Leased land
Lets a farmer record land they lease in from another farmer by picking the lessor and the lessor's parcels. One land record is created per selected lessor parcel.
FactsheetAssets & land
- Who uses it
- Cadre user
- How you get here
- Land list > Add Land > Asset Category "Leased-in Land" (Irrigated or Rain-fed).
- Tables
ie_asset,farmerassets- APIs
- 12 calls today, 10 App Service operations
- Offline
- Partly offline: the location cascade needs internet to start; parcel availability falls back to a local calculation; saves are queued.
Screens
| Screen | What it does | Source |
|---|---|---|
| Add / Edit land (leased-in section) | Pick lessor location, lessor and lessor parcels. | app/src/main/java/org/platformcommons/urvi/view/landasset/AddUpdateAssetNewDialog.kt |
What it captures
| Field | Type | Required | Validation | Options from |
|---|---|---|---|---|
| District > Mandal > Village > VO > Habitation > SHG | Cascading dropdowns | Yes (to find the lessor) | Districts are fetched only when online. SHG list starts with "Non-SHG". | Server datasets PlusOneGetAllDistricts, ...MandalsForDistrict, ...VillagesForMandal, ...VOForVillage, ...HabitationForVOAliasId, PlusOneHabitationSHGList |
| Land Leased From | Dropdown | Yes | The current farmer is excluded. | SHG farmers (PlusOneWorkNodeFarmerHusbandFatherSHGWise), VO non-SHG farmers, or local farmers |
| Lessor's land parcels | Checklist with leased acres | Yes (at least 1) | Multi-select when new, single-select when editing. Leased acres must be greater than 0 and no more than the parcel's available land. | PlusOneGetOwnedLandByIEID minus PlusOneGetATMNFUsedAcreageByIEID; offline: owned minus leased-out minus ATM minus current Crop Actual |
Rules
Conditions from the code, rewritten as plain decision rules.
| When | Then |
|---|---|
| Leased acres for a parcel are 0 or more than the parcel's available land | Error "Land limit exceed." |
| Editing an existing lease | Available land = available + this lease's current acres. |
| The lease is saved | One asset is created per selected parcel, copying its khata, survey number and leased acres, with lease type INCOMING and lease status PENDING. |
| The lessor parcel has a geofence | The new leased-in record inherits it. |
| The device is offline | Districts cannot be loaded and available acres are computed locally. |
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 /geo/children | Children of a geography node |
GET /farmers/snapshot | Cursor-paged hydrated farmer snapshot |
GET /farmers/search | Search farmers in a geography (online) |
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) |
PATCH /files/{fileId} | Append a chunk to a resumable upload |
HEAD /files/{fileId} | Current offset of a resumable upload |
Behaviour notes
- Rows show Leased-from / Leased-to badges on the Land list.
- Possible bug · unverified each leased record gets a random-character suffix in its name, and editing several records saves them in a loop; a failure mid-way leaves a partial save.
Improve in the rewrite
- Model a lease as one record linking lessor parcel and lessee instead of copying parcel data.
- Save multi-parcel leases atomically.