entity

package
v0.0.0-...-ee0ddec Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ID             string `db:"id"`
	DocumentNumber string `db:"document_number"`
}

func (*Account) Validate

func (acc *Account) Validate() error

type OperationType

type OperationType int
const (
	NormalPurchase          OperationType = 1
	PurchaseWithInstallment OperationType = 2
	Withdrawal              OperationType = 3
	CreditVoucher           OperationType = 4
)

func (*OperationType) GetAmount

func (op *OperationType) GetAmount(amount float64) float64

func (*OperationType) IsValid

func (op *OperationType) IsValid() bool

type Transaction

type Transaction struct {
	ID              string  `db:"id"`
	AccountID       string  `db:"account_id"`
	OperationTypeID int     `db:"operation_type_id"`
	Amount          float64 `db:"amount"`
}

func (*Transaction) SetTxnAmount

func (txn *Transaction) SetTxnAmount()

func (*Transaction) Validate

func (txn *Transaction) Validate() error

Jump to

Keyboard shortcuts

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