frontend phase 12

This commit is contained in:
hamid
2026-07-10 14:48:15 +03:30
parent 67c028562e
commit 6186f54294
34 changed files with 2363 additions and 1 deletions
@@ -12,6 +12,31 @@ for awareness.
- **Requests filed:** frontend/requests/for-backend.md (yes/no)
-->
## frontend-phase-12-b13 — Nurse earnings & payout history — 2026-07-10
- **Shipped:** the **last money-path frontend phase** — the read-only **nurse earnings** surface. A **new
`services/payouts` domain** (types/keys/constants/apis[client+mock]/4 read-only hooks + hooks-only barrel)
and three nurse screens under the nurse shell: **`/nurse/earnings`** (net payable balance + four-bucket
breakdown + a plain-Persian cadence/dispute-window explainer + a state-segmented earnings list), **`/nurse/
earnings/payouts`** (payout history list), and **`/nurse/earnings/payouts/[id]`** (payout/batch reconciliation
detail — money decomposition + masked IBAN + transfer ref + the exact bookings covered). Three shared tested
composites: **`EarningsBalanceHeader`** (net balance with an explicit **negative "owed back"** state — never a
bare minus), **`EarningsRow`** (three-amount `gross commission = your payout` breakdown via `PriceBreakdown`
+ one of four visually-distinct state chips + state affordance: pending shows a **display-only** dispute-window
countdown reusing `CountdownTimer`), **`PayoutHistoryRow`** (net transferred + status chip + masked IBAN +
failure banner). Deep-links to the f8 booking detail (`/nurse/visits/{id}`); the `earnings` nav item +
`PaidOutlined` icon + a `payouts` i18n namespace (82 keys, both locales in sync) added. **Strictly read-only**
— no transfer/retry/batch/mutation; a failed payout shows its reason with **no retry** (admin action). Money is
IRR digit-strings via the f0 money util (`gross = commission + payout`; the BNPL provider commission never
appears); eligibility/dates/amounts are server truth (never computed client-side).
- **Consumes:** dev/contracts/domains/payouts.md (backend phase b13) — only `GET api/v1/nurse_payouts/history`
maps a live nurse route; the summary/earnings-list/nurse-payout-detail are contract gaps (REQ-025).
- **Mocked client-side:** `services/payouts` via `payoutsMockApi` (`USE_PAYOUTS_MOCK=true`) — self-contained,
money-correct fixtures covering all four earnings states + all four payout statuses + a `failed` payout + a
**negative net balance** (`MOCK_SCENARIO='clawback_heavy'`). Swap is one flip once REQ-025 lands.
- **Gate:** npm run check green · npm run test:ci green (242 tests, +3 suites) · npm run build green with
NEXT_PUBLIC_API_URL set.
- **Requests filed:** frontend/requests/for-backend.md — yes (REQ-025).
## frontend-phase-11-b12 — BNPL installment checkout (D1D5) — 2026-07-10
- **Shipped:** the **alternate checkout branch** off C6 — a **new `services/bnpl` domain** (types/keys/
constants/invalidations/apis[client+mock]/7 hooks + barrel) and the five wireframe screens under the