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
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