From 45a62661c25b0e744fac802bca23460e908d038c Mon Sep 17 00:00:00 2001 From: krishnareddy-tadi Date: Fri, 5 May 2023 16:38:14 +0530 Subject: [PATCH] Add `measureFields` to attachment value --- src/db/models/json/indicatorsAndCaseloads.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/db/models/json/indicatorsAndCaseloads.ts b/src/db/models/json/indicatorsAndCaseloads.ts index 259a44e9..7074a00e 100644 --- a/src/db/models/json/indicatorsAndCaseloads.ts +++ b/src/db/models/json/indicatorsAndCaseloads.ts @@ -132,9 +132,14 @@ export const hasDisaggregation = ( */ export const CASELOAD_VALUE = t.intersection([ t.type({ - metrics: t.type({ - values: CASELOAD_OR_INDICATOR_METRICS_VALUES, - }), + metrics: t.intersection([ + t.type({ + values: CASELOAD_OR_INDICATOR_METRICS_VALUES, + }), + t.partial({ + measureFields: t.array(METRIC_DEFINITION), + }), + ]), }), t.partial({ description: t.string, @@ -176,6 +181,7 @@ export const INDICATOR_VALUE = t.intersection([ }), }), ]), + measureFields: t.array(METRIC_DEFINITION), }), ]), }),