BBU - Update Facility
- Overview
- Features:
- Service wise functionalities
- Error Logging and Persistence
- Excel Template Structure
- Architecture and Flow
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.
- For facilities requiring multiple customer assignments:
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 Name | Description | Is Mandatory | Regex |
|---|---|---|---|
| Sequence Number | Sequential number to track rows. | Y | |
| Customer Facility Code | Unique code for the facility. | Y | ^[A-Z0-9*-]{3,11}$ |
| Customer Facility Name | Name of the facility. | Y | ^[a-zA-Z0-9-,*'/()&+ ]{3,128}$ |
| ISO Country Code | Country code in ISO format (e.g., US, IN, DE). | Y | ^[A-Z]{2}$ |
| City | Name of the city where the facility is located. | N | ^[a-zA-Z0-9.,:;$%&+\]\[*"( )'\/^\-]{2,100}$ |
| Postal Code | Postal code of the facility. | N | maxLength: 20 |
| Region | State or region where the facility exists. | N | ^[a-zA-Z.,:;$%&+\]\[*"( )'\/^\-]{1,100}$ |
| Street Name | Name of the street for the facility location. | N | ^[a-zA-Z0-9.,:;$%&+\]\[*"( )'\/^\-]{0,36}$ |
| Street Number | Number of the building or address. | N | ^[a-zA-Z0-9.,:;$%&+\]\[*"( )'\/^\-]{0,10}$ |
| Sub Area | Specific sub-area within the city. | N | ^[a-zA-Z0-9.,:;$%&+\]\[*"( )'\/^\-]{0,36}$ |
| Apartment or Floor | Apartment or floor details, if applicable. | N | ^[a-zA-Z0-9.,:;$%&+\]\[*"( )'\/^\-]{0,36}$ |
| PO Box Number | PO Box details for mailing. | N | ^[a-zA-Z0-9.,:;$%&+\]\[*"( )'\/^\-]{0,10}$ |
| District | District information where the facility resides. | N | ^[a-zA-Z0-9.,:;$%&+\]\[*"( )'\/^\-]{0,36}$ |
| Customer Facility Status | Status of the facility (e.g., Active, Inactive). | Y | Enum: [A, I] |
| Customer Code | Unique Code of the Customer to link/de-link | N | ^[A-Z0-9*-]{3,11}$ |
| Action | Operation to perform (Link/Delink). | N | Enum: [LINK, DELINK] |
Architecture and Flow
Sequence Diagram
The sequence diagram shows the complete flow from upload to completion.
Steps
- Validate Template: The user uploads the Excel file. The system checks for valid structure and mandatory fields.
- Process Request:
- BBU Upload Service validates and processes the create/update request row-by-row.
- Validation Service:
- Each row is validated for completeness, consistency, and business rules.
- Invalid rows return error messages.
- Upsert Service:
- Successfully validated rows are sent to the upsert service to insert or update facilities.
- Auto Sync & Publish:
- Once the upsert completes, the system triggers auto-sync for downstream systems.
- 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?