From 741140d03add979d529430adc6da44f46221af1c Mon Sep 17 00:00:00 2001 From: Lilian Saget-Lethias Date: Mon, 7 Aug 2023 17:51:58 +0200 Subject: [PATCH] fix: change nc with 0 when relatable in consultation (Fixes #1709) --- .../declaration/indicators/BalancedRepresentation.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/app/src/common/core-domain/domain/declaration/indicators/BalancedRepresentation.ts b/packages/app/src/common/core-domain/domain/declaration/indicators/BalancedRepresentation.ts index 8a60be256..85283945a 100644 --- a/packages/app/src/common/core-domain/domain/declaration/indicators/BalancedRepresentation.ts +++ b/packages/app/src/common/core-domain/domain/declaration/indicators/BalancedRepresentation.ts @@ -43,10 +43,12 @@ export class BalancedRepresentation extends JsonEntity) { const props: BalancedRepresentationProps = {}; - if (json.executiveMenPercent) props.executiveMenPercent = new Percentage(json.executiveMenPercent); - if (json.executiveWomenPercent) props.executiveWomenPercent = new Percentage(json.executiveWomenPercent); - if (json.memberMenPercent) props.memberMenPercent = new Percentage(json.memberMenPercent); - if (json.memberWomenPercent) props.memberWomenPercent = new Percentage(json.memberWomenPercent); + if (typeof json.executiveMenPercent === "number") + props.executiveMenPercent = new Percentage(json.executiveMenPercent); + if (typeof json.executiveWomenPercent === "number") + props.executiveWomenPercent = new Percentage(json.executiveWomenPercent); + if (typeof json.memberMenPercent === "number") props.memberMenPercent = new Percentage(json.memberMenPercent); + if (typeof json.memberWomenPercent === "number") props.memberWomenPercent = new Percentage(json.memberWomenPercent); if (json.notComputableReasonExecutives) props.notComputableReasonExecutives = new NotComputableReasonExecutiveRepEq(json.notComputableReasonExecutives); if (json.notComputableReasonMembers)