Open allyssad opened 1 year ago
blockers:
how to handle finalPrice and totalQty on Order model:
currently as passed in values that would come from the checkout form (e.g. promoRate and total) with a hook that updates the finalPrice to reflect the promorate
option 1: change the logic so that read the order details table and perform an operation on the relevant rows
i created reducers that work but i struggled to pull in the relevant data from the order_detail table
this may be because the associations weren't all in place?
option 2: make them instance methods:
e.g. exampleOrder.getFinalPrice() and exampleOrder.getTotalQty()
Associations:
Order.hasMany(Order_Detail);
Order_Detail.belongsTo(Order);
Order.belongsTo(User);
User.hasMany(Order);