mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 03:54:08 +00:00
feat: add crypto account type to demo data (#555)
* feat: add crypto account type to demo data * fix: set currency to BTC, revert schema migration change and fix tests * fix: update dates in time_series tests
This commit is contained in:
committed by
GitHub
parent
f904d9d062
commit
49d1fe0e11
@@ -219,6 +219,24 @@ namespace :demo_data do
|
||||
|
||||
brokerage.sync
|
||||
|
||||
crypto = Account.find_or_create_by(name: "Bitcoin Account") do |a|
|
||||
a.family = family
|
||||
a.accountable = Account::Crypto.new
|
||||
a.currency = "BTC"
|
||||
a.balance = 0.1
|
||||
end
|
||||
|
||||
crypto_valuations = [
|
||||
{ date: 1.year.ago.to_date, value: 0.05, currency: "BTC" },
|
||||
{ date: 200.days.ago.to_date, value: 0.06, currency: "BTC" },
|
||||
{ date: 100.days.ago.to_date, value: 0.08, currency: "BTC" },
|
||||
{ date: 20.days.ago.to_date, value: 0.1, currency: "BTC" }
|
||||
]
|
||||
|
||||
crypto.valuations.upsert_all(crypto_valuations, unique_by: :index_valuations_on_account_id_and_date)
|
||||
|
||||
crypto.sync
|
||||
|
||||
mortgage = Account.find_or_create_by(name: "Demo Mortgage") do |a|
|
||||
a.family = family
|
||||
a.accountable = Account::Loan.new
|
||||
|
||||
Reference in New Issue
Block a user