CivicTechFredericton / mealplanner

Primary Meal Planner repo
MIT License
9 stars 18 forks source link

[FEATURE] Ingredient table and product keyword introduced #538

Open shanthisa opened 7 months ago

shanthisa commented 7 months ago

Is your feature request related to a problem? Please describe. Earlier the product and the ingredient was connected with a foreign key relation. This made it very difficult to do data entry. To simplify this I came up with this loosely coupling solution.

Describe the solution you'd like The ingredient will be connected to the meal recipe with the foreign key relation. The ingredient will additionally have a keyword called the product_keyword which will refer to the possible main product name. Eg: If the ingredient says 'Freshly chopped Parsley', the product keyword would say 'Parsley'. This product_keyword is also present as an array in the product table. Also there are ingredients which say with an 'or'. Example1: Butter or Margerine, Example2: Haddock, Cod, Hake or Bluefish Now these are different products but mentioned as the same ingredient. These ingredients are split and are included with product keywords. In order to connect them as the ingredient name, I have an introduced an additional key substitute ingredient_id and substitute_reason where the primary ingredient id is stored as substitute_ingredient_id and users can choose to give a substitute_reason incase they would like to search or filter based on this reason in future.

Describe alternatives you've considered Tried to keep the measure. But it was not scalable to the data.

Additional context I created a recipe assistant outside this meal planner project with AI prompts and scraper API to derive the products for the ingredients.

folaj034 commented 4 months ago

@RLCASTRO, @shanthisa : I think this has to be reviewed by a developer.