usecase

package
v0.0.0-...-ca54044 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountOutput

type AccountOutput struct {
	Id        string    `json:"id"`
	Balance   float64   `json:"balance"`
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

type CreateAccountInput

type CreateAccountInput struct {
	CustomerId string
}

type CreateAccountOutput

type CreateAccountOutput struct {
	Id        string         `json:"id"`
	Balance   float64        `json:"balance"`
	CreatedAt time.Time      `json:"createdAt"`
	UpdatedAt time.Time      `json:"updatedAt"`
	Customer  CustomerOutput `json:"customer"`
}

type CreateAccountUseCase

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

func NewCreateAccountUseCase

func NewCreateAccountUseCase(accountGateway gateway.AccountGateway, customerGateway gateway.CustomerGateway) *CreateAccountUseCase

func (*CreateAccountUseCase) Execute

type CreateCustomerInput

type CreateCustomerInput struct {
	Name  string `json:"name"`
	Email string `json:"email"`
}

type CreateCustomerOutput

type CreateCustomerOutput struct {
	Id        string    `json:"id"`
	Name      string    `json:"name"`
	Email     string    `json:"email"`
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

type CreateCustomerUseCase

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

func NewCreateCustomerUseCase

func NewCreateCustomerUseCase(customerGateway gateway.CustomerGateway) *CreateCustomerUseCase

func (*CreateCustomerUseCase) Execute

type CreateTransactionInput

type CreateTransactionInput struct {
	From   string  `json:"from"`
	To     string  `json:"to"`
	Amount float64 `json:"amount"`
}

type CreateTransactionOutput

type CreateTransactionOutput struct {
	From   AccountOutput `json:"from"`
	To     AccountOutput `json:"to"`
	Amount float64       `json:"amount"`
}

type CreateTransactionUseCase

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

func NewCreateTransactionUseCase

func NewCreateTransactionUseCase(
	transactionGateway gateway.TransactionGateway,
	accountGateway gateway.AccountGateway,
	eventDispatcher *events.EventDispatcher,
) *CreateTransactionUseCase

func (*CreateTransactionUseCase) Execute

type CustomerOutput

type CustomerOutput struct {
	Id        string    `json:"id"`
	Name      string    `json:"name"`
	Email     string    `json:"email"`
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

type DeleteCustomerInput

type DeleteCustomerInput struct {
	Id string
}

type DeleteCustomerOutput

type DeleteCustomerOutput struct {
	Id        string    `json:"id"`
	Name      string    `json:"name"`
	Email     string    `json:"email"`
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

type DeleteCustomerUseCase

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

func NewDeleteCustomerUseCase

func NewDeleteCustomerUseCase(customerGateway gateway.CustomerGateway) *DeleteCustomerUseCase

func (*DeleteCustomerUseCase) Execute

type DepositInput

type DepositInput struct {
	Id     string
	Amount float64 `json:"amount"`
}

type DepositOutput

type DepositOutput struct {
	Id        string         `json:"id"`
	Balance   float64        `json:"balance"`
	CreatedAt time.Time      `json:"createdAt"`
	UpdatedAt time.Time      `json:"udpatedAt"`
	Customer  CustomerOutput `json:"customer"`
}

type DepositUseCase

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

func NewDepositUseCase

func NewDepositUseCase(accountGateway gateway.AccountGateway) *DepositUseCase

func (*DepositUseCase) Execute

func (uc *DepositUseCase) Execute(input *DepositInput) (*DepositOutput, error)

type FindCustomerInput

type FindCustomerInput struct {
	Id string
}

type FindCustomerOutput

type FindCustomerOutput struct {
	Id        string    `json:"id"`
	Name      string    `json:"name"`
	Email     string    `json:"email"`
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

type FindCustomerUseCase

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

func NewFindCustomerUseCase

func NewFindCustomerUseCase(customerGateway gateway.CustomerGateway) *FindCustomerUseCase

func (*FindCustomerUseCase) Execute

type ListCustomerAccountsInput

type ListCustomerAccountsInput struct {
	CustomerId string
}

type ListCustomerAccountsOutput

type ListCustomerAccountsOutput struct {
	Accounts []*AccountOutput `json:"accounts"`
}

type ListCustomerAccountsUseCase

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

func NewListCustomerAccountsUseCase

func NewListCustomerAccountsUseCase(accountGateway gateway.AccountGateway, customerGateway gateway.CustomerGateway) *ListCustomerAccountsUseCase

func (*ListCustomerAccountsUseCase) Execute

type ListCustomersInput

type ListCustomersInput struct{}

type ListCustomersOutput

type ListCustomersOutput struct {
	Customers []*CustomerOutput `json:"customers"`
}

type ListCustomersUseCase

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

func NewListCustomersUseCase

func NewListCustomersUseCase(customerGateway gateway.CustomerGateway) *ListCustomersUseCase

func (*ListCustomersUseCase) Execute

type MockCustomerGateway

type MockCustomerGateway struct {
	mock.Mock
}

func (*MockCustomerGateway) Create

func (m *MockCustomerGateway) Create(customer *entity.Customer) error

func (*MockCustomerGateway) Delete

func (m *MockCustomerGateway) Delete(customer *entity.Customer) error

func (*MockCustomerGateway) FindAll

func (m *MockCustomerGateway) FindAll() ([]*entity.Customer, error)

func (*MockCustomerGateway) FindById

func (m *MockCustomerGateway) FindById(id string) (*entity.Customer, error)

func (*MockCustomerGateway) Update

func (m *MockCustomerGateway) Update(customer *entity.Customer) error

type ShowAccountBalanceInput

type ShowAccountBalanceInput struct {
	Id string
}

type ShowAccountBalanceOutput

type ShowAccountBalanceOutput struct {
	Id        string    `json:"id"`
	Balance   float64   `json:"balance"`
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

type ShowAccountBalanceUseCase

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

func NewShowAccountBalanceUseCase

func NewShowAccountBalanceUseCase(accountGateway gateway.AccountGateway) *ShowAccountBalanceUseCase

func (*ShowAccountBalanceUseCase) Execute

type UpdateCustomerInput

type UpdateCustomerInput struct {
	Id    string
	Name  string `json:"name"`
	Email string `json:"email"`
}

type UpdateCustomerOutput

type UpdateCustomerOutput struct {
	Id        string    `json:"id"`
	Name      string    `json:"name"`
	Email     string    `json:"email"`
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

type UpdateCustomerUseCase

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

func NewUpdateCustomerUseCase

func NewUpdateCustomerUseCase(customerGateway gateway.CustomerGateway) *UpdateCustomerUseCase

func (*UpdateCustomerUseCase) Execute

type WithdrawInput

type WithdrawInput struct {
	Id     string
	Amount float64 `json:"amount"`
}

type WithdrawOutput

type WithdrawOutput struct {
	Id        string         `json:"id"`
	Balance   float64        `json:"balance"`
	CreatedAt time.Time      `json:"createdAt"`
	UpdatedAt time.Time      `json:"udpatedAt"`
	Customer  CustomerOutput `json:"customer"`
}

type WithdrawUseCase

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

func NewWithdrawUseCase

func NewWithdrawUseCase(accountGateway gateway.AccountGateway) *WithdrawUseCase

func (*WithdrawUseCase) Execute

func (uc *WithdrawUseCase) Execute(input *WithdrawInput) (*WithdrawOutput, error)

Jump to

Keyboard shortcuts

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