const MAX_AUDIT_FIELD_VALUE_LENGTH = 200 export function toAuditFieldValue(value: unknown): string | null { if (value === null || value === undefined || value === '') return null const text = typeof value === 'string' ? value : JSON.stringify(value) if (typeof text !== 'string') return null return text.length > MAX_AUDIT_FIELD_VALUE_LENGTH ? `${text.slice(0, MAX_AUDIT_FIELD_VALUE_LENGTH)}…` : text }