【问题标题】:Database model for handling e commerce returns处理电子商务退货的数据库模型
【发布时间】:2015-10-12 00:43:31
【问题描述】:

表结构如下:

订单表


order_id 
customer_id 
billing_address_id 
shipping_address_id 
payment_mode
price
shipping_price 
create_TS
update_TS 

订单项表


order_item_id 
order_id
item_id 
delivery_id 
status_id
store_id 
quantity 
unit_price 
shipping_price 
create_TS  
update_TS  

来自客户的订单可以包含来自不同商家的商品。 订单中的每个项目都位于订单项表中,并引用 orders 表中的 order id

我的问题是如何处理退货? 退货应该是单独的订单项目吗?还是应该只更改订单项的状态以返回相关状态?

我问这个是因为,如果是退货,我们会从客户那里获得有关退货原因的信息,我们可能想要跟踪退货订单以进行分析等。

建模或合并处理退货单的最佳方式是什么

更新:

我与一个物流供应商有合作关系,我向其提交关于每个常规订单、退货单和订单取消的请求。

预订表


booking_id
order_item_id
booking_status (this is the vendor defined status)
delivery_partner_id (if we have more than one logistics partner)
is_return_order (a flag to identify if this booking is for returns)
create_ts
update_ts

如果我有一个单独的退货表,应如何修改此表以同时保存退货和常规订单。当前链接是 lineitems 表中的 order_item_id。如何使用 return_id 绑定预订? 我如何拥有

【问题讨论】:

    标签: mysql database database-schema scalability datamodel


    【解决方案1】:

    我会创建一个额外的表格,您可以在其中保存有关退货的信息(参考上面的描述):

        return_id
        order_id
        (order_item_id) depending on if you need that specific information
        return_reason_id (when you have predefined reasons)
        customer_comment (when the customer has to say something 
        return_comment (if your returns department wants to add some info)
        create_TS
    

    如果您退回了一些商品,您将 order_item 或订单设置为“已退货”状态

    由于退货不是真正的订单商品,我不想将它们写在那里...您应该为此目的使用其他表格。

    【讨论】:

      猜你喜欢
      • 2011-02-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-11
      • 2019-10-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多