domain

package
v0.0.0-...-eafcd8e Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2021 License: Apache-2.0 Imports: 7 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 {
	AccountId   string  `db:"account_id"`
	UserId      string  `db:"customer_id"`
	OpeningDate string  `db:"opening_date"`
	AccountType string  `db:"account_type"`
	Amount      float64 `db:"amount"`
	Status      string  `db:"status"`
}

func (Account) ToNewAccountResponseDto

func (a Account) ToNewAccountResponseDto() dto.NewAccountResponse

type AccountRepository

type AccountRepository interface {
	Save(Account) (*Account, *errs.AppError)
	FindBy(string) (*Account, *errs.AppError)
	SaveTransactions(Transaction) (*Transaction, *errs.AppError)
}

type AccountRepositoryDb

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

func NewAccountRepositoryDb

func NewAccountRepositoryDb(dbClient *sqlx.DB) AccountRepositoryDb

func (AccountRepositoryDb) FindBy

func (d AccountRepositoryDb) FindBy(accountId string) (*Account, *errs.AppError)

func (AccountRepositoryDb) Save

func (AccountRepositoryDb) SaveTransactions

func (d AccountRepositoryDb) SaveTransactions(t Transaction) (*Transaction, *errs.AppError)

type Transaction

type Transaction struct {
	TransactionId   string
	AccountId       string
	Amount          float64
	TransactionType string
	TransactionDate string
}

func (Transaction) ToDto

type User

type User struct {
	Id          string `json:"id" xml:"id" db:"customer_id"`
	Name        string `json:"name" xml:"name"`
	City        string `json:"city" xml:"city"`
	Zipcode     string `json:"zipcode" xml:"zipcode"`
	DateOfBirth string `json:"dateofbirth" xml:"dateofbirth" db:"date_of_birth"`
	Status      string `json:"status" xml:"status"`
}

model

func (User) ToDto

func (u User) ToDto() dto.UserResponse

type UserRepository

type UserRepository interface {
	//secondary port
	GetAllUsers() ([]User, *errs.AppError)
	ById(string) (*User, *errs.AppError)
	ByStatus(int) ([]User, *errs.AppError)
}

type UserRepositoryDb

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

func NewUserRepositoryDb

func NewUserRepositoryDb(dbClient *sqlx.DB) UserRepositoryDb

func (UserRepositoryDb) ById

func (d UserRepositoryDb) ById(id string) (*User, *errs.AppError)

func (UserRepositoryDb) ByStatus

func (d UserRepositoryDb) ByStatus(status int) ([]User, *errs.AppError)

func (UserRepositoryDb) GetAllUsers

func (d UserRepositoryDb) GetAllUsers() ([]User, *errs.AppError)

type UserRepositoryStub

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

mock adapter stub is placeholder that simulates the input

func NewUserRepositoryStub

func NewUserRepositoryStub() UserRepositoryStub

func (UserRepositoryStub) GetAllUsers

func (u UserRepositoryStub) GetAllUsers() ([]User, error)

Jump to

Keyboard shortcuts

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