Skip to content

Sneha/feature/user project roles api#59

Open
snehagopalappa wants to merge 4 commits into
masterfrom
sneha/feature/user-project-roles-api
Open

Sneha/feature/user project roles api#59
snehagopalappa wants to merge 4 commits into
masterfrom
sneha/feature/user-project-roles-api

Conversation

@snehagopalappa
Copy link
Copy Markdown
Collaborator

Summary:

Implements the User Project Role API module with full CRUD endpoints, role-based access control, validation, and tests.

Changes

New module src/modules/user-project-roles/

  • userProjectRole.service.ts — business logic with full validation, 404/409 guards and Prisma error handling
  • userProjectRole.controller.ts — thin request/response layer delegating to service
  • userProjectRole.routes.ts — 3 endpoints with full Swagger documentation and role-based access control
  • index.ts — exports the router

src/routes/index.ts

  • Registered new routes under /user-project-roles

tests/unit/userProjectRole.test.ts
-12 unit tests covering all service methods including success cases, 400/404/409 error cases and database error handling

tests/integration/userProjectRole.test.ts

  • 22 integration tests covering all 3 endpoints with full RBAC, validation and error case coverage

Endpoints

  • GET /user-project-roles — ADMIN and MANAGER only
  • POST /user-project-roles — ADMIN only
  • DELETE /user-project-roles/:user_id/:project_id/:role_id — ADMIN only

Test Results

  • 12 unit tests — all passing
  • 22 integration tests — all passing
  • Type-check and lint passing with zero errors

Notes

image image

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