Aller au contenu principal

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​

  • Account at lib/domain/identity/account.dart. Contract Account.
  • Role at lib/domain/identity/role.dart. Contract Role.
  • Session at lib/domain/identity/session.dart. Contract Session.
  • Consent at lib/domain/identity/consent.dart. Contract Consent.

Models​

  • AccountModel at lib/data/identity/account_model.dart. fromJson keys match the exchange payload (id, phone, email, roles).
  • SessionModel at lib/data/identity/session_model.dart. Opaque token field from verify.

Data sources​

  • IdentityRemoteDataSource at lib/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​

  • IdentityRepository at lib/domain/identity/identity_repository.dart (interface) and lib/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.