ierolemap
Role or designation of a farmer, such as lead farmer or CRP.
Table factsheetagri_db
- Written by
- Legacy setup (IERoleMapDTO)
- Data down-sync (
SetupService.fetchIERolesfromDataSetupViewModel,SetupForUser) - Add farmer designation (
BridgeSyncHelper.createIE) - Response handlers IERoleMapPost/Patch/
DeleteRH
- Read by
- Activity tracker (
getAllLeadFarmer) - IERoleMapMapper (builds legacy
ie.designation)
- Activity tracker (
- Filled from
POST api/setupdata/v2 (IERoleMapDTO)GET /ctld/api/ierolemap/v1?criteria=- Sync
- appId is a client UUID primary key. syncStatus starts at SYNC_DONE for downloaded rows, becomes SYNC_NOT_INITIALIZED when the row is created or edited on the device, and goes back to SYNC_DONE when the response handler writes the server id. opId holds the id of the last queued library operation. Sync entity IE_ROLE_MAP (POST, PATCH, DELETE).
- Source
- data/src/main/java/org/mindtree/app/agricultor/data/entity/IERoleMap.kt
Columns
| Column | Type | Null | Key | Meaning |
|---|---|---|---|---|
isActive | INTEGER | Yes | Soft-delete flag (1 = active). | |
id | INTEGER | Yes | Server id. Null or 0 until the row is synced. | |
appId | TEXT | No | PK | Client-side UUID. Defaults to a random UUID when the object is built, including when server JSON is parsed. |
opId | TEXT | Yes | Id of the last queued operation in the library queue (SYNC_QUEUE_DB). | |
syncStatus | TEXT | No | SYNC_NOT_INITIALIZED | IN_SYNC_QUEUE | SYNC_DONE (default). | |
role_code | TEXT | Yes | Role code, e.g. role.ap.gov.leadfarmer. | |
role_roleName | TEXT | Yes | Display name of the role, e.g. "Lead Farmer". Shown in the designation list. | |
role_description | TEXT | Yes | No description in code. | |
role_roleType | TEXT | Yes | Role type. The app sends ROLE_TYPE.TENANT when it creates a mapping. | |
ie_id | TEXT | Yes | FK → ie_flat_entity.iEOLTPId | Farmer server id. Link by convention only, no FK constraint. |
ie_isActive | INTEGER | Yes | Active flag of the embedded object. | |
ie_person_id | INTEGER | Yes | Server id of the embedded object. | |
ie_person_personprofile_firstName | TEXT | Yes | Farmer profile: first name. | |
ie_person_personprofile_id | INTEGER | Yes | Server id of the embedded object. | |
ie_caretakertenant_loginName | TEXT | Yes | Farmer caretaker tenant: login name. | |
ie_caretakertenant_id | INTEGER | Yes | Server id of the embedded object. | |
appmill_metadata_ie_appId | TEXT | Yes | FK → ie.appId | Local appId of the owning farmer (ie.appId). Used to link rows before the farmer has a server id. Link by convention only, no FK constraint. |
Notes
- getAllLeadFarmer filters role_code = 'role.ap.gov.leadfarmer'.
- Active roles are looked up by farmer server id or, for unsynced farmers, by local IE appId.