Features / Assets & land

Land assets

Records each land parcel a farmer owns or cultivates: category, irrigated or rain-fed, khata and survey numbers and acres. Each parcel can then be authenticated (locked) and geofenced.

FactsheetAssets & land
Who uses it
Cadre userHAN user (blocked)
How you get here
Farmer hub, Land tile. Needs the land switch on and, unless it is the user's own record, a category that is not C4/C5.
Tables
ie_asset, farmerassets
APIs
11 calls today, 10 App Service operations
Offline
Add, edit and delete work offline and are queued for sync. Refresh and the disabled-land list need the network.

Screens

ScreenWhat it doesSource
Land listParcels grouped by category and irrigation with totals, authentication state and geofence button.app/src/main/java/org/platformcommons/urvi/view/landasset/LandAssetFragment.kt
Add / Edit landForm for one parcel (class AddUpdateAssetFragment).app/src/main/java/org/platformcommons/urvi/view/landasset/AddUpdateAssetNewDialog.kt
Land view modelLoad, save, delete and refresh land.app/src/main/java/org/platformcommons/urvi/view/landasset/LandAssetViewModel.kt
Disabled landLists farmers whose land was disabled on the server.app/src/main/java/org/platformcommons/urvi/view/ie/DisabledLandFragment.kt

What it captures

FieldTypeRequiredValidationOptions from
AuthenticateCheckboxNoCan be ticked when the land is new or not yet authenticated; locked once saved as authenticated.User input
Asset CategoryDropdownYesEach sub-category exists as Irrigated and Rain-fed.Fixed list in code (Land Owned, Leased-in Land, RoFR (Recognition of Forest Rights) Land, Endowment Land, Assigned Land / D-Patta, Land Owned Others, Leased-in Land Others); labels from asset master data
Land Ownership TypeSingle choice (Owner / Cultivator)If sub-category is Land OwnedFixed list
Land TypeSingle choice (Irrigated / Rain-fed)YesDecides the functionality code.Fixed list
DescriptionTextNoShown for Land Owned Others and Leased-in Land Others.User input
NameTextIf visibleUser input
Khata NoTextIf the khata-mandatory config is on and the sub-category is not Leased-in, RoFR, Endowment, Assigned/D-Patta, Owned Others or Leased OthersA "*" is added to the label when mandatory. Hidden for Leased-in Land.User input
Survey NoTextIf the survey-mandatory config is on and the sub-category is not Leased-inHidden for Leased-in Land.User input
AcresDecimalIf not Leased-inGreater than 0; at most 2 digits before and 2 after the decimal point (max 99.99). Unit is always acres.User input
Land Leased ToRead-only textNoShown only for Land Owned when a leased-to farmer is already set.Server

Rules

Conditions from the code, rewritten as plain decision rules.

WhenThen
The land is authenticated and admin does not allow editing authenticated landTapping the row shows "Land has already been authenticated. You cannot edit!!".
Category master data has not loadedThe Add Land button stays disabled.
Editing and the acreage changedNew acres must be at least current-season, current-month Crop Actual acres on this land + latest ATM land size + acres leased out; otherwise "You cannot enter acres less than the total acres used for Crop Actual/ATM and Leased."
The user tries to delete land with unharvested current-season Crop Actual crops, unharvested ATM items, or land leased out to another farmerDelete is blocked.
Delete is allowedA mandatory reason is asked (spaces become underscores); the land is marked inactive, removed from the local list and a DELETE is queued.
The user saves landA confirmation "I have correctly entered the land particulars..." is always shown.
Land is savedAn MD5 checksum and audit fields (app version, device model and id, created/modified time) are set; the server rejects crop entries whose land checksum is stale.
The user pulls to refreshAll the farmer's assets are fetched from the server; for assets with no local geofence, the latest .kml attachment is downloaded; the local list is rebuilt.
Land was disabled on the server (dataset DisabledAssetCodeForCadre)No new crops can be added to it and Crop Actual cards on it hide Edit and show "land disabled".

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).
GET /gateway/asset-service/api/v1/asset/attachment/bulk?assetIds=Download asset attachments (KML geofences, images) in bulk.
GET /gateway/commons-report-service/api/v1/datasets/name/DisabledAssetCodeForCadre/executeGet land codes that were disabled on the server so the app can mark them disabled.
GET /gateway/asset-service/api/v1/assets/{assetId}Refetch one asset from the server to repair a sync error.
GET /gateway/commons-report-service/api/v1/datasets/name/PlusOneGetOwnedLandByIEID/executeGet a farmer's owned land, used to validate land entries.
GET /rtld/api/dataset/v1/execute?name=PlusOneGetATMNFUsedAcreageByIEIDGet acreage already used by ATM/natural farming, used to validate entries.
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.
DELETE /gateway/asset-service/api/v1/assets/{id}?reason=Disable (soft-delete) a land asset.
App Service v2: operationUse
GET /configTyped config bundle (ETag)
GET /farmers/snapshotCursor-paged hydrated farmer snapshot
GET /farmers/changesDelta sync: upserts and tombstones since a cursor
GET /farmers/{farmerId}/landsA farmer's land parcels
GET /farmers/{farmerId}/metricsOwned, leased, used and available acres
POST /sync/batchApply an ordered batch of offline mutations
POST /filesCreate a file upload (resumable or single-shot)
GET /files/{fileId}File metadata and signed download URL
PATCH /files/{fileId}Append a chunk to a resumable upload
HEAD /files/{fileId}Current offset of a resumable upload

Behaviour notes

  • Help text: one record per parcel; once authenticated only the DPM (District Programme Manager) can edit it, and only on the web.
  • The asset "name" (built from farmer alias, name, category, sub-category, functionality, index and time) is used as the link key by Crop Actual, ATM and geofencing.
  • Possible bug · unverified deleting land removes the local row before the server DELETE succeeds; if sync fails the land vanishes locally until the next refresh.
  • Possible bug · unverified the RoFR tooltip compares a sub-category to a functionality constant, so it may never show.
  • Possible bug · unverified the row date formatter returns on the first parse failure, so the second date format is never tried.
  • Possible bug · unverified maximum acreage of 99.99 means large parcels cannot be entered.

Improve in the rewrite

  • Make authentication an explicit one-time action with a summary instead of a checkbox plus confirmation on every save.
  • Build one shared "land usage" service; today available acreage is computed in three places with slightly different rules.
  • Use the asset id/UUID as the foreign key instead of the name string.
  • Delete locally only after the server confirms (or show a pending-delete state).