requests

package
v0.0.0-...-adc1c8a Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CatalogResponse

type CatalogResponse struct {
	Price float32 `json:"price"`
}

type CheckoutBasketRequest

type CheckoutBasketRequest struct {
	Address     string `json:"address" validate:"required,min=3,max=512"`
	Email       string `json:"email" validate:"required,email"`
	Name        string `json:"name" validate:"required,min=3,max=128"`
	PhoneNumber string `json:"phoneNumber" validate:"required,min=8,max=512"`
}

func (*CheckoutBasketRequest) Bind

func (r *CheckoutBasketRequest) Bind(c *fiber.Ctx, order *CreateOrderRequest, v *validator.Validate) error

type CreateBasketItemRequest

type CreateBasketItemRequest struct {
	CatalogId string `json:"catalogId" validate:"required,uuid"`
	Quantity  uint   `json:"quantity" validate:"required,min=1"`
}

type CreateBasketRequest

type CreateBasketRequest struct {
	Items []CreateBasketItemRequest `json:"items" validate:"dive"`
}

func (*CreateBasketRequest) Bind

func (r *CreateBasketRequest) Bind(c *fiber.Ctx, basket *models.Basket, v *validator.Validate) error

type CreateOrderRequest

type CreateOrderRequest struct {
	Address     string        `json:"address"`
	Email       string        `json:"email"`
	Name        string        `json:"name"`
	PhoneNumber string        `json:"phoneNumber"`
	Basket      models.Basket `json:"basket"`
	UserId      uuid.UUID     `json:"userId"`
}

type UpdateBasketItemRequest

type UpdateBasketItemRequest struct {
	Id        string `json:"id" validate:"omitempty,uuid"`
	CatalogId string `json:"catalogId" validate:"required,uuid"`
	Quantity  uint   `json:"quantity" validate:"required,min=1"`
}

type UpdateBasketRequest

type UpdateBasketRequest struct {
	Items []UpdateBasketItemRequest `json:"items" validate:"dive"`
}

func (*UpdateBasketRequest) Bind

func (r *UpdateBasketRequest) Bind(c *fiber.Ctx, basket *models.Basket, v *validator.Validate) error

Jump to

Keyboard shortcuts

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