added password hashing and validation to createUser + fix service bugs#54
Conversation
…d validation and hashing to createUser
AKV2703
left a comment
There was a problem hiding this comment.
Approving this for now due to time constraints. The overall structure and implementation are solid, and the password hashing/validation improvements are a good addition. One important concern is the Prisma configuration change introducing previewFeatures = ["prismaSchemaFolder"], since this affects the global Prisma client generation setup and should only remain if the project is intentionally moving toward split Prisma schema management. A few other areas should also be documented for future hardening work, including consistent email normalization during duplicate checks, handling password updates safely within updateUser(), and reviewing whether deleteUser() should validate additional relational dependencies beyond treeScan references. These are not blockers for now, but they should be tracked and revisited later.
Summary:
Improved the POST /users endpoint by adding password hashing and validation to createUser, and fixed several bugs identified during review.
Changes:
Added prismaSchemaFolder so Prisma correctly picks up all model files from prisma/models/
Test Results
17 unit tests - all passing
32 integration tests - all passing
(GET /users - 7 tests
GET /users/:id - 6 tests
POST /users - 8 tests
PUT /users/:id - 5 tests
DELETE /users/:id - 6 tests )
Notes
updateUser password hashing is a known gap - flagged for follow-up PR
Unit test:

Integration test:
