إنتقل إلى المحتوى الرئيسي

WP-12 API enrichment for Stitch parity

Load AGENTS.md, contracts.md, ADR 0012, and this file. Tech specs: api/api-enrichment.md, app/api-enrichment.md, exchange/api-enrichment.md. Implement only when the user asks and WP-04, WP-05, and WP-07 have landed.

Group G4. May run beside WP-11.

Owns​

Write:

  • afia-api/src/main/java/health/afia/app/notifications/
  • afia-api/src/test/java/health/afia/app/notifications/
  • afia-api/src/main/resources/db/changelog/modules/stitch-parity.yaml
  • afia-app/lib/domain/care/
  • afia-app/lib/data/care/

Edit (add fields and endpoints only, in the owner package):

  • health.afia.app.patient.appointment and health.afia.app.clinician.agenda
  • health.afia.app.patient.profile and health.afia.app.clinician.profile
  • health.afia.app.patient.billing and health.afia.app.patient.monitoring
  • health.afia.app.admin
  • health.afia.app.diagnostics
  • health.afia.app.identity for lastSeenAt only
  • The matching test folders
  • afia-app/lib/domain/ and afia-app/lib/data/ folders for the same packages
  • db.changelog-master.yaml to include stitch-parity.yaml

Features: F-22 dashboard and notification projections.

Reserved paths: /api/v1/afia/notifications, /api/v1/afia/patient/home, /api/v1/afia/clinician/dashboard.

Must not write​

  • EndpointUri.java, api_config.dart. A WP-00 follow-up adds the three new constants.
  • Any presentation folder
  • A second table for a type another package owns
  • health.afia.app.patient.results storage. Results stay a projection from diagnostics.

Depends on​

WP-04, WP-05, and WP-07. The fields extend their types. A WP-00 follow-up reserves the three new prefixes before the first controller lands.

Done when​

  1. Visits gain reason, mode (VIDEO or CABINET), priority (ROUTINE or URGENT), clinicName, and specialty.
  2. GET /api/v1/afia/clinician/agenda accepts from and to. day still works.
  3. POST /api/v1/afia/appointments/{id}/rating stores 1 to 5 stars for an ended visit. Only the visit patient may rate.
  4. Clinician search cards gain displayName, clinicName, fee, and nextSlot.
  5. GET /api/v1/afia/clinician/dashboard, GET /api/v1/afia/patient/home, GET /api/v1/afia/admin/dashboard, and GET /api/v1/afia/worklists/summary?kind= return counts and short lists for the caller role.
  6. GET /api/v1/afia/notifications projects visits, results, invoices, and alerts. POST /api/v1/afia/notifications/seen sets lastSeenAt on the account.
  7. Vitals gain unit, measuredAt, and status (NORMAL, HIGH, LOW). Invoices gain createdAt, currency (MRU), reference, and clinicianName.
  8. Work items gain examName, requestedAt, orderedBy, and structureName. Orders gain scheduledAt. PATCH /api/v1/afia/orders/{id}/schedule sets it.
  9. Patient profile gains firstName, lastName, birthDate, email, address, city, bloodGroup, allergies, and history. Clinician profile gains displayName, clinicName, and bio.
  10. Admin users gain displayName, status (ACTIVE or SUSPENDED), and createdAt. PATCH /api/v1/afia/admin/users/{id}/status sets status.
  11. Every new column is in stitch-parity.yaml. Every new endpoint has a controller test.
  12. cd afia-api && mvn test passes.
  13. cd afia-app && flutter test passes.

Do not invent screens​

This package adds fields that in-scope Stitch screens show. Do not add a field that no in-scope screen.png shows. Do not add charts, AI, or video control fields. NNI belongs to ADR 0013 / AFIA-38 on the patient profile, not to this WP’s enrichment cut.