Skip to content

III - Revenge of the DB Adapters #45

Description

@tpadilla10117

We need the following additional db adapters to configure our orders:

  • getOrderProductById - > getOrderProductById(id) - return the order_products

  • addProductToOrder - > addProductToOrder({ orderId, productId, price, quantity })

    • - f 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 })
  1. Find the order with id equal to the passed in id
  2. Update the price or quantity as necessary
  • destroyOrderProduct -> destroyOrderProduct(id)
  1. remove the single identified order_products from database

"Do what must be done Lord [Code]r. Do not hesitate, show no mercy"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions