feat: port secretaries tab from tauri to admin my-secretaries page
- Redesign MySecretariesPage pixel-perfect to clinic-pro-tauri (active/previous tabs, desktop table, mobile cards, add/edit/view modal with permission accordions, deactivate confirm) - Permission sections based on existing admin pages (appointments, patients, payments, insurances, addresses, clinic_info) - Extend DoctorSecretary with national_code + address columns (+migration); wire create/update in SecretaryController; add patients/payments to DEFAULT_PERMISSIONS - Extend Secretary/SecretaryPermissions types; update admin SecretariesPage - Backend + frontend tests; update docs/api/secretary.md Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+58
-18
@@ -31,6 +31,9 @@ Create a secretary for a doctor.
|
||||
{
|
||||
"doctor_uuid": "550e8400-...",
|
||||
"mobile_number": "09123456789",
|
||||
"name": "سارا احمدی",
|
||||
"national_code": "1234567890",
|
||||
"address": "یزد، خیابان تست",
|
||||
"password": "secretaryPass123",
|
||||
"permissions": {
|
||||
"version": 1,
|
||||
@@ -41,19 +44,31 @@ Create a secretary for a doctor.
|
||||
"cancel": false,
|
||||
"update_status": true
|
||||
},
|
||||
"patients": {
|
||||
"view": true,
|
||||
"create": false,
|
||||
"update": false,
|
||||
"delete": false
|
||||
},
|
||||
"payments": {
|
||||
"view": true,
|
||||
"create": false,
|
||||
"update": false,
|
||||
"delete": false
|
||||
},
|
||||
"insurances": {
|
||||
"view": true,
|
||||
"create": false,
|
||||
"update": false,
|
||||
"delete": false
|
||||
},
|
||||
"addresses": {
|
||||
"view": true,
|
||||
"create": false,
|
||||
"update": false,
|
||||
"delete": false
|
||||
},
|
||||
"clinic_info": { "view": true, "update": false },
|
||||
"insurances": {
|
||||
"view": true,
|
||||
"create": false,
|
||||
"update": false,
|
||||
"delete": false
|
||||
}
|
||||
"clinic_info": { "view": true, "update": false }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -63,11 +78,16 @@ Create a secretary for a doctor.
|
||||
| --------------- | ------------- | -------- | -------------------------------------------- |
|
||||
| `doctor_uuid` | string (UUID) | ✅ | Doctor to assign secretary to |
|
||||
| `mobile_number` | string | ✅ | Secretary's login mobile |
|
||||
| `name` | string | ❌ | Full name (نام + نام خانوادگی) → `user_name` |
|
||||
| `national_code` | string | ❌ | کد ملی منشی (nullable) |
|
||||
| `address` | string | ❌ | آدرس منشی (nullable) |
|
||||
| `password` | string | ❌ | Initial password (auto-generated if omitted) |
|
||||
| `permissions` | object | ❌ | Permission set (see structure below) |
|
||||
|
||||
**Permissions Structure:**
|
||||
|
||||
مجموعهٔ منابع (resources) بر اساس صفحات موجود پنل ادمین است. `mergePermissions` هر منبع/اکشن ارسالشده را deep-merge میکند؛ فقط `appointments` در بکاند enforce میشود (`MyAppointmentsController`, `DashboardController`)، بقیه UI/ذخیرهای هستند.
|
||||
|
||||
```json
|
||||
{
|
||||
"version": 1,
|
||||
@@ -78,6 +98,24 @@ Create a secretary for a doctor.
|
||||
"cancel": false, // Can cancel appointments
|
||||
"update_status": true // Can mark as completed/no_show
|
||||
},
|
||||
"patients": {
|
||||
"view": true,
|
||||
"create": false,
|
||||
"update": false,
|
||||
"delete": false
|
||||
},
|
||||
"payments": {
|
||||
"view": true,
|
||||
"create": false,
|
||||
"update": false,
|
||||
"delete": false
|
||||
},
|
||||
"insurances": {
|
||||
"view": true,
|
||||
"create": false,
|
||||
"update": false,
|
||||
"delete": false
|
||||
},
|
||||
"addresses": {
|
||||
"view": true,
|
||||
"create": false,
|
||||
@@ -87,12 +125,6 @@ Create a secretary for a doctor.
|
||||
"clinic_info": {
|
||||
"view": true,
|
||||
"update": false
|
||||
},
|
||||
"insurances": {
|
||||
"view": true,
|
||||
"create": false,
|
||||
"update": false,
|
||||
"delete": false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -112,6 +144,8 @@ Create a secretary for a doctor.
|
||||
"owner_type": "doctor",
|
||||
"clinic_uuid": null,
|
||||
"is_active": true,
|
||||
"national_code": "1234567890",
|
||||
"address": "یزد، خیابان تست",
|
||||
"permissions": { ... },
|
||||
"created_at": 1717000000
|
||||
}
|
||||
@@ -178,7 +212,7 @@ Get secretary detail.
|
||||
|
||||
## PATCH `/api/v1/secretary/{uuid}`
|
||||
|
||||
Update secretary active status or permissions.
|
||||
Update secretary active status, profile fields (name/national_code/address), or permissions. تمام فیلدها اختیاریاند و فقط موارد ارسالشده اعمال میشوند.
|
||||
|
||||
**Permission:** `ROLE_DOCTOR` — must be the linked doctor
|
||||
|
||||
@@ -187,6 +221,9 @@ Update secretary active status or permissions.
|
||||
```json
|
||||
{
|
||||
"active": false,
|
||||
"name": "نام جدید",
|
||||
"national_code": "9999999999",
|
||||
"address": "آدرس جدید",
|
||||
"permissions": {
|
||||
"version": 1,
|
||||
"resources": {
|
||||
@@ -201,10 +238,13 @@ Update secretary active status or permissions.
|
||||
}
|
||||
```
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------- | ------- | -------- | ------------------------ |
|
||||
| `active` | boolean | ❌ | Enable/disable secretary |
|
||||
| `permissions` | object | ❌ | New permissions object |
|
||||
| Field | Type | Required | Description |
|
||||
| --------------- | ------- | -------- | -------------------------------------------- |
|
||||
| `active` | boolean | ❌ | Enable/disable secretary |
|
||||
| `name` | string | ❌ | بهروزرسانی نام کامل منشی (`user_name`) |
|
||||
| `national_code` | string | ❌ | بهروزرسانی کد ملی (nullable) |
|
||||
| `address` | string | ❌ | بهروزرسانی آدرس (nullable) |
|
||||
| `permissions` | object | ❌ | New permissions object (deep-merged) |
|
||||
|
||||
### Response `200`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user