command

package
v1.48.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: Apache-2.0 Imports: 23 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 {
	// TransactionRepo provides an abstraction on top of the transaction data source.
	TransactionRepo transaction.Repository

	// OperationRepo provides an abstraction on top of the operation data source.
	OperationRepo operation.Repository

	// AssetRateRepo provides an abstraction on top of the asset rate data source.
	AssetRateRepo assetrate.Repository

	// BalanceRepo provides an abstraction on top of the balance data source.
	BalanceRepo balance.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) CreateBTOAsync added in v1.48.0

func (uc *UseCase) CreateBTOAsync(ctx context.Context, data mmodel.Queue)

func (*UseCase) CreateBalance added in v1.48.0

func (uc *UseCase) CreateBalance(ctx context.Context, data mmodel.Queue) error

func (*UseCase) CreateBalanceTransactionOperationsAsync added in v1.48.0

func (uc *UseCase) CreateBalanceTransactionOperationsAsync(ctx context.Context, data mmodel.Queue) error

CreateBalanceTransactionOperationsAsync func that is responsible to create all transactions at the same async.

func (*UseCase) CreateMetadata added in v1.48.0

func (uc *UseCase) CreateMetadata(ctx context.Context, logger mlog.Logger, metadata map[string]any, o *operation.Operation) error

CreateMetadata func that create metadata into operations

func (*UseCase) CreateOperation

func (uc *UseCase) CreateOperation(ctx context.Context, balances []*mmodel.Balance, 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 (uc *UseCase) CreateOrCheckIdempotencyKey(ctx context.Context, organizationID, ledgerID uuid.UUID, key, hash string, ttl time.Duration) error

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, transactionID uuid.UUID, t *goldModel.Transaction) (*transaction.Transaction, error)

CreateTransaction creates a new transaction persisting data in the repository.

func (*UseCase) DeleteBalance added in v1.48.0

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

DeleteBalance delete balance in the repository.

func (*UseCase) SendBTOExecuteAsync added in v1.48.0

func (uc *UseCase) SendBTOExecuteAsync(ctx context.Context, organizationID, ledgerID uuid.UUID, parseDSL *goldModel.Transaction, validate *goldModel.Responses, blc []*mmodel.Balance, tran *transaction.Transaction)

SendBTOExecuteAsync func that send balances, transaction and operations to a queue to execute async.

func (*UseCase) SendLogTransactionAuditQueue added in v1.48.0

func (uc *UseCase) SendLogTransactionAuditQueue(ctx context.Context, operations []*operation.Operation, organizationID, ledgerID, transactionID uuid.UUID)

SendLogTransactionAuditQueue sends transaction audit log data to a message queue for processing and storage. ctx is the request-scoped context for cancellation and deadlines. operations is the list of operations to be logged in the audit queue. organizationID is the UUID of the associated organization. ledgerID is the UUID of the ledger linked to the transaction. transactionID is the UUID of the transaction being logged.

func (*UseCase) Update added in v1.48.0

func (uc *UseCase) Update(ctx context.Context, organizationID, ledgerID, balanceID uuid.UUID, update mmodel.UpdateBalance) error

Update balance in the repository.

func (*UseCase) UpdateBalances added in v1.48.0

func (uc *UseCase) UpdateBalances(ctx context.Context, organizationID, ledgerID uuid.UUID, validate goldModel.Responses, balances []*mmodel.Balance) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL