DIGIT Docs
v0.2
  • DIGIT Knowledge Base
  • Local Governance
v0.2
  • Introducing HCM Console
  • Release Notes
    • 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
      • Low Level Design
        • Project Factory (Campaign Manager)
      • Services
        • Project Factory
          • Campaign Manage APIs
          • Data Manage APIs
            • Target Upload
          • Boundary Campaign Setup
            • Boundary Generation
        • HCM Console Web
          • User Interface Design
          • Create New Campaign
            • Campaign Details
            • Delivery Details
            • Boundary Details
            • Resource Upload Details
            • Setup and Implementation of Campaign
            • Summary Screen
          • Change Campaign Dates
          • My Campaign
            • Action Column Integration
          • Boundary Bulk Upload
          • Campaign Timeline
  • SETUP
    • Installation
    • Configuration
    • 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
  • Handling boundary data API performance:
  • API Details

Was this helpful?

Export as PDF
  1. TECHNOLOGY
  2. Architecture
  3. Services
  4. HCM Console Web
  5. Create New Campaign

Boundary Details

PreviousDelivery DetailsNextResource Upload Details

Was this helpful?

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 :

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:

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: 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

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.

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" }

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:

Link:

https://github.com/egovernments/egov-mdms-data/blob/UNIFIED-DEV/data/mz/health/hcm-admin-console/hierarchyConfig.json
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/components/SelectingBoundaries.js
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/DIGIT-Frontend/blob/campaign/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/hooks/useParallelSearch.js