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 `gorm:"primaryKey,default:gen_random_uuid()" json:"id"` AccountNumber string `json:"account_number" validate:"required"` TotalBalance float64 `json:"total_balance" validate:"required,number"` AvaliableBalance float64 `json:"avaliable_balance" validate:"required,number"` }
Account Area
func (*Account) GetAccountNumber ¶
func (*Account) GetAvaliableBalance ¶
func (*Account) GetTotalBalance ¶
func (*Account) WithdrawMoney ¶
type BalanceInquiry ¶
type BalanceInquiry struct { Transaction AccountId string `json:"account_id" validate:"required"` }
func NewBalanceInquiry ¶
func NewBalanceInquiry(accountId string, transaction Transaction) *BalanceInquiry
type Card ¶
type Card struct { ID string `gorm:"primaryKey,default:gen_random_uuid()" json:"id"` Number string `json:"number"` CustomerName string `json:"customer_name"` ExpirationMonth int `json:"expiration_month"` ExpirationYear int `json:"expiration_year"` CVV int `json:"cvv"` }
type CashDeposit ¶
type CashDeposit struct { Deposit CashDepositLimit float64 `json:"cash_deposit_limit" validate:"required,number,gte=0"` }
func NewCashDeposit ¶
func NewCashDeposit(cashDepositLimit float64, deposit Deposit) *CashDeposit
type CheckDeposit ¶
type CheckDeposit struct { Deposit CheckNumber string `json:"check_number" validate:"required"` BankCode string `json:"bank_code" validate:"required"` }
func NewCheckDeposit ¶
func NewCheckDeposit(checkNumber, bankCode string, deposit Deposit) *CheckDeposit
type CheckingAccount ¶
type Customer ¶
type Customer struct { ID string `gorm:"primaryKey,default:gen_random_uuid()" json:"id"` Name string `json:"name"` Email string `json:"email"` Phone string `json:"phone"` Status CustomerStatus `json:"status"` AddressID string `json:"address_id"` Address *valueObject.Address `json:"address"` AccountID string `json:"account_id" ` Account IAccount `json:"account" gorm:"-"` CreatedAt time.Time UpdatedAt time.Time DeletedAt gorm.DeletedAt `gorm:"index"` }
func NewCustomer ¶
type CustomerStatus ¶
type CustomerStatus string
const ( ACTIVE CustomerStatus = "Active" BLOCKED CustomerStatus = "Blocked" BANNED CustomerStatus = "Banned" COMPROMISED CustomerStatus = "Compromised" ARCHIVED CustomerStatus = "Archived" CLOSED CustomerStatus = "Closed" UNKNOWN CustomerStatus = "Unknown" )
type Deposit ¶
type Deposit struct { Transaction Amount float64 `json:"amount" validate:"required,number,gt=0"` }
func (*Deposit) CheckAmmount ¶
type IAccount ¶
type IAccount interface { AddMoney(amount float64) error WithdrawMoney(amount float64) error GetAccountNumber() string GetTotalBalance() float64 GetAvaliableBalance() float64 }
func NewCheckingAccount ¶
func NewSavingsAccount ¶
type ITransaction ¶
type ITransaction interface { DefineStatus(status TransactionStatus) CheckStatus() TransactionStatus }
type SavingsAccount ¶
SavingsAccount Area
type Transaction ¶
type Transaction struct { ID string `json:"id" validate:"required" gorm:"primaryKey,default:gen_random_uuid()"` Status TransactionStatus `json:"status" validate:"required"` CreatedAt time.Time `json:"created_at"` }
func (*Transaction) CheckStatus ¶
func (t *Transaction) CheckStatus() TransactionStatus
func (*Transaction) DefineStatus ¶
func (t *Transaction) DefineStatus(status TransactionStatus)
type TransactionStatus ¶
type TransactionStatus string
const ( SUCCESS TransactionStatus = "Success" FAILURE TransactionStatus = "Failure" INTERRUPTED TransactionStatus = "Interrupted" FULL TransactionStatus = "Full" PARTIAL TransactionStatus = "Partial" NONE TransactionStatus = "None" )
type Transfer ¶
type Transfer struct { Transaction FromAccountNumber string `json:"from_account_number" validate:"required"` ToAccountNumber string `json:"to_account_number" validate:"required"` Amount float64 `json:"amount" validate:"required,number,gt=0"` }
func NewTransfer ¶
func NewTransfer(fromAccountNumber, toAccountNumber string, amount float64, transaction Transaction) *Transfer
type Withdrawal ¶
type Withdrawal struct { Transaction Amount float64 `json:"amount" validate:"required,number,gt=0"` }
func NewWithdrawal ¶
func NewWithdrawal(transaction Transaction, amount float64) *Withdrawal
Click to show internal directories.
Click to hide internal directories.