Skip to main content

BBU - Update Facility

Overview

BBU for Updating Facilities in Bulk.

Template name: BLK_UPDATE_FACILITY

Features:

  • Validate Facility Data in Batches
  • Update Facility Data in Batches
  • Link/De-Link Customers to Facilities
  • Log & Persist Errors/Failures for:
    • Invalid Data
    • System Failures
  • Asynchronous API Call to Read from the Database
  • Publish Persisted Data in Batches to Retina

Service wise functionalities

Bulk Upload API

The Bulk Upload API is responsible for processing the uploaded Excel file and managing facility updates efficiently.

Key Features:

  • Template Validation:
    • Validate the template name and header names.
    • Check for duplicate records within the file.
  • Data Mapping:
    • Map the Excel data into batches for processing.
  • Ingest Facility Call:
    • Upon successful validation, call the Ingest Facility API in batches.
  • Audit and Logging:
    • Capture the API responses.
    • Persist results (success/failure) into the BBU Audit History Table for future reference.

Ingest Facility API

The Ingest Facility API handles the facility update process while ensuring all CMD (Customer Master Data) rules are met.

Key Functionalities:

  • Data Validation:
    • Perform all standard validation checks for facility updates.
    • Validate formats, character limits, and constraints as per existing CMD rules.
  • Duplicate Check:
    • Verify if the facility already exists based on the current duplicate check logic.
  • Facility Update:
    • If the facility passes all CMD validations, the facility record will be updated.
  • Customer Linking/De-Linking:
    • If the Customer Code column is populated, ensure the Action column is also filled.
    • Based on the Action column:
      • Perform a Link operation to associate the customer with the facility.
      • Perform a De-Link operation to remove the association.
  • Multiple Customer Assignments:
    • For facilities requiring multiple customer assignments:
      • Enter multiple rows with the same Facility Code.
      • Populate each row with the respective Customer Code and Action values.

Error Logging and Persistence

  • All errors (validation, ingestion failures, or system issues) will be logged and persisted in the BBU Audit History Table.
  • This ensures traceability and allows reprocessing of failed records.

Excel Template Structure

The following columns will be provided in the Excel template:

Column NameDescriptionIs MandatoryRegex
Sequence NumberSequential number to track rows.Y
Customer Facility CodeUnique code for the facility.Y^[A-Z0-9*-]{3,11}$
Customer Facility NameName of the facility.Y^[a-zA-Z0-9-,*'/()&+ ]{3,128}$
ISO Country CodeCountry code in ISO format (e.g., US, IN, DE).Y^[A-Z]{2}$
CityName of the city where the facility is located.N^[a-zA-Z0-9.,:;$%&+\]\[*"( )'\/^\-]{2,100}$
Postal CodePostal code of the facility.NmaxLength: 20
RegionState or region where the facility exists.N^[a-zA-Z.,:;$%&+\]\[*"( )'\/^\-]{1,100}$
Street NameName of the street for the facility location.N^[a-zA-Z0-9.,:;$%&+\]\[*"( )'\/^\-]{0,36}$
Street NumberNumber of the building or address.N^[a-zA-Z0-9.,:;$%&+\]\[*"( )'\/^\-]{0,10}$
Sub AreaSpecific sub-area within the city.N^[a-zA-Z0-9.,:;$%&+\]\[*"( )'\/^\-]{0,36}$
Apartment or FloorApartment or floor details, if applicable.N^[a-zA-Z0-9.,:;$%&+\]\[*"( )'\/^\-]{0,36}$
PO Box NumberPO Box details for mailing.N^[a-zA-Z0-9.,:;$%&+\]\[*"( )'\/^\-]{0,10}$
DistrictDistrict information where the facility resides.N^[a-zA-Z0-9.,:;$%&+\]\[*"( )'\/^\-]{0,36}$
Customer Facility StatusStatus of the facility (e.g., Active, Inactive).YEnum: [A, I]
Customer CodeUnique Code of the Customer to link/de-linkN^[A-Z0-9*-]{3,11}$
ActionOperation to perform (Link/Delink).NEnum: [LINK, DELINK]

Architecture and Flow

Sequence Diagram

The sequence diagram shows the complete flow from upload to completion.

Steps

  1. Validate Template: The user uploads the Excel file. The system checks for valid structure and mandatory fields.
  2. Process Request:
    • BBU Upload Service validates and processes the create/update request row-by-row.
  3. Validation Service:
    • Each row is validated for completeness, consistency, and business rules.
    • Invalid rows return error messages.
  4. Upsert Service:
    • Successfully validated rows are sent to the upsert service to insert or update facilities.
  5. Auto Sync & Publish:
    • Once the upsert completes, the system triggers auto-sync for downstream systems.
  6. Completion Response:
    • Final success or error responses are sent back to the user.

Error Handling

  • Validation Errors: Rows with missing or invalid data are rejected with a clear error message.
  • Upsert Failures: If upsert fails, appropriate exception messages are returned.
  • Sync Failures: Rows failing the auto-sync are flagged for retry or manual intervention.
Was this page helpful?