1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-02 20:15:22 +02:00

Basic Account Balance Sync Algorithm (#501)

* Sketch out sync interface

* Add basic account sync algorithm

* Update logic for final balance in series

* Remove start_date concept

* Clean up tests

* Improve clarity of test

* Update app/models/account.rb

Co-authored-by: Rob Zolkos <rob@zolkos.com>
Signed-off-by: Zach Gollwitzer <zach.gollwitzer@gmail.com>

* Update app/models/transaction.rb

Co-authored-by: Rob Zolkos <rob@zolkos.com>
Signed-off-by: Zach Gollwitzer <zach.gollwitzer@gmail.com>

* Update app/models/valuation.rb

Co-authored-by: Rob Zolkos <rob@zolkos.com>
Signed-off-by: Zach Gollwitzer <zach.gollwitzer@gmail.com>

* Re-organize code, simplify job interface

* Consolidate balance calculations

* More cleanup

---------

Signed-off-by: Zach Gollwitzer <zach.gollwitzer@gmail.com>
Co-authored-by: Rob Zolkos <rob@zolkos.com>
This commit is contained in:
Zach Gollwitzer 2024-02-29 08:32:52 -05:00 committed by GitHub
parent fb657856a5
commit dbf575c02a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 207 additions and 175 deletions

View file

@ -1,3 +1,11 @@
class Transaction < ApplicationRecord
belongs_to :account
after_commit :sync_account
private
def sync_account
self.account.sync_later
end
end