harvest_logs
Harvest record for a crop in the portfolio flow: dates, type, quantity and surplus.
Table factsheetagri_db
- Written by
- Harvest (
IePortfolioRepositoryImpl,BridgeSyncHelper->Repo.createHarvestLogs) HarvestPostRH(writes server id)
- Harvest (
- Read by
HarvestWorker(getHarvestby uuid)
- Sync
- No BaseEntity flags. Queued as sync entity HARVEST via sync_ledger; the server id is written back into the id column.
- Source
- data/src/main/java/org/mindtree/app/agricultor/data/entity/HarvestLogs.kt
Columns
| Column | Type | Null | Key | Meaning |
|---|---|---|---|---|
id | INTEGER | No | PK | Local autoincrement, later overwritten with the server id by updateHarvest(uuid, serverId). Autoincrement. |
earlyHarvestReason | TEXT | Yes | Reason for harvesting early. | |
harvestDate | TEXT | Yes | Harvest date, yyyy-MM-dd. Set to the end date because the start-date picker was removed. | |
harvestCompleteDate | TEXT | Yes | Harvest end date, yyyy-MM-dd. | |
portfolioLineItemId | TEXT | Yes | FK → portfolio_portfoliolineitem.id | Portfolio line item id. Link by convention only, no FK constraint. |
productLineItemId | TEXT | Yes | PPLI server id of the harvested crop (same value as portfolioProductLineItemId). | |
harvestStatus | TEXT | Yes | HARVEST_STATUS.PENDING (continuous harvest) | HARVEST_STATUS.COMPLETED (whole crop). | |
harvestType | TEXT | Yes | HARVEST_TYPE.WHOLE | HARVEST_TYPE.CONTINOUS. | |
portfolioProductLineItemId | TEXT | Yes | FK → portfolio_portfoliolineitem_portfolioproductlineitem.id | Portfolio product line item id. Link by convention only, no FK constraint. |
genericProduct | TEXT | Yes | Product code of the harvested crop (= PPLI genericProduct). | |
ownerId | TEXT | Yes | Farmer server id. | |
ownerEntityType | TEXT | Yes | Owner type, normally the farmer (IE) entity type. | |
uuid | TEXT | No | Business UUID (no unique index). | |
interestedInCropMarketing | INTEGER | Yes | 1 if the farmer wants help marketing the crop. Asked only for whole-crop harvests; null for continuous. | |
surplusOutput_id | INTEGER | Yes | Server id of the embedded object. | |
surplusOutput_value | REAL | Yes | Numeric quantity value (flattened embedded quantity). | |
surplusOutput_uoM_symbol | TEXT | Yes | Unit of measure detail (flattened embedded DTO). | |
surplusOutput_uoM_code | TEXT | Yes | Unit of measure detail (flattened embedded DTO). | |
surplusOutput_uoM_unitName | TEXT | Yes | Unit of measure detail (flattened embedded DTO). | |
surplusOutput_uoM_measurementtype_label | TEXT | Yes | Unit of measure detail (flattened embedded DTO). | |
surplusOutput_uoM_measurementtype_dataCode | TEXT | Yes | Unit of measure detail (flattened embedded DTO). | |
surplusOutput_uoM_measurementtype_globalrefclass_classCode | TEXT | Yes | Unit of measure detail (flattened embedded DTO). | |
surplusOutput_uoM_measurementtype_globalrefclass_name | TEXT | Yes | Unit of measure detail (flattened embedded DTO). | |
surplusOutput_uoM_measurementtype_language_language | TEXT | Yes | Language name. | |
surplusOutput_uoM_measurementtype_language_languageCode | TEXT | Yes | Language code (ENG, TEL, ...). | |
quantity_id | INTEGER | Yes | Server id of the embedded object. | |
quantity_value | REAL | Yes | Numeric quantity value (flattened embedded quantity). | |
quantity_uoM_symbol | TEXT | Yes | Unit of measure detail (flattened embedded DTO). | |
quantity_uoM_code | TEXT | Yes | Unit of measure detail (flattened embedded DTO). | |
quantity_uoM_unitName | TEXT | Yes | Unit of measure detail (flattened embedded DTO). | |
quantity_uoM_measurementtype_label | TEXT | Yes | Unit of measure detail (flattened embedded DTO). | |
quantity_uoM_measurementtype_dataCode | TEXT | Yes | Unit of measure detail (flattened embedded DTO). | |
quantity_uoM_measurementtype_globalrefclass_classCode | TEXT | Yes | Unit of measure detail (flattened embedded DTO). | |
quantity_uoM_measurementtype_globalrefclass_name | TEXT | Yes | Unit of measure detail (flattened embedded DTO). | |
quantity_uoM_measurementtype_language_language | TEXT | Yes | Language name. | |
quantity_uoM_measurementtype_language_languageCode | TEXT | Yes | Language code (ENG, TEL, ...). |
Notes
- Possible bug · unverified id is both a local autoincrement and the server id.
- Dropped and recreated in migration 14 to 15 (data lost).
- No unique index on uuid.