mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-04 21:15:19 +02:00
Improve chart performance and gapfilling (#2306)
This commit is contained in:
parent
e1b81ef879
commit
6e202bd7ec
10 changed files with 382 additions and 196 deletions
|
@ -88,7 +88,20 @@ class BalanceSheet
|
|||
end
|
||||
|
||||
def net_worth_series(period: Period.last_30_days)
|
||||
active_accounts.balance_series(currency: currency, period: period, favorable_direction: "up")
|
||||
memo_key = [ period.start_date, period.end_date ].compact.join("_")
|
||||
|
||||
@net_worth_series ||= {}
|
||||
|
||||
account_ids = active_accounts.pluck(:id)
|
||||
|
||||
builder = (@net_worth_series[memo_key] ||= Balance::ChartSeriesBuilder.new(
|
||||
account_ids: account_ids,
|
||||
currency: currency,
|
||||
period: period,
|
||||
favorable_direction: "up"
|
||||
))
|
||||
|
||||
builder.balance_series
|
||||
end
|
||||
|
||||
def currency
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue