discount

package
v0.0.0-...-c52fe67 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2020 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	DiscountService service.DiscountService
}

func NewHandler

func NewHandler(params Params) Handler

func (Handler) Create

func (h Handler) Create(c echo.Context) error

swagger:route POST /discounts discounts reqDiscountCreate

Create discount data

This endpoint will create or update the discount and return the discount structure

Responses:
  200: Discount
  400: HTTPError
  404: HTTPError
  500: HTTPError

func (Handler) Delete

func (h Handler) Delete(c echo.Context) error

swagger:route DELETE /discounts/{id} discounts reqDiscountGetByID

Delete a discount by ID

This endpoint deletes discount and returns 204 response code (no content).

Responses:
  204:
  400: HTTPError
  404: HTTPError
  500: HTTPError

func (Handler) GetByFilter

func (h Handler) GetByFilter(c echo.Context) error

swagger:route GET /discounts discounts reqDiscountGetByFilter

Getting a list of discounts by filter. It returns only current user discounts.

This endpoint returns a list of discount structures

Responses:
  200: DiscountList
  500: HTTPError

func (Handler) GetByID

func (h Handler) GetByID(c echo.Context) error

swagger:route GET /discounts/{id} discounts reqDiscountGetByID

Getting a discount by ID

This endpoint returns the discount structure

Responses:
  200: Discount
  400: HTTPError
  404: HTTPError
  500: HTTPError

func (Handler) Update

func (h Handler) Update(c echo.Context) error

swagger:route PUT /discounts/{id} discounts reqDiscountUpdate

Update discount data

This endpoint will create or update the discount and return the discount structure

Responses:
  200: Discount
  400: HTTPError
  404: HTTPError
  500: HTTPError

type Params

type Params struct {
	fx.In

	DiscountService service.DiscountService
}

Jump to

Keyboard shortcuts

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