command

package
v1.36.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 20 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 organization.Repository

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

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

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

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

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

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

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

	// RedisRepo provides an abstraction on top of the redis consumer.
	RedisRepo redis.RedisRepository
}

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

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

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

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

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

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

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

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