Real-Dev-Squad / website-backend

The backend code for all our website-related apps
https://api.realdevsquad.com/
MIT License
55 stars 258 forks source link

Standardize User Identification Field in Logs Collection for Consistent Querying #2246

Open vinit717 opened 2 weeks ago

vinit717 commented 2 weeks ago

Issue Description

Currently, the logs collection includes two different fields, createdBy and userId, for user identification within the meta field. This inconsistency complicates queries for logs associated with specific users, as it requires checking both fields. We need to standardize the field name to userId across all log entries.

Expected Behavior

All entries in the logs collection should use a consistent field, userId, for user identification within the meta field. This will allow for uniform querying of logs by userId without having to handle cases where createdBy is used instead.

Current Behavior

Some documents in the logs collection use meta.createdBy while others use meta.userId. This inconsistency makes it more complex to fetch logs for a user, as queries need to account for both fields.

Screenshots

Reproducibility

Severity/Priority

Additional Information

Checklist