diff --git a/misc/database.drawio b/misc/database.drawio index d713698..ac00c45 100644 --- a/misc/database.drawio +++ b/misc/database.drawio @@ -1,20 +1,20 @@ - + - + - + - + - + @@ -23,43 +23,43 @@ - + - + - + - + - + - + - + - + - + - + - + - + @@ -67,13 +67,13 @@ - + - - + + @@ -108,51 +108,51 @@ - + - + - + - + - + - + - + - + - + - + - + - + - - + + @@ -167,7 +167,7 @@ - + @@ -185,22 +185,22 @@ - + - + - + - + - + @@ -223,13 +223,13 @@ - + - + @@ -244,16 +244,16 @@ - + - + - + - + @@ -262,52 +262,52 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -316,7 +316,7 @@ - + @@ -376,7 +376,7 @@ - + @@ -416,8 +416,8 @@ - - + + @@ -439,7 +439,7 @@ - + @@ -448,17 +448,17 @@ - + - + - + @@ -478,7 +478,7 @@ - + @@ -526,13 +526,13 @@ - + - + - + @@ -552,7 +552,7 @@ - + @@ -578,22 +578,22 @@ - + - + - + - + - + - + @@ -606,8 +606,8 @@ - - + + @@ -622,48 +622,48 @@ - + - + - + - + - + - + - + - + - + - + - - + + - + @@ -676,8 +676,7 @@ - - + @@ -688,31 +687,31 @@ - + - + - + - + - - + + - + @@ -721,21 +720,21 @@ - + - + - + - - + + @@ -750,13 +749,13 @@ - + - + - + @@ -768,10 +767,10 @@ - + - + @@ -836,10 +835,10 @@ - + - + diff --git a/software/backend/routes/order.routes.ts b/software/backend/routes/order.routes.ts index dbc2462..62b1a93 100644 --- a/software/backend/routes/order.routes.ts +++ b/software/backend/routes/order.routes.ts @@ -61,21 +61,22 @@ order.get("/:id", (req: Request, res: Response) => { // Place a new order order.post("/", (req: Request, res: Response) => { + console.log(req.body.tickets) Order.create(req.body) .then(async order => { - for (let orderItem of req.body.orderItems) { + for (let ticket of req.body.tickets) { Ticket.create({ - orderId: order.id, - quantity: orderItem.quantity, - orderPrice: orderItem.orderPrice, - productId: orderItem.productId + orderId: order.dataValues.id, + concertId: ticket.concertId, + orderPrice: ticket.orderPrice, + seatId: ticket.seatId }) Concert.decrement( "inStock", { - by: orderItem.quantity, - where: { id: orderItem.productId } + by: 1, + where: { id: ticket.concertId } } ) } diff --git a/software/src/components/basics/actionDialog.vue b/software/src/components/basics/actionDialog.vue index d607cfa..98e48df 100644 --- a/software/src/components/basics/actionDialog.vue +++ b/software/src/components/basics/actionDialog.vue @@ -1,5 +1,6 @@