✅ FULLY IMPLEMENTED: This is the only resource with functional endpoints in this preliminary prototype. All CRUD operations work as documented below.
The Especialidades (Specialties) endpoints provide full CRUD operations for managing medical specialties in the system. Specialties are used to categorize doctors by their area of medical expertise.
Especialidades serve as a foundational resource. In the planned full implementation, doctors will be assigned to specialties, so specialties should be created before creating doctor records.
Name of the medical specialty (3-100 characters, letters and spaces only)
Response: 201 CreatedReturns the created specialty object with the assigned ID and a Location header pointing to the new resource.Response: 400 Bad RequestReturned when validation fails.Response: 409 ConflictReturned when a specialty with the same name already exists.Example Request:
Name of the medical specialty (3-100 characters, letters and spaces only)
Response: 200 OKReturns the updated specialty object.Response: 404 Not FoundReturned when the specialty with the specified ID doesn’t exist.Response: 400 Bad RequestReturned when validation fails.Response: 409 ConflictReturned when the updated name conflicts with another existing specialty.Example Request:
Response: 204 No ContentReturned when the specialty is successfully deleted.Response: 404 Not FoundReturned when the specialty with the specified ID doesn’t exist.
Deleting a specialty that is assigned to existing doctors may cause referential integrity issues. Ensure no doctors are assigned to the specialty before deletion, or implement cascade deletion/reassignment logic.