Features / Assets & land

Crop stock (inventory)

Records how much of each crop the farmer holds in stock, in quintals ("My Crops").

FactsheetAssets & land
Who uses it
Cadre userHAN user (blocked)
How you get here
Farmer hub, Crops tile. Needs a category that is not C4/C5.
Tables
ie_inventory, inventoryproduct
APIs
4 calls today, 3 App Service operations
Offline
Works offline; saved locally and synced later.

Screens

ScreenWhat it doesSource
Crops (In Quintal)List crops and enter quantities.app/src/main/java/org/platformcommons/urvi/view/inventory/InventoryNewFragment.kt
Select Crop sheetPick crops by category and search; reused by Crop Plan/Actual and Certification.app/src/main/java/org/platformcommons/urvi/view/inventory/SelectCropFragment.kt

What it captures

FieldTypeRequiredValidationOptions from
CropsMulti-select sheetYes (at least 1 new crop when adding)Category dropdown plus text search; crops already added are pre-ticked.Local ProductSKUMaster table (product categories excluding PRODUCT_MAJOR_TYPE.LEARNING)
Quantity (quintal)NumberAt least one valueEvery value must be numeric.User input

Rules

Conditions from the code, rewritten as plain decision rules.

WhenThen
The user taps Done with no unsaved change or all values emptyNothing is saved.
The user taps Done with valid changesNew rows are created and changed rows updated.
The user goes back with unsaved changesA confirmation is shown.

API contracts

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

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

    Improve in the rewrite

    • Show inline validation per row.