Add more transactions to handle

This commit is contained in:
Illya Marchenko 2024-03-25 12:13:23 +02:00
parent 5c13135615
commit 87d9fb261b
Signed by: stuzer05
GPG Key ID: A6ABAAA9268F9F4F

27
main.go

@ -209,6 +209,33 @@ func handleWebhook(w http.ResponseWriter, r *http.Request) {
Notes: string(body),
SourceId: account.Id,
})
case "YouTube":
transactionList = append(transactionList, firefly3.TransactionSplitStore{
Type_: &transactionTypeWithdrawal,
Date: time.Now(), // time.Unix(int64(time.Now()), 0)
Amount: strconv.Itoa(transaction.Data.StatementItem.Amount / 100),
Description: "YouTube membership: Latte ASMR",
Notes: string(body),
SourceId: account.Id,
})
case "Київстар +380672463500":
transactionList = append(transactionList, firefly3.TransactionSplitStore{
Type_: &transactionTypeWithdrawal,
Date: time.Now(), // time.Unix(int64(time.Now()), 0)
Amount: strconv.Itoa(transaction.Data.StatementItem.Amount / 100),
Description: "Kyivstar: +380672463500",
Notes: string(body),
SourceId: account.Id,
})
case "Lifecell +380732463500":
transactionList = append(transactionList, firefly3.TransactionSplitStore{
Type_: &transactionTypeWithdrawal,
Date: time.Now(), // time.Unix(int64(time.Now()), 0)
Amount: strconv.Itoa(transaction.Data.StatementItem.Amount / 100),
Description: "Lifecell: +380732463500",
Notes: string(body),
SourceId: account.Id,
})
break
}