domain

package
v0.0.0-...-70c8d4d Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const WITHDRAWAL = "WITHDRAWAL"

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Id          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 (Account) ToDto

func (a Account) ToDto() dto.AccountResponse

type AccountRepository

type AccountRepository interface {
	Save(Account) (*Account, *errs.AppError)
}

type AccountRepositoryDb

type AccountRepositoryDb struct {
	// contains filtered or unexported fields
}

func NewAccountRepositoryDb

func NewAccountRepositoryDb(dbClient *sqlx.DB) AccountRepositoryDb

func (AccountRepositoryDb) Save

type AuthorizationRepository

type AuthorizationRepository interface {
	IsAuthorized(token string, routeName string, vars map[string]string) bool
}

type Customer

type Customer struct {
	Id          string `db:"customer_id"`
	Name        string
	City        string
	Pincode     string `db:"zipcode"`
	DateofBirth string `db:"date_of_birth"`
	Status      string
}

func (Customer) ToDto

func (c Customer) ToDto() dto.CustomerResponse

type CustomerRepository

type CustomerRepository interface {
	FindAll(string) ([]Customer, *errs.AppError)
	ById(string) (*Customer, *errs.AppError)
}

type CustomerRepositoryDB

type CustomerRepositoryDB struct {
	// contains filtered or unexported fields
}

func NewCustomerRepositoryDb

func NewCustomerRepositoryDb(dbClient *sqlx.DB) CustomerRepositoryDB

func (CustomerRepositoryDB) ById

func (CustomerRepositoryDB) FindAll

func (d CustomerRepositoryDB) FindAll(status string) ([]Customer, *errs.AppError)

type CustomerRepositoryStub

type CustomerRepositoryStub struct {
	Customers []Customer
}

func NewCustomerrepositoryStub

func NewCustomerrepositoryStub() CustomerRepositoryStub

func (CustomerRepositoryStub) ById

func (CustomerRepositoryStub) FindAll

func (s CustomerRepositoryStub) FindAll(_ string) ([]Customer, *errs.AppError)

type QoD

type QoD struct {
	Success struct {
		Total int `json:"total"`
	} `json:"success"`
	Contents struct {
		Quotes []struct {
			Quote  string `json:"quote"`
			Length string `json:"length"`
			Author string `json:"author"`
			Tags   struct {
				Num0 string `json:"0"`
				Num1 string `json:"1"`
				Num2 string `json:"2"`
				Num3 string `json:"3"`
				Num5 string `json:"5"`
			} `json:"tags"`
			Category   string `json:"category"`
			Language   string `json:"language"`
			Date       string `json:"date"`
			Permalink  string `json:"permalink"`
			ID         string `json:"id"`
			Background string `json:"background"`
			Title      string `json:"title"`
		} `json:"quotes"`
	} `json:"contents"`
	Baseurl   string `json:"baseurl"`
	Copyright struct {
		Year int    `json:"year"`
		URL  string `json:"url"`
	} `json:"copyright"`
}

type QoDRepository

type QoDRepository interface {
	GetQod() (QoD, *errs.AppError)
}

type RemoteAuthRepository

type RemoteAuthRepository struct {
}

func NewAuthRepository

func NewAuthRepository() RemoteAuthRepository

func (RemoteAuthRepository) IsAuthorized

func (r RemoteAuthRepository) IsAuthorized(token string, routeName string, vars map[string]string) bool

type RemoteQoDRepository

type RemoteQoDRepository struct {
}

func NewQoDRepository

func NewQoDRepository() RemoteQoDRepository

func (RemoteQoDRepository) GetQod

func (r RemoteQoDRepository) GetQod() (QoD, *errs.AppError)

type Transaction

type Transaction struct {
	Id              string  `db:"transaction_id"`
	AccountId       string  `db:"account_id"`
	Amount          float64 `db:"amount"`
	TransactionType string  `db:"transaction_type"`
	Date            string  `db:"transaction_date"`
}

func (Transaction) IsWithdrawal

func (t Transaction) IsWithdrawal() bool

func (Transaction) ToDto

type TransactionRepository

type TransactionRepository interface {
	Transaction(Transaction) (*Transaction, *errs.AppError)
	FindBy(string) (*Account, *errs.AppError)
}

func NewTransactionRepositoryDb

func NewTransactionRepositoryDb(dbClient *sqlx.DB) TransactionRepository

Jump to

Keyboard shortcuts

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