feat: complete user crud, harden prisma error handling, and fix build output path#7
Merged
kenneth-loto merged 2 commits intoJun 30, 2026
Conversation
Merges the complete ProjectModule, TaskModule with member and admin scoped access and the shared canAccessTask helper, CommentModule with author and task-access scoping, full Swagger documentation with Bearer auth security scheme, the bearer() Better Auth plugin, AllExceptionsFilter with Prisma error type guarding, the Prisma barrel file, reformatted imports, and the 74-test suite from develop into main, completing the TaskForge API core feature set on the stable branch.
… output path - create CreateUserDto with email, name, and role fields, and UpdateUserDto using PartialType - add create, update, and delete methods to UserService - add POST /user, PATCH /user/:id, and DELETE /user/:id endpoints to UserController, all admin-only with role selection on create - add 14 tests across user.service and user.controller suites covering create, update, and delete - add app.enableShutdownHooks() in main.ts for clean sigterm and sigint handling - improve prisma error messages in AllExceptionsFilter showing target fields for P2002, cause for P2025, and fk field for P2003 - add onPoolError callback in PrismaService logging pool-level errors instead of crashing the process - update e2e test to match current root route welcome json response - fix readme task status values, arcjet link, and swagger url from /api to /docs - add rootDir ./src to tsconfig.build.json so dist/main.js generates correctly instead of dist/src/main.js fixing start:prod
|
Base branch auto-updated: This PR has been redirected from |
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Completes the User module CRUD surface with create, update, and delete endpoints, improves Prisma error message clarity, adds graceful shutdown handling, and fixes a production build path bug.
What's Changed
CreateUserDtowithemail,name, androlefields andUpdateUserDtoas aPartialTypeof itcreate,update, anddeletemethods toUserServicePOST /user,PATCH /user/:id, andDELETE /user/:idtoUserController, all restricted to admin with role selection available on creationuser.serviceanduser.controllertest suites covering the new create, update, and delete behaviorapp.enableShutdownHooks()inmain.tsfor clean SIGTERM and SIGINT handling on process terminationAllExceptionsFilter:P2002now surfaces the conflicting target fields,P2025surfaces the cause, andP2003surfaces the foreign key fieldonPoolErrorcallback toPrismaServicethat logs pool-level connection errors instead of letting them crash the process/apito/docsrootDir: ./srctotsconfig.build.jsonso the production build emitsdist/main.jsinstead ofdist/src/main.js, fixingstart:prodWhy
The User module needed write operations to match Project, Task, and Comment. More specific Prisma error messages make debugging constraint violations significantly faster for API consumers and developers alike. Graceful shutdown hooks ensure in-flight requests and database connections close cleanly rather than being abruptly terminated. The
rootDirfix was a blocking bug —start:prodwas pointing at a path that didn't exist without it.