1

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).

enter image description here

3
  • Could you add one or two Use Cases with which the persons that use your system, will interact with that application as a whole? Maybe this can give us some insights on the workings of the database.
    – kiltek
    Oct 26, 2018 at 10:53
  • @kiltek Sure! Updating question now Oct 26, 2018 at 11:09
  • @kiltek Updated, please see question again! Oct 26, 2018 at 11:13

1 Answer 1

-1

Having read your now-edited question...

I think you need a Customer-Product link table on which the price lives. CustomerProduct has a customer id, product id, and compulsory price field (maybe even currency depending on your customer base?)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.