fix(260923-le6): PMG-Summe null bei fehlendem Teilwert
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -237,9 +237,13 @@ function emptyPmgMetrics(): ProxmoxPmgMetrics {
|
|||||||
return { productType: 'pmg', countIn: null, countOut: null, spamCount: null, virusCount: null };
|
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 {
|
function sumOrNull(a: number | null, b: number | null): number | null {
|
||||||
if (a === null && b === null) return null;
|
if (a === null || b === null) return null;
|
||||||
return (a ?? 0) + (b ?? 0);
|
return a + b;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function normalizePmg(body: unknown): NormalizeResult<ProxmoxPmgMetrics> {
|
export function normalizePmg(body: unknown): NormalizeResult<ProxmoxPmgMetrics> {
|
||||||
|
|||||||
Reference in New Issue
Block a user