This Django-based API manages appointments for patients and counsellors. It provides functionality for creating, updating, fetching, and deleting appointments.
- Clone the repository.
- Install the required dependencies using
pip install -r requirements.txt. - Run migrations:
python manage.py migrate. - Start the development server:
python manage.py runserver. - Access the API using the provided endpoints.
- URL:
/appointments/ - Method:
GET - Description: Retrieve a list of all active appointments.
- URL:
/appointments/delete/<int:appointment_id>/ - Method:
DELETE - Description: Soft-delete an appointment by marking it as inactive.
- URL:
/appointments/create/ - Method:
POST - Description: Create a new appointment.
- URL:
/appointments/update/<int:appointment_id>/ - Method:
PUTorPATCH - Description: Update an existing appointment.
- URL:
/appointments/fetch/?patient_id=<int:patient_id>&counsellor_id=<int:counsellor_id>&appointment_date=<str:date> - Method:
GET - Description: Fetch an appointment based on patient, counsellor, and appointment date.
- URL:
/appointments/for-patient/<int:patient_id>/ - Method:
GET - Description: Fetch all appointments for a specific patient.
- URL:
/appointments/for-counsellor/<int:counsellor_id>/ - Method:
GET - Description: Fetch all appointments for a specific counsellor.
- URL:
/appointments/active/?start_date=<int:startdate>&end_date=<int:end_date> - Method:
GET - Description: Fetch all active appointments within a specified date range.
- URL:
/appointments/fetch-id/<int:appointment_id>/ - Method:
GET - Description: Fetch a specific appointment by its ID.
- URL:
/patients/ - Method:
GET - Description: Retrieve a list of all active patients.
- URL:
/patients/create/ - Method:
POST - Description: Create a new patient.
- URL:
/patients/update/<int:patient_id>/ - Method:
PUT - Description: Update an existing patient.
- URL:
/patients/delete/<int:patient_id>/ - Method:
DELETE - Description: Soft-delete a patient by marking it as inactive.
- URL:
/patients/fetch-id/<int:patient_id>/ - Method:
GET - Description: Fetch a specific patient by its ID.
- URL:
/patients/fetch-email/<str:patient_email>/ - Method:
GET - Description: Fetch a specific patient by email.
- URL:
/counsellors/ - Method:
GET - Description: Retrieve a list of all active counsellors.
- URL:
/counsellors/delete/<int:counsellor_id> - Method:
DELETE - Description: Soft-delete a counsellor by marking it as inactive.
- URL:
/counsellors/create/ - Method:
POST - Description: Create a new counsellor.
- URL:
/counsellors/update/<int:counsellor_id>/ - Method:
PUT - Description: Update an existing counsellor.
- URL:
/counsellors/fetch-email/<str:counsellor_email>/ - Method:
GET - Description: Fetch a specific counsellor by email.