Features / Planning & tracking

PMDS and A Grade crop details

Extra questions shown on a Crop Actual block when the crop type is PMDS (pre-monsoon dry sowing, a natural-farming practice of sowing seed mixes before the monsoon) or A Grade (a crop type that must include associated and bio-diversity crops).

FactsheetPlanning & tracking
Who uses it
Cadre user
How you get here
Add/Edit crop block, after picking crop type PMDS or A Grade.
Tables
portfolio_question_response, portfolio_portfoliolineitem_portfolioproductlineitem
APIs
2 calls today, 4 App Service operations
Offline
Saved with the crop block and synced with it.

Screens

ScreenWhat it doesSource
Add / Edit crop block (PMDS section)PMDS questions and A Grade crop lists.app/src/main/java/org/platformcommons/urvi/view/portfolio/AddPortfolioActivity.kt
A Grade crop listAssociated and bio-diversity crop rows.app/src/main/java/org/platformcommons/urvi/view/portfolio/PortfolioAGradeCropAdapter.kt

What it captures

FieldTypeRequiredValidationOptions from
Type of PMDSRadio (Regular / Pelletized)If PMDSFixed list
Kits used per acre @15 kgRadio (1 / 2)If PMDS and RegularFixed list
Mode of sowingRadio (Broadcasting / Line sowing)If PMDSFixed list
No. of seed varieties sownWhole numberIf PMDS6 to 35.User input
Quantity of PMDS seeds used (kg)DecimalIf PMDS1 to 999 kg; up to 3 digits before and 2 after the decimal point.User input
Associated cropsMulti-selectIf A Grade (at least 2)Select Crop sheet
Bio-diversity cropsMulti-selectIf A Grade (at least 2)Select Crop sheet

Rules

Conditions from the code, rewritten as plain decision rules.

WhenThen
Crop type is PMDSThe AP_GOV_PMDS crop is added automatically and "Add crop" is hidden.
Crop type is A GradeOnly one main crop is allowed and the A Grade practice is added automatically.
A crop is removed or the crop type changes away from PMDSStored PMDS answers are deleted.
PMDS / RDS crop-type config switches are offThose crop types are not offered.

API contracts

Each call opens to its use case, headers, request and response bodies, and errors.

App Service v2: operationUse
GET /configTyped config bundle (ETag)
GET /farmers/snapshotCursor-paged hydrated farmer snapshot
GET /farmers/{farmerId}/crop-blocksA farmer's Crop Actual blocks for a season / month
POST /sync/batchApply an ordered batch of offline mutations

Behaviour notes

  • Associated and bio-diversity crops are merged into the block's crop list on save.

Improve in the rewrite

  • Drive the PMDS questions and ranges from server config rather than code.