Skip to content

feat: harden csv schema normalization for migration flows#379

Open
Abolax123 wants to merge 4 commits intoRemitwise-Org:mainfrom
Abolax123:feature/migration-csv-schema-normalization
Open

feat: harden csv schema normalization for migration flows#379
Abolax123 wants to merge 4 commits intoRemitwise-Org:mainfrom
Abolax123:feature/migration-csv-schema-normalization

Conversation

@Abolax123
Copy link
Copy Markdown

@Abolax123 Abolax123 commented Mar 24, 2026

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.

@Abolax123 Abolax123 force-pushed the feature/migration-csv-schema-normalization branch from ac0e985 to ebab02b Compare March 24, 2026 14:57
@Abolax123 Abolax123 force-pushed the feature/migration-csv-schema-normalization branch from 08a7747 to 0b5822c Compare March 24, 2026 21:47
@Baskarayelu
Copy link
Copy Markdown
Contributor

Please resolve the conflicts

@Baskarayelu
Copy link
Copy Markdown
Contributor

@Abolax123 Please resolve the conflicts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Harden CSV export and import schema normalization

3 participants