feat: event dashboard metric cards with stats endpoint (UX-02)
Add GET /events/{event}/stats endpoint returning aggregate counts for
persons (by status, approved without shift), pending identity matches,
and shift fill rates. Frontend metric cards component shows four
actionable KPIs on the event overview tab.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,7 @@ import { apiClient } from '@/lib/axios'
|
||||
import type {
|
||||
CreateEventPayload,
|
||||
EventItem,
|
||||
EventStats,
|
||||
UpdateEventPayload,
|
||||
} from '@/types/event'
|
||||
|
||||
@@ -130,3 +131,16 @@ export function useUpdateEvent(orgId: Ref<string>, id: Ref<string>) {
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
export function useEventStats(eventId: Ref<string>) {
|
||||
return useQuery({
|
||||
queryKey: ['events', eventId, 'stats'],
|
||||
queryFn: async () => {
|
||||
const { data } = await apiClient.get<{ data: EventStats }>(
|
||||
`/events/${eventId.value}/stats`,
|
||||
)
|
||||
return data.data
|
||||
},
|
||||
enabled: () => !!eventId.value,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user