placecare / backend

0 stars 0 forks source link

Implementation of CRUD for Professional Model in API REST #5

Open NathaelB opened 17 hours ago

NathaelB commented 17 hours ago

We need to implement a CRUD (Create, Read, Update, Delete) system for the Professional model in our API REST. The Professional modal should support listing all professionals, with an optional filter by companyId, and providing the ability to retrieve, create, update and delete indivual professionals. This impelment must follow RESTFul conventions.

Acceptance Criteria:

NathaelB commented 17 hours ago

Response Contract for /v1/professionals

The response for the route /v1/professionals is designed to return a paginated list of professionals, along with metadata to facilitate navigation across multiple pages of results.

{
 "meta": {
   "total": 2,
   "perPage": 10,
   "currentPage": 1,
   "lastPage": 1,
   "firstPage": 1,
   "firstPageUrl": "/?page=1",
   "lastPageUrl": "/?page=1",
   "nextPageUrl": null,
   "previousPageUrl": null
 },
 "data": []
}

Description

This structure ensures that clients have enough information to handle pagination effectively, making it easier to manage large datasets and providing a consistent way to navigate through records.

NathaelB commented 2 hours ago

To create a Professional, you need to use the Keycloak service to register it in our authentication system, obtain its id and insert the result in the oidcId column.