19 lines
1002 B
TypeScript
19 lines
1002 B
TypeScript
/**
|
|
* React Query key factory for the verification domain. The nurse's own `status()` is the **single
|
|
* cached source** that both B3 (checklist) and B6 (under-review) read — one query, two views. Every
|
|
* submit/upload/run mutation invalidates `status()` so the checklist re-renders from cache with no
|
|
* manual refetch. The public `badge(nurseId)` is longer-lived and reused by search/f6.
|
|
*/
|
|
export const verificationKeys = {
|
|
all: ['verification'] as const,
|
|
|
|
// The signed-in nurse's checklist — moderately fresh; every mutation invalidates it.
|
|
status: () => [...verificationKeys.all, 'status'] as const,
|
|
|
|
// A manual step's uploaded documents (metadata only), if a screen ever lists them separately.
|
|
documents: (stepCode: string) => [...verificationKeys.all, 'documents', stepCode] as const,
|
|
|
|
// The public trust badge — keyed per nurse; reused by the own-profile view and f6 search/profile.
|
|
badge: (nurseId: number) => [...verificationKeys.all, 'badge', nurseId] as const,
|
|
};
|