Draft Flow
The draft flow enables admins to edit microplans. When a user reopens a microplan via the microplan search, it loads at the last edited page.
Overview:
Flow Summary:
Edit Microplans: Admins edit the microplan, which redirects to
employee/microplan/setup-microplan?key=8µplanId=c4cb8a1b-ef4f-4998-afe4-5dd0432c1&campaignId=ef3f044f-047f-4eb5-adb1-5dbc92507461
(sample URL).User Edits: Users update details such as data management, boundary selection, and user-tagging.
Save Changes: Changes are saved.
Reopen Microplan: When reopened, the microplan loads the last edited page for further edits.
Implementation:
Redirection:When the user clicks "Edit Microplan," they are redirected to the following URL:
row represents plan object
Retrieving Last Edited Screen: The last edited screen is retrieved from the
additionalDetails
field in the/plan-service/config/search
response.User Input: The user fills in the required details on the redirected page. The input is stored in
totalForm
data, which holds the input as key-value pairs.Updating the Plan: The
totalForm
data is used to update the plan object. TheuseCreateUpdatePlanProject
hook is utilized to update the appropriate attributes of the plan based on the current screen. The updated plan object is then sent to/plan-service/config/update
. Primarily, theadditional
key is updated to ensure that the user lands on the last edited page during subsequent edits.Campaign Object Update: For boundary and microplan details pages, the campaign object is also updated. The updated campaign object is sent to
/project-factory/v1/project-type/update
.
/plan-service/config/search
POST
{ "PlanConfigurationSearchCriteria": { "tenantId": "mz", "id": "c4cb8a1b-ef4f-4998-afe4-5dd0432c11a2" } }
/plan-service/config/_update
POST
[ { "id": "c4cb8a1b-ef4f-4998-afe4-5dd0432c11a2", "tenantId": "mz", "name": "Malaria-SMC Campaign-Fixed Post-07 Jan 25j", "campaignId": "ef3f044f-047f-4eb5-adb1-5dbc92507461", "status": "DRAFT","additionalDetails": { "key": "6", "assumptionsForm": { "selectedRegistrationDistributionMode": { "code": "TOGETHER", "value": "Together" } }, "campaignType": "MR-DN", "DistributionProcess": "FIXED_POST", "RegistrationProcess": "FIXED_POST", "resourceDistributionStrategyCode": "FIXED_POST", "isRegistrationAndDistributionHappeningTogetherOrSeparately": "TOGETHER" }, "workflow": null } ]
project-factory/v1/project-type/update
POST
{ "id": "ef3f044f-047f-4eb5-adb1-5dbc92507461", "tenantId": "mz", "status": "drafted", "action": "draft", "campaignNumber": "CMP-2025-01-07-007018", "isActive": true, "parentId": null, "campaignName": "Malaria-SMC Campaign-Fixed Post-07 Jan 25k", "projectType": "MR-DN", "hierarchyType": "MICROPLAN", }
Last updated
Was this helpful?