WP-02 exchange
Contract type PatientProfile. Envelope: envelope.md.
Workflow
- A patient session GETs
/api/v1/afia/patient/profile. - The API returns
accountIdanddisplayName. - The client PUTs or PATCHes
displayName. - The API writes the same profile row and returns it.
Wire
GET /api/v1/afia/patient/profile
res { data: { "accountId", "displayName" }, status, message, errors }
Write:
req { "displayName": "..." }
res { data: { "accountId", "displayName" }, ... }
Errors: missing session, not a patient, validation on displayName.
Ownership
WP-02 writes health.afia.app.patient.profile and lib/*/patient/profile/. Shared language is PatientProfile. Account.id comes from identity once WP-01 exists.
Does not do
Appointment or results JSON. Class internals. Invented screens.