From a72a57fbe1eb8a44a9697979ba360f20706c28dd Mon Sep 17 00:00:00 2001 From: Neur0toxine Date: Thu, 28 Dec 2023 12:52:45 +0300 Subject: [PATCH] add services support --- api-client-go | 1 - types.go | 33 +++++++++++++++++++++------------ 2 files changed, 21 insertions(+), 13 deletions(-) delete mode 160000 api-client-go diff --git a/api-client-go b/api-client-go deleted file mode 160000 index 5c6d2eb..0000000 --- a/api-client-go +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5c6d2ebead217f5916767a9a542117fa496c677b diff --git a/types.go b/types.go index 6e72ebf..bb51ef2 100644 --- a/types.go +++ b/types.go @@ -1057,24 +1057,33 @@ type ProductGroup struct { // BaseProduct type. type BaseProduct struct { - Name string `json:"name,omitempty"` - URL string `json:"url,omitempty"` - Article string `json:"article,omitempty"` - ExternalID string `json:"externalId,omitempty"` - Manufacturer string `json:"manufacturer,omitempty"` - Description string `json:"description,omitempty"` - Popular bool `json:"popular,omitempty"` - Stock bool `json:"stock,omitempty"` - Novelty bool `json:"novelty,omitempty"` - Recommended bool `json:"recommended,omitempty"` - Active bool `json:"active,omitempty"` - Markable bool `json:"markable,omitempty"` + Name string `json:"name,omitempty"` + Type ProductType `json:"type,omitempty"` + URL string `json:"url,omitempty"` + Article string `json:"article,omitempty"` + ExternalID string `json:"externalId,omitempty"` + Manufacturer string `json:"manufacturer,omitempty"` + Description string `json:"description,omitempty"` + Popular bool `json:"popular,omitempty"` + Stock bool `json:"stock,omitempty"` + Novelty bool `json:"novelty,omitempty"` + Recommended bool `json:"recommended,omitempty"` + Active bool `json:"active,omitempty"` + Markable bool `json:"markable,omitempty"` } +type ProductType string + +const ( + RegularProduct ProductType = "product" + ServiceProduct ProductType = "service" +) + // Product type. type Product struct { BaseProduct ID int `json:"id,omitempty"` + Type ProductType `json:"type"` MaxPrice float32 `json:"maxPrice,omitempty"` MinPrice float32 `json:"minPrice,omitempty"` ImageURL string `json:"imageUrl,omitempty"`