Repository navigation
feat: CommBank PDF statement ingestion and upload endpoint - #52
Merged
Merged
Conversation
CommBank only exports PDF statements (date, details, signed amount, running balance; no currency, transaction ID or time of day). commbank.py parses the transaction table with pdfplumber, never storing the statement header (name, address, BSB, account number), and inserts rows labelled 'commbank' in AUD with an FX-converted GBP amount and a place resolved from the nearest location fix within +/-12 h (get_nearest_lat_lon_within_hours, using indexed range lookups). Adds the pdfplumber dependency. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Accepts a CommBank Transaction Summary PDF plus the YYYY-MM period it covers. The PDF is parsed up front (an unreadable statement is rejected with a 400), a backup copy is saved, and ingestion is queued in the background with the period recorded in upload_log. COMMBANK_BACKUP_DIR is created with the other backup dirs and shown in the local-backups metadata. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… account opening spend_complete now needs a covering upload_log entry from CommBank as well as Revolut and Wise, but only for dates on or after the account existed (UPLOAD_SOURCE_START_DATES), so earlier dates can still complete. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Deploying travelnet with
|
| Latest commit: |
0fd0518
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://53900040.travelnet.pages.dev |
| Branch Preview URL: | https://feat-commbank-finance-ingest.travelnet.pages.dev |
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
Adds CommBank as a transaction source. CommBank only exports PDF statements, so this parses a "Transaction Summary" PDF and feeds it through the same ingestion path as Revolut and Wise.
Changes
feat(transactions):ingest/commbank.pyparses the transaction table withpdfplumber(date, details, signed amount, running balance; no currency, ID or time of day), never storing the statement header (name, address, account details). Rows are labelledcommbank, AUD, with an FX-converted GBP amount and a place resolved from the nearest location fix within ±12 h (get_nearest_lat_lon_within_hours, using indexed range lookups). Adds thepdfplumberdependency.feat(upload):POST /upload/commbanktakes the PDF and theYYYY-MMperiod it covers. The PDF is parsed up front (an unreadable statement is a 400), a backup copy is saved to a newCOMMBANK_BACKUP_DIR, and ingestion is queued in the background with the period recorded inupload_log.feat(daily-summary):spend_completenow also needs a covering CommBank upload, but only for dates on or after the account was opened (UPLOAD_SOURCE_START_DATES), so earlier dates can still complete.Testing
New parser and insert tests (fixtures are synthetic: placeholder name and account numbers),
get_nearest_lat_lon_within_hourstests, and updated completeness tests. CI runs the suite on this branch.🤖 Generated with Claude Code