Database / Land & assets

ie_asset

Legacy copy of farmer assets (land, livestock) used by land lists and geofencing.

Table factsheetie_register.db
Written by
  • FarmerAssetsMapper (copy of agri_db farmerassets)
  • IeAssetRepositoryImpl
Read by
  • Land lists (fetchAuthenticatedAssetNames)
  • PortfolioBinderAdapter (is land disabled)
  • GeofencingViewModel
  • CompactBlockImp
  • IePortfolioRepositoryImpl
Filled from
Copied from agri_db farmerassets
Sync
No sync flags.
Source
app/src/main/java/org/platformcommons/urvi/datasource/database/entity/IeAsset.kt

Columns

ColumnTypeNullKeyMeaning
uniqueIdentityKeyINTEGERNoPKLocal autoincrement key. Autoincrement.
assetNameTEXTYesGenerated unique asset name (farmer alias, land name, farmer name, category labels, index, time); sent as the asset code.
assetSubCategoryTEXTYesLabel of assetSubCategoryCode (first server label).
assetSubCategoryCodeTEXTYesReference data code.
notesTEXTYesFree-text description typed on the add/edit asset form.
assetCostTEXTYesNo description in code.
assetCategoryTEXTYesLabel of assetCategoryCode (first server label).
assetCategoryCodeTEXTYesReference data code.
yearOfPurchaseTEXTYesNo description in code.
aliasIdTEXTYesIndexBusiness alias (stable cross-system id). Index: unique.
assetFunctionalityTEXTYesLabel of assetFunctionalityCode (first server label).
qualityTEXTYesQuality code of the asset from the server.
assetFunctionalityCodeTEXTYesReference data code.
parentAliasIdTEXTYesFK → ie.aliasIdaliasId of the parent farmer (legacy ie.aliasId). Link by convention only, no FK constraint.
idINTEGERYesServer id. Null or 0 until the row is synced.
iETEXTYesOwner farmer server id (= farmerassets.owningEntityId).
nameTEXTYesLand name (asset spec asset.spec.land.name).
surveyNumberTEXTYesSurvey number of the land (asset spec asset.spec.land.survey_number).
accountNumberTEXTYesAccount (khata) number of the land (asset spec asset.spec.land.account_number).
landHolderTypeOwnerINTEGERNo1 = owner.
authenticatedINTEGERYesVerified land flag.
assetChecksumTEXTYesContent hash of a land asset. Links this row to the land before the land has a server id.
leasedFromOwningEntityIdTEXTYesFarmer id of the owner the land is leased from (leased-in land).
leasedToOwningEntityIdTEXTYesFarmer id the owned land is leased to.
isLeasedINTEGERYes1 if the land is leased (from the server).
leaseStatusTEXTYesLease state. New leased-in land starts as ASSET_LEASED_STATUS.PENDING.
leaseTypeTEXTYesLease direction. New leased-in land uses ASSET_LEASED_TYPE.INCOMING.
leasedFromAssetIdTEXTYesServer id of the owner's land this leased-in land comes from.
leasedFromWorknodeCodeTEXTYesCode of the SHG (or VO when no SHG was chosen) used to pick the lessor farmer.
leasedFromWorknodeTypeTEXTYesType of node used to pick the lessor farmer: "SHG" when an SHG was chosen, else "VO".
isActiveINTEGERNoSoft-delete flag.
inactiveReasonTEXTYesReason given when the row was deactivated.
inactiveAtINTEGERYesWhen the row was deactivated (epoch millis).
createdAtTEXTYesCreated time from the server.
lastModifiedAtTEXTYesLast modified time from the server.
appCreatedAtTEXTYesCreated on device (epoch millis). Type differs between tables (TEXT vs INTEGER).
appLastModifiedAtTEXTYesLast modified on device (epoch millis).
createdByAppINTEGERYesAudit: app that created/last changed the row.
lastModifiedByAppINTEGERYesAudit: app that created/last changed the row.
createdFromDeviceTEXTYesAudit: device id that created/last changed the row.
lastUpdatedFromDeviceTEXTYesAudit: device id that created/last changed the row.
geoFencingFileNameTEXTYesFile name of the geofence polygon (KML/GeoJSON).
geoFencingCreatedOnTEXTYesWhen the geofence was captured.
geoFencingFilePathTEXTYesLocal path of the polygon file under filesDir/geofencing/.
geoFencingIdINTEGERYesServer attachment id of the geofence file.
allocatedquantity_idINTEGERYesServer id of the embedded object.
allocatedquantity_valueTEXTYesNumeric quantity value (flattened embedded quantity).
allocatedquantity_uomCodeTEXTYesUnit of measure detail (flattened embedded DTO).
totalquantity_idINTEGERYesServer id of the embedded object.
totalquantity_valueTEXTYesNumeric quantity value (flattened embedded quantity).
totalquantity_uomCodeTEXTYesUnit of measure detail (flattened embedded DTO).

Notes

  • fetchAuthenticatedAssetNames: active, authenticated assets of a category for a farmer.