dto

package
v0.0.0-...-ff54fb6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 29, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const DEPOSIT = "deposit"
View Source
const WITHDRAWAL = "withdrawal"

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomerResponse

type CustomerResponse struct {
	Id          string `json:"customer_id"`
	Name        string `json:"name"`
	City        string `json:"city"`
	Zipcode     string `json:"zip_code"`
	DateofBirth string `json:"date_of_birth"`
	Status      string `json:"status"`
}

type NewAccountRequest

type NewAccountRequest struct {
	CustomerId  string  `json:"customer_id"`
	AccountType string  `json:"account_type"`
	Amount      float64 `json:"amount"`
}

func (NewAccountRequest) Validate

func (r NewAccountRequest) Validate() *errs.AppError

type NewAccountResponse

type NewAccountResponse struct {
	AccountId string `json:"account_id"`
}

type TransactionRequest

type TransactionRequest struct {
	AccountId       string  `json:"account_id"`
	Amount          float64 `json:"amount"`
	TransactionType string  `json:"transaction_type"`
	TransactionDate string  `json:"transaction_date"`
	CustomerId      string  `json:"-"`
}

func (TransactionRequest) IsTransactionTypeDeposit

func (r TransactionRequest) IsTransactionTypeDeposit() bool

func (TransactionRequest) IsTransactionTypeWithdrawal

func (r TransactionRequest) IsTransactionTypeWithdrawal() bool

func (TransactionRequest) Validate

func (r TransactionRequest) Validate() *errs.AppError

type TransactionResponse

type TransactionResponse struct {
	TransactionId   string  `json:"transaction_id"`
	AccountId       string  `json:"account_id"`
	Amount          float64 `json:"new_balance"`
	TransactionType string  `json:"transaction_type"`
	TransactionDate string  `json:"transaction_date"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL