Documentation ¶
Index ¶
- type UseCase
- func (uc *UseCase) CreateOperation(ctx context.Context, accounts []*account.Account, transactionID string, ...)
- func (uc *UseCase) CreateOrCheckIdempotencyKey(ctx context.Context, organizationID, ledgerID uuid.UUID, key, hash string, ...) error
- func (uc *UseCase) CreateOrUpdateAssetRate(ctx context.Context, organizationID, ledgerID uuid.UUID, ...) (*assetrate.AssetRate, error)
- func (uc *UseCase) CreateTransaction(ctx context.Context, organizationID, ledgerID uuid.UUID, ...) (*transaction.Transaction, error)
- func (uc *UseCase) UpdateOperation(ctx context.Context, ...) (*operation.Operation, error)
- func (uc *UseCase) UpdateTransaction(ctx context.Context, organizationID, ledgerID, transactionID uuid.UUID, ...) (*transaction.Transaction, error)
- func (uc *UseCase) UpdateTransactionStatus(ctx context.Context, organizationID, ledgerID, transactionID uuid.UUID, ...) (*transaction.Transaction, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UseCase ¶
type UseCase struct { // TransactionRepo provides an abstraction on top of the transaction data source. TransactionRepo transaction.Repository // AccountGRPCRepo provides an abstraction on top of the account grpc. AccountGRPCRepo out.Repository // OperationRepo provides an abstraction on top of the operation data source. OperationRepo operation.Repository // AssetRateRepo provides an abstraction on top of the operation data source. AssetRateRepo assetrate.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 implementations.
func (*UseCase) CreateOperation ¶
func (uc *UseCase) CreateOperation(ctx context.Context, accounts []*account.Account, transactionID string, dsl *goldModel.Transaction, validate goldModel.Responses, result chan []*operation.Operation, err chan error)
CreateOperation creates a new operation based on transaction id and persisting data in the repository.
func (*UseCase) CreateOrCheckIdempotencyKey ¶ added in v1.34.0
func (*UseCase) CreateOrUpdateAssetRate ¶ added in v1.31.0
func (uc *UseCase) CreateOrUpdateAssetRate(ctx context.Context, organizationID, ledgerID uuid.UUID, cari *assetrate.CreateAssetRateInput) (*assetrate.AssetRate, error)
CreateOrUpdateAssetRate creates or updates an asset rate.
func (*UseCase) CreateTransaction ¶
func (uc *UseCase) CreateTransaction(ctx context.Context, organizationID, ledgerID uuid.UUID, t *goldModel.Transaction) (*transaction.Transaction, error)
CreateTransaction creates a new transaction persisting data in the repository.
func (*UseCase) UpdateOperation ¶
func (uc *UseCase) UpdateOperation(ctx context.Context, organizationID, ledgerID, transactionID, operationID uuid.UUID, uoi *operation.UpdateOperationInput) (*operation.Operation, error)
UpdateOperation update an operation from the repository by given id.
func (*UseCase) UpdateTransaction ¶
func (uc *UseCase) UpdateTransaction(ctx context.Context, organizationID, ledgerID, transactionID uuid.UUID, uti *transaction.UpdateTransactionInput) (*transaction.Transaction, error)
UpdateTransaction update a transaction from the repository by given id.
func (*UseCase) UpdateTransactionStatus ¶
func (uc *UseCase) UpdateTransactionStatus(ctx context.Context, organizationID, ledgerID, transactionID uuid.UUID, description string) (*transaction.Transaction, error)
UpdateTransactionStatus update a status transaction from the repository by given id.
Click to show internal directories.
Click to hide internal directories.