Refactor
This commit is contained in:
parent
4f592feb02
commit
4df406563d
7
main.go
7
main.go
@ -135,12 +135,17 @@ func handleWebhook(w http.ResponseWriter, r *http.Request) {
|
|||||||
firefly3Transaction.SourceId = Firefy3AccountsConfig["Wallet cash (UAH)"]
|
firefly3Transaction.SourceId = Firefy3AccountsConfig["Wallet cash (UAH)"]
|
||||||
firefly3Transaction.DestinationId = firefly3Transaction.SourceId
|
firefly3Transaction.DestinationId = firefly3Transaction.SourceId
|
||||||
firefly3Transactions = append(firefly3Transactions, firefly3Transaction)
|
firefly3Transactions = append(firefly3Transactions, firefly3Transaction)
|
||||||
} else if slices.Contains([]string{"Банкомат DN00", "Термінал EasyPay", "City24", "Термінал City24"}, transaction.Data.StatementItem.Description) {
|
} else if slices.Contains([]string{"Термінал EasyPay", "City24", "Термінал City24"}, transaction.Data.StatementItem.Description) {
|
||||||
firefly3Transaction.Type_ = &transactionTypeTransfer
|
firefly3Transaction.Type_ = &transactionTypeTransfer
|
||||||
firefly3Transaction.Description = "Transfer between accounts"
|
firefly3Transaction.Description = "Transfer between accounts"
|
||||||
firefly3Transaction.SourceId = Firefy3AccountsConfig["Wallet cash (UAH)"] // test
|
firefly3Transaction.SourceId = Firefy3AccountsConfig["Wallet cash (UAH)"] // test
|
||||||
firefly3Transaction.DestinationId = account.Id // test
|
firefly3Transaction.DestinationId = account.Id // test
|
||||||
firefly3Transactions = append(firefly3Transactions, firefly3Transaction)
|
firefly3Transactions = append(firefly3Transactions, firefly3Transaction)
|
||||||
|
} else if slices.Contains([]string{"Банкомат DN00"}, transaction.Data.StatementItem.Description) {
|
||||||
|
firefly3Transaction.Type_ = &transactionTypeTransfer
|
||||||
|
firefly3Transaction.Description = "Transfer between accounts"
|
||||||
|
firefly3Transaction.DestinationId = Firefy3AccountsConfig["Wallet cash (UAH)"] // test
|
||||||
|
firefly3Transactions = append(firefly3Transactions, firefly3Transaction)
|
||||||
} else {
|
} else {
|
||||||
for _, row := range ShopConfig {
|
for _, row := range ShopConfig {
|
||||||
if slices.Contains(row.Names, transaction.Data.StatementItem.Description) || slices.Contains(row.MCCCodes, transaction.Data.StatementItem.Mcc) {
|
if slices.Contains(row.Names, transaction.Data.StatementItem.Description) || slices.Contains(row.MCCCodes, transaction.Data.StatementItem.Mcc) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user