Documentation ¶
Index ¶
- type AccessTokenClaims
- type Account
- type Bank
- type CreateAccountReq
- type CreateUserReq
- type CreateUserTransactionReq
- type GetUserTransactionsReq
- type LoginReq
- type LoginResp
- type Transaction
- type TransactionType
- type UpdateUserAccountTransactionsReq
- type UpdateUserTransactionsReq
- type User
- type UserTransactionResp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessTokenClaims ¶
type AccessTokenClaims struct { jwt.StandardClaims Identity *User `json:"identity"` }
type Account ¶
type Account struct { ID int32 `json:"id" db:"id"` Name string `json:"name,omitempty" db:"name"` Bank Bank `json:"bank,omitempty" db:"bank"` UserID int32 `json:"userId,omitempty" db:"user_id"` CreatedAt time.Time `json:"createdAt,omitempty" db:"created_at"` Transactions []Transaction `json:"transactions,omitempty"` }
type CreateAccountReq ¶
type CreateUserReq ¶
type CreateUserTransactionReq ¶
type CreateUserTransactionReq struct { UserID int `json:"userId" validate:"required,numeric,min=1"` AccountID int `json:"accountId" validate:"required,numeric,min=1"` Amount int `json:"amount" validate:"required,numeric,min=1"` TransactionType TransactionType `json:"transactionType" validate:"required,alpha"` }
type GetUserTransactionsReq ¶
type Transaction ¶
type Transaction struct { ID int32 `json:"id" db:"id"` Amount int `json:"amount,omitempty" db:"amount"` TransactionType TransactionType `json:"transactionType,omitempty" db:"transaction_type"` CreatedAt time.Time `json:"createdAt,omitempty" db:"created_at"` }
type TransactionType ¶
type TransactionType string
const ( Deposit TransactionType = "deposit" Withdraw TransactionType = "withdraw" )
func (TransactionType) IsValid ¶
func (tt TransactionType) IsValid() error
type UpdateUserAccountTransactionsReq ¶
type UpdateUserAccountTransactionsReq struct { UserID int `json:"userId" validate:"required,numeric,min=1"` AccountID int `json:"accountId" validate:"required,numeric,min=1"` Amount int `json:"amount" validate:"required,numeric,min=1"` TransactionType TransactionType `json:"transactionType" validate:"required,alpha"` }
type UpdateUserTransactionsReq ¶
type UpdateUserTransactionsReq struct { UserID int `json:"userId" validate:"required,numeric,min=1"` Amount int `json:"amount" validate:"required,numeric,min=1"` TransactionType TransactionType `json:"transactionType" validate:"required,alpha"` }
type UserTransactionResp ¶
type UserTransactionResp struct { UserID int `json:"id" db:"user_id"` AccountID int `json:"accountId" db:"account_id"` Bank string `json:"bank,omitempty" db:"bank"` Amount string `json:"amount,omitempty" db:"amount"` TransactionType TransactionType `json:"transactionType" db:"transaction_type"` CreatedAt time.Time `json:"createdAt,omitempty" db:"transaction_created_at"` }
Click to show internal directories.
Click to hide internal directories.