accounts

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2022 License: Unlicense Imports: 13 Imported by: 0

Documentation

Overview

Package accounts is a generated GoMock package.

Package accounts is a generated GoMock package.

Index

Constants

View Source
const (
	AccountNumberVariants = "0123456789"
	AccountNumberSize     = 6
)

Variables

View Source
var (
	ErrAccountHolderNotFound = errors.New("no holders found with this document_number")
	ErrAccountNotFound       = errors.New("no accounts found with these filters")
	ErrMultpleAccountsFound  = errors.New("multiple accounts found with these filters")
	ErrAccountInactive       = errors.New("account must be active for this operation")
	ErrAccountUnblcked       = errors.New("account must be blocked for this operation")
)

Functions

This section is empty.

Types

type Account

type Account struct {
	ID             uuid.UUID
	Name           string
	Agency         string
	Number         string
	DocumentNumber string
	HolderID       uuid.UUID
	Status         Status
}

type ListFilter

type ListFilter struct {
	Sort           int
	Page           int
	Size           int
	DocumentNumber string
}

type MockRepository

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

MockRepository is a mock of Repository interface.

func NewMockRepository

func NewMockRepository(ctrl *gomock.Controller) *MockRepository

NewMockRepository creates a new mock instance.

func (*MockRepository) Create

func (m *MockRepository) Create(ctx context.Context, model accountModel) (accountModel, error)

Create mocks base method.

func (*MockRepository) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockRepository) GetByFilter

func (m *MockRepository) GetByFilter(ctx context.Context, filter accountFilter) ([]accountModel, error)

GetByFilter mocks base method.

func (*MockRepository) ListByFilter

func (m *MockRepository) ListByFilter(ctx context.Context, filter ListFilter) (int, []accountModel, error)

ListByFilter mocks base method.

func (*MockRepository) Update

func (m *MockRepository) Update(ctx context.Context, model accountModel) (accountModel, error)

Update mocks base method.

type MockRepositoryMockRecorder

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

MockRepositoryMockRecorder is the mock recorder for MockRepository.

func (*MockRepositoryMockRecorder) Create

func (mr *MockRepositoryMockRecorder) Create(ctx, model interface{}) *gomock.Call

Create indicates an expected call of Create.

func (*MockRepositoryMockRecorder) GetByFilter

func (mr *MockRepositoryMockRecorder) GetByFilter(ctx, filter interface{}) *gomock.Call

GetByFilter indicates an expected call of GetByFilter.

func (*MockRepositoryMockRecorder) ListByFilter

func (mr *MockRepositoryMockRecorder) ListByFilter(ctx, filter interface{}) *gomock.Call

ListByFilter indicates an expected call of ListByFilter.

func (*MockRepositoryMockRecorder) Update

func (mr *MockRepositoryMockRecorder) Update(ctx, model interface{}) *gomock.Call

Update indicates an expected call of Update.

type MockService

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

MockService is a mock of Service interface.

func NewMockService

func NewMockService(ctrl *gomock.Controller) *MockService

NewMockService creates a new mock instance.

func (*MockService) BlockByID

func (m *MockService) BlockByID(ctx context.Context, id uuid.UUID) (Account, error)

BlockByID mocks base method.

func (*MockService) CloseByID

func (m *MockService) CloseByID(ctx context.Context, id uuid.UUID) (Account, error)

CloseByID mocks base method.

func (*MockService) Create

func (m *MockService) Create(ctx context.Context, account Account) (Account, error)

Create mocks base method.

func (*MockService) EXPECT

func (m *MockService) EXPECT() *MockServiceMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockService) GetByID

func (m *MockService) GetByID(ctx context.Context, id uuid.UUID) (Account, error)

GetByID mocks base method.

func (*MockService) List

func (m *MockService) List(ctx context.Context, filter ListFilter) (int, []Account, error)

List mocks base method.

func (*MockService) UnblockByID

func (m *MockService) UnblockByID(ctx context.Context, id uuid.UUID) (Account, error)

UnblockByID mocks base method.

type MockServiceMockRecorder

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

MockServiceMockRecorder is the mock recorder for MockService.

func (*MockServiceMockRecorder) BlockByID

func (mr *MockServiceMockRecorder) BlockByID(ctx, id interface{}) *gomock.Call

BlockByID indicates an expected call of BlockByID.

func (*MockServiceMockRecorder) CloseByID

func (mr *MockServiceMockRecorder) CloseByID(ctx, id interface{}) *gomock.Call

CloseByID indicates an expected call of CloseByID.

func (*MockServiceMockRecorder) Create

func (mr *MockServiceMockRecorder) Create(ctx, account interface{}) *gomock.Call

Create indicates an expected call of Create.

func (*MockServiceMockRecorder) GetByID

func (mr *MockServiceMockRecorder) GetByID(ctx, id interface{}) *gomock.Call

GetByID indicates an expected call of GetByID.

func (*MockServiceMockRecorder) List

func (mr *MockServiceMockRecorder) List(ctx, filter interface{}) *gomock.Call

List indicates an expected call of List.

func (*MockServiceMockRecorder) UnblockByID

func (mr *MockServiceMockRecorder) UnblockByID(ctx, id interface{}) *gomock.Call

UnblockByID indicates an expected call of UnblockByID.

type Repository

type Repository interface {
	Create(ctx context.Context, model accountModel) (accountModel, error)
	Update(ctx context.Context, model accountModel) (accountModel, error)
	GetByFilter(ctx context.Context, filter accountFilter) ([]accountModel, error)
	ListByFilter(ctx context.Context, filter ListFilter) (int, []accountModel, error)
}

func NewRepository

func NewRepository(t tracer.Tracer, db database.Database) Repository

type Service

type Service interface {
	Create(ctx context.Context, account Account) (Account, error)
	BlockByID(ctx context.Context, id uuid.UUID) (Account, error)
	UnblockByID(ctx context.Context, id uuid.UUID) (Account, error)
	CloseByID(ctx context.Context, id uuid.UUID) (Account, error)
	GetByID(ctx context.Context, id uuid.UUID) (Account, error)
	List(ctx context.Context, filter ListFilter) (int, []Account, error)
}

func NewService

func NewService(t tracer.Tracer, r Repository, holderRepository holders.Repository) Service

type Status

type Status string
const (
	ActiveStatus  Status = "ACTIVE"
	BlockedStatus Status = "BLOCKED"
	ClosedStatus  Status = "CLOSED"
)

Jump to

Keyboard shortcuts

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