2103-USD / codalorians

0 stars 0 forks source link

Database Adapters - Order_Products [Milestone Week 3 Part 1] #5

Closed alex-yambao closed 3 years ago

alex-yambao commented 3 years ago

Backend

Database Adapters

getOrderProductById getOrderProductById(id) return the order_products addProductToOrder addProductToOrder({ orderId, productId, price, quantity }) if the productId is NOT on the order yet, create a new order_products update the order_products quantity (add passed-in quantity to the current order_products quantity) update the order_products price return the order_products updateOrderProduct updateOrderProduct({ id, price, quantity }) Find the order with id equal to the passed in id Update the price or quantity as necessary destroyOrderProduct destroyOrderProduct(id) remove the single identified order_products from database