Skip to content

feat: Add bulk import validation warnings and summary statistics (closes #115)#458

Open
noxxxxybot-sketch wants to merge 2 commits intorohitdash08:mainfrom
noxxxxybot-sketch:feat/bulk-import-validation
Open

feat: Add bulk import validation warnings and summary statistics (closes #115)#458
noxxxxybot-sketch wants to merge 2 commits intorohitdash08:mainfrom
noxxxxybot-sketch:feat/bulk-import-validation

Conversation

@noxxxxybot-sketch
Copy link

Summary

Adds validation warnings and summary statistics to the bulk import preview endpoint, addressing issue #115.

Changes

  • ****: Added function that checks each row for:
    • Unusually large amounts (>100k)
    • Future dates and suspiciously old dates (< 2000)
    • Short/empty or overly long descriptions (>500 chars)
  • ****: Updated to return (per-row issues with field + message) and (total/income/expense amounts, date range, counts)
  • ****: Added 4 new tests (3 unit + 1 integration) covering validation logic

API Response (Before → After)

Before:
After:

Tests

  • 3 unit tests pass ✅
  • Integration tests require Redis (expected in CI)

Nox added 2 commits March 15, 2026 12:08
…08#91)

- Rule-based auto-categorization with 60+ keyword mappings across 10 categories
- Confidence scoring (0.0-1.0) with alternatives ranking
- Learning from user corrections via POST /categorize/learn
- Batch categorization endpoint for multiple transactions
- User-specific learned rules stored in categorization_rules table
- 26 comprehensive tests (all passing, 48 total)

API Endpoints:
- POST /categorize — Categorize single transaction
- POST /categorize/batch — Batch categorize up to 100 transactions
- POST /categorize/learn — Learn from user corrections
- GET /categorize/rules — List learned rules
- DELETE /categorize/rules/:id — Delete a learned rule
 rohitdash08#115)

- Add validate_import_rows() function with per-row validation warnings for:
  - Unusually large amounts (>100k)
  - Future dates and suspiciously old dates
  - Short/empty or overly long descriptions
- Add summary statistics: total amounts, income vs expense breakdown, date range
- Update /expenses/import/preview to include warnings and summary in response
- Add comprehensive unit and integration tests
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.

1 participant