WP-01 Flutter spec
The store shell is in afia-app and is smaller than the design. Contract types: contracts.md. Wire: exchange/identity.md.
Usage
The identity shell calls IdentityRepository.requestOtp, verifyOtp, and me. Deletion calls deleteAccount with phone or email. Do not name login screens from Stitch.
Domain
Accountatlib/domain/identity/account.dart. ContractAccount.Roleatlib/domain/identity/role.dart. ContractRole.Sessionatlib/domain/identity/session.dart. ContractSession.Consentatlib/domain/identity/consent.dart. ContractConsent.
Models
AccountModelatlib/data/identity/account_model.dart.fromJsonkeys match the exchange payload (id,phone,email,roles).SessionModelatlib/data/identity/session_model.dart. Opaque token field from verify.
Data sources
IdentityRemoteDataSourceatlib/data/identity/identity_remote_data_source.dart.
requestOtp(phone) -> void
verifyOtp(phone, code) -> Session
me() -> Account
deleteAccount(phoneOrEmail) -> void
Calls AfiaApiClient with ApiConfig auth and me paths.
Repositories
IdentityRepositoryatlib/domain/identity/identity_repository.dart(interface) andlib/data/identity/identity_repository_impl.dart.
Presentation under lib/presentation/identity/ imports the repository only.
Does not do
Java types. Invented OTP screens. A second HTTP client. Patient, clinician, or admin packages.