Features / Farmer profile

Farmer list & search

The home list of every farmer in the user's selected work area, with search, filters and status badges. In Urvi every farmer (or SHG member) record is called an "IE" (Individual Entrepreneur); once synced it gets a server "IE ID".

FactsheetFarmer profile
Who uses it
Cadre userHAN user (read-only downstream)Unit login (Unit In-charge / FMT)
How you get here
Home screen for cadre users (HomeActivity). Tapping a card opens the Farmer hub; the "+" button opens Add Farmer.
Tables
ie_flat_entity
APIs
3 calls today, 4 App Service operations
Offline
Fully offline: the list reads the local ie_flat_entity table. Pull-to-refresh and the disabled-land worker need the network.

Screens

ScreenWhat it doesSource
Farmer listList, search and filter farmers; open a farmer.app/src/main/java/org/platformcommons/urvi/view/ie/IeFragment.kt
Farmer cardShows name, IE ID, endorsement status, chips and last Crop Actual info.app/src/main/java/org/platformcommons/urvi/view/ie/IeAdapter.kt
Filter sheetStatus, endorsement, model, trade interest, NF category and SHG filters.app/src/main/res/layout/filter_sheet_item.xml

What it captures

FieldTypeRequiredValidationOptions from
SearchTextNoIf the text is all digits and starts with 6, 7, 8 or 9 it searches mobile numbers; otherwise it searches full name or NF category. Matches that start with the text are listed before matches that only contain it.Local farmer table
Farmer statusSingle choiceNoAll / Active / Inactive.Fixed list
EndorsementMulti-selectNoEndorsed, Pending, Flagged, For review.Fixed list
ModelMulti-selectNoATM, A Grade, Compact Block.Fixed list
Interested in tradeSingle choiceNoYes / No.Fixed list
NF CategoryChipsNoC0, C1 w/o PMDS, S2S w/o PMDS, PMDS, PMDS+C1, PMDS+S2S, PMDSW, S2SW, RDS, RDSW, DGC 365. "NF Category 25-26" is a natural-farming label computed by the server.Fixed list
SHGMulti-select dialogNoShows SHG name and SHG id.Distinct SHGs of local farmers

Rules

Conditions from the code, rewritten as plain decision rules.

WhenThen
The search text is all digits and starts with 6, 7, 8 or 9The app searches mobile numbers instead of names.
An SHG or endorsement-status filter is appliedThe list is loaded by a direct database query on SHG and status.
The user pulls to refreshApp configs, the tenant product list and VO endorsements are re-fetched.
The screen resumes, the network is up and the configured interval has passedA background worker downloads the server list of disabled land (dataset DisabledAssetCodeForCadre).
Only part of the data was down-syncedA warning card is shown that opens Data Setup to load more.
The farmer is C4 or C5The card shows a C4/C5 image.

API contracts

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

Today: callUseReplaced by
GET /gateway/commons-report-service/api/v1/datasets/name/PlusOneWorkNodeFarmerListGeoWise/executeDownload the flattened farmer list, page by page (resumable).
GET /gateway/commons-report-service/api/v1/datasets/name/PlusOneWorkNodeFarmerListGeoWiseUnit/executeDownload the farmer list for a Unit In-charge / FMT.
POST /ptld/api/customworknode/v1/worknodeietag/urviCreate the full server-side farmer (IE) from the flat record; also used as get-or-create when a farmer is opened.
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 /endorsementsEndorsement statuses (VO, SHG, farmer)

Behaviour notes

  • The bell icon opens notifications; its count is the number of endorsement comments.
  • Each card shows chips (ATM, A Grade, Compact Block, AAP submitted, NF Category 25-26), the "NF journey" per year, and the last Crop Actual created date and months entered.
  • Possible bug · unverified name search lower-cases the farmer name but not the typed query, so typing capitals finds nothing.
  • Possible bug · unverified mobile search force-unwraps the phone number and crashes when a farmer has no mobile number.
  • Possible bug · unverified the Model filter allows ticking several models but only the first ticked one (ATM, then A Grade, then Compact Block) is applied.

Improve in the rewrite

  • Make search case-insensitive on both sides and null-safe.
  • Apply all ticked Model filters (OR / AND as agreed).
  • Move list queries off the main thread and page the list.