implemented wallet headers

This commit is contained in:
Fran Jurmanović
2021-06-10 00:13:35 +02:00
parent 636a367d3e
commit 0fc69a0af2
7 changed files with 113 additions and 7 deletions

View File

@@ -1,6 +1,9 @@
package models
import "time"
import (
"encoding/json"
"time"
)
type Transaction struct {
tableName struct{} `pg:"transactions,alias:transactions"`
@@ -15,8 +18,9 @@ type Transaction struct {
}
type NewTransactionBody struct {
WalletID string `json:"walletId" form:"walletId"`
TransactionTypeID string `json:"transactionTypeId" form:"transactionTypeId"`
TransactionDate time.Time `json:"transactionDate" form:"transactionDate"`
Description string `json:"description" form:"description"`
WalletID string `json:"walletId" form:"walletId"`
TransactionTypeID string `json:"transactionTypeId" form:"transactionTypeId"`
TransactionDate time.Time `json:"transactionDate" form:"transactionDate"`
Description string `json:"description" form:"description"`
Amount json.Number `json:"amount" form:"amount"`
}

View File

@@ -12,3 +12,11 @@ type NewWalletBody struct {
Name string `json:"name" form:"name"`
UserID string `json:"userId" form:"userId"`
}
type WalletHeader struct {
WalletId string `json:"walletId"`
CurrentBalance int `json:"currentBalance"`
LastMonth int `json:"lastMonth"`
NextMonth int `json:"nextMonth"`
Currency string `json:"currency"`
}