Transfer Matching: Larger match date window for manual matching (#514)

This commit is contained in:
Dylan Corrales
2025-12-30 13:06:40 -05:00
committed by GitHub
parent 7915fee62c
commit 4e87eead2c
3 changed files with 9 additions and 8 deletions

View File

@@ -133,6 +133,7 @@ class Transfer < ApplicationRecord
return unless inflow_transaction&.entry && outflow_transaction&.entry
date_diff = (inflow_transaction.entry.date - outflow_transaction.entry.date).abs
errors.add(:base, "Must be within 4 days") if date_diff > 4
max_days = status == "confirmed" ? 30 : 4
errors.add(:base, "Must be within #{max_days} days") if date_diff > max_days
end
end