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 NewAccountFromRequest ¶
func NewAccountFromRequest(req dto.AccountRequest) Account
func (Account) CanWithdraw ¶
func (Account) NewAccountResponse ¶
func (a Account) NewAccountResponse() *dto.AccountResponse
type AccountRepository ¶
type AccountRepositoryDB ¶
type AccountRepositoryDB struct {
// contains filtered or unexported fields
}
func NewAccountRepositoryDb ¶
func NewAccountRepositoryDb(client *sqlx.DB) AccountRepositoryDB
func (AccountRepositoryDB) FindBy ¶
func (d AccountRepositoryDB) FindBy(accountId string) (*Account, *errs.AppError)
func (AccountRepositoryDB) Save ¶
func (d AccountRepositoryDB) Save(a Account) (*Account, *errs.AppError)
func (AccountRepositoryDB) SaveTransaction ¶
func (d AccountRepositoryDB) SaveTransaction(t Transaction) (*Transaction, *errs.AppError)
*
- transaction = make an entry in the transaction table + update the balance in the accounts table
type AuthRepository ¶
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) StatusAsText ¶
func (Customer) ToResponse ¶
func (c Customer) ToResponse() dto.CustomerResponse
type CustomerRepository ¶
type CustomerRepositoryDB ¶
type CustomerRepositoryDB struct {
// contains filtered or unexported fields
}
func NewCustomerRepositoryDb ¶
func NewCustomerRepositoryDb(client *sqlx.DB) CustomerRepositoryDB
type CustomerRepositoryStub ¶
type CustomerRepositoryStub struct {
// contains filtered or unexported fields
}
func NewCustomerRepositoryStub ¶
func NewCustomerRepositoryStub() CustomerRepositoryStub
type RemoteAuthRepository ¶
type RemoteAuthRepository struct { }
func NewAuthRepository ¶
func NewAuthRepository() RemoteAuthRepository
func (RemoteAuthRepository) IsAuthorized ¶
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) ToDto ¶
func (t Transaction) ToDto() dto.TransactionResponse
Click to show internal directories.
Click to hide internal directories.