Skip to content

feat: add bank reconciliation feature#6

Open
TMaYaD wants to merge 10 commits into
mainfrom
feature/bank-reconciliation
Open

feat: add bank reconciliation feature#6
TMaYaD wants to merge 10 commits into
mainfrom
feature/bank-reconciliation

Conversation

@TMaYaD
Copy link
Copy Markdown
Member

@TMaYaD TMaYaD commented Jan 28, 2026

Summary

Add bank statement reconciliation to match transactions from CSV uploads with existing payments.

New Models

  • BankStatement: Stores uploaded CSV file with status (pending/processed)
  • BankTransaction: Individual rows from CSV with matching status

New Services

  • BankStatementParser: Parses CSV, creates transactions
  • ReconciliationMatcher: Matches by date (±3 days), amount, and reference

New UI

  • Upload bank statement CSV
  • View transaction list with match status
  • Confirm/reject/rematch actions

Testing

  • All 275 specs pass (2 pending for empty model specs)
  • Manual: Upload CSV with date/amount/description/reference columns

- Add BankStatement and BankTransaction models with migrations
- Add BankStatementParser service to parse CSV files
- Add ReconciliationMatcher service to match transactions to payments
- Add BankStatementsController with upload, index, show actions
- Add BankTransactionsController with confirm/reject/rematch actions
- Add views for uploading statements and reviewing matches
- Add routes and i18n translations
@trixy-the-ai-bot trixy-the-ai-bot added the in-progress Bot is actively working on this label Mar 2, 2026
@trixy-the-ai-bot trixy-the-ai-bot self-assigned this Mar 2, 2026
@trixy-the-ai-bot trixy-the-ai-bot removed the in-progress Bot is actively working on this label Mar 2, 2026
@trixy-the-ai-bot
Copy link
Copy Markdown
Collaborator

Merge conflicts resolved.

Resolved merge conflicts across 4 files (Gemfile, Gemfile.lock, config/locales/en.yml, db/schema.rb) when integrating a bank reconciliation feature branch with the main branch. Key decisions included keeping new gems from both sides (chartkick, csv), merging all i18n locale sections, and carefully reconciling 8 schema conflict regions — preserving bank-related tables (bank_statements, bank_transactions, payment_allocations) from HEAD while adopting main's schema version, new tables (entries, user_associations, users, versions, solid_queue tables), and column additions to invoices, leases, owners, payments, and properties. Main's security deposit refactoring (security_deposit_type/value) superseded HEAD's security_deposit_in_months column during the lease table merge.

@trixy-the-ai-bot trixy-the-ai-bot added the in-progress Bot is actively working on this label Mar 23, 2026
@trixy-the-ai-bot trixy-the-ai-bot removed the in-progress Bot is actively working on this label Mar 23, 2026
@trixy-the-ai-bot
Copy link
Copy Markdown
Collaborator

Merge conflicts resolved.

Both gems were preserved when resolving a merge conflict in Gemfile between the feature/bank-reconciliation branch (which added gem "csv", "~> 3.3" for CSV import) and main (which added gem "google-cloud-storage" for Cloud Run). Gemfile.lock required no manual changes as it auto-merged correctly, and the resolution was pushed as a merge commit to feature/bank-reconciliation.

@trixy-the-ai-bot trixy-the-ai-bot added the in-progress Bot is actively working on this label Mar 25, 2026
- Add config/routes.rb to Metrics/BlockLength rubocop exclude list
- Normalize config/locales/en.yml: sort bank_statements/bank_transactions keys alphabetically
- Add BankStatementPolicy and BankTransactionPolicy (admin-only, inherit ApplicationPolicy)
- Add authorize/policy_scope calls to BankStatements and BankTransactions controllers
- Add sign_in_admin before hook to bank request specs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@trixy-the-ai-bot trixy-the-ai-bot removed the in-progress Bot is actively working on this label Mar 25, 2026
@trixy-the-ai-bot
Copy link
Copy Markdown
Collaborator

CI failures addressed.

Three issues were fixed after an initial push:

  1. Rubocop lint: config/routes.rb exceeded the 25-line block length limit — resolved by excluding it in .rubocop.yml.
  2. I18n spec: bank_statements and bank_transactions locale keys were out of alphabetical order and had unnecessary quotes — fixed by repositioning and cleaning them up.
  3. Request spec failures: Bank statement/transaction specs lacked authentication and Pundit authorization — fixed by adding sign_in_admin to specs, adding authorize/policy_scope calls to controllers, and creating BankStatementPolicy and BankTransactionPolicy (admin-only, inheriting ApplicationPolicy).

@trixy-the-ai-bot trixy-the-ai-bot added the in-progress Bot is actively working on this label Mar 30, 2026
@trixy-the-ai-bot trixy-the-ai-bot removed the in-progress Bot is actively working on this label Mar 30, 2026
@trixy-the-ai-bot
Copy link
Copy Markdown
Collaborator

Merge conflicts resolved.

The Gemfile merge conflict in PR #6 was resolved by retaining the csv gem for bank reconciliation, removing duplicate chartkick and groupdate entries already present from main, and dropping google-cloud-storage since the project migrated to Backblaze B2 using aws-sdk-s3. The merge commit was pushed, leaving PR #6 conflict-free.

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.

2 participants