mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-02 20:15:22 +02:00
Prepare fixture data for account sync tests (#493)
* Rename account balance field for clarity `original_balance` and `original_currency` may infer that these values are "original" to the account. In reality, they represent the "current" balance and currency on the account. * Prepare fixture data for account sync testing * Update to new field * Fix conflicts * Remove local schema change
This commit is contained in:
parent
d3b326d273
commit
7d48c01833
37 changed files with 230 additions and 265 deletions
10
test/fixtures/account/credits.yml
vendored
10
test/fixtures/account/credits.yml
vendored
|
@ -1,11 +1 @@
|
|||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
|
||||
# This model initially had no columns defined. If you add columns to the
|
||||
# model remove the "{}" from the fixture names and add the columns immediately
|
||||
# below each fixture, per the syntax in the comments below
|
||||
#
|
||||
one: {}
|
||||
# column: value
|
||||
#
|
||||
two: {}
|
||||
# column: value
|
||||
|
|
12
test/fixtures/account/depositories.yml
vendored
12
test/fixtures/account/depositories.yml
vendored
|
@ -1,11 +1 @@
|
|||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
|
||||
# This model initially had no columns defined. If you add columns to the
|
||||
# model remove the "{}" from the fixture names and add the columns immediately
|
||||
# below each fixture, per the syntax in the comments below
|
||||
#
|
||||
one: {}
|
||||
# column: value
|
||||
#
|
||||
two: {}
|
||||
# column: value
|
||||
checking: {}
|
||||
|
|
10
test/fixtures/account/investments.yml
vendored
10
test/fixtures/account/investments.yml
vendored
|
@ -1,11 +1 @@
|
|||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
|
||||
# This model initially had no columns defined. If you add columns to the
|
||||
# model remove the "{}" from the fixture names and add the columns immediately
|
||||
# below each fixture, per the syntax in the comments below
|
||||
#
|
||||
one: {}
|
||||
# column: value
|
||||
#
|
||||
two: {}
|
||||
# column: value
|
||||
|
|
10
test/fixtures/account/loans.yml
vendored
10
test/fixtures/account/loans.yml
vendored
|
@ -1,11 +1 @@
|
|||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
|
||||
# This model initially had no columns defined. If you add columns to the
|
||||
# model remove the "{}" from the fixture names and add the columns immediately
|
||||
# below each fixture, per the syntax in the comments below
|
||||
#
|
||||
one: {}
|
||||
# column: value
|
||||
#
|
||||
two: {}
|
||||
# column: value
|
||||
|
|
10
test/fixtures/account/other_assets.yml
vendored
10
test/fixtures/account/other_assets.yml
vendored
|
@ -1,11 +1 @@
|
|||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
|
||||
# This model initially had no columns defined. If you add columns to the
|
||||
# model remove the "{}" from the fixture names and add the columns immediately
|
||||
# below each fixture, per the syntax in the comments below
|
||||
#
|
||||
one: {}
|
||||
# column: value
|
||||
#
|
||||
two: {}
|
||||
# column: value
|
||||
|
|
10
test/fixtures/account/other_liabilities.yml
vendored
10
test/fixtures/account/other_liabilities.yml
vendored
|
@ -1,11 +1 @@
|
|||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
|
||||
# This model initially had no columns defined. If you add columns to the
|
||||
# model remove the "{}" from the fixture names and add the columns immediately
|
||||
# below each fixture, per the syntax in the comments below
|
||||
#
|
||||
one: {}
|
||||
# column: value
|
||||
#
|
||||
two: {}
|
||||
# column: value
|
||||
|
|
10
test/fixtures/account/properties.yml
vendored
10
test/fixtures/account/properties.yml
vendored
|
@ -1,11 +1 @@
|
|||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
|
||||
# This model initially had no columns defined. If you add columns to the
|
||||
# model remove the "{}" from the fixture names and add the columns immediately
|
||||
# below each fixture, per the syntax in the comments below
|
||||
#
|
||||
one: {}
|
||||
# column: value
|
||||
#
|
||||
two: {}
|
||||
# column: value
|
||||
|
|
10
test/fixtures/account/vehicles.yml
vendored
10
test/fixtures/account/vehicles.yml
vendored
|
@ -1,11 +1 @@
|
|||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
|
||||
# This model initially had no columns defined. If you add columns to the
|
||||
# model remove the "{}" from the fixture names and add the columns immediately
|
||||
# below each fixture, per the syntax in the comments below
|
||||
#
|
||||
one: {}
|
||||
# column: value
|
||||
#
|
||||
two: {}
|
||||
# column: value
|
||||
|
|
20
test/fixtures/account_balances.yml
vendored
20
test/fixtures/account_balances.yml
vendored
|
@ -1,13 +1,13 @@
|
|||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
|
||||
one:
|
||||
account: dylan_checking
|
||||
date: 2024-02-12
|
||||
balance: 9.99
|
||||
currency: MyString
|
||||
# one:
|
||||
# account: generic
|
||||
# date: 2024-02-12
|
||||
# balance: 9.99
|
||||
# currency: MyString
|
||||
|
||||
two:
|
||||
account: richards_savings
|
||||
date: 2024-02-12
|
||||
balance: 9.99
|
||||
currency: MyString
|
||||
# two:
|
||||
# account: generic
|
||||
# date: 2024-02-13
|
||||
# balance: 9.99
|
||||
# currency: MyString
|
||||
|
|
29
test/fixtures/accounts.yml
vendored
29
test/fixtures/accounts.yml
vendored
|
@ -1,14 +1,23 @@
|
|||
dylan_checking:
|
||||
# No transactions, no valuations, just a generic account
|
||||
generic:
|
||||
family: dylan_family
|
||||
name: Bob's Checking
|
||||
original_balance: 1200
|
||||
name: No history, generic account
|
||||
balance: 1200
|
||||
|
||||
dylan_roth:
|
||||
# Account with only valuations
|
||||
collectible:
|
||||
family: dylan_family
|
||||
name: Bob's Roth IRA
|
||||
original_balance: 1200
|
||||
name: Collectible Account
|
||||
balance: 500
|
||||
|
||||
richards_savings:
|
||||
family: richards_family
|
||||
name: Keef's HYSA
|
||||
original_balance: 1500
|
||||
# Account with only transactions
|
||||
checking:
|
||||
family: dylan_family
|
||||
name: Checking Account
|
||||
balance: 5000
|
||||
|
||||
# Account with both transactions and valuations
|
||||
savings_with_valuation_overrides:
|
||||
family: dylan_family
|
||||
name: Savings account with valuation overrides
|
||||
balance: 20000
|
||||
|
|
20
test/fixtures/exchange_rates.yml
vendored
20
test/fixtures/exchange_rates.yml
vendored
|
@ -1,13 +1,13 @@
|
|||
# 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
|
||||
# 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
|
||||
# two:
|
||||
# base_currency: two
|
||||
# converted_currency: two
|
||||
# rate: 9.99
|
||||
# date: 2024-02-09
|
||||
|
|
5
test/fixtures/families.yml
vendored
5
test/fixtures/families.yml
vendored
|
@ -1,7 +1,2 @@
|
|||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
|
||||
dylan_family:
|
||||
name: The Dylan Family
|
||||
|
||||
richards_family:
|
||||
name: The Richards Family
|
||||
|
|
66
test/fixtures/transactions.yml
vendored
66
test/fixtures/transactions.yml
vendored
|
@ -1,15 +1,55 @@
|
|||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
# Checking account transactions
|
||||
checking_one:
|
||||
name: Starbucks
|
||||
date: <%= 5.days.ago.to_date %>
|
||||
amount: 10
|
||||
account: checking
|
||||
|
||||
one:
|
||||
name: MyString
|
||||
date: 2024-02-23
|
||||
amount: 9.99
|
||||
currency: MyString
|
||||
account: dylan_checking
|
||||
checking_two:
|
||||
name: Chipotle
|
||||
date: <%= 12.days.ago.to_date %>
|
||||
amount: 30
|
||||
account: checking
|
||||
|
||||
two:
|
||||
name: MyString
|
||||
date: 2024-02-20
|
||||
amount: 9.99
|
||||
currency: MyString
|
||||
account: dylan_checking
|
||||
checking_three:
|
||||
name: Amazon
|
||||
date: <%= 15.days.ago.to_date %>
|
||||
amount: 20
|
||||
account: checking
|
||||
|
||||
checking_four:
|
||||
name: Paycheck
|
||||
date: <%= 22.days.ago.to_date %>
|
||||
amount: -1075
|
||||
account: checking
|
||||
|
||||
checking_five:
|
||||
name: Netflix
|
||||
date: <%= 30.days.ago.to_date %>
|
||||
amount: 15
|
||||
account: checking
|
||||
|
||||
# Savings account that has these transactions and valuation overrides
|
||||
savings_one:
|
||||
name: Interest Received
|
||||
date: <%= 5.days.ago.to_date %>
|
||||
amount: -200
|
||||
account: savings_with_valuation_overrides
|
||||
|
||||
savings_two:
|
||||
name: Check Deposit
|
||||
date: <%= 12.days.ago.to_date %>
|
||||
amount: -50
|
||||
account: savings_with_valuation_overrides
|
||||
|
||||
savings_three:
|
||||
name: Withdrawal
|
||||
date: <%= 18.days.ago.to_date %>
|
||||
amount: 2000
|
||||
account: savings_with_valuation_overrides
|
||||
|
||||
savings_four:
|
||||
name: Check Deposit
|
||||
date: <%= 30.days.ago.to_date %>
|
||||
amount: -500
|
||||
account: savings_with_valuation_overrides
|
||||
|
|
11
test/fixtures/users.yml
vendored
11
test/fixtures/users.yml
vendored
|
@ -1,20 +1,13 @@
|
|||
bob:
|
||||
family_admin:
|
||||
family: dylan_family
|
||||
first_name: Bob
|
||||
last_name: Dylan
|
||||
email: bob@bobdylan.com
|
||||
password_digest: <%= BCrypt::Password.create('password') %>
|
||||
|
||||
jakob:
|
||||
family_member:
|
||||
family: dylan_family
|
||||
first_name: Jakob
|
||||
last_name: Dylan
|
||||
email: jakobdylan@yahoo.com
|
||||
password_digest: <%= BCrypt::Password.create('password') %>
|
||||
|
||||
keith:
|
||||
family: richards_family
|
||||
first_name: Keith
|
||||
last_name: Richards
|
||||
email: keith@rollingstones.com
|
||||
password_digest: <%= BCrypt::Password.create('password') %>
|
||||
|
|
33
test/fixtures/valuations.yml
vendored
33
test/fixtures/valuations.yml
vendored
|
@ -1,11 +1,26 @@
|
|||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
# For collectible account that only has valuations (no transactions)
|
||||
collectible_one:
|
||||
value: 550
|
||||
date: <%= 4.days.ago.to_date %>
|
||||
account: collectible
|
||||
|
||||
one:
|
||||
value: 9.99
|
||||
date: 2024-02-15
|
||||
account: dylan_checking
|
||||
collectible_two:
|
||||
value: 700
|
||||
date: <%= 12.days.ago.to_date %>
|
||||
account: collectible
|
||||
|
||||
two:
|
||||
value: 9.99
|
||||
date: 2024-02-15
|
||||
account: richards_savings
|
||||
collectible_three:
|
||||
value: 400
|
||||
date: <%= 30.days.ago.to_date %>
|
||||
account: collectible
|
||||
|
||||
# For checking account that has valuations and transactions
|
||||
savings_one:
|
||||
value: 20500
|
||||
date: <%= 3.days.ago.to_date %>
|
||||
account: savings_with_valuation_overrides
|
||||
|
||||
savings_two:
|
||||
value: 19500
|
||||
date: <%= 12.days.ago.to_date %>
|
||||
account: savings_with_valuation_overrides
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue