Update Campaign (Boundary/ Resources)

This flow allows the user to update campaign boundary, facility, user, and target details once the campaign is created.

My campaign

Users can go to update campaign flow from the action button present in my campaigns screen.

Updating the campaign is possible only for ongoing and upcoming campaigns.

Screens coming for this update campaign are-

  • Selecting Boundary

  • Update Facility details

  • Update User details

  • Update Target

  • Summary

1. Selecting Boundary

This is the first screen that is displayed to the user when they try to update the campaign from the My Campaigns screen. This screen is already pre-filled with the boundary data which is selected during the campaign creation.

It is impossible to delete the already selected boundaries, user can always add new boundaries if they want to update.

Boundary details

File Path: - https://github.com/egovernments/DIGIT-Frontend/blob/console/health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/UpdateBoundaryWrapper.js

2. Update Facility Data

This screen allows the user to update the facility details:

Update Facility Data

When the user downloads the current facility template, then that template is already filled with the facility details that the user has entered during the time of campaign creation.

In this user can add the new facilities.

3. Upload User Details

This screen allows the user to update the facility details:

Update user details

When the user downloads the current user template, then that template is already filled with the user details that the user has entered during the time of campaign creation.

In this user can add a new user.

4. Update Targets

This screen allows the user to update targets:

Update target details

When the user downloads the current target template then that template is already filled with the target details that the user has entered during the time of campaign creation.

In this user can add the new targets or change the existing ones.

The file path of all the upload screens:

https://github.com/egovernments/DIGIT-Frontend/blob/console/health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/UploadData.js

5. Summary

This helps the user to view the summary of all the entered details in the previous screens:

Summary

File path - https://github.com/egovernments/DIGIT-Frontend/blob/console/health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/CampaignUpdateSummary.js

Working of the update campaign flow-

The update campaign flow works similarly to the setup campaign. But the difference is that here we send the parentId in the URL and fetch it from there.

When the user clicks on next after the boundary details screen, the create API is called with parentID in the params and with action = draft. Then for the subsequent steps update API is called. In the summary screen again create API is called again but with action = 'create'. This action updates the campaign.

File Path: - https://github.com/egovernments/DIGIT-Frontend/blob/console/health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/UpdateCampaign.js

Validation of the update campaign

  1. If no new boundary selected - If the user has not selected any new boundary then, to update the campaign at least one data upload is necessary.

  2. New Boundaries Added - If the user has selected new boundaries then all the 3 data uploads are necessary for the user.

API Details

Action
Role
Payload

/project-factory/v1/project-type/create

CAMPAIGN_MANAGER

"action": "draft", "action": "create", to update the campaign

/project-factory/v1/project-type/search

CAMPAIGN_MANAGER

only id is required in params

/project-factory/v1/project-type/update

CAMPAIGN_MANAGER

/project-factory/v1/data/_download

CAMPAIGN_MANAGER

Params will be different for different types- 1) boundary tenantId:mz

type:boundary

hierarchyType:ADMIN

id:987eadc3-55a0-4553-925d-bf8087f57e5a 2) facilityWithBoundary tenantId:mz

type:facilityWithBoundary

hierarchyType:ADMIN

id:052f59fc-18a7-4e07-816a-f5d8062b56b5 3) userWithBoundary tenantId:mz

type:userWithBoundary

hierarchyType:ADMIN

id:fbfbd393-d053-4f51-9e12-1068b97da292

Was this helpful?