endorsement_entity
Endorsement (VO/SHG approval) record for a VO, SHG or farmer, including review and abstract PDF.
Table factsheetagri_db
- Written by
FetchEndorsementDataWorker,FetchEndorsementForVoDataWorkerSetupIeFlatSchemaDataEndorsementRepositoryImpl- Endorse / review / upload abstract (
createEndorsement,updateEndorsement,uploadEndorsementAbstract)
- Read by
- Endorsement screens
- Farmer detail (
getEntityForIeId)
- Filled from
GET rtld/api/dataset/v1/execute (endorsement datasets)- Sync
- No BaseEntity flags. Local changes are queued in sync_ledger as ENDORSEMENT and ENDORSEMENT_ATTACHMENT.
- Source
- data/src/main/java/org/mindtree/app/agricultor/data/sync/entity/EndorsementEntity.kt
Columns
| Column | Type | Null | Key | Meaning |
|---|---|---|---|---|
id | INTEGER | Yes | Server id. Null or 0 until the row is synced. | |
entityType | TEXT | Yes | ENTITY.TYPE.VO | SHG | FARMER. | |
entityId | TEXT | Yes | FK → ie_flat_entity.iEOLTPId | Id of the endorsed VO, SHG or farmer. Link by convention only, no FK constraint. |
entityCode | TEXT | Yes | For farmer rows: farmer alias (ie_flat_entity.uuid); otherwise entity_code from the server. | |
endorsedBy | TEXT | Yes | Who endorsed or flagged: "firstName--loginName" of the logged-in user, or endorsed_by from the server. | |
name | TEXT | Yes | Display name: VO name, SHG name or farmer full name. | |
status | TEXT | Yes | PENDING | ENDORSED | FLAGGED | FOR_REVIEW. | |
districtName | TEXT | Yes | District name of the VO/SHG/farmer. | |
unitName | TEXT | Yes | unit_name from the server. For locally built farmer rows the app puts the farmer's phone number here. | |
timestamp | INTEGER | Yes | Endorsed time (epoch millis). | |
endorsedUserId | INTEGER | Yes | User id of the person who endorsed or flagged. | |
mandalCode | TEXT | Yes | Mandal code: mandal_code from the server, or ie_flat_entity.mandalCode for locally built rows. | |
mandalName | TEXT | Yes | Mandal name of the VO/SHG/farmer. | |
voCode | TEXT | Yes | VO id (= ie_flat_entity.vOId). | |
voName | TEXT | Yes | Name of the VO. | |
shgCode | TEXT | Yes | SHG id (= ie_flat_entity.sHGID). | |
shgName | TEXT | Yes | Name of the SHG. | |
reviewdBy | TEXT | Yes | Reviewer (column name typo). | |
reviewByUserId | INTEGER | Yes | User id of the person who marked the record "for review" (resolved). | |
reviewedTimestamp | INTEGER | Yes | No description in code. | |
abstractFile | TEXT | Yes | Path or URL of the generated abstract PDF. | |
hasNpmShop | INTEGER | Yes | 1 if the VO has an NPM shop. | |
endorsementType | TEXT | Yes | null = regular endorsement, else a survey type. | |
created_at | INTEGER | Yes | Created time; added in migration 39 to 40 with typo type INTERGER. | |
uuid | TEXT | No | PK | Primary key (business UUID). |
Notes
- saveEndorsements clears the whole table, then inserts, so unsynced local rows can be lost on refresh.
- getEntityForIeId: latest non-null-status endorsement of a farmer by created_at DESC.
- getCountOfEndorsedSHGForVo: distinct ENDORSED SHGs of a VO.
- Possible bug · unverified clear-and-insert on refresh may wipe local endorsements that are not yet synced.
- Missing index on entityId.