HCM-BFF Service

Overview

The HCM-BFF service is a comprehensive backend service that facilitates various functionalities related to bulk data processing, transformation, parsing, and microplan handling. It acts as a bridge between the frontend and backend systems, providing a unified service for handling complex operations in processing microplans.

Service Details

Service Name

HCM-BFF Service

APIs

  • getTransformedData API

    • Endpoint: POST /bulk/_transform

    • Description: Transforms bulk data based on specified configurations using MDMS for transformation templates and the filestore service for file URLs.

  • process API

    • Endpoint: POST /bulk/_process

    • Description: Processes transformed data by grouping and consolidating based on specified configurations. Leverages MDMS for parsing templates and consolidation rules.

  • processMicroplan API

    • Endpoint: POST /hcm/_processmicroplan

    • Description: A comprehensive API for processing microplans, involving data transformation and parsing. Utilizes transformation and parsing templates from MDMS, integrating _transform and _process APIs.

Swagger API Contract

Please refer to the below Swagger API contract for hcm-bff service to understand the structure of APIs and to have visualization of all internal APIs Swagger API contract

Functionality Overview

  • Data Transformation: Transforms bulk data using predefined templates and configurations.

  • Data Parsing and Processing: Parses and processes transformed data based on specified templates, grouping, and consolidation rules.

  • Microplan Handling: Comprehensive microplan processing involving transformation, parsing, and file ingestion.

Dependencies

  • MDMS Service: Fetches transformation and parsing templates.

  • Filestore Service: Obtains file URLs and stores processed files.

  • External Libraries: Dependencies such as XLSX for Excel file manipulation.

  • HCM-MOZ-IMPL Service: Ingestion of data with proper ingestion type.

Use Case

The HCM-BFF service is indispensable for managing large-scale data operations in transforming, parsing, and processing bulk data, facilitating seamless microplan execution.

getTransformedData API

Description

The getTransformedData API transforms bulk data based on specified configurations. It utilizes MDMS to fetch transformation templates and the filestore service for file URLs.

Endpoint

POST /bulk/_transform

Request

  • HCMConfig: Object - Configuration object for bulk transformation.

  • fileStoreId: String - The ID of the file store containing the data.

  • transformTemplate: String - Transformation template identifier.

  • selectedRows: Array - Array specifying selected rows for transformation.

  • RequestInfo: Object - Request information object.

Response

  • Success (200): Object - Transformed data.

    • updatedDatas: Array - Array of transformed data.

  • Error (4xx, 5xx): Object - Error response in case of failure.

    • message: String - Error message.

Implementation Details

  • Extracts relevant information from the request body.

  • Calls MDMS to retrieve the transformation template.

  • Fetches the file URL from the file store based on the file store ID.

  • Retrieves data from the specified sheet using the obtained URL, selected rows, and transformation configuration.

  • Sends the transformed data as a response.

 

process API

Description

The process API is responsible for further processing the transformed data by grouping and consolidating based on specified configurations.

Endpoint

POST /bulk/_process

Request

  • HCMConfig: Object - Configuration object for bulk data processing.

  • data: Array - Array of transformed data to be processed.

  • parsingTemplate: String - Parsing template identifier.

  • RequestInfo: Object - Request information object.

Response

  • Success (200): Object - Processed data.

    • updatedDatas: Array - Array of processed data.

  • Error (4xx, 5xx): Object - Error response in case of failure.

    • message: String - Error message.

Implementation Details

  • Extracts relevant information from the request body.

  • Calls MDMS to retrieve the parsing template.

  • Converts transformed data to a structured format based on the parsing template.

  • Groups and consolidates data based on unique keys and consolidation rules.

  • Sends the processed data as a response.

processMicroplan API

Description

The processMicroplan API handles the processing of a microplan, involving data transformation and parsing. It leverages transformation and parsing templates obtained from MDMS, utilizing _transform and _process APIs.

Endpoint

POST /hcm/_processmicroplan

Request

  • HCMConfig: Object - Configuration object for processing a microplan.

  • campaignType: String - Type of campaign for which the microplan is processed.

  • RequestInfo: Object - Request information object.

Response

  • Success (200): Object - Result of the microplan processing.

    • Job: Object - Job details, including ingestion details.

      • ingestionDetails: Array - Array containing details of each ingestion.

        • id: String - File store ID.

        • tenanId: String - Tenant ID.

        • state: String - State of the ingestion (e.g., "started").

        • type: String - Type of file (e.g., "xlsx").

        • ingestionType: String - Type of ingestion.

    • tenantId: String - Tenant ID.

  • Error (4xx, 5xx): Object - Error response in case of failure.

    • message: String - Error message.

Implementation Details

  • Extracts relevant information from the request body.

  • Calls MDMS to retrieve campaign details.

  • Sets transformation template and parsing templates from the campaign details.

  • Calls _transform API to transform the data based on the obtained transformation template.

  • Iterates through parsing templates and calls _process API to further process the data.

  • Simplifies processed data by extracting non-array and non-object key-value pairs.

  • Converts simplified data to an Excel sheet using the XLSX library.

  • Uploads the file to the file store and retrieves file details.

  • Updates job and ingestion details with file details and triggers ingestion using the produceIngestion function.

  • Sends job details as a response.

 

 

 

 

 

 

 

 

 

 

 

 

Sample Postman Curl Collections

Please refer to this link for Curl Collections.

MDMS Template Datas

Transform Template

The Transform Template is a configuration MDMS data used by the HCM-BFF service to transform bulk data from a specified sheet. It contains an array of field configurations, each specifying the rules for transforming a particular column in the sheet. The configurations include details such as the column name, transformation format, and default values. Additionally, the template specifies the sheet name where the data is located and is identified by a unique TemplateName.

Sample Master Data : link

Parsing Template

The Parsing Template is another configuration MDMS data that outlines the rules for parsing and processing transformed data. It includes an array of paths, each defining a specific attribute in the transformed data. For each path, the template provides information such as whether it should be treated as unique, the JSON path to locate the attribute, and whether consolidation rules should be applied. The TemplateName uniquely identifies the parsing template.

Sample Master Data : link

HCMTemplate

The HCMTemplate is another configuration MDMS data that includes information about the type of campaign (campaignType), associated parsing templates (parsingTemplates), and the transform template (transformTemplate). This template serves as a holistic configuration for handling a specific type of campaign.

Sample Master Data : link

Relationship Between Templates

The HCMTemplate acts as a coordinator, utilizing both the Transform Template and Parsing Template:

  • It references the Transform Template to guide the initial transformation of raw data from a sheet, applying specified rules to create structured data.

  • The Parsing Template is then used to define how this transformed data should be parsed, specifying attributes, their uniqueness, and consolidation rules.

In summary, the HCMTemplate brings together these two templates to seamlessly execute the entire process, from transforming raw data to parsing and structuring it for further processing.

Helm Chart and Environment

Please refer to this link for Helm Chart and Environment details of hcm-bff service.