1
I am having difficulties in implementing a requirement in database modeling, this requirement corresponds to product returns.
This is the scenario that occurs the returns and the different modes of return of products:
- Customer buys only one product and returns the same;
- Customer buys two or more products and returns only one of them;
- Customer buys a Kit that contains several products and returns the Kit whole;
- Customer buys a Kit that contains several products and returns some products of this kit;
I created an example to illustrate the modeling of the sales module, so that you understand the logic, follow the image:
The diagram above illustrates how this my database in relation to product sales, however I did not put all fields if it would not contain much information hindering understanding, but the logic is this, also I did not put the table of Salesman nor that of Client, but, both relate to the table of Sales.
You will need to register the following return information:
Products developed or Kits;
The customer responsible for the return;
The seller to whom the customer has returned the product(s));
The corresponding sale;
Time and date of return;
The field id_kit on the table Item, may contain values 0 (null), this table may represent an Item as a product of sale or a Kit as a product.
With the above information how can I model the (s) table(s) corresponding to product returns?
This diagram was made in brModel ne?
– user28595
Yes I used it to create the diagram.
– gato
Well q noticed that I had already seen the type of diagram somewhere :D
– user28595
when a sale happens only the output of a product the value of the field id_kit is 0?
– Ari
I edited the question.
– gato