From fb74264f679721b4ccaf28502af6fd5e885a4b71 Mon Sep 17 00:00:00 2001 From: stuzer05 Date: Tue, 26 Mar 2024 17:29:09 +0200 Subject: [PATCH] Add MCC codes --- main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index 6057d1f..17f91b2 100644 --- a/main.go +++ b/main.go @@ -127,13 +127,13 @@ func handleWebhook(w http.ResponseWriter, r *http.Request) { firefly3Transaction.Type_ = &transactionTypeTransfer firefly3Transaction.Description = "Transfer between accounts" firefly3Transaction.DestinationId = "1" - } else if slices.Contains([]string{"АТБ", "Велмарт", "Novus", "Glovo", "zakaz.ua", "Мегамаркет"}, transaction.Data.StatementItem.Description) { + } else if slices.Contains([]int{5411, 5499, 5451, 5422, 5412, 5921}, transaction.Data.StatementItem.Mcc) || slices.Contains([]string{"АТБ", "Велмарт", "Novus", "Glovo", "zakaz.ua", "Мегамаркет", "Сільпо"}, transaction.Data.StatementItem.Description) { firefly3Transaction.Description = "Groceries" - } else if slices.Contains([]string{"Аптека Доброго Дня", "Аптека оптових цін", "Аптека Копійка", "Аптека Гала", "Аптека АНЦ", "APTEKA 7"}, transaction.Data.StatementItem.Description) { + } else if slices.Contains([]string{"Аптека Доброго Дня", "Аптека оптових цін", "Аптека Копійка", "Аптека Гала", "Аптека АНЦ", "APTEKA 7", "vidshkod ekv apt12"}, transaction.Data.StatementItem.Description) { firefly3Transaction.Description = "Medications" - } else if slices.Contains([]string{"Київ Цифровий", "Київпастранс"}, transaction.Data.StatementItem.Description) { + } else if slices.Contains([]int{4131, 4111, 4112}, transaction.Data.StatementItem.Mcc) || slices.Contains([]string{"Київ Цифровий", "Київпастранс"}, transaction.Data.StatementItem.Description) { firefly3Transaction.Description = "Public transport" - } else if slices.Contains([]string{"McDonald's"}, transaction.Data.StatementItem.Description) { + } else if slices.Contains([]string{"McDonald’s"}, transaction.Data.StatementItem.Description) { firefly3Transaction.Description = "McDonalds" } else if slices.Contains([]string{"LeoCafe"}, transaction.Data.StatementItem.Description) { firefly3Transaction.Description = "Cafe"