Add converter test data
This commit is contained in:
8
tests/converters/cbacsv_v0/cbacsv_transactions.csv
Normal file
8
tests/converters/cbacsv_v0/cbacsv_transactions.csv
Normal file
@@ -0,0 +1,8 @@
|
||||
29/06/2025,"-70.40","AMAZON AU MARKETPLACE SYDNEY",""
|
||||
24/06/2025,"-322.39","APIA BRISBANE QLD",""
|
||||
24/06/2025,"-8.00","MONTHLY FEE",""
|
||||
17/06/2025,"-515.43","BPAYN ERGON ENERGY RETAILBPAY",""
|
||||
15/06/2025,"-1.19","INTNL TRANSACTION FEE",""
|
||||
14/06/2025,"-8.64","INTNL TRANSACTION FEE",""
|
||||
11/06/2025,"-0.86","INTNL TRANSACTION FEE",""
|
||||
04/06/2025,"+2897.86","PAYMENT RECEIVED, THANK YOU",""
|
||||
|
10
tests/converters/cbacsv_v0/config.toml
Normal file
10
tests/converters/cbacsv_v0/config.toml
Normal file
@@ -0,0 +1,10 @@
|
||||
[beanify]
|
||||
default-converter = "cbacsv_v0"
|
||||
rule-interface = "json"
|
||||
|
||||
[rules.json]
|
||||
rulepath = "./rules.json"
|
||||
|
||||
[converters.cbacsv_v0]
|
||||
asset-account = "Liabilities:CBA:CreditCard"
|
||||
asset-currency = "AUD"
|
||||
40
tests/converters/cbacsv_v0/expected.ledger
Normal file
40
tests/converters/cbacsv_v0/expected.ledger
Normal file
@@ -0,0 +1,40 @@
|
||||
2025-06-29 ! "Amazon" "Something from Amazon AU"
|
||||
; AMAZON AU MARKETPLACE SYDNEY
|
||||
Liabilities:CBA:CreditCard -70.4 AUD
|
||||
Expenses:Shopping:Amazon 70.4 AUD
|
||||
|
||||
2025-06-24 * "APIA" "House Insurance"
|
||||
; APIA BRISBANE QLD
|
||||
Liabilities:CBA:CreditCard -322.39 AUD
|
||||
Expenses:House:Insurance 322.39 AUD
|
||||
|
||||
2025-06-24 * "CBA" "Bank Fees"
|
||||
; MONTHLY FEE
|
||||
Liabilities:CBA:CreditCard -8.0 AUD
|
||||
Expenses:Fees 8.0 AUD
|
||||
|
||||
2025-06-17 * "Ergon Energy" "Electricity Bill"
|
||||
; BPAYN ERGON ENERGY RETAILBPAY
|
||||
Liabilities:CBA:CreditCard -515.43 AUD
|
||||
Expenses:House:Electricity 515.43 AUD
|
||||
|
||||
2025-06-15 ! "CBA" "International Transaction Fee"
|
||||
; INTNL TRANSACTION FEE
|
||||
Liabilities:CBA:CreditCard -1.19 AUD
|
||||
Expenses:CBA:Fees 1.19 AUD
|
||||
|
||||
2025-06-14 ! "CBA" "International Transaction Fee"
|
||||
; INTNL TRANSACTION FEE
|
||||
Liabilities:CBA:CreditCard -8.64 AUD
|
||||
Expenses:CBA:Fees 8.64 AUD
|
||||
|
||||
2025-06-11 ! "CBA" "International Transaction Fee"
|
||||
; INTNL TRANSACTION FEE
|
||||
Liabilities:CBA:CreditCard -0.86 AUD
|
||||
Expenses:CBA:Fees 0.86 AUD
|
||||
|
||||
2025-06-04 ! "" "Credit Card Payment"
|
||||
; PAYMENT RECEIVED, THANK YOU
|
||||
Assets:OtherBankAccount -2897.86 AUD
|
||||
Liabilities:CBA:CreditCard 2897.86 AUD
|
||||
|
||||
69
tests/converters/cbacsv_v0/rules.json
Normal file
69
tests/converters/cbacsv_v0/rules.json
Normal file
@@ -0,0 +1,69 @@
|
||||
{
|
||||
"cbacsv_v0": {
|
||||
"rules": [
|
||||
{
|
||||
"record_fields": {
|
||||
"target_account": "AMAZON AU MARKETPLACE"
|
||||
},
|
||||
"transaction_fields": {
|
||||
"payee": "Amazon",
|
||||
"narration": "Something from Amazon AU",
|
||||
"target_account": "Expenses:Shopping:Amazon"
|
||||
}
|
||||
},
|
||||
{
|
||||
"record_fields": {
|
||||
"target_account": "APIA"
|
||||
},
|
||||
"transaction_fields": {
|
||||
"flag": "*",
|
||||
"payee": "APIA",
|
||||
"narration": "House Insurance",
|
||||
"target_account": "Expenses:House:Insurance"
|
||||
}
|
||||
},
|
||||
{
|
||||
"record_fields": {
|
||||
"target_account": "MONTHLY FEE"
|
||||
},
|
||||
"transaction_fields": {
|
||||
"flag": "*",
|
||||
"payee": "CBA",
|
||||
"narration": "Bank Fees",
|
||||
"target_account": "Expenses:Fees"
|
||||
}
|
||||
},
|
||||
{
|
||||
"record_fields": {
|
||||
"target_account": "BPAYN ERGON ENERGY RETAILBPAY"
|
||||
},
|
||||
"transaction_fields": {
|
||||
"flag": "*",
|
||||
"payee": "Ergon Energy",
|
||||
"narration": "Electricity Bill",
|
||||
"target_account": "Expenses:House:Electricity"
|
||||
}
|
||||
},
|
||||
{
|
||||
"record_fields": {
|
||||
"target_account": "INTNL TRANSACTION FEE"
|
||||
},
|
||||
"transaction_fields": {
|
||||
"payee": "CBA",
|
||||
"narration": "International Transaction Fee",
|
||||
"target_account": "Expenses:CBA:Fees"
|
||||
}
|
||||
},
|
||||
{
|
||||
"record_fields": {
|
||||
"source_account": "PAYMENT RECEIVED, THANK YOU",
|
||||
"target_account": "ACCOUNT"
|
||||
},
|
||||
"transaction_fields": {
|
||||
"narration": "Credit Card Payment",
|
||||
"source_account": "Assets:OtherBankAccount"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
7
tests/converters/cbacsv_v0/test.sh
Executable file
7
tests/converters/cbacsv_v0/test.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
COMMAND="beanify --config config.toml cbacsv_transactions.csv --batch"
|
||||
|
||||
if diff <($COMMAND) expected.ledger; then
|
||||
echo "Files match"
|
||||
else
|
||||
echo "Files do not match"
|
||||
fi
|
||||
Reference in New Issue
Block a user