Skip to main content

WP-04 Flutter spec

The store shell is in afia-app and is smaller than the design. Contract type: Clinic. Reuse Account and Role from identity. Wire: exchange/admin.md.

Usage​

The admin role shell calls AdminRepository.listAccounts, assignRole, getClinic, and updateClinic. Other roles do not open lib/presentation/admin/.

Domain​

  • Clinic at lib/domain/admin/clinic.dart. Contract Clinic.
  • Reuse identity Account and Role. Do not redefine them.

Models​

  • ClinicModel at lib/data/admin/clinic_model.dart. fromJson keys name, timezone.
  • Directory rows reuse AccountModel from identity data, or a thin admin view that does not persist a copy.

Data sources​

  • AdminRemoteDataSource at lib/data/admin/admin_remote_data_source.dart.
listAccounts() -> Account[]
assignRole(accountId, role) -> Account
getClinic() -> Clinic
updateClinic(name, timezone) -> Clinic

Uses ApiConfig admin prefix.

Repositories​

  • AdminRepository at lib/domain/admin/admin_repository.dart.

Presentation under lib/presentation/admin/ imports the repository only. Gate the shell on ADMIN.

Does not do​

Java types. afia-web pages. Invented admin screens. A second user table. A second HTTP client.