usecase

package
v0.0.0-...-3ca87c7 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateAccountInput

type CreateAccountInput struct {
	Name    string `json:"name" validate:"required"`
	CPF     string `json:"cpf" validate:"required"`
	Balance int64  `json:"balance" validate:"gt=0,required"`
}

CreateAccountInput input data

type CreateAccountOutput

type CreateAccountOutput struct {
	ID        string  `json:"id"`
	Name      string  `json:"name"`
	CPF       string  `json:"cpf"`
	Balance   float64 `json:"balance"`
	CreatedAt string  `json:"created_at"`
}

CreateAccountOutput output data

type CreateAccountPresenter

type CreateAccountPresenter interface {
	Output(domain.Account) CreateAccountOutput
}

CreateAccountPresenter output port

type CreateAccountUseCase

type CreateAccountUseCase interface {
	Execute(context.Context, CreateAccountInput) (CreateAccountOutput, error)
}

CreateAccountUseCase input port

func NewCreateAccountInteractor

func NewCreateAccountInteractor(
	repo domain.AccountRepository,
	presenter CreateAccountPresenter,
	t time.Duration,
) CreateAccountUseCase

NewCreateAccountInteractor creates new createAccountInteractor with its dependencies

type CreateTransferInput

type CreateTransferInput struct {
	AccountOriginID      string `json:"account_origin_id" validate:"required,uuid4"`
	AccountDestinationID string `json:"account_destination_id" validate:"required,uuid4"`
	Amount               int64  `json:"amount" validate:"gt=0,required"`
}

CreateTransferInput input data

type CreateTransferOutput

type CreateTransferOutput struct {
	ID                   string  `json:"id"`
	AccountOriginID      string  `json:"account_origin_id"`
	AccountDestinationID string  `json:"account_destination_id"`
	Amount               float64 `json:"amount"`
	CreatedAt            string  `json:"created_at"`
}

CreateTransferOutput output data

type CreateTransferPresenter

type CreateTransferPresenter interface {
	Output(domain.Transfer) CreateTransferOutput
}

CreateTransferPresenter output port

type CreateTransferUseCase

type CreateTransferUseCase interface {
	Execute(context.Context, CreateTransferInput) (CreateTransferOutput, error)
}

CreateTransferUseCase input port

func NewCreateTransferInteractor

func NewCreateTransferInteractor(
	transferRepo domain.TransferRepository,
	accountRepo domain.AccountRepository,
	presenter CreateTransferPresenter,
	t time.Duration,
) CreateTransferUseCase

NewCreateTransferInteractor creates new createTransferInteractor with its dependencies

type DeleteAccountBalaceInput

type DeleteAccountBalaceInput struct {
	ID int64 `json:"balance" validate:"gt=0,required"`
}

DeleteAccountBalaceInput input data

type DeleteAccountBalanceOutput

type DeleteAccountBalanceOutput struct {
	Success bool `json:"success"`
}

FindAccountBalanceOutput output data

type DeleteAccountBalancePresenter

type DeleteAccountBalancePresenter interface {
	Output(bool) DeleteAccountBalanceOutput
}

DeleteAccountBalancePresenter output port

type DeleteAccountBalanceUseCase

type DeleteAccountBalanceUseCase interface {
	Execute(context.Context, domain.AccountID) (DeleteAccountBalanceOutput, error)
}

DeleteAccountBalanceUseCase input port

func NewDeleteBalanceAccountInteractor

func NewDeleteBalanceAccountInteractor(
	repo domain.AccountRepository,
	presenter DeleteAccountBalancePresenter,
	t time.Duration,
) DeleteAccountBalanceUseCase

NewDeleteBalanceAccountInteractor creates new deleteBalanceAccountInteractor with its dependencies

type FindAccountBalaceInput

type FindAccountBalaceInput struct {
	ID int64 `json:"balance" validate:"gt=0,required"`
}

FindAccountBalaceInput input data

type FindAccountBalanceOutput

type FindAccountBalanceOutput struct {
	Balance float64 `json:"balance"`
}

FindAccountBalanceOutput output data

type FindAccountBalancePresenter

type FindAccountBalancePresenter interface {
	Output(domain.Money) FindAccountBalanceOutput
}

FindAccountBalancePresenter output port

type FindAccountBalanceUseCase

type FindAccountBalanceUseCase interface {
	Execute(context.Context, domain.AccountID) (FindAccountBalanceOutput, error)
}

FindAccountBalanceUseCase input port

func NewFindBalanceAccountInteractor

func NewFindBalanceAccountInteractor(
	repo domain.AccountRepository,
	presenter FindAccountBalancePresenter,
	t time.Duration,
) FindAccountBalanceUseCase

NewFindBalanceAccountInteractor creates new findBalanceAccountInteractor with its dependencies

type FindAllAccountOutput

type FindAllAccountOutput struct {
	ID        string  `json:"id"`
	Name      string  `json:"name"`
	CPF       string  `json:"cpf"`
	Balance   float64 `json:"balance"`
	CreatedAt string  `json:"created_at"`
}

FindAllAccountOutput outputData swagger:response accountsResponse

type FindAllAccountOutputResponse

type FindAllAccountOutputResponse struct {
	ID        string  `json:"id"`
	Name      string  `json:"name"`
	CPF       string  `json:"cpf"`
	Balance   float64 `json:"balance"`
	CreatedAt string  `json:"created_at"`
}

List of Accounts Response swagger:response accountsResponse

type FindAllAccountPresenter

type FindAllAccountPresenter interface {
	Output([]domain.Account) []FindAllAccountOutput
}

FindAllAccountPresenter output port

type FindAllAccountUseCase

type FindAllAccountUseCase interface {
	Execute(context.Context) ([]FindAllAccountOutput, error)
}

FindAllAccountUseCase input port

func NewFindAllAccountInteractor

func NewFindAllAccountInteractor(
	repo domain.AccountRepository,
	presenter FindAllAccountPresenter,
	t time.Duration,
) FindAllAccountUseCase

NewFindAllAccountInteractor creates new findAllAccountInteractor with its dependencies

type FindAllTransferOutput

type FindAllTransferOutput struct {
	ID                   string  `json:"id"`
	AccountOriginID      string  `json:"account_origin_id"`
	AccountDestinationID string  `json:"account_destination_id"`
	Amount               float64 `json:"amount"`
	CreatedAt            string  `json:"created_at"`
}

FindAllTransferOutput output data

type FindAllTransferPresenter

type FindAllTransferPresenter interface {
	Output([]domain.Transfer) []FindAllTransferOutput
}

FindAllTransferPresenter output port

type FindAllTransferUseCase

type FindAllTransferUseCase interface {
	Execute(context.Context) ([]FindAllTransferOutput, error)
}

FindAllTransferUseCase input port

func NewFindAllTransferInteractor

func NewFindAllTransferInteractor(
	repo domain.TransferRepository,
	presenter FindAllTransferPresenter,
	t time.Duration,
) FindAllTransferUseCase

NewFindAllTransferInteractor creates new findAllTransferInteractor with its dependencies

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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