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) CreateOrUpdateAssetRate ¶
func (handler *AssetRateHandler) CreateOrUpdateAssetRate(p any, c *fiber.Ctx) error
CreateOrUpdateAssetRate creates or updates an asset rate.
@Summary Create or Update an AssetRate @Description Create or Update an AssetRate with the input details @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) GetAllAssetRatesByAssetCode ¶
func (handler *AssetRateHandler) GetAllAssetRatesByAssetCode(c *fiber.Ctx) error
GetAllAssetRatesByAssetCode retrieves an asset rate.
@Summary Get an AssetRate by the Asset Code @Description Get an AssetRate by the Asset Code with the input details @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_code path string true "From Asset Code" @Param to query []string false "To Asset Codes" example("BRL,USD,SGD") @Success 200 {object} mpostgres.Pagination{items=[]assetrate.AssetRate} @Router /v1/organizations/{organization_id}/ledgers/{ledger_id}/asset-rates/from/{asset_code} [get]
func (*AssetRateHandler) GetAssetRateByExternalID ¶
func (handler *AssetRateHandler) GetAssetRateByExternalID(c *fiber.Ctx) error
GetAssetRateByExternalID retrieves an asset rate.
@Summary Get an AssetRate by External ID @Description Get an AssetRate by External ID with the input details @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 external_id path string true "External ID" @Success 200 {object} assetrate.AssetRate @Router /v1/organizations/{organization_id}/ledgers/{ledger_id}/asset-rates/{external_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]