docs use cases uc 005 view municipality prices - AlexandreZanata/Abastevo GitHub Wiki
UC-005 — View Municipality Fuel Prices
| Field | Value |
|---|---|
| ID | UC-005 |
| Name | View Municipality Fuel Prices |
| Actors | End User |
| Layer | UI → Application → Domain |
Goal
Display average, min, and max prices for all available FuelProduct values in the selected municipality for the latest (or selected) SurveyWeek.
This is the fuel averages detail screen. It is reached from Home via View full price details. Tapping a FuelProduct card on Home does not open this screen — it opens UC-007 directly for that fuel (one-tap shortcut).
Preconditions
CitySelectedor preferred location set.AveragePricerecords exist for municipality +SurveyWeek(or empty state per BR-010).
Main flow
- System resolves municipality, state, and
SurveyWeek(BR-006). - System loads all
AveragePricerows for that scope. - UI displays:
- Municipality and state (localized formatting).
- Survey week date range (localized dates).
- Last sync timestamp.
- ANP attribution footer (BR-009).
- For each
FuelProductwith data, show:- Localized product name (i18n).
- Average price (currency formatted).
- Min / max range.
- Station count surveyed.
- User taps a fuel row → emit
FuelProductSelected→ navigate to UC-007 (if station detail) or expand detail inline.
Entry point note: Home fuel cards skip this screen and navigate straight to UC-007 with the tapped
FuelProduct(−1 step). This screen keeps the min/avg/max + station-count comparison view reachable from Home.
Alternative flows
A1 — No fuels for municipality
- WHEN zero rows for municipality in selected week
- THEN empty state (BR-010) using
dataAvailability:NO_DATA_THIS_WEEK→prices_empty_no_data_this_weekNEVER_IN_ANP→prices_empty_never_in_anp
- AND show
operationalNotebanner when non-null (Phase 12 week catalog)
A2 — User switches survey week
- WHEN user selects older week from history selector
- THEN reload prices for that
SurveyWeek(UC-006)
A3 — Offline
- WHEN no network
- THEN show cached prices + offline banner (BR-004)
A4 — Stale data
- WHEN latest week older than 8 days
- THEN show stale banner + refresh action
Business rules
- BR-004, BR-006, BR-009, BR-010
Domain events
FuelProductSelected(optional, on row tap)
Postconditions
- User sees authoritative averages for their location.
i18n keys
prices_titleprices_survey_week_labelprices_last_sync_labelprices_station_countprices_anp_attributionfuel_product_ethanol(etc. perFuelProduct)prices_empty_municipalityprices_empty_no_data_this_weekprices_empty_never_in_anp