docs use cases uc 006 view price history - AlexandreZanata/Abastevo GitHub Wiki
UC-006 — View Price History
| Field | Value |
|---|---|
| ID | UC-006 |
| Name | View Price History |
| Actors | End User |
| Layer | UI → Application → Domain |
Goal
Show how average prices for a selected FuelProduct in a municipality changed across imported SurveyWeeks.
Preconditions
showPriceHistorypreference is true (default).- At least 2 imported
SurveyWeeks for same municipality + fuel (otherwise show single-point message).
Main flow
- User opens history from UC-005 fuel detail.
- System queries immutable
AveragePricehistory (BR-003) ordered bySurveyWeek.startDate. - UI renders trend list or simple chart (avg price vs week).
- User can tap a week to view full UC-005 snapshot for that week.
Alternative flows
A1 — Only one week available
- WHEN single
SurveyWeekin DB - THEN show message: "History available after more weekly syncs"
A2 — Gap in weeks
- WHEN missing intermediate weeks (user didn't sync)
- THEN show only available weeks, no interpolation (honest data)
Business rules
- BR-003, BR-006
Domain events
- None (read-only)
Postconditions
- User understands price trend from stored ANP history only.
i18n keys
history_titlehistory_insufficient_datahistory_week_label