diff --git a/ledger/update.jq b/ledger/update.jq index 368e4b4..6203270 100644 --- a/ledger/update.jq +++ b/ledger/update.jq @@ -16,6 +16,7 @@ def categorize_transaction: elif test("CHICK-FIL-A|GEMELLIS\\s+ITALIAN|CHIPOTLE|SHEETZ|KUNG\\s+FU\\s+TEA") then "Expenses:Food:Restaurants" elif test("GRUBHUB|DD\\s+\\*DOORDASH") then "Expenses:Food:Delivery" elif test("MARKET@WORK") then "Expenses:Food:Snacks" + elif test("Interest earned") then "Income:Interest" else "UNKNOWN" end; def format_transactions: @@ -35,9 +36,10 @@ def format_transactions: def rename_accounts: map(.name |= ( - if (.| startswith("Adv Plus Banking")) then "Checking" - elif (.| startswith("Unlimited Cash Rewards Visa Signature")) then "Credit" - elif (.| startswith("Amazon Prime Rewards Visa Signature")) then "Amazon" + if (.| contains("7778")) then "Checking" + elif (.| contains("5809")) then "Credit" + elif (.| contains("3116")) then "Amazon" + elif (.| contains("3013")) then "Savings" end)); .accounts | rename_accounts | format_transactions[]