chicken-sloths / bangazon-api-sprint1

API for a mock Amazon + Etsy platform providing developers access to the company's employee & product data
0 stars 0 forks source link

Order detail JSON should contain product details #10

Closed Arwask closed 6 years ago

Arwask commented 6 years ago

Update the Order detail JSON object should contain all nested Product information.

For example:

{
   OrderId: 21,
   CustomerId: 16,
   PaymentTypeId: 83,
   Products: [
      {
         ProductId: 156,
         Name: "Kite",
         Price: 14.25
         Quantity: 1
      },
      {
         ProductId: 212,
         Name: "Roller blades",
         Price: 88.99
         Quantity: 1
      }
   ]
}
kenziebottoms commented 6 years ago

Is this a joined query or do we want the OrderDetail object to contain Product information? Seems to violate single source of truth.

TimAConner commented 6 years ago

I have the same question. Also, it says JSON object, but we are using SQL. Is JSON how the Order is being passed around in the JavaScript or does it want us to store it as JSON?

jordan-castelloe commented 6 years ago

I wanna help with this one!

DavidLarsKetch commented 6 years ago

Another update... Regarding @kenziebottoms comment: the first one. I'm understanding that the JSON returned from a query to Orders also makes a query of Products_Orders & from there Products to combine all the info.