Product
// Product represents a product in the system.
type Product struct {
ID int `json:"id"` // unique identifier
Name string `json:"name"` // name of the product
Description string `json:"description"` // description of the product
CategoryId int `json:"category"` // category of the product
SubCategoryId int `json:"subCategory"` // sub-category of the product
ImageURL string `json:"imageUrl"` // URL to the product image
Price int `json:"price"` // price of the product in cents
PreviousPrice int `json:"previousPrice"` // previous price of the product in cents
Offered bool `json:"offered"` // whether the product is offered
}
Products
// Products represents a collection of products.
type Products struct {
Data []*Product `json:"data"`
}
Product Request Params
// ProductRequestParams represents the parameters required to create or update a product.
type ProductRequestParams struct {
Name string `json:"name"`
Description string `json:"description"`
CategoryId int `json:"category"`
SubCategoryId int `json:"subCategory"`
ImageURL string `json:"imageUrl"`
Price int `json:"price"`
PreviousPrice int `json:"previousPrice"`
Offered bool `json:"offered"`
}