mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-02 20:15:22 +02:00
Multi-Currency Part 2 (#543)
* Support all currencies, handle outside DB * Remove currencies from seed * Fix account balance namespace * Set default currency on authentication * Cache currency instances * Implement multi-currency syncs with tests * Series fallback, passing tests * Fix conflicts * Make value group concrete class that works with currency values * Fix migration conflict * Update tests to expect multi-currency results * Update account list to use group method * Namespace updates * Fetch unknown exchange rates from API * Fix date range bug * Ensure demo data works without external API * Enforce cascades only at DB level
This commit is contained in:
parent
de0cba9fed
commit
110855d077
55 changed files with 1226 additions and 714 deletions
4
test/fixtures/account/depositories.yml
vendored
4
test/fixtures/account/depositories.yml
vendored
|
@ -2,3 +2,7 @@ checking:
|
|||
id: "123e4567-e89b-12d3-a456-426614174000"
|
||||
savings:
|
||||
id: "123e4567-e89b-12d3-a456-426614174001"
|
||||
eur_checking:
|
||||
id: "123e4567-e89b-12d3-a456-426614174004"
|
||||
multi_currency:
|
||||
id: "123e4567-e89b-12d3-a456-426614174005"
|
||||
|
|
32
test/fixtures/account/expected_balances.csv
vendored
Normal file
32
test/fixtures/account/expected_balances.csv
vendored
Normal file
|
@ -0,0 +1,32 @@
|
|||
date_offset,collectable,checking,savings_with_valuation_overrides,credit_card,eur_checking_eur,eur_checking_usd,multi_currency
|
||||
-30,400,4000,21250,1040,11850,12947.31,10721.26
|
||||
-29,400,3985,21750,940,12050,13182.7,10921.26
|
||||
-28,400,3985,21750,940,12050,13194.75,10921.26
|
||||
-27,400,3985,21750,940,12050,13132.09,10921.26
|
||||
-26,400,3985,21750,940,12050,13083.89,10921.26
|
||||
-25,400,3985,21000,940,12050,13081.48,10921.26
|
||||
-24,400,3985,21000,940,12050,13062.2,10921.26
|
||||
-23,400,3985,21000,940,12050,13022.435,10921.26
|
||||
-22,400,5060,21000,940,12050,13060.995,10921.26
|
||||
-21,400,5060,21000,940,12050,13068.225,10921.26
|
||||
-20,400,5060,21000,940,12050,13079.07,10921.26
|
||||
-19,400,5060,21000,940,11950,12932.29,10813.04
|
||||
-18,400,5060,19000,940,11950,12934.68,10813.04
|
||||
-17,400,5060,19000,940,11950,12927.51,10813.04
|
||||
-16,400,5060,19000,940,11950,12916.755,10813.04
|
||||
-15,400,5040,19000,960,11950,12882.1,10813.04
|
||||
-14,400,5040,19000,960,11950,12879.71,10813.04
|
||||
-13,400,5040,19000,960,11950,12873.735,10813.04
|
||||
-12,700,5010,19500,990,11950,12821.155,10813.04
|
||||
-11,700,5010,19500,990,11950,12797.255,10813.04
|
||||
-10,700,5010,19500,990,11950,12873.735,10813.04
|
||||
-9,700,5010,19500,990,12000,12939.6,10863.04
|
||||
-8,700,5010,19500,990,12000,12933.6,10863.04
|
||||
-7,700,5010,19500,990,12000,12928.8,10863.04
|
||||
-6,700,5010,19500,990,12000,12906,10863.04
|
||||
-5,700,5000,19700,1000,12000,12891.6,10863.04
|
||||
-4,550,5000,19700,1000,12000,12945.6,10000
|
||||
-3,550,5000,20500,1000,12000,13046.4,10000
|
||||
-2,550,5000,20500,1000,12000,12982.8,10000
|
||||
-1,550,5000,20500,1000,12000,13014,10000
|
||||
0,550,5000,20000,1000,12000,13000.8,10000
|
|
17
test/fixtures/accounts.yml
vendored
17
test/fixtures/accounts.yml
vendored
|
@ -29,3 +29,20 @@ credit_card:
|
|||
balance: 1000
|
||||
accountable_type: Account::Credit
|
||||
accountable_id: "123e4567-e89b-12d3-a456-426614174003"
|
||||
|
||||
eur_checking:
|
||||
family: dylan_family
|
||||
name: Euro Checking Account
|
||||
currency: EUR
|
||||
balance: 12000
|
||||
accountable_type: Account::Depository
|
||||
accountable_id: "123e4567-e89b-12d3-a456-426614174004"
|
||||
|
||||
# Multi-currency account (e.g. Wise, Revolut, etc.)
|
||||
multi_currency:
|
||||
family: dylan_family
|
||||
name: Multi Currency Account
|
||||
currency: USD # multi-currency accounts still have a "primary" currency
|
||||
balance: 10000
|
||||
accountable_type: Account::Depository
|
||||
accountable_id: "123e4567-e89b-12d3-a456-426614174005"
|
||||
|
|
9
test/fixtures/currencies.yml
vendored
9
test/fixtures/currencies.yml
vendored
|
@ -1,9 +0,0 @@
|
|||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
|
||||
# one:
|
||||
# name: MyString
|
||||
# iso_code: MyString
|
||||
|
||||
# two:
|
||||
# name: MyString
|
||||
# iso_code: MyString
|
323
test/fixtures/exchange_rates.yml
vendored
323
test/fixtures/exchange_rates.yml
vendored
|
@ -1,13 +1,310 @@
|
|||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
|
||||
# one:
|
||||
# base_currency: one
|
||||
# converted_currency: one
|
||||
# rate: 9.99
|
||||
# date: 2024-02-09
|
||||
|
||||
# two:
|
||||
# base_currency: two
|
||||
# converted_currency: two
|
||||
# rate: 9.99
|
||||
# date: 2024-02-09
|
||||
day_30_ago_eur_to_usd:
|
||||
base_currency: EUR
|
||||
converted_currency: USD
|
||||
rate: 1.0926
|
||||
date: <%= 30.days.ago.to_date %>
|
||||
day_29_ago_eur_to_usd:
|
||||
base_currency: EUR
|
||||
converted_currency: USD
|
||||
rate: 1.094
|
||||
date: <%= 29.days.ago.to_date %>
|
||||
day_28_ago_eur_to_usd:
|
||||
base_currency: EUR
|
||||
converted_currency: USD
|
||||
rate: 1.095
|
||||
date: <%= 28.days.ago.to_date %>
|
||||
day_27_ago_eur_to_usd:
|
||||
base_currency: EUR
|
||||
converted_currency: USD
|
||||
rate: 1.0898
|
||||
date: <%= 27.days.ago.to_date %>
|
||||
day_26_ago_eur_to_usd:
|
||||
base_currency: EUR
|
||||
converted_currency: USD
|
||||
rate: 1.0858
|
||||
date: <%= 26.days.ago.to_date %>
|
||||
day_25_ago_eur_to_usd:
|
||||
base_currency: EUR
|
||||
converted_currency: USD
|
||||
rate: 1.0856
|
||||
date: <%= 25.days.ago.to_date %>
|
||||
day_24_ago_eur_to_usd:
|
||||
base_currency: EUR
|
||||
converted_currency: USD
|
||||
rate: 1.084
|
||||
date: <%= 24.days.ago.to_date %>
|
||||
day_23_ago_eur_to_usd:
|
||||
base_currency: EUR
|
||||
converted_currency: USD
|
||||
rate: 1.0807
|
||||
date: <%= 23.days.ago.to_date %>
|
||||
day_22_ago_eur_to_usd:
|
||||
base_currency: EUR
|
||||
converted_currency: USD
|
||||
rate: 1.0839
|
||||
date: <%= 22.days.ago.to_date %>
|
||||
day_21_ago_eur_to_usd:
|
||||
base_currency: EUR
|
||||
converted_currency: USD
|
||||
rate: 1.0845
|
||||
date: <%= 21.days.ago.to_date %>
|
||||
day_20_ago_eur_to_usd:
|
||||
base_currency: EUR
|
||||
converted_currency: USD
|
||||
rate: 1.0854
|
||||
date: <%= 20.days.ago.to_date %>
|
||||
day_19_ago_eur_to_usd:
|
||||
base_currency: EUR
|
||||
converted_currency: USD
|
||||
rate: 1.0822
|
||||
date: <%= 19.days.ago.to_date %>
|
||||
day_18_ago_eur_to_usd:
|
||||
base_currency: EUR
|
||||
converted_currency: USD
|
||||
rate: 1.0824
|
||||
date: <%= 18.days.ago.to_date %>
|
||||
day_17_ago_eur_to_usd:
|
||||
base_currency: EUR
|
||||
converted_currency: USD
|
||||
rate: 1.0818
|
||||
date: <%= 17.days.ago.to_date %>
|
||||
day_16_ago_eur_to_usd:
|
||||
base_currency: EUR
|
||||
converted_currency: USD
|
||||
rate: 1.0809
|
||||
date: <%= 16.days.ago.to_date %>
|
||||
day_15_ago_eur_to_usd:
|
||||
base_currency: EUR
|
||||
converted_currency: USD
|
||||
rate: 1.078
|
||||
date: <%= 15.days.ago.to_date %>
|
||||
day_14_ago_eur_to_usd:
|
||||
base_currency: EUR
|
||||
converted_currency: USD
|
||||
rate: 1.0778
|
||||
date: <%= 14.days.ago.to_date %>
|
||||
day_13_ago_eur_to_usd:
|
||||
base_currency: EUR
|
||||
converted_currency: USD
|
||||
rate: 1.0773
|
||||
date: <%= 13.days.ago.to_date %>
|
||||
day_12_ago_eur_to_usd:
|
||||
base_currency: EUR
|
||||
converted_currency: USD
|
||||
rate: 1.0729
|
||||
date: <%= 12.days.ago.to_date %>
|
||||
day_11_ago_eur_to_usd:
|
||||
base_currency: EUR
|
||||
converted_currency: USD
|
||||
rate: 1.0709
|
||||
date: <%= 11.days.ago.to_date %>
|
||||
day_10_ago_eur_to_usd:
|
||||
base_currency: EUR
|
||||
converted_currency: USD
|
||||
rate: 1.0773
|
||||
date: <%= 10.days.ago.to_date %>
|
||||
day_9_ago_eur_to_usd:
|
||||
base_currency: EUR
|
||||
converted_currency: USD
|
||||
rate: 1.0783
|
||||
date: <%= 9.days.ago.to_date %>
|
||||
day_8_ago_eur_to_usd:
|
||||
base_currency: EUR
|
||||
converted_currency: USD
|
||||
rate: 1.0778
|
||||
date: <%= 8.days.ago.to_date %>
|
||||
day_7_ago_eur_to_usd:
|
||||
base_currency: EUR
|
||||
converted_currency: USD
|
||||
rate: 1.0774
|
||||
date: <%= 7.days.ago.to_date %>
|
||||
day_6_ago_eur_to_usd:
|
||||
base_currency: EUR
|
||||
converted_currency: USD
|
||||
rate: 1.0755
|
||||
date: <%= 6.days.ago.to_date %>
|
||||
day_5_ago_eur_to_usd:
|
||||
base_currency: EUR
|
||||
converted_currency: USD
|
||||
rate: 1.0743
|
||||
date: <%= 5.days.ago.to_date %>
|
||||
day_4_ago_eur_to_usd:
|
||||
base_currency: EUR
|
||||
converted_currency: USD
|
||||
rate: 1.0788
|
||||
date: <%= 4.days.ago.to_date %>
|
||||
day_3_ago_eur_to_usd:
|
||||
base_currency: EUR
|
||||
converted_currency: USD
|
||||
rate: 1.0872
|
||||
date: <%= 3.days.ago.to_date %>
|
||||
day_2_ago_eur_to_usd:
|
||||
base_currency: EUR
|
||||
converted_currency: USD
|
||||
rate: 1.0819
|
||||
date: <%= 2.days.ago.to_date %>
|
||||
day_1_ago_eur_to_usd:
|
||||
base_currency: EUR
|
||||
converted_currency: USD
|
||||
rate: 1.0845
|
||||
date: <%= 1.days.ago.to_date %>
|
||||
today_eur_to_usd:
|
||||
base_currency: EUR
|
||||
converted_currency: USD
|
||||
rate: 1.0834
|
||||
date: <%= Date.current %>
|
||||
day_30_ago_usd_to_eur:
|
||||
base_currency: USD
|
||||
converted_currency: EUR
|
||||
rate: 0.9179
|
||||
date: <%= 30.days.ago.to_date %>
|
||||
day_29_ago_usd_to_eur:
|
||||
base_currency: USD
|
||||
converted_currency: EUR
|
||||
rate: 0.9154
|
||||
date: <%= 29.days.ago.to_date %>
|
||||
day_28_ago_usd_to_eur:
|
||||
base_currency: USD
|
||||
converted_currency: EUR
|
||||
rate: 0.9107
|
||||
date: <%= 28.days.ago.to_date %>
|
||||
day_27_ago_usd_to_eur:
|
||||
base_currency: USD
|
||||
converted_currency: EUR
|
||||
rate: 0.9139
|
||||
date: <%= 27.days.ago.to_date %>
|
||||
day_26_ago_usd_to_eur:
|
||||
base_currency: USD
|
||||
converted_currency: EUR
|
||||
rate: 0.9082
|
||||
date: <%= 26.days.ago.to_date %>
|
||||
day_25_ago_usd_to_eur:
|
||||
base_currency: USD
|
||||
converted_currency: EUR
|
||||
rate: 0.9077
|
||||
date: <%= 25.days.ago.to_date %>
|
||||
day_24_ago_usd_to_eur:
|
||||
base_currency: USD
|
||||
converted_currency: EUR
|
||||
rate: 0.9054
|
||||
date: <%= 24.days.ago.to_date %>
|
||||
day_23_ago_usd_to_eur:
|
||||
base_currency: USD
|
||||
converted_currency: EUR
|
||||
rate: 0.9004
|
||||
date: <%= 23.days.ago.to_date %>
|
||||
day_22_ago_usd_to_eur:
|
||||
base_currency: USD
|
||||
converted_currency: EUR
|
||||
rate: 0.9040
|
||||
date: <%= 22.days.ago.to_date %>
|
||||
day_21_ago_usd_to_eur:
|
||||
base_currency: USD
|
||||
converted_currency: EUR
|
||||
rate: 0.9060
|
||||
date: <%= 21.days.ago.to_date %>
|
||||
day_20_ago_usd_to_eur:
|
||||
base_currency: USD
|
||||
converted_currency: EUR
|
||||
rate: 0.9052
|
||||
date: <%= 20.days.ago.to_date %>
|
||||
day_19_ago_usd_to_eur:
|
||||
base_currency: USD
|
||||
converted_currency: EUR
|
||||
rate: 0.9139
|
||||
date: <%= 19.days.ago.to_date %>
|
||||
day_18_ago_usd_to_eur:
|
||||
base_currency: USD
|
||||
converted_currency: EUR
|
||||
rate: 0.9155
|
||||
date: <%= 18.days.ago.to_date %>
|
||||
day_17_ago_usd_to_eur:
|
||||
base_currency: USD
|
||||
converted_currency: EUR
|
||||
rate: 0.9135
|
||||
date: <%= 17.days.ago.to_date %>
|
||||
day_16_ago_usd_to_eur:
|
||||
base_currency: USD
|
||||
converted_currency: EUR
|
||||
rate: 0.9141
|
||||
date: <%= 16.days.ago.to_date %>
|
||||
day_15_ago_usd_to_eur:
|
||||
base_currency: USD
|
||||
converted_currency: EUR
|
||||
rate: 0.9131
|
||||
date: <%= 15.days.ago.to_date %>
|
||||
day_14_ago_usd_to_eur:
|
||||
base_currency: USD
|
||||
converted_currency: EUR
|
||||
rate: 0.9147
|
||||
date: <%= 14.days.ago.to_date %>
|
||||
day_13_ago_usd_to_eur:
|
||||
base_currency: USD
|
||||
converted_currency: EUR
|
||||
rate: 0.9112
|
||||
date: <%= 13.days.ago.to_date %>
|
||||
day_12_ago_usd_to_eur:
|
||||
base_currency: USD
|
||||
converted_currency: EUR
|
||||
rate: 0.9115
|
||||
date: <%= 12.days.ago.to_date %>
|
||||
day_11_ago_usd_to_eur:
|
||||
base_currency: USD
|
||||
converted_currency: EUR
|
||||
rate: 0.9132
|
||||
date: <%= 11.days.ago.to_date %>
|
||||
day_10_ago_usd_to_eur:
|
||||
base_currency: USD
|
||||
converted_currency: EUR
|
||||
rate: 0.9130
|
||||
date: <%= 10.days.ago.to_date %>
|
||||
day_9_ago_usd_to_eur:
|
||||
base_currency: USD
|
||||
converted_currency: EUR
|
||||
rate: 0.9192
|
||||
date: <%= 9.days.ago.to_date %>
|
||||
day_8_ago_usd_to_eur:
|
||||
base_currency: USD
|
||||
converted_currency: EUR
|
||||
rate: 0.9188
|
||||
date: <%= 8.days.ago.to_date %>
|
||||
day_7_ago_usd_to_eur:
|
||||
base_currency: USD
|
||||
converted_currency: EUR
|
||||
rate: 0.9194
|
||||
date: <%= 7.days.ago.to_date %>
|
||||
day_6_ago_usd_to_eur:
|
||||
base_currency: USD
|
||||
converted_currency: EUR
|
||||
rate: 0.9177
|
||||
date: <%= 6.days.ago.to_date %>
|
||||
day_5_ago_usd_to_eur:
|
||||
base_currency: USD
|
||||
converted_currency: EUR
|
||||
rate: 0.9187
|
||||
date: <%= 5.days.ago.to_date %>
|
||||
day_4_ago_usd_to_eur:
|
||||
base_currency: USD
|
||||
converted_currency: EUR
|
||||
rate: 0.9213
|
||||
date: <%= 4.days.ago.to_date %>
|
||||
day_3_ago_usd_to_eur:
|
||||
base_currency: USD
|
||||
converted_currency: EUR
|
||||
rate: 0.9186
|
||||
date: <%= 3.days.ago.to_date %>
|
||||
day_2_ago_usd_to_eur:
|
||||
base_currency: USD
|
||||
converted_currency: EUR
|
||||
rate: 0.9218
|
||||
date: <%= 2.days.ago.to_date %>
|
||||
day_1_ago_usd_to_eur:
|
||||
base_currency: USD
|
||||
converted_currency: EUR
|
||||
rate: 0.9213
|
||||
date: <%= 1.days.ago.to_date %>
|
||||
today_usd_to_eur:
|
||||
base_currency: USD
|
||||
converted_currency: EUR
|
||||
rate: 0.9141
|
||||
date: <%= Date.current %>
|
||||
|
|
62
test/fixtures/family/expected_snapshots.csv
vendored
62
test/fixtures/family/expected_snapshots.csv
vendored
|
@ -1,32 +1,32 @@
|
|||
date_offset,net_worth,assets,liabilities,depositories,investments,loans,credits,properties,vehicles,other_assets,other_liabilities
|
||||
-30,24610,25650,1040,25250,0,0,1040,0,0,400,0
|
||||
-29,25195,26135,940,25735,0,0,940,0,0,400,0
|
||||
-28,25195,26135,940,25735,0,0,940,0,0,400,0
|
||||
-27,25195,26135,940,25735,0,0,940,0,0,400,0
|
||||
-26,25195,26135,940,25735,0,0,940,0,0,400,0
|
||||
-25,24445,25385,940,24985,0,0,940,0,0,400,0
|
||||
-24,24445,25385,940,24985,0,0,940,0,0,400,0
|
||||
-23,24445,25385,940,24985,0,0,940,0,0,400,0
|
||||
-22,25520,26460,940,26060,0,0,940,0,0,400,0
|
||||
-21,25520,26460,940,26060,0,0,940,0,0,400,0
|
||||
-20,25520,26460,940,26060,0,0,940,0,0,400,0
|
||||
-19,25520,26460,940,26060,0,0,940,0,0,400,0
|
||||
-18,23520,24460,940,24060,0,0,940,0,0,400,0
|
||||
-17,23520,24460,940,24060,0,0,940,0,0,400,0
|
||||
-16,23520,24460,940,24060,0,0,940,0,0,400,0
|
||||
-15,23480,24440,960,24040,0,0,960,0,0,400,0
|
||||
-14,23480,24440,960,24040,0,0,960,0,0,400,0
|
||||
-13,23480,24440,960,24040,0,0,960,0,0,400,0
|
||||
-12,24220,25210,990,24510,0,0,990,0,0,700,0
|
||||
-11,24220,25210,990,24510,0,0,990,0,0,700,0
|
||||
-10,24220,25210,990,24510,0,0,990,0,0,700,0
|
||||
-9,24220,25210,990,24510,0,0,990,0,0,700,0
|
||||
-8,24220,25210,990,24510,0,0,990,0,0,700,0
|
||||
-7,24220,25210,990,24510,0,0,990,0,0,700,0
|
||||
-6,24220,25210,990,24510,0,0,990,0,0,700,0
|
||||
-5,24400,25400,1000,24700,0,0,1000,0,0,700,0
|
||||
-4,24250,25250,1000,24700,0,0,1000,0,0,550,0
|
||||
-3,25050,26050,1000,25500,0,0,1000,0,0,550,0
|
||||
-2,25050,26050,1000,25500,0,0,1000,0,0,550,0
|
||||
-1,25050,26050,1000,25500,0,0,1000,0,0,550,0
|
||||
0,24550,25550,1000,25000,0,0,1000,0,0,550,0
|
||||
-30,48278.57,49318.57,1040.00,48918.57,0.00,0.00,1040.00,0.00,0.00,400.00,0.00
|
||||
-29,49298.96,50238.96,940.00,49838.96,0.00,0.00,940.00,0.00,0.00,400.00,0.00
|
||||
-28,49311.01,50251.01,940.00,49851.01,0.00,0.00,940.00,0.00,0.00,400.00,0.00
|
||||
-27,49248.35,50188.35,940.00,49788.35,0.00,0.00,940.00,0.00,0.00,400.00,0.00
|
||||
-26,49200.15,50140.15,940.00,49740.15,0.00,0.00,940.00,0.00,0.00,400.00,0.00
|
||||
-25,48447.74,49387.74,940.00,48987.74,0.00,0.00,940.00,0.00,0.00,400.00,0.00
|
||||
-24,48428.46,49368.46,940.00,48968.46,0.00,0.00,940.00,0.00,0.00,400.00,0.00
|
||||
-23,48388.70,49328.70,940.00,48928.70,0.00,0.00,940.00,0.00,0.00,400.00,0.00
|
||||
-22,49502.26,50442.26,940.00,50042.26,0.00,0.00,940.00,0.00,0.00,400.00,0.00
|
||||
-21,49509.49,50449.49,940.00,50049.49,0.00,0.00,940.00,0.00,0.00,400.00,0.00
|
||||
-20,49520.33,50460.33,940.00,50060.33,0.00,0.00,940.00,0.00,0.00,400.00,0.00
|
||||
-19,49265.33,50205.33,940.00,49805.33,0.00,0.00,940.00,0.00,0.00,400.00,0.00
|
||||
-18,47267.72,48207.72,940.00,47807.72,0.00,0.00,940.00,0.00,0.00,400.00,0.00
|
||||
-17,47260.55,48200.55,940.00,47800.55,0.00,0.00,940.00,0.00,0.00,400.00,0.00
|
||||
-16,47249.80,48189.80,940.00,47789.80,0.00,0.00,940.00,0.00,0.00,400.00,0.00
|
||||
-15,47175.14,48135.14,960.00,47735.14,0.00,0.00,960.00,0.00,0.00,400.00,0.00
|
||||
-14,47172.75,48132.75,960.00,47732.75,0.00,0.00,960.00,0.00,0.00,400.00,0.00
|
||||
-13,47166.78,48126.78,960.00,47726.78,0.00,0.00,960.00,0.00,0.00,400.00,0.00
|
||||
-12,47854.20,48844.20,990.00,48144.20,0.00,0.00,990.00,0.00,0.00,700.00,0.00
|
||||
-11,47830.30,48820.30,990.00,48120.30,0.00,0.00,990.00,0.00,0.00,700.00,0.00
|
||||
-10,47906.78,48896.78,990.00,48196.78,0.00,0.00,990.00,0.00,0.00,700.00,0.00
|
||||
-9,48022.64,49012.64,990.00,48312.64,0.00,0.00,990.00,0.00,0.00,700.00,0.00
|
||||
-8,48016.64,49006.64,990.00,48306.64,0.00,0.00,990.00,0.00,0.00,700.00,0.00
|
||||
-7,48011.84,49001.84,990.00,48301.84,0.00,0.00,990.00,0.00,0.00,700.00,0.00
|
||||
-6,47989.04,48979.04,990.00,48279.04,0.00,0.00,990.00,0.00,0.00,700.00,0.00
|
||||
-5,48154.64,49154.64,1000.00,48454.64,0.00,0.00,1000.00,0.00,0.00,700.00,0.00
|
||||
-4,47195.60,48195.60,1000.00,47645.60,0.00,0.00,1000.00,0.00,0.00,550.00,0.00
|
||||
-3,48096.40,49096.40,1000.00,48546.40,0.00,0.00,1000.00,0.00,0.00,550.00,0.00
|
||||
-2,48032.80,49032.80,1000.00,48482.80,0.00,0.00,1000.00,0.00,0.00,550.00,0.00
|
||||
-1,48064.00,49064.00,1000.00,48514.00,0.00,0.00,1000.00,0.00,0.00,550.00,0.00
|
||||
0,47550.80,48550.80,1000.00,48000.80,0.00,0.00,1000.00,0.00,0.00,550.00,0.00
|
|
64
test/fixtures/transactions.yml
vendored
64
test/fixtures/transactions.yml
vendored
|
@ -5,6 +5,7 @@ checking_one:
|
|||
amount: 10
|
||||
account: checking
|
||||
category: food_and_drink
|
||||
currency: USD
|
||||
|
||||
checking_two:
|
||||
name: Chipotle
|
||||
|
@ -12,12 +13,14 @@ checking_two:
|
|||
amount: 30
|
||||
account: checking
|
||||
category: food_and_drink
|
||||
currency: USD
|
||||
|
||||
checking_three:
|
||||
name: Amazon
|
||||
date: <%= 15.days.ago.to_date %>
|
||||
amount: 20
|
||||
account: checking
|
||||
currency: USD
|
||||
|
||||
checking_four:
|
||||
name: Paycheck
|
||||
|
@ -25,12 +28,14 @@ checking_four:
|
|||
amount: -1075
|
||||
account: checking
|
||||
category: income
|
||||
currency: USD
|
||||
|
||||
checking_five:
|
||||
name: Netflix
|
||||
date: <%= 29.days.ago.to_date %>
|
||||
amount: 15
|
||||
account: checking
|
||||
currency: USD
|
||||
|
||||
# Savings account that has these transactions and valuation overrides
|
||||
savings_one:
|
||||
|
@ -39,6 +44,7 @@ savings_one:
|
|||
amount: -200
|
||||
account: savings_with_valuation_overrides
|
||||
category: income
|
||||
currency: USD
|
||||
|
||||
savings_two:
|
||||
name: Check Deposit
|
||||
|
@ -46,12 +52,14 @@ savings_two:
|
|||
amount: -50
|
||||
account: savings_with_valuation_overrides
|
||||
category: income
|
||||
currency: USD
|
||||
|
||||
savings_three:
|
||||
name: Withdrawal
|
||||
date: <%= 18.days.ago.to_date %>
|
||||
amount: 2000
|
||||
account: savings_with_valuation_overrides
|
||||
currency: USD
|
||||
|
||||
savings_four:
|
||||
name: Check Deposit
|
||||
|
@ -59,6 +67,7 @@ savings_four:
|
|||
amount: -500
|
||||
account: savings_with_valuation_overrides
|
||||
category: income
|
||||
currency: USD
|
||||
|
||||
# Credit card account transactions
|
||||
credit_card_one:
|
||||
|
@ -67,6 +76,7 @@ credit_card_one:
|
|||
amount: 10
|
||||
account: credit_card
|
||||
category: food_and_drink
|
||||
currency: USD
|
||||
|
||||
credit_card_two:
|
||||
name: Chipotle
|
||||
|
@ -74,15 +84,69 @@ credit_card_two:
|
|||
amount: 30
|
||||
account: credit_card
|
||||
category: food_and_drink
|
||||
currency: USD
|
||||
|
||||
credit_card_three:
|
||||
name: Amazon
|
||||
date: <%= 15.days.ago.to_date %>
|
||||
amount: 20
|
||||
account: credit_card
|
||||
currency: USD
|
||||
|
||||
credit_card_four:
|
||||
name: CC Payment
|
||||
date: <%= 29.days.ago.to_date %>
|
||||
amount: -100
|
||||
account: credit_card
|
||||
currency: USD
|
||||
|
||||
# eur_checking transactions
|
||||
eur_checking_one:
|
||||
name: Check
|
||||
date: <%= 9.days.ago.to_date %>
|
||||
amount: -50
|
||||
currency: EUR
|
||||
account: eur_checking
|
||||
|
||||
eur_checking_two:
|
||||
name: Shopping trip
|
||||
date: <%= 19.days.ago.to_date %>
|
||||
amount: 100
|
||||
currency: EUR
|
||||
account: eur_checking
|
||||
|
||||
eur_checking_three:
|
||||
name: Check
|
||||
date: <%= 29.days.ago.to_date %>
|
||||
amount: -200
|
||||
currency: EUR
|
||||
account: eur_checking
|
||||
|
||||
# multi_currency transactions
|
||||
multi_currency_one:
|
||||
name: Outflow 1
|
||||
date: <%= 4.days.ago.to_date %>
|
||||
amount: 800
|
||||
currency: EUR
|
||||
account: multi_currency
|
||||
|
||||
multi_currency_two:
|
||||
name: Inflow 1
|
||||
date: <%= 9.days.ago.to_date %>
|
||||
amount: -50
|
||||
currency: USD
|
||||
account: multi_currency
|
||||
|
||||
multi_currency_three:
|
||||
name: Outflow 2
|
||||
date: <%= 19.days.ago.to_date %>
|
||||
amount: 100
|
||||
currency: EUR
|
||||
account: multi_currency
|
||||
|
||||
multi_currency_four:
|
||||
name: Inflow 2
|
||||
date: <%= 29.days.ago.to_date %>
|
||||
amount: -200
|
||||
currency: USD
|
||||
account: multi_currency
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue