Skip to content

Import pending Monzo transactions with settled-only reporting#6

Merged
sergdort merged 3 commits intomainfrom
codex/pending-monzo-import-settled-reporting
Mar 1, 2026
Merged

Import pending Monzo transactions with settled-only reporting#6
sergdort merged 3 commits intomainfrom
codex/pending-monzo-import-settled-reporting

Conversation

@sergdort
Copy link
Copy Markdown
Owner

Summary

  • import pending Monzo transactions (amount != 0) and keep postedAt null until settlement
  • reconcile pending rows in the active sync window by deleting missing Monzo IDs
  • exclude pending Monzo rows from report totals (trends, category breakdown, monthly ledger)
  • show a Pending chip in Expenses and clarify settled-only totals on Home monthly ledger
  • update Monzo domain/PWA tests and sync docs in AGENTS.md + README.md

Validation

  • pnpm --filter @tithe/tests test -- tests/domain/monzo.spec.ts tests/api/routes.spec.ts tests/pwa/mobile.spec.ts
  • pnpm typecheck

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces support for importing pending Monzo transactions (those with amount != 0 but settled = null) alongside settled ones, while keeping them excluded from report totals until they settle.

Changes:

  • Domain/repository logic: Pending Monzo transactions are now imported with postedAt = null; a settledOrNonMonzo filter (source != 'monzo' OR posted_at IS NOT NULL) is applied to all three report aggregates (monthly trends, category breakdown, monthly ledger); a new listPendingMonzoInRange repository method powers a reconciliation loop that deletes pending rows disappearing from the sync window.
  • UI updates: A Pending chip is shown in the Expenses list for Monzo rows with postedAt = null; a clarification note is added below the Monthly Ledger card header.
  • Test and docs updates: New domain integration tests cover pending-to-settled settlement, disappearing-pending deletion, and report exclusion; PWA E2E tests cover the badge and ledger notice; AGENTS.md and README.md are updated to document the new behavior.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/domain/src/services/monzo.service.ts Removes the isPendingTransaction filter so pending rows are imported; adds fetchedTransactionIds set and a reconciliation loop to delete pending rows missing from the window
packages/domain/src/repositories/expenses.repository.ts Adds listPendingMonzoInRange method and interface for pending-row reconciliation
packages/domain/src/repositories/reports.repository.ts Applies settledOrNonMonzo filter to monthlyTrends, categoryBreakdown, and monthlyLedger queries
apps/pwa/src/pages/ExpensesPage.tsx Renders a warning Chip labeled "Pending" for Monzo rows where postedAt === null
apps/pwa/src/features/home/components/MonthlyLedgerCard.tsx Adds a caption noting that pending Monzo transactions are excluded from totals
tests/domain/monzo.spec.ts Adds test cases for pending import, settlement update, deletion reconciliation, and report exclusion
tests/pwa/mobile.spec.ts Updates E2E test to verify the Pending badge and ledger disclaimer text
README.md Documents the new pending import policy and report exclusion behavior
AGENTS.md Documents the pending import, reconciliation, and report exclusion behaviors
.agents/notes.md Increments version counter on the pnpm test targeting note

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/domain/monzo.spec.ts Outdated
@sergdort sergdort merged commit 4d6dde8 into main Mar 1, 2026
1 check 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.

3 participants