frontend phase 5 & backend phase 12

This commit is contained in:
hamid
2026-07-09 03:05:14 +03:30
parent 465f75c29e
commit dc64472631
98 changed files with 11847 additions and 136 deletions
@@ -12,6 +12,25 @@ for awareness.
- **Requests filed:** frontend/requests/for-backend.md (yes/no)
-->
## frontend-phase-5-b6 — Nurse verification flow (trust engine) — 2026-07-09
- **Shipped:** `services/verification` domain (types/keys/constants/validation/apis[client+mock(primary)+seam]/
hooks/index) — ONE cached `status()` query drives B3+B6, every mutation invalidates it. The nurse
verification route subtree `nurse/verification/{page(B3),identity(B4),credentials(B5),review(B6)}` +
co-located `VerificationChecklist` / `verificationSteps` (data-driven step rendering, synthetic mobile step).
Two shared components with tests: `<DocumentUpload>` (client type/size validation, progress %, success/
retry, re-upload-on-reject, server-metadata truth + local-capture mode) and `<TrustBadge>` (verified/
unverified/expired off `--bal-*`, reused by f6). Publish gate wired on `nurse/services` (`PublishGate`
disabled until `approved`); trust badge on the nurse profile (own state from `ownBadgeState`). 6 new AppIcons,
4 route constants, `verification` i18n namespace (123 keys) in both locales. Honest copy: manual steps
never claim an automated authority check; a step reads "تاییدشده" only when `passed`.
- **Consumes:** dev/contracts/domains/verification.md + openapi/swagger.v1.json (backend-phase-6). Wire is
**camelCase**; action-style routes under `api/v1/nurse_verification/*` + `api/v1/nurses/{id}/trust_badge`.
- **Mocked client-side:** `services/verification` via `verificationMockApi` behind `USE_VERIFICATION_MOCK`
(**default true** — runs the whole journey standalone incl. a dev-only admin-decision sim, since b6 isn't
reachable here). One-line swap to `verificationClientApi`. See mocks-registry.
- **Gate:** npm run check green · npm run test:ci green (157 tests, +9) · en/fa in sync (123 verification keys).
- **Requests filed:** frontend/requests/for-backend.md — yes (REQ-011 nurse credential-details endpoint).
## frontend-phase-4-b5 — Catalog browse (Home A5) & nurse service builder (B7) — 2026-07-05
- **Shipped:** `services/catalog` domain (types/keys/constants/apis[client+mock+seam]/hooks/index) — the b5
catalog skeleton + nurse pricing layer. Hooks: `useServiceCategories`, `useCategoryOptionGroups` (both
@@ -132,3 +132,21 @@ delivers fixes in its own change. **Frontend never edits backend code to "fix" a
if it binds `page_size`, tell us and we'll switch the client (one line per list call).
- **Proposed shape:** list query = `?page={1-based}&pageSize={≤100}`; response `data` = `{ items, total, page, pageSize }`.
- **Status:** open
## REQ-011 — Nurse-facing endpoint for structured professional-credential details — filed by frontend-phase-5-b6 — 2026-07-09
- **Need:** A nurse-facing command to submit the **structured** credential fields B5 collects alongside the
document uploads: `inoNumber` (شماره نظام پرستاری), `specialties` (string[] — stable codes + free-text),
and optionally `licenseNumber`, `issuingAuthority`, `holderName`, `issuedAt`, `expiresAt`. Proposed:
`POST api/v1/nurse_verification/credential_details` (or fold into the manual-step `documents` confirm body).
- **Why:** The b6 contract records these structured fields **only on the admin `decide`** — there is no
nurse-facing endpoint to capture them. B5 needs them at submission time (the INO number is the nurse's
primary registry key, specialties feed f6 search facets). Today the client collects them and the mock
persists them; the real `verificationClientApi.submitCredentialDetails` **no-ops** (the document uploads
it accompanies ARE contract-backed via `upload_url` → PUT → `documents`). Without this, a swap to the real
backend silently drops the INO number + specialties until an admin re-enters them.
- **Proposed shape:** `POST api/v1/nurse_verification/credential_details` body
`{ inoNumber, specialties: string[], licenseNumber?, issuingAuthority?, holderName?, issuedAt?, expiresAt? }`
`VerificationStatusDto`. Alternatively, extend the manual-step `documents` confirm body with these fields.
- **Also (minor):** the contract's `VerificationStepDto` has no `isRequired` — the client treats **every**
seeded step as required (the "X از Y" meter Y = `steps.length`). Confirm that holds, or add `isRequired`.
- **Status:** open