CMD- Segment Workflow High-Level Design
The CMD Portal - Segment tab will be used to assign or update segments for the customer.
- Segment Portal in CMD:
The updated side navigation bar, shown in the screenshot below, now includes segmentation.
When a user clicks the "Add segment" button on the retrieval page, they can select a segment type and value from the list below.
After choosing a segment type and value, users can click the "ADD" button in the model to add multiple segments simultaneously, reducing the number of API calls required.
The screenshot below shows a new segment type. "Attractiveness" and "Key Client" segments use a card view, limiting users to a maximum of five segments (or fewer, as needed). An edit and delete function allows for segment removal.
- Segment Tab:
The segmentation details tab now displays a list of segments in a table view after the number of segments is added. This table offers enhanced editing and deletion capabilities; multiple segments can be edited or deleted simultaneously using checkboxes within each row.
Other warnings and alerts will be shown as per current standards.
- Segment Workflow High-Level Design: The below diagram shows the high-level segment workflow functional and technical design between the CMD-Segment portal, Ingest API, Workflow Service, and Database
High-Level Flow Between Portal and Ingest Customer:
- User logs into the portal and performs edits on segments for the customer.
- The data is sent to ingest customer for processing.
- First, the system will validate the data, before generate a workflow for segment.
- Once the data is validated, the system checks if the customer is in the workflow.
- If the requested customer is a parent customer, the system will check if any of the associated child customers are in the workflow.
- If yes, the system will display the validation message: "Associated customer is active in workflow and Update segments are not allowed."
- If no, a workflow will be generated and assigned to the data steward for further action.
High-level Flow between Portal ,Workflow and Ingest Customer:
- The Data steward logs into the segment portal and ensures they have the necessary roles and access to workflows.
- The Data steward retrieves the tasks assigned to them for review.
- Once the task is retrieved, the steward verifies the task.
- After verification, the steward will decide to approve or reject the task.
- If approved, the system will promote the segmentation changes and perform segment automation for the customer.
- Once segment automation is complete, the customer will be published to downstream systems.
- If rejected, the system will revert the customer’s segment to its previous state and remove the customer from the segment workflow.
- Data Base Changes: To implement the segmentation workflow, we need a table to maintain the workflow status of each segment.
customer_segment_workflow
| Attribute Name | Data Type | Sample Values |
|---|---|---|
| ROW_ID | BigSerial | 12 |
| PROCESS_ID | VARCHAR(255) | c85c603d-d8b2-11ef-b288-06cdcc0cd50d |
| CUSTOMER_CMD_CODE | VARCHAR(100) | IN8983222 |
| SEGMENT_DATA | TEXT | { "customerCode": "US00566348", "customerAuditData": { "user": "n.n.reddy@maersk.com", "sourceSystem": "PRTL" }, "customerSegments": [ { "brandCode": "MAEU", "segmentClassification": { "segmentTypeCode": "VERT", "segmentValueCode": "OTHR", "segmentValueName": "OTHER" }, "isUnassignSegment": true, "bulkUploadAction": null } ]} |
| CREATE_USER | VARCHAR(255) | n.n.reddy@maersk.com |
| CREATE_TIME | TIMESTAMPTZ | 2025-01-12 18:27:47.169 +0530 |
| UPDATE_USER | VARCHAR(255) | n.n.reddy@maersk.com |
| UPDATE_TIME | TIMESTAMPTZ | 2025-01-13 11:27:47.169 +0530 |
| STATUS | VARCHAR(100) | APPROVEDREJECTED |
| ERROR_CODE | VARCHAR(255) | 500,400 |
| IS_PENDING | BPCHAR(1) | YN |
| SOURCE_SYSTEM | VARCHAR(50) | PRTL |
| COMMENTS | TEXT |