Documentation ¶
Index ¶
- type UseCase
- func (uc *UseCase) CreateAccount(ctx context.Context, organizationID, ledgerID, portfolioID uuid.UUID, ...) (*a.Account, error)
- func (uc *UseCase) CreateAsset(ctx context.Context, organizationID, ledgerID uuid.UUID, ...) (*s.Asset, error)
- func (uc *UseCase) CreateLedger(ctx context.Context, organizationID uuid.UUID, cli *l.CreateLedgerInput) (*l.Ledger, error)
- func (uc *UseCase) CreateOrganization(ctx context.Context, coi *o.CreateOrganizationInput) (*o.Organization, error)
- func (uc *UseCase) CreatePortfolio(ctx context.Context, organizationID, ledgerID string, ...) (*p.Portfolio, error)
- func (uc *UseCase) CreateProduct(ctx context.Context, organizationID, ledgerID uuid.UUID, ...) (*r.Product, error)
- func (uc *UseCase) DeleteAccountByID(ctx context.Context, organizationID, ledgerID, portfolioID, id 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, portfolioID, id uuid.UUID, ...) (*a.Account, error)
- func (uc *UseCase) UpdateAccountByID(ctx context.Context, id string, balance *a.Balance) (*a.Account, error)
- func (uc *UseCase) UpdateAssetByID(ctx context.Context, organizationID, ledgerID uuid.UUID, id uuid.UUID, ...) (*s.Asset, error)
- func (uc *UseCase) UpdateLedgerByID(ctx context.Context, organizationID, id uuid.UUID, uli *l.UpdateLedgerInput) (*l.Ledger, error)
- func (uc *UseCase) UpdateOrganizationByID(ctx context.Context, id uuid.UUID, uoi *o.UpdateOrganizationInput) (*o.Organization, error)
- func (uc *UseCase) UpdatePortfolioByID(ctx context.Context, organizationID, ledgerID, id uuid.UUID, ...) (*p.Portfolio, error)
- func (uc *UseCase) UpdateProductByID(ctx context.Context, organizationID, ledgerID, id uuid.UUID, ...) (*r.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 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 }
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 uuid.UUID, cai *a.CreateAccountInput) (*a.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 *s.CreateAssetInput) (*s.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 *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 uuid.UUID, 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 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 ¶
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 ¶ added in v1.10.0
func (uc *UseCase) UpdateAccount(ctx context.Context, organizationID, ledgerID, portfolioID, id uuid.UUID, 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) UpdateAssetByID ¶ added in v1.11.0
func (uc *UseCase) UpdateAssetByID(ctx context.Context, organizationID, ledgerID uuid.UUID, id uuid.UUID, uii *s.UpdateAssetInput) (*s.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 *l.UpdateLedgerInput) (*l.Ledger, error)
UpdateLedgerByID update a ledger from the repository.
func (*UseCase) UpdateOrganizationByID ¶
func (uc *UseCase) UpdateOrganizationByID(ctx context.Context, id uuid.UUID, uoi *o.UpdateOrganizationInput) (*o.Organization, error)
UpdateOrganizationByID update an organization from the repository.
Source Files ¶
- command.go
- create-account.go
- create-asset.go
- create-ledger.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-organization.go
- update-portfolio.go
- update-product.go