in

package
v1.36.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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

type AssetRateHandler struct {
	Command *command.UseCase
	Query   *query.UseCase
}

AssetRateHandler struct contains a cqrs use case for managing asset rate.

func (*AssetRateHandler) CreateOrUpdateAssetRate added in v1.31.0

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 added in v1.31.0

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"
@Param			limit			query		int			false	"Limit"				default(10)
@Param			start_date		query		string		false	"Start Date"		example "2021-01-01"
@Param			end_date		query		string		false	"End Date"			example "2021-01-01"
@Param			sort_order		query		string		false	"Sort Order"		Enums(asc,desc)
@Param			cursor			query		string		false	"Cursor"
@Success		200				{object}	mpostgres.Pagination{items=[]assetrate.AssetRate,next_cursor=string,prev_cursor=string,limit=int}
@Router			/v1/organizations/{organization_id}/ledgers/{ledger_id}/asset-rates/from/{asset_code} [get]

func (*AssetRateHandler) GetAssetRateByExternalID added in v1.31.0

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

type OperationHandler struct {
	Command *command.UseCase
	Query   *query.UseCase
}

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"
@Param			limit			query		int		false	"Limit"			default(10)
@Param			start_date		query		string	false	"Start Date"	example "2021-01-01"
@Param			end_date		query		string	false	"End Date"		example "2021-01-01"
@Param			sort_order		query		string	false	"Ledger ID"		enum(asc,desc)
@Param			cursor			query		string	false	"Cursor"
@Success		200				{object}	mpostgres.Pagination{items=[]operation.Operation, next_cursor=string, prev_cursor=string,limit=int}
@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"
@Param			limit			query		int		false	"Limit"			default(10)
@Param			start_date		query		string	false	"Start Date"	example "2021-01-01"
@Param			end_date		query		string	false	"End Date"		example "2021-01-01"
@Param			sort_order		query		string	false	"Sort Order"	Enums(asc,desc)
@Param			cursor			query		string	false	"Cursor"
@Success		200				{object}	mpostgres.Pagination{items=[]operation.Operation,next_cursor=string,prev_cursor=string,limit=int}
@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

type TransactionHandler struct {
	Command *command.UseCase
	Query   *query.UseCase
}

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"
@Param			limit			query		int		false	"Limit"			default(10)
@Param			start_date		query		string	false	"Start Date"	example "2021-01-01"
@Param			end_date		query		string	false	"End Date"		example "2021-01-01"
@Param			sort_order		query		string	false	"Sort Order"	Enums(asc,desc)
@Param			cursor			query		string	false	"Cursor"
@Success		200				{object}	mpostgres.Pagination{items=[]transaction.Transaction,next_cursor=string,prev_cursor=string,limit=int,page=nil}
@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]

Jump to

Keyboard shortcuts

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