diff --git a/software/backend/routes/city.routes.ts b/software/backend/routes/city.routes.ts
index 7ddea96..893c645 100644
--- a/software/backend/routes/city.routes.ts
+++ b/software/backend/routes/city.routes.ts
@@ -15,12 +15,12 @@ city.get("/", (req: Request, res: Response) => {
]
})
.then(cities => {
- for (let city of cities) {
- for (let location of city.dataValues.locations) {
- location.dataValues.nrOfConcerts = location.dataValues.concerts.length
- delete location.dataValues.concerts
- }
- }
+ // for (let city of cities) {
+ // for (let location of city.dataValues.locations) {
+ // location.dataValues.nrOfConcerts = location.dataValues.concerts.length
+ // delete location.dataValues.concerts
+ // }
+ // }
res.status(200).json(cities)
})
})
\ No newline at end of file
diff --git a/software/backend/routes/location.routes.ts b/software/backend/routes/location.routes.ts
index 0782544..209c787 100644
--- a/software/backend/routes/location.routes.ts
+++ b/software/backend/routes/location.routes.ts
@@ -20,7 +20,12 @@ location.get("/", (req: Request, res: Response) => {
City,
{
model: Concert,
- include: [ Event ],
+ include: [
+ {
+ model: Event,
+ include: [ Band ]
+ }
+ ],
attributes: {
exclude: [ "locationId", "tourId" ]
}
@@ -40,18 +45,6 @@ location.get("/", (req: Request, res: Response) => {
}
})
.then(async locations => {
- for (let location of locations) {
- for (let concert of location.dataValues.concerts) {
- let event = concert.dataValues.event
-
- await Band.findByPk(event.dataValues.bandId)
- .then(band => {
- event.dataValues.bandName = band.dataValues.name
- delete event.dataValues.bandId
- })
- }
- }
-
if (sort != undefined) {
locations.sort((location1, location2) => {
if (sort == "desc") {
@@ -77,7 +70,12 @@ location.get("/location/:urlName", (req: Request, res: Response) => {
City,
{
model: Concert,
- include: [ Event ],
+ include: [
+ {
+ model: Event,
+ include: [ Band ]
+ }
+ ],
attributes: {
exclude: [ "locationId", "tourId" ]
}
@@ -97,16 +95,6 @@ location.get("/location/:urlName", (req: Request, res: Response) => {
}
})
.then(async location => {
- for (let concert of location.dataValues.concerts) {
- let event = concert.dataValues.event
-
- await Band.findByPk(event.dataValues.bandId)
- .then(band => {
- event.dataValues.bandName = band.dataValues.name
- delete event.dataValues.bandId
- })
- }
-
for (let seatGroup of location.dataValues.seatGroups) {
for (let seatRow of seatGroup.dataValues.seatRows) {
for (let seat of seatRow.dataValues.seats) {
diff --git a/software/src/components/navigation/footerItems.vue b/software/src/components/navigation/footerItems.vue
index 954b934..471a038 100644
--- a/software/src/components/navigation/footerItems.vue
+++ b/software/src/components/navigation/footerItems.vue
@@ -1,5 +1,5 @@
@@ -21,6 +30,7 @@ defineProps({
>
+
+
+
- {{ title }}
+
+ {{ title }}
+
+
- {{ description }}
+
+
+
+ {{ description }}
+
-
+
diff --git a/software/src/components/pageParts/locationListItem.vue b/software/src/components/pageParts/locationListItem.vue
index e20df46..ef7772b 100644
--- a/software/src/components/pageParts/locationListItem.vue
+++ b/software/src/components/pageParts/locationListItem.vue
@@ -1,12 +1,20 @@
@@ -17,7 +25,7 @@ defineProps({
@click="router.push('locations/' + location.name.replaceAll(' ', '-').toLowerCase())"
>
- {{ location.concerts.length }} {{ $t('concert', location.concerts.length) }}
+ {{ concerts.length }} {{ $t('concert', concerts.length) }}
\ No newline at end of file
diff --git a/software/src/components/pageParts/ticketListItem.vue b/software/src/components/pageParts/ticketListItem.vue
index d6157f2..9b7fd50 100644
--- a/software/src/components/pageParts/ticketListItem.vue
+++ b/software/src/components/pageParts/ticketListItem.vue
@@ -1,17 +1,41 @@
@@ -31,12 +27,12 @@ function editQuantity(basketItem: BasketItemModel) {
|
- {{ basketItem.concert.event.band.name }}
+ {{ basketItem.band.name }}
|
- {{ basketItem.concert.event.name }}
+ {{ basketItem.event.name }}
|
diff --git a/software/src/pages/events/bandDetailPage/bandMemberSection.vue b/software/src/pages/events/bandDetailPage/bandMemberSection.vue
index b071a03..49bd4f0 100644
--- a/software/src/pages/events/bandDetailPage/bandMemberSection.vue
+++ b/software/src/pages/events/bandDetailPage/bandMemberSection.vue
@@ -1,13 +1,13 @@
-
+
-
-
-
-
-
- {{ concert.location.name }}
-
+
+
+
+
+
+
+ {{ concert.location.name }}
+
-
- {{ band.name }} - {{ band.events[0].name }}
-
-
-
-
-
+
+ {{ band.name }} - {{ band.events[0].name }}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/software/src/pages/events/bandDetailPage/index.vue b/software/src/pages/events/bandDetailPage/index.vue
index 09acec8..6acf453 100644
--- a/software/src/pages/events/bandDetailPage/index.vue
+++ b/software/src/pages/events/bandDetailPage/index.vue
@@ -1,5 +1,4 @@
@@ -53,7 +49,8 @@ getLocation(String(router.currentRoute.value.params.locationName))
-
+ Loading...
+
@@ -63,14 +60,12 @@ getLocation(String(router.currentRoute.value.params.locationName))
>
- {{ concert.event.bandName }}
+ {{ concert.event.band.name }}
diff --git a/software/src/pages/locations/locationsPage/index.vue b/software/src/pages/locations/locationsPage/index.vue
index 8085978..7677bc5 100644
--- a/software/src/pages/locations/locationsPage/index.vue
+++ b/software/src/pages/locations/locationsPage/index.vue
@@ -1,14 +1,12 @@
@@ -52,7 +50,10 @@ shoppingStore.getCities()
-
+
diff --git a/software/src/pages/searchPage/index.vue b/software/src/pages/searchPage/index.vue
index 62ba4ba..90adbae 100644
--- a/software/src/pages/searchPage/index.vue
+++ b/software/src/pages/searchPage/index.vue
@@ -46,7 +46,12 @@ const searchStore = useSearchStore()
v-for="event in searchStore.events"
>
-
+
@@ -55,7 +60,10 @@ const searchStore = useSearchStore()
v-for="i in 3"
>
-
+ Loading...
+
diff --git a/software/src/scripts/concertScripts.ts b/software/src/scripts/concertScripts.ts
index 11d8598..6eb3c2d 100644
--- a/software/src/scripts/concertScripts.ts
+++ b/software/src/scripts/concertScripts.ts
@@ -1,7 +1,6 @@
import { RatingModel } from "@/data/models/acts/ratingModel"
import { dateToHumanReadableString } from "./dateTimeScripts"
-import { TourModel } from "@/data/models/acts/tourModel"
-import { EventModel } from "@/data/models/acts/eventModel"
+import { ConcertModel } from "@/data/models/acts/concertModel"
/**
* Calculate a price based on parameters
@@ -16,6 +15,7 @@ export function calcPrice(price: number, quantity: number = 1): number {
return Math.round(quantity * price * 100) / 100
}
+
/**
* Calculate the average of an Array of ratings
*
@@ -33,6 +33,14 @@ export function calcRating(ratings: Array) {
return sum / ratings.length
}
+
+/**
+ * Classifies a bunch of ratings to groups from 1 to 5 stars
+ *
+ * @param ratings Array of RatingModels
+ *
+ * @returns Array of Objects: { value: number[1-5], count: number }
+ */
export function calcRatingValues(ratings: Array) {
let ratingValues = [
{ value: 1, count: 0 },
@@ -57,10 +65,10 @@ export function calcRatingValues(ratings: Array) {
*
* @returns A date string. If one concert: dd.MM.YYYY, if two or more: dd.MM.YYYY - dd.MM.YYYY
*/
-export function createDateRangeString(event: EventModel) {
+export function createDateRangeString(concerts: Array) {
const dateArray: Array = []
- for (let concert of event.concerts) {
+ for (let concert of concerts) {
dateArray.push(new Date(concert.date))
}
@@ -85,10 +93,10 @@ export function createDateRangeString(event: EventModel) {
*
* @returns Lowest ticket price, rounded to two floating point digits
*/
-export function lowestTicketPrice(event: EventModel): string {
+export function lowestTicketPrice(concerts: Array): string {
const priceArray : Array = []
- for (let concert of event.concerts) {
+ for (let concert of concerts) {
priceArray.push(concert.price)
}
diff --git a/software/src/scripts/dateTimeScripts.ts b/software/src/scripts/dateTimeScripts.ts
index 77f39ab..9b23942 100644
--- a/software/src/scripts/dateTimeScripts.ts
+++ b/software/src/scripts/dateTimeScripts.ts
@@ -1,9 +1,23 @@
+/**
+ * Concert a date object to german time string
+ *
+ * @param date Date object
+ *
+ * @returns German date string, e.g. 31.12.2024
+ */
export function dateToHumanReadableString(date: Date) {
return String(date.getDate()).padStart(2, '0') + '.' +
String(date.getMonth() + 1).padStart(2, '0') + '.' +
date.getFullYear()
}
+/**
+ * Convert ISO time string to german time string
+ *
+ * @param string ISO time string, e.g. 2024-12-31
+ *
+ * @returns German date string, e.g. 31.12.2024
+ */
export function dateStringToHumanReadableString(string: string) {
return dateToHumanReadableString(new Date(string))
}
\ No newline at end of file