E-commerce order system and Order Management System
Order System Design
Overall Design
1. The time for each order is less than 3 seconds. 2. The inventory verification does not involve multiple purchases. 3. The order can be split according to different supplier processes. 4. The logistics information can be returned.
Order State Machine Design
1. Waiting for System Review 2. Waiting for payment 3. Waiting for shipment 4. Waiting for receipt 5. completed 6. Order closed
Order Status flow is shown in:
1) review failed 2) Unpaid (24 hours to be paid) 3) Payment failed 4) delivery failure the above four statuses are the reasons for order closure
- The review fails in the following situations during the review:
1) the same user has returned the ticket three times in the past month.
2) The user refuses to pay for the delivery of goods
3) The user's delivery address cannot be delivered more than three times, and the phone number cannot be contacted.
4) Conflicts with distribution personnel
5) blacklist of other channels
1. For promotional products: here we use locking inventory during payment, deducting inventory upon successful payment, and releasing inventory upon payment failure. Of course, when there is no inventory, you cannot add a shopping cart on the product details page to determine the purchase intention, without affecting other users. The buyer and the seller are not slow, and the technical or processing function logic is also good.
2. for general commodities: when an Order is generated, the number of available inventories is reduced, and the number of Order-Occupied inventories (Order Occupied Inventory) increases. The changed quantity is the number of products in the Order, this is easy to understand: Order generation and warehouse delivery are asynchronous in terms of time. This method ensures that the inventory of orders has been generated, and the customers can receive goods smoothly. In addition, when placing orders, they can ensure that products are delivered. If you do not set up an order to occupy inventory, the customer will place an order and the inventory will be unavailable. When processing an order, only the inventory occupied by the order is targeted, and it has nothing to do with the sales at the front-end. After the order is delivered, only the inventory occupied by the order is deducted from the system.
Because there are multiple suppliers in the e-commerce website, a single order can contain multiple suppliers, so we need to split the orders according to different suppliers to form the concept of sub-parent orders.