Documentation ¶
Index ¶
- type UseCase
- func (uc *UseCase) CreateAccount(ctx context.Context, organizationID, ledgerID uuid.UUID, ...) (*mmodel.Account, error)
- func (uc *UseCase) CreateAsset(ctx context.Context, organizationID, ledgerID uuid.UUID, ...) (*mmodel.Asset, error)
- func (uc *UseCase) CreateLedger(ctx context.Context, organizationID uuid.UUID, cli *mmodel.CreateLedgerInput) (*mmodel.Ledger, error)
- func (uc *UseCase) CreateMetadata(ctx context.Context, entityName, entityID string, metadata map[string]any) (map[string]any, error)
- func (uc *UseCase) CreateOrganization(ctx context.Context, coi *mmodel.CreateOrganizationInput) (*mmodel.Organization, error)
- func (uc *UseCase) CreatePortfolio(ctx context.Context, organizationID, ledgerID uuid.UUID, ...) (*mmodel.Portfolio, error)
- func (uc *UseCase) CreateProduct(ctx context.Context, organizationID, ledgerID uuid.UUID, ...) (*mmodel.Product, error)
- func (uc *UseCase) DeleteAccountByID(ctx context.Context, organizationID, ledgerID uuid.UUID, ...) error
- func (uc *UseCase) DeleteAssetByID(ctx context.Context, organizationID, ledgerID, id uuid.UUID) error
- func (uc *UseCase) DeleteLedgerByID(ctx context.Context, organizationID, id uuid.UUID) error
- func (uc *UseCase) DeleteOrganizationByID(ctx context.Context, id uuid.UUID) error
- func (uc *UseCase) DeletePortfolioByID(ctx context.Context, organizationID, ledgerID, id uuid.UUID) error
- func (uc *UseCase) DeleteProductByID(ctx context.Context, organizationID, ledgerID, id uuid.UUID) error
- func (uc *UseCase) UpdateAccount(ctx context.Context, organizationID, ledgerID uuid.UUID, ...) (*mmodel.Account, error)
- func (uc *UseCase) UpdateAccountByID(ctx context.Context, organizationID, ledgerID, id uuid.UUID, ...) (*mmodel.Account, error)
- func (uc *UseCase) UpdateAssetByID(ctx context.Context, organizationID, ledgerID uuid.UUID, id uuid.UUID, ...) (*mmodel.Asset, error)
- func (uc *UseCase) UpdateLedgerByID(ctx context.Context, organizationID, id uuid.UUID, ...) (*mmodel.Ledger, error)
- func (uc *UseCase) UpdateMetadata(ctx context.Context, entityName, entityID string, metadata map[string]any) (map[string]any, error)
- func (uc *UseCase) UpdateOrganizationByID(ctx context.Context, id uuid.UUID, uoi *mmodel.UpdateOrganizationInput) (*mmodel.Organization, error)
- func (uc *UseCase) UpdatePortfolioByID(ctx context.Context, organizationID, ledgerID, id uuid.UUID, ...) (*mmodel.Portfolio, error)
- func (uc *UseCase) UpdateProductByID(ctx context.Context, organizationID, ledgerID, id uuid.UUID, ...) (*mmodel.Product, error)
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 (*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 ¶
DeleteLedgerByID deletes a ledger from the repository
func (*UseCase) DeleteOrganizationByID ¶
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 (*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.
Source Files ¶
- command.go
- create-account.go
- create-asset.go
- create-ledger.go
- create-metadata.go
- create-organization.go
- create-portfolio.go
- create-product.go
- delete-account.go
- delete-asset.go
- delete-ledger.go
- delete-organization.go
- delete-portfolio.go
- delete-product.go
- update-account-id.go
- update-account.go
- update-asset.go
- update-ledger.go
- update-metadata.go
- update-organization.go
- update-portfolio.go
- update-product.go