Enterprise Identity Split Operations
- Split: Separates enterprise identity (EIMP events)
- Split-and-Merge: Handles complex identity changes
- Benefits: Maintains data integrity, prevents orphaned associations, ensures proper identity mapping
WIP, not to be referred
What is Split?
A “split” separates a customer’s enterprise identity into distinct records, typically triggered by changes in enterprise identity data (EIMP events). This ensures each identity is accurately represented and prevents data conflicts.
- Triggered by EIMP SPLIT events
- Removes payment methods and merchant associations
- Updates or clears identity fields (e.g., HSID)
- Ensures no orphaned or duplicate records
Use case
If a patient’s enterprise record is split due to a data correction, their wallet and payment methods are safely separated and updated, ensuring each new identity has the correct information and no overlap.
How Split Works
The wallet-customer-service provides essential functionality for managing customer identities across the Common Checkout Gateway (CCG) platform. The Split operation maintains identity integrity when enterprise identities need to be separated. This operation is crucial for:
- Identity Resolution: Ensuring accurate customer identification across systems
- Data Consistency: Maintaining data integrity during identity changes
- Payment Method Management: Preserving and properly routing payment instruments
Architecture Diagram
Split Process
A customer split occurs when an enterprise identity needs to be separated, typically triggered by EIMP (Enterprise Identity Management Platform) events.
Process Flow
-
Event Initialization:
- System receives an EIMP SPLIT event containing a masterIndividualIdentifier
- EimpEventProcessor identifies the enterprise customer by enterpriseId
- Creates EimpMasterIndividualDetails record with PROCESSING status
-
Payment Method Cleanup:
- DeleteAllCustomerPaymentMethodsCommandHandler deletes all customer payment methods
- System monitors deletion status with configurable retry attempts (default: 3)
- Payment methods transition through states: ACTIVE → DELETING → DELETED
-
Merchant Customer Cleanup:
- MerchantCustomerHandler removes all merchant-customer relationships
- Prevents orphaned associations after split
-
HSID Management:
- System queries identity service to check HSID status
- If HSID is being split (empty HSID identifiers), clears from customer record
- Otherwise maintains or updates HSID based on identity information
-
Customer Update:
- Updates customer demographics using identity service
- Updates enterprise customer record with current information
- Sets EIMP event status to COMPLETED
- Logs successful completion
Error Handling & Recovery
- Failed operations update EimpMasterIndividualDetails with status ERROR
- System logs specific failure points for troubleshooting
- Retry mechanisms for transient failures (particularly payment method deletion)
Split-and-Merge Process
The combined SPLIT_AND_MERGE operation handles complex enterprise identity changes requiring both operations.
Process Flow
-
Split Phase:
- Follows standard split process to remove payment methods and associations
- Clears merchant identifiers to prepare for identity change
-
Merge Phase:
- Updates customer with new identity information
- Reconnects enterprise identifiers as needed
-
Status Tracking:
- Updates EimpMasterIndividualDetails throughout process
- Logs at key transition points
Key Components
-
EimpEventProcessor:
- Central component handling all EIMP events
- Routes events to appropriate handlers based on type (SPLIT, MERGE, SPLIT_AND_MERGE)
- Manages event status tracking and updates
-
DeleteAllCustomerPaymentMethodsCommandHandler:
- Manages bulk deletion of payment methods
- Coordinates with vendor services for payment method removal
Testing and Verification
Test Scenarios
-
Split Test Cases:
- Split with immediate payment method deletion
- Split with retry on payment method deletion
- Split with HSID separation
- Split with error conditions
-
Split-and-Merge Test Cases:
- Complete flow with HSID changes
- Error handling at various stages
Verification Checklist
- Payment methods properly deleted during split
- Merchant identifiers cleared during split
- Customer records correctly updated
- Events published at appropriate points
Best Practices
- Monitor logs for split errors and unusual events
- Test with various identity scenarios (including edge cases)
- Ensure retry logic is configured for payment method deletion
- Regularly review and update identity matching criteria