From 4edf1819db85f7e147f7717fc6a1fdc9ac3f1e42 Mon Sep 17 00:00:00 2001 From: LightJack05 <66321084+LightJack05@users.noreply.github.com> Date: Thu, 5 Feb 2026 20:35:57 +0100 Subject: [PATCH 1/2] feat: Add quantity to product --- internal/database/product/product.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/database/product/product.go b/internal/database/product/product.go index 280d948..e70cd54 100644 --- a/internal/database/product/product.go +++ b/internal/database/product/product.go @@ -4,6 +4,7 @@ type Product struct { ID_ string `json:"_id" bson:"_id"` Brands string `json:"brands" bson:"brands"` ProductName string `json:"product_name" bson:"product_name"` + Quantity string `json:"quantity" bson:"quantity"` Nutriments struct { SaturatedFat float64 `json:"saturated-fat" bson:"saturated-fat,truncate"` SodiumValue float64 `json:"sodium_value" bson:"sodium_value,truncate"` From 7da4f837fcb060ac6cf398892c1093a075e16697 Mon Sep 17 00:00:00 2001 From: LightJack05 <66321084+LightJack05@users.noreply.github.com> Date: Thu, 5 Feb 2026 20:36:15 +0100 Subject: [PATCH 2/2] Added quantity to swagger docs --- docs/docs.go | 3 +++ docs/swagger.json | 3 +++ docs/swagger.yaml | 2 ++ 3 files changed, 8 insertions(+) diff --git a/docs/docs.go b/docs/docs.go index 6f0b677..82f7beb 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -498,6 +498,9 @@ const docTemplate = `{ }, "product_name": { "type": "string" + }, + "quantity": { + "type": "string" } } }, diff --git a/docs/swagger.json b/docs/swagger.json index a99fb2b..b38be6f 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -491,6 +491,9 @@ }, "product_name": { "type": "string" + }, + "quantity": { + "type": "string" } } }, diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 2380081..25d8da4 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -239,6 +239,8 @@ definitions: type: object product_name: type: string + quantity: + type: string type: object product.getProductByIdResponse: properties: