diff --git a/software/backend/models/acts/tour.model.ts b/software/backend/models/acts/tour.model.ts
index c59d90c..e1eec93 100644
--- a/software/backend/models/acts/tour.model.ts
+++ b/software/backend/models/acts/tour.model.ts
@@ -23,5 +23,5 @@ export class Tour extends Model {
band: Band
@HasMany(() => Concert)
- shows: Concert[]
+ concerts: Concert[]
}
\ No newline at end of file
diff --git a/software/src/App.vue b/software/src/App.vue
index 3577c3d..6f26b62 100644
--- a/software/src/App.vue
+++ b/software/src/App.vue
@@ -7,6 +7,7 @@ import navigationPrependItems from './components/navigation/navigationPrependIte
import { usePreferencesStore } from './data/stores/preferencesStore';
import { useFeedbackStore } from './data/stores/feedbackStore';
import { useConcertStore } from './data/stores/concertStore';
+import { LocationModel } from './data/models/acts/locationModel';
const preferencesStore = usePreferencesStore()
const concertStore = useConcertStore()
@@ -22,6 +23,19 @@ concertStore.fetchAllTours()
watch(() => preferencesStore.language, () => {
i18n.global.locale = preferencesStore.language
}, { immediate: true })
+
+watch(() => concertStore.cityFilter, () => {
+ concertStore.locationFilter = new LocationModel()
+ concertStore.filterTours()
+})
+
+watch(() => concertStore.locationFilter, () => {
+ concertStore.filterTours()
+})
+
+watch(() => concertStore.genreFilter, () => {
+ concertStore.filterTours()
+})
@@ -64,8 +78,8 @@ watch(() => preferencesStore.language, () => {
-
-
+
+
diff --git a/software/src/components/navigation/navigationPrependItems.vue b/software/src/components/navigation/navigationPrependItems.vue
index 5b40a60..40251e8 100644
--- a/software/src/components/navigation/navigationPrependItems.vue
+++ b/software/src/components/navigation/navigationPrependItems.vue
@@ -10,7 +10,7 @@
logo: string
ratings: Array
- members: Array
- genres: {
+ members: Array<{
+ name: string,
+ image: string
+ }>
+ genres: Array<{
name: string
- }
+ }>
}
\ No newline at end of file
diff --git a/software/src/data/models/cityModel.ts b/software/src/data/models/acts/cityModel.ts
similarity index 100%
rename from software/src/data/models/cityModel.ts
rename to software/src/data/models/acts/cityModel.ts
diff --git a/software/src/data/models/concertModel.ts b/software/src/data/models/acts/concertModel.ts
similarity index 100%
rename from software/src/data/models/concertModel.ts
rename to software/src/data/models/acts/concertModel.ts
diff --git a/software/src/data/models/genreModel.ts b/software/src/data/models/acts/genreModel.ts
similarity index 59%
rename from software/src/data/models/genreModel.ts
rename to software/src/data/models/acts/genreModel.ts
index 4447307..134c0f3 100644
--- a/software/src/data/models/genreModel.ts
+++ b/software/src/data/models/acts/genreModel.ts
@@ -1,4 +1,3 @@
-import { MemberModel } from "./memberModel"
import { RatingModel } from "./ratingModel"
export class GenreModel {
@@ -7,13 +6,9 @@ export class GenreModel {
bands: Array<
{
name: string
- foundingYear: number
- descriptionEn: string
- descriptionDe: string
images: Array
logo: string
ratings: Array
- members: Array
}
>
}
\ No newline at end of file
diff --git a/software/src/data/models/locationModel.ts b/software/src/data/models/acts/locationModel.ts
similarity index 90%
rename from software/src/data/models/locationModel.ts
rename to software/src/data/models/acts/locationModel.ts
index 00ab26c..ad6380a 100644
--- a/software/src/data/models/locationModel.ts
+++ b/software/src/data/models/acts/locationModel.ts
@@ -4,7 +4,6 @@ export class LocationModel {
address: string
image: string
city: {
- id: number
name: string
country: string
}
diff --git a/software/src/data/models/ratingModel.ts b/software/src/data/models/acts/ratingModel.ts
similarity index 100%
rename from software/src/data/models/ratingModel.ts
rename to software/src/data/models/acts/ratingModel.ts
diff --git a/software/src/data/models/tourModel.ts b/software/src/data/models/acts/tourModel.ts
similarity index 85%
rename from software/src/data/models/tourModel.ts
rename to software/src/data/models/acts/tourModel.ts
index 1b8f2f5..5a1102c 100644
--- a/software/src/data/models/tourModel.ts
+++ b/software/src/data/models/acts/tourModel.ts
@@ -7,5 +7,5 @@ export class TourModel {
offered: boolean
band: BandModel
image: string
- shows: Array
+ concerts: Array
}
\ No newline at end of file
diff --git a/software/src/data/models/memberModel.ts b/software/src/data/models/memberModel.ts
deleted file mode 100644
index b9f111f..0000000
--- a/software/src/data/models/memberModel.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import { BandModel } from "./bandModel"
-
-export class MemberModel {
- id: Number
- name: string
- image: string
-}
\ No newline at end of file
diff --git a/software/src/data/models/basketItemModel.ts b/software/src/data/models/ordering/basketItemModel.ts
similarity index 82%
rename from software/src/data/models/basketItemModel.ts
rename to software/src/data/models/ordering/basketItemModel.ts
index 3fc1f29..8195339 100644
--- a/software/src/data/models/basketItemModel.ts
+++ b/software/src/data/models/ordering/basketItemModel.ts
@@ -1,4 +1,4 @@
-import { ConcertModel } from "./concertModel"
+import { ConcertModel } from "../acts/concertModel"
export class BasketItemModel {
id: number = -1
diff --git a/software/src/data/models/orderItemModel.ts b/software/src/data/models/ordering/orderItemModel.ts
similarity index 70%
rename from software/src/data/models/orderItemModel.ts
rename to software/src/data/models/ordering/orderItemModel.ts
index 93e1183..3033b3d 100644
--- a/software/src/data/models/orderItemModel.ts
+++ b/software/src/data/models/ordering/orderItemModel.ts
@@ -1,4 +1,4 @@
-import { ConcertModel } from "./concertModel"
+import { ConcertModel } from "../acts/concertModel"
export class OrderItemModel {
orderId: number = -1
diff --git a/software/src/data/models/orderModel.ts b/software/src/data/models/ordering/orderModel.ts
similarity index 69%
rename from software/src/data/models/orderModel.ts
rename to software/src/data/models/ordering/orderModel.ts
index 4fc0505..6d1bd0e 100644
--- a/software/src/data/models/orderModel.ts
+++ b/software/src/data/models/ordering/orderModel.ts
@@ -1,6 +1,6 @@
-import { AddressModel } from "./addressModel"
+import { AddressModel } from "../user/addressModel"
import { OrderItemModel } from "./orderItemModel"
-import { PaymentModel } from "./paymentModel"
+import { PaymentModel } from "../user/paymentModel"
export class OrderModel {
id: number
diff --git a/software/src/data/models/accountModel.ts b/software/src/data/models/user/accountModel.ts
similarity index 100%
rename from software/src/data/models/accountModel.ts
rename to software/src/data/models/user/accountModel.ts
diff --git a/software/src/data/models/accountRole.ts b/software/src/data/models/user/accountRole.ts
similarity index 100%
rename from software/src/data/models/accountRole.ts
rename to software/src/data/models/user/accountRole.ts
diff --git a/software/src/data/models/addressModel.ts b/software/src/data/models/user/addressModel.ts
similarity index 100%
rename from software/src/data/models/addressModel.ts
rename to software/src/data/models/user/addressModel.ts
diff --git a/software/src/data/models/paymentModel.ts b/software/src/data/models/user/paymentModel.ts
similarity index 100%
rename from software/src/data/models/paymentModel.ts
rename to software/src/data/models/user/paymentModel.ts
diff --git a/software/src/data/stores/accountStore.ts b/software/src/data/stores/accountStore.ts
index 4d13e58..dc3e93c 100644
--- a/software/src/data/stores/accountStore.ts
+++ b/software/src/data/stores/accountStore.ts
@@ -1,13 +1,13 @@
import { useLocalStorage } from "@vueuse/core";
import { defineStore } from "pinia";
-import { AccountModel } from "../models/accountModel";
-import { OrderModel } from "../models/orderModel";
+import { AccountModel } from "../models/user/accountModel";
+import { OrderModel } from "../models/ordering/orderModel";
import { useFeedbackStore } from "./feedbackStore";
import { loginAccount, registerAccount, updateAccount } from "../api/accountApi";
import { getUserOrders } from "../api/orderApi";
import { BannerStateEnum } from "../enums/bannerStateEnum";
-import { AddressModel } from "../models/addressModel";
-import { PaymentModel } from "../models/paymentModel";
+import { AddressModel } from "../models/user/addressModel";
+import { PaymentModel } from "../models/user/paymentModel";
export const useAccountStore = defineStore("accountStore", {
state: () => ({
diff --git a/software/src/data/stores/basketStore.ts b/software/src/data/stores/basketStore.ts
index db17e70..8f4b69c 100644
--- a/software/src/data/stores/basketStore.ts
+++ b/software/src/data/stores/basketStore.ts
@@ -1,13 +1,13 @@
import { defineStore } from "pinia";
import { useLocalStorage } from "@vueuse/core";
-import { BasketItemModel } from "../models/basketItemModel";
+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/concertModel";
-import { AddressModel } from "../models/addressModel";
-import { PaymentModel } from "../models/paymentModel";
+import { ConcertModel } from "../models/acts/concertModel";
+import { AddressModel } from "../models/user/addressModel";
+import { PaymentModel } from "../models/user/paymentModel";
export const useBasketStore = defineStore('basketStore', {
state: () => ({
diff --git a/software/src/data/stores/concertStore.ts b/software/src/data/stores/concertStore.ts
index 58a282e..02f6da9 100644
--- a/software/src/data/stores/concertStore.ts
+++ b/software/src/data/stores/concertStore.ts
@@ -1,23 +1,28 @@
import { useLocalStorage } from "@vueuse/core";
import { defineStore } from "pinia";
-import { TourModel } from "../models/tourModel";
+import { TourModel } from "../models/acts/tourModel";
import { getAllTours } from "../api/tourApi";
-import { GenreModel } from "../models/genreModel";
+import { GenreModel } from "../models/acts/genreModel";
import { getAllBands } from "../api/bandApi";
-import { BandModel } from "../models/bandModel";
-import { LocationModel } from "../models/locationModel";
+import { BandModel } from "../models/acts/bandModel";
+import { LocationModel } from "../models/acts/locationModel";
import { getAllLocations } from "../api/locationApi";
import { getAllGenres } from "../api/genreApi";
-import { CityModel } from "../models/cityModel";
+import { CityModel } from "../models/acts/cityModel";
import { getAllCities } from "../api/cityApi";
export const useConcertStore = defineStore("concertStore", {
state: () => ({
tours: useLocalStorage>("hackmycart/concertStore/tours", []),
+ filteredTours: useLocalStorage>("hackmycart/concertStore/filteredTours", []),
bands: useLocalStorage>("hackmycart/concertStore/bands", []),
locations: useLocalStorage>("hackmycart/concertStore/locations", []),
+ filteredLocations: useLocalStorage>("hackmycart/concertStore/filteredLocations", []),
cities: useLocalStorage>("hackmycart/concertStore/cities", []),
- genres: useLocalStorage>("hackmycart/concertStore/genres", [])
+ genres: useLocalStorage>("hackmycart/concertStore/genres", []),
+ cityFilter: useLocalStorage("hackmycart/concertStore/cityFilter", new CityModel()),
+ locationFilter: useLocalStorage("hackmycart/concertStore/locationFilter", new LocationModel),
+ genreFilter: useLocalStorage("hackmycart/concertStore/genreFilter", new GenreModel())
}),
actions: {
@@ -27,8 +32,12 @@ export const useConcertStore = defineStore("concertStore", {
this.tours = result.data
this.tours.sort((a, b) => {
- return new Date(a.shows[0].date) < new Date(b.shows[0].date) ? -1 : 1
+ return new Date(a.concerts[0].date) < new Date(b.concerts[0].date) ? -1 : 1
})
+
+ this.filteredTours = this.tours
+
+ this.filterTours()
})
await getAllBands()
@@ -50,6 +59,60 @@ export const useConcertStore = defineStore("concertStore", {
.then(result => {
this.cities = result.data
})
+ },
+
+ filterTours() {
+ this.filteredTours = []
+
+ // Filter tours by city, location and genre
+ for (let tour of this.tours) {
+ let rightGenre = false
+ let rightCity = false
+ let rightLocation = false
+
+ // Genre filter
+ if (this.genreFilter == null || this.genreFilter.id == undefined) {
+ rightGenre = true
+ } else {
+ for (let genre of tour.band.genres) {
+ if (genre.name == this.genreFilter.name) {
+ rightGenre = true
+ }
+ }
+ }
+
+ // City filter
+ if (this.cityFilter == null || this.cityFilter.id == undefined) {
+ rightCity = true
+ } else {
+ for (let concert of tour.concerts) {
+ if (concert.location.city.name == this.cityFilter.name) {
+ rightCity = true
+ }
+ }
+
+ // Filter locations by city
+ this.filteredLocations = this.cities.find(city =>
+ city.id == this.cityFilter.id
+ ).locations
+ }
+
+
+ // Location filter
+ if (this.locationFilter == null || this.locationFilter.id == undefined) {
+ rightLocation = true
+ } else {
+ for (let concert of tour.concerts) {
+ if (concert.location.id == this.locationFilter.id) {
+ rightLocation = true
+ }
+ }
+ }
+
+ if (rightGenre && rightCity && rightLocation) {
+ this.filteredTours.push(tour)
+ }
+ }
}
}
})
\ No newline at end of file
diff --git a/software/src/locales/de.json b/software/src/locales/de.json
index 255ffce..a2b261f 100644
--- a/software/src/locales/de.json
+++ b/software/src/locales/de.json
@@ -11,17 +11,9 @@
"topBands": "Top Bands",
"topLocations": "Top Veranstaltungsorte"
},
-
-
-
-
-
-
-
"tours": {
"concert": "Konzert | Konzerte"
},
-
"preferences": {
"pageSetup": "Seiteneinstellungen",
"selectedTheme": "Ausgewähltes Theme",
@@ -148,5 +140,8 @@
"wrongIban": "Falsches IBAN Format, nur deutsche IBAN-Nummern erlaubt!",
"save": "Speichern",
"editProduct": "Produkt bearbeiten",
- "brand": "Marke | Marken"
+ "brand": "Marke | Marken",
+ "concerts": {
+ "location": "Veranstaltungsort"
+ }
}
diff --git a/software/src/locales/en.json b/software/src/locales/en.json
index 50c367f..8242d1f 100644
--- a/software/src/locales/en.json
+++ b/software/src/locales/en.json
@@ -11,18 +11,9 @@
"topBands": "Top Bands",
"topLocations": "Top Locations"
},
-
-
-
-
-
-
-
"tours": {
"concert": "Concert | Concerts"
},
-
-
"preferences": {
"pageSetup": "Page setup",
"selectedTheme": "Selected theme",
@@ -149,5 +140,8 @@
"wrongIban": "Wrong IBAN format, only German IBANs are allowed!",
"save": "Save",
"editProduct": "Edit product",
- "brand": "Brand | Brands"
+ "brand": "Brand | Brands",
+ "concerts": {
+ "location": "Locations"
+ }
}
diff --git a/software/src/pages/account/accountDataPage/addressesCard.vue b/software/src/pages/account/accountDataPage/addressesCard.vue
index d50f526..7f5d363 100644
--- a/software/src/pages/account/accountDataPage/addressesCard.vue
+++ b/software/src/pages/account/accountDataPage/addressesCard.vue
@@ -2,7 +2,7 @@
import cardView from '@/components/cardView.vue';
import { useAccountStore } from '@/data/stores/accountStore';
import outlinedButton from '@/components/outlinedButton.vue';
-import { AddressModel } from '@/data/models/addressModel';
+import { AddressModel } from '@/data/models/user/addressModel';
import { useFeedbackStore } from '@/data/stores/feedbackStore';
import { getNumberStartRules, getPostalRules, getStringRules } from '@/scripts/validationRules';
diff --git a/software/src/pages/account/accountDataPage/paymentsCard.vue b/software/src/pages/account/accountDataPage/paymentsCard.vue
index 4bc383e..855ed03 100644
--- a/software/src/pages/account/accountDataPage/paymentsCard.vue
+++ b/software/src/pages/account/accountDataPage/paymentsCard.vue
@@ -2,7 +2,7 @@
import cardView from '@/components/cardView.vue';
import { useAccountStore } from '@/data/stores/accountStore';
import outlinedButton from '@/components/outlinedButton.vue';
-import { PaymentModel } from '@/data/models/paymentModel';
+import { PaymentModel } from '@/data/models/user/paymentModel';
import { getIbanRules, getStringRules } from '@/scripts/validationRules';
const accountStore = useAccountStore()
diff --git a/software/src/pages/account/loginPage/registerForm.vue b/software/src/pages/account/loginPage/registerForm.vue
index edb63ca..d9a8cc4 100644
--- a/software/src/pages/account/loginPage/registerForm.vue
+++ b/software/src/pages/account/loginPage/registerForm.vue
@@ -1,5 +1,5 @@
-
+ Tour Detail
\ No newline at end of file
diff --git a/software/src/pages/shows/ticketsPage/filterNavDrawer.vue b/software/src/pages/shows/ticketsPage/filterNavDrawer.vue
index 99cb766..59d57e3 100644
--- a/software/src/pages/shows/ticketsPage/filterNavDrawer.vue
+++ b/software/src/pages/shows/ticketsPage/filterNavDrawer.vue
@@ -1,8 +1,6 @@
diff --git a/software/src/pages/shows/ticketsPage/index.vue b/software/src/pages/shows/ticketsPage/index.vue
index d712d09..c8b2133 100644
--- a/software/src/pages/shows/ticketsPage/index.vue
+++ b/software/src/pages/shows/ticketsPage/index.vue
@@ -2,9 +2,7 @@
import tourCard from "./tourCard.vue"
import { ref, watch } from "vue";
import filterNavDrawer from "./filterNavDrawer.vue";
-import { useTourStore } from "@/data/stores/tourStore";
-const tourStore = useTourStore()
const showProductDetails = ref(false)
// const dialogProduct = ref(new ProductModel())
@@ -20,7 +18,7 @@ const showProductDetails = ref(false)
-
+
diff --git a/software/src/pages/shows/ticketsPage/productDetailsDialog.vue b/software/src/pages/shows/ticketsPage/productDetailsDialog.vue
index baa820c..37df891 100644
--- a/software/src/pages/shows/ticketsPage/productDetailsDialog.vue
+++ b/software/src/pages/shows/ticketsPage/productDetailsDialog.vue
@@ -2,43 +2,40 @@
import { VNumberInput } from 'vuetify/labs/VNumberInput'
import { ModelRef, ref, watch } from 'vue';
import { useBasketStore } from '@/data/stores/basketStore';
-import { calcPrice } from '@/scripts/productScripts';
import ActionDialog from '@/components/actionDialog.vue'
-import { ProductModel } from '@/data/models/productModel';
import outlinedButton from '@/components/outlinedButton.vue';
-const props = defineProps({
- product: {
- type: ProductModel,
- default: new ProductModel()
- }
-})
+// const props = defineProps({
+// product: {
+// type: ProductModel,
+// default: new ProductModel()
+// }
+// })
-const showDialog: ModelRef = defineModel()
-const nrOfArticles = ref(1)
-const basketStore = useBasketStore()
-const selectedImage = ref("")
+// const showDialog: ModelRef = defineModel()
+// const nrOfArticles = ref(1)
+// const basketStore = useBasketStore()
+// const selectedImage = ref("")
-function addProductToBasket() {
- basketStore.addItemToBasket(props.product, nrOfArticles.value)
- nrOfArticles.value = 1
- showDialog.value = false
-}
+// function addProductToBasket() {
+// basketStore.addItemToBasket(props.product, nrOfArticles.value)
+// nrOfArticles.value = 1
+// showDialog.value = false
+// }
-watch(() => props.product.images, () => {
- selectedImage.value = 'http://localhost:3000/static/' + props.product.images[0]
-})
+// watch(() => props.product.images, () => {
+// selectedImage.value = 'http://localhost:3000/static/' + props.product.images[0]
+// })
-
-
@@ -66,7 +63,6 @@ watch(() => props.product.images, () => {
-
@@ -157,5 +153,5 @@ watch(() => props.product.images, () => {
{{ $t('addToBasket') }}
-
+ -->
\ No newline at end of file
diff --git a/software/src/pages/shows/ticketsPage/tourCard.vue b/software/src/pages/shows/ticketsPage/tourCard.vue
index 7643aec..c7c62a9 100644
--- a/software/src/pages/shows/ticketsPage/tourCard.vue
+++ b/software/src/pages/shows/ticketsPage/tourCard.vue
@@ -1,18 +1,17 @@
-
{{ tour.shows.length }} {{ $t('tours.concert', tour.shows.length) }}
-
+ -->
-
+