in

package
v1.48.0-beta.6 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRouter

NewRouter registerNewRouters routes to the Server.

func WithSwaggerEnvConfig

func WithSwaggerEnvConfig() fiber.Handler

WithSwaggerEnvConfig sets the Swagger configuration for the API documentation from environment variables if they are set.

Types

type AccountHandler

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

AccountHandler struct contains an account use case for managing account related operations.

func (*AccountHandler) CreateAccount

func (handler *AccountHandler) CreateAccount(i any, c *fiber.Ctx) error

CreateAccount is a method that creates account information.

@Summary		Create an Account
@Description	Create an Account with the input payload
@Tags			Accounts
@Accept			json
@Produce		json
@Param			Authorization	header		string						true	"Authorization Bearer Token"
@Param			X-Request-Id		header		string						false	"Request ID"
@Param			organization_id	path		string						true	"Organization ID"
@Param			ledger_id		path		string						true	"Ledger ID"
@Param			account			body		mmodel.CreateAccountInput	true	"Account"
@Success		200				{object}	mmodel.Account
@Router			/v1/organizations/{organization_id}/ledgers/{ledger_id}/accounts [post]

func (*AccountHandler) DeleteAccountByID

func (handler *AccountHandler) DeleteAccountByID(c *fiber.Ctx) error

DeleteAccountByID is a method that removes Account information by a given account id.

@Summary		Delete an Account by ID
@Description	Delete an Account with the input ID
@Tags			Accounts
@Param			Authorization	header	string	true	"Authorization Bearer Token"
@Param			X-Request-Id		header	string	false	"Request ID"
@Param			organization_id	path	string	true	"Organization ID"
@Param			ledger_id		path	string	true	"Ledger ID"
@Param			id				path	string	true	"Account ID"
@Success		204
@Router			/v1/organizations/{organization_id}/ledgers/{ledger_id}/accounts/{id} [delete]

func (*AccountHandler) GetAccountByAlias

func (handler *AccountHandler) GetAccountByAlias(c *fiber.Ctx) error

GetAccountByAlias is a method that retrieves Account information by a given account alias.

@Summary		Get an Account by Alias
@Description	Get an Account with the input Alias
@Tags			Accounts
@Produce		json
@Param			Authorization	header		string	true	"Authorization Bearer Token"
@Param			X-Request-Id		header		string	false	"Request ID"
@Param			organization_id	path		string	true	"Organization ID"
@Param			ledger_id		path		string	true	"Ledger ID"
@Param			alias			path		string	true	"Alias"
@Success		200				{object}	mmodel.Account
@Router			/v1/organizations/{organization_id}/ledgers/{ledger_id}/accounts/{alias} [get]

func (*AccountHandler) GetAccountByID

func (handler *AccountHandler) GetAccountByID(c *fiber.Ctx) error

GetAccountByID is a method that retrieves Account information by a given account id.

@Summary		Get an Account by ID
@Description	Get an Account with the input ID
@Tags			Accounts
@Produce		json
@Param			Authorization	header		string	true	"Authorization Bearer Token"
@Param			X-Request-Id		header		string	false	"Request ID"
@Param			organization_id	path		string	true	"Organization ID"
@Param			ledger_id		path		string	true	"Ledger ID"
@Param			id				path		string	true	"Account ID"
@Success		200				{object}	mmodel.Account
@Router			/v1/organizations/{organization_id}/ledgers/{ledger_id}/accounts/{id} [get]

func (*AccountHandler) GetAllAccounts

func (handler *AccountHandler) GetAllAccounts(c *fiber.Ctx) error

GetAllAccounts is a method that retrieves all Accounts.

@Summary		Get all Accounts
@Description	Get all Accounts with the input metadata or without metadata
@Tags			Accounts
@Produce		json
@Param			Authorization	header		string	true	"Authorization Bearer Token"
@Param			X-Request-Id		header		string	false	"Request ID"
@Param			organization_id	path		string	true	"Organization ID"
@Param			ledger_id		path		string	true	"Ledger ID"
@Param			metadata		query		string	false	"Metadata"
@Param			limit			query		int		false	"Limit"			default(10)
@Param			page			query		int		false	"Page"			default(1)
@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)
@Success		200				{object}	mpostgres.Pagination{items=[]mmodel.Account,page=int,limit=int}
@Router			/v1/organizations/{organization_id}/ledgers/{ledger_id}/accounts [get]

func (*AccountHandler) UpdateAccount

func (handler *AccountHandler) UpdateAccount(i any, c *fiber.Ctx) error

UpdateAccount is a method that updates Account information.

@Summary		Update an Account
@Description	Update an Account with the input payload
@Tags			Accounts
@Accept			json
@Produce		json
@Param			Authorization	header		string						true	"Authorization Bearer Token"
@Param			X-Request-Id		header		string						false	"Request ID"
@Param			organization_id	path		string						true	"Organization ID"
@Param			ledger_id		path		string						true	"Ledger ID"
@Param			id				path		string						true	"Account ID"
@Param			account			body		mmodel.UpdateAccountInput	true	"Account"
@Success		200				{object}	mmodel.Account
@Router			/v1/organizations/{organization_id}/ledgers/{ledger_id}/accounts/{id} [patch]

type AssetHandler

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

AssetHandler struct contains a cqrs use case for managing asset in related operations.

func (*AssetHandler) CreateAsset

func (handler *AssetHandler) CreateAsset(a any, c *fiber.Ctx) error

CreateAsset is a method that creates asset information.

@Summary		Create an Asset
@Description	Create an Asset with the input payload
@Tags			Assets
@Accept			json
@Produce		json
@Param			Authorization	header		string					true	"Authorization Bearer Token"
@Param			X-Request-Id		header		string					false	"Request ID"
@Param			organization_id	path		string					true	"Organization ID"
@Param			ledger_id		path		string					true	"Ledger ID"
@Param			asset			body		mmodel.CreateAssetInput	true	"Asset Input"
@Success		200				{object}	mmodel.Asset
@Router			/v1/organizations/{organization_id}/ledgers/{ledger_id}/assets [post]

func (*AssetHandler) DeleteAssetByID

func (handler *AssetHandler) DeleteAssetByID(c *fiber.Ctx) error

DeleteAssetByID is a method that removes Asset information by a given ids.

@Summary		Delete an Asset by ID
@Description	Delete an Asset with the input ID
@Tags			Assets
@Param			Authorization	header	string	true	"Authorization Bearer Token"
@Param			X-Request-Id		header	string	false	"Request ID"
@Param			organization_id	path	string	true	"Organization ID"
@Param			ledger_id		path	string	true	"Ledger ID"
@Param			id				path	string	true	"Asset ID"
@Success		204
@Router			/v1/organizations/{organization_id}/ledgers/{ledger_id}/assets/{id} [delete]

func (*AssetHandler) GetAllAssets

func (handler *AssetHandler) GetAllAssets(c *fiber.Ctx) error

GetAllAssets is a method that retrieves all Assets.

@Summary		Get all Assets
@Description	Get all Assets with the input metadata or without metadata
@Tags			Assets
@Produce		json
@Param			Authorization	header		string	true	"Authorization Bearer Token"
@Param			X-Request-Id		header		string	false	"Request ID"
@Param			organization_id	path		string	true	"Organization ID"
@Param			ledger_id		path		string	true	"Ledger ID"
@Param			metadata		query		string	false	"Metadata"
@Param			limit			query		int		false	"Limit"			default(10)
@Param			page			query		int		false	"Page"			default(1)
@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)
@Success		200				{object}	mpostgres.Pagination{items=[]mmodel.Asset,page=int,limit=int}
@Router			/v1/organizations/{organization_id}/ledgers/{ledger_id}/assets [get]

func (*AssetHandler) GetAssetByID

func (handler *AssetHandler) GetAssetByID(c *fiber.Ctx) error

GetAssetByID is a method that retrieves Asset information by a given id.

@Summary		Get an Asset by ID
@Description	Get an Asset with the input ID
@Tags			Assets
@Produce		json
@Param			Authorization	header		string	true	"Authorization Bearer Token"
@Param			X-Request-Id		header		string	false	"Request ID"
@Param			organization_id	path		string	true	"Organization ID"
@Param			ledger_id		path		string	true	"Ledger ID"
@Param			id				path		string	true	"Asset ID"
@Success		200				{object}	mmodel.Asset
@Router			/v1/organizations/{organization_id}/ledgers/{ledger_id}/assets/{id} [get]

func (*AssetHandler) UpdateAsset

func (handler *AssetHandler) UpdateAsset(a any, c *fiber.Ctx) error

UpdateAsset is a method that updates Asset information.

@Summary		Update an Asset
@Description	Update an Asset with the input payload
@Tags			Assets
@Accept			json
@Produce		json
@Param			Authorization	header		string					true	"Authorization Bearer Token"
@Param			X-Request-Id		header		string					false	"Request ID"
@Param			organization_id	path		string					true	"Organization ID"
@Param			ledger_id		path		string					true	"Ledger ID"
@Param			id				path		string					true	"Asset ID"
@Param			asset			body		mmodel.UpdateAssetInput	true	"Asset Input"
@Success		200				{object}	mmodel.Asset
@Router			/v1/organizations/{organization_id}/ledgers/{ledger_id}/assets/{id} [patch]

type LedgerHandler

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

LedgerHandler struct contains a ledger use case for managing ledger related operations.

func (*LedgerHandler) CreateLedger

func (handler *LedgerHandler) CreateLedger(i any, c *fiber.Ctx) error

CreateLedger is a method that creates Ledger information.

@Summary		Create a Ledger
@Description	Create a Ledger with the input payload
@Tags			Ledgers
@Accept			json
@Produce		json
@Param			Authorization	header		string						true	"Authorization Bearer Token"
@Param			X-Request-Id		header		string						false	"Request ID"
@Param			organization_id	path		string						true	"Organization ID"
@Param			ledger			body		mmodel.CreateLedgerInput	true	"Ledger Input"
@Success		200				{object}	mmodel.Ledger
@Router			/v1/organizations/{organization_id}/ledgers [post]

func (*LedgerHandler) DeleteLedgerByID

func (handler *LedgerHandler) DeleteLedgerByID(c *fiber.Ctx) error

DeleteLedgerByID is a method that removes Ledger information by a given id.

@Summary		Delete a Ledger by ID
@Description	Delete a Ledger with the input ID
@Tags			Ledgers
@Param			Authorization	header	string	true	"Authorization Bearer Token"
@Param			X-Request-Id		header	string	false	"Request ID"
@Param			organization_id	path	string	true	"Organization ID"
@Param			id				path	string	true	"Ledger ID"
@Success		204
@Router			/v1/organizations/{organization_id}/ledgers/{id} [delete]

func (*LedgerHandler) GetAllLedgers

func (handler *LedgerHandler) GetAllLedgers(c *fiber.Ctx) error

GetAllLedgers is a method that retrieves all ledgers.

@Summary		Get all Ledgers
@Description	Get all Ledgers with the input metadata or without metadata
@Tags			Ledgers
@Produce		json
@Param			Authorization	header		string	true	"Authorization Bearer Token"
@Param			X-Request-Id		header		string	false	"Request ID"
@Param			organization_id	path		string	true	"Organization ID"
@Param			id				path		string	true	"Ledger ID"
@Param			limit			query		int		false	"Limit"			default(10)
@Param			page			query		int		false	"Page"			default(1)
@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)
@Success		200				{object}	mpostgres.Pagination{items=[]mmodel.Ledger,page=int,limit=int}
@Router			/v1/organizations/{organization_id}/ledgers [get]

func (*LedgerHandler) GetLedgerByID

func (handler *LedgerHandler) GetLedgerByID(c *fiber.Ctx) error

GetLedgerByID is a method that retrieves Ledger information by a given id.

@Summary		Get a Ledger by ID
@Description	Get a Ledger with the input ID
@Tags			Ledgers
@Produce		json
@Param			Authorization	header		string	true	"Authorization Bearer Token"
@Param			X-Request-Id		header		string	false	"Request ID"
@Param			organization_id	path		string	true	"Organization ID"
@Param			id				path		string	true	"Ledger ID"
@Success		200				{object}	mmodel.Ledger
@Router			/v1/organizations/{organization_id}/ledgers/{id} [get]

func (*LedgerHandler) UpdateLedger

func (handler *LedgerHandler) UpdateLedger(p any, c *fiber.Ctx) error

UpdateLedger is a method that updates Ledger information.

@Summary		Update a Ledger
@Description	Update a Ledger with the input payload
@Tags			Ledgers
@Accept			json
@Produce		json
@Param			Authorization	header		string						true	"Authorization Bearer Token"
@Param			X-Request-Id		header		string						false	"Request ID"
@Param			organization_id	path		string						true	"Organization ID"
@Param			id				path		string						true	"Ledger ID"
@Param			ledger			body		mmodel.UpdateLedgerInput	true	"Ledger Input"
@Success		200				{object}	mmodel.Ledger
@Router			/v1/organizations/{organization_id}/ledgers/{id} [patch]

type OrganizationHandler

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

OrganizationHandler struct contains an organization use case for managing organization related operations.

func (*OrganizationHandler) CreateOrganization

func (handler *OrganizationHandler) CreateOrganization(p any, c *fiber.Ctx) error

CreateOrganization is a method that creates Organization information.

@Summary		Create an Organization
@Description	Create an Organization with the input payload
@Tags			Organizations
@Accept			json
@Produce		json
@Param			Authorization	header		string							true	"Authorization Bearer Token"
@Param			X-Request-Id		header		string							false	"Request ID"
@Param			organization	body		mmodel.CreateOrganizationInput	true	"Organization Input"
@Success		200				{object}	mmodel.Organization
@Router			/v1/organizations [post]

func (*OrganizationHandler) DeleteOrganizationByID

func (handler *OrganizationHandler) DeleteOrganizationByID(c *fiber.Ctx) error

DeleteOrganizationByID is a method that removes Organization information by a given id.

@Summary		Delete an Organization by ID
@Description	Delete an Organization with the input ID
@Tags			Organizations
@Param			Authorization	header	string	true	"Authorization Bearer Token"
@Param			X-Request-Id		header	string	false	"Request ID"
@Param			id				path	string	true	"Organization ID"
@Success		204
@Router			/v1/organizations/{id} [delete]

func (*OrganizationHandler) GetAllOrganizations

func (handler *OrganizationHandler) GetAllOrganizations(c *fiber.Ctx) error

GetAllOrganizations is a method that retrieves all Organizations.

@Summary		Get all Organizations
@Description	Get all Organizations with the input metadata or without metadata
@Tags			Organizations
@Produce		json
@Param			Authorization	header		string	true	"Authorization Bearer Token"
@Param			X-Request-Id		header		string	false	"Request ID"
@Param			metadata		query		string	false	"Metadata"
@Param			limit			query		int		false	"Limit"			default(10)
@Param			page			query		int		false	"Page"			default(1)
@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)
@Success		200				{object}	mpostgres.Pagination{items=[]mmodel.Organization,page=int,limit=int}
@Router			/v1/organizations [get]

func (*OrganizationHandler) GetOrganizationByID

func (handler *OrganizationHandler) GetOrganizationByID(c *fiber.Ctx) error

GetOrganizationByID is a method that retrieves Organization information by a given id.

@Summary		Get an Organization by ID
@Description	Get an Organization with the input ID
@Tags			Organizations
@Produce		json
@Param			Authorization	header		string	true	"Authorization Bearer Token"
@Param			X-Request-Id		header		string	false	"Request ID"
@Param			id				path		string	true	"Organization ID"
@Success		200				{object}	mmodel.Organization
@Router			/v1/organizations/{id} [get]

func (*OrganizationHandler) UpdateOrganization

func (handler *OrganizationHandler) UpdateOrganization(p any, c *fiber.Ctx) error

UpdateOrganization is a method that updates Organization information.

@Summary		Update an Organization
@Description	Update an Organization with the input payload
@Tags			Organizations
@Accept			json
@Produce		json
@Param			Authorization	header		string							true	"Authorization Bearer Token"
@Param			X-Request-Id		header		string							false	"Request ID"
@Param			id				path		string							true	"Organization ID"
@Param			organization	body		mmodel.UpdateOrganizationInput	true	"Organization Input"
@Success		200				{object}	mmodel.Organization
@Router			/v1/organizations/{id} [patch]

type PortfolioHandler

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

PortfolioHandler struct contains a portfolio use case for managing portfolio related operations.

func (*PortfolioHandler) CreatePortfolio

func (handler *PortfolioHandler) CreatePortfolio(i any, c *fiber.Ctx) error

CreatePortfolio is a method that creates portfolio information.

@Summary		Create a Portfolio
@Description	Create a Portfolio with the input payload
@Tags			Portfolios
@Accept			json
@Produce		json
@Param			Authorization	header		string						true	"Authorization Bearer Token"
@Param			X-Request-Id		header		string						false	"Request ID"
@Param			organization_id	path		string						true	"Organization ID"
@Param			ledger_id		path		string						true	"Ledger ID"
@Param			portfolio		body		mmodel.CreatePortfolioInput	true	"Portfolio Payload"
@Success		200				{object}	mmodel.Portfolio
@Router			/v1/organizations/{organization_id}/ledgers/{ledger_id}/portfolios [post]

func (*PortfolioHandler) DeletePortfolioByID

func (handler *PortfolioHandler) DeletePortfolioByID(c *fiber.Ctx) error

DeletePortfolioByID is a method that removes Portfolio information by a given ids.

@Summary		Delete a Portfolio by ID
@Description	Delete a Portfolio with the input ID
@Tags			Portfolios
@Param			Authorization	header	string	true	"Authorization Bearer Token"
@Param			X-Request-Id		header	string	false	"Request ID"
@Param			organization_id	path	string	true	"Organization ID"
@Param			ledger_id		path	string	true	"Ledger ID"
@Param			id				path	string	true	"Portfolio ID"
@Success		204
@Router			/v1/organizations/{organization_id}/ledgers/{ledger_id}/portfolios/{id} [delete]

func (*PortfolioHandler) GetAllPortfolios

func (handler *PortfolioHandler) GetAllPortfolios(c *fiber.Ctx) error

GetAllPortfolios is a method that retrieves all Portfolios.

@Summary		Get all Portfolios
@Description	Get all Portfolios with the input metadata or without metadata
@Tags			Portfolios
@Produce		json
@Param			Authorization	header		string	true	"Authorization Bearer Token"
@Param			X-Request-Id		header		string	false	"Request ID"
@Param			organization_id	path		string	true	"Organization ID"
@Param			ledger_id		path		string	true	"Ledger ID"
@Param			metadata		query		string	false	"Metadata query"
@Param			limit			query		int		false	"Limit"			default(10)
@Param			page			query		int		false	"Page"			default(1)
@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)
@Success		200				{object}	mpostgres.Pagination{items=[]mmodel.Portfolio,page=int,limit=int}
@Router			/v1/organizations/{organization_id}/ledgers/{ledger_id}/portfolios [get]

func (*PortfolioHandler) GetPortfolioByID

func (handler *PortfolioHandler) GetPortfolioByID(c *fiber.Ctx) error

GetPortfolioByID is a method that retrieves Portfolio information by a given id.

@Summary		Get a Portfolio by ID
@Description	Get a Portfolio with the input ID
@Tags			Portfolios
@Produce		json
@Param			Authorization	header		string	true	"Authorization Bearer Token"
@Param			X-Request-Id		header		string	false	"Request ID"
@Param			organization_id	path		string	true	"Organization ID"
@Param			ledger_id		path		string	true	"Ledger ID"
@Param			id				path		string	true	"Portfolio ID"
@Success		200				{object}	mmodel.Portfolio
@Router			/v1/organizations/{organization_id}/ledgers/{ledger_id}/portfolios/{id} [get]

func (*PortfolioHandler) UpdatePortfolio

func (handler *PortfolioHandler) UpdatePortfolio(i any, c *fiber.Ctx) error

UpdatePortfolio is a method that updates Portfolio information.

@Summary		Update a Portfolio
@Description	Update a Portfolio with the input payload
@Tags			Portfolios
@Accept			json
@Produce		json
@Param			Authorization	header		string						true	"Authorization Bearer Token"
@Param			X-Request-Id		header		string						false	"Request ID"
@Param			organization_id	path		string						true	"Organization ID"
@Param			ledger_id		path		string						true	"Ledger ID"
@Param			id				path		string						true	"Portfolio ID"
@Param			portfolio		body		mmodel.UpdatePortfolioInput	true	"Portfolio Payload"
@Success		200				{object}	mmodel.Portfolio
@Router			/v1/organizations/{organization_id}/ledgers/{ledger_id}/portfolios/{id} [patch]

type SegmentHandler

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

SegmentHandler struct contains a segment use case for managing segment related operations.

func (*SegmentHandler) CreateSegment

func (handler *SegmentHandler) CreateSegment(i any, c *fiber.Ctx) error

CreateSegment is a method that creates segment information.

@Summary		Create a Segment
@Description	Create a Segment with the input payload
@Tags			Segments
@Accept			json
@Produce		json
@Param			Authorization	header		string						true	"Authorization Bearer Token"
@Param			X-Request-Id		header		string						false	"Request ID"
@Param			organization_id	path		string						true	"Organization ID"
@Param			ledger_id		path		string						true	"Ledger ID"
@Param			segment			body		mmodel.CreateSegmentInput	true	"Segment"
@Success		200				{object}	mmodel.Segment
@Router			/v1/organizations/{organization_id}/ledgers/{ledger_id}/segments [post]

func (*SegmentHandler) DeleteSegmentByID

func (handler *SegmentHandler) DeleteSegmentByID(c *fiber.Ctx) error

DeleteSegmentByID is a method that removes Segment information by a given ids.

@Summary		Delete a Segment by ID
@Description	Delete a Segment with the input ID
@Tags			Segments
@Param			Authorization	header	string	true	"Authorization Bearer Token"
@Param			X-Request-Id		header	string	false	"Request ID"
@Param			organization_id	path	string	true	"Organization ID"
@Param			ledger_id		path	string	true	"Ledger ID"
@Param			id				path	string	true	"Segment ID"
@Success		204
@Router			/v1/organizations/{organization_id}/ledgers/{ledger_id}/segments/{id} [delete]

func (*SegmentHandler) GetAllSegments

func (handler *SegmentHandler) GetAllSegments(c *fiber.Ctx) error

GetAllSegments is a method that retrieves all Segments.

@Summary		Get all Segments
@Description	Get all Segments with the input metadata or without metadata
@Tags			Segments
@Produce		json
@Param			Authorization	header		string	true	"Authorization Bearer Token"
@Param			X-Request-Id		header		string	false	"Request ID"
@Param			organization_id	path		string	true	"Organization ID"
@Param			ledger_id		path		string	true	"Ledger ID"
@Param			metadata		query		string	false	"Metadata"
@Param			limit			query		int		false	"Limit"			default(10)
@Param			page			query		int		false	"Page"			default(1)
@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)
@Success		200				{object}	mpostgres.Pagination{items=[]mmodel.Segment,page=int,limit=int}
@Router			/v1/organizations/{organization_id}/ledgers/{ledger_id}/segments [get]

func (*SegmentHandler) GetSegmentByID

func (handler *SegmentHandler) GetSegmentByID(c *fiber.Ctx) error

GetSegmentByID is a method that retrieves Segment information by a given id.

@Summary		Get a Segment by ID
@Description	Get a Segment with the input ID
@Tags			Segments
@Produce		json
@Param			Authorization	header		string	true	"Authorization Bearer Token"
@Param			X-Request-Id		header		string	false	"Request ID"
@Param			organization_id	path		string	true	"Organization ID"
@Param			ledger_id		path		string	true	"Ledger ID"
@Param			id				path		string	true	"Segment ID"
@Success		200				{object}	mmodel.Segment
@Router			/v1/organizations/{organization_id}/ledgers/{ledger_id}/segments/{id} [get]

func (*SegmentHandler) UpdateSegment

func (handler *SegmentHandler) UpdateSegment(i any, c *fiber.Ctx) error

UpdateSegment is a method that updates Segment information.

@Summary		Update a Segment
@Description	Update a Segment with the input payload
@Tags			Segments
@Accept			json
@Produce		json
@Param			Authorization	header		string						true	"Authorization Bearer Token"
@Param			X-Request-Id		header		string						false	"Request ID"
@Param			organization_id	path		string						true	"Organization ID"
@Param			ledger_id		path		string						true	"Ledger ID"
@Param			id				path		string						true	"Segment ID"
@Param			segment			body		mmodel.UpdateSegmentInput	true	"Segment"
@Success		200				{object}	mmodel.Segment
@Router			/v1/organizations/{organization_id}/ledgers/{ledger_id}/segments/{id} [patch]

Jump to

Keyboard shortcuts

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