security: A01-13 — nest all event routes under organisation prefix

Move all authenticated organiser-facing event sub-resource routes from
/events/{event}/... to /organisations/{organisation}/events/{event}/...
to enforce multi-tenancy at the routing layer.

Changes:
- Routes: restructured api.php to nest all event sub-resources under
  the existing organisation prefix group
- Controllers: added Organisation parameter and VerifiesOrganisationEvent
  trait to all 12 affected controllers (sections, time-slots, shifts,
  persons, crowd-lists, locations, shift-assignments, registration-fields,
  availabilities, field-values, section-preferences, stats)
- Tests: updated all 20 feature test files with new route paths
- Frontend: updated 8 API composables and 20 Vue components/pages
- API.md: updated documentation to reflect new route structure

Portal routes, public routes (volunteer-register), and invitation routes
remain unchanged as they operate without organisation context.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-14 08:16:36 +02:00
parent 51e5dd6fcb
commit 7932e53daf
64 changed files with 726 additions and 568 deletions

View File

@@ -6,15 +6,17 @@ import type { Person } from '@/types/person'
const props = defineProps<{
eventId: string
orgId: string
crowdList: CrowdList
}>()
const modelValue = defineModel<boolean>({ required: true })
const orgIdRef = computed(() => props.orgId)
const eventIdRef = computed(() => props.eventId)
const { data: personsResponse } = usePersonList(eventIdRef)
const { mutate: addPerson, isPending } = useAddPersonToCrowdList(eventIdRef)
const { data: personsResponse } = usePersonList(orgIdRef, eventIdRef)
const { mutate: addPerson, isPending } = useAddPersonToCrowdList(orgIdRef, eventIdRef)
const selectedPersonId = ref<string | null>(null)
const showSuccess = ref(false)

View File

@@ -37,12 +37,12 @@ const {
isLoading: personsLoading,
isError: personsError,
refetch: refetchPersons,
} = useCrowdListPersons(eventIdRef, crowdListIdRef)
} = useCrowdListPersons(orgIdRef, eventIdRef, crowdListIdRef)
// Mutations
const { mutate: removePerson, isPending: isRemoving } = useRemovePersonFromCrowdList(eventIdRef)
const { mutate: approvePerson } = useApprovePerson(eventIdRef)
const { mutate: approveAllPending, isPending: isApprovingAll } = useApproveAllPending(eventIdRef)
const { mutate: removePerson, isPending: isRemoving } = useRemovePersonFromCrowdList(orgIdRef, eventIdRef)
const { mutate: approvePerson } = useApprovePerson(orgIdRef, eventIdRef)
const { mutate: approveAllPending, isPending: isApprovingAll } = useApproveAllPending(orgIdRef, eventIdRef)
// Resolved lookups
const crowdTypeObj = computed(() => {
@@ -715,6 +715,7 @@ function onApproveAllExecute() {
v-if="crowdList"
v-model="isAddPersonDialogOpen"
:event-id="eventId"
:org-id="orgId"
:crowd-list="crowdList"
/>

View File

@@ -22,8 +22,8 @@ const orgIdRef = computed(() => props.orgId)
const { data: crowdTypes } = useCrowdTypeList(orgIdRef)
const { data: companies } = useCompanies(orgIdRef)
const { mutate: createCrowdList, isPending: isCreating } = useCreateCrowdList(eventIdRef)
const { mutate: updateCrowdList, isPending: isUpdating } = useUpdateCrowdList(eventIdRef)
const { mutate: createCrowdList, isPending: isCreating } = useCreateCrowdList(orgIdRef, eventIdRef)
const { mutate: updateCrowdList, isPending: isUpdating } = useUpdateCrowdList(orgIdRef, eventIdRef)
const isPending = computed(() => isCreating.value || isUpdating.value)

View File

@@ -17,7 +17,7 @@ const orgIdRef = computed(() => props.orgId)
const eventIdRef = computed(() => props.eventId)
const { data: events, isLoading: isLoadingEvents } = useEventList(orgIdRef)
const { mutate: importFields, isPending } = useImportFieldsFromEvent(eventIdRef)
const { mutate: importFields, isPending } = useImportFieldsFromEvent(orgIdRef, eventIdRef)
const selectedEventId = ref<string | null>(null)

View File

@@ -20,7 +20,7 @@ const orgIdRef = computed(() => props.orgId)
const eventIdRef = computed(() => props.eventId)
const { data: templates, isLoading } = useRegistrationFieldTemplates(orgIdRef)
const { mutate: createFromTemplate, isPending } = useCreateFieldFromTemplate(eventIdRef)
const { mutate: createFromTemplate, isPending } = useCreateFieldFromTemplate(orgIdRef, eventIdRef)
const existingSlugs = computed(() =>
new Set(props.existingFields.map(f => f.slug)),

View File

@@ -1,14 +1,17 @@
<script setup lang="ts">
import { useEventStats } from '@/composables/api/useEvents'
import { useAuthStore } from '@/stores/useAuthStore'
const props = defineProps<{
eventId: string
}>()
const router = useRouter()
const authStore = useAuthStore()
const orgIdRef = computed(() => authStore.currentOrganisation?.id ?? '')
const eventIdRef = computed(() => props.eventId)
const { data: stats, isLoading, isError, refetch } = useEventStats(eventIdRef)
const { data: stats, isLoading, isError, refetch } = useEventStats(orgIdRef, eventIdRef)
function navigateTo(routeName: string) {
router.push({ name: routeName, params: { id: props.eventId } })

View File

@@ -35,7 +35,7 @@ const refVForm = ref<VForm>()
const showSuccess = ref(false)
const successName = ref('')
const { mutate: createPerson, isPending } = useCreatePerson(eventIdRef)
const { mutate: createPerson, isPending } = useCreatePerson(orgIdRef, eventIdRef)
const crowdTypeItems = computed(() =>
crowdTypes.value

View File

@@ -19,7 +19,7 @@ const orgIdRef = computed(() => props.orgId)
const { data: crowdTypes } = useCrowdTypeList(orgIdRef)
const { data: companies } = useCompanies(orgIdRef)
const { mutate: updatePerson, isPending } = useUpdatePerson(eventIdRef)
const { mutate: updatePerson, isPending } = useUpdatePerson(orgIdRef, eventIdRef)
const form = ref({
crowd_type_id: '',

View File

@@ -14,11 +14,12 @@ const emit = defineEmits<{
const modelValue = defineModel<boolean>({ required: true })
const orgIdRef = computed(() => props.orgId)
const eventIdRef = computed(() => props.eventId)
const personIdRef = computed(() => props.personId ?? '')
const { data: person, isLoading } = usePersonDetail(eventIdRef, personIdRef)
const { mutate: updatePerson } = useUpdatePerson(eventIdRef)
const { data: person, isLoading } = usePersonDetail(orgIdRef, eventIdRef, personIdRef)
const { mutate: updatePerson } = useUpdatePerson(orgIdRef, eventIdRef)
const activeTab = ref('info')

View File

@@ -1,6 +1,7 @@
<script setup lang="ts">
import { useAssignShift } from '@/composables/api/useShifts'
import { usePersonList } from '@/composables/api/usePersons'
import { useAuthStore } from '@/stores/useAuthStore'
import type { Shift } from '@/types/section'
import type { Person } from '@/types/person'
@@ -12,12 +13,14 @@ const props = defineProps<{
const modelValue = defineModel<boolean>({ required: true })
const authStore = useAuthStore()
const orgIdRef = computed(() => authStore.currentOrganisation?.id ?? '')
const eventIdRef = computed(() => props.eventId)
const sectionIdRef = computed(() => props.sectionId)
const approvedFilter = ref({ status: 'approved' })
const { data: personsResponse } = usePersonList(eventIdRef, approvedFilter)
const { mutate: assignShift, isPending } = useAssignShift(eventIdRef, sectionIdRef)
const { data: personsResponse } = usePersonList(orgIdRef, eventIdRef, approvedFilter)
const { mutate: assignShift, isPending } = useAssignShift(orgIdRef, eventIdRef, sectionIdRef)
const persons = computed(() => personsResponse.value?.data ?? [])

View File

@@ -39,7 +39,7 @@ const form = ref({
const errors = ref<Record<string, string>>({})
const refVForm = ref<VForm>()
const { mutate: createSection, isPending } = useCreateSection(eventIdRef)
const { mutate: createSection, isPending } = useCreateSection(orgId, eventIdRef)
const typeOptions = [
{ title: 'Standaard', value: 'standard' },

View File

@@ -2,6 +2,7 @@
import { VForm } from 'vuetify/components/VForm'
import { useCreateShift, useUpdateShift } from '@/composables/api/useShifts'
import { useTimeSlotList } from '@/composables/api/useTimeSlots'
import { useAuthStore } from '@/stores/useAuthStore'
import { requiredValidator } from '@core/utils/validators'
import type { Shift, ShiftStatus } from '@/types/section'
@@ -18,16 +19,18 @@ const modelValue = defineModel<boolean>({ required: true })
const router = useRouter()
const route = useRoute()
const authStore = useAuthStore()
const orgIdRef = computed(() => authStore.currentOrganisation?.id ?? '')
const eventIdRef = computed(() => props.eventId)
const sectionIdRef = computed(() => props.sectionId)
const isEditing = computed(() => !!props.shift)
const isSubEventRef = computed(() => props.isSubEvent)
const { data: timeSlots } = useTimeSlotList(eventIdRef, { includeParent: isSubEventRef })
const { mutate: createShift, isPending: isCreating } = useCreateShift(eventIdRef, sectionIdRef)
const { mutate: updateShift, isPending: isUpdating } = useUpdateShift(eventIdRef, sectionIdRef)
const { data: timeSlots } = useTimeSlotList(orgIdRef, eventIdRef, { includeParent: isSubEventRef })
const { mutate: createShift, isPending: isCreating } = useCreateShift(orgIdRef, eventIdRef, sectionIdRef)
const { mutate: updateShift, isPending: isUpdating } = useUpdateShift(orgIdRef, eventIdRef, sectionIdRef)
const isPending = computed(() => isCreating.value || isUpdating.value)

View File

@@ -1,6 +1,7 @@
<script setup lang="ts">
import { VForm } from 'vuetify/components/VForm'
import { useCreateTimeSlot, useUpdateTimeSlot } from '@/composables/api/useTimeSlots'
import { useAuthStore } from '@/stores/useAuthStore'
import { requiredValidator } from '@core/utils/validators'
import type { TimeSlot } from '@/types/section'
@@ -12,6 +13,8 @@ const props = defineProps<{
const modelValue = defineModel<boolean>({ required: true })
const authStore = useAuthStore()
const orgIdRef = computed(() => authStore.currentOrganisation?.id ?? '')
const eventIdRef = computed(() => props.eventId)
const isEditing = computed(() => !!props.timeSlot)
@@ -28,8 +31,8 @@ const form = ref({
const errors = ref<Record<string, string>>({})
const refVForm = ref<VForm>()
const { mutate: createTimeSlot, isPending: isCreating } = useCreateTimeSlot(eventIdRef)
const { mutate: updateTimeSlot, isPending: isUpdating } = useUpdateTimeSlot(eventIdRef)
const { mutate: createTimeSlot, isPending: isCreating } = useCreateTimeSlot(orgIdRef, eventIdRef)
const { mutate: updateTimeSlot, isPending: isUpdating } = useUpdateTimeSlot(orgIdRef, eventIdRef)
const isPending = computed(() => isCreating.value || isUpdating.value)

View File

@@ -35,7 +35,7 @@ const form = ref({
const errors = ref<Record<string, string>>({})
const refVForm = ref<VForm>()
const { mutate: updateSection, isPending } = useUpdateSection(eventIdRef)
const { mutate: updateSection, isPending } = useUpdateSection(orgId, eventIdRef)
const typeOptions = [
{ title: 'Standaard', value: 'standard' },

View File

@@ -2,6 +2,7 @@
import draggable from 'vuedraggable'
import { useSectionList, useDeleteSection, useReorderSections } from '@/composables/api/useSections'
import { useShiftList, useDeleteShift } from '@/composables/api/useShifts'
import { useAuthStore } from '@/stores/useAuthStore'
import CreateSectionDialog from '@/components/sections/CreateSectionDialog.vue'
import EditSectionDialog from '@/components/sections/EditSectionDialog.vue'
import CreateShiftDialog from '@/components/sections/CreateShiftDialog.vue'
@@ -11,17 +12,19 @@ import { useShiftDetailStore } from '@/stores/useShiftDetailStore'
import type { FestivalSection, Shift, ShiftStatus } from '@/types/section'
const shiftDetailStore = useShiftDetailStore()
const authStore = useAuthStore()
const props = defineProps<{
eventId: string
isSubEvent?: boolean
}>()
const orgIdRef = computed(() => authStore.currentOrganisation?.id ?? '')
const eventIdRef = computed(() => props.eventId)
// --- Section list ---
const { data: sectionsQuery, isLoading: sectionsLoading } = useSectionList(eventIdRef)
const { mutate: reorderSections } = useReorderSections(eventIdRef)
const { data: sectionsQuery, isLoading: sectionsLoading } = useSectionList(orgIdRef, eventIdRef)
const { mutate: reorderSections } = useReorderSections(orgIdRef, eventIdRef)
// Local ref for draggable — synced from query but not overwritten during drag
const sections = ref<FestivalSection[]>([])
@@ -57,14 +60,14 @@ const activeSectionEventId = computed(() => {
})
const activeSectionEventIdRef = computed(() => activeSectionEventId.value)
const { mutate: deleteSection } = useDeleteSection(activeSectionEventIdRef)
const { mutate: deleteSection } = useDeleteSection(orgIdRef, activeSectionEventIdRef)
// --- Shifts for active section ---
const activeSectionIdRef = computed(() => activeSectionId.value ?? '')
const { data: shifts, isLoading: shiftsLoading } = useShiftList(activeSectionEventIdRef, activeSectionIdRef)
const { mutate: deleteShiftMutation, isPending: isDeleting } = useDeleteShift(activeSectionEventIdRef, activeSectionIdRef)
const { data: shifts, isLoading: shiftsLoading } = useShiftList(orgIdRef, activeSectionEventIdRef, activeSectionIdRef)
const { mutate: deleteShiftMutation, isPending: isDeleting } = useDeleteShift(orgIdRef, activeSectionEventIdRef, activeSectionIdRef)
// Group shifts by time_slot_id
const shiftsByTimeSlot = computed(() => {

View File

@@ -1,6 +1,7 @@
<script setup lang="ts">
import { useAssignablePersons, useAssignPersonToShift } from '@/composables/api/useShiftAssignments'
import { getApiErrorMessage } from '@/lib/apiErrors'
import { useAuthStore } from '@/stores/useAuthStore'
import type { AssignablePerson } from '@/types/shiftAssignment'
import type { Shift } from '@/types/section'
@@ -16,11 +17,13 @@ const emit = defineEmits<{
const modelValue = defineModel<boolean>({ required: true })
const authStore = useAuthStore()
const orgIdRef = computed(() => authStore.currentOrganisation?.id ?? '')
const eventIdRef = computed(() => props.eventId)
const shiftIdRef = computed(() => props.shift?.id ?? '')
const { data: assignableData, isLoading } = useAssignablePersons(eventIdRef, shiftIdRef)
const { mutateAsync: assignPerson, isPending: isAssigning } = useAssignPersonToShift(eventIdRef)
const { data: assignableData, isLoading } = useAssignablePersons(orgIdRef, eventIdRef, shiftIdRef)
const { mutateAsync: assignPerson, isPending: isAssigning } = useAssignPersonToShift(orgIdRef, eventIdRef)
// Search and filters
const searchQuery = ref('')

View File

@@ -9,6 +9,7 @@ import {
} from '@/composables/api/useShiftAssignments'
import AssignPersonDialog from '@/components/shifts/AssignPersonDialog.vue'
import { getApiErrorMessage } from '@/lib/apiErrors'
import { useAuthStore } from '@/stores/useAuthStore'
import { useShiftDetailStore } from '@/stores/useShiftDetailStore'
import { ShiftAssignmentStatus } from '@/types/shiftAssignment'
import type { ShiftAssignment } from '@/types/shiftAssignment'
@@ -21,7 +22,9 @@ const props = defineProps<{
const modelValue = defineModel<boolean>({ required: true })
const authStore = useAuthStore()
const store = useShiftDetailStore()
const orgIdRef = computed(() => authStore.currentOrganisation?.id ?? '')
const eventIdRef = computed(() => props.eventId)
// Fetch assignments filtered by this shift
@@ -34,16 +37,16 @@ const {
isLoading: assignmentsLoading,
isError: assignmentsError,
refetch: refetchAssignments,
} = useShiftAssignmentList(eventIdRef, filters)
} = useShiftAssignmentList(orgIdRef, eventIdRef, filters)
const assignments = computed(() => assignmentsResponse.value?.data ?? [])
// Mutations
const { mutate: approveAssignment, isPending: isApproving } = useApproveAssignment(eventIdRef)
const { mutate: rejectAssignment, isPending: isRejecting } = useRejectAssignment(eventIdRef)
const { mutate: cancelAssignment, isPending: isCancelling } = useCancelAssignment(eventIdRef)
const { mutate: bulkApprove, isPending: isBulkApproving } = useBulkApproveAssignments(eventIdRef)
const { mutateAsync: assignPersonMutation } = useAssignPersonToShift(eventIdRef)
const { mutate: approveAssignment, isPending: isApproving } = useApproveAssignment(orgIdRef, eventIdRef)
const { mutate: rejectAssignment, isPending: isRejecting } = useRejectAssignment(orgIdRef, eventIdRef)
const { mutate: cancelAssignment, isPending: isCancelling } = useCancelAssignment(orgIdRef, eventIdRef)
const { mutate: bulkApprove, isPending: isBulkApproving } = useBulkApproveAssignments(orgIdRef, eventIdRef)
const { mutateAsync: assignPersonMutation } = useAssignPersonToShift(orgIdRef, eventIdRef)
// Re-assign
const reassigning = ref<string | null>(null)

View File

@@ -21,26 +21,26 @@ interface PaginatedResponse<T> {
}
}
export function useCrowdLists(eventId: Ref<string>) {
export function useCrowdLists(orgId: Ref<string>, eventId: Ref<string>) {
return useQuery({
queryKey: ['crowd-lists', eventId],
queryFn: async () => {
const { data } = await apiClient.get<{ data: CrowdList[] }>(
`/events/${eventId.value}/crowd-lists`,
`/organisations/${orgId.value}/events/${eventId.value}/crowd-lists`,
)
return data.data
},
enabled: () => !!eventId.value,
enabled: () => !!orgId.value && !!eventId.value,
})
}
export function useCrowdListPersons(eventId: Ref<string>, crowdListId: Ref<string>) {
export function useCrowdListPersons(orgId: Ref<string>, eventId: Ref<string>, crowdListId: Ref<string>) {
return useQuery({
queryKey: ['crowd-lists', eventId, 'persons', crowdListId],
queryFn: async () => {
const { data } = await apiClient.get<PaginatedResponse<Person>>(
`/events/${eventId.value}/crowd-lists/${crowdListId.value}/persons`,
`/organisations/${orgId.value}/events/${eventId.value}/crowd-lists/${crowdListId.value}/persons`,
)
return data
@@ -49,13 +49,13 @@ export function useCrowdListPersons(eventId: Ref<string>, crowdListId: Ref<strin
})
}
export function useCreateCrowdList(eventId: Ref<string>) {
export function useCreateCrowdList(orgId: Ref<string>, eventId: Ref<string>) {
const queryClient = useQueryClient()
return useMutation({
mutationFn: async (payload: CreateCrowdListDto) => {
const { data } = await apiClient.post<ApiResponse<CrowdList>>(
`/events/${eventId.value}/crowd-lists`,
`/organisations/${orgId.value}/events/${eventId.value}/crowd-lists`,
payload,
)
@@ -67,13 +67,13 @@ export function useCreateCrowdList(eventId: Ref<string>) {
})
}
export function useUpdateCrowdList(eventId: Ref<string>) {
export function useUpdateCrowdList(orgId: Ref<string>, eventId: Ref<string>) {
const queryClient = useQueryClient()
return useMutation({
mutationFn: async ({ id, ...payload }: UpdateCrowdListDto & { id: string }) => {
const { data } = await apiClient.put<ApiResponse<CrowdList>>(
`/events/${eventId.value}/crowd-lists/${id}`,
`/organisations/${orgId.value}/events/${eventId.value}/crowd-lists/${id}`,
payload,
)
@@ -85,12 +85,12 @@ export function useUpdateCrowdList(eventId: Ref<string>) {
})
}
export function useDeleteCrowdList(eventId: Ref<string>) {
export function useDeleteCrowdList(orgId: Ref<string>, eventId: Ref<string>) {
const queryClient = useQueryClient()
return useMutation({
mutationFn: async (id: string) => {
await apiClient.delete(`/events/${eventId.value}/crowd-lists/${id}`)
await apiClient.delete(`/organisations/${orgId.value}/events/${eventId.value}/crowd-lists/${id}`)
},
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ['crowd-lists', eventId.value] })
@@ -98,13 +98,13 @@ export function useDeleteCrowdList(eventId: Ref<string>) {
})
}
export function useAddPersonToCrowdList(eventId: Ref<string>) {
export function useAddPersonToCrowdList(orgId: Ref<string>, eventId: Ref<string>) {
const queryClient = useQueryClient()
return useMutation({
mutationFn: async ({ listId, personId }: { listId: string; personId: string }) => {
const { data } = await apiClient.post<ApiResponse<CrowdList>>(
`/events/${eventId.value}/crowd-lists/${listId}/persons`,
`/organisations/${orgId.value}/events/${eventId.value}/crowd-lists/${listId}/persons`,
{ person_id: personId },
)
@@ -116,13 +116,13 @@ export function useAddPersonToCrowdList(eventId: Ref<string>) {
})
}
export function useRemovePersonFromCrowdList(eventId: Ref<string>) {
export function useRemovePersonFromCrowdList(orgId: Ref<string>, eventId: Ref<string>) {
const queryClient = useQueryClient()
return useMutation({
mutationFn: async ({ listId, personId }: { listId: string; personId: string }) => {
await apiClient.delete(
`/events/${eventId.value}/crowd-lists/${listId}/persons/${personId}`,
`/organisations/${orgId.value}/events/${eventId.value}/crowd-lists/${listId}/persons/${personId}`,
)
},
onSuccess: (_data, variables) => {
@@ -134,7 +134,7 @@ export function useRemovePersonFromCrowdList(eventId: Ref<string>) {
})
}
export function useApproveAllPending(eventId: Ref<string>) {
export function useApproveAllPending(orgId: Ref<string>, eventId: Ref<string>) {
const queryClient = useQueryClient()
return useMutation({
@@ -142,7 +142,7 @@ export function useApproveAllPending(eventId: Ref<string>) {
const results = await Promise.allSettled(
personIds.map(id =>
apiClient.post<ApiResponse<Person>>(
`/events/${eventId.value}/persons/${id}/approve`,
`/organisations/${orgId.value}/events/${eventId.value}/persons/${id}/approve`,
),
),
)

View File

@@ -175,15 +175,15 @@ export function useUploadEventImage(orgId: Ref<string>, eventId: Ref<string>) {
})
}
export function useEventStats(eventId: Ref<string>) {
export function useEventStats(orgId: Ref<string>, eventId: Ref<string>) {
return useQuery({
queryKey: ['events', eventId, 'stats'],
queryFn: async () => {
const { data } = await apiClient.get<{ data: EventStats }>(
`/events/${eventId.value}/stats`,
`/organisations/${orgId.value}/events/${eventId.value}/stats`,
)
return data.data
},
enabled: () => !!eventId.value,
enabled: () => !!orgId.value && !!eventId.value,
})
}

View File

@@ -24,6 +24,7 @@ interface PaginatedResponse<T> {
}
export function usePersonList(
orgId: Ref<string>,
eventId: Ref<string>,
filters?: Ref<{ crowd_type_id?: string; status?: string }>,
) {
@@ -37,37 +38,37 @@ export function usePersonList(
params.status = filters.value.status
const { data } = await apiClient.get<PaginatedResponse<Person>>(
`/events/${eventId.value}/persons`,
`/organisations/${orgId.value}/events/${eventId.value}/persons`,
{ params },
)
return data
},
enabled: () => !!eventId.value,
enabled: () => !!orgId.value && !!eventId.value,
})
}
export function usePersonDetail(eventId: Ref<string>, id: Ref<string>) {
export function usePersonDetail(orgId: Ref<string>, eventId: Ref<string>, id: Ref<string>) {
return useQuery({
queryKey: ['persons', eventId, 'detail', id],
queryFn: async () => {
const { data } = await apiClient.get<ApiResponse<Person>>(
`/events/${eventId.value}/persons/${id.value}`,
`/organisations/${orgId.value}/events/${eventId.value}/persons/${id.value}`,
)
return data.data
},
enabled: () => !!eventId.value && !!id.value,
enabled: () => !!orgId.value && !!eventId.value && !!id.value,
})
}
export function useCreatePerson(eventId: Ref<string>) {
export function useCreatePerson(orgId: Ref<string>, eventId: Ref<string>) {
const queryClient = useQueryClient()
return useMutation({
mutationFn: async (payload: CreatePersonPayload) => {
const { data } = await apiClient.post<ApiResponse<Person>>(
`/events/${eventId.value}/persons`,
`/organisations/${orgId.value}/events/${eventId.value}/persons`,
payload,
)
@@ -79,13 +80,13 @@ export function useCreatePerson(eventId: Ref<string>) {
})
}
export function useUpdatePerson(eventId: Ref<string>) {
export function useUpdatePerson(orgId: Ref<string>, eventId: Ref<string>) {
const queryClient = useQueryClient()
return useMutation({
mutationFn: async ({ id, ...payload }: UpdatePersonPayload & { id: string }) => {
const { data } = await apiClient.put<ApiResponse<Person>>(
`/events/${eventId.value}/persons/${id}`,
`/organisations/${orgId.value}/events/${eventId.value}/persons/${id}`,
payload,
)
@@ -98,13 +99,13 @@ export function useUpdatePerson(eventId: Ref<string>) {
})
}
export function useApprovePerson(eventId: Ref<string>) {
export function useApprovePerson(orgId: Ref<string>, eventId: Ref<string>) {
const queryClient = useQueryClient()
return useMutation({
mutationFn: async (id: string) => {
const { data } = await apiClient.post<ApiResponse<Person>>(
`/events/${eventId.value}/persons/${id}/approve`,
`/organisations/${orgId.value}/events/${eventId.value}/persons/${id}/approve`,
)
return data.data
@@ -115,12 +116,12 @@ export function useApprovePerson(eventId: Ref<string>) {
})
}
export function useDeletePerson(eventId: Ref<string>) {
export function useDeletePerson(orgId: Ref<string>, eventId: Ref<string>) {
const queryClient = useQueryClient()
return useMutation({
mutationFn: async (id: string) => {
await apiClient.delete(`/events/${eventId.value}/persons/${id}`)
await apiClient.delete(`/organisations/${orgId.value}/events/${eventId.value}/persons/${id}`)
},
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ['persons', eventId.value] })

View File

@@ -13,28 +13,28 @@ interface ApiResponse<T> {
message?: string
}
export function useRegistrationFormFields(eventId: Ref<string>) {
export function useRegistrationFormFields(orgId: Ref<string>, eventId: Ref<string>) {
return useQuery({
queryKey: ['registration-form-fields', eventId],
queryFn: async () => {
const { data } = await apiClient.get<{ data: RegistrationFormField[] }>(
`/events/${eventId.value}/registration-fields`,
`/organisations/${orgId.value}/events/${eventId.value}/registration-fields`,
)
return data.data
},
enabled: () => !!eventId.value,
enabled: () => !!orgId.value && !!eventId.value,
staleTime: Infinity,
})
}
export function useCreateRegistrationFormField(eventId: Ref<string>) {
export function useCreateRegistrationFormField(orgId: Ref<string>, eventId: Ref<string>) {
const queryClient = useQueryClient()
return useMutation({
mutationFn: async (payload: RegistrationFormFieldCreateDTO) => {
const { data } = await apiClient.post<ApiResponse<RegistrationFormField>>(
`/events/${eventId.value}/registration-fields`,
`/organisations/${orgId.value}/events/${eventId.value}/registration-fields`,
payload,
)
@@ -46,13 +46,13 @@ export function useCreateRegistrationFormField(eventId: Ref<string>) {
})
}
export function useUpdateRegistrationFormField(eventId: Ref<string>) {
export function useUpdateRegistrationFormField(orgId: Ref<string>, eventId: Ref<string>) {
const queryClient = useQueryClient()
return useMutation({
mutationFn: async ({ id, ...payload }: RegistrationFormFieldUpdateDTO & { id: string }) => {
const { data } = await apiClient.put<ApiResponse<RegistrationFormField>>(
`/events/${eventId.value}/registration-fields/${id}`,
`/organisations/${orgId.value}/events/${eventId.value}/registration-fields/${id}`,
payload,
)
@@ -64,12 +64,12 @@ export function useUpdateRegistrationFormField(eventId: Ref<string>) {
})
}
export function useDeleteRegistrationFormField(eventId: Ref<string>) {
export function useDeleteRegistrationFormField(orgId: Ref<string>, eventId: Ref<string>) {
const queryClient = useQueryClient()
return useMutation({
mutationFn: async (id: string) => {
await apiClient.delete(`/events/${eventId.value}/registration-fields/${id}`)
await apiClient.delete(`/organisations/${orgId.value}/events/${eventId.value}/registration-fields/${id}`)
},
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ['registration-form-fields', eventId] })
@@ -77,13 +77,13 @@ export function useDeleteRegistrationFormField(eventId: Ref<string>) {
})
}
export function useReorderRegistrationFormFields(eventId: Ref<string>) {
export function useReorderRegistrationFormFields(orgId: Ref<string>, eventId: Ref<string>) {
const queryClient = useQueryClient()
let previousFields: RegistrationFormField[] | undefined
return useMutation({
mutationFn: async (orderedIds: string[]) => {
await apiClient.post(`/events/${eventId.value}/registration-fields/reorder`, {
await apiClient.post(`/organisations/${orgId.value}/events/${eventId.value}/registration-fields/reorder`, {
ids: orderedIds,
})
},
@@ -107,13 +107,13 @@ export function useReorderRegistrationFormFields(eventId: Ref<string>) {
})
}
export function useCreateFieldFromTemplate(eventId: Ref<string>) {
export function useCreateFieldFromTemplate(orgId: Ref<string>, eventId: Ref<string>) {
const queryClient = useQueryClient()
return useMutation({
mutationFn: async (templateId: string) => {
const { data } = await apiClient.post<ApiResponse<RegistrationFormField>>(
`/events/${eventId.value}/registration-fields/from-template`,
`/organisations/${orgId.value}/events/${eventId.value}/registration-fields/from-template`,
{ template_id: templateId },
)
@@ -125,13 +125,13 @@ export function useCreateFieldFromTemplate(eventId: Ref<string>) {
})
}
export function useImportFieldsFromEvent(eventId: Ref<string>) {
export function useImportFieldsFromEvent(orgId: Ref<string>, eventId: Ref<string>) {
const queryClient = useQueryClient()
return useMutation({
mutationFn: async (sourceEventId: string) => {
const { data } = await apiClient.post<ApiResponse<RegistrationFormField[]>>(
`/events/${eventId.value}/registration-fields/import-from-event`,
`/organisations/${orgId.value}/events/${eventId.value}/registration-fields/import-from-event`,
{ source_event_id: sourceEventId },
)

View File

@@ -27,17 +27,17 @@ export function useSectionCategories(orgId: Ref<string>) {
})
}
export function useSectionList(eventId: Ref<string>) {
export function useSectionList(orgId: Ref<string>, eventId: Ref<string>) {
return useQuery({
queryKey: ['sections', eventId],
queryFn: async () => {
const { data } = await apiClient.get<PaginatedResponse<FestivalSection>>(
`/events/${eventId.value}/sections`,
`/organisations/${orgId.value}/events/${eventId.value}/sections`,
)
return data.data
},
enabled: () => !!eventId.value,
enabled: () => !!orgId.value && !!eventId.value,
})
}
@@ -47,13 +47,13 @@ export interface CreateSectionResult {
parentEventName?: string
}
export function useCreateSection(eventId: Ref<string>) {
export function useCreateSection(orgId: Ref<string>, eventId: Ref<string>) {
const queryClient = useQueryClient()
return useMutation({
mutationFn: async (payload: CreateSectionPayload): Promise<CreateSectionResult> => {
const { data } = await apiClient.post<ApiResponse<FestivalSection> & { meta?: { redirected_to_parent?: boolean; parent_event_name?: string } }>(
`/events/${eventId.value}/sections`,
`/organisations/${orgId.value}/events/${eventId.value}/sections`,
payload,
)
@@ -69,13 +69,13 @@ export function useCreateSection(eventId: Ref<string>) {
})
}
export function useUpdateSection(eventId: Ref<string>) {
export function useUpdateSection(orgId: Ref<string>, eventId: Ref<string>) {
const queryClient = useQueryClient()
return useMutation({
mutationFn: async ({ id, ...payload }: UpdateSectionPayload & { id: string }) => {
const { data } = await apiClient.put<ApiResponse<FestivalSection>>(
`/events/${eventId.value}/sections/${id}`,
`/organisations/${orgId.value}/events/${eventId.value}/sections/${id}`,
payload,
)
@@ -88,12 +88,12 @@ export function useUpdateSection(eventId: Ref<string>) {
})
}
export function useDeleteSection(eventId: Ref<string>) {
export function useDeleteSection(orgId: Ref<string>, eventId: Ref<string>) {
const queryClient = useQueryClient()
return useMutation({
mutationFn: async (id: string) => {
await apiClient.delete(`/events/${eventId.value}/sections/${id}`)
await apiClient.delete(`/organisations/${orgId.value}/events/${eventId.value}/sections/${id}`)
},
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ['sections', eventId.value] })
@@ -101,13 +101,13 @@ export function useDeleteSection(eventId: Ref<string>) {
})
}
export function useReorderSections(eventId: Ref<string>) {
export function useReorderSections(orgId: Ref<string>, eventId: Ref<string>) {
const queryClient = useQueryClient()
let previousSections: FestivalSection[] | undefined
return useMutation({
mutationFn: async (orderedIds: string[]) => {
await apiClient.post(`/events/${eventId.value}/sections/reorder`, {
await apiClient.post(`/organisations/${orgId.value}/events/${eventId.value}/sections/reorder`, {
sections: orderedIds,
})
},

View File

@@ -29,6 +29,7 @@ export interface ShiftAssignmentFilters {
}
export function useShiftAssignmentList(
orgId: Ref<string>,
eventId: Ref<string>,
filters?: Ref<ShiftAssignmentFilters>,
) {
@@ -42,23 +43,23 @@ export function useShiftAssignmentList(
if (filters?.value?.status) params.status = filters.value.status
const { data } = await apiClient.get<PaginatedResponse<ShiftAssignment>>(
`/events/${eventId.value}/shift-assignments`,
`/organisations/${orgId.value}/events/${eventId.value}/shift-assignments`,
{ params },
)
return data
},
enabled: () => !!eventId.value,
enabled: () => !!orgId.value && !!eventId.value,
})
}
export function useApproveAssignment(eventId: Ref<string>) {
export function useApproveAssignment(orgId: Ref<string>, eventId: Ref<string>) {
const queryClient = useQueryClient()
return useMutation({
mutationFn: async (assignmentId: string) => {
const { data } = await apiClient.post<ApiResponse<ShiftAssignment>>(
`/events/${eventId.value}/shift-assignments/${assignmentId}/approve`,
`/organisations/${orgId.value}/events/${eventId.value}/shift-assignments/${assignmentId}/approve`,
)
return data.data
@@ -70,13 +71,13 @@ export function useApproveAssignment(eventId: Ref<string>) {
})
}
export function useRejectAssignment(eventId: Ref<string>) {
export function useRejectAssignment(orgId: Ref<string>, eventId: Ref<string>) {
const queryClient = useQueryClient()
return useMutation({
mutationFn: async ({ assignmentId, reason }: { assignmentId: string; reason?: string }) => {
const { data } = await apiClient.post<ApiResponse<ShiftAssignment>>(
`/events/${eventId.value}/shift-assignments/${assignmentId}/reject`,
`/organisations/${orgId.value}/events/${eventId.value}/shift-assignments/${assignmentId}/reject`,
{ reason },
)
@@ -89,13 +90,13 @@ export function useRejectAssignment(eventId: Ref<string>) {
})
}
export function useCancelAssignment(eventId: Ref<string>) {
export function useCancelAssignment(orgId: Ref<string>, eventId: Ref<string>) {
const queryClient = useQueryClient()
return useMutation({
mutationFn: async (assignmentId: string) => {
const { data } = await apiClient.post<ApiResponse<ShiftAssignment>>(
`/events/${eventId.value}/shift-assignments/${assignmentId}/cancel`,
`/organisations/${orgId.value}/events/${eventId.value}/shift-assignments/${assignmentId}/cancel`,
)
return data.data
@@ -107,13 +108,13 @@ export function useCancelAssignment(eventId: Ref<string>) {
})
}
export function useBulkApproveAssignments(eventId: Ref<string>) {
export function useBulkApproveAssignments(orgId: Ref<string>, eventId: Ref<string>) {
const queryClient = useQueryClient()
return useMutation({
mutationFn: async (assignmentIds: string[]) => {
const { data } = await apiClient.post<ApiResponse<unknown>>(
`/events/${eventId.value}/shift-assignments/bulk-approve`,
`/organisations/${orgId.value}/events/${eventId.value}/shift-assignments/bulk-approve`,
{ assignment_ids: assignmentIds },
)
@@ -126,13 +127,13 @@ export function useBulkApproveAssignments(eventId: Ref<string>) {
})
}
export function useAssignPersonToShift(eventId: Ref<string>) {
export function useAssignPersonToShift(orgId: Ref<string>, eventId: Ref<string>) {
const queryClient = useQueryClient()
return useMutation({
mutationFn: async ({ sectionId, shiftId, personId }: { sectionId: string; shiftId: string; personId: string }) => {
const { data } = await apiClient.post<ApiResponse<ShiftAssignment>>(
`/events/${eventId.value}/sections/${sectionId}/shifts/${shiftId}/assign`,
`/organisations/${orgId.value}/events/${eventId.value}/sections/${sectionId}/shifts/${shiftId}/assign`,
{ person_id: personId },
)
@@ -147,12 +148,12 @@ export function useAssignPersonToShift(eventId: Ref<string>) {
})
}
export function useAssignablePersons(eventId: MaybeRef<string>, shiftId: MaybeRef<string>) {
export function useAssignablePersons(orgId: MaybeRef<string>, eventId: MaybeRef<string>, shiftId: MaybeRef<string>) {
return useQuery({
queryKey: ['assignable-persons', eventId, shiftId],
queryFn: async () => {
const { data } = await apiClient.get<{ data: AssignablePerson[]; meta: AssignablePersonsMeta }>(
`/events/${unref(eventId)}/shifts/${unref(shiftId)}/assignable-persons`,
`/organisations/${unref(orgId)}/events/${unref(eventId)}/shifts/${unref(shiftId)}/assignable-persons`,
)
return {
@@ -160,6 +161,6 @@ export function useAssignablePersons(eventId: MaybeRef<string>, shiftId: MaybeRe
meta: data.meta,
}
},
enabled: () => !!unref(eventId) && !!unref(shiftId),
enabled: () => !!unref(orgId) && !!unref(eventId) && !!unref(shiftId),
})
}

View File

@@ -13,27 +13,27 @@ interface PaginatedResponse<T> {
data: T[]
}
export function useShiftList(eventId: Ref<string>, sectionId: Ref<string>) {
export function useShiftList(orgId: Ref<string>, eventId: Ref<string>, sectionId: Ref<string>) {
return useQuery({
queryKey: ['shifts', sectionId],
queryFn: async () => {
const { data } = await apiClient.get<PaginatedResponse<Shift>>(
`/events/${eventId.value}/sections/${sectionId.value}/shifts`,
`/organisations/${orgId.value}/events/${eventId.value}/sections/${sectionId.value}/shifts`,
)
return data.data
},
enabled: () => !!eventId.value && !!sectionId.value,
enabled: () => !!orgId.value && !!eventId.value && !!sectionId.value,
})
}
export function useCreateShift(eventId: Ref<string>, sectionId: Ref<string>) {
export function useCreateShift(orgId: Ref<string>, eventId: Ref<string>, sectionId: Ref<string>) {
const queryClient = useQueryClient()
return useMutation({
mutationFn: async (payload: CreateShiftPayload) => {
const { data } = await apiClient.post<ApiResponse<Shift>>(
`/events/${eventId.value}/sections/${sectionId.value}/shifts`,
`/organisations/${orgId.value}/events/${eventId.value}/sections/${sectionId.value}/shifts`,
payload,
)
@@ -45,13 +45,13 @@ export function useCreateShift(eventId: Ref<string>, sectionId: Ref<string>) {
})
}
export function useUpdateShift(eventId: Ref<string>, sectionId: Ref<string>) {
export function useUpdateShift(orgId: Ref<string>, eventId: Ref<string>, sectionId: Ref<string>) {
const queryClient = useQueryClient()
return useMutation({
mutationFn: async ({ id, ...payload }: UpdateShiftPayload & { id: string }) => {
const { data } = await apiClient.put<ApiResponse<Shift>>(
`/events/${eventId.value}/sections/${sectionId.value}/shifts/${id}`,
`/organisations/${orgId.value}/events/${eventId.value}/sections/${sectionId.value}/shifts/${id}`,
payload,
)
@@ -63,13 +63,13 @@ export function useUpdateShift(eventId: Ref<string>, sectionId: Ref<string>) {
})
}
export function useDeleteShift(eventId: Ref<string>, sectionId: Ref<string>) {
export function useDeleteShift(orgId: Ref<string>, eventId: Ref<string>, sectionId: Ref<string>) {
const queryClient = useQueryClient()
return useMutation({
mutationFn: async (id: string) => {
await apiClient.delete(
`/events/${eventId.value}/sections/${sectionId.value}/shifts/${id}`,
`/organisations/${orgId.value}/events/${eventId.value}/sections/${sectionId.value}/shifts/${id}`,
)
},
onSuccess: () => {
@@ -78,13 +78,13 @@ export function useDeleteShift(eventId: Ref<string>, sectionId: Ref<string>) {
})
}
export function useAssignShift(eventId: Ref<string>, sectionId: Ref<string>) {
export function useAssignShift(orgId: Ref<string>, eventId: Ref<string>, sectionId: Ref<string>) {
const queryClient = useQueryClient()
return useMutation({
mutationFn: async ({ shiftId, personId }: { shiftId: string; personId: string }) => {
const { data } = await apiClient.post<ApiResponse<unknown>>(
`/events/${eventId.value}/sections/${sectionId.value}/shifts/${shiftId}/assign`,
`/organisations/${orgId.value}/events/${eventId.value}/sections/${sectionId.value}/shifts/${shiftId}/assign`,
{ person_id: personId },
)

View File

@@ -13,7 +13,7 @@ interface PaginatedResponse<T> {
data: T[]
}
export function useTimeSlotList(eventId: Ref<string>, options?: { includeParent?: Ref<boolean> }) {
export function useTimeSlotList(orgId: Ref<string>, eventId: Ref<string>, options?: { includeParent?: Ref<boolean> }) {
const includeParent = options?.includeParent
return useQuery({
@@ -21,23 +21,23 @@ export function useTimeSlotList(eventId: Ref<string>, options?: { includeParent?
queryFn: async () => {
const params = includeParent?.value ? { include_parent: 'true' } : {}
const { data } = await apiClient.get<PaginatedResponse<TimeSlot>>(
`/events/${eventId.value}/time-slots`,
`/organisations/${orgId.value}/events/${eventId.value}/time-slots`,
{ params },
)
return data.data
},
enabled: () => !!eventId.value,
enabled: () => !!orgId.value && !!eventId.value,
})
}
export function useCreateTimeSlot(eventId: Ref<string>) {
export function useCreateTimeSlot(orgId: Ref<string>, eventId: Ref<string>) {
const queryClient = useQueryClient()
return useMutation({
mutationFn: async (payload: CreateTimeSlotPayload) => {
const { data } = await apiClient.post<ApiResponse<TimeSlot>>(
`/events/${eventId.value}/time-slots`,
`/organisations/${orgId.value}/events/${eventId.value}/time-slots`,
payload,
)
@@ -49,13 +49,13 @@ export function useCreateTimeSlot(eventId: Ref<string>) {
})
}
export function useUpdateTimeSlot(eventId: Ref<string>) {
export function useUpdateTimeSlot(orgId: Ref<string>, eventId: Ref<string>) {
const queryClient = useQueryClient()
return useMutation({
mutationFn: async ({ id, ...payload }: UpdateTimeSlotPayload & { id: string }) => {
const { data } = await apiClient.put<ApiResponse<TimeSlot>>(
`/events/${eventId.value}/time-slots/${id}`,
`/organisations/${orgId.value}/events/${eventId.value}/time-slots/${id}`,
payload,
)
@@ -67,12 +67,12 @@ export function useUpdateTimeSlot(eventId: Ref<string>) {
})
}
export function useDeleteTimeSlot(eventId: Ref<string>) {
export function useDeleteTimeSlot(orgId: Ref<string>, eventId: Ref<string>) {
const queryClient = useQueryClient()
return useMutation({
mutationFn: async (id: string) => {
await apiClient.delete(`/events/${eventId.value}/time-slots/${id}`)
await apiClient.delete(`/organisations/${orgId.value}/events/${eventId.value}/time-slots/${id}`)
},
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ['time-slots', eventId.value] })

View File

@@ -21,10 +21,10 @@ const authStore = useAuthStore()
const orgId = computed(() => authStore.currentOrganisation?.id ?? '')
const eventId = computed(() => String((route.params as { id: string }).id))
const { data: crowdLists, isLoading, isError, refetch } = useCrowdLists(eventId)
const { data: crowdLists, isLoading, isError, refetch } = useCrowdLists(orgId, eventId)
const { data: crowdTypes } = useCrowdTypeList(orgId)
const { data: companies } = useCompanies(orgId)
const { mutate: deleteCrowdList, isPending: isDeleting } = useDeleteCrowdList(eventId)
const { mutate: deleteCrowdList, isPending: isDeleting } = useDeleteCrowdList(orgId, eventId)
// Lookup maps for resolving IDs to names
const crowdTypeMap = computed(() => {

View File

@@ -29,7 +29,7 @@ const filters = computed(() => ({
status: filterStatus.value || undefined,
}))
const { data: personsResponse, isLoading, isError, refetch } = usePersonList(eventId, filters)
const { data: personsResponse, isLoading, isError, refetch } = usePersonList(orgId, eventId, filters)
const { data: crowdTypes } = useCrowdTypeList(orgId)
const persons = computed(() => personsResponse.value?.data ?? [])
@@ -123,8 +123,8 @@ const isDeleteDialogOpen = ref(false)
const deletingPerson = ref<Person | null>(null)
// Mutations
const { mutate: approvePerson } = useApprovePerson(eventId)
const { mutate: deletePerson, isPending: isDeleting } = useDeletePerson(eventId)
const { mutate: approvePerson } = useApprovePerson(orgId, eventId)
const { mutate: deletePerson, isPending: isDeleting } = useDeletePerson(orgId, eventId)
const showSuccess = ref(false)
const successMessage = ref('')

View File

@@ -35,11 +35,11 @@ const eventId = computed(() => String((route.params as { id: string }).id))
const { mutate: updateEvent, isPending: isUpdatingEvent } = useUpdateEvent(orgId, eventId)
// Registration form fields
const { data: fields, isLoading } = useRegistrationFormFields(eventId)
const { mutate: createField, isPending: isCreating } = useCreateRegistrationFormField(eventId)
const { mutate: updateField, isPending: isUpdating } = useUpdateRegistrationFormField(eventId)
const { mutate: deleteField, isPending: isDeleting } = useDeleteRegistrationFormField(eventId)
const { mutate: reorderFields } = useReorderRegistrationFormFields(eventId)
const { data: fields, isLoading } = useRegistrationFormFields(orgId, eventId)
const { mutate: createField, isPending: isCreating } = useCreateRegistrationFormField(orgId, eventId)
const { mutate: updateField, isPending: isUpdating } = useUpdateRegistrationFormField(orgId, eventId)
const { mutate: deleteField, isPending: isDeleting } = useDeleteRegistrationFormField(orgId, eventId)
const { mutate: reorderFields } = useReorderRegistrationFormFields(orgId, eventId)
// Local draggable list synced from query
const localFields = ref<RegistrationFormField[]>([])

View File

@@ -20,8 +20,8 @@ const authStore = useAuthStore()
const orgId = computed(() => authStore.currentOrganisation?.id ?? '')
const eventId = computed(() => String((route.params as { id: string }).id))
const { data: timeSlots, isLoading, isError, refetch } = useTimeSlotList(eventId)
const { mutate: deleteTimeSlotMutation, isPending: isDeletingTimeSlot } = useDeleteTimeSlot(eventId)
const { data: timeSlots, isLoading, isError, refetch } = useTimeSlotList(orgId, eventId)
const { mutate: deleteTimeSlotMutation, isPending: isDeletingTimeSlot } = useDeleteTimeSlot(orgId, eventId)
// Load children for festivals — needed for time slot context chips
const { data: children } = useEventChildren(orgId, eventId)