DIGIT Docs
v0.3.1
  • DIGIT Knowledge Base
  • Local Governance
v0.3.1
  • Introducing HCM Console
  • Release Notes
    • v0.3.1: Release Notes
      • Service Build Updates
      • Master Data Management Service (MDMS) & Configuration Updates
      • HCM Console Test Cases V0.3.1
    • v0.3: Release Notes
      • v0.3 Technical Release Summary
      • Service Build Updates
      • Master Data Management Service (MDMS) & Configuration Updates
      • HCM Console Test Cases V0.3
      • Gate 2 Release Checklist
        • Release Showcase
    • v0.2: Release Notes
      • v0.2 Technical Release Summary
      • Service Build Updates
      • Master Data Management Service (MDMS) & Configuration Updates
    • v0.1: Release Notes
      • v0.1 Technical Release Summary
      • Service Build Updates
      • Master Data Management Service (MDMS) & Configuration Updates
      • Gate 2 Release Checklist
  • PRODUCT SPECIFICATION
    • User Manual
    • Product Requirement Document (PRD)
    • Functional Specifications
  • TECHNOLOGY
    • Architecture
      • High Level Design
        • Project Factory
      • Low Level Design
        • Project Factory (Campaign Manager)
          • Create Campaign
          • Update Campaign
          • Manage Resources
        • Admin Console
          • Campaign Creation Flow
          • Campaign Updation Flow
          • Checklist Management
      • Services
        • Project Factory
          • Manage Campaign APIs
            • Microplan Integration
            • Update an Ongoing Campaign
          • Manage Data APIs
            • Target Upload
          • Manage Boundary APIs
            • Boundary Generation
            • Boundary Management
            • Boundary Management Through GeoJson
        • HCM Console Web
          • User Interface Design
          • Manage Campaign
            • Setup Campaign (New Campaign)
              • Campaign Details
              • Boundary Details
              • Delivery Details
              • Resource Upload Details
              • Summary Screen
              • Setup Campaign from Microplan
              • Setup and Implementation of Campaign
              • IRS Console Support
              • Data Mapping Screen (v0.3 Patch)
              • Co-Delivery Console Support
            • My Campaign
              • My Campaign Actions
              • Campaign Timeline
              • Update Campaign (Boundary/ Resources)
              • Update Campaign Dates
          • Boundary Data Management
          • Manage Checklist
            • Default Templates
  • SETUP
    • Installation
    • Configuration
      • UI Configurations
      • Steps to Enable a New Campaign Type in Console
      • Advanced Configurations
    • Quality Assurance Testing
      • Automation - Run HCM Console Script
        • User
        • Target
        • Facility
      • Performance Testing
  • GENERAL
    • Product Roadmap
Powered by GitBook

All content on this page by eGov Foundation is licensed under a Creative Commons Attribution 4.0 International License.

On this page

Was this helpful?

Export as PDF
  1. TECHNOLOGY
  2. Architecture
  3. Services
  4. Project Factory
  5. Manage Campaign APIs

Update an Ongoing Campaign

This flow comes in picture if u have parentId present in your request body and that parent campaign should be in created state.

In case parent campaign is present-

Introduced two new columns in Campaign Details table i.e isActive(boolean) and parentId (string)

Validate Parent Campaign(if parentId present)

  1. If actionInUrl is create ,then parentCampaign should be active or isActive of parentCampaign should be true.

  2. If actionInUrl is update, then parentCampaign should be inActive or isActive of parentCampaign should be false.

Validate Boundaries (If Parent Campaign Present)

1. Boundaries array in new Campaign should contain only newly added boundaries and the existing boundaries are fetched from parent Campaign and new boundaries are formed by merging both.

If actionInUrl is create and parentCampaign is present ,call the generate of templates of all three types(boundary, user, facility) .

Create Project -

  1. If new boundaries are selected in update flow , then projects are created only for those newly added boundaries.

  2. If existing targets are updated then update project is called with updated project target mappings.

Edit generated facility and user sheets -

  1. Once you are in update campaign flow, you can edit the existing facility mappings to boundary codes and also make it inactive or active and this would subsequently update the mappings like Project Facility and Project Staff mappings .

Retry Mechanism -

If campaign fails ,we have added retry feature so that it can be restarted from same point where it failed(needs more optimisation).

Update Campaign Object-

```
   "CampaignDetails":  {
            "id": "2b68a3aa-fca2-462e-8d59-8821c9a56132",
            "tenantId": "mz",
            "status": "drafted",
            "action": "create",
            "campaignNumber": "CMP-2024-10-15-004031",
            "isActive": true,
            "parentId": "43503755-db1d-4cef-9851-72360ee6eaa1",
            "campaignName": "LLIN-OCT15a",
            "projectType": "LLIN-mz",
            "hierarchyType": "HIERARCHYTEST",
            "boundaryCode": "",
            "projectId": null,
            "startDate": 1727202600000,
            "endDate": 1727720999000,
            "additionalDetails": {
                "key": 10,
                "beneficiaryType": "HOUSEHOLD"
            },
            "resources": [
            {
                "type": "facility",
                "filename": "update-facility.xlsx",
                "resourceId": "42c04e62-4b7b-4697-b2bd-aa90a212164c",
                "filestoreId": "20420b29-d913-4412-b3bd-34b850e2677b"
            },
            {
                "type": "boundaryWithTarget",
                "filename": "updated-boundary.xlsx",
                "resourceId": "8567db53-450e-465d-a14a-46e2690cf728",
                "filestoreId": "30ae3fd6-b77c-42e7-9a33-e88e29369764"
            },
            {
                "type": "user",
                "filename": "updated-user.xlsx",
                "resourceId": "fcc4a423-6ac5-4ee4-80c2-0f915a95253f",
                "filestoreId": "3c531af7-d923-47cc-b58a-c501a73e749c"
            }
        ],
            "boundaries": [],
            "deliveryRules": [
                {
                    "active": true,
                    "cycleIndex": "1",
                    "deliveries": [
                        {
                            "active": true,
                            "deliveryIndex": "1",
                            "deliveryRules": [
                                {
                                    "ruleKey": 1,
                                    "delivery": {},
                                    "products": [
                                        {
                                            "key": 1,
                                            "count": 1,
                                            "value": "PVAR-2024-05-09-000333"
                                        }
                                    ],
                                    "attributes": [
                                        {
                                            "key": 1,
                                            "value": "1",
                                            "operator": {
                                                "code": "LESS_THAN_EQUAL_TO"
                                            },
                                            "attribute": {
                                                "code": "CAMPAIGN_BEDNET_INDIVIDUAL_LABEL"
                                            }
                                        },
                                        {
                                            "key": 2,
                                            "value": "3",
                                            "operator": {
                                                "code": "LESS_THAN_EQUAL_TO"
                                            },
                                            "attribute": {
                                                "code": "CAMPAIGN_BEDNET_HOUSEHOLD_LABEL"
                                            }
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                }
            ],
            "auditDetails": {
                "createdBy": "63a21269-d40d-4c26-878f-4f4486b1f44b",
                "lastModifiedBy": "63a21269-d40d-4c26-878f-4f4486b1f44b",
                "createdTime": 1728983362986,
                "lastModifiedTime": 1728983362995
            }
        },
```

Multiple Updates of a Campaign

  1. Once the ongoing campaign is updated and reaches the "Created" state, the updated sheet templates (i.e., Facility, User, and Target) are consolidated back into the format used during the initial "Create" flow.

  2. This ensures that when you attempt to update the campaign again, it will be treated as the first update.

Retry API Payload

curl --location 'http://localhost:8080/project-factory/v1/project-type/retry' \
--header 'accept: application/json, text/plain, */*' \
--header 'accept-language: en-GB,en-US;q=0.9,en;q=0.8' \
--header 'content-type: application/json;charset=UTF-8' \
--header 'cookie: _ga=GA1.1.1393179794.1723545096; _ga_H9YC8FEN6F=GS1.1.1724821683.8.0.1724821683.60.0.0' \
--header 'origin: https://unified-qa.digit.org' \
--header 'priority: u=1, i' \
--header 'referer: https://unified-qa.digit.org/workbench-ui/employee/campaign/setup-campaign?key=7&summary=false&id=04606e62-0ba7-4b89-9a90-4b22d6a64d4c' \
--header 'sec-ch-ua: "Chromium";v="124", "Google Chrome";v="124", "Not-A.Brand";v="99"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "Linux"' \
--header 'sec-fetch-dest: empty' \
--header 'sec-fetch-mode: cors' \
--header 'sec-fetch-site: same-origin' \
--header 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36' \
--data '{
    "CampaignDetails": {
            "id": "936e0d18-9259-4f65-a533-55c6de435d91",
            "tenantId": "mz",
            "status": "drafted",
            "action": "draft",
            "campaignNumber": "CMP-2024-11-21-005699",
            "isActive": true,
            "parentId": null,
            "campaignName": "12wsa",
            "projectType": "LLIN-mz",
            "hierarchyType": "HIERARCHYTEST",
            "boundaryCode": "",
            "projectId": null,
            "startDate": 1732687346000,
            "endDate": 1732946546000,
            "additionalDetails": {
                "key": 2,
                "cycleData": {
                    "cycleData": [],
                    "cycleConfgureDate": {
                        "cycle": 1,
                        "refetch": true,
                        "deliveries": 1
                    }
                },
                "beneficiaryType": "HOUSEHOLD"
            },
            "resources": [
                {
                    "type": "boundaryWithTarget",
                    "filename": "output15706625467747668334.xls",
                    "filestoreId": "2108493a-74f5-4e89-89f7-04772a750b49",
                    "createResourceId": null
                }
            ],
            "boundaries": [],
            "deliveryRules": [
                {
                    "id": "84e28a7b-8c6d-4505-a7ef-5d714e0361f6",
                    "code": "LLIN-mz",
                    "name": "mz project type configuration for LLIN Campaigns",
                    "group": "MALARIA",
                    "cycles": [],
                    "resources": [],
                    "validMaxAge": null,
                    "validMinAge": null,
                    "dashboardUrls": {
                        "DISTRICT_SUPERVISOR": "/digit-ui/employee/dss/dashboard/district-health-dashboard",
                        "NATIONAL_SUPERVISOR": "/digit-ui/employee/dss/landing/national-health-dashboard",
                        "PROVINCIAL_SUPERVISOR": "/digit-ui/employee/dss/dashboard/provincial-health-dashboard"
                    },
                    "taskProcedure": [
                        "1 bednet is to be distributed per 2 household members.",
                        "If there are 4 household members, 2 bednets should be distributed.",
                        "If there are 5 household members, 3 bednets should be distributed."
                    ],
                    "IsCycleDisable": true,
                    "attrAddDisable": true,
                    "beneficiaryType": "HOUSEHOLD",
                    "productCountHide": true,
                    "deliveryAddDisable": true,
                    "eligibilityCriteria": [
                        "All households are eligible.",
                        "Prison inmates are eligible."
                    ]
                }
            ],
            "auditDetails": {
                "createdBy": "b43b260c-f620-45d3-a43f-f53148f87f15",
                "lastModifiedBy": "1a456c75-6953-4be1-bd61-aaa7ef3468a9",
                "createdTime": 1732172916113,
                "lastModifiedTime": 1732347490207
            }
        },
    "RequestInfo": {
        "apiId": "Rainmaker",
        "authToken": "dd3eab34-9511-44b0-b206-4b7c87e941c2",
        "userInfo": {
            "id": 6152,
            "uuid": "63a21269-d40d-4c26-878f-4f4486b1f44b",
            "userName": "MDMSMZ",
            "name": "MDMSMZ",
            "mobileNumber": "8998989222",
            "emailId": null,
            "locale": null,
            "type": "EMPLOYEE",
            "roles": [
                {
                    "name": "System Administrator",
                    "code": "SYSTEM_ADMINISTRATOR",
                    "tenantId": "mz"
                },
                {
                    "name": "Localisation admin",
                    "code": "LOC_ADMIN",
                    "tenantId": "mz"
                },
                {
                    "name": "MDMS Admin",
                    "code": "MDMS_ADMIN",
                    "tenantId": "mz"
                },
                {
                    "name": "Campaign Manager",
                    "code": "CAMPAIGN_MANAGER",
                    "tenantId": "mz"
                }
            ],
            "active": true,
            "tenantId": "mz",
            "permanentCity": null
        },
        "msgId": "1726570830190|en_MZ",
        "plainAccessRequest": {}
    }
}'









PreviousMicroplan IntegrationNextManage Data APIs

Was this helpful?