Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Sales format #10412

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Draft

chore: Sales format #10412

wants to merge 11 commits into from

Conversation

aleene
Copy link
Contributor

@aleene aleene commented Jun 6, 2024

What

Add sales format attribute to specific categories of the Categories Taxonomy. These categories are used by Prices to determine which categories should be shown to the user when entering prices by weight/volume or item.

The attribute is sales_format:en:

Possible values :

  • package for products that have a barcode;
  • weight for products sold by weight (potatoes, cereals, etc.);
  • volume for products sold by volume (olive oil, coffee (small, medium, large), etc.)
  • item for products sold by piece (melon, lemon, croissant)
    A product could have multiple sales formats. Thus a kiwi can be sold in a package of 6 kiwis, individually per piece or barcode, or by weight.

The attribute leverages the tree structure, thus a parent node determines the values of its children.

All top parents will be set to sales_format:en:package, as is the standard for OFF is now based on package/barcode.

@aleene aleene marked this pull request as draft June 6, 2024 16:29
@github-actions github-actions bot added 🧬 Taxonomies https://wiki.openfoodfacts.org/Global_taxonomies categories labels Jun 6, 2024
replaces en:eggs in order to exclude other children
Shouldn't this be limited to specific children?
@aleene
Copy link
Contributor Author

aleene commented Jun 6, 2024

Start out with:

PARENT_CATEGORIES_ID = [
"en:vegetables", # 391 descendants
"en:fruits", # 287
"en:culinary-plants", # 152
"en:breads", # 103
"en:nuts", # 77
"en:viennoiseries", # 47
"en:potatoes", # 27
"en:eggs", # 21
"en:textured-vegetable-protein" # 2]

EXTRA_CHILDREN = [
"en:rolled-oats",
"en:ginger",
"en:mushrooms",
"en:candies"]

ADDITIONAL_FILTERING = [
"Cooked",
"Fresh",
"Frozen",
"Canned"]

Set to the Rhizomes only
Copy link

sonarcloud bot commented Jun 8, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
categories 🧬 Taxonomies https://wiki.openfoodfacts.org/Global_taxonomies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant