usecase

package
v0.0.0-...-ac81adf Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authorizer

type Authorizer interface {
	Authorized(context.Context, entity.Transfer) (bool, error)
}

Authorizer port

type CreateTransferInput

type CreateTransferInput struct {
	ID        vo.Uuid
	PayerID   vo.Uuid
	PayeeID   vo.Uuid
	Value     vo.Money
	CreatedAt time.Time
}

Input data

type CreateTransferOutput

type CreateTransferOutput struct {
	ID        string `json:"id"`
	PayerID   string `json:"payer"`
	PayeeID   string `json:"payee"`
	Value     int64  `json:"value"`
	CreatedAt string `json:"created_at"`
}

Output data

type CreateTransferPresenter

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

Output port

type CreateTransferUseCase

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

Input port

func NewCreateTransferInteractor

func NewCreateTransferInteractor(
	repoTransferCreator entity.TransferRepositoryCreator,
	repoUserUpdater entity.UserRepositoryUpdater,
	repoUserFinder entity.UserRepositoryFinder,
	authorizer Authorizer,
	notifier Notifier,
	pre CreateTransferPresenter,
) CreateTransferUseCase

NewCreateTransferInteractor creates new createTransferInteractor with its dependencies

type CreateUserDocumentOutput

type CreateUserDocumentOutput struct {
	Type  string `json:"type"`
	Value string `json:"value"`
}

Output data

type CreateUserInput

type CreateUserInput struct {
	ID        vo.Uuid
	FullName  vo.FullName
	Document  vo.Document
	Email     vo.Email
	Password  vo.Password
	Wallet    *vo.Wallet
	Type      vo.TypeUser
	CreatedAt time.Time
}

Input data

type CreateUserOutput

type CreateUserOutput struct {
	ID        string                   `json:"id"`
	FullName  string                   `json:"full_name"`
	Email     string                   `json:"email"`
	Password  string                   `json:"password"`
	Document  CreateUserDocumentOutput `json:"document"`
	Wallet    CreateUserWalletOutput   `json:"wallet"`
	Roles     CreateUserRolesOutput    `json:"roles"`
	Type      string                   `json:"type"`
	CreatedAt string                   `json:"created_at"`
}

Output data

type CreateUserPresenter

type CreateUserPresenter interface {
	Output(entity.User) CreateUserOutput
}

Output port

type CreateUserRolesOutput

type CreateUserRolesOutput struct {
	CanTransfer bool `json:"can_transfer"`
}

Output data

type CreateUserUseCase

type CreateUserUseCase interface {
	Execute(context.Context, CreateUserInput) (CreateUserOutput, error)
}

Input port

func NewCreateUserInteractor

func NewCreateUserInteractor(repo entity.UserRepositoryCreator, pre CreateUserPresenter) CreateUserUseCase

NewCreateUserInteractor creates new createUserInteractor with its dependencies

type CreateUserWalletOutput

type CreateUserWalletOutput struct {
	Currency string `json:"currency"`
	Amount   int64  `json:"amount"`
}

Output data

type FindUserByIDDocumentOutput

type FindUserByIDDocumentOutput struct {
	Type  string `json:"type"`
	Value string `json:"value"`
}

Output data

type FindUserByIDInput

type FindUserByIDInput struct {
	ID vo.Uuid
}

Input data

type FindUserByIDOutput

type FindUserByIDOutput struct {
	ID        string                     `json:"id"`
	FullName  string                     `json:"fullname"`
	Email     string                     `json:"email"`
	Document  FindUserByIDDocumentOutput `json:"document"`
	Wallet    FindUserByIDWalletOutput   `json:"wallet"`
	Roles     FindUserByIDRolesOutput    `json:"roles"`
	Type      string                     `json:"type"`
	CreatedAt string                     `json:"created_at"`
}

Output data

type FindUserByIDPresenter

type FindUserByIDPresenter interface {
	Output(entity.User) FindUserByIDOutput
}

Output port

type FindUserByIDRolesOutput

type FindUserByIDRolesOutput struct {
	CanTransfer bool `json:"can_transfer"`
}

Output data

type FindUserByIDUseCase

type FindUserByIDUseCase interface {
	Execute(context.Context, FindUserByIDInput) (FindUserByIDOutput, error)
}

Input port

func NewFindUserByIDInteractor

func NewFindUserByIDInteractor(repo entity.UserRepositoryFinder, pre FindUserByIDPresenter) FindUserByIDUseCase

NewFindUserByIDInteractor creates new findUserByIDInteractor with its dependencies

type FindUserByIDWalletOutput

type FindUserByIDWalletOutput struct {
	Currency string `json:"currency"`
	Amount   int64  `json:"amount"`
}

Output data

type Notifier

type Notifier interface {
	Notify(context.Context, entity.Transfer)
}

Notifier port

Jump to

Keyboard shortcuts

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