feat: harden csv schema normalization for migration flows#379
Open
Abolax123 wants to merge 4 commits intoRemitwise-Org:mainfrom
Open
feat: harden csv schema normalization for migration flows#379Abolax123 wants to merge 4 commits intoRemitwise-Org:mainfrom
Abolax123 wants to merge 4 commits intoRemitwise-Org:mainfrom
Conversation
ac0e985 to
ebab02b
Compare
08a7747 to
0b5822c
Compare
Contributor
|
Please resolve the conflicts |
Contributor
|
@Abolax123 Please resolve the conflicts |
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.
Closes #322
Overview
This PR hardens the CSV export and import schema normalization for migration flows involving savings goal data in the data_migration contract. This ensures stricter validation, preventing malformed or ambiguous data from being imported.
Key Changes
Strict Header Validation: Implemented mandatory header checks (names and order) in import_goals_from_csv.
Row-Level Integrity: Added checks for valid data types and non-negative financial amounts.
NatSpec Documentation: Added security assumptions and functional documentation.
Enhanced Error Handling: Descriptive errors for schema mismatches and malformed rows.
README Update: Added documentation for the Data Migration utility.
Test Coverage
7 new test cases added to data_migration/src/lib.rs covering edge cases:
Wrong/ambiguous headers
Missing columns
Malformed row types
Negative amounts
Empty files
Header-only files
All tests passed.