feat(settings): complete remaining settings tabs (account, tags, turns)

Fill the three previously-placeholder settings sections so every menu item
is now a real page inside the settings shell:

- حساب کاربری: new authenticated POST /api/v1/user/change-password
  (verifies current password, ≥8 chars, must differ) + account page with a
  profile summary and change-password form.
- برچسب‌ها: new per-tenant TenantTag domain (entity/repo/controller +
  migration) with tenant-scoped CRUD at /api/v1/tenant-tag(s), plus a tags
  management page (list + color + add/edit/delete).
- مدیریت نوبت دهی: export the existing WeeklyScheduleTab from
  DoctorDetailPage and reuse it in a standalone AppointmentSettingsPage
  (current doctor's uuid + addresses).

Wire all three menu entries to their routes. Backend covered by PHPUnit
(change-password, tenant-tag CRUD + ownership); FE covered by Vitest.
API docs updated (auth.md, tag.md).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
hamed
2026-07-13 14:16:21 +03:30
co-authored by Claude Opus 4.8
parent 19d8560c9e
commit 76f9fbe88f
20 changed files with 1004 additions and 14 deletions
+32
View File
@@ -629,6 +629,38 @@ Submit a pre-registration request (doctor or clinic). Public endpoint — no aut
---
## POST `/api/v1/user/change-password`
تغییر رمز عبور توسط کاربرِ احرازشده (بدون OTP). رمز فعلی راستی‌آزمایی می‌شود.
**Permission:** `IS_AUTHENTICATED_FULLY`
### Request Body
```json
{
"current_password": "oldpass1234",
"new_password": "newpass1234"
}
```
| Field | Type | Required | Validation |
|-------|------|----------|------------|
| `current_password` | string | ✅ | باید با رمز فعلی مطابقت کند |
| `new_password` | string | ✅ | حداقل ۸ کاراکتر و متفاوت با رمز فعلی |
### Response `200`
```json
{ "success": true, "data": { "message": "رمز عبور با موفقیت تغییر یافت" } }
```
### Errors
| HTTP | Code | field | Description |
|------|------|-------|-------------|
| 422 | `ERR_VALIDATION_001` | `new_password` | رمز جدید کوتاه یا برابر رمز فعلی |
| 422 | `ERR_VALIDATION_001` | `current_password` | رمز فعلی نادرست |
---
## POST `/api/v1/user/reset-password`
تغییر رمز عبور با تأیید هویت از طریق OTP.
+36
View File
@@ -144,3 +144,39 @@ Full-table JSON export and strict wipe+replace import for this category live und
The admin list endpoint accepts `sort=id&order=asc|desc` to order by `id`
(used by the admin «دسته‌بندی‌ها» page when clicking the «شناسه» column).
Without `sort`, the default ordering (weight/name) is unchanged.
---
## برچسب‌های Tenant (doctor/clinic)
برچسب‌های اختصاصیِ هر tenant با رنگ نمایش — جدا از taxonomy سراسری بالا. همه به entity کاربر (`doctor`/`clinic`) scope می‌شوند؛ هر tenant فقط برچسب‌های خودش را می‌بیند/تغییر می‌دهد.
**Permission:** `IS_AUTHENTICATED_FULLY` (doctor/clinic/secretary)
### GET `/api/v1/tenant-tags`
لیست برچسب‌های tenant جاری. Response: `{ success, data: [{ uuid, name, color, active }] }`
### POST `/api/v1/tenant-tag`
```json
{ "name": "فوری", "color": "#FF0000" }
```
| Field | Type | Required | Validation |
|-------|------|----------|------------|
| `name` | string | ✅ | غیرخالی، حداکثر ۶۰ |
| `color` | string | ❌ | هگز `#RRGGBB` یا `#RRGGBBAA` (پیش‌فرض `#5559CE`) |
Response `201`: TenantTag object.
### PATCH `/api/v1/tenant-tag/{uuid}`
فیلدهای اختیاری `name` / `color` / `active`. فقط مالک؛ در غیر این صورت `404`.
### DELETE `/api/v1/tenant-tag/{uuid}`
حذف برچسب. فقط مالک؛ در غیر این صورت `404`.
### Errors
| HTTP | Code | field | Description |
|------|------|-------|-------------|
| 422 | `ERR_VALIDATION_001` | `name` | نام خالی |
| 422 | `ERR_VALIDATION_001` | `color` | رنگ نامعتبر |
| 404 | `ERR_NOT_FOUND_001` | — | برچسب یافت نشد یا متعلق به tenant دیگر |
| 403 | `ERR_FORBIDDEN_001` | — | پروفایل tenant یافت نشد |