diff --git a/api/transactions.go b/api/transactions.go index d8e03da..581589a 100644 --- a/api/transactions.go +++ b/api/transactions.go @@ -79,8 +79,8 @@ type FilteredTransactions struct { CurrentBalance float64 `json:"current_balance"` TxnTimestamp time.Time `json:"txn_timestamp"` Type string `json:"type"` - Receiver string `json:"reciever"` - Sender string `json:"sender"` + Account string `json:"account"` + Merchant string `json:"merchant"` } type TransactionsReturn struct { @@ -105,15 +105,15 @@ func filterTransactions(raw TransactionsResponse, since time.Time) []FilteredTra UUID: t[i].UUID, Amount: t[i].Amount, Type: t[i].Type, - Sender: t[i].FinancialInformationProvider.Name, - Receiver: t[i].Narration, + Merchant: t[i].FinancialInformationProvider.Name, + Account: t[i].Narration, TxnTimestamp: t[i].TxnTimestamp, CurrentBalance: t[i].CurrentBalance, } // Use Fold's F1 classifier if this transaction was classified if t[i].Merchant != nil { - transaction.Receiver = t[i].Merchant.(string) + transaction.Account = t[i].Merchant.(string) } transactions = append(transactions, transaction) diff --git a/cmd/transactions.go b/cmd/transactions.go index 320fdbf..2ad912d 100644 --- a/cmd/transactions.go +++ b/cmd/transactions.go @@ -38,9 +38,9 @@ func printTransactions(t api.FilteredTransactions) { t.TxnTimestamp, t.Amount, t.Type, - t.Sender, + t.Merchant, t.CurrentBalance, - t.Receiver, + t.Account, ) } @@ -50,9 +50,9 @@ func writeToDb(t api.FilteredTransactions) { Timestamp: t.TxnTimestamp, Amount: t.Amount, Type: t.Type, - Sender: t.Sender, + Merchant: t.Merchant, CurrentBalance: t.CurrentBalance, - Receiver: t.Receiver, + Account: t.Account, }) } diff --git a/db/models.go b/db/models.go index 8edb1aa..ccad75c 100644 --- a/db/models.go +++ b/db/models.go @@ -10,6 +10,6 @@ type Transactions struct { CurrentBalance float64 Timestamp time.Time `gorm:"index:sortTimestamp,sort:desc"` Type string - Receiver string - Sender string + Account string + Merchant string }