Files
HealthLog/src/lib/record-settings/dto.ts
T
Marc-André Bombeck 009de7cb5f feat: add record keyed settings
- Separate managed record settings from actor identity\n- Limit integration reads to the active managed record
2026-08-06 02:26:44 +02:00

33 lines
764 B
TypeScript

export interface RecordSettingsDto {
record: {
id: string;
displayName: string;
locale: string | null;
timezone: string;
kind: "managed";
};
}
/**
* The record-settings payload intentionally names the record it describes.
* It is never an extension of `/api/auth/me`, which remains the actor's
* identity payload while the browser is switched into another record.
*/
export function toRecordSettingsDto(source: {
id: string;
name: string | null;
locale: string | null;
timezone: string;
recordKind: "managed";
}): RecordSettingsDto {
return {
record: {
id: source.id,
displayName: source.name ?? "",
locale: source.locale,
timezone: source.timezone,
kind: source.recordKind,
},
};
}