mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-02 20:15:22 +02:00
* Balance reconcilations with new components * Fix materializer and test assumptions * Fix investment valuation calculations and recon display * Lint fixes * Balance series uses new component fields
31 lines
598 B
Ruby
31 lines
598 B
Ruby
class UI::Account::ActivityDate < ApplicationComponent
|
|
attr_reader :account, :data
|
|
|
|
delegate :date, :entries, :balance, :transfers, to: :data
|
|
|
|
def initialize(account:, data:)
|
|
@account = account
|
|
@data = data
|
|
end
|
|
|
|
def id
|
|
dom_id(account, "entries_#{date}")
|
|
end
|
|
|
|
def broadcast_channel
|
|
account
|
|
end
|
|
|
|
def end_balance_money
|
|
balance&.end_balance_money || Money.new(0, account.currency)
|
|
end
|
|
|
|
def broadcast_refresh!
|
|
Turbo::StreamsChannel.broadcast_replace_to(
|
|
broadcast_channel,
|
|
target: id,
|
|
renderable: self,
|
|
layout: false
|
|
)
|
|
end
|
|
end
|