diff --git a/software/backend/data/orders.json b/software/backend/data/orders.json index 3b76df9..5a20fa4 100644 --- a/software/backend/data/orders.json +++ b/software/backend/data/orders.json @@ -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 } ] } diff --git a/software/backend/models/ordering/ticket.model.ts b/software/backend/models/ordering/ticket.model.ts index 6ae9b60..c9ecb86 100644 --- a/software/backend/models/ordering/ticket.model.ts +++ b/software/backend/models/ordering/ticket.model.ts @@ -26,7 +26,7 @@ export class Ticket extends Model { order: Order @BelongsTo(() => Concert) - product: Concert + concert: Concert @BelongsTo(() => Seat) seat: Seat diff --git a/software/backend/routes/order.routes.ts b/software/backend/routes/order.routes.ts index aa9fa8f..da88f85 100644 --- a/software/backend/routes/order.routes.ts +++ b/software/backend/routes/order.routes.ts @@ -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, diff --git a/software/src/components/actionDialog.vue b/software/src/components/basics/actionDialog.vue similarity index 93% rename from software/src/components/actionDialog.vue rename to software/src/components/basics/actionDialog.vue index 5139820..d607cfa 100644 --- a/software/src/components/actionDialog.vue +++ b/software/src/components/basics/actionDialog.vue @@ -1,6 +1,5 @@ + + + + + + {{ title }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/software/src/components/cardWithTopImage.vue b/software/src/components/basics/cardViewTopImage.vue similarity index 100% rename from software/src/components/cardWithTopImage.vue rename to software/src/components/basics/cardViewTopImage.vue diff --git a/software/src/components/confirmDialog.vue b/software/src/components/basics/confirmDialog.vue similarity index 88% rename from software/src/components/confirmDialog.vue rename to software/src/components/basics/confirmDialog.vue index 5cc7707..76e8606 100644 --- a/software/src/components/confirmDialog.vue +++ b/software/src/components/basics/confirmDialog.vue @@ -1,7 +1,7 @@ - - - - - - - - {{ title }} - - - - - - - - - + diff --git a/software/src/components/cardWithLeftImage.vue b/software/src/components/cardWithLeftImage.vue deleted file mode 100644 index 8dc0c44..0000000 --- a/software/src/components/cardWithLeftImage.vue +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - {{ title }} - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/software/src/components/pageParts/concertListItem.vue b/software/src/components/pageParts/concertListItem.vue index ece4c55..df9b2b8 100644 --- a/software/src/components/pageParts/concertListItem.vue +++ b/software/src/components/pageParts/concertListItem.vue @@ -1,10 +1,10 @@ + + + + + + {{ $t('date') }} + + + + {{ dateStringToHumanReadableString(concert.date) }} + + + + {{ $t('location') }} + + + + {{ concert.location.name }}, {{ concert.location.city.name }} + + + + {{ $t('price') }} + + + + {{ concert.price }} € + + + + + + + + + {{ $t('seatGroup') }} + + + + {{ seatGroup }} + + + + {{ $t('standingArea') }} + + + + + + + {{ $t('seatRow') }} + + + + {{ seatRow }} + + + + + + {{ $t('seat') }} + + + + {{ seat }} + + + + + + + + \ No newline at end of file diff --git a/software/src/data/models/ordering/orderItemModel.ts b/software/src/data/models/ordering/orderItemModel.ts deleted file mode 100644 index 3033b3d..0000000 --- a/software/src/data/models/ordering/orderItemModel.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ConcertModel } from "../acts/concertModel" - -export class OrderItemModel { - orderId: number = -1 - quantity: number = 1 - orderPrice: number = 0 - product: ConcertModel -} \ No newline at end of file diff --git a/software/src/data/models/ordering/orderModel.ts b/software/src/data/models/ordering/orderModel.ts index 6d1bd0e..c53d53a 100644 --- a/software/src/data/models/ordering/orderModel.ts +++ b/software/src/data/models/ordering/orderModel.ts @@ -1,12 +1,12 @@ import { AddressModel } from "../user/addressModel" -import { OrderItemModel } from "./orderItemModel" import { PaymentModel } from "../user/paymentModel" +import { TicketModel } from "./ticketModel" export class OrderModel { id: number accountId: number shippingProgress: number - orderItems: Array + tickets: Array orderedAt: string payment: PaymentModel address: AddressModel diff --git a/software/src/data/models/ordering/ticketModel.ts b/software/src/data/models/ordering/ticketModel.ts new file mode 100644 index 0000000..2dcce69 --- /dev/null +++ b/software/src/data/models/ordering/ticketModel.ts @@ -0,0 +1,20 @@ +import { ConcertModel } from "../acts/concertModel" +import { SeatModel } from "../locations/seatModel" + +export class TicketModel { + id: number + orderId: number = -1 + orderPrice: number = 0 + concert: ConcertModel + seat: { + seatNr: number, + seatRow: { + row: number, + seatGroup: { + name: string, + surcharge: number, + standingArea: boolean + } + } + } +} \ No newline at end of file diff --git a/software/src/data/stores/accountStore.ts b/software/src/data/stores/accountStore.ts index dc3e93c..a64d92f 100644 --- a/software/src/data/stores/accountStore.ts +++ b/software/src/data/stores/accountStore.ts @@ -11,8 +11,7 @@ import { PaymentModel } from "../models/user/paymentModel"; export const useAccountStore = defineStore("accountStore", { state: () => ({ - userAccount: useLocalStorage("hackmycart/accountStore/userAccount", new AccountModel()), - orders: useLocalStorage>("hackmycart/accountStore/orders", [ new OrderModel() ]) + userAccount: useLocalStorage("hackmycart/accountStore/userAccount", new AccountModel()) }), actions: { diff --git a/software/src/locales/de.json b/software/src/locales/de.json index f46587a..21aa907 100644 --- a/software/src/locales/de.json +++ b/software/src/locales/de.json @@ -153,5 +153,11 @@ "orderedAt": "Bestellt am", "logout": "Ausloggen", "logoutDescription": "Aktuellen Useraccount ausloggen", - "login": "Login" + "login": "Login", + "seatRow": "Sitzreihe", + "seat": "Sitz", + "seatGroup": "Kategorie", + "date": "Datum", + "price": "Preis", + "standingArea": "Stehbereich" } diff --git a/software/src/locales/en.json b/software/src/locales/en.json index c3a432f..a4a0713 100644 --- a/software/src/locales/en.json +++ b/software/src/locales/en.json @@ -153,5 +153,11 @@ "orderedAt": "Ordered at", "logout": "Logout", "logoutDescription": "Logout current account", - "login": "Login" + "login": "Login", + "seatRow": "Seat Row", + "seat": "Seat", + "seatGroup": "Category", + "date": "Date", + "price": "Price", + "standingArea": "Standing Area" } diff --git a/software/src/pages/account/accountDataPage/accountDataCard.vue b/software/src/pages/account/accountDataPage/accountDataCard.vue index f324ee8..af44be9 100644 --- a/software/src/pages/account/accountDataPage/accountDataCard.vue +++ b/software/src/pages/account/accountDataPage/accountDataCard.vue @@ -1,5 +1,5 @@ @@ -39,11 +28,11 @@ function formatDateTimeString(string: string) { - + diff --git a/software/src/pages/account/ordersPage/orderItem.vue b/software/src/pages/account/ordersPage/orderItem.vue index a6a134b..0d10217 100644 --- a/software/src/pages/account/ordersPage/orderItem.vue +++ b/software/src/pages/account/ordersPage/orderItem.vue @@ -1,13 +1,17 @@