Features / Farmer profile

Farmer category (Farmer/C4/C5)

Every farmer has a "Current Member Category": Farmer, C4 (Non-Agri, no farming) or C5 (POP). The category decides which farm modules open, and it freezes after a deadline or once land is authenticated.

FactsheetFarmer profile
Who uses it
Cadre userUnit login (relies on frozen category for endorsement)
How you get here
Set on the Add/Edit farmer screen; checked by the Farmer hub tiles and by endorsement.
Tables
ie, ie_flat_entity
APIs
2 calls today, 3 App Service operations
Offline
Category is stored locally with the farmer record and synced with it. Endorsement refreshes the admin deadline from the server dataset PLUS_ONE_FARMING_CATEGORY_LAST_UPDATE_DATE.

Screens

ScreenWhat it doesSource
Add / Edit Farmer (category radios)Pick the current member category.app/src/main/java/org/platformcommons/urvi/view/ie/AddIeFragment.kt
Category freeze checkDecides whether the category can still change.app/src/main/java/org/platformcommons/urvi/utility/AppUtils.kt

What it captures

FieldTypeRequiredValidationOptions from
Current Member CategoryRadioIf ActiveFarmer / C4 (Non-Agri) / C5 (POP). Changing it resets the category-set date (gapStartDate) to now.Fixed list

Rules

Conditions from the code, rewritten as plain decision rules.

WhenThen
The category-set date is later than the admin-configured last mandatory category update dateThe category is frozen and cannot be edited.
The member is a Farmer and any of their land is authenticatedThe category is frozen.
The category is C4 or C5Land, Crops, Crop Plan, Crop Actual and Certification tiles are blocked; Livestock is still allowed.
The category is C4Comments (endorsement) tile is blocked, but at endorsement time a C4 farmer can be endorsed without KAP submission.
The farmer has no category at allMost farm tiles show an "update category" message and do not open.
Opening Crop Actual while the category update is still due (not frozen)A "change category" dialog is shown first.

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/PLUS_ONE_FARMING_CATEGORY_LAST_UPDATE_DATE/executeGet each farmer's farming-category last update (gap start) date.
PATCH /ptld/api/customworknode/v1/worknodeietag/urvi/ieUpdate a farmer profile or farming category / gap start date.
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

  • Stored as "<KAP 2021-22 category>/<current category>", for example "N-A/Farmer". The KAP 2021-22 category radio is hidden and always disabled.
  • Possible bug · unverified the category is saved and parsed as its label text (including Telugu), so language changes alter the stored value.

Improve in the rewrite

  • Store the category as a code (FARMER, C4, C5) and keep the label for display only.
  • Show the lock reason (deadline passed, land authenticated, admin flag) on screen.