NOT IMPLEMENTED: The CitaController is empty in the source code. These endpoints are architectural documentation only and will return 404 errors if called. Only the Especialidad endpoints are currently functional.
The Citas (Appointments) resource is architecturally designed to provide CRUD operations for managing medical appointments. The data model is defined with status tracking (Pending, Confirmed, Cancelled, Completed), but the controller endpoints are not yet implemented.
Response: 200 OKReturns the appointment object (same structure as above).Response: 404 Not FoundReturned when the appointment with the specified ID doesn’t exist.Example Request:
curl -X GET "https://localhost:5001/api/Cita/1" \ -H "Content-Type: application/json"
Example Response:
{ "id": 1, "pacienteId": 1, "medicoId": 1, "costo": 150.00, "motivo": "Consulta de control cardiológico", "fechaInicio": "2026-03-15T09:00:00", "fechaFin": "2026-03-15T09:30:00", "observaciones": "Paciente reporta dolor en el pecho ocasional", "estado": "Confirmada"}
Response: 201 CreatedReturns the created appointment object with the assigned ID. The appointment status is automatically set to Pendiente (Pending).Response: 400 Bad RequestReturned when validation fails (e.g., invalid date format, negative cost, missing required fields).Response: 404 Not FoundReturned when the referenced patient or doctor doesn’t exist.Example Request:
curl -X POST "https://localhost:5001/api/Cita" \ -H "Content-Type: application/json" \ -d '{ "pacienteId": 1, "medicoId": 1, "costo": 150.00, "motivo": "Consulta de control cardiológico", "fechaInicio": "2026-03-15T09:00:00", "fechaFin": "2026-03-15T09:30:00", "observaciones": "Primera consulta del año" }'
Example Response:
{ "id": 3, "pacienteId": 1, "medicoId": 1, "costo": 150.00, "motivo": "Consulta de control cardiológico", "fechaInicio": "2026-03-15T09:00:00", "fechaFin": "2026-03-15T09:30:00", "observaciones": "Primera consulta del año", "estado": "Pendiente"}
Response: 200 OKReturns the updated appointment object.Response: 404 Not FoundReturned when the appointment with the specified ID doesn’t exist, or when the referenced patient/doctor doesn’t exist.Response: 400 Bad RequestReturned when validation fails.Example Request:
curl -X PUT "https://localhost:5001/api/Cita/3" \ -H "Content-Type: application/json" \ -d '{ "pacienteId": 1, "medicoId": 1, "costo": 175.00, "motivo": "Consulta de control cardiológico - Seguimiento", "fechaInicio": "2026-03-15T10:00:00", "fechaFin": "2026-03-15T10:30:00", "observaciones": "Horario reprogramado a solicitud del paciente" }'
Example Response:
{ "id": 3, "pacienteId": 1, "medicoId": 1, "costo": 175.00, "motivo": "Consulta de control cardiológico - Seguimiento", "fechaInicio": "2026-03-15T10:00:00", "fechaFin": "2026-03-15T10:30:00", "observaciones": "Horario reprogramado a solicitud del paciente", "estado": "Pendiente"}
The unique identifier of the appointment to delete
Response: 204 No ContentReturned when the appointment is successfully deleted.Response: 404 Not FoundReturned when the appointment with the specified ID doesn’t exist.
Consider implementing soft deletion or status updates instead of hard deletion to maintain appointment history and audit trails.
The Cita entity is defined in Models/Entities/Cita.cs:
public class Cita{ public int Id { get; set; } public int PacienteId { get; set; } public int MedicoId { get; set; } public decimal Costo { get; set; } public required string Motivo { get; set; } public DateTime FechaInicio { get; set; } public DateTime FechaFin { get; set; } public string? Observaciones { get; set; } public CitaEstado Estado { get; set; }}