Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Error ¶
Error represents a custom error object that includes an HTTP status code
func (*Error) ToResponse ¶
ToResponse converts the error into a JSON response
type ErrorResponse ¶
type ErrorResponse struct {
Message string `json:"message"`
}
ErrorResponse represents the structure for error responses
type Product ¶
type Product struct { ID string `json:"_id" validate:"required"` Name string `json:"name" validate:"required"` Description string `json:"description" validate:"required"` Price float64 `json:"price" validate:"required,gt=0"` Category Category `json:"category" validate:"required"` Parents []Product `json:"parents" validate:"customParentsValidation"` Children []Product `json:"children" validate:"customChildrenValidation"` Discounts []Discount `json:"discounts" validate:"customDiscountsValidation"` Attributes []Attribute `json:"attributes" validate:"customAttributesValidation"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` }
func (*Product) ValidateProductData ¶
type ProductResponse ¶
Click to show internal directories.
Click to hide internal directories.