SeatSelection page

This commit is contained in:
2024-10-04 20:15:16 +02:00
parent 8165f17fc8
commit e48782b897
22 changed files with 316 additions and 76 deletions

View File

@@ -4,4 +4,12 @@ let BASE_URL = "http://localhost:3000/concerts"
export async function getAllConcerts() {
return await axios.get(BASE_URL)
}
}
export async function getConcert(id: number) {
if (id != undefined) {
return await axios.get(BASE_URL + "/" + id)
} else {
return null
}
}

View File

@@ -5,5 +5,6 @@ export class SeatGroupModel {
surcharge: number
standingArea: Boolean
capacity: number
occupied: number
seatRows: Array<SeatRowModel>
}

View File

@@ -1,4 +1,5 @@
export class SeatModel {
id: number
seatNr: string
state: number
}

View File

@@ -0,0 +1,14 @@
import { SeatModel } from "../locations/seatModel";
import { SeatRowModel } from "../locations/seatRowModel";
export class SelectedSeatModel {
seat: SeatModel
seatRow: number
seatGroupName: string
constructor(seat: SeatModel, seatRow: number, seatGroupName: string) {
this.seat = seat
this.seatRow = seatRow
this.seatGroupName = seatGroupName
}
}

View File

@@ -3,17 +3,19 @@ import { useLocalStorage } from "@vueuse/core";
import { BasketItemModel } from "../models/ordering/basketItemModel";
import { useFeedbackStore } from "./feedbackStore";
import { BannerStateEnum } from "../enums/bannerStateEnum";
import { addOrder } from "../api/orderApi";
import { useAccountStore } from "./accountStore";
import { ConcertModel } from "../models/acts/concertModel";
import { AddressModel } from "../models/user/addressModel";
import { PaymentModel } from "../models/user/paymentModel";
import { SeatModel } from "../models/locations/seatModel";
import { ref } from "vue";
import { SelectedSeatModel } from "../models/ordering/selectedSeatModel";
export const useBasketStore = defineStore('basketStore', {
state: () => ({
itemsInBasket: useLocalStorage<Array<BasketItemModel>>("hackmycart/basketStore/productsInBasket", []),
usedAddress: useLocalStorage("hackmycart/basketStore/usedAddress", new AddressModel()),
usedPayment: useLocalStorage("hackmycart/basketStore/usedPayment", new PaymentModel())
usedPayment: useLocalStorage("hackmycart/basketStore/usedPayment", new PaymentModel()),
selectedSeats: ref<Array<SelectedSeatModel>>([])
}),
getters: {