repository

package
v0.0.0-...-160a394 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UserRepositoryPayerNotFoundError = errors.New("Payer not found in user repository")
	UserRepositoryPayeeNotFoundError = errors.New("Payee not found in user repository")
)
View Source
var (
	TransactionNotFoundError = errors.New("Transaction not found in transaction repository")
)

Functions

This section is empty.

Types

type TransactionRepository

type TransactionRepository interface {
	Create(transaction entity.Transaction) (*entity.Transaction, error)
	Update(transaction entity.Transaction) error
	GetByID(ID string) (*entity.Transaction, error)
}

type TransactionRepositoryFake

type TransactionRepositoryFake struct {
	FakeCreate  func(transaction entity.Transaction) (*entity.Transaction, error)
	FakeUpdate  func(transaction entity.Transaction) error
	FakeGetByID func(ID string) (*entity.Transaction, error)
}

func NewTransactionRepositoryFake

func NewTransactionRepositoryFake() TransactionRepositoryFake

func (TransactionRepositoryFake) Create

func (TransactionRepositoryFake) GetByID

func (TransactionRepositoryFake) Update

func (r TransactionRepositoryFake) Update(transaction entity.Transaction) error

type UserRepository

type UserRepository interface {
	GetPayerByID(ID string) (*entity.Payer, error)
	GetPayeeByID(ID string) (*entity.Payee, error)
	CreatePayer(payer *entity.Payer) (*entity.Payer, error)
	CreatePayee(payee *entity.Payee) (*entity.Payee, error)
	UpdatePayer(payer *entity.Payer) (*entity.Payer, error)
	UpdatePayee(payee *entity.Payee) (*entity.Payee, error)
}

type UserRepositoryFake

type UserRepositoryFake struct {
	FakeGetPayerByID func(ID string) (*entity.Payer, error)
	FakeGetPayeeByID func(ID string) (*entity.Payee, error)
	FakeCreatePayer  func(payer *entity.Payer) (*entity.Payer, error)
	FakeCreatePayee  func(payee *entity.Payee) (*entity.Payee, error)
	FakeUpdatePayer  func(payer *entity.Payer) (*entity.Payer, error)
	FakeUpdatePayee  func(payee *entity.Payee) (*entity.Payee, error)
}

func NewUserRepositoryFake

func NewUserRepositoryFake() UserRepositoryFake

func (UserRepositoryFake) CreatePayee

func (r UserRepositoryFake) CreatePayee(payee *entity.Payee) (*entity.Payee, error)

func (UserRepositoryFake) CreatePayer

func (r UserRepositoryFake) CreatePayer(payer *entity.Payer) (*entity.Payer, error)

func (UserRepositoryFake) GetPayeeByID

func (r UserRepositoryFake) GetPayeeByID(ID string) (*entity.Payee, error)

func (UserRepositoryFake) GetPayerByID

func (r UserRepositoryFake) GetPayerByID(ID string) (*entity.Payer, error)

func (UserRepositoryFake) UpdatePayee

func (r UserRepositoryFake) UpdatePayee(payee *entity.Payee) (*entity.Payee, error)

func (UserRepositoryFake) UpdatePayer

func (r UserRepositoryFake) UpdatePayer(payer *entity.Payer) (*entity.Payer, error)

Jump to

Keyboard shortcuts

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