[Client] Implementation (Router) #175

Closed
opened 2025-12-12 17:31:34 +00:00 by GFMpt13 · 1 comment
GFMpt13 commented 2025-12-12 17:31:34 +00:00 (Migrated from github.com)

Create src/routers/clients.py.

  • POST /: Create a new client. Handle duplicates.
  • GET /{id}: Retrieve a client by ObjectId.
  • GET /: List clients OR Find by Filter.
  • Logic: Check query params.
  • If ?nif={val} is present -> Call repo.get_by_nif(val).
  • If ?email={val} is present -> Call repo.get_by_email(val).
  • Else -> Call repo.get_all_clients().
  • PATCH /{id}: Update client details using ClientUpdate schema.
  • DELETE /{id}: Delete a client.
Create src/routers/clients.py. - [x] POST /: Create a new client. Handle duplicates. - [x] GET /{id}: Retrieve a client by ObjectId. - [x] GET /: List clients OR Find by Filter. - Logic: Check query params. - If ?nif={val} is present -> Call repo.get_by_nif(val). - If ?email={val} is present -> Call repo.get_by_email(val). - Else -> Call repo.get_all_clients(). - [x] PATCH /{id}: Update client details using ClientUpdate schema. - [x] DELETE /{id}: Delete a client.
duarteneves5 commented 2026-01-19 15:18:30 +00:00 (Migrated from github.com)

I am currently developing the tests for the route

I am currently developing the tests for the route
Sign in to join this conversation.
No description provided.