WP-05 exchange
One Appointment row. Two HTTP faces. Envelope: envelope.md.
Workflow
- A patient lists appointments on
/api/v1/afia/appointments. - The patient requests a slot with
clinicianIdandslot. - The API inserts one
Appointmentrow. - A clinician GETs
/api/v1/afia/clinician/agendafor a day and sees the same rows. /api/v1/afia/clinician/patientslists patients who have an appointment with that clinician. It does not copyPatientProfilestorage.
Wire
GET /api/v1/afia/appointments
res { data: [ { "id", "patientId", "clinicianId", "slot", "status" } ], ... }
POST /api/v1/afia/appointments
req { "clinicianId", "slot" }
res { data: { "id", "patientId", "clinicianId", "slot", "status" }, ... }
GET /api/v1/afia/clinician/agenda?day=
res { data: [ { "id", "patientId", "clinicianId", "slot", "status" } ], ... }
GET /api/v1/afia/clinician/patients
res { data: [ { "patientId" } ], ... }
Errors: missing session, wrong role, unknown clinician, slot conflict (when status rules land).
Ownership
WP-05 writes health.afia.app.patient.appointment, health.afia.app.clinician.agenda, and lib/*/booking/ plus the two presentation folders. Shared language is Appointment.
Does not do
Encounter JSON. A second appointment resource. Class internals. Invented calendar widgets.