Skip to content

feat: Introduce user management services for create, read, and update… - #50

Merged
JahnaviVeera merged 1 commit into
spotmies:masterfrom
JahnaviVeera:master
Mar 13, 2026
Merged

JahnaviVeera merged 1 commit into
spotmies:masterfrom
JahnaviVeera:master

Conversation

@JahnaviVeera

Copy link
Copy Markdown
Collaborator

… operations, including password hashing and automatic project provisioning, and remove various utility scripts.

… operations, including password hashing and automatic project provisioning, and remove various utility scripts.
@JahnaviVeera
JahnaviVeera merged commit e8dbb95 into spotmies:master Mar 13, 2026
1 check passed
@github-actions

Copy link
Copy Markdown

🤖 AI Code Review

🤖 AI Code Review

📌 Summary

  • The diff primarily involves the deletion of several database utility scripts and modifications to the user.services.ts file.
  • The deletions appear to be part of a cleanup effort, likely to remove unused or redundant scripts.
  • The changes in user.services.ts introduce new logic for handling user status transitions and improve the getClosedCustomersList function.
  • No high-risk issues were identified, but there are areas for improvement in maintainability and potential edge case handling.

💬 Inline Comments (File-wise)

src/modules/user/user.services.ts

  • Line 236: The formatDate function is defined inline within the updateUser function. This could lead to duplication if similar formatting is needed elsewhere.

    • ✅ Suggestion: Extract formatDate into a utility function to improve reusability and maintainability.
  • Line 238: The default project type is hardcoded as 'villa'. This may not be flexible for future changes or other project types.

    • ✅ Suggestion: Consider making the default project type configurable via an environment variable or a constant.
  • Line 239: The fallback location is set to "To be specified". This could lead to inconsistent data if not updated later.

    • ✅ Suggestion: Add a validation step to ensure the location is updated before the project is finalized.
  • Line 263: Clearing dataToUpdate.notes when converting a lead to a customer might inadvertently remove important information.

    • ✅ Suggestion: Confirm with stakeholders if this behavior is intentional. If so, consider logging or archiving the notes before clearing them.
  • Line 526: The getClosedCustomersList function assumes that user.projects[0] is the latest project. This may not always be true if the projects array is not sorted.

    • ✅ Suggestion: Explicitly sort the projects array by createdAt or updatedAt to ensure the latest project is used.
  • Line 531: The fallback for projectName is "No Project Assigned". This could be misleading if the user has projects but they are not fetched correctly.

    • ✅ Suggestion: Add a log or warning to indicate when no project is assigned or fetched.

⚠️ High-Risk Issues

No high-risk issues found.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant