mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-10 07:55:21 +02:00
Add reconciliation manager (#2459)
* Add reconciliation manager * Fix notes editing
This commit is contained in:
parent
89cc64418e
commit
52333e3fa6
11 changed files with 273 additions and 64 deletions
16
app/models/account/reconcileable.rb
Normal file
16
app/models/account/reconcileable.rb
Normal file
|
@ -0,0 +1,16 @@
|
|||
module Account::Reconcileable
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
def create_reconciliation(balance:, date:, dry_run: false)
|
||||
reconciliation_manager.reconcile_balance(balance: balance, date: date, dry_run: dry_run)
|
||||
end
|
||||
|
||||
def update_reconciliation(existing_valuation_entry, balance:, date:, dry_run: false)
|
||||
reconciliation_manager.reconcile_balance(balance: balance, date: date, existing_valuation_entry: existing_valuation_entry, dry_run: dry_run)
|
||||
end
|
||||
|
||||
private
|
||||
def reconciliation_manager
|
||||
@reconciliation_manager ||= Account::ReconciliationManager.new(self)
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue