docs use cases uc 003 select location - AlexandreZanata/Abastevo GitHub Wiki
UC-003 — Select Location (State + City)
| Field | Value |
|---|---|
| ID | UC-003 |
| Name | Select Location |
| Actors | End User |
| Layer | UI → Application → Domain |
Goal
Let the user choose a Brazilian state and municipality to view fuel prices.
Preconditions
- At least one
SurveyWeekimported (BR-005). DataReadinessisREADY,PARTIAL, orSTALE.
Main flow
- User opens location picker from home or search tab.
- System displays list of 27
BrazilianStatevalues (localized display names via i18n). - User selects a state.
- System loads all catalog municipalities for the state (BR-016), each annotated with
DataAvailabilityfor latestSurveyWeek(BR-006). - User selects a municipality from the list (including cities without current-week data).
- System validates selection exists in
MunicipalityCatalog. - System persists
preferredStateandpreferredMunicipality(BR-012). - System emits
CitySelected. - System navigates to UC-005 (municipality prices).
Alternative flows
A1 — Municipality has no data for selected week
- WHEN municipality list item has
DataAvailability.NO_DATA_THIS_WEEKorNEVER_IN_ANP - THEN allow selection; UC-005 shows informative empty state (BR-010)
A2 — State has no catalog municipalities
- WHEN municipality list is empty for state
- THEN show empty state (BR-010) with message to pick another state
A3 — User changes location from home
- WHEN user already has a preferred city
- THEN picker pre-selects current state/municipality
Business rules
- BR-005, BR-006, BR-010, BR-012, BR-016
Domain events
CitySelected(municipality, state, surveyWeekId)
Postconditions
- Home screen reflects selected municipality.
- Preference survives app restart.
i18n keys
location_picker_titlelocation_state_labellocation_municipality_labellocation_empty_statelocation_no_data_this_week