mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-06 14:05:20 +02:00
Lint fixes
This commit is contained in:
parent
0619102273
commit
e795c4c9a3
3 changed files with 23 additions and 23 deletions
|
@ -65,10 +65,10 @@ class UI::Account::BalanceReconciliation < ApplicationComponent
|
|||
|
||||
# Change in brokerage cash (includes deposits, withdrawals, and cash from trades)
|
||||
items << { label: "Change in brokerage cash", value: net_cash_flow, tooltip: "Net change in cash from deposits, withdrawals, and trades", style: :flow }
|
||||
|
||||
|
||||
# Change in holdings from trading activity
|
||||
items << { label: "Change in holdings (buys/sells)", value: net_non_cash_flow, tooltip: "Impact on holdings from buying and selling securities", style: :flow }
|
||||
|
||||
|
||||
# Market price changes
|
||||
items << { label: "Change in holdings (market price activity)", value: balance.net_market_flows_money, tooltip: "Change in holdings value from market price movements", style: :flow }
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ class Balance::Materializer
|
|||
@balances.map { |b| b.attributes
|
||||
.slice("date", "balance", "cash_balance", "currency",
|
||||
"start_cash_balance", "start_non_cash_balance",
|
||||
"cash_inflows", "cash_outflows",
|
||||
"cash_inflows", "cash_outflows",
|
||||
"non_cash_inflows", "non_cash_outflows",
|
||||
"net_market_flows",
|
||||
"cash_adjustments", "non_cash_adjustments",
|
||||
|
|
|
@ -65,7 +65,7 @@ class Balance::MaterializerTest < ActiveSupport::TestCase
|
|||
test "purges stale balances and holdings" do
|
||||
# Balance before start date is stale
|
||||
@account.expects(:start_date).returns(2.days.ago.to_date).twice
|
||||
|
||||
|
||||
stale_balance = Balance.new(
|
||||
date: 3.days.ago.to_date,
|
||||
balance: 10000,
|
||||
|
@ -147,24 +147,24 @@ class Balance::MaterializerTest < ActiveSupport::TestCase
|
|||
|
||||
private
|
||||
|
||||
def assert_balance_fields_persisted(expected_balances)
|
||||
expected_balances.each do |expected|
|
||||
persisted = @account.balances.find_by(date: expected.date)
|
||||
assert_not_nil persisted, "Balance for #{expected.date} should be persisted"
|
||||
|
||||
# Check all balance component fields
|
||||
assert_equal expected.balance, persisted.balance
|
||||
assert_equal expected.cash_balance, persisted.cash_balance
|
||||
assert_equal expected.start_cash_balance, persisted.start_cash_balance
|
||||
assert_equal expected.start_non_cash_balance, persisted.start_non_cash_balance
|
||||
assert_equal expected.cash_inflows, persisted.cash_inflows
|
||||
assert_equal expected.cash_outflows, persisted.cash_outflows
|
||||
assert_equal expected.non_cash_inflows, persisted.non_cash_inflows
|
||||
assert_equal expected.non_cash_outflows, persisted.non_cash_outflows
|
||||
assert_equal expected.net_market_flows, persisted.net_market_flows
|
||||
assert_equal expected.cash_adjustments, persisted.cash_adjustments
|
||||
assert_equal expected.non_cash_adjustments, persisted.non_cash_adjustments
|
||||
assert_equal expected.flows_factor, persisted.flows_factor
|
||||
def assert_balance_fields_persisted(expected_balances)
|
||||
expected_balances.each do |expected|
|
||||
persisted = @account.balances.find_by(date: expected.date)
|
||||
assert_not_nil persisted, "Balance for #{expected.date} should be persisted"
|
||||
|
||||
# Check all balance component fields
|
||||
assert_equal expected.balance, persisted.balance
|
||||
assert_equal expected.cash_balance, persisted.cash_balance
|
||||
assert_equal expected.start_cash_balance, persisted.start_cash_balance
|
||||
assert_equal expected.start_non_cash_balance, persisted.start_non_cash_balance
|
||||
assert_equal expected.cash_inflows, persisted.cash_inflows
|
||||
assert_equal expected.cash_outflows, persisted.cash_outflows
|
||||
assert_equal expected.non_cash_inflows, persisted.non_cash_inflows
|
||||
assert_equal expected.non_cash_outflows, persisted.non_cash_outflows
|
||||
assert_equal expected.net_market_flows, persisted.net_market_flows
|
||||
assert_equal expected.cash_adjustments, persisted.cash_adjustments
|
||||
assert_equal expected.non_cash_adjustments, persisted.non_cash_adjustments
|
||||
assert_equal expected.flows_factor, persisted.flows_factor
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue