Add converter test data

This commit is contained in:
2026-01-05 19:40:26 +10:00
parent 3b37c62f17
commit 6ad7c0362a
10 changed files with 279 additions and 0 deletions

View 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",""
1 29/06/2025 -70.40 AMAZON AU MARKETPLACE SYDNEY
2 24/06/2025 -322.39 APIA BRISBANE QLD
3 24/06/2025 -8.00 MONTHLY FEE
4 17/06/2025 -515.43 BPAYN ERGON ENERGY RETAILBPAY
5 15/06/2025 -1.19 INTNL TRANSACTION FEE
6 14/06/2025 -8.64 INTNL TRANSACTION FEE
7 11/06/2025 -0.86 INTNL TRANSACTION FEE
8 04/06/2025 +2897.86 PAYMENT RECEIVED, THANK YOU

View 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"

View 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

View 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"
}
}
]
}
}

View 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

View File

@@ -0,0 +1,10 @@
[beanify]
default-converter = "wise_v0"
rule-interface = "json"
[rules.json]
rulepath = "./rules.json"
[converters.wise_v0]
asset-account = "Asset:Wise:{currency}"
fee-account = "Expenses:Wise:Fees"

View File

@@ -0,0 +1,48 @@
2024-12-30 * "Foodworks" "Grocery Shop"
Asset:Wise:AUD -7.99 AUD
Expenses:Foodworks 7.99 AUD
2024-12-30 * "Foodworks" "Grocery Shop"
Asset:Wise:AUD -50.89 AUD
Expenses:Foodworks 50.89 AUD
2024-12-29 ! "" ""
Asset:Wise:AUD -4.0 AUD @@ 2.49 USD
Asset:Wise:AUD -0.01 AUD
Expenses:Wise:Fees 0.01 AUD
Expenses:Kindle 2.49 USD
2024-12-29 * "Amazon" "Amazon Prime Subscription"
Asset:Wise:AUD -9.99 AUD
Expenses:AmazonPrime 9.99 AUD
2024-12-29 * "Foodworks" "Grocery Shop"
Asset:Wise:AUD -19.02 AUD
Expenses:Foodworks 19.02 AUD
2024-12-28 ! "Twitch" "Twitch Subscription"
Asset:Wise:AUD -37.76 AUD
Expenses:Twitch 37.76 AUD
2024-12-26 * "Foodworks" "Grocery Shop"
Asset:Wise:AUD -45.63 AUD
Expenses:Foodworks 45.63 AUD
2024-07-12 * "Bossman" "Income from Bossman"
Income:Bossman -211.8 EUR
Asset:Wise:EUR 211.8 EUR
2024-12-26 ! "" "Internal Transfer"
Assets:BankAccount -200.0 AUD
Asset:Wise:AUD 200.0 AUD
2024-12-24 ! "" ""
Asset:Wise:AUD -3.9800000000000004 AUD @@ 2.49 USD
Asset:Wise:AUD -0.01 AUD
Expenses:Wise:Fees 0.01 AUD
Expenses:Kindle 2.49 USD
2024-04-09 ! "" "Internal Transfer"
Assets:BankAccount -110.0 AUD
Asset:Wise:AUD 110.0 AUD

View File

@@ -0,0 +1,67 @@
{
"wise_v0": {
"rules": [
{
"record_fields": {
"target_account": "Amazon Kindle"
},
"transaction_fields": {
"target_account": "Expenses:Kindle"
}
},
{
"record_fields": {
"target_account": "Amazon Prime"
},
"transaction_fields": {
"flag": "*",
"payee": "Amazon",
"narration": "Amazon Prime Subscription",
"target_account": "Expenses:AmazonPrime"
}
},
{
"record_fields": {
"target_account": "Twitch"
},
"transaction_fields": {
"payee": "Twitch",
"narration": "Twitch Subscription",
"target_account": "Expenses:Twitch"
}
},
{
"record_fields": {
"source_account": "Bossman"
},
"transaction_fields": {
"flag": "*",
"payee": "Bossman",
"narration": "Income from Bossman",
"source_account": "Income:Bossman"
}
},
{
"record_fields": {
"source_account": "John Doe",
"target_account": "John Doe"
},
"transaction_fields": {
"narration": "Internal Transfer",
"source_account": "Assets:BankAccount"
}
},
{
"record_fields": {
"target_account": "Foodworks"
},
"transaction_fields": {
"flag": "*",
"payee": "Foodworks",
"narration": "Grocery Shop",
"target_account": "Expenses:Foodworks"
}
}
]
}
}

View File

@@ -0,0 +1,7 @@
COMMAND="beanify --config config.toml wise_transactions.csv --batch"
if diff <($COMMAND) expected.ledger; then
echo "Files match"
else
echo "Files do not match"
fi

View File

@@ -0,0 +1,13 @@
ID,Status,Direction,"Created on","Finished on","Source fee amount","Source fee currency","Target fee amount","Target fee currency","Source name","Source amount (after fees)","Source currency","Target name","Target amount (after fees)","Target currency","Exchange rate",Reference,Batch,"Created by"
"CARD_TRANSACTION-2105714018",COMPLETED,OUT,"2024-12-30 06:33:12","2024-12-30 06:33:12",0.00,AUD,,,"John Doe",7.99,AUD,Foodworks,7.99,AUD,1.0000000000000000,,,"John Doe"
"CARD_TRANSACTION-2105440126",COMPLETED,OUT,"2024-12-30 03:00:51","2024-12-30 03:00:51",0.00,AUD,,,"John Doe",50.89,AUD,Foodworks,50.89,AUD,1.0000000000000000,,,"John Doe"
"CARD_TRANSACTION-2103818034",COMPLETED,OUT,"2024-12-29 13:17:44","2024-12-29 13:17:44",0.01,AUD,,,"John Doe",4.01,AUD,"Amazon Kindle",2.49,USD,0.6216000000000000,,,"John Doe"
"CARD_TRANSACTION-2103000353",COMPLETED,OUT,"2024-12-29 06:48:41","2024-12-29 06:48:41",0.00,AUD,,,"John Doe",9.99,AUD,"Amazon Prime",9.99,AUD,1.0000000000000000,,,"John Doe"
"CARD_TRANSACTION-2102941763",COMPLETED,OUT,"2024-12-29 06:05:29","2024-12-29 06:05:29",0.00,AUD,,,"John Doe",19.02,AUD,Foodworks,19.02,AUD,1.0000000000000000,,,"John Doe"
"CARD_TRANSACTION-2100854593",COMPLETED,OUT,"2024-12-28 13:03:10","2024-12-28 13:03:10",0.00,AUD,,,"John Doe",37.76,AUD,Twitch,37.76,AUD,1.0000000000000000,,,"John Doe"
"CARD_TRANSACTION-2094160498",COMPLETED,OUT,"2024-12-26 06:45:23","2024-12-26 06:45:23",0.00,AUD,,,"John Doe",45.63,AUD,Foodworks,45.63,AUD,1.0000000000000000,,,"John Doe"
TRANSFER-1141557141,COMPLETED,IN,"2024-07-12 11:02:43","2024-07-12 11:02:48",0.00,EUR,,,"Bossman",211.80,EUR,"John Doe",211.8,EUR,1.0,"Work on Leo 10.6 hours at 20/hour",,"John Doe"
TRANSFER-1350829818,COMPLETED,IN,"2024-12-26 04:42:23","2024-12-26 04:44:16",0.00,AUD,,,"John Doe",200.0,AUD,"John Doe",200.0,AUD,1.0,,,"John Doe"
"CARD_TRANSACTION-2089802144",COMPLETED,OUT,"2024-12-24 09:20:07","2024-12-24 09:20:07",0.01,AUD,,,"John Doe",3.99,AUD,"Amazon Kindle",2.49,USD,0.6240500000000000,,,"John Doe"
"CARD_TRANSACTION-2067258210",CANCELLED,OUT,"2024-12-16 15:07:50","2024-12-16 15:07:50",,,,,"John Doe",1.15,AUD,"Amazon Prime",1.15,AUD,1,,,"John Doe"
TRANSFER-1028702430,COMPLETED,IN,"2024-04-09 03:05:48","2024-04-09 03:05:54",0.00,AUD,,,"John Doe",110.0,AUD,"John Doe",110.0,AUD,1.0,AutoCredit,,"John Doe"
1 ID Status Direction Created on Finished on Source fee amount Source fee currency Target fee amount Target fee currency Source name Source amount (after fees) Source currency Target name Target amount (after fees) Target currency Exchange rate Reference Batch Created by
2 CARD_TRANSACTION-2105714018 COMPLETED OUT 2024-12-30 06:33:12 2024-12-30 06:33:12 0.00 AUD John Doe 7.99 AUD Foodworks 7.99 AUD 1.0000000000000000 John Doe
3 CARD_TRANSACTION-2105440126 COMPLETED OUT 2024-12-30 03:00:51 2024-12-30 03:00:51 0.00 AUD John Doe 50.89 AUD Foodworks 50.89 AUD 1.0000000000000000 John Doe
4 CARD_TRANSACTION-2103818034 COMPLETED OUT 2024-12-29 13:17:44 2024-12-29 13:17:44 0.01 AUD John Doe 4.01 AUD Amazon Kindle 2.49 USD 0.6216000000000000 John Doe
5 CARD_TRANSACTION-2103000353 COMPLETED OUT 2024-12-29 06:48:41 2024-12-29 06:48:41 0.00 AUD John Doe 9.99 AUD Amazon Prime 9.99 AUD 1.0000000000000000 John Doe
6 CARD_TRANSACTION-2102941763 COMPLETED OUT 2024-12-29 06:05:29 2024-12-29 06:05:29 0.00 AUD John Doe 19.02 AUD Foodworks 19.02 AUD 1.0000000000000000 John Doe
7 CARD_TRANSACTION-2100854593 COMPLETED OUT 2024-12-28 13:03:10 2024-12-28 13:03:10 0.00 AUD John Doe 37.76 AUD Twitch 37.76 AUD 1.0000000000000000 John Doe
8 CARD_TRANSACTION-2094160498 COMPLETED OUT 2024-12-26 06:45:23 2024-12-26 06:45:23 0.00 AUD John Doe 45.63 AUD Foodworks 45.63 AUD 1.0000000000000000 John Doe
9 TRANSFER-1141557141 COMPLETED IN 2024-07-12 11:02:43 2024-07-12 11:02:48 0.00 EUR Bossman 211.80 EUR John Doe 211.8 EUR 1.0 Work on Leo 10.6 hours at 20/hour John Doe
10 TRANSFER-1350829818 COMPLETED IN 2024-12-26 04:42:23 2024-12-26 04:44:16 0.00 AUD John Doe 200.0 AUD John Doe 200.0 AUD 1.0 John Doe
11 CARD_TRANSACTION-2089802144 COMPLETED OUT 2024-12-24 09:20:07 2024-12-24 09:20:07 0.01 AUD John Doe 3.99 AUD Amazon Kindle 2.49 USD 0.6240500000000000 John Doe
12 CARD_TRANSACTION-2067258210 CANCELLED OUT 2024-12-16 15:07:50 2024-12-16 15:07:50 John Doe 1.15 AUD Amazon Prime 1.15 AUD 1 John Doe
13 TRANSFER-1028702430 COMPLETED IN 2024-04-09 03:05:48 2024-04-09 03:05:54 0.00 AUD John Doe 110.0 AUD John Doe 110.0 AUD 1.0 AutoCredit John Doe