Documentation
¶
Index ¶
Constants ¶
View Source
const WITHDRAWAL = "withdrawal"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { AccountId string `db:"account_id"` CustomerId string `db:"customer_id"` OpeningDate string `db:"opening_date"` AccountType string `db:"account_type"` Amount float64 `db:"amount"` Status string `db:"status"` }
func NewAccount ¶
func (Account) CanWithdraw ¶
func (*Account) ToResponseDto ¶
func (a *Account) ToResponseDto() dto.NewAccountResponse
type AccountRepository ¶
type AccountRepositoryMysql ¶
type AccountRepositoryMysql struct {
// contains filtered or unexported fields
}
func NewAccountRepositoryMysql ¶
func NewAccountRepositoryMysql(dbClient *sqlx.DB) AccountRepositoryMysql
func (AccountRepositoryMysql) FindBy ¶
func (db AccountRepositoryMysql) FindBy(accountId string) (*Account, *errs.AppError)
func (AccountRepositoryMysql) Save ¶
func (db AccountRepositoryMysql) Save(a Account) (*Account, *errs.AppError)
func (AccountRepositoryMysql) SaveTransaction ¶
func (db AccountRepositoryMysql) SaveTransaction(t Transaction) (*Transaction, *errs.AppError)
type Customer ¶
type Customer struct { Id string `db:"customer_id"` Name string City string Zipcode string DateofBirth string `db:"date_of_birth"` Status string }
func (Customer) ToDto ¶
func (c Customer) ToDto() dto.CustomerResponse
type CustomerRepository ¶
type CustomerRepositoryMysql ¶
type CustomerRepositoryMysql struct {
// contains filtered or unexported fields
}
func NewCustomerRepositoryMysql ¶
func NewCustomerRepositoryMysql(dbClient *sqlx.DB) CustomerRepositoryMysql
type CustomerRepositoryStub ¶
type CustomerRepositoryStub struct {
// contains filtered or unexported fields
}
func NewCustomerRepositoryStub ¶
func NewCustomerRepositoryStub() CustomerRepositoryStub
func (CustomerRepositoryStub) FindAll ¶
func (s CustomerRepositoryStub) FindAll() ([]Customer, error)
type Transaction ¶
type Transaction struct { TransactionId string `db:"transaction_id"` AccountId string `db:"account_id"` Amount float64 `db:"amount"` TransactionType string `db:"transaction_type"` TransactionDate string `db:"transaction_date"` }
func (Transaction) IsWithdrawal ¶
func (t Transaction) IsWithdrawal() bool
func (*Transaction) ToResponseDto ¶
func (t *Transaction) ToResponseDto() dto.TransactionResponse
type TransactionRepository ¶
type TransactionRepository interface { Withdraw(Transaction) (*Transaction, *errs.AppError) Deposit(Transaction) (*Transaction, *errs.AppError) }
Click to show internal directories.
Click to hide internal directories.