1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-19 05:09:38 +02:00

Implement savings rate insight card (#670)

This commit is contained in:
Josh Brown 2024-04-24 15:02:22 +01:00 committed by GitHub
parent 461fa672ff
commit b3f8ab78d9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 89 additions and 54 deletions

View file

@ -10,10 +10,12 @@ class PagesController < ApplicationController
snapshot_transactions = Current.family.snapshot_transactions
@income_series = snapshot_transactions[:income_series]
@spending_series = snapshot_transactions[:spending_series]
@savings_rate_series = snapshot_transactions[:savings_rate_series]
snapshot_account_transactions = Current.family.snapshot_account_transactions
@top_spenders = snapshot_account_transactions[:top_spenders]
@top_earners = snapshot_account_transactions[:top_earners]
@top_savers = snapshot_account_transactions[:top_savers]
@account_groups = Current.family.accounts.by_group(period: @period, currency: Current.family.currency)
@transactions = Current.family.transactions.limit(5).order(date: :desc)
@ -22,7 +24,6 @@ class PagesController < ApplicationController
placeholder_series_data = 10.times.map do |i|
{ date: Date.current - i.days, value: Money.new(0) }
end
@savings_rate_series = TimeSeries.new(10.times.map { |i| { date: Date.current - i.days, value: 0 } })
@investing_series = TimeSeries.new(placeholder_series_data)
end