ChickenKyiv / recipe-search-api

https://loopback-recipe-search.herokuapp.com/explorer/#!/Recipe/Recipe_find
GNU Affero General Public License v3.0
2 stars 5 forks source link

update attributes #23

Open atherdon opened 6 years ago

atherdon commented 6 years ago
attributes :
course : An array of the cources associated with this recipe.
cuisine : An array of the cuisines associated with this recipe.
holiday : An array of the holidays associated with this recipe.
flavors : The flavor scores for this recipe.
salty : Saltiness on a range of 0 to 1.
sour : Sourness on a range of 0 to 1.
sweet : Sweetness on a range of 0 to 1.
bitter : Bitterness on a range of 0 to 1.
meaty : Savoryness on a range of 0 to 1.
piquant : Spiciness on a range of 0 to 1.
sanjeeb-sang commented 6 years ago

When adding course attribute to recipe, don't I have to create a new course model and create one to many or many-to-many relation between course and recipe. The same goes for cuisine, holiday and flavors.

atherdon commented 6 years ago

yeah, you right @sanjeeb9853 1-to-many relation (one recipe - few attributes(i.e. few courses))

sanjeeb-sang commented 6 years ago

Hi @atherdon I updated the attributes and have created a pull request, it's at https://github.com/ChickenKyiv/recipe-search-api/pull/66.

atherdon commented 6 years ago

@sanjeeb9853 yeah, i saw it, but i this is not exactly what we needed here. we faced a similar probem before, when we also added separated relations for diets, allergies, etc. But we decide to simplify the database logic and instead of having 5 relations - we add an attribute field, and this field contain all the stuff. so i think we should create an arrays, each of them will be related to one field, like saulty and then we'll add that arrays to our import script, that stored at bin folder. Tell me if this is not clear - adn i'll explain more

atherdon commented 6 years ago

@sanjeeb9853 tell me what should be our next steps