feat: bulk import validation & preview improvements (#115)#654
Open
sungdark wants to merge 1 commit intorohitdash08:mainfrom
Open
feat: bulk import validation & preview improvements (#115)#654sungdark wants to merge 1 commit intorohitdash08:mainfrom
sungdark wants to merge 1 commit intorohitdash08:mainfrom
Conversation
…08#115) Implement per-row validation with warnings and auto-corrections for the bulk import preview endpoint (issue rohitdash08#115). Changes: - Add validate_import_rows() to expense_import.py with detailed per-row validation for dates, amounts, descriptions, currency, and expense_type - New RowValidationResult and BulkImportValidationResult dataclasses for structured validation output - /expenses/import/preview now returns: valid_rows, warning_rows, error_rows, ready_to_import, row_validations with per-row warnings, corrections, and error flags - Auto-corrections applied: missing description→Unknown, missing currency→USD, unknown expense_type→EXPENSE, negative amounts→abs() - strict query param: zero amounts and future dates become errors - Duplicate detection integrated into row_validations - 15 new unit tests covering all validation scenarios
Author
|
/claim #115 Implementation SummaryWhat was builtBackend — `expense_import.py` (+248 lines)
Backend — `expenses.py` (preview endpoint enhanced)
Tests (+408 lines)
/close #115 |
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.
Summary
Implements per-row validation with warnings and auto-corrections for the bulk import preview endpoint, closing issue #115.
What was built
Backend — expense_import.py (+248 lines)
Backend — expenses.py (preview endpoint enhanced)
Tests — test_expenses.py (+408 lines)
PR Claim
/claim #115