订单状态设计

关于数据库‘状态’字段设计的思考与实践 - 倒骑的驴 - 博客园

KEY VALUE
CREATE_FAILED 创建订单失败(终态)
PAY_WAITTING 等待买家付款
PAY_CONFIRMING 付款确认中
PAY_FAILED 买家付款失败(终态,依赖需求而定)
PAY_SUCCESS 买家付款成功
DELIVERED 卖家已发货
RECEIVED 买家已收货
RETURNING 退货中
RETURN_SUCCESS 退货成功(终态)
CLOSED 订单关闭(终态)

拆表

order: 根据商家(provider_id)的维度来拆单;
order_item: 根据规格(product_id)的维度来拆单;

拆状态

STATUS: ‘PENDING’,’AUTO_CLOSED’,’CLOSED’,’REVIEW_FAIL’,’REVIEWED’,’PICK_FAIL’,’PICKED’,’FINISHED’

PAY_STATUS: ‘PENDING’,’PAYED’,’REFUND_PROCESSING’,’REFUND_SUCCESS’,’PARTIAL_REFUND’

SHIP_STATUS: ‘NOT_SHIPED’,’SENDING’,’DELIVERED’,’PARTIAL_RETURN’,’FULL_RETURN’,’PARTIAL_SENDING’