Aller au contenu principal

WP-12 Flutter spec

Client side of the new fields and projections. Decision: ADR 0012. Wire: exchange/api-enrichment.md.

Usage​

Role screens call CareGateway for home, dashboard, worklist summary, and notifications. They keep calling the owner repositories for visits, profiles, orders, and admin users. Those models gain the new fields.

Domain​

  • PatientHome, ClinicianDashboard, AdminDashboard, WorklistSummary, and AfiaNotification at lib/domain/care/.
  • CareGateway at lib/domain/care/care_gateway.dart gains patientHome, clinicianDashboard, adminDashboard, worklistSummary(kind), notifications, and markNotificationsSeen.
  • Owner domain types in lib/domain/booking/, patient/profile/, clinician/profile/, admin/, and diagnostics/ gain the fields in api/api-enrichment.md.

Models​

  • PatientHomeModel, ClinicianDashboardModel, AdminDashboardModel, WorklistSummaryModel, and NotificationModel at lib/data/care/. fromJson keys match the wire.
  • Owner models add the new keys. A missing key parses to null so older servers still work.

Data sources​

  • CareRemote at lib/data/care/care_remote.dart.
patientHome() -> PatientHome
clinicianDashboard() -> ClinicianDashboard
adminDashboard() -> AdminDashboard
worklistSummary(kind) -> WorklistSummary
notifications() -> AfiaNotification[]
markNotificationsSeen() -> void

Owner data sources add rateVisit(id, stars), agendaRange(from, to), scheduleOrder(id, scheduledAt), and setUserStatus(id, status).

Uses ApiConfig constants that a WP-00 follow-up adds.

Repositories​

  • CareGateway is the repository for projections.
  • BookingRepository, profile repositories, AdminRepository, and the diagnostics repository keep their names.

Does not do​

Screens. Theme. A second HTTP client. Local caches of health data.