WP-02 API spec
The module is in afia-api. Contract type: PatientProfile in contracts.md. Wire: exchange/patient-profile.md.
Usage
A patient reads and updates their own profile on /api/v1/afia/patient/profile. The handler takes accountId from the session once WP-01 exists. Until then, accept accountId on the resource.
Domain
PatientProfileathealth.afia.app.patient.profile.PatientProfile. ContractPatientProfile.
Persistence
PatientProfileEntity table patient_profile. Columns match the contract fields only. Do not store appointments or results here.
HTTP DTOs
PatientProfileRequestDtoinbound. FielddisplayName.PatientProfileResponseDtooutbound. FieldsaccountId,displayName.
Mappers
PatientProfileMapper.toResponse(PatientProfile) -> PatientProfileResponseDto
PatientProfileMapper.toDomain(PatientProfileEntity) -> PatientProfile
PatientProfileMapper.apply(PatientProfile, PatientProfileRequestDto) -> PatientProfile
Services
PatientProfileService
get(accountId) -> PatientProfile
update(accountId, displayName) -> PatientProfile
Controllers
PatientProfileControlleron reserved/api/v1/afia/patient/profile.GETand write for the current patient.
Does not do
health.afia.app.patient.appointment or health.afia.app.patient.results. Identity Account persistence. Flutter types. Consult or booking widgets.