# endpoints_documentation = { # "root": { # "path": "/", # "method": "GET", # "description": "API root endpoint", # "parameters": None, # "request_body": None, # "response": {"message": "Clinic Reservation API - Use /docs for documentation"} # }, # "get_reservations": { # "path": "/reservations", # "method": "GET", # "description": "Get all reservations", # "parameters": None, # "request_body": None, # "response": { # "description": "List of all reservations", # "model": "List[Reservation]", # "filters": "Only returns reservations with status 'scheduled'" # } # }, # "get_reservations_by_filters": { # "path": "/reservations/", # "method": "GET", # "description": "Get reservations filtered by patient ID and/or doctor name (only scheduled)", # "parameters": { # "patient_id": { # "type": "str", # "required": False, # "description": "Filter by patient ID" # }, # "doctor_name": { # "type": "str", # "required": False, # "description": "Filter by doctor name (case-insensitive partial match)" # } # }, # "request_body": None, # "response": { # "description": "List of matching scheduled reservations", # "model": "List[Reservation]", # "error": "404 if no scheduled reservations match criteria" # } # }, # "create_reservation": { # "path": "/create-reservation", # "method": "POST", # "description": "Create a new reservation", # "parameters": None, # "request_body": { # "model": "CreateReservation", # "required_fields": { # "patient_id": "str", # "doctor_name": "str", # "date_time": "datetime like this 2023-10-16T19:00:00" # }, # "optional_fields": { # "reason": "str (optional)" # } # }, # "response": { # "description": "Created reservation with status 'scheduled'", # "model": "Reservation", # "error": "404 if doctor not found" # } # }, # "reschedule_reservation": { # "path": "/reservations/reschedule", # "method": "PUT", # "description": "Reschedule an existing reservation", # "parameters": { # "doctor_name": { # "type": "str", # "required": True, # "description": "ID of the reservation to reschedule" # }, # "new_date_time": { # "type": "str", # "required": True, # "description": "New date/time to reschedule to" # } # }, # "response": { # "description": "Updated reservation with new date/time", # "model": "Reservation", # "error": "404 if reservation not found" # } # }, # "cancel_reservation": { # "path": "/reservations/cancel", # "method": "PUT", # "description": "Cancel a reservation", # "parameters": { # "doctor_name": { # "type": "str", # "required": True, # "description": "ID of the reservation to cancel" # } # }, # "request_body": None, # "response": { # "description": "Canceled reservation (status changed to 'canceled')", # "model": "Reservation", # "error": "404 if reservation not found" # } # }, # "get_doctors": { # "path": "/doctors", # "method": "GET", # "description": "Get list of all available doctors", # "parameters": None, # "request_body": None, # "response": { # "description": "List of doctors with their specialties", # "model": "List[dict]", # "example": [ # {"id": 1, "name": "Dr. Smith", "specialty": "General Medicine"} # ] # } # }, # "get_doctor_availability": { # "path": "/doctors/{doctor_id}/availability", # "method": "GET", # "description": "Get doctor's fake availability slots (30-min intervals from 9am-5pm)", # "parameters": { # "doctor_id": { # "type": "int", # "required": True, # "description": "ID of the doctor" # }, # "date": { # "type": "str (YYYY-MM-DD)", # "required": False, # "description": "Date to check availability (default: today)" # } # }, # "request_body": None, # "response": { # "description": "Doctor's availability slots with random availability", # "model": "dict", # "example": { # "doctor_id": 1, # "date": "2023-10-15", # "slots": [ # { # "start": "2023-10-15T09:00:00", # "end": "2023-10-15T09:30:00", # "available": True # } # ] # }, # "error": "404 if doctor not found" # } # }, # "get_patients": { # "path": "/patients", # "method": "GET", # "description": "Get list of all patients", # "parameters": None, # "request_body": None, # "response": { # "description": "List of patients with contact information", # "model": "List[Patient]", # "example": [ # {"id": "uuid-123", "name": "John Doe", "phone": "555-0101", "email": "john@example.com"} # ] # } # }, # "get_patient_reservations": { # "path": "/patients/reservations", # "method": "GET", # "description": "Get my all reservations", # "parameters": { # "patient_id": { # "type": "str", # "required": True, # "description": "ID of the patient" # } # }, # "request_body": None, # "response": { # "description": "List of patient's reservations (all statuses)", # "model": "List[Reservation]", # "note": "Returns empty list if no reservations found (no 404 error)" # } # }, # "get_hospitals": { # "path": "/hospitals", # "method": "GET", # "description": "Get list of all hospitals and thier working hours (start time and end time) and location", # "parameters": None, # } # } endpoints_documentation = { "get_my_reservations": { "path": "/patients/reservations", "method": "GET", "description": "Get my personal reservations/appointments (all statuses)", "parameters": { "patient_id": { "type": "str", "required": True, "description": "ID of the patient" } }, "response": { "description": "List of patient's reservations", "model": "List[Reservation]" }, "use_case": "When user asks: Tell me my reservations, Show my appointments, قولي حجوزاتي" }, "get_all_reservations": { "path": "/reservations", "method": "GET", "description": "Get all reservations in the system (admin view)", "parameters": None, "response": { "description": "List of all scheduled reservations", "model": "List[Reservation]" }, "use_case": "When admin asks: Show all reservations, Get all appointments" }, "create_reservation": { "path": "/create-reservation", "method": "POST", "description": "Book a new appointment/reservation", "request_body": { "required_fields": { "patient_id": "str", "doctor_name": "str", "date_time": "datetime (2023-10-16T19:00:00)" }, "optional_fields": { "reason": "str" } }, "response": { "description": "Created reservation", "model": "Reservation" }, "use_case": "When user asks: Book appointment, Schedule meeting, احجز موعد, I want to book with Dr. Smith" }, "reschedule_reservation": { "path": "/reservations/reschedule", "method": "PUT", "description": "Change appointment date/time", "parameters": { "doctor_name": { "type": "str", "required": True, "description": "Doctor name for the reservation" }, "patient_id": { "type": "str", "required": True, "description": "ID of the patient who wants to reschedule" } }, "body": { "new_date_time": { "type": "str", "required": True, "description": "New date/time to reschedule to (format: YYYY-MM-DDTHH:MM:SS)" } }, "response": { "description": "Updated reservation", "model": "Reservation" }, "use_case": "When user asks: Reschedule appointment, Change my appointment time, غير موعدي" }, "cancel_reservation": { "path": "/reservations/cancel", "method": "PUT", "description": "Cancel an existing appointment", "parameters": { "doctor_name": { "type": "str", "required": True, "description": "Doctor name for the reservation to cancel" }, "patient_id": { "type": "str", "required": True, "description": "ID of the patient who wants to cancel" } }, "response": { "description": "Canceled reservation", "model": "Reservation" }, "use_case": "When user asks: Cancel appointment, Cancel my booking, الغي موعدي" }, "get_doctors": { "path": "/doctors", "method": "GET", "description": "Get list of available doctors and their specialties and Get doctors by department", "parameters": None, "response": { "description": "List of doctors", "model": "List[Doctor]" }, "use_case": "When user asks: Show doctors, List available doctors, اظهر الاطباء" }, "get_doctor_details": { "path": "/doctor-details", "method": "GET", "description": "Retrieves comprehensive information about doctor including their weekly schedule, working hours, and available appointment slots for today. The endpoint provides both the doctor's general availability (working hours for each day of the week) and specific available time slots for the current day (after accounting for existing appointments).", "parameters": { "doctor_name": { "type": "str", "required": True, "description": "Name of the doctor to get details for" } }, }, "get_patients": { "path": "/patients", "method": "GET", "description": "Get list of all patients (admin only)", "parameters": None, "response": { "description": "List of patients", "model": "List[Patient]" }, "use_case": "When admin asks: Show all patients, List patients" }, "get_hospitals": { "path": "/hospitals", "method": "GET", "description": "Get list of hospitals with locations and working hours", "parameters": None, "response": { "description": "List of hospitals", "model": "List[Hospital]" }, "use_case": "When user asks: Show hospitals, Where are the clinics, اظهر المستشفيات" } }