Repository navigation
Reject conflicting master data and preserve prior cleaning evidence - #5
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem and behavior
The cleaner previously kept the first supplier/employee record for each ID. Two rows with different bank accounts or roles therefore silently selected different master data when the extract order changed, affecting shared-account features and employee context in audit queries.
Repeated IDs now merge only when every source field agrees after existing text normalisation. Missing cells compare equal to missing cells, while populated versus missing attributes conflict. Validation runs before lossy date parsing and reports the source file, row positions, ID and field names without exposing bank-account values. Cleaned supplier IDs are used for orphan-reference checks.
All three cleaned tables and the quality report are serialised to temporary files before publication. Previously complete outputs are restored after handled publication failures; an initial run removes partially published files. If rollback itself fails, the error identifies recovery paths and retains previous bytes. This remains a single-writer CLI: multi-file reader snapshots and process-crash recovery are outside this change.
Validation
makeis unavailable. All 93 cleaning tests pass.docs/MASTER_DATA_CASE.zh-CN.md, with business decisions, reproducible tests, follow-up answers and explicit scope boundaries.