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

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

On this page
  • 1. Upload Target Data
  • 2. Upload Facility Data
  • 3. Upload User Data
  • 4. Summary
  • Schema Validation
  • Validation API Call:
  • Reference Links:
  • API Details
  • New Features:

Was this helpful?

Export as PDF
  1. TECHNOLOGY
  2. Architecture
  3. Services
  4. HCM Console Web
  5. Manage Campaign
  6. Setup Campaign (New Campaign)

Resource Upload Details

PreviousDelivery DetailsNextSummary Screen

Was this helpful?

The resource upload details consists of 3 types of uploads:

  • Upload Target Data

  • Facility Upload

  • User Upload

  • Upload Summary

1. Upload Target Data

This screen will come after a user selects the boundaries.

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.

In this screen, when a user clicks on the download template, an Excel gets downloaded containing 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.

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

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.

4. Summary

This screen displays all the files which were uploaded in the previous screens, Validation in this screen -

All the 3 files are mandatory to upload in this step otherwise the user is not allowed to move to the next step.

Schema Validation

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 (v0.3.1):

  1. Sheet Names: Ensuring the sheet names in all three uploads match the expected values.

  2. Template Locale: The uploaded template should be in the same locale in which it was generated.

  3. Campaign ID: The campaign ID in the upload must match the campaign ID for which the template was generated. This validation is conditional and can be toggled at the DevOps level.

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

For more information on this schema, you can refer to:

Reference Links:

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

API Details

End Point
Role
Details

/project-factory/v1/data/_download

CAMPAIGN_MANAGER

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

type:boundary

hierarchyType:ADMIN

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

type:facilityWithBoundary

hierarchyType:ADMIN

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

type:userWithBoundary

hierarchyType:ADMIN

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

/project-factory/v1/data/_create

CAMPAIGN_MANAGER

1) type: boundaryWithTarget { "type": "boundaryWithTarget", ""action": "validate",

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

2) type: facility { "type": "facility",

"action": "validate",

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

3) type: user { "type": "user",

"action": "validate",

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

New Features:

A new pop-up has been added which displays the option to download the template in all 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.

All the 3 downloads are happening through the Generate and Download APIs. For the Generate API, the following hook is used:

After uploading the templates, UI validation is done through schema stored in the MDMS: Schema Data link:

For the backend validation, we use the following hook:

Bulk upload:

Preview component:

File screen:

https://github.com/egovernments/DIGIT-Frontend/blob/campaign/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/hooks/useGenerateIdCampaign.js
https://github.com/egovernments/egov-mdms-data/blob/UNIFIED-DEV/data/mz/health/hcm-admin-console/adminSchema.json
Configuration
https://github.com/egovernments/egov-mdms-data/blob/UNIFIED-DEV/data/mz/health/hcm-admin-console/baseTimeOut.json
https://github.com/egovernments/DIGIT-Frontend/blob/campaign/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/hooks/useResourceData.js
https://github.com/egovernments/DIGIT-Frontend/blob/campaign/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/BulkUpload.js
https://github.com/egovernments/DIGIT-Frontend/blob/campaign/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/XlsPreview.js
https://github.com/egovernments/DIGIT-Frontend/blob/campaign/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/UploadData.js