-
Type:
Task
-
Resolution: Done
-
Priority:
Medium
-
Affects Version/s: None
-
None
-
STOP TB Sprint 9, STOP TB Sprint 10
Description:
When a form schema is updated (fields added, removed, renamed, or changed in type or options), beneficiaries registered with an older version of the form still have data saved against the old schema. The app must load and update these beneficiaries using the latest form version without losing, corrupting, or mis-mapping existing data.
Scope:
- Map existing beneficiary data from the old form version onto the latest form schema when opening a beneficiary for edit or update.
- Fields that exist in both versions are pre-filled with the existing values.
- Newly added fields appear empty (or with default values) and follow the new validation rules.
- Fields removed in the new version are kept in stored data, not silently deleted, unless agreed otherwise. They are not shown in the UI.
- Changed field types or options (for example, dropdown values updated) are handled gracefully, with no crash and no invalid pre-selection.
- Saving the beneficiary with the new form stores the data against the new form version.
Acceptance criteria:
- Fill and save a beneficiary using the old form version.
- Update the form version, then open the same beneficiary.
- Existing values are correctly pre-filled in the new form.
- New fields can be filled and saved, and old data is not lost.
- The app does not crash on missing, extra, or changed fields.
- The updated record syncs to the backend with the correct form version.