-2
I am in a virtual store project and I have a question about the stock control process.
Initially I’m doing everything on the table product
where I have two camps: manage_stock
and stock
. Manage Stock will control whether or not the product will have stock control at the time of sales and Stock is the stock in question.
When an order has its status marked as paid I direct decrease in the product in the column stock
.
Follows structure of the table:
Tabela product
id name manage_stock stock
1 Mouse 0 NULL
2 Teclado 1 50
3 Monitor 1 10
4 Gabinete 0 5
Table product
Is this logic correct? or should I create a table only for the stock linking the product. The drop in stock is a simple direct decrease in the table produtc
?
If each product has a stock as well as a stock only has a product can soon have a column of
stock
in the product table itself– Miguel
I voted to close as unclear because only with this information can only you answer this.
– Maniero
What information about logic should I include in the question? I passed the way I thought I was right and would like to know if I can improve the logic. @bigown your comment could be constructive if you indicated how I should improve the question or logic
– Dagobe
Putting in more information, I have no way of knowing what you need, what you’re doing. At the moment the possible answer is that it may be better. The other way is to do a full tutorial on stock control that, in addition to making the question broad, may be of no use to this case. Stock control is often absurdly more complex than this. But if these are your requirements, it’s all right. Did it help you at all? I don’t think so. The question also doesn’t help to give another answer.
– Maniero