Documentation ¶
Index ¶
- func NewRouter(lg mlog.Logger, tl *mopentelemetry.Telemetry, cc *mcasdoor.CasdoorConnection, ...) *fiber.App
- func WithSwaggerEnvConfig() fiber.Handler
- type AssetRateHandler
- type OperationHandler
- func (handler *OperationHandler) GetAllOperationsByAccount(c *fiber.Ctx) error
- func (handler *OperationHandler) GetAllOperationsByPortfolio(c *fiber.Ctx) error
- func (handler *OperationHandler) GetOperationByAccount(c *fiber.Ctx) error
- func (handler *OperationHandler) GetOperationByPortfolio(c *fiber.Ctx) error
- func (handler *OperationHandler) UpdateOperation(p any, c *fiber.Ctx) error
- type TransactionHandler
- func (handler *TransactionHandler) CommitTransaction(c *fiber.Ctx) error
- func (handler *TransactionHandler) CreateTransactionDSL(c *fiber.Ctx) error
- func (handler *TransactionHandler) CreateTransactionJSON(p any, c *fiber.Ctx) error
- func (handler *TransactionHandler) CreateTransactionTemplate(p any, c *fiber.Ctx) error
- func (handler *TransactionHandler) GetAllTransactions(c *fiber.Ctx) error
- func (handler *TransactionHandler) GetTransaction(c *fiber.Ctx) error
- func (handler *TransactionHandler) RevertTransaction(c *fiber.Ctx) error
- func (handler *TransactionHandler) UpdateTransaction(p any, c *fiber.Ctx) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRouter ¶
func NewRouter(lg mlog.Logger, tl *mopentelemetry.Telemetry, cc *mcasdoor.CasdoorConnection, th *TransactionHandler, oh *OperationHandler, ah *AssetRateHandler) *fiber.App
func WithSwaggerEnvConfig ¶
func WithSwaggerEnvConfig() fiber.Handler
WithSwaggerEnvConfig sets the Swagger configuration for the API documentation from environment variables if they are set.
Types ¶
type AssetRateHandler ¶
AssetRateHandler struct contains a cqrs use case for managing asset rate.
func (*AssetRateHandler) CreateAssetRate ¶
func (handler *AssetRateHandler) CreateAssetRate(p any, c *fiber.Ctx) error
CreateAssetRate creates a new asset rate.
@Summary Create an AssetRate @Description Create an AssetRate with the input payload @Tags Asset Rates @Accept json @Produce json @Param Authorization header string true "Authorization Bearer Token" @Param Midaz-Id header string false "Request ID" @Param organization_id path string true "Organization ID" @Param ledger_id path string true "Ledger ID" @Param asset-rate body assetrate.CreateAssetRateInput true "AssetRate Input" @Success 200 {object} assetrate.AssetRate @Router /v1/organizations/{organization_id}/ledgers/{ledger_id}/asset-rates [post]
func (*AssetRateHandler) GetAssetRate ¶
func (handler *AssetRateHandler) GetAssetRate(c *fiber.Ctx) error
GetAssetRate retrieves an asset rate.
@Summary Get an AssetRate by ID @Description Get an AssetRate with the input ID @Tags Asset Rates @Produce json @Param Authorization header string true "Authorization Bearer Token" @Param Midaz-Id header string false "Request ID" @Param organization_id path string true "Organization ID" @Param ledger_id path string true "Ledger ID" @Param asset_rate_id path string true "AssetRate ID" @Param asset-rate body assetrate.CreateAssetRateInput true "AssetRate Input" @Success 200 {object} assetrate.AssetRate @Router /v1/organizations/{organization_id}/ledgers/{ledger_id}/asset-rates/{asset_rate_id} [get]
type OperationHandler ¶
OperationHandler struct contains a cqrs use case for managing operations.
func (*OperationHandler) GetAllOperationsByAccount ¶
func (handler *OperationHandler) GetAllOperationsByAccount(c *fiber.Ctx) error
GetAllOperationsByAccount retrieves all operations by account.
@Summary Get all Operations by account @Description Get all Operations with the input ID @Tags Operations @Produce json @Param Authorization header string true "Authorization Bearer Token" @Param Midaz-Id header string false "Request ID" @Param organization_id path string true "Organization ID" @Param ledger_id path string true "Ledger ID" @Param account_id path string true "Account ID" @Success 200 {object} mpostgres.Pagination{items=[]operation.Operation} @Router /v1/organizations/{organization_id}/ledgers/{ledger_id}/accounts/{account_id}/operations [get]
func (*OperationHandler) GetAllOperationsByPortfolio ¶
func (handler *OperationHandler) GetAllOperationsByPortfolio(c *fiber.Ctx) error
GetAllOperationsByPortfolio retrieves all operations by portfolio.
@Summary Get all Operations by portfolio @Description Get all Operations with the input ID @Tags Operations @Produce json @Param Authorization header string true "Authorization Bearer Token" @Param Midaz-Id header string false "Request ID" @Param organization_id path string true "Organization ID" @Param ledger_id path string true "Ledger ID" @Param portfolio_id path string true "Portfolio ID" @Success 200 {object} mpostgres.Pagination{items=[]operation.Operation} @Router /v1/organizations/{organization_id}/ledgers/{ledger_id}/portfolios/{portfolio_id}/operations [get]
func (*OperationHandler) GetOperationByAccount ¶
func (handler *OperationHandler) GetOperationByAccount(c *fiber.Ctx) error
GetOperationByAccount retrieves an operation by account.
@Summary Get an Operation by account @Description Get an Operation with the input ID @Tags Operations @Produce json @Param Authorization header string true "Authorization Bearer Token" @Param Midaz-Id header string false "Request ID" @Param organization_id path string true "Organization ID" @Param ledger_id path string true "Ledger ID" @Param account_id path string true "Account ID" @Param operation_id path string true "Operation ID" @Success 200 {object} operation.Operation @Router /v1/organizations/{organization_id}/ledgers/{ledger_id}/accounts/{account_id}/operations/{operation_id} [get]
func (*OperationHandler) GetOperationByPortfolio ¶
func (handler *OperationHandler) GetOperationByPortfolio(c *fiber.Ctx) error
GetOperationByPortfolio retrieves an operation by portfolio.
@Summary Get an Operation by portfolio @Description Get an Operation with the input ID @Tags Operations @Produce json @Param Authorization header string true "Authorization Bearer Token" @Param Midaz-Id header string false "Request ID" @Param organization_id path string true "Organization ID" @Param ledger_id path string true "Ledger ID" @Param portfolio_id path string true "Portfolio ID" @Param operation_id path string true "Operation ID" @Success 200 {object} operation.Operation @Router /v1/organizations/{organization_id}/ledgers/{ledger_id}/portfolios/{portfolio_id}/operations/{operation_id} [get]
func (*OperationHandler) UpdateOperation ¶
func (handler *OperationHandler) UpdateOperation(p any, c *fiber.Ctx) error
UpdateOperation method that patch operation created before
@Summary Update an Operation @Description Update an Operation with the input payload @Tags Operations @Accept json @Produce json @Param Authorization header string true "Authorization Bearer Token" @Param Midaz-Id header string false "Request ID" @Param organization_id path string true "Organization ID" @Param ledger_id path string true "Ledger ID" @Param transaction_id path string true "Transaction ID" @Param operation_id path string true "Operation ID" @Param operation body operation.UpdateOperationInput true "Operation Input" @Success 200 {object} operation.Operation @Router /v1/organizations/{organization_id}/ledgers/{ledger_id}/transactions/{transaction_id}/operations/{operation_id} [patch]
type TransactionHandler ¶
TransactionHandler struct that handle transaction
func (*TransactionHandler) CommitTransaction ¶
func (handler *TransactionHandler) CommitTransaction(c *fiber.Ctx) error
CommitTransaction method that commit transaction created before
TODO: Implement this method and the swagger documentation related to it
func (*TransactionHandler) CreateTransactionDSL ¶
func (handler *TransactionHandler) CreateTransactionDSL(c *fiber.Ctx) error
CreateTransactionDSL method that create transaction using DSL
@Summary Create a Transaction using DSL @Description Create a Transaction with the input DSL file @Tags Transactions @Accept mpfd @Produce json @Param Authorization header string true "Authorization Bearer Token" @Param Midaz-Id header string false "Request ID" @Param organization_id path string true "Organization ID" @Param ledger_id path string true "Ledger ID" @Param transaction formData file true "Transaction DSL file" @Success 200 {object} transaction.Transaction @Router /v1/organizations/{organization_id}/ledgers/{ledger_id}/transactions/dsl [post]
func (*TransactionHandler) CreateTransactionJSON ¶
func (handler *TransactionHandler) CreateTransactionJSON(p any, c *fiber.Ctx) error
CreateTransactionJSON method that create transaction using JSON
@Summary Create a Transaction using JSON @Description Create a Transaction with the input payload @Tags Transactions @Accept json @Produce json @Param Authorization header string true "Authorization Bearer Token" @Param Midaz-Id header string false "Request ID" @Param organization_id path string true "Organization ID" @Param ledger_id path string true "Ledger ID" @Param transaction body transaction.CreateTransactionInput true "Transaction Input" @Success 200 {object} transaction.Transaction @Router /v1/organizations/{organization_id}/ledgers/{ledger_id}/transactions/json [post]
func (*TransactionHandler) CreateTransactionTemplate ¶
func (handler *TransactionHandler) CreateTransactionTemplate(p any, c *fiber.Ctx) error
CreateTransactionTemplate method that create transaction template
TODO: Implement this method and the swagger documentation related to it
func (*TransactionHandler) GetAllTransactions ¶
func (handler *TransactionHandler) GetAllTransactions(c *fiber.Ctx) error
GetAllTransactions method that get all transactions created before
@Summary Get all Transactions @Description Get all Transactions with the input metadata or without metadata @Tags Transactions @Produce json @Param Authorization header string true "Authorization Bearer Token" @Param Midaz-Id header string false "Request ID" @Param organization_id path string true "Organization ID" @Param ledger_id path string true "Ledger ID" @Success 200 {object} mpostgres.Pagination{items=[]transaction.Transaction} @Router /v1/organizations/{organization_id}/ledgers/{ledger_id}/transactions [get]
func (*TransactionHandler) GetTransaction ¶
func (handler *TransactionHandler) GetTransaction(c *fiber.Ctx) error
GetTransaction method that get transaction created before
@Summary Get a Transaction by ID @Description Get a Transaction with the input ID @Tags Transactions @Produce json @Param Authorization header string true "Authorization Bearer Token" @Param Midaz-Id header string false "Request ID" @Param organization_id path string true "Organization ID" @Param ledger_id path string true "Ledger ID" @Param transaction_id path string true "Transaction ID" @Success 200 {object} transaction.Transaction @Router /v1/organizations/{organization_id}/ledgers/{ledger_id}/transactions/{transaction_id} [get]
func (*TransactionHandler) RevertTransaction ¶
func (handler *TransactionHandler) RevertTransaction(c *fiber.Ctx) error
RevertTransaction method that revert transaction created before
TODO: Implement this method and the swagger documentation related to it
func (*TransactionHandler) UpdateTransaction ¶
func (handler *TransactionHandler) UpdateTransaction(p any, c *fiber.Ctx) error
UpdateTransaction method that patch transaction created before
@Summary Update a Transaction @Description Update a Transaction with the input payload @Tags Transactions @Accept json @Produce json @Param Authorization header string true "Authorization Bearer Token" @Param Midaz-Id header string false "Request ID" @Param organization_id path string true "Organization ID" @Param ledger_id path string true "Ledger ID" @Param transaction_id path string true "Transaction ID" @Param transaction body transaction.UpdateTransactionInput true "Transaction Input" @Success 200 {object} transaction.Transaction @Router /v1/organizations/{organization_id}/ledgers/{ledger_id}/transactions/{transaction_id} [patch]