Data download (Unit / FMT)
For Unit In-Charge and FMT L1 users, downloads master data plus farmers, land, crop plans and compact blocks for every VO assigned to them. No VO selection is needed.
FactsheetOnboarding & setup
- Who uses it
- Unit In-Charge / FMT L1
- How you get here
- Automatically after role detection for Unit users; in load-more mode via Settings > Load more data.
- Tables
sync_status,ie_flat_entity,cropdata,practicemaster,farmerassets,portfolio,portfolio_portfoliolineitem,compact_block,compact_block_member- APIs
- 11 calls today, 3 App Service operations
- Offline
- Needs internet. Offline, items end in ERROR with Retry.
Screens
| Screen | What it does | Source |
|---|---|---|
| Unit Data Setup | List of 8 download items with status and Retry/Refresh. | app/src/main/java/org/platformcommons/urvi/view/datasetup/UnitDataSetupActivity.kt |
Rules
Conditions from the code, rewritten as plain decision rules.
| When | Then |
|---|---|
| Downloads run | Items: App Configs, Product Master, Practice Master, Farmers, Farmer Assets, Portfolio, Portfolio Attachments, Compact Block. Assets and Portfolio run in parallel. |
| Downloading farmers | Each VO in the downloaded hierarchy (MAJOR_TYPE.VO) is counted and paged separately, with progress saved per VO. |
| Every VO's farmers are fully downloaded | All per-VO progress is reset so the next run is a full refresh. |
| An error occurs and some farmers are already stored | Farmers is PARTIAL_SUCCESS. |
| Downloading compact blocks | Each VO is paged (size 100) with per-VO progress and the same reset-when-all-done rule. |
| All four mandatory items succeeded and every item finished | Go to Home in Unit mode and set KEY_IS_UNIT_LOGIN, setupStatus and isLanguageSelected. |
| In load-more mode | Downloads do not auto-start and the app does not move to Home by itself. |
| Settings > Load more data is tapped and any queued item has never been attempted | Block with "Please sync before loading more data." and a Force sync button. |
API contracts
Each call opens to its use case, headers, request and response bodies, and errors.
| App Service v2: operation | Use |
|---|---|
GET /config | Typed config bundle (ETag) |
GET /farmers/snapshot | Cursor-paged hydrated farmer snapshot |
GET /compact-blocks | Compact blocks for VOs |
Behaviour notes
- Mandatory items: App Configs, Product Master, Practice Master, Farmers.
- Unlike Cadre there is no IE Role Map, no asset attachments and no farming model download.
- Progress keys: totalIEPages / pulledIEPages for farmers, totalCBPages / pulledCBPages for compact blocks.
Improve in the rewrite
- Share one download engine with the Cadre flow.
- Consider downloading only changed records instead of a full refresh after every complete run.