dto

package
v0.0.0-...-aec1c34 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicQueryParam

type BasicQueryParam struct {
	Paginator struct {
		Page     int
		PageSize int
	}
	Filter struct {
		OrederBy []string
	}
}

BasicQueryParam should be used to param basic pagination and orderby queryparams

func NewBasicQueryParam

func NewBasicQueryParam() *BasicQueryParam

type CreateMerchantRequest

type CreateMerchantRequest struct {
	Name string `json:"name"`
}

type CreateMerchantResponse

type CreateMerchantResponse struct {
	ID  uuid.UUID `json:"id,omitempty"`
	Err error     `json:"error,omitempty"`
}

func (CreateMerchantResponse) Failed

func (resp CreateMerchantResponse) Failed() error

type CreateProductRequest

type CreateProductRequest struct {
	MID   uuid.UUID `json:"merchant_id"`
	Name  string    `json:"name"`
	Desc  string    `json:"description"`
	Qty   int       `json:"qty"`
	Price float32   `json:"price"`
}

type CreateProductResponse

type CreateProductResponse struct {
	ID  uuid.UUID `json:"id,omitempty"`
	Err error     `json:"err,omitempty"`
}

func (CreateProductResponse) Failed

func (resp CreateProductResponse) Failed() error

type CustomClaim

type CustomClaim struct {
	*stdjwt.StandardClaims
	AccntID uint   `json:"accnt_id"`
	Email   string `json:"email"`
	Role    string `json:"role"`
}

CustomClaim defines the claim to be used in JWT

type ListMerchantResponse

type ListMerchantResponse struct {
	Merchants []MerchantDetailResponse `json:"merchants,omitempty"`
	Err       error                    `json:"err,omitempty"`
}

func (ListMerchantResponse) Failed

func (resp ListMerchantResponse) Failed() error

type ListProductResponse

type ListProductResponse struct {
	Products []ProductDetailsResponse `json:"products,omitempty"`
	Err      error                    `json:"error,omitempty"`
}

func (ListProductResponse) Failed

func (resp ListProductResponse) Failed() error

type MerchantDetailResponse

type MerchantDetailResponse struct {
	ID   uuid.UUID `json:"id,omitempty"`
	Name string    `json:"name,omitempty"`
	Err  error     `json:"err,omitempty"`
}

type ProductDetailsResponse

type ProductDetailsResponse struct {
	ID       uuid.UUID `json:"id,omitempty"`
	Name     string    `json:"name,omitempty"`
	LowStock *bool     `json:"low_stock,omitempty"`
	Price    float32   `json:"price,omitempty"`
	Desc     string    `json:"description,omitempty"`
	Err      error     `json:"error,omitempty"`
}

Jump to

Keyboard shortcuts

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