WP-06 API spec
The module is in afia-api. Contract type: Encounter in contracts.md. Wire: exchange/encounter.md.
Usage
A clinician creates and updates notes on /api/v1/afia/clinician/encounters. The encounter points at an appointmentId from WP-05. A patient caller is rejected.
Domain
Encounterathealth.afia.app.clinician.encounter.Encounter. ContractEncounter.
Persistence
EncounterEntity table encounter. Columns match the contract fields only. Do not persist appointments here.
HTTP DTOs
EncounterRequestDtoinbound.appointmentId,notes.EncounterResponseDtooutbound. ContractEncounterfields.
Mappers
EncounterMapper.toResponse(Encounter) -> EncounterResponseDto
EncounterMapper.toDomain(EncounterEntity) -> Encounter
Services
EncounterService
writeEncounterNote(session, appointmentId, notes) -> Encounter
updateNotes(session, encounterId, notes) -> Encounter
This is the sketch operation AgendaService.writeEncounterNote. WP-06 owns it.
Controllers
EncounterControlleron reserved/api/v1/afia/clinician/encounters.
Does not do
Appointment persistence, profiles, or diagnostics. Patient-facing note editors. Flutter types. SOAP templates.