mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-05 05:25:24 +02:00
CSV Imports Overhaul (Transactions, Trades, Accounts, and Mint import support) (#1209)
* Remove stale 1.0 import logic and model * Fresh start * Checkpoint before removing nav * First working prototype * Add trade, account, and mint import flows * Basic working version with tests * System tests for each import type * Clean up mappings flow * Clean up PR, refactor stale code, tests * Add back row validations * Row validations * Fix import job test * Fix import navigation * Fix mint import configuration form * Currency preset for new accounts
This commit is contained in:
parent
23786b444a
commit
398b246965
103 changed files with 2420 additions and 1689 deletions
5
test/fixtures/files/imports/accounts.csv
vendored
Normal file
5
test/fixtures/files/imports/accounts.csv
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
type,name,amount,currency
|
||||
Checking,Main Checking Account,5000.00,USD
|
||||
Savings,Emergency Fund,10000.00,USD
|
||||
Credit Card,Rewards Credit Card,-1500.00,USD
|
||||
Investment,Retirement Portfolio,75000.00,USD
|
|
3
test/fixtures/files/imports/invalid.csv
vendored
Normal file
3
test/fixtures/files/imports/invalid.csv
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
name,age
|
||||
"John Doe,23
|
||||
"Jane Doe",25
|
Can't render this file because it contains an unexpected character in line 3 and column 1.
|
11
test/fixtures/files/imports/mint.csv
vendored
Normal file
11
test/fixtures/files/imports/mint.csv
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
Date,Description,Original Description,Amount,Transaction Type,Category,Account Name,Labels,Notes
|
||||
05/01/2023,Grocery Store,SAFEWAY #1234,78.32,debit,Groceries,Checking Account,,
|
||||
05/02/2023,Gas Station,SHELL OIL 57442893,-45.67,credit,Gas & Fuel,Credit Card,,
|
||||
05/03/2023,Monthly Rent,AUTOPAY MORTGAGE,1500.00,debit,Mortgage & Rent,Checking Account,,
|
||||
05/04/2023,Paycheck,ACME CORP PAYROLL,-2500.00,credit,Paycheck,Checking Account,Income,
|
||||
05/05/2023,Restaurant,CHIPOTLE MEX GRILL,15.75,debit,Restaurants,Credit Card,,
|
||||
05/06/2023,Online Shopping,AMAZON.COM,32.99,debit,Shopping,Credit Card,,
|
||||
05/07/2023,Utility Bill,CITY POWER & LIGHT,89.50,debit,Utilities,Checking Account,,
|
||||
05/08/2023,Coffee Shop,STARBUCKS,4.25,debit,Coffee Shops,Credit Card,,
|
||||
05/09/2023,Gym Membership,FITNESS WORLD,49.99,debit,Gym,Checking Account,Health,Monthly membership
|
||||
05/10/2023,Movie Theater,AMC THEATERS #123,24.50,debit,Movies & DVDs,Credit Card,Entertainment,
|
|
11
test/fixtures/files/imports/trades.csv
vendored
Normal file
11
test/fixtures/files/imports/trades.csv
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
date,ticker,qty,price,amount,account,name
|
||||
2023-01-15,AAPL,10,150.25,1502.50,Brokerage Account,Buy Apple Inc
|
||||
2023-02-03,GOOGL,5,2100.75,10503.75,Retirement Account,Buy Alphabet Inc
|
||||
2023-03-10,MSFT,15,245.50,3682.50,Brokerage Account,Buy Microsoft Corp
|
||||
2023-04-05,AMZN,8,3200.00,25600.00,Brokerage Account,Buy Amazon.com Inc
|
||||
2023-05-20,TSLA,20,180.75,3615.00,Retirement Account,Buy Tesla Inc
|
||||
2023-06-15,AAPL,-5,170.50,-852.50,Brokerage Account,Sell Apple Inc
|
||||
2023-07-02,GOOGL,-2,2250.00,-4500.00,Retirement Account,Sell Alphabet Inc
|
||||
2023-08-18,NVDA,12,450.25,5403.00,Brokerage Account,Buy NVIDIA Corp
|
||||
2023-09-07,MSFT,-7,300.75,-2105.25,Brokerage Account,Sell Microsoft Corp
|
||||
2023-10-01,META,25,310.50,7762.50,Retirement Account,Buy Meta Platforms Inc
|
|
10
test/fixtures/files/imports/transactions.csv
vendored
Normal file
10
test/fixtures/files/imports/transactions.csv
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
Date,Name,Amount,Category,Tags,Account,Notes
|
||||
2023-05-01,Grocery Store,-89.75,Food,Groceries,Checking Account,Weekly grocery shopping
|
||||
2023-05-03,Electric Company,-120.50,Utilities,Bills|Home,Credit Card,Monthly electricity bill
|
||||
2023-05-05,Coffee Shop,-4.25,Food,Coffee|Work,Debit Card,Morning coffee
|
||||
2023-05-07,Gas Station,-45.00,Transportation,Car|Fuel,Credit Card,Fill up car tank
|
||||
2023-05-10,Online Retailer,-79.99,Shopping,Clothing,Credit Card,New shoes purchase
|
||||
2023-05-12,Restaurant,-65.30,Food,Dining Out|Date Night,Checking Account,Dinner with partner
|
||||
2023-05-15,Mobile Phone Provider,-55.00,Utilities,Bills|Communication,Debit Card,Monthly phone bill
|
||||
2023-05-18,Movie Theater,-24.00,Entertainment,Movies,Credit Card,Weekend movie night
|
||||
2023-05-20,Pharmacy,-32.50,Health,Medicine,Debit Card,Prescription refill
|
|
6
test/fixtures/import/mappings.yml
vendored
Normal file
6
test/fixtures/import/mappings.yml
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
one:
|
||||
import: transaction
|
||||
key: Food
|
||||
type: Import::CategoryMapping
|
||||
mappable: food_and_drink
|
||||
mappable_type: Category
|
5
test/fixtures/import/rows.yml
vendored
Normal file
5
test/fixtures/import/rows.yml
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
one:
|
||||
import: transaction
|
||||
date: 01/01/2024
|
||||
amount: 100
|
||||
currency: USD
|
23
test/fixtures/imports.yml
vendored
23
test/fixtures/imports.yml
vendored
|
@ -1,20 +1,3 @@
|
|||
empty_import:
|
||||
account: depository
|
||||
created_at: <%= 1.minute.ago %>
|
||||
|
||||
completed_import:
|
||||
account: depository
|
||||
column_mappings:
|
||||
date: date
|
||||
name: name
|
||||
category: category
|
||||
amount: amount
|
||||
raw_file_str: |
|
||||
date,name,category,tags,amount
|
||||
2024-01-01,Starbucks drink,Food & Drink,Test Tag,-20
|
||||
normalized_csv_str: |
|
||||
date,name,category,tags,amount
|
||||
2024-01-01,Starbucks drink,Food & Drink,Test Tag,-20
|
||||
created_at: <%= 2.days.ago %>
|
||||
|
||||
|
||||
transaction:
|
||||
family: dylan_family
|
||||
type: TransactionImport
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue