feat: add clinic management and financial reporting features
- Implemented ClinicFormPage for adding new clinics with validation. - Created MyFinancialPage to display financial summaries and charts. - Developed MyPatientsPage for managing patient data with search and pagination. - Added PreRegistrationsPage for handling pre-registration requests with approval and rejection functionalities. - Introduced database migration for pre_registrations table. - Built PreRegistrationController for managing pre-registration logic, including submission, approval, and rejection. - Created PreRegistration entity and repository for handling pre-registration data.
This commit is contained in:
@@ -507,3 +507,50 @@ Invalidate the refresh token (stored in Redis).
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## POST `/api/v1/pre-registration`
|
||||
|
||||
Submit a pre-registration request (doctor or clinic). Public endpoint — no auth required.
|
||||
|
||||
**Permission:** Public
|
||||
|
||||
### Request Body
|
||||
```json
|
||||
{
|
||||
"type": "independent_doctor",
|
||||
"name": "دکتر علی احمدی",
|
||||
"mobile": "09121234567",
|
||||
"info": "متخصص داخلی، ۱۰ سال سابقه"
|
||||
}
|
||||
```
|
||||
|
||||
| Field | Type | Required | Notes |
|
||||
|-------|------|----------|-------|
|
||||
| `type` | string | ✅ | `independent_doctor` \| `doctor_with_clinic` \| `clinic_manager` |
|
||||
| `name` | string | ✅ | min 2 chars |
|
||||
| `mobile` | string | ✅ | 10–15 chars |
|
||||
| `info` | string | ❌ | specialty, address, etc. |
|
||||
|
||||
**Type meanings:**
|
||||
|
||||
| Value | Roles granted on approval | Entities created |
|
||||
|-------|--------------------------|-----------------|
|
||||
| `independent_doctor` | `ROLE_DOCTOR` | Doctor |
|
||||
| `doctor_with_clinic` | `ROLE_DOCTOR` + `ROLE_CLINIC` | Doctor + Clinic |
|
||||
| `clinic_manager` | `ROLE_CLINIC` | Clinic |
|
||||
|
||||
### Response `200`
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"data": { "uuid": "...", "status": "pending" }
|
||||
}
|
||||
```
|
||||
|
||||
### Error Codes
|
||||
| Code | HTTP | Meaning |
|
||||
|------|------|---------|
|
||||
| `VALIDATION_ERROR` | 422 | Invalid type / mobile / name |
|
||||
| `DUPLICATE_REQUEST` | 409 | Pending request already exists for this mobile |
|
||||
|
||||
Reference in New Issue
Block a user