Files
HealthLog/src/lib/query-keys/record-settings.ts
T
Marc-André Bombeck e788675b82 feat: configure managed record settings
- Scope writable settings to the selected managed record\n- Render typed Guardian controls with separated audit attribution
2026-08-06 03:21:02 +02:00

27 lines
1.2 KiB
TypeScript

/**
* Record configuration has its own cache family because it follows the active
* health record, while `authMe()` remains the person at the keyboard. Keeping
* the record id in every member prevents an actor cache cell from being read
* or invalidated as though it belonged to a switched record.
*/
export const recordSettingsKeys = {
root: () => ["record-settings"] as const,
detail: (recordId: string) =>
["record-settings", recordId, "detail"] as const,
integrations: (recordId: string) =>
["record-settings", recordId, "integrations"] as const,
profile: (recordId: string) =>
["record-settings", recordId, "profile"] as const,
family: (recordId: string, family: string) =>
["record-settings", recordId, family] as const,
/** Named aliases stay unambiguous when assembled into `queryKeys`. */
recordSettingsDetail: (recordId: string) =>
["record-settings", recordId, "detail"] as const,
recordSettingsIntegrations: (recordId: string) =>
["record-settings", recordId, "integrations"] as const,
recordSettingsProfile: (recordId: string) =>
["record-settings", recordId, "profile"] as const,
recordSettingsFamily: (recordId: string, family: string) =>
["record-settings", recordId, family] as const,
};