I am making a b2b-webshop system that will have multiple customers. Each customer will have a separate active pricelist which contains the products that they can buy and the prices that applies for that customer.
I am struggling designing this. What is a good practice?
My database looks like below right now, and Im thinking about adding a Pricelist-table that contains which products are active, price and a customerId and then queyring this to get products to display for each customer. But it seems a little backwards?
Use case 1:
Admin adds a new product. The product will be on display for customer with ID 4. Admin goes to the pricelist admin-page and adds the new product to customer 4's pricelist which contains 0-X products. Admin sets the price that this customer will have for that product and clicks save.
Use case 2:
A customer goes in to the order page. A list of products are shown based on the items in a pricelist set up for this customer(ID 4).