package validation type SupplierPrice struct { SupplierID uint `json:"supplier_id" validate:"required,gt=0"` Price float64 `json:"price" validate:"required,gte=0"` } type Create struct { Name string `json:"name" validate:"required_strict,min=3,max=50"` UomID uint `json:"uom_id" validate:"required,gt=0"` Suppliers []SupplierPrice `json:"suppliers,omitempty" validate:"omitempty,dive"` Flags []string `json:"flags" validate:"dive,max=50"` } type Update struct { Name *string `json:"name,omitempty" validate:"omitempty,min=3,max=50"` UomID *uint `json:"uom_id,omitempty" validate:"omitempty,gt=0"` Suppliers *[]SupplierPrice `json:"suppliers,omitempty" validate:"omitempty,dive"` Flags *[]string `json:"flags,omitempty" validate:"omitempty,dive,max=50"` } type Query struct { Page int `query:"page" validate:"omitempty,number,min=1"` Limit int `query:"limit" validate:"omitempty,number,min=1,max=100"` Search string `query:"search" validate:"omitempty,max=50"` SupplierID uint `query:"supplier_id" validate:"omitempty,gt=0"` }