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
| Screen | What it does | Source |
|---|---|---|
| Land list | Parcels 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 land | Form for one parcel (class AddUpdateAssetFragment). | app/src/main/java/org/platformcommons/urvi/view/landasset/AddUpdateAssetNewDialog.kt |
| Land view model | Load, save, delete and refresh land. | app/src/main/java/org/platformcommons/urvi/view/landasset/LandAssetViewModel.kt |
| Disabled land | Lists farmers whose land was disabled on the server. | app/src/main/java/org/platformcommons/urvi/view/ie/DisabledLandFragment.kt |
What it captures
| Field | Type | Required | Validation | Options from |
|---|---|---|---|---|
| Authenticate | Checkbox | No | Can be ticked when the land is new or not yet authenticated; locked once saved as authenticated. | User input |
| Asset Category | Dropdown | Yes | Each 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 Type | Single choice (Owner / Cultivator) | If sub-category is Land Owned | Fixed list | |
| Land Type | Single choice (Irrigated / Rain-fed) | Yes | Decides the functionality code. | Fixed list |
| Description | Text | No | Shown for Land Owned Others and Leased-in Land Others. | User input |
| Name | Text | If visible | User input | |
| Khata No | Text | If the khata-mandatory config is on and the sub-category is not Leased-in, RoFR, Endowment, Assigned/D-Patta, Owned Others or Leased Others | A "*" is added to the label when mandatory. Hidden for Leased-in Land. | User input |
| Survey No | Text | If the survey-mandatory config is on and the sub-category is not Leased-in | Hidden for Leased-in Land. | User input |
| Acres | Decimal | If not Leased-in | Greater than 0; at most 2 digits before and 2 after the decimal point (max 99.99). Unit is always acres. | User input |
| Land Leased To | Read-only text | No | Shown only for Land Owned when a leased-to farmer is already set. | Server |
Rules
Conditions from the code, rewritten as plain decision rules.
| When | Then |
|---|---|
| The land is authenticated and admin does not allow editing authenticated land | Tapping the row shows "Land has already been authenticated. You cannot edit!!". |
| Category master data has not loaded | The Add Land button stays disabled. |
| Editing and the acreage changed | New 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 farmer | Delete is blocked. |
| Delete is allowed | A 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 land | A confirmation "I have correctly entered the land particulars..." is always shown. |
| Land is saved | An 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 refresh | All 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.
| App Service v2: operation | Use |
|---|---|
GET /config | Typed config bundle (ETag) |
GET /farmers/snapshot | Cursor-paged hydrated farmer snapshot |
GET /farmers/changes | Delta sync: upserts and tombstones since a cursor |
GET /farmers/{farmerId}/lands | A farmer's land parcels |
GET /farmers/{farmerId}/metrics | Owned, leased, used and available acres |
POST /sync/batch | Apply an ordered batch of offline mutations |
POST /files | Create 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).