docs use cases uc 008 manage settings - AlexandreZanata/Abastevo GitHub Wiki
UC-008 — Manage Settings and Storage
| Field | Value |
|---|---|
| ID | UC-008 |
| Name | Manage Settings and Storage |
| Actors | End User |
| Layer | UI → Application |
Goal
Configure app preferences, manage local storage, and view data source information.
Preconditions
- None (settings always reachable).
Main flow
- User opens Settings screen.
- User can change:
- Language (
en,pt-BR) — applies immediately via i18n. - Preferred location — clears or sets via UC-003.
- Sync station detail toggle (BR-008, default on).
- Auto-download latest survey week toggle (BR-020, default on).
- Auto sync on Wi‑Fi only (BR-014).
- Station retention weeks (BR-013).
- Show price history (UC-006).
- Language (
- On each change, system emits
PreferencesUpdated. - User can tap Sync now → UC-001.
- User can view Storage usage: summary size, station detail size, week count.
- User can Clear cache:
STATION_DETAIL_ONLY— remove station rows per retention policy.ALL— remove all imported data, reset toEMPTY(confirmation dialog).
Alternative flows
A1 — Clear all with confirmation
- WHEN user confirms clear all
- THEN emit
CacheCleared(ALL), wipe DB, return to UC-002 flow
A2 — Storage full during sync
- WHEN import fails for insufficient space
- THEN show
STORAGE_FULL, suggest clear station detail
Business rules
- BR-008, BR-011, BR-013, BR-014, BR-020
Domain events
PreferencesUpdatedCacheCleared
Postconditions
- Preferences persisted locally.
- Storage reflects user choices.
i18n keys
settings_titlesettings_languagesettings_sync_station_detailsettings_auto_download_latest_weeksettings_sync_wifi_onlysettings_retention_weekssettings_storage_usagesettings_clear_cachesettings_clear_cache_confirmsettings_anp_attribution_link