generated from ctc-uci/npo-template-merged
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Milestone
Description
Description
The task is to create CRUD (Create, Read, Update, Delete) API routes for the Area of Interest table and implement endpoints for managing the many-to-many relationships through the relevant join tables.
Area of Interest table
POST /areas-of-interest- create an area of interestGET /areas-of-interest- get all areas of interestGET /areas-of-interest/{id}- get a single area of interestPUT /areas-of-interest/{id}- update a single area of interestDELETE /areas-of-interest/{id}- delete a single area of interest
Clinic-AreaOfInterest relationship
POST /clinics/{clinicId}/areas-of-interest- assign an area to a clinicDELETE /clinics/{clinicId}/areas-of-interest/{areaId}- remove an area from a clinicGET /clinics/{clinicId}/areas-of-interest- list all areas for a clinic
Workshop-AreaOfInterest relationship
POST /workshops/{workshopId}/areas-of-interest- assign an area to a workshopDELETE /workshops/{workshopId}/areas-of-interest/{areaId}- remove an area from a workshopGET /workshops/{workshopId}/areas-of-interest- list all areas for a workshop
Case-AreaOfInterest relationship
POST /cases/{caseId}/areas-of-interest- assign an area to a caseDELETE /cases/{caseId}/areas-of-interest/{areaId}- remove an area from a caseGET /cases/{caseId}/areas-of-interest- list all areas for a case
Recommended Steps
- Git pull to fetch current changes and create a new branch.
- Review the Area of Interest table schema and all relevant join tables.
- Create
areasOfInterest.jsfile in/server/routes. - Create
workshops.jsandcase.jsfiles in/server/routesfor the intermediary table routes - Implement CRUD routes for the Area of Interest table.
- Implement nested routes for managing Area of Interest relationships with Clinic, Workshop, and Case.
- Add validation and error handling for all routes.
- Test all routes using Postman and take screenshots as proof of functionality.
Acceptance Criteria
- GET routes return all areas of interest or a single record by ID.
- POST route creates a new area of interest.
- PUT route updates an existing area of interest.
- DELETE route removes an area of interest.
- POST/DELETE/GET routes manage Clinic-AreaOfInterest, Workshop-AreaOfInterest, and Case-AreaOfInterest relationships correctly.
- Error handling is implemented for all routes.
Resources
- See
users.tsor similar route files for structure reference. - Postman for testing requests.
If you have any questions, feel free to reach out to Josh or Dommenick on Slack!
Metadata
Metadata
Assignees
Labels
No labels