# م4-م8 Remediation — إصلاح أعطال التنفيذ (Fable audit 2026-07-09)

> Fable اصطاد «شكلها متعمل بس ميتة». الإصلاح قبل م9. المرجع: Fable execution audit (البوابة قبل م9-م11).

## الأعطال
- **B1 [م8]:** cashier-queue route موجود (`clinic.routes.ts:174`) بس مفيش nav item في `CLINIC_NAV` (`clinic-layout.component.ts:41-225`) ولا أي routerLink. → الشاشة مش موجودة للمالك.
- **B2 [م8/م4]:** `CashierQueueController:41` بيفلتر `payment_disposition=send_to_cashier`؛ الكاتب الوحيد `CreateVisit:160-221`. أزرار sendToCashier (`reception-order.ts:670`, `consultation.ts:377`) navigation بس بلا ختم؛ مفيش endpoint يختم أوردر موجود. → الطابور فاضي إلا من مسار الويزارد.
- **B3 [م5]:** `POST encounters/{id}/begin` (`api.php:274`) **صفر FE callers**؛ `consultation.ts ngOnInit` GET بس. → arrived→in_consultation مابيحصلش لـencounter مُنشأ مسبقًا (وضع المحطات) → الطابور «منتظر» أبدًا + now-serving فاضي (`now-serving:34` يفلتر in_room من in_consultation).
- **P1:** `SettingController PUBLIC_READ_KEYS` فيه `clinic.scheduling_mode` بس. `clinic.visit_stations` (nurse، `clinic-layout:292`) + `clinic.default_payment_method` (reception، `create-visit:616`) → 403 للأدوار غير الأدمن → fallback صامت. (co4 أدمن فبانت شغّالة.)
- **P2 [م4]:** `AvailabilityService:73-83,217-227` seatsTaken بيعدّ الموعد نفسه؛ overbooking off + آخر مقعد → 409 عند الوصول (`MarkArrived:90`). مؤجّل لـم8 واتنسي.
- **MINOR:** settings ميتة `pharmacy_source`/`allow_credit_balance` (إخفاء).

## 📊 ليدجر
| WP | المحتوى | مراجعة | الحالة |
|----|---------|--------|--------|
| R-BE | B2 endpoint `POST clinic/service-orders/{order}/send-to-cashier` (ختم disposition+at+by، company-scoped، perm) + P1 whitelist (visit_stations+default_payment_method في PUBLIC_READ_KEYS) + P2 seatsTaken self-exclude في مسار الوصول. Pest. | Codex | ✅ |
| R-FE | B1 nav item cashier-queue + B2 نداء endpoint من زرّي sendToCashier قبل التنقّل + B3 `begin(id)` fire-and-forget من consultation mount + i18n + إخفاء الإعدادات الميتة. build. | Codex | ✅ |
| R-ship | verify + CHANGELOG + نشر /app + push. | single | ✅ |

**DAG:** R-BE ‖ R-FE (FE عنده عقد الـendpoint). R-ship آخرًا. عقد الـendpoint: `POST /clinic/service-orders/{order}/send-to-cashier` → 200، يختم `payment_disposition=send_to_cashier`+`sent_to_cashier_at`+`sent_to_cashier_by`.
