Recurring scoping implementation (#1300)

* Recurring scoping implementation

* FIX tests and reviews
This commit is contained in:
soky srm
2026-03-26 19:01:35 +01:00
committed by GitHub
parent 9410e5b38d
commit f1991eaefe
11 changed files with 232 additions and 51 deletions

View File

@@ -54,6 +54,7 @@ class TransactionsController < ApplicationController
# Load projected recurring transactions for next 10 days
@projected_recurring = Current.family.recurring_transactions
.accessible_by(Current.user)
.active
.where("next_expected_date <= ? AND next_expected_date >= ?",
10.days.from_now.to_date,
@@ -304,6 +305,7 @@ class TransactionsController < ApplicationController
# Check if a recurring transaction already exists for this pattern
existing = Current.family.recurring_transactions.find_by(
account_id: transaction.entry.account_id,
merchant_id: transaction.merchant_id,
name: transaction.merchant_id.present? ? nil : transaction.entry.name,
currency: transaction.entry.currency,