command

package
v1.29.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: Apache-2.0 Imports: 19 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

	// AssetRepo provides an abstraction on top of the asset data source.
	AssetRepo s.Repository

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

	// RabbitMQRepo provides an abstraction on top of the producer rabbitmq.
	RabbitMQRepo rmq.ProducerRepository
}

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 uuid.UUID, cai *mmodel.CreateAccountInput) (*mmodel.Account, error)

CreateAccount creates a new account persists data in the repository.

func (*UseCase) CreateAsset added in v1.11.0

func (uc *UseCase) CreateAsset(ctx context.Context, organizationID, ledgerID uuid.UUID, cii *mmodel.CreateAssetInput) (*mmodel.Asset, error)

CreateAsset creates a new asset persists data in the repository.

func (*UseCase) CreateLedger

func (uc *UseCase) CreateLedger(ctx context.Context, organizationID uuid.UUID, cli *mmodel.CreateLedgerInput) (*mmodel.Ledger, error)

CreateLedger creates a new ledger persists data in the repository.

func (*UseCase) CreateMetadata added in v1.25.0

func (uc *UseCase) CreateMetadata(ctx context.Context, entityName, entityID string, metadata map[string]any) (map[string]any, error)

func (*UseCase) CreateOrganization

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

CreateOrganization creates a new organization persists data in the repository.

func (*UseCase) CreatePortfolio

func (uc *UseCase) CreatePortfolio(ctx context.Context, organizationID, ledgerID uuid.UUID, cpi *mmodel.CreatePortfolioInput) (*mmodel.Portfolio, error)

CreatePortfolio creates a new portfolio persists data in the repository.

func (*UseCase) CreateProduct

func (uc *UseCase) CreateProduct(ctx context.Context, organizationID, ledgerID uuid.UUID, cpi *mmodel.CreateProductInput) (*mmodel.Product, error)

CreateProduct creates a new product persists data in the repository.

func (*UseCase) DeleteAccountByID

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

DeleteAccountByID delete an account from the repository by ids.

func (*UseCase) DeleteAssetByID added in v1.11.0

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

DeleteAssetByID delete an asset from the repository by ids.

func (*UseCase) DeleteLedgerByID

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

DeleteLedgerByID deletes a ledger from the repository

func (*UseCase) DeleteOrganizationByID

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

DeleteOrganizationByID fetch a new organization from the repository

func (*UseCase) DeletePortfolioByID

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

DeletePortfolioByID deletes a portfolio from the repository by ids.

func (*UseCase) DeleteProductByID

func (uc *UseCase) DeleteProductByID(ctx context.Context, organizationID, ledgerID, id uuid.UUID) 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 uuid.UUID, portfolioID *uuid.UUID, id uuid.UUID, uai *mmodel.UpdateAccountInput) (*mmodel.Account, error)

UpdateAccount update an account from the repository by given id.

func (*UseCase) UpdateAccountByID

func (uc *UseCase) UpdateAccountByID(ctx context.Context, organizationID, ledgerID, id uuid.UUID, balance *mmodel.Balance) (*mmodel.Account, error)

UpdateAccountByID update an account from the repository by given id.

func (*UseCase) UpdateAssetByID added in v1.11.0

func (uc *UseCase) UpdateAssetByID(ctx context.Context, organizationID, ledgerID uuid.UUID, id uuid.UUID, uii *mmodel.UpdateAssetInput) (*mmodel.Asset, error)

UpdateAssetByID update an asset from the repository by given id.

func (*UseCase) UpdateLedgerByID

func (uc *UseCase) UpdateLedgerByID(ctx context.Context, organizationID, id uuid.UUID, uli *mmodel.UpdateLedgerInput) (*mmodel.Ledger, error)

UpdateLedgerByID update a ledger from the repository.

func (*UseCase) UpdateMetadata added in v1.25.0

func (uc *UseCase) UpdateMetadata(ctx context.Context, entityName, entityID string, metadata map[string]any) (map[string]any, error)

func (*UseCase) UpdateOrganizationByID

func (uc *UseCase) UpdateOrganizationByID(ctx context.Context, id uuid.UUID, uoi *mmodel.UpdateOrganizationInput) (*mmodel.Organization, error)

UpdateOrganizationByID update an organization from the repository.

func (*UseCase) UpdatePortfolioByID

func (uc *UseCase) UpdatePortfolioByID(ctx context.Context, organizationID, ledgerID, id uuid.UUID, upi *mmodel.UpdatePortfolioInput) (*mmodel.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 uuid.UUID, upi *mmodel.UpdateProductInput) (*mmodel.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