Ticket Component

This commit is contained in:
2024-10-06 19:30:12 +02:00
parent c050560fba
commit 4a62c7a96b
47 changed files with 365 additions and 219 deletions

View File

@@ -23,11 +23,13 @@
"tickets": [
{
"concertId": 0,
"orderPrice": 184
"orderPrice": 184,
"seatId": 2
},
{
"concertId": 0,
"orderPrice": 184
"orderPrice": 184,
"seatId": 3
}
]
},
@@ -40,7 +42,8 @@
"tickets": [
{
"concertId": 0,
"orderPrice": 184
"orderPrice": 184,
"seatId": 3
}
]
}

View File

@@ -26,7 +26,7 @@ export class Ticket extends Model {
order: Order
@BelongsTo(() => Concert)
product: Concert
concert: Concert
@BelongsTo(() => Seat)
seat: Seat

View File

@@ -7,6 +7,10 @@ import { Address } from "../models/user/address.model";
import { Band } from "../models/acts/band.model";
import { Location } from "../models/locations/location.model";
import { Event } from "../models/acts/event.model";
import { City } from "../models/locations/city.model";
import { Seat } from "../models/locations/seat.model";
import { SeatRow } from "../models/locations/seatRow.model";
import { SeatGroup } from "../models/locations/seatGroup.model";
export const order = Router()
@@ -25,7 +29,10 @@ order.get("/:id", (req: Request, res: Response) => {
model: Event,
include: [ Band ]
},
Location
{
model: Location,
include: [ City ]
}
],
attributes: {
exclude: [
@@ -34,6 +41,15 @@ order.get("/:id", (req: Request, res: Response) => {
]
}
},
{
model: Seat,
include: [
{
model: SeatRow,
include: [ SeatGroup ]
}
]
}
]
},
Payment,