Skip to content

feat: CommBank PDF statement ingestion and upload endpoint - #52

Merged
danielroberts20 merged 3 commits into
mainfrom
feat/commbank-finance-ingestion
Oct 7, 2026
Merged

danielroberts20 merged 3 commits into
mainfrom
feat/commbank-finance-ingestion

Conversation

@danielroberts20

Copy link
Copy Markdown
Owner

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.py parses the transaction table with pdfplumber (date, details, signed amount, running balance; no currency, ID or time of day), never storing the statement header (name, address, account details). Rows are labelled commbank, 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.
  • feat(upload): POST /upload/commbank takes the PDF and the YYYY-MM period it covers. The PDF is parsed up front (an unreadable statement is a 400), a backup copy is saved to a new COMMBANK_BACKUP_DIR, and ingestion is queued in the background with the period recorded in upload_log.
  • feat(daily-summary): spend_complete now 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_hours tests, and updated completeness tests. CI runs the suite on this branch.

🤖 Generated with Claude Code

danielroberts20 and others added 3 commits October 7, 2026 08:51
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]>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying travelnet-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0fd0518
Status:🚫  Build failed.

View logs

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying travelnet with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0fd0518
Status: ✅  Deploy successful!
Preview URL: https://53900040.travelnet.pages.dev
Branch Preview URL: https://feat-commbank-finance-ingest.travelnet.pages.dev

View logs

@danielroberts20
danielroberts20 merged commit 06c8818 into main Oct 7, 2026
3 of 4 checks passed
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