usecase

package
v0.0.0-...-2ff9a84 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateDTO

func ValidateDTO(v any) error

Types

type AccountOutput

type AccountOutput struct {
	ID           uuid.UUID `json:"account_id"`
	AccountType  string    `json:"account_type"`
	CustomerName string    `json:"customer_name"`
	Email        string    `json:"email"`
	Balance      string    `json:"balance"`
	Status       string    `json:"status"`
}

type AccountUseCase

type AccountUseCase interface {
	ExecuteNewAccount(ctx context.Context, input NewAccountInput) (uuid.UUID, error)
	ExecuteDeposit(ctx context.Context, accountID uuid.UUID, value uint64) (uuid.UUID, error)
	ExecuteTransfer(ctx context.Context, payer, payee uuid.UUID, value uint64) (uuid.UUID, error)
	FindByID(ctx context.Context, accountID uuid.UUID) (*AccountOutput, error)
	FindAll(ctx context.Context) ([]*AccountOutput, error)
	ExecuteSnapshotTransaction(ctx context.Context, accountID uuid.UUID)
	ExecuteLogin(ctx context.Context, email, password string) (*entity.ResumeAccount, error)
}

type NewAccountInput

type NewAccountInput struct {
	Name           string `json:"customer_name" validate:"required"`
	Email          string `json:"email" validate:"required"`
	Password       string `json:"password" validate:"required"`
	Type           string `json:"account_type" validate:"required"`
	DocumentNumber string `json:"document_number" validate:"required"`
	PhoneNumber    string `json:"phone_number" validate:"required"`
}

Jump to

Keyboard shortcuts

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