backend phase 15 & frontend phase 8

This commit is contained in:
hamid
2026-07-10 03:22:29 +03:30
parent 93cc5ecb98
commit cd6c2591a6
154 changed files with 15335 additions and 37 deletions
@@ -0,0 +1,19 @@
import { useQuery } from '@tanstack/react-query';
import { bookingsApi } from '../apis';
import { bookingKeys } from '../keys';
import { SESSION_EVV_STALE_TIME } from '../constants';
/**
* Per-session EVV detail (`booking_sessions/evv/{id}`) — the `checkInAt` + advisory `checkInAddressMatch`
* the EVV banner renders on the nurse's day surface (the booking-detail card reads these from the
* embedded session instead, so it doesn't need this). `enabled` lets the day surface fetch it only for
* sessions that already have EVV activity. EVV mutations `setQueryData` this key so the banner is instant.
*/
export function useSessionEvv(sessionId: number | undefined, options?: { enabled?: boolean }) {
return useQuery({
queryKey: bookingKeys.sessionEvv(sessionId ?? -1),
queryFn: () => bookingsApi.getSessionEvv(sessionId as number),
enabled: (options?.enabled ?? true) && sessionId != null && sessionId > 0,
staleTime: SESSION_EVV_STALE_TIME,
});
}