(params: {
orgSettings: DataRetentionSettings | null | undefined
workspaceId: string
key: RetentionHoursKey
})
| 110 | * nothing is configured (the dispatcher treats `null` as "skip"). |
| 111 | */ |
| 112 | export function resolveEffectiveRetentionHours(params: { |
| 113 | orgSettings: DataRetentionSettings | null | undefined |
| 114 | workspaceId: string |
| 115 | key: RetentionHoursKey |
| 116 | }): number | null { |
| 117 | const override = params.orgSettings?.retentionOverrides?.find( |
| 118 | (o) => o?.workspaceId === params.workspaceId |
| 119 | ) |
| 120 | const overrideValue = override?.[params.key] |
| 121 | if (overrideValue !== undefined) return overrideValue |
| 122 | return params.orgSettings?.[params.key] ?? null |
| 123 | } |
no outgoing calls
no test coverage detected