Draft Flows
Overview
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.
Workflow
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:
/employee/microplan/setup-microplan?key=${resolvedKey}µplanId=${row.id}&campaignId=${row.campaignDetails.id}The row represents a plan object.
Retrieving Last Edited Screen: The last edited screen is retrieved from the
additionalDetailsfield in the/plan-service/config/searchresponse.User Input: The user fills in the required details on the redirected page. The input is stored in
totalFormdata, which holds the input as key-value pairs.Updating the Plan: The
totalFormdata is used to update the plan object. TheuseCreateUpdatePlanProjecthook is utilised 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, theadditionalkey 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.
API Endpoints
/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?