Atomize model classes
This commit is contained in:
@@ -5,11 +5,11 @@ import { useRouter } from 'vue-router';
|
||||
import outlinedButton from '@/components/basics/outlinedButton.vue';
|
||||
import { getUserOrders } from '@/data/api/orderApi';
|
||||
import { ref } from 'vue';
|
||||
import { OrderModel } from '@/data/models/ordering/orderModel';
|
||||
import { OrderApiModel } from '@/data/models/ordering/orderApiModel';
|
||||
|
||||
const accountStore = useAccountStore()
|
||||
const router = useRouter()
|
||||
const orders = ref<Array<OrderModel>>([])
|
||||
const orders = ref<Array<OrderApiModel>>([])
|
||||
|
||||
getUserOrders(accountStore.userAccount.id)
|
||||
.then(result => {
|
||||
@@ -32,7 +32,9 @@ getUserOrders(accountStore.userAccount.id)
|
||||
v-for="order in orders"
|
||||
>
|
||||
<v-col>
|
||||
<order-item :order="order" />
|
||||
<order-item
|
||||
:order="order"
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
import cardView from '@/components/basics/cardView.vue';
|
||||
import { OrderModel } from '@/data/models/ordering/orderModel';
|
||||
import { useAccountStore } from '@/data/stores/accountStore';
|
||||
import ticketListItem from '@/components/pageParts/ticketListItem.vue';
|
||||
|
||||
const accountStore = useAccountStore()
|
||||
import { OrderApiModel } from '@/data/models/ordering/orderApiModel';
|
||||
|
||||
defineProps({
|
||||
order: OrderModel,
|
||||
order: OrderApiModel,
|
||||
loading: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
@@ -56,12 +53,16 @@ function formatDateTimeString(string: string) {
|
||||
<v-col>
|
||||
<ticket-list-item
|
||||
:concert="ticket.concert"
|
||||
:event="ticket.concert.event"
|
||||
:band="ticket.concert.event.band"
|
||||
:location="ticket.concert.location"
|
||||
:city="ticket.concert.location.city"
|
||||
:image="ticket.concert.event.image"
|
||||
:seat-group="ticket.seat.seatRow.seatGroup.name"
|
||||
/>
|
||||
<!-- todo :seat-group="ticket.seat.seatRow.seatGroup.name"
|
||||
:seat-row="ticket.seat.seatRow.row"
|
||||
:seat="ticket.seat.seatNr"
|
||||
:standing-area="ticket.seat.seatRow.seatGroup.standingArea"
|
||||
/>
|
||||
:standing-area="ticket.seat.seatRow.seatGroup.standingArea" -->
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
|
||||
@@ -5,8 +5,6 @@ import orderingDialog from './orderingDialog.vue';
|
||||
import outlinedButton from '@/components/basics/outlinedButton.vue';
|
||||
import { ref } from 'vue';
|
||||
import { useAccountStore } from '@/data/stores/accountStore';
|
||||
import concertListItem from '@/components/pageParts/concertListItem.vue';
|
||||
import { dateStringToHumanReadableString } from '@/scripts/dateTimeScripts';
|
||||
import ticketsTable from './ticketsTable.vue';
|
||||
|
||||
const basketStore = useBasketStore()
|
||||
|
||||
@@ -8,10 +8,6 @@ const basketStore = useBasketStore()
|
||||
function removeFromBasket(basketItem: BasketItemModel) {
|
||||
basketStore.removeItemFromBasket(basketItem)
|
||||
}
|
||||
|
||||
function editQuantity(basketItem: BasketItemModel) {
|
||||
// todo
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -31,12 +27,12 @@ function editQuantity(basketItem: BasketItemModel) {
|
||||
<tr v-for="basketItem in basketStore.itemsInBasket">
|
||||
<!-- Band name -->
|
||||
<td>
|
||||
{{ basketItem.concert.event.band.name }}
|
||||
{{ basketItem.band.name }}
|
||||
</td>
|
||||
|
||||
<!-- Event name -->
|
||||
<td>
|
||||
{{ basketItem.concert.event.name }}
|
||||
{{ basketItem.event.name }}
|
||||
</td>
|
||||
|
||||
<!-- Quantity -->
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<script setup lang="ts">
|
||||
import { BandModel } from '@/data/models/acts/bandModel';
|
||||
import cardWithTopImage from '@/components/basics/cardViewTopImage.vue';
|
||||
import { useFeedbackStore } from '@/data/stores/feedbackStore';
|
||||
import { BandApiModel } from '@/data/models/acts/bandApiModel';
|
||||
|
||||
const feedbackStore = useFeedbackStore()
|
||||
|
||||
defineProps({
|
||||
band: {
|
||||
type: BandModel,
|
||||
type: BandApiModel,
|
||||
required: true
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,48 +1,48 @@
|
||||
<script setup lang="ts">
|
||||
import { BandModel } from '@/data/models/acts/bandModel';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useFeedbackStore } from '@/data/stores/feedbackStore';
|
||||
import concertListItem from '@/components/pageParts/concertListItem.vue';
|
||||
import { ConcertApiModel } from '@/data/models/acts/concertApiModel';
|
||||
import { BandApiModel } from '@/data/models/acts/bandApiModel';
|
||||
import { EventApiModel } from '@/data/models/acts/eventApiModel';
|
||||
|
||||
const router = useRouter()
|
||||
const feedbackStore = useFeedbackStore()
|
||||
|
||||
defineProps({
|
||||
band: {
|
||||
type: BandModel,
|
||||
required: true
|
||||
}
|
||||
band: BandApiModel,
|
||||
events: Array<EventApiModel>
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<v-row v-if="feedbackStore.fetchDataFromServerInProgress" v-for="i in 3">
|
||||
<v-col>
|
||||
<concert-list-item :loading="true" />
|
||||
<!-- <concert-list-item
|
||||
:loading="true" /> -->
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<v-row v-else v-for="concert of band.events[0].concerts">
|
||||
<v-col>
|
||||
<concert-list-item
|
||||
:date="concert.date"
|
||||
:price="concert.price"
|
||||
:title="concert.location.city.name"
|
||||
:description="concert.location.name"
|
||||
:link="concert.inStock > 0"
|
||||
:in-stock="concert.inStock"
|
||||
:onClick="() => router.push('/concert/' + concert.id)"
|
||||
>
|
||||
<template #description>
|
||||
<div>
|
||||
{{ concert.location.name }}
|
||||
</div>
|
||||
<div v-else v-for="event of events">
|
||||
<v-row v-for="concert of event.concerts">
|
||||
<v-col>
|
||||
<concert-list-item
|
||||
:concert="concert"
|
||||
:title="concert.location.city.name"
|
||||
:link="concert.inStock > 0"
|
||||
:onClick="() => router.push('/concert/' + concert.id)"
|
||||
>
|
||||
<template #description>
|
||||
<div>
|
||||
{{ concert.location.name }}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
{{ band.name }} - {{ band.events[0].name }}
|
||||
</div>
|
||||
</template>
|
||||
</concert-list-item>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<div>
|
||||
{{ band.name }} - {{ band.events[0].name }}
|
||||
</div>
|
||||
</template>
|
||||
</concert-list-item>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
</template>
|
||||
@@ -1,5 +1,4 @@
|
||||
<script setup lang="ts">
|
||||
import { BandModel } from '@/data/models/acts/bandModel';
|
||||
import { useRouter } from 'vue-router';
|
||||
import ratingSection from './ratingSection.vue';
|
||||
import bandMemberSection from './bandMemberSection.vue';
|
||||
@@ -11,11 +10,13 @@ import { useShoppingStore } from '@/data/stores/shoppingStore';
|
||||
import { ref } from 'vue';
|
||||
import { useFeedbackStore } from '@/data/stores/feedbackStore';
|
||||
import { getBand } from '@/data/api/bandApi';
|
||||
import { BandApiModel } from '@/data/models/acts/bandApiModel';
|
||||
import { genre } from 'backend/routes/genre.routes';
|
||||
|
||||
const router = useRouter()
|
||||
const shoppingStore = useShoppingStore()
|
||||
const feedbackStore = useFeedbackStore()
|
||||
const band = ref<BandModel>(new BandModel())
|
||||
const band = ref<BandApiModel>(new BandApiModel())
|
||||
|
||||
feedbackStore.fetchDataFromServerInProgress = true
|
||||
|
||||
@@ -47,7 +48,10 @@ getBand(String(router.currentRoute.value.params.bandName).replaceAll('-', ' '))
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<concert-section :band="band"/>
|
||||
<concert-section
|
||||
:band="band"
|
||||
:events="band.events"
|
||||
/>
|
||||
|
||||
<v-row>
|
||||
<v-col>
|
||||
@@ -64,7 +68,7 @@ getBand(String(router.currentRoute.value.params.bandName).replaceAll('-', ' '))
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<rating-section :band="band" />
|
||||
<rating-section :ratings="band.ratings" />
|
||||
|
||||
|
||||
<v-row>
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import { BandModel } from '@/data/models/acts/bandModel';
|
||||
import { useFeedbackStore } from '@/data/stores/feedbackStore';
|
||||
import { BandApiModel } from '@/data/models/acts/bandApiModel';
|
||||
import { RatingModel } from '@/data/models/acts/ratingModel';
|
||||
import { calcRating, calcRatingValues } from '@/scripts/concertScripts';
|
||||
|
||||
const feedbackStore = useFeedbackStore()
|
||||
|
||||
defineProps({
|
||||
band: {
|
||||
type: BandModel,
|
||||
ratings: {
|
||||
type: Array<RatingModel>,
|
||||
required: true
|
||||
}
|
||||
})
|
||||
@@ -18,32 +16,32 @@ defineProps({
|
||||
<v-col>
|
||||
<div class="d-flex align-center justify-center flex-column" style="height: 100%;">
|
||||
<div class="text-h2 mt-5">
|
||||
{{ calcRating(band.ratings).toFixed(1) }}
|
||||
{{ calcRating(ratings).toFixed(1) }}
|
||||
<span class="text-h6 ml-n3">/5</span>
|
||||
</div>
|
||||
|
||||
<v-rating
|
||||
:model-value="calcRating(band.ratings)"
|
||||
:model-value="calcRating(ratings)"
|
||||
color="yellow-darken-3"
|
||||
half-increments
|
||||
size="x-large"
|
||||
readonly
|
||||
/>
|
||||
|
||||
<div class="px-3 text-h6">{{ band.ratings.length }} {{ $t('rating', band.ratings.length) }}</div>
|
||||
<div class="px-3 text-h6">{{ ratings.length }} {{ $t('rating', ratings.length) }}</div>
|
||||
</div>
|
||||
</v-col>
|
||||
|
||||
<v-col>
|
||||
<v-list>
|
||||
<v-list-item v-for="ratingValue in calcRatingValues(band.ratings)">
|
||||
<v-list-item v-for="ratingValue in calcRatingValues(ratings)">
|
||||
<template v-slot:prepend>
|
||||
<span>{{ ratingValue.value }}</span>
|
||||
<v-icon class="ml-3 mr-n3" icon="mdi-star" />
|
||||
</template>
|
||||
|
||||
<v-progress-linear
|
||||
:model-value="(ratingValue.count / band.ratings.length) * 100"
|
||||
:model-value="(ratingValue.count / ratings.length) * 100"
|
||||
height="20"
|
||||
color="yellow-darken-3"
|
||||
rounded
|
||||
|
||||
@@ -33,9 +33,10 @@ shoppingStore.getEvents()
|
||||
v-for="i in 3"
|
||||
>
|
||||
<v-col>
|
||||
<event-list-item
|
||||
Loading...
|
||||
<!-- todo <event-list-item
|
||||
:loading="true"
|
||||
/>
|
||||
/> -->
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
@@ -46,6 +47,8 @@ shoppingStore.getEvents()
|
||||
<v-col>
|
||||
<event-list-item
|
||||
:event="event"
|
||||
:band="event.band"
|
||||
:concerts="event.concerts"
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
@@ -8,12 +8,12 @@ import { useRouter } from 'vue-router';
|
||||
import sectionDivider from '@/components/basics/sectionDivider.vue';
|
||||
import { useBasketStore } from '@/data/stores/basketStore';
|
||||
import concertListItem from '@/components/pageParts/concertListItem.vue';
|
||||
import { ConcertModel } from '@/data/models/acts/concertModel';
|
||||
import outlinedButton from '@/components/basics/outlinedButton.vue';
|
||||
import { ConcertApiModel } from '@/data/models/acts/concertApiModel';
|
||||
|
||||
const router = useRouter()
|
||||
const seatGroups = ref<Array<SeatGroupModel>>()
|
||||
const concertModel = ref<ConcertModel>(new ConcertModel())
|
||||
const concertModel = ref<ConcertApiModel>(new ConcertApiModel())
|
||||
const feedbackStore = useFeedbackStore()
|
||||
const basketStore = useBasketStore()
|
||||
|
||||
@@ -42,12 +42,10 @@ getConcert(Number(router.currentRoute.value.params.id))
|
||||
<v-row>
|
||||
<v-col>
|
||||
<concert-list-item
|
||||
:concert="concertModel"
|
||||
:loading="feedbackStore.fetchDataFromServerInProgress"
|
||||
:link="false"
|
||||
:title="concertModel.location.city.name"
|
||||
:image="concertModel.location.imageOutdoor"
|
||||
:date="concertModel.date"
|
||||
:price="concertModel.price"
|
||||
:show-button="false"
|
||||
>
|
||||
<template #description>
|
||||
@@ -79,7 +77,10 @@ getConcert(Number(router.currentRoute.value.params.id))
|
||||
|
||||
<v-col v-else>
|
||||
<seat-plan-map
|
||||
:concert="concertModel" :seat-groups="seatGroups" :location="concertModel.location" />
|
||||
:concert="concertModel"
|
||||
:seat-groups="seatGroups"
|
||||
:location="concertModel.location"
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
@@ -103,7 +104,8 @@ getConcert(Number(router.currentRoute.value.params.id))
|
||||
<v-row class="pb-5">
|
||||
<outlined-button
|
||||
prepend-icon="mdi-basket-plus"
|
||||
@click="basketStore.moveSeatSelectionsToBasket(); router.push('/basket')"
|
||||
@click="basketStore.moveSeatSelectionsToBasket(concertModel.event, concertModel.event.band);
|
||||
router.push('/basket')"
|
||||
:disabled="basketStore.selectedSeats.length == 0"
|
||||
block
|
||||
>
|
||||
|
||||
@@ -9,13 +9,14 @@ import { useFeedbackStore } from '@/data/stores/feedbackStore';
|
||||
import { ref } from 'vue';
|
||||
import { EventModel } from '@/data/models/acts/eventModel';
|
||||
import { getTopEvents } from '@/data/api/eventApi';
|
||||
import { LocationModel } from '@/data/models/locations/locationModel';
|
||||
import { getTopLocations } from '@/data/api/locationApi';
|
||||
import { LocationApiModel } from '@/data/models/locations/locationApiModel';
|
||||
import { EventApiModel } from '@/data/models/acts/eventApiModel';
|
||||
|
||||
const router = useRouter()
|
||||
const feedbackStore = useFeedbackStore()
|
||||
const topEvents = ref<Array<EventModel>>(Array.from({length: 4}, () => new EventModel()))
|
||||
const topLocations = ref<Array<LocationModel>>(Array.from({length: 8}, () => new LocationModel()))
|
||||
const topEvents = ref<Array<EventApiModel>>(Array.from({length: 4}, () => new EventApiModel()))
|
||||
const topLocations = ref<Array<LocationApiModel>>(Array.from({length: 8}, () => new LocationApiModel()))
|
||||
|
||||
feedbackStore.fetchDataFromServerInProgress = true
|
||||
|
||||
@@ -54,7 +55,7 @@ getTopEvents(4)
|
||||
@click="router.push('/bands/' + topEvents[i - 1].band.name.replaceAll(' ', '-').toLowerCase())"
|
||||
:loading="feedbackStore.fetchDataFromServerInProgress"
|
||||
>
|
||||
ab {{ lowestTicketPrice(topEvents[i - 1]) }} €
|
||||
ab {{ lowestTicketPrice(topEvents[i - 1].concerts) }} €
|
||||
</card-with-top-image>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
@@ -1,20 +1,17 @@
|
||||
<script setup lang="ts">
|
||||
import { LocationModel } from '@/data/models/locations/locationModel';
|
||||
import { useRouter } from 'vue-router';
|
||||
import sectionDivider from '@/components/basics/sectionDivider.vue';
|
||||
import { dateStringToHumanReadableString } from '@/scripts/dateTimeScripts';
|
||||
import seatPlanMap from '@/components/seatPlanMap/seatPlanMap.vue';
|
||||
import { useShoppingStore } from '@/data/stores/shoppingStore';
|
||||
import { getLocation } from '@/data/api/locationApi';
|
||||
import { ref } from 'vue';
|
||||
import { useFeedbackStore } from '@/data/stores/feedbackStore';
|
||||
import heroImage from '@/components/pageParts/heroImage.vue';
|
||||
import concertListItem from '@/components/pageParts/concertListItem.vue';
|
||||
import { LocationApiModel } from '@/data/models/locations/locationApiModel';
|
||||
|
||||
const router = useRouter()
|
||||
const shoppingStore = useShoppingStore()
|
||||
const feedbackStore = useFeedbackStore()
|
||||
const location = ref<LocationModel>(new LocationModel())
|
||||
const location = ref<LocationApiModel>(new LocationApiModel())
|
||||
|
||||
feedbackStore.fetchDataFromServerInProgress = true
|
||||
|
||||
@@ -22,7 +19,6 @@ getLocation(String(router.currentRoute.value.params.locationName))
|
||||
.then(result => {
|
||||
location.value = result.data
|
||||
feedbackStore.fetchDataFromServerInProgress = false
|
||||
console.log(location.value.seatGroups)
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -53,7 +49,8 @@ getLocation(String(router.currentRoute.value.params.locationName))
|
||||
|
||||
<v-row v-if="feedbackStore.fetchDataFromServerInProgress" v-for="i in 3">
|
||||
<v-col class="text-center">
|
||||
<concert-list-item :loading="feedbackStore.fetchDataFromServerInProgress" />
|
||||
Loading...
|
||||
<!-- todo <concert-list-item :loading="feedbackStore.fetchDataFromServerInProgress" /> -->
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
@@ -63,14 +60,12 @@ getLocation(String(router.currentRoute.value.params.locationName))
|
||||
>
|
||||
<v-col>
|
||||
<concert-list-item
|
||||
:date="concert.date"
|
||||
:concert="concert"
|
||||
:title="concert.event.name"
|
||||
:in-stock="concert.inStock"
|
||||
:price="concert.price"
|
||||
:onClick="() => router.push('/bands/' + concert.event.bandName.replaceAll(' ', '-').toLowerCase())"
|
||||
:onClick="() => router.push('/bands/' + concert.event.band.name.replaceAll(' ', '-').toLowerCase())"
|
||||
>
|
||||
<template #description>
|
||||
{{ concert.event.bandName }}
|
||||
{{ concert.event.band.name }}
|
||||
</template>
|
||||
</concert-list-item>
|
||||
</v-col>
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
import sectionDivider from '@/components/basics/sectionDivider.vue';
|
||||
import cardWithTopImage from '@/components/basics/cardViewTopImage.vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useShoppingStore } from '@/data/stores/shoppingStore';
|
||||
import { useFeedbackStore } from '@/data/stores/feedbackStore';
|
||||
import locationListItem from '@/components/pageParts/locationListItem.vue';
|
||||
|
||||
const shoppingStore = useShoppingStore()
|
||||
const feedbackStore = useFeedbackStore()
|
||||
const router = useRouter()
|
||||
|
||||
shoppingStore.getCities()
|
||||
</script>
|
||||
@@ -52,7 +50,10 @@ shoppingStore.getCities()
|
||||
|
||||
<v-row>
|
||||
<v-col v-for="location in city.locations" cols="3">
|
||||
<location-list-item :location="location" />
|
||||
<location-list-item
|
||||
:location="location"
|
||||
:concerts="location.concerts"
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
|
||||
@@ -46,7 +46,12 @@ const searchStore = useSearchStore()
|
||||
v-for="event in searchStore.events"
|
||||
>
|
||||
<v-col>
|
||||
<event-list-item :event="event" :loading="searchStore.searchInProgress" />
|
||||
<event-list-item
|
||||
:event="event"
|
||||
:band="event.band"
|
||||
:concerts="event.concerts"
|
||||
:loading="searchStore.searchInProgress"
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
@@ -55,7 +60,10 @@ const searchStore = useSearchStore()
|
||||
v-for="i in 3"
|
||||
>
|
||||
<v-col>
|
||||
<event-list-item :loading="searchStore.searchInProgress" />
|
||||
Loading...
|
||||
<!-- <event-list-item
|
||||
:loading="searchStore.searchInProgress"
|
||||
/> -->
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user