Documentation
¶
Index ¶
- type UseCase
- func (uc *UseCase) CreateBTOAsync(ctx context.Context, data mmodel.Queue)
- func (uc *UseCase) CreateBalance(ctx context.Context, data mmodel.Queue) error
- func (uc *UseCase) CreateBalanceTransactionOperationsAsync(ctx context.Context, data mmodel.Queue) error
- func (uc *UseCase) CreateMetadata(ctx context.Context, logger mlog.Logger, metadata map[string]any, ...) error
- func (uc *UseCase) CreateOperation(ctx context.Context, balances []*mmodel.Balance, 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, transactionID uuid.UUID, ...) (*transaction.Transaction, error)
- func (uc *UseCase) DeleteBalance(ctx context.Context, organizationID, ledgerID, balanceID uuid.UUID) error
- func (uc *UseCase) SendBTOExecuteAsync(ctx context.Context, organizationID, ledgerID uuid.UUID, ...)
- func (uc *UseCase) SendLogTransactionAuditQueue(ctx context.Context, operations []*operation.Operation, ...)
- func (uc *UseCase) Update(ctx context.Context, organizationID, ledgerID, balanceID uuid.UUID, ...) error
- func (uc *UseCase) UpdateBalances(ctx context.Context, organizationID, ledgerID uuid.UUID, ...) 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 // 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 (*UseCase) CreateBalance ¶ added in v1.48.0
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 (*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 (*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.
Source Files
¶
- command.go
- create-assetrate.go
- create-balance-transaction-operations-async.go
- create-balance.go
- create-idempotency-key.go
- create-operation.go
- create-transaction.go
- delete_balance.go
- send-bto-execute-async.go
- send-log-transaction-audit-queue.go
- update-balance.go
- update-operation.go
- update-transaction.go