Only this pageAll pages
Powered by GitBook
1 of 46

v0.1

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

PRODUCT SPECIFICATION

Loading...

Loading...

Loading...

Loading...

TECHNOLOGY

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

SETUP

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

GENERAL

Loading...

Introducing HCM Console

About HCM Console

The Health Campaign Management (HCM) app has achieved remarkable success, and we want to build on this momentum. While setting up a campaign currently involves considerable developer support, we are turning this into an opportunity for improvement. In this regard, we are introducing the HCM Console, an innovative solution designed to empower users to create and manage campaigns effortlessly, enhancing overall efficiency and streamlining the process.

Who is the HCM Console for?

HCM Console is designed for individuals familiar with the on-ground execution of health campaigns. These users understand key terms like cycles, deliveries, doses, boundaries, and campaign hierarchies. However, they are not expected to be tech-savvy, and we aim to eliminate the need for them to grasp technical concepts like JSON files, schemas, APIs, MDMS, services, or intricate UI/UX designs. In short, HCM Console prioritises intuitive user experience with extensive guidance throughout the campaign creation and execution process.

Key Features

Version 0.1 focuses on empowering users to:

  • Initiate campaigns: A clear landing page will provide easy access to the "Setup Campaign" and "My Campaign" options.

  • Define campaign details: A dedicated page will allow users to customise crucial campaign parameters.

  • Set delivery rules: Users can establish delivery rules, including options to record side effects, reasons for refusal, and referrals.

  • Utilise Excel data: An upload functionality will enable seamless import of facility and user data from Excel sheets.

  • Review and confirm: Clear review and success screens will guide users through the final steps of campaign creation.

  • Save drafts: Users can conveniently save incomplete campaigns as drafts for completion later.

These features, cumulatively, will allow users to create the core structure of their campaigns within version 0.1. Subsequent releases will introduce advanced functionalities like the form engine for customising individual and household registration forms, and enhanced data capture functionalities for side effects, refusals, and referrals. It is important to note that the HCM app will continue to support these advanced features in the interim, and the impel team will be responsible for any necessary changes or customisations until their official release within the Campaign Manager.

By introducing the HCM Console, we aim to significantly reduce the time and effort required to set up campaigns within the HCM app, empowering users to take greater ownership and expedite campaign implementation. This user-centric approach translates to enhanced campaign efficiency, allowing our team to focus on further optimising and scaling the HCM app for even greater impact.

HCM Console Web

Here are the articles in this section:

  • User Interface Design

  • Create New Campaign

  • My Campaign

Architecture

Here are the articles in this section:

High Level Design

Low Level Design

Setup Campaigns

Here are the articles in this section:

  • User manual

  • Functional Specifications

Low Level Design

Click here to know more.

Services

Product Roadmap

Create New Campaign

This allows users to fill in all the campaign details and create a new campaign.

Click on the following links to learn more:

Campaign Details

Overview

In the Campaign Details stepper, there are 2 screens:

  • Campaign Type

  • Campaign Name

1. Campaign Type

This is the first screen when the user clicks on the set-up campaign. In this screen, a user can select the campaign type and the beneficiary will be prepopulated from the MDMS. It is a mandatory field to set up a campaign.

Here, the dropdown will show the list of campaign types that are present in the MDMS. We will fetch the MDMS data from:

MDMS:

File Path:

2. Campaign Name

This screen comes after the campaign type. This step is crucial for saving your campaign as a draft, as the name serves as a unique identifier. After clicking on 'Next', the name will be saved and the user can check from the draft.

File Path:

This screen asks a user to fill in the start and end date of the campaign.

FilePath:

End Point
Method
Payload

Boundary Bulk Upload

This screen allows the user to create a new hierarchy and then upload the boundary data in bulk.

  1. Upload Boundary Screen

This screen allows the user to select the hierarchy. According to that, a template is downloaded in which the user needs to fill in the boundary data. If the hierarchy type is not present, then the user can make a new hierarchy using this screen.

  1. Create Boundary Hierarchy

The user needs to give a hierarchy name, and levels according to the hierarchy.

UI Validation: Headers should be according to the template downloaded.

API Details

EndPoint
MDMS Roles
Method
Payload

Quality Assurance Testing

Find the links below:

Campaign Details
Delivery Details
Boundary Details
Resource Upload Details
Setup and Implementation of Campaign
Summary

project-factory/v1/project-type/create

POST

{ "hierarchyType": "ADMIN", "tenantId": "mz", "action": "draft", "campaignName": "test90", "resources": [], "projectType": "MR-DN", "additionalDetails": { "beneficiaryType": "INDIVIDUAL", "key": 2 } }

project-factory/v1/project-type/search

POST

{ "tenantId": "mz", "ids": [ "2a2491a7-c52d-4305-8b5b-9aa10ae44168" ], "pagination": {} }

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

POST

{ "tenantId": "mz", "ids": [ "2a2491a7-c52d-4305-8b5b-9aa10ae44168" ], "pagination": {} }

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

POST

{ "id": "2a2491a7-c52d-4305-8b5b-9aa10ae44168", "tenantId": "mz", "status": "drafted", "action": "draft", "campaignNumber": "CMP-2024-05-15-000496", "campaignName": "test90", "projectType": "MR-DN", "hierarchyType": "ADMIN", "boundaryCode": "", "projectId": null, "startDate": 1715970599000, "endDate": 1717180199000, "additionalDetails": { "beneficiaryType": "INDIVIDUAL", "key": 3 }, "resources": [], "boundaries": [], "deliveryRules": [], "auditDetails": { "createdBy": "21fed2bc-6a73-41b2-b9ae-0996f5b5ede5", "lastModifiedBy": "21fed2bc-6a73-41b2-b9ae-0996f5b5ede5", "createdTime": 1715762971435, "lastModifiedTime": 1715762971519 } }

https://github.com/egovernments/egov-mdms-data/blob/UNIFIED-DEV/data/mz/health/project-types.json
https://github.com/egovernments/DIGIT-Frontend/blob/campaign/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/CampaignType.js
https://github.com/egovernments/DIGIT-Frontend/blob/campaign/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/CampaignName.js
https://github.com/egovernments/DIGIT-Frontend/blob/campaign/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/CampaignDates.js
Campaign Type Screen
Campaign Name Screen

/boundary-service/boundary-hierarchy-definition/_create

1759 - CAMPAIGN_MANAGER

POST

{ "tenantId": "mz", "hierarchyType": "test", "boundaryHierarchy": [ { "boundaryType": "country", "parentBoundaryType": null, "active": true }, { "boundaryType": "state", "parentBoundaryType": "country", "active": true } ] }

/project-factory/v1/data/_create

1772- CAMPAIGN_MANAGER

POST

{ "tenantId": "mz", "type": "boundary", "fileStoreId": "1f984e91-2ed2-4d5c-8788-37b3a4c8fcbc", "action": "create", "hierarchyType": "test", "additionalDetails": {} }

/boundary-service/boundary-hierarchy-definition/_search

1760-CAMPAIGN_MANAGER

POST

{ "tenantId": "mz" }

Upload Boundary
create boundary hierarchy

v0.1: Release Notes

Overview

This release will let the user - who is a System Administrator - set up campaigns on the HCM App and will reduce the current setup time for a given campaign from about 15 days to about 2-3 days.

Release Highlights

Features

Description

Campaign name

The system admin can set the name of the campaign being created.

Campaign start and end dates

The system admin can set when the campaign starts and ends in the system.

Number of cycles, number of deliveries in each cycle, and dates for each cycle

The system admin can set the number of cycles and deliveries and dates for each cycle in the system.

Setting delivery rules for each delivery

Using the attributes and mathematical operators, the system admin can set the delivery rules for each delivery, and create eligibility criteria for all deliveries.

Selecting boundaries for campaign through UI

The user can select the boundaries where the campaign will be done through UI.

Setting targets at the lowest level of boundary data

A system admin can set the targets at the lowest level of boundary data by uploading target data on Excel template upload.

Creating facility data

A system admin can create or choose to reuse the existing facility data with the help of an Excel template upload.

Creating user data

A system admin can create the user data with the help of an Excel template upload.

Known Issues

Some of the known issues related to this release are:

  1. Usability of the Excel templates: The usability of the Excel templates for setting targets, facility data, and user data could be improved as the inputs in the Excel from the users are not restricted in the sheet and could lead to errors.

Upcoming Release Features

  1. Decentralising the data setup process.

  2. Changing dates for ongoing campaigns from the Console.

  3. Allowing users to configure app features.

Target

This page contains collection consisting of different scenarios of Target Uploads which can be done to test in any environments.

These sheets have been created based on following assumptions :

Url - https://unified-qa.digit.org

locale - en_MZ

msgId - 1710912592752|en_MZ

hierarchy Type - ADMIN

project Type - LLIN-mz

Steps

  1. Import environment variable file and collection file in Postman.

8KB
Target upload.postman_environment.json
environment.json
83KB
Target Upload API Automation.postman_collection.json
collection.json
  1. Successful run scenario:

  • With a valid range of numbers in the 'Target' column.

Example:

District
Post administrative
Locality
Village
Household Target at village level (Mandatory and to be entered by the user)

Yarnee

Klagbe Clinic

Klagbe Town

Pailey Towns

101

Yarnee

Klagbe Clinic

Klagbe Town

Pailey test town

102

13KB
valid file target.xlsx
  1. Negative run scenario:

  • With an empty 'Target' column.

Example:

District
Post administrative
Locality
Village
Household Target at village level (Mandatory and to be entered by the user)

Yarnee

Klagbe Clinic

Klagbe Town

Pailey Towns

Yarnee

Klagbe Clinic

Klagbe Town

Pailey test town

13KB
empty target upload.xlsx
  • With invalid values in the 'Target' column (max, min, date, negative, zero, decimal values).

District
Post administrative
Locality
Village
Household Target at village level (Mandatory and to be entered by the user)

Yarnee

Klagbe Clinic

Klagbe Town

Pailey Towns

-1

Yarnee

Klagbe Clinic

Klagbe Town

Pailey test town

0

Yarnee

Klagbe Clinic

Klagbe Town

Pailey test town

1.11

Yarnee

Klagbe Clinic

Klagbe Town

Pailey test town

AB$$

Yarnee

Klagbe Clinic

Klagbe Town

Pailey test town

12/04/24

Yarnee

Klagbe Clinic

Klagbe Town

Pailey test town

1000000000

13KB
invalid values in Target column.xlsx
  1. Collection runner result - Passed.

21KB
Target Upload API Automation.postman_test_run.json

Boundary Details

This screen allows a user to select different boundary details required for the campaign creation. Here, we show the boundary types based on the hierarchy type which is present in the MDMS, MDMS file path : https://github.com/egovernments/egov-mdms-data/blob/UNIFIED-DEV/data/mz/health/hcm-admin-console/hierarchyConfig.json

If we want to fetch the hierarchy type from the MDMS, use the following API:

 const reqCriteria = {
    url: `/boundary-service/boundary-hierarchy-definition/_search`,
    changeQueryName: `${hierarchyType}`,
    body: {
      BoundaryTypeHierarchySearchCriteria: {
        tenantId: tenantId,
        limit: 2,
        offset: 0,
        hierarchyType: hierarchyType,
      },
    },
  };

To fetch the hierarchy definition, this is mentioned in the setUpCampaign page: https://github.com/egovernments/DIGIT-Frontend/blob/campaign/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/SetupCampaign.js

After calling the hierarchy, the response is stored in the session storage under the name:

HCM_CAMPAIGN_MANAGER_UPLOAD_ID

After it is stored, we can use it in the "Selecting Boundaries" component to show the different boundary types present: The FilePath for it is the following: https://github.com/egovernments/DIGIT-Frontend/blob/campaign/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/SelectingBoundaries.js The boundary type in the screen is shown upto the lowest hierarchy level which is also configured from the MDMS. The options in the hierarchy is shown using the following:

const reqCriteriaBoundaryTypeSearch = Digit.CustomService.getResponse({
          url: "/boundary-service/boundary-relationships/_search",
          params: {
            tenantId: tenantId,
            hierarchyType: hierarchy,
            boundaryType: boundaryType,
            parent: parentCode,
          },
          body: {},
        });

In the selection boundary screen, we show options according to parent boundary type using the above API. Some validations for this screen:

  • All the boundary types in the screen are mandatory.

  • Lower level boundary type is mandatory if a user has selected the above levels

After the boundaries are selected, the Generate API is called with a delay of 3 seconds when the user clicks on next, using the following hook: https://github.com/egovernments/DIGIT-Frontend/blob/campaign/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/hooks/useGenerateIdCampaign.js

Handling boundary data API performance:

We have impemented Parallel API calls have been implemented for boundary data search to optimise the performance better. We have added all the API search from the loop and calling parallel calls at once and storing the respective data in respective boundaryType.

For the next time when we are making boundary search api calls, we are checking locally whether data is present otherwise calling the API search only for the required data to optimise it better.

All the above mentioned logic have been added in useParallelSearch.js hook.

Link: https://github.com/egovernments/DIGIT-Frontend/blob/campaign/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/hooks/useParallelSearch.js

API Details

EndPoint
Method
Payload

boundary-service/boundary-relationships/_search

POST

Params tenantId=mz

hierarchyType=ADMIN

boundaryType=Provincia

parent=ADMIN_MO

/boundary-service/boundary-hierarchy-definition/_search

POST

{ "tenantId": "mz", "limit": 2, "offset": 0, "hierarchyType": "ADMIN" }

Setup and Implementation of Campaign

The logic for the step-by-step screens, stepper functionality, storing data in localStorage, creating/updating campaigns, and restructuring API data back into localStorage is all managed within SetupCampaign.js.

https://github.com/egovernments/DIGIT-Frontend/blob/campaign/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/SetupCampaign.js

All screens are present in the given configuration. Link: https://github.com/egovernments/DIGIT-Frontend/blob/campaign/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/configs/CampaignConfig.js

In the configuration:

  • stepCount represents the step number. Multiple configuration objects can share the same stepCount.

  • skipAPICall: If this is set to true, the API call for the screen is skipped.

  • sessionData: Local storage data is passed in custom props, allowing for custom logic to be added to the screens as needed.

export const CampaignConfig = (totalFormData, dataParams) => {
  return [
    {
      form: [
        {
          stepCount: "1",
          key: "1",
          name: "HCM_CAMPAIGN_TYPE",
          body: [
            {
              isMandatory: false,
              key: "projectType",
              type: "component",
              skipAPICall: true,
              component: "CampaignSelection",
              withoutLabel: true,
              disable: false,
              customProps: {
                module: "HCM",
                sessionData: totalFormData,
              },
              populators: {
                name: "projectType",
              },
            },
          ],
        },
        ``````

In setup campaign, we have functions to perform specific logic.

  • loopAndReturn: This function takes the delivery rule conditions coming from API response and restructure the data in local storage format.

  • cycleDataRemap: This function takes the delivery rules data coming from API response and return array of object of start date and end date based on cycles.

  • reverseDeliveryRemap: This function take the deliveryConditions from API response and return the structure of delivery data.

  • groupByTypeRemap: This function create the local structure of boundaries.

  • updateUrlParams: This function is using to update the url.

New Campaign & Implementing Local Storage

  • In a new campaign, we update the total form when a user clicks on next after entering the data.

  • After updating the total form data, we store the data in localStorage.

  • We also call the API to draft the data in case a user wants to come back and resume the campaign.

  • Refer to the following link:

https://github.com/egovernments/DIGIT-Frontend/blob/campaign/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/SetupCampaign.js#L545

Draft Campaign & Data Fetching

  • When a user clicks on the draft campaign, he/she can fetch campaign data from the response.

  • After getting a response, one can restructure the data in screen format and store in the local storage.

  • After updating, the user is redirected to the last screen where additional details are stored in response.

  • Refer to the following link:

https://github.com/egovernments/DIGIT-Frontend/blob/campaign/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/SetupCampaign.js#L327

Stepper

  • Based on screens, a user can filter the configuration and show the the stepper based on the configuration.

  • Refer to the following link:

https://github.com/egovernments/DIGIT-Frontend/blob/campaign/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/SetupCampaign.js#L1159

Service Build Updates

Category
Services
Docker Image
Comments

DIGIT 2.9 LTS

MDMS V2

mdms-v2-db:MDMS-v2-2.9LTS-fc6b868dce-47

new service

Boundary V2

boundary-service:boundary-hierarchy-def-modified-6d5b30d4f6-9

new service

HCM v1.4

project-factory:v0.1.0-6caaf2700e-6

new service

workbench-ui:v0.1.0-6caaf2700e-16

new service

Functional Specifications

Name of the field

Description

Mandatory or Optional

Input

Validation

Need Data from programme/state?

Campaign type

Specific campaign run by the system admin.

Mandatory

User

Yes

Campaign name

Name given to the campaign being created.

Mandatory

User

Yes

Beneficiary type

Specify the beneficiaries for the campaign. For example, household, individual, structure.

Mandatory

Auto Selected by the system

No

Start and end dates of the campaign

This will define when the campaign starts and ends.

Mandatory for moving to the next step.

User

Yes

Number of cycles in the campaign

This will set the number of cycles in the campaign.

Mandatory for moving to the next step

User

Yes

Number of deliveries in each cycle in the campaign

This will set the number of deliveries in each cycle of the campaign.

Mandatory for moving to the next step

User

Yes

Dates for each cycle

This will set the dates of cycles in each cycle of the campaign.

Mandatory for campaign creation, non mandatory to move to the next step

User

Yes

Selecting parameters for delivery rules

These are the parameters basis which a user can create the delivery rules.

Mandatory for moving to the next step

User

Yes

Selecting operators for delivery rules

These are the operators basis which a user can create the delivery rules.

Mandatory for moving to the next step

User

Yes

Configuring resources for delivery

These are the products/resources that are going to be delivered to the beneficiary during the campaign.

Mandatory for moving to the next step

User

Yes

Selection of the boundary information

The user will select boundaries where the user wants to select the boundary.

Mandatory for moving to the next step

User

Yes

Setting of targets

The user will enter boundary-wise targets in an Excel template.

Mandatory for campaign creation, non mandatory to move to the next step

User

Yes

Creating facility data

The user will enter the facility data in an Excel template.

Mandatory for campaign creation, non mandatory to move to the next step

User

Yes

Creating user data

The system admin will enter the user data in an Excel template.

Mandatory for campaign creation, non mandatory to move to the next step

User

Yes

Product Requirement Document (PRD)

Table of Contents:

Background

Target Audience

Objectives

Assumptions and Validations

Role-Action Mapping

Specifications

Risk and Limitation

Out of Scope

Design

Background

As the adoption of the HCM app is beginning to increase, a significant piece of feedback we have received is that setting up any campaign on the HCM app currently demands a minimum of two weeks of development effort. There is a consensus that the lead time for campaign setup needs to be shortened.

The concept involves transforming the HCM app into a SaaS-like product, featuring a console that empowers the admin user, in this case, the campaign manager, to effortlessly create and execute campaigns on the HCM app. The Campaign Manager product will offer the admin user the flexibility to select and customise specific components of the HCM app according to their preferences.

Target Audience

The user persona for this product is anyone who knows how a given health campaign works on the ground. They have a decent understanding of terms and concepts such as Cycles, Deliveries, Doses, Boundaries, Hierarchy, and other Campaign-related terminologies.

The challenge is around the ability of the user to use and understand technology. The user is not tech-savvy and is not expected to know concepts of JSON Files, Schemas, APIs, MDMS, Services, and any other such terms. The user is also not expected to be well-versed in high-fidelity UX/UI and needs every bit of hand-holding possible during the process of creating and running a campaign.

Objectives (of this release)

  1. Reduce set-up time for new campaigns.

  2. Reduce dependence on engineering resources for setting up a new campaign.

  3. Provide the power to the end user for customising campaigns.

Assumptions and Validations

Sr. No.

Theme

Assumption

1

User persona

The user is well-versed with campaign terminologies and has some level of previous campaign management experience.

2

Device type

The product will be used as a web-based application with an internet connection.

Role-Action Mapping

Sr. No.

Role

Action

1

Campaign Manager

  1. Select Campaign Type

  1. Assign Campaign Name

  1. Set Campaign Dates

  1. Configure Boundary Data

  1. Configure Facilities

  1. Configure Users

  1. Set Rules for Delivery

Specifications

Question

Input Field Type

Validations/Limitation

  1. Which campaign type do you want to run?

Dropdown single selection

Users can select only one campaign at a time. The entries in this drop-down will be pre loaded from the back end. Will provide the functionality of updating the list to the users from UI.

  1. What is the name of your campaign?

Open text field

Limit of 50 characters.

  1. Beneficiary type for the selected campaign is

Non-editable field

The answer to this question can only be household or individual based on the campaign name selected in the previous question.

  1. Select the start and end dates of the campaign for the boundaries selected above. Note: This date range will be applicable to all boundaries selected in the previous question.

Calendar selection Icon with 2 inputs:

Start Date

End Date

The selection will ask for 2 inputs from the user:

Start and end dates. The user cannot select start or end dates from the past. only future date selections should be allowed. By default, when the selection opens, the date should be set to today's date.

Risk and Limitations

  1. Boundary data: If the boundary data is updated regularly, then the analytics for the long-term will not have data sanity.

  2. Users might have issues uploading multiple Excel sheets for targets, facility, and user data.

Out of Scope for v0.1:

  1. Boundary data mapping and hierarchy changes through UI will not be allowed. If the user wants to edit/add new boundary data, it will be raised through the L1 team.

  2. Editing of campaign data, once the campaign is live through the HCM Console UI, is not allowed. The changes will have to be routed through the implementation team.

  3. Language selection for the app will not be a part of this release.

Design

Click here to learn more.

Boundary Generation

Generate API for Boundary

Generation API for Boundary

API Overview

Base URL: project-factory/v1/

Endpoint: /data/_generate

Method: POST

Request Structure:

Body Parameters:

  • RequestInfo: Object containing RequestInfo

  • Query Parameters:

    • tenantId: Tenant

    • type: Type of Resource (e.g., boundary)

    • forceUpdate: Boolean type (either true or false)

    • hierarchyType: Name of Boundary Hierarchy

    • campaignId: CampaignId

Response Structure:

Success Response:

{
   "ResponseInfo": {
       "apiId": "egov-bff",
       "ver": "0.0.1",
       "ts": 1716878176955,
       "status": "successful",
       "desc": "new-response"
   },
   "GeneratedResource": [
       {
           "id": "5ef5547e-414f-4164-9c12-644716e4fa71",
           "fileStoreid": null,
           "type": "boundary",
           "status": "inprogress",
           "hierarchyType": "ADMIN",
           "tenantId": "mz",
           "auditDetails": {
               "lastModifiedTime": 1716878176947,
               "createdTime": 1716878176947,
               "createdBy": "867ba408-1b82-4746-8274-eb916e625fea",
               "lastModifiedBy": "867ba408-1b82-4746-8274-eb916e625fea"
           },
           "additionalDetails": {
               "Filters": null
           },
           "count": null
       }
   ]
}

Flow

  1. Client Initiates Request:

    • The client initiates a dataGenerate request to the Project Factory Service.

  2. Validation of Request:

    • Schema Validation: Validate against generateRequestSchema.

    • Tenant ID Validation: Ensure tenantId matches in query and RequestInfo.userInfo.

    • Force Update: Default to "false" if missing.

    • Hierarchy Type Validation: Validate hierarchyType for the tenantId.

  3. Processing of Generate Request:

    • Fetch Data from DB:

      • Retrieve data using getResponseFromDb(request).

    • Modify Response Data:

      • Modify the fetched data with getModifiedResponse(responseData).

    • Generate New Entry:

      • Create a new entry with getNewEntryResponse(request).

    • Expire Old Data:

      • Update the status of old data to expired using getOldEntryResponse(modifiedResponse, request).

    • Persist Data Changes:

      • Call updateAndPersistGenerateRequest(newEntryResponse, oldEntryResponse, responseData, request).

        • Purpose:

          • If forceUpdate is true and data exists: Mark existing data as expired and create new data.

          • No data exists or force update is true: Generate new data.

          • If forceUpdate is false and data exists: Return the old data.

  4. Boundary Data Processing:

    • Generate new Boundary Data:

      • Fetch Boundary Relationships.

      • If no boundary is found, generate an empty boundary sheet.

      • Fetch Filters from CampaignId and generate Boundary Data based on those Filters.

        • If Filters is null, it will generate the whole Boundary Data.

    • After the Boundary Sheet has been generated, append the ReadMeSheet.

    • Generate different tabs based on any boundary level configured (here District).

  5. Generating Different Boundary Templates based on Campaign Type

  • Fetch configurable columns from mdms present for each campaign type from schema -[HCM-ADMIN-CONSOLE.adminSchema].

  • Here is a sample data from the given schema having configurable columns for Campaign SMC-

 "mdms": [
        {
            "id": "536f6de8-8c90-4631-b401-5a3beabf4893",
            "tenantId": "mz",
            "schemaCode": "HCM-ADMIN-CONSOLE.adminSchema",
            "uniqueIdentifier": "boundary.MR-DN",
            "data": {
                "title": "boundary",
                "$schema": "http://json-schema.org/draft-07/schema#",
                "properties": {
                    "numberProperties": [
                        {
                            "name": "HCM_ADMIN_CONSOLE_TARGET_SMC_AGE_3_TO_11",
                            "type": "number",
                            "isRequired": true,
                            "description": "Target at village level - Age 3 to 11 Months (Mandatory and to be entered by the user)",
                            "orderNumber": 2
                        },
                        {
                            "name": "HCM_ADMIN_CONSOLE_TARGET_SMC_AGE_12_TO_59",
                            "type": "number",
                            "isRequired": true,
                            "description": "Target at village level - Age 12 to 59 Months (Mandatory and to be entered by the user)",
                            "orderNumber": 3
                        }
                    ],
                    "stringProperties": [
                        {
                            "name": "HCM_ADMIN_CONSOLE_BOUNDARY_CODE",
                            "type": "string",
                            "isRequired": true,
                            "description": "Boundary Code",
                            "orderNumber": 1,
                            "freezeColumn": true
                        }
                    ]
                },
                "campaignType": "MR-DN"
            },
            "isActive": true,
            "auditDetails": {
                "createdBy": "63a21269-d40d-4c26-878f-4f4486b1f44b",
                "lastModifiedBy": "63a21269-d40d-4c26-878f-4f4486b1f44b",
                "createdTime": 1718171965428,
                "lastModifiedTime": 1718171965428
            }
        }
    ]
  1. Handle Error:

    • Update status to failed, add error details, log the error, and produce a message to the update topic.

  2. Downloading the generated boundary template through /data/_generate API:

    • One can get the filestoreId through the /data/_download API which will fetch from db using the id from the response of /data/_generate API.

Note:

Downloaded Template will have one ReadMe sheet, one Boundary Data Tab, and all other tabs on a number of unique districts(or whichever level configured).

Core Services 2.9LTS
Service Build Details
Health Services v1.4
HCM Admin Console v0.1
Project Factory
Workbench UI
DevOps v0.1
Configs v0.1
MDMS v0.1
Localisation v0.1

Project Factory

Overview

Project-factory assists users in generating the seed data essential for the campaign creation process in DIGIT HCM and in establishing relationships between all resources. The Project Factory Service manages project-type campaigns by handling the creation, updating, searching, and campaign setup processes. This documentation details the available APIs, their endpoints, request and response structures, and internal processing flows.

Pre-requisites

  • Knowledge of JavaScript (preferably ES6).

  • Knowledge of Git or any version control system.

  • Knowledge of RESTful web services.

  • Knowledge of the Kafka and Postgres.

  • Knowledge of eGov-mdms service, eGov-persister, eGov-idgen, eGov-indexer, and eGov-user will be helpful.

Base URL

project-factory/v1/

APIs Overview

Create Campaign

TO DO add other information

DB DIAGRAM

Swagger :

Configs and helm chart details :

  • Persister config : https://github.com/egovernments/configs/blob/UNIFIED-UAT/health/egov-persister/project-factory-persister.yml Helm chart details : https://github.com/egovernments/DIGIT-DevOps/blob/unified-env/deploy-as-code/helm/charts/health-services/project-factory/values.yaml

  • Configure the role CAMPAIGN_MANAGER for project-factory in the ‘ACCESSCONTROL-ROLES’ module.

  • Configure the action id(s) with the corresponding role code ‘ACCESSCONTROL-ROLEACTIONS’ module.

  • For Project Factory Service Role-Action mappings are as follows in the Dev environment.

API EndPoints

Roles

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

  • CAMPAIGN_MANAGER

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

  • CAMPAIGN_MANAGER

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

  • CAMPAIGN_MANAGER

/project-factory/v1/data/_create

  • CAMPAIGN_MANAGER

/project-factory/v1/data/_search

  • CAMPAIGN_MANAGER

/project-factory/v1/data/_generate

  • CAMPAIGN_MANAGER

/project-factory/v1/data/_download

  • CAMPAIGN_MANAGER

Additional APIs being used are:

API EndPoints

Roles

/boundary-service/boundary-hierarchy-definition/_search

  • CAMPAIGN_MANAGER

boundary-service/boundary-relationships/_search

  • CAMPAIGN_MANAGER

/product/variant/v1/_search

  • CAMPAIGN_MANAGER

/product/v1/_search

  • CAMPAIGN_MANAGER

/product/v1/_create

  • CAMPAIGN_MANAGER

/product/variant/v1/_create

  • CAMPAIGN_MANAGER

  • Configure all the MDMS data for project factory service as done in the QA environment.

Data to configure :

  • Attribute Config

  • Boundary Schema

  • Delivery Config

  • Facility Schema

  • Gender Config

  • Mail Config

  • Operator Config

  • Product Type

  • User Schema

Refer to the following:

https://github.com/egovernments/egov-mdms-data/tree/UNIFIED-QA/data/mz/health/hcm-admin-console

IdGen Config:

Make sure the id format is configured in the ‘IdFormat.json’ file of the ‘common-masters’ module.

Below is what is currently configured in the QA environment.

{
    "format": "CMP-[cy:yyyy-MM-dd]-[SEQ_EG_CMP_ID]",
    "idname": "campaign.number"
}

Environment variables Below are the variables that should be configured well before deployment of the project factory service build image.

  • Add these ‘db-host’,’db-name’,’db-url’,’domain’ and all the digit core platform services configurations (Idgen ,persister, filestore, etc.) in respective environments yaml file.

  • Add project factory service related environment variables’ value like the way it's done in the QA environment yaml file. (Search for project-factory)

  • https://github.com/egovernments/DIGIT-DevOps/blob/unified-env/deploy-as-code/helm/environments/unified-qa.yaml

  • https://github.com/egovernments/DIGIT-DevOps/tree/unified-env/deploy-as-code/helm/charts/health-services/project-factory

  • Heath-hrms, health-project, health-individual and facility should have specified heap and memory limits as mentioned below

heap: "-Xmx256m -Xms256m"
memory_limits: 512Mi
  • Make sure to add the DB(Postgres and flyway) username & password in the respective environment secret yaml file the way it's done here.

  • Make sure to add the digit core services related secrets are configured in the respective environment secret file the way it's done here.

  • Click here for localisation details.

  • Click here to get the Postman Collection

User

This page contains collection consisting of different scenarios of User Uploads which can be done to test in any environments.

These sheets have been created based on following assumptions:

URL - https://unified-qa.digit.org

locale - en_MZ

msgId - 1710912592752|en_MZ

hierarchy Type - ADMIN

project Type - LLIN-mz

Steps

  1. Import the environment variable file and collection file in Postman.

3KB
User.postman_environment.json
environment.json
113KB
User Bulk Upload Automation.postman_collection.json
collection.json
  1. Successful run scenario:

  • When a user adds valid data to the user file.

Example:

Name of the Person (Mandatory)
Phone Number (Mandatory)
Role (Mandatory)
Employment Type (Mandatory)
Boundary Code (Mandatory)

Name

5555627761

Distributor

Permanent

ADMIN_MO_07_MAPUTO CITY

141KB
valid user upload.xlsx
samplevalidfile
  • When a user uploads a valid sheet with a missing row in between

Example:

Name of the Person (Mandatory)
Phone Number (Mandatory)
Role (Mandatory)
Employment Type (Mandatory)
Boundary Code (Mandatory)

Name

5555627761

Distributor

Permanent

ADMIN_MO_07_MAPUTO CITY

141KB
with row in between.xlsx
  1. Negative run scenarios:

  • With an empty "Name of the Person (Mandatory)" column.

Example:

Name of the Person (Mandatory)
Phone Number (Mandatory)
Role (Mandatory)
Employment Type (Mandatory)
Boundary Code (Mandatory)

5555627761

Distributor

Permanent

ADMIN_MO_07_MAPUTO CITY

141KB
withoutname userupload.xlsx
  • With less than 2 letters in "the "Name of the Person (Mandatory)" column.

Example:

Name of the Person (Mandatory)
Phone Number (Mandatory)
Role (Mandatory)
Employment Type (Mandatory)
Boundary Code (Mandatory)

N

5555627761

Distributor

Permanent

ADMIN_MO_07_MAPUTO CITY

141KB
with 2 letters in name of person.xlsx
  • Without phone number.

Example:

Name of the Person (Mandatory)
Phone Number (Mandatory)
Role (Mandatory)
Employment Type (Mandatory)
Boundary Code (Mandatory)

Name

Distributor

Permanent

ADMIN_MO_07_MAPUTO CITY

141KB
without phone number.xlsx
  • With invalid values in the phone number column.

Example:

Name of the Person (Mandatory)
Phone Number (Mandatory)
Role (Mandatory)
Employment Type (Mandatory)
Boundary Code (Mandatory)

Name

6347374

Distributor

Temporary

ADMIN_MO_07_MAPUTO CITY

Name1

ABC23

Distributor

Permanent

ADMIN_MO_07_MAPUTO CITY

141KB
With invalid values in phone number column.xlsx
  • With the same phone number.

Example:

Name of the Person (Mandatory)
Phone Number (Mandatory)
Role (Mandatory)
Employment Type (Mandatory)
Boundary Code (Mandatory)

Name

6347374748

Distributor

Temporary

ADMIN_MO_07_MAPUTO CITY

Name1

6347374748

Distributor

Permanent

ADMIN_MO_07_MAPUTO CITY

141KB
with same phone number.xlsx
  • Without data in the role column.

Example:

Name of the Person (Mandatory)
Phone Number (Mandatory)
Role (Mandatory)
Employment Type (Mandatory)
Boundary Code (Mandatory)

Name

6347374748

Temporary

ADMIN_MO_07_MAPUTO CITY

Name1

6347374748

Permanent

ADMIN_MO_07_MAPUTO CITY

141KB
without role column.xlsx
  • Without data in the Employment Type column.

Example:

Name of the Person (Mandatory)
Phone Number (Mandatory)
Role (Mandatory)
Employment Type (Mandatory)
Boundary Code (Mandatory)

Name

6347374748

Distributor

ADMIN_MO_07_MAPUTO CITY

Name1

6347374748

Distributor

ADMIN_MO_07_MAPUTO CITY

141KB
without Employment type.xlsx
  • With an empty Boundary Code column.

Example:

Name of the Person (Mandatory)
Phone Number (Mandatory)
Role (Mandatory)
Employment Type (Mandatory)
Boundary Code (Mandatory)

Name

6347374748

Distributor

Temporary

Name1

6347374748

Distributor

Permanent

141KB
without Boundarycode column.xlsx
  • With invalid values in the Boundary Code column.

Example:

Name of the Person (Mandatory)
Phone Number (Mandatory)
Role (Mandatory)
Employment Type (Mandatory)
Boundary Code (Mandatory)

Name

6347374748

Distributor

Temporary

ABC

Name1

6347374748

Distributor

Permanent

111

141KB
with invalid boundary code.xlsx

Test Run collection -Passed

26KB
User Bulk Upload Automation.postman_test_run.json

Boundary Campaign Setup

Boundary Bulk Upload for Campaign

Boundary Bulk Upload Overview:

This documentation outlines the process and components of bulk uploading boundaries for a campaign. It covers the proper format of the Excel sheet, unique code generation, functions for boundary entity creation, boundary relationship creation, localisation, and API details.

Sequence Diagram

Boundary bulk upload flow

Format of Excel for Boundary Bulk Upload

The Excel sheet should be formatted as follows:

Country
Província
Distrito
Posto Administrativo
Localidade
Aldeia

INDIA

INDIA

KARNATAKA

INDIA

KARNATAKA

BLR

INDIA

KARNATAKA

BLR

KORAMANGALA

INDIA

KARNATAKA

BLR

KORAMANGALA

3RD BLOCK

INDIA

KARNATAKA

BLR

KORAMANGALA

3RD BLOCK

EGOV

INDIA

BIHAR

INDIA

BIHAR

PATNA

Unique Code Generation

Unique codes are auto-generated for each boundary level as follows:

Boundary
Code

INDIA

ADMIN_IN

KARNATAKA

ADMIN_IN_01_KARNATAKA

BLR

ADMIN_IN_01_01_BLR

KORAMANGALA

ADMIN_IN_01_01_01_KORMANGALA

BIHAR

ADMIN_IN_02_BIHAR

PATNA

ADMIN_IN_02_01_PATNA

If there are two districts (boundaries at the same level) with the same name (for example, BLR) under different parent-level boundary, the names will be updated to BLR, BLR-01, and so on.

getAutoGeneratedBoundaryCodes Function

Purpose:

Generate auto-generated boundary codes based on boundary list, child-parent mapping, element codes map, count map, and request information.

Parameters:

  • boundaryList: List of boundary data.

  • childParentMap: Map of child-parent relationships.

  • elementCodesMap: Map of boundaries to its corresponding auto generated unique codes.

  • countMap: Map of counts for each boundaries.

  • request: HTTP request object.

Returns:

  • Updated element codes map.

Steps:

  1. Initialise Column Data:

    • Initialise an array to store column data.

  2. Extract Unique Elements:

    • Iterate through each row of the boundary list.

    • Extract unique elements from each column.

  3. Generate Boundary Codes:

    • Iterate over columns to generate boundary codes.

    • Check if the element code exists in the element codes map.

    • If not, generate a new code based on parent-child mapping and sequence.

    • Store the code of the element in the element codes map.

  4. Default Code Generation:

    • Generate default code if parent code is not found.

  5. Updated Element Codes Map

    Return Updated Boundary Data - Auto-Generated Code Map.

Boundary Entities Creation

Boundary entities are created chunk-wise, with each chunk consisting of 200 codes.

Create Boundary Entities

Purpose:

To create new boundary entities in the system from provided boundary codes.

Steps:

  1. Convert Boundary Map:

    • Change the boundary map to a list of objects with key and value.

  2. Prepare Request:

    • Set up the request details and initialise lists for boundaries and existing codes.

  3. Chunk Boundary Codes:

    • Divide the boundary codes into smaller groups.

  4. Fetch Existing Boundaries:

    • Check the system for existing boundary codes and collect them.

  5. Identify New Boundaries:

    • Determine which boundary codes are new and add them to the list of boundaries to create.

  6. Create New Boundaries:

    • If there are new boundaries, send them to the system in groups and log the results.

  7. Handle Existing Boundaries:

    • Log a message if all boundaries already exist.

  8. Error Handling:

    • Manage any errors that occur and provide a relevant error message.

Boundary Relationship Creation

Create Boundary Relationship

Purpose:

To create boundary relationships in the system from provided boundary codes and their parent-child mappings.

Steps:

  1. Convert Boundary Map:

    • Transform the boundary map to a list of {key, value} objects.

  2. Initialise Request:

    • Prepare the request details and activity messages array.

  3. Fetch Existing Relationships:

    • Retrieve existing boundary relationships and extract their codes.

  4. Identify and Create Relationships:

    • For each boundary code, check if it exists. If not:

      • Prepare the boundary relationship data.

      • Confirm the parent boundary creation.

      • Create the boundary relationship.

  5. Handle Existing Relationships:

    • If all relationships already exist, log a validation error.

  6. Attach Activity Messages:

    • Add activity messages to the request body.

  7. Error Handling:

    • Catch, log, and handle errors appropriately.

Localisation Upsert of Codes

Boundary codes are localised to their corresponding names as specified in the uploaded Excel sheet.

Boundary Bulk Upload Upsertion

To add more boundaries after the initial upload, use an Excel sheet that includes existing boundary codes. New boundaries without codes will be created in the same way as the first upload.

API for Boundary Bulk Upload

API request for boundary bulk upload:

bashCopy codecurl --location 'http://localhost:8080/project-factory/v1/data/_create' \
--header 'authority: unified-dev.digit.org' \
--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' \
--header 'cookie: _ga_XBQP06FR8V=GS1.1.1691570094.3.1.1691570094.60.0.0; _ga=GA1.1.2124364284.1689669598; _ga_P1TZCPKF6S=GS1.1.1691648339.2.0.1691648339.60.0.0; __cuid=fe28d9c8c84c4d2487b9cb6c9e4cdec1; amp_fef1e8=f4a3f3ed-50f2-409b-be4f-a1ce1dbb59f2R...1hgs4r9gr.1hgs4robc.nu.1r.pp; _ga_H9YC8FEN6F=GS1.1.1701751656.77.1.1701751677.39.0.0' \
--header 'origin: https://unified-dev.digit.org' \
--header 'referer: https://unified-dev.digit.org/works-ui/employee/measurement/update?tenantId=pg.citya&workOrderNumber=WO/2023-24/000894&mbNumber=MB/2023-24/001252' \
--header 'sec-ch-ua: "Chromium";v="116", "Not)A;Brand";v="24", "Google Chrome";v="116"' \
--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/116.0.0.0 Safari/537.36' \
--data-raw '{
    "RequestInfo": {
        "apiId": "Rainmaker",
        "authToken": "e45445a1-6891-4a76-a4e6-528e1dd24946",
        "userInfo": {
            "id": 1284,
            "uuid": "867ba408-1b82-4746-8274-eb916e625fea",
            "userName": "EMP57",
            "name": "Jagan",
            "mobileNumber": "6667776662",
            "emailId": "[email protected]",
            "locale": "string",
            "type": "EMPLOYEE",
            "roles": [
                {
                    "name": "System Administrator",
                    "code": "SYSTEM_ADMINISTRATOR",
                    "tenantId": "mz"
                },
                {
                    "name": "Campaign Manager",
                    "code": "CAMPAIGN_MANAGER",
                    "tenantId": "mz"
                },
                {
                    "name": "Localisation admin",
                    "code": "LOC_ADMIN",
                    "tenantId": "mz"
                },
                {
                    "name": "MDMS Admin",
                    "code": "MDMS_ADMIN",
                    "tenantId": "mz"
                }
            ],
            "active": true,
            "tenantId": "mz",
            "permanentCity": "Amritsar"
        },
        "msgId": "1710912592752|en_IN",
        "plainAccessRequest": {}
    },
    "ResourceDetails": {
        "type": "boundary",
        "tenantId": "mz",
        "fileStoreId": "be52ce1a-bc25-4328-91bc-a682079abb59",
        "action": "create",
        "hierarchyType": "ADMIN",
        "additionalDetails": {},
        "campaignId": "5d721d03-bdf5-4021-86ff-107e61eb7abb"
    }
}'

Note: Ensure the API endpoint, headers, and payload are customised as per your environment and requirements.

Facility

This page contains collection consisting of different scenarios of Facility Uploads which can be done to test in any environments.

These sheets have been created based on following assumptions :

Url -

locale - en_MZ

msgId - 1710912592752|en_MZ

hierarchy Type - ADMIN

project Type - LLIN-mz

  1. Import environment variable file and collection file in Postman:

  1. Successful run scenarios:

  • Valid file with correct values in all columns.

Example:

Facility Name
Facility Type
Facility Status
Capacity (Units: Bales for Bednets/ SPAQ Blister for SMC)
Boundary Code (Mandatory)
Facility Usage
  • With a valid file with a missing row in between.

Example:

Facility Name
Facility Type
Facility Status
Capacity (Units: Bales for Bednets/ SPAQ Blister for SMC)
Boundary Code (Mandatory)
Facility Usage
  1. Negative run scenarios:

  • With an empty "Facility Usage" column.

Example:

Facility Name
Facility Type
Facility Status
Capacity (Units: Bales for Bednets/ SPAQ Blister for SMC)
Boundary Code (Mandatory)
Facility Usage
  • With all inactive values for the "Facility usage" column.

Example:

Facility Name
Facility Type
Facility Status
Capacity (Units: Bales for Bednets/ SPAQ Blister for SMC)
Boundary Code (Mandatory)
Facility Usage
  • With an empty "Boundary Code" column.

Example:

Facility Name
Facility Type
Facility Status
Capacity (Units: Bales for Bednets/ SPAQ Blister for SMC)
Boundary Code (Mandatory)
Facility Usage
  • With duplicate names in the "Facility Name" column.

Example:

Facility Name
Facility Type
Facility Status
Capacity (Units: Bales for Bednets/ SPAQ Blister for SMC)
Boundary Code (Mandatory)
Facility Usage
  • With an empty "Facility Name" column.

Example:

Facility Name
Facility Type
Facility Status
Capacity (Units: Bales for Bednets/ SPAQ Blister for SMC)
Boundary Code (Mandatory)
Facility Usage
  • With an invalid value in the "Facility Name" column.

Facility Name
Facility Type
Facility Status
Capacity (Units: Bales for Bednets/ SPAQ Blister for SMC)
Boundary Code (Mandatory)
Facility Usage
  • With an empty "Facility Type" column.

Facility Name
Facility Type
Facility Status
Capacity (Units: Bales for Bednets/ SPAQ Blister for SMC)
Boundary Code (Mandatory)
Facility Usage
  • With an empty "Facility Status" column.

Facility Name
Facility Type
Facility Status
Capacity (Units: Bales for Bednets/ SPAQ Blister for SMC)
Boundary Code (Mandatory)
Facility Usage
  • With empty and invalid values in the 'Capacity' column (max, min, date, negative, zero values).

Facility Name
Facility Type
Facility Status
Capacity (Units: Bales for Bednets/ SPAQ Blister for SMC)
Boundary Code (Mandatory)
Facility Usage
  • With empty and invalid values in the "Boundary Code" column.

Facility Name
Facility Type
Facility Status
Capacity (Units: Bales for Bednets/ SPAQ Blister for SMC)
Boundary Code (Mandatory)
Facility Usage
  1. Collection runner result -passed:

Facility bednet for MZ

Storing Resource

Permanent

200

ADMIN_MO

Active

Facility bednet MDA-LF-Nairobi

Storing Resource

Permanent

200

ADMIN_MO_07_06_YARNEE

Inactive

Facility bednet MDA-LF-Nairobi

Storing Resource

Permanent

200

ADMIN_MO_07_06_03_KLAGBE CLINIC

Inactive

Facility bednet for MZ

Storing Resource

Permanent

200

ADMIN_MO

Active

Facility bednet MDA-LF-Nairobi

Storing Resource

Permanent

200

ADMIN_MO_07_06_03_KLAGBE CLINIC

Inactive

Facility bednet for MZ

Storing Resource

Permanent

200

ADMIN_MO

Facility bednet MDA-LF-Nairobi

Storing Resource

Permanent

200

ADMIN_MO_07_06_03_KLAGBE CLINIC

Facility bednet for MZ

Storing Resource

Permanent

200

ADMIN_MO

Inactive

Facility bednet MDA-LF-Nairobi

Storing Resource

Permanent

200

ADMIN_MO_07_06_YARNEE

Inactive

Facility bednet MDA-LF-Nairobi

Storing Resource

Permanent

200

ADMIN_MO_07_06_03_KLAGBE CLINIC

Inactive

Facility bednet for MZ

Storing Resource

Permanent

200

Active

Facility bednet MDA-LF-Nairobi

Storing Resource

Permanent

200

Inactive

Facility bednet MDA-LF-Nairobi

Storing Resource

Permanent

200

Inactive

FAC1

Storing Resource

Permanent

200

ADMIN_MO

Active

FAC1

Storing Resource

Permanent

200

ADMIN_MO_07_06_YARNEE

Active

Facility bednet MDA-LF-Nairobi

Storing Resource

Permanent

200

ADMIN_MO_07_06_03_KLAGBE CLINIC

Inactive

Storing Resource

Permanent

200

ADMIN_MO

Active

Storing Resource

Permanent

200

ADMIN_MO_07_06_YARNEE

Inactive

Storing Resource

Permanent

200

ADMIN_MO_07_06_03_KLAGBE CLINIC

Inactive

//////

Storing Resource

Permanent

200

ADMIN_MO

Active

Facility bednet for MZ

Permanent

200

ADMIN_MO

Active

Facility bednet MDA-LF-Nairobi

Permanent

200

ADMIN_MO_07_06_YARNEE

Inactive

Facility bednet MDA-LF-Nairobi

Permanent

200

ADMIN_MO_07_06_03_KLAGBE CLINIC

Inactive

Facility bednet for MZ

Storing Resource

200

ADMIN_MO

Active

Facility bednet MDA-LF-Nairobi

Storing Resource

200

ADMIN_MO_07_06_YARNEE

Inactive

Facility bednet MDA-LF-Nairobi

Storing Resource

200

ADMIN_MO_07_06_03_KLAGBE CLINIC

Inactive

Facility bednet for MZ

Storing Resource

Permanent

-11

ADMIN_MO

Active

Facility bednet MDA-LF-Nairobi

Storing Resource

Permanent

0

ADMIN_MO_07_06_YARNEE

Inactive

Facility bednet MDA-LF-Nairobi

Storing Resource

Permanent

12/03/24

ADMIN_MO_07_06_03_KLAGBE CLINIC

Inactive

Facility bednet for MZ

Storing Resource

Permanent

200

2454

Active

Facility bednet MDA-LF-Nairobi

Storing Resource

Permanent

200

aaa

Inactive

Facility bednet MDA-LF-Nairobi

Storing Resource

Permanent

200

111 CLINIC

Inactive

https://unified-qa.digit.org
3KB
Facility.postman_environment.json
environment.json
140KB
FACILITY BULK UPLOAD AUTOMATION.postman_collection.json
collection.json
145KB
valid facility file.xlsx
145KB
valid facility file (with missing row in between).xlsx
145KB
empty Facility Usage column.xlsx
145KB
all inactive facility usage.xlsx
145KB
empty boundary code.xlsx
145KB
same facility name.xlsx
145KB
empty facility name.xlsx
145KB
invalid facility name.xlsx
145KB
empty facility type.xlsx
145KB
empty facility status.xlsx
145KB
empty and invalid values in capacity column.xlsx
145KB
empty and invalid values in Boundary code column.xlsx
34KB
FACILITY BULK UPLOAD AUTOMATION.postman_test_run.json

User Manual

The HCM Console will help admins set up a campaign on the Digit HCM App. This will help an admin to reduce the campaign setup time which is about 15 days (without the console) to less than 3 days to less than 3 hours (with the console). Further, v0.1 of HCM Console will also aim at reducing the dependencies on the implementation team for setting up campaigns and campaign data on the DIGIT HCM app and provide this capability directly to the end user.

Key Features

Ability to set up a campaign with the following features:

  • Homepage with "Setup Campaign" and "My Campaign" CTAs

  • Campaign details page

  • Boundary details

  • Delivery details

  • Excel upload for targets, facility, and user data setup

  • Review and success screens

  • Ability to save campaigns as draft

User Role

Who can use HCM Console?

User Role

Scope of Action

Role Description

System Admin

National Level/District Level

The user will have all the data required for setting up a campaign and will be responsible for campaign setup on the DIGIT HCM app using the campaign data.

User Flow: Steps to Use HCM Console

You must first select the language before you can log in. Currently, 3 languages are supported for the HCM Console. They are:

  • English

  • Portuguese

  • French

Select the preferred language and click on 'Continue' to go to the login page.

(Note: Getting an account on HCM Console: The admin will have their account created by the implementation team and will be provided with a username and password to log in to the account.)

On the login page, add the "User Name", 'Password', and the 'City' you are working in to log in to HCM Console.

Once you log in, follow the steps shown below to set up a campaign using HCM Console or view the ones already set up:

Homepage (Setup Campaign and My Campaign): After logging in, you will see 2 actions you can perform on the homepage. You can click on “My Campaigns” or “Setup Campaigns”.

My Campaign:

If you click on “My Campaigns” you will see:

a. A list of all the campaigns that the admin has created until now for future dates, past dates, or current dates, including drafted campaigns. There can be 5 statuses in which a campaign can be in, which are:

  1. Ongoing

  2. Completed

  3. Upcoming

  4. Drafts

  5. Failed

b. There will be 5 columns for each campaign:

  1. Campaign Name

  2. Campaign Type

  3. Beneficiary Type

  4. Campaign Start Date

  5. Campaign End Date

If you click on the name of the campaign, you will be redirected to the summary page.

(Note: The admin can input a partial search on the "My Campaign" page where if the admin adds only the first 2 letters of a campaign, the results should show all the campaign names containing those 2 letters in the search bar. If the campaign is in draft, the admin can start editing from the review page. For completed and ongoing campaigns, the admin will have a view-only experience.)

Setup Campaign:

If you click on “Setup Campaign” you will see the basic Campaign Details page. There are 7 actions you can perform when you click on Setup Campaign:

  1. Campaign Details

  2. Boundary Details

  3. Delivery Details

  4. Target Details

  5. Facility Details

  6. User Details

  7. Summary.

Each action and its steps are explained below:

1. Campaign Details

On the Campaign Details page, you will see a list of questions which you will have to answer:

Which is the type of campaign you want to run? (This is a mandatory field for moving to the next screen).

This question will allow you to select any one of the preloaded campaign types. If there are campaigns that are not there in the list, they will first need to be added from the backend with data that has been agreed upon by stakeholders. Based on the selected campaign, the following data will be prefilled in the next steps:

  1. Beneficiary Type (Campaign details step)

  2. Number of Cycles and Deliveries in each Cycle (Delivery step)

  3. Product delivered in each delivery for each cycle based on the corresponding delivery parameters (Age, Weight, Height, Gender) (Rule Engine Step)

Once you select the campaign type, click on 'Next'.

What is the name of your campaign? (This is a mandatory field for moving to the next screen): The answer to this question will be used as the name of the campaign for the reference purpose of the user.

(Note: The campaign will automatically be saved as a draft once you provide a unique name for the campaign.)

Once you enter the "Name of the Campaign", click on 'Next'. You will move on to the Boundary Details page.

2. Boundary Details

This step will enable you to select the existing boundary data in the system. (This is a mandatory field for moving to the next screen). The boundary data will have to be set up in the system beforehand at the time of instance creation and the same boundary data should be reused by the user for all campaigns in a given instance.

(Note: If you have not selected boundaries, you will not be allowed to move on to the next steps. For example: If the boundary data is set up for Mozambique, the user will see the whole boundary mapping for Mozambique that is available on the system. If there is a need for change, we will provide the contact information for the L1 team to update the boundary and the L1 team will update the boundary data.)

The boundary selection for a campaign will happen through a mapped checkbox field as shown below. There is a drop-down-based selection for each level of the hierarchy:

(Note: If a given boundary is selected in one level of the hierarchy, the next level will show boundaries mapped to only the ones selected in the previous level. You will not be able to make any selection at a given level without selecting the boundaries in the level above. If you are creating a new boundary data by raising a request with the L1 team, the UI will have only the updated boundary hierarchy type.)

After you have selected the country, province, district, and post administrative, click on ‘Next’. This will take you to the Delivery Details page for the campaign.

3. Delivery Details

On the delivery details page, you will configure the following:

  1. Campaign start and end dates

  2. Number of cycles and number of deliveries in each cycle of the campaign

  3. Configuring dates for each cycle

  4. Configuring parameters for delivery rules

  5. Configuring resources for delivery

Select the start date and end date of the campaign and click on ‘Next’.

(Note: The start and end dates of the campaign will define the window in which the campaign will remain active on the system and the users of the app will be allowed to login only during the selected campaign dates.)

You will come to the screen that shows the number of cycles and deliveries in each cycle of the campaign (These are mandatory fields for moving to the next screen): You will see the number of cycles and deliveries pre-configured based on the campaign type selected by the user in the first step. If you choose to increase or decrease the number of cycles, you can do so. The maximum number of cycles and deliveries can be up to 5.

Dates for each cycle (These dates are non-mandatory for moving to the next screen): You will add the start and end dates for each cycle. If you do not add these dates, you can still move to the next screen by clicking on 'Next'.

The next page is on Configure Conditions for Delivery:

Conditions for Individual-based Campaigns:

You will see all the conditions pre-configured for the selected individual-based campaign, but you can choose to change the conditions if needed.

Based on the number of cycles and deliveries in each cycle, you will see the exact number of tabs for cycles and deliveries. If you go back and reduce the number of cycles or deliveries, the last cycle/delivery will be deleted first and all the rules will also be deleted along with it.

Selecting Attributes: After this, you will have to configure conditions using the following attributes:

  • Age (in months)

  • Weight (in kgs)

  • Height (in cms)

  • Gender (Male or Female) - When this attribute is selected, you can only select “Equals To” in the operator field and the input field should be set to Male and Female only as a single dropdown selection.

If you want to configure a condition having multiple attributes, you can click on “Add More Attributes” which will open up the selector block again.

Selecting Operators: You can choose to select the following operators to set rules:

  • IN BETWEEN (if this is selected, you should see 2 input boxes for value)

  • GREATER THAN

  • GREATER THAN EQUAL TO

  • LESS THAN EQUAL TO

  • LESS THAN

  • IS EQUAL TO

Configuring Resources: Once you have selected all the attributes, operators, and values basis which the deliveries have to be made, you can click on configure resources which will open a pop-up that will have the following:

  • Product to be delivered

  • Count for each product - This is a numeric counter only and cannot be 0.

  • Add resources CTA to add multiple resources for the rule being configured.

  • Can’t find your product in the list? Add New Product as subtext.

  • The “Confirm Resources” button to confirm selected resources for a given rule.

If you are not able to find the product variant of your desired choice, you will be allowed to create a new product. If you click on “Can't fnd your product on the product list?”, you are redirected to a new tab where you will fill the following fields.

  1. Product Name: Should be the name of the resource. (Alphanumeric with a limit of 100).

  2. Product Type: Dropdown which can have the following options: Medicine, Bednet, Tonic.

  3. Product Variant: Ideally this should have the grammage of the formulation (Alphanumeric with a limit of 100).

Once you have saved the new product by selecting “Confirm Addition of Products”, you will see a success message. You will also be redirected to the rule setting page, where you will see the new product added in the “Product to be Delivered" dropdown.

(Note: If the admin has added some products already (let’s say 4) and then plans on adding a new product to the list after he/she has added the new product(s) and gets redirected to the “Delivery Rules” page, the admin will still see the 4 products previously added in the pop-up.)

Conditions for Household-based Campaigns:

Currently, we only support LLIN bednet campaigns as a household-based campaign. In this case, the user will only have to configure 2 attributes:

  • Number of beneficiaries per bednet

  • Maximum number of bednets per household

(Note: The add new condition button for bednet campaigns will be disabled and will have only 2 attributes in the dropdown, that is, the number of beneficiaries per bednet, and the maximum number of bednets per household.)

Once you have set the delivery rules, and clicked on ‘Next’, you will move to the Target Details page.

4. Target Details

Here, you will set targets for the campaign by default at the lowest level of the hierarchy structure (This is a non-mandatory step for moving to the next screen). This will be achieved by an Excel upload as explained below:

To set targets, click on “Download Template” in the pop-up that appears as soon as you arrive on this screen. You will download the template having all the boundaries in the Excel with an empty column for setting targets.

(Note: Each campaign will have its own target setting template: For example, bednet campaign will have its own template, and SMC campaign will have its template.)

The first tab/sheet will be the “Read Me” tab and will have the information on how you can set the targets for each village selected in the boundary selection screen.

The district-wise sheets will have the following structure:

Target Data Template (Bednet Campaign)

Target Data Template (SMC Campaign)

(Note: All the villages in the Excel will be listed based on the district they belong to, with one tab for each district having a list of the villages under them. For example, if you have selected 20 districts, you will see 20 tabs (one for each district) having all the villages belonging to that particular district. Target numbers assigned for a given boundary are for the complete campaign and not just for each cycle.)

Once you have uploaded the targets, click on 'Next' to move to the Facility Details page.

5. Facility Details

Setting up the facility data will include downloading and uploading the list of facilities (This is a non-mandatory step for moving to the next page):

Case 1: Facility Data is not created in the system:

  • You will see a pop-up to download the Excel sheet.

  • The facility Excel file will be downloaded when you click on the ‘Download’ button. The template for the Excel is here.

  • The Excel will have 2 sheets: 1) List of Available Facilities, 2) List of Campaign Boundaries. The second sheet will have the list of campaign boundaries with boundary codes which you can copy to the first sheet to assign boundaries to facilities.

  • In the case where there is no facility data available in the facility registry , the “List of Available Facilities” sheet will have no data but will have 7 column headers to capture facility details which are:

  • When there is no facility data in the system, you need to add the Facility Name (must be unique), Facility Type (Warehouse/Health Facility), Facility Status (Temporary/Permanent), Capacity (Number input), Boundary Codes which are associated with a given facility and Facility Usage Status (Active/Inactive).

  • If a facility is associated with 2 or more boundaries, add all the boundary codes for that facility in the boundary code column separated by commas.

  • The entry of "Active" or "Inactive" in the column "Facility Usage" will decide if a given facility in the registry will be used in the campaign or not. If a facility is set to "active" the facility will be used in the campaign or else it will not.

  • Each facility can be assigned multiple facility types. If a given facility has multiple types, add each type separated by commas as shown here: Warehouse, Health Facility.

  • The facility will be created at the hierarchical level to which the boundary code is associated. The facility to boundary code mapping shows that the facility serves these boundaries and not that it is present there physically.

  • You can then upload the populated Excel sheet and move to the next step.

Case 2: Facility data exists in the system:

  • You will see a pop-up to download the Excel sheet.

  • The facility Excel file will be downloaded when you click on the ‘Download’ button. The template for the Excel is here.

  • The Excel will have 2 sheets: 1) List of Available Facilities, 2) List of Campaign Boundaries. The second sheet will have the list of campaign boundaries.

  • As there are facilities that already exist in the Facility Registry, the user will see this list of facilities in the "List of Available Facilities" sheet with all the columns in the sheet already prefilled.

  • The user can set an existing facility to 'Active' or 'Inactive' under the Facility Usage Status column without changing any other column inputs for the given facility based on whether the facility will be used in the campaign or not. Any existing facility being used in a campaign should be set to active, if it is not being used in the campaign it should be set to inactive.

  • When there is new facility data that needs to be added to the system, you need to add a new line item with the following columns filled out: Facility Name (must be unique), Facility Type (Warehouse/Health Facility), Facility Status (Temporary/Permanent), Capacity (Number input), Boundary Codes and Facility Usage Status (Active/Inactive).

  • Once you upload the Excel sheet, click on ‘Next’ to move to the User Details page.

6. User Details

(Note: This is a non-mandatory step for moving to next screen. The data for users will not be saved in the system and the system admin will have to keep uploading the information for users every time they create a new campaign.)

  • You will see a pop-up to download the Excel sheet on this page.

  • The Excel template will have 2 sheets: 1) Create List of Users, 2) List of Campaign Boundaries. The second sheet will have the list of campaign boundaries with boundary codes which you can copy to the first sheet to assign boundaries to users.

  • The link to the user data upload excel is here

  • The "Create List of Users” sheet will have the following column headers:

  • Create a line item for every user.

  • If there is a user who is mapped to multiple boundaries, the system admin will have to add the boundary codes to all the boundaries that the user is mapped to by separating them by commas.

  • You must enter all columns in the given sheet as shown above, where all columns are mandatory. The username and password for each user added as a separate line item will be generated at the time when the campaign is successfully created.

  • The user credentials will be created and available for download as an Excel file on the campaign details page with all the columns filled by the user and the username and credentials for each user.

Once you have uploaded the user data, click on 'Next' to go to the Summary page.

7. Summary

Once all details have been added and saved, you can see the information collected in all the previous steps on the summary page. You can click on the files attached in each step and see the preview of the file attached. You can also edit any one of those sections.

You can edit a campaign's start date if it has passed but the campaign is in the draft stage. If the campaign is created, the dates can only be changed if the campaign start date has not passed.

Once you are satisfied with all the information, click on “Create Campaign”. The success screen will show that the campaign data has been captured successfully. It will take some time to create the campaign on the system, including the user credentials.

You can click on “Go to My Campaigns” where you can view the campaign in the ‘Upcoming’ tab and click on it.

Once you click on the campaign, you will see the summary page where the user credentials can be downloaded.

Data Manage APIs

The documentation details of APIs for creating, searching, generating, and downloading data, including request/response structures, flows, and error handling.

Create Data

Endpoint

  • Endpoint: /data/_create

  • Method: POST

Request Structure

  • Body Parameters:

    • RequestInfo: Object containing request information.

    • ResourceDetails: Object containing the details of the resource to be created or validated.

      • type: Type of the resource (boundary, facility, user, boundaryWithTarget).

      • tenantId: Tenant identifier.

      • fileStoreId: File store identifier.

      • action: Action type (create or validate).

      • hierarchyType: Type of hierarchy.

      • campaignId: Campaign identifier.

      • additionalDetails: Additional details object (optional).

Response Structure

  • Success Response:

    - ResponseInfo: Object containing response information.

    - ResourceDetails: Array containing the detail objects of the created or validated resource.

Flow

  1. Client Initiates Request: The client sends a createData request to the Project Factory Service.

  2. Validation of Request: The Project Factory Service validates the request schema and the provided resource details.

  3. Processing the Request:

    • If action is 'create':

      • Enrich resource details, set status to "data-accepted", and persist in DB.

      • Further creation process happens in the background.

      • After successful creation, set the status to 'completed' and persist resource details in DB.

    • If action is 'validate':

      • Enrich resource details, set the status to "validation-started", and persist in DB.

      • Further creation process happens in the background.

      • If file data is invalid, set the status to 'invalid' and persist in DB.

      • After successful creation, set the status to 'completed' and persist resource details in DB.

    • Fail case: If validation or creation fails, set the status to 'failed' and persist in DB with the error cause in additional details.

  4. Response: The Project Factory Service sends the response back to the client containing the resource details and status.

Flow Diagram

Parsing Logic from sheet:

The getSheetData function retrieves and processes data from an Excel sheet, validating the structure according to the configuration provided in createAndSearchConfig. The key part of this process is the parseArrayConfig.parseLogic configuration, which specifies how to parse and validate the columns in the sheet. Here's a detailed explanation of how the function works, including the parsing logic:

Parsing Logic Using parseArrayConfig.parseLogic

The parseArrayConfig.parseLogic configuration specifies how each column in the sheet should be processed. Here's how the parsing logic works:

Column Configuration

Each column configuration specifies:

  • sheetColumn: The column letter in the sheet.

  • sheetColumnName: The expected name of the column in the sheet.

  • resultantPath: The path where the value will be stored in the resultant JSON.

  • type: The expected type of the value (e.g., string, number, boolean).

  • conversionCondition: Optional conditions for converting values.

Validating Column Names

During the validation step, the function checks that the first-row value matches the expected column name.

Processing Rows

When mapping the rows to JSON, the function uses the resultantPath to place the values in the correct location in the JSON object. It converts values according to the specified type and conversionCondition.

Example Conversion

For a column configuration with type: "boolean" and conversionCondition, the function would convert "Permanent" to true and "Temporary" to an empty string.

In summary, the getSheetData function retrieves and processes data from an Excel sheet, validating the structure and content according to the createAndSearchConfig configuration. The parseArrayConfig.parseLogic part of the configuration specifies how each column should be validated and processed into the resultant JSON format.

Search Data API

Endpoint

  • Endpoint: /data/_search

  • Method: POST

Request Structure

  • RequestInfo: Object containing request information.

  • SearchCriteria: Object containing search criteria.

    • id: (Optional) ID of the resource.

    • tenantId: Tenant identifier.

    • type: (Optional) Type of the resource (boundary, facility, user, boundaryWithTarget).

    • status: (Optional) Status of the resource.

Response Body Structure

  • ResponseInfo: Object containing response information.

  • ResourceDetails: Array containing the details object of the searched resource.

Flow

  1. Client Request: Client sends a POST request to /data/_search.

  2. Request Content: Includes RequestInfo and SearchCriteria.

  3. Validation: Server validates request structure and content.

  4. Response Creation: Server creates response with info and resource details.

  5. Response Dispatch: Sends response back to client.

  6. Error Handling: If errors occur, generates error response and sends it.

Flow Diagram

Generate Data API

Endpoint

  • Endpoint: /data/_generate

  • Method: POST

Request Structure

  • RequestInfo: Object containing request information.

  • Query Parameters:

    • type: Type of the resource for which data needs to be generated.

    • tenantId: Tenant identifier.

    • hierarchyType: Type of hierarchy.

    • forceUpdate: (Optional) Boolean indicating whether to force update existing data.

Response Structure

  • ResponseInfo: Object containing response information.

  • GeneratedResource: Array containing the details object of the generated resource.

Flow

  1. Client Request: The client sends a POST request to /v1/data/_generate.

  2. Request Validation: Upon receiving the request, the server validates the request structure and parameters.

  3. Generate Data Process:

    • Validation: The server validates the generate request.

    • Data Processing:

      • Fetch Data: Fetches existing data from the database.

      • Modify Data: Modifies the retrieved data as necessary.

      • Generate New ID: Generates a new random ID and sets the file store ID to null.

      • Expire Old Data: Marks existing data status as expired.

      • Generate New Data: Generates new data based on the request parameters.

      • Update and Persist: Updates and persists the generate request along with the new data.

    • Force Update Logic:

      • If the forceUpdate parameter is set to true:

        • Search and Update: Searches for existing data of the specified type and updates the existing data information.

      • If the forceUpdate parameter is not provided or set to false:

        • Fetch Existing Data: Retrieves already persisted data from the database of the specified type.

  4. Response Creation: After processing the request, the server creates a response containing the details of the generated resource.

  5. Response Dispatch: The server sends the generated response back to the client.

  6. Error Handling: If errors occur, generates an error response and sends it.

Flow Diagram

Data to Sheet Parsing Logic

  1. Fetch Required Columns from MDMS:

    • Use callMdmsData to get type schema columns in the correct order.

  2. Define Headers:

    • MDMS schema required columns are headers and ensures column orders.

  3. Localise Headers:

    • Use getLocalizedHeaders with localizationMap.

  4. Localise Sheet Name:

    • Use getLocalizedName with localizationMap and generate sheet.

Adding a New Column to the Generated Sheet

To add a new column to the Generated sheet, follow these steps:

  1. Search Schema Details

    • Locate the type schema from the HCM-ADMIN-CONSOLE.adminSchema schema in the workbench.

  2. Identify Column Type

    • Determine the column type based on the properties defined in the schema:

      • stringProperties for string-based columns.

      • numberProperties for numeric-based columns.

      • enumProperties for enumerated columns.

  3. Define New Column

    • Add the new column to the schema under the appropriate properties section:

      • String Column: Include attributes such as name, type, maxLength, minLength, isUnique, isRequired, description, and orderNumber.

      • Number Column: Include attributes such as name, type, maximum, minimum, isRequired, description, orderNumber, and errorMessage.

      • Enum Column: Include attributes such as name, enum, isRequired, description, and orderNumber.

  4. Ensure Column Uniqueness

    • Ensure that the isUnique property is correctly set for string columns to enforce uniqueness.

  5. Column Visibility (Future Implementation)

    • Note that hideColumn and freezeColumn features will be implemented in the next version.

Sheet Data Validation:

This process is sufficient for validating the new column in the Generated sheet.

Column Change Reflection in APIs

If there's a need to reflect the column in APIs, follow these additional steps:

  1. Update createAndSearch.ts File

    • Modify the createAndSearch.ts file under the defined type parseLogic object.

    • Integrate the new column into the appropriate data structures used for API operations.

    • Example :

      • sheetColumn: A

      • sheetColumnName: HCM_ADMIN_CONSOLE_FACILITY_CODE

      • resultantPath: id

      • type: string

      • Mapping: Data from column A (HCM_ADMIN_CONSOLE_FACILITY_CODE) in the sheet will be mapped to id in the API data.

By following these steps, you can successfully add and validate a new column in the Generated sheet and ensure its reflection in the associated APIs.

Download Data API

Endpoint

  • Endpoint: /data/_download

  • Method: POST

Request Structure

  • RequestInfo: Object containing request information.

  • Type: (Optional) Type of the resource being downloaded.

  • TenantId: Tenant identifier.

  • HierarchyType: Type of hierarchy.

  • Id: (Optional) ID of the resource being downloaded.

  • Filters: (Optional) Additional filters for the download request.

Response Structure

  • ResponseInfo: Object containing response information.

  • ResourceDetails: Array containing the details object of the downloaded resource.

Flow

  1. Client Request: The client sends a POST request to download data.

  2. Request Validation: Upon receiving the request, the server validates the request structure and parameters.

  3. Data Download Process:

    • Validation: Validate the download request.

    • Fetch Data: Fetch existing data of the specified type from the data host service.

    • Processing: Process the retrieved data as necessary.

  4. Response Creation: After processing the request, the server creates a response containing the details of the downloaded resource.

  5. Response Dispatch: The server sends the generated response back to the client.

  6. Error Handling: If errors occur during the process, an error response is generated and sent.

Flow Diagram

parseLogic: [
    {
        sheetColumn: "A",
        sheetColumnName: "HCM_ADMIN_CONSOLE_FACILITY_CODE",
        resultantPath: "id",
        type: "string"
    },
    {
        sheetColumn: "B",
        sheetColumnName: "HCM_ADMIN_CONSOLE_FACILITY_NAME",
        resultantPath: "name",
        type: "string"
    },
    {
        sheetColumn: "C",
        sheetColumnName: "HCM_ADMIN_CONSOLE_FACILITY_TYPE",
        resultantPath: "usage",
        type: "string"
    },
    {
        sheetColumn: "D",
        sheetColumnName: "HCM_ADMIN_CONSOLE_FACILITY_STATUS",
        resultantPath: "isPermanent",
        type: "boolean",
        conversionCondition: {
            "Permanent": "true",
            "Temporary": ""
        }
    },
    {
        sheetColumn: "E",
        sheetColumnName: "HCM_ADMIN_CONSOLE_FACILITY_CAPACITY",
        resultantPath: "storageCapacity",
        type: "number"
    },
    {
        sheetColumn: "F",
        sheetColumnName: "HCM_ADMIN_CONSOLE_BOUNDARY_CODE_MANDATORY"
    }
]
{
    "sheetColumn": "D",
    "sheetColumnName": "HCM_ADMIN_CONSOLE_FACILITY_STATUS",
    "resultantPath": "isPermanent",
    "type": "boolean",
    "conversionCondition": {
        "Permanent": "true",
        "Temporary": ""
    }
}

Gate 2 Release Checklist

Checklist
Yes/No/Partially
Reference Link/ETA
Owner
Reviewer
Remarks

The development is complete for all the features that are part of the release.

Yes

The code freeze occurred on Jun 20

Test cases are documented by the QA team, reviewed by product owners, and test results are updated in the test cases sheet.

Yes

@shreya

All test cases are reviewed by the Product Owner and results have been updated in the sheet. QA sign-off is given accordingly

The incremental demo of the features showcased during the sprint showcase and feedback is incorporated. If possible, list out the JIRA tickets for feedback.

Yes

Jagan and Team

We had the following incremental demos with the product owner:

  1. HCM Campaign Screens Preview: April 10, 5:00 – 5:30pm

  2. HCM Campaign Manager Demo: April 15, 2:00 – 3:00pm

  3. End-to-End Flow of HCM Admin Console: April 29, 3:00 – 4:00pm

  4. Final HCM Admin Console Demo: May 10, 4:00 – 4:45pm

  5. Incremental Performance Improvement on HCM Admin Console Demo: Jun 11, 3:00 – 4.00pm

  6. Performance Improvement Changes on HCM Admin Console Demo: Jun 14, 12:00 – 12:45pm

UI/UX audit review is completed along with feedback incorporation for any changes in UI/UX.

Yes

Nabeel

@ AndrewJones

UI/UX audit done, and feedbacks incorporated

Incremental demos to the product owners are completed as part of the sprint, and feedback is incorporated.

Yes

Shreya

QA sign-off is completed by the QA team and communicated to product owners. All the tickets’ QA sign-off status is updated in JIRA.

Yes

shreya

QA sign-off was completed on May 9, 2024.

UI, and API technical documents are updated for the release along with the configuration documents.

Yes

Ashish Nabeel

UAT promotion and regression testing from the QA team is completed. The QA team has shared the UAT regression test cases with the product owners.

Yes

Shreya

UAT sign-off was completed on May 23, 2024.

API automation scripts are updated for new APIs or changes to any existing APIs for the release. API automation regression is completed on UAT; the automation test results are analysed and the necessary actions are taken to fix the failure cases. Publish the list of failure use cases with a reason for failure and the resolution taken to fix these failures for the release.

Yes

Shreya

The API backward compatibility testing is completed.

shreya

Not Applicable, since it is new service

The communication is shared with product owners for the completion of UAT promotion and regression by the QA team. The product owners have to give a product sign-off within one week of this communication.

Yes

Yes

shreya

UAT sign-off was completed on May 23, 2024.

The UAT product sign-off communication is received from product owners along with the release notes and user guides (if applicable).

Yes

The GIT tags and releases are created for the code changes for the release.

Yes

Verify whether the release notes are updated.

Yes

Ashish

Verify whether all the UAT builds are updated along with the GIT tag details.

Yes

Ashish

Verify whether all MDMS, configurations, infra-ops configurations are updated.

Yes

Ashish

Verify whether all docs will be published to by the Technical Writer as part of the release.

Yes

Mihika

In progress - review pending

Verify whether all test cases are up-to-date and updated along with the necessary permissions to view the test cases sheet. The test cases sheet is verified by the test lead.

Yes

Shreya

Verify whether the UAT credentials' sheet is updated with the details of new users and roles, if any.

This should not go into Gitbook as this is internal to eGov.

Shreya

Verify whether all the localisation data was added in UAT, and updated in the release kits.

shreya

Verify whether the product release notes and user guides are updated and published.

,

The demo of the released features is done by the product team as part of a sprint/release showcase.

Yes

Yes

Technical and product workshops/demos are conducted by the engineering and product teams respectively to the implementation team (implementation handover).

Yes

@Ankit Sharma

HCM Admin Console Final Handover to Impel Team Date: May 30

HCM Admin Console Incremental Handover Date: May 16 Date: Jun 21

Architect sign-off and technical quality report.

Verify Bug Bash has been completed

Yes

Bug bash done on 21 May 2024

Product roadmap and success metrics.

Yes

Yes

Vignesh

Adoption metrics.

Ankit

Programme roll-out plan.

Ankit

Ranjani

Implementation plan/checklist

Ankit

Ranjani

Gate 2

Yes

Vignesh

ExCos

June 20

The internal release communication along with all the release artefacts are shared by the engineering/ product teams.

Vignesh

To be shared post Gate 2

Delivery Details

In the 'Delivery Details' step, users encounter 3 screens:

  • Delivery Dates

  • Cycle Configuration

  • Delivery

1. Campaign Dates

This screen asks a user to fill in the start and end date of the campaign.

FilePath:

2. Cycle Configuration Screen

On this screen, users specify the number of cycles and deliveries. The number of cycles must be at least 1 and can be up to 5. Once the user has defined the number of cycles and deliveries, they can proceed to enter the start and end dates for each cycle.

The number of cycles and deliveries are configurable based on project type. We can configure it in MDMS:

Link:

If data is configured, a user will see the number of cycles and deliveries as per the configuration. A user, however, can increase or decrease if they find it necessary.

The validations added for the start date and the end date of the cycles should not overlap to each other.

File Path:

After filling in all the cycle details, a user can click on 'Next' and move to the Delivery rules screen. Clicking on 'Next' enables a user to store the cycle data in the local storage.

3. Delivery Screen

On this screen, users fill in all the delivery details (adding delivery rules, adding conditions in delivery rules, adding products in the delivery rules) of each cycle and delivery which the user has selected in the cycle details screen.

The delivery screen can also be configured based on project type. A user can configure the number of delivery conditions, their attributes, and products. If the data is configured correctly, a user can see the data preloaded in delivery rules and the user can change, remove, or add, if they find it necessary.

A user can add delivery rules up to 5. A user can add conditions in each delivery rule with attribute options having height, weight, gender, and age. For Project type, LLIN-mz configuration is passed in delivery rules in which two fixed attributes are present for the bednet campaign.

After filling in all the delivery rules details, when a user clicks on next, the data will be stored in the localStorage as well as in the draft API. The delivery rules data will be validated in the preview screen.

Reference files:

File Path:

Delivery rule's screen file path:

API call file path:

Select or Create a Product

If you click on configure resources on the delivery screen, a pop-up appears where a user can either select or create a product:

Product Screen: When a user clicks on "Add Products to be delivered", a pop-up screen will appear with a list of product variants where a user can add the products and the number of counts in the delivery rules.

A user can add multiple products to the product screen after clicking on "add more resources" When the user clicks on confirm resources, products will be added to the delivery rules. The user can remove the products as well.

If the product is not present, a user can click on "Add New Product" to create a new product and variant, and subsequently add delivery rules. Clicking on "Add New Product" will open the create product screen.

Users can enter product names, product variants, and product types which are sourced from MDMS data. Additionally, a user can create multiple products using the "Add Products" button. After clicking on 'Confirm,' the product will be created, followed by the creation of product variants.

After successful creation, users will be directed to a success response screen.

Guide on Setting Up Delivery Configuration.

Here you can find the config of delivery based on project type.

The following is the structure of the delivery configuration:

  • projectType: This will be the type of the project. If the selected project type is present in the MDMS, then we use that config.

  • attrAddDisable: if this is true, we are restricting a user that they cannot add any attribute.

  • deliveryAddDisable: if this is true, a user cannot add any further delivery rule conditions.

  • cycleConfig: This will be an object containing cycles and deliveries. This refers to the number of cycles and deliveries that will be shown in the cycle screen.

  • deliveryConfig: This will be an array of objects, each object representing one delivery condition.

Adding product config is a careful job, adding the wrong product in the config will cause issues while creating a product.

In Value, the product variant ID should be added in the value which will be getting in the below API:product/variant/v1/_search

The name will consist of the name of the product and the variant of the product separated with "-"

for name: product/v1/_search

for variant: product/variant/v1/_search

FilePath:

Reference links:

MDMS:

Attribute:

Operator:

Bednet config:

Product Type:

HOOKS:

New changes

We have added Delivery type at each delivery conditions showing the delivery type of the campaign.

It is configurable in mdms for the SMC project type. We can add default delivery type at each conditions.

deliveryConfig: It will contain default data of all deliveries.

conditionConfig: It will contain default data of each delivery condition of each deliveries

deliveryType: Default value of delivery type.

API Details

End Point
Method
Payload

New Feature:

A info card is been added in both the screens in the delivery details. Which states the criteria of delivery as recommended by WHO.

```json
{
      "projectType": "MR-DN",
      "attrAddDisable": false,
      "deliveryAddDisable": false,
      "customAttribute": true,
      "cycleConfig": {
        "cycle": 3,
        "deliveries": 2
      },
      "deliveryConfig": [
        {
          "attributeConfig": [
            {
              "key": 1,
              "label": "Custom",
              "attrType": "dropdown",
              "attrValue": "Age",
              "operatorValue": "GREATER_THAN",
              "value": 10
            },
            {
              "key": 2,
              "label": "Custom",
              "attrType": "dropdown",
              "attrValue": "Height",
              "operatorValue": "LESS_THAN",
              "value": 50
            }
          ],
          "productConfig": [
            {
              "key": 1,
              "count": 1,
              "value": "PVAR-2024-05-15-000044",
              "name": "Paracetamol - 500mg"
            }
          ]
        },
        {
          "attributeConfig": [
            {
              "key": 1,
              "label": "Custom",
              "attrType": "dropdown",
              "attrValue": "Age",
              "operatorValue": "IN_BETWEEN",
              "toValue": 10,
              "fromValue": 20
            }
          ],
          "productConfig": [
            {
              "key": 1,
              "count": 1,
              "value": "PVAR-2024-05-15-000044",
              "name": "Paracetamol - 500mg"
            }
          ]
        }
      ]
    }
```
 "cycleConfig": {
        "cycle": 3, //no of cycle
        "deliveries": 2 // no of deliveries
      },
```
"deliveryConfig": [
        {
          "attributeConfig": [ // this represent each attribute in a condition
            {
              "key": 1, // this should be always in sequential order
              "label": "Custom",  // this should be always set to custom
              "attrType": "dropdown", // this represnt the type of component
              "attrValue": "Age", // this is the value of the attribute which show in the attribute component
              "operatorValue": "GREATER_THAN", // this is operator value, it will show in operator component
              "value": 10 // this is the value which will show in value input component
            },
            ....
          ],
          "productConfig": [
            {
              "key": 1, // this will be always in sequential order
              "count": 1, // represent the count of the product
              "value": "PVAR-2024-05-15-000044", // variant id of the product. We need to be careful before adding the id that it should be present in the database 
              "name": "Paracetamol - 500mg" // name should always be adding using "{productName} - {variant}"
            }
          ]
        },
```
]
```javascript
deliveryConfig: [
      {
        delivery: 1,
        conditionConfig: [
          {
            deliveryType: "DIRECT",
            attributeConfig: [
              {
                key: 1,
                label: "Custom",
                attrType: "dropdown",
                attrValue: "Age",
                operatorValue: "IN_BETWEEN",
                fromValue: 3,
                toValue: 11,
              },
            ],
            productConfig: [
              {
                key: 1,
                count: 1,
                value: "PVAR-2024-01-24-000079",
                name: "AQ - 75mg",
              },
              {
                key: 1,
                count: 1,
                value: "PVAR-2024-05-03-000305",
                name: "SP - 250mg",
              },
            ],
          },
          {
            deliveryType: "DIRECT",
            attributeConfig: [
              {
                key: 1,
                label: "Custom",
                attrType: "dropdown",
                attrValue: "Age",
                operatorValue: "IN_BETWEEN",
                fromValue: 12,
                toValue: 59,
              },
            ],
            productConfig: [
              {
                key: 1,
                count: 1,
                value: "PVAR-2024-01-24-000078",
                name: "AQ - 150mg",
              },
            ],
          },
        ],
      },
      {
        delivery: 2,
        conditionConfig: [
          {
            deliveryType: "INDIRECT",
            attributeConfig: [
              {
                key: 1,
                label: "Custom",
                attrType: "dropdown",
                attrValue: "Age",
                operatorValue: "IN_BETWEEN",
                fromValue: 3,
                toValue: 11,
              },
            ],
            productConfig: [
              {
                key: 1,
                count: 1,
                value: "PVAR-2024-01-24-000079",
                name: "AQ - 75mg",
              },
            ],
          },
          {
            deliveryType: "INDIRECT",
            attributeConfig: [
              {
                key: 1,
                label: "Custom",
                attrType: "dropdown",
                attrValue: "Age",
                operatorValue: "IN_BETWEEN",
                fromValue: 12,
                toValue: 59,
              },
            ],
            productConfig: [
              {
                key: 1,
                count: 1,
                value: "PVAR-2024-01-24-000078",
                name: "AQ - 150mg",
              },
            ],
          },
        ],
      },
      {
        delivery: 3,
        conditionConfig: [
          {
            deliveryType: "INDIRECT",
            attributeConfig: [
              {
                key: 1,
                label: "Custom",
                attrType: "dropdown",
                attrValue: "Age",
                operatorValue: "IN_BETWEEN",
                fromValue: 3,
                toValue: 11,
              },
            ],
            productConfig: [
              {
                key: 1,
                count: 1,
                value: "PVAR-2024-01-24-000079",
                name: "AQ - 75mg",
              },
            ],
          },
          {
            deliveryType: "INDIRECT",
            attributeConfig: [
              {
                key: 1,
                label: "Custom",
                attrType: "dropdown",
                attrValue: "Age",
                operatorValue: "IN_BETWEEN",
                fromValue: 12,
                toValue: 59,
              },
            ],
            productConfig: [
              {
                key: 1,
                count: 1,
                value: "PVAR-2024-01-24-000078",
                name: "AQ - 150mg",
              },
            ],
          },
        ],
      },
    ],
```

product/variant/v1/_search

POST

{ "ProductVariant": {}, "RequestInfo": { } }

product/v1/_search

POST

{ "Product": { "id": [ "P-2024-01-04-000094", "P-2024-01-04-000094", "P-2024-01-04-000095", "P-2024-01-04-000095", "P-2024-01-04-000096", "P-2024-01-04-000094", "P-2024-01-04-000094", "P-2024-01-04-000095", "P-2024-01-04-000095",] }, "RequestInfo": { } }

product/v1/_create

POST

{ "Product": [ { "tenantId": "mz", "type": "BEDNET", "name": "CHECKTHEONE" } ], "apiOperation": "CREATE", "RequestInfo": { } }

product/variant/v1/_create

POST

{ "ProductVariant": [ { "tenantId": "mz", "productId": "P-2024-05-09-000322", "variation": "1000" } ], "apiOperation": "CREATE", "RequestInfo": { } }

project-factory/v1/project-type/update

POST

{ "CampaignDetails": { "id": "76e7f371-1f85-4739-97dc-feb4ee10fa6b", "tenantId": "mz", "status": "drafted", "action": "draft", "campaignNumber": "CMP-2024-05-09-001413", "campaignName": "TheNewOne", "projectType": "LLIN-mz", "hierarchyType": "ADMIN", "boundaryCode": "", "projectId": null, "startDate": 1716056999000, "endDate": 1716488999000, "additionalDetails": { "beneficiaryType": "HOUSEHOLD", "key": 5 }, "resources": [], "boundaries": [], "deliveryRules": [ { "cycleNumber": 1, "deliveryNumber": 1, "deliveryRuleNumber": 1, "products": [ { "value": "PVAR-2024-01-24-000076", "name": "SP - 500mg", "count": 1 } ], "conditions": [ { "attribute": "CAMPAIGN_BEDNET_INDIVIDUAL_LABEL", "operator": null, "value": null }, { "attribute": "CAMPAIGN_BEDNET_HOUSEHOLD_LABEL", "operator": null, "value": null } ] } ], "auditDetails": { "createdBy": "63a21269-d40d-4c26-878f-4f4486b1f44b", "lastModifiedBy": "63a21269-d40d-4c26-878f-4f4486b1f44b", "createdTime": 1715270852152, "lastModifiedTime": 1715273123616 } }, "RequestInfo": { } }

https://github.com/egovernments/DIGIT-Frontend/blob/campaign/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/CampaignDates.js
https://github.com/egovernments/egov-mdms-data/blob/UNIFIED-QA/data/mz/health/hcm-admin-console/deliveryConfig.json
https://github.com/egovernments/DIGIT-Frontend/blob/campaign/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/CycleConfiguration.js
https://github.com/egovernments/DIGIT-Frontend/blob/campaign/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/SetupCampaign.js
https://github.com/egovernments/DIGIT-Frontend/blob/campaign/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/deliveryRule/index.js
https://github.com/egovernments/DIGIT-Frontend/blob/campaign/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/SetupCampaign.js
https://github.com/egovernments/DIGIT-Frontend/tree/campaign/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/deliveryRule
https://github.com/egovernments/DIGIT-Frontend/blob/campaign/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/AddProduct.js
https://github.com/egovernments/egov-mdms-data/blob/UNIFIED-DEV/data/mz/health/hcm-admin-console/attributeConfig.json
https://github.com/egovernments/egov-mdms-data/blob/UNIFIED-DEV/data/mz/health/hcm-admin-console/operatorConfig.json
https://github.com/egovernments/egov-mdms-data/blob/UNIFIED-DEV/data/mz/health/hcm-admin-console/deliveryConfig.json
https://github.com/egovernments/egov-mdms-data/blob/UNIFIED-DEV/data/mz/health/hcm-admin-console/productType.json
https://github.com/egovernments/DIGIT-Frontend/blob/campaign/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/hooks/useCreateProduct.js
https://github.com/egovernments/DIGIT-Frontend/blob/campaign/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/hooks/useCreateProductVariant.js
https://github.com/egovernments/DIGIT-Frontend/blob/campaign/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/hooks/useProductList.js
https://github.com/egovernments/DIGIT-Frontend/blob/campaign/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/hooks/useUpdateCampaign.js
Campaign Dates Screen
Git Release Tag v0.1
Link
Vignesh Nayak
Vignesh Nayak
UI/UX Audit 27 May
UI/UX Audit 6 May
Vignesh Nayak
Link
API
UI
Link
Link
v0.1
Link
devops config
config v0.1
Link
https://egov-digit.gitbook.io/0.1
https://egov-digit.gitbook.io/0.1
Link
Link
Release Notes
User Manual
Yes
HCM Admin Console Final Handover
Dashboard
Swagger Editor

Configuration

Overview

The purpose of this document is to provide a comprehensive guide to the various configuration options available in our HCM Admin Console Application. Proper configuration is crucial for optimizing performance, ensuring security, and customizing the user experience to meet specific needs. This document is designed to help system administrators, developers, and end-users understand and implement these configurations effectively. To learn more about HCM Service/App Configuration, Click here.

Scope

This guide covers all aspects of application configuration, including global settings, module-specific options, and environment-specific adjustments. It addresses different configuration methods such as through files, environment variables, and command-line arguments. Additionally, it includes advanced configuration topics like custom scripting, API integrations, and feature flag management.

Audience

The primary audience for this document includes:

  • System Administrators: Responsible for setting up and maintaining the application in various environments.

  • Developers: Need to understand configuration options for development, testing, and deployment.

  • End-Users: May require guidance on configuring user-specific settings via the user interface.

Structure

The document is organized into the following sections:

  1. Configuration Types: Detailed descriptions of global, module-specific, and environment-specific settings.

  2. Configuration Methods: Instructions on how to apply configurations using different methods.

  3. Common Configuration Options: Examples of frequently used settings, including database connections, authentication, logging, and UI adjustments.

  4. Advanced Configurations: Information on extending the application's functionality through custom scripts, plugins, and integrations.

  5. Best Practices: Recommendations for managing configurations securely and efficiently.

  6. Troubleshooting: Solutions to common configuration problems and tips for debugging issues.

  7. Appendices: Additional resources, including a glossary and references for further reading.

By following the guidance provided in this document, users can ensure that the application is configured correctly to meet their operational needs, enhancing both performance and user satisfaction.


This overview section sets the stage for the rest of the document by clearly outlining its purpose, scope, intended audience, and overall structure.

Boundary Master Setup

The Boundary serves as the primary master data for a campaign and can be configured using the screen provided below. To upload a boundary into the database, a hierarchy is required. If the necessary hierarchy is not available in the existing list, it can be created using the designated screen. Hierarchies of any level can be established.

An example of a hierarchy structure is as follows, with the hierarchy type set to ADMIN:

ADMIN Hierarchy
COUNTRY -> STATE -> DISTRICT -> ADMINISTRATIVE POST -> LOCALITY -> VILLAGE
Create Boundary Hierarchy

After creating the hierarchy we can upload boundary data in bulk using.

Upload Boundary

In this screen user needs to first select the hierarchy type and download its respective template.

The template will be downloaded containing boundary levels in the headers according to the hierarchy. User needs to fill that template in a specific format . For the reference a dummy template is attached.

All the boundaries are localised using the localisation module -

boundary-${BOUNDARY_HIERARCHY_TYPE} // hierarchy type should be according to the selected hierarchy

The system automatically generates a default localization for all boundary codes during the boundary data upload, using the same language/locale as specified at the time of upload.

MDMS Data Setup

1. Hierarchy Config

This config defines the boundary hierarchy on which campaign can be created. All the boundary levels are coming according to the hierarchy configured. The lowest hierarchy will represent the lowest level hierarchy to be displayed. The boundary data is displayed according to this.

selecting boundaries

User can change the lowest hierarchy but it is advised to keep till the mentioned level because lot of boundaries will increase the validations and the load on the server to load all the boundaries

2. Template Validations (Admin Schemas)

Based on this schema validations happens in the excel from both UI and backend for all the different uploads , there is one schema with the title according to the uploaded type. If user wants to change anything in the excel validation then the data of the schema needs to be updated.

Schema properties

IsRequired : true for all those columns which are mandatory to be filled

orderNumber : position where that column will be present

title : set according to the type of upload

enum : defines a set of allowed values for a specific property, ensuring that only predefined, valid options can be assigned to that property.

numberProperties : numeric fields with specific characteristics such as uniqueness, required status, and value constraints like minimum and maximum limits.

string properties : text fields with specific characteristics such as required status, uniqueness, and constraints on length and content.

User can change the following validations from the excel using this schema such as-

  1. User Validations -

  • Roles - Roles to be validated can be added or delete in the schema

  • Employement Type - Can be changed from the enum

  • All the headers are mandatory they can be adjusted according to the requirement,just by changing isRequired to true/false.

  1. Facility Validations-

  • Facility Type - More type can be added or deleted.

  • Facility Status - More requirements can be added or deleted.

  • Facility Usage - More requirements can be added or deleted.

  • Capacity - Minimum and maximum can be changed.

  • Facility Name - max length and min length can be changed.

  • All the headers are mandatory they can be adjusted according to the requirement , just by changing isRequired to true/false.

  1. Target Validation -

  • Target - min and max validations can be changed.

  • Boundary code and target header are mandatory.

  • It also has a field called campaign type, so based on campaign type boundary target updated any new target column can be introduced.

sample data as follows,

while introducing a new campaign/project type this target schema needs to be added for it.

{
    "tenantId": "mz",
    "moduleName": "HCM-ADMIN-CONSOLE",
    "adminSchema": [
        {
            "title": "user", // type of upload
            "$schema": "http://json-schema.org/draft-07/schema#",
            "properties": {
                "enumProperties": [  
                    {
                        "enum": [    // what all roles user can use 
                            "Registrar",
                            "Distributor",
                            "Supervisor",
                            "Help Desk",
                            "Monitor Local",
                            "Logistical officer"
                        ],
                        "name": "HCM_ADMIN_CONSOLE_USER_ROLE",
                        "isRequired": true,
                        "description": "User Role",
                        "orderNumber": 3
                    },
                    {
                        "enum": [
                            "Temporary",
                            "Permanent"
                        ],
                        "name": "HCM_ADMIN_CONSOLE_USER_EMPLOYMENT_TYPE",
                        "isRequired": true,
                        "description": "Employement Type",
                        "orderNumber": 4
                    }
                ],
                "numberProperties": [
                    {
                        "name": "HCM_ADMIN_CONSOLE_USER_PHONE_NUMBER",
                        "type": "number",
                        "isUnique": true,
                        "isRequired": true,
                        "description": "Phone Number",
                        "orderNumber": 2
                    }
                ],
                "stringProperties": [
                    {
                        "name": "HCM_ADMIN_CONSOLE_USER_NAME",
                        "type": "string",
                        "maxLength": 128,
                        "minLength": 2,
                        "isRequired": true,
                        "description": "User Name",
                        "orderNumber": 1
                    },
                    {
                        "name": "HCM_ADMIN_CONSOLE_BOUNDARY_CODE_MANDATORY",
                        "type": "string",
                        "isRequired": true,
                        "description": "Boundary Code (Mandatory)",
                        "orderNumber": 5
                    }
                ]
            },
            "campaignType": "all"
        },
        {
            "title": "facility",
            "$schema": "http://json-schema.org/draft-07/schema#",
            "properties": {
                "enumProperties": [
                    {
                        "enum": [
                            "Warehouse",
                            "Health Facility",
                            "Storing Resource"
                        ],
                        "name": "HCM_ADMIN_CONSOLE_FACILITY_TYPE",
                        "isRequired": true,
                        "description": "Facility type",
                        "orderNumber": 2
                    },
                    {
                        "enum": [
                            "Temporary",
                            "Permanent"
                        ],
                        "name": "HCM_ADMIN_CONSOLE_FACILITY_STATUS",
                        "isRequired": true,
                        "description": "Facility status",
                        "orderNumber": 3
                    },
                    {
                        "enum": [
                            "Active",
                            "Inactive"
                        ],
                        "name": "HCM_ADMIN_CONSOLE_FACILITY_USAGE",
                        "isRequired": true,
                        "description": "Facility usage",
                        "orderNumber": 6
                    }
                ],
                "numberProperties": [
                    {
                        "name": "HCM_ADMIN_CONSOLE_FACILITY_CAPACITY",
                        "type": "number",
                        "maximum": 100000000,
                        "minimum": 1,
                        "isRequired": true,
                        "description": "Camapcity",
                        "orderNumber": 4
                    }
                ],
                "stringProperties": [
                    {
                        "name": "HCM_ADMIN_CONSOLE_FACILITY_NAME",
                        "type": "string",
                        "isUnique": true,
                        "maxLength": 2000,
                        "minLength": 1,
                        "isRequired": true,
                        "description": "Facility Name",
                        "orderNumber": 1
                    },
                    {
                        "name": "HCM_ADMIN_CONSOLE_BOUNDARY_CODE_MANDATORY",
                        "type": "string",
                        "isRequired": true,
                        "description": "Boundary Code",
                        "orderNumber": 5
                    }
                ]
            },
            "campaignType": "all"
        },
        {
            "title": "boundary",
            "$schema": "http://json-schema.org/draft-07/schema#",
            "properties": {
                "numberProperties": [
                    {
                        "name": "HCM_ADMIN_CONSOLE_TARGET_SMC_AGE_3_TO_11",
                        "type": "number",
                        "isRequired": true,
                        "description": "Target at village level - Age 3 to 11 Months (Mandatory and to be entered by the user)",
                        "orderNumber": 2
                    },
                    {
                        "name": "HCM_ADMIN_CONSOLE_TARGET_SMC_AGE_12_TO_59",
                        "type": "number",
                        "isRequired": true,
                        "description": "Target at village level - Age 12 to 59 Months (Mandatory and to be entered by the user)",
                        "orderNumber": 3
                    }
                ],
                "stringProperties": [
                    {
                        "name": "HCM_ADMIN_CONSOLE_BOUNDARY_CODE",
                        "type": "string",
                        "isRequired": true,
                        "description": "Boundary Code",
                        "orderNumber": 1,
                        "freezeColumn": true
                    }
                ]
            },
            "campaignType": "MR-DN"
        },
        {
            "title": "boundary",
            "$schema": "http://json-schema.org/draft-07/schema#",
            "properties": {
                "numberProperties": [
                    {
                        "name": "HCM_ADMIN_CONSOLE_TARGET",
                        "type": "number",
                        "isRequired": true,
                        "description": "Target at the Selected Boundary Level",
                        "orderNumber": 2
                    }
                ],
                "stringProperties": [
                    {
                        "name": "HCM_ADMIN_CONSOLE_BOUNDARY_CODE",
                        "type": "string",
                        "isRequired": true,
                        "description": "Boundary Code",
                        "orderNumber": 1,
                        "freezeColumn": true
                    }
                ]
            },
            "campaignType": "LLIN-mz"
        },
        {
            "title": "boundaryWithTarget",
            "$schema": "http://json-schema.org/draft-07/schema#",
            "properties": {
                "numberProperties": [
                    {
                        "name": "HCM_ADMIN_CONSOLE_TARGET",
                        "type": "number",
                        "maximum": 100000000,
                        "minimum": 1,
                        "isRequired": true,
                        "description": "Target at the Selected Boundary Level",
                        "orderNumber": 1
                    }
                ],
                "stringProperties": [
                    {
                        "name": "HCM_ADMIN_CONSOLE_BOUNDARY_CODE",
                        "type": "string",
                        "isRequired": true,
                        "description": "Boundary Code",
                        "orderNumber": 1,
                        "freezeColumn": true
                    }
                ]
            },
            "campaignType": "LLIN-mz"
        },
        {
            "title": "boundaryWithTarget",
            "$schema": "http://json-schema.org/draft-07/schema#",
            "properties": {
                "numberProperties": [
                    {
                        "name": "HCM_ADMIN_CONSOLE_TARGET_SMC_AGE_3_TO_11",
                        "type": "number",
                        "maximum": 100000000,
                        "minimum": 1,
                        "isRequired": true,
                        "description": "Target at village level - Age 3 to 11 Months (Mandatory and to be entered by the user)",
                        "orderNumber": 2
                    },
                    {
                        "name": "HCM_ADMIN_CONSOLE_TARGET_SMC_AGE_12_TO_59",
                        "type": "number",
                        "maximum": 100000000,
                        "minimum": 1,
                        "isRequired": true,
                        "description": "Target at village level - Age 12 to 59 Months (Mandatory and to be entered by the user)",
                        "orderNumber": 3
                    }
                ],
                "stringProperties": [
                    {
                        "name": "HCM_ADMIN_CONSOLE_BOUNDARY_CODE",
                        "type": "string",
                        "isRequired": true,
                        "description": "Boundary Code",
                        "orderNumber": 1,
                        "freezeColumn": true
                    }
                ]
            },
            "campaignType": "MR-DN"
        }
    ]
}

3. Attributes Config

It includes a list of attribute configurations, each identified by a unique key and specified by a code and an internationalization key (i18nKey). The attributes listed are "Age," "Height," "Weight," and "Gender," which can be used in campaigns to capture relevant information.

Attributes

The attribute dropdown is populated from this schema. If the user wants to add or delete attribute options this schema is helpful.

4. Base Timeout

This schema configures the base time interval after which the search API is called following a file upload. The search API checks the validation status of the uploaded file. The frequency of the API calls is determined by the data present, with the time interval calculated as the base time multiplied by the number of fields in the sheet, constrained by both the minimum base time and the maxTime stated in the schema. The search API will continue to be called repeatedly until a successful or failed response is received.

Advised not to change the base time and max time to prevent delay in validation progress.

5. Delivery Config

It defines two project types, "LLIN-mz" and "MR-DN," each with specific configurations for attribute management, delivery settings, and cycle configurations. The delivery settings include conditions based on attributes and specific product configurations to be used during the delivery cycles.

  • Project Types:

    • LLIN-mz:

      • Attributes and deliveries cannot be added or disabled.

      • Allows custom attributes.

      • Configured for 1 cycle and 1 delivery.

      • Delivery includes attributes and products with conditions based on attribute values.

    • MR-DN:

      • Attributes and deliveries can be added.

      • Allows custom attributes.

      • Configured for 3 cycles and 3 deliveries.

      • Each delivery includes conditions for different age ranges and associated product configurations.

      • Conditions specify whether delivery is direct or indirect.

  • Common Configurations:

    • Attribute Configurations: Define specific attributes with their types, values, and conditions.

    • Product Configurations: Define products to be delivered, including details like key, count, value, and name.

    • Cycle Configurations: Specify the number of cycles and deliveries within each project type.

    • Conditions: Differentiate between direct and indirect deliveries based on attribute values (e.g., age ranges).

According to the configuration indirect delivery is configured for the 1st delivery and indirect and the next. This is the by default configuration according to the WHO recommendations which is present user can also modify the details.

In this values come throught the product variant ID which should be changed according to the environment.

Mandatory to set product variant ID according to the environment.

 "productConfig": [
            {
              "key": 1,
              "count": 1,
              "value": "PVAR-2024-05-03-000305",  // product variant id should be configured according to the environment.
              "name": "SP - 250mg"
            }
          ]
        }
      ]
    },
Delivery conditions for the SMC campaign

6. Delivery Type Config

This is used in delivery config schema to show the direct and indirect deliveries.

7. Mail Config

It has the by default mail id to contact the L1 or implementation team if the hierarchy you want is not present. The mail id can be configured from this schema

8. Operator Config

This schema contains all the operator options which is required for the attributes.

Operators containg options

9. Product Type

This schema displays the options to add the resource type, if the resource you want is not present in the options. And the resource added here will be present in the resources dropdown, so prevent from adding any junk data.

Resource type options

10. ReadMe Config

This schema is used to display the the info message in the UI and read me sheet in the downloaded template.

It configures according to the upload type. Which shows the instructions to user how to fill the template. These are codes are localised according to the message.

info message for downloaded template

Given belowe is the example of the how data is entered into the read Me schema for the headers and their description -

{
      "type": "userWithBoundary",
      "texts": [
        {
          "header": "USERWITHBOUNDARY_README_HEADER_1",
          "isHeaderBold": true,
          "inSheet": true,
          "inUiInfo": true,
          "descriptions": [
            {
              "text": "USERWITHBOUNDARY_README_HEADER_1_DESC_1",
              "isStepRequired": true
            },
            {
              "text": "USERWITHBOUNDARY_README_HEADER_1_DESC_2",
              "isStepRequired": true
            }
          ]
        },
        {
          "header": "USERWITHBOUNDARY_README_HEADER_2",
          "isHeaderBold": true,
          "inSheet": true,
          "inUiInfo": true,
          "descriptions": [
            {
              "text": "USERWITHBOUNDARY_README_HEADER_2_DESC_1",
              "isStepRequired": true
            },
            {
              "text": "USERWITHBOUNDARY_README_HEADER_2_DESC_2",
              "isStepRequired": true
            },
            {
              "text": "USERWITHBOUNDARY_README_HEADER_2_DESC_3",
              "isStepRequired": true
            },
            {
              "text": "USERWITHBOUNDARY_README_HEADER_2_DESC_4",
              "isStepRequired": true
            }
          ]
        },
  • type: defined the type of upload

  • header: The text identifier for the header.

  • isHeaderBold: A boolean indicating whether the header text should be displayed in bold.

  • inSheet: A boolean indicating whether this header should be included in the sheet.

  • inUiInfo: A boolean indicating whether this header should be displayed in the UI.

  • text: The text identifier for the description.

  • isStepRequired: A boolean indicating whether this description step is required.

All the headers and description are written in codes which is localised using the localisation module named -

rainmaker-hcm-admin-schemas

Helm Configurations

Project factory service has dependency on kafka, postgres and rediss.

Changes in the HELM -

name: SPLIT_BOUNDARIES_ON
    value: {{ .Values.splitBoundariesOn | default "Distrito" }} 

Multiple tabs are generated according to the boundary type mentioned in this, user can changes according to the requirement.

name: USER_PASSWORD_AUTO_GENERATE
    value: "true"  
  - name: USER_DEFAULT_PASSWORD
    value: "eGov@123" 

To generate a default password or a random password.

name: NOT_CREATE_USER_IF_ALREADY_THERE
    value: "true"

To test for the mobile number.

egov-mdms-data/data/mz/health/hcm-admin-console/deliveryConfig.json at UNIFIED-QA · egovernments/egov-mdms-dataGitHub
Kaviyarasan P
Kaviyarasan P
Kaviyarasan P
Jagankumar
Jagankumar
Jagankumar
Jagankumar
Jagankumar
Jagankumar
Jagankumar
Jagankumar
Jagankumar
Jagankumar
Jagankumar
Jagankumar
Service Build Details
Vignesh Nayak
Vignesh Nayak
Vignesh Nayak
Vignesh Nayak
Vignesh Nayak
Vignesh Nayak
Vignesh Nayak
Vignesh Nayak
Vignesh Nayak
Logo
Logo
health-campaign-devops/config-as-code/helm/charts/health-services/project-factory/values.yaml at HCM-ADMINCONSOLE-v0.1 · egovernments/health-campaign-devopsGitHub
HELM chart
Sample Boundary data for Upload
https://raw.githubusercontent.com/egovernments/egov-mdms-data/UNIFIED-QA/data/mz/health/hcm-admin-console/adminSchema.json
adminSchema.json
GitBook
MDMS Schema Collection
Logo
Logo
https://raw.githubusercontent.com/egovernments/egov-mdms-data/UNIFIED-QA/data/mz/health/hcm-admin-console/baseTimeOut.json
baseTimeOut.json

v0.1 Technical Release Summary

Overview

We have introduced a new service project-factory and console web to streamline the campaign setup process.

Project Factory

Project-factory helps users create the seed data necessary for the campaign creation process in DIGIT HCM. Additionally, it helps establish relationships between all the resources.

Depends on the Latest Health Services (Integrated with Boundary V2),

Console

The console web application assists users with the initial boundary setup, campaign creation, delivery rule configuration, product creation, boundary target setting, facility creation and linking for each boundary, user creation, staff mapping for each boundary, and connecting with the project-factory service to create campaigns in DIGIT HCM.

My Campaign

Overview

My campaign screen allows users to see the list of campaigns that are in Ongoing, Completed, or Draft status. Users can search campaign by using the campaign name or campaign type. Users can also see a summary of the campaign and complete the campaign creation if it is draft status.

The list of statuses showing in "My Campaign" screen are:

  1. Ongoing

  2. Completed

  3. Drafts

  4. Failed

  5. Upcoming

User actions

After clicking on the My Campaign link from the HCM Campaign module card, the user lands on the My Campaign screens where the user can see all the lists of campaigns of each action in the tab.

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

On my campaign screen, we are sending the payload:

  • Campaigns with an end date that has passed the current date are marked as 'Completed'.

  • Campaigns with a status of 'Started' and no end date, or with an end date in the future, are labeled as 'Ongoing'."

  • The logic is written in UICustomizations.js

  • File path: https://github.com/egovernments/DIGIT-Frontend/blob/campaign/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/configs/UICustomizations.js

Clicking on campaigns other than draft status will redirect to the summary page of the campaign where the user can see the complete details of the respective campaign.

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

Ongoing Campaign Filtering

For the ongoing campaign filtering functionality, we are utilizing the campaignsIncludeDates parameter set to true. The startDate and endDate parameters are both set to the current date. This configuration ensures that the API will return any campaign where the specified startDate or endDate falls within the campaign's defined start and end dates. Additionally, the campaign status is filtered to include campaigns with statuses of created or creating.

Parameters

  • campaignsIncludeDates: This boolean parameter is set to true to enable date range filtering.

  • startDate: The start date for the filter, set to today's date.

  • endDate: The end date for the filter, also set to today's date.

  • status: The campaign status filter, including the statuses created and creating.

Implementation

To filter the ongoing campaigns based on the criteria mentioned above, ensure that your request payload includes the following parameters:

{ 
   "campaignsIncludeDates": true, 
   "startDate": "", // Use the current epoch date dynamically 
   "endDate": "2024-05-23", // Use the current epoch date dynamically 
   "status": ["created", "creating"] 
}

Logic Explanation

  • campaignsIncludeDates = true: This activates the date range filtering feature.

  • startDate and endDate = today: By setting both the start and end dates to today's date, the filter will capture any campaigns that are active today.

  • status = ["created", "creating"]: Filters the campaigns to only include those that are currently in the created or creating status.

Completed Campaign Filtering

For filtering completed campaigns, we use a similar approach with a slight modification to the date parameters and status. Specifically, we will set the endDate parameter to yesterday's date. This configuration ensures that the API returns campaigns that have ended as of yesterday. The statuses to filter will remain creating and created.

Parameters

  • endDate: The end date for the filter, is set to yesterday's date.

  • status: The campaign status filter, including the statuses creating and created.

Implementation

To filter the ongoing campaigns based on the criteria mentioned above, ensure that your request payload includes the following parameters:

{
   "endDate": "", // Use the yesterday epoch date dynamically 
   "status": ["created", "creating"] 
}

Logic Explanation

  1. endDate = yesterday: By setting the end date to yesterday's date, the filter will capture any campaigns that have ended by the end of the previous day.

  2. status = ["created", "creating"]: Filters the campaigns to include only those that were in the created or creating status when they ended.

When a user clicks on completed campaign, they will be redirected to the summary page displaying the campaign details. The success toast message will appear If user credential sheet is generated successfully. User can view or download the sheet from the user credential card or download button which appears at the top.

Upcoming Campaign Filtering

For filtering upcoming campaigns, we use a different approach by setting the campaignsIncludeDates parameter to false and specifying the startDate parameter to tomorrow's date in epoch format. This configuration ensures that the API returns campaigns scheduled to start tomorrow. The statuses to filter will remain creating and created.

Parameters

  • campaignsIncludeDates: This boolean parameter is set to false as we are not filtering based on a date range but rather a specific start date.

  • startDate: The start date for the filter, set to tomorrow's date in epoch format.

  • status: The campaign status filter, including the statuses creating and created.

Implementation

To filter the upcoming campaigns based on the criteria mentioned above, ensure that your request payload includes the following parameters:

{
  "campaignsIncludeDates": false,
  "startDate": 1716748800,  // Use tomorrow's epoch date dynamically
  "status": ["created", "creating"]
}

Logic Explanation

  1. campaignsIncludeDates = false: This deactivates the date range filtering feature, focusing the filter on a specific start date.

  2. startDate = tomorrow (epoch date): By setting the start date to tomorrow's date in epoch format, the filter will capture any campaigns scheduled to start tomorrow.

  3. status = ["created", "creating"]: Filters the campaigns to include only those that are in the created or creating status and scheduled to start tomorrow.

When a user clicks on upcoming campaign, they will be redirected to the summary page displaying the campaign details.

Drafts Campaign Filtering

For the drafts campaign, we are passing the status as drafted. It will return all the drafts which are in drafted status

Failed Campaign Filtering

For failed campaigns, we are passing the status as failed. It will return all the drafts which are in failed status

When a user clicks on a failed campaign, they will be redirected to the summary page displaying the campaign details. Additionally, a toast message will appear, showing the error that caused the campaign to fail.

MDMS

Path: https://github.com/egovernments/egov-mdms-data/blob/UNIFIED-DEV/data/mz/health/project-types.json

API Details

End Point
Method
Payload

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

POST

{ "RequestInfo": { }, "CampaignDetails": { "tenantId": "mz", "status": [ "failed" ], "createdBy": "ff98f9f6-192b-4e12-8e90-7b73dcd0ad4d", "pagination": { "sortBy": "createdTime", "sortOrder": "desc", "limit": 10, "offset": 0 } } }

Resource Upload Details

The resource upload details consists of 3 types of uploads:

  • Upload Target Data

  • Facility Upload

  • User Upload

1. Upload Target Data

This screen will come after a user selects the boundaries.

Upload Target Data

When a user clicks on the download template button, an Excel will get downloaded which will contain readMe, Boundary Data sheet along with the sheets with districts, where the user has to fill the target at the lowest level. After the file is uploaded, it will go for validation. Once validated, a user can go to the next page, where the user can delete the file and move to the next page to upload facility date.

2. Upload Facility Data

This screen will come after the target upload screen.

Upload facility data

In this screen, when a user clicks on the download template, an Excel get downloaded that contains readMe, Facility sheet, and BoundaryData sheet. A user has to fill in the boundary codes and from that sheet, the user has to fill in the facility sheet.

3. Upload User Data

This screen will appear after the facility Details screen.

Upload user screen

When a user clicks on the download template, an Excel gets downloaded that consists of with readMe, User Sheet and BoundaryData. The user has to fill the user sheet only.

All the 3 downloads are happening through the Generate and Download APIs. For the Generate API, the following hook is used: https://github.com/egovernments/DIGIT-Frontend/blob/campaign/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/hooks/useGenerateIdCampaign.js

This hook will return the ID which is stored in the local storage according to the type:

HCM_CAMPAIGN_MANAGER_UPLOAD_ID

Next, /project-factory/v1/data/_download is used to download the template.

Schema Validation

After uploading the templates, UI validation is done through schema stored in the MDMS: Schema Data link : https://github.com/egovernments/egov-mdms-data/blob/UNIFIED-DEV/data/mz/health/hcm-admin-console/adminSchema.json

Schema Module = adminSchema Below is the admin schema-

 "SchemaDefinitions": [
        {
            "id": "92fb3b53-adfe-44e9-ab27-da3209b5e0f1",
            "tenantId": "mz",
            "code": "HCM-ADMIN-CONSOLE.adminSchema",
            "description": null,
            "definition": {
                "type": "object",
                "title": "Comprehensive Example Schema",
                "$schema": "http://json-schema.org/draft-07/schema#",
                "required": [
                    "$schema",
                    "title",
                    "campaignType"
                ],
                "x-unique": [
                    "title",
                    "campaignType"
                ],
                "properties": {
                    "title": {
                        "type": "string"
                    },
                    "$schema": {
                        "enum": [
                            "http://json-schema.org/draft-07/schema#"
                        ],
                        "type": "string",
                        "default": "http://json-schema.org/draft-07/schema#"
                    },
                    "properties": {
                        "type": "object",
                        "properties": {
                            "enumProperties": {
                                "type": "array",
                                "items": {
                                    "type": "object",
                                    "required": [
                                        "name",
                                        "description"
                                    ],
                                    "properties": {
                                        "enum": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        },
                                        "name": {
                                            "type": "string"
                                        },
                                        "isUnique": {
                                            "type": "boolean"
                                        },
                                        "hideColumn": {
                                            "type": "boolean"
                                        },
                                        "isRequired": {
                                            "type": "boolean"
                                        },
                                        "description": {
                                            "type": "string"
                                        },
                                        "orderNumber": {
                                            "type": "integer",
                                            "minimum": 1
                                        },
                                        "errorMessage": {
                                            "type": "string"
                                        },
                                        "freezeColumn": {
                                            "type": "boolean"
                                        }
                                    },
                                    "minProperties": 1
                                },
                                "minItems": 1
                            },
                            "numberProperties": {
                                "type": "array",
                                "items": {
                                    "type": "object",
                                    "required": [
                                        "name",
                                        "description"
                                    ],
                                    "properties": {
                                        "name": {
                                            "type": "string"
                                        },
                                        "type": {
                                            "enum": [
                                                "number"
                                            ],
                                            "type": "string"
                                        },
                                        "maximum": {
                                            "type": "number"
                                        },
                                        "minimum": {
                                            "type": "number"
                                        },
                                        "isUnique": {
                                            "type": "boolean"
                                        },
                                        "hideColumn": {
                                            "type": "boolean"
                                        },
                                        "isRequired": {
                                            "type": "boolean"
                                        },
                                        "multipleOf": {
                                            "type": "number"
                                        },
                                        "description": {
                                            "type": "string"
                                        },
                                        "orderNumber": {
                                            "type": "integer",
                                            "minimum": 1
                                        },
                                        "errorMessage": {
                                            "type": "string"
                                        },
                                        "freezeColumn": {
                                            "type": "boolean"
                                        },
                                        "exclusiveMaximum": {
                                            "type": "boolean"
                                        },
                                        "exclusiveMinimum": {
                                            "type": "boolean"
                                        }
                                    },
                                    "minProperties": 1
                                },
                                "minItems": 1
                            },
                            "stringProperties": {
                                "type": "array",
                                "items": {
                                    "type": "object",
                                    "required": [
                                        "name",
                                        "description"
                                    ],
                                    "properties": {
                                        "name": {
                                            "type": "string"
                                        },
                                        "type": {
                                            "enum": [
                                                "string"
                                            ],
                                            "type": "string"
                                        },
                                        "pattern": {
                                            "type": "string",
                                            "format": "regex"
                                        },
                                        "isUnique": {
                                            "type": "boolean"
                                        },
                                        "maxLength": {
                                            "type": "integer",
                                            "minimum": 0
                                        },
                                        "minLength": {
                                            "type": "integer",
                                            "minimum": 0
                                        },
                                        "hideColumn": {
                                            "type": "boolean"
                                        },
                                        "isRequired": {
                                            "type": "boolean"
                                        },
                                        "description": {
                                            "type": "string"
                                        },
                                        "orderNumber": {
                                            "type": "integer",
                                            "minimum": 1
                                        },
                                        "errorMessage": {
                                            "type": "string"
                                        },
                                        "freezeColumn": {
                                            "type": "boolean"
                                        }
                                    },
                                    "minProperties": 1
                                },
                                "minItems": 1
                            },
                            "additionalProperties": {
                                "type": "boolean"
                            }
                        },
                        "additionalProperties": false
                    },
                    "campaignType": {
                        "type": "string"
                    }
                },
                "description": "A simplified JSON Schema example based on data type.",
                "additionalProperties": false
            },
            "isActive": true,
            "auditDetails": {
                "createdBy": "8b110055-330f-4e7b-b4c0-f618f29b9d47",
                "lastModifiedBy": "8b110055-330f-4e7b-b4c0-f618f29b9d47",
                "createdTime": 1718169189364,
                "lastModifiedTime": 1718169189364
            }
        }
    ]

By using AJV Validation , we are validating the headers of the facility sheet. We are also doing some basic validations for the data such as-

  • Facility Type can only be Warehouse/Health Facility

  • Facility Name can only be string

  • Facility Status can only be Temporary or Permanent etc.

Apart from this, we are also validating sheet names in all the 3 uploads.

For target validation, we use schema only for validating the header of the target and boundary codes. Here, we also validate the target at the lowest level, where the value should be between:

targetValue <= 0 || targetValue >= 100000000

Validation API Call:

Before calling we are using base time out which is fetched from the MDMS

https://github.com/egovernments/egov-mdms-data/blob/UNIFIED-DEV/data/mz/health/hcm-admin-console/baseTimeOut.json

Reference Links:

For the backend validation, we use the following hook: https://github.com/egovernments/DIGIT-Frontend/blob/campaign/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/hooks/useResourceData.js

The screens are using the given below components for upload and validation-

Bulk upload: https://github.com/egovernments/DIGIT-Frontend/blob/campaign/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/BulkUpload.js

Preview component: https://github.com/egovernments/DIGIT-Frontend/blob/campaign/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/XlsPreview.js

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

API Details

End Point
Method
Payload

/project-factory/v1/data/_generate

POST

Params will be different for different types- 1) facilityWithBoundary

tenantId:mz

type:facilityWithBoundary

forceUpdate:true

hierarchyType:ADMIN

campaignId:13175791-db53-4d10-be90-2dba1c138756 2) boundary tenantId:mz

type:boundary

forceUpdate:true

hierarchyType:ADMIN

campaignId:13175791-db53-4d10-be90-2dba1c138756 3)userWithBoundary tenantId:mz

type:userWithBoundary

forceUpdate:true

hierarchyType:ADMIN

campaignId:13175791-db53-4d10-be90-2dba1c138756

/project-factory/v1/data/_download

POST

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

/project-factory/v1/data/_create

POST

1) type: boundaryWithTarget { "type": "boundaryWithTarget", "hierarchyType": "ADMIN", "tenantId": "mz", "fileStoreId": "ad9efbdb-b2c5-434e-b86e-1cb02d61e758", "action": "validate", "campaignId": "13175791-db53-4d10-be90-2dba1c138756", "additionalDetails": {} } 2) type: facility { "type": "facility", "hierarchyType": "ADMIN", "tenantId": "mz", "fileStoreId": "a5ca723c-e463-4428-86b4-e0f706973857", "action": "validate", "campaignId": "13175791-db53-4d10-be90-2dba1c138756", "additionalDetails": {} } 3) type: user { "type": "user", "hierarchyType": "ADMIN", "tenantId": "mz", "fileStoreId": "3f6348b0-7e10-4f1a-8f48-dcfb0c9afdff", "action": "validate", "campaignId": "13175791-db53-4d10-be90-2dba1c138756", "additionalDetails": {} }

New Features:

A new popup has been added which display the option to download the template in all the three upload screens.

Use Case :

when the user comes after clicking next on the delivery screen and the file is not uploaded then this pop up is displayed.

Target Upload

Target Upload API

API Overview

Base URL: project-factory/v1/

Endpoint: /data/_create

  • Method: POST

Request Structure:

  • Body Parameters:

    • RequestInfo: Object Containing RequestInfo

    • ResourceDetails: Details of a given Resource

      • type: Type of resource to create (e.g., boundarywithTarget)

      • tenantId: Tenant

      • fileStoreId: FileStoreId of Target Upload Sheet

      • action: Action to perform (e.g., validate for target upload)

      • hierarchyType: Name of Boundary Hierarchy

      • campaignId: CampaignId

      • additionalDetails: Additional details (optional)

Response Structure:

  • Success Response:

    • ResponseInfo: Object Containing ResponseInfo

    • ResourceDetails: Details of the created resource

Flow:

  1. Client Initiates Request:

    • The client sends a POST request to /data/_create endpoint with action: validate.

  2. Validation of Request:

    • Resource Details Validation:

      • Check if request.body.ResourceDetails exists and is not empty.

      • Throw a validation error if missing or empty with the message "ResourceDetails is missing or empty or null".

    • Schema Validation:

      • Validate request.body.ResourceDetails against createRequestSchema.

    • Hierarchy Type Validation:

      • Validate hierarchyType in request.body.ResourceDetails using validateHierarchyType function.

    • Tenant ID Validation:

      • Ensure that request.body.ResourceDetails.tenantId matches request.body.RequestInfo.userInfo.tenantId.

      • Throw a validation error if they do not match with the message "tenantId is not matching with userInfo".

  3. Different Tab Headers Validation:

    • Validate whether headers are according to the template across all tabs of different districts.

  4. Target Sheet Validation:

    • All validations will be on Sheets other than the ReadMe Sheet and Boundary Data Sheet.

    • Immediate validations:

      • District Tabs Validation:

        • Validate whether all district tabs are present in the Target Sheet uploaded.

      • Empty Sheet Validation:

        • Throw a validation error if any Target Sheet is empty.

      • Root (District) level boundary validation:

        • Throw a validation error if the root column (District) is empty in any row.

    • Validations for each row:

      • Boundary Codes Validation:

        • Check for missing or empty boundary codes in any row of any sheet.

        • Check for boundary code columns to be of type string.

        • Check for the presence of more than one boundary code in a given row of a given Target Sheet.

        • Check for duplicacy of the boundary code within the given Target Sheet.

      • Boundary Targets Validation:

        • Ensure that Target values are not missing and are positive numbers less than 1 Million.

Campaign Manage APIs

The documentation details the API endpoints for creating, updating, and searching project type campaigns. It includes request and response structures, validation steps, and flow diagrams.

Create Campaign

Endpoint

POST /project-type/create

Request Structure

Body Parameters

  • RequestInfo: Object containing RequestInfo.

  • CampaignDetails: Object containing the details of the campaign to be created.

  • tenantId: Tenant identifier.

  • hierarchyType: Type of hierarchy.

  • action: Action type (create or draft).

  • boundaries: Array of boundaries.

  • resources: Array of resources.

  • projectType: Type of the project.

  • deliveryRules: Array of delivery rules.

  • Additional request info

Response Structure

Success Response

  • ResponseInfo: Object containing ResponseInfo.

  • CampaignDetails: The created campaign details.

Flow

Client Initiates Request

The client initiates a createCampaign request to the Project Factory Service.

Validation of Request

If the action is 'create':

  1. The Project Factory Service validates the request schema.

  2. It also validates the uniqueness of the campaign name in the database.

  3. If the campaign name exists, an error is thrown.

If the action is 'draft':

  1. The Project Factory Service validates the request schema.

  2. It also validates the uniqueness of the campaign name in the database.

  3. If the campaign name exists, an error is thrown.

Boundary and MDMS Validation

For both 'create' and 'draft' actions:

  1. The Project Factory Service validates the request for hierarchy type and boundaries with the Boundary Service.

  2. It validates the request for project type code from MDMS.

Campaign Creation

If the action is 'create':

  1. The Project Factory Service validates the request for data resources.

  2. It enriches the CampaignDetails and sets the status to 'creating'.

  3. The CampaignDetails are persisted in the database.

  4. For each resource data, the Project Factory Service creates resources through the /project-factory/v1/data/_create API.

  5. It enriches boundaries for project creation and creates projects for each boundary with the Health Project Service.

  6. The enriched CampaignDetails are persisted in the database.

  7. The CampaignDetails object is sent to a Kafka topic for project mappings.

  8. If the campaign status is not "created", project mappings are performed through the /project-factory/v1/project-type/createCampaign API and the status is updated to 'created'.

  9. If the campaign status is already 'created', an error is thrown, and the status is updated to 'failed'.

If the action is 'draft':

  1. The CampaignDetails are enriched, and the status is set to 'drafted;.

  2. The enriched CampaignDetails are persisted in the database.

Response

The Project Factory Service sends the response back to the client.

Flow Diagram

Update Project Type Campaign

Endpoint

POST /project-type/update

Request Structure

Body Parameters

  • RequestInfo: Object containing RequestInfo.

  • CampaignDetails: Object containing the details of the campaign to be updated.

  • id: Unique identifier of the campaign.

  • tenantId: Tenant identifier.

  • hierarchyType: Type of hierarchy.

  • action: Action type (create or draft).

  • boundaries: Array of boundaries.

  • resources: Array of resources.

  • projectType: Type of the project.

  • deliveryRules: Array of delivery rules.

Response Structure

Success Response

  • ResponseInfo: Object containing ResponseInfo.

  • CampaignDetails: The updated campaign details.

Flow

Receive Request

The ProjectFactoryService receives an updateCampaign request from the Client.

Validate Request Schema

The received request schema is validated to ensure it matches the expected format.

Check Campaign Existence

The system checks if the campaign specified in the request exists in the database.

Check Campaign Status

If the campaign exists, the system checks its status in the database.

Handle Drafted Status

If the campaign status is 'drafted':

  1. Validate Boundaries: Validate the request for hierarchyType and boundaries.

  2. Validate Project Type: It validates the request for project type code from MDMS.

  3. Enrich Campaign Details: Enrich the campaign details and set the status to 'updating'.

  4. Update Campaign Details: Update the campaign details in the database.

  5. Update Resource Data: Update each resource data associated with the campaign through the /project-factory/v1/data/_update API.

  6. Enrich Boundaries: Enrich the boundaries for the project update.

  7. Update Projects: Update projects associated with each boundary.

  8. Persist Changes: Persist the updated campaign details in the database.

  9. Send to Kafka Topic: Send the updated CampaignDetails object to the Kafka topic for project mappings.

  10. Listen to Kafka: Listen for updates from the Kafka topic to get the updated CampaignDetails object for project mappings.

Handle Campaign Status

If the campaign status is not 'created':

  1. Do project mapping through /project-factory/v1/project-type/createCampaign API.

  2. Enrich the CampaignDetails and set the status to 'created'.

  3. Update the CampaignDetail in the database.

Handle Project Mapping Error

If the campaign status is 'created':

  1. Throw an error indicating that the project is already mapped for this campaign.

  2. Enrich the CampaignDetails and set the status to 'failed'.

  3. Update the CampaignDetail in the database.

Handle Non-Drafted Status

If the campaign status is not 'drafted', the system throws an error indicating that only drafted campaigns can be updated.

Send Response

The ProjectFactoryService sends a response to the Client based on the outcome of the update operation.

Flow Diagram

Search Project Type Campaign

Endpoint

POST /project-type/search

Request Structure

Body Parameters

  • RequestInfo: Object containing RequestInfo.

  • CampaignDetails: Object containing the search criteria for campaigns.

  • tenantId: Tenant identifier.

  • ids: Array of campaign IDs to search for.

  • startDate: The start date for the search.

  • endDate: End date for the search.

  • projectType: Type of the project.

  • campaignName: Name of the campaign.

  • status: Status of the campaign.

  • createdBy: Creator of the campaign.

  • campaignNumber: Number of the campaign.

  • campaignsIncludeDates: Flag to include campaigns based on dates.

  • pagination: Object containing pagination settings.

    • limit: Maximum number of results to return.

    • offset: Offset for paginated results.

    • sortOrder: Sort order for results (asc/desc).

    • sortBy: Field to sort results by.

Response Structure

Success Response

  • ResponseInfo: Object containing ResponseInfo details.

  • CampaignDetails: Array containing details of matching campaigns.

  • totalCount: Total number of matching campaigns.

Flow

Client Initiates Request

The client sends a searchCampaign request to the Project Factory Service.

Validation of Request

The Project Factory Service validates the request schema and search criteria.

Search Campaigns

  • The Project Factory Service constructs a search query based on the provided criteria.

  • It checks if there are specific search fields like start date, end date, campaign name, etc.

  • Depending on the campaignsIncludeDates flag, the service adjusts the search conditions accordingly.

    • If campaignsIncludeDates is true:

      • It shows only those campaigns whose start date is on or before the provided start date and whose end date is on or after the provided end date.

    • If campaignsIncludeDates is false:

      • It shows only those campaigns whose start date is on or after the provided start date and whose end date is on or before the provided end date.

  • The service executes the constructed query to retrieve matching campaign details from the database.

Response

The Project Factory Service sends the response back to the client.

  • The response contains the matching campaign details along with the total count, if applicable.

Flow Diagram

Summary Screen

The Summary screen provides users with a comprehensive view of all campaign details entered.

Users can review the entirety of their campaign information. If the campaign status is marked as 'drafted,' users can either edit the existing data or submit it. After submission, the campaign is created, initiating the 'create' action.

For campaigns in a 'draft' status, the summary screen serves as the final step of the campaign setup process, giving users the option to edit or submit the details before finalisation.

If the campaign is successfully created while in the 'draft' status, users are directed to a success screen.

After the API call, the data undergoes restructuring to present delivery rules based on the cycle and delivery details.

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

Implementing error cards and screens

If campaign data is incomplete and user tries to create a campaign, then we are showing all the erros in the respective card specifyig the error to the user. User can make the change by using errors button or clicking on edit button showing in the card.

Errors card Implementation:

We are adding all the errors as per screen name in an array and passing the erros as a props in ViewComposer component.

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

API Details:

For draft status only:

End point
Method
Payload

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

POST

{ "CampaignDetails": { "id": "eacb77b9-0bcd-4939-88a6-ca9456eb7bc4", "tenantId": "mz", "status": "drafted", "action": "create", "campaignNumber": "CMP-2024-05-09-001425", "campaignName": "checkte", "projectType": "LLIN-Moz", "hierarchyType": "ADMIN", "boundaryCode": "mz", "projectId": null, "startDate": 1715538599000, "endDate": 1717266599000, "additionalDetails": { "beneficiaryType": "HOUSEHOLD", "key": 10 }, "resources": [ { "type": "facility", "filename": "fac.xlsx", "filestoreId": "19be64bc-5a03-4932-9b88-90feb16e642a" }, { "type": "boundaryWithTarget", "filename": "TR.xlsx", "filestoreId": "8821993e-339b-4af5-9263-337276891065" } ], "boundaries": [ { "code": "mz", "type": "Country", "isRoot": true, "includeAllChildren": true }], "deliveryRules": [ { "startDate": 1715711399000, "endDate": 1716661799000, "cycleNumber": 1, "deliveryNumber": 1, "deliveryRuleNumber": 1, "products": [ { "value": "PVAR-2024-01-24-000076", "name": "SP - 500mg", "count": 1 } ], "conditions": [ { "attribute": "Age", "operator": "LESS_THAN", "value": 100 } ] } ], "auditDetails": { "createdBy": "63a21269-d40d-4c26-878f-4f4486b1f44b", "lastModifiedBy": "63a21269-d40d-4c26-878f-4f4486b1f44b", "createdTime": 1715275958664, "lastModifiedTime": 1715276207117 } }, "RequestInfo": { } }

Release Notes

Here are the articles in this section:

v0.1 Release Notes

Automation - Run HCM Console Script

This step involves executing the Postman collection for collective creation of hierarchical data, file uploads, template generation, validation, and campaign creation within the same

Steps

  1. Import the environment variable file and collection file in Postman.

155KB
ADMIN CONSOLE flow 1.postman_collection.json
collection.json
6KB
Admin console flow.postman_environment.json
environment.json
  • Click on the Import button and drop both files.

  1. Go to the Environment tab on the left side and click on it.

Certain values of environment variables should be changed depending on the following:

  • URL: This depends on the environment being used (for example, development, staging, production).

  • tenantid: Identifies the specific tenant for which the operations are being performed.

  • projecttype: Specifies the type of project, which can be either "LLIN-mz" or "MR-DN" (MDMS configuration).

  • locale: Defines the locale/language for localization purposes (e.g., en_IN for English in India, en_MZ for English in Mozambique).

  • msgId: Unique identifier combined with locale (e.g., 1710912592752|en_MZ). In msg id, change as per the locale used.

  1. Go to the collection tab on the left side and click on it.

List of APIs

  1. Auth token: Obtains credentials required to execute the collection.

  1. Create boundary-hierarchy-definition: Creates a new hierarchy definition.

  1. Search boundary-hierarchy-definition: Searches for a hierarchy definition created by the user.

  1. F ilestore upload: Uploads boundaries stored in an Excel file.

  1. Boundary bulk upload: Uploads boundaries for previously created hierarchies.

  1. Boundary relationship search API: Searches relationships of boundary uploads within a specified hierarchy.

  1. Upsert localisations: Inserts or updates localizations for headers related to hierarchy names in a spreadsheet.

  1. Search Localisations: Verifies if localisations have been successfully created.

  1. Campaign create draft: Initiates the creation of a campaign with project type, name, start/end dates, delivery rules, and selected boundaries.

  1. Campaign search: Searches the drafted campaign

  1. Template Generate API - boundary: Generates a template for uploading targets.

  1. Template Download API - boundary: Retrieves Filestore ID generated from template generate API for boundary templates.

  1. Get Excel: Fetches and downloads the Excel file associated with a Filestore ID.

  1. Filestore upload: Uploads a target file by filling in all necessary data.

  1. Template Generate API - facility: Generates a template for uploading facilities.

16.Template Download API - facility: Retrieves Filestore ID generated from Template Generate API for facility templates.

  1. Get Excel: Fetches and downloads the Excel file associated with a Filestore ID.

  1. Filestore upload: Uploads a facility file by filling in all necessary data.

  1. Template Generate API - user: Generates a template for uploading users.

  1. Template Download API - user: Retrieves Filestore ID generated from Template Generate API for user templates.

  1. Get Excel: Fetches and downloads the Excel file associated with a Filestore ID.

  1. Filestore upload: Uploads a user file by filling in all necessary data.

  1. Validate resource boundary: Checks the correctness of an uploaded boundary file.

  1. Search API: Searches for the validated boundary file.

  1. Validate resource facility: Checks the correctness of an uploaded facility file.

  1. Search API: Searches for the validated facility file.

  1. Validate resource user: Checks the correctness of an uploaded user file.

  1. Search API: Searches for the validated user file.

  1. Campaign create: Creates a campaign using resource IDs and Filestore IDs validated through previous APIs.

  1. Campaign search API: Searches for a campaign and checks its status (creating, created, or failed).

  1. Search API - user creds: Fetches user credentials resource ID.

  1. Check user creds Excel.

  1. Start executing the script one by one.

  2. In Filestore upload API, upload the Excel sheet in the file field by uploading the valid file. You will get a filestore id in response.

For example, A valid file can be created - if hierarchyType is "MH" and the sheet has 6 levels consisting of COUNTRY, PROVINCE, DISTRITO, POST ADMINISTRATIVE, LOCALITY and VILLAGE. Change the sheet name to MH_COUNTRY, MH_PROVINCE, MH_DISTRITO, MH_POST ADMINISTRATIVE, MH_LOCALITY, and MH_VILLAGE and all the boundaries as per hierarchy and upload the Excel sheet.

The sample sheet with valid data is given below:

57KB
Sample sheet.xlsx
  1. From 13. check the Excel with filestore Target API, and click on the filestore link by clicking on ctrl+click. It will download the target file.

  1. From 14. filestore upload target API. After downloading the file, upload the valid file by filling in the target column in the sheet. You will get a filestore id in response.

Sample Sheet:

10KB
Target Template (sample).xlsx
  1. From 17, check the Excel with filestore API. Click on the filestore link (ctrl+click). It will download the facility file.

  1. From 18, filestore upload Facility API; after downloading the file, upload the valid file by filling in the facility usage and boundary code column in the sheet. You will get a filestore id in response.

Sample Sheet:

29KB
Facility Template (sample).xlsx
  1. From 21, check the Excel with filestore API, and click on the filestore link by pressing ctrl+click. It will download the user file.

  1. From 22, filestore upload User API. After downloading the file, upload the valid file by filling in all columns in the sheet. You will get a filestore id in response.

Sample Sheet:

25KB
User Template (sample).xlsx
  1. From 32, check user creds Excel. You will be able to get the user credentials Excel sheet by clicking on the filestore link (ctrl+click).

In the user credentials sheet, you will be able to see the username and password to log into the app.

Sample Sheet:

22KB
userCredential (1).xlsx

High Level Design

The platform architecture illustration below provides a visual representation of the key components and layers that facilitate a campaign creation flow in health campaign management.

Master Data

The following are the various master data that will be used during the campaign creation process.

  1. Different types of campaign and delivery rules.

  2. Attributes on which delivery rules can be created.

  3. Schema to validate the Excel data for different templates.

  4. Parsing and transforming templates.

  5. Type to API mapping.

Project Factory Components

User Interface Design

Below are the configurations needed for successfully setting up the campaign module:

MDMS Configuration

  • citymodule needed to run campaign module in an environment:

    Link: https://github.com/egovernments/egov-mdms-data/blob/UNIFIED-QA/data/mz/tenant/citymodule.json

{
      "module": "Campaign",
      "code": "Campaign",
      "active": true,
      "order": 10,
      "tenants": [
        {
          "code": "mz"
        }
      ]
    },

  • roleactions config needed for the user for all campaign access

    Link: https://github.com/egovernments/egov-mdms-data/blob/UNIFIED-QA/data/mz/ACCESSCONTROL-ROLEACTIONS/roleactions.json

  • actionTest config needed for sidebar action and user access for services

    LINK: https://github.com/egovernments/egov-mdms-data/blob/UNIFIED-QA/data/mz/ACCESSCONTROL-ACTIONS-TEST/actions-test.json

    To enable action in the sidebar, add navigationUrl and path to the object

{
      ```
      "path": "1Campaign.Mycampaign",
      "navigationURL": "/workbench-ui/employee/campaign/my-campaign",
      "leftIcon": "dynamic:EstimateIcon",
      "rightIcon": ""
    },

Refer to the below id's link in QA:

  • 1528

  • 1763

  • 1764

  • 1765

  • 1766

  • 1767

  • 1768

  • 1769

  • 1770

  • 1771

  • 1772

  • 1773

  • 1774

  • 1775

  • 1776

  • 1777

  • roles need to be added in roles

    Link: https://github.com/egovernments/egov-mdms-data/blob/UNIFIED-QA/data/mz/ACCESSCONTROL-ROLES/roles.json

{
      "code": "CAMPAIGN_MANAGER",
      "name": "Campaign Manager",
      "description": "Campaign Manager"
    }
  • Boundary Schema config needs to be added for boundary sheet validation:

    Link: https://github.com/egovernments/egov-mdms-data/blob/UNIFIED-QA/data/mz/health/hcm-admin-console/boundarySchema.json

  • Facility Schema config needs to be added for facility sheet validation:

    Link:https://github.com/egovernments/egov-mdms-data/blob/UNIFIED-QA/data/mz/health/hcm-admin-console/facilitySchema.json

  • User schema config needs to be added for user sheet validation:

    Link: https://github.com/egovernments/egov-mdms-data/blob/UNIFIED-QA/data/mz/health/hcm-admin-console/userSchema.json

  • Hierarchy config needs to be added to define lowset hierarchy in boundary selection:

    Link: https://github.com/egovernments/egov-mdms-data/blob/UNIFIED-QA/data/mz/health/hcm-admin-console/hierarchyConfig.json

Devops Configuration

  • Global configuratio needs to be added to environments.

    Link: https://github.com/egovernments/DIGIT-DevOps/blob/unified-env/deploy-as-code/helm/environments/unified-uat.yaml

  • Helm chart needs to be added in devops.

    Link: https://github.com/egovernments/DIGIT-DevOps/blob/unified-env/deploy-as-code/helm/charts/frontend/workbench-ui/Chart.yaml

  • Refer here to learn more about the setup environment.

Localisation

Module
Use

rainmaker-common

For all common screen localisation messages like login, homepage, sidebar

rainmaker-campaignmanager

For all admin console related screens localisation messages

rainmaker-hcm-admin-schemas

For all upload schemas like target, facility, user

boundary-${BOUNDARY_HIERARCHY_TYPE}

For boundary type localisations, we are getting this BOUNDARY_HIERARCHY_TYPE from the mdms

Project Factory (Campaign Manager)

Overview

This service is used to create a Project (Campaign), create required resource data, and create a mapping relation between them based on the boundary data.

Project Factory Flow

Dependencies

  1. Project

  2. Facility

  3. Product

  4. HRMS

  5. MDMS

  6. Boundary

  7. Localisation

  8. Access Control

  9. IdGen

  10. Individual

  11. User

API Specification

Base Path: /project-factory/

API Contract Link

Project Factory API Spec

Data Model

DB Schema Diagram

Data API's DB Schema

campaign process db diagram

Web Sequence Diagrams

Data Create API

Bulk Create Data API

Generate Data API

Generate Bulk Data API

Process Create Campaign API

Create Campaign API
Swagger Editor

Master Data Management Service (MDMS) & Configuration Updates

Configuration details

Feature
Service name
Changes
Description

boundary persister

boundary persister

project-factory persister

project-factory persister

For MDMS-V2 changes, refer to the file below for MDMS schema and data that needs to be added for health - HCM-ADMIN-CONSOLE service: Refer here to get all the MDMSv2 schemas and data.

https://api.postman.com/collections/29681440-f3d1e10d-18ac-493c-b135-2d90b2c99804?access_key=PMAT-01J0R7QH8J233MMZ1N9QN94MV4

  1. Data for schema HCM-ADMIN-CONSOLE.attributeConfig

[
      {
        "key": 1,
        "code": "Age",
        "i18nKey": "CAMPAIGN_ATTRIBUTE_AGE"
      },
      {
        "key": 2,
        "code": "Height",
        "i18nKey": "CAMPAIGN_ATTRIBUTE_HEIGHT"
      },
      {
        "key": 3,
        "code": "Weight",
        "i18nKey": "CAMPAIGN_ATTRIBUTE_WEIGHT"
      },
      {
        "key": 4,
        "code": "Gender",
        "i18nKey": "CAMPAIGN_ATTRIBUTE_GENDER"
      }
    ]
  1. Data for schema HCM-ADMIN-CONSOLE.deliveryTypeConfig

{
  "tenantId": "mz",
  "moduleName": "HCM-ADMIN-CONSOLE",
  "deliveryTypeConfig": [
    {
      "key": 1,
      "code": "DIRECT"
    },
    {
      "key": 2,
      "code": "INDIRECT"
    }
  ]
}
  1. Data for schema HCM-ADMIN-CONSOLE.deliveryConfig

 [
        {
            "id": "420b3aa2-9374-46db-8cb1-d556b91bfe5c",
            "tenantId": "mz",
            "schemaCode": "HCM-ADMIN-CONSOLE.deliveryConfig",
            "uniqueIdentifier": "LLIN-mz",
            "data": {
                "cycleConfig": {
                    "cycle": 1,
                    "deliveries": 1
                },
                "projectType": "LLIN-mz",
                "attrAddDisable": true,
                "deliveryConfig": [
                    {
                        "productConfig": [
                            {
                                "key": 1,
                                "name": "LLIN Bednet - Large",
                                "count": 1,
                                "value": "PVAR-2024-05-29-000073"
                            }
                        ],
                        "attributeConfig": [
                            {
                                "key": 1,
                                "label": "Custom",
                                "value": 1.8,
                                "attrType": "text",
                                "attrValue": "CAMPAIGN_BEDNET_INDIVIDUAL_LABEL",
                                "operatorValue": "EQUAL_TO"
                            },
                            {
                                "key": 2,
                                "label": "Custom",
                                "value": 3,
                                "attrType": "text",
                                "attrValue": "CAMPAIGN_BEDNET_HOUSEHOLD_LABEL",
                                "operatorValue": "LESS_THAN_EQUAL_TO"
                            }
                        ]
                    }
                ],
                "customAttribute": true,
                "deliveryAddDisable": true
            },
            "isActive": true,
            "auditDetails": {
                "createdBy": "8b110055-330f-4e7b-b4c0-f618f29b9d47",
                "lastModifiedBy": "8b110055-330f-4e7b-b4c0-f618f29b9d47",
                "createdTime": 1718790384341,
                "lastModifiedTime": 1718790384341
            }
        },
        {
            "id": "ea8ecfc2-acc6-4292-a618-e9eabba488bb",
            "tenantId": "mz",
            "schemaCode": "HCM-ADMIN-CONSOLE.deliveryConfig",
            "uniqueIdentifier": "MR-DN",
            "data": {
                "cycleConfig": {
                    "cycle": 4,
                    "deliveries": 3
                },
                "projectType": "MR-DN",
                "attrAddDisable": false,
                "deliveryConfig": [
                    {
                        "delivery": 1,
                        "conditionConfig": [
                            {
                                "deliveryType": "DIRECT",
                                "productConfig": [
                                    {
                                        "key": 1,
                                        "name": "SP  - 250mg",
                                        "count": 1,
                                        "value": "PVAR-2024-05-29-000068"
                                    },
                                    {
                                        "key": 1,
                                        "name": "AQ  - 75mg",
                                        "count": 1,
                                        "value": "PVAR-2024-05-29-000067"
                                    }
                                ],
                                "attributeConfig": [
                                    {
                                        "key": 1,
                                        "label": "Custom",
                                        "toValue": 11,
                                        "attrType": "dropdown",
                                        "attrValue": "Age",
                                        "fromValue": 3,
                                        "operatorValue": "IN_BETWEEN"
                                    }
                                ],
                                "disableDeliveryType": true
                            },
                            {
                                "deliveryType": "DIRECT",
                                "productConfig": [
                                    {
                                        "key": 1,
                                        "name": "A.Q - 150mg",
                                        "count": 1,
                                        "value": "PVAR-2024-05-29-000069"
                                    },
                                    {
                                        "key": 1,
                                        "name": "S.P - 500mg",
                                        "count": 1,
                                        "value": "PVAR-2024-05-29-000070"
                                    }
                                ],
                                "attributeConfig": [
                                    {
                                        "key": 1,
                                        "label": "Custom",
                                        "toValue": 59,
                                        "attrType": "dropdown",
                                        "attrValue": "Age",
                                        "fromValue": 12,
                                        "operatorValue": "IN_BETWEEN"
                                    }
                                ],
                                "disableDeliveryType": true
                            }
                        ]
                    },
                    {
                        "delivery": 2,
                        "conditionConfig": [
                            {
                                "deliveryType": "INDIRECT",
                                "productConfig": [
                                    {
                                        "key": 1,
                                        "name": "AQ  - 75mg",
                                        "count": 1,
                                        "value": "PVAR-2024-05-29-000067"
                                    }
                                ],
                                "attributeConfig": [
                                    {
                                        "key": 1,
                                        "label": "Custom",
                                        "toValue": 11,
                                        "attrType": "dropdown",
                                        "attrValue": "Age",
                                        "fromValue": 3,
                                        "operatorValue": "IN_BETWEEN"
                                    }
                                ]
                            },
                            {
                                "deliveryType": "INDIRECT",
                                "productConfig": [
                                    {
                                        "key": 1,
                                        "name": "A.Q - 150mg",
                                        "count": 1,
                                        "value": "PVAR-2024-05-29-000069"
                                    }
                                ],
                                "attributeConfig": [
                                    {
                                        "key": 1,
                                        "label": "Custom",
                                        "toValue": 59,
                                        "attrType": "dropdown",
                                        "attrValue": "Age",
                                        "fromValue": 12,
                                        "operatorValue": "IN_BETWEEN"
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "delivery": 3,
                        "conditionConfig": [
                            {
                                "deliveryType": "INDIRECT",
                                "productConfig": [
                                    {
                                        "key": 1,
                                        "name": "AQ  - 75mg",
                                        "count": 1,
                                        "value": "PVAR-2024-05-29-000067"
                                    }
                                ],
                                "attributeConfig": [
                                    {
                                        "key": 1,
                                        "label": "Custom",
                                        "toValue": 11,
                                        "attrType": "dropdown",
                                        "attrValue": "Age",
                                        "fromValue": 3,
                                        "operatorValue": "IN_BETWEEN"
                                    }
                                ]
                            },
                            {
                                "deliveryType": "INDIRECT",
                                "productConfig": [
                                    {
                                        "key": 1,
                                        "name": "A.Q - 150mg",
                                        "count": 1,
                                        "value": "PVAR-2024-05-29-000069"
                                    }
                                ],
                                "attributeConfig": [
                                    {
                                        "key": 1,
                                        "label": "Custom",
                                        "toValue": 59,
                                        "attrType": "dropdown",
                                        "attrValue": "Age",
                                        "fromValue": 12,
                                        "operatorValue": "IN_BETWEEN"
                                    }
                                ]
                            }
                        ]
                    }
                ],
                "customAttribute": true,
                "deliveryAddDisable": false
            },
            "isActive": true,
            "auditDetails": {
                "createdBy": "8b110055-330f-4e7b-b4c0-f618f29b9d47",
                "lastModifiedBy": "8b110055-330f-4e7b-b4c0-f618f29b9d47",
                "createdTime": 1718790371242,
                "lastModifiedTime": 1718790371242
            }
        }
    ]
  1. Data for schema HCM-ADMIN-CONSOLE.facilityschema

 {
    "tenantId": "mz",
    "moduleName": "HCM-ADMIN-CONSOLE",
    "facilitySchema": [
        {
            "$schema": "http://json-schema.org/draft-07/schema#",
            "title": "FacilityTemplateSchema",
            "type": "object",
            "properties": {
                "HCM_ADMIN_CONSOLE_FACILITY_NAME": {
                    "type": "string",
                    "maxLength": 2000,
                    "minLength": 1
                },
                "HCM_ADMIN_CONSOLE_FACILITY_TYPE": {
                    "enum": [
                        "Warehouse",
                        "Health Facility"
                    ]
                },
                "HCM_ADMIN_CONSOLE_FACILITY_STATUS": {
                    "enum": [
                        "Temporary",
                        "Permanent"
                    ]
                },
                "HCM_ADMIN_CONSOLE_FACILITY_CAPACITY": {
                    "type": "number",
                    "minimum": 1,
                    "maximum": 100000000
                },
                "HCM_ADMIN_CONSOLE_BOUNDARY_CODE_MANDATORY": {
                    "type": "string"
                }
            },
            "required": [
                "HCM_ADMIN_CONSOLE_FACILITY_NAME",
                "HCM_ADMIN_CONSOLE_FACILITY_TYPE",
                "HCM_ADMIN_CONSOLE_FACILITY_STATUS",
                "HCM_ADMIN_CONSOLE_FACILITY_CAPACITY",
                "HCM_ADMIN_CONSOLE_BOUNDARY_CODE_MANDATORY"
            ],
            "unique": [
                "HCM_ADMIN_CONSOLE_FACILITY_NAME"
            ]
        }
    ]
}
  1. Data for schema HCM-ADMIN-CONSOLE.adminSchema

  [
        {
            "title": "user",
            "$schema": "http://json-schema.org/draft-07/schema#",
            "properties": {
                "enumProperties": [
                    {
                        "enum": [
                            "Registrar",
                            "Distributor",
                            "Supervisor",
                            "Help Desk",
                            "Monitor Local",
                            "Logistical officer"
                        ],
                        "name": "HCM_ADMIN_CONSOLE_USER_ROLE",
                        "isRequired": true,
                        "description": "User Role",
                        "orderNumber": 3
                    },
                    {
                        "enum": [
                            "Temporary",
                            "Permanent"
                        ],
                        "name": "HCM_ADMIN_CONSOLE_USER_EMPLOYMENT_TYPE",
                        "isRequired": true,
                        "description": "Employement Type",
                        "orderNumber": 4
                    }
                ],
                "numberProperties": [
                    {
                        "name": "HCM_ADMIN_CONSOLE_USER_PHONE_NUMBER",
                        "type": "number",
                        "isUnique": true,
                        "isRequired": true,
                        "description": "Phone Number",
                        "orderNumber": 2
                    }
                ],
                "stringProperties": [
                    {
                        "name": "HCM_ADMIN_CONSOLE_USER_NAME",
                        "type": "string",
                        "maxLength": 128,
                        "minLength": 2,
                        "isRequired": true,
                        "description": "User Name",
                        "orderNumber": 1
                    },
                    {
                        "name": "HCM_ADMIN_CONSOLE_BOUNDARY_CODE_MANDATORY",
                        "type": "string",
                        "isRequired": true,
                        "description": "Boundary Code (Mandatory)",
                        "orderNumber": 5
                    }
                ]
            },
            "campaignType": "all"
        },
        {
            "title": "facility",
            "$schema": "http://json-schema.org/draft-07/schema#",
            "properties": {
                "enumProperties": [
                    {
                        "enum": [
                            "Warehouse",
                            "Health Facility",
                            "Storing Resource"
                        ],
                        "name": "HCM_ADMIN_CONSOLE_FACILITY_TYPE",
                        "isRequired": true,
                        "description": "Facility type",
                        "orderNumber": 2
                    },
                    {
                        "enum": [
                            "Temporary",
                            "Permanent"
                        ],
                        "name": "HCM_ADMIN_CONSOLE_FACILITY_STATUS",
                        "isRequired": true,
                        "description": "Facility status",
                        "orderNumber": 3
                    },
                    {
                        "enum": [
                            "Active",
                            "Inactive"
                        ],
                        "name": "HCM_ADMIN_CONSOLE_FACILITY_USAGE",
                        "isRequired": true,
                        "description": "Facility usage",
                        "orderNumber": 6
                    }
                ],
                "numberProperties": [
                    {
                        "name": "HCM_ADMIN_CONSOLE_FACILITY_CAPACITY",
                        "type": "number",
                        "maximum": 100000000,
                        "minimum": 1,
                        "isRequired": true,
                        "description": "Camapcity",
                        "orderNumber": 4
                    }
                ],
                "stringProperties": [
                    {
                        "name": "HCM_ADMIN_CONSOLE_FACILITY_NAME",
                        "type": "string",
                        "isUnique": true,
                        "maxLength": 2000,
                        "minLength": 1,
                        "isRequired": true,
                        "description": "Facility Name",
                        "orderNumber": 1
                    },
                    {
                        "name": "HCM_ADMIN_CONSOLE_BOUNDARY_CODE_MANDATORY",
                        "type": "string",
                        "isRequired": true,
                        "description": "Boundary Code",
                        "orderNumber": 5
                    }
                ]
            },
            "campaignType": "all"
        },
        {
            "title": "boundary",
            "$schema": "http://json-schema.org/draft-07/schema#",
            "properties": {
                "numberProperties": [
                    {
                        "name": "HCM_ADMIN_CONSOLE_TARGET_SMC_AGE_3_TO_11",
                        "type": "number",
                        "isRequired": true,
                        "description": "Target at village level - Age 3 to 11 Months (Mandatory and to be entered by the user)",
                        "orderNumber": 2
                    },
                    {
                        "name": "HCM_ADMIN_CONSOLE_TARGET_SMC_AGE_12_TO_59",
                        "type": "number",
                        "isRequired": true,
                        "description": "Target at village level - Age 12 to 59 Months (Mandatory and to be entered by the user)",
                        "orderNumber": 3
                    }
                ],
                "stringProperties": [
                    {
                        "name": "HCM_ADMIN_CONSOLE_BOUNDARY_CODE",
                        "type": "string",
                        "isRequired": true,
                        "description": "Boundary Code",
                        "orderNumber": 1,
                        "freezeColumn": true
                    }
                ]
            },
            "campaignType": "MR-DN"
        },
        {
            "title": "boundary",
            "$schema": "http://json-schema.org/draft-07/schema#",
            "properties": {
                "numberProperties": [
                    {
                        "name": "HCM_ADMIN_CONSOLE_TARGET",
                        "type": "number",
                        "isRequired": true,
                        "description": "Target at the Selected Boundary Level",
                        "orderNumber": 2
                    }
                ],
                "stringProperties": [
                    {
                        "name": "HCM_ADMIN_CONSOLE_BOUNDARY_CODE",
                        "type": "string",
                        "isRequired": true,
                        "description": "Boundary Code",
                        "orderNumber": 1,
                        "freezeColumn": true
                    }
                ]
            },
            "campaignType": "LLIN-mz"
        },
        {
            "title": "boundaryWithTarget",
            "$schema": "http://json-schema.org/draft-07/schema#",
            "properties": {
                "numberProperties": [
                    {
                        "name": "HCM_ADMIN_CONSOLE_TARGET",
                        "type": "number",
                        "maximum": 100000000,
                        "minimum": 1,
                        "isRequired": true,
                        "description": "Target at the Selected Boundary Level",
                        "orderNumber": 1
                    }
                ],
                "stringProperties": [
                    {
                        "name": "HCM_ADMIN_CONSOLE_BOUNDARY_CODE",
                        "type": "string",
                        "isRequired": true,
                        "description": "Boundary Code",
                        "orderNumber": 1,
                        "freezeColumn": true
                    }
                ]
            },
            "campaignType": "LLIN-mz"
        },
        {
            "title": "boundaryWithTarget",
            "$schema": "http://json-schema.org/draft-07/schema#",
            "properties": {
                "numberProperties": [
                    {
                        "name": "HCM_ADMIN_CONSOLE_TARGET_SMC_AGE_3_TO_11",
                        "type": "number",
                        "maximum": 100000000,
                        "minimum": 1,
                        "isRequired": true,
                        "description": "Target at village level - Age 3 to 11 Months (Mandatory and to be entered by the user)",
                        "orderNumber": 2
                    },
                    {
                        "name": "HCM_ADMIN_CONSOLE_TARGET_SMC_AGE_12_TO_59",
                        "type": "number",
                        "maximum": 100000000,
                        "minimum": 1,
                        "isRequired": true,
                        "description": "Target at village level - Age 12 to 59 Months (Mandatory and to be entered by the user)",
                        "orderNumber": 3
                    }
                ],
                "stringProperties": [
                    {
                        "name": "HCM_ADMIN_CONSOLE_BOUNDARY_CODE",
                        "type": "string",
                        "isRequired": true,
                        "description": "Boundary Code",
                        "orderNumber": 1,
                        "freezeColumn": true
                    }
                ]
            },
            "campaignType": "MR-DN"
        }
    ]
  1. Data for schema HCM-ADMIN-CONSOLE.baseTimeout

     [
      {
        "baseTimeOut": 50,
        "maxTime": 2500
      }
    ]
  1. Data for schema HCM-ADMIN-CONSOLE.mailConfig

 [
      {
        "mailId": "[email protected]"
      }
    ]
  1. Data for schema HCM-ADMIN-CONSOLE.operatorConfig

[
      {
        "key": 1,
        "code": "LESS_THAN"
      },
      {
        "key": 2,
        "code": "GREATER_THAN"
      },
      {
        "key": 3,
        "code": "IN_BETWEEN"
      },
      {
        "key": 4,
        "code": "EQUAL_TO"
      },
      {
        "key": 5,
        "code": "GREATER_THAN_EQUAL_TO"
      },
      {
        "key": 6,
        "code": "LESS_THAN_EQUAL_TO"
      }
    ]
  1. Data for schema HCM-ADMIN-CONSOLE.productType

[
      {
        "key": 1,
        "code": "BEDNET"
      },
      {
        "key": 2,
        "code": "TONIC"
      },
      {
        "key": 3,
        "code": "DRUG"
      }
    ]
  1. Data for schema HCM-ADMIN-CONSOLE.readMeConfig

 [
    {
      "type": "facilityWithBoundary",
      "texts": [
        {
          "header": "FACILITYWITHBOUNDARY_README_HEADER_1",
          "isHeaderBold": true,
          "inSheet": true,
          "inUiInfo": true,
          "descriptions": [
            {
              "text": "FACILITYWITHBOUNDARY_README_HEADER_1_DESC_1",
              "isStepRequired": true
            },
            {
              "text": "FACILITYWITHBOUNDARY_README_HEADER_1_DESC_2",
              "isStepRequired": true
            }
          ]
        },
        {
          "header": "FACILITYWITHBOUNDARY_README_HEADER_2",
          "isHeaderBold": true,
          "inSheet": true,
          "inUiInfo": true,
          "descriptions": [
            {
              "text": "FACILITYWITHBOUNDARY_README_HEADER_2_DESC_1",
              "isStepRequired": true
            },
            {
              "text": "FACILITYWITHBOUNDARY_README_HEADER_2_DESC_2",
              "isStepRequired": true
            },
            {
              "text": "FACILITYWITHBOUNDARY_README_HEADER_2_DESC_3",
              "isStepRequired": true
            },
            {
              "text": "FACILITYWITHBOUNDARY_README_HEADER_2_DESC_4",
              "isStepRequired": true
            },
            {
              "text": "FACILITYWITHBOUNDARY_README_HEADER_2_DESC_5",
              "isStepRequired": false
            },
            {
              "text": "FACILITYWITHBOUNDARY_README_HEADER_2_DESC_6",
              "isStepRequired": false
            },
            {
              "text": "FACILITYWITHBOUNDARY_README_HEADER_2_DESC_7",
              "isStepRequired": false
            }
          ]
        },
        {
          "header": "FACILITYWITHBOUNDARY_README_HEADER_3",
          "isHeaderBold": true,
          "inSheet": true,
          "inUiInfo": true,
          "descriptions": [
            {
              "text": "FACILITYWITHBOUNDARY_README_HEADER_3_DESC_1",
              "isStepRequired": false
            },
            {
              "text": "FACILITYWITHBOUNDARY_README_HEADER_3_DESC_2",
              "isStepRequired": false
            },
            {
              "text": "FACILITYWITHBOUNDARY_README_HEADER_3_DESC_3",
              "isStepRequired": false
            }
          ]
        }
      ]
    },
    {
      "type": "userWithBoundary",
      "texts": [
        {
          "header": "USERWITHBOUNDARY_README_HEADER_1",
          "isHeaderBold": true,
          "inSheet": true,
          "inUiInfo": true,
          "descriptions": [
            {
              "text": "USERWITHBOUNDARY_README_HEADER_1_DESC_1",
              "isStepRequired": true
            },
            {
              "text": "USERWITHBOUNDARY_README_HEADER_1_DESC_2",
              "isStepRequired": true
            }
          ]
        },
        {
          "header": "USERWITHBOUNDARY_README_HEADER_2",
          "isHeaderBold": true,
          "inSheet": true,
          "inUiInfo": true,
          "descriptions": [
            {
              "text": "USERWITHBOUNDARY_README_HEADER_2_DESC_1",
              "isStepRequired": true
            },
            {
              "text": "USERWITHBOUNDARY_README_HEADER_2_DESC_2",
              "isStepRequired": true
            },
            {
              "text": "USERWITHBOUNDARY_README_HEADER_2_DESC_3",
              "isStepRequired": true
            },
            {
              "text": "USERWITHBOUNDARY_README_HEADER_2_DESC_4",
              "isStepRequired": true
            }
          ]
        },
        {
          "header": "USERWITHBOUNDARY_README_HEADER_3",
          "isHeaderBold": true,
          "inSheet": true,
          "inUiInfo": true,
          "descriptions": [
            {
              "text": "USERWITHBOUNDARY_README_HEADER_3_DESC_1",
              "isStepRequired": false
            },
            {
              "text": "USERWITHBOUNDARY_README_HEADER_3_DESC_2",
              "isStepRequired": false
            }
          ]
        }
      ]
    },
    {
      "type": "boundary",
      "texts": [
        {
          "header": "BOUNDARY_README_HEADER_1",
          "isHeaderBold": true,
          "inSheet": true,
          "inUiInfo": true,
          "descriptions": [
            {
              "text": "BOUNDARY_README_HEADER_1_DESC_1",
              "isStepRequired": true
            },
            {
              "text": "BOUNDARY_README_HEADER_1_DESC_2",
              "isStepRequired": true
            }
          ]
        },
        {
          "header": "BOUNDARY_README_HEADER_2",
          "isHeaderBold": true,
          "inSheet": true,
          "inUiInfo": true,
          "descriptions": [
            {
              "text": "BOUNDARY_README_HEADER_2_DESC_1",
              "isStepRequired": true
            },
            {
              "text": "BOUNDARY_README_HEADER_2_DESC_2",
              "isStepRequired": true
            },
            {
              "text": "BOUNDARY_README_HEADER_2_DESC_3",
              "isStepRequired": true
            },
            {
              "text": "BOUNDARY_README_HEADER_2_DESC_4",
              "isStepRequired": true
            }
          ]
        },
        {
          "header": "BOUNDARY_README_HEADER_3",
          "isHeaderBold": true,
          "inSheet": true,
          "inUiInfo": true,
          "descriptions": [
            {
              "text": "BOUNDARY_README_HEADER_3_DESC_1",
              "isStepRequired": false
            },
            {
              "text": "BOUNDARY_README_HEADER_3_DESC_2",
              "isStepRequired": false
            },
            {
              "text": "BOUNDARY_README_HEADER_3_DESC_3",
              "isStepRequired": false
            }
          ]
        }
      ]
    }
  ]
  1. Data for schema HCM-ADMIN-CONSOLE.Boundary

[
      {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "BoundaryTemplateSchema",
        "type": "object",
        "properties": {
          "HCM_ADMIN_CONSOLE_BOUNDARY_CODE": {
            "type": "string",
            "minLength": 1
          },
          "HCM_ADMIN_CONSOLE_TARGET_AT_THE_SELECTED_BOUNDARY_LEVEL": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100000000
          }
        },
        "required": ["HCM_ADMIN_CONSOLE_BOUNDARY_CODE"]
      }
    ]
  1. Data for schema HCM-ADMIN-CONSOLE.hierarchyConfig

 [
      {
        "hierarchy": "ADMIN",
        "lowestHierarchy": "Posto Administrativo"
      }
    ]
  1. Data for schema HCM-ADMIN-CONSOLE.userSchema

[
        {
            "$schema": "http://json-schema.org/draft-07/schema#",
            "title": "UserTemplateSchema",
            "type": "object",
            "properties": {
                "HCM_ADMIN_CONSOLE_USER_NAME": {
                    "type": "string",
                    "maxLength": 128,
                    "minLength": 2
                },
                "HCM_ADMIN_CONSOLE_USER_PHONE_NUMBER": {
                    "type": "integer"
                },
                "HCM_ADMIN_CONSOLE_USER_ROLE": {
                    "type": "string",
                    "enum": ["Registrar", "Distributor", "Supervisor", "Help Desk", "Monitor Local", "Logistical officer"]
                },
                "HCM_ADMIN_CONSOLE_USER_EMPLOYMENT_TYPE": {
                    "enum": [
                        "Temporary",
                        "Permanent"
                    ]
                },
                "HCM_ADMIN_CONSOLE_BOUNDARY_CODE_MANDATORY": {
                    "type": "string"
                }
            },
            "required": [
                "HCM_ADMIN_CONSOLE_USER_NAME",
                "HCM_ADMIN_CONSOLE_USER_PHONE_NUMBER",
                "HCM_ADMIN_CONSOLE_USER_ROLE",
                "HCM_ADMIN_CONSOLE_USER_EMPLOYMENT_TYPE",
                "HCM_ADMIN_CONSOLE_BOUNDARY_CODE_MANDATORY"
            ],
            "unique": [
                "HCM_ADMIN_CONSOLE_USER_PHONE_NUMBER"
            ]
        }
    ]

Role-Action Mapping

data/pg/ACCESSCONTROL-ACTIONS-TEST/actions-test.json

    [{
      "id": 1951,
      "name": "v1 project type update",
      "url": "/project-factory/v1/project-type/update",
      "displayName": "v1 project type update",
      "orderNumber": 0,
      "enabled": true,
      "serviceCode": "mdms",
      "code": "null",
      "path": ""
    },
    {
      "id": 1952,
      "name": "Upload File by FileStoreId",
      "url": "/filestore/v1/files",
      "displayName": "Upload File by FileStoreId",
      "orderNumber": 0,
      "queryParams": "fileStoreId",
      "parentModule": "PGR",
      "enabled": false,
      "serviceCode": "PGR",
      "code": "null",
      "path": "PGR.Get File by FileStoreId"
    },
     {
      "id": 1953,
      "name": "Boundary service create",
      "url": "/boundary-service/boundary/_create",
      "displayName": "Boundary service create",
      "orderNumber": 0,
      "enabled": true,
      "serviceCode": "mdms",
      "code": "null",
      "path": ""
    },
    {
      "id": 1954,
      "name": "Boundary service update",
      "url": "/boundary-service/boundary/_update",
      "displayName": "Boundary service update",
      "orderNumber": 0,
      "enabled": true,
      "serviceCode": "mdms",
      "code": "null",
      "path": ""
    },
    {
      "id": 1955,
      "name": "Boundary service search",
      "url": "/boundary-service/boundary/_search",
      "displayName": "Boundary service search",
      "orderNumber": 0,
      "enabled": true,
      "serviceCode": "mdms",
      "code": "null",
      "path": ""
    },
    {
      "id": 1956,
      "name": "Boundary relationship create",
      "url": "/boundary-service/boundary-relationships/_create",
      "displayName": "Boundary relationship create",
      "orderNumber": 0,
      "enabled": true,
      "serviceCode": "mdms",
      "code": "null",
      "path": ""
    },
    {
      "id": 1957,
      "name": "Boundary relationship update",
      "url": "/boundary-service/boundary-relationships/_update",
      "displayName": "Boundary relationship update",
      "orderNumber": 0,
      "enabled": true,
      "serviceCode": "mdms",
      "code": "null",
      "path": ""
    },
    {
      "id": 1958,
      "name": "Boundary relationship search",
      "url": "/boundary-service/boundary-relationships/_search",
      "displayName": "Boundary relationship search",
      "orderNumber": 0,
      "enabled": true,
      "serviceCode": "mdms",
      "code": "null",
      "path": ""
    },
        {
      "id": 1959,
      "name": "v1 project type create",
      "url": "/project-factory/v1/project-type/create",
      "displayName": "v1 project type create",
      "orderNumber": 0,
      "enabled": true,
      "serviceCode": "mdms",
      "code": "null",
      "path": ""
    },
    {
      "id": 1960,
      "name": "project factory data search",
      "url": "/project-factory/v1/data/_search",
      "displayName": "project factory data search",
      "orderNumber": 0,
      "enabled": true,
      "serviceCode": "mdms",
      "code": "null",
      "path": ""
    },
     {
      "id": 1961,
      "name": "boundary bulk upload",
      "url": "/project-factory/v1/data/_autoGenerateBoundaryCode",
      "displayName": "boundary bulk upload",
      "orderNumber": 0,
      "enabled": true,
      "serviceCode": "mdms",
      "code": "null",
      "path": ""
    },
     {
      "id": 1962,
      "name": "boundary hierarchy definition create",
      "url": "/boundary-service/boundary-hierarchy-definition/_create",
      "displayName": "boundary hierarchy definition create",
      "orderNumber": 0,
      "enabled": true,
      "serviceCode": "mdms",
      "code": "null",
      "path": ""
    },
    {
      "id": 1963,
      "name": "boundary hierarchy definition search",
      "url": "/boundary-service/boundary-hierarchy-definition/_search",
      "displayName": "boundary hierarchy definition search",
      "orderNumber": 0,
      "enabled": true,
      "serviceCode": "mdms",
      "code": "null",
      "path": ""
    }]

data/pg/ACCESSCONTROL-ROLES/roles.json:

 {
        "code": "CAMPAIGN_MANAGER",
        "name": "Campaign Manager",
        "description": "Campaign Manager"
    }
#3053
#3054
Logo

Installation

Click here to learn more.

Performance Testing

performance report