dtos

package
v0.0.0-...-4b4a10f Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateProductRequestDto

type CreateProductRequestDto struct {
	Name        string  `json:"name" validate:"required"`
	Description string  `json:"description"`
	Price       float64 `json:"price" validate:"required"`
}

type CreateProductResponseDto

type CreateProductResponseDto struct {
	ProductID uuid.UUID `json:"productId"`
}

type GetProductByIdRequestDto

type GetProductByIdRequestDto struct {
	ProductId uuid.UUID `param:"id" json:"-"`
}

type GetProductByIdResponseDto

type GetProductByIdResponseDto struct {
	Product *ProductResponseDto `json:"product"`
}

type GetProductsRequestDto

type GetProductsRequestDto struct {
	*utils.ListQuery
}

type GetProductsResponseDto

type GetProductsResponseDto struct {
	Products *utils.ListResult[*ProductResponseDto]
}

type ProductResponseDto

type ProductResponseDto struct {
	ProductID   uuid.UUID `json:"productId"`
	Name        string    `json:"name"`
	Description string    `json:"description"`
	Price       float64   `json:"price"`
	CreatedAt   time.Time `json:"createdAt"`
	UpdatedAt   time.Time `json:"updatedAt"`
}

type SearchProductsRequestDto

type SearchProductsRequestDto struct {
	SearchText       string `query:"search" json:"search"`
	*utils.ListQuery `json:"listQuery"`
}

type SearchProductsResponseDto

type SearchProductsResponseDto struct {
	Products *utils.ListResult[*ProductResponseDto]
}

type UpdateProductRequestDto

type UpdateProductRequestDto struct {
	ProductID   uuid.UUID `json:"-" param:"id"`
	Name        string    `json:"name" validate:"required"`
	Description string    `json:"description"`
	Price       float64   `json:"price" validate:"required"`
}

type UpdateProductResponseDto

type UpdateProductResponseDto struct {
	ProductID uuid.UUID `json:"productId"`
}

Jump to

Keyboard shortcuts

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