operation

package
v1.29.0-beta.11 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package operation is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Amount

type Amount struct {
	Amount *float64 `json:"amount"`
	Scale  *float64 `json:"scale"`
}

Amount structure for marshaling/unmarshalling JSON.

func (Amount) IsEmpty

func (a Amount) IsEmpty() bool

IsEmpty method that set empty or nil in fields

type Balance

type Balance struct {
	Available *float64 `json:"available"`
	OnHold    *float64 `json:"onHold"`
	Scale     *float64 `json:"scale"`
}

Balance structure for marshaling/unmarshalling JSON.

func (Balance) IsEmpty

func (b Balance) IsEmpty() bool

IsEmpty method that set empty or nil in fields

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(arg0 context.Context, arg1 *Operation) (*Operation, error)

Create mocks base method.

func (*MockRepository) Delete

func (m *MockRepository) Delete(arg0 context.Context, arg1, arg2, arg3 uuid.UUID) error

Delete mocks base method.

func (*MockRepository) EXPECT

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

func (*MockRepository) Find

func (m *MockRepository) Find(arg0 context.Context, arg1, arg2, arg3, arg4 uuid.UUID) (*Operation, error)

Find mocks base method.

func (*MockRepository) FindAll

func (m *MockRepository) FindAll(arg0 context.Context, arg1, arg2, arg3 uuid.UUID, arg4, arg5 int) ([]*Operation, error)

FindAll mocks base method.

func (*MockRepository) FindAllByAccount

func (m *MockRepository) FindAllByAccount(arg0 context.Context, arg1, arg2, arg3 uuid.UUID, arg4, arg5 int) ([]*Operation, error)

FindAllByAccount mocks base method.

func (*MockRepository) FindAllByPortfolio

func (m *MockRepository) FindAllByPortfolio(arg0 context.Context, arg1, arg2, arg3 uuid.UUID, arg4, arg5 int) ([]*Operation, error)

FindAllByPortfolio mocks base method.

func (*MockRepository) FindByAccount

func (m *MockRepository) FindByAccount(arg0 context.Context, arg1, arg2, arg3, arg4 uuid.UUID) (*Operation, error)

FindByAccount mocks base method.

func (*MockRepository) FindByPortfolio

func (m *MockRepository) FindByPortfolio(arg0 context.Context, arg1, arg2, arg3, arg4 uuid.UUID) (*Operation, error)

FindByPortfolio mocks base method.

func (*MockRepository) ListByIDs

func (m *MockRepository) ListByIDs(arg0 context.Context, arg1, arg2 uuid.UUID, arg3 []uuid.UUID) ([]*Operation, error)

ListByIDs mocks base method.

func (*MockRepository) Update

func (m *MockRepository) Update(arg0 context.Context, arg1, arg2, arg3, arg4 uuid.UUID, arg5 *Operation) (*Operation, 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(arg0, arg1 any) *gomock.Call

Create indicates an expected call of Create.

func (*MockRepositoryMockRecorder) Delete

func (mr *MockRepositoryMockRecorder) Delete(arg0, arg1, arg2, arg3 any) *gomock.Call

Delete indicates an expected call of Delete.

func (*MockRepositoryMockRecorder) Find

func (mr *MockRepositoryMockRecorder) Find(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call

Find indicates an expected call of Find.

func (*MockRepositoryMockRecorder) FindAll

func (mr *MockRepositoryMockRecorder) FindAll(arg0, arg1, arg2, arg3, arg4, arg5 any) *gomock.Call

FindAll indicates an expected call of FindAll.

func (*MockRepositoryMockRecorder) FindAllByAccount

func (mr *MockRepositoryMockRecorder) FindAllByAccount(arg0, arg1, arg2, arg3, arg4, arg5 any) *gomock.Call

FindAllByAccount indicates an expected call of FindAllByAccount.

func (*MockRepositoryMockRecorder) FindAllByPortfolio

func (mr *MockRepositoryMockRecorder) FindAllByPortfolio(arg0, arg1, arg2, arg3, arg4, arg5 any) *gomock.Call

FindAllByPortfolio indicates an expected call of FindAllByPortfolio.

func (*MockRepositoryMockRecorder) FindByAccount

func (mr *MockRepositoryMockRecorder) FindByAccount(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call

FindByAccount indicates an expected call of FindByAccount.

func (*MockRepositoryMockRecorder) FindByPortfolio

func (mr *MockRepositoryMockRecorder) FindByPortfolio(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call

FindByPortfolio indicates an expected call of FindByPortfolio.

func (*MockRepositoryMockRecorder) ListByIDs

func (mr *MockRepositoryMockRecorder) ListByIDs(arg0, arg1, arg2, arg3 any) *gomock.Call

ListByIDs indicates an expected call of ListByIDs.

func (*MockRepositoryMockRecorder) Update

func (mr *MockRepositoryMockRecorder) Update(arg0, arg1, arg2, arg3, arg4, arg5 any) *gomock.Call

Update indicates an expected call of Update.

type Operation

type Operation struct {
	ID              string         `json:"id"`
	TransactionID   string         `json:"transactionId"`
	Description     string         `json:"description"`
	Type            string         `json:"type"`
	AssetCode       string         `json:"assetCode"`
	ChartOfAccounts string         `json:"chartOfAccounts"`
	Amount          Amount         `json:"amount"`
	Balance         Balance        `json:"balance"`
	BalanceAfter    Balance        `json:"balanceAfter"`
	Status          Status         `json:"status"`
	AccountID       string         `json:"accountId"`
	AccountAlias    string         `json:"accountAlias"`
	PortfolioID     *string        `json:"portfolioId"`
	OrganizationID  string         `json:"organizationId"`
	LedgerID        string         `json:"ledgerId"`
	CreatedAt       time.Time      `json:"createdAt"`
	UpdatedAt       time.Time      `json:"updatedAt"`
	DeletedAt       *time.Time     `json:"deletedAt"`
	Metadata        map[string]any `json:"metadata"`
}

Operation is a struct designed to encapsulate response payload data.

type OperationPostgreSQLModel

type OperationPostgreSQLModel struct {
	ID                    string
	TransactionID         string
	Description           string
	Type                  string
	AssetCode             string
	Amount                *float64
	AmountScale           *float64
	AvailableBalance      *float64
	BalanceScale          *float64
	OnHoldBalance         *float64
	AvailableBalanceAfter *float64
	OnHoldBalanceAfter    *float64
	BalanceScaleAfter     *float64
	Status                string
	StatusDescription     *string
	AccountID             string
	AccountAlias          string
	PortfolioID           *string
	ChartOfAccounts       string
	OrganizationID        string
	LedgerID              string
	CreatedAt             time.Time
	UpdatedAt             time.Time
	DeletedAt             sql.NullTime
	Metadata              map[string]any
}

OperationPostgreSQLModel represents the entity OperationPostgreSQLModel into SQL context in Database

func (*OperationPostgreSQLModel) FromEntity

func (t *OperationPostgreSQLModel) FromEntity(operation *Operation)

FromEntity converts an entity Operation to OperationPostgreSQLModel

func (*OperationPostgreSQLModel) ToEntity

func (t *OperationPostgreSQLModel) ToEntity() *Operation

ToEntity converts an OperationPostgreSQLModel to entity Operation

type OperationPostgreSQLRepository

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

OperationPostgreSQLRepository is a Postgresql-specific implementation of the OperationRepository.

func NewOperationPostgreSQLRepository

func NewOperationPostgreSQLRepository(pc *mpostgres.PostgresConnection) *OperationPostgreSQLRepository

NewOperationPostgreSQLRepository returns a new instance of OperationPostgreSQLRepository using the given Postgres connection.

func (*OperationPostgreSQLRepository) Create

func (r *OperationPostgreSQLRepository) Create(ctx context.Context, operation *Operation) (*Operation, error)

Create a new Operation entity into Postgresql and returns it.

func (*OperationPostgreSQLRepository) Delete

func (r *OperationPostgreSQLRepository) Delete(ctx context.Context, organizationID, ledgerID, id uuid.UUID) error

Delete removes a Operation entity from the database using the provided IDs.

func (*OperationPostgreSQLRepository) Find

func (r *OperationPostgreSQLRepository) Find(ctx context.Context, organizationID, ledgerID, transactionID, id uuid.UUID) (*Operation, error)

Find retrieves a Operation entity from the database using the provided ID.

func (*OperationPostgreSQLRepository) FindAll

func (r *OperationPostgreSQLRepository) FindAll(ctx context.Context, organizationID, ledgerID, transactionID uuid.UUID, limit, page int) ([]*Operation, error)

FindAll retrieves Operations entities from the database.

func (*OperationPostgreSQLRepository) FindAllByAccount

func (r *OperationPostgreSQLRepository) FindAllByAccount(ctx context.Context, organizationID, ledgerID, accountID uuid.UUID, limit, page int) ([]*Operation, error)

FindAllByAccount retrieves Operations entities from the database using the provided account ID.

func (*OperationPostgreSQLRepository) FindAllByPortfolio

func (r *OperationPostgreSQLRepository) FindAllByPortfolio(ctx context.Context, organizationID, ledgerID, portfolioID uuid.UUID, limit, page int) ([]*Operation, error)

FindAllByPortfolio retrieves Operations entities from the database using the provided portfolio ID.

func (*OperationPostgreSQLRepository) FindByAccount

func (r *OperationPostgreSQLRepository) FindByAccount(ctx context.Context, organizationID, ledgerID, accountID, id uuid.UUID) (*Operation, error)

FindByAccount retrieves a Operation entity from the database using the provided account ID.

func (*OperationPostgreSQLRepository) FindByPortfolio

func (r *OperationPostgreSQLRepository) FindByPortfolio(ctx context.Context, organizationID, ledgerID, portfolioID, id uuid.UUID) (*Operation, error)

FindByPortfolio retrieves a Operation entity from the database using the provided portfolio ID.

func (*OperationPostgreSQLRepository) ListByIDs

func (r *OperationPostgreSQLRepository) ListByIDs(ctx context.Context, organizationID, ledgerID uuid.UUID, ids []uuid.UUID) ([]*Operation, error)

ListByIDs retrieves Operation entities from the database using the provided IDs.

func (*OperationPostgreSQLRepository) Update

func (r *OperationPostgreSQLRepository) Update(ctx context.Context, organizationID, ledgerID, transactionID, id uuid.UUID, operation *Operation) (*Operation, error)

Update a Operation entity into Postgresql and returns the Operation updated.

type Repository

type Repository interface {
	Create(ctx context.Context, operation *Operation) (*Operation, error)
	FindAll(ctx context.Context, organizationID, ledgerID, transactionID uuid.UUID, limit, page int) ([]*Operation, error)
	FindAllByAccount(ctx context.Context, organizationID, ledgerID, accountID uuid.UUID, limit, page int) ([]*Operation, error)
	FindAllByPortfolio(ctx context.Context, organizationID, ledgerID, portfolioID uuid.UUID, limit, page int) ([]*Operation, error)
	Find(ctx context.Context, organizationID, ledgerID, transactionID, id uuid.UUID) (*Operation, error)
	FindByAccount(ctx context.Context, organizationID, ledgerID, accountID, id uuid.UUID) (*Operation, error)
	FindByPortfolio(ctx context.Context, organizationID, ledgerID, portfolioID, id uuid.UUID) (*Operation, error)
	ListByIDs(ctx context.Context, organizationID, ledgerID uuid.UUID, ids []uuid.UUID) ([]*Operation, error)
	Update(ctx context.Context, organizationID, ledgerID, transactionID, id uuid.UUID, operation *Operation) (*Operation, error)
	Delete(ctx context.Context, organizationID, ledgerID, id uuid.UUID) error
}

Repository provides an interface for operations related to operation template entities.

type Status

type Status struct {
	Code        string  `json:"code" validate:"max=100"`
	Description *string `json:"description" validate:"omitempty,max=256"`
}

Status structure for marshaling/unmarshalling JSON.

func (Status) IsEmpty

func (s Status) IsEmpty() bool

IsEmpty method that set empty or nil in fields

type UpdateOperationInput

type UpdateOperationInput struct {
	Description string         `json:"description" validate:"max=256"`
	Metadata    map[string]any `json:"metadata,omitempty"`
}

UpdateOperationInput is a struct design to encapsulate payload data.

Jump to

Keyboard shortcuts

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