ποΈ Issue: User β Implement repository properly (align with modular architecture)
Description
The user module needs a clean repository implementation with Prisma, exposing the operations required by its use-cases, and decoupling controllers/services from direct ORM calls.
What is expected
- A Prisma-backed repository (e.g.,
user-prisma.repository.ts) implementing the repository interface.
- Controllers/services interact with the repository interface only.
- Prisma/infra errors mapped to domain exceptions (
Conflict, NotFound, Validation, etc.).
- Comprehensive tests.
What should be modified
- Define/complete repository interface and Prisma implementation under
src/modules/user/repositories/.
- Remove direct Prisma calls from presentation/application layers.
- Ensure DI/factories wire the repository correctly.
Tests
- Unit tests for repository methods (
findById, findByEmail, create, update, delete, etc.).
- Integration tests through controllers.
Acceptance criteria
Rollback plan
- Keep a pre-refactor tag/branch.
- Revert and re-apply in smaller steps if needed.
ποΈ Issue: User β Implement repository properly (align with modular architecture)
Description
The user module needs a clean repository implementation with Prisma, exposing the operations required by its use-cases, and decoupling controllers/services from direct ORM calls.
What is expected
user-prisma.repository.ts) implementing the repository interface.Conflict,NotFound,Validation, etc.).What should be modified
src/modules/user/repositories/.Tests
findById,findByEmail,create,update,delete, etc.).Acceptance criteria
Rollback plan