Add the Healthcare platform backend (phases 13.0–13.7) with Alembic migration revision fix, production deploy script, validation reports, shared UI exports, and loyalty list page client directives so Next.js build succeeds. Co-authored-by: Cursor <cursoragent@cursor.com>
3.9 KiB
3.9 KiB
Healthcare Validation Report
Date: 2026-07-26
Environment: Windows dev / TorbatYar monorepo frontend
Quality Gates
| Gate | Command | Result | Notes |
|---|---|---|---|
| TypeScript | npm run typecheck |
⚠️ PASS healthcare | 1 pre-existing beauty error unrelated |
| ESLint | npm run lint |
✅ PASS | Healthcare hooks rule fixed |
| Healthcare imports | npm run validate:healthcare-imports |
✅ PASS | |
| Healthcare routes | npm run validate:healthcare-routes |
✅ PASS | 114 pages |
| Circular deps | npm run validate:healthcare-circular |
✅ PASS | 32 module files |
| Architecture | npm run validate:architecture |
✅ PASS | |
| Production build | npm run build |
⚠️ BLOCKED | Hospitality TS error (z namespace) — healthcare compiled OK in 5.6min |
CRUD Validation (manual / code review)
| Entity | Create | Read | Update | Delete | Workflow |
|---|---|---|---|---|---|
| clinics | ✅ dialog | ✅ table | ✅ dialog | ✅ confirm | — |
| branches | ✅ | ✅ | ✅ | ✅ | — |
| departments | ✅ | ✅ | ✅ | ✅ | — |
| doctors | ✅ | ✅ | ✅ | ✅ | — |
| patients | ✅ | ✅ | ✅ | ✅ | — |
| appointments | ✅ book | ✅ | — | — | confirm/cancel/no-show |
| visit_sessions | ✅ | ✅ | — | — | start/finish/defer/call |
| prescription_orders | ✅ | ✅ | — | — | accept/prepare/ready/pickup/cancel |
| waiting_list | ✅ | ✅ | — | — | — |
| external_providers | ✅ | ✅ | ✅ | ✅ | — |
Permission Validation
useHealthcarePermissionsgrants manage to tenant owners / platform admin- View routes require authenticated tenant +
healthcare.*.viewkeys (UI gate) - API 403 surfaces
PermissionDeniedState - Permissions catalog page lists all backend-defined keys
Responsive Validation
HealthcareResourceWorkspace: table scroll + card grid (sm:grid-cols-2 xl:grid-cols-3)TableToolbarstacks on mobile (flex-col sm:flex-row)AppointmentCalendar: horizontal scroll (overflow-x-auto, min-width 720px)- Portal shells unchanged — mobile portal route
/healthcare/mobile/[portal]
Accessibility Validation
- Dialogs:
role="dialog",aria-modal, Escape to close - Drawer: labelled title
aria-labelledby - Timeline: semantic
<ol>/<time dateTime> - Tab lists:
role="tablist"/role="tab"/aria-selected - Action buttons:
aria-labelon icon-only controls
Performance Validation
- TanStack Query caching for lookups (
useHealthcareLookupsstale shared keys) - Debounced search (300ms) reduces re-filter churn
- Pagination when API returns
{ items, total } - No N+1 in list screens (single list call per resource)
Calendar Validation
AppointmentsCalendarPageloads up to 200 appointments- Week / day toggle via Tabs
- Maps patient/doctor names via lookup cache
- Hour grid 08:00–19:00
Design System Validation
- Uses
@/src/shared/uiDS re-exports (Button, Dialog, DataTable, Badge, etc.) - Healthcare tokens:
--health-accent,MedicalStatusChip - Light/dark via CSS variables (
var(--surface),var(--border)) - RTL: timeline border-s, drawer side=left (RTL start)
Self-Audit Checklist
- Enterprise completeness dimensions addressed for UI layer
- No cross-module imports (accounting/beauty/hospitality)
- Documentation reports generated
- Automatic repair loop run until healthcare lint/validate pass
- Full monorepo
npm run build— blocked by hospitality unrelated error
Recommended Follow-ups
- Add backend list endpoints for medical records & encounters → enable full table CRUD
- Fix
modules/hospitality/components/HospitalityListCrudPage.tsxzimport for green CI build - Wire
npm run validate:healthcare-bundlepost-build when build unblocked