Skip to content

feat: complete user crud, harden prisma error handling, and fix build output path#7

Merged
kenneth-loto merged 2 commits into
developfrom
feat/user-crud-completion-and-operational-fixes
Jun 30, 2026
Merged

feat: complete user crud, harden prisma error handling, and fix build output path#7
kenneth-loto merged 2 commits into
developfrom
feat/user-crud-completion-and-operational-fixes

Conversation

@kenneth-loto

Copy link
Copy Markdown
Owner

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

  • Added CreateUserDto with email, name, and role fields and UpdateUserDto as a PartialType of it
  • Added create, update, and delete methods to UserService
  • Added POST /user, PATCH /user/:id, and DELETE /user/:id to UserController, all restricted to admin with role selection available on creation
  • Added 14 new tests across user.service and user.controller test suites covering the new create, update, and delete behavior
  • Added app.enableShutdownHooks() in main.ts for clean SIGTERM and SIGINT handling on process termination
  • Improved Prisma error messages in AllExceptionsFilter: P2002 now surfaces the conflicting target fields, P2025 surfaces the cause, and P2003 surfaces the foreign key field
  • Added an onPoolError callback to PrismaService that logs pool-level connection errors instead of letting them crash the process
  • Updated the e2e test to match the current root route's welcome JSON response
  • Fixed README task status values, the Arcjet link, and the Swagger URL reference from /api to /docs
  • Added rootDir: ./src to tsconfig.build.json so the production build emits dist/main.js instead of dist/src/main.js, fixing start:prod

Why

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 rootDir fix was a blocking bug — start:prod was pointing at a path that didn't exist without it.

kenneth-loto and others added 2 commits June 30, 2026 22:26
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
@github-actions github-actions Bot changed the base branch from main to develop June 30, 2026 15:48
@github-actions

Copy link
Copy Markdown

Base branch auto-updated: This PR has been redirected from main to develop. Please ensure feature, fix, or chore branches are integrated into develop before production releases.

@github-actions

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@kenneth-loto kenneth-loto merged commit baf08d1 into develop Jun 30, 2026
9 checks passed
@kenneth-loto kenneth-loto deleted the feat/user-crud-completion-and-operational-fixes branch June 30, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant