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:
@@ -677,3 +677,48 @@ List all SMS templates.
|
||||
| `POST /api/v1/admin/clinic/invitation/{invUuid}/resend` | Resend SMS |
|
||||
| `PATCH /api/v1/admin/clinic/invitation/{invUuid}/status` | Change status |
|
||||
| `DELETE /api/v1/admin/clinic/invitation/{invUuid}` | Delete |
|
||||
|
||||
---
|
||||
|
||||
## Settings
|
||||
|
||||
### GET /api/v1/admin/settings
|
||||
|
||||
Returns all site configuration values.
|
||||
|
||||
**Response `200`**
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"data": {
|
||||
"commission_enabled": "0",
|
||||
"commission_percent": "0",
|
||||
"site_name": "ClinicPro",
|
||||
"support_phone": "",
|
||||
"max_cancel_hours_before": "24",
|
||||
"appointment_reminder_hours": "2"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
All values are strings. Missing keys return their default values.
|
||||
|
||||
### PATCH /api/v1/admin/settings
|
||||
|
||||
Update one or more settings. Unknown keys are silently ignored.
|
||||
|
||||
**Request body** (partial update — send only keys to change):
|
||||
```json
|
||||
{
|
||||
"commission_enabled": "1",
|
||||
"commission_percent": "5",
|
||||
"site_name": "کلینیکپرو"
|
||||
}
|
||||
```
|
||||
|
||||
**Response `200`** — same shape as GET, returns all settings after save.
|
||||
|
||||
**Commission rules:**
|
||||
- `commission_enabled` — `"1"` = active, `"0"` = inactive
|
||||
- `commission_percent` — integer string, `0`–`100`
|
||||
- Commission applies only to regular users (`booked_by = user`); secretaries are exempt
|
||||
|
||||
Reference in New Issue
Block a user