Skip to content

Commit

Permalink
Add to schema. Sync with OFF
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Feb 9, 2024
1 parent 7c70a5d commit 51a84ea
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ class ProductFull(ProductCreate):
description="quantity unit of the product: g or ml (depending on the product).",
examples=["g", "ml"],
)
categories_tags: list = Field(
description="categories of the product.",
examples=[["en:breakfasts", "en:spreads"]],
)
brands: str | None = Field(
description="brand(s) of the product.",
examples=["Rigoni di Asiago", "Lindt"],
Expand Down
1 change: 1 addition & 0 deletions app/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def init_sentry(sentry_dsn: str | None, integrations: list[Integration] | None =
"product_name",
"product_quantity",
"product_quantity_unit",
"categories_tags",
"brands",
"image_url",
"unique_scans_n",
Expand Down
3 changes: 3 additions & 0 deletions tests/integration/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def override_get_db():
product_name="Chestnut spread 500 g",
product_quantity=500,
product_quantity_unit="g",
categories_tags=["en:spreads", "en:nuts-and-their-products"],
brands="Clément Faugier",
source="off",
unique_scans_n=20,
Expand All @@ -57,6 +58,7 @@ def override_get_db():
product_name="Chestnut spread 100 g",
product_quantity=100,
product_quantity_unit="g",
categories_tags=["en:spreads", "en:nuts-and-their-products"],
brands="Clément Faugier",
source="off",
unique_scans_n=10,
Expand All @@ -66,6 +68,7 @@ def override_get_db():
product_name="Crème bio de châtaignes 320 g",
product_quantity=320,
product_quantity_unit="g",
categories_tags=["en:spreads", "en:nuts-and-their-products"],
brands="Ethiquable",
source="off",
unique_scans_n=0,
Expand Down

0 comments on commit 51a84ea

Please sign in to comment.