2212-grace-shopper-triceratops / tri-grace-shopper

0 stars 3 forks source link

order models #35

Open allyssad opened 1 year ago

allyssad commented 1 year ago
allyssad commented 1 year ago

blockers:

  1. 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()

allyssad commented 1 year ago

Associations:

Order.hasMany(Order_Detail);
Order_Detail.belongsTo(Order);
Order.belongsTo(User);
User.hasMany(Order);
pbryan9 commented 1 year ago