Features / Assets & land

Livestock

Records how many animals of each type the farmer has, titled "Cattle".

FactsheetAssets & land
Who uses it
Cadre userHAN user (blocked)
How you get here
Farmer hub, Livestock tile. Needs a category (C4 and C5 are allowed).
Tables
ie_asset, farmerassets
APIs
5 calls today, 3 App Service operations
Offline
Works offline; changes are queued for sync. No pull-to-refresh on this screen.

Screens

ScreenWhat it doesSource
Livestock / CattleEnter a count per animal type.app/src/main/java/org/platformcommons/urvi/view/livestockasset/LiveStockAssetFragment.kt

What it captures

FieldTypeRequiredValidationOptions from
Count per animal typeNumberNoWhole number, max 3 digits (0-999). Every non-empty value must be numeric.Fixed list in code: Adult cows, Other cows, Oxen/Bulls, Goat, Sheep, Adult buffaloes; labels from asset master

Rules

Conditions from the code, rewritten as plain decision rules.

WhenThen
Asset master data is missingThe screen closes with "error fetching asset".
The user taps Done and no row is new or changedNothing is saved.
The user taps Done with changesNew rows are created first, then changed rows are patched.
A value is clearedThe existing record is not deleted.

API contracts

Each call opens to its use case, headers, request and response bodies, and errors.

Today: callUseReplaced by
GET S3 igx-static-data/asset/ref_data.jsonLoad asset (land/cattle) reference data.
GET S3 igx-static-data/asset/classification.jsonLoad asset classification data.
GET /gateway/asset-service/api/v1/assets/ownerEntities?ownerEntityIdList=&ownerEntityType=OWNER_ENTITY.IEDownload land and cattle assets for a chunk of farmers (or the cadre, with OWNER_ENTITY.BRIDGE_USER).
POST /gateway/asset-service/api/v1/assets/Create a land or cattle asset.
PATCH /gateway/asset-service/api/v1/assets/Update land or cattle assets.
App Service v2: operationUse
GET /configTyped config bundle (ETag)
GET /farmers/snapshotCursor-paged hydrated farmer snapshot
POST /sync/batchApply an ordered batch of offline mutations

Behaviour notes

  • There is no add button, refresh or authentication on this screen.

Improve in the rewrite

  • Allow removing an animal type or setting it to zero explicitly.
  • Drive the animal list from master data rather than code.