command

package
v1.10.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UseCase

type UseCase struct {
	// OrganizationRepo provides an abstraction on top of the organization data source.
	OrganizationRepo o.Repository

	// LedgerRepo provides an abstraction on top of the ledger data source.
	LedgerRepo l.Repository

	// ProductRepo provides an abstraction on top of the product data source.
	ProductRepo r.Repository

	// PortfolioRepo provides an abstraction on top of the portfolio data source.
	PortfolioRepo p.Repository

	// AccountRepo provides an abstraction on top of the account data source.
	AccountRepo a.Repository

	// InstrumentRepo provides an abstraction on top of the instrument data source.
	InstrumentRepo i.Repository

	// MetadataRepo provides an abstraction on top of the metadata data source.
	MetadataRepo m.Repository
}

UseCase is a struct that aggregates various repositories for simplified access in use case implementations.

func (*UseCase) CreateAccount

func (uc *UseCase) CreateAccount(ctx context.Context, organizationID, ledgerID, portfolioID string, cai *a.CreateAccountInput) (*a.Account, error)

CreateAccount creates a new account persists data in the repository.

func (*UseCase) CreateInstrument

func (uc *UseCase) CreateInstrument(ctx context.Context, organizationID, ledgerID uuid.UUID, cii *i.CreateInstrumentInput) (*i.Instrument, error)

CreateInstrument creates a new instrument persists data in the repository.

func (*UseCase) CreateLedger

func (uc *UseCase) CreateLedger(ctx context.Context, organizationID string, cli *l.CreateLedgerInput) (*l.Ledger, error)

CreateLedger creates a new ledger persists data in the repository.

func (*UseCase) CreateOrganization

func (uc *UseCase) CreateOrganization(ctx context.Context, coi *o.CreateOrganizationInput) (*o.Organization, error)

CreateOrganization creates a new organization persists data in the repository.

func (*UseCase) CreatePortfolio

func (uc *UseCase) CreatePortfolio(ctx context.Context, organizationID, ledgerID string, cpi *p.CreatePortfolioInput) (*p.Portfolio, error)

CreatePortfolio creates a new portfolio persists data in the repository.

func (*UseCase) CreateProduct

func (uc *UseCase) CreateProduct(ctx context.Context, organizationID, ledgerID string, cpi *r.CreateProductInput) (*r.Product, error)

CreateProduct creates a new product persists data in the repository.

func (*UseCase) DeleteAccountByID

func (uc *UseCase) DeleteAccountByID(ctx context.Context, organizationID, ledgerID, portfolioID, id string) error

DeleteAccountByID delete an account from the repository by ids.

func (*UseCase) DeleteInstrumentByID

func (uc *UseCase) DeleteInstrumentByID(ctx context.Context, organizationID, ledgerID, id uuid.UUID) error

DeleteInstrumentByID delete an instrument from the repository by ids.

func (*UseCase) DeleteLedgerByID

func (uc *UseCase) DeleteLedgerByID(ctx context.Context, organizationID, id string) error

DeleteLedgerByID deletes a ledger from the repository

func (*UseCase) DeleteOrganizationByID

func (uc *UseCase) DeleteOrganizationByID(ctx context.Context, id string) error

DeleteOrganizationByID fetch a new organization from the repository

func (*UseCase) DeletePortfolioByID

func (uc *UseCase) DeletePortfolioByID(ctx context.Context, organizationID, ledgerID, id string) error

DeletePortfolioByID deletes a portfolio from the repository by ids.

func (*UseCase) DeleteProductByID

func (uc *UseCase) DeleteProductByID(ctx context.Context, organizationID, ledgerID, id string) error

DeleteProductByID delete a product from the repository by ids.

func (*UseCase) UpdateAccount added in v1.10.0

func (uc *UseCase) UpdateAccount(ctx context.Context, organizationID, ledgerID, portfolioID, id string, uai *a.UpdateAccountInput) (*a.Account, error)

UpdateAccount update an account from the repository by given id.

func (*UseCase) UpdateAccountByID

func (uc *UseCase) UpdateAccountByID(ctx context.Context, id string, balance *a.Balance) (*a.Account, error)

UpdateAccountByID update an account from the repository by given id.

func (*UseCase) UpdateInstrumentByID

func (uc *UseCase) UpdateInstrumentByID(ctx context.Context, organizationID, ledgerID uuid.UUID, id uuid.UUID, uii *i.UpdateInstrumentInput) (*i.Instrument, error)

UpdateInstrumentByID update an instrument from the repository by given id.

func (*UseCase) UpdateLedgerByID

func (uc *UseCase) UpdateLedgerByID(ctx context.Context, organizationID, id string, uli *l.UpdateLedgerInput) (*l.Ledger, error)

UpdateLedgerByID update a ledger from the repository.

func (*UseCase) UpdateOrganizationByID

func (uc *UseCase) UpdateOrganizationByID(ctx context.Context, id string, uoi *o.UpdateOrganizationInput) (*o.Organization, error)

UpdateOrganizationByID update an organization from the repository.

func (*UseCase) UpdatePortfolioByID

func (uc *UseCase) UpdatePortfolioByID(ctx context.Context, organizationID, ledgerID, id string, upi *p.UpdatePortfolioInput) (*p.Portfolio, error)

UpdatePortfolioByID update a portfolio from the repository by given id.

func (*UseCase) UpdateProductByID

func (uc *UseCase) UpdateProductByID(ctx context.Context, organizationID, ledgerID, id string, upi *r.UpdateProductInput) (*r.Product, error)

UpdateProductByID update a product from the repository by given id.

Jump to

Keyboard shortcuts

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