Database / Crops & portfolio

portfolio_question_response

Questionnaire answers attached to a PLI (for example seed source or practices).

Table factsheetagri_db
Written by
  • PLI save (deletes then re-inserts all answers)
Read by
  • Portfolio screens
Filled from
GET /gateway/portfolio-service/api/v1/portfolios/ownerEntities
Sync
Has BaseEntity flags; sent with the PLI.
Source
data/src/main/java/org/mindtree/app/agricultor/data/entity/PortfolioLineItem.kt

Columns

ColumnTypeNullKeyMeaning
portfolioLineItemAppIdTEXTYesFK → portfolio_portfoliolineitem.appIdPortfolio line item app id. Link by convention only, no FK constraint.
idINTEGERYesServer id. Null or 0 until the row is synced.
uuidTEXTYesIndexStable business UUID, also sent to the server. Index: unique.
questionIdINTEGERYesPMDS question number: 1 Type of PMDS, 2 Kits used per acre, 3 Mode of sowing, 4 No of seed varieties sown, 5 Quantity of PMDS seeds used.
categoryTEXTNoQuestion category (required).
subCategoryTEXTYesPMDS_TYPE | KITS_USED | MODE_OF_SOWING | SEED_VARIETY | SEEDS_USED.
questionTypeTEXTYesAnswer type.
questionCodeTEXTYesReference data code.
questionLabelTEXTYesEnglish question text, e.g. "Type of PMDS".
answerLanguageCodeTEXTYesReference data code.
answerValueTEXTYesCoded answer.
answerLabelTEXTYesSelected option number ("1" or "2") for single-select questions.
answerTextTEXTYesFree-text answer.
appCreatedAtTEXTYesCreated on device (epoch millis). Type differs between tables (TEXT vs INTEGER).
appLastModifiedAtTEXTYesLast modified on device (epoch millis).
appIdTEXTNoPKClient-side UUID. Defaults to a random UUID when the object is built, including when server JSON is parsed.
opIdTEXTYesId of the last queued operation in the library queue (SYNC_QUEUE_DB).
syncStatusTEXTNoSYNC_NOT_INITIALIZED | IN_SYNC_QUEUE | SYNC_DONE (default).

Notes

  • deletePortfolioQuestionResponseByPLIAppId runs on every PLI save.