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

No relationship between Product and department #24

Open
ademulegun opened this issue Jun 8, 2019 · 7 comments
Open

No relationship between Product and department #24

ademulegun opened this issue Jun 8, 2019 · 7 comments

Comments

@ademulegun
Copy link

From your database schema, i cant find a relationship between product and department, which makes this enpoint confusing (/products/inDepartment/{department_id})

@edertaveiraturing
Copy link

So, you can reach the products from the department through categories, since one department can have many categories and one category can have many products, you can get products from the department.

@sabyrzhan
Copy link

there is a catalog_get_products_on_department procedure that you can use. However the procedure has error: does not have p.display in select statement in order to order the result. So this sql scripts need a fix.

@abeltsew
Copy link

I am having the same error on SP call to catalog_get_products_on_department,
has anybody found a fix?

@sabyrzhan
Copy link

Well you have 2 ways:

  1. fix the procedure locally and go with it.
  2. write your own procedure or SQL script.
    Think better way is the first.

@innoflash
Copy link

innoflash commented Aug 16, 2019

For a normal shopping cart you add products to cart as you please,

i suppose thats why we have the **/shoppingcart/add** route and 
the **product_id** column in the cart

next you will see a route that queries products in a cart so i think these 2 models are related directly and not through another

@sbansa1
Copy link

sbansa1 commented Aug 21, 2019

Exactly what I am thinking. Well there should atleast be a foreign key. Since one department can have many products.

@Basttyy
Copy link

Basttyy commented Oct 4, 2019

Exactly what I am thinking. Well there should atleast be a foreign key. Since one department can have many products.

there is no need for that. product can get to departments through categories

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants