Some questions about the order module in e-commerce

is the logic of price calculation in order service when calculating activity promotion in order operation?

if a coupon is used in an order or a promotion produces a discount, how is it recorded, while the other order discount information is associated with the table? How do you record the discounts shared on each item?

Mar.10,2021

although it is not a Java question, let me give you an answer. My basic idea is:

  1. everything is an object
  2. promotional prices should not be calculated in the order service, but should be given to the promotional service (coupons, discounts, buy and send, etc.).
  3. the order service should just take the information provided by all other services to generate orders, such as membership information, product information, promotion information, and finally generate order information.

the third point is the most important, because all the information is mixed up, which may also be where you get confused. At this time, it is necessary for Jobs to return to the most simple way of thinking, first know all the information in mind (to complex), and then grasp the most essential thing of the order (to simplicity). In my opinion, the order is just the commodity + unit price + subtotal + other expenses + total (of course, you can record the member id,sku, promotion id and other convenient troubleshooting and follow-up statistical analysis, such as the discount information apportioned to each item).

although the design is not the best, only the most suitable, the key is the tradeoff. You can do whatever you want. it depends on your choice.
I haven't done an e-commerce system for a long time. I hope a little advice will help you. O ( _ ) O Thank you

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eb5099-251f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eb5099-251f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?