Each option shows only if remote config's enabled-versions list contains the current versionName_versionCode.
Remote config
Early Harvest Reason
Text
If current month is before the month of the crop's expected harvest date
Hidden otherwise.
User input
Total output (quintals)
Decimal
Yes
0-999.99 (up to 3 whole digits, 2 decimals).
User input
Surplus for sale (quintals)
Decimal
Yes
0-999.99 and less than or equal to total output.
User input
Interested in marketing with RySS
Checkbox
No
Shown only for Whole crop when surplus > 0.
User input
Harvest date
Date (yyyy-MM-dd)
Yes
Latest = today. Earliest = crop's previous harvest end date + 1 day.
Date picker
Photo
Camera
If Whole crop
Location must be captured first.
Device camera
Location
GPS
Yes
Device GPS
Rules
Conditions from the code, rewritten as plain decision rules.
When
Then
Form is valid and confirmed
A harvest_logs row is written (quantity, surplus, harvest date as complete date, status, type, PLI id, product line item id, earlyHarvestReason, interestedInCropMarketing), the portfolio product's harvest status and complete date update, and sync is triggered.
HarvestWorker runs
Harvest log is POSTed for the owner.
API contracts
Each call opens to its use case, headers, request and response bodies, and errors.
Possible bug · unverifiedphoto and GPS are required to pass validation but are not stored in harvest_logs or sent (not confirmed against the server payload).
Improve in the rewrite
Merge with ATM harvest into one component with consistent date rules and limits.
Persist and upload photo and geotag, or drop the requirement.
Replace version-list feature gating with a simple per-option flag.