feat(booking): move event and ticket configuration to database
Replace hardcoded event details and ticket types with dynamic DB records Add booking-config API endpoint to serve active event settings
This commit is contained in:
@@ -213,7 +213,7 @@
|
||||
<template #quantity-cell="{ row }">
|
||||
<div class="space-y-0.5 py-0.5">
|
||||
<div class="text-sm font-medium text-default">
|
||||
{{ ticketLabel(row.original.ticketType) }}
|
||||
{{ ticketLabel(row.original) }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -243,7 +243,7 @@
|
||||
<template #status-cell="{ row }">
|
||||
<div class="space-y-1 py-0.5">
|
||||
<UBadge
|
||||
:label="getBookingStatusLabel(row.original.status)"
|
||||
:label="getBookingStatusLabel(row.original.status, row.original.statusLabel)"
|
||||
:color="row.original.status === 'confirmed' ? 'success' : 'warning'"
|
||||
variant="soft"
|
||||
size="sm"
|
||||
@@ -288,12 +288,11 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type { BookingCapacitySettings, BookingInventorySummary, PublicBooking, TicketType } from '~~/shared/booking'
|
||||
import type { BookingCapacitySettings, BookingInventorySummary, PublicBooking } from '~~/shared/booking'
|
||||
|
||||
import {
|
||||
formatBookingCurrency,
|
||||
getBookingStatusLabel,
|
||||
getTicketCatalogItem
|
||||
getBookingStatusLabel
|
||||
} from '~~/shared/booking'
|
||||
|
||||
import { getErrorMessage } from '../../utils/errors'
|
||||
@@ -370,6 +369,7 @@ const filteredBookings = computed(() => {
|
||||
booking.personInChargeName,
|
||||
booking.personInChargePhoneNumber,
|
||||
booking.ticketType,
|
||||
booking.ticketLabel,
|
||||
booking.status
|
||||
].some((value) => value.toLowerCase().includes(keyword))
|
||||
})
|
||||
@@ -385,8 +385,8 @@ const confirmedCount = computed(() => {
|
||||
|
||||
await refreshBookings()
|
||||
|
||||
function ticketLabel(ticketType: TicketType) {
|
||||
return getTicketCatalogItem(ticketType)?.label || ticketType.toUpperCase()
|
||||
function ticketLabel(booking: PublicBooking) {
|
||||
return booking.ticketLabel || booking.ticketType.toUpperCase()
|
||||
}
|
||||
|
||||
function confirmationPath(booking: PublicBooking) {
|
||||
|
||||
Reference in New Issue
Block a user