feat(api): add dashboard endpoints for clinic, doctor, and secretary roles
- Implemented GET /api/v1/dashboard/clinic to return clinic stats and today's schedule for clinic owners. - Implemented GET /api/v1/dashboard/doctor to return doctor's stats and today's schedule for doctors. - Implemented GET /api/v1/dashboard/secretary to return stats and conditional appointments for secretaries. feat(migrations): create user_active_context and mobile_verification_otp tables - Added migration to create user_active_context table for tracking active user sessions. - Added migration to create mobile_verification_otp table for handling mobile number verification. feat(migrations): create site_config table for application settings - Added migration to create site_config table to store various site configuration settings. feat(appointments): create MyAppointmentsController for user-specific appointments - Added MyAppointmentsController to handle fetching user-specific appointments with pagination and filtering. feat(auth): implement NotificationMobileController for mobile number verification - Added NotificationMobileController to handle OTP requests and verification for mobile number changes. feat(auth): create MobileVerificationOtp entity for OTP management - Created MobileVerificationOtp entity to manage OTP records for mobile verification. feat(auth): create UserActiveContext entity for user session management - Created UserActiveContext entity to manage user active sessions. feat(config): implement SiteConfigController for managing site settings - Added SiteConfigController to handle fetching and updating site configuration settings. feat(config): create SiteConfig entity and repository for configuration management - Created SiteConfig entity and repository to manage site configuration data.
This commit is contained in:
@@ -275,3 +275,54 @@ Updated appointment object.
|
||||
| `ERR_NOT_FOUND_001` | 404 | Appointment not found |
|
||||
| `ERR_CONFLICT_001` | 409 | Version mismatch (optimistic lock) |
|
||||
| `ERR_VALIDATION_001` | 422 | Invalid status value |
|
||||
|
||||
---
|
||||
|
||||
## GET /api/v1/my/appointments
|
||||
|
||||
Role-aware paginated list of appointments. Returns only what the authenticated user is authorized to see.
|
||||
|
||||
**Auth:** `IS_AUTHENTICATED_FULLY` (any role)
|
||||
|
||||
**Role behavior:**
|
||||
| Role | Scope |
|
||||
|------|-------|
|
||||
| `ROLE_ADMIN` | All appointments |
|
||||
| `ROLE_CLINIC` | Appointments for doctors in this clinic |
|
||||
| `ROLE_DOCTOR` | Appointments for this doctor |
|
||||
| `ROLE_SECRETARY` | Appointments for the linked doctor (empty if `appointments.view` permission is false) |
|
||||
|
||||
### Query Parameters
|
||||
| Param | Type | Default | Description |
|
||||
|-------|------|---------|-------------|
|
||||
| `page` | int | 1 | Page number |
|
||||
| `limit` | int | 15 | Items per page (max 100) |
|
||||
| `search` | string | — | Search by mobile, real name, or doctor name |
|
||||
| `status` | string | — | Filter by appointment status |
|
||||
| `date` | string | — | Filter by date in `Y-m-d` format |
|
||||
|
||||
### Response `200`
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"data": [
|
||||
{
|
||||
"uuid": "string",
|
||||
"patient_name": "string",
|
||||
"patient_mobile": "string",
|
||||
"doctor_name": "string",
|
||||
"clinic_name": "string | null",
|
||||
"appointment_date": "2026-07-25",
|
||||
"appointment_time": "14:30",
|
||||
"slot_start": 1700000000,
|
||||
"status": "reserved",
|
||||
"amount": 0,
|
||||
"created_at": "ISO 8601 string"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"totalRecords": 8000,
|
||||
"totalPages": 533,
|
||||
"currentPage": 1
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user