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

Migrate valuations controller to new reconciliation methods

This commit is contained in:
Zach Gollwitzer 2025-07-10 10:31:40 -04:00
parent 25f0c78c47
commit d80cb9f812
19 changed files with 187 additions and 171 deletions

View file

@ -6,16 +6,9 @@ class Account::ReconcileableTest < ActiveSupport::TestCase
@family = families(:dylan_family)
end
# Currency updates earn their own method because updating an account currency incurs
# side effects like recalculating balances, etc.
test "can update the account currency" do
@account.update_currency!("EUR")
assert_equal "EUR", @account.currency
assert_equal "EUR", @account.entries.valuations.first.currency
end
# If a user has an opening balance (valuation) for their manual account and has 1+ transactions, the intent of
# Scope: Depository Only
#
# If a user has an opening balance (valuation) for their manual *Depository* account and has 1+ transactions, the intent of
# "updating current balance" typically means that their start balance is incorrect. We follow that user intent
# by default and find the delta required, and update the opening balance so that the timeline reflects this current balance
#