From 2eb86e14eab77aa36afe089f1e74080e91fad81c Mon Sep 17 00:00:00 2001 From: Schalli Date: Wed, 23 Sep 2026 15:30:58 +0200 Subject: [PATCH] fix(260923-le6): PMG-Summe null bei fehlendem Teilwert Co-Authored-By: Claude Sonnet 5 --- apps/api/src/proxmox/proxmox-normalize.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/api/src/proxmox/proxmox-normalize.ts b/apps/api/src/proxmox/proxmox-normalize.ts index a35222d..cbf8ecb 100644 --- a/apps/api/src/proxmox/proxmox-normalize.ts +++ b/apps/api/src/proxmox/proxmox-normalize.ts @@ -237,9 +237,13 @@ function emptyPmgMetrics(): ProxmoxPmgMetrics { return { productType: 'pmg', countIn: null, countOut: null, spamCount: null, virusCount: null }; } +// Eine Tageszahl aus zwei Teilwerten ist nur dann bekannt, wenn beide +// Teilwerte bekannt sind; eine Teilsumme saehe vollstaendig aus, waere +// aber still falsch (Abnahmebefund 260923-dhh, Wahrheit 7; PMG-Feldnamen +// sind nur Annahme A5). function sumOrNull(a: number | null, b: number | null): number | null { - if (a === null && b === null) return null; - return (a ?? 0) + (b ?? 0); + if (a === null || b === null) return null; + return a + b; } export function normalizePmg(body: unknown): NormalizeResult {