Downloads every land and livestock asset owned by a list of farmers. It is called online during the cadre data download (DataSetupViewModel.syncFarmerAssets) and the unit data download (UnitDataSetupViewModel, SetupForUnitInChargeLogin), in chunks of the ref-data asset pagination limit (default 30 IE ids). It is also called for one farmer from the farmer hub (OptionViewModel.syncFarmerData) and the Land screen refresh (IeAssetRepositoryImpl.fetchAssetOnline). The side-menu user-data refresh (FetchUserDataWorker -> SetupForUser) calls it with ownerEntityType=OWNER_ENTITY.BRIDGE_USER for the cadre's own assets. Rows that still have a pending local sync are skipped. The rest are saved to farmerassets, and assets the server no longer returns are removed (LoadMoreDataUtils.removeAssetDataWhenNotFound). On failure the download step is marked ERROR and the dependent attachment step is skipped.
Headers
Header
Value
Notes
X-SESSIONID
<session id>
Not declared on the Retrofit method; AuthInterceptor (data/net/AuthInterceptor.kt) adds it. On a 401 or 400 it re-authenticates and retries once.
Parameters
Param
In
Required
Example
Notes
ownerEntityIdList
query
Yes
880001
Retrofit List<String>, sent as repeated params: ownerEntityIdList=880001&ownerEntityIdList=880002. Chunk size comes from ref data (AppUtils.getFarmerAssetPaginationLimit), default 30.
ownerEntityType
query
Yes
OWNER_ENTITY.IE
OWNER_ENTITY.IE for farmers. OWNER_ENTITY.BRIDGE_USER for the logged-in cadre's own assets (SetupForUser).
Request
No body. ownerEntityIdList (IE ids), ownerEntityType
Values from the asset ref data (land or livestock picker on the Land and Livestock screens).
*.labels[]
array
Localised labels, stored in asset_*_labels tables.
totalQuantity.value
double
Land extent (acres) or head count, from the Extent field. On an "Integrity" error, the RH sets a null value to 0.0 and re-queues.
totalQuantity.uoM
object
Unit of measure (code, symbol, measurementType).
nameList[].text
string
Asset name or survey label. PII: may contain survey or land identifiers.
assetSpecsList[]
array
specName/specValue pairs (for example survey number). PII: land record identifiers.
appMillMetadata.ie_appId
string
Local app id of the farmer, used to resolve owningEntityId offline.
assetCheckSum
string
MD5 of the asset name plus total quantity (IeAsset.setMD5Hash). The server uses it to detect checksum mismatches (ERR_PLATFORM_ASSET_CHECKSUM_MISMATCH).
No paging; the whole chunk comes back in one response.
Errors
Status
When
What the app does
non-2xx
Any failure for a chunk
Data download throws "Failed to fetch farmer assets: <code>", marks farmer_assets and farmer_asset_attachments as ERROR and stops. The farmer hub sync posts an error status. SetupForUser logs a Crashlytics non-fatal and, on a 401, refreshes the session.
401/400
Session invalid
AuthInterceptor re-authenticates and retries once.