Feature/manual transaction reconciliation

Merged
DA
24d ago
+1182-81

Summary

Adds a per-transaction reconciliation status (unreconciled / cleared / reconciled) for manually-entered accounts, so you can check transactions off against bank statement — similar to Bluecoins.

Why

Manual accounts (no bank connection) currently have no way to mark a transaction as verified against a statement. Synced accounts already have this covered by other features in the app — duplicate-matching on sync, and statement-level reconciliation (Statement Vault, balance adjustments) — so this PR only targets manual accounts to avoid overlapping with those.

Changes

Data model

  • New entries.reconciled_status column (unreconciled/cleared/reconciled, default unreconciled)
  • Entry#advance_reconciled_status! cycles through the three states
  • Entry.needs_reconciliation / Entry.cleared_or_reconciled scopes

Backend

  • PATCH /transactions/:id/reconcile — toggles status on one transaction, manual accounts only
  • Bulk update supports reconciled_status (non-manual accounts in a mixed selection are just skipped, not errored)
  • Search filter by reconciliation status

UI

  • Clickable status badge on the transaction row and detail view
  • Reconciliation field in the bulk-edit drawer
  • New filter tab + applied-filter chip
  • "Reconcile" quick action in the multi-select toolbar, works across accounts in one selection

Tests

  • Model, controller, and search filter tests covering the cycle behavior, manual-vs-synced guard, and cross-family access

Notes for reviewers

  • DS::Menu with variant: "icon" ignores custom trigger content — had to use variant: "button" instead to get the check-circle icon to actually show up.
  • Added .includes(:account) to Entry.bulk_update! to avoid an N+1 from the new manual-account check.
  • Migration already run and schema regenerated against DB.

Summary by CodeRabbit

  • New Features

    • Added manual transaction reconciliation with unreconciled, cleared, and reconciled statuses.
    • Reconciliation status can be advanced directly from transaction rows.
    • Added bulk reconciliation controls, filters, badges, tooltips, and localized labels.
    • Synced-account transactions are protected from manual reconciliation updates.
  • Bug Fixes

    • Bulk updates now reject unsupported or unauthorized reconciliation changes and provide clear feedback.
  • Tests

    • Added coverage for status cycling, filtering, permissions, account types, and bulk updates.

https://github.com/user-attachments/assets/2121a628-b978-439b-b4e7-82c471f0350b