it seems OrderLine has OrderItems, why? #1171
Replies: 1 comment
-
|
Yes, the reason is that it helps Vendure do proper stock & tax management. The reasons are not immediately obvious but in certain complex scenarios they are very useful. For instance, an Order with a promotion, "10% off order total". In order to correctly manage taxation, this discount must be split up and proportionally applied to all items in the order, reducing the sale price of each OrderItem. In some circumstances, a single OrderLine with e.g. a quantity of 3 might end up with a 1-penny difference in the price of each OrderItem. This in unavoidable and is part of correctly handing taxes. Now let's say one of these items gets returned. We already know exactly how much each OrderItem was worth, so we can more easily refund the correct amount. On top of this, we can tie a return to a specific OrderItem which provides a more auditable history for stock tracking purposes. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
it seems order item object is extra and not necessary in order
i see many eccommerce platform and they never define two orderline and orderitem together
why u model this two model
is there reason i didn't see ?
Beta Was this translation helpful? Give feedback.
All reactions