mirror of
https://github.com/we-promise/sure.git
synced 2026-04-08 14:54:49 +00: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
32 lines
598 B
Ruby
32 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
|