From 74c5f3f79779d7a3cbc9cf1ca5897a221c6815c9 Mon Sep 17 00:00:00 2001 From: Pyry Rouvila Date: Tue, 29 Oct 2024 14:55:40 +0200 Subject: [PATCH 01/50] chore: clean up E-Signet / OIDP verification button code (#7862) * chore: clean up oidpcallback frontend code * chore: clean up verificationbutton * chore: remove the backend functionality * revert: codegen changes * chore: remove oidp related changes from client/utils/gateway.ts --- packages/client/graphql.schema.json | 515 ++---------------- packages/client/src/App.tsx | 10 - .../components/form/FormFieldGenerator.tsx | 30 - packages/client/src/forms/index.ts | 16 - packages/client/src/forms/utils.ts | 14 - .../messages/views/nidVerificationCallback.ts | 33 -- packages/client/src/navigation/routes.ts | 2 - packages/client/src/setupTests.ts | 8 - packages/client/src/tests/schema.graphql | 46 -- packages/client/src/utils/gateway.ts | 105 +--- .../OIDPVerificationCallback.test.tsx | 164 ------ .../OIDPVerificationCallback.tsx | 151 ----- .../views/OIDPVerificationCallback/queries.ts | 61 --- .../views/OIDPVerificationCallback/utils.ts | 271 --------- .../RegisterForm/review/ReviewSection.tsx | 21 - .../VerificationButton.stories.tsx | 60 -- .../VerificationButton/VerificationButton.tsx | 99 ---- .../src/VerificationButton/index.ts | 11 - packages/components/src/index.ts | 1 - packages/config/src/handlers/forms/field.ts | 4 - packages/gateway/src/constants.ts | 5 - packages/gateway/src/environment.ts | 14 +- .../src/features/OIDPUserInfo/oidp-types.ts | 41 -- .../OIDPUserInfo/root-resolvers.test.ts | 267 --------- .../features/OIDPUserInfo/root-resolvers.ts | 34 -- .../src/features/OIDPUserInfo/schema.graphql | 57 -- .../src/features/OIDPUserInfo/utils.ts | 146 ----- packages/gateway/src/graphql/config.ts | 2 - packages/gateway/src/graphql/index.graphql | 1 - packages/gateway/src/graphql/schema.d.ts | 424 -------------- packages/gateway/src/graphql/schema.graphql | 46 -- packages/gateway/test/setupJest.ts | 9 - packages/user-mgnt/src/constants.ts | 7 - packages/user-mgnt/src/environment.ts | 7 +- packages/user-mgnt/src/utils/system.ts | 47 -- 35 files changed, 40 insertions(+), 2689 deletions(-) delete mode 100644 packages/client/src/i18n/messages/views/nidVerificationCallback.ts delete mode 100644 packages/client/src/views/OIDPVerificationCallback/OIDPVerificationCallback.test.tsx delete mode 100644 packages/client/src/views/OIDPVerificationCallback/OIDPVerificationCallback.tsx delete mode 100644 packages/client/src/views/OIDPVerificationCallback/queries.ts delete mode 100644 packages/client/src/views/OIDPVerificationCallback/utils.ts delete mode 100644 packages/components/src/VerificationButton/VerificationButton.stories.tsx delete mode 100644 packages/components/src/VerificationButton/VerificationButton.tsx delete mode 100644 packages/components/src/VerificationButton/index.ts delete mode 100644 packages/gateway/src/features/OIDPUserInfo/oidp-types.ts delete mode 100644 packages/gateway/src/features/OIDPUserInfo/root-resolvers.test.ts delete mode 100644 packages/gateway/src/features/OIDPUserInfo/root-resolvers.ts delete mode 100644 packages/gateway/src/features/OIDPUserInfo/schema.graphql delete mode 100644 packages/gateway/src/features/OIDPUserInfo/utils.ts diff --git a/packages/client/graphql.schema.json b/packages/client/graphql.schema.json index feba952fa5d..0e734fdd950 100644 --- a/packages/client/graphql.schema.json +++ b/packages/client/graphql.schema.json @@ -9334,6 +9334,39 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "confirmRegistration", + "description": null, + "args": [ + { + "name": "id", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "createBirthRegistration", "description": null, @@ -11079,356 +11112,6 @@ ], "possibleTypes": null }, - { - "kind": "OBJECT", - "name": "OIDPUserAddress", - "description": null, - "fields": [ - { - "name": "city", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "country", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "formatted", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "locality", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "postal_code", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "region", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "street_address", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "OIDPUserInfo", - "description": null, - "fields": [ - { - "name": "address", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "OIDPUserAddress", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "birthdate", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "email", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "email_verified", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "family_name", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "gender", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "given_name", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "locale", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "middle_name", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "nickname", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "phone_number", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "phone_number_verified", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "picture", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "preferred_username", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "profile", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "sub", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "updated_at", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "website", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "zoneinfo", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, { "kind": "INPUT_OBJECT", "name": "ObservationFHIRIDS", @@ -13241,79 +12924,6 @@ "isDeprecated": false, "deprecationReason": null }, - { - "name": "getOIDPUserInfo", - "description": null, - "args": [ - { - "name": "clientId", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "code", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "grantType", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "redirectUri", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "type": { - "kind": "OBJECT", - "name": "UserInfo", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, { "name": "getRegistrationsListByFilter", "description": null, @@ -19290,65 +18900,6 @@ "enumValues": null, "possibleTypes": null }, - { - "kind": "OBJECT", - "name": "UserInfo", - "description": null, - "fields": [ - { - "name": "districtFhirId", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "locationLevel3FhirId", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "oidpUserInfo", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "OIDPUserInfo", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "stateFhirId", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, { "kind": "INPUT_OBJECT", "name": "UserInput", diff --git a/packages/client/src/App.tsx b/packages/client/src/App.tsx index d6b32c54739..78e43a12276 100644 --- a/packages/client/src/App.tsx +++ b/packages/client/src/App.tsx @@ -63,7 +63,6 @@ import { AdministrativeLevels } from '@client/views/Organisation/AdministrativeL import { VerifyCertificatePage } from '@client/views/VerifyCertificate/VerifyCertificatePage' import { IssueCertificate } from '@client/views/IssueCertificate/IssueCertificate' import { IssuePayment } from '@client/views/IssueCertificate/IssueCollectorForm/IssuePayment' -import { OIDPVerificationCallback } from './views/OIDPVerificationCallback/OIDPVerificationCallback' import { ApolloProvider } from '@client/utils/ApolloProvider' import { Home } from '@client/views/OfficeHome/Home' import { PrintRecord } from './views/PrintRecord/PrintRecord' @@ -533,15 +532,6 @@ export function App(props: IAppProps) { } component={IssuePayment} /> - ( (val: string) => setFieldValue(fieldDefinition.name, val), [fieldDefinition.name, setFieldValue] ) - const isOnline = useOnlineStatus() const inputProps = { id: fieldDefinition.name, @@ -615,21 +609,6 @@ const GeneratedInputField = React.memo( ) } - if (fieldDefinition.type === NID_VERIFICATION_BUTTON) { - return ( - - - - ) - } - if (fieldDefinition.type === REDIRECT) { return ( void } interface IDispatchProps { @@ -1120,18 +1098,12 @@ class FormSectionComponent extends React.Component { field.searchableType as LocationType[] ) } - : field.type === NID_VERIFICATION_BUTTON - ? ({ - ...field, - onClick: this.props.onNidAuthenticationClick - } as INidVerificationButton) : field if ( field.type === FETCH_BUTTON || field.type === FIELD_WITH_DYNAMIC_DEFINITIONS || field.type === SELECT_WITH_DYNAMIC_OPTIONS || - field.type === NID_VERIFICATION_BUTTON || field.type === BUTTON ) { return ( @@ -1311,7 +1283,6 @@ export const FormFieldGenerator: React.FC = (props) => { const userDetails = useSelector(getUserDetails) const intl = useIntl() const dispatch = useDispatch() - const { onClick: onNidAuthenticationClick } = useNidAuthentication() return ( @@ -1345,7 +1316,6 @@ export const FormFieldGenerator: React.FC = (props) => { offlineCountryConfig={offlineCountryConfig} userDetails={userDetails} dynamicDispatch={(...args) => dispatch(dynamicDispatch(...args))} - onNidAuthenticationClick={onNidAuthenticationClick} /> )} diff --git a/packages/client/src/forms/index.ts b/packages/client/src/forms/index.ts index 07c69b94266..c157e88245c 100644 --- a/packages/client/src/forms/index.ts +++ b/packages/client/src/forms/index.ts @@ -69,7 +69,6 @@ export const DYNAMIC_LIST = 'DYNAMIC_LIST' export const FETCH_BUTTON = 'FETCH_BUTTON' export const LOCATION_SEARCH_INPUT = 'LOCATION_SEARCH_INPUT' export const TIME = 'TIME' -export const NID_VERIFICATION_BUTTON = 'NID_VERIFICATION_BUTTON' export const DIVIDER = 'DIVIDER' export const HEADING3 = 'HEADING3' export const SIGNATURE = 'SIGNATURE' @@ -716,12 +715,6 @@ export interface ITimeFormFIeld extends IFormFieldBase { type: typeof TIME ignorePlaceHolder?: boolean } -export interface INidVerificationButton extends IFormFieldBase { - type: typeof NID_VERIFICATION_BUTTON - labelForVerified: MessageDescriptor - labelForUnverified: MessageDescriptor - labelForOffline: MessageDescriptor -} export interface ISignatureFormField extends IFormFieldBase { type: typeof SIGNATURE @@ -790,7 +783,6 @@ export type IFormField = | ILocationSearchInputFormField | IDateRangePickerFormField | ITimeFormFIeld - | INidVerificationButton | IDividerFormField | ISignatureFormField | IHttpFormField @@ -1231,13 +1223,6 @@ export interface Ii18nLoaderButtonField extends Ii18nFormFieldBase { errorText: string networkErrorText: string } -export interface Ii18nNidVerificationButtonField extends Ii18nFormFieldBase { - type: typeof NID_VERIFICATION_BUTTON - onClick: () => void - labelForVerified: string - labelForUnverified: string - labelForOffline: string -} export interface I18nDividerField extends Ii18nFormFieldBase { type: typeof DIVIDER @@ -1317,7 +1302,6 @@ export type Ii18nFormField = | Ii18nLocationSearchInputFormField | Ii18nDateRangePickerFormField | Ii18nTimeFormField - | Ii18nNidVerificationButtonField | I18nDividerField | I18nHeading3Field | Ii18nSignatureField diff --git a/packages/client/src/forms/utils.ts b/packages/client/src/forms/utils.ts index c732a35549c..9c7e35dd56f 100644 --- a/packages/client/src/forms/utils.ts +++ b/packages/client/src/forms/utils.ts @@ -41,8 +41,6 @@ import { FIELD_WITH_DYNAMIC_DEFINITIONS, IRadioGroupWithNestedFieldsFormField, ISelectFormFieldWithOptions, - NID_VERIFICATION_BUTTON, - INidVerificationButton, BULLET_LIST, HIDDEN, Ii18nHiddenFormField, @@ -190,18 +188,6 @@ export const internationaliseFieldObject = ( ) } - if (base.type === NID_VERIFICATION_BUTTON) { - ;(base as any).labelForVerified = intl.formatMessage( - (field as INidVerificationButton).labelForVerified - ) - ;(base as any).labelForUnverified = intl.formatMessage( - (field as INidVerificationButton).labelForUnverified - ) - ;(base as any).labelForOffline = intl.formatMessage( - (field as INidVerificationButton).labelForOffline - ) - } - if (isFieldButton(field)) { ;(base as Ii18nButtonFormField).buttonLabel = intl.formatMessage( field.buttonLabel diff --git a/packages/client/src/i18n/messages/views/nidVerificationCallback.ts b/packages/client/src/i18n/messages/views/nidVerificationCallback.ts deleted file mode 100644 index ffda7b5abc6..00000000000 --- a/packages/client/src/i18n/messages/views/nidVerificationCallback.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * OpenCRVS is also distributed under the terms of the Civil Registration - * & Healthcare Disclaimer located at http://opencrvs.org/license. - * - * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. - */ -import { defineMessages, MessageDescriptor } from 'react-intl' - -interface INidVerfificationCallBackMessages - extends Record { - authenticatingNid: MessageDescriptor - failedToAuthenticateNid: MessageDescriptor -} - -const messagesToDefine: INidVerfificationCallBackMessages = { - authenticatingNid: { - defaultMessage: 'Authenticating National ID', - id: 'misc.nidCallback.authenticatingNid', - description: 'Label for nid authention ongoing phase' - }, - failedToAuthenticateNid: { - defaultMessage: 'Failed to authenticate National ID', - id: 'misc.nidCallback.failedToAuthenticateNid', - description: 'Label for nid authention failed phase' - } -} - -export const messages: INidVerfificationCallBackMessages = - defineMessages(messagesToDefine) diff --git a/packages/client/src/navigation/routes.ts b/packages/client/src/navigation/routes.ts index 15fae4c9741..35395667abe 100644 --- a/packages/client/src/navigation/routes.ts +++ b/packages/client/src/navigation/routes.ts @@ -99,6 +99,4 @@ export const VIEW_RECORD = '/:declarationId/viewRecord' export const VIEW_VERIFY_CERTIFICATE = '/verify-certificate/:declarationId' export const ORGANISATIONS_INDEX = '/organisation/:locationId?' -export const OIDP_VERIFICATION_CALLBACK = '/mosip-callback' - export const PRINT_RECORD = '/print-record/:declarationId' diff --git a/packages/client/src/setupTests.ts b/packages/client/src/setupTests.ts index 9e2c276cdc4..bc635072148 100644 --- a/packages/client/src/setupTests.ts +++ b/packages/client/src/setupTests.ts @@ -286,11 +286,3 @@ vi.mock('react-router', async () => ({ section: 'child' })) })) - -vi.mock('@client/views/OIDPVerificationCallback/utils', async () => ({ - ...((await vi.importActual( - '@client/views/OIDPVerificationCallback/utils' - )) as any), - useExtractCallBackState: vi.fn(), - useQueryParams: vi.fn() -})) diff --git a/packages/client/src/tests/schema.graphql b/packages/client/src/tests/schema.graphql index ade59b35fd7..eef8e51b9c2 100644 --- a/packages/client/src/tests/schema.graphql +++ b/packages/client/src/tests/schema.graphql @@ -1179,39 +1179,6 @@ input ObservationFHIRIDS { lastPreviousLiveBirth: String } -type OIDPUserAddress { - formatted: String - street_address: String - locality: String - region: String - postal_code: String - city: String - country: String -} - -type OIDPUserInfo { - sub: String! - name: String - given_name: String - family_name: String - middle_name: String - nickname: String - preferred_username: String - profile: String - picture: String - website: String - email: String - email_verified: Boolean - gender: String - birthdate: String - zoneinfo: String - locale: String - phone_number: String - phone_number_verified: Boolean - address: OIDPUserAddress - updated_at: Int -} - type OperationHistorySearchSet { operationType: String operatedOn: Date @@ -1455,12 +1422,6 @@ type Query { getActiveCertificatesSVG: [CertificateSVG!] fetchSystem(clientId: ID!): System informantSMSNotifications: [SMSNotification!] - getOIDPUserInfo( - code: String! - clientId: String! - redirectUri: String! - grantType: String - ): UserInfo } type QuestionnaireQuestion { @@ -1944,13 +1905,6 @@ input UserIdentifierInput { value: String } -type UserInfo { - oidpUserInfo: OIDPUserInfo - districtFhirId: String - stateFhirId: String - locationLevel3FhirId: String -} - input UserInput { id: ID name: [HumanNameInput!]! diff --git a/packages/client/src/utils/gateway.ts b/packages/client/src/utils/gateway.ts index 0c6699aacfb..3c50650dab7 100644 --- a/packages/client/src/utils/gateway.ts +++ b/packages/client/src/utils/gateway.ts @@ -932,6 +932,7 @@ export type Mutation = { changeEmail?: Maybe changePassword?: Maybe changePhone?: Maybe + confirmRegistration: Scalars['ID'] createBirthRegistration: CreatedIds createBirthRegistrationCorrection: Scalars['ID'] createDeathRegistration: CreatedIds @@ -1032,6 +1033,10 @@ export type MutationChangePhoneArgs = { verifyCode: Scalars['String'] } +export type MutationConfirmRegistrationArgs = { + id: Scalars['ID'] +} + export type MutationCreateBirthRegistrationArgs = { details: BirthRegistrationInput } @@ -1234,41 +1239,6 @@ export enum NotificationType { Sms = 'SMS' } -export type OidpUserAddress = { - __typename?: 'OIDPUserAddress' - city?: Maybe - country?: Maybe - formatted?: Maybe - locality?: Maybe - postal_code?: Maybe - region?: Maybe - street_address?: Maybe -} - -export type OidpUserInfo = { - __typename?: 'OIDPUserInfo' - address?: Maybe - birthdate?: Maybe - email?: Maybe - email_verified?: Maybe - family_name?: Maybe - gender?: Maybe - given_name?: Maybe - locale?: Maybe - middle_name?: Maybe - name?: Maybe - nickname?: Maybe - phone_number?: Maybe - phone_number_verified?: Maybe - picture?: Maybe - preferred_username?: Maybe - profile?: Maybe - sub: Scalars['String'] - updated_at?: Maybe - website?: Maybe - zoneinfo?: Maybe -} - export type ObservationFhirids = { attendantAtBirth?: InputMaybe birthType?: InputMaybe @@ -1398,7 +1368,6 @@ export type Query = { getDeclarationsStartedMetrics?: Maybe getEventsWithProgress?: Maybe getLocationStatistics?: Maybe - getOIDPUserInfo?: Maybe getRegistrationsListByFilter?: Maybe getSystemRoles?: Maybe> getTotalCertifications?: Maybe> @@ -1496,13 +1465,6 @@ export type QueryGetLocationStatisticsArgs = { populationYear: Scalars['Int'] } -export type QueryGetOidpUserInfoArgs = { - clientId: Scalars['String'] - code: Scalars['String'] - grantType?: InputMaybe - redirectUri: Scalars['String'] -} - export type QueryGetRegistrationsListByFilterArgs = { event: Scalars['String'] filterBy: Scalars['String'] @@ -2153,14 +2115,6 @@ export type UserIdentifierInput = { value?: InputMaybe } -export type UserInfo = { - __typename?: 'UserInfo' - districtFhirId?: Maybe - locationLevel3FhirId?: Maybe - oidpUserInfo?: Maybe - stateFhirId?: Maybe -} - export type UserInput = { device?: InputMaybe email?: InputMaybe @@ -5328,55 +5282,6 @@ export type MarkEventAsNotDuplicateMutation = { markEventAsNotDuplicate: string } -export type GetOidpUserInfoQueryVariables = Exact<{ - code: Scalars['String'] - clientId: Scalars['String'] - redirectUri: Scalars['String'] - grantType?: InputMaybe -}> - -export type GetOidpUserInfoQuery = { - __typename?: 'Query' - getOIDPUserInfo?: { - __typename?: 'UserInfo' - districtFhirId?: string | null - stateFhirId?: string | null - locationLevel3FhirId?: string | null - oidpUserInfo?: { - __typename?: 'OIDPUserInfo' - sub: string - name?: string | null - given_name?: string | null - family_name?: string | null - middle_name?: string | null - nickname?: string | null - preferred_username?: string | null - profile?: string | null - picture?: string | null - website?: string | null - email?: string | null - email_verified?: boolean | null - gender?: string | null - birthdate?: string | null - zoneinfo?: string | null - locale?: string | null - phone_number?: string | null - phone_number_verified?: boolean | null - updated_at?: number | null - address?: { - __typename?: 'OIDPUserAddress' - formatted?: string | null - street_address?: string | null - locality?: string | null - region?: string | null - postal_code?: string | null - city?: string | null - country?: string | null - } | null - } | null - } | null -} - type EventSearchFields_BirthEventSearchSet_Fragment = { __typename?: 'BirthEventSearchSet' dateOfBirth?: PlainDate | null diff --git a/packages/client/src/views/OIDPVerificationCallback/OIDPVerificationCallback.test.tsx b/packages/client/src/views/OIDPVerificationCallback/OIDPVerificationCallback.test.tsx deleted file mode 100644 index 4b8d9e005b1..00000000000 --- a/packages/client/src/views/OIDPVerificationCallback/OIDPVerificationCallback.test.tsx +++ /dev/null @@ -1,164 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * OpenCRVS is also distributed under the terms of the Civil Registration - * & Healthcare Disclaimer located at http://opencrvs.org/license. - * - * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. - */ -import { checkAuth } from '@client/profile/profileActions' -import { queries } from '@client/profile/queries' -import { storage } from '@client/storage' -import { createStore } from '@client/store' -import { createTestComponent, mockUserResponse } from '@client/tests/util' -import { merge } from 'lodash' -import * as React from 'react' -import { waitFor, waitForElement } from '@client/tests/wait-for-element' -import { vi, Mock } from 'vitest' -import { OIDPVerificationCallback } from './OIDPVerificationCallback' -import { URLSearchParams } from 'url' -import { useQueryParams, useExtractCallBackState } from './utils' -import { GET_OIDP_USER_INFO } from './queries' -import { createDeclaration, storeDeclaration } from '@client/declarations' -import { Event } from '@client/utils/gateway' - -const draft = createDeclaration(Event.Birth) -draft.data.mother = {} - -const mockFetchUserDetails = vi.fn() - -const registerScopeToken = - 'eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWdpc3RlciIsImNlcnRpZnkiLCJkZW1vIl0sImlhdCI6MTU0MjY4ODc3MCwiZXhwIjoxNTQzMjkzNTcwLCJhdWQiOlsib3BlbmNydnM6YXV0aC11c2VyIiwib3BlbmNydnM6dXNlci1tZ250LXVzZXIiLCJvcGVuY3J2czpoZWFydGgtdXNlciIsIm9wZW5jcnZzOmdhdGV3YXktdXNlciIsIm9wZW5jcnZzOm5vdGlmaWNhdGlvbi11c2VyIiwib3BlbmNydnM6d29ya2Zsb3ctdXNlciJdLCJpc3MiOiJvcGVuY3J2czphdXRoLXNlcnZpY2UiLCJzdWIiOiI1YmVhYWY2MDg0ZmRjNDc5MTA3ZjI5OGMifQ.ElQd99Lu7WFX3L_0RecU_Q7-WZClztdNpepo7deNHqzro-Cog4WLN7RW3ZS5PuQtMaiOq1tCb-Fm3h7t4l4KDJgvC11OyT7jD6R2s2OleoRVm3Mcw5LPYuUVHt64lR_moex0x_bCqS72iZmjrjS-fNlnWK5zHfYAjF2PWKceMTGk6wnI9N49f6VwwkinJcwJi6ylsjVkylNbutQZO0qTc7HRP-cBfAzNcKD37FqTRNpVSvHdzQSNcs7oiv3kInDN5aNa2536XSd3H-RiKR9hm9eID9bSIJgFIGzkWRd5jnoYxT70G0t03_mTVnDnqPXDtyI-lmerx24Ost0rQLUNIg' -const getItem = window.localStorage.getItem as Mock -const nameObj = { - data: { - getUser: { - name: [ - { - use: 'en', - firstNames: 'Mohammad', - familyName: 'Ashraful', - __typename: 'HumanName' - }, - { use: 'bn', firstNames: '', familyName: '', __typename: 'HumanName' } - ], - role: { - _id: '778464c0-08f8-4fb7-8a37-b86d1efc462a', - labels: [ - { - lang: 'en', - label: 'DISTRICT_REGISTRAR' - } - ] - } - } - } -} - -merge(mockUserResponse, nameObj) -mockFetchUserDetails.mockReturnValue(mockUserResponse) -queries.fetchUserDetails = mockFetchUserDetails -storage.getItem = vi.fn() -storage.setItem = vi.fn() - -// Define the mock query - -const graphqlMocks = [ - { - request: { - query: GET_OIDP_USER_INFO, - variables: { - code: '1234', - clientId: '7b621732-6c1d-4808-81b2-fd67f05f3af3', - redirectUri: 'http://localhost:3000/mosip-callback' - } - }, - result: { - data: { - getOIDPUserInfo: { - oidpUserInfo: { - sub: '123', - name: 'John Doe', - given_name: 'John', - family_name: 'Doe', - middle_name: null, - nickname: null, - preferred_username: 'jdoe', - profile: 'https://example.com/profile', - picture: 'https://example.com/picture.jpg', - website: 'https://example.com', - email: 'jdoe@example.com', - email_verified: true, - gender: 'male', - birthdate: '1980-01-01', - zoneinfo: 'America/Los_Angeles', - locale: 'en-US', - phone_number: '+1-123-456-7890', - phone_number_verified: true, - address: { - formatted: '123 Main St\nSan Francisco, CA 94105\nUSA', - street_address: '123 Main St', - locality: 'San Francisco', - region: 'CA', - postal_code: '94105', - country: 'USA' - }, - updated_at: '2023-03-30T10:00:00Z' - }, - districtFhirId: '12345', - stateFhirId: '67890' - } - } - } - } -] - -let { store, history } = createStore() - -beforeEach(async () => { - ;({ store, history } = createStore()) - - getItem.mockReturnValue(registerScopeToken) - getItem.mockReturnValue('ea02388') - ;(useExtractCallBackState as Mock).mockImplementation(() => ({ - pathname: 'http://localhost:3000/mosip-callback', - section: 'mother', - declarationId: draft.id - })) - ;(useQueryParams as Mock).mockImplementation( - () => new URLSearchParams({ code: '1234' }) - ) - - await store.dispatch(checkAuth()) - await store.dispatch(storeDeclaration(draft)) -}) - -describe('Nid Verfication Callback page', () => { - it('When nid user is successfully fetched', async () => { - const testComponent = await createTestComponent( - , - { store, history, graphqlMocks: graphqlMocks } - ) - await waitFor(() => testComponent.find('#authenticating-label').length > 0) - - await new Promise((resolve) => { - setTimeout(resolve, 100) - }) - - const declaration = store - .getState() - .declarationsState.declarations.find((d) => d.id === draft.id) - expect(declaration?.data.mother.firstNamesEng).toBe('John') - }) - - it('When nid user info fetch has failed', async () => { - const testComponent = await createTestComponent( - , - { store, history } - ) - - await waitForElement(testComponent, '#authentication-failed-label') - }) -}) diff --git a/packages/client/src/views/OIDPVerificationCallback/OIDPVerificationCallback.tsx b/packages/client/src/views/OIDPVerificationCallback/OIDPVerificationCallback.tsx deleted file mode 100644 index a0686eedbda..00000000000 --- a/packages/client/src/views/OIDPVerificationCallback/OIDPVerificationCallback.tsx +++ /dev/null @@ -1,151 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * OpenCRVS is also distributed under the terms of the Civil Registration - * & Healthcare Disclaimer located at http://opencrvs.org/license. - * - * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. - */ -import { - IDeclaration, - modifyDeclaration, - writeDeclaration -} from '@client/declarations' -import { selectCountryLogo, getOfflineData } from '@client/offline/selectors' -import React from 'react' -import { useIntl } from 'react-intl' -import { useDispatch, useSelector } from 'react-redux' -import { - addNidUserInfoToDeclaration, - useExtractCallBackState, - useQueryParams -} from '@client/views/OIDPVerificationCallback/utils' -import styled from 'styled-components' -import { Link, Stack, Text, Spinner, Button, Icon } from '@opencrvs/components' -import { CountryLogo } from '@opencrvs/components/lib/icons' -import { LogoContainer } from '@client/views/UserSetup/UserSetupPage' -import { buttonMessages } from '@client/i18n/messages' -import { messages as nidCallbackMessages } from '@client/i18n/messages/views/nidVerificationCallback' -import { useQuery } from '@apollo/client' -import { useDeclaration } from '@client/declarations/selectors' -import { GET_OIDP_USER_INFO } from '@client/views/OIDPVerificationCallback/queries' -import { useHistory } from 'react-router' -import { OIDP_VERIFICATION_CALLBACK } from '@client/navigation/routes' - -// OIDP Verification Callback -// -- -// Checks the ?state= query parameter for a JSON string like: { pathname: "/path/somewhere" } -// Redirects to the pathname in state - -const Page = styled.div` - color: ${({ theme }) => theme.colors.copy}; - background: ${({ theme }) => theme.colors.background}; - min-height: 100vh; - display: flex; - flex-direction: column; - text-align: center; -` -const Container = styled.div` - width: 288px; - margin: auto; - margin-top: 10vh; -` - -const UserActionsContainer = styled.div` - background: ${({ theme }) => theme.colors.white}; - padding: 24px 40px; - border: 1px solid ${({ theme }) => theme.colors.grey300}; - border-radius: 10px; -` - -export const OIDPVerificationCallback = () => { - const params = useQueryParams() - const { pathname, declarationId, section } = useExtractCallBackState() - const code = params.get('code') - const offlineData = useSelector(getOfflineData) - const clientId = offlineData.systems.find((s) => s.type === 'NATIONAL_ID') - ?.settings?.openIdProviderClientId - const intl = useIntl() - const logo = useSelector(selectCountryLogo) - const declaration = useDeclaration(declarationId) - const dispatch = useDispatch() - const history = useHistory() - const oidpUserInfoQueryVariables = { - code, - clientId, - redirectUri: `${window.location.origin}${OIDP_VERIFICATION_CALLBACK}` - } - const { loading, error, refetch } = useQuery(GET_OIDP_USER_INFO, { - variables: oidpUserInfoQueryVariables, - notifyOnNetworkStatusChange: true, - onCompleted: (data) => { - addNidUserInfoToDeclaration(declaration, section, data.getOIDPUserInfo) - dispatch(modifyDeclaration(declaration)) - dispatch(writeDeclaration(declaration)) - goToVerificationOrigin() - } - }) - - if (!pathname) { - // Do not redirect and let the hooks throw - return null - } - - const goToVerificationOrigin = () => { - pathname && history.push(pathname) - } - - const handleRetry = () => refetch(oidpUserInfoQueryVariables) - - return ( - - - - - - - - - {loading && ( - <> - - - {intl.formatMessage(nidCallbackMessages.authenticatingNid)} - - - )} - {error && ( - <> - - - {intl.formatMessage( - nidCallbackMessages.failedToAuthenticateNid - )} - - - - )} - - {intl.formatMessage(buttonMessages.cancel)} - - - - - - - ) -} diff --git a/packages/client/src/views/OIDPVerificationCallback/queries.ts b/packages/client/src/views/OIDPVerificationCallback/queries.ts deleted file mode 100644 index 6d3cbb6ab15..00000000000 --- a/packages/client/src/views/OIDPVerificationCallback/queries.ts +++ /dev/null @@ -1,61 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * OpenCRVS is also distributed under the terms of the Civil Registration - * & Healthcare Disclaimer located at http://opencrvs.org/license. - * - * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. - */ -import { gql } from '@apollo/client' - -export const GET_OIDP_USER_INFO = gql` - query getOIDPUserInfo( - $code: String! - $clientId: String! - $redirectUri: String! - $grantType: String - ) { - getOIDPUserInfo( - code: $code - clientId: $clientId - redirectUri: $redirectUri - grantType: $grantType - ) { - oidpUserInfo { - sub - name - given_name - family_name - middle_name - nickname - preferred_username - profile - picture - website - email - email_verified - gender - birthdate - zoneinfo - locale - phone_number - phone_number_verified - address { - formatted - street_address - locality - region - postal_code - city - country - } - updated_at - } - districtFhirId - stateFhirId - locationLevel3FhirId - } - } -` diff --git a/packages/client/src/views/OIDPVerificationCallback/utils.ts b/packages/client/src/views/OIDPVerificationCallback/utils.ts deleted file mode 100644 index 36661fc1ea2..00000000000 --- a/packages/client/src/views/OIDPVerificationCallback/utils.ts +++ /dev/null @@ -1,271 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * OpenCRVS is also distributed under the terms of the Civil Registration - * & Healthcare Disclaimer located at http://opencrvs.org/license. - * - * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. - */ - -import { IDeclaration, writeDeclaration } from '@client/declarations' -import { useDeclaration } from '@client/declarations/selectors' -import { isDefaultCountry } from '@client/forms/utils' -import { OIDP_VERIFICATION_CALLBACK } from '@client/navigation/routes' -import { IOfflineData } from '@client/offline/reducer' -import { getOfflineData } from '@client/offline/selectors' -import formatDate from '@client/utils/date-formatting' -import { camelCase } from 'lodash' -import { useEffect, useMemo } from 'react' -import { useDispatch, useSelector } from 'react-redux' -import { useLocation, useRouteMatch } from 'react-router' - -interface OIDPUserAddress { - formatted?: string | null - street_address?: string | null - locality?: string | null - region?: string | null - postal_code?: string | null - city?: string | null - country?: string | null -} - -interface oidpUserInfo { - sub: string - name?: string | null - given_name?: string | null - family_name?: string | null - middle_name?: string | null - nickname?: string | null - preferred_username?: string | null - profile?: string | null - picture?: string | null - website?: string | null - email?: string | null - email_verified?: boolean | null - gender?: string | null - birthdate?: string | null - zoneinfo?: string | null - locale?: string | null - phone_number?: string | null - phone_number_verified?: boolean | null - address?: OIDPUserAddress | null - updated_at?: number | null -} - -interface UserInfo { - oidpUserInfo: oidpUserInfo - districtFhirId?: string | null - stateFhirId?: string | null - locationLevel3FhirId?: string | null -} - -interface INidCallbackState { - pathname: string | undefined - declarationId: string - section: string -} - -export function useQueryParams() { - const { search } = useLocation() - - return useMemo(() => new URLSearchParams(search), [search]) -} - -export function addNidUserInfoToDeclaration( - declaration: IDeclaration, - section: string, - nidUserInfo: UserInfo -) { - const oidpUserInfo = nidUserInfo.oidpUserInfo - - // initialise the section (mother/father/informant) if it doesn't exist - if (!declaration.data[section]) { - declaration.data[section] = {} - } - - const declarationDataSection = declaration.data[section] - const fieldsModifiedByNidUserInfo = [] - const splitFullName = splitName(oidpUserInfo.name) - - if (oidpUserInfo.birthdate) { - // Deceased don't have "deceased" -prefix - const dataSection = section === 'deceased' ? '' : section - declarationDataSection[camelCase(`${dataSection}BirthDate`)] = formatDate( - new Date(oidpUserInfo.birthdate), - 'yyyy-MM-dd' - ) - fieldsModifiedByNidUserInfo.push(camelCase(`${dataSection}BirthDate`)) - } - - if (splitFullName.firstName) { - declarationDataSection['firstNamesEng'] = splitFullName.firstName - fieldsModifiedByNidUserInfo.push('firstNamesEng') - } - if (splitFullName.lastName) { - declarationDataSection['familyNameEng'] = splitFullName.lastName - fieldsModifiedByNidUserInfo.push('familyNameEng') - } - - if (oidpUserInfo.address?.country) { - declarationDataSection['countryPrimary'] = oidpUserInfo.address.country - fieldsModifiedByNidUserInfo.push('countryPrimary') - - if (isDefaultCountry(oidpUserInfo.address.country)) { - //populate default country specific address fields - if (nidUserInfo.stateFhirId) { - declarationDataSection['statePrimary'] = nidUserInfo.stateFhirId - fieldsModifiedByNidUserInfo.push('statePrimary') - } - if (nidUserInfo.districtFhirId) { - declarationDataSection['districtPrimary'] = nidUserInfo.districtFhirId - fieldsModifiedByNidUserInfo.push('districtPrimary') - } - if (nidUserInfo.locationLevel3FhirId) { - declarationDataSection['locationLevel3Primary'] = - nidUserInfo.locationLevel3FhirId - fieldsModifiedByNidUserInfo.push('locationLevel3Primary') - } - if (oidpUserInfo.address.street_address) { - declarationDataSection['addressLine2UrbanOptionPrimary'] = - oidpUserInfo.address.street_address - fieldsModifiedByNidUserInfo.push('addressLine2UrbanOptionPrimary') - } - if (oidpUserInfo.address.postal_code) { - declarationDataSection['postCodePrimary'] = - oidpUserInfo.address.postal_code - fieldsModifiedByNidUserInfo.push('postCodePrimary') - } - } else { - //populate international address fields - if (oidpUserInfo.address.region) { - declarationDataSection['internationalStatePrimary'] = - oidpUserInfo.address.region - fieldsModifiedByNidUserInfo.push('internationalStatePrimary') - } - if (oidpUserInfo.address.locality) { - declarationDataSection['internationalDistrictPrimary'] = - oidpUserInfo.address.locality - fieldsModifiedByNidUserInfo.push('internationalDistrictPrimary') - } - if (oidpUserInfo.address.city) { - declarationDataSection['locationLevel3Primary'] = - oidpUserInfo.address.city - fieldsModifiedByNidUserInfo.push('locationLevel3Primary') - } - if (oidpUserInfo.address.street_address) { - declarationDataSection['internationalAddressLine1Primary'] = - oidpUserInfo.address.street_address - fieldsModifiedByNidUserInfo.push('internationalAddressLine1Primary') - } - if (oidpUserInfo.address.postal_code) { - declarationDataSection['internationalPostcodePrimary'] = - oidpUserInfo.address.postal_code - fieldsModifiedByNidUserInfo.push('internationalPostcodePrimary') - } - } - - if (section === 'father') { - declarationDataSection['primaryAddressSameAsOtherPrimary'] = false - } - - if (section === 'spouse') { - declarationDataSection['primaryAddressSameAsOtherPrimary'] = false - } - } - - declarationDataSection['fieldsModifiedByNidUserInfo'] = - fieldsModifiedByNidUserInfo - declarationDataSection[`${section}NidVerification`] = oidpUserInfo.sub -} - -function splitName(name: string | undefined | null = '') { - if (!name) { - return { firstName: '', lastName: '' } - } - - const [firstName, ...lastName] = name.split(' ').filter(Boolean) - return { - firstName: firstName, - lastName: lastName.join(' ') - } -} - -export const useNidAuthentication = () => { - const dispatch = useDispatch() - const match = useRouteMatch() - const matchParams = match.params as { - declarationId: string - groupId: string - pageId: string - } - const offlineCountryConfig = useSelector(getOfflineData) - const declaration = useDeclaration(matchParams.declarationId) - - const onClick = () => - dispatch( - writeDeclaration(declaration, () => { - redirectToNidIntegration( - offlineCountryConfig, - matchParams.declarationId, - matchParams.pageId, - match.url - ) - }) - ) - - return { onClick } -} - -export function redirectToNidIntegration( - offlineCountryConfig: IOfflineData, - declarationId: string, - currentSection: string, - currentPathname: string -) { - const nidSystemSetting = offlineCountryConfig.systems.find( - (s) => s.type === 'NATIONAL_ID' - )?.settings - - if (!nidSystemSetting) { - return - } - const url = new URL(`${nidSystemSetting?.openIdProviderBaseUrl}authorize`) - - url.searchParams.append( - 'client_id', - nidSystemSetting?.openIdProviderClientId || '' - ) - url.searchParams.append( - 'redirect_uri', - `${window.location.origin}${OIDP_VERIFICATION_CALLBACK}` - ) - url.searchParams.append('response_type', 'code') - url.searchParams.append('scope', 'openid profile') - url.searchParams.append('acr_values', 'mosip:idp:acr:static-code') - const stateToBeSent: INidCallbackState = { - pathname: currentPathname, - declarationId: declarationId, - section: currentSection - } - url.searchParams.append('state', JSON.stringify(stateToBeSent)) - url.searchParams.append('claims', nidSystemSetting.openIdProviderClaims || '') - window.location.href = url.toString() -} - -export const useExtractCallBackState = () => { - const params = useQueryParams() - - useEffect(() => { - if (!params.get('state')) { - throw new Error('No state provided from OIDP callback.') - } - }, [params]) - - const { pathname, declarationId, section } = JSON.parse( - params.get('state') ?? '{}' - ) as INidCallbackState - - return { pathname, declarationId, section } -} diff --git a/packages/client/src/views/RegisterForm/review/ReviewSection.tsx b/packages/client/src/views/RegisterForm/review/ReviewSection.tsx index 7cfc1bc0721..c2406b6b80d 100644 --- a/packages/client/src/views/RegisterForm/review/ReviewSection.tsx +++ b/packages/client/src/views/RegisterForm/review/ReviewSection.tsx @@ -68,7 +68,6 @@ import { SELECT_WITH_DYNAMIC_OPTIONS, SELECT_WITH_OPTIONS, SubmissionAction, - NID_VERIFICATION_BUTTON, WARNING, DIVIDER, HIDDEN @@ -132,7 +131,6 @@ import { } from '@client/views/CorrectionForm/utils' import { ListReview } from '@opencrvs/components/lib/ListReview' import { DuplicateWarning } from '@client/views/Duplicates/DuplicateWarning' -import { VerificationButton } from '@opencrvs/components/lib/VerificationButton' import { DuplicateForm } from '@client/views/RegisterForm/duplicate/DuplicateForm' import { Button } from '@opencrvs/components/lib/Button' import { UserDetails } from '@client/utils/userUtils' @@ -542,25 +540,6 @@ const renderValue = ( ) return (selectedLocation && selectedLocation.displayLabel) || '' } - if (field.type === NID_VERIFICATION_BUTTON) { - return ( - {}} - labelForVerified={intl.formatMessage( - formMessageDescriptors.nidVerified - )} - labelForUnverified={intl.formatMessage( - formMessageDescriptors.nidNotVerified - )} - labelForOffline={intl.formatMessage(formMessageDescriptors.nidOffline)} - reviewLabelForUnverified={intl.formatMessage( - formMessageDescriptors.nidNotVerifiedReviewSection - )} - status={value ? 'verified' : 'unverified'} - useAsReviewLabel={true} - /> - ) - } if (typeof value === 'boolean') { return value diff --git a/packages/components/src/VerificationButton/VerificationButton.stories.tsx b/packages/components/src/VerificationButton/VerificationButton.stories.tsx deleted file mode 100644 index 86c315a0e0a..00000000000 --- a/packages/components/src/VerificationButton/VerificationButton.stories.tsx +++ /dev/null @@ -1,60 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * OpenCRVS is also distributed under the terms of the Civil Registration - * & Healthcare Disclaimer located at http://opencrvs.org/license. - * - * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. - */ -import * as React from 'react' -import { ComponentMeta, ComponentStory } from '@storybook/react' -import { VerificationButton } from './VerificationButton' - -export default { - title: 'Controls/Verification button', - component: VerificationButton, - parameters: { - docs: { - description: { - component: ` -\`\` is used for authentication flow. It can show an action button, a verified icon or a disabled button with an offline message.` - } - } - } -} as ComponentMeta - -const Template: ComponentStory = (args) => { - return -} - -export const Unverified = Template.bind({}) -Unverified.args = { - status: 'unverified', - onClick: () => {}, - labelForVerified: 'Authenticated', - labelForUnverified: 'Authenticate', - labelForOffline: - 'National ID authentication is currently not available offline.' -} - -export const Verified = Template.bind({}) -Verified.args = { - status: 'verified', - onClick: () => {}, - labelForVerified: 'Authenticated', - labelForUnverified: 'Authenticate', - labelForOffline: - 'National ID authentication is currently not available offline.' -} - -export const Offline = Template.bind({}) -Offline.args = { - status: 'offline', - onClick: () => {}, - labelForVerified: 'Authenticated', - labelForUnverified: 'Authenticate', - labelForOffline: - 'National ID authentication is currently not available offline.' -} diff --git a/packages/components/src/VerificationButton/VerificationButton.tsx b/packages/components/src/VerificationButton/VerificationButton.tsx deleted file mode 100644 index 5910a4c0501..00000000000 --- a/packages/components/src/VerificationButton/VerificationButton.tsx +++ /dev/null @@ -1,99 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * OpenCRVS is also distributed under the terms of the Civil Registration - * & Healthcare Disclaimer located at http://opencrvs.org/license. - * - * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. - */ -import * as React from 'react' -import { Icon } from '../Icon' -import { Button } from '../Button' -import styled from 'styled-components' -import { Text } from '../Text' -import { Stack } from '../Stack' - -export interface VerificationButtonProps { - status?: 'unverified' | 'verified' | 'offline' - id?: string - onClick: () => void - labelForVerified: string - labelForUnverified: string - labelForOffline: string - reviewLabelForUnverified?: string - useAsReviewLabel?: boolean -} - -const VerificationBadge = styled.div` - display: inline-flex; - justify-content: center; - align-items: center; - height: 40px; - color: ${({ theme }) => theme.colors.primary}; - svg { - height: 24px; - width: 24px; - vertical-align: top; - margin-left: -2px; - margin-right: 8px; - pointer-events: none; - } -` - -export const VerificationButton = ({ - status = 'unverified', - onClick, - labelForUnverified, - labelForVerified, - labelForOffline, - reviewLabelForUnverified, - useAsReviewLabel -}: VerificationButtonProps) => { - return ( - <> - {status === 'unverified' && !useAsReviewLabel && ( - - )} - - {status === 'unverified' && useAsReviewLabel && ( - - - - {reviewLabelForUnverified} - - - )} - - {status === 'offline' && ( - - - - {labelForOffline} - - - )} - - {status === 'verified' && ( - - - - {labelForVerified} - - - )} - - ) -} diff --git a/packages/components/src/VerificationButton/index.ts b/packages/components/src/VerificationButton/index.ts deleted file mode 100644 index cae4ae99661..00000000000 --- a/packages/components/src/VerificationButton/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * OpenCRVS is also distributed under the terms of the Civil Registration - * & Healthcare Disclaimer located at http://opencrvs.org/license. - * - * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. - */ -export * from './VerificationButton' diff --git a/packages/components/src/index.ts b/packages/components/src/index.ts index e8be3cd7af5..72f96d9a488 100644 --- a/packages/components/src/index.ts +++ b/packages/components/src/index.ts @@ -76,7 +76,6 @@ export * from './Toggle' export * from './ToggleIcon' export * from './ToggleMenu' export * from './Tooltip' -export * from './VerificationButton' export * from './VerticalBar' export * from './ViewData' export * from './WarningMessage' diff --git a/packages/config/src/handlers/forms/field.ts b/packages/config/src/handlers/forms/field.ts index 0330876d34d..8ddcfc0ebc3 100644 --- a/packages/config/src/handlers/forms/field.ts +++ b/packages/config/src/handlers/forms/field.ts @@ -106,9 +106,6 @@ const LocationSearchInputField = base.extend({ type: z.literal('LOCATION_SEARCH_INPUT') }) const TimeField = base.extend({ type: z.literal('TIME') }) -const NidVerificationButtonField = base.extend({ - type: z.literal('NID_VERIFICATION_BUTTON') -}) const DividerField = base.extend({ type: z.literal('DIVIDER') }) const Heading3Field = base.extend({ type: z.literal('HEADING3') }) const SignatureField = base.extend({ type: z.literal('SIGNATURE') }) @@ -165,7 +162,6 @@ export const field = z.discriminatedUnion('type', [ FetchButtonField, LocationSearchInputField, TimeField, - NidVerificationButtonField, DividerField, Heading3Field, SignatureField, diff --git a/packages/gateway/src/constants.ts b/packages/gateway/src/constants.ts index 740cc44ad63..039a9f42809 100644 --- a/packages/gateway/src/constants.ts +++ b/packages/gateway/src/constants.ts @@ -50,8 +50,3 @@ export const CONFIG_SMS_CODE_EXPIRY_SECONDS = env.CONFIG_SMS_CODE_EXPIRY_SECONDS export const CONFIG_SYSTEM_TOKEN_EXPIRY_SECONDS = env.CONFIG_SYSTEM_TOKEN_EXPIRY_SECONDS export const MINIO_BUCKET = env.MINIO_BUCKET -export const OIDP_BASE_URL = env.NATIONAL_ID_OIDP_BASE_URL -export const OIDP_TOKEN_URL = env.NATIONAL_ID_OIDP_TOKEN_URL -export const OIDP_USERINFO_URL = env.NATIONAL_ID_OIDP_USERINFO_URL -export const OIDP_CLIENT_PRIVATE_KEY = env.NATIONAL_ID_OIDP_CLIENT_PRIVATE_KEY -export const OIDP_JWT_AUD_CLAIM = env.NATIONAL_ID_OIDP_JWT_AUD_CLAIM diff --git a/packages/gateway/src/environment.ts b/packages/gateway/src/environment.ts index 04f8d7cc5ad..7fdc7179d83 100644 --- a/packages/gateway/src/environment.ts +++ b/packages/gateway/src/environment.ts @@ -46,17 +46,5 @@ export const env = cleanEnv(process.env, { CONFIG_TOKEN_EXPIRY_SECONDS: num({ default: 604800 }), // 1 week CONFIG_SMS_CODE_EXPIRY_SECONDS: num({ default: 600 }), // 10 minutes CONFIG_SYSTEM_TOKEN_EXPIRY_SECONDS: num({ default: 600 }), // 10 minutes - MINIO_BUCKET: str({ devDefault: 'ocrvs' }), - - NATIONAL_ID_OIDP_BASE_URL: str({ default: undefined }), - NATIONAL_ID_OIDP_TOKEN_URL: str({ default: undefined }), - NATIONAL_ID_OIDP_USERINFO_URL: str({ default: undefined }), - NATIONAL_ID_OIDP_CLIENT_PRIVATE_KEY: str({ - default: undefined, - desc: 'Base64 encoded RS256 JSON Web Key' - }), - NATIONAL_ID_OIDP_JWT_AUD_CLAIM: str({ - default: undefined, - desc: 'Value for "aud" claim when getting access token for fetching Open ID provider user info' - }) + MINIO_BUCKET: str({ devDefault: 'ocrvs' }) }) diff --git a/packages/gateway/src/features/OIDPUserInfo/oidp-types.ts b/packages/gateway/src/features/OIDPUserInfo/oidp-types.ts deleted file mode 100644 index 68fed026edf..00000000000 --- a/packages/gateway/src/features/OIDPUserInfo/oidp-types.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * OpenCRVS is also distributed under the terms of the Civil Registration - * & Healthcare Disclaimer located at http://opencrvs.org/license. - * - * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. - */ -type OIDPUserAddress = { - formatted: string - street_address: string - locality: string - region: string - postal_code: string - city: string - country: string -} -export type OIDPUserInfo = { - sub: string - name?: string - given_name?: string - family_name?: string - middle_name?: string - nickname?: string - preferred_username?: string - profile?: string - picture?: string - website?: string - email?: string - email_verified?: boolean - gender?: 'female' | 'male' - birthdate?: string - zoneinfo?: string - locale?: string - phone_number?: string - phone_number_verified?: boolean - address?: Partial - updated_at?: number -} diff --git a/packages/gateway/src/features/OIDPUserInfo/root-resolvers.test.ts b/packages/gateway/src/features/OIDPUserInfo/root-resolvers.test.ts deleted file mode 100644 index 56b1a3a6534..00000000000 --- a/packages/gateway/src/features/OIDPUserInfo/root-resolvers.test.ts +++ /dev/null @@ -1,267 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * OpenCRVS is also distributed under the terms of the Civil Registration - * & Healthcare Disclaimer located at http://opencrvs.org/license. - * - * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. - */ -import { resolvers as typeResolvers } from '@gateway/features/OIDPUserInfo/root-resolvers' -import { OIDP_CLIENT_PRIVATE_KEY } from '@gateway/constants' -import * as fetchAny from 'jest-fetch-mock' -import * as jose from 'jose' -import { TestResolvers } from '@gateway/utils/testUtils' -const resolvers = typeResolvers as unknown as TestResolvers -const fetch = fetchAny as fetchAny.FetchMock - -beforeEach(() => { - fetch.resetMocks() -}) - -describe('get user info from OIDP national id integration', () => { - it('returns user info and decrypts JWT properly', async () => { - const jwtPayload = { - sub: '1234567890', - name: 'Pyry Rouvila', - given_name: 'Pyry', - family_name: 'Rouvila', - middle_name: 'Test', - birthdate: '1980-04-01', - address: { - formatted: 'Testingston 1\n12345 Ibombo, Central\nFarajaland', - street_address: 'Tammelankatu 1', - locality: 'Ibombo', - region: 'Central', - postal_code: '12345', - country: 'Farajaland' - } - } - - const decodeKey = Buffer.from( - OIDP_CLIENT_PRIVATE_KEY!, - 'base64' - )?.toString() - const jwkObject = JSON.parse(decodeKey) - const privateKey = await jose.importJWK(jwkObject, 'RS256') - const encoded = await new jose.SignJWT(jwtPayload) - .setProtectedHeader({ alg: 'RS256' }) - .sign(privateKey) - - fetch - .mockResponseOnce( - JSON.stringify({ - access_token: 'some-access-token' - }) - ) - .mockResponseOnce(encoded) - .mockResponseOnce( - JSON.stringify({ - resourceType: 'Bundle', - id: '34abc0a0-912d-4b8b-97fd-def9a2321b0f', - meta: { lastUpdated: '2023-05-19T15:39:21.599+00:00' }, - type: 'searchset', - total: 0, - link: [ - { - relation: 'self', - url: 'http://localhost:7070/location?name=Farajaland' - } - ], - entry: [] - }) - ) - .mockResponseOnce( - JSON.stringify({ - resourceType: 'Bundle', - id: 'c819db15-fc28-4606-9db4-095378a06125', - meta: { - lastUpdated: '2023-03-10T13:46:59.923+00:00' - }, - type: 'searchset', - total: 1, - link: [ - { - relation: 'self', - url: 'http://localhost:7070/location?name=Central' - } - ], - entry: [ - { - fullUrl: - 'http://localhost:7070/location/5dd96001-7c94-4eeb-b96e-8a987957f7a2/_history/b3f14d83-eb74-4cfa-b17e-039d57d222f0', - resource: { - resourceType: 'Location', - identifier: [ - { - system: 'http://opencrvs.org/specs/id/statistical-code', - value: 'ADMIN_STRUCTURE_AWn3s2RqgAN' - }, - { - system: 'http://opencrvs.org/specs/id/jurisdiction-type', - value: 'STATE' - } - ], - name: 'Central', - alias: ['Central'], - description: 'AWn3s2RqgAN', - status: 'active', - mode: 'instance', - partOf: { - reference: 'Location/0' - }, - type: { - coding: [ - { - system: 'http://opencrvs.org/specs/location-type', - code: 'ADMIN_STRUCTURE' - } - ] - }, - physicalType: { - coding: [ - { - code: 'jdn', - display: 'Jurisdiction' - } - ] - }, - extension: [], - meta: { - lastUpdated: '2023-01-18T12:54:05.278+00:00', - versionId: 'b3f14d83-eb74-4cfa-b17e-039d57d222f0' - }, - id: '5dd96001-7c94-4eeb-b96e-8a987957f7a2' - }, - request: { - method: 'PUT', - url: 'Location/5dd96001-7c94-4eeb-b96e-8a987957f7a2' - } - } - ] - }) - ) - .mockResponseOnce( - JSON.stringify({ - resourceType: 'Bundle', - id: 'c6f0f99f-ad27-4e6e-9705-a320c1eb3423', - meta: { - lastUpdated: '2023-03-10T11:55:07.461+00:00' - }, - type: 'searchset', - total: 1, - link: [ - { - relation: 'self', - url: 'http://localhost:7070/location?name=Ibombo&type=ADMIN_STRUCTURE' - } - ], - entry: [ - { - fullUrl: - 'http://localhost:7070/location/ab93d5a5-c078-4dfa-b4ca-d54d1e57bca0/_history/5127621b-de2a-4bd2-b530-6413924f2ed2', - resource: { - resourceType: 'Location', - identifier: [ - { - system: 'http://opencrvs.org/specs/id/statistical-code', - value: 'ADMIN_STRUCTURE_oEBf29y8JP8' - }, - { - system: 'http://opencrvs.org/specs/id/jurisdiction-type', - value: 'DISTRICT' - } - ], - name: 'Ibombo', - alias: ['Ibombo'], - description: 'oEBf29y8JP8', - status: 'active', - mode: 'instance', - partOf: { - reference: 'Location/5dd96001-7c94-4eeb-b96e-8a987957f7a2' - }, - type: { - coding: [ - { - system: 'http://opencrvs.org/specs/location-type', - code: 'ADMIN_STRUCTURE' - } - ] - }, - physicalType: { - coding: [ - { - code: 'jdn', - display: 'Jurisdiction' - } - ] - }, - extension: [], - meta: { - lastUpdated: '2023-01-18T12:54:05.324+00:00', - versionId: '5127621b-de2a-4bd2-b530-6413924f2ed2' - }, - id: 'ab93d5a5-c078-4dfa-b4ca-d54d1e57bca0' - }, - request: { - method: 'PUT', - url: 'Location/ab93d5a5-c078-4dfa-b4ca-d54d1e57bca0' - } - } - ] - }) - ) - - const data = await resolvers.Query!.getOIDPUserInfo( - {}, - { - code: 'some-code', - clientId: 'some-client-id', - redirectUri: 'http://localhost:3000/mosip-callback' - } - ) - expect(fetch.mock.calls[0][0]).toMatch(/oauth\/v2\/token$/) - expect(fetch.mock.calls[1][0]).toMatch(/oidc\/v2\/userinfo$/) - expect(fetch.mock.calls[2][0]).toMatch( - /Location\?name=Farajaland&type=ADMIN_STRUCTURE$/ - ) - expect(fetch.mock.calls[3][0]).toMatch( - /Location\?name=Central&type=ADMIN_STRUCTURE$/ - ) - expect(fetch.mock.calls[4][0]).toMatch( - /Location\?name=Ibombo&type=ADMIN_STRUCTURE$/ - ) - expect(data).toEqual({ - oidpUserInfo: jwtPayload, - districtFhirId: '5dd96001-7c94-4eeb-b96e-8a987957f7a2', - locationLevel3FhirId: 'ab93d5a5-c078-4dfa-b4ca-d54d1e57bca0', - stateFhirId: null - }) - }) - - it('throws an error if no access token is returned', async () => { - fetch.mockResponseOnce( - JSON.stringify({ - error: 'invalid_assertion', - error_description: 'invalid_assertion' - }), - { status: 400 } - ) - - try { - await resolvers.Query!.getOIDPUserInfo( - {}, - { - code: 'some-code', - clientId: 'some-client-id', - redirectUri: 'http://localhost:3000/mosip-callback' - } - ) - } catch (e) { - expect(e.message).toMatch('No access token was returned') - } - - expect.assertions(1) - }) -}) diff --git a/packages/gateway/src/features/OIDPUserInfo/root-resolvers.ts b/packages/gateway/src/features/OIDPUserInfo/root-resolvers.ts deleted file mode 100644 index 1180e016cd7..00000000000 --- a/packages/gateway/src/features/OIDPUserInfo/root-resolvers.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * OpenCRVS is also distributed under the terms of the Civil Registration - * & Healthcare Disclaimer located at http://opencrvs.org/license. - * - * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. - */ -import { GQLResolver } from '@gateway/graphql/schema' -import { fetchToken, fetchUserInfo } from './utils' - -export const resolvers: GQLResolver = { - Query: { - getOIDPUserInfo: async (_, { code, clientId, redirectUri, grantType }) => { - const tokenResponse = await fetchToken({ - code, - clientId, - redirectUri, - grantType - }) - - if (!tokenResponse.access_token) { - throw new Error( - 'Something went wrong with the OIDP token request. No access token was returned. Response from OIDP: ' + - JSON.stringify(tokenResponse) - ) - } - - return fetchUserInfo(tokenResponse.access_token) - } - } -} diff --git a/packages/gateway/src/features/OIDPUserInfo/schema.graphql b/packages/gateway/src/features/OIDPUserInfo/schema.graphql deleted file mode 100644 index a3d41fedbcd..00000000000 --- a/packages/gateway/src/features/OIDPUserInfo/schema.graphql +++ /dev/null @@ -1,57 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# OpenCRVS is also distributed under the terms of the Civil Registration -# & Healthcare Disclaimer located at http://opencrvs.org/license. -# -# Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. - -type OIDPUserAddress { - formatted: String - street_address: String - locality: String - region: String - postal_code: String - city: String - country: String -} - -type OIDPUserInfo { - sub: String! - name: String - given_name: String - family_name: String - middle_name: String - nickname: String - preferred_username: String - profile: String - picture: String - website: String - email: String - email_verified: Boolean - gender: String - birthdate: String - zoneinfo: String - locale: String - phone_number: String - phone_number_verified: Boolean - address: OIDPUserAddress - updated_at: Int -} - -type UserInfo { - oidpUserInfo: OIDPUserInfo - districtFhirId: String - stateFhirId: String - locationLevel3FhirId: String -} - -type Query { - getOIDPUserInfo( - code: String! - clientId: String! - redirectUri: String! - grantType: String - ): UserInfo -} diff --git a/packages/gateway/src/features/OIDPUserInfo/utils.ts b/packages/gateway/src/features/OIDPUserInfo/utils.ts deleted file mode 100644 index aa42fd4dae2..00000000000 --- a/packages/gateway/src/features/OIDPUserInfo/utils.ts +++ /dev/null @@ -1,146 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * OpenCRVS is also distributed under the terms of the Civil Registration - * & Healthcare Disclaimer located at http://opencrvs.org/license. - * - * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. - */ -import * as jwt from 'jsonwebtoken' -import * as jose from 'jose' -import fetch from '@gateway/fetch' -import { - OIDP_CLIENT_PRIVATE_KEY, - OIDP_JWT_AUD_CLAIM, - OIDP_TOKEN_URL, - OIDP_USERINFO_URL -} from '@gateway/constants' - -import { logger } from '@opencrvs/commons' -import { OIDPUserInfo } from './oidp-types' -import { Bundle, Location } from '@opencrvs/commons/types' -import { fetchFromHearth } from '@gateway/features/fhir/service' - -const TOKEN_GRANT_TYPE = 'authorization_code' -const CLIENT_ASSERTION_TYPE = - 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer' - -const JWT_ALG = 'RS256' -const JWT_EXPIRATION_TIME = '1h' - -export type FetchTokenProps = { - code: string - clientId: string - redirectUri: string - grantType?: string -} - -const searchLocationFromHearth = (name: string) => - fetchFromHearth>( - `/Location?${new URLSearchParams({ name, type: 'ADMIN_STRUCTURE' })}` - ) - -const findAdminStructureLocationWithName = async (name: string) => { - const fhirBundleLocations = await searchLocationFromHearth(name) - - if ((fhirBundleLocations.entry?.length ?? 0) > 1) { - throw new Error( - 'Multiple admin structure locations found with the same name' - ) - } - - if ((fhirBundleLocations.entry?.length ?? 0) === 0) { - logger.warn('No admin structure location found with the name: ' + name) - return null - } - - return fhirBundleLocations.entry?.[0].resource?.id -} - -const pickUserInfo = async (userInfo: OIDPUserInfo) => { - const stateFhirId = - userInfo.address?.country && - (await findAdminStructureLocationWithName(userInfo.address.country)) - - return { - oidpUserInfo: userInfo, - stateFhirId, - districtFhirId: - userInfo.address?.region && - (await findAdminStructureLocationWithName(userInfo.address.region)), - locationLevel3FhirId: - userInfo.address?.locality && - (await findAdminStructureLocationWithName(userInfo.address.locality)) - } -} - -export const fetchToken = async ({ - code, - clientId, - redirectUri, - grantType = TOKEN_GRANT_TYPE -}: FetchTokenProps) => { - const body = new URLSearchParams({ - code: code, - client_id: clientId, - redirect_uri: redirectUri, - grant_type: grantType, - client_assertion_type: CLIENT_ASSERTION_TYPE, - client_assertion: await generateSignedJwt(clientId) - }) - - const request = await fetch(OIDP_TOKEN_URL!, { - method: 'POST', - headers: { - 'Content-Type': 'application/x-www-form-urlencoded' - }, - body - }) - - const response = await request.json() - return response as { access_token?: string } -} - -export const fetchUserInfo = async (accessToken: string) => { - const request = await fetch(OIDP_USERINFO_URL!, { - headers: { - Authorization: 'Bearer ' + accessToken - } - }) - - const response = await request.text() - const decodedResponse = decodeUserInfoResponse(response) - - logger.info(`OIDP user info response succeeded`) - - return pickUserInfo(decodedResponse) -} - -const generateSignedJwt = async (clientId: string) => { - const header = { - alg: JWT_ALG, - typ: 'JWT' - } - - const payload = { - iss: clientId, - sub: clientId, - aud: OIDP_JWT_AUD_CLAIM - } - - const decodeKey = Buffer.from(OIDP_CLIENT_PRIVATE_KEY!, 'base64')?.toString() - const jwkObject = JSON.parse(decodeKey) - const privateKey = await jose.importJWK(jwkObject, JWT_ALG) - - return new jose.SignJWT(payload) - .setProtectedHeader(header) - .setIssuedAt() - .setExpirationTime(JWT_EXPIRATION_TIME) - .sign(privateKey) -} - -const decodeUserInfoResponse = (response: string) => { - return jwt.decode(response) as OIDPUserInfo -} diff --git a/packages/gateway/src/graphql/config.ts b/packages/gateway/src/graphql/config.ts index fa554e2e352..c0d94db2c87 100644 --- a/packages/gateway/src/graphql/config.ts +++ b/packages/gateway/src/graphql/config.ts @@ -31,7 +31,6 @@ import { searchTypeResolvers } from '@gateway/features/search/type-resolvers' import { resolvers as userRootResolvers } from '@gateway/features/user/root-resolvers' import { resolvers as correctionRootResolvers } from '@gateway/features/correction/root-resolvers' import { resolvers as bookmarkAdvancedSearchResolvers } from '@gateway/features/bookmarkAdvancedSearch/root-resolvers' -import { resolvers as OIDPUserInfoResolvers } from '@gateway/features/OIDPUserInfo/root-resolvers' import { ISystemModelData, IUserModelData, @@ -84,7 +83,6 @@ export const resolvers: StringIndexed = merge( correctionRootResolvers as IResolvers, integrationResolver as IResolvers, bookmarkAdvancedSearchResolvers as IResolvers, - OIDPUserInfoResolvers as IResolvers, { FieldValue: new GraphQLScalarType({ name: 'FieldValue', diff --git a/packages/gateway/src/graphql/index.graphql b/packages/gateway/src/graphql/index.graphql index ab8ca23a042..f9f8634bfd4 100644 --- a/packages/gateway/src/graphql/index.graphql +++ b/packages/gateway/src/graphql/index.graphql @@ -19,7 +19,6 @@ # import Mutation.* from '../features/systems/schema.graphql' # import Query.* from '../features/systems/schema.graphql' # import Mutation from '../features/bookmarkAdvancedSearch/schema.graphql' -# import Query.* from '../features/OIDPUserInfo/schema.graphql' # import * from 'common.graphql' # TODO diff --git a/packages/gateway/src/graphql/schema.d.ts b/packages/gateway/src/graphql/schema.d.ts index a02daf1f502..6807e1a9b80 100644 --- a/packages/gateway/src/graphql/schema.d.ts +++ b/packages/gateway/src/graphql/schema.d.ts @@ -50,7 +50,6 @@ export interface GQLQuery { getEventsWithProgress?: GQLEventProgressResultSet getSystemRoles?: Array fetchSystem?: GQLSystem - getOIDPUserInfo?: GQLUserInfo } export interface GQLMutation { @@ -509,13 +508,6 @@ export interface GQLSystem { settings?: GQLSystemSettings } -export interface GQLUserInfo { - oidpUserInfo?: GQLOIDPUserInfo - districtFhirId?: string - stateFhirId?: string - locationLevel3FhirId?: string -} - export interface GQLCorrectionInput { requester: string requesterOther?: string @@ -1019,29 +1011,6 @@ export interface GQLSystemSettings { openIdProviderClaims?: string } -export interface GQLOIDPUserInfo { - sub: string - name?: string - given_name?: string - family_name?: string - middle_name?: string - nickname?: string - preferred_username?: string - profile?: string - picture?: string - website?: string - email?: string - email_verified?: boolean - gender?: string - birthdate?: string - zoneinfo?: string - locale?: string - phone_number?: string - phone_number_verified?: boolean - address?: GQLOIDPUserAddress - updated_at?: number -} - export interface GQLAttachmentInput { _fhirID?: string contentType?: string @@ -1516,16 +1485,6 @@ export interface GQLWebhookPermission { permissions: Array } -export interface GQLOIDPUserAddress { - formatted?: string - street_address?: string - locality?: string - region?: string - postal_code?: string - city?: string - country?: string -} - export const enum GQLAttachmentInputStatus { approved = 'approved', validated = 'validated', @@ -1748,7 +1707,6 @@ export interface GQLResolver { EventProgressResultSet?: GQLEventProgressResultSetTypeResolver SystemRole?: GQLSystemRoleTypeResolver System?: GQLSystemTypeResolver - UserInfo?: GQLUserInfoTypeResolver CreatedIds?: GQLCreatedIdsTypeResolver Reinstated?: GQLReinstatedTypeResolver Avatar?: GQLAvatarTypeResolver @@ -1791,7 +1749,6 @@ export interface GQLResolver { EventProgressSet?: GQLEventProgressSetTypeResolver SystemSettings?: GQLSystemSettingsTypeResolver - OIDPUserInfo?: GQLOIDPUserInfoTypeResolver AssignmentData?: GQLAssignmentDataTypeResolver RegWorkflow?: GQLRegWorkflowTypeResolver Certificate?: GQLCertificateTypeResolver @@ -1815,7 +1772,6 @@ export interface GQLResolver { MarriageEventSearchSet?: GQLMarriageEventSearchSetTypeResolver EventProgressData?: GQLEventProgressDataTypeResolver WebhookPermission?: GQLWebhookPermissionTypeResolver - OIDPUserAddress?: GQLOIDPUserAddressTypeResolver FieldValue?: GraphQLScalarType AuditLogItemBase?: { __resolveType: GQLAuditLogItemBaseTypeResolver @@ -1861,7 +1817,6 @@ export interface GQLQueryTypeResolver { getEventsWithProgress?: QueryToGetEventsWithProgressResolver getSystemRoles?: QueryToGetSystemRolesResolver fetchSystem?: QueryToFetchSystemResolver - getOIDPUserInfo?: QueryToGetOIDPUserInfoResolver } export interface QueryToSendNotificationToAllUsersArgs { @@ -2460,21 +2415,6 @@ export interface QueryToFetchSystemResolver { ): TResult } -export interface QueryToGetOIDPUserInfoArgs { - code: string - clientId: string - redirectUri: string - grantType?: string -} -export interface QueryToGetOIDPUserInfoResolver { - ( - parent: TParent, - args: QueryToGetOIDPUserInfoArgs, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - export interface GQLMutationTypeResolver { requestRegistrationCorrection?: MutationToRequestRegistrationCorrectionResolver rejectRegistrationCorrection?: MutationToRejectRegistrationCorrectionResolver @@ -5470,55 +5410,6 @@ export interface SystemToSettingsResolver { ): TResult } -export interface GQLUserInfoTypeResolver { - oidpUserInfo?: UserInfoToOidpUserInfoResolver - districtFhirId?: UserInfoToDistrictFhirIdResolver - stateFhirId?: UserInfoToStateFhirIdResolver - locationLevel3FhirId?: UserInfoToLocationLevel3FhirIdResolver -} - -export interface UserInfoToOidpUserInfoResolver { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - -export interface UserInfoToDistrictFhirIdResolver< - TParent = any, - TResult = any -> { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - -export interface UserInfoToStateFhirIdResolver { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - -export interface UserInfoToLocationLevel3FhirIdResolver< - TParent = any, - TResult = any -> { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - export interface GQLCreatedIdsTypeResolver { compositionId?: CreatedIdsToCompositionIdResolver trackingId?: CreatedIdsToTrackingIdResolver @@ -7866,233 +7757,6 @@ export interface SystemSettingsToOpenIdProviderClaimsResolver< ): TResult } -export interface GQLOIDPUserInfoTypeResolver { - sub?: OIDPUserInfoToSubResolver - name?: OIDPUserInfoToNameResolver - given_name?: OIDPUserInfoToGiven_nameResolver - family_name?: OIDPUserInfoToFamily_nameResolver - middle_name?: OIDPUserInfoToMiddle_nameResolver - nickname?: OIDPUserInfoToNicknameResolver - preferred_username?: OIDPUserInfoToPreferred_usernameResolver - profile?: OIDPUserInfoToProfileResolver - picture?: OIDPUserInfoToPictureResolver - website?: OIDPUserInfoToWebsiteResolver - email?: OIDPUserInfoToEmailResolver - email_verified?: OIDPUserInfoToEmail_verifiedResolver - gender?: OIDPUserInfoToGenderResolver - birthdate?: OIDPUserInfoToBirthdateResolver - zoneinfo?: OIDPUserInfoToZoneinfoResolver - locale?: OIDPUserInfoToLocaleResolver - phone_number?: OIDPUserInfoToPhone_numberResolver - phone_number_verified?: OIDPUserInfoToPhone_number_verifiedResolver - address?: OIDPUserInfoToAddressResolver - updated_at?: OIDPUserInfoToUpdated_atResolver -} - -export interface OIDPUserInfoToSubResolver { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - -export interface OIDPUserInfoToNameResolver { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - -export interface OIDPUserInfoToGiven_nameResolver< - TParent = any, - TResult = any -> { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - -export interface OIDPUserInfoToFamily_nameResolver< - TParent = any, - TResult = any -> { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - -export interface OIDPUserInfoToMiddle_nameResolver< - TParent = any, - TResult = any -> { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - -export interface OIDPUserInfoToNicknameResolver { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - -export interface OIDPUserInfoToPreferred_usernameResolver< - TParent = any, - TResult = any -> { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - -export interface OIDPUserInfoToProfileResolver { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - -export interface OIDPUserInfoToPictureResolver { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - -export interface OIDPUserInfoToWebsiteResolver { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - -export interface OIDPUserInfoToEmailResolver { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - -export interface OIDPUserInfoToEmail_verifiedResolver< - TParent = any, - TResult = any -> { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - -export interface OIDPUserInfoToGenderResolver { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - -export interface OIDPUserInfoToBirthdateResolver { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - -export interface OIDPUserInfoToZoneinfoResolver { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - -export interface OIDPUserInfoToLocaleResolver { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - -export interface OIDPUserInfoToPhone_numberResolver< - TParent = any, - TResult = any -> { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - -export interface OIDPUserInfoToPhone_number_verifiedResolver< - TParent = any, - TResult = any -> { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - -export interface OIDPUserInfoToAddressResolver { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - -export interface OIDPUserInfoToUpdated_atResolver< - TParent = any, - TResult = any -> { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - export interface GQLAssignmentDataTypeResolver { practitionerId?: AssignmentDataToPractitionerIdResolver firstName?: AssignmentDataToFirstNameResolver @@ -10533,94 +10197,6 @@ export interface WebhookPermissionToPermissionsResolver< ): TResult } -export interface GQLOIDPUserAddressTypeResolver { - formatted?: OIDPUserAddressToFormattedResolver - street_address?: OIDPUserAddressToStreet_addressResolver - locality?: OIDPUserAddressToLocalityResolver - region?: OIDPUserAddressToRegionResolver - postal_code?: OIDPUserAddressToPostal_codeResolver - city?: OIDPUserAddressToCityResolver - country?: OIDPUserAddressToCountryResolver -} - -export interface OIDPUserAddressToFormattedResolver< - TParent = any, - TResult = any -> { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - -export interface OIDPUserAddressToStreet_addressResolver< - TParent = any, - TResult = any -> { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - -export interface OIDPUserAddressToLocalityResolver< - TParent = any, - TResult = any -> { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - -export interface OIDPUserAddressToRegionResolver { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - -export interface OIDPUserAddressToPostal_codeResolver< - TParent = any, - TResult = any -> { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - -export interface OIDPUserAddressToCityResolver { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - -export interface OIDPUserAddressToCountryResolver< - TParent = any, - TResult = any -> { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - export interface GQLAuditLogItemBaseTypeResolver { (parent: TParent, context: Context, info: GraphQLResolveInfo): | 'UserAuditLogItemWithComposition' diff --git a/packages/gateway/src/graphql/schema.graphql b/packages/gateway/src/graphql/schema.graphql index ec49396ea5a..0dbf8e1d4bc 100644 --- a/packages/gateway/src/graphql/schema.graphql +++ b/packages/gateway/src/graphql/schema.graphql @@ -147,12 +147,6 @@ type Query { sortOrder: String ): [SystemRole!] fetchSystem(clientId: ID!): System - getOIDPUserInfo( - code: String! - clientId: String! - redirectUri: String! - grantType: String - ): UserInfo } type Mutation { @@ -635,13 +629,6 @@ type System { settings: SystemSettings } -type UserInfo { - oidpUserInfo: OIDPUserInfo - districtFhirId: String - stateFhirId: String - locationLevel3FhirId: String -} - input CorrectionInput { requester: String! requesterOther: String @@ -1121,29 +1108,6 @@ type SystemSettings { openIdProviderClaims: String } -type OIDPUserInfo { - sub: String! - name: String - given_name: String - family_name: String - middle_name: String - nickname: String - preferred_username: String - profile: String - picture: String - website: String - email: String - email_verified: Boolean - gender: String - birthdate: String - zoneinfo: String - locale: String - phone_number: String - phone_number_verified: Boolean - address: OIDPUserAddress - updated_at: Int -} - input AttachmentInput { _fhirID: ID contentType: String @@ -1617,16 +1581,6 @@ type WebhookPermission { permissions: [String!]! } -type OIDPUserAddress { - formatted: String - street_address: String - locality: String - region: String - postal_code: String - city: String - country: String -} - enum AttachmentInputStatus { approved validated diff --git a/packages/gateway/test/setupJest.ts b/packages/gateway/test/setupJest.ts index 12052b031da..001598ad33e 100644 --- a/packages/gateway/test/setupJest.ts +++ b/packages/gateway/test/setupJest.ts @@ -17,12 +17,3 @@ jest.setMock('node-fetch', { default: fetch, Headers: f.Headers }) jest.setMock('@opencrvs/commons/monitoring') process.env.CERT_PUBLIC_KEY_PATH = join(__dirname, './cert.key.pub') -process.env.NATIONAL_ID_OIDP_CLIENT_PRIVATE_KEY = - 'ewogICAgInAiOiAiMVRMMlRPOWxNZnZOWThzeWVReFFrd3F1RThfdll5bV85ZS1yUkxRaV9reWJvLUMwUXJYVklQRFNfN2laV3I4WFB0MGlMWnJkemtjSzU0dGtKWGRkYWk3bEhxM3VyNndLU09uUHVPMURNS0stLXlNR3lCd0RfazdTbUdLUDlsTml3Q0pDT1Q2dDdjWEM1SnBEaVBNc05HQWNEUDZyRGFQQ2tlMzZUcjV5LW5NIiwKICAgICJrdHkiOiAiUlNBIiwKICAgICJxIjogIng4U1FwSHc2UlFnWmxHUC1EdWpiS1pRcUZxczAxU0ZsczFQa1lya25yM01rV1FrUFVGVDlubW5CbTlHWlVwbUV0TU9WZDc4SWVfdHV1UGZFVFo1SWYwTmt0bTNJdS1Pcm9jQzJBU3IzQnF0dUZyUnhUWTRJbnVBVnhHd0VuV0Frd1ZWR1dJQklEVkhSeHhGblAwZUo0YWNmVGVDcWs4QTE1cFRhOUo2MmY4ayIsCiAgICAiZCI6ICJubms3Q2RtT2hucVdyMTU1cW5hc25PY2pPamYyVEJLNlVpYUJOcWw1S1FBMmlJSnJGa0F1ZXFYcmwzM1J0eVgtZFFtOU1NTnhNLUYwMUpac3REME50eW1ZdXlzOVFMbGhKbld2RHlGLXlmMHJHOFJPVHROQkNuZjgxNUE2STQ1UzhqVUlXMGI1dl9lQlAxY1lKdWRLSW5QNlY0NVRZUEFlSjhKQ2hPeFJ2RlJHX2loOFVRaTdDZFZWNXFvVUVpX1lOWXNleTc1cTZpTFRiRVFFOExsNE9lMnRFNDMxTnltMTBaa185R2FNVEp0SU1YMm1iMW01blFfMTZmRC1ZNDZvWDlucW9zUUtUZ19uYmRoUFU3QWQwNW5MSjZFRER0X0JIbDNfc0d1blhrN3BhMjFTN1hfRjBQT0JrdG42dlNUV0FEZjQtM2pXaFNHa21yX3pyR3hLc1EiLAogICAgImUiOiAiQVFBQiIsCiAgICAicWkiOiAiRlpCaE55Uk5nMVhJVW44d1VFVGRCSEh4Qmx0Wk9tbDJhUzNXYlVZb3VuQlN1NDhoVk9BOGpWdFJFaWFBc25xUkxtaGNIN3V0aWVCTHBKazZsZ2pyM3RINnh3WklOSDRCb1NBYnRyUW5DMXd1ZE1fa1FCX1hpRk4tSFhPX0oyU2thV05nb19JSFFING1udXZnRUkxUEdpZGdwZzJ2NnJ6V3R3ZW5rbXhHblJnIiwKICAgICJkcCI6ICJNYkhMVDJ1TnZ2VGVqeUJTQjMwald1TG1hSl9UUU4zLWJLa00xdHJXUFVoR0R4RFZjNmRHb29MXzY3TnZxNE5YTzhQM3I0R2xxZXROVTJOZVdJMVdMT1g1YWdsSTFaSFlZOTU4R0xMVk1vVDgxelQyNDdZRUNFYl9ONTNoeUp6dks3SFFsZDlTVTFZQmM1LXhsajU0VTAwRHZOT3ZzMkkwZkNkb2JPcGZpcGsiLAogICAgImFsZyI6ICJSUzI1NiIsCiAgICAiZHEiOiAiYlJkRjJkMVJRTk5zaktHU1l2ZjhmeGNfYU1PMEJWUElvd2FFS1BsdDE1MHNVMGJrU3YwdXh1eF80eVN4OHU2TkR0M2o2TkcwdzJnS0RnNlg3NzhwWGY0aXFKRUpWcm04eDRkaW5QNm1pY2ppUkpuamFmUFBkMXR0NTZjSldodmYxb2hIOHhxU3ZsdFpFTG5MUlQ0LTZMQ0lJdEkydEpyNWxHTGpzMFJjNnlrIiwKICAgICJuIjogInBsNVE4QWVsT1ozWERyc093ems5T0ExNzR1WEF3ZnpxOW1NVXB2cVEwMC1sMFlKWGljZUlfWU13ZVJnS0tGTnpEMklEajhGNnJqaDh1THEwdjhiTE5oLWQzUEFwRHBTMTVOc3ZhN2U4VFZNR1paLVZJVDVKVGZqMzZsNWR2Q1oxa21MRUJ2ZjJhbzFHOVowMXU0NDNMZDRueEgzNHpkLTlUZU5VRXp4ejAweXUtOFBrRkJ5OGNySGVCR2JmcUlTLV9nbVJ6ZEIwclFQM29GT3hiNWJfa01WYUR6Wm5YSFVVemFIdDRNOEcxcHF2QjJOZzQzUDQ0d2NJME1YMVNHVkRQbGMtZVBfNjFjNW5qTzhoVnhnbUZzOUt0WVR5a0t3OXhsYUh6U1dCbG9ObVZFeG1Yd1ItckVzSTdJczdxOUpWTjdEVzNaNmYzRnk3NVpnN21rZXhTdyIKfQ==' -process.env.NATIONAL_ID_OIDP_BASE_URL = 'http://localhost:27501/v1/oid/' -process.env.NATIONAL_ID_OIDP_TOKEN_URL = - 'http://localhost:27502/v1/esignet/oauth/v2/token' -process.env.NATIONAL_ID_OIDP_USERINFO_URL = - 'http://localhost:27502/v1/esignet/oidc/v2/userinfo' -process.env.NATIONAL_ID_OIDP_JWT_AUD_CLAIM = - 'http://localhost:27501/v1/idp/oauth/token' diff --git a/packages/user-mgnt/src/constants.ts b/packages/user-mgnt/src/constants.ts index 2136746db35..89e256a7345 100644 --- a/packages/user-mgnt/src/constants.ts +++ b/packages/user-mgnt/src/constants.ts @@ -26,10 +26,3 @@ export const RECORD_SEARCH_QUOTA = env.RECORD_SEARCH_QUOTA export const FHIR_URL = env.FHIR_URL export const METRICS_URL = env.METRICS_URL - -export const NATIONAL_ID_OIDP_BASE_URL = env.NATIONAL_ID_OIDP_BASE_URL -export const NATIONAL_ID_OIDP_CLIENT_ID = env.NATIONAL_ID_OIDP_CLIENT_ID -export const NATIONAL_ID_OIDP_ESSENTIAL_CLAIMS = - env.NATIONAL_ID_OIDP_ESSENTIAL_CLAIMS -export const NATIONAL_ID_OIDP_VOLUNTARY_CLAIMS = - env.NATIONAL_ID_OIDP_VOLUNTARY_CLAIMS diff --git a/packages/user-mgnt/src/environment.ts b/packages/user-mgnt/src/environment.ts index 8c9b5c22db2..1d6026efda3 100644 --- a/packages/user-mgnt/src/environment.ts +++ b/packages/user-mgnt/src/environment.ts @@ -24,10 +24,5 @@ export const env = cleanEnv(process.env, { RECORD_SEARCH_QUOTA: num({ default: 2000 }), FHIR_URL: url({ devDefault: 'http://localhost:3447/fhir' }), - METRICS_URL: url({ devDefault: 'http://localhost:1050' }), - - NATIONAL_ID_OIDP_BASE_URL: str({ default: undefined }), - NATIONAL_ID_OIDP_CLIENT_ID: str({ default: undefined }), - NATIONAL_ID_OIDP_ESSENTIAL_CLAIMS: str({ default: undefined }), - NATIONAL_ID_OIDP_VOLUNTARY_CLAIMS: str({ default: undefined }) + METRICS_URL: url({ devDefault: 'http://localhost:1050' }) }) diff --git a/packages/user-mgnt/src/utils/system.ts b/packages/user-mgnt/src/utils/system.ts index 00620af2387..ef3a21084c4 100644 --- a/packages/user-mgnt/src/utils/system.ts +++ b/packages/user-mgnt/src/utils/system.ts @@ -8,12 +8,6 @@ * * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. */ -import { - NATIONAL_ID_OIDP_CLIENT_ID, - NATIONAL_ID_OIDP_BASE_URL, - NATIONAL_ID_OIDP_ESSENTIAL_CLAIMS, - NATIONAL_ID_OIDP_VOLUNTARY_CLAIMS -} from '@user-mgnt/constants' import { ISystemModel } from '@user-mgnt/model/system' import { pick } from 'lodash' import { Types } from 'mongoose' @@ -33,30 +27,12 @@ export const integratingSystemTypes = { type MongooseQueriedSystem = ISystemModel & { _id: Types.ObjectId } const pickSettings = (system: MongooseQueriedSystem) => { - const openIdProviderClaims = convertClaimsToUserInfoClaims({ - openIdProviderEssentialClaims: NATIONAL_ID_OIDP_ESSENTIAL_CLAIMS, - openIdProviderVoluntaryClaims: NATIONAL_ID_OIDP_VOLUNTARY_CLAIMS - }) - - const openIdConnectUrl = - system.type === 'NATIONAL_ID' && - NATIONAL_ID_OIDP_CLIENT_ID && - NATIONAL_ID_OIDP_BASE_URL && - (NATIONAL_ID_OIDP_ESSENTIAL_CLAIMS || NATIONAL_ID_OIDP_VOLUNTARY_CLAIMS) - ? { - openIdProviderBaseUrl: NATIONAL_ID_OIDP_BASE_URL, - openIdProviderClientId: NATIONAL_ID_OIDP_CLIENT_ID, - openIdProviderClaims - } - : {} - const webhook = system.settings.webhook.map((ite) => ({ event: ite.event, permissions: ite.permissions })) return { - ...openIdConnectUrl, webhook, dailyQuota: system.settings.dailyQuota } @@ -80,26 +56,3 @@ export const pickSystem = (system: MongooseQueriedSystem) => { settings: pickSettings(system) } } - -const convertClaimsToUserInfoClaims = ({ - openIdProviderEssentialClaims, - openIdProviderVoluntaryClaims -}: { - openIdProviderEssentialClaims?: string - openIdProviderVoluntaryClaims?: string -}) => { - const userinfo: Record = {} - - for (const claim of (openIdProviderVoluntaryClaims ?? '').split(',')) { - userinfo[claim] = { essential: false } - } - - for (const claim of (openIdProviderEssentialClaims ?? '').split(',')) { - userinfo[claim] = { essential: true } - } - - return JSON.stringify({ - userinfo, - id_token: {} - }) -} From 40c658adb6a11b2c48ee297666699b7cd2651daa Mon Sep 17 00:00:00 2001 From: Jamil Date: Wed, 30 Oct 2024 16:38:08 +0600 Subject: [PATCH 02/50] fix: custom time period in user audit (#7810) * fix: pick last date of a month for dateEnd * Revert "fix: pick last date of a month for dateEnd" This reverts commit 107a03940b41659c7f16014c2e46fe15d05d06d7. * fix: pick last date of a month for endDate * fix: use endOfMonth on onDatesChange() --- packages/client/src/components/DateRangePicker.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/client/src/components/DateRangePicker.tsx b/packages/client/src/components/DateRangePicker.tsx index 13db36cc971..22ea5323f25 100644 --- a/packages/client/src/components/DateRangePicker.tsx +++ b/packages/client/src/components/DateRangePicker.tsx @@ -38,6 +38,7 @@ import subMonths from 'date-fns/subMonths' import subYears from 'date-fns/subYears' import * as React from 'react' import { WrappedComponentProps, injectIntl } from 'react-intl' +import endOfMonth from 'date-fns/endOfMonth' const { useState, useEffect, useMemo } = React @@ -641,7 +642,7 @@ function DateRangePickerComponent(props: IDateRangePickerProps) { onSelectDate={(date) => { props.onDatesChange({ startDate: startDate, - endDate: endOfDay(date) + endDate: endOfDay(endOfMonth(date)) }) setModalVisible(false) props.closeModalFromHOC && props.closeModalFromHOC() @@ -731,7 +732,7 @@ function DateRangePickerComponent(props: IDateRangePickerProps) { onClick={() => { props.onDatesChange({ startDate: startDate, - endDate: endOfDay(endDate) + endDate: endOfDay(endOfMonth(endDate)) }) setModalVisible(false) props.closeModalFromHOC && props.closeModalFromHOC() From 02b2eeed0b485b86c3477f81a94849cdb483d0a7 Mon Sep 17 00:00:00 2001 From: Tameem Bin Haider Date: Wed, 30 Oct 2024 17:38:30 +0600 Subject: [PATCH 03/50] fix: return first child "location" from query (#7789) * fix: return first child "location" from query The query only needs to consider the locations under the given parent & not the offices/addresses. The country level query also needed to be separately handled. * chore: include _count param to get all locations * feat: define isLeafLevelLocation query in client * refactor: use the new isLeafLevelLocation query * feat: create isLeafLevelLocation query * fix: prevent disabled filter from being selected * test: update mocks to use new query * test: add tests for isLeafLevelLocation query * chore!: remove hasChildLocation query * docs: add entry about the deleted & new query * fix: extract type from available query type --------- Co-authored-by: Riku Rouvila --- CHANGELOG.md | 4 +- packages/client/graphql.schema.json | 14 +- packages/client/src/tests/schema.graphql | 1 - .../utils/gateway-deprecated-do-not-use.d.ts | 2 - packages/client/src/utils/gateway.ts | 163 +++---- .../views/Performance/RegistrationsList.tsx | 18 +- .../Performance/CompletenessRates.test.tsx | 54 +-- .../Performance/CompletenessRates.tsx | 297 ++++++------ .../src/views/SysAdmin/Performance/queries.ts | 13 +- .../features/location/root-resolvers.test.ts | 35 +- .../src/features/location/root-resolvers.ts | 35 +- .../src/features/location/schema.graphql | 2 +- packages/gateway/src/graphql/schema.d.ts | 437 +++++++++--------- packages/gateway/src/graphql/schema.graphql | 50 +- packages/gateway/src/location.ts | 20 +- packages/gateway/src/rate-limit.test.ts | 13 +- 16 files changed, 595 insertions(+), 563 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c82080a1f49..502c692e3e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -62,8 +62,8 @@ - Remove informant notification configuration from the UI and read notification configuration settings from `record-notification` endpoint in countryconfig - **Gateways searchEvents API updated** `operationHistories` only returns `operationType` & `operatedOn` due to the other fields being unused in OpenCRVS -- **Config changes to review/preview and signatures** Core used to provide review/preview section by default which are now removed and need to be provided from countryconfig. The signature field definitions (e.g. informant signature, bride signature etc.) were hard coded in core which also have now been removed. The signatures can now be added through the review/preview sections defined in countryconfig just like any other field. You can use the following section definition as the default which is without any additional fields. We highly recommend checking out our reference country repository which has the signature fields in it's review/preview sections - +- **Config changes to review/preview and signatures** Core used to provide review/preview section by default which are now removed and need to be provided from countryconfig. The signature field definitions (e.g. informant signature, bride signature etc.) were hard coded in core which also have now been removed. The signatures can now be added through the review/preview sections defined in countryconfig just like any other field. You can use the following section definition as the default which is without any additional fields. We highly recommend checking out our reference country repository which has the signature fields in its review/preview sections +- `hasChildLocation` query has been removed from gateway. We have created the query `isLeafLevelLocation` instead which is more descriptive on its intended use. ``` { id: 'preview', diff --git a/packages/client/graphql.schema.json b/packages/client/graphql.schema.json index 0e734fdd950..ea6a1e8c74d 100644 --- a/packages/client/graphql.schema.json +++ b/packages/client/graphql.schema.json @@ -13607,11 +13607,11 @@ "deprecationReason": null }, { - "name": "hasChildLocation", + "name": "isLeafLevelLocation", "description": null, "args": [ { - "name": "parentId", + "name": "locationId", "description": null, "type": { "kind": "NON_NULL", @@ -13628,9 +13628,13 @@ } ], "type": { - "kind": "OBJECT", - "name": "Location", - "ofType": null + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } }, "isDeprecated": false, "deprecationReason": null diff --git a/packages/client/src/tests/schema.graphql b/packages/client/src/tests/schema.graphql index eef8e51b9c2..351d3bee0c9 100644 --- a/packages/client/src/tests/schema.graphql +++ b/packages/client/src/tests/schema.graphql @@ -1305,7 +1305,6 @@ type Query { ): RegistrationCountResult fetchMarriageRegistration(id: ID!): MarriageRegistration fetchRecordDetailsForVerification(id: String!): RecordDetails - hasChildLocation(parentId: String!): Location getUser(userId: String): User getUserByMobile(mobile: String): User getUserByEmail(email: String): User diff --git a/packages/client/src/utils/gateway-deprecated-do-not-use.d.ts b/packages/client/src/utils/gateway-deprecated-do-not-use.d.ts index db4c85123ac..65ba841ca1e 100644 --- a/packages/client/src/utils/gateway-deprecated-do-not-use.d.ts +++ b/packages/client/src/utils/gateway-deprecated-do-not-use.d.ts @@ -38,7 +38,6 @@ export interface GQLQuery { fetchRecordDetailsForVerification?: GQLRecordDetails locationsByParent?: Array locationById?: GQLLocation - hasChildLocation?: GQLLocation getUser?: GQLUser getUserByMobile?: GQLUser getUserByEmail?: GQLUser @@ -2053,7 +2052,6 @@ export interface GQLQueryTypeResolver { fetchRecordDetailsForVerification?: QueryToFetchRecordDetailsForVerificationResolver locationsByParent?: QueryToLocationsByParentResolver locationById?: QueryToLocationByIdResolver - hasChildLocation?: QueryToHasChildLocationResolver getUser?: QueryToGetUserResolver getUserByMobile?: QueryToGetUserByMobileResolver getUserByEmail?: QueryToGetUserByEmailResolver diff --git a/packages/client/src/utils/gateway.ts b/packages/client/src/utils/gateway.ts index 3c50650dab7..346bcd017b6 100644 --- a/packages/client/src/utils/gateway.ts +++ b/packages/client/src/utils/gateway.ts @@ -1379,7 +1379,7 @@ export type Query = { getUserByEmail?: Maybe getUserByMobile?: Maybe getVSExports?: Maybe - hasChildLocation?: Maybe + isLeafLevelLocation: Scalars['Boolean'] listBirthRegistrations?: Maybe queryPersonByIdentifier?: Maybe queryPersonByNidIdentifier?: Maybe @@ -1531,8 +1531,8 @@ export type QueryGetUserByMobileArgs = { mobile?: InputMaybe } -export type QueryHasChildLocationArgs = { - parentId: Scalars['String'] +export type QueryIsLeafLevelLocationArgs = { + locationId: Scalars['String'] } export type QueryListBirthRegistrationsArgs = { @@ -7215,22 +7215,13 @@ export type GetLocationStatisticsQuery = { } | null } -export type HasChildLocationQueryVariables = Exact<{ - parentId: Scalars['String'] +export type IsLeafLevelLocationQueryVariables = Exact<{ + locationId: Scalars['String'] }> -export type HasChildLocationQuery = { +export type IsLeafLevelLocationQuery = { __typename?: 'Query' - hasChildLocation?: { - __typename?: 'Location' - id: string - type?: string | null - identifier?: Array<{ - __typename?: 'Identifier' - system?: string | null - value?: string | null - }> | null - } | null + isLeafLevelLocation: boolean } export type FetchMonthWiseEventMetricsQueryVariables = Exact<{ @@ -7359,82 +7350,76 @@ export type GetRegistrationsListByFilterQueryVariables = Exact<{ size: Scalars['Int'] }> -export type RegistrationsListByLocationFilter = { - __typename: 'TotalMetricsByLocation' - total?: number | null - results: Array<{ - __typename?: 'EventMetricsByLocation' - total: number - late: number - delayed: number - home: number - healthFacility: number - location: { __typename?: 'Location'; name?: string | null } - }> -} - -export type RegistrationsListByRegistrarFilter = { - __typename: 'TotalMetricsByRegistrar' - total?: number | null - results: Array<{ - __typename?: 'EventMetricsByRegistrar' - total: number - late: number - delayed: number - registrarPractitioner?: { - __typename?: 'User' - id: string - systemRole: SystemRoleType - role: { - __typename?: 'Role' - _id: string - labels: Array<{ - __typename?: 'RoleLabel' - lang: string - label: string - }> - } - primaryOffice?: { - __typename?: 'Location' - name?: string | null - id: string - } | null - name: Array<{ - __typename?: 'HumanName' - firstNames?: string | null - familyName?: string | null - use?: string | null - }> - avatar?: { - __typename?: 'Avatar' - type: string - data: string - } | null - } | null - }> -} - -export type RegistrationsListByTimeFilter = { - __typename: 'TotalMetricsByTime' - total?: number | null - results: Array<{ - __typename?: 'EventMetricsByTime' - total: number - delayed: number - late: number - home: number - healthFacility: number - month: string - time: string - }> -} - export type GetRegistrationsListByFilterQuery = { __typename?: 'Query' getRegistrationsListByFilter?: - | RegistrationsListByLocationFilter - | RegistrationsListByRegistrarFilter - | RegistrationsListByTimeFilter + | { + __typename: 'TotalMetricsByLocation' + total?: number | null + results: Array<{ + __typename?: 'EventMetricsByLocation' + total: number + late: number + delayed: number + home: number + healthFacility: number + location: { __typename?: 'Location'; name?: string | null } + }> + } + | { + __typename: 'TotalMetricsByRegistrar' + total?: number | null + results: Array<{ + __typename?: 'EventMetricsByRegistrar' + total: number + late: number + delayed: number + registrarPractitioner?: { + __typename?: 'User' + id: string + systemRole: SystemRoleType + role: { + __typename?: 'Role' + _id: string + labels: Array<{ + __typename?: 'RoleLabel' + lang: string + label: string + }> + } + primaryOffice?: { + __typename?: 'Location' + name?: string | null + id: string + } | null + name: Array<{ + __typename?: 'HumanName' + firstNames?: string | null + familyName?: string | null + use?: string | null + }> + avatar?: { + __typename?: 'Avatar' + type: string + data: string + } | null + } | null + }> + } + | { + __typename: 'TotalMetricsByTime' + total?: number | null + results: Array<{ + __typename?: 'EventMetricsByTime' + total: number + delayed: number + late: number + home: number + healthFacility: number + month: string + time: string + }> + } | null } diff --git a/packages/client/src/views/Performance/RegistrationsList.tsx b/packages/client/src/views/Performance/RegistrationsList.tsx index 943cf5d868a..9c48497965a 100644 --- a/packages/client/src/views/Performance/RegistrationsList.tsx +++ b/packages/client/src/views/Performance/RegistrationsList.tsx @@ -30,9 +30,6 @@ import { IStoreState } from '@client/store' import { GetRegistrationsListByFilterQuery, QueryGetRegistrationsListByFilterArgs, - RegistrationsListByLocationFilter, - RegistrationsListByRegistrarFilter, - RegistrationsListByTimeFilter, RegistrationType } from '@client/utils/gateway' import { generateLocations } from '@client/utils/locationUtils' @@ -398,7 +395,10 @@ function RegistrationListComponent(props: IProps) { } const getTableContentByRegistrar = ( - result: RegistrationsListByRegistrarFilter['results'][0], + result: Extract< + GetRegistrationsListByFilterQuery['getRegistrationsListByFilter'], + { __typename: 'TotalMetricsByRegistrar' } + >['results'][0], index: number ) => ({ ...result, @@ -463,7 +463,10 @@ function RegistrationListComponent(props: IProps) { }) const getTableContentByLocation = ( - result: RegistrationsListByLocationFilter['results'][0], + result: Extract< + GetRegistrationsListByFilterQuery['getRegistrationsListByFilter'], + { __typename: 'TotalMetricsByLocation' } + >['results'][0], index: number ) => ({ ...result, @@ -485,7 +488,10 @@ function RegistrationListComponent(props: IProps) { }) const getTableContentByTime = ( - result: RegistrationsListByTimeFilter['results'][0], + result: Extract< + GetRegistrationsListByFilterQuery['getRegistrationsListByFilter'], + { __typename: 'TotalMetricsByTime' } + >['results'][0], index: number ) => { return { diff --git a/packages/client/src/views/SysAdmin/Performance/CompletenessRates.test.tsx b/packages/client/src/views/SysAdmin/Performance/CompletenessRates.test.tsx index 4576df441e7..989630c1c97 100644 --- a/packages/client/src/views/SysAdmin/Performance/CompletenessRates.test.tsx +++ b/packages/client/src/views/SysAdmin/Performance/CompletenessRates.test.tsx @@ -17,8 +17,8 @@ import { AppStore } from '@client/store' import { CompletenessRates } from '@client/views/SysAdmin/Performance/CompletenessRates' import { EVENT_COMPLETENESS_RATES } from '@client/navigation/routes' import { - HAS_CHILD_LOCATION, - FETCH_MONTH_WISE_EVENT_ESTIMATIONS + FETCH_MONTH_WISE_EVENT_ESTIMATIONS, + IS_LEAF_LEVEL_LOCATION } from '@client/views/SysAdmin/Performance/queries' import { waitForElement } from '@client/tests/wait-for-element' import { stringify, parse } from 'query-string' @@ -37,33 +37,12 @@ describe('Registraion Rates tests', () => { const graphqlMocks = [ { request: { - query: HAS_CHILD_LOCATION, + query: IS_LEAF_LEVEL_LOCATION, variables: { parentId: '6e1f3bce-7bcb-4bf6-8e35-0d9facdf158b' } }, result: { data: { - hasChildLocation: { - id: 'd70fbec1-2b26-474b-adbc-bb83783bdf29', - type: 'ADMIN_STRUCTURE', - identifier: [ - { - system: 'http://opencrvs.org/specs/id/geo-id', - value: '4194' - }, - { - system: 'http://opencrvs.org/specs/id/bbs-code', - value: '11' - }, - { - system: 'http://opencrvs.org/specs/id/jurisdiction-type', - value: 'UNION' - }, - { - system: 'http://opencrvs.org/specs/id/a2i-internal-reference', - value: 'division=9&district=30&upazila=233&union=4194' - } - ] - } + isLeafLevelLocation: true } } }, @@ -233,33 +212,12 @@ describe('Registraion Rates error state tests', () => { const graphqlMocks = [ { request: { - query: HAS_CHILD_LOCATION, + query: IS_LEAF_LEVEL_LOCATION, variables: { parentId: '6e1f3bce-7bcb-4bf6-8e35-0d9facdf158b' } }, result: { data: { - hasChildLocation: { - id: 'd70fbec1-2b26-474b-adbc-bb83783bdf29', - type: 'ADMIN_STRUCTURE', - identifier: [ - { - system: 'http://opencrvs.org/specs/id/geo-id', - value: '4194' - }, - { - system: 'http://opencrvs.org/specs/id/bbs-code', - value: '11' - }, - { - system: 'http://opencrvs.org/specs/id/jurisdiction-type', - value: 'UNION' - }, - { - system: 'http://opencrvs.org/specs/id/a2i-internal-reference', - value: 'division=9&district=30&upazila=233&union=4194' - } - ] - } + isLeafLevelLocation: true } } }, diff --git a/packages/client/src/views/SysAdmin/Performance/CompletenessRates.tsx b/packages/client/src/views/SysAdmin/Performance/CompletenessRates.tsx index e8aba47901e..3ba146ab060 100644 --- a/packages/client/src/views/SysAdmin/Performance/CompletenessRates.tsx +++ b/packages/client/src/views/SysAdmin/Performance/CompletenessRates.tsx @@ -13,12 +13,15 @@ import { DateRangePicker } from '@client/components/DateRangePicker' import { GenericErrorToast } from '@client/components/GenericErrorToast' import { LocationPicker } from '@client/components/LocationPicker' import { Query } from '@client/components/Query' -import { Event } from '@client/utils/gateway' +import { + Event, + IsLeafLevelLocationQuery, + QueryIsLeafLevelLocationArgs +} from '@client/utils/gateway' import { messages } from '@client/i18n/messages/views/performance' import { goToCompletenessRates } from '@client/navigation' import { - getJurisidictionType, CompletenessRateTime, getAdditionalLocations, NATIONAL_ADMINISTRATIVE_LEVEL @@ -27,8 +30,8 @@ import { SysAdminContentWrapper } from '@client/views/SysAdmin/SysAdminContentWr import type { GQLMonthWiseEstimationMetric } from '@client/utils/gateway-deprecated-do-not-use' import { parse } from 'query-string' import * as React from 'react' -import { injectIntl, WrappedComponentProps } from 'react-intl' -import { connect } from 'react-redux' +import { injectIntl, useIntl, WrappedComponentProps } from 'react-intl' +import { connect, useDispatch } from 'react-redux' import { RouteComponentProps } from 'react-router' import { IPerformanceSelectOption, @@ -37,14 +40,14 @@ import { import { FETCH_LOCATION_WISE_EVENT_ESTIMATIONS, FETCH_MONTH_WISE_EVENT_ESTIMATIONS, - HAS_CHILD_LOCATION + IS_LEAF_LEVEL_LOCATION } from './queries' import { CompletenessDataTable } from './reports/completenessRates/CompletenessDataTable' -import { useCallback } from 'react' import { Content, ContentSize } from '@opencrvs/components/lib/Content' import { navigationMessages } from '@client/i18n/messages/views/navigation' import format from '@client/utils/date-formatting' import { SegmentedControl } from '@client/components/SegmentedControl' +import { useQuery } from '@apollo/client' const { useState } = React export enum COMPLETENESS_RATE_REPORT_BASE { @@ -53,7 +56,7 @@ export enum COMPLETENESS_RATE_REPORT_BASE { } interface ISearchParams { - locationId: string + locationId?: string timeStart: string timeEnd: string time: CompletenessRateTime @@ -77,7 +80,7 @@ function prepareChartData( return ( data && data.reduce( - (chartData: any[], dataDetails: GQLMonthWiseEstimationMetric, index) => { + (chartData: any[], dataDetails: GQLMonthWiseEstimationMetric) => { if (dataDetails !== null) { chartData.push({ label: @@ -102,6 +105,138 @@ function prepareChartData( ) } +function Filter({ + locationId, + event, + dateStart, + dateEnd, + base, + time, + onBaseChange +}: { + locationId: string + event: Event + dateStart: Date + dateEnd: Date + base: COMPLETENESS_RATE_REPORT_BASE + time: CompletenessRateTime + onBaseChange: (base: COMPLETENESS_RATE_REPORT_BASE) => void +}) { + const intl = useIntl() + const { data } = useQuery< + IsLeafLevelLocationQuery, + QueryIsLeafLevelLocationArgs + >(IS_LEAF_LEVEL_LOCATION, { + variables: { + locationId: + locationId === NATIONAL_ADMINISTRATIVE_LEVEL ? '0' : locationId + } + }) + const dispatch = useDispatch() + + if ( + data?.isLeafLevelLocation === true && + base === COMPLETENESS_RATE_REPORT_BASE.LOCATION + ) { + onBaseChange(COMPLETENESS_RATE_REPORT_BASE.TIME) + } + + const options: (IPerformanceSelectOption & { disabled?: boolean })[] = [ + { + label: intl.formatMessage(messages.overTime), + value: COMPLETENESS_RATE_REPORT_BASE.TIME + }, + { + label: intl.formatMessage(messages.byLocation), + value: COMPLETENESS_RATE_REPORT_BASE.LOCATION, + disabled: data?.isLeafLevelLocation ?? true + } + ] + + return ( + <> + + onBaseChange(option.value as COMPLETENESS_RATE_REPORT_BASE) + } + /> + { + dispatch( + goToCompletenessRates( + event, + newLocationId, + dateStart, + dateEnd, + time + ) + ) + }} + /> + { + startDate.setDate(startDate.getDate() + 1) + dispatch( + goToCompletenessRates( + event, + locationId as string, + startDate, + endDate, + time + ) + ) + }} + /> + + dispatch( + goToCompletenessRates( + event, + locationId, + dateStart, + dateEnd, + option.value as CompletenessRateTime + ) + ) + } + id="completenessRateTimeSelect" + withLightTheme={true} + value={time} + options={[ + { + label: intl.formatMessage( + messages.performanceWithinTargetDaysLabel, + { + target: + window.config[event.toUpperCase() as Uppercase] + .REGISTRATION_TARGET, + withPrefix: false + } + ), + value: CompletenessRateTime.WithinTarget + }, + { + label: intl.formatMessage(messages.performanceWithin1YearLabel), + value: CompletenessRateTime.Within1Year + }, + { + label: intl.formatMessage(messages.performanceWithin5YearsLabel), + value: CompletenessRateTime.Within5Years + } + ]} + /> + + ) +} + function CompletenessRatesComponent(props: ICompletenessRateProps) { const [base, setBase] = useState({ baseType: COMPLETENESS_RATE_REPORT_BASE.TIME @@ -118,138 +253,8 @@ function CompletenessRatesComponent(props: ICompletenessRateProps) { search ) as unknown as ISearchParams - const getFilter = useCallback(() => { - const dateStart = new Date(timeStart) - const dateEnd = new Date(timeEnd) - return ( - { - const childJurisdictionType = getJurisidictionType(hasChildLocation) - if ( - !childJurisdictionType && - base.baseType === COMPLETENESS_RATE_REPORT_BASE.LOCATION - ) { - setBase({ baseType: COMPLETENESS_RATE_REPORT_BASE.TIME }) - } - }} - > - {({ data, loading, error }) => { - const childJurisdictionType = - data && - data.hasChildLocation && - getJurisidictionType(data.hasChildLocation) - - const options: (IPerformanceSelectOption & { disabled?: boolean })[] = - [ - { - label: intl.formatMessage(messages.overTime), - value: COMPLETENESS_RATE_REPORT_BASE.TIME - }, - { - label: intl.formatMessage(messages.byLocation, { - childJurisdictionType - }), - value: COMPLETENESS_RATE_REPORT_BASE.LOCATION, - type: childJurisdictionType || '', - disabled: !childJurisdictionType - } - ] - - return ( - <> - - setBase({ - baseType: option.value as COMPLETENESS_RATE_REPORT_BASE, - locationJurisdictionType: option.type - }) - } - /> - { - props.goToCompletenessRates( - eventType as Event, - newLocationId, - dateStart, - dateEnd, - time - ) - }} - /> - { - startDate.setDate(startDate.getDate() + 1) - props.goToCompletenessRates( - eventType as Event, - locationId as string, - startDate, - endDate, - time - ) - }} - /> - - props.goToCompletenessRates( - eventType as Event, - locationId, - dateStart, - dateEnd, - option.value as CompletenessRateTime - ) - } - id="completenessRateTimeSelect" - withLightTheme={true} - value={time} - options={[ - { - label: intl.formatMessage( - messages.performanceWithinTargetDaysLabel, - { - target: - window.config[ - (eventType.toUpperCase() as 'BIRTH') || 'DEATH' - ].REGISTRATION_TARGET, - withPrefix: false - } - ), - value: CompletenessRateTime.WithinTarget - }, - { - label: intl.formatMessage( - messages.performanceWithin1YearLabel - ), - value: CompletenessRateTime.Within1Year - }, - { - label: intl.formatMessage( - messages.performanceWithin5YearsLabel - ), - value: CompletenessRateTime.Within5Years - } - ]} - /> - - ) - }} - - ) - }, [base, props, timeStart, timeEnd, eventType, intl, locationId, time]) + const dateStart = new Date(timeStart) + const dateEnd = new Date(timeEnd) return ( setBase({ baseType: base })} + /> + } > { - describe('hasChildLocation()', () => { - it('returns a location object if found', async () => { - fetch.mockResponseOnce(JSON.stringify([{ id: 'woohoo' }])) + describe('isLeafLevelLocation', () => { + it('returns false if a location has administrative locations as its children', async () => { + fetch.mockResponseOnce( + JSON.stringify([ + savedAdministrativeLocation({ partOf: { reference: 'Location/1' } }) + ]) + ) // @ts-ignore - const composition = await resolvers.Query!.hasChildLocation( + const isLeafLevelLocation = await resolvers.Query!.isLeafLevelLocation( {}, - { parentId: '1' }, + { locationId: '1' }, { headers: undefined } ) + expect(isLeafLevelLocation).toBe(false) + }) - expect(composition).toBeDefined() + it('returns true if a location has no administrative locations as its children', async () => { + fetch.mockResponseOnce( + JSON.stringify([ + savedLocation({ partOf: { reference: 'Location/1' } }), + savedAdministrativeLocation({ partOf: { reference: 'Location/2' } }) + ]) + ) + // @ts-ignore + const isLeafLevelLocation = await resolvers.Query!.isLeafLevelLocation( + {}, + { locationId: '1' }, + { headers: undefined } + ) + expect(isLeafLevelLocation).toBe(true) }) }) }) diff --git a/packages/gateway/src/features/location/root-resolvers.ts b/packages/gateway/src/features/location/root-resolvers.ts index 34cd38d95b7..64b6cb3c13b 100644 --- a/packages/gateway/src/features/location/root-resolvers.ts +++ b/packages/gateway/src/features/location/root-resolvers.ts @@ -9,16 +9,41 @@ * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. */ +import { + resourceIdentifierToUUID, + SavedLocation +} from '@opencrvs/commons/types' import { GQLResolver } from '@gateway/graphql/schema' -import { fetchLocationChildren } from '@gateway/location' +import { fetchAllLocations, fetchLocationChildren } from '@gateway/location' import { UUID } from '@opencrvs/commons' export const resolvers: GQLResolver = { Query: { - async hasChildLocation(_, { parentId }, { headers: authHeader }) { - const children = await fetchLocationChildren(parentId as UUID) - const [childLocation] = children - return childLocation + async isLeafLevelLocation(_, { locationId }) { + let children: SavedLocation[] + /* + * This is because of a tech debt we have that + * there is no location resource created for the + * country so we have a bunch of places where we + * need to manually check if the id equals '0' + */ + if (locationId === '0') { + children = await fetchAllLocations() + } else { + children = await fetchLocationChildren(locationId as UUID) + } + /* + * We want to consider only the admin structure locations + * here & not the offices or addresses that might have the + * given location as a parent + */ + const administrativeChildLocation = children.filter( + (child) => + child.type?.coding?.some(({ code }) => code === 'ADMIN_STRUCTURE') && + child.partOf && + resourceIdentifierToUUID(child.partOf.reference) === locationId + ) + return administrativeChildLocation.length == 0 } } } diff --git a/packages/gateway/src/features/location/schema.graphql b/packages/gateway/src/features/location/schema.graphql index db6e0e46e5f..3491f2ec784 100644 --- a/packages/gateway/src/features/location/schema.graphql +++ b/packages/gateway/src/features/location/schema.graphql @@ -43,5 +43,5 @@ type Location { # -> Location (mostly the same property name except:) } type Query { - hasChildLocation(parentId: String!): Location + isLeafLevelLocation(locationId: String!): Boolean! } diff --git a/packages/gateway/src/graphql/schema.d.ts b/packages/gateway/src/graphql/schema.d.ts index 6807e1a9b80..31096478dd8 100644 --- a/packages/gateway/src/graphql/schema.d.ts +++ b/packages/gateway/src/graphql/schema.d.ts @@ -28,7 +28,7 @@ export interface GQLQuery { fetchRegistrationCountByStatus?: GQLRegistrationCountResult fetchMarriageRegistration?: GQLMarriageRegistration fetchRecordDetailsForVerification?: GQLRecordDetails - hasChildLocation?: GQLLocation + isLeafLevelLocation: boolean getUser?: GQLUser getUserByMobile?: GQLUser getUserByEmail?: GQLUser @@ -252,25 +252,6 @@ export interface GQLRecordDetailsNameMap { DeathRegistration: GQLDeathRegistration } -export interface GQLLocation { - id: string - _fhirID?: string - identifier?: Array - status?: string - name?: string - alias?: Array - description?: string - partOf?: string - type?: string - telecom?: Array - address?: GQLAddress - longitude?: number - latitude?: number - altitude?: number - geoData?: string - hierarchy?: Array -} - export interface GQLUser { id: string userMgntUserID: string @@ -729,6 +710,25 @@ export interface GQLRelatedPerson { exactDateOfBirthUnknown?: boolean } +export interface GQLLocation { + id: string + _fhirID?: string + identifier?: Array + status?: string + name?: string + alias?: Array + description?: string + partOf?: string + type?: string + telecom?: Array + address?: GQLAddress + longitude?: number + latitude?: number + altitude?: number + geoData?: string + hierarchy?: Array +} + export interface GQLQuestionnaireQuestion { fieldId?: string value?: string @@ -835,11 +835,6 @@ export interface GQLStatusWiseRegistrationCount { count: number } -export interface GQLIdentifier { - system?: string - value?: string -} - export const enum GQLSystemRoleType { FIELD_AGENT = 'FIELD_AGENT', REGISTRATION_AGENT = 'REGISTRATION_AGENT', @@ -868,6 +863,11 @@ export interface GQLLocalRegistrar { signature?: GQLSignature } +export interface GQLIdentifier { + system?: string + value?: string +} + export interface GQLSignature { data?: string type?: string @@ -1684,7 +1684,6 @@ export interface GQLResolver { __resolveType: GQLRecordDetailsTypeResolver } - Location?: GQLLocationTypeResolver User?: GQLUserTypeResolver SearchUserResult?: GQLSearchUserResultTypeResolver SearchFieldAgentResult?: GQLSearchFieldAgentResultTypeResolver @@ -1716,6 +1715,7 @@ export interface GQLResolver { Map?: GraphQLScalarType Registration?: GQLRegistrationTypeResolver RelatedPerson?: GQLRelatedPersonTypeResolver + Location?: GQLLocationTypeResolver QuestionnaireQuestion?: GQLQuestionnaireQuestionTypeResolver History?: GQLHistoryTypeResolver MedicalPractitioner?: GQLMedicalPractitionerTypeResolver @@ -1727,9 +1727,9 @@ export interface GQLResolver { Attachment?: GQLAttachmentTypeResolver Deceased?: GQLDeceasedTypeResolver StatusWiseRegistrationCount?: GQLStatusWiseRegistrationCountTypeResolver - Identifier?: GQLIdentifierTypeResolver Role?: GQLRoleTypeResolver LocalRegistrar?: GQLLocalRegistrarTypeResolver + Identifier?: GQLIdentifierTypeResolver Signature?: GQLSignatureTypeResolver BookmarkedSeachItem?: GQLBookmarkedSeachItemTypeResolver SearchFieldAgentResponse?: GQLSearchFieldAgentResponseTypeResolver @@ -1795,7 +1795,7 @@ export interface GQLQueryTypeResolver { fetchRegistrationCountByStatus?: QueryToFetchRegistrationCountByStatusResolver fetchMarriageRegistration?: QueryToFetchMarriageRegistrationResolver fetchRecordDetailsForVerification?: QueryToFetchRecordDetailsForVerificationResolver - hasChildLocation?: QueryToHasChildLocationResolver + isLeafLevelLocation?: QueryToIsLeafLevelLocationResolver getUser?: QueryToGetUserResolver getUserByMobile?: QueryToGetUserByMobileResolver getUserByEmail?: QueryToGetUserByEmailResolver @@ -2059,13 +2059,16 @@ export interface QueryToFetchRecordDetailsForVerificationResolver< ): TResult } -export interface QueryToHasChildLocationArgs { - parentId: string +export interface QueryToIsLeafLevelLocationArgs { + locationId: string } -export interface QueryToHasChildLocationResolver { +export interface QueryToIsLeafLevelLocationResolver< + TParent = any, + TResult = any +> { ( parent: TParent, - args: QueryToHasChildLocationArgs, + args: QueryToIsLeafLevelLocationArgs, context: Context, info: GraphQLResolveInfo ): TResult @@ -4303,169 +4306,6 @@ export interface GQLRecordDetailsTypeResolver { | 'DeathRegistration' | Promise<'BirthRegistration' | 'DeathRegistration'> } -export interface GQLLocationTypeResolver { - id?: LocationToIdResolver - _fhirID?: LocationTo_fhirIDResolver - identifier?: LocationToIdentifierResolver - status?: LocationToStatusResolver - name?: LocationToNameResolver - alias?: LocationToAliasResolver - description?: LocationToDescriptionResolver - partOf?: LocationToPartOfResolver - type?: LocationToTypeResolver - telecom?: LocationToTelecomResolver - address?: LocationToAddressResolver - longitude?: LocationToLongitudeResolver - latitude?: LocationToLatitudeResolver - altitude?: LocationToAltitudeResolver - geoData?: LocationToGeoDataResolver - hierarchy?: LocationToHierarchyResolver -} - -export interface LocationToIdResolver { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - -export interface LocationTo_fhirIDResolver { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - -export interface LocationToIdentifierResolver { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - -export interface LocationToStatusResolver { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - -export interface LocationToNameResolver { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - -export interface LocationToAliasResolver { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - -export interface LocationToDescriptionResolver { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - -export interface LocationToPartOfResolver { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - -export interface LocationToTypeResolver { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - -export interface LocationToTelecomResolver { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - -export interface LocationToAddressResolver { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - -export interface LocationToLongitudeResolver { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - -export interface LocationToLatitudeResolver { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - -export interface LocationToAltitudeResolver { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - -export interface LocationToGeoDataResolver { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - -export interface LocationToHierarchyResolver { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - export interface GQLUserTypeResolver { id?: UserToIdResolver userMgntUserID?: UserToUserMgntUserIDResolver @@ -6184,6 +6024,169 @@ export interface RelatedPersonToExactDateOfBirthUnknownResolver< ): TResult } +export interface GQLLocationTypeResolver { + id?: LocationToIdResolver + _fhirID?: LocationTo_fhirIDResolver + identifier?: LocationToIdentifierResolver + status?: LocationToStatusResolver + name?: LocationToNameResolver + alias?: LocationToAliasResolver + description?: LocationToDescriptionResolver + partOf?: LocationToPartOfResolver + type?: LocationToTypeResolver + telecom?: LocationToTelecomResolver + address?: LocationToAddressResolver + longitude?: LocationToLongitudeResolver + latitude?: LocationToLatitudeResolver + altitude?: LocationToAltitudeResolver + geoData?: LocationToGeoDataResolver + hierarchy?: LocationToHierarchyResolver +} + +export interface LocationToIdResolver { + ( + parent: TParent, + args: {}, + context: Context, + info: GraphQLResolveInfo + ): TResult +} + +export interface LocationTo_fhirIDResolver { + ( + parent: TParent, + args: {}, + context: Context, + info: GraphQLResolveInfo + ): TResult +} + +export interface LocationToIdentifierResolver { + ( + parent: TParent, + args: {}, + context: Context, + info: GraphQLResolveInfo + ): TResult +} + +export interface LocationToStatusResolver { + ( + parent: TParent, + args: {}, + context: Context, + info: GraphQLResolveInfo + ): TResult +} + +export interface LocationToNameResolver { + ( + parent: TParent, + args: {}, + context: Context, + info: GraphQLResolveInfo + ): TResult +} + +export interface LocationToAliasResolver { + ( + parent: TParent, + args: {}, + context: Context, + info: GraphQLResolveInfo + ): TResult +} + +export interface LocationToDescriptionResolver { + ( + parent: TParent, + args: {}, + context: Context, + info: GraphQLResolveInfo + ): TResult +} + +export interface LocationToPartOfResolver { + ( + parent: TParent, + args: {}, + context: Context, + info: GraphQLResolveInfo + ): TResult +} + +export interface LocationToTypeResolver { + ( + parent: TParent, + args: {}, + context: Context, + info: GraphQLResolveInfo + ): TResult +} + +export interface LocationToTelecomResolver { + ( + parent: TParent, + args: {}, + context: Context, + info: GraphQLResolveInfo + ): TResult +} + +export interface LocationToAddressResolver { + ( + parent: TParent, + args: {}, + context: Context, + info: GraphQLResolveInfo + ): TResult +} + +export interface LocationToLongitudeResolver { + ( + parent: TParent, + args: {}, + context: Context, + info: GraphQLResolveInfo + ): TResult +} + +export interface LocationToLatitudeResolver { + ( + parent: TParent, + args: {}, + context: Context, + info: GraphQLResolveInfo + ): TResult +} + +export interface LocationToAltitudeResolver { + ( + parent: TParent, + args: {}, + context: Context, + info: GraphQLResolveInfo + ): TResult +} + +export interface LocationToGeoDataResolver { + ( + parent: TParent, + args: {}, + context: Context, + info: GraphQLResolveInfo + ): TResult +} + +export interface LocationToHierarchyResolver { + ( + parent: TParent, + args: {}, + context: Context, + info: GraphQLResolveInfo + ): TResult +} + export interface GQLQuestionnaireQuestionTypeResolver { fieldId?: QuestionnaireQuestionToFieldIdResolver value?: QuestionnaireQuestionToValueResolver @@ -6999,12 +7002,12 @@ export interface StatusWiseRegistrationCountToCountResolver< ): TResult } -export interface GQLIdentifierTypeResolver { - system?: IdentifierToSystemResolver - value?: IdentifierToValueResolver +export interface GQLRoleTypeResolver { + _id?: RoleTo_idResolver + labels?: RoleToLabelsResolver } -export interface IdentifierToSystemResolver { +export interface RoleTo_idResolver { ( parent: TParent, args: {}, @@ -7013,7 +7016,7 @@ export interface IdentifierToSystemResolver { ): TResult } -export interface IdentifierToValueResolver { +export interface RoleToLabelsResolver { ( parent: TParent, args: {}, @@ -7022,12 +7025,13 @@ export interface IdentifierToValueResolver { ): TResult } -export interface GQLRoleTypeResolver { - _id?: RoleTo_idResolver - labels?: RoleToLabelsResolver +export interface GQLLocalRegistrarTypeResolver { + name?: LocalRegistrarToNameResolver + role?: LocalRegistrarToRoleResolver + signature?: LocalRegistrarToSignatureResolver } -export interface RoleTo_idResolver { +export interface LocalRegistrarToNameResolver { ( parent: TParent, args: {}, @@ -7036,7 +7040,7 @@ export interface RoleTo_idResolver { ): TResult } -export interface RoleToLabelsResolver { +export interface LocalRegistrarToRoleResolver { ( parent: TParent, args: {}, @@ -7045,13 +7049,10 @@ export interface RoleToLabelsResolver { ): TResult } -export interface GQLLocalRegistrarTypeResolver { - name?: LocalRegistrarToNameResolver - role?: LocalRegistrarToRoleResolver - signature?: LocalRegistrarToSignatureResolver -} - -export interface LocalRegistrarToNameResolver { +export interface LocalRegistrarToSignatureResolver< + TParent = any, + TResult = any +> { ( parent: TParent, args: {}, @@ -7060,7 +7061,12 @@ export interface LocalRegistrarToNameResolver { ): TResult } -export interface LocalRegistrarToRoleResolver { +export interface GQLIdentifierTypeResolver { + system?: IdentifierToSystemResolver + value?: IdentifierToValueResolver +} + +export interface IdentifierToSystemResolver { ( parent: TParent, args: {}, @@ -7069,10 +7075,7 @@ export interface LocalRegistrarToRoleResolver { ): TResult } -export interface LocalRegistrarToSignatureResolver< - TParent = any, - TResult = any -> { +export interface IdentifierToValueResolver { ( parent: TParent, args: {}, diff --git a/packages/gateway/src/graphql/schema.graphql b/packages/gateway/src/graphql/schema.graphql index 0dbf8e1d4bc..c254f048bd2 100644 --- a/packages/gateway/src/graphql/schema.graphql +++ b/packages/gateway/src/graphql/schema.graphql @@ -31,7 +31,7 @@ type Query { ): RegistrationCountResult fetchMarriageRegistration(id: ID!): MarriageRegistration fetchRecordDetailsForVerification(id: String!): RecordDetails - hasChildLocation(parentId: String!): Location + isLeafLevelLocation(locationId: String!): Boolean! getUser(userId: String): User getUserByMobile(mobile: String): User getUserByEmail(email: String): User @@ -386,25 +386,6 @@ type MarriageRegistration implements EventRegistration { union RecordDetails = BirthRegistration | DeathRegistration -type Location { - id: ID! - _fhirID: ID - identifier: [Identifier!] - status: String - name: String - alias: [String!] - description: String - partOf: String - type: String - telecom: [ContactPoint] - address: Address - longitude: Float - latitude: Float - altitude: Float - geoData: String - hierarchy: [Location!] -} - type User { id: ID! userMgntUserID: ID! @@ -850,6 +831,25 @@ type RelatedPerson { exactDateOfBirthUnknown: Boolean } +type Location { + id: ID! + _fhirID: ID + identifier: [Identifier!] + status: String + name: String + alias: [String!] + description: String + partOf: String + type: String + telecom: [ContactPoint] + address: Address + longitude: Float + latitude: Float + altitude: Float + geoData: String + hierarchy: [Location!] +} + type QuestionnaireQuestion { fieldId: String value: String @@ -956,11 +956,6 @@ type StatusWiseRegistrationCount { count: Int! } -type Identifier { - system: String - value: String -} - enum SystemRoleType { FIELD_AGENT REGISTRATION_AGENT @@ -989,6 +984,11 @@ type LocalRegistrar { signature: Signature } +type Identifier { + system: String + value: String +} + type Signature { data: String type: String diff --git a/packages/gateway/src/location.ts b/packages/gateway/src/location.ts index bccc75d440c..71bc4e2d341 100644 --- a/packages/gateway/src/location.ts +++ b/packages/gateway/src/location.ts @@ -10,7 +10,7 @@ */ import { UUID } from '@opencrvs/commons' -import { Location, SavedLocation } from '@opencrvs/commons/types' +import { Location, SavedBundle, SavedLocation } from '@opencrvs/commons/types' import { APPLICATION_CONFIG_URL } from './constants' import fetch from 'node-fetch' @@ -28,6 +28,24 @@ export const fetchLocation = async (id: UUID) => { return response.json() as Promise } +const FETCH_ALL_LOCATIONS = new URL( + '/locations?type=ADMIN_STRUCTURE&_count=0', + APPLICATION_CONFIG_URL +) + +export const fetchAllLocations = async () => { + const response = await fetch(FETCH_ALL_LOCATIONS) + + if (!response.ok) { + throw new Error( + `Couldn't fetch the locations from config: ${await response.text()}` + ) + } + const locationsBundle: SavedBundle = await response.json() + + return locationsBundle.entry.map(({ resource }) => resource) +} + const FETCH_ALL_LOCATION_CHILDREN = (id: UUID) => new URL(`/locations/${id}/children`, APPLICATION_CONFIG_URL) diff --git a/packages/gateway/src/rate-limit.test.ts b/packages/gateway/src/rate-limit.test.ts index b1d8e02a5ee..684e2320d0e 100644 --- a/packages/gateway/src/rate-limit.test.ts +++ b/packages/gateway/src/rate-limit.test.ts @@ -21,6 +21,7 @@ import { flushAll } from './utils/redis-test-utils' import { StartedTestContainer } from 'testcontainers' +import { savedAdministrativeLocation } from '@opencrvs/commons/fixtures' const fetch = fetchAny as any const resolvers = rootResolvers as any @@ -144,12 +145,16 @@ describe('Rate limit', () => { it('does not throw RateLimitError when a non-rate-limited route is being called 20 times', async () => { const resolverCalls = Array.from({ length: 20 }, async () => { - fetch.mockResponseOnce(JSON.stringify([{ resourceType: 'Location' }])) - await locationResolvers.Query.hasChildLocation( + fetch.mockResponseOnce( + JSON.stringify([ + savedAdministrativeLocation({ partOf: { reference: 'Location/1' } }) + ]) + ) + await locationResolvers.Query!.isLeafLevelLocation( {}, - { parentId: '1' }, + { locationId: '1' }, { headers: authHeaderRegAgent }, - { fieldName: 'hasChildLocation' } + { fieldName: 'isLeafLevelLocation' } ) }) From ad5c9ed8a58ee50205138d35c8848ed0bb75c85e Mon Sep 17 00:00:00 2001 From: Pyry Rouvila Date: Thu, 31 Oct 2024 13:59:25 +0200 Subject: [PATCH 04/50] fix(rate-limit): use the value of an object key, instead of the key itself (#7877) * feat(tests): add rate limiting tests for multiple users * fix: ratelimiting using 'username' as key instead of the actual username * fix: add other tests back * fix: do a full object access like the function supports * chore(changelog): amend for 1.6 --- CHANGELOG.md | 2 + packages/gateway/src/rate-limit.test.ts | 134 +++++++++++++++++++++++- packages/gateway/src/rate-limit.ts | 9 +- 3 files changed, 141 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 502c692e3e4..da853ccc22e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -57,6 +57,7 @@ - Handle label params used in form inputs when rendering in action details modal - **Staged files getting reset on precommit hook failure** We were running lint-staged separately on each package using lerna which potentially created a race condition causing staged changes to get lost on failure. Now we are running lint-staged directly without depending on lerna. **_This is purely a DX improvement without affecting any functionality of the system_** - Fix `informantType` missing in template object which prevented rendering informant relationship data in the certificates [#5952](https://github.com/opencrvs/opencrvs-core/issues/5952) +- Fix users hitting rate limit when multiple users authenticated the same time with different usernames [#7728](https://github.com/opencrvs/opencrvs-core/issues/7728) ### Breaking changes @@ -64,6 +65,7 @@ - **Gateways searchEvents API updated** `operationHistories` only returns `operationType` & `operatedOn` due to the other fields being unused in OpenCRVS - **Config changes to review/preview and signatures** Core used to provide review/preview section by default which are now removed and need to be provided from countryconfig. The signature field definitions (e.g. informant signature, bride signature etc.) were hard coded in core which also have now been removed. The signatures can now be added through the review/preview sections defined in countryconfig just like any other field. You can use the following section definition as the default which is without any additional fields. We highly recommend checking out our reference country repository which has the signature fields in its review/preview sections - `hasChildLocation` query has been removed from gateway. We have created the query `isLeafLevelLocation` instead which is more descriptive on its intended use. + ``` { id: 'preview', diff --git a/packages/gateway/src/rate-limit.test.ts b/packages/gateway/src/rate-limit.test.ts index 684e2320d0e..c92c4178706 100644 --- a/packages/gateway/src/rate-limit.test.ts +++ b/packages/gateway/src/rate-limit.test.ts @@ -14,7 +14,6 @@ import { resolvers as locationRootResolvers } from '@gateway/features/location/r import * as fetchAny from 'jest-fetch-mock' import * as jwt from 'jsonwebtoken' import { readFileSync } from 'fs' -// eslint-disable-next-line import/no-relative-parent-imports import { startContainer, stopContainer, @@ -22,6 +21,7 @@ import { } from './utils/redis-test-utils' import { StartedTestContainer } from 'testcontainers' import { savedAdministrativeLocation } from '@opencrvs/commons/fixtures' +import { createServer } from '@gateway/server' const fetch = fetchAny as any const resolvers = rootResolvers as any @@ -38,6 +38,7 @@ jest.mock('./constants', () => { }) describe('Rate limit', () => { let authHeaderRegAgent: { Authorization: string } + let authHeaderRegAgent2: { Authorization: string } beforeAll(async () => { container = await startContainer() @@ -63,6 +64,20 @@ describe('Rate limit', () => { authHeaderRegAgent = { Authorization: `Bearer ${validateToken}` } + + const validateToken2 = jwt.sign( + { scope: ['validate'] }, + readFileSync('./test/cert.key'), + { + subject: '5bdc55ece42c82de9a529c36', + algorithm: 'RS256', + issuer: 'opencrvs:auth-service', + audience: 'opencrvs:gateway-user' + } + ) + authHeaderRegAgent2 = { + Authorization: `Bearer ${validateToken2}` + } }) it('allows 10 calls and then throws RateLimitError', async () => { @@ -143,6 +158,70 @@ describe('Rate limit', () => { ).resolves.not.toThrowError() }) + it('does not throw RateLimitError when different users try to access the same route', async () => { + const users = [ + { username: 'sakibal.hasan', id: '0' }, + { username: 'p.rouvila', id: '1' } + ] + + // Call the route 7 times for all users, it should not throw RateLimitError for this user yet + for (let i = 1; i <= 7; i++) { + fetch.mockResponseOnce( + JSON.stringify({ + username: users[0].username, + id: users[0].id, + scope: ['declare'], + status: 'active' + }) + ) + + await resolvers.Query.verifyPasswordById( + {}, + { id: users[0].id, password: 'test' }, + { headers: authHeaderRegAgent }, + { fieldName: 'verifyPasswordById' } + ) + } + + // ...now call the same route 7 times for the second user, it should not throw RateLimitError for this user either + for (let i = 1; i <= 7; i++) { + fetch.mockResponseOnce( + JSON.stringify({ + username: users[1].username, + id: users[1].id, + scope: ['declare'], + status: 'active' + }) + ) + + await resolvers.Query.verifyPasswordById( + {}, + { id: users[1].id, password: 'test' }, + { headers: authHeaderRegAgent2 }, + { fieldName: 'verifyPasswordById' } + ) + } + + // ...now call the same route for the first user again, it should not still throw RateLimitError + fetch.mockResponseOnce( + JSON.stringify({ + username: users[0].username, + id: users[0].id, + scope: ['declare'], + status: 'active' + }) + ) + + return expect( + resolvers.Query.verifyPasswordById( + {}, + { id: users[0].id, password: 'test' }, + { headers: authHeaderRegAgent }, + { fieldName: 'verifyPasswordById' } + ) + ).resolves.not.toThrowError() + }) + it('does not throw RateLimitError when a non-rate-limited route is being called 20 times', async () => { const resolverCalls = Array.from({ length: 20 }, async () => { fetch.mockResponseOnce( @@ -160,4 +239,57 @@ describe('Rate limit', () => { return expect(() => Promise.all(resolverCalls)).not.toThrowError() }) + + it('handles multiple users authenticating with different usernames', async () => { + const server = await createServer() + + // okay to go through 10 times + for (let i = 1; i <= 10; i++) { + const res = await server.app.inject({ + method: 'POST', + url: '/auth/authenticate', + payload: { + username: 'test.user', + password: 'test' + } + }) + + expect((res.result as any).statusCode).not.toBe(402) + } + + // should return 402 Forbidden + const res = await server.app.inject({ + method: 'POST', + url: '/auth/authenticate', + payload: { + username: 'test.user', + password: 'test' + } + }) + expect((res.result as any).statusCode).toBe(402) + + // okay to go through 10 times with a different username + for (let i = 1; i <= 10; i++) { + const res = await server.app.inject({ + method: 'POST', + url: '/auth/authenticate', + payload: { + username: 'test.user2', + password: 'test' + } + }) + expect((res.result as any).statusCode).not.toBe(402) + } + + // should return 402 Forbidden + const res2 = await server.app.inject({ + method: 'POST', + url: '/auth/authenticate', + payload: { + username: 'test.user2', + password: 'test' + } + }) + expect((res2.result as any).statusCode).toBe(402) + }) }) diff --git a/packages/gateway/src/rate-limit.ts b/packages/gateway/src/rate-limit.ts index ddce825a085..b3125b68b5b 100644 --- a/packages/gateway/src/rate-limit.ts +++ b/packages/gateway/src/rate-limit.ts @@ -105,14 +105,17 @@ export const rateLimitedRoute = const key = pathOptionsForKey!.find( (path) => get(payload, path) !== undefined ) + const value = get(payload, key!) - if (!key) { - throw new Error("Couldn't find a rate limiting key in payload") + if (!value) { + throw new Error( + "Couldn't find the value for a rate limiting key in payload" + ) } return withRateLimit( { - key: `${key}:${route}`, + key: `${value}:${route}`, requestsPerMinute }, fn From b48fdfcd88db55e5e602eb3946d1c4d67d17c03c Mon Sep 17 00:00:00 2001 From: Jamil Date: Thu, 31 Oct 2024 18:23:29 +0600 Subject: [PATCH 05/50] feat: include service name to sentry logs (#7841) * feat: attach service name to sentry log * Update packages/auth/src/config/plugins.ts Co-authored-by: Riku Rouvila * Update packages/config/src/config/plugins.ts Co-authored-by: Riku Rouvila * Update packages/documents/src/config/plugins.ts Co-authored-by: Riku Rouvila * Update packages/gateway/src/config/plugins.ts Co-authored-by: Riku Rouvila * Update packages/metrics/src/config/plugins.ts Co-authored-by: Riku Rouvila * Update packages/notification/src/config/plugins.ts Co-authored-by: Riku Rouvila * Update packages/search/src/config/plugins.ts Co-authored-by: Riku Rouvila * Update packages/user-mgnt/src/config/plugins.ts Co-authored-by: Riku Rouvila * Update packages/webhooks/src/config/plugins.ts Co-authored-by: Riku Rouvila * Update packages/workflow/src/config/plugins.ts Co-authored-by: Riku Rouvila --------- Co-authored-by: Riku Rouvila --- packages/auth/src/config/plugins.ts | 5 ++++- packages/config/src/config/plugins.ts | 5 ++++- packages/documents/src/config/plugins.ts | 5 ++++- packages/gateway/src/config/plugins.ts | 5 ++++- packages/metrics/src/config/plugins.ts | 5 ++++- packages/notification/src/config/plugins.ts | 5 ++++- packages/search/src/config/plugins.ts | 5 ++++- packages/user-mgnt/src/config/plugins.ts | 5 ++++- packages/webhooks/src/config/plugins.ts | 5 ++++- packages/workflow/src/config/plugins.ts | 5 ++++- 10 files changed, 40 insertions(+), 10 deletions(-) diff --git a/packages/auth/src/config/plugins.ts b/packages/auth/src/config/plugins.ts index b3254d5e7a0..3fe1527b5d3 100644 --- a/packages/auth/src/config/plugins.ts +++ b/packages/auth/src/config/plugins.ts @@ -36,7 +36,10 @@ export default function getPlugins() { options: { client: { environment: process.env.DOMAIN, - dsn: env.SENTRY_DSN + dsn: env.SENTRY_DSN, + initialScope: { + tags: { service: 'auth' } + } }, catchLogErrors: true } diff --git a/packages/config/src/config/plugins.ts b/packages/config/src/config/plugins.ts index eda61ca6ce1..0e6a8a30641 100644 --- a/packages/config/src/config/plugins.ts +++ b/packages/config/src/config/plugins.ts @@ -37,7 +37,10 @@ export default function getPlugins() { options: { client: { environment: env.DOMAIN, - dsn: env.SENTRY_DSN + dsn: env.SENTRY_DSN, + initialScope: { + tags: { service: 'config' } + } }, catchLogErrors: true } diff --git a/packages/documents/src/config/plugins.ts b/packages/documents/src/config/plugins.ts index 276595b4b23..4f7f12d5444 100644 --- a/packages/documents/src/config/plugins.ts +++ b/packages/documents/src/config/plugins.ts @@ -38,7 +38,10 @@ export default function getPlugins() { options: { client: { environment: process.env.DOMAIN, - dsn: SENTRY_DSN + dsn: SENTRY_DSN, + initialScope: { + tags: { service: 'documents' } + } }, catchLogErrors: true } diff --git a/packages/gateway/src/config/plugins.ts b/packages/gateway/src/config/plugins.ts index f34cb6b42c8..430f40317da 100644 --- a/packages/gateway/src/config/plugins.ts +++ b/packages/gateway/src/config/plugins.ts @@ -57,7 +57,10 @@ export const getPlugins = () => { options: { client: { dsn: SENTRY_DSN, - environment: process.env.DOMAIN + environment: process.env.DOMAIN, + initialScope: { + tags: { service: 'gateway' } + } }, catchLogErrors: true } diff --git a/packages/metrics/src/config/plugins.ts b/packages/metrics/src/config/plugins.ts index 89e5bd35fe5..760abad67e5 100644 --- a/packages/metrics/src/config/plugins.ts +++ b/packages/metrics/src/config/plugins.ts @@ -38,7 +38,10 @@ export default function getPlugins() { options: { client: { environment: process.env.DOMAIN, - dsn: SENTRY_DSN + dsn: SENTRY_DSN, + initialScope: { + tags: { service: 'metrics' } + } }, catchLogErrors: true } diff --git a/packages/notification/src/config/plugins.ts b/packages/notification/src/config/plugins.ts index 809bb945721..7274b639990 100644 --- a/packages/notification/src/config/plugins.ts +++ b/packages/notification/src/config/plugins.ts @@ -38,7 +38,10 @@ export default function getPlugins() { options: { client: { environment: process.env.DOMAIN, - dsn: SENTRY_DSN + dsn: SENTRY_DSN, + initialScope: { + tags: { service: 'notification' } + } }, catchLogErrors: true } diff --git a/packages/search/src/config/plugins.ts b/packages/search/src/config/plugins.ts index e3e1310a8d5..db95c615902 100644 --- a/packages/search/src/config/plugins.ts +++ b/packages/search/src/config/plugins.ts @@ -37,7 +37,10 @@ export default function getPlugins() { options: { client: { environment: process.env.DOMAIN, - dsn: SENTRY_DSN + dsn: SENTRY_DSN, + initialScope: { + tags: { service: 'search' } + } }, catchLogErrors: true } diff --git a/packages/user-mgnt/src/config/plugins.ts b/packages/user-mgnt/src/config/plugins.ts index 40487a91d66..8b853a16ed4 100644 --- a/packages/user-mgnt/src/config/plugins.ts +++ b/packages/user-mgnt/src/config/plugins.ts @@ -37,7 +37,10 @@ export default function getPlugins() { options: { client: { environment: process.env.DOMAIN, - dsn: SENTRY_DSN + dsn: SENTRY_DSN, + initialScope: { + tags: { service: 'user-mgnt' } + } }, catchLogErrors: true } diff --git a/packages/webhooks/src/config/plugins.ts b/packages/webhooks/src/config/plugins.ts index 1eed22f0da1..418928e9562 100644 --- a/packages/webhooks/src/config/plugins.ts +++ b/packages/webhooks/src/config/plugins.ts @@ -37,7 +37,10 @@ export default function getPlugins() { options: { client: { environment: process.env.DOMAIN, - dsn: SENTRY_DSN + dsn: SENTRY_DSN, + initialScope: { + tags: { service: 'webhooks' } + } }, catchLogErrors: true } diff --git a/packages/workflow/src/config/plugins.ts b/packages/workflow/src/config/plugins.ts index b84086c20d5..9d8c14f1b1a 100644 --- a/packages/workflow/src/config/plugins.ts +++ b/packages/workflow/src/config/plugins.ts @@ -37,7 +37,10 @@ export default function getPlugins() { options: { client: { environment: process.env.DOMAIN, - dsn: SENTRY_DSN + dsn: SENTRY_DSN, + initialScope: { + tags: { service: 'workflow' } + } }, catchLogErrors: true } From 06fd407c2c38250ae75dea06eb0ebab236053f8e Mon Sep 17 00:00:00 2001 From: Jamil Date: Thu, 31 Oct 2024 20:52:49 +0600 Subject: [PATCH 06/50] Integrate Knip (#7847) * chore: set up knip * chore: remove unused exports from client * chore: add lint-knip in CI * feat: CI: compare knip issue count of base branch and pr branch * fix: use base_ref directly, write output to GITHUB_OUTPUT * fix: remove knip script from package.json * refactor: remove unused codes from client * refactor: remove unused codes from commons * fix: remove knip.ts * fix: create knip reporter in pipeline * refactor: remove unused codes from config * fix: remove unused imports and declarations * fix: run knip externally * chore: remove knip-reporter * chore: remove unused imports from config * chore: remove unused imports from client * amend: export `QUESTION_KEYS` * amend: export `PaymentSection` * refactor: make `create reporter` more readable * chore: remove security scans * chore: remove unused devDependenceis * refactor: move contents of QueryProvider to index.ts * chore: run gql type generator --- .github/workflows/lint-and-test.yml | 63 +++ .../src/features/oauthToken/token-exchange.ts | 6 +- .../client/src/components/Header/Header.tsx | 2 +- packages/client/src/components/form/http.ts | 2 +- packages/client/src/declarations/index.ts | 30 +- packages/client/src/declarations/selectors.ts | 4 +- .../advancedSearch/fieldDefinitions/Birth.ts | 213 +++++---- .../advancedSearch/fieldDefinitions/Death.ts | 209 +++++---- .../client/src/forms/correction/corrector.ts | 5 +- .../client/src/forms/correction/payment.ts | 2 +- .../client/src/forms/correction/reason.ts | 2 +- .../src/forms/correction/supportDocument.ts | 2 +- .../src/forms/deserializer/deserializer.ts | 2 +- packages/client/src/forms/index.ts | 137 +++--- .../forms/register/declaration-selectors.ts | 2 +- packages/client/src/forms/register/reducer.ts | 2 +- .../src/forms/register/reviewReducer.ts | 2 +- .../forms/user/fieldDefinitions/createUser.ts | 4 +- .../client/src/forms/user/query/queries.ts | 7 - packages/client/src/forms/utils.ts | 16 +- packages/client/src/i18n/reducer.ts | 2 +- packages/client/src/navigation/index.ts | 6 - packages/client/src/offline/actions.ts | 13 - packages/client/src/offline/reducer.ts | 5 - .../src/tests/mock-graphql-responses.ts | 407 ------------------ .../client/src/tests/mock-offline-data.ts | 2 +- packages/client/src/tests/util.tsx | 12 +- packages/client/src/user/userReducer.ts | 2 +- packages/client/src/utils/authUtils.ts | 17 +- packages/client/src/utils/constants.ts | 3 +- packages/client/src/utils/data-formatting.ts | 5 - packages/client/src/utils/gateway.ts | 9 - .../src/utils/persistence/persistLink.ts | 2 +- .../client/src/views/CorrectionForm/utils.ts | 6 - .../src/views/DataProvider/QueryProvider.tsx | 90 ---- .../src/views/DataProvider/birth/queries.ts | 2 +- .../src/views/DataProvider/death/queries.ts | 2 +- .../src/views/OfficeHome/OfficeHome.tsx | 5 - packages/client/src/views/OfficeHome/utils.ts | 13 - .../src/views/PrintCertificate/PDFUtils.ts | 2 +- .../client/src/views/RecordAudit/utils.ts | 9 - .../duplicate/DuplicateFormTabs.tsx | 2 +- packages/client/src/workqueue/actions.ts | 2 +- packages/commons/src/authentication.ts | 7 +- packages/commons/src/fhir/composition.ts | 24 +- packages/commons/src/fhir/constants.ts | 11 +- packages/commons/src/fhir/extension.ts | 4 - packages/commons/src/fhir/index.ts | 32 +- packages/commons/src/fhir/payments.ts | 2 +- packages/commons/src/fhir/practitioner.ts | 19 - packages/commons/src/fhir/task.ts | 43 +- .../src/fhir/transformers/constants.ts | 64 --- .../fhir/transformers/fhir-builders.test.ts | 2 +- .../commons/src/fhir/transformers/index.ts | 7 +- .../src/fhir/transformers/templates.ts | 6 +- .../src/fhir/transformers/transformer.ts | 8 +- .../commons/src/fhir/transformers/utils.ts | 88 +--- packages/commons/src/nominal.ts | 4 - packages/commons/src/record.ts | 17 - packages/config/src/config/constants.ts | 1 - .../application/applicationConfigHandler.ts | 2 +- packages/config/src/handlers/forms/field.ts | 2 +- .../config/src/handlers/locations/handler.ts | 2 +- .../config/src/handlers/locations/utils.ts | 2 +- packages/config/src/models/config.ts | 7 - packages/config/src/utils/verifyToken.ts | 13 - packages/login/src/App.tsx | 3 +- .../src/common/LoginBackgroundWrapper.tsx | 2 +- packages/login/src/i18n/reducer.ts | 4 +- packages/login/src/login/actions.ts | 27 +- packages/login/src/login/selectors.ts | 8 - packages/login/src/navigation/routes.ts | 2 - packages/login/src/utils/authApi.ts | 2 +- packages/login/src/utils/authUtils.ts | 5 +- packages/login/src/utils/dataCleanse.ts | 4 - packages/login/src/utils/fieldUtils.ts | 5 - packages/login/src/utils/referenceApi.ts | 2 +- packages/login/src/utils/validate.ts | 4 +- packages/login/src/views/Common.tsx | 6 - .../views/ResetCredentialsForm/Commons.tsx | 19 - .../ResetCredentialsSuccessPage.tsx | 2 +- yarn.lock | 17 + 82 files changed, 462 insertions(+), 1347 deletions(-) delete mode 100644 packages/client/src/views/DataProvider/QueryProvider.tsx delete mode 100644 packages/commons/src/fhir/transformers/constants.ts diff --git a/.github/workflows/lint-and-test.yml b/.github/workflows/lint-and-test.yml index 65f83a98e0f..4afa00a76b5 100644 --- a/.github/workflows/lint-and-test.yml +++ b/.github/workflows/lint-and-test.yml @@ -137,3 +137,66 @@ jobs: - name: Run Unit Test if: steps.check-scripts.outputs.skip != 'true' && steps.check-scripts.outputs.skip-test != 'true' run: cd ${{ matrix.package }} && yarn test + + lint-knip: + runs-on: ubuntu-22.04 + steps: + - name: Checkout base branch + uses: actions/checkout@v2 + with: + ref: ${{ github.base_ref }} + - uses: actions/setup-node@v4 + - name: Install dependencies + run: yarn install --ignore-scripts + - name: Create reporter + run: | + cat << 'EOF' > knip-reporter.js + const reporter = function (options) { + const totalIssues = Object.values(options.issues).reduce( + (acc, issueRecords) => + acc + Object.values(issueRecords).reduce( + (acc2, issuesInFile) => acc2 + Object.keys(issuesInFile).length, + 0 + ), + 0 + ); + console.log(JSON.stringify({ totalIssues })); + }; + export default reporter; + EOF + - name: Run knip on base branch + id: knip_base + run: | + OUTPUT=$(npx knip --no-exit-code --exports --reporter=./knip-reporter.js) + JSON=$(echo "$OUTPUT" | grep -o '{.*}') + total_issues=$(echo "$JSON" | jq '.totalIssues') + echo "Total Issues: $total_issues" + echo "maxIssues=${total_issues}" >> $GITHUB_OUTPUT + echo "Max issues = $maxIssues" + + - name: Checkout the PR branch + uses: actions/checkout@v2 + with: + ref: ${{ github.head_ref }} + - uses: actions/setup-node@v4 + - name: Install dependencies + run: yarn install --ignore-scripts + - name: Create reporter + run: | + cat << 'EOF' > knip-reporter.js + const reporter = function (options) { + const totalIssues = Object.values(options.issues).reduce( + (acc, issueRecords) => + acc + Object.values(issueRecords).reduce( + (acc2, issuesInFile) => acc2 + Object.keys(issuesInFile).length, + 0 + ), + 0 + ); + console.log(JSON.stringify({ totalIssues })); + }; + export default reporter; + EOF + - name: Run knip on PR branch + run: | + npx knip --max-issues=${{ steps.knip_base.outputs.maxIssues }} --exports --reporter=./knip-reporter.js diff --git a/packages/auth/src/features/oauthToken/token-exchange.ts b/packages/auth/src/features/oauthToken/token-exchange.ts index a1a2b843409..08224019e3c 100644 --- a/packages/auth/src/features/oauthToken/token-exchange.ts +++ b/packages/auth/src/features/oauthToken/token-exchange.ts @@ -17,10 +17,8 @@ import { import { pipe } from 'fp-ts/lib/function' import { UUID } from '@opencrvs/commons' -export const SUBJECT_TOKEN_TYPE = - 'urn:ietf:params:oauth:token-type:access_token' -export const RECORD_TOKEN_TYPE = - 'urn:opencrvs:oauth:token-type:single_record_token' +const SUBJECT_TOKEN_TYPE = 'urn:ietf:params:oauth:token-type:access_token' +const RECORD_TOKEN_TYPE = 'urn:opencrvs:oauth:token-type:single_record_token' /** * Allows creating record-specific tokens for when a 3rd party system needs to confirm a registration diff --git a/packages/client/src/components/Header/Header.tsx b/packages/client/src/components/Header/Header.tsx index e8817bf478f..7af99a9525d 100644 --- a/packages/client/src/components/Header/Header.tsx +++ b/packages/client/src/components/Header/Header.tsx @@ -131,7 +131,7 @@ const USERS_WITHOUT_SEARCH = SYS_ADMIN_ROLES.concat( PERFORMANCE_MANAGEMENT_ROLES ) -export const HeaderComponent = (props: IFullProps) => { +const HeaderComponent = (props: IFullProps) => { const { location, userDetails, diff --git a/packages/client/src/components/form/http.ts b/packages/client/src/components/form/http.ts index 816c397a29f..e794b93e38d 100644 --- a/packages/client/src/components/form/http.ts +++ b/packages/client/src/components/form/http.ts @@ -28,7 +28,7 @@ function transformRequestBody( ]) ) } -export function transformHttpFieldIntoRequest( +function transformHttpFieldIntoRequest( field: IHttpFormField, ...evalParams: [IFormSectionData, IOfflineData, IFormData, UserDetails | null] ) { diff --git a/packages/client/src/declarations/index.ts b/packages/client/src/declarations/index.ts index de3e7fc5436..9b8186070d0 100644 --- a/packages/client/src/declarations/index.ts +++ b/packages/client/src/declarations/index.ts @@ -45,7 +45,6 @@ import { draftToGqlTransformer } from '@client/transformer' import { transformSearchQueryDataToDraft } from '@client/utils/draftUtils' -import { getQueryMapping } from '@client/views/DataProvider/QueryProvider' import type { GQLEventSearchResultSet, GQLEventSearchSet, @@ -89,6 +88,9 @@ import { ViewRecordQueries } from '@client/views/ViewRecord/query' import { UserDetails } from '@client/utils/userUtils' import { clearUnusedViewRecordCacheEntries } from '@client/utils/persistence' import { getReviewForm } from '@client/forms/register/review-selectors' +import { getBirthQueryMappings } from '@client/views/DataProvider/birth/queries' +import { getDeathQueryMappings } from '@client/views/DataProvider/death/queries' +import { getMarriageQueryMappings } from '@client/views/DataProvider/marriage/queries' const ARCHIVE_DECLARATION = 'DECLARATION/ARCHIVE' const SET_INITIAL_DECLARATION = 'DECLARATION/SET_INITIAL_DECLARATION' @@ -159,7 +161,7 @@ export enum DOWNLOAD_STATUS { UNASSIGNING = 'UNASSIGNING' } -export const processingStates = [ +const processingStates = [ SUBMISSION_STATUS.READY_TO_ARCHIVE, SUBMISSION_STATUS.ARCHIVING, SUBMISSION_STATUS.READY_TO_SUBMIT, @@ -500,6 +502,16 @@ const initialState: IDeclarationsState = { isWritingDraft: false } +/* Need to add mappings for events here */ +const QueryMapper = { + [Event.Birth]: getBirthQueryMappings, + [Event.Death]: getDeathQueryMappings, + [Event.Marriage]: getMarriageQueryMappings +} +const getQueryMapping = (event: Event, action: DeclarationAction) => { + return QueryMapper[event] && QueryMapper[event](action) +} + export function createDeclaration(event: Event, initialData?: IFormData) { return { id: uuid(), @@ -585,7 +597,7 @@ export const getStorageDeclarationsSuccess = ( payload: response }) -export const getStorageDeclarationsFailed = +const getStorageDeclarationsFailed = (): IGetStorageDeclarationsFailedAction => ({ type: GET_DECLARATIONS_FAILED }) @@ -639,13 +651,13 @@ export function writeDeclaration( return { type: WRITE_DECLARATION, payload: { declaration, callback } } } -export function writeDeclarationSuccess( +function writeDeclarationSuccess( declaration: IDeclaration ): IWriteDeclarationSuccessAction { return { type: WRITE_DECLARATION_SUCCESS, payload: { declaration } } } -export function writeDeclarationFailed(): IWriteDeclarationFailedAction { +function writeDeclarationFailed(): IWriteDeclarationFailedAction { return { type: WRITE_DECLARATION_FAILED } } @@ -1222,7 +1234,7 @@ function downloadDeclarationFail( } } -export function executeUnassignDeclaration( +function executeUnassignDeclaration( id: string, client: ApolloClient<{}>, refetchQueries?: InternalRefetchQueriesInclude @@ -1947,9 +1959,7 @@ export function filterProcessingDeclarations( } } -export function getMinioUrlsFromDeclaration( - declaration: IDeclaration | undefined -) { +function getMinioUrlsFromDeclaration(declaration: IDeclaration | undefined) { if (!declaration) { return [] } @@ -1995,7 +2005,7 @@ export function getMinioUrlsFromDeclaration( return minioUrls } -export function postMinioUrlsToServiceWorker(minioUrls: string[]) { +function postMinioUrlsToServiceWorker(minioUrls: string[]) { navigator?.serviceWorker?.controller?.postMessage({ minioUrls: minioUrls }) diff --git a/packages/client/src/declarations/selectors.ts b/packages/client/src/declarations/selectors.ts index f8369701a7b..ff047a3660f 100644 --- a/packages/client/src/declarations/selectors.ts +++ b/packages/client/src/declarations/selectors.ts @@ -12,7 +12,7 @@ import { IDeclaration, IDeclarationsState } from '@client/declarations/index' import { IStoreState } from '@client/store' import { useSelector } from 'react-redux' -export const getDraftsState = (store: IStoreState): IDeclarationsState => +const getDraftsState = (store: IStoreState): IDeclarationsState => store.declarationsState function getKey( @@ -27,7 +27,7 @@ export const getInitialDeclarationsLoaded = ( ): IDeclarationsState['initialDeclarationsLoaded'] => getKey(store, 'initialDeclarationsLoaded') -export const selectDeclaration = +const selectDeclaration = (declarationId: string) => (store: IStoreState) => getKey(store, 'declarations').find(({ id }) => declarationId === id) as T diff --git a/packages/client/src/forms/advancedSearch/fieldDefinitions/Birth.ts b/packages/client/src/forms/advancedSearch/fieldDefinitions/Birth.ts index 1e143c9409e..a99f4a20a4f 100644 --- a/packages/client/src/forms/advancedSearch/fieldDefinitions/Birth.ts +++ b/packages/client/src/forms/advancedSearch/fieldDefinitions/Birth.ts @@ -15,110 +15,109 @@ import { messages as advancedSearchForm } from '@client/i18n/messages/views/adva import { isValidDate } from '@client/search/advancedSearch/validators' import { TIME_PERIOD } from './utils' -export const advancedSearchBirthSectionRegistrationDetails: IFormSectionGroup = - { - id: 'BirthRegistrationDetails', - title: advancedSearchForm.registrationDetails, - fields: [ - { - name: 'placeOfRegistration', - type: 'LOCATION_SEARCH_INPUT', - label: advancedSearchForm.placeOfRegistrationlabel, - helperText: advancedSearchForm.placeOfRegistrationHelperText, - placeholder: formMessageDescriptors.formSelectPlaceholder, - required: false, - initialValue: '', - searchableResource: ['locations', 'offices'], - searchableType: ['CRVS_OFFICE', 'ADMIN_STRUCTURE'], - validator: [] - }, - { - name: 'dateOfRegistration', - type: 'DATE_RANGE_PICKER', - label: advancedSearchForm.dateOfRegistration, - required: false, - initialValue: '', - validator: [isValidDate] - }, - { - name: 'registrationStatuses', - type: 'SELECT_WITH_OPTIONS', - label: advancedSearchForm.statusOfRecordLabel, - required: false, - initialValue: '', - validator: [], - placeholder: formMessageDescriptors.formSelectPlaceholder, - options: [ - { - value: 'ALL', - label: advancedSearchForm.recordStatusAny - }, - { - value: 'IN_PROGRESS', - label: advancedSearchForm.recordStatusInprogress - }, - { - value: 'IN_REVIEW', - label: advancedSearchForm.recordStatusInReview - }, - { - value: 'REJECTED', - label: advancedSearchForm.recordStatusRequireUpdate - }, - { - value: 'REGISTERED', - label: advancedSearchForm.recordStatusRegistered - }, - { - value: 'CERTIFIED', - label: advancedSearchForm.recordStatusCertified - }, - { - value: 'ARCHIVED', - label: advancedSearchForm.recordStatusAchived - }, - { - value: 'CORRECTION_REQUESTED', - label: advancedSearchForm.recordStatusCorrectionRequested - }, - { - value: 'VALIDATED', - label: advancedSearchForm.recordStatusValidated - } - ] - }, - { - name: 'registrationByPeriod', - type: 'SELECT_WITH_OPTIONS', - label: advancedSearchForm.timePeriodLabel, - required: false, - initialValue: '', - validator: [], - helperText: advancedSearchForm.timePeriodHelperText, - placeholder: formMessageDescriptors.formSelectPlaceholder, - options: [ - { - value: TIME_PERIOD.LAST_7_DAYS, - label: advancedSearchForm.timePeriodLast7Days - }, - { - value: TIME_PERIOD.LAST_30_DAYS, - label: advancedSearchForm.timePeriodLast30Days - }, - { - value: TIME_PERIOD.LAST_90_DAYS, - label: advancedSearchForm.timePeriodLast90Days - }, - { - value: TIME_PERIOD.LAST_YEAR, - label: advancedSearchForm.timePeriodLastYear - } - ] - } - ] - } +const advancedSearchBirthSectionRegistrationDetails: IFormSectionGroup = { + id: 'BirthRegistrationDetails', + title: advancedSearchForm.registrationDetails, + fields: [ + { + name: 'placeOfRegistration', + type: 'LOCATION_SEARCH_INPUT', + label: advancedSearchForm.placeOfRegistrationlabel, + helperText: advancedSearchForm.placeOfRegistrationHelperText, + placeholder: formMessageDescriptors.formSelectPlaceholder, + required: false, + initialValue: '', + searchableResource: ['locations', 'offices'], + searchableType: ['CRVS_OFFICE', 'ADMIN_STRUCTURE'], + validator: [] + }, + { + name: 'dateOfRegistration', + type: 'DATE_RANGE_PICKER', + label: advancedSearchForm.dateOfRegistration, + required: false, + initialValue: '', + validator: [isValidDate] + }, + { + name: 'registrationStatuses', + type: 'SELECT_WITH_OPTIONS', + label: advancedSearchForm.statusOfRecordLabel, + required: false, + initialValue: '', + validator: [], + placeholder: formMessageDescriptors.formSelectPlaceholder, + options: [ + { + value: 'ALL', + label: advancedSearchForm.recordStatusAny + }, + { + value: 'IN_PROGRESS', + label: advancedSearchForm.recordStatusInprogress + }, + { + value: 'IN_REVIEW', + label: advancedSearchForm.recordStatusInReview + }, + { + value: 'REJECTED', + label: advancedSearchForm.recordStatusRequireUpdate + }, + { + value: 'REGISTERED', + label: advancedSearchForm.recordStatusRegistered + }, + { + value: 'CERTIFIED', + label: advancedSearchForm.recordStatusCertified + }, + { + value: 'ARCHIVED', + label: advancedSearchForm.recordStatusAchived + }, + { + value: 'CORRECTION_REQUESTED', + label: advancedSearchForm.recordStatusCorrectionRequested + }, + { + value: 'VALIDATED', + label: advancedSearchForm.recordStatusValidated + } + ] + }, + { + name: 'registrationByPeriod', + type: 'SELECT_WITH_OPTIONS', + label: advancedSearchForm.timePeriodLabel, + required: false, + initialValue: '', + validator: [], + helperText: advancedSearchForm.timePeriodHelperText, + placeholder: formMessageDescriptors.formSelectPlaceholder, + options: [ + { + value: TIME_PERIOD.LAST_7_DAYS, + label: advancedSearchForm.timePeriodLast7Days + }, + { + value: TIME_PERIOD.LAST_30_DAYS, + label: advancedSearchForm.timePeriodLast30Days + }, + { + value: TIME_PERIOD.LAST_90_DAYS, + label: advancedSearchForm.timePeriodLast90Days + }, + { + value: TIME_PERIOD.LAST_YEAR, + label: advancedSearchForm.timePeriodLastYear + } + ] + } + ] +} -export const advancedSearchBirthSectionChildDetails: IFormSectionGroup = { +const advancedSearchBirthSectionChildDetails: IFormSectionGroup = { id: 'BirthChildDetails', title: advancedSearchForm.registrationDetails, fields: [ @@ -176,7 +175,7 @@ export const advancedSearchBirthSectionChildDetails: IFormSectionGroup = { ] } -export const advancedSearchBirthSectionEventDetails: IFormSectionGroup = { +const advancedSearchBirthSectionEventDetails: IFormSectionGroup = { id: 'BirthEventDetails', title: advancedSearchForm.registrationDetails, fields: [ @@ -320,7 +319,7 @@ export const advancedSearchBirthSectionEventDetails: IFormSectionGroup = { ] } -export const advancedSearchBirthSectionMotherDetails: IFormSectionGroup = { +const advancedSearchBirthSectionMotherDetails: IFormSectionGroup = { id: 'BirthMotherDetails', title: advancedSearchForm.registrationDetails, fields: [ @@ -355,7 +354,7 @@ export const advancedSearchBirthSectionMotherDetails: IFormSectionGroup = { ] } -export const advancedSearchBirthSectionFatherDetails: IFormSectionGroup = { +const advancedSearchBirthSectionFatherDetails: IFormSectionGroup = { id: 'BirthFatherDetails', title: advancedSearchForm.registrationDetails, fields: [ @@ -388,7 +387,7 @@ export const advancedSearchBirthSectionFatherDetails: IFormSectionGroup = { ] } -export const advancedSearchBirthSectionInformantDetails: IFormSectionGroup = { +const advancedSearchBirthSectionInformantDetails: IFormSectionGroup = { id: 'BirthInformantDetails', title: advancedSearchForm.registrationDetails, fields: [ diff --git a/packages/client/src/forms/advancedSearch/fieldDefinitions/Death.ts b/packages/client/src/forms/advancedSearch/fieldDefinitions/Death.ts index ee629ef783d..7aa0ddb7248 100644 --- a/packages/client/src/forms/advancedSearch/fieldDefinitions/Death.ts +++ b/packages/client/src/forms/advancedSearch/fieldDefinitions/Death.ts @@ -15,110 +15,109 @@ import { messages as advancedSearchForm } from '@client/i18n/messages/views/adva import { isValidDate } from '@client/search/advancedSearch/validators' import { TIME_PERIOD } from './utils' -export const advancedSearchDeathSectionRegistrationDetails: IFormSectionGroup = - { - id: 'DeathRegistrationDetails', - title: advancedSearchForm.registrationDetails, - fields: [ - { - name: 'placeOfRegistration', - type: 'LOCATION_SEARCH_INPUT', - label: advancedSearchForm.placeOfRegistrationlabel, - helperText: advancedSearchForm.placeOfRegistrationHelperText, - placeholder: formMessageDescriptors.formSelectPlaceholder, - required: false, - initialValue: '', - searchableResource: ['locations', 'offices'], - searchableType: ['CRVS_OFFICE', 'ADMIN_STRUCTURE'], - validator: [] - }, - { - name: 'dateOfRegistration', - type: 'DATE_RANGE_PICKER', - label: advancedSearchForm.dateOfRegistration, - required: false, - initialValue: '', - validator: [isValidDate] - }, - { - name: 'registrationStatuses', - type: 'SELECT_WITH_OPTIONS', - label: advancedSearchForm.statusOfRecordLabel, - required: false, - initialValue: '', - validator: [], - placeholder: formMessageDescriptors.formSelectPlaceholder, - options: [ - { - value: 'ALL', - label: advancedSearchForm.recordStatusAny - }, - { - value: 'IN_PROGRESS', - label: advancedSearchForm.recordStatusInprogress - }, - { - value: 'IN_REVIEW', - label: advancedSearchForm.recordStatusInReview - }, - { - value: ' REJECTED', - label: advancedSearchForm.recordStatusRequireUpdate - }, - { - value: 'REGISTERED', - label: advancedSearchForm.recordStatusRegistered - }, - { - value: ' CERTIFIED', - label: advancedSearchForm.recordStatusCertified - }, - { - value: 'ARCHIVED', - label: advancedSearchForm.recordStatusAchived - }, - { - value: 'CORRECTION_REQUESTED', - label: advancedSearchForm.recordStatusCorrectionRequested - }, - { - value: 'VALIDATED', - label: advancedSearchForm.recordStatusValidated - } - ] - }, - { - name: 'registrationByPeriod', - type: 'SELECT_WITH_OPTIONS', - label: advancedSearchForm.timePeriodLabel, - required: false, - initialValue: '', - validator: [], - helperText: advancedSearchForm.timePeriodHelperText, - placeholder: formMessageDescriptors.formSelectPlaceholder, - options: [ - { - value: TIME_PERIOD.LAST_7_DAYS, - label: advancedSearchForm.timePeriodLast7Days - }, - { - value: TIME_PERIOD.LAST_30_DAYS, - label: advancedSearchForm.timePeriodLast30Days - }, - { - value: TIME_PERIOD.LAST_90_DAYS, - label: advancedSearchForm.timePeriodLast90Days - }, - { - value: TIME_PERIOD.LAST_YEAR, - label: advancedSearchForm.timePeriodLastYear - } - ] - } - ] - } +const advancedSearchDeathSectionRegistrationDetails: IFormSectionGroup = { + id: 'DeathRegistrationDetails', + title: advancedSearchForm.registrationDetails, + fields: [ + { + name: 'placeOfRegistration', + type: 'LOCATION_SEARCH_INPUT', + label: advancedSearchForm.placeOfRegistrationlabel, + helperText: advancedSearchForm.placeOfRegistrationHelperText, + placeholder: formMessageDescriptors.formSelectPlaceholder, + required: false, + initialValue: '', + searchableResource: ['locations', 'offices'], + searchableType: ['CRVS_OFFICE', 'ADMIN_STRUCTURE'], + validator: [] + }, + { + name: 'dateOfRegistration', + type: 'DATE_RANGE_PICKER', + label: advancedSearchForm.dateOfRegistration, + required: false, + initialValue: '', + validator: [isValidDate] + }, + { + name: 'registrationStatuses', + type: 'SELECT_WITH_OPTIONS', + label: advancedSearchForm.statusOfRecordLabel, + required: false, + initialValue: '', + validator: [], + placeholder: formMessageDescriptors.formSelectPlaceholder, + options: [ + { + value: 'ALL', + label: advancedSearchForm.recordStatusAny + }, + { + value: 'IN_PROGRESS', + label: advancedSearchForm.recordStatusInprogress + }, + { + value: 'IN_REVIEW', + label: advancedSearchForm.recordStatusInReview + }, + { + value: ' REJECTED', + label: advancedSearchForm.recordStatusRequireUpdate + }, + { + value: 'REGISTERED', + label: advancedSearchForm.recordStatusRegistered + }, + { + value: ' CERTIFIED', + label: advancedSearchForm.recordStatusCertified + }, + { + value: 'ARCHIVED', + label: advancedSearchForm.recordStatusAchived + }, + { + value: 'CORRECTION_REQUESTED', + label: advancedSearchForm.recordStatusCorrectionRequested + }, + { + value: 'VALIDATED', + label: advancedSearchForm.recordStatusValidated + } + ] + }, + { + name: 'registrationByPeriod', + type: 'SELECT_WITH_OPTIONS', + label: advancedSearchForm.timePeriodLabel, + required: false, + initialValue: '', + validator: [], + helperText: advancedSearchForm.timePeriodHelperText, + placeholder: formMessageDescriptors.formSelectPlaceholder, + options: [ + { + value: TIME_PERIOD.LAST_7_DAYS, + label: advancedSearchForm.timePeriodLast7Days + }, + { + value: TIME_PERIOD.LAST_30_DAYS, + label: advancedSearchForm.timePeriodLast30Days + }, + { + value: TIME_PERIOD.LAST_90_DAYS, + label: advancedSearchForm.timePeriodLast90Days + }, + { + value: TIME_PERIOD.LAST_YEAR, + label: advancedSearchForm.timePeriodLastYear + } + ] + } + ] +} -export const advancedSearchDeathSectiondeceasedDetails: IFormSectionGroup = { +const advancedSearchDeathSectiondeceasedDetails: IFormSectionGroup = { id: 'DeathdeceasedDetails', title: advancedSearchForm.registrationDetails, fields: [ @@ -174,7 +173,7 @@ export const advancedSearchDeathSectiondeceasedDetails: IFormSectionGroup = { ] } -export const advancedSearchDeathSectionEventDetails: IFormSectionGroup = { +const advancedSearchDeathSectionEventDetails: IFormSectionGroup = { id: 'DeathEventDetails', title: advancedSearchForm.registrationDetails, fields: [ @@ -318,7 +317,7 @@ export const advancedSearchDeathSectionEventDetails: IFormSectionGroup = { ] } -export const advancedSearchDeathSectionInformantDetails: IFormSectionGroup = { +const advancedSearchDeathSectionInformantDetails: IFormSectionGroup = { id: 'DeathInformantDetails', title: advancedSearchForm.registrationDetails, fields: [ diff --git a/packages/client/src/forms/correction/corrector.ts b/packages/client/src/forms/correction/corrector.ts index d3a1bf4e1a7..acd1cb1f236 100644 --- a/packages/client/src/forms/correction/corrector.ts +++ b/packages/client/src/forms/correction/corrector.ts @@ -37,10 +37,7 @@ export enum CorrectorRelationship { ANOTHER_AGENT = 'ANOTHER_AGENT', REGISTRAR = 'REGISTRAR', COURT = 'COURT', - OTHER = 'OTHER', - LOCAL_REGISTRAR = 'LOCAL_REGISTRAR', - NATIONAL_REGISTRAR = 'NATIONAL_REGISTRAR', - REGISTRATION_AGENT = 'REGISTRATION_AGENT' + OTHER = 'OTHER' } export const CorrectorRelationLabelArray = [ diff --git a/packages/client/src/forms/correction/payment.ts b/packages/client/src/forms/correction/payment.ts index fe355dfd802..14d0cf32499 100644 --- a/packages/client/src/forms/correction/payment.ts +++ b/packages/client/src/forms/correction/payment.ts @@ -17,7 +17,7 @@ import { } from '@client/forms' import { messages } from '@client/i18n/messages/views/correction' -export const correctionFeesPayment = (currencySymbol: string) => +const correctionFeesPayment = (currencySymbol: string) => ({ id: 'correctionFeesPayment', fields: [ diff --git a/packages/client/src/forms/correction/reason.ts b/packages/client/src/forms/correction/reason.ts index ba36b237d27..c328dc17ca6 100644 --- a/packages/client/src/forms/correction/reason.ts +++ b/packages/client/src/forms/correction/reason.ts @@ -30,7 +30,7 @@ export enum CorrectionReason { OTHER = 'OTHER' } -export const correctRecordReasonSectionGroup: IFormSectionGroup = { +const correctRecordReasonSectionGroup: IFormSectionGroup = { id: 'recordCorrection', title: messages.whatWasTheReasonForCorrection, error: messages.reasonForChangeError, diff --git a/packages/client/src/forms/correction/supportDocument.ts b/packages/client/src/forms/correction/supportDocument.ts index 4b1d4b4e769..05780684bb1 100644 --- a/packages/client/src/forms/correction/supportDocument.ts +++ b/packages/client/src/forms/correction/supportDocument.ts @@ -17,7 +17,7 @@ import { import { messages } from '@client/i18n/messages/views/correction' import { fieldValueSectionExchangeTransformer } from '@client/forms/register/mappings/mutation' -export const supportingDocumentsSectionGroup: IFormSectionGroup = { +const supportingDocumentsSectionGroup: IFormSectionGroup = { id: 'correctionDocumentsViewGroup', fields: [ { diff --git a/packages/client/src/forms/deserializer/deserializer.ts b/packages/client/src/forms/deserializer/deserializer.ts index 54ac334cf41..f387fd37f58 100644 --- a/packages/client/src/forms/deserializer/deserializer.ts +++ b/packages/client/src/forms/deserializer/deserializer.ts @@ -289,7 +289,7 @@ function deserializeQueryMap(queryMap: ISerializedQueryMap) { }, {}) } -export function deserializeFormField( +function deserializeFormField( field: SerializedFormField, validators: Record ): IFormField { diff --git a/packages/client/src/forms/index.ts b/packages/client/src/forms/index.ts index c157e88245c..cbe88e38f56 100644 --- a/packages/client/src/forms/index.ts +++ b/packages/client/src/forms/index.ts @@ -76,11 +76,6 @@ export const HTTP = 'HTTP' export const BUTTON = 'BUTTON' export const REDIRECT = 'REDIRECT' -export enum Sort { - ASC = 'asc', - DESC = 'desc' -} - export enum SubmissionAction { SUBMIT_FOR_REVIEW = 'submit for review', APPROVE_DECLARATION = 'approve', @@ -279,9 +274,6 @@ export interface IQuestionnaireQuestion { fieldId: string value: string } -export interface IQuestionnaire { - data: IQuestionnaireQuestion[] -} export interface IFileValue { optionValues: IFormFieldValue[] @@ -297,7 +289,7 @@ export interface IContactPointPhone { interface IInformantOtherInformantType { otherInformantType: string } -export interface IInformant { +interface IInformant { value: string nestedFields: IInformantOtherInformantType } @@ -371,16 +363,6 @@ interface Operation< operation: Key } -export type IFormFieldQueryMapDescriptor< - T extends keyof typeof queries = keyof typeof queries -> = { - operation: T - parameters: FunctionParamsToDescriptor< - Params<(typeof queries)[T]>, - IQueryDescriptor - > -} - export type IFormFieldMapping = { mutation?: IFormFieldMutationMapFunction query?: IFormFieldQueryMapFunction @@ -471,7 +453,7 @@ export type DependencyInfo = { } export type InitialValue = IFormFieldValue | DependencyInfo -export interface IFormFieldBase { +interface IFormFieldBase { name: string type: IFormField['type'] label: MessageDescriptor @@ -565,7 +547,7 @@ export interface IRadioGroupWithNestedFieldsFormField nestedFields: INestedInputFields } -export interface IInformativeRadioGroupFormField extends IFormFieldBase { +interface IInformativeRadioGroupFormField extends IFormFieldBase { type: typeof INFORMATIVE_RADIO_GROUP information: IFormSectionData dynamicInformationRetriever?: (obj: any) => IFormSectionData @@ -577,22 +559,22 @@ export interface ITextFormField extends IFormFieldBase { maxLength?: number dependency?: string } -export interface IHiddenFormField extends IFormFieldBase { +interface IHiddenFormField extends IFormFieldBase { type: typeof HIDDEN } -export interface ITelFormField extends IFormFieldBase { +interface ITelFormField extends IFormFieldBase { type: typeof TEL isSmallSized?: boolean } -export interface INumberFormField extends IFormFieldBase { +interface INumberFormField extends IFormFieldBase { type: typeof NUMBER step?: number max?: number inputWidth?: number maxLength?: number } -export interface IBigNumberFormField extends IFormFieldBase { +interface IBigNumberFormField extends IFormFieldBase { type: typeof BIG_NUMBER step?: number } @@ -610,26 +592,26 @@ export interface IDateFormField extends IFormFieldBase { notice?: MessageDescriptor ignorePlaceHolder?: boolean } -export interface IDateRangePickerFormField extends IFormFieldBase { +interface IDateRangePickerFormField extends IFormFieldBase { type: typeof DATE_RANGE_PICKER notice?: MessageDescriptor ignorePlaceHolder?: boolean } -export interface ITextareaFormField extends IFormFieldBase { +interface ITextareaFormField extends IFormFieldBase { type: typeof TEXTAREA maxLength?: number } -export interface ISubsectionFormField extends IFormFieldBase { +interface ISubsectionFormField extends IFormFieldBase { type: typeof SUBSECTION_HEADER } -export interface IDividerFormField extends IFormFieldBase { +interface IDividerFormField extends IFormFieldBase { type: typeof DIVIDER } -export interface IFieldGroupTitleField extends IFormFieldBase { +interface IFieldGroupTitleField extends IFormFieldBase { type: typeof FIELD_GROUP_TITLE } -export interface IDocumentsFormField extends IFormFieldBase { +interface IDocumentsFormField extends IFormFieldBase { type: typeof DOCUMENTS } export interface IListFormField extends IFormFieldBase { @@ -641,11 +623,11 @@ export interface IDynamicListFormField extends IFormFieldBase { type: typeof DYNAMIC_LIST dynamicItems: IDynamicItems } -export interface IParagraphFormField extends IFormFieldBase { +interface IParagraphFormField extends IFormFieldBase { type: typeof PARAGRAPH fontVariant?: string } -export interface IImageUploaderWithOptionsFormField extends IFormFieldBase { +interface IImageUploaderWithOptionsFormField extends IFormFieldBase { type: typeof IMAGE_UPLOADER_WITH_OPTIONS optionSection: IFormSection } @@ -657,12 +639,12 @@ export interface IDocumentUploaderWithOptionsFormField extends IFormFieldBase { optionCondition?: string hideOnEmptyOption?: boolean } -export interface ISimpleDocumentUploaderFormField extends IFormFieldBase { +interface ISimpleDocumentUploaderFormField extends IFormFieldBase { type: typeof SIMPLE_DOCUMENT_UPLOADER allowedDocType?: string[] } -export interface ILocationSearchInputFormField extends IFormFieldBase { +interface ILocationSearchInputFormField extends IFormFieldBase { type: typeof LOCATION_SEARCH_INPUT searchableResource: Array< Extract @@ -673,11 +655,11 @@ export interface ILocationSearchInputFormField extends IFormFieldBase { dynamicOptions?: IDynamicOptions } -export interface IWarningField extends IFormFieldBase { +interface IWarningField extends IFormFieldBase { type: typeof WARNING } -export interface ILink extends IFormFieldBase { +interface ILink extends IFormFieldBase { type: typeof LINK } @@ -711,7 +693,7 @@ export interface ILoaderButton extends IFormFieldBase { errorTitle: MessageDescriptor } -export interface ITimeFormFIeld extends IFormFieldBase { +interface ITimeFormFIeld extends IFormFieldBase { type: typeof TIME ignorePlaceHolder?: boolean } @@ -909,11 +891,6 @@ export type IMutationDescriptor = | MutationFactoryOperation | MutationDefaultOperation -export type X = FunctionParamsToDescriptor< - Params<(typeof mutations)['eventLocationMutationTransformer']>, - IMutationDescriptor -> - // Initial type as it's always used as an object. // @todo should be stricter than this export type TransformedData = { [key: string]: any } @@ -945,15 +922,8 @@ export enum UserSection { Preview = 'preview' } -export enum AdvancedSearchSection { - Birth = 'birth', - Death = 'death' -} - export enum CertificateSection { - Collector = 'collector', - CollectCertificate = 'collectCertificate', - CollectDeathCertificate = 'collectDeathCertificate' + Collector = 'collector' } export enum CorrectionSection { @@ -972,7 +942,7 @@ export enum ReviewSection { Review = 'review' } -export enum RegistrationSection { +enum RegistrationSection { Registration = 'registration' } @@ -1031,12 +1001,7 @@ export interface ISerializedForm { sections: ISerializedFormSection[] } -export interface Ii18nSelectOption { - value: string - label: string -} - -export interface Ii18nFormFieldBase { +interface Ii18nFormFieldBase { name: string type: Ii18nFormField['type'] label: string @@ -1061,7 +1026,7 @@ export interface Ii18nFormFieldBase { dependsOn?: string[] } -export interface Ii18nSelectFormField extends Ii18nFormFieldBase { +interface Ii18nSelectFormField extends Ii18nFormFieldBase { type: typeof SELECT_WITH_OPTIONS optionCondition?: string options: SelectComponentOption[] @@ -1114,11 +1079,11 @@ export interface Ii18nTextFormField extends Ii18nFormFieldBase { export interface Ii18nHiddenFormField extends Ii18nFormFieldBase { type: typeof HIDDEN } -export interface Ii18nTelFormField extends Ii18nFormFieldBase { +interface Ii18nTelFormField extends Ii18nFormFieldBase { type: typeof TEL isSmallSized?: boolean } -export interface Ii18nNumberFormField extends Ii18nFormFieldBase { +interface Ii18nNumberFormField extends Ii18nFormFieldBase { type: typeof NUMBER step?: number max?: number @@ -1126,58 +1091,57 @@ export interface Ii18nNumberFormField extends Ii18nFormFieldBase { maxLength?: number } -export interface Ii18nBigNumberFormField extends Ii18nFormFieldBase { +interface Ii18nBigNumberFormField extends Ii18nFormFieldBase { type: typeof BIG_NUMBER step?: number } -export interface Ii18nCheckboxGroupFormField extends Ii18nFormFieldBase { +interface Ii18nCheckboxGroupFormField extends Ii18nFormFieldBase { type: typeof CHECKBOX_GROUP options: CheckboxComponentOption[] } -export interface Ii18nCheckboxFormField extends Ii18nFormFieldBase { +interface Ii18nCheckboxFormField extends Ii18nFormFieldBase { type: typeof CHECKBOX checkedValue?: 'true' | 'false' | boolean uncheckedValue?: 'true' | 'false' | boolean } -export interface Ii18nDateFormField extends Ii18nFormFieldBase { +interface Ii18nDateFormField extends Ii18nFormFieldBase { type: typeof DATE notice?: string ignorePlaceHolder?: boolean } -export interface Ii18nDateRangePickerFormField extends Ii18nFormFieldBase { +interface Ii18nDateRangePickerFormField extends Ii18nFormFieldBase { type: typeof DATE_RANGE_PICKER notice?: string ignorePlaceHolder?: boolean } -export interface Ii18nTextareaFormField extends Ii18nFormFieldBase { +interface Ii18nTextareaFormField extends Ii18nFormFieldBase { type: typeof TEXTAREA maxLength?: number } -export interface Ii18nSubsectionFormField extends Ii18nFormFieldBase { +interface Ii18nSubsectionFormField extends Ii18nFormFieldBase { type: typeof SUBSECTION_HEADER } -export interface Ii18nFieldGroupTitleField extends Ii18nFormFieldBase { +interface Ii18nFieldGroupTitleField extends Ii18nFormFieldBase { type: typeof FIELD_GROUP_TITLE } -export interface Ii18nDocumentsFormField extends Ii18nFormFieldBase { +interface Ii18nDocumentsFormField extends Ii18nFormFieldBase { type: typeof DOCUMENTS } -export interface Ii18nListFormField extends Ii18nFormFieldBase { +interface Ii18nListFormField extends Ii18nFormFieldBase { type: typeof BULLET_LIST items: string[] } -export interface Ii18nParagraphFormField extends Ii18nFormFieldBase { +interface Ii18nParagraphFormField extends Ii18nFormFieldBase { type: typeof PARAGRAPH fontVariant?: IFont } -export interface Ii18nImageUploaderWithOptionsFormField - extends Ii18nFormFieldBase { +interface Ii18nImageUploaderWithOptionsFormField extends Ii18nFormFieldBase { type: typeof IMAGE_UPLOADER_WITH_OPTIONS optionSection: IFormSection } -export interface Ii18nDocumentUploaderWithOptions extends Ii18nFormFieldBase { +interface Ii18nDocumentUploaderWithOptions extends Ii18nFormFieldBase { type: typeof DOCUMENT_UPLOADER_WITH_OPTION options: SelectComponentOption[] optionCondition?: string @@ -1185,13 +1149,12 @@ export interface Ii18nDocumentUploaderWithOptions extends Ii18nFormFieldBase { maxSizeMB?: number hideOnEmptyOption?: boolean } -export interface Ii18nSimpleDocumentUploaderFormField - extends Ii18nFormFieldBase { +interface Ii18nSimpleDocumentUploaderFormField extends Ii18nFormFieldBase { type: typeof SIMPLE_DOCUMENT_UPLOADER allowedDocType?: string[] } -export interface Ii18nLocationSearchInputFormField extends Ii18nFormFieldBase { +interface Ii18nLocationSearchInputFormField extends Ii18nFormFieldBase { type: typeof LOCATION_SEARCH_INPUT searchableResource: Array< Extract @@ -1203,15 +1166,15 @@ export interface Ii18nLocationSearchInputFormField extends Ii18nFormFieldBase { dynamicOptions?: IDynamicOptions } -export interface Ii18nWarningField extends Ii18nFormFieldBase { +interface Ii18nWarningField extends Ii18nFormFieldBase { type: typeof WARNING } -export interface Ii18nLinkField extends Ii18nFormFieldBase { +interface Ii18nLinkField extends Ii18nFormFieldBase { type: typeof LINK } -export interface Ii18nLoaderButtonField extends Ii18nFormFieldBase { +interface Ii18nLoaderButtonField extends Ii18nFormFieldBase { type: typeof FETCH_BUTTON queryMap: IQueryMap queryData?: IQuery @@ -1224,20 +1187,20 @@ export interface Ii18nLoaderButtonField extends Ii18nFormFieldBase { networkErrorText: string } -export interface I18nDividerField extends Ii18nFormFieldBase { +interface I18nDividerField extends Ii18nFormFieldBase { type: typeof DIVIDER } -export interface I18nHeading3Field extends Ii18nFormFieldBase { +interface I18nHeading3Field extends Ii18nFormFieldBase { type: typeof HEADING3 } -export interface Ii18nTimeFormField extends Ii18nFormFieldBase { +interface Ii18nTimeFormField extends Ii18nFormFieldBase { type: typeof TIME ignorePlaceHolder?: boolean } -export interface Ii18nSignatureField extends Ii18nFormFieldBase { +interface Ii18nSignatureField extends Ii18nFormFieldBase { type: typeof SIGNATURE maxSizeMb?: number allowedFileFormats?: ( @@ -1248,7 +1211,7 @@ export interface Ii18nSignatureField extends Ii18nFormFieldBase { )[] } -export interface Ii18nHttpFormField extends Ii18nFormFieldBase { +interface Ii18nHttpFormField extends Ii18nFormFieldBase { type: typeof HTTP options: { headers: Record @@ -1267,7 +1230,7 @@ export interface Ii18nButtonFormField extends Ii18nFormFieldBase { } } -export interface Ii18nRedirectFormField extends Ii18nFormFieldBase { +interface Ii18nRedirectFormField extends Ii18nFormFieldBase { type: typeof REDIRECT options: { url: string diff --git a/packages/client/src/forms/register/declaration-selectors.ts b/packages/client/src/forms/register/declaration-selectors.ts index e1a7692b845..151c0d8cff5 100644 --- a/packages/client/src/forms/register/declaration-selectors.ts +++ b/packages/client/src/forms/register/declaration-selectors.ts @@ -43,7 +43,7 @@ export const getEventRegisterForm = (state: IStoreState, event: Event) => { return getRegisterForm(state)[event] } -export const getRegisterFormSection = ( +const getRegisterFormSection = ( state: IStoreState, key: Section | string, event: Event diff --git a/packages/client/src/forms/register/reducer.ts b/packages/client/src/forms/register/reducer.ts index 667a6cfd0d4..89936df2ff2 100644 --- a/packages/client/src/forms/register/reducer.ts +++ b/packages/client/src/forms/register/reducer.ts @@ -28,7 +28,7 @@ export type IRegisterFormState = } } -export const initialState: IRegisterFormState = { +const initialState: IRegisterFormState = { state: 'LOADING', registerForm: null } diff --git a/packages/client/src/forms/register/reviewReducer.ts b/packages/client/src/forms/register/reviewReducer.ts index 3cf7efcd5ea..26160883ede 100644 --- a/packages/client/src/forms/register/reviewReducer.ts +++ b/packages/client/src/forms/register/reviewReducer.ts @@ -28,7 +28,7 @@ export type IReviewFormState = } } -export const initialState: IReviewFormState = { +const initialState: IReviewFormState = { state: 'LOADING', reviewForm: null } diff --git a/packages/client/src/forms/user/fieldDefinitions/createUser.ts b/packages/client/src/forms/user/fieldDefinitions/createUser.ts index d89a71dfc8b..bffeb68e9c8 100644 --- a/packages/client/src/forms/user/fieldDefinitions/createUser.ts +++ b/packages/client/src/forms/user/fieldDefinitions/createUser.ts @@ -19,7 +19,7 @@ import { } from '@client/forms/index' import { messages as userFormMessages } from '@client/i18n/messages/views/userForm' -export function userSectionFormType(): ISerializedFormSection { +function userSectionFormType(): ISerializedFormSection { return { id: UserSection.User, viewType: 'form', @@ -240,7 +240,7 @@ const getPreviewGroups = () => { }) } -export const userSectionPreviewType: ISerializedFormSection = { +const userSectionPreviewType: ISerializedFormSection = { id: UserSection.Preview, viewType: 'preview', name: userFormMessages.userFormReviewTitle, diff --git a/packages/client/src/forms/user/query/queries.ts b/packages/client/src/forms/user/query/queries.ts index 58d5e49cf40..50edf19f041 100644 --- a/packages/client/src/forms/user/query/queries.ts +++ b/packages/client/src/forms/user/query/queries.ts @@ -27,13 +27,6 @@ export const getSystemRolesQuery = gql` } ` -export const updateRoleQuery = gql` - mutation updateRole($systemRole: SystemRoleInput) { - updateRole(systemRole: $systemRole) { - roleIdMap - } - } -` async function fetchRoles(criteria = {}) { return ( client && diff --git a/packages/client/src/forms/utils.ts b/packages/client/src/forms/utils.ts index 9c7e35dd56f..1de494ea076 100644 --- a/packages/client/src/forms/utils.ts +++ b/packages/client/src/forms/utils.ts @@ -100,7 +100,7 @@ interface IRange { value: string } -export const internationaliseOptions = ( +const internationaliseOptions = ( intl: IntlShape, options: Array ) => { @@ -115,7 +115,7 @@ export const internationaliseOptions = ( }) } -export const internationaliseListFieldObject = ( +const internationaliseListFieldObject = ( intl: IntlShape, options: MessageDescriptor[] ) => { @@ -202,7 +202,7 @@ export const internationaliseFieldObject = ( return base as Ii18nFormField } -export const generateOptions = ( +const generateOptions = ( options: ILocation[], optionType: string ): ISelectOption[] => { @@ -524,7 +524,7 @@ interface IVars { [key: string]: any } -export function getInputValues( +function getInputValues( inputs: IFieldInput[], values: IFormSectionData ): IDynamicValues { @@ -716,13 +716,11 @@ export const isRadioGroupWithNestedField = ( return field.type === RADIO_GROUP_WITH_NESTED_FIELDS } -export const isDynamicField = ( - field: IFormField -): field is IDynamicFormField => { +const isDynamicField = (field: IFormField): field is IDynamicFormField => { return field.type === FIELD_WITH_DYNAMIC_DEFINITIONS } -export const isDateField = ( +const isDateField = ( field: IFormField, sectionData: IFormSectionData ): field is IDateFormField => { @@ -778,7 +776,7 @@ export function isFieldRedirect( return field.type === REDIRECT } -export function isInitialValueDependencyInfo( +function isInitialValueDependencyInfo( value: InitialValue ): value is DependencyInfo { return typeof value === 'object' && value !== null && 'dependsOn' in value diff --git a/packages/client/src/i18n/reducer.ts b/packages/client/src/i18n/reducer.ts index 848404efb37..b55513f90b3 100644 --- a/packages/client/src/i18n/reducer.ts +++ b/packages/client/src/i18n/reducer.ts @@ -45,7 +45,7 @@ export type IntlState = { languages: ILanguageState } -export const initLanguages = () => { +const initLanguages = () => { const initLanguages: ILanguageState = {} getAvailableLanguages().forEach((lang) => { initLanguages[lang] = { diff --git a/packages/client/src/navigation/index.ts b/packages/client/src/navigation/index.ts index 886a57da816..4dc272f1a92 100644 --- a/packages/client/src/navigation/index.ts +++ b/packages/client/src/navigation/index.ts @@ -408,12 +408,6 @@ export function goToIssueCertificatePayment( ) } -export function goToDeathRegistration(declarationId: string) { - return push( - formatUrl(DRAFT_DEATH_FORM, { declarationId: declarationId.toString() }) - ) -} - export function goToSettings() { return push(SETTINGS) } diff --git a/packages/client/src/offline/actions.ts b/packages/client/src/offline/actions.ts index a6d2398d83b..14b5e8b9e0b 100644 --- a/packages/client/src/offline/actions.ts +++ b/packages/client/src/offline/actions.ts @@ -267,13 +267,6 @@ export const configLoaded = ( payload: payload }) -export const certificateLoadFailed = ( - payload: CertificateLoadFailedAction['payload'] -): CertificateLoadFailedAction => ({ - type: CERTIFICATE_LOAD_FAILED, - payload -}) - export const certificateConfigurationLoaded = ( payload: CertificateConfiguration ): CertificateConfigurationLoadedAction => ({ @@ -293,12 +286,6 @@ export const configFailed = (error: Error): ApplicationConfigFailedAction => ({ payload: error }) -export const updateOfflineConfigData = (payload: { - config: IApplicationConfig -}): ApplicationConfigUpdatedAction => ({ - type: UPDATE_OFFLINE_CONFIG, - payload: payload -}) export const updateOfflineSystems = (payload: { systems: System[] }): UpdateOfflineSystemsAction => ({ diff --git a/packages/client/src/offline/reducer.ts b/packages/client/src/offline/reducer.ts index 41adfb050cd..af5d8ca3ccc 100644 --- a/packages/client/src/offline/reducer.ts +++ b/packages/client/src/offline/reducer.ts @@ -138,11 +138,6 @@ async function saveOfflineData(offlineData: IOfflineData) { return storage.setItem('offline', JSON.stringify(offlineData)) } -export type CertificatePayload = { - svgCode: string - event: Event -} - function checkIfDone( oldState: IOfflineDataState, loopOrState: IOfflineDataState | Loop diff --git a/packages/client/src/tests/mock-graphql-responses.ts b/packages/client/src/tests/mock-graphql-responses.ts index 7587a971312..06f67f06817 100644 --- a/packages/client/src/tests/mock-graphql-responses.ts +++ b/packages/client/src/tests/mock-graphql-responses.ts @@ -9,8 +9,6 @@ * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. */ -import { GET_BIRTH_REGISTRATION_FOR_CERTIFICATE } from '@client/views/DataProvider/birth/queries' - export const birthDeclarationForReview = { _fhirIDMap: { composition: 'ab6123f6-0fce-43f2-a973-c538d04de741', @@ -262,408 +260,3 @@ export const birthDeclarationForReview = { ], __typename: 'BirthRegistration' } - -// late birth registration with father details -export const lateBirthCertificationResponseWithFather = [ - { - request: { - query: GET_BIRTH_REGISTRATION_FOR_CERTIFICATE, - variables: { id: '6a5fd35d-01ec-4c37-976e-e055107a74a1' } - }, - result: { - data: { - fetchBirthRegistration: { - _fhirIDMap: { - composition: '4a2fcc2a-d5f5-46e2-9d55-0a6fb0dca5b1', - encounter: '733fe804-cff3-40dc-a7c9-5e5c5ecf1ad7', - eventLocation: 'ecc82ed2-960d-4a92-9c42-67cace118a02', - observation: { - birthType: '960244b5-6ec2-4ee5-8ba2-ce282df1c086', - weightAtBirth: '31121f4b-dd91-46c1-9395-5e39e6b2c7cc', - attendantAtBirth: '40b1fa41-3ced-4288-b303-f7badc2d8c3b' - } - }, - id: '4a2fcc2a-d5f5-46e2-9d55-0a6fb0dca5b1', - child: { - id: 'cfa8b077-b0cf-4dce-9e04-78dc7aa37380', - multipleBirth: 1, - name: [ - { - use: 'en', - firstNames: 'Son', - familyName: 'Heung Min', - __typename: 'HumanName' - } - ], - birthDate: '2021-12-23', - gender: 'male', - __typename: 'Person' - }, - informant: { - id: '7ac5c5de-ecfb-40e4-bf02-53c7f726ca18', - relationship: 'MOTHER', - otherRelationship: null, - individual: null, - __typename: 'RelatedPerson' - }, - mother: { - id: 'e62684c0-be5c-45d7-a89f-c0f01f165aa1', - name: [ - { - use: 'en', - firstNames: 'Sally', - familyName: 'Heung Min', - __typename: 'HumanName' - } - ], - birthDate: '1990-02-02', - maritalStatus: 'MARRIED', - occupation: null, - detailsExist: true, - reasonNotApplying: null, - dateOfMarriage: null, - educationalAttainment: 'POST_SECONDARY_ISCED_4', - nationality: ['FAR'], - identifier: [ - { - id: '321654987', - type: 'NATIONAL_ID', - otherType: null, - __typename: 'IdentityType' - } - ], - address: [ - { - type: 'PLACE_OF_HERITAGE', - line: ['', '', '', '', '', ''], - district: '15be3bed-10e9-4a09-b195-cbb54a47eccb', - state: 'f050a94e-4e61-4cfb-a9ac-b3e96096e267', - city: null, - postalCode: null, - country: 'FAR', - __typename: 'Address' - }, - { - type: 'PERMANENT', - line: ['', '', '', '', '', '', 'URBAN'], - district: '039a4bcd-2c24-4210-a833-5bfe38ae07d6', - state: '169981c1-89af-44f9-906a-bf783028ed14', - city: null, - postalCode: null, - country: 'FAR', - __typename: 'Address' - }, - { - type: 'CURRENT', - line: ['', '', '', '', '', '', 'URBAN'], - district: '039a4bcd-2c24-4210-a833-5bfe38ae07d6', - state: '169981c1-89af-44f9-906a-bf783028ed14', - city: null, - postalCode: null, - country: 'FAR', - __typename: 'Address' - } - ], - telecom: null, - __typename: 'Person' - }, - father: { - id: 'e62684c0-be5c-45d7-a89f-c0f01f165aa1', - name: [ - { - use: 'en', - firstNames: 'Frank', - familyName: 'Heung Min', - __typename: 'HumanName' - } - ], - birthDate: '1990-02-02', - maritalStatus: 'MARRIED', - occupation: null, - detailsExist: true, - reasonNotApplying: null, - dateOfMarriage: null, - educationalAttainment: 'POST_SECONDARY_ISCED_4', - nationality: ['FAR'], - identifier: [ - { - id: '321654987', - type: 'NATIONAL_ID', - otherType: null, - __typename: 'IdentityType' - } - ], - address: [ - { - type: 'PLACE_OF_HERITAGE', - line: ['', '', '', '', '', ''], - district: '15be3bed-10e9-4a09-b195-cbb54a47eccb', - state: 'f050a94e-4e61-4cfb-a9ac-b3e96096e267', - city: null, - postalCode: null, - country: 'FAR', - __typename: 'Address' - }, - { - type: 'PERMANENT', - line: ['', '', '', '', '', '', 'URBAN'], - district: '039a4bcd-2c24-4210-a833-5bfe38ae07d6', - state: '169981c1-89af-44f9-906a-bf783028ed14', - city: null, - postalCode: null, - country: 'FAR', - __typename: 'Address' - }, - { - type: 'CURRENT', - line: ['', '', '', '', '', '', 'URBAN'], - district: '039a4bcd-2c24-4210-a833-5bfe38ae07d6', - state: '169981c1-89af-44f9-906a-bf783028ed14', - city: null, - postalCode: null, - country: 'FAR', - __typename: 'Address' - } - ], - telecom: null, - __typename: 'Person' - }, - registration: { - id: '850a6503-5f86-4412-8496-b91eb1cdd34f', - informantType: 'MOTHER', - otherInformantType: null, - contact: 'FATHER', - contactRelationship: null, - contactPhoneNumber: '+260787877877', - attachments: null, - status: [ - { - comments: null, - type: 'REGISTERED', - timestamp: '2022-04-14T12:52:25.151Z', - __typename: 'RegWorkflow' - }, - { - comments: null, - type: 'REGISTERED', - timestamp: '2022-04-14T12:52:25.151Z', - __typename: 'RegWorkflow' - }, - { - comments: null, - type: 'WAITING_VALIDATION', - timestamp: '2022-04-14T12:52:25.151Z', - __typename: 'RegWorkflow' - } - ], - type: 'BIRTH', - trackingId: 'BHEOYEI', - registrationNumber: '2022BHEOYEI', - __typename: 'Registration' - }, - attendantAtBirth: 'PHYSICIAN', - weightAtBirth: 4, - birthType: 'SINGLE', - eventLocation: { - type: 'HEALTH_FACILITY', - address: { - line: [], - district: null, - state: null, - city: null, - postalCode: null, - country: null, - __typename: 'Address' - }, - __typename: 'Location' - }, - questionnaire: null, - history: [ - { - date: '2022-04-14T12:52:34.112+00:00', - action: 'DOWNLOADED', - reinstated: false, - statusReason: null, - location: { - id: '852b103f-2fe0-4871-a323-51e51c6d9198', - name: 'Ibombo', - __typename: 'Location' - }, - office: { - id: '204f706f-e097-4394-9d12-bd50f057f923', - name: 'Ibombo District Office', - __typename: 'Location' - }, - user: { - id: '6241918dd6dc544f60d8f73a', - role: 'CHAIRMAN', - systemRole: 'LOCAL_REGISTRAR', - name: [ - { - firstNames: 'Kennedy', - familyName: 'Mweene', - use: 'en', - __typename: 'HumanName' - } - ], - avatar: null, - __typename: 'User' - }, - signature: null, - comments: [], - input: [], - output: [], - certificates: null, - __typename: 'History' - }, - { - date: '2022-04-14T12:52:25.951+00:00', - action: 'REGISTERED', - reinstated: false, - statusReason: null, - location: { - id: '852b103f-2fe0-4871-a323-51e51c6d9198', - name: 'Ibombo', - __typename: 'Location' - }, - office: { - id: '204f706f-e097-4394-9d12-bd50f057f923', - name: 'Ibombo District Office', - __typename: 'Location' - }, - user: { - id: '6241918dd6dc544f60d8f73a', - role: 'CHAIRMAN', - systemRole: 'LOCAL_REGISTRAR', - name: [ - { - firstNames: 'Kennedy', - familyName: 'Mweene', - use: 'en', - __typename: 'HumanName' - } - ], - avatar: null, - __typename: 'User' - }, - signature: { - data: 'data:image/png;base64,iVBORw0KGgoAAA', - type: 'image/png' - }, - comments: [], - input: [], - output: [], - certificates: null, - __typename: 'History' - }, - { - date: '2022-04-14T12:52:25.798+00:00', - action: 'WAITING_VALIDATION', - reinstated: false, - statusReason: null, - location: { - id: '852b103f-2fe0-4871-a323-51e51c6d9198', - name: 'Ibombo', - __typename: 'Location' - }, - office: { - id: '204f706f-e097-4394-9d12-bd50f057f923', - name: 'Ibombo District Office', - __typename: 'Location' - }, - user: { - id: '6241918dd6dc544f60d8f73a', - role: 'CHAIRMAN', - systemRole: 'LOCAL_REGISTRAR', - name: [ - { - firstNames: 'Kennedy', - familyName: 'Mweene', - use: 'en', - __typename: 'HumanName' - } - ], - avatar: null, - __typename: 'User' - }, - signature: null, - comments: [], - input: [], - output: [], - certificates: null, - __typename: 'History' - } - ], - __typename: 'BirthRegistration' - } - } - } - } -] - -export const informantSMSNotificationMock = [ - { - id: '63a30240ee4b270dc91f53d0', - name: 'birthInProgressSMS', - enabled: true, - updatedAt: '1671688043153', - createdAt: '1671627328205', - __typename: 'SMSNotification' - }, - { - id: '63a30240ee4b270dc91f53d1', - name: 'birthDeclarationSMS', - enabled: false, - updatedAt: '1671688046478', - createdAt: '1671627328205', - __typename: 'SMSNotification' - }, - { - id: '63a30240ee4b270dc91f53d2', - name: 'birthRegistrationSMS', - enabled: true, - updatedAt: '1671627328205', - createdAt: '1671627328205', - __typename: 'SMSNotification' - }, - { - id: '63a30240ee4b270dc91f53d3', - name: 'birthRejectionSMS', - enabled: true, - updatedAt: '1671627328205', - createdAt: '1671627328205', - __typename: 'SMSNotification' - }, - { - id: '63a30240ee4b270dc91f53d4', - name: 'deathInProgressSMS', - enabled: true, - updatedAt: '1671627328205', - createdAt: '1671627328205', - __typename: 'SMSNotification' - }, - { - id: '63a30240ee4b270dc91f53d5', - name: 'deathDeclarationSMS', - enabled: true, - updatedAt: '1671627328205', - createdAt: '1671627328205', - __typename: 'SMSNotification' - }, - { - id: '63a30240ee4b270dc91f53d6', - name: 'deathRegistrationSMS', - enabled: true, - updatedAt: '1671627328205', - createdAt: '1671627328205', - __typename: 'SMSNotification' - }, - { - id: '63a30240ee4b270dc91f53d7', - name: 'deathRejectionSMS', - enabled: true, - updatedAt: '1671627328205', - createdAt: '1671627328205', - __typename: 'SMSNotification' - } -] diff --git a/packages/client/src/tests/mock-offline-data.ts b/packages/client/src/tests/mock-offline-data.ts index 25da8514b92..24a34b559de 100644 --- a/packages/client/src/tests/mock-offline-data.ts +++ b/packages/client/src/tests/mock-offline-data.ts @@ -20,7 +20,7 @@ import type { export const validImageB64String = 'iVBORw0KGgoAAAANSUhEUgAAAAgAAAACCAYAAABllJ3tAAAABHNCSVQICAgIfAhkiAAAABl0RVh0U29mdHdhcmUAZ25vbWUtc2NyZWVuc2hvdO8Dvz4AAAAXSURBVAiZY1RWVv7PgAcw4ZNkYGBgAABYyAFsic1CfAAAAABJRU5ErkJggg==' -export const systems: System[] = [ +const systems: System[] = [ { name: 'WebHook 1', status: SystemStatus.Active, diff --git a/packages/client/src/tests/util.tsx b/packages/client/src/tests/util.tsx index 4e49085df6e..916ee33f292 100644 --- a/packages/client/src/tests/util.tsx +++ b/packages/client/src/tests/util.tsx @@ -218,7 +218,7 @@ export const selectOption = ( return input.find('.react-select__control') } -export const eventAddressData = { +const eventAddressData = { country: 'FAR', state: 'bac22b09-1260-4a59-a5b9-c56c43ae889c', district: '852b103f-2fe0-4871-a323-51e51c6d9198', @@ -238,7 +238,7 @@ export const eventAddressData = { internationalPostalCode: '' } -export const primaryAddressData = { +const primaryAddressData = { primaryAddress: '', countryPrimary: 'FAR', statePrimary: 'bac22b09-1260-4a59-a5b9-c56c43ae889c', @@ -252,7 +252,7 @@ export const primaryAddressData = { addressLine5Primary: 'my village' } -export const secondaryAddressData = { +const secondaryAddressData = { secondaryAddress: '', countrySecondary: 'FAR', stateSecondary: 'bac22b09-1260-4a59-a5b9-c56c43ae889c', @@ -266,7 +266,7 @@ export const secondaryAddressData = { addressLine5Secondary: '' } -export const primaryInternationalAddressLines = { +const primaryInternationalAddressLines = { internationalStatePrimary: 'ujggiu', internationalDistrictPrimary: 'iuoug', internationalCityPrimary: '', @@ -276,7 +276,7 @@ export const primaryInternationalAddressLines = { internationalPostalCodePrimary: '' } -export const secondaryInternationalAddressLines = { +const secondaryInternationalAddressLines = { internationalStateSecondary: 'ugou', internationalDistrictSecondary: 'iugoug', internationalCitySecondary: '', @@ -444,7 +444,7 @@ export const mockRegistrarUserResponse = { } } -export function appendStringToKeys( +function appendStringToKeys( obj: Record, appendString: string ): Record { diff --git a/packages/client/src/user/userReducer.ts b/packages/client/src/user/userReducer.ts index 4c1f4a413ef..6b520204dc4 100644 --- a/packages/client/src/user/userReducer.ts +++ b/packages/client/src/user/userReducer.ts @@ -178,7 +178,7 @@ export interface IRoleLoadedAction { } } -export function rolesLoaded(systemRoles: SystemRole[]): IRoleLoadedAction { +function rolesLoaded(systemRoles: SystemRole[]): IRoleLoadedAction { return { type: ROLES_LOADED, payload: { diff --git a/packages/client/src/utils/authUtils.ts b/packages/client/src/utils/authUtils.ts index f89b9194929..3e1f435f59c 100644 --- a/packages/client/src/utils/authUtils.ts +++ b/packages/client/src/utils/authUtils.ts @@ -65,13 +65,7 @@ export const getTokenPayload = (token: string) => { return decoded } -export function getCurrentUserScope() { - const token = getToken() - const payload = token && getTokenPayload(token) - return (payload && payload.scope) || [] -} - -export function isTokenAboutToExpire(token: string) { +function isTokenAboutToExpire(token: string) { const payload = token && getTokenPayload(token) const payloadExpMillis = Number(payload && payload.exp) * 1000 return payloadExpMillis - Date.now() <= TOKEN_EXPIRE_MILLIS @@ -101,7 +95,7 @@ export async function refreshToken() { return true } -export const enum AuthScope { +const enum AuthScope { DECLARE = 'declare', REGISTER = 'register', CERTIFY = 'certify', @@ -111,13 +105,6 @@ export const enum AuthScope { NATLSYSADMIN = 'natlsysadmin' } -export const hasNatlSysAdminScope = (scope: Scope | null): boolean => { - if (scope?.includes(AuthScope.NATLSYSADMIN)) { - return true - } - return false -} - export const hasRegisterScope = (scope: Scope | null): boolean => { if (scope?.includes(AuthScope.REGISTER)) { return true diff --git a/packages/client/src/utils/constants.ts b/packages/client/src/utils/constants.ts index 62486a37cf3..f6bcaff1375 100644 --- a/packages/client/src/utils/constants.ts +++ b/packages/client/src/utils/constants.ts @@ -50,7 +50,7 @@ export const REGISTRAR_ROLES = [ ROLE_REGISTRATION_AGENT ] -export const MARRIAGE_SIGNATURE_KEYS = [ +const MARRIAGE_SIGNATURE_KEYS = [ 'groomSignature', 'brideSignature', 'witnessOneSignature', @@ -63,7 +63,6 @@ export const SIGNATURE_KEYS = [ ] as const export const PAGE_TRANSITIONS_CLASSNAME = 'page-transition' -export const PAGE_TRANSITIONS_TIMING_FUNC_N_FILL_MODE = 'ease-in-out both' export const PAGE_TRANSITIONS_ENTER_TIME = 500 export const PAGE_TRANSITIONS_EXIT_TIME = PAGE_TRANSITIONS_ENTER_TIME - 10 diff --git a/packages/client/src/utils/data-formatting.ts b/packages/client/src/utils/data-formatting.ts index 57082f2a4fb..001daa8bec9 100644 --- a/packages/client/src/utils/data-formatting.ts +++ b/packages/client/src/utils/data-formatting.ts @@ -63,11 +63,6 @@ export const extractCommentFragmentValue = ( return fragmentValue } -export const sentenceCase = (str: string): string => - str.replace(/\w\S*/g, (txt: string) => { - return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase() - }) - export const mergeArraysRemovingEmptyStrings = ( strArrayA: string[], strArrayB: string[] diff --git a/packages/client/src/utils/gateway.ts b/packages/client/src/utils/gateway.ts index 346bcd017b6..e80a30f3b62 100644 --- a/packages/client/src/utils/gateway.ts +++ b/packages/client/src/utils/gateway.ts @@ -2322,15 +2322,6 @@ export type GetSystemRolesQuery = { }> | null } -export type UpdateRoleMutationVariables = Exact<{ - systemRole?: InputMaybe -}> - -export type UpdateRoleMutation = { - __typename?: 'Mutation' - updateRole: { __typename?: 'Response'; roleIdMap: any } -} - export type AdvancedSeachParametersFragment = { __typename?: 'AdvancedSeachParameters' event?: Event | null diff --git a/packages/client/src/utils/persistence/persistLink.ts b/packages/client/src/utils/persistence/persistLink.ts index 50a2621e8c2..69a4d674cf0 100644 --- a/packages/client/src/utils/persistence/persistLink.ts +++ b/packages/client/src/utils/persistence/persistLink.ts @@ -91,4 +91,4 @@ class PersistLink extends ApolloLink { const createPersistLink = () => new PersistLink() -export { PersistLink, createPersistLink } +export { createPersistLink } diff --git a/packages/client/src/views/CorrectionForm/utils.ts b/packages/client/src/views/CorrectionForm/utils.ts index 46da4033219..9ecf98c0061 100644 --- a/packages/client/src/views/CorrectionForm/utils.ts +++ b/packages/client/src/views/CorrectionForm/utils.ts @@ -781,9 +781,3 @@ const getVisibleSections = ( ).length > 0 ) } - -export function labelFormatterForInformant(inputString: string) { - return ( - inputString.charAt(0) + inputString.slice(1).toLowerCase() - ).replaceAll('_', ' ') -} diff --git a/packages/client/src/views/DataProvider/QueryProvider.tsx b/packages/client/src/views/DataProvider/QueryProvider.tsx deleted file mode 100644 index d232ca8f5e3..00000000000 --- a/packages/client/src/views/DataProvider/QueryProvider.tsx +++ /dev/null @@ -1,90 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * OpenCRVS is also distributed under the terms of the Civil Registration - * & Healthcare Disclaimer located at http://opencrvs.org/license. - * - * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. - */ -import * as React from 'react' -import { WrappedComponentProps as IntlShapeProps, injectIntl } from 'react-intl' -import { Action } from '@client/forms' -import { Event } from '@client/utils/gateway' -import { getBirthQueryMappings } from '@client/views/DataProvider/birth/queries' -import { getDeathQueryMappings } from '@client/views/DataProvider/death/queries' -import { getMarriageQueryMappings } from '@client/views/DataProvider/marriage/queries' -import { Query } from '@client/components/Query' -import { WatchQueryFetchPolicy } from '@apollo/client' - -interface IQueryProviderProps { - event: Event - action: Action - payload?: any - fetchPolicy?: WatchQueryFetchPolicy - children?: React.ReactNode -} -type IProps = IQueryProviderProps & IntlShapeProps -/* Need to add mappings for events here */ -const QueryMapper = { - [Event.Birth]: getBirthQueryMappings, - [Event.Death]: getDeathQueryMappings, - [Event.Marriage]: getMarriageQueryMappings -} -export const getQueryMapping = (event: Event, action: Action) => { - return QueryMapper[event] && QueryMapper[event](action) -} - -export const QueryContext = React.createContext({ - loading: false, - error: {}, - data: {}, - dataKey: '' -}) -class QueryProviderComponent extends React.Component { - getMapping() { - const { event, action } = this.props - return QueryMapper[event] && QueryMapper[event](action) - } - - render() { - const eventQueryMapping = this.getMapping() - if (!eventQueryMapping) { - return null - } - return ( - - {({ - loading, - error, - data - }: { - loading: any - error?: any - data: any - }) => { - return ( - - {this.props.children} - - ) - }} - - ) - } -} - -export const QueryProvider = injectIntl(QueryProviderComponent) diff --git a/packages/client/src/views/DataProvider/birth/queries.ts b/packages/client/src/views/DataProvider/birth/queries.ts index d92e431c83b..a366527cbdf 100644 --- a/packages/client/src/views/DataProvider/birth/queries.ts +++ b/packages/client/src/views/DataProvider/birth/queries.ts @@ -11,7 +11,7 @@ import { gql } from '@apollo/client' import { Action, DownloadAction } from '@client/forms' -export const GET_BIRTH_REGISTRATION_FOR_REVIEW = gql` +const GET_BIRTH_REGISTRATION_FOR_REVIEW = gql` query fetchBirthRegistrationForReview($id: ID!) { fetchBirthRegistration(id: $id) { _fhirIDMap diff --git a/packages/client/src/views/DataProvider/death/queries.ts b/packages/client/src/views/DataProvider/death/queries.ts index 1f42392fb84..86aecd6e7ce 100644 --- a/packages/client/src/views/DataProvider/death/queries.ts +++ b/packages/client/src/views/DataProvider/death/queries.ts @@ -11,7 +11,7 @@ import { gql } from '@apollo/client' import { Action, DownloadAction } from '@client/forms' -export const GET_DEATH_REGISTRATION_FOR_REVIEW = gql` +const GET_DEATH_REGISTRATION_FOR_REVIEW = gql` query fetchDeathRegistrationForReview($id: ID!) { fetchDeathRegistration(id: $id) { _fhirIDMap diff --git a/packages/client/src/views/OfficeHome/OfficeHome.tsx b/packages/client/src/views/OfficeHome/OfficeHome.tsx index 6e3d10215ac..595e5b83fc0 100644 --- a/packages/client/src/views/OfficeHome/OfficeHome.tsx +++ b/packages/client/src/views/OfficeHome/OfficeHome.tsx @@ -37,7 +37,6 @@ import { FIELD_AGENT_ROLES } from '@client/utils/constants' import { Toast } from '@opencrvs/components/lib/Toast' -import { Spinner } from '@opencrvs/components/lib/Spinner' import * as React from 'react' import { injectIntl, WrappedComponentProps as IntlShapeProps } from 'react-intl' import { connect } from 'react-redux' @@ -63,10 +62,6 @@ import { getOfflineData } from '@client/offline/selectors' import { IOfflineData } from '@client/offline/reducer' import { Event } from '@client/utils/gateway' -export const StyledSpinner = styled(Spinner)` - margin: 20% auto; -` - const FABContainer = styled.div` position: fixed; right: 40px; diff --git a/packages/client/src/views/OfficeHome/utils.ts b/packages/client/src/views/OfficeHome/utils.ts index 43fccc8d3ad..819fa1f9649 100644 --- a/packages/client/src/views/OfficeHome/utils.ts +++ b/packages/client/src/views/OfficeHome/utils.ts @@ -87,19 +87,6 @@ export const changeSortedColumn = ( } } -export const getStatusWiseWQTab = (status: string) => { - switch (status) { - case 'REGISTERED': - return 'printTab' - case 'VALIDATED': - return 'approvalTab' - case 'ISSUED': - return 'issueTab' - default: - return 'reviewTab' - } -} - export const getPreviousOperationDateByOperationType = ( operationHistories: ITaskHistory[], operationType: string diff --git a/packages/client/src/views/PrintCertificate/PDFUtils.ts b/packages/client/src/views/PrintCertificate/PDFUtils.ts index 91fe857eec4..51fee86cf6b 100644 --- a/packages/client/src/views/PrintCertificate/PDFUtils.ts +++ b/packages/client/src/views/PrintCertificate/PDFUtils.ts @@ -42,7 +42,7 @@ function isMessageDescriptor( ) } -export function formatAllNonStringValues( +function formatAllNonStringValues( templateData: Record, intl: IntlShape ): Record { diff --git a/packages/client/src/views/RecordAudit/utils.ts b/packages/client/src/views/RecordAudit/utils.ts index a2f58737fe1..5abb838320e 100644 --- a/packages/client/src/views/RecordAudit/utils.ts +++ b/packages/client/src/views/RecordAudit/utils.ts @@ -26,7 +26,6 @@ import type { GQLMarriageEventSearchSet } from '@client/utils/gateway-deprecated-do-not-use' import { createNamesMap } from '@client/utils/data-formatting' -import { formatLongDate } from '@client/utils/date-formatting' import { IDynamicValues } from '@client/navigation' import { countryMessages } from '@client/i18n/messages/constants' import { @@ -293,14 +292,6 @@ const getLocation = ( return EMPTY_STRING } -export const getFormattedDate = (date: Date) => { - return formatLongDate( - date.toLocaleString(), - window.config.LANGUAGES, - 'MMMM dd, yyyy · hh.mm a' - ) -} - export const getCaptitalizedWord = (word: string | undefined): string => { if (!word) return EMPTY_STRING return word.toUpperCase()[0] + word.toLowerCase().slice(1) diff --git a/packages/client/src/views/RegisterForm/duplicate/DuplicateFormTabs.tsx b/packages/client/src/views/RegisterForm/duplicate/DuplicateFormTabs.tsx index 976bfe47959..2dafa8289c2 100644 --- a/packages/client/src/views/RegisterForm/duplicate/DuplicateFormTabs.tsx +++ b/packages/client/src/views/RegisterForm/duplicate/DuplicateFormTabs.tsx @@ -107,7 +107,7 @@ interface IComparisonDeclaration { }[] } -export const getVisibleSections = ( +const getVisibleSections = ( formSections: IFormSection[], declaration: IDeclaration ) => { diff --git a/packages/client/src/workqueue/actions.ts b/packages/client/src/workqueue/actions.ts index b8c5b6abce1..bd2e0c505a6 100644 --- a/packages/client/src/workqueue/actions.ts +++ b/packages/client/src/workqueue/actions.ts @@ -17,7 +17,7 @@ export const UPDATE_REGISTRAR_WORKQUEUE = 'DECLARATION/UPDATE_REGISTRAR_WORKQUEUE' export const UPDATE_REGISTRAR_WORKQUEUE_SUCCESS = 'DECLARATION/UPDATE_REGISTRAR_WORKQUEUE_SUCCESS' -export const UPDATE_REGISTRAR_WORKQUEUE_FAIL = +const UPDATE_REGISTRAR_WORKQUEUE_FAIL = 'DECLARATION/UPDATE_REGISTRAR_WORKQUEUE_FAIL' export const UPDATE_WORKQUEUE_PAGINATION = 'DECLARATION/UPDATE_WORKQUEUE_PAGINATION' diff --git a/packages/commons/src/authentication.ts b/packages/commons/src/authentication.ts index 2300a607644..384a263473e 100644 --- a/packages/commons/src/authentication.ts +++ b/packages/commons/src/authentication.ts @@ -57,7 +57,7 @@ export const userRoleScopes = { } /** All the scopes system/integration can be assigned to */ -export const systemScopes = { +const systemScopes = { recordsearch: 'recordsearch', declare: 'declare', notificationApi: 'notification-api', @@ -77,9 +77,8 @@ export const systemRoleScopes = { } export type UserRole = keyof typeof userRoleScopes -export type UserScope = (typeof userScopes)[keyof typeof userScopes] -export type SystemRole = keyof typeof systemRoleScopes -export type SystemScope = (typeof systemScopes)[keyof typeof systemScopes] +type UserScope = (typeof userScopes)[keyof typeof userScopes] +type SystemScope = (typeof systemScopes)[keyof typeof systemScopes] export type Scope = UserScope | SystemScope export interface ITokenPayload { diff --git a/packages/commons/src/fhir/composition.ts b/packages/commons/src/fhir/composition.ts index b2dc283814f..8fd6ccbd975 100644 --- a/packages/commons/src/fhir/composition.ts +++ b/packages/commons/src/fhir/composition.ts @@ -30,16 +30,15 @@ export const GROOM_TITLE = "Groom's details" export const ATTACHMENT_DOCS_TITLE = 'Supporting Documents' -export const CORRECTION_CERTIFICATE_DOCS_TITLE = 'Correction certificates' -export const CERTIFICATE_DOCS_TITLE = 'Certificates' +const CORRECTION_CERTIFICATE_DOCS_TITLE = 'Correction certificates' +const CERTIFICATE_DOCS_TITLE = 'Certificates' -export const BIRTH_ENCOUNTER_TITLE = 'Birth encounter' -export const MARRIAGE_ENCOUNTER_TITLE = 'Marriage encounter' -export const DEATH_ENCOUNTER_TITLE = 'Death encounter' -export const BIRTH_CORRECTION_ENCOUNTER_TITLE = 'Birth correction encounters' -export const DEATH_CORRECTION_ENCOUNTER_TITLE = 'Death correction encounters' -export const MARRIAGE_CORRECTION_ENCOUNTER_TITLE = - 'Marriage correction encounters' +const BIRTH_ENCOUNTER_TITLE = 'Birth encounter' +const MARRIAGE_ENCOUNTER_TITLE = 'Marriage encounter' +const DEATH_ENCOUNTER_TITLE = 'Death encounter' +const BIRTH_CORRECTION_ENCOUNTER_TITLE = 'Birth correction encounters' +const DEATH_CORRECTION_ENCOUNTER_TITLE = 'Death correction encounters' +const MARRIAGE_CORRECTION_ENCOUNTER_TITLE = 'Marriage correction encounters' export const MOTHER_CODE = 'mother-details' export const FATHER_CODE = 'father-details' @@ -54,8 +53,8 @@ export const GROOM_CODE = 'groom-details' export const ATTACHMENT_DOCS_CODE = 'supporting-documents' -export const CORRECTION_CERTIFICATE_DOCS_CODE = 'correction-certificates' -export const CERTIFICATE_DOCS_CODE = 'certificates' +const CORRECTION_CERTIFICATE_DOCS_CODE = 'correction-certificates' +const CERTIFICATE_DOCS_CODE = 'certificates' export const BIRTH_ENCOUNTER_CODE = 'birth-encounter' export const MARRIAGE_ENCOUNTER_CODE = 'marriage-encounter' @@ -199,9 +198,6 @@ export type Section = { > } -export type SectionMappingByCode = - ReferenceTypeByCode['code'] - export type CompositionSection = Section export type SavedCompositionSection = Omit & { diff --git a/packages/commons/src/fhir/constants.ts b/packages/commons/src/fhir/constants.ts index 6e05de43fe2..5f103bc5773 100644 --- a/packages/commons/src/fhir/constants.ts +++ b/packages/commons/src/fhir/constants.ts @@ -17,6 +17,11 @@ export const SYSTEM_FILE_NAME_SYSTEM = export const FHIR_OBSERVATION_CATEGORY_URL = 'http://hl7.org/fhir/observation-category' +export enum EVENT_TYPE { + BIRTH = 'BIRTH', + DEATH = 'DEATH', + MARRIAGE = 'MARRIAGE' +} export const DOWNLOADED_EXTENSION_URL = `${OPENCRVS_SPECIFICATION_URL}extension/regDownloaded` as const export const REINSTATED_EXTENSION_URL = @@ -29,16 +34,10 @@ export const UNASSIGNED_EXTENSION_URL = `${OPENCRVS_SPECIFICATION_URL}extension/regUnassigned` as const export const MAKE_CORRECTION_EXTENSION_URL = `${OPENCRVS_SPECIFICATION_URL}extension/makeCorrection` as const -export const REQUEST_CORRECTION_OTHER_REASON_EXTENSION_URL = - `${OPENCRVS_SPECIFICATION_URL}extension/otherReason` as const export const REQUESTING_INDIVIDUAL = `${OPENCRVS_SPECIFICATION_URL}extension/requestingIndividual` as const export const REQUESTING_INDIVIDUAL_OTHER = `${OPENCRVS_SPECIFICATION_URL}extension/requestingIndividualOther` as const -export const HAS_SHOWED_VERIFIED_DOCUMENT = - `${OPENCRVS_SPECIFICATION_URL}extension/hasShowedVerifiedDocument` as const -export const PAYMENT_DETAILS = - `${OPENCRVS_SPECIFICATION_URL}extension/paymentDetails` as const export const NO_SUPPORTING_DOCUMENTATION_REQUIRED = `${OPENCRVS_SPECIFICATION_URL}extension/noSupportingDocumentationRequired` as const export const VIEWED_EXTENSION_URL = diff --git a/packages/commons/src/fhir/extension.ts b/packages/commons/src/fhir/extension.ts index 50a36130455..002c5bc2897 100644 --- a/packages/commons/src/fhir/extension.ts +++ b/packages/commons/src/fhir/extension.ts @@ -237,7 +237,6 @@ export type KnownExtensionType = StringExtensionType & { > } } -export type StringExtension = { url: string; valueString: string } export type Extension = KnownExtensionType[keyof KnownExtensionType] type NestedExtensionTypes = Extract< @@ -249,9 +248,6 @@ type AllExtensions = | KnownExtensionType[keyof KnownExtensionType] | NestedExtensionTypes -export type StringValueExtension = - StringExtensionType[keyof StringExtensionType] - export function findExtension( url: URL, listOfExtensions: AllExtensions[] diff --git a/packages/commons/src/fhir/index.ts b/packages/commons/src/fhir/index.ts index 648b5a483a8..e16846ad8ee 100644 --- a/packages/commons/src/fhir/index.ts +++ b/packages/commons/src/fhir/index.ts @@ -9,12 +9,11 @@ * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. */ -import { RegistrationStatus, ValidRecord } from '../record' +import { ValidRecord } from '../record' import { Nominal } from '../nominal' import { UUID } from '../uuid' import { Encounter, SavedEncounter } from './encounter' import { Extension } from './extension' -import { Patient } from './patient' import { CompositionSection, CompositionSectionCode, @@ -151,20 +150,6 @@ export type BundleEntryWithFullUrl = Omit< fullUrl: URNReference | URLReference } -/* - * A placeholder until someone writes better with Zod - */ -export function validateBundle(bundle: unknown): bundle is Bundle { - if (typeof bundle !== 'object' || bundle === null) { - throw new Error('Bundle must be an object') - } - if (!('entry' in bundle)) { - throw new Error('Bundle must have an entry list') - } - - return true -} - export type SavedBundleEntry = Omit< fhir3.BundleEntry, 'fullUrl' | 'resource' @@ -177,15 +162,6 @@ export type StrictBundle = Omit & { entry: { [Property in keyof T]: BundleEntry } } -export type BusinessStatus = Omit & { - coding: Array< - Omit & { - system: 'http://opencrvs.org/specs/reg-status' - code: RegistrationStatus - } - > -} - export type Composition = Omit & { section: Array relatesTo?: Array< @@ -218,7 +194,7 @@ export type SavedRelatedPerson = Omit & { patient: SavedReference } -export type SavedQuestionnaireResponse = Omit< +type SavedQuestionnaireResponse = Omit< QuestionnaireResponse, 'status' | 'id' > & { @@ -230,7 +206,7 @@ export type CompositionHistory = Saved & { resourceType: 'CompositionHistory' } -export type SavedCompositionHistory = SavedComposition & { +type SavedCompositionHistory = SavedComposition & { resourceType: 'CompositionHistory' } @@ -310,8 +286,6 @@ export type EncounterParticipant = Omit< } } -type ItemType = T extends Array ? U : never -export type TelecomSystem = ItemType['system'] export type CodeableConcept = fhir3.CodeableConcept export function markSaved(resource: T, id: UUID | string) { diff --git a/packages/commons/src/fhir/payments.ts b/packages/commons/src/fhir/payments.ts index 1f21697ec78..7590c5c531d 100644 --- a/packages/commons/src/fhir/payments.ts +++ b/packages/commons/src/fhir/payments.ts @@ -44,7 +44,7 @@ export type PaymentReconciliation = Omit< } } -export function isPaymentReconciliation( +function isPaymentReconciliation( resource: Resource ): resource is PaymentReconciliation { return resource.resourceType === 'PaymentReconciliation' diff --git a/packages/commons/src/fhir/practitioner.ts b/packages/commons/src/fhir/practitioner.ts index eedc19c89c3..ca2650db3d4 100644 --- a/packages/commons/src/fhir/practitioner.ts +++ b/packages/commons/src/fhir/practitioner.ts @@ -11,9 +11,7 @@ import { Bundle, Resource, - Task, WithStrictExtensions, - findExtension, WithUUID, SavedReference } from '.' @@ -47,12 +45,6 @@ export function isPractitionerRole( return resource.resourceType === 'PractitionerRole' } -export function isPractitionerRoleHistory( - resource: T -): resource is T & PractitionerRoleHistory { - return resource.resourceType === 'PractitionerRoleHistory' -} - export function isPractitionerRoleOrPractitionerRoleHistory( resource: T ): resource is (T & PractitionerRoleHistory) | (T & PractitionerRole) { @@ -73,17 +65,6 @@ export function getPractitioner(id: string, bundle: Bundle) { return practitioner } -export function getPractitionerIdFromTask(task: Task) { - const extension = findExtension( - 'http://opencrvs.org/specs/extension/regLastUser', - task.extension - ) - if (!extension) { - throw new Error('No practitioner found in task') - } - return extension.valueReference.reference.split('/')[1] -} - export function getPractitionerContactDetails(practitioner: Practitioner) { const msisdn = practitioner.telecom.find((t) => t.system === 'phone')?.value const email = practitioner.telecom.find((t) => t.system === 'email')?.value diff --git a/packages/commons/src/fhir/task.ts b/packages/commons/src/fhir/task.ts index 070d9d55b72..a2072688d88 100644 --- a/packages/commons/src/fhir/task.ts +++ b/packages/commons/src/fhir/task.ts @@ -15,7 +15,6 @@ import { BundleEntry, Coding, DOWNLOADED_EXTENSION_URL, - DUPLICATE_TRACKING_ID, Extension, FLAGGED_AS_POTENTIAL_DUPLICATE, MAKE_CORRECTION_EXTENSION_URL, @@ -92,8 +91,6 @@ export type TaskIdentifier = value: string } -export type ExtractValue = Extract['value'] - type ExtractSystem = T extends { system: string } ? T['system'] : never export type TaskIdentifierSystem = ExtractSystem @@ -174,19 +171,13 @@ export function getBusinessStatus(task: T) { return code.code } -export function isTaskBundleEntry( - entry: T -): entry is (T & BundleEntry) | (T & Saved>) { - return entry.resource.resourceType === 'Task' -} - export function isTask( resource: T ): resource is (T & Task) | (T & SavedTask) { return resource.resourceType === 'Task' } -export function isTaskHistory( +function isTaskHistory( resource: T ): resource is T & TaskHistory { return resource.resourceType === 'TaskHistory' @@ -209,9 +200,7 @@ export function getTaskFromSavedBundle( return task } -export function sortTasksAscending( - tasks: T[] -) { +function sortTasksAscending(tasks: T[]) { return tasks.slice().sort((a, b) => { return ( new Date(a.lastModified).getTime() - new Date(b.lastModified).getTime() @@ -285,7 +274,7 @@ export function getTasksInAscendingOrder< ) } -export const enum TaskAction { +const enum TaskAction { VERIFIED = 'VERIFIED', ASSIGNED = 'ASSIGNED', UNASSIGNED = 'UNASSIGNED', @@ -413,32 +402,6 @@ export function addExtensionsToTask( } } -export const TaskActionExtension = [ - ASSIGNED_EXTENSION_URL, - VERIFIED_EXTENSION_URL, - UNASSIGNED_EXTENSION_URL, - DOWNLOADED_EXTENSION_URL, - REINSTATED_EXTENSION_URL, - MAKE_CORRECTION_EXTENSION_URL, - VIEWED_EXTENSION_URL, - MARKED_AS_NOT_DUPLICATE, - MARKED_AS_DUPLICATE, - DUPLICATE_TRACKING_ID, - FLAGGED_AS_POTENTIAL_DUPLICATE -] - -export function clearActionExtension(task: Task) { - return { - ...task, - extension: (task.extension ?? []).filter( - (ext) => - !TaskActionExtension.includes( - ext.url as (typeof TaskActionExtension)[number] - ) - ) - } -} - /* * @deprecated */ diff --git a/packages/commons/src/fhir/transformers/constants.ts b/packages/commons/src/fhir/transformers/constants.ts deleted file mode 100644 index f0ed51c885f..00000000000 --- a/packages/commons/src/fhir/transformers/constants.ts +++ /dev/null @@ -1,64 +0,0 @@ -import { OPENCRVS_SPECIFICATION_URL } from '..' - -/* - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * OpenCRVS is also distributed under the terms of the Civil Registration - * & Healthcare Disclaimer located at http://opencrvs.org/license. - * - * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. - */ -export const ORIGINAL_FILE_NAME_SYSTEM = - 'http://opencrvs.org/specs/id/original-file-name' -export const SYSTEM_FILE_NAME_SYSTEM = - 'http://opencrvs.org/specs/id/system-file-name' -export const FHIR_SPECIFICATION_URL = 'http://hl7.org/fhir/StructureDefinition/' - -export const FHIR_OBSERVATION_CATEGORY_URL = - 'http://hl7.org/fhir/observation-category' -export enum EVENT_TYPE { - BIRTH = 'BIRTH', - DEATH = 'DEATH', - MARRIAGE = 'MARRIAGE' -} - -export const DOWNLOADED_EXTENSION_URL = - `${OPENCRVS_SPECIFICATION_URL}extension/regDownloaded` as const -export const REINSTATED_EXTENSION_URL = - `${OPENCRVS_SPECIFICATION_URL}extension/regReinstated` as const -export const ASSIGNED_EXTENSION_URL = - `${OPENCRVS_SPECIFICATION_URL}extension/regAssigned` as const -export const VERIFIED_EXTENSION_URL = - `${OPENCRVS_SPECIFICATION_URL}extension/regVerified` as const -export const UNASSIGNED_EXTENSION_URL = - `${OPENCRVS_SPECIFICATION_URL}extension/regUnassigned` as const -export const MAKE_CORRECTION_EXTENSION_URL = - `${OPENCRVS_SPECIFICATION_URL}extension/makeCorrection` as const -export const REQUEST_CORRECTION_OTHER_REASON_EXTENSION_URL = - `${OPENCRVS_SPECIFICATION_URL}extension/otherReason` as const -export const REQUESTING_INDIVIDUAL = - `${OPENCRVS_SPECIFICATION_URL}extension/requestingIndividual` as const -export const REQUESTING_INDIVIDUAL_OTHER = - `${OPENCRVS_SPECIFICATION_URL}extension/requestingIndividualOther` as const -export const HAS_SHOWED_VERIFIED_DOCUMENT = - `${OPENCRVS_SPECIFICATION_URL}extension/hasShowedVerifiedDocument` as const -export const PAYMENT_DETAILS = - `${OPENCRVS_SPECIFICATION_URL}extension/paymentDetails` as const -export const NO_SUPPORTING_DOCUMENTATION_REQUIRED = - `${OPENCRVS_SPECIFICATION_URL}extension/noSupportingDocumentationRequired` as const -export const VIEWED_EXTENSION_URL = - `${OPENCRVS_SPECIFICATION_URL}extension/regViewed` as const -export const MARKED_AS_NOT_DUPLICATE = - `${OPENCRVS_SPECIFICATION_URL}extension/markedAsNotDuplicate` as const -export const MARKED_AS_DUPLICATE = - `${OPENCRVS_SPECIFICATION_URL}extension/markedAsDuplicate` as const -export const DUPLICATE_TRACKING_ID = - `${OPENCRVS_SPECIFICATION_URL}extension/duplicateTrackingId` as const -export const FLAGGED_AS_POTENTIAL_DUPLICATE = - `${OPENCRVS_SPECIFICATION_URL}extension/flaggedAsPotentialDuplicate` as const - -export const BIRTH_REG_NO = 'birth-registration-number' as const -export const DEATH_REG_NO = 'death-registration-number' as const -export const MARRIAGE_REG_NO = 'marriage-registration-number' as const diff --git a/packages/commons/src/fhir/transformers/fhir-builders.test.ts b/packages/commons/src/fhir/transformers/fhir-builders.test.ts index ed4fe1ffe13..55c2c9e3a6e 100644 --- a/packages/commons/src/fhir/transformers/fhir-builders.test.ts +++ b/packages/commons/src/fhir/transformers/fhir-builders.test.ts @@ -9,7 +9,7 @@ * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. */ import { buildFHIRBundle } from '.' -import { EVENT_TYPE } from './constants' +import { EVENT_TYPE } from '../constants' import * as _ from 'lodash' diff --git a/packages/commons/src/fhir/transformers/index.ts b/packages/commons/src/fhir/transformers/index.ts index 2cd04f46949..dd513b08dda 100644 --- a/packages/commons/src/fhir/transformers/index.ts +++ b/packages/commons/src/fhir/transformers/index.ts @@ -92,10 +92,11 @@ import { findExtension, getComposition, markSaved, - CompositionSectionTitleByCode + CompositionSectionTitleByCode, + EVENT_TYPE } from '..' import { getUUID } from '../..' -import { EVENT_TYPE, replaceFromBundle } from '../../record' +import { replaceFromBundle } from '../../record' import { AddressInput, Attachment, @@ -118,7 +119,7 @@ type StringReplace< ? StringReplace : `${A}${T}` -export enum SignatureExtensionPostfix { +enum SignatureExtensionPostfix { INFORMANT = 'informants-signature', GROOM = 'groom-signature', BRIDE = 'bride-signature', diff --git a/packages/commons/src/fhir/transformers/templates.ts b/packages/commons/src/fhir/transformers/templates.ts index b7a4de5eda3..c8b7cd21f6c 100644 --- a/packages/commons/src/fhir/transformers/templates.ts +++ b/packages/commons/src/fhir/transformers/templates.ts @@ -23,6 +23,7 @@ import { QuestionnaireResponse, RelatedPerson, Section, + EVENT_TYPE, Task } from '..' import { @@ -30,19 +31,16 @@ import { CompositionSectionTitle, CompositionSectionTitleByCode, DEATH_CORRECTION_ENCOUNTER_CODE, - EVENT_TYPE, PartialBy } from '../../types' import { UUID } from '../../uuid' -export const CORRECTION_CERTIFICATE_DOCS_CONTEXT_KEY = 'correction-certificates' export const BIRTH_ENCOUNTER_CODE = 'birth-encounter' export const MARRIAGE_ENCOUNTER_CODE = 'marriage-encounter' export const BODY_WEIGHT_CODE = '3141-9' export const BIRTH_TYPE_CODE = '57722-1' export const MARRIAGE_TYPE_CODE = 'partnership' export const BIRTH_ATTENDANT_CODE = '73764-3' -export const INFORMANT_TYPE = 'informant-type' export const NUMBER_BORN_ALIVE_CODE = 'num-born-alive' export const NUMBER_FOEATAL_DEATH_CODE = 'num-foetal-death' export const MALE_DEPENDENTS_ON_DECEASED_CODE = @@ -55,7 +53,6 @@ export const OBSERVATION_CATEGORY_PROCEDURE_DESC = 'Procedure' export const OBSERVATION_CATEGORY_VSIGN_CODE = 'vital-signs' export const OBSERVATION_CATEGORY_VSIGN_DESC = 'Vital Signs' export const ATTACHMENT_CONTEXT_KEY = 'attachments' -export const CERTIFICATE_CONTEXT_KEY = 'certificates' export const DEATH_ENCOUNTER_CODE = 'death-encounter' export const CAUSE_OF_DEATH_CODE = 'ICD10' export const CAUSE_OF_DEATH_METHOD_CODE = 'cause-of-death-method' @@ -63,7 +60,6 @@ export const CAUSE_OF_DEATH_ESTABLISHED_CODE = 'cause-of-death-established' export const MANNER_OF_DEATH_CODE = 'uncertified-manner-of-death' export const DEATH_DESCRIPTION_CODE = 'lay-reported-or-verbal-autopsy-description' -export const PARENT_DETAILS = 'parent-details' export function createPersonSection( refUuid: UUID, diff --git a/packages/commons/src/fhir/transformers/transformer.ts b/packages/commons/src/fhir/transformers/transformer.ts index 9db2c497f81..6d91ed5b09d 100644 --- a/packages/commons/src/fhir/transformers/transformer.ts +++ b/packages/commons/src/fhir/transformers/transformer.ts @@ -9,9 +9,8 @@ * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. */ -import { Bundle } from '..' +import { Bundle, EVENT_TYPE } from '..' import { IsNominal } from '../../nominal' -import { EVENT_TYPE } from '../../record' import { BirthRegistration, DeathRegistration, @@ -22,10 +21,7 @@ export type Context = { event: EVENT_TYPE _index: { [Key in A]: number } } -export type IFieldBuilderFunction< - Key extends string | number | symbol, - FieldType -> = ( +type IFieldBuilderFunction = ( accumulatedObj: Bundle, fieldValue: NonNullable, context: Context diff --git a/packages/commons/src/fhir/transformers/utils.ts b/packages/commons/src/fhir/transformers/utils.ts index dcc3b4379ea..d38ae9177fe 100644 --- a/packages/commons/src/fhir/transformers/utils.ts +++ b/packages/commons/src/fhir/transformers/utils.ts @@ -56,7 +56,6 @@ import { WITNESS_ONE_CODE, WITNESS_TWO_CODE, findCompositionSection, - findExtension, getComposition, isObservation, isURLReference, @@ -70,14 +69,9 @@ import { isHealthFacility, PartialBy } from '../../types' -import { - DOWNLOADED_EXTENSION_URL, - EVENT_TYPE, - FHIR_OBSERVATION_CATEGORY_URL, - MAKE_CORRECTION_EXTENSION_URL -} from './constants' +import { EVENT_TYPE, FHIR_OBSERVATION_CATEGORY_URL } from '../constants' -export function findCompositionSectionInBundle( +function findCompositionSectionInBundle( code: CompositionSectionCode, fhirBundle: T ) { @@ -208,7 +202,7 @@ export function selectOrCreateObservationResource( ) } -export function updateObservationInfo( +function updateObservationInfo( observation: Observation, categoryCode: string, categoryDescription: string, @@ -241,58 +235,7 @@ export function updateObservationInfo( return observation } -export function selectObservationResource( - observationCode: string, - fhirBundle: Bundle -): Observation | undefined { - let observation - fhirBundle.entry.forEach((entry) => { - if ( - !entry || - !entry.resource || - entry.resource.resourceType === 'Observation' - ) { - const observationEntry = entry.resource as Observation - const obCoding = - observationEntry.code && - observationEntry.code.coding && - observationEntry.code.coding.find( - (obCode) => obCode.code === observationCode - ) - if (obCoding) { - observation = observationEntry - } - } - }) - - return observation -} - -export async function removeObservationResource( - observationCode: string, - fhirBundle: Bundle -) { - fhirBundle.entry.forEach((entry, index) => { - if ( - !entry || - !entry.resource || - entry.resource.resourceType === 'Observation' - ) { - const observationEntry = entry.resource as Observation - const obCoding = - observationEntry.code && - observationEntry.code.coding && - observationEntry.code.coding.find( - (obCode) => obCode.code === observationCode - ) - if (obCoding) { - fhirBundle.entry.splice(index, 1) - } - } - }) -} - -export function createObservationResource( +function createObservationResource( sectionCode: CompositionSectionCode, fhirBundle: Bundle, context: any @@ -756,22 +699,18 @@ export function setQuestionnaireItem( } } -export function setArrayPropInResourceObject< - T extends Resource, - L extends keyof T ->(resource: T, label: L, value: Array<{}>, propName: string) { +function setArrayPropInResourceObject( + resource: T, + label: L, + value: Array<{}>, + propName: string +) { if (!resource[label]) { resource[label] = {} as T[L] } resource[label][propName as keyof T[L]] = value as T[L][keyof T[L]] } -export function getDownloadedExtensionStatus(task: Task) { - const extension = - task.extension && findExtension(DOWNLOADED_EXTENSION_URL, task.extension) - return extension?.valueString -} - export function getMaritalStatusCode(fieldValue: string) { switch (fieldValue) { case 'SINGLE': @@ -817,10 +756,3 @@ export function setInformantReference( : personEntry.fullUrl } } - -export function hasRequestCorrectionExtension(task: Task) { - const extension = - task.extension && - findExtension(MAKE_CORRECTION_EXTENSION_URL, task.extension) - return extension -} diff --git a/packages/commons/src/nominal.ts b/packages/commons/src/nominal.ts index 1726279a3b8..085142be8d5 100644 --- a/packages/commons/src/nominal.ts +++ b/packages/commons/src/nominal.ts @@ -27,7 +27,3 @@ export type NestedNominal< export type IsNominal = typeof __nominal__type extends keyof NonNullable ? true : false - -export type IfNominalType = IsNominal extends true - ? Output - : never diff --git a/packages/commons/src/record.ts b/packages/commons/src/record.ts index c54b74af1b0..1f6398bfcc5 100644 --- a/packages/commons/src/record.ts +++ b/packages/commons/src/record.ts @@ -26,7 +26,6 @@ import { SavedBundle, Task, TrackingID, - getBusinessStatus, getComposition, getStatusFromTask, getTaskFromSavedBundle, @@ -35,12 +34,6 @@ import { } from './fhir' import { NestedNominal, Nominal } from './nominal' -export enum EVENT_TYPE { - BIRTH = 'BIRTH', - DEATH = 'DEATH', - MARRIAGE = 'MARRIAGE' -} - export function getEventLabelFromBundle(bundle: Bundle) { const composition = getComposition(bundle) if ( @@ -58,8 +51,6 @@ export function getEventLabelFromBundle(bundle: Bundle) { } } -type RecordBase = Bundle - export type ReadyForReviewRecord = Nominal export type WaitingForValidationRecord = Nominal< @@ -152,14 +143,6 @@ export function changeState( return record as any as StateIdenfitiers[A] } -export function getState(record: RecordBase) { - const task = record.entry.map(({ resource }) => resource).find(isTask) - if (!task) { - throw new Error('No task found') - } - return getBusinessStatus(task) as keyof StateIdenfitiers -} - export function isInProgress(record: ValidRecord): record is InProgressRecord { return getStatusFromTask(getTaskFromSavedBundle(record)) === 'IN_PROGRESS' } diff --git a/packages/config/src/config/constants.ts b/packages/config/src/config/constants.ts index b0d4ce73285..a2f54faa419 100644 --- a/packages/config/src/config/constants.ts +++ b/packages/config/src/config/constants.ts @@ -8,5 +8,4 @@ * * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. */ -export const OPENCRVS_SPECIFICATION_URL = 'http://opencrvs.org/specs/' export const DEFAULT_TIMEOUT = 600000 diff --git a/packages/config/src/handlers/application/applicationConfigHandler.ts b/packages/config/src/handlers/application/applicationConfigHandler.ts index 15a461d1b15..798fc5187fb 100644 --- a/packages/config/src/handlers/application/applicationConfigHandler.ts +++ b/packages/config/src/handlers/application/applicationConfigHandler.ts @@ -21,7 +21,7 @@ import { pipe } from 'fp-ts/lib/function' import { verifyToken } from '@config/utils/verifyToken' import { RouteScope } from '@config/config/routes' -export const SystemRoleType = [ +const SystemRoleType = [ 'FIELD_AGENT', 'LOCAL_REGISTRAR', 'LOCAL_SYSTEM_ADMIN', diff --git a/packages/config/src/handlers/forms/field.ts b/packages/config/src/handlers/forms/field.ts index 8ddcfc0ebc3..2819edae0b1 100644 --- a/packages/config/src/handlers/forms/field.ts +++ b/packages/config/src/handlers/forms/field.ts @@ -32,7 +32,7 @@ const dependencyInfo = z.object({ dependsOn: z.array(z.string()), expression: z.string() }) -export const initialValue = z +const initialValue = z .union([dependencyInfo, z.string(), z.number(), z.boolean()]) .optional() diff --git a/packages/config/src/handlers/locations/handler.ts b/packages/config/src/handlers/locations/handler.ts index fc52c4c5177..d2896c672d0 100644 --- a/packages/config/src/handlers/locations/handler.ts +++ b/packages/config/src/handlers/locations/handler.ts @@ -27,7 +27,7 @@ import { } from '@opencrvs/commons/types' import { fetchFromHearth, sendToFhir } from '@config/services/hearth' -export enum Code { +enum Code { CRVS_OFFICE = 'CRVS_OFFICE', ADMIN_STRUCTURE = 'ADMIN_STRUCTURE', HEALTH_FACILITY = 'HEALTH_FACILITY' diff --git a/packages/config/src/handlers/locations/utils.ts b/packages/config/src/handlers/locations/utils.ts index c8b39aee940..e7eb2f5f3d3 100644 --- a/packages/config/src/handlers/locations/utils.ts +++ b/packages/config/src/handlers/locations/utils.ts @@ -108,7 +108,7 @@ export const composeFhirLocation = ( } } -export function setExtensions( +function setExtensions( malePopulations: Statistics, femalePopulations: Statistics, totalPopulations: Statistics, diff --git a/packages/config/src/models/config.ts b/packages/config/src/models/config.ts index 22f2cb17215..ff78df0bb2c 100644 --- a/packages/config/src/models/config.ts +++ b/packages/config/src/models/config.ts @@ -113,13 +113,6 @@ export interface Integration { status: string } -export const statuses = { - PENDING: 'pending', - ACTIVE: 'active', - DISABLED: 'disabled', - DEACTIVATED: 'deactivated' -} - const configSchema = new Schema({ APPLICATION_NAME: { type: String, required: false, default: 'OpenCRVS' }, BIRTH: { type: birthSchema, required: false }, diff --git a/packages/config/src/utils/verifyToken.ts b/packages/config/src/utils/verifyToken.ts index 78731545bec..4fb5e6c8c38 100644 --- a/packages/config/src/utils/verifyToken.ts +++ b/packages/config/src/utils/verifyToken.ts @@ -12,7 +12,6 @@ import * as jwt from 'jsonwebtoken' import * as t from 'io-ts' import { function as f, either as e } from 'fp-ts' import { publicCert } from '@config/server' -import * as decode from 'jwt-decode' const tokenPayload = t.type({ sub: t.string, @@ -38,15 +37,3 @@ function safeVerifyJwt(token: string) { export function verifyToken(token: string) { return f.pipe(token, safeVerifyJwt, e.chainW(tokenPayload.decode)) } - -export const getTokenPayload = (token: string) => { - let decoded: ITokenPayload - try { - decoded = decode(token) - } catch (err) { - throw new Error( - `getTokenPayload: Error occurred during token decode : ${err}` - ) - } - return decoded -} diff --git a/packages/login/src/App.tsx b/packages/login/src/App.tsx index bac686010f2..55f1a1b4a55 100644 --- a/packages/login/src/App.tsx +++ b/packages/login/src/App.tsx @@ -12,7 +12,7 @@ import { PageContainer } from '@login/common/PageContainer' import { ErrorBoundary } from '@login/ErrorBoundary' import { IntlContainer } from '@login/i18n/components/I18nContainer' import * as routes from '@login/navigation/routes' -import { AppStore, createStore } from '@login/store' +import { AppStore } from '@login/store' import { StepOneContainer } from '@login/views/StepOne/StepOneContainer' import { getTheme } from '@opencrvs/components/lib/theme' import * as React from 'react' @@ -32,7 +32,6 @@ import { LoginBackgroundWrapper } from '@login/common/LoginBackgroundWrapper' import { StepTwoContainer } from '@login/views/StepTwo/StepTwoContainer' import { ReloadModal } from './views/ReloadModal' -export const { store, history } = createStore() interface IAppProps { store: AppStore history: History diff --git a/packages/login/src/common/LoginBackgroundWrapper.tsx b/packages/login/src/common/LoginBackgroundWrapper.tsx index 1ab81e0c0c2..eb0c2a75a0a 100644 --- a/packages/login/src/common/LoginBackgroundWrapper.tsx +++ b/packages/login/src/common/LoginBackgroundWrapper.tsx @@ -55,7 +55,7 @@ export interface IProps { children: React.ReactNode } -export function usePersistentCountryBackground() { +function usePersistentCountryBackground() { const theme = useTheme() const [countryBackground, setCountryBackground] = React.useState({ backgroundColor: `${(theme as ITheme).colors.backgroundPrimary}`, diff --git a/packages/login/src/i18n/reducer.ts b/packages/login/src/i18n/reducer.ts index 5bf088382c4..98ff1fb2abd 100644 --- a/packages/login/src/i18n/reducer.ts +++ b/packages/login/src/i18n/reducer.ts @@ -31,7 +31,7 @@ export interface ILanguageState { [key: string]: ILanguage } -export const initLanguages = () => { +const initLanguages = () => { const initLanguages: ILanguageState = {} getAvailableLanguages().forEach((lang) => { initLanguages[lang] = { @@ -50,7 +50,7 @@ export type IntlState = { const DEFAULT_MESSAGES = { default: 'default' } -export const initialState: IntlState = { +const initialState: IntlState = { language: getDefaultLanguage(), messages: DEFAULT_MESSAGES, languages: initLanguages() diff --git a/packages/login/src/login/actions.ts b/packages/login/src/login/actions.ts index 6dbdbac84b0..c2fbd2ce611 100644 --- a/packages/login/src/login/actions.ts +++ b/packages/login/src/login/actions.ts @@ -58,7 +58,7 @@ export enum FORGOTTEN_ITEMS { PASSWORD = 'password' } -export type ApplicationConfigAction = { +type ApplicationConfigAction = { type: typeof CONFIG_LOAD } @@ -130,12 +130,12 @@ export type VerifyCodeFailedAction = { payload: Error } -export type GoToAppAction = { +type GoToAppAction = { type: typeof GOTO_APP payload: string } -export type StoreReloadModalVisibilityAction = { +type StoreReloadModalVisibilityAction = { type: typeof RELOAD_MODAL_VISIBILITY payload: { visibility: boolean } } @@ -160,10 +160,6 @@ export type Action = | StoreClientRedirectRouteAction | StoreReloadModalVisibilityAction -export const applicationConfigLoadAction = (): ApplicationConfigAction => ({ - type: CONFIG_LOAD -}) - export const resetSubmissionError = (): AuthenticationResetAction => { return { type: AUTHENTICATE_RESET @@ -252,15 +248,6 @@ export const storeClientRedirectRoute = ( } } -export const storeReloadModalVisibility = ( - visibility: boolean -): StoreReloadModalVisibilityAction => { - return { - type: RELOAD_MODAL_VISIBILITY, - payload: { visibility } - } -} - export const verifyCode = (values: IVerifyCodeNumbers): VerifyCodeAction => { const code = Object.values(values).join('') return { @@ -280,13 +267,7 @@ export const failVerifyCode = (error: AxiosError): VerifyCodeFailedAction => ({ type: VERIFY_CODE_FAILED, payload: error }) -export function goBack() { - return back() -} -export const gotoApp = (appId: string): GoToAppAction => ({ - type: GOTO_APP, - payload: appId -}) + export function goToForgottenItemForm() { return push(FORGOTTEN_ITEM) } diff --git a/packages/login/src/login/selectors.ts b/packages/login/src/login/selectors.ts index 277b3878875..d13a64d1561 100644 --- a/packages/login/src/login/selectors.ts +++ b/packages/login/src/login/selectors.ts @@ -67,14 +67,6 @@ export function selectApplicationName(store: IStoreState) { return getKey(store, 'config').APPLICATION_NAME } -export function selectImageToObjectFit(store: IStoreState) { - if (getKey(store, 'config').LOGIN_BACKGROUND?.imageFit) { - return getKey(store, 'config').LOGIN_BACKGROUND?.imageFit - } else { - return getKey(store, 'config').LOGIN_BACKGROUND?.imageFit - } -} - export const getStepOneDetails = ( store: IStoreState ): LoginState['authenticationDetails'] => getKey(store, 'authenticationDetails') diff --git a/packages/login/src/navigation/routes.ts b/packages/login/src/navigation/routes.ts index 3d9a568ba68..dae6b67b1df 100644 --- a/packages/login/src/navigation/routes.ts +++ b/packages/login/src/navigation/routes.ts @@ -17,5 +17,3 @@ export const RECOVERY_CODE_ENTRY = '/recovery-code' export const SECURITY_QUESTION = '/security-question' export const UPDATE_PASSWORD = '/reset-password' export const SUCCESS = '/success' - -export const REGISTER_APP = 'register' diff --git a/packages/login/src/utils/authApi.ts b/packages/login/src/utils/authApi.ts index ed3aad7dffe..f5c85225a80 100644 --- a/packages/login/src/utils/authApi.ts +++ b/packages/login/src/utils/authApi.ts @@ -11,7 +11,7 @@ import axios, { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios' import * as Sentry from '@sentry/react' -export interface ICodeVerifyData { +interface ICodeVerifyData { nonce: string code: string } diff --git a/packages/login/src/utils/authUtils.ts b/packages/login/src/utils/authUtils.ts index f89266910fc..784e2a8a7ae 100644 --- a/packages/login/src/utils/authUtils.ts +++ b/packages/login/src/utils/authUtils.ts @@ -11,14 +11,11 @@ import decode from 'jwt-decode' import * as Sentry from '@sentry/react' -export const ERROR_CODE_TOO_MANY_ATTEMPTS = 429 export const ERROR_CODE_FIELD_MISSING = 500 export const ERROR_CODE_INVALID_CREDENTIALS = 401 export const ERROR_CODE_FORBIDDEN_CREDENTIALS = 403 export const ERROR_CODE_PHONE_NUMBER_VALIDATE = 503 -export interface IURLParams { - [key: string]: string | string[] | undefined -} + export interface ITokenPayload { subject: string exp: string diff --git a/packages/login/src/utils/dataCleanse.ts b/packages/login/src/utils/dataCleanse.ts index ece19f8adde..6a78be43a90 100644 --- a/packages/login/src/utils/dataCleanse.ts +++ b/packages/login/src/utils/dataCleanse.ts @@ -31,7 +31,3 @@ export const convertToMSISDN = (phone: string, alpha3CountryCode: string) => { .replace(/[\s-]/g, '') ) } - -export const getMSISDNCountryCode = (countryCode: string) => { - return callingCountries[countryCode.toUpperCase()].countryCallingCodes[0] -} diff --git a/packages/login/src/utils/fieldUtils.ts b/packages/login/src/utils/fieldUtils.ts index be72120ada0..b57c4dc4164 100644 --- a/packages/login/src/utils/fieldUtils.ts +++ b/packages/login/src/utils/fieldUtils.ts @@ -27,11 +27,6 @@ export type Ii18nReduxFormFieldProps = { focusInput: boolean } -export type IReduxFormFieldProps = { - placeholder?: MessageDescriptor - label?: MessageDescriptor -} & Omit - export type IFieldGroup = { [key: string]: Ii18nReduxFormFieldProps } diff --git a/packages/login/src/utils/referenceApi.ts b/packages/login/src/utils/referenceApi.ts index 6415cba14fa..2122706e517 100644 --- a/packages/login/src/utils/referenceApi.ts +++ b/packages/login/src/utils/referenceApi.ts @@ -11,7 +11,7 @@ import { IntlMessages } from '@login/i18n/reducer' import { request } from './authApi' -export interface ILanguage { +interface ILanguage { lang: string displayName: string messages: IntlMessages diff --git a/packages/login/src/utils/validate.ts b/packages/login/src/utils/validate.ts index 3f69e5c4c33..95fcac354a4 100644 --- a/packages/login/src/utils/validate.ts +++ b/packages/login/src/utils/validate.ts @@ -12,7 +12,7 @@ import { MessageDescriptor } from 'react-intl' import { PrimitiveType } from 'intl-messageformat' import { messages } from '@login/i18n/messages/validations' import { validate as validateEmail } from 'email-validator' -export interface IValidationResult { +interface IValidationResult { message: MessageDescriptor props?: { [key: string]: PrimitiveType } } @@ -23,7 +23,7 @@ export const isAValidPhoneNumberFormat = (value: string): boolean => { const pattern = window.config.PHONE_NUMBER_PATTERN return new RegExp(pattern).test(value) } -export const isAValidEmailAddressFormat = (value: string): boolean => { +const isAValidEmailAddressFormat = (value: string): boolean => { return validateEmail(value) } diff --git a/packages/login/src/views/Common.tsx b/packages/login/src/views/Common.tsx index 4a2d402ef80..a53a79ae1ae 100644 --- a/packages/login/src/views/Common.tsx +++ b/packages/login/src/views/Common.tsx @@ -27,12 +27,6 @@ export const LogoContainer = styled.div` } ` -export interface IProps { - formId: string - submissionError: boolean - errorCode?: number -} - export const Container = styled.div` position: relative; height: auto; diff --git a/packages/login/src/views/ResetCredentialsForm/Commons.tsx b/packages/login/src/views/ResetCredentialsForm/Commons.tsx index f34852ee2ce..0662b4d0b55 100644 --- a/packages/login/src/views/ResetCredentialsForm/Commons.tsx +++ b/packages/login/src/views/ResetCredentialsForm/Commons.tsx @@ -10,25 +10,6 @@ */ import styled from 'styled-components' -export const Title = styled.div` - ${({ theme }) => theme.fonts.h2}; - color: ${({ theme }) => theme.colors.copy}; -` -export const Page = styled.div` - color: ${({ theme }) => theme.colors.copy}; - background: ${({ theme }) => theme.colors.white}; - min-height: 100vh; - display: flex; - flex-direction: column; - text-align: center; -` -export const Container = styled.div` - position: relative; - height: auto; - padding: 0px; - margin: 125px auto 0px auto; - max-width: 460px; -` export const LogoContainer = styled.div` flex-direction: row; display: flex; diff --git a/packages/login/src/views/ResetCredentialsForm/ResetCredentialsSuccessPage.tsx b/packages/login/src/views/ResetCredentialsForm/ResetCredentialsSuccessPage.tsx index 7995f10a213..918ea1f1fad 100644 --- a/packages/login/src/views/ResetCredentialsForm/ResetCredentialsSuccessPage.tsx +++ b/packages/login/src/views/ResetCredentialsForm/ResetCredentialsSuccessPage.tsx @@ -42,7 +42,7 @@ type Props = { goToHome: typeof goToHome } & RouteComponentProps< > & IntlShapeProps & { logo: string | undefined } -export const ResetCredentialsSuccessView = (props: Props) => { +const ResetCredentialsSuccessView = (props: Props) => { const { logo, goToHome, intl, location } = props const { forgottenItem } = location.state diff --git a/yarn.lock b/yarn.lock index 58759998a61..aaf090ebee4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8679,6 +8679,13 @@ dependencies: undici-types "~5.26.4" +"@types/node@^22.7.9": + version "22.7.9" + resolved "https://registry.yarnpkg.com/@types/node/-/node-22.7.9.tgz#2bf2797b5e84702d8262ea2cf843c3c3c880d0e9" + integrity sha512-jrTfRC7FM6nChvU7X2KqcrgquofrWLFDeYC1hKfwNWomVvrn7JIksqf344WN2X/y8xrgqBd2dJATZV4GbatBfg== + dependencies: + undici-types "~6.19.2" + "@types/node@^8.10.50": version "8.10.66" resolved "https://registry.npmjs.org/@types/node/-/node-8.10.66.tgz" @@ -24035,6 +24042,11 @@ typescript@4.9.5, typescript@^4.5: resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.4.5.tgz#42ccef2c571fdbd0f6718b1d1f5e6e5ef006f611" integrity sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ== +typescript@^5.6.3: + version "5.6.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.6.3.tgz#5f3449e31c9d94febb17de03cc081dd56d81db5b" + integrity sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw== + typical@^2.6.1: version "2.6.1" resolved "https://registry.npmjs.org/typical/-/typical-2.6.1.tgz" @@ -24095,6 +24107,11 @@ undici-types@~5.26.4: resolved "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz" integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== +undici-types@~6.19.2: + version "6.19.8" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.19.8.tgz#35111c9d1437ab83a7cdc0abae2f26d88eda0a02" + integrity sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw== + undici@^5.22.1: version "5.28.4" resolved "https://registry.yarnpkg.com/undici/-/undici-5.28.4.tgz#6b280408edb6a1a604a9b20340f45b422e373068" From 6c114c4108775c5b7a7469fcd350bb348a64dac0 Mon Sep 17 00:00:00 2001 From: alsmk Date: Fri, 1 Nov 2024 16:10:53 +0600 Subject: [PATCH 07/50] added an enviornment in trigger-e2e job --- .github/workflows/trigger-e2e-environment.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/trigger-e2e-environment.yml b/.github/workflows/trigger-e2e-environment.yml index 9e9b0e2d71c..559b34a8d71 100644 --- a/.github/workflows/trigger-e2e-environment.yml +++ b/.github/workflows/trigger-e2e-environment.yml @@ -26,6 +26,7 @@ jobs: trigger-e2e: if: ${{ !contains(github.actor, 'bot') && github.event.pull_request.head.repo.fork == false }} runs-on: ubuntu-22.04 + environment: ${{ inputs.pr_number || github.ref }} outputs: run_id: ${{ steps.dispatch_e2e.outputs.run_id }} deployment_link: ${{ steps.print-links.outputs.deployment_link }} From ce02fb7954394b1d54b156dc1a760936054ff4b6 Mon Sep 17 00:00:00 2001 From: "Al hel md. shahriar zaman" Date: Fri, 1 Nov 2024 17:19:08 +0600 Subject: [PATCH 08/50] changed the environment name --- .github/workflows/trigger-e2e-environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/trigger-e2e-environment.yml b/.github/workflows/trigger-e2e-environment.yml index 559b34a8d71..598c8a2654e 100644 --- a/.github/workflows/trigger-e2e-environment.yml +++ b/.github/workflows/trigger-e2e-environment.yml @@ -26,7 +26,7 @@ jobs: trigger-e2e: if: ${{ !contains(github.actor, 'bot') && github.event.pull_request.head.repo.fork == false }} runs-on: ubuntu-22.04 - environment: ${{ inputs.pr_number || github.ref }} + environment: ${{ github.steps.dispatch_e2e.outputs.stack }} outputs: run_id: ${{ steps.dispatch_e2e.outputs.run_id }} deployment_link: ${{ steps.print-links.outputs.deployment_link }} From 161fa131d554249c6583285dcf2998b50350dc0e Mon Sep 17 00:00:00 2001 From: "Al hel md. shahriar zaman" Date: Fri, 1 Nov 2024 17:59:46 +0600 Subject: [PATCH 09/50] Adding an environment for successful deployment --- .github/workflows/trigger-e2e-environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/trigger-e2e-environment.yml b/.github/workflows/trigger-e2e-environment.yml index 598c8a2654e..f105620e9bb 100644 --- a/.github/workflows/trigger-e2e-environment.yml +++ b/.github/workflows/trigger-e2e-environment.yml @@ -26,7 +26,7 @@ jobs: trigger-e2e: if: ${{ !contains(github.actor, 'bot') && github.event.pull_request.head.repo.fork == false }} runs-on: ubuntu-22.04 - environment: ${{ github.steps.dispatch_e2e.outputs.stack }} + environment: ${{ github.action.steps.dispatch_e2e.outputs.stack }} outputs: run_id: ${{ steps.dispatch_e2e.outputs.run_id }} deployment_link: ${{ steps.print-links.outputs.deployment_link }} From 08493c40bf9a2c406761ba9f307e706e212f3f58 Mon Sep 17 00:00:00 2001 From: "Al hel md. shahriar zaman" Date: Fri, 1 Nov 2024 18:31:06 +0600 Subject: [PATCH 10/50] Testing with a static environment name --- .github/workflows/trigger-e2e-environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/trigger-e2e-environment.yml b/.github/workflows/trigger-e2e-environment.yml index f105620e9bb..0259690f7bc 100644 --- a/.github/workflows/trigger-e2e-environment.yml +++ b/.github/workflows/trigger-e2e-environment.yml @@ -26,7 +26,7 @@ jobs: trigger-e2e: if: ${{ !contains(github.actor, 'bot') && github.event.pull_request.head.repo.fork == false }} runs-on: ubuntu-22.04 - environment: ${{ github.action.steps.dispatch_e2e.outputs.stack }} + environment: for-workflow outputs: run_id: ${{ steps.dispatch_e2e.outputs.run_id }} deployment_link: ${{ steps.print-links.outputs.deployment_link }} From 77685b1a8009c62976d4dfd78dc8d9b502d399fa Mon Sep 17 00:00:00 2001 From: "Al hel md. shahriar zaman" Date: Mon, 4 Nov 2024 15:56:23 +0600 Subject: [PATCH 11/50] Added another job for make the slugified branch name and environment --- .github/workflows/trigger-e2e-environment.yml | 44 ++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/.github/workflows/trigger-e2e-environment.yml b/.github/workflows/trigger-e2e-environment.yml index 0259690f7bc..2226dd44e28 100644 --- a/.github/workflows/trigger-e2e-environment.yml +++ b/.github/workflows/trigger-e2e-environment.yml @@ -23,10 +23,52 @@ concurrency: cancel-in-progress: true jobs: + gathering_information: + runs-on: ubuntu-22.04 + outputs: + slugified_branch: ${{ steps.slugify_bname.outputs.stack }} + steps: + - uses: actions/checkout@v3 + + - name: Get branch name (when manually triggered) + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + if: ${{ github.event_name == 'workflow_dispatch' }} + run: | + PR_NUMBER=${{ github.event.inputs.pr_number }} + PR_DATA=$(gh pr view $PR_NUMBER --json headRefName,headRefOid) + BRANCH_NAME=$(echo "$PR_DATA" | jq -r '.headRefName') + echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_ENV + + - name: Get Branch Name (on PR creation) + if: ${{ github.event_name != 'workflow_dispatch' }} + run: | + echo "BRANCH_NAME=$(echo ${{ github.head_ref }})" >> $GITHUB_ENV + + - name: Slugify the branch name + id: slugify_bname + uses: actions/github-script@v7 + with: + script: | + function slugify(str) { + return str + .toLowerCase() + .replace(/[^\w\s-]/g, '') + .trim() + .replace(/\s+/g, '-') + .replace(/-+/g, '-') + .substr(0, 35) + .replace(/[^a-zA-Z0-9]+$/g, ''); + } + core.setOutput('stack', slugify('${{ env.BRANCH_NAME }}')); + + + trigger-e2e: if: ${{ !contains(github.actor, 'bot') && github.event.pull_request.head.repo.fork == false }} runs-on: ubuntu-22.04 - environment: for-workflow + needs: gathering_information + environment: ${{ needs.gathering_information.outputs.slugified_branch }} outputs: run_id: ${{ steps.dispatch_e2e.outputs.run_id }} deployment_link: ${{ steps.print-links.outputs.deployment_link }} From c356728d00cbc7dbe39a7491e94f572e8c114c15 Mon Sep 17 00:00:00 2001 From: tahmidrahman-dsi Date: Mon, 4 Nov 2024 15:58:12 +0600 Subject: [PATCH 12/50] feat: handle foreignObject in svg to support html --- packages/client/package.json | 2 + .../src/views/PrintCertificate/PDFUtils.ts | 38 +++++++++++++++- .../usePrintableCertificate.ts | 44 +++++++++---------- 3 files changed, 60 insertions(+), 24 deletions(-) diff --git a/packages/client/package.json b/packages/client/package.json index b23a4f13825..2a7f8da301b 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -40,6 +40,7 @@ "@sentry/tracing": "^7.12.1", "@types/bcryptjs": "^2.4.2", "@types/history": "^4.6.2", + "@types/html-to-pdfmake": "^2.4.4", "@types/nock": "^10.0.3", "@types/pdfmake": "^0.2.0", "@types/react-redux": "^7.1.5", @@ -66,6 +67,7 @@ "graphql-tools": "^4.0.7", "handlebars": "^4.7.6", "history": "^4.7.2", + "html-to-pdfmake": "^2.5.13", "iframe-resizer-react": "^1.1.0", "jsdom-worker": "^0.3.0", "jwt-decode": "^2.2.0", diff --git a/packages/client/src/views/PrintCertificate/PDFUtils.ts b/packages/client/src/views/PrintCertificate/PDFUtils.ts index 51fee86cf6b..b1acdce44ed 100644 --- a/packages/client/src/views/PrintCertificate/PDFUtils.ts +++ b/packages/client/src/views/PrintCertificate/PDFUtils.ts @@ -28,6 +28,8 @@ import isValid from 'date-fns/isValid' import format from 'date-fns/format' import { getHandlebarHelpers } from '@client/forms/handlebarHelpers' import { FontFamilyTypes } from '@client/utils/referenceApi' +import htmlToPdfmake from 'html-to-pdfmake' +import { Content } from 'pdfmake/interfaces' type TemplateDataType = string | MessageDescriptor | Array function isMessageDescriptor( @@ -224,8 +226,19 @@ src: url("${url}") format("truetype"); return serializer.serializeToString(svg) } export function svgToPdfTemplate(svg: string, offlineResource: IOfflineData) { + const initialDefaultFont = offlineResource.templates.fonts + ? Object.keys(offlineResource.templates.fonts)[0] + : null const pdfTemplate: IPDFTemplate = { ...certificateBaseTemplate, + definition: { + ...certificateBaseTemplate.definition, + defaultStyle: { + font: + initialDefaultFont || + certificateBaseTemplate.definition.defaultStyle.font + } + }, fonts: { ...certificateBaseTemplate.fonts, ...offlineResource.templates.fonts @@ -253,9 +266,30 @@ export function svgToPdfTemplate(svg: string, offlineResource: IOfflineData) { } } - pdfTemplate.definition.content = { - svg + const foreignObjects = svgElement.getElementsByTagName('foreignObject') + const absolutelyPositionedHTMLs: Content[] = [] + if (foreignObjects.length) { + for (const foreignObject of foreignObjects) { + const x = Number.parseInt(foreignObject.getAttribute('x')!) + const y = Number.parseInt(foreignObject.getAttribute('y')!) + const htmlContent = foreignObject.innerHTML + const pdfmakeContent = htmlToPdfmake(htmlContent, { + ignoreStyles: ['font-family'] + }) + absolutelyPositionedHTMLs.push({ + stack: pdfmakeContent, + absolutePosition: { x, y } + } as Content) + } } + + pdfTemplate.definition.content = [ + { + svg + }, + ...absolutelyPositionedHTMLs + ] + return pdfTemplate } diff --git a/packages/client/src/views/PrintCertificate/usePrintableCertificate.ts b/packages/client/src/views/PrintCertificate/usePrintableCertificate.ts index e69966f3389..dbc1ce7d398 100644 --- a/packages/client/src/views/PrintCertificate/usePrintableCertificate.ts +++ b/packages/client/src/views/PrintCertificate/usePrintableCertificate.ts @@ -146,28 +146,28 @@ export const usePrintableCertificate = (declarationId: string) => { } const draft = cloneDeep(declaration) - draft.submissionStatus = SUBMISSION_STATUS.READY_TO_CERTIFY - draft.action = isPrintInAdvance - ? SubmissionAction.CERTIFY_DECLARATION - : SubmissionAction.CERTIFY_AND_ISSUE_DECLARATION + // draft.submissionStatus = SUBMISSION_STATUS.READY_TO_CERTIFY + // draft.action = isPrintInAdvance + // ? SubmissionAction.CERTIFY_DECLARATION + // : SubmissionAction.CERTIFY_AND_ISSUE_DECLARATION const registeredDate = getRegisteredDate(draft.data) const certificate = draft.data.registration.certificates[0] const eventDate = getEventDate(draft.data, draft.event) - if (!isPrintInAdvance) { - const paymentAmount = calculatePrice( - draft.event, - eventDate, - registeredDate, - offlineData - ) - certificate.payments = { - type: 'MANUAL' as const, - amount: Number(paymentAmount), - outcome: 'COMPLETED' as const, - date: new Date().toISOString() - } - } + // if (!isPrintInAdvance) { + // const paymentAmount = calculatePrice( + // draft.event, + // eventDate, + // registeredDate, + // offlineData + // ) + // certificate.payments = { + // type: 'MANUAL' as const, + // amount: Number(paymentAmount), + // outcome: 'COMPLETED' as const, + // date: new Date().toISOString() + // } + // } const svg = await compileSvg( offlineData.templates.certificates[draft.event].definition, @@ -186,12 +186,12 @@ export const usePrintableCertificate = (declarationId: string) => { } const pdfTemplate = svgToPdfTemplate(svg, offlineData) - + console.log(pdfTemplate) printPDF(pdfTemplate, draft.id) - dispatch(modifyDeclaration(draft)) - dispatch(writeDeclaration(draft)) - dispatch(goToHomeTab(WORKQUEUE_TABS.readyToPrint)) + // dispatch(modifyDeclaration(draft)) + // dispatch(writeDeclaration(draft)) + // dispatch(goToHomeTab(WORKQUEUE_TABS.readyToPrint)) } const handleEdit = () => { From 375df64b068476ff055cfe00f33dd3bfa7a6cf8b Mon Sep 17 00:00:00 2001 From: Tomi Salo <54830004+Eezi@users.noreply.github.com> Date: Mon, 4 Nov 2024 12:34:32 +0200 Subject: [PATCH 13/50] refactor: Converted the PerformanceHome to function component. (#7799) * refactor: Converted the PerformanceHome to function component. * refactor: refactored the LoadingIndicatorComp component to functional. * refactor: refactored the UserReviewFormComponent component to functional. * fix: Added missing prop --------- Co-authored-by: Riku Rouvila --- .../src/views/OfficeHome/LoadingIndicator.tsx | 60 +- .../SysAdmin/Performance/PerformanceHome.tsx | 710 +++++++++--------- .../Team/user/userCreation/UserReviewForm.tsx | 384 +++++----- 3 files changed, 561 insertions(+), 593 deletions(-) diff --git a/packages/client/src/views/OfficeHome/LoadingIndicator.tsx b/packages/client/src/views/OfficeHome/LoadingIndicator.tsx index 0fae9bf9797..984e7247fd8 100644 --- a/packages/client/src/views/OfficeHome/LoadingIndicator.tsx +++ b/packages/client/src/views/OfficeHome/LoadingIndicator.tsx @@ -74,36 +74,36 @@ type IBaseLoadingProps = { type IProps = IBaseLoadingProps & IntlShapeProps & IOnlineStatusProps -class LoadingIndicatorComp extends React.Component { - render() { - const { loading, noDeclaration, hasError, intl } = this.props - - return ( - - {this.props.isOnline && loading && ( - - - - )} - - {this.props.isOnline && hasError && ( - - {intl.formatMessage(errorMessages.queryError)} - - )} - {!this.props.isOnline && ( - - - - {intl.formatMessage(constantsMessages.noConnection)} - - - )} - - - ) - } -} +const LoadingIndicatorComp = ({ + loading, + noDeclaration, + hasError, + intl, + isOnline +}: IProps) => ( + + {isOnline && loading && ( + + + + )} + + {isOnline && hasError && ( + + {intl.formatMessage(errorMessages.queryError)} + + )} + {!isOnline && ( + + + + {intl.formatMessage(constantsMessages.noConnection)} + + + )} + + +) export function withOnlineStatus( WrappedComponent: React.ComponentType diff --git a/packages/client/src/views/SysAdmin/Performance/PerformanceHome.tsx b/packages/client/src/views/SysAdmin/Performance/PerformanceHome.tsx index 175e76e26b2..0b4b2007539 100644 --- a/packages/client/src/views/SysAdmin/Performance/PerformanceHome.tsx +++ b/packages/client/src/views/SysAdmin/Performance/PerformanceHome.tsx @@ -17,7 +17,7 @@ import { generateLocations } from '@client/utils/locationUtils' import { ISearchLocation } from '@opencrvs/components/lib/LocationSearch' import { ResponsiveModal } from '@opencrvs/components/lib/ResponsiveModal' import { Spinner } from '@opencrvs/components/lib/Spinner' -import * as React from 'react' +import React, { useState, useEffect, useCallback } from 'react' import { parse } from 'query-string' import { ITheme } from '@opencrvs/components/lib/theme' import { injectIntl, WrappedComponentProps, IntlShape } from 'react-intl' @@ -201,12 +201,6 @@ interface IMetricsQueryResult { getTotalMetrics: GQLTotalMetricsResult } -interface State { - toggleStatus: boolean - officeSelected: boolean - isAccessibleOffice: boolean -} - type IOnlineStatusProps = { isOnline: boolean } @@ -236,43 +230,75 @@ interface ICorrectionsQueryResult { getTotalCorrections: Array } -class PerformanceHomeComponent extends React.Component { - transformPropsToState(props: Props) { - const { selectedLocation } = props - return { - toggleStatus: false, - officeSelected: this.isOfficeSelected(selectedLocation), - isAccessibleOffice: this.isAccessibleOfficeSelected(selectedLocation) - } - } - - constructor(props: Props) { - super(props) - window.__localeId__ = this.props.intl.locale - - this.state = this.transformPropsToState(props) - } - - componentDidUpdate(previousProps: Props) { - if (previousProps.selectedLocation.id !== this.props.selectedLocation.id) { - this.setState({ - officeSelected: this.isOfficeSelected(this.props.selectedLocation), - isAccessibleOffice: this.isAccessibleOfficeSelected( - this.props.selectedLocation - ) - }) - } - } +const PerformanceHomeComponent = (props: Props) => { + const { + selectedLocation, + locations, + offices, + intl, + goToPerformanceHome, + goToWorkflowStatus, + goToCompletenessRates, + timeStart, + timeEnd, + event, + isOnline, + userDetails, + currency + } = props - togglePerformanceStatus = () => { - this.setState({ - toggleStatus: !this.state.toggleStatus - }) + const isOfficeSelected = useCallback( + (selectedLocation?: ISearchLocation) => { + if (selectedLocation) { + return Object.keys(offices).some((id) => id === selectedLocation.id) + } + return false + }, + [offices] + ) + + const isAccessibleOfficeSelected = useCallback( + (selectedLocation?: ISearchLocation) => { + if ( + selectedLocation && + isOfficeSelected(selectedLocation) && + userDetails && + userDetails.systemRole + ) { + if (userDetails?.systemRole === 'NATIONAL_REGISTRAR') { + return true + } + if ( + REGISTRAR_ROLES.includes(userDetails?.systemRole) && + userDetails.primaryOffice?.id === selectedLocation.id + ) { + return true + } + } + return false + }, + [isOfficeSelected, userDetails] + ) + + const [toggleStatus, setToggleStatus] = useState(false) + const [officeSelected, setOfficeSelected] = useState( + isOfficeSelected(selectedLocation) + ) + const [isAccessibleOffice, setIsAccessibleOffice] = useState( + isAccessibleOfficeSelected(selectedLocation) + ) + + useEffect(() => { + setOfficeSelected(isOfficeSelected(selectedLocation)) + setIsAccessibleOffice(isAccessibleOfficeSelected(selectedLocation)) + }, [selectedLocation, isAccessibleOfficeSelected, isOfficeSelected]) + + const togglePerformanceStatus = () => { + setToggleStatus(!toggleStatus) } - onClickDetails = (time: CompletenessRateTime) => { - const { event, timeStart, timeEnd, selectedLocation } = this.props - this.props.goToCompletenessRates( + const onClickDetails = (time: CompletenessRateTime) => { + goToCompletenessRates( event, selectedLocation && !isCountry(selectedLocation) ? selectedLocation.id @@ -283,7 +309,7 @@ class PerformanceHomeComponent extends React.Component { ) } - getFilter = (intl: IntlShape, selectedLocation: ISearchLocation) => { + const getFilter = (intl: IntlShape, selectedLocation: ISearchLocation) => { const { id: locationId } = selectedLocation return ( @@ -296,24 +322,18 @@ class PerformanceHomeComponent extends React.Component { newLocationId, generateLocations( { - ...this.props.locations, - ...this.props.offices + ...locations, + ...offices }, - this.props.intl + intl ).concat(getAdditionalLocations(intl)) ) - this.props.goToPerformanceHome( - this.props.timeStart, - this.props.timeEnd, - this.props.event, - newLocation.id - ) + goToPerformanceHome(timeStart, timeEnd, event, newLocation.id) }} /> { - const { timeStart, timeEnd } = this.props - this.props.goToPerformanceHome( + goToPerformanceHome( timeStart, timeEnd, option.value as Event, @@ -323,7 +343,7 @@ class PerformanceHomeComponent extends React.Component { id="eventSelect" withLightTheme={true} defaultWidth={110} - value={this.props.event} + value={event} options={[ { label: intl.formatMessage(messages.eventOptionForBirths), @@ -336,352 +356,310 @@ class PerformanceHomeComponent extends React.Component { ]} /> { - this.props.goToPerformanceHome( - startDate, - endDate, - this.props.event, - locationId - ) + goToPerformanceHome(startDate, endDate, event, locationId) }} /> ) } - onClickStatusDetails = (status?: keyof IStatusMapping) => { - const { event, timeStart, timeEnd, selectedLocation } = this.props + const onClickStatusDetails = (status?: keyof IStatusMapping) => { const { id: locationId } = selectedLocation - this.props.goToWorkflowStatus(locationId, timeStart, timeEnd, status, event) + goToWorkflowStatus(locationId, timeStart, timeEnd, status, event) } - isOfficeSelected(selectedLocation?: ISearchLocation) { - if (selectedLocation) { - return Object.keys(this.props.offices).some( - (id) => id === selectedLocation.id - ) - } - return false + const queryVariablesWithoutLocationId = { + timeStart: timeStart.toISOString(), + timeEnd: timeEnd.toISOString(), + event: event.toUpperCase() } - isAccessibleOfficeSelected(selectedLocation?: ISearchLocation) { - if ( - selectedLocation && - this.isOfficeSelected(selectedLocation) && - this.props.userDetails && - this.props.userDetails.systemRole - ) { - if (this.props.userDetails?.systemRole === 'NATIONAL_REGISTRAR') { - return true - } else if ( - REGISTRAR_ROLES.includes(this.props.userDetails?.systemRole) && - this.props.userDetails.primaryOffice?.id === selectedLocation.id - ) { - return true - } - } - return false - } - - render() { - const { intl, isOnline } = this.props - const { toggleStatus, officeSelected } = this.state - const { timeStart, timeEnd, event, selectedLocation } = this.props + return ( + + + + + {isOnline ? ( + <> + + {({ + loading, + error, + data + }: { + loading: boolean + error?: ApolloError + data?: IMetricsQueryResult + }) => { + if (error) { + return + } - const queryVariablesWithoutLocationId = { - timeStart: timeStart.toISOString(), - timeEnd: timeEnd.toISOString(), - event: event.toUpperCase() - } - return ( - - - - - {isOnline ? ( - <> - } - > - {({ - loading, - error, - data - }: { - loading: boolean - error?: ApolloError - data?: IMetricsQueryResult - }) => { - if (error) { - return - } - - if (loading && !data) { - return ( - - ) - } - return ( - <> - {!officeSelected && ( - - )} - + {!officeSelected && ( + - - - - ) - }} - - + + + + ) + }} + + + {({ + loading, + error, + data + }: { + loading: boolean + error?: ApolloError + data?: ICorrectionsQueryResult + }) => { + if (error) { + return + } + + if (loading) { + return null + } + return ( + + ) + }} + + + {({ loading, data, error }) => { + if (error) { + return } - > - {({ - loading, - error, - data - }: { - loading: boolean - error?: ApolloError - data?: ICorrectionsQueryResult - }) => { - if (error) { - return - } - - if (loading) { - return null - } + if (loading) { + return null + } + if (data && data.getTotalPayments) { return ( - + ) - }} - - - {({ loading, data, error }) => { - if (error) { - return - } - if (loading) { - return null - } - if (data && data.getTotalPayments) { - return ( - + }} + + + ) : ( + + + + {intl.formatMessage(constantsMessages.noConnection)} + + + )} + + + + {({ loading, data, error }) => { + if (error) { + return + } + return ( + <> + + + {loading && !data ? ( + + ) : ( + <> + {isOnline && ( + - ) - } - - return <> - }} - - - ) : ( - - - - {intl.formatMessage(constantsMessages.noConnection)} - - - )} - - - - {({ loading, data, error }) => { - if (error) { - return - } - return ( - <> - - - {loading && !data ? ( - - ) : ( - <> - {isOnline && ( - - )} + )} - {!officeSelected && isOnline && ( - <> - + {!officeSelected && isOnline && ( + <> + - - - )} - - )} - - - - {!officeSelected && ( - - {!isOnline ? null : loading && !data ? ( - - ) : ( - + } + citizen={Math.round( + data.getLocationStatistics!.population / + data.getLocationStatistics!.registrars + )} + /> + )} - + )} - - - {!isOnline ? ( - <> - ) : loading && !data ? ( - + + + + {!officeSelected && ( + + {!isOnline ? null : loading && !data ? ( + ) : ( - )} - - - - ) - }} - - - - ) - } + + )} + + + {!isOnline ? ( + <> + ) : loading && !data ? ( + + ) : ( + + )} + + + + ) + }} + + + + ) } function mapStateToProps( diff --git a/packages/client/src/views/SysAdmin/Team/user/userCreation/UserReviewForm.tsx b/packages/client/src/views/SysAdmin/Team/user/userCreation/UserReviewForm.tsx index e5dfad507f0..aba6ec4601a 100644 --- a/packages/client/src/views/SysAdmin/Team/user/userCreation/UserReviewForm.tsx +++ b/packages/client/src/views/SysAdmin/Team/user/userCreation/UserReviewForm.tsx @@ -117,111 +117,26 @@ const Value = styled.span` ${({ theme }) => theme.fonts.reg16} ` -class UserReviewFormComponent extends React.Component< - IFullProps & IDispatchProps -> { - transformSectionData = () => { - const { intl, userFormSection, userDetails } = this.props - let nameJoined = false, - fieldValue - const sections: ISectionData[] = [] - getVisibleSectionGroupsBasedOnConditions( - userFormSection, - this.props.formData - ).forEach((group) => { - group.fields.forEach((field: IFormField, idx) => { - if (field.hideValueInPreview) { - return - } else if (field.type === SUBSECTION_HEADER || field.type === DIVIDER) { - return - } else if (field && field.type === FIELD_GROUP_TITLE) { - sections.push({ title: intl.formatMessage(field.label), items: [] }) - } else if (field && sections.length > 0) { - if (field.name === 'username' && !this.getValue(field)) return - let label = intl.formatMessage(field.label) - if ( - !getConditionalActionsForField( - field, - this.props.formData, - this.props.offlineCountryConfiguration, - { user: this.props.formData }, - userDetails - ).includes('hide') - ) { - fieldValue = this.getValue(field) - - if (['firstNamesEng', 'familyNameEng'].includes(field.name)) { - if (nameJoined) return - label = intl.formatMessage(constantsMessages.name) - fieldValue = this.getName(group.fields) - nameJoined = true - } - - if (field.type === SIMPLE_DOCUMENT_UPLOADER) { - fieldValue = ( - - ) - } - - sections[sections.length - 1].items.push({ - label: , - value: {fieldValue}, - actions: - !( - field.name === 'registrationOffice' && - this.props.userDetails?.systemRole !== 'NATIONAL_SYSTEM_ADMIN' - ) && !field.readonly ? ( - { - this.props.userId - ? this.props.goToUserReviewForm( - this.props.userId, - userFormSection.id, - group.id, - field.name - ) - : this.props.goToCreateUserSection( - userFormSection.id, - group.id, - field.name - ) - }} - > - {intl.formatMessage(messages.change)} - - ) : ( - <> - ) - }) - } - } - }) - }) - - return sections - } - - getValue = (field: IFormField) => { - const { intl, formData } = this.props - +const UserReviewFormComponent = ({ + intl, + userFormSection, + userDetails, + formData, + offlineCountryConfiguration, + userId, + goToUserReviewForm, + goToCreateUserSection, + submitForm, + goBack, + section +}: IFullProps & IDispatchProps) => { + const getValue = (field: IFormField) => { if (field.type === LOCATION_SEARCH_INPUT) { const offlineLocations = field.searchableResource.reduce( (locations, resource) => { return { ...locations, - ...getListOfLocations( - this.props.offlineCountryConfiguration, - resource - ) + ...getListOfLocations(offlineCountryConfiguration, resource) } }, {} @@ -244,7 +159,95 @@ class UserReviewFormComponent extends React.Component< : '' } - getName = (fields: IFormField[]) => { + const transformSectionData = () => { + let nameJoined = false, + fieldValue + const sections: ISectionData[] = [] + getVisibleSectionGroupsBasedOnConditions(userFormSection, formData).forEach( + (group) => { + group.fields.forEach((field: IFormField, idx) => { + if (field.hideValueInPreview) { + return + } else if ( + field.type === SUBSECTION_HEADER || + field.type === DIVIDER + ) { + return + } else if (field && field.type === FIELD_GROUP_TITLE) { + sections.push({ title: intl.formatMessage(field.label), items: [] }) + } else if (field && sections.length > 0) { + if (field.name === 'username' && !getValue(field)) return + let label = intl.formatMessage(field.label) + if ( + !getConditionalActionsForField( + field, + formData, + offlineCountryConfiguration, + { user: formData }, + userDetails + ).includes('hide') + ) { + fieldValue = getValue(field) + + if (['firstNamesEng', 'familyNameEng'].includes(field.name)) { + if (nameJoined) return + label = intl.formatMessage(constantsMessages.name) + fieldValue = getName(group.fields) + nameJoined = true + } + + if (field.type === SIMPLE_DOCUMENT_UPLOADER) { + fieldValue = ( + + ) + } + + sections[sections.length - 1].items.push({ + label: , + value: {fieldValue}, + actions: + !( + field.name === 'registrationOffice' && + userDetails?.systemRole !== 'NATIONAL_SYSTEM_ADMIN' + ) && !field.readonly ? ( + { + userId + ? goToUserReviewForm( + userId, + userFormSection.id, + group.id, + field.name + ) + : goToCreateUserSection( + userFormSection.id, + group.id, + field.name + ) + }} + > + {intl.formatMessage(messages.change)} + + ) : ( + <> + ) + }) + } + } + }) + } + ) + + return sections + } + + const getName = (fields: IFormField[]) => { const firstNamesEngField = fields.find( (field) => field.name === 'firstNamesEng' ) as IFormField @@ -252,18 +255,16 @@ class UserReviewFormComponent extends React.Component< (field) => field.name === 'familyName' ) as IFormField - return `${this.getValue(firstNamesEngField)} ${this.getValue( - familyNameEngField - )}` + return `${getValue(firstNamesEngField)} ${getValue(familyNameEngField)}` } - handleSubmit = () => { + const handleSubmit = () => { const variables = draftToGqlTransformer( - { sections: [this.props.userFormSection] }, - { user: this.props.formData }, + { sections: [userFormSection] }, + { user: formData }, '', - this.props.userDetails, - this.props.offlineCountryConfiguration + userDetails, + offlineCountryConfiguration ) if (variables.user._fhirID) { variables.user.id = variables.user._fhirID @@ -274,100 +275,89 @@ class UserReviewFormComponent extends React.Component< delete variables.user.signature.name delete variables.user.signature.__typename //to fix updating registrar bug } - this.props.submitForm(variables) + submitForm(variables) } - render() { - const { - intl, - section, - userId, - formData, - goToTeamUserList, - userDetails, - offlineCountryConfiguration - } = this.props - let title: string | undefined - let actionComponent: JSX.Element - const locationId = formData['registrationOffice'] - const locationDetails = - offlineCountryConfiguration['locations'][`${locationId}`] || - offlineCountryConfiguration['facilities'][`${locationId}`] || - offlineCountryConfiguration['offices'][`${locationId}`] - if (userId) { - title = intl.formatMessage(sysAdminMessages.editUserDetailsTitle) - actionComponent = ( - } - align={ICON_ALIGNMENT.LEFT} - > - {intl.formatMessage(buttonMessages.confirm)} - - ) - } else { - title = section.title && intl.formatMessage(section.title) - actionComponent = ( - - ) - } - return ( - - locationDetails - ? goToTeamUserList(locationDetails.id) - : userDetails?.primaryOffice?.id && - goToTeamUserList(userDetails.primaryOffice.id) + let title: string | undefined + let actionComponent: JSX.Element + const locationId = formData['registrationOffice'] + const locationDetails = + offlineCountryConfiguration['locations'][`${locationId}`] || + offlineCountryConfiguration['facilities'][`${locationId}`] || + offlineCountryConfiguration['offices'][`${locationId}`] + if (userId) { + title = intl.formatMessage(sysAdminMessages.editUserDetailsTitle) + actionComponent = ( + } + align={ICON_ALIGNMENT.LEFT} + > + {intl.formatMessage(buttonMessages.confirm)} + + ) + } else { + title = section.title && intl.formatMessage(section.title) + actionComponent = ( + ) } + return ( + + locationDetails + ? goToTeamUserList(locationDetails.id) + : userDetails?.primaryOffice?.id && + goToTeamUserList(userDetails.primaryOffice.id) + } + hideBackground={true} + > + + + {transformSectionData().map((sec, index) => { + return ( + + + {sec.items.map((item, index) => { + return ( + + ) + })} + + + ) + })} + {actionComponent} + + + + ) } const mapDispatchToProps = (dispatch: Dispatch, props: IFullProps) => { From 062757e86b44adf3eb97b6f0a568de17e8b50d50 Mon Sep 17 00:00:00 2001 From: Tameem Bin Haider Date: Mon, 4 Nov 2024 18:05:54 +0600 Subject: [PATCH 14/50] chore: use event enum instead of hardcoded string (#7890) --- packages/client/src/search/transformer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/src/search/transformer.ts b/packages/client/src/search/transformer.ts index 6470821252b..59b8c55f93f 100644 --- a/packages/client/src/search/transformer.ts +++ b/packages/client/src/search/transformer.ts @@ -105,7 +105,7 @@ export const transformData = ( return { id: assignedReg.id, name: - assignedReg.type === 'Marriage' + assignedReg.type === Event.Marriage ? mergedMarriageName : (createNamesMap(names as HumanName[])[locale] as string) || (createNamesMap(names as HumanName[])[LANG_EN] as string) || From 2609813594e693793d2eb2e8a66bdb8b3eb9483b Mon Sep 17 00:00:00 2001 From: "Al hel md. shahriar zaman" Date: Mon, 4 Nov 2024 19:10:18 +0600 Subject: [PATCH 15/50] Removed all the reused variables and functions --- .github/workflows/trigger-e2e-environment.yml | 49 ++++++++++--------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/.github/workflows/trigger-e2e-environment.yml b/.github/workflows/trigger-e2e-environment.yml index 2226dd44e28..b2cdfbb1504 100644 --- a/.github/workflows/trigger-e2e-environment.yml +++ b/.github/workflows/trigger-e2e-environment.yml @@ -23,10 +23,11 @@ concurrency: cancel-in-progress: true jobs: - gathering_information: + generate_stack_name_and_branch: runs-on: ubuntu-22.04 outputs: slugified_branch: ${{ steps.slugify_bname.outputs.stack }} + branch_name: ${{ steps.bname_out.outputs.B_NAME }} steps: - uses: actions/checkout@v3 @@ -39,12 +40,18 @@ jobs: PR_DATA=$(gh pr view $PR_NUMBER --json headRefName,headRefOid) BRANCH_NAME=$(echo "$PR_DATA" | jq -r '.headRefName') echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_ENV + - name: Get Branch Name (on PR creation) if: ${{ github.event_name != 'workflow_dispatch' }} run: | echo "BRANCH_NAME=$(echo ${{ github.head_ref }})" >> $GITHUB_ENV - + + - name: Set the branch name as output + id: bname_out + run: | + echo "B_NAME=$(echo ${{ env.BRANCH_NAME }})" >> $GITHUB_OUTPUT + - name: Slugify the branch name id: slugify_bname uses: actions/github-script@v7 @@ -67,14 +74,18 @@ jobs: trigger-e2e: if: ${{ !contains(github.actor, 'bot') && github.event.pull_request.head.repo.fork == false }} runs-on: ubuntu-22.04 - needs: gathering_information - environment: ${{ needs.gathering_information.outputs.slugified_branch }} + needs: generate_stack_name_and_branch + environment: ${{ needs.generate_stack_name_and_branch.outputs.slugified_branch }} outputs: run_id: ${{ steps.dispatch_e2e.outputs.run_id }} deployment_link: ${{ steps.print-links.outputs.deployment_link }} steps: - uses: actions/checkout@v3 + - name: Parse the branch name and set it as environment variable + run: | + echo "BRANCH_NAME=${{ needs.generate_stack_name_and_branch.outputs.B_NAME }}" >> $GITHUB_ENV + - name: Get PR Information (when manually triggered) env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} @@ -82,16 +93,13 @@ jobs: run: | PR_NUMBER=${{ github.event.inputs.pr_number }} PR_DATA=$(gh pr view $PR_NUMBER --json headRefName,headRefOid) - BRANCH_NAME=$(echo "$PR_DATA" | jq -r '.headRefName') HEAD_COMMIT_HASH=$(echo "$PR_DATA" | jq -r '.headRefOid' | cut -c1-7) - echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_ENV echo "HEAD_COMMIT_HASH=${HEAD_COMMIT_HASH}" >> $GITHUB_ENV - - name: Get Branch Name and Head Commit Hash (on PR creation) + - name: Get Head Commit Hash (on PR creation) if: ${{ github.event_name != 'workflow_dispatch' }} id: vars run: | - echo "BRANCH_NAME=$(echo ${{ github.head_ref }})" >> $GITHUB_ENV COMMIT_HASH=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }}) echo "HEAD_COMMIT_HASH=${COMMIT_HASH}" >> $GITHUB_ENV @@ -110,23 +118,18 @@ jobs: echo "PR Branch: ${{ env.BRANCH_NAME }}" echo "PR Head Commit Hash: ${{ env.HEAD_COMMIT_HASH }}" echo "Farajaland Commit Hash: ${{ env.FARAJALAND_COMMIT_HASH }}" - + + - name: Parse the stack name + id: gen_stack + run: | + stack=${{ needs.generate_stack_name_and_branch.outputs.slugified_branch }} + echo "stack=${stack}" >> $GITHUB_OUTPUT - name: Trigger E2E Workflow id: dispatch_e2e uses: actions/github-script@v7 with: github-token: ${{ secrets.GH_TOKEN }} script: | - function slugify(str) { - return str - .toLowerCase() - .replace(/[^\w\s-]/g, '') - .trim() - .replace(/\s+/g, '-') - .replace(/-+/g, '-') - .substr(0, 35) - .replace(/[^a-zA-Z0-9]+$/g, ''); - } const result = await github.rest.repos.createDispatchEvent({ owner: 'opencrvs', repo: 'e2e', @@ -135,11 +138,11 @@ jobs: actor: '${{ github.actor }}', 'core-image-tag': '${{ env.HEAD_COMMIT_HASH }}', 'countryconfig-image-tag': '${{ env.FARAJALAND_COMMIT_HASH }}', - stack: slugify('${{ env.BRANCH_NAME }}') + stack: '${{ steps.gen_stack.outputs.stack }}' } }); - core.setOutput('stack', slugify('${{ env.BRANCH_NAME }}')); + console.log(result); await new Promise(resolve => setTimeout(resolve, 10000)); @@ -165,10 +168,10 @@ jobs: id: print-links run: | E2E_RUN_LINK="https://github.com/opencrvs/e2e/actions/runs/${{ steps.dispatch_e2e.outputs.run_id }}" - DEPLOYMENT_LINK="https://${{ steps.dispatch_e2e.outputs.stack }}.opencrvs.dev" + DEPLOYMENT_LINK="https://${{ steps.gen_stack.outputs.stack }}.opencrvs.dev" echo "See your E2E deployment run details here: $E2E_RUN_LINK" >> $GITHUB_STEP_SUMMARY - echo "All deployments & E2E of this environment you can see here: https://github.com/opencrvs/e2e/deployments/${{ steps.dispatch_e2e.outputs.stack }}" >> $GITHUB_STEP_SUMMARY + echo "All deployments & E2E of this environment you can see here: https://github.com/opencrvs/e2e/deployments/${{ steps.gen_stack.outputs.stack }}" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY echo "If everything goes alright, you should see your stack getting deployed here: $DEPLOYMENT_LINK" >> $GITHUB_STEP_SUMMARY From f663fc4204704f5b9d2b693d9768197f897e0522 Mon Sep 17 00:00:00 2001 From: "Al hel md. shahriar zaman" Date: Mon, 4 Nov 2024 19:33:46 +0600 Subject: [PATCH 16/50] Parsing branch name in trigger e2e job is been corrected --- .github/workflows/trigger-e2e-environment.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/trigger-e2e-environment.yml b/.github/workflows/trigger-e2e-environment.yml index b2cdfbb1504..36487901a7a 100644 --- a/.github/workflows/trigger-e2e-environment.yml +++ b/.github/workflows/trigger-e2e-environment.yml @@ -84,7 +84,8 @@ jobs: - name: Parse the branch name and set it as environment variable run: | - echo "BRANCH_NAME=${{ needs.generate_stack_name_and_branch.outputs.B_NAME }}" >> $GITHUB_ENV + B_NAME=${{ needs.generate_stack_name_and_branch.outputs.branch_name }} + echo "BRANCH_NAME=${B_NAME}" >> $GITHUB_ENV - name: Get PR Information (when manually triggered) env: From 7adae80d0a5679a97d3d15fd445dcd70ff18978f Mon Sep 17 00:00:00 2001 From: tahmidrahman-dsi Date: Tue, 5 Nov 2024 15:31:18 +0600 Subject: [PATCH 17/50] fix: minor amends and apply width of the foreignObject to the column --- .../src/views/PrintCertificate/PDFUtils.ts | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/packages/client/src/views/PrintCertificate/PDFUtils.ts b/packages/client/src/views/PrintCertificate/PDFUtils.ts index b1acdce44ed..d8d72568334 100644 --- a/packages/client/src/views/PrintCertificate/PDFUtils.ts +++ b/packages/client/src/views/PrintCertificate/PDFUtils.ts @@ -268,19 +268,23 @@ export function svgToPdfTemplate(svg: string, offlineResource: IOfflineData) { const foreignObjects = svgElement.getElementsByTagName('foreignObject') const absolutelyPositionedHTMLs: Content[] = [] - if (foreignObjects.length) { - for (const foreignObject of foreignObjects) { - const x = Number.parseInt(foreignObject.getAttribute('x')!) - const y = Number.parseInt(foreignObject.getAttribute('y')!) - const htmlContent = foreignObject.innerHTML - const pdfmakeContent = htmlToPdfmake(htmlContent, { - ignoreStyles: ['font-family'] - }) - absolutelyPositionedHTMLs.push({ - stack: pdfmakeContent, - absolutePosition: { x, y } - } as Content) - } + for (const foreignObject of foreignObjects) { + const width = Number.parseInt(foreignObject.getAttribute('width')!) + const x = Number.parseInt(foreignObject.getAttribute('x')!) + const y = Number.parseInt(foreignObject.getAttribute('y')!) + const htmlContent = foreignObject.innerHTML + const pdfmakeContent = htmlToPdfmake(htmlContent, { + ignoreStyles: ['font-family'] + }) + absolutelyPositionedHTMLs.push({ + columns: [ + { + width, + stack: pdfmakeContent + } + ], + absolutePosition: { x, y } + } as Content) } pdfTemplate.definition.content = [ From feaccae628e57e1335f7285fa9b95bb2d7f3dd61 Mon Sep 17 00:00:00 2001 From: tahmidrahman-dsi Date: Tue, 5 Nov 2024 17:21:41 +0600 Subject: [PATCH 18/50] chore: remove temporary changes --- .../usePrintableCertificate.ts | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/packages/client/src/views/PrintCertificate/usePrintableCertificate.ts b/packages/client/src/views/PrintCertificate/usePrintableCertificate.ts index dbc1ce7d398..e69966f3389 100644 --- a/packages/client/src/views/PrintCertificate/usePrintableCertificate.ts +++ b/packages/client/src/views/PrintCertificate/usePrintableCertificate.ts @@ -146,28 +146,28 @@ export const usePrintableCertificate = (declarationId: string) => { } const draft = cloneDeep(declaration) - // draft.submissionStatus = SUBMISSION_STATUS.READY_TO_CERTIFY - // draft.action = isPrintInAdvance - // ? SubmissionAction.CERTIFY_DECLARATION - // : SubmissionAction.CERTIFY_AND_ISSUE_DECLARATION + draft.submissionStatus = SUBMISSION_STATUS.READY_TO_CERTIFY + draft.action = isPrintInAdvance + ? SubmissionAction.CERTIFY_DECLARATION + : SubmissionAction.CERTIFY_AND_ISSUE_DECLARATION const registeredDate = getRegisteredDate(draft.data) const certificate = draft.data.registration.certificates[0] const eventDate = getEventDate(draft.data, draft.event) - // if (!isPrintInAdvance) { - // const paymentAmount = calculatePrice( - // draft.event, - // eventDate, - // registeredDate, - // offlineData - // ) - // certificate.payments = { - // type: 'MANUAL' as const, - // amount: Number(paymentAmount), - // outcome: 'COMPLETED' as const, - // date: new Date().toISOString() - // } - // } + if (!isPrintInAdvance) { + const paymentAmount = calculatePrice( + draft.event, + eventDate, + registeredDate, + offlineData + ) + certificate.payments = { + type: 'MANUAL' as const, + amount: Number(paymentAmount), + outcome: 'COMPLETED' as const, + date: new Date().toISOString() + } + } const svg = await compileSvg( offlineData.templates.certificates[draft.event].definition, @@ -186,12 +186,12 @@ export const usePrintableCertificate = (declarationId: string) => { } const pdfTemplate = svgToPdfTemplate(svg, offlineData) - console.log(pdfTemplate) + printPDF(pdfTemplate, draft.id) - // dispatch(modifyDeclaration(draft)) - // dispatch(writeDeclaration(draft)) - // dispatch(goToHomeTab(WORKQUEUE_TABS.readyToPrint)) + dispatch(modifyDeclaration(draft)) + dispatch(writeDeclaration(draft)) + dispatch(goToHomeTab(WORKQUEUE_TABS.readyToPrint)) } const handleEdit = () => { From 55cc4db38f700dc8e9c007d080709aa0dc9070c8 Mon Sep 17 00:00:00 2001 From: tahmidrahman-dsi Date: Tue, 5 Nov 2024 17:36:37 +0600 Subject: [PATCH 19/50] chore: update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index da853ccc22e..578b6b0f562 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,7 @@ - Internally we were storing the `family` name field as a required property which was limiting what how you could capture the name of a person in the forms. Now we are storing it as an optional property which would make more flexible. - Remove the leftover features from the application config pages, such as certificates and informant notification. [#7156](https://github.com/opencrvs/opencrvs-core/issues/7156) - **PDF page size** The generated PDF used to be defaulted to A4 size. Now it respects the SVG dimensions if specified +- Support html content wrapped in `foreignObject` used in svg template in certificate PDF output ## Bug fixes From 99515f90ff302248d3ebaad3482299b9f30a1c29 Mon Sep 17 00:00:00 2001 From: tareq89 Date: Mon, 4 Nov 2024 12:04:11 +0600 Subject: [PATCH 20/50] review header subject container overflowWrap changed to anywhere for responsiveness --- packages/client/src/views/RegisterForm/review/ReviewHeader.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/src/views/RegisterForm/review/ReviewHeader.tsx b/packages/client/src/views/RegisterForm/review/ReviewHeader.tsx index ad238c4e8fd..77546990974 100644 --- a/packages/client/src/views/RegisterForm/review/ReviewHeader.tsx +++ b/packages/client/src/views/RegisterForm/review/ReviewHeader.tsx @@ -41,7 +41,7 @@ const TitleContainer = styled.div` ` const SubjectContainer = styled.div` ${({ theme }) => theme.fonts.h2} - overflow-wrap: break-word; + overflow-wrap: anywhere; ` export const ReviewHeader = (props: IReviewHeaderProps) => { const { id, logoSource, title, subject } = props From d409a964b63c333fd63843d3c8e41b1737611782 Mon Sep 17 00:00:00 2001 From: "Al hel md. shahriar zaman" Date: Wed, 6 Nov 2024 15:25:07 +0600 Subject: [PATCH 21/50] Refactoring: Just changed some varible name and id name for better readability --- .github/workflows/trigger-e2e-environment.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/trigger-e2e-environment.yml b/.github/workflows/trigger-e2e-environment.yml index 36487901a7a..d7e1c341194 100644 --- a/.github/workflows/trigger-e2e-environment.yml +++ b/.github/workflows/trigger-e2e-environment.yml @@ -27,7 +27,7 @@ jobs: runs-on: ubuntu-22.04 outputs: slugified_branch: ${{ steps.slugify_bname.outputs.stack }} - branch_name: ${{ steps.bname_out.outputs.B_NAME }} + branch_name: ${{ steps.set_branch_name.outputs.BRANCH_NAME }} steps: - uses: actions/checkout@v3 @@ -48,9 +48,9 @@ jobs: echo "BRANCH_NAME=$(echo ${{ github.head_ref }})" >> $GITHUB_ENV - name: Set the branch name as output - id: bname_out + id: set_branch_name run: | - echo "B_NAME=$(echo ${{ env.BRANCH_NAME }})" >> $GITHUB_OUTPUT + echo "BRANCH_NAME=$(echo ${{ env.BRANCH_NAME }})" >> $GITHUB_OUTPUT - name: Slugify the branch name id: slugify_bname @@ -84,8 +84,8 @@ jobs: - name: Parse the branch name and set it as environment variable run: | - B_NAME=${{ needs.generate_stack_name_and_branch.outputs.branch_name }} - echo "BRANCH_NAME=${B_NAME}" >> $GITHUB_ENV + BRANCH_NAME=${{ needs.generate_stack_name_and_branch.outputs.branch_name }} + echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_ENV - name: Get PR Information (when manually triggered) env: @@ -121,7 +121,7 @@ jobs: echo "Farajaland Commit Hash: ${{ env.FARAJALAND_COMMIT_HASH }}" - name: Parse the stack name - id: gen_stack + id: generate_stack run: | stack=${{ needs.generate_stack_name_and_branch.outputs.slugified_branch }} echo "stack=${stack}" >> $GITHUB_OUTPUT @@ -139,7 +139,7 @@ jobs: actor: '${{ github.actor }}', 'core-image-tag': '${{ env.HEAD_COMMIT_HASH }}', 'countryconfig-image-tag': '${{ env.FARAJALAND_COMMIT_HASH }}', - stack: '${{ steps.gen_stack.outputs.stack }}' + stack: '${{ steps.generate_stack.outputs.stack }}' } }); @@ -169,10 +169,10 @@ jobs: id: print-links run: | E2E_RUN_LINK="https://github.com/opencrvs/e2e/actions/runs/${{ steps.dispatch_e2e.outputs.run_id }}" - DEPLOYMENT_LINK="https://${{ steps.gen_stack.outputs.stack }}.opencrvs.dev" + DEPLOYMENT_LINK="https://${{ steps.generate_stack.outputs.stack }}.opencrvs.dev" echo "See your E2E deployment run details here: $E2E_RUN_LINK" >> $GITHUB_STEP_SUMMARY - echo "All deployments & E2E of this environment you can see here: https://github.com/opencrvs/e2e/deployments/${{ steps.gen_stack.outputs.stack }}" >> $GITHUB_STEP_SUMMARY + echo "All deployments & E2E of this environment you can see here: https://github.com/opencrvs/e2e/deployments/${{ steps.generate_stack.outputs.stack }}" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY echo "If everything goes alright, you should see your stack getting deployed here: $DEPLOYMENT_LINK" >> $GITHUB_STEP_SUMMARY From a3a8a7c2a2970447b6447039ff8e524d347305e5 Mon Sep 17 00:00:00 2001 From: Tomi Salo <54830004+Eezi@users.noreply.github.com> Date: Wed, 6 Nov 2024 19:37:29 +0200 Subject: [PATCH 22/50] Refactor/forgotten item component to functional (#7891) * refactor: ForgottenItemComponent to functional component * refactor: IDVerifierComponent to functional component. * refactor: SecurityQuestionComponent to functional component. --------- Co-authored-by: Tahmid Rahman <42269993+tahmidrahman-dsi@users.noreply.github.com> --- .../src/views/PrintCertificate/IDVerifier.tsx | 164 +++++------ .../ForgottenItemForm.tsx | 228 +++++++-------- .../SecurityQuestionForm.tsx | 265 ++++++++---------- 3 files changed, 302 insertions(+), 355 deletions(-) diff --git a/packages/client/src/views/PrintCertificate/IDVerifier.tsx b/packages/client/src/views/PrintCertificate/IDVerifier.tsx index 14300a6c270..bb9ab26c70e 100644 --- a/packages/client/src/views/PrintCertificate/IDVerifier.tsx +++ b/packages/client/src/views/PrintCertificate/IDVerifier.tsx @@ -8,7 +8,7 @@ * * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. */ -import * as React from 'react' +import React, { useState } from 'react' import styled from 'styled-components' import { Content, ContentSize } from '@opencrvs/components/lib/Content' import { Button } from '@opencrvs/components/lib/Button' @@ -64,23 +64,15 @@ interface IIDVerifierProps { actionProps: IVerifierActionProps } -interface IIDVerifierState { - showPrompt: boolean -} - -class IDVerifierComponent extends React.Component< - IIDVerifierProps & IntlShapeProps, - IIDVerifierState -> { - state = { showPrompt: false } +const IDVerifierComponent = (props: IIDVerifierProps & IntlShapeProps) => { + const { collectorInformation, intl, actionProps, id, title } = props + const [showPrompt, setShowPrompt] = useState(false) - togglePrompt = () => { - this.setState((prevState) => ({ showPrompt: !prevState.showPrompt })) + const togglePrompt = () => { + setShowPrompt((prev) => !prev) } - renderLabelValue = () => { - const { collectorInformation, intl } = this.props - + const renderLabelValue = () => { return ( <> {collectorInformation.iD && ( @@ -139,81 +131,73 @@ class IDVerifierComponent extends React.Component< ) } - render() { - const { positiveAction, negativeAction } = this.props.actionProps - const { showPrompt } = this.state - const { intl, id } = this.props - const isIssueUrl = window.location.href.includes('issue') - const modalTitle = isIssueUrl - ? intl.formatMessage(issueMessages.idCheckWithoutVerify) - : intl.formatMessage(certificateMessages.idCheckDialogTitle) - - return ( -
- - - {negativeAction.label} - , - - ]} - > - {this.renderLabelValue()} - - - - {intl.formatMessage(certificateMessages.idCheckDialogCancel)} - , - { - this.props.actionProps.negativeAction.handler() - this.togglePrompt() - }} - > - {intl.formatMessage(certificateMessages.idCheckDialogConfirm)} - - ]} - > - {intl.formatMessage(certificateMessages.idCheckDialogDescription)} - -
- ) - } + const { positiveAction, negativeAction } = actionProps + const isIssueUrl = window.location.href.includes('issue') + const modalTitle = isIssueUrl + ? intl.formatMessage(issueMessages.idCheckWithoutVerify) + : intl.formatMessage(certificateMessages.idCheckDialogTitle) + + return ( +
+ + + {negativeAction.label} + , + + ]} + > + {renderLabelValue()} + + + + {intl.formatMessage(certificateMessages.idCheckDialogCancel)} + , + { + actionProps.negativeAction.handler() + togglePrompt() + }} + > + {intl.formatMessage(certificateMessages.idCheckDialogConfirm)} + + ]} + > + {intl.formatMessage(certificateMessages.idCheckDialogDescription)} + +
+ ) } export const IDVerifier = injectIntl(IDVerifierComponent) diff --git a/packages/login/src/views/ResetCredentialsForm/ForgottenItemForm.tsx b/packages/login/src/views/ResetCredentialsForm/ForgottenItemForm.tsx index 05c6594ac20..d8713278949 100644 --- a/packages/login/src/views/ResetCredentialsForm/ForgottenItemForm.tsx +++ b/packages/login/src/views/ResetCredentialsForm/ForgottenItemForm.tsx @@ -17,7 +17,7 @@ import { Button } from '@opencrvs/components/lib/Button' import { Icon } from '@opencrvs/components/lib/Icon' import { RadioButton } from '@opencrvs/components/lib/Radio' -import * as React from 'react' +import React, { useState } from 'react' import { injectIntl, WrappedComponentProps } from 'react-intl' import { connect } from 'react-redux' import styled from 'styled-components' @@ -34,135 +34,123 @@ interface BaseProps { goToHome: typeof goToHome goToPhoneNumberVerificationForm: typeof goToPhoneNumberVerificationForm } -interface State { - forgottenItem: string - error: boolean -} type Props = BaseProps & WrappedComponentProps -class ForgottenItemComponent extends React.Component { - constructor(props: Props) { - super(props) - this.state = { - forgottenItem: '', - error: false - } - } +const ForgottenItemComponent = ({ + goToHome, + goToPhoneNumberVerificationForm, + intl +}: Props) => { + const [forgottenItem, setForgottenItem] = useState('') + const [error, setError] = useState(false) - handleContinue = (event: React.FormEvent) => { + const handleContinue = (event: React.FormEvent) => { event.preventDefault() - if (this.state.forgottenItem === '') { - this.setState({ error: true }) - } else { - this.props.goToPhoneNumberVerificationForm(this.state.forgottenItem) + if (forgottenItem === '') { + return setError(true) } + return goToPhoneNumberVerificationForm(forgottenItem) } - render() { - const { intl, goToHome } = this.props - - const forgottenItems = [ - { - id: 'usernameOption', - option: { - label: intl.formatMessage(messages.usernameOptionLabel), - value: 'username' - } - }, - { - id: 'passwordOption', - option: { - label: intl.formatMessage(messages.passwordOptionLabel), - value: 'password' - } + const forgottenItems = [ + { + id: 'usernameOption', + option: { + label: intl.formatMessage(messages.usernameOptionLabel), + value: 'username' + } + }, + { + id: 'passwordOption', + option: { + label: intl.formatMessage(messages.passwordOptionLabel), + value: 'password' } - ] + } + ] - return ( - <> - - - - } - mobileLeft={ - - } - mobileTitle={intl.formatMessage(messages.forgottenItemFormTitle)} - desktopTitle={intl.formatMessage(messages.forgottenItemFormTitle)} - /> - } - skipToContentText={intl.formatMessage( - constantsMessages.skipToMainContent - )} - > -
- - {intl.formatMessage(messages.continueButtonLabel)} - - ]} - showTitleOnMobile - > - - {this.state.error && ( - - {intl.formatMessage(messages.error)} - - )} - {forgottenItems.map((item) => { - return ( - - this.setState({ forgottenItem: item.option.value }) - } - /> - ) - })} - - -
- - - ) - } + return ( + <> + + + + } + mobileLeft={ + + } + mobileTitle={intl.formatMessage(messages.forgottenItemFormTitle)} + desktopTitle={intl.formatMessage(messages.forgottenItemFormTitle)} + /> + } + skipToContentText={intl.formatMessage( + constantsMessages.skipToMainContent + )} + > +
+ + {intl.formatMessage(messages.continueButtonLabel)} + + ]} + showTitleOnMobile + > + + {error && ( + + {intl.formatMessage(messages.error)} + + )} + {forgottenItems.map((item) => { + return ( + setForgottenItem(item.option.value)} + /> + ) + })} + + +
+ + + ) } export const ForgottenItem = connect(null, { diff --git a/packages/login/src/views/ResetCredentialsForm/SecurityQuestionForm.tsx b/packages/login/src/views/ResetCredentialsForm/SecurityQuestionForm.tsx index 0fcb1fbd115..a11160c50bc 100644 --- a/packages/login/src/views/ResetCredentialsForm/SecurityQuestionForm.tsx +++ b/packages/login/src/views/ResetCredentialsForm/SecurityQuestionForm.tsx @@ -21,7 +21,7 @@ import { } from '@login/utils/authApi' import { InputField } from '@opencrvs/components/lib/InputField' import { TextInput } from '@opencrvs/components/lib/TextInput' -import * as React from 'react' +import React, { useState } from 'react' import { injectIntl, WrappedComponentProps } from 'react-intl' import { connect } from 'react-redux' import { RouteComponentProps, withRouter } from 'react-router' @@ -97,174 +97,149 @@ interface BaseProps goToUpdatePasswordForm: typeof goToUpdatePasswordForm goToSuccessPage: typeof goToSuccessPage } -interface State { - answer: string - touched: boolean - error: boolean - questionKey: QUESTION_KEYS -} type Props = BaseProps & WrappedComponentProps -class SecurityQuestionComponent extends React.Component { - constructor(props: Props) { - super(props) - this.state = { - answer: '', - touched: false, - error: false, - questionKey: props.location.state.securityQuestionKey - } - } +const SecurityQuestionComponent = ({ + goToPhoneNumberVerificationForm, + goToUpdatePasswordForm, + goToSuccessPage, + intl, + location +}: Props) => { + const [answer, setAnswer] = useState('') + const [touched, setTouched] = useState(false) + const [error, setError] = useState(false) + const [questionKey, setQuestionKey] = useState( + location.state.securityQuestionKey + ) - handleChange = (value: string) => { - this.setState({ - error: value === '', - answer: value, - touched: true - }) + const handleChange = (value: string) => { + setAnswer(value) + setTouched(true) + setError(value === '') } - handleContinue = async (event: React.FormEvent) => { + const handleContinue = async (event: React.FormEvent) => { event.preventDefault() - if (!this.state.answer) { - this.setState({ - touched: true, - error: true - }) - return - } - if (this.state.error) { - return + if (!answer) { + setTouched(true) + return setError(true) } + if (error) return + let result: IVerifySecurityAnswerResponse try { - result = await authApi.verifySecurityAnswer( - this.props.location.state.nonce, - this.state.answer - ) + result = await authApi.verifySecurityAnswer(location.state.nonce, answer) if (!result.matched) { - this.setState({ questionKey: result.securityQuestionKey }) - return + return setQuestionKey(result.securityQuestionKey) } - if ( - this.props.location.state.forgottenItem === FORGOTTEN_ITEMS.USERNAME - ) { - await authApi.sendUserName(this.props.location.state.nonce) - this.props.goToSuccessPage(this.props.location.state.forgottenItem) - } else { - this.props.goToUpdatePasswordForm(result.nonce) + if (location.state.forgottenItem === FORGOTTEN_ITEMS.USERNAME) { + await authApi.sendUserName(location.state.nonce) + return goToSuccessPage(location.state.forgottenItem) } + goToUpdatePasswordForm(result.nonce) } catch (error) { // @todo error handling - this.setState({ error: true }) + setError(true) } } - render() { - const { intl, goToPhoneNumberVerificationForm } = this.props - const { forgottenItem } = this.props.location.state + const { forgottenItem } = location.state - return ( - <> - goToPhoneNumberVerificationForm(forgottenItem)} - > - - + return ( + <> + goToPhoneNumberVerificationForm(forgottenItem)} + > + + + } + mobileLeft={ + + } + mobileTitle={intl.formatMessage( + sharedMessages.credentialsResetFormTitle, + { + forgottenItem } - mobileLeft={ - + )} + desktopTitle={intl.formatMessage( + sharedMessages.credentialsResetFormTitle, + { + forgottenItem } - mobileTitle={intl.formatMessage( - sharedMessages.credentialsResetFormTitle, - { - forgottenItem - } - )} - desktopTitle={intl.formatMessage( - sharedMessages.credentialsResetFormTitle, - { - forgottenItem - } - )} - /> - } - skipToContentText={intl.formatMessage( - constantsMessages.skipToMainContent - )} - > -
- - {intl.formatMessage(sharedMessages.continueButtonLabel)} - - ]} - > - - - this.handleChange(e.target.value)} - touched={this.state.touched} - error={this.state.error} - /> - - - -
- - - ) - } + )} + /> + } + skipToContentText={intl.formatMessage( + constantsMessages.skipToMainContent + )} + > +
+ + {intl.formatMessage(sharedMessages.continueButtonLabel)} + + ]} + > + + + handleChange(e.target.value)} + touched={touched} + error={error} + /> + + + +
+ + + ) } export const SecurityQuestion = withRouter( From 6666d383b03312753377ec63b824eee2772af055 Mon Sep 17 00:00:00 2001 From: Tameem Bin Haider Date: Thu, 7 Nov 2024 19:00:36 +0600 Subject: [PATCH 23/50] chore: remove unused env var from webhooks (#7930) --- packages/webhooks/src/constants.ts | 1 - packages/webhooks/src/environment.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/packages/webhooks/src/constants.ts b/packages/webhooks/src/constants.ts index 81ad51c12ea..ae19995ad65 100644 --- a/packages/webhooks/src/constants.ts +++ b/packages/webhooks/src/constants.ts @@ -18,7 +18,6 @@ export const MONGO_URL = env.MONGO_URL export const HOST = env.HOST export const PORT = env.PORT export const USER_MANAGEMENT_URL = env.USER_MANAGEMENT_URL -export const CERT_PRIVATE_KEY_PATH = env.CERT_PRIVATE_KEY_PATH export const CERT_PUBLIC_KEY_PATH = env.CERT_PUBLIC_KEY_PATH export const SENTRY_DSN = env.SENTRY_DSN diff --git a/packages/webhooks/src/environment.ts b/packages/webhooks/src/environment.ts index 0abccef569f..a94bccec008 100644 --- a/packages/webhooks/src/environment.ts +++ b/packages/webhooks/src/environment.ts @@ -15,7 +15,6 @@ export const env = cleanEnv(process.env, { HOST: str({ devDefault: '0.0.0.0' }), PORT: port({ default: 2525 }), USER_MANAGEMENT_URL: url({ devDefault: 'http://localhost:3030/' }), - CERT_PRIVATE_KEY_PATH: str({ devDefault: '../../.secrets/private-key.pem' }), CERT_PUBLIC_KEY_PATH: str({ devDefault: '../../.secrets/public-key.pem' }), SENTRY_DSN: str({ default: undefined }), NODE_ENV: str({ devDefault: 'development' }), From c2418e556ce83168e361b7d542eec61c6e5725ee Mon Sep 17 00:00:00 2001 From: Tameem Bin Haider Date: Thu, 7 Nov 2024 20:19:18 +0600 Subject: [PATCH 24/50] chore: set local hooks path on install (#7920) --- setup.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/setup.sh b/setup.sh index 13cb5807039..106a905db09 100755 --- a/setup.sh +++ b/setup.sh @@ -234,7 +234,7 @@ done ### # -# Check if Docker Compose exists +# Check if Docker Compose exists # ### @@ -242,7 +242,7 @@ if ! docker compose version &> /dev/null then echo "Docker Compose is not available in your Docker installation" echo "Your Docker version may be too old to include Docker Compose as part of the Docker CLI." - + if [ $OS == "UBUNTU" ]; then echo "Please follow the installation instructions here: https://docs.docker.com/engine/install/ubuntu/" else @@ -333,6 +333,10 @@ else fi yarn install +echo -e "\033[32m:::::::::::::::::::::: Setting hooks path to .husky ::::::::::::::::::::::\033[0m" +echo +git config --local core.hooksPath .husky/ + echo -e "\033[32m::::::::::::::::::::::: Creating some directories :::::::::::::::::::::::\033[0m" echo echo -e "\033[32m::::::::::::: Please enter your sudo password when prompted :::::::::::::\033[0m" From a4b2f2448871b0861055ef46dbab3632613ea4de Mon Sep 17 00:00:00 2001 From: Riku Rouvila Date: Fri, 8 Nov 2024 10:59:38 +0200 Subject: [PATCH 25/50] =?UTF-8?q?Require=20PRs=20to=20have=20"=F0=9F=9A=80?= =?UTF-8?q?=20Ready=20to=20deploy"=20label=20to=20be=20deployed=20(#7932)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ....yml => deploy-to-feature-environment.yml} | 109 +++++++++++------- .github/workflows/on-label-added-for-pr.yml | 47 ++++++++ .github/workflows/trigger-e2e.yml | 2 +- 3 files changed, 117 insertions(+), 41 deletions(-) rename .github/workflows/{trigger-e2e-environment.yml => deploy-to-feature-environment.yml} (77%) create mode 100644 .github/workflows/on-label-added-for-pr.yml diff --git a/.github/workflows/trigger-e2e-environment.yml b/.github/workflows/deploy-to-feature-environment.yml similarity index 77% rename from .github/workflows/trigger-e2e-environment.yml rename to .github/workflows/deploy-to-feature-environment.yml index d7e1c341194..4e67d14481a 100644 --- a/.github/workflows/trigger-e2e-environment.yml +++ b/.github/workflows/deploy-to-feature-environment.yml @@ -6,7 +6,7 @@ # & Healthcare Disclaimer located at http://opencrvs.org/license. # # Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. -name: Deploy branch & run E2E +name: Deploy PR to feature environment on: pull_request: @@ -25,37 +25,70 @@ concurrency: jobs: generate_stack_name_and_branch: runs-on: ubuntu-22.04 - outputs: + outputs: slugified_branch: ${{ steps.slugify_bname.outputs.stack }} - branch_name: ${{ steps.set_branch_name.outputs.BRANCH_NAME }} + branch_name: ${{ steps.set_branch_and_pr_number.outputs.BRANCH_NAME }} + pr_number: ${{ steps.set_branch_and_pr_number.outputs.PR_NUMBER }} + author: ${{ steps.get_author.outputs.AUTHOR }} steps: - - uses: actions/checkout@v3 - - - name: Get branch name (when manually triggered) - env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - if: ${{ github.event_name == 'workflow_dispatch' }} - run: | - PR_NUMBER=${{ github.event.inputs.pr_number }} - PR_DATA=$(gh pr view $PR_NUMBER --json headRefName,headRefOid) - BRANCH_NAME=$(echo "$PR_DATA" | jq -r '.headRefName') - echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_ENV - - - - name: Get Branch Name (on PR creation) - if: ${{ github.event_name != 'workflow_dispatch' }} - run: | - echo "BRANCH_NAME=$(echo ${{ github.head_ref }})" >> $GITHUB_ENV - - - name: Set the branch name as output - id: set_branch_name - run: | - echo "BRANCH_NAME=$(echo ${{ env.BRANCH_NAME }})" >> $GITHUB_OUTPUT - - - name: Slugify the branch name - id: slugify_bname - uses: actions/github-script@v7 - with: + - uses: actions/checkout@v3 + + - name: Get branch name (when manually triggered) + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + if: ${{ github.event_name == 'workflow_dispatch' }} + run: | + PR_NUMBER=${{ github.event.inputs.pr_number }} + PR_DATA=$(gh pr view $PR_NUMBER --json headRefName,headRefOid) + BRANCH_NAME=$(echo "$PR_DATA" | jq -r '.headRefName') + echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_ENV + echo "PR_NUMBER=${PR_NUMBER}" >> $GITHUB_ENV + + - name: Get PR Information + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + if: ${{ github.event_name != 'workflow_dispatch' }} + run: | + PR_NUMBER=${{ github.event.pull_request.number }} + echo "PR_NUMBER=${PR_NUMBER}" >> $GITHUB_ENV + + - name: Check for "🚀 Ready to deploy" label + run: | + labels=$(gh pr view $PR_NUMBER --json labels --jq '.labels[].name') + if [[ "$labels" != *"🚀 Ready to deploy"* ]]; then + echo "Label '🚀 Ready to deploy' not found. Exiting." + exit 1 + else + echo "Label '🚀 Ready to deploy' found. Continuing." + fi + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Get PR Author + id: get_author + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + run: | + AUTHOR=$(gh pr view $PR_NUMBER --json author --jq '.author.login') + echo "PR is created by $AUTHOR" + echo "AUTHOR=$(echo $AUTHOR)" >> $GITHUB_ENV + echo "::set-output name=AUTHOR::$AUTHOR" + + - name: Get Branch Name (on PR creation) + if: ${{ github.event_name != 'workflow_dispatch' }} + run: | + echo "BRANCH_NAME=$(echo ${{ github.head_ref }})" >> $GITHUB_ENV + + - name: Set the branch name as output + id: set_branch_and_pr_number + run: | + echo "BRANCH_NAME=$(echo ${{ env.BRANCH_NAME }})" >> $GITHUB_OUTPUT + echo "PR_NUMBER=$(echo ${{ env.PR_NUMBER }})" >> $GITHUB_OUTPUT + + - name: Slugify the branch name + id: slugify_bname + uses: actions/github-script@v7 + with: script: | function slugify(str) { return str @@ -69,10 +102,8 @@ jobs: } core.setOutput('stack', slugify('${{ env.BRANCH_NAME }}')); - - trigger-e2e: - if: ${{ !contains(github.actor, 'bot') && github.event.pull_request.head.repo.fork == false }} + if: ${{ (github.event_name == 'workflow_dispatch') || (!contains(github.actor, 'bot') && github.event.pull_request.head.repo.fork == false) }} runs-on: ubuntu-22.04 needs: generate_stack_name_and_branch environment: ${{ needs.generate_stack_name_and_branch.outputs.slugified_branch }} @@ -84,7 +115,7 @@ jobs: - name: Parse the branch name and set it as environment variable run: | - BRANCH_NAME=${{ needs.generate_stack_name_and_branch.outputs.branch_name }} + BRANCH_NAME=${{ needs.generate_stack_name_and_branch.outputs.branch_name }} echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_ENV - name: Get PR Information (when manually triggered) @@ -119,7 +150,7 @@ jobs: echo "PR Branch: ${{ env.BRANCH_NAME }}" echo "PR Head Commit Hash: ${{ env.HEAD_COMMIT_HASH }}" echo "Farajaland Commit Hash: ${{ env.FARAJALAND_COMMIT_HASH }}" - + - name: Parse the stack name id: generate_stack run: | @@ -136,15 +167,13 @@ jobs: repo: 'e2e', event_type: 'run_e2e', client_payload: { - actor: '${{ github.actor }}', + actor: '${{ needs.generate_stack_name_and_branch.outputs.author }}', 'core-image-tag': '${{ env.HEAD_COMMIT_HASH }}', 'countryconfig-image-tag': '${{ env.FARAJALAND_COMMIT_HASH }}', stack: '${{ steps.generate_stack.outputs.stack }}' } }); - - console.log(result); await new Promise(resolve => setTimeout(resolve, 10000)); @@ -179,7 +208,7 @@ jobs: echo "deployment_link=$DEPLOYMENT_LINK" >> $GITHUB_OUTPUT listen-e2e: - needs: trigger-e2e + needs: [trigger-e2e, generate_stack_name_and_branch] runs-on: ubuntu-22.04 steps: - name: Wait for Environment Deployment (Deploy Job) @@ -190,7 +219,7 @@ jobs: const owner = 'opencrvs'; const repo = 'e2e'; const runId = ${{ needs.trigger-e2e.outputs.run_id }}; - const prNumber = ${{ github.event.pull_request.number }}; + const prNumber = ${{ needs.generate_stack_name_and_branch.outputs.pr_number }}; const deployMessage = `Your environment is deployed to ${{ needs.trigger-e2e.outputs.deployment_link }}`; let deployJobCompleted = false; diff --git a/.github/workflows/on-label-added-for-pr.yml b/.github/workflows/on-label-added-for-pr.yml new file mode 100644 index 00000000000..72148eb8e8f --- /dev/null +++ b/.github/workflows/on-label-added-for-pr.yml @@ -0,0 +1,47 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. +# +# OpenCRVS is also distributed under the terms of the Civil Registration +# & Healthcare Disclaimer located at http://opencrvs.org/license. +# +# Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. +name: Listen for labels added to PRs + +on: + pull_request: + types: [labeled] + +jobs: + dispatch-deploy: + runs-on: ubuntu-latest + steps: + - name: Check for "🚀 Ready to deploy" label + id: label_check + run: | + labels=$(jq -r '.pull_request.labels[].name' "$GITHUB_EVENT_PATH") + if [[ "$labels" != *"🚀 Ready to deploy"* ]]; then + echo "Label not found, skipping dispatch." + exit 1 + fi + echo "Label found, dispatching deploy workflow." + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Trigger Deploy Workflow + if: steps.label_check.outcome == 'success' + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const prNumber = context.payload.pull_request.number; + const result = await github.rest.actions.createWorkflowDispatch({ + owner: context.repo.owner, + repo: context.repo.repo, + workflow_id: 'deploy-to-feature-environment.yml', + ref: context.payload.pull_request.head.ref, + inputs: { + pr_number: prNumber.toString(), + } + }); + console.log(result); diff --git a/.github/workflows/trigger-e2e.yml b/.github/workflows/trigger-e2e.yml index 7528183fe46..1a4cdc21c7f 100644 --- a/.github/workflows/trigger-e2e.yml +++ b/.github/workflows/trigger-e2e.yml @@ -6,7 +6,7 @@ # & Healthcare Disclaimer located at http://opencrvs.org/license. # # Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. -name: Trigger E2E +name: 'Trigger integration E2E tests in Farajaland development' on: push: From 3c6cc371d7525c607626bcc27bd3ee407f571b1c Mon Sep 17 00:00:00 2001 From: Tomi Salo <54830004+Eezi@users.noreply.github.com> Date: Fri, 8 Nov 2024 20:48:33 +0200 Subject: [PATCH 26/50] Converted the RegRatesLineChart component to function (#7685) * Converted the RegRatesLineChart component to function * Added missing dependency to useEffect dependency array * Refactored the ForgottenItemForm to function component * Refactored the SecurityQuestionForm to function component * fix: Cannot access getStatePropertiesForChart before initialization. --------- Co-authored-by: Tahmid Rahman <42269993+tahmidrahman-dsi@users.noreply.github.com> --- .../components/charts/RegRatesLineChart.tsx | 345 +++++++++--------- .../ForgottenItemForm.tsx | 1 - .../SecurityQuestionForm.tsx | 1 + 3 files changed, 171 insertions(+), 176 deletions(-) diff --git a/packages/client/src/components/charts/RegRatesLineChart.tsx b/packages/client/src/components/charts/RegRatesLineChart.tsx index e9fcd79d36c..eebfb98b042 100644 --- a/packages/client/src/components/charts/RegRatesLineChart.tsx +++ b/packages/client/src/components/charts/RegRatesLineChart.tsx @@ -12,7 +12,7 @@ import { Event } from '@client/utils/gateway' import { constantsMessages } from '@client/i18n/messages' import { LineChart } from '@opencrvs/components/lib/LineChart' import { ITheme } from '@opencrvs/components/lib/theme' -import * as React from 'react' +import React, { useState, useEffect, useCallback } from 'react' import { injectIntl, WrappedComponentProps } from 'react-intl' import styled, { withTheme } from 'styled-components' import { CompletenessRateTime } from '@client/views/SysAdmin/Performance/utils' @@ -131,24 +131,10 @@ function LegendDot(props: React.HTMLAttributes) { ) } -class RegRatesLineChartComponent extends React.Component { - constructor(props: IProps) { - super(props) - this.state = { - ...this.getStatePropertiesForChart(), - ...this.getLatestData() - } - } - - getStatePropertiesForChart = () => { - if (window.innerWidth > this.props.theme.grid.breakpoints.md) { - return this.getStatePropertiesForLargeWindowChart() - } else { - return this.getStatePropertiesForSmallWindowChart() - } - } +const RegRatesLineChartComponent = (props: IProps) => { + const { theme, data, intl, eventType, completenessRateTime } = props - getStatePropertiesForSmallWindowChart = () => { + const getStatePropertiesForSmallWindowChart = () => { return { legendMarginTop: -16, legendMarginLeft: 0, @@ -160,7 +146,7 @@ class RegRatesLineChartComponent extends React.Component { legendLayout: 'horizontal' as const } } - getStatePropertiesForLargeWindowChart = () => { + const getStatePropertiesForLargeWindowChart = () => { return { legendMarginTop: -16, legendMarginLeft: 54, @@ -172,23 +158,15 @@ class RegRatesLineChartComponent extends React.Component { legendLayout: 'vertical' as const } } - componentDidMount() { - window.addEventListener('resize', this.recordWindowWidth) - } - - componentWillUnmount() { - window.removeEventListener('resize', this.recordWindowWidth) - } - recordWindowWidth = () => { - this.setState({ - ...this.state, - ...this.getStatePropertiesForChart() - }) - } + const getStatePropertiesForChart = useCallback(() => { + if (window.innerWidth > theme.grid.breakpoints.md) { + return getStatePropertiesForLargeWindowChart() + } + return getStatePropertiesForSmallWindowChart() + }, [theme]) - getLatestData() { - const { data, theme } = this.props + const getLatestData = () => { const latestData = data && data[data.length - 1] return { activeLabel: (latestData && latestData.label) || '', @@ -206,18 +184,48 @@ class RegRatesLineChartComponent extends React.Component { } } } - customizedLegend = () => { + + const [state, setState] = useState(() => ({ + ...getStatePropertiesForChart(), + ...getLatestData() + })) + const { + chartTop, + chartRight, + chartBottom, + chartLeft, + maximizeXAxisInterval, + legendLayout, + legendMarginLeft, + legendMarginTop + } = state + + useEffect(() => { + const recordWindowWidth = () => { + const latesProperties = getStatePropertiesForChart() + setState((prev) => ({ + ...prev, + ...latesProperties + })) + } + + window.addEventListener('resize', recordWindowWidth) + return () => { + window.removeEventListener('resize', recordWindowWidth) + } + }, [getStatePropertiesForChart]) + + const customizedLegend = () => { const { activeLabel, activeRegisteredInTargetDays, activeTotalRegistered, activeTotalEstimate - } = this.state.activeLabel ? this.state : this.getLatestData() - const { intl, eventType, completenessRateTime } = this.props + } = state.activeLabel ? state : getLatestData() return ( {activeLabel} @@ -284,7 +292,7 @@ class RegRatesLineChartComponent extends React.Component { ) } - customizedTooltip = (dataPoint: any) => { + const customizedTooltip = (dataPoint: any) => { const wrapperPayload = dataPoint.payload[0] return ( @@ -295,11 +303,11 @@ class RegRatesLineChartComponent extends React.Component { ) } - mouseMoveHandler = (data: any) => { - const { theme } = this.props + const mouseMoveHandler = (data: any) => { if (data && data.activePayload) { - this.setState({ + setState({ + ...state, activeLabel: data.activeLabel || '', activeRegisteredInTargetDays: { value: data.activePayload[2].value || 0, @@ -316,135 +324,127 @@ class RegRatesLineChartComponent extends React.Component { }) } } - mouseLeaveHandler = () => { - this.setState(this.getLatestData()) + const mouseLeaveHandler = () => { + const latestState = getLatestData() + setState((prev) => ({ ...prev, ...latestState })) } - getLoadingIndicatorForMobileView() { - return ( - - - - - - - -
- -
- + + const getLoadingIndicatorForMobileView = () => ( + + + + + + + +
+ +
+ + +
+ +
+
+ +
+ +
+ + -
+
+
+ -
-
- -
- -
- - - - -
- - - -
-
- -
- -
- - - - -
- - - -
-
-
-
- -
- ) - } - getLoadingIndicatorForDesktopView() { - return ( - - - - - - - - -
- -
- + + +
+ +
+ +
+ + + + +
+ + + +
+
+
+
+ +
+ ) + + const getLoadingIndicatorForDesktopView = () => ( + + + + + + + + +
+ +
+ + +
+ +
+
+ +
+ +
+ + -
+
+
+ -
-
- -
- -
- - - - -
- - - -
-
- -
- -
- - - - -
- - - -
-
-
-
-
- ) - } - getLoadingIndicator = () => { - if (window.innerWidth > this.props.theme.grid.breakpoints.md) { - return this.getLoadingIndicatorForDesktopView() - } else { - return this.getLoadingIndicatorForMobileView() + +
+
+ +
+ +
+ + + + +
+ + + +
+
+
+
+
+ ) + + const getLoadingIndicator = () => { + if (window.innerWidth > theme.grid.breakpoints.md) { + return getLoadingIndicatorForDesktopView() } + return getLoadingIndicatorForMobileView() } - getChart(data: ILineDataPoint[]) { - const { - chartTop, - chartRight, - chartBottom, - chartLeft, - maximizeXAxisInterval, - legendLayout - } = this.state + + if (data) { return ( { 'totalRegistered', 'registeredInTargetDays' ]} - mouseMoveHandler={this.mouseMoveHandler} - mouseLeaveHandler={this.mouseLeaveHandler} - tooltipContent={this.customizedTooltip} - legendContent={this.customizedLegend} + mouseMoveHandler={mouseMoveHandler} + mouseLeaveHandler={mouseLeaveHandler} + tooltipContent={customizedTooltip} + legendContent={customizedLegend} chartTop={chartTop} chartRight={chartRight} chartBottom={chartBottom} @@ -466,12 +466,7 @@ class RegRatesLineChartComponent extends React.Component { /> ) } - render() { - const { data } = this.props - - if (data) return this.getChart(data) - else return this.getLoadingIndicator() - } + return getLoadingIndicator() } export const RegRatesLineChart = withTheme( diff --git a/packages/login/src/views/ResetCredentialsForm/ForgottenItemForm.tsx b/packages/login/src/views/ResetCredentialsForm/ForgottenItemForm.tsx index d8713278949..83f7524c913 100644 --- a/packages/login/src/views/ResetCredentialsForm/ForgottenItemForm.tsx +++ b/packages/login/src/views/ResetCredentialsForm/ForgottenItemForm.tsx @@ -152,7 +152,6 @@ const ForgottenItemComponent = ({ ) } - export const ForgottenItem = connect(null, { goToHome, goToPhoneNumberVerificationForm diff --git a/packages/login/src/views/ResetCredentialsForm/SecurityQuestionForm.tsx b/packages/login/src/views/ResetCredentialsForm/SecurityQuestionForm.tsx index a11160c50bc..003dcd430fd 100644 --- a/packages/login/src/views/ResetCredentialsForm/SecurityQuestionForm.tsx +++ b/packages/login/src/views/ResetCredentialsForm/SecurityQuestionForm.tsx @@ -141,6 +141,7 @@ const SecurityQuestionComponent = ({ await authApi.sendUserName(location.state.nonce) return goToSuccessPage(location.state.forgottenItem) } + goToUpdatePasswordForm(result.nonce) } catch (error) { // @todo error handling From 9316352f6c8a3573635972adb05c76c764d25e02 Mon Sep 17 00:00:00 2001 From: Markus Date: Mon, 11 Nov 2024 10:43:17 +0200 Subject: [PATCH 27/50] fix: add warning limit for eslint in gateway --- packages/gateway/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/gateway/package.json b/packages/gateway/package.json index e5bddb313d7..c0a733f8440 100644 --- a/packages/gateway/package.json +++ b/packages/gateway/package.json @@ -17,7 +17,7 @@ "gen:schema:watch": "nodemon --quiet --on-change-only -e graphql -i src/graphql/schema.graphql -x 'yarn gen:schema'", "gen:types:watch": "nodemon --quiet --on-change-only -w src/graphql/schema.graphql -x 'yarn gen:types'", "open:cov": "yarn test && opener coverage/index.html", - "lint": "eslint -c .eslintrc.js --fix ./src" + "lint": "eslint -c .eslintrc.js --fix ./src --max-warnings=0" }, "dependencies": { "@elastic/elasticsearch": "8.13.1", From 09878a85e489f2cbac330d699f41a076a2c497eb Mon Sep 17 00:00:00 2001 From: Markus Date: Mon, 11 Nov 2024 10:44:22 +0200 Subject: [PATCH 28/50] fix: update gh action logging for knip --- .github/workflows/lint-and-test.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint-and-test.yml b/.github/workflows/lint-and-test.yml index 4afa00a76b5..2c21f890683 100644 --- a/.github/workflows/lint-and-test.yml +++ b/.github/workflows/lint-and-test.yml @@ -170,9 +170,9 @@ jobs: OUTPUT=$(npx knip --no-exit-code --exports --reporter=./knip-reporter.js) JSON=$(echo "$OUTPUT" | grep -o '{.*}') total_issues=$(echo "$JSON" | jq '.totalIssues') - echo "Total Issues: $total_issues" + echo "Found $total_issues issue(s) on base branch." + echo "Setting $total_issues issue(s) as max limit for PR branch." echo "maxIssues=${total_issues}" >> $GITHUB_OUTPUT - echo "Max issues = $maxIssues" - name: Checkout the PR branch uses: actions/checkout@v2 @@ -198,5 +198,4 @@ jobs: export default reporter; EOF - name: Run knip on PR branch - run: | - npx knip --max-issues=${{ steps.knip_base.outputs.maxIssues }} --exports --reporter=./knip-reporter.js + run: npx knip --max-issues=${{ steps.knip_base.outputs.maxIssues }} --exports --reporter=./knip-reporter.js From 3827c4b61e35396f4e206dc696f4c8a0553663b4 Mon Sep 17 00:00:00 2001 From: Markus Date: Mon, 11 Nov 2024 10:53:35 +0200 Subject: [PATCH 29/50] fix: add unused function to test knip trigger --- packages/notification/src/i18n/utils.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/notification/src/i18n/utils.ts b/packages/notification/src/i18n/utils.ts index d025a754426..4dc498a2b51 100644 --- a/packages/notification/src/i18n/utils.ts +++ b/packages/notification/src/i18n/utils.ts @@ -16,3 +16,5 @@ export function getAvailableLanguages() { export function getDefaultLanguage() { return getAvailableLanguages()[0] } + +export function unusedFn() {} From 77792847809fcc3a46e1f4da1c71ab93202d17f6 Mon Sep 17 00:00:00 2001 From: Markus Date: Mon, 11 Nov 2024 12:02:29 +0200 Subject: [PATCH 30/50] fix(knip): update custom counter logic to include right error types --- .github/workflows/lint-and-test.yml | 46 ++++++++++++++++------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/.github/workflows/lint-and-test.yml b/.github/workflows/lint-and-test.yml index 2c21f890683..815b286d172 100644 --- a/.github/workflows/lint-and-test.yml +++ b/.github/workflows/lint-and-test.yml @@ -152,17 +152,20 @@ jobs: run: | cat << 'EOF' > knip-reporter.js const reporter = function (options) { - const totalIssues = Object.values(options.issues).reduce( - (acc, issueRecords) => - acc + Object.values(issueRecords).reduce( - (acc2, issuesInFile) => acc2 + Object.keys(issuesInFile).length, - 0 - ), + const totalIssues = Object.entries(options.counters).reduce( + (acc, [key, value]) => { + if (options.report[key]) { + return acc + value + } + + return acc + }, 0 - ); - console.log(JSON.stringify({ totalIssues })); - }; - export default reporter; + ) + + console.log(JSON.stringify({ totalIssues })) + } + export default reporter EOF - name: Run knip on base branch id: knip_base @@ -185,17 +188,20 @@ jobs: run: | cat << 'EOF' > knip-reporter.js const reporter = function (options) { - const totalIssues = Object.values(options.issues).reduce( - (acc, issueRecords) => - acc + Object.values(issueRecords).reduce( - (acc2, issuesInFile) => acc2 + Object.keys(issuesInFile).length, - 0 - ), + const totalIssues = Object.entries(options.counters).reduce( + (acc, [key, value]) => { + if (options.report[key]) { + return acc + value + } + + return acc + }, 0 - ); - console.log(JSON.stringify({ totalIssues })); - }; - export default reporter; + ) + + console.log(JSON.stringify({ totalIssues })) + } + export default reporter EOF - name: Run knip on PR branch run: npx knip --max-issues=${{ steps.knip_base.outputs.maxIssues }} --exports --reporter=./knip-reporter.js From 02a96b67e276d34d6c02c24caf836833e1364e10 Mon Sep 17 00:00:00 2001 From: Markus Date: Mon, 11 Nov 2024 12:30:35 +0200 Subject: [PATCH 31/50] fix: remove unused export created for testing --- packages/notification/src/i18n/utils.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/notification/src/i18n/utils.ts b/packages/notification/src/i18n/utils.ts index 4dc498a2b51..d025a754426 100644 --- a/packages/notification/src/i18n/utils.ts +++ b/packages/notification/src/i18n/utils.ts @@ -16,5 +16,3 @@ export function getAvailableLanguages() { export function getDefaultLanguage() { return getAvailableLanguages()[0] } - -export function unusedFn() {} From 9d9801056747ec44082c26de22b6f083843c156d Mon Sep 17 00:00:00 2001 From: Siyasanga Mtshokotsha Date: Mon, 11 Nov 2024 13:43:23 +0200 Subject: [PATCH 32/50] feat: Add constants.humanName to allow countries to have custom full name format (#7812) * Add humanName to constants.ts To allow countries to have custom ordering for full names https://github.com/opencrvs/opencrvs-core/issues/6830 * Use constants.humanName on the UserList.tsx comp To ensure that we get the format from the country-config https://github.com/opencrvs/opencrvs-core/issues/6830 * Create a utility function getLocalisedname() To make the name more usable we had to extract the name formatting logic into it's own function. https://github.com/opencrvs/opencrvs-core/issues/6830 * Use getLocalisedName on the UserList component https://github.com/opencrvs/opencrvs-core/issues/6830 * Use getLocalisedName on the UserAudit comp Replace older logic to get the name which was based on an assumption that we support names in multiple languages https://github.com/opencrvs/opencrvs-core/issues/6830 * refactor: use getLocalisedName() @ InProgress.tsx We've found cleaner way to make the rendered name customizable for each country through client copy from country-config https://github.com/opencrvs/opencrvs-core/issues/6830 * Refactor the work queues to use getLocalisedName() We need to update all the places where a citizen's name is being referenced to show it in the format that the country chooses https://github.com/opencrvs/opencrvs-core/issues/6830 * Record changes in the CHANGELOG for this PR https://github.com/opencrvs/opencrvs-core/issues/6830 --- CHANGELOG.md | 1 + .../client/src/i18n/messages/constants.ts | 6 ++ packages/client/src/utils/data-formatting.ts | 16 ++++ packages/client/src/utils/draftUtils.test.ts | 87 ++++++++++++------- packages/client/src/utils/draftUtils.ts | 82 +++++++---------- .../OfficeHome/inProgress/InProgress.tsx | 3 +- .../OfficeHome/inProgress/inProgress.test.tsx | 2 +- .../src/views/OfficeHome/outbox/Outbox.tsx | 2 +- .../views/RecordAudit/RecordAudit.test.tsx | 2 +- .../src/views/RecordAudit/RecordAudit.tsx | 4 +- .../client/src/views/RecordAudit/utils.ts | 73 ++++++++++++---- .../review/ReviewSection.test.tsx | 2 +- .../RegisterForm/review/ReviewSection.tsx | 6 +- .../src/views/SysAdmin/Team/user/UserList.tsx | 9 +- .../client/src/views/UserAudit/UserAudit.tsx | 7 +- 15 files changed, 177 insertions(+), 125 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 578b6b0f562..d922c96fbe4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ - Record audit action buttons are moved into action menu [#7390](https://github.com/opencrvs/opencrvs-core/issues/7390) - Reoder the sytem user add/edit field for surname to be first, also change labels from `Last name` to `User's surname` and lastly remove the NID question from the form [#6830](https://github.com/opencrvs/opencrvs-core/issues/6830) - Auth now allows exchanging user's token for a new record-specific token [#7728](https://github.com/opencrvs/opencrvs-core/issues/7728) +- Allow countries to customise the format of the full name in the sytem for `sytem users` and `citizens` e.g `{LastName} {MiddleName} {Firstname}`, in any case where one of the name is not provided e.g no `MiddleName`, we'll simply render e.g `{LastName} {FirstName}` without any extra spaces if that's the order set in `country-config`. [#6830](https://github.com/opencrvs/opencrvs-core/issues/6830) ## Bug fixes diff --git a/packages/client/src/i18n/messages/constants.ts b/packages/client/src/i18n/messages/constants.ts index 58101a09a2c..38957df0d13 100644 --- a/packages/client/src/i18n/messages/constants.ts +++ b/packages/client/src/i18n/messages/constants.ts @@ -163,6 +163,7 @@ interface IConstantsMessages refresh: MessageDescriptor duplicateOf: MessageDescriptor matchedTo: MessageDescriptor + humanName: MessageDescriptor } const messagesToDefine: IConstantsMessages = { action: { @@ -978,6 +979,11 @@ const messagesToDefine: IConstantsMessages = { defaultMessage: `{registrationTargetDays} days - 1 year`, description: `Label for registrations within {registrationTargetDays} days to 1 year`, id: 'constants.withinTargetDaysTo1Year' + }, + humanName: { + defaultMessage: `{lastName} {middleName} {firstName}`, + description: 'A localized order of the full name', + id: 'constants.humanName' } } export const constantsMessages: Record< diff --git a/packages/client/src/utils/data-formatting.ts b/packages/client/src/utils/data-formatting.ts index 001daa8bec9..4de65ff8694 100644 --- a/packages/client/src/utils/data-formatting.ts +++ b/packages/client/src/utils/data-formatting.ts @@ -11,6 +11,8 @@ import { getDefaultLanguage } from '@client/i18n/utils' import type { GQLComment } from '@client/utils/gateway-deprecated-do-not-use' import { HumanName } from './gateway' +import { constantsMessages } from '@client/i18n/messages' +import { IntlShape } from 'react-intl' interface INamesMap { [key: string]: string @@ -81,3 +83,17 @@ export const mergeArraysRemovingEmptyStrings = ( export function getPercentage(total: number, current: number) { return current === 0 || total === 0 ? 0 : (current / total) * 100 } + +export function getLocalisedName( + intl: IntlShape, + nameObject: HumanName +): string { + return intl + .formatMessage(constantsMessages.humanName, { + firstName: nameObject.firstNames, + middleName: nameObject.middleName, + lastName: nameObject.familyName + }) + .replace(/\s+/g, ' ') // Remove extra spaces + .trim() +} diff --git a/packages/client/src/utils/draftUtils.test.ts b/packages/client/src/utils/draftUtils.test.ts index b7be4734d51..0f3012f4201 100644 --- a/packages/client/src/utils/draftUtils.test.ts +++ b/packages/client/src/utils/draftUtils.test.ts @@ -17,29 +17,49 @@ import type { GQLBirthEventSearchSet, GQLDeathEventSearchSet } from '@client/utils/gateway-deprecated-do-not-use' +import { createIntl, createIntlCache } from 'react-intl' + +const cache = createIntlCache() +const intlEngish = createIntl( + { + locale: 'en', + messages: {} + }, + cache +) +const intlBangla = createIntl( + { + locale: 'en', + messages: {} + }, + cache +) describe('draftUtils tests', () => { describe('getDraftInformantFullName()', () => { describe('Birth event', () => { it('Returns child english name properly', () => { expect( - getDeclarationFullName({ - id: '7b57d8f9-4d2d-4f12-8d0a-b042fe14f3d4', - data: { - child: { - firstNames: 'মুশ্রাফুল', - familyName: 'হক', - firstNamesEng: 'Mushraful', - familyNameEng: 'Hoque' - } + getDeclarationFullName( + { + id: '7b57d8f9-4d2d-4f12-8d0a-b042fe14f3d4', + data: { + child: { + firstNames: 'মুশ্রাফুল', + familyName: 'হক', + firstNamesEng: 'Mushraful', + familyNameEng: 'Hoque' + } + }, + event: Event.Birth, + savedOn: 1558037863335, + modifiedOn: 1558037867987 }, - event: Event.Birth, - savedOn: 1558037863335, - modifiedOn: 1558037867987 - }) - ).toBe('Mushraful Hoque') + intlEngish + ) + ).toBe('Hoque Mushraful') }) - it('Returns child bangla name properly', () => { + it('Returns child English name properly even though localed is Bangla', () => { expect( getDeclarationFullName( { @@ -55,30 +75,33 @@ describe('draftUtils tests', () => { savedOn: 1558037863335, modifiedOn: 1558037867987 }, - 'bn' + intlBangla ) - ).toBe('হক') + ).toBe('Hoque Mushraful') }) }) describe('Death event', () => { it('Returns deceased english name properly', () => { expect( - getDeclarationFullName({ - id: '7b57d8f9-4d2d-4f12-8d0a-b042fe14f3d4', - data: { - deceased: { - firstNames: 'মুশ্রাফুল', - familyName: 'হক', - familyNameEng: 'Hoque' - } + getDeclarationFullName( + { + id: '7b57d8f9-4d2d-4f12-8d0a-b042fe14f3d4', + data: { + deceased: { + firstNames: 'মুশ্রাফুল', + familyName: 'হক', + familyNameEng: 'Hoque' + } + }, + event: Event.Death, + savedOn: 1558037863335, + modifiedOn: 1558037867987 }, - event: Event.Death, - savedOn: 1558037863335, - modifiedOn: 1558037867987 - }) + intlBangla + ) ).toBe('Hoque') }) - it('Returns child bangla name properly', () => { + it('Returns child English name properly even when the current locale is Bangla', () => { expect( getDeclarationFullName( { @@ -95,9 +118,9 @@ describe('draftUtils tests', () => { savedOn: 1558037863335, modifiedOn: 1558037867987 }, - 'bn' + intlEngish ) - ).toBe('মুশ্রাফুল হক') + ).toBe('Hoque Mushraful') }) }) }) diff --git a/packages/client/src/utils/draftUtils.ts b/packages/client/src/utils/draftUtils.ts index 47dfe4dbe57..10058046659 100644 --- a/packages/client/src/utils/draftUtils.ts +++ b/packages/client/src/utils/draftUtils.ts @@ -13,7 +13,6 @@ import { SUBMISSION_STATUS, IPrintableDeclaration } from '@client/declarations' -import { IFormSectionData } from '@client/forms' import { Event, History, RegStatus } from '@client/utils/gateway' import type { GQLBirthEventSearchSet, @@ -24,67 +23,48 @@ import type { import { getEvent } from '@client/views/PrintCertificate/utils' import { includes } from 'lodash' import { EMPTY_STRING } from '@client/utils/constants' - -const getEngName = ( - sectionData: IFormSectionData, - lastNameFirst: boolean -): string => { - if (lastNameFirst) { - return `${sectionData.familyNameEng ?? ''} ${ - sectionData.firstNamesEng ?? '' - }` - } - return [ - sectionData.firstNamesEng, - sectionData.middleNameEng, - sectionData.familyNameEng - ] - .filter(Boolean) - .join(' ') - .trim() -} - -const getOtherName = (sectionData: IFormSectionData): string => { - return [ - sectionData.firstNames, - sectionData.middleName, - sectionData.familyName - ] - .filter(Boolean) - .join(' ') - .trim() -} - -const getFullName = ( - sectionData: IFormSectionData, - language = 'en', - lastNameFirst = false -): string => { - if (!sectionData) { - return EMPTY_STRING - } - if (language === 'en') { - return getEngName(sectionData, lastNameFirst) - } - return getOtherName(sectionData) || getEngName(sectionData, lastNameFirst) -} +import { getLocalisedName } from './data-formatting' +import { IntlShape } from 'react-intl' /* * lastNameFirst needs to be removed in #4464 */ export const getDeclarationFullName = ( draft: IDeclaration, - language?: string, - lastNameFirst?: boolean + intl: IntlShape ) => { switch (draft.event) { case Event.Birth: - return getFullName(draft.data.child, language, lastNameFirst) + return draft.data.child + ? getLocalisedName(intl, { + firstNames: draft.data.child.firstNamesEng as string, + middleName: draft.data.child.middleNameEng as string, + familyName: draft.data.child.familyNameEng as string + }) + : EMPTY_STRING case Event.Death: - return getFullName(draft.data.deceased, language, lastNameFirst) + return draft.data.deceased + ? getLocalisedName(intl, { + firstNames: draft.data.deceased.firstNamesEng as string, + middleName: draft.data.deceased.middleNameEng as string, + familyName: draft.data.deceased.familyNameEng as string + }) + : EMPTY_STRING case Event.Marriage: - const brideName = getFullName(draft.data.bride, language, lastNameFirst) - const groomName = getFullName(draft.data.groom, language, lastNameFirst) + const brideName = draft.data.bride + ? getLocalisedName(intl, { + firstNames: draft.data.bride.firstNamesEng as string, + middleName: draft.data.bride.middleNameEng as string, + familyName: draft.data.bride.familyNameEng as string + }) + : EMPTY_STRING + const groomName = draft.data.groom + ? getLocalisedName(intl, { + firstNames: draft.data.groom.firstNamesEng as string, + middleName: draft.data.groom.middleNameEng as string, + familyName: draft.data.groom.familyNameEng as string + }) + : EMPTY_STRING if (brideName && groomName) { return `${groomName} & ${brideName}` } else { diff --git a/packages/client/src/views/OfficeHome/inProgress/InProgress.tsx b/packages/client/src/views/OfficeHome/inProgress/InProgress.tsx index bccebf39128..cd4d32b7e1d 100644 --- a/packages/client/src/views/OfficeHome/inProgress/InProgress.tsx +++ b/packages/client/src/views/OfficeHome/inProgress/InProgress.tsx @@ -344,7 +344,6 @@ class InProgressComponent extends React.Component< transformDraftContent = () => { const { intl } = this.props - const { locale } = intl if (!this.props.drafts || this.props.drafts.length <= 0) { return [] } @@ -361,7 +360,7 @@ class InProgressComponent extends React.Component< } else if (draft.event && draft.event.toString() === 'marriage') { pageRoute = DRAFT_MARRIAGE_FORM_PAGE } - const name = getDeclarationFullName(draft, locale) + const name = getDeclarationFullName(draft, intl) const lastModificationDate = draft.modifiedOn || draft.savedOn const actions: IAction[] = [] diff --git a/packages/client/src/views/OfficeHome/inProgress/inProgress.test.tsx b/packages/client/src/views/OfficeHome/inProgress/inProgress.test.tsx index 33b8b91e638..1032651d0a4 100644 --- a/packages/client/src/views/OfficeHome/inProgress/inProgress.test.tsx +++ b/packages/client/src/views/OfficeHome/inProgress/inProgress.test.tsx @@ -297,7 +297,7 @@ describe('In Progress tab', () => { const EXPECTED_DATE_OF_REJECTION = formattedDuration(TIME_STAMP) expect(data[0].id).toBe('e302f7c5-ad87-4117-91c1-35eaf2ea7be8') - expect(data[0].name).toBe('anik hoque') + expect(data[0].name).toBe('hoque anik') expect(data[0].lastUpdated).toBe(EXPECTED_DATE_OF_REJECTION) expect(data[0].event).toBe('Birth') expect(data[0].actions).toBeDefined() diff --git a/packages/client/src/views/OfficeHome/outbox/Outbox.tsx b/packages/client/src/views/OfficeHome/outbox/Outbox.tsx index c5b909a69b7..866a5b9cf85 100644 --- a/packages/client/src/views/OfficeHome/outbox/Outbox.tsx +++ b/packages/client/src/views/OfficeHome/outbox/Outbox.tsx @@ -168,7 +168,7 @@ export function Outbox() { function transformDeclarationsReadyToSend() { const items = declarations.map((declaration, index) => { - const name = getDeclarationFullName(declaration) + const name = getDeclarationFullName(declaration, intl) let dateOfEvent if (declaration.event && declaration.event.toString() === 'birth') { dateOfEvent = declaration.data?.child?.childBirthDate as string diff --git a/packages/client/src/views/RecordAudit/RecordAudit.test.tsx b/packages/client/src/views/RecordAudit/RecordAudit.test.tsx index 78eff975f4f..c3c88638a07 100644 --- a/packages/client/src/views/RecordAudit/RecordAudit.test.tsx +++ b/packages/client/src/views/RecordAudit/RecordAudit.test.tsx @@ -292,7 +292,7 @@ describe('Record audit summary for WorkQueue declarations', () => { component.find({ 'data-testid': 'type-value' }).hostNodes().text() ).toBe('Birth') expect(component.find('#content-name').hostNodes().text()).toBe( - 'Shakib Al Hasan' + 'Al Hasan Shakib' ) expect( component diff --git a/packages/client/src/views/RecordAudit/RecordAudit.tsx b/packages/client/src/views/RecordAudit/RecordAudit.tsx index 3b19ab2d0ae..560b773455e 100644 --- a/packages/client/src/views/RecordAudit/RecordAudit.tsx +++ b/packages/client/src/views/RecordAudit/RecordAudit.tsx @@ -555,7 +555,7 @@ const BodyContent = ({ assignment: data.fetchRegistration?.registration?.assignment } } else { - declaration = getGQLDeclaration(data.fetchRegistration, language) + declaration = getGQLDeclaration(data.fetchRegistration, intl) } return ( @@ -592,7 +592,7 @@ const BodyContent = ({ } : getWQDeclarationData( workqueueDeclaration as NonNullable, - language, + intl, trackingId ) const wqStatus = workqueueDeclaration?.registration diff --git a/packages/client/src/views/RecordAudit/utils.ts b/packages/client/src/views/RecordAudit/utils.ts index 5abb838320e..c25d31baaff 100644 --- a/packages/client/src/views/RecordAudit/utils.ts +++ b/packages/client/src/views/RecordAudit/utils.ts @@ -25,7 +25,7 @@ import type { GQLAssignmentData, GQLMarriageEventSearchSet } from '@client/utils/gateway-deprecated-do-not-use' -import { createNamesMap } from '@client/utils/data-formatting' +import { createNamesMap, getLocalisedName } from '@client/utils/data-formatting' import { IDynamicValues } from '@client/navigation' import { countryMessages } from '@client/i18n/messages/constants' import { @@ -337,8 +337,8 @@ export const getDraftDeclarationData = ( ): IDeclarationData => { return { id: declaration.id, - name: getDeclarationFullName(declaration), - type: declaration.event, + name: getDeclarationFullName(declaration, intl), + type: declaration.event || EMPTY_STRING, registrationNo: declaration.data?.registration?.registrationNumber?.toString() || EMPTY_STRING, @@ -365,7 +365,7 @@ export const getDraftDeclarationData = ( export const getWQDeclarationData = ( workqueueDeclaration: GQLEventSearchSet, - language: string, + intl: IntlShape, trackingId: string ) => { let name = EMPTY_STRING @@ -373,19 +373,35 @@ export const getWQDeclarationData = ( isBirthDeclaration(workqueueDeclaration) && workqueueDeclaration.childName ) { - name = getName(workqueueDeclaration.childName, language) + name = getLocalisedName(intl, { + firstNames: workqueueDeclaration.childName[0]?.firstNames, + middleName: workqueueDeclaration.childName[0]?.middleName, + familyName: workqueueDeclaration.childName[0]?.familyName + }) } else if ( isDeathDeclaration(workqueueDeclaration) && workqueueDeclaration.deceasedName ) { - name = getName(workqueueDeclaration.deceasedName, language) + name = getLocalisedName(intl, { + firstNames: workqueueDeclaration.deceasedName[0]?.firstNames, + middleName: workqueueDeclaration.deceasedName[0]?.middleName, + familyName: workqueueDeclaration.deceasedName[0]?.familyName + }) } else if ( isMarriageDeclaration(workqueueDeclaration) && workqueueDeclaration.brideName && workqueueDeclaration.groomName ) { - const groomName = getName(workqueueDeclaration.groomName, language) - const brideName = getName(workqueueDeclaration.brideName, language) + const groomName = getLocalisedName(intl, { + firstNames: workqueueDeclaration.groomName[0]?.firstNames, + middleName: workqueueDeclaration.groomName[0]?.middleName, + familyName: workqueueDeclaration.groomName[0]?.familyName + }) + const brideName = getLocalisedName(intl, { + firstNames: workqueueDeclaration.brideName[0]?.firstNames, + middleName: workqueueDeclaration.brideName[0]?.middleName, + familyName: workqueueDeclaration.brideName[0]?.familyName + }) name = brideName && groomName @@ -408,25 +424,48 @@ export const getWQDeclarationData = ( export const getGQLDeclaration = ( data: IGQLDeclaration, - language: string + intl: IntlShape ): IDeclarationData => { let name = EMPTY_STRING if (data.child) { - name = data.child.name ? getName(data.child.name, language) : EMPTY_STRING + name = data.child.name + ? getLocalisedName(intl, { + firstNames: data.child.name[0]?.firstNames, + middleName: data.child.name[0]?.middleName, + familyName: data.child.name[0]?.familyName + }) + : EMPTY_STRING } else if (data.deceased) { name = data.deceased.name - ? getName(data.deceased.name, language) + ? getLocalisedName(intl, { + firstNames: data.deceased.name[0]?.firstNames, + middleName: data.deceased.name[0]?.middleName, + familyName: data.deceased.name[0]?.familyName + }) : EMPTY_STRING } else if (data.groom || data.bride) { if (data.groom?.name && data.bride?.name) { - name = `${getName(data.groom.name, language)} & ${getName( - data.bride.name, - language - )}` + name = `${getLocalisedName(intl, { + firstNames: data.groom.name[0]?.firstNames, + middleName: data.groom.name[0]?.middleName, + familyName: data.groom.name[0]?.familyName + })} & ${getLocalisedName(intl, { + firstNames: data.bride.name[0]?.firstNames, + middleName: data.bride.name[0]?.middleName, + familyName: data.bride.name[0]?.firstNames + })}` } else if (data.groom?.name) { - name = getName(data.groom.name, language) + name = getLocalisedName(intl, { + firstNames: data.groom.name[0]?.firstNames, + middleName: data.groom.name[0]?.middleName, + familyName: data.groom.name[0]?.familyName + }) } else if (data.bride?.name) { - name = getName(data.bride.name, language) + name = getLocalisedName(intl, { + firstNames: data.bride.name[0]?.firstNames, + middleName: data.bride.name[0]?.middleName, + familyName: data.bride.name[0]?.familyName + }) } else { name = EMPTY_STRING } diff --git a/packages/client/src/views/RegisterForm/review/ReviewSection.test.tsx b/packages/client/src/views/RegisterForm/review/ReviewSection.test.tsx index 08ccebc578e..902f30d036b 100644 --- a/packages/client/src/views/RegisterForm/review/ReviewSection.test.tsx +++ b/packages/client/src/views/RegisterForm/review/ReviewSection.test.tsx @@ -178,7 +178,7 @@ describe('when in device of large viewport', () => { ).toBe('Government of the peoples republic of Bangladesh') expect( reviewSectionComponent.find('#review_header_subject').hostNodes().text() - ).toBe('Birth Declaration for John Doe') + ).toBe('Birth Declaration for Doe John') }) it('typing additional comments input triggers onchange review form', async () => { diff --git a/packages/client/src/views/RegisterForm/review/ReviewSection.tsx b/packages/client/src/views/RegisterForm/review/ReviewSection.tsx index c2406b6b80d..467a90dff6c 100644 --- a/packages/client/src/views/RegisterForm/review/ReviewSection.tsx +++ b/packages/client/src/views/RegisterForm/review/ReviewSection.tsx @@ -1699,11 +1699,7 @@ class ReviewSectionComp extends React.Component { '') as string } - const informantName = getDeclarationFullName( - declaration, - intl.locale, - this.isLastNameFirst() - ) + const informantName = getDeclarationFullName(declaration, intl) const draft = this.isDraft() const transformedSectionData = this.transformSectionData( formSections.filter( diff --git a/packages/client/src/views/SysAdmin/Team/user/UserList.tsx b/packages/client/src/views/SysAdmin/Team/user/UserList.tsx index 34a7659c9ab..c61076155aa 100644 --- a/packages/client/src/views/SysAdmin/Team/user/UserList.tsx +++ b/packages/client/src/views/SysAdmin/Team/user/UserList.tsx @@ -34,7 +34,7 @@ import { NATL_ADMIN_ROLES, SYS_ADMIN_ROLES } from '@client/utils/constants' -import { createNamesMap } from '@client/utils/data-formatting' +import { createNamesMap, getLocalisedName } from '@client/utils/data-formatting' import { SysAdminContentWrapper } from '@client/views/SysAdmin/SysAdminContentWrapper' import { getAddressName, @@ -552,12 +552,7 @@ function UserListComponent(props: IProps) { return data.searchUsers.results.map( (user: User | null, index: number) => { if (user !== null) { - const name = - (user && - user.name && - ((createNamesMap(user.name)[intl.locale] as string) || - (createNamesMap(user.name)[LANG_EN] as string))) || - '' + const name = getLocalisedName(intl, user.name[0]) const role = intl.formatMessage({ id: getUserRoleIntlKey(user.role._id) }) diff --git a/packages/client/src/views/UserAudit/UserAudit.tsx b/packages/client/src/views/UserAudit/UserAudit.tsx index 680ed4cec5d..d4c0b29b2e9 100644 --- a/packages/client/src/views/UserAudit/UserAudit.tsx +++ b/packages/client/src/views/UserAudit/UserAudit.tsx @@ -18,7 +18,7 @@ import { Frame } from '@opencrvs/components/lib/Frame' import { IntlShape, useIntl } from 'react-intl' import { useParams } from 'react-router' import { GET_USER } from '@client/user/queries' -import { createNamesMap } from '@client/utils/data-formatting' +import { getLocalisedName } from '@client/utils/data-formatting' import { AvatarSmall } from '@client/components/Avatar' import styled from 'styled-components' import { ToggleMenu } from '@opencrvs/components/lib/ToggleMenu' @@ -42,7 +42,6 @@ import { UserAuditActionModal } from '@client/views/SysAdmin/Team/user/UserAudit import { GetUserQuery, GetUserQueryVariables, - HumanName, User, SystemRoleType } from '@client/utils/gateway' @@ -83,9 +82,7 @@ const transformUserQueryResult = ( '')) || '' }, - name: - createNamesMap(userData.name as HumanName[])[locale] || - createNamesMap(userData.name as HumanName[])[LANG_EN], + name: getLocalisedName(intl, userData.name[0]), systemRole: userData.systemRole, role: userData.role, number: userData.mobile, From 355d1662cc21aad02a59144e7adce8ff8757cb2f Mon Sep 17 00:00:00 2001 From: Pathum Nakandala <61136185+PathumN99@users.noreply.github.com> Date: Mon, 11 Nov 2024 18:44:04 +0530 Subject: [PATCH 33/50] feat: pass record-specific token to country config when registering a event (#7882) * Ticket 7849 implementation * Added audience values to the event-specific token * Removed unnecessary validations * Minor changes * Removed try catch block * chore(changelog): clarify wording on what the token exchange means * fix: add auth url to docker compose * refactor: unify error handling fixes a problem where the rejection error wasnt logged at all --------- Co-authored-by: Pyry Rouvila Co-authored-by: naftis --- CHANGELOG.md | 2 +- docker-compose.yml | 1 + .../auth/src/features/authenticate/service.ts | 13 +++++- packages/workflow/src/constants.ts | 1 + .../registration/fhir/fhir-bundle-modifier.ts | 6 ++- .../workflow/src/records/state-transitions.ts | 12 ++++- .../src/records/token-exchange-handler.ts | 45 +++++++++++++++++++ 7 files changed, 75 insertions(+), 5 deletions(-) create mode 100644 packages/workflow/src/records/token-exchange-handler.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index d922c96fbe4..23c9a748070 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,7 +26,7 @@ - Deploy UI-Kit Storybook to [opencrvs.pages.dev](https://opencrvs.pages.dev) to allow extending OpenCRVS using the component library - Record audit action buttons are moved into action menu [#7390](https://github.com/opencrvs/opencrvs-core/issues/7390) - Reoder the sytem user add/edit field for surname to be first, also change labels from `Last name` to `User's surname` and lastly remove the NID question from the form [#6830](https://github.com/opencrvs/opencrvs-core/issues/6830) -- Auth now allows exchanging user's token for a new record-specific token [#7728](https://github.com/opencrvs/opencrvs-core/issues/7728) +- Auth now allows registrar's token to be exchanged for a new token that strictly allows confirming or rejecting a specific record. Core now passes this token to country configuration instead of the registrar's token [#7728](https://github.com/opencrvs/opencrvs-core/issues/7728) [#7849](https://github.com/opencrvs/opencrvs-core/issues/7849) - Allow countries to customise the format of the full name in the sytem for `sytem users` and `citizens` e.g `{LastName} {MiddleName} {Firstname}`, in any case where one of the name is not provided e.g no `MiddleName`, we'll simply render e.g `{LastName} {FirstName}` without any extra spaces if that's the order set in `country-config`. [#6830](https://github.com/opencrvs/opencrvs-core/issues/6830) ## Bug fixes diff --git a/docker-compose.yml b/docker-compose.yml index 79414a43c7e..1f326c81f36 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -96,6 +96,7 @@ services: - FHIR_URL=http://hearth:3447/fhir - WEBHOOKS_URL=http://webhooks:2525/ - APPLICATION_CONFIG_URL=http://config:2021/ + - AUTH_URL=http://auth:4040 - COUNTRY=${COUNTRY:-bgd} # PEN_TEST change to gbr search: image: opencrvs/ocrvs-search:${VERSION} diff --git a/packages/auth/src/features/authenticate/service.ts b/packages/auth/src/features/authenticate/service.ts index 3521566e3e7..51ed1062040 100644 --- a/packages/auth/src/features/authenticate/service.ts +++ b/packages/auth/src/features/authenticate/service.ts @@ -150,7 +150,18 @@ export async function createTokenForRecordValidation( expiresIn: '7 days', audience: [ 'opencrvs:gateway-user', // to get to the gateway - 'opencrvs:user-mgnt-user' // to allow the gateway to connect the 'sub' to an actual user + 'opencrvs:user-mgnt-user', // to allow the gateway to connect the 'sub' to an actual user + 'opencrvs:auth-user', + 'opencrvs:hearth-user', + 'opencrvs:notification-user', + 'opencrvs:workflow-user', + 'opencrvs:search-user', + 'opencrvs:metrics-user', + 'opencrvs:countryconfig-user', + 'opencrvs:webhooks-user', + 'opencrvs:config-user', + 'opencrvs:documents-user', + 'opencrvs:notification-api-user' ], issuer: JWT_ISSUER } diff --git a/packages/workflow/src/constants.ts b/packages/workflow/src/constants.ts index 285caf6631e..a9b19cd8d7e 100644 --- a/packages/workflow/src/constants.ts +++ b/packages/workflow/src/constants.ts @@ -33,6 +33,7 @@ export const DOCUMENTS_URL = export const USER_MANAGEMENT_URL = process.env.USER_MANAGEMENT_URL || 'http://localhost:3030/' export const SENTRY_DSN = process.env.SENTRY_DSN +export const AUTH_URL = process.env.AUTH_URL || 'http://localhost:4040/' function getAvailableLanguages() { const LANGUAGES = (process.env.LANGUAGES && process.env.LANGUAGES) || 'en,fr' diff --git a/packages/workflow/src/features/registration/fhir/fhir-bundle-modifier.ts b/packages/workflow/src/features/registration/fhir/fhir-bundle-modifier.ts index c1f6bd98650..483d3a7afa0 100644 --- a/packages/workflow/src/features/registration/fhir/fhir-bundle-modifier.ts +++ b/packages/workflow/src/features/registration/fhir/fhir-bundle-modifier.ts @@ -58,8 +58,10 @@ export async function invokeRegistrationValidation( } ) if (!res.ok) { - const errorData = await res.json() - throw `System error: ${res.statusText} ${res.status} ${errorData.msg}` + const errorText = await res.text() + throw new Error( + `Error calling country configuration event-registration [${res.statusText} ${res.status}]: ${errorText}` + ) } return bundle } diff --git a/packages/workflow/src/records/state-transitions.ts b/packages/workflow/src/records/state-transitions.ts index d190b5cd1f4..9775d82c72e 100644 --- a/packages/workflow/src/records/state-transitions.ts +++ b/packages/workflow/src/records/state-transitions.ts @@ -51,7 +51,7 @@ import { TaskHistory, RejectedRecord } from '@opencrvs/commons/types' -import { getUUID, UUID } from '@opencrvs/commons' +import { getUUID, logger, UUID } from '@opencrvs/commons' import { REG_NUMBER_SYSTEM, SECTION_CODE @@ -107,6 +107,7 @@ import { mergeBundles } from '@workflow/records/fhir' import { REG_NUMBER_GENERATION_FAILED } from '@workflow/features/registration/fhir/constants' +import { tokenExchangeHandler } from './token-exchange-handler' export async function toCorrected( record: RegisteredRecord | CertifiedRecord | IssuedRecord, @@ -449,8 +450,17 @@ export async function initiateRegistration( token: string ): Promise { try { + const composition = getComposition(record) + const recordSpecificToken = await tokenExchangeHandler( + token, + headers, + composition.id + ) + headers.authorization = `Bearer ${recordSpecificToken.access_token}` await invokeRegistrationValidation(record, headers) } catch (error) { + logger.error(error) + const statusReason: fhir3.CodeableConcept = { text: REG_NUMBER_GENERATION_FAILED } diff --git a/packages/workflow/src/records/token-exchange-handler.ts b/packages/workflow/src/records/token-exchange-handler.ts new file mode 100644 index 00000000000..7467f88d625 --- /dev/null +++ b/packages/workflow/src/records/token-exchange-handler.ts @@ -0,0 +1,45 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * OpenCRVS is also distributed under the terms of the Civil Registration + * & Healthcare Disclaimer located at http://opencrvs.org/license. + * + * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. + */ +import { AUTH_URL } from '@workflow/constants' +import fetch from 'node-fetch' + +export async function tokenExchangeHandler( + token: string, + headers: Record, + recordId: string +) { + const grantType = 'urn:opencrvs:oauth:grant-type:token-exchange' + const subject_token_type = 'urn:ietf:params:oauth:token-type:access_token' + const requested_token_type = + 'urn:opencrvs:oauth:token-type:single_record_token' + + const authUrl = new URL( + `token?grant_type=${grantType}&subject_token=${token}&subject_token_type=${subject_token_type}&requested_token_type=${requested_token_type}&record_id=${recordId}`, + AUTH_URL + ) + + const res = await fetch(authUrl, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + ...headers + } + }) + + if (!res.ok) { + throw new Error( + `Error calling token exchange handler [${res.statusText} ${ + res.status + }]: ${await res.text()}` + ) + } + return (await res.json()) as { access_token: string } +} From 9a5a80d0e8e7598146091065b9ecd0a72b54f630 Mon Sep 17 00:00:00 2001 From: Jamil Date: Mon, 11 Nov 2024 19:32:19 +0600 Subject: [PATCH 34/50] chore: update yarn.lock (#7952) --- yarn.lock | 46 ++++++++++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/yarn.lock b/yarn.lock index aaf090ebee4..fa8f012e474 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8466,6 +8466,14 @@ "@types/react" "*" hoist-non-react-statics "^3.3.0" +"@types/html-to-pdfmake@^2.4.4": + version "2.4.4" + resolved "https://registry.yarnpkg.com/@types/html-to-pdfmake/-/html-to-pdfmake-2.4.4.tgz#42f97eaaf69ecb68f701b686e56fd914e1780b81" + integrity sha512-2dt44vpbftXWuObFP3UmQwsl6BGCuByxa6IXaIVLn1TqvWDJ6ithkKbiTuWjxmlpCG9vrLJNZYnckbuKQPf19w== + dependencies: + "@types/jsdom" "*" + "@types/pdfmake" "*" + "@types/http-cache-semantics@*": version "4.0.3" resolved "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.3.tgz" @@ -8520,6 +8528,15 @@ resolved "https://registry.npmjs.org/@types/js-yaml/-/js-yaml-4.0.9.tgz" integrity sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg== +"@types/jsdom@*": + version "21.1.7" + resolved "https://registry.yarnpkg.com/@types/jsdom/-/jsdom-21.1.7.tgz#9edcb09e0b07ce876e7833922d3274149c898cfa" + integrity sha512-yOriVnggzrnQ3a9OKOCxaVuSug3w3/SbOj5i7VwXWZEyUNl3bLF9V3MfxGbZKuwqJOQyRfqXyROBB1CoZLFWzA== + dependencies: + "@types/node" "*" + "@types/tough-cookie" "*" + parse5 "^7.0.0" + "@types/json-schema@*", "@types/json-schema@^7.0.6", "@types/json-schema@^7.0.7": version "7.0.15" resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz" @@ -8679,13 +8696,6 @@ dependencies: undici-types "~5.26.4" -"@types/node@^22.7.9": - version "22.7.9" - resolved "https://registry.yarnpkg.com/@types/node/-/node-22.7.9.tgz#2bf2797b5e84702d8262ea2cf843c3c3c880d0e9" - integrity sha512-jrTfRC7FM6nChvU7X2KqcrgquofrWLFDeYC1hKfwNWomVvrn7JIksqf344WN2X/y8xrgqBd2dJATZV4GbatBfg== - dependencies: - undici-types "~6.19.2" - "@types/node@^8.10.50": version "8.10.66" resolved "https://registry.npmjs.org/@types/node/-/node-8.10.66.tgz" @@ -8708,7 +8718,7 @@ dependencies: "@types/node" "*" -"@types/pdfmake@^0.2.0": +"@types/pdfmake@*", "@types/pdfmake@^0.2.0": version "0.2.9" resolved "https://registry.yarnpkg.com/@types/pdfmake/-/pdfmake-0.2.9.tgz#241a4a1d00f2d5426383cd5410991c5587ce57f7" integrity sha512-uLDKEH3A1fnCd/qXYJB2OnKkkjfdC1oc6HYVYBKxsyN1UsJL/8Lt67T6WFo3umkL+5Zd74M2IYcOf5kwwd9x9w== @@ -8991,6 +9001,11 @@ "@types/react" "*" csstype "^3.0.2" +"@types/tough-cookie@*": + version "4.0.5" + resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-4.0.5.tgz#cb6e2a691b70cb177c6e3ae9c1d2e8b2ea8cd304" + integrity sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA== + "@types/traverse@^0.6.32": version "0.6.36" resolved "https://registry.npmjs.org/@types/traverse/-/traverse-0.6.36.tgz" @@ -15609,6 +15624,11 @@ html-tags@^3.1.0, html-tags@^3.2.0: resolved "https://registry.npmjs.org/html-tags/-/html-tags-3.3.1.tgz" integrity sha512-ztqyC3kLto0e9WbNp0aeP+M3kTt+nbaIveGmUxAtZa+8iFgKLUOD4YKM5j+f3QD89bra7UeumolZHKuOXnTmeQ== +html-to-pdfmake@^2.5.13: + version "2.5.14" + resolved "https://registry.yarnpkg.com/html-to-pdfmake/-/html-to-pdfmake-2.5.14.tgz#4ff8b865b4aa8678ca9f18b16d5bf3014566c8ec" + integrity sha512-0mwRkI2NHmY8rE7bHESglmeUsgFPSatvyTWZIeeU7FIXXxUEMRx704xMyKxWo1XBsGqmWAI7nhomrciiy1sWtw== + htmlparser2@^8.0.0, htmlparser2@^8.0.1: version "8.0.2" resolved "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.2.tgz" @@ -24042,11 +24062,6 @@ typescript@4.9.5, typescript@^4.5: resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.4.5.tgz#42ccef2c571fdbd0f6718b1d1f5e6e5ef006f611" integrity sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ== -typescript@^5.6.3: - version "5.6.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.6.3.tgz#5f3449e31c9d94febb17de03cc081dd56d81db5b" - integrity sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw== - typical@^2.6.1: version "2.6.1" resolved "https://registry.npmjs.org/typical/-/typical-2.6.1.tgz" @@ -24107,11 +24122,6 @@ undici-types@~5.26.4: resolved "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz" integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== -undici-types@~6.19.2: - version "6.19.8" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.19.8.tgz#35111c9d1437ab83a7cdc0abae2f26d88eda0a02" - integrity sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw== - undici@^5.22.1: version "5.28.4" resolved "https://registry.yarnpkg.com/undici/-/undici-5.28.4.tgz#6b280408edb6a1a604a9b20340f45b422e373068" From b7082b0844de407ea42413b5f39533dbbe201bdd Mon Sep 17 00:00:00 2001 From: Tameem Bin Haider Date: Tue, 12 Nov 2024 11:46:41 +0600 Subject: [PATCH 35/50] Revert "feat: Add constants.humanName to allow countries to have custom full name format (#7812)" This reverts commit 9d9801056747ec44082c26de22b6f083843c156d. --- CHANGELOG.md | 1 - .../client/src/i18n/messages/constants.ts | 6 -- packages/client/src/utils/data-formatting.ts | 16 ---- packages/client/src/utils/draftUtils.test.ts | 87 +++++++------------ packages/client/src/utils/draftUtils.ts | 82 ++++++++++------- .../OfficeHome/inProgress/InProgress.tsx | 3 +- .../OfficeHome/inProgress/inProgress.test.tsx | 2 +- .../src/views/OfficeHome/outbox/Outbox.tsx | 2 +- .../views/RecordAudit/RecordAudit.test.tsx | 2 +- .../src/views/RecordAudit/RecordAudit.tsx | 4 +- .../client/src/views/RecordAudit/utils.ts | 73 ++++------------ .../review/ReviewSection.test.tsx | 2 +- .../RegisterForm/review/ReviewSection.tsx | 6 +- .../src/views/SysAdmin/Team/user/UserList.tsx | 9 +- .../client/src/views/UserAudit/UserAudit.tsx | 7 +- 15 files changed, 125 insertions(+), 177 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 23c9a748070..36c196eef88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,7 +27,6 @@ - Record audit action buttons are moved into action menu [#7390](https://github.com/opencrvs/opencrvs-core/issues/7390) - Reoder the sytem user add/edit field for surname to be first, also change labels from `Last name` to `User's surname` and lastly remove the NID question from the form [#6830](https://github.com/opencrvs/opencrvs-core/issues/6830) - Auth now allows registrar's token to be exchanged for a new token that strictly allows confirming or rejecting a specific record. Core now passes this token to country configuration instead of the registrar's token [#7728](https://github.com/opencrvs/opencrvs-core/issues/7728) [#7849](https://github.com/opencrvs/opencrvs-core/issues/7849) -- Allow countries to customise the format of the full name in the sytem for `sytem users` and `citizens` e.g `{LastName} {MiddleName} {Firstname}`, in any case where one of the name is not provided e.g no `MiddleName`, we'll simply render e.g `{LastName} {FirstName}` without any extra spaces if that's the order set in `country-config`. [#6830](https://github.com/opencrvs/opencrvs-core/issues/6830) ## Bug fixes diff --git a/packages/client/src/i18n/messages/constants.ts b/packages/client/src/i18n/messages/constants.ts index 38957df0d13..58101a09a2c 100644 --- a/packages/client/src/i18n/messages/constants.ts +++ b/packages/client/src/i18n/messages/constants.ts @@ -163,7 +163,6 @@ interface IConstantsMessages refresh: MessageDescriptor duplicateOf: MessageDescriptor matchedTo: MessageDescriptor - humanName: MessageDescriptor } const messagesToDefine: IConstantsMessages = { action: { @@ -979,11 +978,6 @@ const messagesToDefine: IConstantsMessages = { defaultMessage: `{registrationTargetDays} days - 1 year`, description: `Label for registrations within {registrationTargetDays} days to 1 year`, id: 'constants.withinTargetDaysTo1Year' - }, - humanName: { - defaultMessage: `{lastName} {middleName} {firstName}`, - description: 'A localized order of the full name', - id: 'constants.humanName' } } export const constantsMessages: Record< diff --git a/packages/client/src/utils/data-formatting.ts b/packages/client/src/utils/data-formatting.ts index 4de65ff8694..001daa8bec9 100644 --- a/packages/client/src/utils/data-formatting.ts +++ b/packages/client/src/utils/data-formatting.ts @@ -11,8 +11,6 @@ import { getDefaultLanguage } from '@client/i18n/utils' import type { GQLComment } from '@client/utils/gateway-deprecated-do-not-use' import { HumanName } from './gateway' -import { constantsMessages } from '@client/i18n/messages' -import { IntlShape } from 'react-intl' interface INamesMap { [key: string]: string @@ -83,17 +81,3 @@ export const mergeArraysRemovingEmptyStrings = ( export function getPercentage(total: number, current: number) { return current === 0 || total === 0 ? 0 : (current / total) * 100 } - -export function getLocalisedName( - intl: IntlShape, - nameObject: HumanName -): string { - return intl - .formatMessage(constantsMessages.humanName, { - firstName: nameObject.firstNames, - middleName: nameObject.middleName, - lastName: nameObject.familyName - }) - .replace(/\s+/g, ' ') // Remove extra spaces - .trim() -} diff --git a/packages/client/src/utils/draftUtils.test.ts b/packages/client/src/utils/draftUtils.test.ts index 0f3012f4201..b7be4734d51 100644 --- a/packages/client/src/utils/draftUtils.test.ts +++ b/packages/client/src/utils/draftUtils.test.ts @@ -17,49 +17,29 @@ import type { GQLBirthEventSearchSet, GQLDeathEventSearchSet } from '@client/utils/gateway-deprecated-do-not-use' -import { createIntl, createIntlCache } from 'react-intl' - -const cache = createIntlCache() -const intlEngish = createIntl( - { - locale: 'en', - messages: {} - }, - cache -) -const intlBangla = createIntl( - { - locale: 'en', - messages: {} - }, - cache -) describe('draftUtils tests', () => { describe('getDraftInformantFullName()', () => { describe('Birth event', () => { it('Returns child english name properly', () => { expect( - getDeclarationFullName( - { - id: '7b57d8f9-4d2d-4f12-8d0a-b042fe14f3d4', - data: { - child: { - firstNames: 'মুশ্রাফুল', - familyName: 'হক', - firstNamesEng: 'Mushraful', - familyNameEng: 'Hoque' - } - }, - event: Event.Birth, - savedOn: 1558037863335, - modifiedOn: 1558037867987 + getDeclarationFullName({ + id: '7b57d8f9-4d2d-4f12-8d0a-b042fe14f3d4', + data: { + child: { + firstNames: 'মুশ্রাফুল', + familyName: 'হক', + firstNamesEng: 'Mushraful', + familyNameEng: 'Hoque' + } }, - intlEngish - ) - ).toBe('Hoque Mushraful') + event: Event.Birth, + savedOn: 1558037863335, + modifiedOn: 1558037867987 + }) + ).toBe('Mushraful Hoque') }) - it('Returns child English name properly even though localed is Bangla', () => { + it('Returns child bangla name properly', () => { expect( getDeclarationFullName( { @@ -75,33 +55,30 @@ describe('draftUtils tests', () => { savedOn: 1558037863335, modifiedOn: 1558037867987 }, - intlBangla + 'bn' ) - ).toBe('Hoque Mushraful') + ).toBe('হক') }) }) describe('Death event', () => { it('Returns deceased english name properly', () => { expect( - getDeclarationFullName( - { - id: '7b57d8f9-4d2d-4f12-8d0a-b042fe14f3d4', - data: { - deceased: { - firstNames: 'মুশ্রাফুল', - familyName: 'হক', - familyNameEng: 'Hoque' - } - }, - event: Event.Death, - savedOn: 1558037863335, - modifiedOn: 1558037867987 + getDeclarationFullName({ + id: '7b57d8f9-4d2d-4f12-8d0a-b042fe14f3d4', + data: { + deceased: { + firstNames: 'মুশ্রাফুল', + familyName: 'হক', + familyNameEng: 'Hoque' + } }, - intlBangla - ) + event: Event.Death, + savedOn: 1558037863335, + modifiedOn: 1558037867987 + }) ).toBe('Hoque') }) - it('Returns child English name properly even when the current locale is Bangla', () => { + it('Returns child bangla name properly', () => { expect( getDeclarationFullName( { @@ -118,9 +95,9 @@ describe('draftUtils tests', () => { savedOn: 1558037863335, modifiedOn: 1558037867987 }, - intlEngish + 'bn' ) - ).toBe('Hoque Mushraful') + ).toBe('মুশ্রাফুল হক') }) }) }) diff --git a/packages/client/src/utils/draftUtils.ts b/packages/client/src/utils/draftUtils.ts index 10058046659..47dfe4dbe57 100644 --- a/packages/client/src/utils/draftUtils.ts +++ b/packages/client/src/utils/draftUtils.ts @@ -13,6 +13,7 @@ import { SUBMISSION_STATUS, IPrintableDeclaration } from '@client/declarations' +import { IFormSectionData } from '@client/forms' import { Event, History, RegStatus } from '@client/utils/gateway' import type { GQLBirthEventSearchSet, @@ -23,48 +24,67 @@ import type { import { getEvent } from '@client/views/PrintCertificate/utils' import { includes } from 'lodash' import { EMPTY_STRING } from '@client/utils/constants' -import { getLocalisedName } from './data-formatting' -import { IntlShape } from 'react-intl' + +const getEngName = ( + sectionData: IFormSectionData, + lastNameFirst: boolean +): string => { + if (lastNameFirst) { + return `${sectionData.familyNameEng ?? ''} ${ + sectionData.firstNamesEng ?? '' + }` + } + return [ + sectionData.firstNamesEng, + sectionData.middleNameEng, + sectionData.familyNameEng + ] + .filter(Boolean) + .join(' ') + .trim() +} + +const getOtherName = (sectionData: IFormSectionData): string => { + return [ + sectionData.firstNames, + sectionData.middleName, + sectionData.familyName + ] + .filter(Boolean) + .join(' ') + .trim() +} + +const getFullName = ( + sectionData: IFormSectionData, + language = 'en', + lastNameFirst = false +): string => { + if (!sectionData) { + return EMPTY_STRING + } + if (language === 'en') { + return getEngName(sectionData, lastNameFirst) + } + return getOtherName(sectionData) || getEngName(sectionData, lastNameFirst) +} /* * lastNameFirst needs to be removed in #4464 */ export const getDeclarationFullName = ( draft: IDeclaration, - intl: IntlShape + language?: string, + lastNameFirst?: boolean ) => { switch (draft.event) { case Event.Birth: - return draft.data.child - ? getLocalisedName(intl, { - firstNames: draft.data.child.firstNamesEng as string, - middleName: draft.data.child.middleNameEng as string, - familyName: draft.data.child.familyNameEng as string - }) - : EMPTY_STRING + return getFullName(draft.data.child, language, lastNameFirst) case Event.Death: - return draft.data.deceased - ? getLocalisedName(intl, { - firstNames: draft.data.deceased.firstNamesEng as string, - middleName: draft.data.deceased.middleNameEng as string, - familyName: draft.data.deceased.familyNameEng as string - }) - : EMPTY_STRING + return getFullName(draft.data.deceased, language, lastNameFirst) case Event.Marriage: - const brideName = draft.data.bride - ? getLocalisedName(intl, { - firstNames: draft.data.bride.firstNamesEng as string, - middleName: draft.data.bride.middleNameEng as string, - familyName: draft.data.bride.familyNameEng as string - }) - : EMPTY_STRING - const groomName = draft.data.groom - ? getLocalisedName(intl, { - firstNames: draft.data.groom.firstNamesEng as string, - middleName: draft.data.groom.middleNameEng as string, - familyName: draft.data.groom.familyNameEng as string - }) - : EMPTY_STRING + const brideName = getFullName(draft.data.bride, language, lastNameFirst) + const groomName = getFullName(draft.data.groom, language, lastNameFirst) if (brideName && groomName) { return `${groomName} & ${brideName}` } else { diff --git a/packages/client/src/views/OfficeHome/inProgress/InProgress.tsx b/packages/client/src/views/OfficeHome/inProgress/InProgress.tsx index cd4d32b7e1d..bccebf39128 100644 --- a/packages/client/src/views/OfficeHome/inProgress/InProgress.tsx +++ b/packages/client/src/views/OfficeHome/inProgress/InProgress.tsx @@ -344,6 +344,7 @@ class InProgressComponent extends React.Component< transformDraftContent = () => { const { intl } = this.props + const { locale } = intl if (!this.props.drafts || this.props.drafts.length <= 0) { return [] } @@ -360,7 +361,7 @@ class InProgressComponent extends React.Component< } else if (draft.event && draft.event.toString() === 'marriage') { pageRoute = DRAFT_MARRIAGE_FORM_PAGE } - const name = getDeclarationFullName(draft, intl) + const name = getDeclarationFullName(draft, locale) const lastModificationDate = draft.modifiedOn || draft.savedOn const actions: IAction[] = [] diff --git a/packages/client/src/views/OfficeHome/inProgress/inProgress.test.tsx b/packages/client/src/views/OfficeHome/inProgress/inProgress.test.tsx index 1032651d0a4..33b8b91e638 100644 --- a/packages/client/src/views/OfficeHome/inProgress/inProgress.test.tsx +++ b/packages/client/src/views/OfficeHome/inProgress/inProgress.test.tsx @@ -297,7 +297,7 @@ describe('In Progress tab', () => { const EXPECTED_DATE_OF_REJECTION = formattedDuration(TIME_STAMP) expect(data[0].id).toBe('e302f7c5-ad87-4117-91c1-35eaf2ea7be8') - expect(data[0].name).toBe('hoque anik') + expect(data[0].name).toBe('anik hoque') expect(data[0].lastUpdated).toBe(EXPECTED_DATE_OF_REJECTION) expect(data[0].event).toBe('Birth') expect(data[0].actions).toBeDefined() diff --git a/packages/client/src/views/OfficeHome/outbox/Outbox.tsx b/packages/client/src/views/OfficeHome/outbox/Outbox.tsx index 866a5b9cf85..c5b909a69b7 100644 --- a/packages/client/src/views/OfficeHome/outbox/Outbox.tsx +++ b/packages/client/src/views/OfficeHome/outbox/Outbox.tsx @@ -168,7 +168,7 @@ export function Outbox() { function transformDeclarationsReadyToSend() { const items = declarations.map((declaration, index) => { - const name = getDeclarationFullName(declaration, intl) + const name = getDeclarationFullName(declaration) let dateOfEvent if (declaration.event && declaration.event.toString() === 'birth') { dateOfEvent = declaration.data?.child?.childBirthDate as string diff --git a/packages/client/src/views/RecordAudit/RecordAudit.test.tsx b/packages/client/src/views/RecordAudit/RecordAudit.test.tsx index c3c88638a07..78eff975f4f 100644 --- a/packages/client/src/views/RecordAudit/RecordAudit.test.tsx +++ b/packages/client/src/views/RecordAudit/RecordAudit.test.tsx @@ -292,7 +292,7 @@ describe('Record audit summary for WorkQueue declarations', () => { component.find({ 'data-testid': 'type-value' }).hostNodes().text() ).toBe('Birth') expect(component.find('#content-name').hostNodes().text()).toBe( - 'Al Hasan Shakib' + 'Shakib Al Hasan' ) expect( component diff --git a/packages/client/src/views/RecordAudit/RecordAudit.tsx b/packages/client/src/views/RecordAudit/RecordAudit.tsx index 560b773455e..3b19ab2d0ae 100644 --- a/packages/client/src/views/RecordAudit/RecordAudit.tsx +++ b/packages/client/src/views/RecordAudit/RecordAudit.tsx @@ -555,7 +555,7 @@ const BodyContent = ({ assignment: data.fetchRegistration?.registration?.assignment } } else { - declaration = getGQLDeclaration(data.fetchRegistration, intl) + declaration = getGQLDeclaration(data.fetchRegistration, language) } return ( @@ -592,7 +592,7 @@ const BodyContent = ({ } : getWQDeclarationData( workqueueDeclaration as NonNullable, - intl, + language, trackingId ) const wqStatus = workqueueDeclaration?.registration diff --git a/packages/client/src/views/RecordAudit/utils.ts b/packages/client/src/views/RecordAudit/utils.ts index c25d31baaff..5abb838320e 100644 --- a/packages/client/src/views/RecordAudit/utils.ts +++ b/packages/client/src/views/RecordAudit/utils.ts @@ -25,7 +25,7 @@ import type { GQLAssignmentData, GQLMarriageEventSearchSet } from '@client/utils/gateway-deprecated-do-not-use' -import { createNamesMap, getLocalisedName } from '@client/utils/data-formatting' +import { createNamesMap } from '@client/utils/data-formatting' import { IDynamicValues } from '@client/navigation' import { countryMessages } from '@client/i18n/messages/constants' import { @@ -337,8 +337,8 @@ export const getDraftDeclarationData = ( ): IDeclarationData => { return { id: declaration.id, - name: getDeclarationFullName(declaration, intl), - type: declaration.event || EMPTY_STRING, + name: getDeclarationFullName(declaration), + type: declaration.event, registrationNo: declaration.data?.registration?.registrationNumber?.toString() || EMPTY_STRING, @@ -365,7 +365,7 @@ export const getDraftDeclarationData = ( export const getWQDeclarationData = ( workqueueDeclaration: GQLEventSearchSet, - intl: IntlShape, + language: string, trackingId: string ) => { let name = EMPTY_STRING @@ -373,35 +373,19 @@ export const getWQDeclarationData = ( isBirthDeclaration(workqueueDeclaration) && workqueueDeclaration.childName ) { - name = getLocalisedName(intl, { - firstNames: workqueueDeclaration.childName[0]?.firstNames, - middleName: workqueueDeclaration.childName[0]?.middleName, - familyName: workqueueDeclaration.childName[0]?.familyName - }) + name = getName(workqueueDeclaration.childName, language) } else if ( isDeathDeclaration(workqueueDeclaration) && workqueueDeclaration.deceasedName ) { - name = getLocalisedName(intl, { - firstNames: workqueueDeclaration.deceasedName[0]?.firstNames, - middleName: workqueueDeclaration.deceasedName[0]?.middleName, - familyName: workqueueDeclaration.deceasedName[0]?.familyName - }) + name = getName(workqueueDeclaration.deceasedName, language) } else if ( isMarriageDeclaration(workqueueDeclaration) && workqueueDeclaration.brideName && workqueueDeclaration.groomName ) { - const groomName = getLocalisedName(intl, { - firstNames: workqueueDeclaration.groomName[0]?.firstNames, - middleName: workqueueDeclaration.groomName[0]?.middleName, - familyName: workqueueDeclaration.groomName[0]?.familyName - }) - const brideName = getLocalisedName(intl, { - firstNames: workqueueDeclaration.brideName[0]?.firstNames, - middleName: workqueueDeclaration.brideName[0]?.middleName, - familyName: workqueueDeclaration.brideName[0]?.familyName - }) + const groomName = getName(workqueueDeclaration.groomName, language) + const brideName = getName(workqueueDeclaration.brideName, language) name = brideName && groomName @@ -424,48 +408,25 @@ export const getWQDeclarationData = ( export const getGQLDeclaration = ( data: IGQLDeclaration, - intl: IntlShape + language: string ): IDeclarationData => { let name = EMPTY_STRING if (data.child) { - name = data.child.name - ? getLocalisedName(intl, { - firstNames: data.child.name[0]?.firstNames, - middleName: data.child.name[0]?.middleName, - familyName: data.child.name[0]?.familyName - }) - : EMPTY_STRING + name = data.child.name ? getName(data.child.name, language) : EMPTY_STRING } else if (data.deceased) { name = data.deceased.name - ? getLocalisedName(intl, { - firstNames: data.deceased.name[0]?.firstNames, - middleName: data.deceased.name[0]?.middleName, - familyName: data.deceased.name[0]?.familyName - }) + ? getName(data.deceased.name, language) : EMPTY_STRING } else if (data.groom || data.bride) { if (data.groom?.name && data.bride?.name) { - name = `${getLocalisedName(intl, { - firstNames: data.groom.name[0]?.firstNames, - middleName: data.groom.name[0]?.middleName, - familyName: data.groom.name[0]?.familyName - })} & ${getLocalisedName(intl, { - firstNames: data.bride.name[0]?.firstNames, - middleName: data.bride.name[0]?.middleName, - familyName: data.bride.name[0]?.firstNames - })}` + name = `${getName(data.groom.name, language)} & ${getName( + data.bride.name, + language + )}` } else if (data.groom?.name) { - name = getLocalisedName(intl, { - firstNames: data.groom.name[0]?.firstNames, - middleName: data.groom.name[0]?.middleName, - familyName: data.groom.name[0]?.familyName - }) + name = getName(data.groom.name, language) } else if (data.bride?.name) { - name = getLocalisedName(intl, { - firstNames: data.bride.name[0]?.firstNames, - middleName: data.bride.name[0]?.middleName, - familyName: data.bride.name[0]?.familyName - }) + name = getName(data.bride.name, language) } else { name = EMPTY_STRING } diff --git a/packages/client/src/views/RegisterForm/review/ReviewSection.test.tsx b/packages/client/src/views/RegisterForm/review/ReviewSection.test.tsx index 902f30d036b..08ccebc578e 100644 --- a/packages/client/src/views/RegisterForm/review/ReviewSection.test.tsx +++ b/packages/client/src/views/RegisterForm/review/ReviewSection.test.tsx @@ -178,7 +178,7 @@ describe('when in device of large viewport', () => { ).toBe('Government of the peoples republic of Bangladesh') expect( reviewSectionComponent.find('#review_header_subject').hostNodes().text() - ).toBe('Birth Declaration for Doe John') + ).toBe('Birth Declaration for John Doe') }) it('typing additional comments input triggers onchange review form', async () => { diff --git a/packages/client/src/views/RegisterForm/review/ReviewSection.tsx b/packages/client/src/views/RegisterForm/review/ReviewSection.tsx index 467a90dff6c..c2406b6b80d 100644 --- a/packages/client/src/views/RegisterForm/review/ReviewSection.tsx +++ b/packages/client/src/views/RegisterForm/review/ReviewSection.tsx @@ -1699,7 +1699,11 @@ class ReviewSectionComp extends React.Component { '') as string } - const informantName = getDeclarationFullName(declaration, intl) + const informantName = getDeclarationFullName( + declaration, + intl.locale, + this.isLastNameFirst() + ) const draft = this.isDraft() const transformedSectionData = this.transformSectionData( formSections.filter( diff --git a/packages/client/src/views/SysAdmin/Team/user/UserList.tsx b/packages/client/src/views/SysAdmin/Team/user/UserList.tsx index c61076155aa..34a7659c9ab 100644 --- a/packages/client/src/views/SysAdmin/Team/user/UserList.tsx +++ b/packages/client/src/views/SysAdmin/Team/user/UserList.tsx @@ -34,7 +34,7 @@ import { NATL_ADMIN_ROLES, SYS_ADMIN_ROLES } from '@client/utils/constants' -import { createNamesMap, getLocalisedName } from '@client/utils/data-formatting' +import { createNamesMap } from '@client/utils/data-formatting' import { SysAdminContentWrapper } from '@client/views/SysAdmin/SysAdminContentWrapper' import { getAddressName, @@ -552,7 +552,12 @@ function UserListComponent(props: IProps) { return data.searchUsers.results.map( (user: User | null, index: number) => { if (user !== null) { - const name = getLocalisedName(intl, user.name[0]) + const name = + (user && + user.name && + ((createNamesMap(user.name)[intl.locale] as string) || + (createNamesMap(user.name)[LANG_EN] as string))) || + '' const role = intl.formatMessage({ id: getUserRoleIntlKey(user.role._id) }) diff --git a/packages/client/src/views/UserAudit/UserAudit.tsx b/packages/client/src/views/UserAudit/UserAudit.tsx index d4c0b29b2e9..680ed4cec5d 100644 --- a/packages/client/src/views/UserAudit/UserAudit.tsx +++ b/packages/client/src/views/UserAudit/UserAudit.tsx @@ -18,7 +18,7 @@ import { Frame } from '@opencrvs/components/lib/Frame' import { IntlShape, useIntl } from 'react-intl' import { useParams } from 'react-router' import { GET_USER } from '@client/user/queries' -import { getLocalisedName } from '@client/utils/data-formatting' +import { createNamesMap } from '@client/utils/data-formatting' import { AvatarSmall } from '@client/components/Avatar' import styled from 'styled-components' import { ToggleMenu } from '@opencrvs/components/lib/ToggleMenu' @@ -42,6 +42,7 @@ import { UserAuditActionModal } from '@client/views/SysAdmin/Team/user/UserAudit import { GetUserQuery, GetUserQueryVariables, + HumanName, User, SystemRoleType } from '@client/utils/gateway' @@ -82,7 +83,9 @@ const transformUserQueryResult = ( '')) || '' }, - name: getLocalisedName(intl, userData.name[0]), + name: + createNamesMap(userData.name as HumanName[])[locale] || + createNamesMap(userData.name as HumanName[])[LANG_EN], systemRole: userData.systemRole, role: userData.role, number: userData.mobile, From 4100543517eff1e171da70ccee1f780b14aa9965 Mon Sep 17 00:00:00 2001 From: Riku Rouvila Date: Tue, 12 Nov 2024 09:55:19 +0200 Subject: [PATCH 36/50] Update on-label-added-for-pr.yml --- .github/workflows/on-label-added-for-pr.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/on-label-added-for-pr.yml b/.github/workflows/on-label-added-for-pr.yml index 72148eb8e8f..dfc253570d6 100644 --- a/.github/workflows/on-label-added-for-pr.yml +++ b/.github/workflows/on-label-added-for-pr.yml @@ -16,17 +16,15 @@ jobs: dispatch-deploy: runs-on: ubuntu-latest steps: - - name: Check for "🚀 Ready to deploy" label + - name: Check if added label is "🚀 Ready to deploy" id: label_check run: | - labels=$(jq -r '.pull_request.labels[].name' "$GITHUB_EVENT_PATH") - if [[ "$labels" != *"🚀 Ready to deploy"* ]]; then - echo "Label not found, skipping dispatch." + added_label=$(jq -r '.label.name' "$GITHUB_EVENT_PATH") + if [[ "$added_label" != "🚀 Ready to deploy" ]]; then + echo "Label not found or incorrect, skipping dispatch." exit 1 fi - echo "Label found, dispatching deploy workflow." - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + echo "Correct label added, dispatching deploy workflow." - name: Trigger Deploy Workflow if: steps.label_check.outcome == 'success' From b6d4c0cdbe3225e66b89765208942f4d06de0463 Mon Sep 17 00:00:00 2001 From: Markus Date: Tue, 12 Nov 2024 14:13:58 +0200 Subject: [PATCH 37/50] feat(toolkit): create empty action to allow testing --- .github/workflows/publish-toolkit-to-npm.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/publish-toolkit-to-npm.yml diff --git a/.github/workflows/publish-toolkit-to-npm.yml b/.github/workflows/publish-toolkit-to-npm.yml new file mode 100644 index 00000000000..bbd49914663 --- /dev/null +++ b/.github/workflows/publish-toolkit-to-npm.yml @@ -0,0 +1,17 @@ +name: Publish toolkit to NPM registry +on: + workflow_dispatch: + inputs: + branch_name: + description: Branch to publish from + default: develop + required: true + push: + branches: + - develop +jobs: + publish: + runs-on: 'ubuntu-latest' + steps: + - name: Placeholder for publish + run: echo "Placeholder for publish" From 23284f78a60c4b591084359a6238965593eefd69 Mon Sep 17 00:00:00 2001 From: Markus Date: Tue, 12 Nov 2024 14:19:20 +0200 Subject: [PATCH 38/50] feat(toolkit): add license header --- .github/workflows/publish-toolkit-to-npm.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/publish-toolkit-to-npm.yml b/.github/workflows/publish-toolkit-to-npm.yml index bbd49914663..fce308ff077 100644 --- a/.github/workflows/publish-toolkit-to-npm.yml +++ b/.github/workflows/publish-toolkit-to-npm.yml @@ -1,3 +1,11 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. +# +# OpenCRVS is also distributed under the terms of the Civil Registration +# & Healthcare Disclaimer located at http://opencrvs.org/license. +# +# Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. name: Publish toolkit to NPM registry on: workflow_dispatch: From e9d8982a04dfd579aaea5576517a250c42037f1b Mon Sep 17 00:00:00 2001 From: Jamil Date: Tue, 12 Nov 2024 19:17:24 +0600 Subject: [PATCH 39/50] fix: include all child location in `getStatusWiseRegistrationCountHandler` (#7917) * fix: include all child location in `getStatusWiseRegistrationCountHandler` * fix: unit test * refactor: include children location directly to matchRules * fix: use terms for matchRule * fix: test: remove one http response * chore: remove comment --- packages/search/src/features/search/handler.test.ts | 3 +++ packages/search/src/features/search/handler.ts | 11 ++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/search/src/features/search/handler.test.ts b/packages/search/src/features/search/handler.test.ts index ee4d26b37ed..3ef8fd6a28c 100644 --- a/packages/search/src/features/search/handler.test.ts +++ b/packages/search/src/features/search/handler.test.ts @@ -16,6 +16,8 @@ import { ICountQueryParam } from './handler' import { SearchDocument } from '@opencrvs/commons' import * as searchService from './service' import { OPENCRVS_INDEX_NAME } from '@search/constants' +import * as fetchAny from 'jest-fetch-mock' +const fetch = fetchAny as fetchAny.FetchMock jest.setTimeout(100000) @@ -118,6 +120,7 @@ describe('Verify handlers', () => { it('Should return 200 for valid payload', async () => { const t = await setupTestCases(setup, { scope: ['register'] }) + fetch.mockResponses([JSON.stringify([{ id: '123' }]), { status: 200 }]) const res = await t.callStatusWiseRegistrationCount({ declarationJurisdictionId: '123', status: ['REGISTERED'] diff --git a/packages/search/src/features/search/handler.ts b/packages/search/src/features/search/handler.ts index 5e7b860eea0..43a36e35555 100644 --- a/packages/search/src/features/search/handler.ts +++ b/packages/search/src/features/search/handler.ts @@ -13,7 +13,8 @@ import { logger, SearchDocument, EVENT, - getSearchTotalCount + getSearchTotalCount, + UUID } from '@opencrvs/commons' import { badRequest, internal } from '@hapi/boom' import { DEFAULT_SIZE, advancedSearch } from '@search/features/search/service' @@ -33,6 +34,7 @@ import { searchForBirthDuplicates } from '@search/features/registration/deduplicate/service' import { capitalize } from 'lodash' +import { resolveLocationChildren } from './location' type IAssignmentPayload = { compositionId: string @@ -138,9 +140,12 @@ export async function getStatusWiseRegistrationCountHandler( } ] if (payload.declarationJurisdictionId) { + const leafLevelJurisdictionIds = await resolveLocationChildren( + payload.declarationJurisdictionId as UUID + ) matchRules.push({ - match: { - declarationJurisdictionIds: payload.declarationJurisdictionId + terms: { + 'declarationJurisdictionIds.keyword': leafLevelJurisdictionIds } }) } From 2869fe8692e3bd5c533a5c7d1a8ced182d759601 Mon Sep 17 00:00:00 2001 From: Hyper3x <91010730+Hyper3x@users.noreply.github.com> Date: Tue, 12 Nov 2024 20:13:36 +0530 Subject: [PATCH 40/50] feat: Created confirmRegistration, rejectRegistration GraphQL-endpoints (#7925) * feat: Created confirmRegistration, rejectRegistration GraphQL-endpoints * feat: pass record-specific token to country config when registering a event (#7882) * Ticket 7849 implementation * Added audience values to the event-specific token * Removed unnecessary validations * Minor changes * Removed try catch block * chore(changelog): clarify wording on what the token exchange means * fix: add auth url to docker compose * refactor: unify error handling fixes a problem where the rejection error wasnt logged at all --------- Co-authored-by: Pyry Rouvila Co-authored-by: naftis * Removed unnecessory comments * feat: Created confirmRegistration, rejectRegistration GraphQL-endpoints * Required changes done * Removed unnecessory changes * Prettier issue fixed * test deployment with the confirmRegistration and rejectRegistration endpoints * fix: generalize confirm registration to identifiers as it can handle death as well * trigger ci * fix: don't require identifiers * fix: revert prettier changes * fix: remove unnecessary mutations --------- Co-authored-by: Pathum Nakandala <61136185+PathumN99@users.noreply.github.com> Co-authored-by: Pyry Rouvila Co-authored-by: naftis --- docker-compose.dev.yml | 1 - packages/commons/src/authentication.ts | 3 +- .../features/registration/root-resolvers.ts | 44 ++++++++++++++---- .../src/features/registration/schema.graphql | 19 +++++++- packages/gateway/src/graphql/schema.d.ts | 35 ++++++++++++++ packages/gateway/src/graphql/schema.graphql | 19 +++++++- packages/gateway/src/workflow/index.ts | 46 +++++++++++++++++++ packages/workflow/src/config/routes.ts | 2 +- .../src/features/registration/handler.ts | 8 ++-- .../src/records/handler/register.test.ts | 5 +- .../workflow/src/records/state-transitions.ts | 6 +-- .../create-birth-registration-registrar.md | 2 +- 12 files changed, 166 insertions(+), 24 deletions(-) diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index ec732943e5c..468ccd92f66 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -78,7 +78,6 @@ services: - NODE_ENV=development - FHIR_URL=http://hearth:3447/fhir - AUTH_URL=http://auth:4040 - - CONFIRM_REGISTRATION_URL=http://workflow:5050/confirm/registration - CHECK_INVALID_TOKEN=true ports: - '3040:3040' diff --git a/packages/commons/src/authentication.ts b/packages/commons/src/authentication.ts index 384a263473e..585273e9e37 100644 --- a/packages/commons/src/authentication.ts +++ b/packages/commons/src/authentication.ts @@ -26,7 +26,8 @@ export const userScopes = { bypassRateLimit: 'bypassratelimit', teams: 'teams', config: 'config', - confirmRegistration: 'record.confirm-registration' + confirmRegistration: 'record.confirm-registration', + rejectRegistration: 'record.reject-registration' } as const export const userRoleScopes = { diff --git a/packages/gateway/src/features/registration/root-resolvers.ts b/packages/gateway/src/features/registration/root-resolvers.ts index bad69765683..d241a6289dc 100644 --- a/packages/gateway/src/features/registration/root-resolvers.ts +++ b/packages/gateway/src/features/registration/root-resolvers.ts @@ -58,7 +58,9 @@ import { duplicateRegistration, viewDeclaration, verifyRegistration, - markNotADuplicate + markNotADuplicate, + rejectRegistration, + confirmRegistration } from '@gateway/workflow/index' import { getRecordById } from '@gateway/records' @@ -636,20 +638,46 @@ export const resolvers: GQLResolver = { return taskEntry.resource.id }, - async confirmRegistration(_, { id }, { headers: authHeader }) { + async confirmRegistration(_, { id, details }, { headers: authHeader }) { if (!inScope(authHeader, ['record.confirm-registration'])) { - throw new Error( - 'User does not have a "record.confirm-registration" scope' - ) + throw new Error('User does not have a Confirm Registration scope') + } + + if (!hasRecordAccess(authHeader, id)) { + throw new Error('User does not have access to the record') + } + + try { + const taskEntry = await confirmRegistration(id, authHeader, { + error: details.error, + registrationNumber: details.registrationNumber, + identifiers: details.identifiers + }) + + return taskEntry.resource.id + } catch (error) { + throw new Error(`Failed to confirm registration: ${error.message}`) + } + }, + async rejectRegistration(_, { id, details }, { headers: authHeader }) { + if (!inScope(authHeader, ['record.reject-registration'])) { + throw new Error('User does not have a Reject Registration" scope') } if (!hasRecordAccess(authHeader, id)) { throw new Error('User does not have access to the record') } - // @TODO this is a no-op, only to test the token exchange actually works - // An upcoming pull request will implement this and a `rejectRegistration` mutations - return id + try { + const taskEntry = await rejectRegistration(id, authHeader, { + comment: details.comment || 'No comment provided', + reason: details.reason + }) + + return taskEntry.resource.id + } catch (error) { + throw new Error(`Error in rejectRegistration: ${error.message}`) + } } } } diff --git a/packages/gateway/src/features/registration/schema.graphql b/packages/gateway/src/features/registration/schema.graphql index eab611f0358..a5992899db7 100644 --- a/packages/gateway/src/features/registration/schema.graphql +++ b/packages/gateway/src/features/registration/schema.graphql @@ -567,6 +567,22 @@ input CorrectionRejectionInput { timeLoggedMS: Int! } +input IdentifierInput { + type: String! + value: String! +} + +input ConfirmRegistrationInput { + registrationNumber: String! + error: String + identifiers: [IdentifierInput!] +} + +input RejectRegistrationInput { + reason: String! + comment: String +} + type Mutation { # Generic correction handlers for all event types # Applying a correction request is made on a event level as payload is dependant on event type @@ -643,5 +659,6 @@ type Mutation { comment: String duplicateTrackingId: String ): ID! - confirmRegistration(id: ID!): ID! + confirmRegistration(id: ID!, details: ConfirmRegistrationInput!): ID! + rejectRegistration(id: ID!, details: RejectRegistrationInput!): ID! } diff --git a/packages/gateway/src/graphql/schema.d.ts b/packages/gateway/src/graphql/schema.d.ts index 31096478dd8..6d9a27bf80b 100644 --- a/packages/gateway/src/graphql/schema.d.ts +++ b/packages/gateway/src/graphql/schema.d.ts @@ -86,6 +86,7 @@ export interface GQLMutation { markMarriageAsIssued: string markEventAsDuplicate: string confirmRegistration: string + rejectRegistration: string createOrUpdateUser: GQLUser activateUser?: string changePassword?: string @@ -576,6 +577,17 @@ export interface GQLReinstated { registrationStatus?: GQLRegStatus } +export interface GQLConfirmRegistrationInput { + registrationNumber: string + error?: string + identifiers?: Array +} + +export interface GQLRejectRegistrationInput { + reason: string + comment?: string +} + export interface GQLUserInput { id?: string name: Array @@ -1169,6 +1181,11 @@ export const enum GQLRegStatus { ISSUED = 'ISSUED' } +export interface GQLIdentifierInput { + type: string + value: string +} + export interface GQLHumanNameInput { use?: string firstNames?: string @@ -2452,6 +2469,7 @@ export interface GQLMutationTypeResolver { markMarriageAsIssued?: MutationToMarkMarriageAsIssuedResolver markEventAsDuplicate?: MutationToMarkEventAsDuplicateResolver confirmRegistration?: MutationToConfirmRegistrationResolver + rejectRegistration?: MutationToRejectRegistrationResolver createOrUpdateUser?: MutationToCreateOrUpdateUserResolver activateUser?: MutationToActivateUserResolver changePassword?: MutationToChangePasswordResolver @@ -2986,6 +3004,7 @@ export interface MutationToMarkEventAsDuplicateResolver< export interface MutationToConfirmRegistrationArgs { id: string + details: GQLConfirmRegistrationInput } export interface MutationToConfirmRegistrationResolver< TParent = any, @@ -2999,6 +3018,22 @@ export interface MutationToConfirmRegistrationResolver< ): TResult } +export interface MutationToRejectRegistrationArgs { + id: string + details: GQLRejectRegistrationInput +} +export interface MutationToRejectRegistrationResolver< + TParent = any, + TResult = any +> { + ( + parent: TParent, + args: MutationToRejectRegistrationArgs, + context: Context, + info: GraphQLResolveInfo + ): TResult +} + export interface MutationToCreateOrUpdateUserArgs { user: GQLUserInput } diff --git a/packages/gateway/src/graphql/schema.graphql b/packages/gateway/src/graphql/schema.graphql index c254f048bd2..ab6ae7b7952 100644 --- a/packages/gateway/src/graphql/schema.graphql +++ b/packages/gateway/src/graphql/schema.graphql @@ -216,7 +216,8 @@ type Mutation { comment: String duplicateTrackingId: String ): ID! - confirmRegistration(id: ID!): ID! + confirmRegistration(id: ID!, details: ConfirmRegistrationInput!): ID! + rejectRegistration(id: ID!, details: RejectRegistrationInput!): ID! createOrUpdateUser(user: UserInput!): User! activateUser( userId: String! @@ -697,6 +698,17 @@ type Reinstated { registrationStatus: RegStatus } +input ConfirmRegistrationInput { + registrationNumber: String! + error: String + identifiers: [IdentifierInput!] +} + +input RejectRegistrationInput { + reason: String! + comment: String +} + input UserInput { id: ID name: [HumanNameInput!]! @@ -1266,6 +1278,11 @@ enum RegStatus { ISSUED } +input IdentifierInput { + type: String! + value: String! +} + input HumanNameInput { use: String firstNames: String diff --git a/packages/gateway/src/workflow/index.ts b/packages/gateway/src/workflow/index.ts index f56faf6e0ea..fe44e60e818 100644 --- a/packages/gateway/src/workflow/index.ts +++ b/packages/gateway/src/workflow/index.ts @@ -36,6 +36,11 @@ import { GQLPaymentInput } from '@gateway/graphql/schema' +export type IdentifierInput = { + type: string + value: string +} + const createRequest = async ( method: 'POST' | 'GET' | 'PUT' | 'DELETE', path: string, @@ -235,6 +240,47 @@ export async function markNotADuplicate(id: string, authHeader: IAuthHeader) { return getComposition(response) } +export async function confirmRegistration( + id: string, + authHeader: IAuthHeader, + details: { + error: string | undefined + registrationNumber: string + identifiers?: IdentifierInput[] + } +) { + const res: ReadyForReviewRecord = await createRequest( + 'POST', + `/records/${id}/confirm`, + authHeader, + details + ) + + const taskEntry = res.entry.find((e) => e.resource.resourceType === 'Task') + if (!taskEntry) { + throw new Error('No task entry found in the confirmation response') + } + + return taskEntry +} + +export async function rejectRegistration( + recordId: string, + authHeader: IAuthHeader, + details: { comment: string; reason: string } +) { + const res: RejectedRecord = await createRequest( + 'POST', + `/records/${recordId}/reject`, + authHeader, + details + ) + + const taskEntry = res.entry.find((e) => e.resource.resourceType === 'Task')! + + return taskEntry +} + export async function archiveRegistration( id: string, authHeader: IAuthHeader, diff --git a/packages/workflow/src/config/routes.ts b/packages/workflow/src/config/routes.ts index f018f25b396..f7a649ded9e 100644 --- a/packages/workflow/src/config/routes.ts +++ b/packages/workflow/src/config/routes.ts @@ -61,7 +61,7 @@ export const getRoutes = () => { }, { method: 'POST', - path: '/confirm/registration', + path: '/records/{id}/confirm', handler: markEventAsRegisteredCallbackHandler, config: { tags: ['api'], diff --git a/packages/workflow/src/features/registration/handler.ts b/packages/workflow/src/features/registration/handler.ts index 7c51a68e2b0..c9e9ec555b5 100644 --- a/packages/workflow/src/features/registration/handler.ts +++ b/packages/workflow/src/features/registration/handler.ts @@ -26,8 +26,7 @@ export interface EventRegistrationPayload { trackingId: string registrationNumber: string error: string - compositionId: string - childIdentifiers?: { + identifiers?: { type: SupportedPatientIdentifierCode value: string }[] @@ -38,7 +37,8 @@ export async function markEventAsRegisteredCallbackHandler( h: Hapi.ResponseToolkit ) { const token = getToken(request) - const { registrationNumber, error, childIdentifiers, compositionId } = + const compositionId = request.params.id + const { registrationNumber, error, identifiers } = request.payload as EventRegistrationPayload if (error) { @@ -60,7 +60,7 @@ export async function markEventAsRegisteredCallbackHandler( savedRecord, registrationNumber, token, - childIdentifiers + identifiers ) const event = getEventType(bundle) diff --git a/packages/workflow/src/records/handler/register.test.ts b/packages/workflow/src/records/handler/register.test.ts index de4dd9a7116..84a4948e2ad 100644 --- a/packages/workflow/src/records/handler/register.test.ts +++ b/packages/workflow/src/records/handler/register.test.ts @@ -159,10 +159,9 @@ describe('Register record endpoint', () => { const response = await server.server.inject({ method: 'POST', - url: '/confirm/registration', + url: '/records/7c3af302-08c9-41af-8701-92de9a71a3e4/confirm', payload: { - registrationNumber: '1234', - compositionId: '7c3af302-08c9-41af-8701-92de9a71a3e4' + registrationNumber: '1234' }, headers: { Authorization: `Bearer ${token}` diff --git a/packages/workflow/src/records/state-transitions.ts b/packages/workflow/src/records/state-transitions.ts index 9775d82c72e..588ab595a5b 100644 --- a/packages/workflow/src/records/state-transitions.ts +++ b/packages/workflow/src/records/state-transitions.ts @@ -474,7 +474,7 @@ export async function toRegistered( record: WaitingForValidationRecord, registrationNumber: EventRegistrationPayload['registrationNumber'], token: string, - childIdentifiers?: EventRegistrationPayload['childIdentifiers'] + identifiers?: EventRegistrationPayload['identifiers'] ): Promise { const previousTask = getTaskFromSavedBundle(record) const registeredTaskWithoutPractitionerExtensions = @@ -507,10 +507,10 @@ export async function toRegistered( value: registrationNumber as RegistrationNumber }) - if (event === EVENT_TYPE.BIRTH && childIdentifiers) { + if (event === EVENT_TYPE.BIRTH && identifiers) { // For birth event patients[0] is child and it should // already be initialized with the RN identifier - childIdentifiers.forEach((childIdentifier) => { + identifiers.forEach((childIdentifier) => { const previousIdentifier = patientsWithRegNumber[0].identifier!.find( ({ type }) => type?.coding?.[0].code === childIdentifier.type ) diff --git a/sequence-diagrams/backend/create-birth-registration-registrar.md b/sequence-diagrams/backend/create-birth-registration-registrar.md index f2644994c5b..e0e6e3ad21f 100644 --- a/sequence-diagrams/backend/create-birth-registration-registrar.md +++ b/sequence-diagrams/backend/create-birth-registration-registrar.md @@ -68,7 +68,7 @@ sequenceDiagram Workflow--)Metrics: POST bundle to /events/{event}/waiting-external-validation Workflow--)Country-Config: POST record to /event-registration - Country-Config->>Workflow: POST /confirm/registration + Country-Config->>Workflow: POST /records/{id}/confirm Workflow->>Search: Get record by id Workflow->>User management: Fetch user/system information From f7dab934ee83145c86323a9c436a02ec03393e14 Mon Sep 17 00:00:00 2001 From: Pyry Rouvila Date: Tue, 12 Nov 2024 17:34:12 +0200 Subject: [PATCH 41/50] chore: clean up MOSIP code (#7879) * chore: remove a test that doesn't do anything * chore: clean up mosip code * chore: remove mosip transformers from forms.json * test: knip - view diff * fix: knip issues --------- Co-authored-by: Riku Rouvila --- .github/workflows/lint-and-test.yml | 92 ++++------ packages/client/graphql.schema.json | 24 --- .../birth/mutation/registration-mappings.ts | 4 - .../birth/query/registration-mappings.ts | 28 --- .../mappings/mutation/field-mappings.ts | 27 --- .../register/mappings/query/field-mappings.ts | 77 -------- packages/client/src/tests/forms.json | 50 ------ packages/client/src/tests/schema.graphql | 2 - packages/client/src/utils/gateway.ts | 9 - .../client/src/utils/referenceApi.test.ts | 68 ------- .../src/views/DataProvider/birth/queries.ts | 2 - .../views/DataProvider/marriage/queries.ts | 2 - .../duplicate/DuplicateFormTabs.test.tsx | 1 - .../src/views/ViewRecord/ViewRecord.test.tsx | 1 - packages/client/src/views/ViewRecord/query.ts | 1 - packages/commons/src/fhir/patient.ts | 1 - packages/commons/src/fhir/task.ts | 4 - .../commons/src/fhir/transformers/index.ts | 4 - .../commons/src/fhir/transformers/input.ts | 1 - .../__snapshots__/type-resolvers.test.ts.snap | 3 - .../src/features/registration/schema.graphql | 4 - .../features/registration/type-resolvers.ts | 21 --- packages/gateway/src/graphql/schema.d.ts | 12 -- packages/gateway/src/graphql/schema.graphql | 2 - packages/search/src/features/search/utils.ts | 1 - packages/workflow/src/__mocks__/constants.ts | 1 - packages/workflow/src/constants.ts | 2 - .../fhir/fhir-bundle-modifier.test.ts | 72 +------- .../registration/fhir/fhir-bundle-modifier.ts | 170 +----------------- .../features/registration/fhir/fhir-utils.ts | 25 +-- .../src/features/registration/utils.test.ts | 23 +-- .../src/features/registration/utils.ts | 99 +--------- .../workflow/src/records/state-transitions.ts | 13 +- packages/workflow/src/test/utils.ts | 135 -------------- 34 files changed, 47 insertions(+), 934 deletions(-) diff --git a/.github/workflows/lint-and-test.yml b/.github/workflows/lint-and-test.yml index 815b286d172..8eaea31a5c9 100644 --- a/.github/workflows/lint-and-test.yml +++ b/.github/workflows/lint-and-test.yml @@ -142,66 +142,52 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout base branch - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: ref: ${{ github.base_ref }} - - uses: actions/setup-node@v4 - - name: Install dependencies - run: yarn install --ignore-scripts - - name: Create reporter - run: | - cat << 'EOF' > knip-reporter.js - const reporter = function (options) { - const totalIssues = Object.entries(options.counters).reduce( - (acc, [key, value]) => { - if (options.report[key]) { - return acc + value - } - - return acc - }, - 0 - ) - - console.log(JSON.stringify({ totalIssues })) - } - export default reporter - EOF - - name: Run knip on base branch - id: knip_base - run: | - OUTPUT=$(npx knip --no-exit-code --exports --reporter=./knip-reporter.js) - JSON=$(echo "$OUTPUT" | grep -o '{.*}') - total_issues=$(echo "$JSON" | jq '.totalIssues') - echo "Found $total_issues issue(s) on base branch." - echo "Setting $total_issues issue(s) as max limit for PR branch." - echo "maxIssues=${total_issues}" >> $GITHUB_OUTPUT + path: base - name: Checkout the PR branch - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: ref: ${{ github.head_ref }} + path: pr + - uses: actions/setup-node@v4 - - name: Install dependencies + + - name: Install base dependencies run: yarn install --ignore-scripts - - name: Create reporter + working-directory: base + + - name: Install PR dependencies + run: yarn install --ignore-scripts + working-directory: pr + + - name: Run knip on base branch + id: knip_base run: | - cat << 'EOF' > knip-reporter.js - const reporter = function (options) { - const totalIssues = Object.entries(options.counters).reduce( - (acc, [key, value]) => { - if (options.report[key]) { - return acc + value - } - - return acc - }, - 0 - ) - - console.log(JSON.stringify({ totalIssues })) - } - export default reporter - EOF + npx knip --no-exit-code --exports --reporter=markdown > knip_report.md + TOTAL=$(grep -oP '## [A-Za-z\s]+ \(\K[0-9]+' knip_report.md | awk '{sum+=$1} END {print sum}') + echo "Total $TOTAL issue(s) on base branch." + echo "total=${TOTAL}" >> $GITHUB_OUTPUT + working-directory: base + - name: Run knip on PR branch - run: npx knip --max-issues=${{ steps.knip_base.outputs.maxIssues }} --exports --reporter=./knip-reporter.js + id: knip_pr + run: | + npx knip --no-exit-code --exports --reporter=markdown > knip_report.md + TOTAL=$(grep -oP '## [A-Za-z\s]+ \(\K[0-9]+' knip_report.md | awk '{sum+=$1} END {print sum}') + echo "Total $TOTAL issue(s) on PR branch." + echo "total=${TOTAL}" >> $GITHUB_OUTPUT + working-directory: pr + + - name: Compare base and PR totals + if: ${{ steps.knip_pr.outputs.total > steps.knip_base.outputs.total }} + run: | + echo "## ⚠️ Total issues have increased in the PR branch." >> $GITHUB_STEP_SUMMARY + echo "Differences:" >> $GITHUB_STEP_SUMMARY + echo "\`\`\`diff" >> $GITHUB_STEP_SUMMARY + diff base/knip_report.md pr/knip_report.md >> $GITHUB_STEP_SUMMARY + echo "\`\`\`" >> $GITHUB_STEP_SUMMARY + + exit 1 diff --git a/packages/client/graphql.schema.json b/packages/client/graphql.schema.json index ea6a1e8c74d..4eaf4b8853f 100644 --- a/packages/client/graphql.schema.json +++ b/packages/client/graphql.schema.json @@ -15140,18 +15140,6 @@ "isDeprecated": false, "deprecationReason": null }, - { - "name": "mosipAid", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, { "name": "otherInformantType", "description": null, @@ -15523,18 +15511,6 @@ "isDeprecated": false, "deprecationReason": null }, - { - "name": "mosipAid", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, { "name": "otherInformantType", "description": null, diff --git a/packages/client/src/forms/register/mappings/event-specific-fields/birth/mutation/registration-mappings.ts b/packages/client/src/forms/register/mappings/event-specific-fields/birth/mutation/registration-mappings.ts index be0cf4b2bae..4328580a695 100644 --- a/packages/client/src/forms/register/mappings/event-specific-fields/birth/mutation/registration-mappings.ts +++ b/packages/client/src/forms/register/mappings/event-specific-fields/birth/mutation/registration-mappings.ts @@ -26,10 +26,6 @@ export function setBirthRegistrationSectionTransformer( draftData[sectionId].registrationNumber } - if (draftData[sectionId].mosipAid) { - transformedData[sectionId].mosipAid = draftData[sectionId].mosipAid - } - if (!transformedData[sectionId].status) { transformedData[sectionId].status = [ { diff --git a/packages/client/src/forms/register/mappings/event-specific-fields/birth/query/registration-mappings.ts b/packages/client/src/forms/register/mappings/event-specific-fields/birth/query/registration-mappings.ts index 9d7817a622c..31f290ae004 100644 --- a/packages/client/src/forms/register/mappings/event-specific-fields/birth/query/registration-mappings.ts +++ b/packages/client/src/forms/register/mappings/event-specific-fields/birth/query/registration-mappings.ts @@ -34,31 +34,3 @@ export function getBirthRegistrationSectionTransformer( transformStatusData(transformedData, queryData[sectionId].status, sectionId) } } - -export function mosipAidTransformer( - transformedData: IFormData, - queryData: any, - sectionId: string, - targetSectionId?: string, - targetFieldName?: string -) { - if (queryData[sectionId].mosipAid) { - transformedData[targetSectionId || sectionId][ - targetFieldName || 'mosipAid' - ] = queryData[sectionId].mosipAid - } -} - -export function mosipAidLabelTransformer( - transformedData: IFormData, - queryData: any, - sectionId: string, - targetSectionId?: string, - targetFieldName?: string -) { - if (queryData[sectionId].mosipAid) { - transformedData[targetSectionId || sectionId][ - targetFieldName || 'mosipAIDLabel' - ] = 'MOSIP Application ID' - } -} diff --git a/packages/client/src/forms/register/mappings/mutation/field-mappings.ts b/packages/client/src/forms/register/mappings/mutation/field-mappings.ts index 40fe86eb9d8..7de338f82c0 100644 --- a/packages/client/src/forms/register/mappings/mutation/field-mappings.ts +++ b/packages/client/src/forms/register/mappings/mutation/field-mappings.ts @@ -123,33 +123,6 @@ export const fieldToIdentityTransformer = return transformedData } -export const nidVerificationFieldToIdentityTransformer = ( - transformedData: TransformedData, - draftData: IFormData, - sectionId: string, - field: IFormField -) => { - fieldToIdentityTransformer('id', 'MOSIP_PSUT_TOKEN_ID')( - transformedData, - draftData, - sectionId, - field - ) - const sectionData = transformedData[sectionId] - const existingIdentity = sectionData.identifier.find( - (identifier: IdentityType) => - identifier.type && identifier.type === 'MOSIP_PSUT_TOKEN_ID' - ) - if (existingIdentity) { - const modifiedFields = draftData[sectionId][ - 'fieldsModifiedByNidUserInfo' - ] as string[] | undefined - existingIdentity['fieldsModifiedByIdentity'] = - modifiedFields?.join(',') ?? '' - } - return transformedData -} - interface IAddress { [key: string]: any } diff --git a/packages/client/src/forms/register/mappings/query/field-mappings.ts b/packages/client/src/forms/register/mappings/query/field-mappings.ts index 1628ff15b41..55f243b38eb 100644 --- a/packages/client/src/forms/register/mappings/query/field-mappings.ts +++ b/packages/client/src/forms/register/mappings/query/field-mappings.ts @@ -18,7 +18,6 @@ import { DeathRegistration, MarriageRegistration, Address, - IdentityType, EventRegistration } from '@client/utils/gateway' import { @@ -241,36 +240,6 @@ export const identityToFieldTransformer = return transformedData } -export const identityToNidVerificationFieldTransformer = ( - transformedData: IFormData, - queryData: QueryData, - sectionId: SectionId, - field: IFormField -) => { - identityToFieldTransformer('id', 'MOSIP_PSUT_TOKEN_ID')( - transformedData, - queryData, - sectionId, - field - ) - const existingIdentity = queryData[sectionId]?.identifier?.find( - (identity: IdentityType) => - (identity.type as string) === 'MOSIP_PSUT_TOKEN_ID' - ) - if (!transformedData[sectionId]) { - transformedData[sectionId] = {} - } - - if (existingIdentity) { - const modifiedFields = existingIdentity[ - 'fieldsModifiedByIdentity' - ] as string[] - transformedData[sectionId].fieldsModifiedByNidUserInfo = modifiedFields - } - - return transformedData -} - export const addressQueryTransformer = (config: { useCase: string @@ -625,52 +594,6 @@ export const nestedValueToFieldTransformer = return transformedData } -export const nestedIdentityValueToFieldTransformer = - (nestedField: SectionId) => - ( - transformedData: IFormData, - queryData: QueryData, - sectionId: SectionId, - field: IFormField - ) => { - if (!queryData[sectionId] || !queryData[sectionId][nestedField]) { - return transformedData - } - const clonedData = cloneDeep(transformedData) - if (!clonedData[nestedField]) { - clonedData[nestedField] = {} - } - - identityToFieldTransformer('id', 'MOSIP_PSUT_TOKEN_ID')( - clonedData, - queryData[sectionId], - nestedField, - field - ) - - if (clonedData[nestedField][field.name] === undefined) { - return transformedData - } - transformedData[sectionId][field.name] = clonedData[nestedField][field.name] - - const existingIdentity = queryData[sectionId][nestedField].identifier?.find( - (identity: IdentityType) => - (identity.type as string) === 'MOSIP_PSUT_TOKEN_ID' - ) - if (!transformedData[sectionId]) { - transformedData[sectionId] = {} - } - - if (existingIdentity) { - const modifiedFields = existingIdentity[ - 'fieldsModifiedByIdentity' - ] as string[] - transformedData[sectionId].fieldsModifiedByNidUserInfo = modifiedFields - } - - return transformedData - } - export const booleanTransformer = ( transformedData: IFormData, queryData: QueryData, diff --git a/packages/client/src/tests/forms.json b/packages/client/src/tests/forms.json index 07a7aefd20e..97b038b363e 100644 --- a/packages/client/src/tests/forms.json +++ b/packages/client/src/tests/forms.json @@ -18,11 +18,6 @@ "operation": "registrationNumberTransformer" }, { "fieldName": "qrCode", "operation": "QRCodeTransformer" }, - { "fieldName": "mosipAid", "operation": "mosipAidTransformer" }, - { - "fieldName": "mosipAIDLabel", - "operation": "mosipAidLabelTransformer" - }, { "fieldName": "certificateDate", "operation": "certificateDateTransformer", @@ -1106,51 +1101,6 @@ } } }, - { - "name": "informantNidVerification", - "type": "NID_VERIFICATION_BUTTON", - "label": { - "defaultMessage": "National ID number (in English)", - "description": "Option for form field: Type of ID", - "id": "form.field.label.iDTypeNationalID" - }, - "required": true, - "initialValue": "", - "validator": [], - "conditionals": [ - { - "action": "hide", - "expression": "const nationalIdSystem =\n offlineCountryConfig &&\n offlineCountryConfig.systems.find(s => s.integratingSystemType === 'MOSIP');\n !nationalIdSystem ||\n !nationalIdSystem.settings.openIdProviderBaseUrl ||\n !nationalIdSystem.settings.openIdProviderClientId ||\n !nationalIdSystem.settings.openIdProviderClaims;\n " - }, - { - "action": "hide", - "expression": "((values.informantType===\"MOTHER\") || (values.informantType===\"FATHER\") || (!values.informantType))" - } - ], - "mapping": { - "mutation": { - "operation": "nidVerificationFieldToIdentityTransformer" - }, - "query": { - "operation": "identityToNidVerificationFieldTransformer" - } - }, - "labelForVerified": { - "defaultMessage": "Authenticated", - "description": "label for unverified nid state", - "id": "form.field.nidVerified" - }, - "labelForUnverified": { - "defaultMessage": "Authenticate", - "description": "label for verified nid state", - "id": "form.field.nidNotVerified" - }, - "labelForOffline": { - "defaultMessage": "National ID authentication is currently not available offline.", - "description": "Label for indicating offline status for the user. NID verification is not currently available offline.", - "id": "form.field.nidVerificationOngoing" - } - }, { "name": "primaryAddress", "type": "SUBSECTION_HEADER", diff --git a/packages/client/src/tests/schema.graphql b/packages/client/src/tests/schema.graphql index 351d3bee0c9..67a49e5ff27 100644 --- a/packages/client/src/tests/schema.graphql +++ b/packages/client/src/tests/schema.graphql @@ -1456,7 +1456,6 @@ type Registration { _fhirID: ID draftId: String trackingId: String - mosipAid: String registrationNumber: String paperFormID: String page: String @@ -1490,7 +1489,6 @@ input RegistrationInput { _fhirID: ID draftId: String trackingId: String - mosipAid: String registrationNumber: String paperFormID: String page: String diff --git a/packages/client/src/utils/gateway.ts b/packages/client/src/utils/gateway.ts index e80a30f3b62..e7c9d89484c 100644 --- a/packages/client/src/utils/gateway.ts +++ b/packages/client/src/utils/gateway.ts @@ -1702,7 +1702,6 @@ export type Registration = { inCompleteFields?: Maybe informantType?: Maybe informantsSignature?: Maybe - mosipAid?: Maybe otherInformantType?: Maybe page?: Maybe paperFormID?: Maybe @@ -1736,7 +1735,6 @@ export type RegistrationInput = { informantType?: InputMaybe informantsSignature?: InputMaybe location?: InputMaybe - mosipAid?: InputMaybe otherInformantType?: InputMaybe page?: InputMaybe paperFormID?: InputMaybe @@ -3225,7 +3223,6 @@ export type FetchBirthRegistrationForReviewQuery = { type?: RegistrationType | null trackingId?: string | null registrationNumber?: string | null - mosipAid?: string | null duplicates?: Array<{ __typename?: 'DuplicatesInfo' compositionId?: string | null @@ -3572,7 +3569,6 @@ export type FetchBirthRegistrationForCertificateQuery = { informantsSignature?: string | null trackingId?: string | null registrationNumber?: string | null - mosipAid?: string | null status?: Array<{ __typename?: 'RegWorkflow' type?: RegStatus | null @@ -4752,7 +4748,6 @@ export type FetchMarriageRegistrationForReviewQuery = { type?: RegistrationType | null trackingId?: string | null registrationNumber?: string | null - mosipAid?: string | null duplicates?: Array<{ __typename?: 'DuplicatesInfo' compositionId?: string | null @@ -5107,7 +5102,6 @@ export type FetchMarriageRegistrationForCertificateQuery = { type?: RegistrationType | null trackingId?: string | null registrationNumber?: string | null - mosipAid?: string | null duplicates?: Array<{ __typename?: 'DuplicatesInfo' compositionId?: string | null @@ -7829,7 +7823,6 @@ export type FetchViewRecordByCompositionQuery = { type?: RegistrationType | null trackingId?: string | null registrationNumber?: string | null - mosipAid?: string | null duplicates?: Array<{ __typename?: 'DuplicatesInfo' compositionId?: string | null @@ -8215,7 +8208,6 @@ export type FetchViewRecordByCompositionQuery = { type?: RegistrationType | null trackingId?: string | null registrationNumber?: string | null - mosipAid?: string | null duplicates?: Array<{ __typename?: 'DuplicatesInfo' compositionId?: string | null @@ -8533,7 +8525,6 @@ export type FetchViewRecordByCompositionQuery = { type?: RegistrationType | null trackingId?: string | null registrationNumber?: string | null - mosipAid?: string | null duplicates?: Array<{ __typename?: 'DuplicatesInfo' compositionId?: string | null diff --git a/packages/client/src/utils/referenceApi.test.ts b/packages/client/src/utils/referenceApi.test.ts index b19385c4209..de1e0f8bd83 100644 --- a/packages/client/src/utils/referenceApi.test.ts +++ b/packages/client/src/utils/referenceApi.test.ts @@ -513,65 +513,6 @@ const parsedFacilities = { } } -const statuses = { - PENDING: 'pending', - ACTIVE: 'active', - DISABLED: 'disabled', - DEACTIVATED: 'deactivated' -} - -const mockFetchConfig = { - config: { - API_GATEWAY_URL: 'http://localhost:7070/', - CONFIG_API_URL: 'http://localhost:2021', - LOGIN_URL: 'http://localhost:3020', - AUTH_URL: 'http://localhost:4040', - RESOURCES_URL: 'http://localhost:3040', - APPLICATION_NAME: 'Farajaland CRVS', - FIELD_AGENT_AUDIT_LOCATIONS: 'DISTRICT', - DECLARATION_AUDIT_LOCATIONS: 'DISTRICT', - EXTERNAL_VALIDATION_WORKQUEUE: false, - PHONE_NUMBER_PATTERN: '/^0(7|9)[0-9]{1}[0-9]{7}$/', - SENTRY: 'https://f892d643aab642108f44e2d1795706bc@sentry.io/1774604', - NID_NUMBER_PATTERN: '/^[0-9]{9}$/', - COUNTRY: 'zmb', - CURRENCY: { - isoCode: 'ZMW', - languagesAndCountry: ['en-ZM'] - }, - LANGUAGES: 'en', - INTEGRATIONS: [ - { - name: 'MOSIP', - status: statuses.ACTIVE - } - ] - }, - certificates: [ - { - svgCode: '' - }, - { - svgCode: '' - } - ], - systems: [ - { - name: 'MOSIP', - status: statuses.ACTIVE - } - ] -} - -const certificates = [ - { - svgCode: '' - }, - { - svgCode: '' - } -] - describe('referenceApi', () => { beforeEach(() => { fetch.resetMocks() @@ -593,13 +534,4 @@ describe('referenceApi', () => { const data = await referenceApi.loadFacilities() expect(data).toEqual(parsedFacilities) }) - - it('retrieves the config from the server', async () => { - fetch.mockResponseOnce(JSON.stringify(mockFetchConfig)) - const data = await referenceApi.loadConfig() - expect(data).toEqual({ - ...mockFetchConfig, - certificates - }) - }) }) diff --git a/packages/client/src/views/DataProvider/birth/queries.ts b/packages/client/src/views/DataProvider/birth/queries.ts index a366527cbdf..441ac15bc78 100644 --- a/packages/client/src/views/DataProvider/birth/queries.ts +++ b/packages/client/src/views/DataProvider/birth/queries.ts @@ -180,7 +180,6 @@ const GET_BIRTH_REGISTRATION_FOR_REVIEW = gql` type trackingId registrationNumber - mosipAid } attendantAtBirth weightAtBirth @@ -474,7 +473,6 @@ export const GET_BIRTH_REGISTRATION_FOR_CERTIFICATE = gql` } trackingId registrationNumber - mosipAid } attendantAtBirth weightAtBirth diff --git a/packages/client/src/views/DataProvider/marriage/queries.ts b/packages/client/src/views/DataProvider/marriage/queries.ts index 4c7eef18a50..2eb8d12cb2a 100644 --- a/packages/client/src/views/DataProvider/marriage/queries.ts +++ b/packages/client/src/views/DataProvider/marriage/queries.ts @@ -192,7 +192,6 @@ const GET_MARRIAGE_REGISTRATION_FOR_REVIEW = gql` type trackingId registrationNumber - mosipAid } typeOfMarriage eventLocation { @@ -499,7 +498,6 @@ const GET_MARRIAGE_REGISTRATION_FOR_CERTIFICATE = gql` type trackingId registrationNumber - mosipAid } typeOfMarriage eventLocation { diff --git a/packages/client/src/views/RegisterForm/duplicate/DuplicateFormTabs.test.tsx b/packages/client/src/views/RegisterForm/duplicate/DuplicateFormTabs.test.tsx index 88e13f55923..d3d27c28941 100644 --- a/packages/client/src/views/RegisterForm/duplicate/DuplicateFormTabs.test.tsx +++ b/packages/client/src/views/RegisterForm/duplicate/DuplicateFormTabs.test.tsx @@ -182,7 +182,6 @@ const viewRecordMock = { type: 'BIRTH', trackingId: 'BGVLQSH', registrationNumber: null, - mosipAid: null, __typename: 'Registration' }, history: [ diff --git a/packages/client/src/views/ViewRecord/ViewRecord.test.tsx b/packages/client/src/views/ViewRecord/ViewRecord.test.tsx index a4e24c6e5c1..7a79eec43d6 100644 --- a/packages/client/src/views/ViewRecord/ViewRecord.test.tsx +++ b/packages/client/src/views/ViewRecord/ViewRecord.test.tsx @@ -212,7 +212,6 @@ describe('View Record for loading and success state', () => { type: 'DEATH', trackingId: 'DHN9T01', registrationNumber: '2022DHN9T01', - mosipAid: null, __typename: 'Registration' }, history: [ diff --git a/packages/client/src/views/ViewRecord/query.ts b/packages/client/src/views/ViewRecord/query.ts index 9fcd5e40099..1bfe0030d5d 100644 --- a/packages/client/src/views/ViewRecord/query.ts +++ b/packages/client/src/views/ViewRecord/query.ts @@ -55,7 +55,6 @@ export const FETCH_VIEW_RECORD_BY_COMPOSITION = gql` type trackingId registrationNumber - mosipAid } history { date diff --git a/packages/commons/src/fhir/patient.ts b/packages/commons/src/fhir/patient.ts index bddb6294ce9..e3a5a23a4a7 100644 --- a/packages/commons/src/fhir/patient.ts +++ b/packages/commons/src/fhir/patient.ts @@ -46,7 +46,6 @@ export type OpenCRVSPatientName = Omit & { export const SUPPORTED_PATIENT_IDENTIFIER_CODES = [ 'PASSPORT', 'NATIONAL_ID', - 'MOSIP_PSUT_TOKEN_ID', 'DECEASED_PATIENT_ENTRY', 'BIRTH_PATIENT_ENTRY', 'DRIVING_LICENSE', diff --git a/packages/commons/src/fhir/task.ts b/packages/commons/src/fhir/task.ts index a2072688d88..00755ff77ff 100644 --- a/packages/commons/src/fhir/task.ts +++ b/packages/commons/src/fhir/task.ts @@ -46,10 +46,6 @@ export type TrackingID = Nominal export type RegistrationNumber = Nominal export type TaskIdentifier = - | { - system: 'http://opencrvs.org/specs/id/mosip-aid' - value: string - } | { system: 'http://opencrvs.org/specs/id/draft-id' value: string diff --git a/packages/commons/src/fhir/transformers/index.ts b/packages/commons/src/fhir/transformers/index.ts index dd513b08dda..1d74bea5730 100644 --- a/packages/commons/src/fhir/transformers/index.ts +++ b/packages/commons/src/fhir/transformers/index.ts @@ -2554,10 +2554,6 @@ const builders: IFieldBuilders = { } return setResourceIdentifier(taskResource, `${trackingId}`, fieldValue) }, - mosipAid: (fhirBundle, fieldValue, context) => { - const taskResource = selectOrCreateTaskRefResource(fhirBundle, context) - return setResourceIdentifier(taskResource, 'mosip-aid', fieldValue) - }, registrationNumber: (fhirBundle, fieldValue, context) => { let regNumber: | 'birth-registration-number' diff --git a/packages/commons/src/fhir/transformers/input.ts b/packages/commons/src/fhir/transformers/input.ts index 683563e4020..43890b41993 100644 --- a/packages/commons/src/fhir/transformers/input.ts +++ b/packages/commons/src/fhir/transformers/input.ts @@ -181,7 +181,6 @@ export interface Registration { _fhirID?: string draftId?: string trackingId?: string - mosipAid?: string registrationNumber?: string paperFormID?: string page?: string diff --git a/packages/gateway/src/features/registration/__snapshots__/type-resolvers.test.ts.snap b/packages/gateway/src/features/registration/__snapshots__/type-resolvers.test.ts.snap index 02451a6d6a3..5db255f469c 100644 --- a/packages/gateway/src/features/registration/__snapshots__/type-resolvers.test.ts.snap +++ b/packages/gateway/src/features/registration/__snapshots__/type-resolvers.test.ts.snap @@ -438,7 +438,6 @@ Object { "inCompleteFields": null, "informantType": "MOTHER", "informantsSignature": null, - "mosipAid": null, "otherInformantType": null, "page": null, "paperFormID": null, @@ -872,7 +871,6 @@ Object { "inCompleteFields": null, "informantType": "SPOUSE", "informantsSignature": null, - "mosipAid": null, "otherInformantType": null, "page": null, "paperFormID": null, @@ -1384,7 +1382,6 @@ Object { "inCompleteFields": null, "informantType": "GROOM", "informantsSignature": null, - "mosipAid": null, "otherInformantType": null, "page": null, "paperFormID": null, diff --git a/packages/gateway/src/features/registration/schema.graphql b/packages/gateway/src/features/registration/schema.graphql index a5992899db7..cc30d8580f1 100644 --- a/packages/gateway/src/features/registration/schema.graphql +++ b/packages/gateway/src/features/registration/schema.graphql @@ -359,8 +359,6 @@ input RegistrationInput { draftId: String # long uuid for preventing an event from duplicate submission # short uuid easy to remember trackingId: String - # ID generated by MOSIP that customer can use to check up on a birth reg ID application - mosipAid: String # BRN (Birth Registration Number) DRN (Death Registration Number) - Format to be decided registrationNumber: String paperFormID: String @@ -391,8 +389,6 @@ type Registration { # -> Task draftId: String # short uuid easy to remember trackingId: String # -> .identifier - # ID generated by MOSIP that customer can use to check up on a birth reg ID application - mosipAid: String # BRN (Birth Registration Number) DRN (Death Registration Number) - Format to be decided registrationNumber: String # -> .identifier paperFormID: String # -> .identifier diff --git a/packages/gateway/src/features/registration/type-resolvers.ts b/packages/gateway/src/features/registration/type-resolvers.ts index 407a8af2c8c..adea50cede8 100644 --- a/packages/gateway/src/features/registration/type-resolvers.ts +++ b/packages/gateway/src/features/registration/type-resolvers.ts @@ -731,27 +731,6 @@ export const typeResolvers: GQLResolver = { return (foundIdentifier && foundIdentifier.value) || null }, - async mosipAid(task: Task) { - const mosipAidType = - task && - task.code && - task.code.coding && - task.code.coding[0] && - task.code.coding[0].code - - if (mosipAidType !== 'BIRTH') { - return null - } - - const foundIdentifier = - task.identifier && - task.identifier.find( - (identifier: Identifier) => - identifier.system === `${OPENCRVS_SPECIFICATION_URL}id/mosip-aid` - ) - - return (foundIdentifier && foundIdentifier.value) || null - }, async attachments(task: Task, _, context) { if (!task.focus) { throw new Error( diff --git a/packages/gateway/src/graphql/schema.d.ts b/packages/gateway/src/graphql/schema.d.ts index 6d9a27bf80b..36e768d82eb 100644 --- a/packages/gateway/src/graphql/schema.d.ts +++ b/packages/gateway/src/graphql/schema.d.ts @@ -669,7 +669,6 @@ export interface GQLRegistration { _fhirID?: string draftId?: string trackingId?: string - mosipAid?: string registrationNumber?: string paperFormID?: string page?: string @@ -1082,7 +1081,6 @@ export interface GQLRegistrationInput { _fhirID?: string draftId?: string trackingId?: string - mosipAid?: string registrationNumber?: string paperFormID?: string page?: string @@ -5436,7 +5434,6 @@ export interface GQLRegistrationTypeResolver { _fhirID?: RegistrationTo_fhirIDResolver draftId?: RegistrationToDraftIdResolver trackingId?: RegistrationToTrackingIdResolver - mosipAid?: RegistrationToMosipAidResolver registrationNumber?: RegistrationToRegistrationNumberResolver paperFormID?: RegistrationToPaperFormIDResolver page?: RegistrationToPageResolver @@ -5500,15 +5497,6 @@ export interface RegistrationToTrackingIdResolver< ): TResult } -export interface RegistrationToMosipAidResolver { - ( - parent: TParent, - args: {}, - context: Context, - info: GraphQLResolveInfo - ): TResult -} - export interface RegistrationToRegistrationNumberResolver< TParent = any, TResult = any diff --git a/packages/gateway/src/graphql/schema.graphql b/packages/gateway/src/graphql/schema.graphql index ab6ae7b7952..6aaf55c669e 100644 --- a/packages/gateway/src/graphql/schema.graphql +++ b/packages/gateway/src/graphql/schema.graphql @@ -790,7 +790,6 @@ type Registration { _fhirID: ID draftId: String trackingId: String - mosipAid: String registrationNumber: String paperFormID: String page: String @@ -1179,7 +1178,6 @@ input RegistrationInput { _fhirID: ID draftId: String trackingId: String - mosipAid: String registrationNumber: String paperFormID: String page: String diff --git a/packages/search/src/features/search/utils.ts b/packages/search/src/features/search/utils.ts index 708d98ac87a..d7550b9f785 100644 --- a/packages/search/src/features/search/utils.ts +++ b/packages/search/src/features/search/utils.ts @@ -757,7 +757,6 @@ export const findPatientPrimaryIdentifier = (patient: Patient) => [ 'PASSPORT', 'NATIONAL_ID', - 'MOSIP_PSUT_TOKEN_ID', 'DECEASED_PATIENT_ENTRY', 'BIRTH_PATIENT_ENTRY', 'DRIVING_LICENSE', diff --git a/packages/workflow/src/__mocks__/constants.ts b/packages/workflow/src/__mocks__/constants.ts index 1785c5a3700..76446ad0368 100644 --- a/packages/workflow/src/__mocks__/constants.ts +++ b/packages/workflow/src/__mocks__/constants.ts @@ -17,7 +17,6 @@ export const DOCUMENTS_URL = 'http://localhost:9050' export const NOTIFICATION_SERVICE_URL = 'http://localhost:2020/' export const APPLICATION_CONFIG_URL = 'http://localhost:2021/' export const COUNTRY_CONFIG_URL = 'http://localhost:3040' -export const MOSIP_TOKEN_SEEDER_URL = 'http://localhost:8085' export const WEBHOOKS_URL = 'http://localhost:2525/' export function getDefaultLanguage() { return 'en' diff --git a/packages/workflow/src/constants.ts b/packages/workflow/src/constants.ts index a9b19cd8d7e..11023893361 100644 --- a/packages/workflow/src/constants.ts +++ b/packages/workflow/src/constants.ts @@ -21,8 +21,6 @@ export const SEARCH_URL = process.env.SEARCH_URL || 'http://localhost:9090/' export const WEBHOOKS_URL = process.env.WEBHOOKS_URL || 'http://localhost:2525/' export const METRICS_URL = process.env.METRICS_URL || 'http://localhost:1050/' -export const MOSIP_TOKEN_SEEDER_URL = - process.env.MOSIP_TOKEN_SEEDER_URL || 'http://localhost:8085' export const COUNTRY_CONFIG_URL = process.env.COUNTRY_CONFIG_URL || 'http://localhost:3040' export const CERT_PUBLIC_KEY_PATH = diff --git a/packages/workflow/src/features/registration/fhir/fhir-bundle-modifier.test.ts b/packages/workflow/src/features/registration/fhir/fhir-bundle-modifier.test.ts index 5f25a79e018..59723dc9e33 100644 --- a/packages/workflow/src/features/registration/fhir/fhir-bundle-modifier.test.ts +++ b/packages/workflow/src/features/registration/fhir/fhir-bundle-modifier.test.ts @@ -8,30 +8,14 @@ * * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. */ -import { server as mswServer } from '@test/setupServer' -import { rest } from 'msw' import { setupRegistrationWorkflow, - setupLastRegUser, - validateDeceasedDetails + setupLastRegUser } from '@workflow/features/registration/fhir/fhir-bundle-modifier' import { OPENCRVS_SPECIFICATION_URL } from '@workflow/features/registration/fhir/constants' -import { - testFhirBundle, - mosipSuccessMock, - mosipConfigMock, - mosipDeceasedPatientMock, - mosipBirthPatientBundleMock, - mosipUpdatedDeceasedPatientMock -} from '@workflow/test/utils' +import { testFhirBundle } from '@workflow/test/utils' import { Practitioner, Task } from '@opencrvs/commons/types' import { cloneDeep } from 'lodash' -import * as jwt from 'jsonwebtoken' -import { readFileSync } from 'fs' -import * as fetchAny from 'jest-fetch-mock' -import { MOSIP_TOKEN_SEEDER_URL } from '@workflow/constants' - -const fetch = fetchAny as any describe('Verify fhir bundle modifier functions', () => { describe('SetupRegistrationWorkflow', () => { @@ -217,55 +201,3 @@ describe('Verify fhir bundle modifier functions', () => { }) }) }) - -describe('validateDeceasedDetails functions', () => { - let token: string - let authHeader: { Authorization: string } - beforeEach(async () => { - fetch.resetMocks() - token = jwt.sign({ scope: ['register'] }, readFileSync('./test/cert.key'), { - algorithm: 'RS256', - issuer: 'opencrvs:auth-service', - audience: 'opencrvs:workflow-user' - }) - - authHeader = { - Authorization: `Bearer ${token}` - } - }) - it('Validates deceased details and modifies bundle', async () => { - mswServer.use( - rest.get('http://localhost:2021/integrationConfig', (_, res, ctx) => { - return res(ctx.json(mosipConfigMock)) - }) - ) - - mswServer.use( - rest.post(`${MOSIP_TOKEN_SEEDER_URL}/authtoken/json`, (_, res, ctx) => - res(ctx.json(mosipSuccessMock)) - ) - ) - - mswServer.use( - rest.get('http://localhost:3447/fhir/Patient', (_, res, ctx) => - res(ctx.json(mosipBirthPatientBundleMock)) - ) - ) - - mswServer.use( - rest.put( - 'http://localhost:3447/fhir/Patient/1c9add9b-9215-49d7-bfaa-226c82ac47d2', - (_, res, ctx) => res(ctx.json({})) - ) - ) - - const validateResponse = await validateDeceasedDetails( - mosipDeceasedPatientMock, - authHeader - ) - expect(validateResponse).toEqual(mosipUpdatedDeceasedPatientMock) - }) - afterAll(async () => { - jest.clearAllMocks() - }) -}) diff --git a/packages/workflow/src/features/registration/fhir/fhir-bundle-modifier.ts b/packages/workflow/src/features/registration/fhir/fhir-bundle-modifier.ts index 483d3a7afa0..d7eb7ce7401 100644 --- a/packages/workflow/src/features/registration/fhir/fhir-bundle-modifier.ts +++ b/packages/workflow/src/features/registration/fhir/fhir-bundle-modifier.ts @@ -25,7 +25,7 @@ import { resourceIdentifierToUUID, SupportedPatientIdentifierCode } from '@opencrvs/commons/types' -import { APPLICATION_CONFIG_URL, COUNTRY_CONFIG_URL } from '@workflow/constants' +import { COUNTRY_CONFIG_URL } from '@workflow/constants' import { OPENCRVS_SPECIFICATION_URL, RegStatus @@ -33,11 +33,8 @@ import { import { getSectionEntryBySectionCode } from '@workflow/features/registration/fhir/fhir-template' import { fetchExistingRegStatusCode, - getFromFhir, - getRegStatusCode, - updateResourceInHearth + getRegStatusCode } from '@workflow/features/registration/fhir/fhir-utils' -import { getMosipUINToken } from '@workflow/features/registration/utils' import { getPractitionerRef } from '@workflow/features/user/utils' import { ITokenPayload } from '@workflow/utils/auth-utils' import fetch from 'node-fetch' @@ -207,166 +204,3 @@ export function updatePatientIdentifierWithRN( return patient }) } - -interface Integration { - name: string - status: string - integratingSystemType: 'MOSIP' | 'OTHER' -} - -const statuses = { - PENDING: 'pending', - ACTIVE: 'active', - DISABLED: 'disabled', - DEACTIVATED: 'deactivated' -} - -export async function validateDeceasedDetails( - patient: Saved, - authHeader: { Authorization: string } -): Promise> { - /* - In OCRVS-1637 https://github.com/opencrvs/opencrvs-core/pull/964 we attempted to create a longitudinal - record of life events by an attempt to use an existing person in gateway if an identifier is supplied that we already - have a record of in our system, rather than creating a new patient every time. - - However this supplied identifier cannot be trusted. This could lead to links between persons being abused or the wrong indivdual - being marked as deceased. - - Any external identifier must be justifiably verified as authentic by a National ID system such as MOSIP or equivalent - */ - - const configResponse: Integration[] | undefined = await fetch( - `${APPLICATION_CONFIG_URL}integrationConfig`, - { - method: 'GET', - headers: { - 'Content-Type': 'application/json', - ...authHeader - } - } - ) - .then((response) => { - return response.json() - }) - .catch((error) => { - return Promise.reject( - new Error(`Config request failed: ${error.message}`) - ) - }) - logger.info('validateDeceasedDetails response successful') - if (configResponse?.length) { - const mosipIntegration = configResponse.filter((integration) => { - return integration.integratingSystemType === 'MOSIP' - })[0] - if (mosipIntegration && mosipIntegration.status === statuses.ACTIVE) { - logger.info('validateDeceasedDetails: MOSIP ENABLED') - try { - const mosipTokenSeederResponse = await getMosipUINToken(patient) - logger.info(`MOSIP responded successfully`) - if ( - (mosipTokenSeederResponse.errors && - mosipTokenSeederResponse.errors.length) || - !mosipTokenSeederResponse.response.authToken - ) { - logger.info( - `MOSIP token request failed with errors: ${JSON.stringify( - mosipTokenSeederResponse.errors - )}` - ) - } else if (mosipTokenSeederResponse.response.authStatus === false) { - logger.info( - `MOSIP token request failed with false authStatus: ${JSON.stringify( - mosipTokenSeederResponse.errors - )}` - ) - } else { - const birthPatientBundle: Bundle = await getFromFhir( - `/Patient?identifier=${mosipTokenSeederResponse.response.authToken}` - ) - logger.info( - `Patient bundle returned by MOSIP Token Seeder search. Bundle id: ${birthPatientBundle.id}` - ) - let birthPatient: Partial & Pick = { - resourceType: 'Patient' - } - if ( - birthPatientBundle && - birthPatientBundle.entry && - birthPatientBundle.entry.length - ) { - birthPatientBundle.entry.forEach((entry) => { - const bundlePatient = entry.resource as Patient - const selectedIdentifier = bundlePatient.identifier?.filter( - (identifier) => { - return ( - identifier.type?.coding?.[0].code === - 'MOSIP_PSUT_TOKEN_ID' && - identifier.value === - mosipTokenSeederResponse.response.authToken - ) - } - )[0] - if (selectedIdentifier) { - birthPatient = bundlePatient - } - }) - } - logger.info(`birthPatient id: ${JSON.stringify(birthPatient.id)}`) - if ( - birthPatient && - birthPatient.identifier && - birthPatient.resourceType - ) { - // If existing patient can be found - // mark existing OpenCRVS birth patient as deceased with link to this patient - // Keep both Patient copies as a history of name at birth, may not be that recorde for name at death etc ... - // One should not overwrite the other - birthPatient.deceasedBoolean = true - birthPatient.identifier.push({ - type: { - coding: [ - { - system: `${OPENCRVS_SPECIFICATION_URL}identifier-type`, - code: 'DECEASED_PATIENT_ENTRY' - } - ] - }, - value: patient.id - }) - - await updateResourceInHearth(birthPatient) - // mark patient with link to the birth patient - patient.identifier?.push({ - type: { - coding: [ - { - system: `${OPENCRVS_SPECIFICATION_URL}identifier-type`, - code: 'BIRTH_PATIENT_ENTRY' - } - ] - }, - value: birthPatient.id! - }) - } - } - } catch (err) { - logger.info(`MOSIP token seeder request failed: ${JSON.stringify(err)}`) - } - } - } else { - // mosip not enabled - /* - TODO: Any internal OpenCRVS identifier (BRN) must be justifiably verified as authentic. - - If the form is enabled to submit a BRN in deceased form ... - OpenCRVS needs a robust MOSIP-like verification model on the BRN - We have to validate the bundle carefully against internal checks to find a legitimate birth patient. - - Ensure patient has link to the birth record if it exists. - - */ - // - } - return patient -} diff --git a/packages/workflow/src/features/registration/fhir/fhir-utils.ts b/packages/workflow/src/features/registration/fhir/fhir-utils.ts index cb7df67a276..c5fb948ba48 100644 --- a/packages/workflow/src/features/registration/fhir/fhir-utils.ts +++ b/packages/workflow/src/features/registration/fhir/fhir-utils.ts @@ -15,7 +15,6 @@ import { Composition, OpenCRVSPatientName, Patient, - Resource, Saved, Task, findExtension, @@ -64,7 +63,7 @@ export async function getSharedContactEmail(fhirBundle: Bundle) { ) } -export function concatenateName(fhirNames: OpenCRVSPatientName[]) { +function concatenateName(fhirNames: OpenCRVSPatientName[]) { const language = getDefaultLanguage() const name = fhirNames.find((humanName: OpenCRVSPatientName) => { return humanName.use === language @@ -261,28 +260,6 @@ export async function postToHearth(payload: any) { return res.json() } -export async function updateResourceInHearth(resource: Resource) { - const res = await fetch( - `${FHIR_URL}/${resource.resourceType}/${resource.id}`, - { - method: 'PUT', - body: JSON.stringify(resource), - headers: { - 'Content-Type': 'application/fhir+json' - } - } - ) - if (!res.ok) { - throw new Error( - `FHIR update to ${resource.resourceType} failed with [${ - res.status - }] body: ${await res.text()}` - ) - } - - return res.text() -} - //TODO: need to modifty for marriage event export function getPhoneNo(taskResource: Task, eventType: EVENT_TYPE) { let phoneNumber diff --git a/packages/workflow/src/features/registration/utils.test.ts b/packages/workflow/src/features/registration/utils.test.ts index af04631409f..001ed3612e2 100644 --- a/packages/workflow/src/features/registration/utils.test.ts +++ b/packages/workflow/src/features/registration/utils.test.ts @@ -10,19 +10,13 @@ */ import { generateTrackingIdForEvents, - convertStringToASCII, - getMosipUINToken + convertStringToASCII } from '@workflow/features/registration/utils' -import { - mosipDeceasedPatientMock, - mosipSuccessMock -} from '@workflow/test/utils' import * as fetchAny from 'jest-fetch-mock' import { EVENT_TYPE } from '@workflow/features/registration/fhir/constants' import { Bundle } from '@opencrvs/commons/types' import { server as mswServer } from '@test/setupServer' import { rest } from 'msw' -import { MOSIP_TOKEN_SEEDER_URL } from '@workflow/constants' const fetch = fetchAny as any @@ -88,18 +82,3 @@ describe('Verify utility functions', () => { expect(ascii).toBe('66538771897469') }) }) - -describe('getMosipUINToken functions', () => { - beforeAll(() => { - fetch.mockClear() - }) - it('Calls mosip token seeder function and returns success', async () => { - mswServer.use( - rest.post(`${MOSIP_TOKEN_SEEDER_URL}/authtoken/json`, (_, res, ctx) => - res(ctx.json(mosipSuccessMock)) - ) - ) - const mosipResponse = await getMosipUINToken(mosipDeceasedPatientMock) - expect(mosipResponse).toEqual(mosipSuccessMock) - }) -}) diff --git a/packages/workflow/src/features/registration/utils.ts b/packages/workflow/src/features/registration/utils.ts index 06aeee71607..44e5081ded3 100644 --- a/packages/workflow/src/features/registration/utils.ts +++ b/packages/workflow/src/features/registration/utils.ts @@ -12,17 +12,14 @@ import { Bundle, BundleEntry, Composition, - Patient, Resource, Saved, Task, TrackingID } from '@opencrvs/commons/types' -import { COUNTRY_CONFIG_URL, MOSIP_TOKEN_SEEDER_URL } from '@workflow/constants' +import { COUNTRY_CONFIG_URL } from '@workflow/constants' import { EVENT_TYPE } from '@workflow/features/registration/fhir/constants' -import { concatenateName } from '@workflow/features/registration/fhir/fhir-utils' import { getTaskEventType } from '@workflow/features/task/fhir/utils' -import { logger } from '@opencrvs/commons' import fetch from 'node-fetch' import * as ShortUIDGen from 'short-uid' @@ -115,100 +112,6 @@ export function isInProgressDeclaration(fhirBundle: Bundle) { ) } -interface IMosipAuthData { - vid?: string - name?: string - gender?: string - phoneNumber?: string - dob?: string // Format "1998/01/01" - emailId?: string - fullAddress?: string -} - -interface IMosipRequest { - deliverytype?: 'sync' - output?: string | '' - lang: 'eng' - authdata: IMosipAuthData -} - -interface IMosipSeederPayload { - id: string | '' - version: string | '' - metadata: string | '' - requesttime: string | '' - request: IMosipRequest -} - -interface IMosipErrors { - errorCode: string - errorMessage: string - actionMessage: string -} - -interface IMosipSeederResponseContent { - authStatus: boolean - authToken: string -} - -interface IMosipSeederResponse { - id: 'mosip.identity.auth' - version: 'v1' - responseTime: string - transactionID: string - response: IMosipSeederResponseContent - errors: IMosipErrors[] -} - -export async function getMosipUINToken( - patient: Patient -): Promise { - logger.info(`getMosipUINToken for Patient id ${patient.id}`) - let submittedNationalIDInForm = '' - const identifiers = patient?.identifier?.filter( - (identifier: fhir3.Identifier) => { - return identifier.type?.coding?.[0].code === 'NATIONAL_ID' - } - ) - if (identifiers) { - submittedNationalIDInForm = `${identifiers[0].value}` - } - const payload: IMosipSeederPayload = { - id: '', - version: '', - metadata: '', - requesttime: new Date().toISOString(), - request: { - lang: 'eng', - authdata: { - vid: submittedNationalIDInForm, - name: concatenateName(patient.name), - gender: patient.gender, - dob: patient.birthDate?.replace(/-/g, '/') - // TODO: send informant contact phone number? We dont ask for deceased's phone number in Civil Reg form currently - // TODO: send address in a way MOSIP can understand - } - } - } - const res = await fetch(`${MOSIP_TOKEN_SEEDER_URL}/authtoken/json`, { - method: 'POST', - body: JSON.stringify(payload), - headers: { - 'Content-Type': 'application/json' - } - }) - - if (!res.ok) { - logger.info( - `Unable to retrieve system mosip UIN token. Error: ${res.status} status received` - ) - } - - const body = await res.json() - - return body -} - function getResourceByType( bundle: Bundle, type: string diff --git a/packages/workflow/src/records/state-transitions.ts b/packages/workflow/src/records/state-transitions.ts index 588ab595a5b..ec82f448f23 100644 --- a/packages/workflow/src/records/state-transitions.ts +++ b/packages/workflow/src/records/state-transitions.ts @@ -60,8 +60,7 @@ import { invokeRegistrationValidation, setupLastRegOffice, setupLastRegUser, - updatePatientIdentifierWithRN, - validateDeceasedDetails + updatePatientIdentifierWithRN } from '@workflow/features/registration/fhir/fhir-bundle-modifier' import { EventRegistrationPayload } from '@workflow/features/registration/handler' import { ASSIGNED_EXTENSION_URL } from '@workflow/features/task/fhir/constants' @@ -532,16 +531,6 @@ export async function toRegistered( }) } - if (event === EVENT_TYPE.DEATH) { - /** using first patient because for death event there is only one patient */ - patientsWithRegNumber[0] = await validateDeceasedDetails( - patientsWithRegNumber[0], - { - Authorization: request.headers.authorization - } - ) - } - const patientIds = patientsWithRegNumber.map((p) => p.id) const patientsEntriesWithRN = record.entry.filter((e) => patientIds.includes(e.resource.id) diff --git a/packages/workflow/src/test/utils.ts b/packages/workflow/src/test/utils.ts index 0892f84e12d..7193ce5b35f 100644 --- a/packages/workflow/src/test/utils.ts +++ b/packages/workflow/src/test/utils.ts @@ -350,141 +350,6 @@ export const fieldAgentPractitionerMock = JSON.stringify({ ] }) -type PatientIdentifier = NonNullable[number] - -const drnIdentifier = { - type: { - coding: [ - { - system: 'http://opencrvs.org/specs/identifier-type', - code: 'DEATH_REGISTRATION_NUMBER' - } - ] - }, - value: '2022DSNEYUG' -} satisfies PatientIdentifier - -const nidIdentifier = { - value: '654654666', - type: { - coding: [ - { - system: 'http://opencrvs.org/specs/identifier-type', - code: 'NATIONAL_ID' - } - ] - } -} satisfies PatientIdentifier - -const brnIdentifier = { - type: { - coding: [ - { - system: 'http://opencrvs.org/specs/identifier-type', - code: 'BIRTH_REGISTRATION_NUMBER' - } - ] - }, - value: '2022BSNEYUG' -} satisfies PatientIdentifier - -const mosipPsutTokenIdentifier = { - type: { - coding: [ - { - system: 'http://opencrvs.org/specs/identifier-type', - code: 'MOSIP_PSUT_TOKEN_ID' - } - ] - }, - value: '257803821990055124230310596669133515' -} as fhir3.CodeableConcept - -const birthPatientIdentifier = { - type: { - coding: [ - { - system: 'http://opencrvs.org/specs/identifier-type', - code: 'BIRTH_PATIENT_ENTRY' - } - ] - }, - value: '1c9add9b-9215-49d7-bfaa-226c82ac47d2' -} as fhir3.CodeableConcept - -export const mosipDeceasedPatientMock: Saved = { - resourceType: 'Patient', - active: true, - id: '1c9add9b-9215-49d7-bfaa-226c82ac47d1' as UUID, - name: [ - { - use: 'en', - given: ['Sakib Al'], - family: 'Hasan' - } - ], - gender: 'male', - deceased: true, - birthDate: '1990-09-01', - identifier: [nidIdentifier, drnIdentifier] -} - -export const mosipUpdatedDeceasedPatientMock = { - resourceType: 'Patient', - active: true, - id: '1c9add9b-9215-49d7-bfaa-226c82ac47d1', - name: [ - { - use: 'en', - given: ['Sakib Al'], - family: 'Hasan' - } - ], - gender: 'male', - deceased: true, - birthDate: '1990-09-01', - identifier: [nidIdentifier, drnIdentifier, birthPatientIdentifier] -} - -const mosipBirthPatientMock = { - resourceType: 'Patient', - active: true, - id: '1c9add9b-9215-49d7-bfaa-226c82ac47d2', - name: [ - { - use: 'bn', - given: ['Sakib Al'], - family: ['Hasan'] - } - ], - gender: 'male', - birthDate: '1990-09-01', - multipleBirthInteger: 1, - identifier: [brnIdentifier, mosipPsutTokenIdentifier] -} - -export const mosipBirthPatientBundleMock = { - resourceType: 'Bundle', - type: 'document', - entry: [ - { - fullUrl: `urn:uuid:888` as URNReference, - resource: mosipBirthPatientMock - } - ] -} - -export const mosipSuccessMock = { - transactionID: '5763906453', - version: '1.0', - id: 'mosip.identity.auth', - errors: null, - responseTime: '2022-08-30T08:15:11.033Z', - response: { - authStatus: true, - authToken: '257803821990055124230310596669133515' - } -} export const mosipConfigMock = [ { status: 'active', name: 'Sweet Health', integratingSystemType: 'MOSIP' } ] From e3ea91268a7e08c54f78d2cfd20b7cddee397026 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 13 Nov 2024 15:26:07 +0600 Subject: [PATCH 42/50] chore(deps): update metabase/metabase docker tag to v0.50.30.1 (#7454) * chore(deps): update metabase/metabase docker tag to v0.50.29.1 * chore(deps): update metabase/metabase docker tag to v0.50.30.1 * chore: bump metabase to v0.50.30.1 * chore: remove metabase related entries from tryivyignore * chore: update changelog * feat: include version in metabase file name * fix: override `MB_DB_FILE` only if not defined * Revert "feat: include version in metabase file name" This reverts commit 3a26d0b08d9e3f058291c83e358c1393586e9b27. * Revert "chore: update changelog" This reverts commit 2662940d8668e0d39b8e622bf9f14602fee6e939. * Update CHANGELOG.md chore: update changelog --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: jamil314 --- .trivyignore.yaml | 16 - CHANGELOG.md | 2 +- packages/dashboards/Dockerfile | 2 +- packages/dashboards/metabase.init.db.sql | 822 ++++++++++++----------- packages/dashboards/run.sh | 2 +- 5 files changed, 419 insertions(+), 425 deletions(-) diff --git a/.trivyignore.yaml b/.trivyignore.yaml index 40e659eb3fe..0b848d3e44b 100644 --- a/.trivyignore.yaml +++ b/.trivyignore.yaml @@ -39,16 +39,6 @@ vulnerabilities: statement: Dashboards vulns (java libs) - id: CVE-2022-1471 statement: Dashboards vulns (java libs) - - id: CVE-2024-25710 - statement: Metabase v0.46 vulnerability, fixed in Metabase v0.49 - - id: CVE-2024-26308 - statement: Metabase v0.46 vulnerability, fixed in Metabase v0.49 - - id: CVE-2024-22201 - statement: Metabase v0.46 vulnerability, fixed in Metabase v0.49 - - id: CVE-2023-36478 - statement: Metabase v0.46 vulnerability, fixed in Metabase v0.49 - - id: CVE-2024-21634 - statement: Metabase v0.46 vulnerability, fixed in Metabase v0.49 - id: CVE-2024-4068 statement: Transitive dependency of jest and msw. Not running in production. Likely fixed by upgrading. - id: CVE-2024-37890 @@ -57,9 +47,3 @@ vulnerabilities: statement: Transitive dependency of react-router 5.3.4. Only affects client-side code ocrvs-7682 - id: CVE-2024-47068 statement: Transitive dependency of Vite. Not run in production and there is currently no fix. - - id: CVE-2024-7254 - statement: Metabase v0.46 vulnerability, fixed in Metabase v0.50 ocrvs-6607 - - id: CVE-2024-41909 - statement: Metabase v0.46 vulnerability, fixed in Metabase v0.50 ocrvs-6607 - - id: CVE-2024-22871 - statement: Metabase v0.46 vulnerability, fixed in Metabase v0.50 ocrvs-6607 diff --git a/CHANGELOG.md b/CHANGELOG.md index 36c196eef88..a1a3a1628c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ ### Breaking changes -- **Title** Description +- **Dashboard:** Changes made to the dashboard configuration will reset after upgrading OpenCRVS. ## Improvements diff --git a/packages/dashboards/Dockerfile b/packages/dashboards/Dockerfile index fb56d590ddc..4fa20db1fbb 100644 --- a/packages/dashboards/Dockerfile +++ b/packages/dashboards/Dockerfile @@ -1,4 +1,4 @@ -FROM metabase/metabase:v0.46.6.4 +FROM metabase/metabase:v0.50.30.1 ADD packages/dashboards/run.sh / ADD packages/dashboards/initialize-database.sh / diff --git a/packages/dashboards/metabase.init.db.sql b/packages/dashboards/metabase.init.db.sql index 92a5d5cf81f..f90deaeeab2 100644 --- a/packages/dashboards/metabase.init.db.sql +++ b/packages/dashboards/metabase.init.db.sql @@ -786,8 +786,8 @@ INSERT INTO "PUBLIC"."SETTING" VALUES ('site-name', 'OpenCRVS Local'), ('site-url', 'http://localhost:4444'), ('custom-geojson', '{"cdc1d5eb-c7f8-8b01-b296-eda34d06b6da":{"name":"Full country","url":"http://localhost:3040/content/map.geojson","region_key":"State","region_name":"State"}}'), -('startup-time-millis', '6453'), -('settings-last-updated', '2024-02-29 13:43:53.376747+02'); +('startup-time-millis', '2719'), +('settings-last-updated', '2024-10-21 18:02:31.239457+06'); CREATE CACHED TABLE "PUBLIC"."METRIC_IMPORTANT_FIELD"( "ID" INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 1) DEFAULT ON NULL NOT NULL, "METRIC_ID" INTEGER NOT NULL, @@ -38027,7 +38027,7 @@ CREATE CACHED TABLE "PUBLIC"."QUERY" COMMENT 'Information (such as average execu "QUERY" CHARACTER LARGE OBJECT COMMENT 'The actual "query dictionary" for this query.' ); ALTER TABLE "PUBLIC"."QUERY" ADD CONSTRAINT "PUBLIC"."PK_QUERY" PRIMARY KEY("QUERY_HASH"); --- 3464 +/- SELECT COUNT(*) FROM PUBLIC.QUERY; +-- 3465 +/- SELECT COUNT(*) FROM PUBLIC.QUERY; INSERT INTO "PUBLIC"."QUERY" VALUES (X'4e593a1c0b2629377c681948968bd52751df0f1c012f9e646e4ec8bf70c66767', 392, '{"database":2,"query":{"source-table":22,"limit":10},"type":"query","middleware":{"js-int-to-string?":true,"add-default-userland-constraints?":true}}'), (X'02a64b3814e9e4302e8cf06c9a989abf3bc2bfe81d1cd7cd9bee2ea6dbd57907', 60, '{"database":2,"type":"native","native":{"query":"[\n {$match: {\n $and: [\n [[, {{ filterGender }} ]]\n\n ]\n }}\n , {$group: { \n _id: {salePeriod: \"$totalCount\"}\n , totalCount: {$sum: NumberInt(1)}\n }} \n , {$project: { \n _id : NumberInt(0)\n , \"Total Count\": \"$_id.$totalCount\"\n , totalCount: \"$totalCount\"\n }}\n]","template-tags":{"filterGender":{"id":"56b52da5-caab-ac76-71b2-a487a0402d18","name":"filterGender","display-name":"gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null}},"collection":"analyticsRegistrations"},"middleware":{"js-int-to-string?":true,"add-default-userland-constraints?":true}}'), @@ -43673,9 +43673,12 @@ INSERT INTO "PUBLIC"."QUERY" VALUES (X'2a4df20c370296da0de8b63834426138a264b3cc10519f34eec279ed15413ee4', 263, '{"constraints":{"max-results":10000,"max-results-bare-rows":2000},"type":"native","middleware":{"js-int-to-string?":true,"ignore-cached-results?":false},"native":{"collection":"registrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , { \"$group\": {\n \"_id\": {\n \"gender\": \"$gender\"\n },\n \"count\": {\n \"$sum\": 1\n },\n }\n },\n { \"$project\": {\n \"_id\": false,\n \"gender\": \"$_id.gender\",\n \"count\": true\n }\n },\n {$match: {\n \"gender\": {$ne: null}\n }}\n \n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Gender'': \"$allInfo.gender\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }}\n]","template-tags":{"filterDate":{"id":"57523c92-bc05-e144-f15d-a07fc78322c2","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/relative","default":null},"filterGender":{"id":"f7834d58-4acc-cc46-0aee-08d1421f1ff1","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"af46a4e6-571c-e47f-e8ab-2cf527f54d68","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"a771e085-c491-259c-3020-bb9f97cf56f4","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"09bc4ac9-1847-d645-24c9-4f2892e147d0","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}}},"database":3,"parameters":[{"type":"string/=","value":["Birth"],"id":"6299a85e","target":["dimension",["template-tag","filterEvent"]]},{"type":"date/all-options","value":"past12months~","id":"45724d13","target":["dimension",["template-tag","filterDate"]]}],"async?":true,"cache-ttl":null}'), (X'5410ee4c469ba66304b9401be2c69fb8d6f51b4554415f34da06fdbda9158d65', 241, '{"constraints":{"max-results":10000,"max-results-bare-rows":2000},"type":"query","middleware":{"js-int-to-string?":true,"ignore-cached-results?":false},"database":3,"query":{"aggregation":[["count"]],"breakout":[["field",677,{"temporal-unit":"month"}]],"filter":["=",["field",666,null],"Birth"],"source-table":70},"parameters":[{"type":"string/=","value":["Birth"],"id":"6299a85e","target":["dimension",["field",666,null]]},{"type":"date/all-options","value":"past12months~","id":"45724d13","target":["dimension",["field",677,null]]}],"async?":true,"cache-ttl":null}'), (X'fc7a4db923357a2aea8727afcddc5a021edaf9ebb456c7550541cc93d485eb27', 516, '{"constraints":{"max-results":10000,"max-results-bare-rows":2000},"type":"native","middleware":{"js-int-to-string?":true,"ignore-cached-results?":false},"native":{"template-tags":{"filterDate":{"id":"1e69ed7b-8ae8-6cfe-0c1c-ae93f5048bee","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",658,null],"widget-type":"date/all-options","default":null},"filterState":{"id":"f9f00080-004f-1c25-e71b-af69fb2fc1b1","name":"filterState","display-name":"Filterstate","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null}},"query":"[\n {\n $group: {\n _id: {\n date: { $dateToString: { format: ''%Y-%m-%d'', date: ''$createdAt'' } },\n stateName: ''$stateName''\n },\n total: { $sum: 1 }\n }\n },\n { $addFields: { estimatedNumberOfBirths: 0, stateName: ''$_id.stateName'', date: {$dateFromString: {dateString: ''$_id.date'' } }}},\n { $unionWith: { coll: ''populationEstimatesPerDay'', pipeline: [{$addFields: {stateName: ''$name'', date: ''$date''}}]}},\n\n{ $group: {\n _id: {\n date: ''$date'',\n stateName: ''$stateName''\n },\n totalRegistrations: { $sum: ''$total'' },\n estimate: { $sum: ''$estimatedNumberOfBirths'' }, \n }},\n {$addFields:{stateName: ''$_id.stateName'', date: ''$_id.date''}},\n{\n $match: {\n $and: [\n { _id: { $ne: null } }\n [[ {{ filterDate }} ]]\n [[ {{ filterState }} ]]\n ]\n }\n}, \n{\n $group: {\n _id: {name: \"$stateName\"},\n totalRegistrations: { $sum: ''$totalRegistrations'' },\n estimate: { $sum: ''$estimate'' }\n }\n}, \n{$addFields: {\n percentage: {\n $cond: {\n if: { $eq: [ \"$totalRegistrations\", 0 ] },\n then: 0,\n else: {\n $cond: {\n if: { $eq: [ \"$estimate\", 0 ] },\n then: 0,\n else: {$divide: [''$totalRegistrations'', ''$estimate'']}\n }\n }\n }\n} \n}}, \n{$project: {\n _id: false,\n State: ''$_id.name'',\n ''Completeness Rate'': {$round: [{$multiply: [''$percentage'', 100] }, 0]}\n}} \n]","collection":"registrations"},"database":3,"parameters":[{"type":"string/=","value":["Birth"],"id":"6299a85e","target":["dimension",["template-tag","filterEvent"]]},{"type":"date/all-options","value":"past12months~","id":"45724d13","target":["dimension",["template-tag","filterDate"]]}],"async?":true,"cache-ttl":null}'); +INSERT INTO SYSTEM_LOB_STREAM VALUES(553, 0, '{"constraints":{"max-results":10000,"max-results-bare-rows":2000},"type":"native","middleware":{"js-int-to-string?":true,"ignore-cached-results?":false,"process-viz-settings?":false},"native":{"template-tags":{"filterGender":{"id":"56559614-c685-9d81-d44b-a688fe5b103b","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterDate":{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null},"filterDistrict":{"id":"0d1e592a-47dc-e5ed-9522-613ab64ea6c2","name":"filterDistrict","display-name":"District","type":"dimension","dimension":["field",723,null],"widget-type":"string/=","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterDistrict }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterDistrict }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , mothersAge: ''$mothersAgeAtBirthOfChildInYears''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$gte: [''$mothersAge'', 9]}, {$lt: [''$mothersAge'', 15]}] }, then: ''09-14''},\n {case: {$and: [{$gte: [''$mothersAge'', 15]}, {$lt: [''$mothersAge'', 20]}] }, then: ''15-19''},\n {case: {$and: [{$gte: [''$mothersAge'', 20]}, {$lt: [''$mothersAge'', 25]}] }, then: ''20-24''},\n {case: {$and: [{$gte: [''$mothersAge'', 25]}, {$lt: [''$mothersAge'', 30]}] }, then: ''25-29''},\n {case: {$and: [{$gte: [''$mothersAge'', 30]}, {$lt: [''$mothersAge'', 35]}] }, then: ''30-34''},\n {case: {$and: [{$gte: [''$mothersAge'', 35]}, {$lt: [''$mothersAge'', 40]}] }, then: ''35-39''},\n {case: {$and: [{$gte: [''$mothersAge'', 40]}, {$lt: [''$mothersAge'', 45]}] }, then: ''40-44''},\n {case: {$and: [{$gte: [''$mothersAge'', 45]}, {$lt: [''$mothersAge'', 50]}] }, then: ''45-49''},\n {case: {$and: [{$gte: [''$mothersAge'', 50]}, {$lt: [''$mothersAge'', 55]}] }, then: ''50-54''},\n {case: {$and: [{$gte: [''$mothersAge'', 55]}, {$lt: [''$mothersAge'', 60]}] }, then: ''55-59''},\n {case: {$and: [{$gte: [''$mothersAge'', 60]}] }, then: ''60+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arr', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(553, 1, 'ayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Order\": 1\n }\n }\n]","collection":"registrations"},"database":3,"async?":true,"cache-ttl":null}', NULL); INSERT INTO "PUBLIC"."QUERY" VALUES (X'3ddb346a3903aae638a68a133fa1d898d75d917bd0cede5b21aef2507d07d180', 169, '{"constraints":{"max-results":10000,"max-results-bare-rows":2000},"type":"query","middleware":{"js-int-to-string?":true,"ignore-cached-results?":false},"database":3,"query":{"aggregation":[["count"]],"breakout":[["expression","Reason"]],"expressions":{"Reason":["case",[[["=",["field",688,null],"CLERICAL_ERROR"],"Clerical Error"],[["=",["field",688,null],"JUDICIAL_ORDER"],"Judicial Order"],[["=",["field",688,null],"MATERIAL_ERROR"],"Material Error"],[["=",["field",688,null],"MATERIAL_OMISSION"],"Material Omission"],[["=",["field",688,null],"OTHER"],"Other"]]]},"filter":["=",["field",693,null],"Birth"],"source-table":71},"parameters":[{"type":"string/=","value":["Birth"],"id":"6299a85e","target":["dimension",["field",693,null]]},{"type":"date/all-options","value":"past12months~","id":"45724d13","target":["dimension",["field",695,null]]}],"async?":true,"cache-ttl":null}'), -(X'507e010e113f97d9bffca203327fbcb72849efd06ed6410a73bf98d8e0cce96c', 417, '{"constraints":{"max-results":10000,"max-results-bare-rows":2000},"type":"native","middleware":{"js-int-to-string?":true,"ignore-cached-results?":false},"native":{"collection":"registrations","query":"[\n {\n $group: {\n _id: {\n date: { $dateToString: { format: ''%Y-%m-%d'', date: ''$createdAt'' } },\n stateName: ''$stateName''\n },\n total: { $sum: 1 }\n }\n },\n { $addFields: { estimatedNumberOfBirths: 0, stateName: ''$_id.stateName'', date: {$dateFromString: {dateString: ''$_id.date'' } }}},\n { $unionWith: { coll: ''populationEstimatesPerDay'', pipeline: [{$addFields: {stateName: ''$name'', date: ''$date''}}]}},\n{ $group: {\n _id: {\n date: ''$date'',\n stateName: ''$stateName''\n },\n totalRegistrations: { $sum: ''$total'' },\n estimate: { $sum: ''$estimatedNumberOfBirths'' }, \n }},\n {$addFields:{stateName: ''$_id.stateName'', date: ''$_id.date''}},\n {\n $match: {\n $and: [\n { _id: { $ne: null } }\n [[ {{ filterDate }} ]]\n [[ {{ filterState }} ]]\n ]\n }\n }, \n {\n $group: {\n _id: null,\n totalRegistrations: { $sum: ''$totalRegistrations'' },\n estimate: { $sum: ''$estimate'' }\n }\n }, \n {\n $addFields: {\n percentage: {\n $cond: {\n if: { $eq: [''$totalRegistrations'', 0] },\n then: 0,\n else: {\n $cond: {\n if: { $eq: [''$estimate'', 0] },\n then: 0,\n else: { $divide: [''$totalRegistrations'', ''$estimate''] }\n }\n }\n }\n }\n }\n },\n { $project: { _id: false, percentage: ''$percentage'', totalRegistrations: ''$totalRegistrations'', estimate: ''$estimate'' } } \n]","template-tags":{"filterDate":{"id":"56e116a3-0612-74c2-b84a-28f672d719ef","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",658,null],"widget-type":"date/all-options","default":null},"filterState":{"id":"8735e3f7-fcc5-2a78-8fad-0b88ae7b9a12","name":"filterState","display-name":"Filterstate","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null}}},"database":3,"parameters":[{"type":"string/=","value":["Birth"],"id":"6299a85e","target":["dimension",["template-tag","filterEvent"]]},{"type":"date/all-options","value":"past12months~","id":"45724d13","target":["dimension",["template-tag","filterDate"]]}],"async?":true,"cache-ttl":null}'); +(X'507e010e113f97d9bffca203327fbcb72849efd06ed6410a73bf98d8e0cce96c', 417, '{"constraints":{"max-results":10000,"max-results-bare-rows":2000},"type":"native","middleware":{"js-int-to-string?":true,"ignore-cached-results?":false},"native":{"collection":"registrations","query":"[\n {\n $group: {\n _id: {\n date: { $dateToString: { format: ''%Y-%m-%d'', date: ''$createdAt'' } },\n stateName: ''$stateName''\n },\n total: { $sum: 1 }\n }\n },\n { $addFields: { estimatedNumberOfBirths: 0, stateName: ''$_id.stateName'', date: {$dateFromString: {dateString: ''$_id.date'' } }}},\n { $unionWith: { coll: ''populationEstimatesPerDay'', pipeline: [{$addFields: {stateName: ''$name'', date: ''$date''}}]}},\n{ $group: {\n _id: {\n date: ''$date'',\n stateName: ''$stateName''\n },\n totalRegistrations: { $sum: ''$total'' },\n estimate: { $sum: ''$estimatedNumberOfBirths'' }, \n }},\n {$addFields:{stateName: ''$_id.stateName'', date: ''$_id.date''}},\n {\n $match: {\n $and: [\n { _id: { $ne: null } }\n [[ {{ filterDate }} ]]\n [[ {{ filterState }} ]]\n ]\n }\n }, \n {\n $group: {\n _id: null,\n totalRegistrations: { $sum: ''$totalRegistrations'' },\n estimate: { $sum: ''$estimate'' }\n }\n }, \n {\n $addFields: {\n percentage: {\n $cond: {\n if: { $eq: [''$totalRegistrations'', 0] },\n then: 0,\n else: {\n $cond: {\n if: { $eq: [''$estimate'', 0] },\n then: 0,\n else: { $divide: [''$totalRegistrations'', ''$estimate''] }\n }\n }\n }\n }\n }\n },\n { $project: { _id: false, percentage: ''$percentage'', totalRegistrations: ''$totalRegistrations'', estimate: ''$estimate'' } } \n]","template-tags":{"filterDate":{"id":"56e116a3-0612-74c2-b84a-28f672d719ef","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",658,null],"widget-type":"date/all-options","default":null},"filterState":{"id":"8735e3f7-fcc5-2a78-8fad-0b88ae7b9a12","name":"filterState","display-name":"Filterstate","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null}}},"database":3,"parameters":[{"type":"string/=","value":["Birth"],"id":"6299a85e","target":["dimension",["template-tag","filterEvent"]]},{"type":"date/all-options","value":"past12months~","id":"45724d13","target":["dimension",["template-tag","filterDate"]]}],"async?":true,"cache-ttl":null}'), +(X'85fcf68eb6a7ac8cc842f0b171e8606d01477276f0a89c5de54944db9a306b5a', 335, SYSTEM_COMBINE_CLOB(553)); CREATE CACHED TABLE "PUBLIC"."PERMISSIONS_GROUP"( "ID" INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 3) DEFAULT ON NULL NOT NULL, "NAME" CHARACTER VARYING(255) NOT NULL @@ -44191,15 +44194,15 @@ CREATE CACHED TABLE "PUBLIC"."QRTZ_TRIGGERS" COMMENT 'Used for Quartz scheduler. ALTER TABLE "PUBLIC"."QRTZ_TRIGGERS" ADD CONSTRAINT "PUBLIC"."PK_QRTZ_TRIGGERS" PRIMARY KEY("SCHED_NAME", "TRIGGER_NAME", "TRIGGER_GROUP"); -- 9 +/- SELECT COUNT(*) FROM PUBLIC.QRTZ_TRIGGERS; INSERT INTO "PUBLIC"."QRTZ_TRIGGERS" VALUES -('MetabaseScheduler', 'metabase.task.update-field-values.trigger.3', 'DEFAULT', 'metabase.task.update-field-values.job', 'DEFAULT', 'update-field-values Database 3', 1709258400000, 1676599200000, 5, 'WAITING', 'CRON', 1672258773000, 0, NULL, 2, X'aced0005737200156f72672e71756172747a2e4a6f62446174614d61709fb083e8bfa9b0cb020000787200266f72672e71756172747a2e7574696c732e537472696e674b65794469727479466c61674d61708208e8c3fbc55d280200015a0013616c6c6f77735472616e7369656e74446174617872001d6f72672e71756172747a2e7574696c732e4469727479466c61674d617013e62ead28760ace0200025a000564697274794c00036d617074000f4c6a6176612f7574696c2f4d61703b787000737200116a6176612e7574696c2e486173684d61700507dac1c31660d103000246000a6c6f6164466163746f724900097468726573686f6c6478703f4000000000000c7708000000100000000174000564622d6964737200116a6176612e6c616e672e496e746567657212e2a0a4f781873802000149000576616c7565787200106a6176612e6c616e672e4e756d62657286ac951d0b94e08b0200007870000000037800'), -('MetabaseScheduler', 'metabase.task.sync-and-analyze.trigger.3', 'DEFAULT', 'metabase.task.sync-and-analyze.job', 'DEFAULT', 'sync-and-analyze Database 3', 1709207340000, 1707828540000, 5, 'WAITING', 'CRON', 1672258773000, 0, NULL, 2, X'aced0005737200156f72672e71756172747a2e4a6f62446174614d61709fb083e8bfa9b0cb020000787200266f72672e71756172747a2e7574696c732e537472696e674b65794469727479466c61674d61708208e8c3fbc55d280200015a0013616c6c6f77735472616e7369656e74446174617872001d6f72672e71756172747a2e7574696c732e4469727479466c61674d617013e62ead28760ace0200025a000564697274794c00036d617074000f4c6a6176612f7574696c2f4d61703b787000737200116a6176612e7574696c2e486173684d61700507dac1c31660d103000246000a6c6f6164466163746f724900097468726573686f6c6478703f4000000000000c7708000000100000000174000564622d6964737200116a6176612e6c616e672e496e746567657212e2a0a4f781873802000149000576616c7565787200106a6176612e6c616e672e4e756d62657286ac951d0b94e08b0200007870000000037800'), -('MetabaseScheduler', 'metabase.task.upgrade-checks.trigger', 'DEFAULT', 'metabase.task.upgrade-checks.job', 'DEFAULT', NULL, 1709223300000, -1, 5, 'WAITING', 'CRON', 1709207032000, 0, NULL, 0, X''), -('MetabaseScheduler', 'metabase.task.anonymous-stats.trigger', 'DEFAULT', 'metabase.task.anonymous-stats.job', 'DEFAULT', NULL, 1709263800000, -1, 5, 'WAITING', 'CRON', 1709207032000, 0, NULL, 0, X''), -('MetabaseScheduler', 'metabase.task.refresh-channel-cache.trigger', 'DEFAULT', 'metabase.task.refresh-channel-cache.job', 'DEFAULT', NULL, 1709217060000, -1, 5, 'WAITING', 'CRON', 1709207032000, 0, NULL, 2, X''), -('MetabaseScheduler', 'metabase.task.send-pulses.trigger', 'DEFAULT', 'metabase.task.send-pulses.job', 'DEFAULT', NULL, 1709208000000, -1, 5, 'WAITING', 'CRON', 1709207032000, 0, NULL, 1, X''), -('MetabaseScheduler', 'metabase.task.follow-up-emails.trigger', 'DEFAULT', 'metabase.task.follow-up-emails.job', 'DEFAULT', NULL, 1709287200000, -1, 5, 'WAITING', 'CRON', 1709207033000, 0, NULL, 0, X''), -('MetabaseScheduler', 'metabase.task.task-history-cleanup.trigger', 'DEFAULT', 'metabase.task.task-history-cleanup.job', 'DEFAULT', NULL, 1709208000000, -1, 5, 'WAITING', 'CRON', 1709207033000, 0, NULL, 0, X''), -('MetabaseScheduler', 'metabase.task.truncate-audit-log.trigger', 'DEFAULT', 'metabase.task.truncate-audit-log.job', 'DEFAULT', NULL, 1709244000000, -1, 5, 'WAITING', 'CRON', 1709207033000, 0, NULL, 2, X''); +('MetabaseScheduler', 'metabase.task.update-field-values.trigger.3', 'DEFAULT', 'metabase.task.update-field-values.job', 'DEFAULT', 'update-field-values Database 3', 1729562400000, 1676599200000, 5, 'WAITING', 'CRON', 1672258773000, 0, NULL, 2, X'aced0005737200156f72672e71756172747a2e4a6f62446174614d61709fb083e8bfa9b0cb020000787200266f72672e71756172747a2e7574696c732e537472696e674b65794469727479466c61674d61708208e8c3fbc55d280200015a0013616c6c6f77735472616e7369656e74446174617872001d6f72672e71756172747a2e7574696c732e4469727479466c61674d617013e62ead28760ace0200025a000564697274794c00036d617074000f4c6a6176612f7574696c2f4d61703b787000737200116a6176612e7574696c2e486173684d61700507dac1c31660d103000246000a6c6f6164466163746f724900097468726573686f6c6478703f4000000000000c7708000000100000000174000564622d6964737200116a6176612e6c616e672e496e746567657212e2a0a4f781873802000149000576616c7565787200106a6176612e6c616e672e4e756d62657286ac951d0b94e08b0200007870000000037800'), +('MetabaseScheduler', 'metabase.task.sync-and-analyze.trigger.3', 'DEFAULT', 'metabase.task.sync-and-analyze.job', 'DEFAULT', 'sync-and-analyze Database 3', 1729514940000, 1707828540000, 5, 'WAITING', 'CRON', 1672258773000, 0, NULL, 2, X'aced0005737200156f72672e71756172747a2e4a6f62446174614d61709fb083e8bfa9b0cb020000787200266f72672e71756172747a2e7574696c732e537472696e674b65794469727479466c61674d61708208e8c3fbc55d280200015a0013616c6c6f77735472616e7369656e74446174617872001d6f72672e71756172747a2e7574696c732e4469727479466c61674d617013e62ead28760ace0200025a000564697274794c00036d617074000f4c6a6176612f7574696c2f4d61703b787000737200116a6176612e7574696c2e486173684d61700507dac1c31660d103000246000a6c6f6164466163746f724900097468726573686f6c6478703f4000000000000c7708000000100000000174000564622d6964737200116a6176612e6c616e672e496e746567657212e2a0a4f781873802000149000576616c7565787200106a6176612e6c616e672e4e756d62657286ac951d0b94e08b0200007870000000037800'), +('MetabaseScheduler', 'metabase.task.upgrade-checks.trigger', 'DEFAULT', 'metabase.task.upgrade-checks.job', 'DEFAULT', NULL, 1729512900000, -1, 5, 'WAITING', 'CRON', 1729512151000, 0, NULL, 0, X''), +('MetabaseScheduler', 'metabase.task.anonymous-stats.trigger', 'DEFAULT', 'metabase.task.anonymous-stats.job', 'DEFAULT', NULL, 1729560000000, -1, 5, 'WAITING', 'CRON', 1729512151000, 0, NULL, 0, X''), +('MetabaseScheduler', 'metabase.task.refresh-channel-cache.trigger', 'DEFAULT', 'metabase.task.refresh-channel-cache.job', 'DEFAULT', NULL, 1729521660000, -1, 5, 'WAITING', 'CRON', 1729512151000, 0, NULL, 2, X''), +('MetabaseScheduler', 'metabase.task.send-pulses.trigger', 'DEFAULT', 'metabase.task.send-pulses.job', 'DEFAULT', NULL, 1729515600000, -1, 5, 'WAITING', 'CRON', 1729512151000, 0, NULL, 1, X''), +('MetabaseScheduler', 'metabase.task.follow-up-emails.trigger', 'DEFAULT', 'metabase.task.follow-up-emails.job', 'DEFAULT', NULL, 1729576800000, -1, 5, 'WAITING', 'CRON', 1729512151000, 0, NULL, 0, X''), +('MetabaseScheduler', 'metabase.task.task-history-cleanup.trigger', 'DEFAULT', 'metabase.task.task-history-cleanup.job', 'DEFAULT', NULL, 1729515600000, -1, 5, 'WAITING', 'CRON', 1729512151000, 0, NULL, 0, X''), +('MetabaseScheduler', 'metabase.task.truncate-audit-log.trigger', 'DEFAULT', 'metabase.task.truncate-audit-log.job', 'DEFAULT', NULL, 1729533600000, -1, 5, 'WAITING', 'CRON', 1729512151000, 0, NULL, 2, X''); CREATE INDEX "PUBLIC"."IDX_QRTZ_T_J" ON "PUBLIC"."QRTZ_TRIGGERS"("SCHED_NAME" NULLS FIRST, "JOB_NAME" NULLS FIRST, "JOB_GROUP" NULLS FIRST); CREATE INDEX "PUBLIC"."IDX_QRTZ_T_JG" ON "PUBLIC"."QRTZ_TRIGGERS"("SCHED_NAME" NULLS FIRST, "JOB_GROUP" NULLS FIRST); CREATE INDEX "PUBLIC"."IDX_QRTZ_T_C" ON "PUBLIC"."QRTZ_TRIGGERS"("SCHED_NAME" NULLS FIRST, "CALENDAR_NAME" NULLS FIRST); @@ -44330,7 +44333,7 @@ CREATE CACHED TABLE "PUBLIC"."CORE_SESSION"( "ANTI_CSRF_TOKEN" CHARACTER LARGE OBJECT COMMENT 'Anti-CSRF token for full-app embed sessions.' ); ALTER TABLE "PUBLIC"."CORE_SESSION" ADD CONSTRAINT "PUBLIC"."PK_CORE_SESSION" PRIMARY KEY("ID"); --- 10 +/- SELECT COUNT(*) FROM PUBLIC.CORE_SESSION; +-- 11 +/- SELECT COUNT(*) FROM PUBLIC.CORE_SESSION; INSERT INTO "PUBLIC"."CORE_SESSION" VALUES ('6116652b-052f-4bf1-bcff-826433e97aee', 1, TIMESTAMP '2023-02-24 15:12:36.88', NULL), ('0de105b0-917e-451b-8b32-28203fd0f848', 1, TIMESTAMP '2023-04-28 17:18:58.876', NULL), @@ -44341,7 +44344,8 @@ INSERT INTO "PUBLIC"."CORE_SESSION" VALUES ('423321ba-4c24-444e-8899-b7e98f6bdd81', 1, TIMESTAMP '2023-05-31 18:14:26.738', NULL), ('d7fc40ca-160a-417b-a27d-e869162fad35', 1, TIMESTAMP '2023-07-12 12:19:45.288', NULL), ('c2220621-50e0-4f5a-bba3-44cc40473f83', 1, TIMESTAMP '2023-08-25 18:23:58.526', NULL), -('25980fc8-e44d-44e7-83da-0acebfaa6260', 1, TIMESTAMP '2024-02-13 17:55:44.665374', NULL); +('25980fc8-e44d-44e7-83da-0acebfaa6260', 1, TIMESTAMP '2024-02-13 17:55:44.665374', NULL), +('6e7cc9e5-bf1c-4b36-a725-cae1a9b8de59', 1, TIMESTAMP '2024-10-21 18:05:52.332106', NULL); CREATE CACHED TABLE "PUBLIC"."CARD_LABEL"( "ID" INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 1) DEFAULT ON NULL NOT NULL, "CARD_ID" INTEGER NOT NULL, @@ -44399,7 +44403,7 @@ ALTER TABLE "PUBLIC"."TIMELINE" ADD CONSTRAINT "PUBLIC"."PK_TIMELINE" PRIMARY KE -- 0 +/- SELECT COUNT(*) FROM PUBLIC.TIMELINE; CREATE INDEX "PUBLIC"."IDX_TIMELINE_COLLECTION_ID" ON "PUBLIC"."TIMELINE"("COLLECTION_ID" NULLS FIRST); CREATE CACHED TABLE "PUBLIC"."LOGIN_HISTORY" COMMENT 'Keeps track of various logins for different users and additional info such as location and device'( - "ID" INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 70 RESTART WITH 71) DEFAULT ON NULL NOT NULL, + "ID" INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 70 RESTART WITH 72) DEFAULT ON NULL NOT NULL, "TIMESTAMP" TIMESTAMP WITH TIME ZONE DEFAULT LOCALTIMESTAMP COMMENT 'When this login occurred.' NOT NULL, "USER_ID" INTEGER COMMENT 'ID of the User that logged in.' NOT NULL, "SESSION_ID" CHARACTER VARYING(254) COMMENT 'ID of the Session created by this login if one is currently active. NULL if Session is no longer active.', @@ -44408,7 +44412,7 @@ CREATE CACHED TABLE "PUBLIC"."LOGIN_HISTORY" COMMENT 'Keeps track of various log "IP_ADDRESS" CHARACTER LARGE OBJECT COMMENT 'IP address of the device that login happened from, so we can geocode it and determine approximate location.' NOT NULL ); ALTER TABLE "PUBLIC"."LOGIN_HISTORY" ADD CONSTRAINT "PUBLIC"."PK_LOGIN_HISTORY" PRIMARY KEY("ID"); --- 39 +/- SELECT COUNT(*) FROM PUBLIC.LOGIN_HISTORY; +-- 40 +/- SELECT COUNT(*) FROM PUBLIC.LOGIN_HISTORY; INSERT INTO "PUBLIC"."LOGIN_HISTORY" VALUES (1, TIMESTAMP WITH TIME ZONE '2022-12-13 13:21:22.101+06', 1, NULL, '7d0562e3-c179-4a78-a5eb-213e25d46e3f', 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36', '0:0:0:0:0:0:0:1'), (2, TIMESTAMP WITH TIME ZONE '2022-12-13 16:31:23.178+06', 1, NULL, '7d0562e3-c179-4a78-a5eb-213e25d46e3f', 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36', '0:0:0:0:0:0:0:1'), @@ -44450,7 +44454,8 @@ INSERT INTO "PUBLIC"."LOGIN_HISTORY" VALUES (67, TIMESTAMP WITH TIME ZONE '2023-05-31 18:14:26.743+06', 1, '423321ba-4c24-444e-8899-b7e98f6bdd81', '789ec8a3-6225-4c9b-a76b-344b5be10249', 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36', '0:0:0:0:0:0:0:1'), (68, TIMESTAMP WITH TIME ZONE '2023-07-12 12:19:45.294+06', 1, 'd7fc40ca-160a-417b-a27d-e869162fad35', 'd53c110e-1004-4cc6-9a66-33ae0d36c29d', 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36', '0:0:0:0:0:0:0:1'), (69, TIMESTAMP WITH TIME ZONE '2023-08-25 18:23:58.533+06', 1, 'c2220621-50e0-4f5a-bba3-44cc40473f83', '92378e4c-de06-4768-b993-4faac7588c15', 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36', '0:0:0:0:0:0:0:1'), -(70, TIMESTAMP WITH TIME ZONE '2024-02-13 17:55:44.678231+06', 1, '25980fc8-e44d-44e7-83da-0acebfaa6260', 'bce26e1c-5ed9-4cf7-b4d3-f76bec15080c', 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36', '0:0:0:0:0:0:0:1'); +(70, TIMESTAMP WITH TIME ZONE '2024-02-13 17:55:44.678231+06', 1, '25980fc8-e44d-44e7-83da-0acebfaa6260', 'bce26e1c-5ed9-4cf7-b4d3-f76bec15080c', 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36', '0:0:0:0:0:0:0:1'), +(71, TIMESTAMP WITH TIME ZONE '2024-10-21 18:05:52.380595+06', 1, '6e7cc9e5-bf1c-4b36-a725-cae1a9b8de59', '5152ffab-9985-4989-99cb-feae116fb252', 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36', '0:0:0:0:0:0:0:1'); CREATE INDEX "PUBLIC"."IDX_USER_ID" ON "PUBLIC"."LOGIN_HISTORY"("USER_ID" NULLS FIRST); CREATE INDEX "PUBLIC"."IDX_SESSION_ID" ON "PUBLIC"."LOGIN_HISTORY"("SESSION_ID" NULLS FIRST); CREATE INDEX "PUBLIC"."IDX_TIMESTAMP" ON "PUBLIC"."LOGIN_HISTORY"("TIMESTAMP" NULLS FIRST); @@ -44514,7 +44519,7 @@ CREATE CACHED TABLE "PUBLIC"."PERSISTED_INFO" COMMENT 'Table holding information ALTER TABLE "PUBLIC"."PERSISTED_INFO" ADD CONSTRAINT "PUBLIC"."PK_PERSISTED_INFO" PRIMARY KEY("ID"); -- 0 +/- SELECT COUNT(*) FROM PUBLIC.PERSISTED_INFO; CREATE CACHED TABLE "PUBLIC"."QUERY_EXECUTION" COMMENT 'A log of executed queries, used for calculating historic execution times, auditing, and other purposes.'( - "ID" INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 65690 RESTART WITH 65780) DEFAULT ON NULL SELECTIVITY 100 NOT NULL, + "ID" INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 65690 RESTART WITH 65781) DEFAULT ON NULL SELECTIVITY 100 NOT NULL, "HASH" BINARY VARYING(32) SELECTIVITY 41 COMMENT 'The hash of the query dictionary. This is a 256-bit SHA3 hash of the query.' NOT NULL, "STARTED_AT" TIMESTAMP WITH TIME ZONE SELECTIVITY 98 NOT NULL, "RUNNING_TIME" INTEGER SELECTIVITY 8 COMMENT 'The time, in milliseconds, this query took to complete.' NOT NULL, @@ -44530,7 +44535,7 @@ CREATE CACHED TABLE "PUBLIC"."QUERY_EXECUTION" COMMENT 'A log of executed querie "CACHE_HIT" BOOLEAN SELECTIVITY 1 COMMENT 'Cache hit on query execution' ); ALTER TABLE "PUBLIC"."QUERY_EXECUTION" ADD CONSTRAINT "PUBLIC"."PK_QUERY_EXECUTION" PRIMARY KEY("ID"); --- 65732 +/- SELECT COUNT(*) FROM PUBLIC.QUERY_EXECUTION; +-- 65733 +/- SELECT COUNT(*) FROM PUBLIC.QUERY_EXECUTION; INSERT INTO "PUBLIC"."QUERY_EXECUTION" VALUES (1, X'4e593a1c0b2629377c681948968bd52751df0f1c012f9e646e4ec8bf70c66767', TIMESTAMP WITH TIME ZONE '2022-12-13 13:23:03.924082+06', 392, 4, FALSE, 'ad-hoc', NULL, 1, NULL, NULL, NULL, 2, FALSE), (2, X'02a64b3814e9e4302e8cf06c9a989abf3bc2bfe81d1cd7cd9bee2ea6dbd57907', TIMESTAMP WITH TIME ZONE '2022-12-13 13:33:10.417962+06', 60, 0, TRUE, 'ad-hoc', 'Command failed with error 2 (BadValue): ''$and/$or/$nor must be a nonempty array'' on server localhost:27017. The full response is { "ok" : 0.0, "errmsg" : "$and/$or/$nor must be a nonempty array", "code" : 2, "codeName" : "BadValue" }', 1, NULL, NULL, NULL, 2, NULL), @@ -113539,7 +113544,8 @@ INSERT INTO "PUBLIC"."QUERY_EXECUTION" VALUES (65776, X'5cf5fc5c3c3c843645c5e910f012cb742148b87c8ef87132147c495a6e119f2a', TIMESTAMP WITH TIME ZONE '2024-02-13 18:52:57.134936+06', 76, 1, TRUE, 'public-dashboard', NULL, 1, 12, 4, NULL, 3, FALSE), (65777, X'5cf5fc5c3c3c843645c5e910f012cb742148b87c8ef87132147c495a6e119f2a', TIMESTAMP WITH TIME ZONE '2024-02-13 18:52:57.134936+06', 78, 0, TRUE, 'public-dashboard', 'Broken pipe', 1, 12, 4, NULL, 3, NULL), (65778, X'5cf5fc5c3c3c843645c5e910f012cb742148b87c8ef87132147c495a6e119f2a', TIMESTAMP WITH TIME ZONE '2024-02-13 18:52:57.185185+06', 100, 1, TRUE, 'public-dashboard', NULL, 1, 12, 4, NULL, 3, FALSE), -(65779, X'84a26cba45697433b4d58e0272661e2fb56effec333d2c42018f8c67125f3b6e', TIMESTAMP WITH TIME ZONE '2024-02-13 18:52:57.18072+06', 105, 1, TRUE, 'public-dashboard', NULL, 1, 33, 4, NULL, 3, FALSE); +(65779, X'84a26cba45697433b4d58e0272661e2fb56effec333d2c42018f8c67125f3b6e', TIMESTAMP WITH TIME ZONE '2024-02-13 18:52:57.18072+06', 105, 1, TRUE, 'public-dashboard', NULL, 1, 33, 4, NULL, 3, FALSE), +(65780, X'85fcf68eb6a7ac8cc842f0b171e8606d01477276f0a89c5de54944db9a306b5a', TIMESTAMP WITH TIME ZONE '2024-10-21 18:05:58.037224+06', 335, 10, TRUE, 'question', NULL, 1, 20, NULL, NULL, 3, FALSE); CREATE INDEX "PUBLIC"."IDX_QUERY_EXECUTION_EXECUTOR_ID" ON "PUBLIC"."QUERY_EXECUTION"("EXECUTOR_ID" NULLS FIRST); CREATE INDEX "PUBLIC"."IDX_QUERY_EXECUTION_CARD_ID" ON "PUBLIC"."QUERY_EXECUTION"("CARD_ID" NULLS FIRST); CREATE INDEX "PUBLIC"."IDX_QUERY_EXECUTION_CARD_ID_STARTED_AT" ON "PUBLIC"."QUERY_EXECUTION"("CARD_ID" NULLS FIRST, "STARTED_AT" NULLS FIRST); @@ -113547,7 +113553,7 @@ CREATE INDEX "PUBLIC"."IDX_QUERY_EXECUTION_STARTED_AT" ON "PUBLIC"."QUERY_EXECUT CREATE INDEX "PUBLIC"."IDX_QUERY_EXECUTION_QUERY_HASH_STARTED_AT" ON "PUBLIC"."QUERY_EXECUTION"("HASH" NULLS FIRST, "STARTED_AT" NULLS FIRST); CREATE INDEX "PUBLIC"."IDX_QUERY_EXECUTION_CONTEXT" ON "PUBLIC"."QUERY_EXECUTION"("CONTEXT" NULLS FIRST); CREATE CACHED TABLE "PUBLIC"."VIEW_LOG"( - "ID" INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 59317 RESTART WITH 59384) DEFAULT ON NULL SELECTIVITY 100 NOT NULL, + "ID" INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 59317 RESTART WITH 59387) DEFAULT ON NULL SELECTIVITY 100 NOT NULL, "USER_ID" INTEGER SELECTIVITY 1, "MODEL" CHARACTER VARYING(16) SELECTIVITY 1 NOT NULL, "MODEL_ID" INTEGER SELECTIVITY 1 NOT NULL, @@ -113555,7 +113561,7 @@ CREATE CACHED TABLE "PUBLIC"."VIEW_LOG"( "METADATA" CHARACTER LARGE OBJECT COMMENT 'Serialized JSON corresponding to metadata for view.' ); ALTER TABLE "PUBLIC"."VIEW_LOG" ADD CONSTRAINT "PUBLIC"."PK_VIEW_LOG" PRIMARY KEY("ID"); --- 59297 +/- SELECT COUNT(*) FROM PUBLIC.VIEW_LOG; +-- 59300 +/- SELECT COUNT(*) FROM PUBLIC.VIEW_LOG; INSERT INTO "PUBLIC"."VIEW_LOG" VALUES (1, 1, 'table', 22, TIMESTAMP WITH TIME ZONE '2022-12-13 13:23:03.912+06', '{"cached":null,"ignore_cache":null}'), (2, 1, 'table', 22, TIMESTAMP WITH TIME ZONE '2022-12-13 13:40:18.942+06', '{"cached":null,"ignore_cache":null}'), @@ -174583,7 +174589,11 @@ INSERT INTO "PUBLIC"."VIEW_LOG" VALUES (59380, 1, 'card', 33, TIMESTAMP WITH TIME ZONE '2024-02-13 18:52:57.221817+06', '{"cached":null,"ignore_cache":false,"context":"public-dashboard"}'), (59381, 1, 'card', 12, TIMESTAMP WITH TIME ZONE '2024-02-13 18:52:57.246511+06', '{"cached":null,"ignore_cache":false,"context":"public-dashboard"}'), (59382, 1, 'card', 12, TIMESTAMP WITH TIME ZONE '2024-02-13 18:52:57.301279+06', '{"cached":null,"ignore_cache":false,"context":"public-dashboard"}'), -(59383, 1, 'card', 33, TIMESTAMP WITH TIME ZONE '2024-02-13 18:52:57.317383+06', '{"cached":null,"ignore_cache":false,"context":"public-dashboard"}'); +(59383, 1, 'card', 33, TIMESTAMP WITH TIME ZONE '2024-02-13 18:52:57.317383+06', '{"cached":null,"ignore_cache":false,"context":"public-dashboard"}'), +(59384, 1, 'card', 20, TIMESTAMP WITH TIME ZONE '2024-10-21 18:05:56.771572+06', '{"cached":null,"ignore_cache":null,"context":null}'); +INSERT INTO "PUBLIC"."VIEW_LOG" VALUES +(59385, 1, 'card', 20, TIMESTAMP WITH TIME ZONE '2024-10-21 18:05:56.850191+06', '{"cached":null,"ignore_cache":null,"context":null}'), +(59386, 1, 'card', 20, TIMESTAMP WITH TIME ZONE '2024-10-21 18:05:58.42072+06', '{"cached":null,"ignore_cache":false,"context":"question"}'); CREATE INDEX "PUBLIC"."IDX_VIEW_LOG_USER_ID" ON "PUBLIC"."VIEW_LOG"("USER_ID" NULLS FIRST); CREATE INDEX "PUBLIC"."IDX_VIEW_LOG_TIMESTAMP" ON "PUBLIC"."VIEW_LOG"("MODEL_ID" NULLS FIRST); CREATE CACHED TABLE "PUBLIC"."NATIVE_QUERY_SNIPPET" COMMENT 'Query snippets (raw text) to be substituted in native queries'( @@ -174730,13 +174740,13 @@ ALTER TABLE "PUBLIC"."QRTZ_CRON_TRIGGERS" ADD CONSTRAINT "PUBLIC"."PK_QRTZ_CRON_ INSERT INTO "PUBLIC"."QRTZ_CRON_TRIGGERS" VALUES ('MetabaseScheduler', 'metabase.task.update-field-values.trigger.3', 'DEFAULT', '0 0 2 * * ? *', 'GMT'), ('MetabaseScheduler', 'metabase.task.sync-and-analyze.trigger.3', 'DEFAULT', '0 49 * * * ? *', 'GMT'), -('MetabaseScheduler', 'metabase.task.upgrade-checks.trigger', 'DEFAULT', '0 15 6,18 * * ? *', 'Europe/Helsinki'), -('MetabaseScheduler', 'metabase.task.anonymous-stats.trigger', 'DEFAULT', '0 30 5 * * ? *', 'Europe/Helsinki'), -('MetabaseScheduler', 'metabase.task.refresh-channel-cache.trigger', 'DEFAULT', '0 31 0/4 1/1 * ? *', 'Europe/Helsinki'), -('MetabaseScheduler', 'metabase.task.send-pulses.trigger', 'DEFAULT', '0 0 * * * ? *', 'Europe/Helsinki'), -('MetabaseScheduler', 'metabase.task.follow-up-emails.trigger', 'DEFAULT', '0 0 12 * * ? *', 'Europe/Helsinki'), -('MetabaseScheduler', 'metabase.task.task-history-cleanup.trigger', 'DEFAULT', '0 0 * * * ? *', 'Europe/Helsinki'), -('MetabaseScheduler', 'metabase.task.truncate-audit-log.trigger', 'DEFAULT', '0 0 */12 * * ? *', 'Europe/Helsinki'); +('MetabaseScheduler', 'metabase.task.upgrade-checks.trigger', 'DEFAULT', '0 15 6,18 * * ? *', 'Asia/Dhaka'), +('MetabaseScheduler', 'metabase.task.anonymous-stats.trigger', 'DEFAULT', '0 20 7 * * ? *', 'Asia/Dhaka'), +('MetabaseScheduler', 'metabase.task.refresh-channel-cache.trigger', 'DEFAULT', '0 41 0/4 1/1 * ? *', 'Asia/Dhaka'), +('MetabaseScheduler', 'metabase.task.send-pulses.trigger', 'DEFAULT', '0 0 * * * ? *', 'Asia/Dhaka'), +('MetabaseScheduler', 'metabase.task.follow-up-emails.trigger', 'DEFAULT', '0 0 12 * * ? *', 'Asia/Dhaka'), +('MetabaseScheduler', 'metabase.task.task-history-cleanup.trigger', 'DEFAULT', '0 0 * * * ? *', 'Asia/Dhaka'), +('MetabaseScheduler', 'metabase.task.truncate-audit-log.trigger', 'DEFAULT', '0 0 */12 * * ? *', 'Asia/Dhaka'); CREATE CACHED TABLE "PUBLIC"."QRTZ_SIMPROP_TRIGGERS" COMMENT 'Used for Quartz scheduler.'( "SCHED_NAME" CHARACTER VARYING(120) NOT NULL, "TRIGGER_NAME" CHARACTER VARYING(200) NOT NULL, @@ -174836,7 +174846,7 @@ CREATE CACHED TABLE "PUBLIC"."QRTZ_SCHEDULER_STATE" COMMENT 'Used for Quartz sch ALTER TABLE "PUBLIC"."QRTZ_SCHEDULER_STATE" ADD CONSTRAINT "PUBLIC"."PK_QRTZ_SCHEDULER_STATE" PRIMARY KEY("SCHED_NAME", "INSTANCE_NAME"); -- 1 +/- SELECT COUNT(*) FROM PUBLIC.QRTZ_SCHEDULER_STATE; INSERT INTO "PUBLIC"."QRTZ_SCHEDULER_STATE" VALUES -('MetabaseScheduler', 'MacBook-Pro-16-inch-2231.local1709207031456', 1709207055623, 7500); +('MetabaseScheduler', 'dsi-Inspiron-15-55101729512150623', 1729512548765, 7500); CREATE CACHED TABLE "PUBLIC"."QRTZ_LOCKS" COMMENT 'Used for Quartz scheduler.'( "SCHED_NAME" CHARACTER VARYING(120) SELECTIVITY 50 NOT NULL, "LOCK_NAME" CHARACTER VARYING(40) SELECTIVITY 100 NOT NULL @@ -174900,7 +174910,7 @@ CREATE CACHED TABLE "PUBLIC"."CORE_USER"( ALTER TABLE "PUBLIC"."CORE_USER" ADD CONSTRAINT "PUBLIC"."PK_CORE_USER" PRIMARY KEY("ID"); -- 1 +/- SELECT COUNT(*) FROM PUBLIC.CORE_USER; INSERT INTO "PUBLIC"."CORE_USER" VALUES -(1, 'user@opencrvs.org', 'OpenCRVS', 'User', '$2a$10$wPjljujfMA74bY2gq8YWV.ZyBssybkKWm7xfaKDstwXlCYYvFMB6y', '635efd7e-ff74-4cc5-b460-95ee8523c5c5', TIMESTAMP '2022-12-13 12:23:43.64', TIMESTAMP '2024-02-13 17:55:44.720934', TRUE, TRUE, NULL, NULL, FALSE, FALSE, FALSE, NULL, TIMESTAMP '2024-02-13 18:52:57.314826', NULL, NULL, TRUE, '{"user-recent-views":"[{\"model\":\"card\",\"model_id\":33},{\"model\":\"card\",\"model_id\":12},{\"model\":\"card\",\"model_id\":20},{\"model\":\"card\",\"model_id\":27},{\"model\":\"table\",\"model_id\":70},{\"model\":\"table\",\"model_id\":71},{\"model\":\"table\",\"model_id\":69}]"}'); +(1, 'user@opencrvs.org', 'OpenCRVS', 'User', '$2a$10$7NsBEHbDYiBRar8OL0i2buFS2R511q01hxANLcItTj4t5FSBH0Rfq', 'cf395a7c-031c-4dc7-8204-20cb7e6cb838', TIMESTAMP '2022-12-13 12:23:43.64', TIMESTAMP '2024-10-21 18:05:52.619674', TRUE, TRUE, NULL, NULL, FALSE, FALSE, FALSE, NULL, TIMESTAMP '2024-10-21 18:05:58.415136', NULL, NULL, TRUE, '{"user-recent-views":"[{\"model\":\"card\",\"model_id\":20},{\"model\":\"card\",\"model_id\":33},{\"model\":\"card\",\"model_id\":12},{\"model\":\"card\",\"model_id\":27},{\"model\":\"table\",\"model_id\":70},{\"model\":\"table\",\"model_id\":71},{\"model\":\"table\",\"model_id\":69}]"}'); CREATE CACHED TABLE "PUBLIC"."REVISION"( "ID" INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 715) DEFAULT ON NULL NOT NULL, "MODEL" CHARACTER VARYING(16) NOT NULL, @@ -174966,10 +174976,10 @@ INSERT INTO "PUBLIC"."REVISION" VALUES (93, 'Dashboard', 1, 1, TIMESTAMP WITH TIME ZONE '2022-12-14 12:55:47.744+06', '{"description":null,"name":"Births registered by age of child","cache_ttl":null,"cards":[{"size_x":9,"size_y":5,"row":0,"col":0,"id":1,"card_id":1,"series":[]},{"size_x":9,"size_y":5,"row":0,"col":9,"id":2,"card_id":2,"series":[]},{"size_x":9,"size_y":5,"row":5,"col":9,"id":3,"card_id":3,"series":[]},{"size_x":9,"size_y":5,"row":5,"col":0,"id":4,"card_id":4,"series":[]}]}', FALSE, FALSE, NULL), (94, 'Dashboard', 1, 1, TIMESTAMP WITH TIME ZONE '2022-12-14 12:55:47.781+06', '{"description":null,"name":"Births registered by age of child","cache_ttl":null,"cards":[{"size_x":9,"size_y":5,"row":0,"col":0,"id":1,"card_id":1,"series":[]},{"size_x":9,"size_y":5,"row":0,"col":9,"id":2,"card_id":2,"series":[]},{"size_x":9,"size_y":5,"row":5,"col":9,"id":3,"card_id":3,"series":[]},{"size_x":9,"size_y":5,"row":5,"col":0,"id":4,"card_id":4,"series":[]}]}', FALSE, FALSE, NULL), (105, 'Card', 4, 1, TIMESTAMP WITH TIME ZONE '2022-12-14 15:27:06.514+06', '{"description":"Those who were under 1 year age at the time of registration (in bar chart)","archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Age under 5 Years","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterGender":{"id":"20e2c029-3679-018c-24d6-484d76a11d32","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"91aa0f89-bfc5-64ee-f07e-2f7b7e7ef6d9","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"00b3ab49-d6ce-c6cf-ae25-9b472e0ba093","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"accbacb5-9d7d-c299-3a26-20dd34d7f29e","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n \"childsAgeInDaysAtDeclaration\": {\n \"$lte\": 1825\n }\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n \"childsAgeInDaysAtDeclaration\": {\n \"$lte\": 1825\n }\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , { \"$group\": {\n \"_id\": {\n \"gender\": \"$gender\"\n },\n \"count\": {\n \"$sum\": 1\n },\n }\n },\n { \"$project\": {\n \"_id\": false,\n \"gender\": \"$_id.gender\",\n \"count\": true\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Gender'': \"$allInfo.gender\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }}\n]","collection":"analyticsRegistrations"},"type":"native"},"id":4,"parameter_mappings":[],"display":"bar","entity_id":"fln_xwOYWPvA6slmtJM8d","collection_preview":true,"visualization_settings":{"table.pivot_column":"Gender","table.cell_column":"Count","graph.dimensions":["Gender"],"graph.show_values":true,"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"20e2c029-3679-018c-24d6-484d76a11d32","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"91aa0f89-bfc5-64ee-f07e-2f7b7e7ef6d9","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"00b3ab49-d6ce-c6cf-ae25-9b472e0ba093","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"accbacb5-9d7d-c299-3a26-20dd34d7f29e","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(553, 0, '{"description":"Those who were under 1 year age at the time of registration","archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Age under 1 year","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterGender":{"id":"cb98e793-8e53-1c97-650e-a02494c83f92","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"5761782f-224e-a408-7ca4-53e2c8675c1a","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"b37cbcc8-2f00-7cbc-7fe7-f1bb06d7360b","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"afb955cd-8d16-cefa-b646-e9c72bfa71cf","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n \"childsAgeInDaysAtDeclaration\": {\n \"$lte\": 365\n }\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n \"childsAgeInDaysAtDeclaration\": {\n \"$lte\": 365\n }\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , { \"$group\": {\n \"_id\": {\n \"gender\": \"$gender\"\n },\n \"count\": {\n \"$sum\": 1\n },\n }\n },\n { \"$project\": {\n \"_id\": false,\n \"gender\": \"$_id.gender\",\n \"count\": true\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Gender'': \"$allInfo.gender\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }}\n]","collection":"analyticsRegistrations"},"type":"native"},"id":2,"parameter_mappings":[],"display":"bar","entity_id":"nbbCJ21ti500TiOUVV2tq","collection_preview":true,"visualization_settings":{"table.columns":[{"name":"Gender","fieldRef":["field","Gender",{"base-type":"type/Text"}],"enabled":true},{"name":"Count","fieldRef":["field","Count",{"base-type":"type/Integer"}],"enabled":true},{"name":"Percentage","fieldRef":["field","Percentage",{"base-type":"type/Float"}],"enabled":true}],"table.pivot_column":"count","table.cell_column":"Gender","graph.dimensions":["Gender"],"graph.series_order_dimension":null,"graph.series_order":null,"graph.show_values":true,"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"cb98e793-8e53-1c97-650e-a02494c83f92","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"5761782f-224e-a408-7ca4-53e2c8675c1a","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"b37cbcc8-2f00-7cbc-7fe7-f1bb06d7360b","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"afb955cd-8d16-cefa-b646-e9c72bfa71cf","type":"string/=","target":["dimension",["', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(553, 1, 'template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(554, 0, '{"description":"Those who were under 1 year age at the time of registration","archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Age under 1 year","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterGender":{"id":"cb98e793-8e53-1c97-650e-a02494c83f92","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"5761782f-224e-a408-7ca4-53e2c8675c1a","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"b37cbcc8-2f00-7cbc-7fe7-f1bb06d7360b","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"afb955cd-8d16-cefa-b646-e9c72bfa71cf","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n \"childsAgeInDaysAtDeclaration\": {\n \"$lte\": 365\n }\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n \"childsAgeInDaysAtDeclaration\": {\n \"$lte\": 365\n }\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , { \"$group\": {\n \"_id\": {\n \"gender\": \"$gender\"\n },\n \"count\": {\n \"$sum\": 1\n },\n }\n },\n { \"$project\": {\n \"_id\": false,\n \"gender\": \"$_id.gender\",\n \"count\": true\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Gender'': \"$allInfo.gender\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }}\n]","collection":"analyticsRegistrations"},"type":"native"},"id":2,"parameter_mappings":[],"display":"bar","entity_id":"nbbCJ21ti500TiOUVV2tq","collection_preview":true,"visualization_settings":{"table.columns":[{"name":"Gender","fieldRef":["field","Gender",{"base-type":"type/Text"}],"enabled":true},{"name":"Count","fieldRef":["field","Count",{"base-type":"type/Integer"}],"enabled":true},{"name":"Percentage","fieldRef":["field","Percentage",{"base-type":"type/Float"}],"enabled":true}],"table.pivot_column":"count","table.cell_column":"Gender","graph.dimensions":["Gender"],"graph.series_order_dimension":null,"graph.series_order":null,"graph.show_values":true,"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"cb98e793-8e53-1c97-650e-a02494c83f92","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"5761782f-224e-a408-7ca4-53e2c8675c1a","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"b37cbcc8-2f00-7cbc-7fe7-f1bb06d7360b","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"afb955cd-8d16-cefa-b646-e9c72bfa71cf","type":"string/=","target":["dimension",["', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(554, 1, 'template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); INSERT INTO "PUBLIC"."REVISION" VALUES -(106, 'Card', 2, 1, TIMESTAMP WITH TIME ZONE '2022-12-14 15:28:48.448+06', SYSTEM_COMBINE_CLOB(553), FALSE, FALSE, NULL), +(106, 'Card', 2, 1, TIMESTAMP WITH TIME ZONE '2022-12-14 15:28:48.448+06', SYSTEM_COMBINE_CLOB(554), FALSE, FALSE, NULL), (107, 'Card', 4, 1, TIMESTAMP WITH TIME ZONE '2022-12-14 15:29:11.779+06', '{"description":"Those who were under 1 year age at the time of registration (in bar chart)","archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Age under 5 years","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterGender":{"id":"20e2c029-3679-018c-24d6-484d76a11d32","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"91aa0f89-bfc5-64ee-f07e-2f7b7e7ef6d9","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"00b3ab49-d6ce-c6cf-ae25-9b472e0ba093","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"accbacb5-9d7d-c299-3a26-20dd34d7f29e","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n \"childsAgeInDaysAtDeclaration\": {\n \"$lte\": 1825\n }\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n \"childsAgeInDaysAtDeclaration\": {\n \"$lte\": 1825\n }\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , { \"$group\": {\n \"_id\": {\n \"gender\": \"$gender\"\n },\n \"count\": {\n \"$sum\": 1\n },\n }\n },\n { \"$project\": {\n \"_id\": false,\n \"gender\": \"$_id.gender\",\n \"count\": true\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Gender'': \"$allInfo.gender\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }}\n]","collection":"analyticsRegistrations"},"type":"native"},"id":4,"parameter_mappings":[],"display":"bar","entity_id":"fln_xwOYWPvA6slmtJM8d","collection_preview":true,"visualization_settings":{"table.pivot_column":"Gender","table.cell_column":"Count","graph.dimensions":["Gender"],"graph.show_values":true,"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"20e2c029-3679-018c-24d6-484d76a11d32","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"91aa0f89-bfc5-64ee-f07e-2f7b7e7ef6d9","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"00b3ab49-d6ce-c6cf-ae25-9b472e0ba093","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"accbacb5-9d7d-c299-3a26-20dd34d7f29e","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL); INSERT INTO "PUBLIC"."REVISION" VALUES (110, 'Card', 10, 1, TIMESTAMP WITH TIME ZONE '2022-12-14 18:42:08.065+06', '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Total Registrations","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$match: {\n $and: [\n {_id: {$ne: null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {$group: { \n _id: {}\n , totalCount: {$sum: NumberInt(1)}\n }} \n , {$project: { \n _id : NumberInt(0)\n , totalRegistrations: \"$totalCount\"\n }}\n]","template-tags":{"filterGender":{"id":"053e22d6-e6e4-b616-8a72-cd33a1476315","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"cda8c18e-0863-d59e-4846-e6622917d67e","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"65249c37-7695-8cb3-8e07-7083a1b456a4","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"eefc749d-e0cc-e166-a295-d9c52e783c05","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null}}},"database":2},"id":10,"parameter_mappings":[],"display":"scalar","entity_id":"BKDzBlQYMhO5wQWhVbytt","collection_preview":true,"visualization_settings":{},"is_write":false,"parameters":[{"id":"053e22d6-e6e4-b616-8a72-cd33a1476315","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"cda8c18e-0863-d59e-4846-e6622917d67e","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"65249c37-7695-8cb3-8e07-7083a1b456a4","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"eefc749d-e0cc-e166-a295-d9c52e783c05","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', FALSE, TRUE, NULL), @@ -174985,110 +174995,110 @@ INSERT INTO "PUBLIC"."REVISION" VALUES (201, 'Card', 15, 1, TIMESTAMP WITH TIME ZONE '2022-12-16 12:08:12.815+00', '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":null,"query_type":"native","name":"Filter date test","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterDate":{"id":"feb3ffd2-fa2c-0881-9f28-a1b401cb4715","name":"filterDate","display-name":"Filterdate","type":"date","default":null}},"query":"[{$project: {foo: ''[[{{filterDate}}]]''}}]","collection":"analyticsRegistrations"},"type":"native"},"id":15,"parameter_mappings":[],"display":"table","entity_id":"1z0T_0BESRBrkEWYBglCm","collection_preview":true,"visualization_settings":{"table.pivot_column":"foo","table.cell_column":"_id"},"is_write":false,"parameters":[{"id":"feb3ffd2-fa2c-0881-9f28-a1b401cb4715","type":"date/single","target":["variable",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', FALSE, TRUE, NULL), (205, 'Card', 15, 1, TIMESTAMP WITH TIME ZONE '2022-12-16 12:11:58.979+00', '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":null,"query_type":"native","name":"Filter date test","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterDate":{"id":"feb3ffd2-fa2c-0881-9f28-a1b401cb4715","name":"filterDate","display-name":"Filterdate","type":"dimension","default":null,"dimension":["field",354,null],"widget-type":"string/="}},"query":"[{$project: {foo: ''[[{{filterDate}}]]''}}]","collection":"analyticsRegistrations"},"type":"native"},"id":15,"parameter_mappings":[],"display":"table","entity_id":"1z0T_0BESRBrkEWYBglCm","collection_preview":true,"visualization_settings":{"table.pivot_column":"foo","table.cell_column":"_id"},"is_write":false,"parameters":[{"id":"feb3ffd2-fa2c-0881-9f28-a1b401cb4715","type":"string/=","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL), (207, 'Card', 15, 1, TIMESTAMP WITH TIME ZONE '2022-12-16 12:13:28.888+00', '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":null,"query_type":"native","name":"Filter date test","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterFrom":{"id":"feb3ffd2-fa2c-0881-9f28-a1b401cb4715","name":"filterFrom","display-name":"Filterfrom","type":"date","default":null},"filterTo":{"id":"0d4ae775-ae4b-95a3-6342-771cd1b8f66e","name":"filterTo","display-name":"Filterto","type":"date","default":null}},"query":"[{$project: {foo: ''[[{{filterFrom}}]] - [[{{filterTo}}]]''}}]","collection":"analyticsRegistrations"},"type":"native"},"id":15,"parameter_mappings":[],"display":"table","entity_id":"1z0T_0BESRBrkEWYBglCm","collection_preview":true,"visualization_settings":{"table.pivot_column":"foo","table.cell_column":"_id"},"is_write":false,"parameters":[{"id":"feb3ffd2-fa2c-0881-9f28-a1b401cb4715","type":"date/single","target":["variable",["template-tag","filterFrom"]],"name":"Filterfrom","slug":"filterFrom"},{"id":"0d4ae775-ae4b-95a3-6342-771cd1b8f66e","type":"date/single","target":["variable",["template-tag","filterTo"]],"name":"Filterto","slug":"filterTo"}],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(554, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by age","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"query":"[\n {\n $facet: {\n totals: [{ $count: ''total'' }, { $addFields: { category: ''Total'' } }],\n ageGroups: [\n {\n $match: {\n $and: [\n { _id: { $ne: null } }\n [[{{ filterGender }} ]]\n [[{{ filterEvent }}]]\n [[{{ filterState }}]]\n [[{{ filterOffice }}]]\n ]\n }\n },\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 365] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''Under 1''\n },\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 1825] },\n { $gte: [''$childsAge'', 365] }\n ]\n },\n then: ''Under 5''\n }\n ],\n default: ''Over 5''\n }\n }\n }\n },\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n category: ''$_id.par'',\n total: ''$totalCustomer''\n }\n }\n ]\n }\n },\n {\n $project: {\n mergedArray: { $concatArrays: [''$totals'', ''$ageGroups''] }\n }\n },\n { $unwind: ''$mergedArray'' },\n { $replaceRoot: { newRoot: ''$mergedArray'' } },\n {\n $sort: {\n category: 1\n }\n }\n ]\n ","collection":"analyticsRegistrations","template-tags":{"filterGender":{"id":"46d35bb0-9f4f-a718-3a30-c67b33ebfbbd","name":"filterGender","display-name":"Filtergender","type":"text"},"filterEvent":{"id":"1e389631-be8c-fe8d-ce92-18066d89fb39","name":"filterEvent","display-name":"Filterevent","type":"text"},"filterState":{"id":"ba70e3f4-7b8e-02e5-2762-8e2174e0b651","name":"filterState","display-name":"Filterstate","type":"text"},"filterOffice":{"id":"d700b567-972d-4291-274e-1fb46830afc1","name":"filterOffice","display-name":"Filteroffice","type":"text"}}},"type":"native"},"id":11,"parameter_mappings":[],"display":"table","entity_id":"g6QTDGvlih9yRnNCJqvy9","collection_preview":true,"visualization_settings":{"graph.show_values":true,"graph.x_axis.labels_enabled":false,"table.cell_column":"total","graph.series_order_dimension":null,"graph.y_axis.labels_enabled":false,"graph.label_value_frequency":"fit","graph.metrics":["total"],"graph.y_axis.axis_enabled":true,"table.column_formatting":[{"columns":[],"type":"single","operator":"=","value":"","color":"#509EE3","highlight_row":false}],"graph.label_value_formatting":"auto","graph.series_order":null,"table.pivot_column":"category","column_settings":{"[\"name\",\"Total\"]":{"show_mini_bar":false}},"graph.dimensions":["category"]},"is_write":false,"parameters":[{"id":"46d35bb0-9f4f-a718-3a30-c67b33ebfbbd","type":"category","target":["variable",["template-tag","filterGender"]],"name":"Filtergender","slug":"filterGender"},{"id":"1e389631-be8c-fe8d-ce92-18066d89fb39","type":"category","target":["variable",["template-tag","filt', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(554, 1, 'erEvent"]],"name":"Filterevent","slug":"filterEvent"},{"id":"ba70e3f4-7b8e-02e5-2762-8e2174e0b651","type":"category","target":["variable",["template-tag","filterState"]],"name":"Filterstate","slug":"filterState"},{"id":"d700b567-972d-4291-274e-1fb46830afc1","type":"category","target":["variable",["template-tag","filterOffice"]],"name":"Filteroffice","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(555, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by age","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"query":"[\n {\n $facet: {\n totals: [{ $count: ''total'' }, { $addFields: { category: ''Total'' } }],\n ageGroups: [\n {\n $match: {\n $and: [{ _id: { $ne: null } }\n [[{{ filterGender }} ]]\n [[{{ filterEvent }}]]\n [[{{ filterState }}]]\n [[{{ filterOffice }}]]\n ]\n }\n },\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 365] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''Under 1''\n },\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 1825] },\n { $gte: [''$childsAge'', 365] }\n ]\n },\n then: ''Under 5''\n }\n ],\n default: ''Over 5''\n }\n }\n }\n },\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n category: ''$_id.par'',\n total: ''$totalCustomer''\n }\n }\n ]\n }\n },\n {\n $project: {\n mergedArray: { $concatArrays: [''$totals'', ''$ageGroups''] }\n }\n },\n { $unwind: ''$mergedArray'' },\n { $replaceRoot: { newRoot: ''$mergedArray'' } },\n {\n $addFields: {\n order: {\n $cond: {\n if: { $eq: [''$category'', ''Total''] },\n then: 1,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''Under 1''] },\n then: 2,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''Under 5''] },\n then: 3,\n else: 4\n }\n }\n }\n }\n }\n }\n }\n },\n {\n $sort: {\n order: 1\n }\n },\n { $project: { total: 1, category: 1 } }\n]","collection":"analyticsRegistrations","template-tags":{"filterGender":{"id":"46d35bb0-9f4f-a718-3a30-c67b33ebfbbd","name":"filterGender","display-name":"Filtergender","type":"text"},"filterEvent":{"id":"1e389631-be8c-fe8d-ce92-18066d89fb39","name":"filterEvent","display-name":"Filterevent","type":"text"},"filterState":{"id":"ba70e3f4-7b8e-02e5-2762-8e2174e0b651","name":"filterState","display-name":"Filterstate","type":"text"},"filterOffice":{"id":"d700b567-972d-4291-274e-1fb46830afc1","name":"filterOffice","display-name":"Filteroffice","type":"text"}}},"type":"native"},"id":11,"parameter_mappings":[],"display":"table","entity_id":"g6QTDGvlih9yRnNCJqvy9","collection_preview":true,"visualization_settings":{"graph.show_values":true,"graph.x_axis.labels_enabled":false,"table.cell_column":"total","graph.series_order_dimension":null,"graph.y_axis.labels_enabled":false,"graph.label_value_frequency":"fit","graph.metrics":["total"],"graph.y_axis.axis_enabled":true,"table.column_formatting":[{"columns":[],"type":"single","operator":"=","value":"","color":"#509EE3","highlight_row":false}],"graph.label_value_formatting":"auto","graph.series_order":null,"table.pivot_column":"category","column_settings":{"[\"name\",\"Total\"]":{"s', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(555, 1, 'how_mini_bar":false}},"graph.dimensions":["category"]},"is_write":false,"parameters":[{"id":"46d35bb0-9f4f-a718-3a30-c67b33ebfbbd","type":"category","target":["variable",["template-tag","filterGender"]],"name":"Filtergender","slug":"filterGender"},{"id":"1e389631-be8c-fe8d-ce92-18066d89fb39","type":"category","target":["variable",["template-tag","filterEvent"]],"name":"Filterevent","slug":"filterEvent"},{"id":"ba70e3f4-7b8e-02e5-2762-8e2174e0b651","type":"category","target":["variable",["template-tag","filterState"]],"name":"Filterstate","slug":"filterState"},{"id":"d700b567-972d-4291-274e-1fb46830afc1","type":"category","target":["variable",["template-tag","filterOffice"]],"name":"Filteroffice","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(556, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by age","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"query":"[\n {\n $facet: {\n totals: [{ $count: ''total'' }, { $addFields: { category: ''Total'' } }],\n ageGroups: [\n {\n $match: {\n $and: [{ _id: { $ne: null } }\n [[{{ filterGender }} ]]\n [[{{ filterEvent }}]]\n [[{{ filterState }}]]\n [[{{ filterOffice }}]]\n ]\n }\n },\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 365] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''Under 1''\n },\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 1825] },\n { $gte: [''$childsAge'', 365] }\n ]\n },\n then: ''Under 5''\n }\n ],\n default: ''Over 5''\n }\n }\n }\n },\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n category: ''$_id.par'',\n total: ''$totalCustomer''\n }\n }\n ]\n }\n },\n {\n $project: {\n mergedArray: { $concatArrays: [''$totals'', ''$ageGroups''] }\n }\n },\n { $unwind: ''$mergedArray'' },\n { $replaceRoot: { newRoot: ''$mergedArray'' } },\n {\n $addFields: {\n order: {\n $cond: {\n if: { $eq: [''$category'', ''Total''] },\n then: 1,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''Under 1''] },\n then: 2,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''Under 5''] },\n then: 3,\n else: 4\n }\n }\n }\n }\n }\n }\n }\n },\n {\n $sort: {\n order: 1\n }\n },\n { $project: { total: 1, category: 1 } }\n]","collection":"analyticsRegistrations","template-tags":{"filterGender":{"id":"46d35bb0-9f4f-a718-3a30-c67b33ebfbbd","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null},"filterEvent":{"id":"1e389631-be8c-fe8d-ce92-18066d89fb39","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null},"filterState":{"id":"ba70e3f4-7b8e-02e5-2762-8e2174e0b651","name":"filterState","display-name":"Filterstate","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"d700b567-972d-4291-274e-1fb46830afc1","name":"filterOffice","display-name":"Filteroffice","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null}}},"type":"native"},"id":11,"parameter_mappings":[],"display":"table","entity_id":"g6QTDGvlih9yRnNCJqvy9","collection_preview":true,"visualization_settings":{"graph.show_values":true,"graph.x_axis.labels_enabled":false,"table.cell_column":"total","graph.series_order_dimension":null,"graph.y_axis.labels_enabled":false,"graph.label_value_frequency":"fit","graph.metrics":["t', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(556, 1, 'otal"],"graph.y_axis.axis_enabled":true,"table.column_formatting":[{"columns":[],"type":"single","operator":"=","value":"","color":"#509EE3","highlight_row":false}],"graph.label_value_formatting":"auto","graph.series_order":null,"table.pivot_column":"category","column_settings":{"[\"name\",\"Total\"]":{"show_mini_bar":false}},"graph.dimensions":["category"]},"is_write":false,"parameters":[{"id":"46d35bb0-9f4f-a718-3a30-c67b33ebfbbd","type":"date/month-year","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"1e389631-be8c-fe8d-ce92-18066d89fb39","type":"date/month-year","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"ba70e3f4-7b8e-02e5-2762-8e2174e0b651","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"Filterstate","slug":"filterState"},{"id":"d700b567-972d-4291-274e-1fb46830afc1","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Filteroffice","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(557, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by age","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterGender":{"id":"46d35bb0-9f4f-a718-3a30-c67b33ebfbbd","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null},"filterEvent":{"id":"1e389631-be8c-fe8d-ce92-18066d89fb39","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"ba70e3f4-7b8e-02e5-2762-8e2174e0b651","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"d700b567-972d-4291-274e-1fb46830afc1","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null}},"collection":"analyticsRegistrations","query":"[\n {\n $facet: {\n totals: [{ $count: ''total'' }, { $addFields: { category: ''Total'' } }],\n ageGroups: [\n {\n $match: {\n $and: [{ _id: { $ne: null } }\n [[{{ filterGender }} ]]\n [[{{ filterEvent }}]]\n [[{{ filterState }}]]\n [[{{ filterOffice }}]]\n ]\n }\n },\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 365] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''Under 1''\n },\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 1825] },\n { $gte: [''$childsAge'', 365] }\n ]\n },\n then: ''Under 5''\n }\n ],\n default: ''Over 5''\n }\n }\n }\n },\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n category: ''$_id.par'',\n total: ''$totalCustomer''\n }\n }\n ]\n }\n },\n {\n $project: {\n mergedArray: { $concatArrays: [''$totals'', ''$ageGroups''] }\n }\n },\n { $unwind: ''$mergedArray'' },\n { $replaceRoot: { newRoot: ''$mergedArray'' } },\n {\n $addFields: {\n order: {\n $cond: {\n if: { $eq: [''$category'', ''Total''] },\n then: 1,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''Under 1''] },\n then: 2,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''Under 5''] },\n then: 3,\n else: 4\n }\n }\n }\n }\n }\n }\n }\n },\n {\n $sort: {\n order: 1\n }\n },\n { $project: { total: 1, category: 1 } }\n]"},"database":2},"id":11,"parameter_mappings":[],"display":"table","entity_id":"g6QTDGvlih9yRnNCJqvy9","collection_preview":true,"visualization_settings":{"graph.show_values":true,"graph.x_axis.labels_enabled":false,"table.cell_column":"total","graph.series_order_dimension":null,"graph.y_axis.labels_enabled":false,"graph.label_value_frequency":"fit","graph.metrics":["total"],"graph.y_axi', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(557, 1, 's.axis_enabled":true,"table.column_formatting":[{"columns":[],"type":"single","operator":"=","value":"","color":"#509EE3","highlight_row":false}],"graph.label_value_formatting":"auto","graph.series_order":null,"table.pivot_column":"category","column_settings":{"[\"name\",\"Total\"]":{"show_mini_bar":false}},"graph.dimensions":["category"]},"is_write":false,"parameters":[{"id":"46d35bb0-9f4f-a718-3a30-c67b33ebfbbd","type":"date/month-year","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"1e389631-be8c-fe8d-ce92-18066d89fb39","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"ba70e3f4-7b8e-02e5-2762-8e2174e0b651","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"d700b567-972d-4291-274e-1fb46830afc1","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(558, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by age","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterGender":{"id":"46d35bb0-9f4f-a718-3a30-c67b33ebfbbd","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null},"filterEvent":{"id":"1e389631-be8c-fe8d-ce92-18066d89fb39","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"ba70e3f4-7b8e-02e5-2762-8e2174e0b651","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"d700b567-972d-4291-274e-1fb46830afc1","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null}},"collection":"analyticsRegistrations","query":"[\n {\n $facet: {\n totals: [{ $count: ''total'' }, { $addFields: { category: ''Total'' } }],\n ageGroups: [\n {\n $match: {\n $and: [{ _id: { $ne: null } }\n [[{{ filterGender }} ]]\n [[{{ filterEvent }}]]\n [[{{ filterState }}]]\n [[{{ filterOffice }}]]\n ]\n }\n },\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 365] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''Under 1''\n },\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 1825] },\n { $gte: [''$childsAge'', 365] }\n ]\n },\n then: ''Under 5''\n }\n ],\n default: ''Over 5''\n }\n }\n }\n },\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n category: ''$_id.par'',\n total: ''$totalCustomer''\n }\n }\n ]\n }\n },\n {\n $project: {\n mergedArray: { $concatArrays: [''$totals'', ''$ageGroups''] }\n }\n },\n { $unwind: ''$mergedArray'' },\n { $replaceRoot: { newRoot: ''$mergedArray'' } },\n {\n $addFields: {\n order: {\n $cond: {\n if: { $eq: [''$category'', ''Total''] },\n then: 1,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''Under 1''] },\n then: 2,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''Under 5''] },\n then: 3,\n else: 4\n }\n }\n }\n }\n }\n }\n }\n },\n {\n $sort: {\n order: 1\n }\n },\n { $project: { total: 1, category: 1 } }\n]"},"database":2},"id":11,"parameter_mappings":[],"display":"bar","entity_id":"g6QTDGvlih9yRnNCJqvy9","collection_preview":true,"visualization_settings":{"graph.show_values":true,"graph.x_axis.labels_enabled":false,"table.cell_column":"total","graph.series_order_dimension":null,"graph.y_axis.labels_enabled":false,"graph.label_value_frequency":"fit","graph.metrics":["total"],"graph.y_axis.', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(558, 1, 'axis_enabled":true,"table.column_formatting":[{"columns":[],"type":"single","operator":"=","value":"","color":"#509EE3","highlight_row":false}],"graph.label_value_formatting":"auto","graph.series_order":null,"table.pivot_column":"category","column_settings":{"[\"name\",\"Total\"]":{"show_mini_bar":false}},"graph.dimensions":["category"]},"is_write":false,"parameters":[{"id":"46d35bb0-9f4f-a718-3a30-c67b33ebfbbd","type":"date/month-year","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"1e389631-be8c-fe8d-ce92-18066d89fb39","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"ba70e3f4-7b8e-02e5-2762-8e2174e0b651","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"d700b567-972d-4291-274e-1fb46830afc1","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(559, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by gender","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterGender":{"id":"714d5902-296d-8cee-ed3c-103c588a855a","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"90028ce9-3f5d-246a-8b0e-9221adb5128a","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"8f889b01-8027-df24-1000-aa0e7cd2123e","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"1b5d8679-3ac1-295e-94c5-709031bb6279","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"bb02d443-ba05-0c59-5887-eb51b5e72b90","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , { \"$group\": {\n \"_id\": {\n \"gender\": \"$gender\"\n },\n \"count\": {\n \"$sum\": 1\n },\n }\n },\n { \"$project\": {\n \"_id\": false,\n \"gender\": \"$_id.gender\",\n \"count\": true\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Gender'': \"$allInfo.gender\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }}\n]","collection":"analyticsRegistrations"},"type":"native"},"id":1,"parameter_mappings":[],"display":"bar","entity_id":"Ksk2s3aUAdBmDtMTNwtH3","collection_preview":true,"visualization_settings":{"table.columns":[{"name":"Gender","fieldRef":["field","Gender",{"base-type":"type/Text"}],"enabled":true},{"name":"Count","fieldRef":["field","Count",{"base-type":"type/Integer"}],"enabled":true},{"name":"Percentage","fieldRef":["field","Percentage",{"base-type":"type/Float"}],"enabled":true}],"table.pivot_column":"count","table.cell_column":"Gender","graph.dimensions":["Gender"],"graph.show_goal":false,"graph.show_values":true,"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"714d5902-296d-8cee-ed3c-103c588a855a","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"90028ce9-3f5d-246a-8b0e-9221adb5128a","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"8f889b01-8027-df24-1000-aa0e7cd2123e","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"1b5d8679-3ac1-295e-94c5-709031bb6279","type":"string/=","target":["dimension",["template-t', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(559, 1, 'ag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"bb02d443-ba05-0c59-5887-eb51b5e72b90","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(560, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by gender","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterGender":{"id":"714d5902-296d-8cee-ed3c-103c588a855a","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"90028ce9-3f5d-246a-8b0e-9221adb5128a","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"8f889b01-8027-df24-1000-aa0e7cd2123e","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"1b5d8679-3ac1-295e-94c5-709031bb6279","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"bb02d443-ba05-0c59-5887-eb51b5e72b90","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , { \"$group\": {\n \"_id\": {\n \"gender\": \"$gender\"\n },\n \"count\": {\n \"$sum\": 1\n },\n }\n },\n { \"$project\": {\n \"_id\": false,\n \"gender\": \"$_id.gender\",\n \"count\": true\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Gender'': \"$allInfo.gender\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }}\n]","collection":"analyticsRegistrations"},"type":"native"},"id":1,"parameter_mappings":[],"display":"table","entity_id":"Ksk2s3aUAdBmDtMTNwtH3","collection_preview":true,"visualization_settings":{"table.columns":[{"name":"Gender","fieldRef":["field","Gender",{"base-type":"type/Text"}],"enabled":true},{"name":"Count","fieldRef":["field","Count",{"base-type":"type/Integer"}],"enabled":true},{"name":"Percentage","fieldRef":["field","Percentage",{"base-type":"type/Float"}],"enabled":true}],"table.pivot_column":"count","table.cell_column":"Gender","graph.dimensions":["Gender"],"graph.show_goal":false,"graph.show_values":true,"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"714d5902-296d-8cee-ed3c-103c588a855a","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"90028ce9-3f5d-246a-8b0e-9221adb5128a","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"8f889b01-8027-df24-1000-aa0e7cd2123e","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"1b5d8679-3ac1-295e-94c5-709031bb6279","type":"string/=","target":["dimension",["template', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(560, 1, '-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"bb02d443-ba05-0c59-5887-eb51b5e72b90","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(561, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by gender","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterGender":{"id":"714d5902-296d-8cee-ed3c-103c588a855a","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"90028ce9-3f5d-246a-8b0e-9221adb5128a","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"8f889b01-8027-df24-1000-aa0e7cd2123e","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"1b5d8679-3ac1-295e-94c5-709031bb6279","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"bb02d443-ba05-0c59-5887-eb51b5e72b90","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , { \"$group\": {\n \"_id\": {\n \"gender\": \"$gender\"\n },\n \"count\": {\n \"$sum\": 1\n },\n }\n },\n { \"$project\": {\n \"_id\": false,\n \"gender\": \"$_id.gender\",\n \"count\": true\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Gender'': \"$allInfo.gender\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }}\n]","collection":"analyticsRegistrations"},"type":"native"},"id":1,"parameter_mappings":[],"display":"bar","entity_id":"Ksk2s3aUAdBmDtMTNwtH3","collection_preview":true,"visualization_settings":{"table.columns":[{"name":"Gender","fieldRef":["field","Gender",{"base-type":"type/Text"}],"enabled":true},{"name":"Count","fieldRef":["field","Count",{"base-type":"type/Integer"}],"enabled":true},{"name":"Percentage","fieldRef":["field","Percentage",{"base-type":"type/Float"}],"enabled":true}],"table.pivot_column":"count","table.cell_column":"Gender","graph.dimensions":["Gender"],"graph.show_goal":false,"graph.show_values":true,"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"714d5902-296d-8cee-ed3c-103c588a855a","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"90028ce9-3f5d-246a-8b0e-9221adb5128a","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"8f889b01-8027-df24-1000-aa0e7cd2123e","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"1b5d8679-3ac1-295e-94c5-709031bb6279","type":"string/=","target":["dimension",["template-t', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(561, 1, 'ag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"bb02d443-ba05-0c59-5887-eb51b5e72b90","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(562, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by age","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"query":"[\n {\n $facet: {\n totals: [{ $count: ''total'' }, { $addFields: { category: ''Total'' } }],\n ageGroups: [\n {\n $match: {\n $and: [{ _id: { $ne: null } }\n [[{{ filterDate }} ]]\n [[{{ filterGender }} ]]\n [[{{ filterEvent }}]]\n [[{{ filterState }}]]\n [[{{ filterOffice }}]]\n ]\n }\n },\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 365] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''Under 1''\n },\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 1825] },\n { $gte: [''$childsAge'', 365] }\n ]\n },\n then: ''Under 5''\n }\n ],\n default: ''Over 5''\n }\n }\n }\n },\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n category: ''$_id.par'',\n total: ''$totalCustomer''\n }\n }\n ]\n }\n },\n {\n $project: {\n mergedArray: { $concatArrays: [''$totals'', ''$ageGroups''] }\n }\n },\n { $unwind: ''$mergedArray'' },\n { $replaceRoot: { newRoot: ''$mergedArray'' } },\n {\n $addFields: {\n order: {\n $cond: {\n if: { $eq: [''$category'', ''Total''] },\n then: 1,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''Under 1''] },\n then: 2,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''Under 5''] },\n then: 3,\n else: 4\n }\n }\n }\n }\n }\n }\n }\n },\n {\n $sort: {\n order: 1\n }\n },\n { $project: { total: 1, category: 1 } }\n]","collection":"analyticsRegistrations","template-tags":{"filterGender":{"id":"46d35bb0-9f4f-a718-3a30-c67b33ebfbbd","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null},"filterEvent":{"id":"1e389631-be8c-fe8d-ce92-18066d89fb39","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"ba70e3f4-7b8e-02e5-2762-8e2174e0b651","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"d700b567-972d-4291-274e-1fb46830afc1","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"ea45ef14-a48c-031a-9105-1d97f9a69f69","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}}},"type":"native"},"id":11,"parameter_mappings":[],"display":"bar","entity_id":"g6QTDGvlih9yRnNCJqvy9","collection_preview":true,"visualization_setti', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(562, 1, 'ngs":{"graph.show_values":true,"graph.x_axis.labels_enabled":false,"table.cell_column":"total","graph.series_order_dimension":null,"graph.y_axis.labels_enabled":false,"graph.label_value_frequency":"fit","graph.metrics":["total"],"graph.y_axis.axis_enabled":true,"table.column_formatting":[{"columns":[],"type":"single","operator":"=","value":"","color":"#509EE3","highlight_row":false}],"graph.label_value_formatting":"auto","graph.series_order":null,"table.pivot_column":"category","column_settings":{"[\"name\",\"Total\"]":{"show_mini_bar":false}},"graph.dimensions":["category"]},"is_write":false,"parameters":[{"id":"46d35bb0-9f4f-a718-3a30-c67b33ebfbbd","type":"date/month-year","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"1e389631-be8c-fe8d-ce92-18066d89fb39","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"ba70e3f4-7b8e-02e5-2762-8e2174e0b651","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"d700b567-972d-4291-274e-1fb46830afc1","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"ea45ef14-a48c-031a-9105-1d97f9a69f69","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(555, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by age","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"query":"[\n {\n $facet: {\n totals: [{ $count: ''total'' }, { $addFields: { category: ''Total'' } }],\n ageGroups: [\n {\n $match: {\n $and: [\n { _id: { $ne: null } }\n [[{{ filterGender }} ]]\n [[{{ filterEvent }}]]\n [[{{ filterState }}]]\n [[{{ filterOffice }}]]\n ]\n }\n },\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 365] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''Under 1''\n },\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 1825] },\n { $gte: [''$childsAge'', 365] }\n ]\n },\n then: ''Under 5''\n }\n ],\n default: ''Over 5''\n }\n }\n }\n },\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n category: ''$_id.par'',\n total: ''$totalCustomer''\n }\n }\n ]\n }\n },\n {\n $project: {\n mergedArray: { $concatArrays: [''$totals'', ''$ageGroups''] }\n }\n },\n { $unwind: ''$mergedArray'' },\n { $replaceRoot: { newRoot: ''$mergedArray'' } },\n {\n $sort: {\n category: 1\n }\n }\n ]\n ","collection":"analyticsRegistrations","template-tags":{"filterGender":{"id":"46d35bb0-9f4f-a718-3a30-c67b33ebfbbd","name":"filterGender","display-name":"Filtergender","type":"text"},"filterEvent":{"id":"1e389631-be8c-fe8d-ce92-18066d89fb39","name":"filterEvent","display-name":"Filterevent","type":"text"},"filterState":{"id":"ba70e3f4-7b8e-02e5-2762-8e2174e0b651","name":"filterState","display-name":"Filterstate","type":"text"},"filterOffice":{"id":"d700b567-972d-4291-274e-1fb46830afc1","name":"filterOffice","display-name":"Filteroffice","type":"text"}}},"type":"native"},"id":11,"parameter_mappings":[],"display":"table","entity_id":"g6QTDGvlih9yRnNCJqvy9","collection_preview":true,"visualization_settings":{"graph.show_values":true,"graph.x_axis.labels_enabled":false,"table.cell_column":"total","graph.series_order_dimension":null,"graph.y_axis.labels_enabled":false,"graph.label_value_frequency":"fit","graph.metrics":["total"],"graph.y_axis.axis_enabled":true,"table.column_formatting":[{"columns":[],"type":"single","operator":"=","value":"","color":"#509EE3","highlight_row":false}],"graph.label_value_formatting":"auto","graph.series_order":null,"table.pivot_column":"category","column_settings":{"[\"name\",\"Total\"]":{"show_mini_bar":false}},"graph.dimensions":["category"]},"is_write":false,"parameters":[{"id":"46d35bb0-9f4f-a718-3a30-c67b33ebfbbd","type":"category","target":["variable",["template-tag","filterGender"]],"name":"Filtergender","slug":"filterGender"},{"id":"1e389631-be8c-fe8d-ce92-18066d89fb39","type":"category","target":["variable",["template-tag","filt', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(555, 1, 'erEvent"]],"name":"Filterevent","slug":"filterEvent"},{"id":"ba70e3f4-7b8e-02e5-2762-8e2174e0b651","type":"category","target":["variable",["template-tag","filterState"]],"name":"Filterstate","slug":"filterState"},{"id":"d700b567-972d-4291-274e-1fb46830afc1","type":"category","target":["variable",["template-tag","filterOffice"]],"name":"Filteroffice","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(556, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by age","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"query":"[\n {\n $facet: {\n totals: [{ $count: ''total'' }, { $addFields: { category: ''Total'' } }],\n ageGroups: [\n {\n $match: {\n $and: [{ _id: { $ne: null } }\n [[{{ filterGender }} ]]\n [[{{ filterEvent }}]]\n [[{{ filterState }}]]\n [[{{ filterOffice }}]]\n ]\n }\n },\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 365] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''Under 1''\n },\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 1825] },\n { $gte: [''$childsAge'', 365] }\n ]\n },\n then: ''Under 5''\n }\n ],\n default: ''Over 5''\n }\n }\n }\n },\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n category: ''$_id.par'',\n total: ''$totalCustomer''\n }\n }\n ]\n }\n },\n {\n $project: {\n mergedArray: { $concatArrays: [''$totals'', ''$ageGroups''] }\n }\n },\n { $unwind: ''$mergedArray'' },\n { $replaceRoot: { newRoot: ''$mergedArray'' } },\n {\n $addFields: {\n order: {\n $cond: {\n if: { $eq: [''$category'', ''Total''] },\n then: 1,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''Under 1''] },\n then: 2,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''Under 5''] },\n then: 3,\n else: 4\n }\n }\n }\n }\n }\n }\n }\n },\n {\n $sort: {\n order: 1\n }\n },\n { $project: { total: 1, category: 1 } }\n]","collection":"analyticsRegistrations","template-tags":{"filterGender":{"id":"46d35bb0-9f4f-a718-3a30-c67b33ebfbbd","name":"filterGender","display-name":"Filtergender","type":"text"},"filterEvent":{"id":"1e389631-be8c-fe8d-ce92-18066d89fb39","name":"filterEvent","display-name":"Filterevent","type":"text"},"filterState":{"id":"ba70e3f4-7b8e-02e5-2762-8e2174e0b651","name":"filterState","display-name":"Filterstate","type":"text"},"filterOffice":{"id":"d700b567-972d-4291-274e-1fb46830afc1","name":"filterOffice","display-name":"Filteroffice","type":"text"}}},"type":"native"},"id":11,"parameter_mappings":[],"display":"table","entity_id":"g6QTDGvlih9yRnNCJqvy9","collection_preview":true,"visualization_settings":{"graph.show_values":true,"graph.x_axis.labels_enabled":false,"table.cell_column":"total","graph.series_order_dimension":null,"graph.y_axis.labels_enabled":false,"graph.label_value_frequency":"fit","graph.metrics":["total"],"graph.y_axis.axis_enabled":true,"table.column_formatting":[{"columns":[],"type":"single","operator":"=","value":"","color":"#509EE3","highlight_row":false}],"graph.label_value_formatting":"auto","graph.series_order":null,"table.pivot_column":"category","column_settings":{"[\"name\",\"Total\"]":{"s', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(556, 1, 'how_mini_bar":false}},"graph.dimensions":["category"]},"is_write":false,"parameters":[{"id":"46d35bb0-9f4f-a718-3a30-c67b33ebfbbd","type":"category","target":["variable",["template-tag","filterGender"]],"name":"Filtergender","slug":"filterGender"},{"id":"1e389631-be8c-fe8d-ce92-18066d89fb39","type":"category","target":["variable",["template-tag","filterEvent"]],"name":"Filterevent","slug":"filterEvent"},{"id":"ba70e3f4-7b8e-02e5-2762-8e2174e0b651","type":"category","target":["variable",["template-tag","filterState"]],"name":"Filterstate","slug":"filterState"},{"id":"d700b567-972d-4291-274e-1fb46830afc1","type":"category","target":["variable",["template-tag","filterOffice"]],"name":"Filteroffice","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(557, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by age","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"query":"[\n {\n $facet: {\n totals: [{ $count: ''total'' }, { $addFields: { category: ''Total'' } }],\n ageGroups: [\n {\n $match: {\n $and: [{ _id: { $ne: null } }\n [[{{ filterGender }} ]]\n [[{{ filterEvent }}]]\n [[{{ filterState }}]]\n [[{{ filterOffice }}]]\n ]\n }\n },\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 365] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''Under 1''\n },\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 1825] },\n { $gte: [''$childsAge'', 365] }\n ]\n },\n then: ''Under 5''\n }\n ],\n default: ''Over 5''\n }\n }\n }\n },\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n category: ''$_id.par'',\n total: ''$totalCustomer''\n }\n }\n ]\n }\n },\n {\n $project: {\n mergedArray: { $concatArrays: [''$totals'', ''$ageGroups''] }\n }\n },\n { $unwind: ''$mergedArray'' },\n { $replaceRoot: { newRoot: ''$mergedArray'' } },\n {\n $addFields: {\n order: {\n $cond: {\n if: { $eq: [''$category'', ''Total''] },\n then: 1,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''Under 1''] },\n then: 2,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''Under 5''] },\n then: 3,\n else: 4\n }\n }\n }\n }\n }\n }\n }\n },\n {\n $sort: {\n order: 1\n }\n },\n { $project: { total: 1, category: 1 } }\n]","collection":"analyticsRegistrations","template-tags":{"filterGender":{"id":"46d35bb0-9f4f-a718-3a30-c67b33ebfbbd","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null},"filterEvent":{"id":"1e389631-be8c-fe8d-ce92-18066d89fb39","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null},"filterState":{"id":"ba70e3f4-7b8e-02e5-2762-8e2174e0b651","name":"filterState","display-name":"Filterstate","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"d700b567-972d-4291-274e-1fb46830afc1","name":"filterOffice","display-name":"Filteroffice","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null}}},"type":"native"},"id":11,"parameter_mappings":[],"display":"table","entity_id":"g6QTDGvlih9yRnNCJqvy9","collection_preview":true,"visualization_settings":{"graph.show_values":true,"graph.x_axis.labels_enabled":false,"table.cell_column":"total","graph.series_order_dimension":null,"graph.y_axis.labels_enabled":false,"graph.label_value_frequency":"fit","graph.metrics":["t', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(557, 1, 'otal"],"graph.y_axis.axis_enabled":true,"table.column_formatting":[{"columns":[],"type":"single","operator":"=","value":"","color":"#509EE3","highlight_row":false}],"graph.label_value_formatting":"auto","graph.series_order":null,"table.pivot_column":"category","column_settings":{"[\"name\",\"Total\"]":{"show_mini_bar":false}},"graph.dimensions":["category"]},"is_write":false,"parameters":[{"id":"46d35bb0-9f4f-a718-3a30-c67b33ebfbbd","type":"date/month-year","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"1e389631-be8c-fe8d-ce92-18066d89fb39","type":"date/month-year","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"ba70e3f4-7b8e-02e5-2762-8e2174e0b651","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"Filterstate","slug":"filterState"},{"id":"d700b567-972d-4291-274e-1fb46830afc1","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Filteroffice","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(558, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by age","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterGender":{"id":"46d35bb0-9f4f-a718-3a30-c67b33ebfbbd","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null},"filterEvent":{"id":"1e389631-be8c-fe8d-ce92-18066d89fb39","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"ba70e3f4-7b8e-02e5-2762-8e2174e0b651","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"d700b567-972d-4291-274e-1fb46830afc1","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null}},"collection":"analyticsRegistrations","query":"[\n {\n $facet: {\n totals: [{ $count: ''total'' }, { $addFields: { category: ''Total'' } }],\n ageGroups: [\n {\n $match: {\n $and: [{ _id: { $ne: null } }\n [[{{ filterGender }} ]]\n [[{{ filterEvent }}]]\n [[{{ filterState }}]]\n [[{{ filterOffice }}]]\n ]\n }\n },\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 365] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''Under 1''\n },\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 1825] },\n { $gte: [''$childsAge'', 365] }\n ]\n },\n then: ''Under 5''\n }\n ],\n default: ''Over 5''\n }\n }\n }\n },\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n category: ''$_id.par'',\n total: ''$totalCustomer''\n }\n }\n ]\n }\n },\n {\n $project: {\n mergedArray: { $concatArrays: [''$totals'', ''$ageGroups''] }\n }\n },\n { $unwind: ''$mergedArray'' },\n { $replaceRoot: { newRoot: ''$mergedArray'' } },\n {\n $addFields: {\n order: {\n $cond: {\n if: { $eq: [''$category'', ''Total''] },\n then: 1,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''Under 1''] },\n then: 2,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''Under 5''] },\n then: 3,\n else: 4\n }\n }\n }\n }\n }\n }\n }\n },\n {\n $sort: {\n order: 1\n }\n },\n { $project: { total: 1, category: 1 } }\n]"},"database":2},"id":11,"parameter_mappings":[],"display":"table","entity_id":"g6QTDGvlih9yRnNCJqvy9","collection_preview":true,"visualization_settings":{"graph.show_values":true,"graph.x_axis.labels_enabled":false,"table.cell_column":"total","graph.series_order_dimension":null,"graph.y_axis.labels_enabled":false,"graph.label_value_frequency":"fit","graph.metrics":["total"],"graph.y_axi', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(558, 1, 's.axis_enabled":true,"table.column_formatting":[{"columns":[],"type":"single","operator":"=","value":"","color":"#509EE3","highlight_row":false}],"graph.label_value_formatting":"auto","graph.series_order":null,"table.pivot_column":"category","column_settings":{"[\"name\",\"Total\"]":{"show_mini_bar":false}},"graph.dimensions":["category"]},"is_write":false,"parameters":[{"id":"46d35bb0-9f4f-a718-3a30-c67b33ebfbbd","type":"date/month-year","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"1e389631-be8c-fe8d-ce92-18066d89fb39","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"ba70e3f4-7b8e-02e5-2762-8e2174e0b651","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"d700b567-972d-4291-274e-1fb46830afc1","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(559, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by age","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterGender":{"id":"46d35bb0-9f4f-a718-3a30-c67b33ebfbbd","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null},"filterEvent":{"id":"1e389631-be8c-fe8d-ce92-18066d89fb39","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"ba70e3f4-7b8e-02e5-2762-8e2174e0b651","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"d700b567-972d-4291-274e-1fb46830afc1","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null}},"collection":"analyticsRegistrations","query":"[\n {\n $facet: {\n totals: [{ $count: ''total'' }, { $addFields: { category: ''Total'' } }],\n ageGroups: [\n {\n $match: {\n $and: [{ _id: { $ne: null } }\n [[{{ filterGender }} ]]\n [[{{ filterEvent }}]]\n [[{{ filterState }}]]\n [[{{ filterOffice }}]]\n ]\n }\n },\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 365] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''Under 1''\n },\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 1825] },\n { $gte: [''$childsAge'', 365] }\n ]\n },\n then: ''Under 5''\n }\n ],\n default: ''Over 5''\n }\n }\n }\n },\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n category: ''$_id.par'',\n total: ''$totalCustomer''\n }\n }\n ]\n }\n },\n {\n $project: {\n mergedArray: { $concatArrays: [''$totals'', ''$ageGroups''] }\n }\n },\n { $unwind: ''$mergedArray'' },\n { $replaceRoot: { newRoot: ''$mergedArray'' } },\n {\n $addFields: {\n order: {\n $cond: {\n if: { $eq: [''$category'', ''Total''] },\n then: 1,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''Under 1''] },\n then: 2,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''Under 5''] },\n then: 3,\n else: 4\n }\n }\n }\n }\n }\n }\n }\n },\n {\n $sort: {\n order: 1\n }\n },\n { $project: { total: 1, category: 1 } }\n]"},"database":2},"id":11,"parameter_mappings":[],"display":"bar","entity_id":"g6QTDGvlih9yRnNCJqvy9","collection_preview":true,"visualization_settings":{"graph.show_values":true,"graph.x_axis.labels_enabled":false,"table.cell_column":"total","graph.series_order_dimension":null,"graph.y_axis.labels_enabled":false,"graph.label_value_frequency":"fit","graph.metrics":["total"],"graph.y_axis.', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(559, 1, 'axis_enabled":true,"table.column_formatting":[{"columns":[],"type":"single","operator":"=","value":"","color":"#509EE3","highlight_row":false}],"graph.label_value_formatting":"auto","graph.series_order":null,"table.pivot_column":"category","column_settings":{"[\"name\",\"Total\"]":{"show_mini_bar":false}},"graph.dimensions":["category"]},"is_write":false,"parameters":[{"id":"46d35bb0-9f4f-a718-3a30-c67b33ebfbbd","type":"date/month-year","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"1e389631-be8c-fe8d-ce92-18066d89fb39","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"ba70e3f4-7b8e-02e5-2762-8e2174e0b651","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"d700b567-972d-4291-274e-1fb46830afc1","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(560, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by gender","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterGender":{"id":"714d5902-296d-8cee-ed3c-103c588a855a","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"90028ce9-3f5d-246a-8b0e-9221adb5128a","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"8f889b01-8027-df24-1000-aa0e7cd2123e","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"1b5d8679-3ac1-295e-94c5-709031bb6279","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"bb02d443-ba05-0c59-5887-eb51b5e72b90","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , { \"$group\": {\n \"_id\": {\n \"gender\": \"$gender\"\n },\n \"count\": {\n \"$sum\": 1\n },\n }\n },\n { \"$project\": {\n \"_id\": false,\n \"gender\": \"$_id.gender\",\n \"count\": true\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Gender'': \"$allInfo.gender\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }}\n]","collection":"analyticsRegistrations"},"type":"native"},"id":1,"parameter_mappings":[],"display":"bar","entity_id":"Ksk2s3aUAdBmDtMTNwtH3","collection_preview":true,"visualization_settings":{"table.columns":[{"name":"Gender","fieldRef":["field","Gender",{"base-type":"type/Text"}],"enabled":true},{"name":"Count","fieldRef":["field","Count",{"base-type":"type/Integer"}],"enabled":true},{"name":"Percentage","fieldRef":["field","Percentage",{"base-type":"type/Float"}],"enabled":true}],"table.pivot_column":"count","table.cell_column":"Gender","graph.dimensions":["Gender"],"graph.show_goal":false,"graph.show_values":true,"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"714d5902-296d-8cee-ed3c-103c588a855a","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"90028ce9-3f5d-246a-8b0e-9221adb5128a","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"8f889b01-8027-df24-1000-aa0e7cd2123e","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"1b5d8679-3ac1-295e-94c5-709031bb6279","type":"string/=","target":["dimension",["template-t', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(560, 1, 'ag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"bb02d443-ba05-0c59-5887-eb51b5e72b90","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(561, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by gender","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterGender":{"id":"714d5902-296d-8cee-ed3c-103c588a855a","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"90028ce9-3f5d-246a-8b0e-9221adb5128a","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"8f889b01-8027-df24-1000-aa0e7cd2123e","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"1b5d8679-3ac1-295e-94c5-709031bb6279","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"bb02d443-ba05-0c59-5887-eb51b5e72b90","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , { \"$group\": {\n \"_id\": {\n \"gender\": \"$gender\"\n },\n \"count\": {\n \"$sum\": 1\n },\n }\n },\n { \"$project\": {\n \"_id\": false,\n \"gender\": \"$_id.gender\",\n \"count\": true\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Gender'': \"$allInfo.gender\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }}\n]","collection":"analyticsRegistrations"},"type":"native"},"id":1,"parameter_mappings":[],"display":"table","entity_id":"Ksk2s3aUAdBmDtMTNwtH3","collection_preview":true,"visualization_settings":{"table.columns":[{"name":"Gender","fieldRef":["field","Gender",{"base-type":"type/Text"}],"enabled":true},{"name":"Count","fieldRef":["field","Count",{"base-type":"type/Integer"}],"enabled":true},{"name":"Percentage","fieldRef":["field","Percentage",{"base-type":"type/Float"}],"enabled":true}],"table.pivot_column":"count","table.cell_column":"Gender","graph.dimensions":["Gender"],"graph.show_goal":false,"graph.show_values":true,"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"714d5902-296d-8cee-ed3c-103c588a855a","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"90028ce9-3f5d-246a-8b0e-9221adb5128a","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"8f889b01-8027-df24-1000-aa0e7cd2123e","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"1b5d8679-3ac1-295e-94c5-709031bb6279","type":"string/=","target":["dimension",["template', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(561, 1, '-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"bb02d443-ba05-0c59-5887-eb51b5e72b90","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(562, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by gender","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterGender":{"id":"714d5902-296d-8cee-ed3c-103c588a855a","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"90028ce9-3f5d-246a-8b0e-9221adb5128a","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"8f889b01-8027-df24-1000-aa0e7cd2123e","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"1b5d8679-3ac1-295e-94c5-709031bb6279","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"bb02d443-ba05-0c59-5887-eb51b5e72b90","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , { \"$group\": {\n \"_id\": {\n \"gender\": \"$gender\"\n },\n \"count\": {\n \"$sum\": 1\n },\n }\n },\n { \"$project\": {\n \"_id\": false,\n \"gender\": \"$_id.gender\",\n \"count\": true\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Gender'': \"$allInfo.gender\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }}\n]","collection":"analyticsRegistrations"},"type":"native"},"id":1,"parameter_mappings":[],"display":"bar","entity_id":"Ksk2s3aUAdBmDtMTNwtH3","collection_preview":true,"visualization_settings":{"table.columns":[{"name":"Gender","fieldRef":["field","Gender",{"base-type":"type/Text"}],"enabled":true},{"name":"Count","fieldRef":["field","Count",{"base-type":"type/Integer"}],"enabled":true},{"name":"Percentage","fieldRef":["field","Percentage",{"base-type":"type/Float"}],"enabled":true}],"table.pivot_column":"count","table.cell_column":"Gender","graph.dimensions":["Gender"],"graph.show_goal":false,"graph.show_values":true,"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"714d5902-296d-8cee-ed3c-103c588a855a","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"90028ce9-3f5d-246a-8b0e-9221adb5128a","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"8f889b01-8027-df24-1000-aa0e7cd2123e","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"1b5d8679-3ac1-295e-94c5-709031bb6279","type":"string/=","target":["dimension",["template-t', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(562, 1, 'ag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"bb02d443-ba05-0c59-5887-eb51b5e72b90","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(563, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by age","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"query":"[\n {\n $facet: {\n totals: [{ $count: ''total'' }, { $addFields: { category: ''Total'' } }],\n ageGroups: [\n {\n $match: {\n $and: [{ _id: { $ne: null } }\n [[{{ filterDate }} ]]\n [[{{ filterGender }} ]]\n [[{{ filterEvent }}]]\n [[{{ filterState }}]]\n [[{{ filterOffice }}]]\n ]\n }\n },\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 365] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''Under 1''\n },\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 1825] },\n { $gte: [''$childsAge'', 365] }\n ]\n },\n then: ''Under 5''\n }\n ],\n default: ''Over 5''\n }\n }\n }\n },\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n category: ''$_id.par'',\n total: ''$totalCustomer''\n }\n }\n ]\n }\n },\n {\n $project: {\n mergedArray: { $concatArrays: [''$totals'', ''$ageGroups''] }\n }\n },\n { $unwind: ''$mergedArray'' },\n { $replaceRoot: { newRoot: ''$mergedArray'' } },\n {\n $addFields: {\n order: {\n $cond: {\n if: { $eq: [''$category'', ''Total''] },\n then: 1,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''Under 1''] },\n then: 2,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''Under 5''] },\n then: 3,\n else: 4\n }\n }\n }\n }\n }\n }\n }\n },\n {\n $sort: {\n order: 1\n }\n },\n { $project: { total: 1, category: 1 } }\n]","collection":"analyticsRegistrations","template-tags":{"filterGender":{"id":"46d35bb0-9f4f-a718-3a30-c67b33ebfbbd","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null},"filterEvent":{"id":"1e389631-be8c-fe8d-ce92-18066d89fb39","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"ba70e3f4-7b8e-02e5-2762-8e2174e0b651","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"d700b567-972d-4291-274e-1fb46830afc1","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"ea45ef14-a48c-031a-9105-1d97f9a69f69","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}}},"type":"native"},"id":11,"parameter_mappings":[],"display":"bar","entity_id":"g6QTDGvlih9yRnNCJqvy9","collection_preview":true,"visualization_setti', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(563, 1, 'ngs":{"graph.show_values":true,"graph.x_axis.labels_enabled":false,"table.cell_column":"total","graph.series_order_dimension":null,"graph.y_axis.labels_enabled":false,"graph.label_value_frequency":"fit","graph.metrics":["total"],"graph.y_axis.axis_enabled":true,"table.column_formatting":[{"columns":[],"type":"single","operator":"=","value":"","color":"#509EE3","highlight_row":false}],"graph.label_value_formatting":"auto","graph.series_order":null,"table.pivot_column":"category","column_settings":{"[\"name\",\"Total\"]":{"show_mini_bar":false}},"graph.dimensions":["category"]},"is_write":false,"parameters":[{"id":"46d35bb0-9f4f-a718-3a30-c67b33ebfbbd","type":"date/month-year","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"1e389631-be8c-fe8d-ce92-18066d89fb39","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"ba70e3f4-7b8e-02e5-2762-8e2174e0b651","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"d700b567-972d-4291-274e-1fb46830afc1","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"ea45ef14-a48c-031a-9105-1d97f9a69f69","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); INSERT INTO "PUBLIC"."REVISION" VALUES (209, 'Card', 15, 1, TIMESTAMP WITH TIME ZONE '2022-12-16 12:15:26.281+00', '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":null,"query_type":"native","name":"Filter date test","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterFrom":{"id":"feb3ffd2-fa2c-0881-9f28-a1b401cb4715","name":"filterFrom","display-name":"Filterfrom","type":"dimension","default":null,"dimension":["field",354,null],"widget-type":"string/="},"filterTo":{"id":"0d4ae775-ae4b-95a3-6342-771cd1b8f66e","name":"filterTo","display-name":"Filterto","type":"dimension","default":null,"dimension":["field",354,null],"widget-type":"string/="}},"query":"[{$project: {foo: ''[[{{filterFrom}}]] - [[{{filterTo}}]]''}}]","collection":"analyticsRegistrations"},"type":"native"},"id":15,"parameter_mappings":[],"display":"table","entity_id":"1z0T_0BESRBrkEWYBglCm","collection_preview":true,"visualization_settings":{"table.pivot_column":"foo","table.cell_column":"_id"},"is_write":false,"parameters":[{"id":"feb3ffd2-fa2c-0881-9f28-a1b401cb4715","type":"string/=","target":["dimension",["template-tag","filterFrom"]],"name":"Filterfrom","slug":"filterFrom"},{"id":"0d4ae775-ae4b-95a3-6342-771cd1b8f66e","type":"string/=","target":["dimension",["template-tag","filterTo"]],"name":"Filterto","slug":"filterTo"}],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL), -(217, 'Card', 11, 1, TIMESTAMP WITH TIME ZONE '2022-12-16 12:32:02.562+00', SYSTEM_COMBINE_CLOB(554), FALSE, FALSE, NULL), -(218, 'Card', 11, 1, TIMESTAMP WITH TIME ZONE '2022-12-16 12:39:30.498+00', SYSTEM_COMBINE_CLOB(555), FALSE, FALSE, NULL), -(220, 'Card', 11, 1, TIMESTAMP WITH TIME ZONE '2022-12-16 12:41:51.789+00', SYSTEM_COMBINE_CLOB(556), FALSE, FALSE, NULL), -(222, 'Card', 11, 1, TIMESTAMP WITH TIME ZONE '2022-12-16 13:00:42.748+00', SYSTEM_COMBINE_CLOB(557), FALSE, FALSE, NULL), -(223, 'Card', 11, 1, TIMESTAMP WITH TIME ZONE '2022-12-16 13:00:51.299+00', SYSTEM_COMBINE_CLOB(558), FALSE, FALSE, NULL), +(217, 'Card', 11, 1, TIMESTAMP WITH TIME ZONE '2022-12-16 12:32:02.562+00', SYSTEM_COMBINE_CLOB(555), FALSE, FALSE, NULL), +(218, 'Card', 11, 1, TIMESTAMP WITH TIME ZONE '2022-12-16 12:39:30.498+00', SYSTEM_COMBINE_CLOB(556), FALSE, FALSE, NULL), +(220, 'Card', 11, 1, TIMESTAMP WITH TIME ZONE '2022-12-16 12:41:51.789+00', SYSTEM_COMBINE_CLOB(557), FALSE, FALSE, NULL), +(222, 'Card', 11, 1, TIMESTAMP WITH TIME ZONE '2022-12-16 13:00:42.748+00', SYSTEM_COMBINE_CLOB(558), FALSE, FALSE, NULL), +(223, 'Card', 11, 1, TIMESTAMP WITH TIME ZONE '2022-12-16 13:00:51.299+00', SYSTEM_COMBINE_CLOB(559), FALSE, FALSE, NULL), (225, 'Card', 16, 1, TIMESTAMP WITH TIME ZONE '2022-12-16 13:06:40.366+00', '{"description":null,"archived":false,"collection_position":null,"table_id":22,"database_id":2,"enable_embedding":false,"collection_id":null,"query_type":"query","name":"Total Registrations (without native query)","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"query","query":{"source-table":22,"aggregation":[["count"]]},"database":2},"id":16,"parameter_mappings":[],"display":"scalar","entity_id":"BOot6oon80vLb791-gzQb","collection_preview":true,"visualization_settings":{},"is_write":false,"parameters":[],"dataset":false,"public_uuid":null}', FALSE, TRUE, NULL), -(230, 'Card', 1, 1, TIMESTAMP WITH TIME ZONE '2022-12-16 13:08:02.855+00', SYSTEM_COMBINE_CLOB(559), FALSE, FALSE, NULL), -(231, 'Card', 1, 1, TIMESTAMP WITH TIME ZONE '2022-12-16 13:08:10.749+00', SYSTEM_COMBINE_CLOB(560), FALSE, FALSE, NULL), -(232, 'Card', 1, 1, TIMESTAMP WITH TIME ZONE '2022-12-16 13:08:26.98+00', SYSTEM_COMBINE_CLOB(561), FALSE, FALSE, NULL), -(236, 'Card', 11, 1, TIMESTAMP WITH TIME ZONE '2022-12-16 13:09:55.075+00', SYSTEM_COMBINE_CLOB(562), FALSE, FALSE, NULL), +(230, 'Card', 1, 1, TIMESTAMP WITH TIME ZONE '2022-12-16 13:08:02.855+00', SYSTEM_COMBINE_CLOB(560), FALSE, FALSE, NULL), +(231, 'Card', 1, 1, TIMESTAMP WITH TIME ZONE '2022-12-16 13:08:10.749+00', SYSTEM_COMBINE_CLOB(561), FALSE, FALSE, NULL), +(232, 'Card', 1, 1, TIMESTAMP WITH TIME ZONE '2022-12-16 13:08:26.98+00', SYSTEM_COMBINE_CLOB(562), FALSE, FALSE, NULL), +(236, 'Card', 11, 1, TIMESTAMP WITH TIME ZONE '2022-12-16 13:09:55.075+00', SYSTEM_COMBINE_CLOB(563), FALSE, FALSE, NULL), (237, 'Card', 16, 1, TIMESTAMP WITH TIME ZONE '2022-12-16 13:10:28.396+00', '{"description":null,"archived":false,"collection_position":null,"table_id":22,"database_id":2,"enable_embedding":false,"collection_id":null,"query_type":"query","name":"Total Registrations (without native query)","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"query":{"aggregation":[["count"]],"filter":["time-interval",["field",354,null],-1,"year"],"source-table":22},"type":"query"},"id":16,"parameter_mappings":[],"display":"scalar","entity_id":"BOot6oon80vLb791-gzQb","collection_preview":true,"visualization_settings":{},"is_write":false,"parameters":[],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(563, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by age","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"query":"[\n {\n $match: {\n $and: [{ _id: { $ne: null } }\n [[{{ filterDate }} ]]\n [[{{ filterGender }} ]]\n [[{{ filterEvent }}]]\n [[{{ filterState }}]]\n [[{{ filterOffice }}]]\n ]\n }\n },\n {\n $facet: {\n totals: [{ $count: ''total'' }, { $addFields: { category: ''Total'' } }],\n ageGroups: [\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 365] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''Under 1''\n },\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 1825] },\n { $gte: [''$childsAge'', 365] }\n ]\n },\n then: ''Under 5''\n }\n ],\n default: ''Over 5''\n }\n }\n }\n },\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n category: ''$_id.par'',\n total: ''$totalCustomer''\n }\n }\n ]\n }\n },\n {\n $project: {\n mergedArray: { $concatArrays: [''$totals'', ''$ageGroups''] }\n }\n },\n { $unwind: ''$mergedArray'' },\n { $replaceRoot: { newRoot: ''$mergedArray'' } },\n {\n $addFields: {\n order: {\n $cond: {\n if: { $eq: [''$category'', ''Total''] },\n then: 1,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''Under 1''] },\n then: 2,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''Under 5''] },\n then: 3,\n else: 4\n }\n }\n }\n }\n }\n }\n }\n },\n {\n $sort: {\n order: 1\n }\n },\n { $project: { total: 1, category: 1 } }\n]","collection":"analyticsRegistrations","template-tags":{"filterGender":{"id":"46d35bb0-9f4f-a718-3a30-c67b33ebfbbd","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null},"filterEvent":{"id":"1e389631-be8c-fe8d-ce92-18066d89fb39","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"ba70e3f4-7b8e-02e5-2762-8e2174e0b651","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"d700b567-972d-4291-274e-1fb46830afc1","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"ea45ef14-a48c-031a-9105-1d97f9a69f69","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}}},"type":"native"},"id":11,"parameter_mappings":[],"display":"bar","entity_id":"g6QTDGvlih9yRnNCJqvy9","collection_preview":true,"visualization_s', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(563, 1, 'ettings":{"graph.show_values":true,"graph.x_axis.labels_enabled":false,"table.cell_column":"total","graph.series_order_dimension":null,"graph.y_axis.labels_enabled":false,"graph.label_value_frequency":"fit","graph.metrics":["total"],"graph.y_axis.axis_enabled":true,"table.column_formatting":[{"columns":[],"type":"single","operator":"=","value":"","color":"#509EE3","highlight_row":false}],"graph.label_value_formatting":"auto","graph.series_order":null,"table.pivot_column":"category","column_settings":{"[\"name\",\"Total\"]":{"show_mini_bar":false}},"graph.dimensions":["category"]},"is_write":false,"parameters":[{"id":"46d35bb0-9f4f-a718-3a30-c67b33ebfbbd","type":"date/month-year","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"1e389631-be8c-fe8d-ce92-18066d89fb39","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"ba70e3f4-7b8e-02e5-2762-8e2174e0b651","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"d700b567-972d-4291-274e-1fb46830afc1","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"ea45ef14-a48c-031a-9105-1d97f9a69f69","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); INSERT INTO SYSTEM_LOB_STREAM VALUES(564, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by age","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"query":"[\n {\n $match: {\n $and: [{ _id: { $ne: null } }\n [[{{ filterDate }} ]]\n [[{{ filterGender }} ]]\n [[{{ filterEvent }}]]\n [[{{ filterState }}]]\n [[{{ filterOffice }}]]\n ]\n }\n },\n {\n $facet: {\n totals: [{ $count: ''total'' }, { $addFields: { category: ''Total'' } }],\n ageGroups: [\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 365] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''Under 1''\n },\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 1825] },\n { $gte: [''$childsAge'', 365] }\n ]\n },\n then: ''Under 5''\n }\n ],\n default: ''Over 5''\n }\n }\n }\n },\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n category: ''$_id.par'',\n total: ''$totalCustomer''\n }\n }\n ]\n }\n },\n {\n $project: {\n mergedArray: { $concatArrays: [''$totals'', ''$ageGroups''] }\n }\n },\n { $unwind: ''$mergedArray'' },\n { $replaceRoot: { newRoot: ''$mergedArray'' } },\n {\n $addFields: {\n order: {\n $cond: {\n if: { $eq: [''$category'', ''Total''] },\n then: 1,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''Under 1''] },\n then: 2,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''Under 5''] },\n then: 3,\n else: 4\n }\n }\n }\n }\n }\n }\n }\n },\n {\n $sort: {\n order: 1\n }\n },\n { $project: { total: 1, category: 1 } }\n]","collection":"analyticsRegistrations","template-tags":{"filterGender":{"id":"46d35bb0-9f4f-a718-3a30-c67b33ebfbbd","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null},"filterEvent":{"id":"1e389631-be8c-fe8d-ce92-18066d89fb39","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"ba70e3f4-7b8e-02e5-2762-8e2174e0b651","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"d700b567-972d-4291-274e-1fb46830afc1","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"ea45ef14-a48c-031a-9105-1d97f9a69f69","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}}},"type":"native"},"id":11,"parameter_mappings":[],"display":"bar","entity_id":"g6QTDGvlih9yRnNCJqvy9","collection_preview":true,"visualization_s', NULL); INSERT INTO SYSTEM_LOB_STREAM VALUES(564, 1, 'ettings":{"graph.show_values":true,"graph.x_axis.labels_enabled":false,"table.cell_column":"total","graph.series_order_dimension":null,"graph.y_axis.labels_enabled":false,"graph.label_value_frequency":"fit","graph.metrics":["total"],"graph.y_axis.axis_enabled":true,"table.column_formatting":[{"columns":[],"type":"single","operator":"=","value":"","color":"#509EE3","highlight_row":false}],"graph.label_value_formatting":"auto","graph.series_order":null,"table.pivot_column":"category","column_settings":{"[\"name\",\"Total\"]":{"show_mini_bar":false}},"graph.dimensions":["category"]},"is_write":false,"parameters":[{"id":"46d35bb0-9f4f-a718-3a30-c67b33ebfbbd","type":"date/month-year","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"1e389631-be8c-fe8d-ce92-18066d89fb39","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"ba70e3f4-7b8e-02e5-2762-8e2174e0b651","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"d700b567-972d-4291-274e-1fb46830afc1","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"ea45ef14-a48c-031a-9105-1d97f9a69f69","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(565, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by gender","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterGender":{"id":"714d5902-296d-8cee-ed3c-103c588a855a","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"90028ce9-3f5d-246a-8b0e-9221adb5128a","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"8f889b01-8027-df24-1000-aa0e7cd2123e","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"1b5d8679-3ac1-295e-94c5-709031bb6279","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"bb02d443-ba05-0c59-5887-eb51b5e72b90","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , { \"$group\": {\n \"_id\": {\n \"gender\": \"$gender\"\n },\n \"count\": {\n \"$sum\": 1\n },\n }\n },\n { \"$project\": {\n \"_id\": false,\n \"gender\": \"$_id.gender\",\n \"count\": true\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Gender'': \"$allInfo.gender\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }}\n]","collection":"analyticsRegistrations"},"type":"native"},"id":1,"parameter_mappings":[],"display":"bar","entity_id":"Ksk2s3aUAdBmDtMTNwtH3","collection_preview":true,"visualization_settings":{"table.columns":[],"table.pivot_column":"count","table.cell_column":"Gender","graph.dimensions":[],"graph.show_goal":false,"graph.show_values":true,"graph.metrics":[null]},"is_write":false,"parameters":[{"id":"714d5902-296d-8cee-ed3c-103c588a855a","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"90028ce9-3f5d-246a-8b0e-9221adb5128a","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"8f889b01-8027-df24-1000-aa0e7cd2123e","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"1b5d8679-3ac1-295e-94c5-709031bb6279","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"bb02d443-ba05-0c59-5887-eb51b5e72b90","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uu', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(565, 1, 'id":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(566, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by age","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterGender":{"id":"46d35bb0-9f4f-a718-3a30-c67b33ebfbbd","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"1e389631-be8c-fe8d-ce92-18066d89fb39","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"ba70e3f4-7b8e-02e5-2762-8e2174e0b651","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"d700b567-972d-4291-274e-1fb46830afc1","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"ea45ef14-a48c-031a-9105-1d97f9a69f69","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}},"collection":"analyticsRegistrations","query":"[\n {\n $match: {\n $and: [{ _id: { $ne: null } }\n [[{{ filterDate }} ]]\n [[{{ filterGender }} ]]\n [[{{ filterEvent }}]]\n [[{{ filterState }}]]\n [[{{ filterOffice }}]]\n ]\n }\n },\n {\n $facet: {\n totals: [{ $count: ''total'' }, { $addFields: { category: ''Total'' } }],\n ageGroups: [\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 365] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''Under 1''\n },\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 1825] },\n { $gte: [''$childsAge'', 365] }\n ]\n },\n then: ''Under 5''\n }\n ],\n default: ''Over 5''\n }\n }\n }\n },\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n category: ''$_id.par'',\n total: ''$totalCustomer''\n }\n }\n ]\n }\n },\n {\n $project: {\n mergedArray: { $concatArrays: [''$totals'', ''$ageGroups''] }\n }\n },\n { $unwind: ''$mergedArray'' },\n { $replaceRoot: { newRoot: ''$mergedArray'' } },\n {\n $addFields: {\n order: {\n $cond: {\n if: { $eq: [''$category'', ''Total''] },\n then: 1,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''Under 1''] },\n then: 2,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''Under 5''] },\n then: 3,\n else: 4\n }\n }\n }\n }\n }\n }\n }\n },\n {\n $sort: {\n order: 1\n }\n },\n { $project: { total: 1, category: 1 } }\n]"},"database":2},"id":11,"parameter_mappings":[],"display":"bar","entity_id":"g6QTDGvlih9yRnNCJqvy9","collection_preview":true,"visualization_settings', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(566, 1, '":{"graph.show_values":true,"graph.x_axis.labels_enabled":false,"table.cell_column":"total","graph.series_order_dimension":null,"graph.y_axis.labels_enabled":false,"graph.label_value_frequency":"fit","graph.metrics":["total"],"graph.y_axis.axis_enabled":true,"table.column_formatting":[{"columns":[],"type":"single","operator":"=","value":"","color":"#509EE3","highlight_row":false}],"graph.label_value_formatting":"auto","graph.series_order":null,"table.pivot_column":"category","column_settings":{"[\"name\",\"Total\"]":{"show_mini_bar":false}},"graph.dimensions":["category"]},"is_write":false,"parameters":[{"id":"46d35bb0-9f4f-a718-3a30-c67b33ebfbbd","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"1e389631-be8c-fe8d-ce92-18066d89fb39","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"ba70e3f4-7b8e-02e5-2762-8e2174e0b651","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"d700b567-972d-4291-274e-1fb46830afc1","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"ea45ef14-a48c-031a-9105-1d97f9a69f69","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(565, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by age","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"query":"[\n {\n $match: {\n $and: [{ _id: { $ne: null } }\n [[{{ filterDate }} ]]\n [[{{ filterGender }} ]]\n [[{{ filterEvent }}]]\n [[{{ filterState }}]]\n [[{{ filterOffice }}]]\n ]\n }\n },\n {\n $facet: {\n totals: [{ $count: ''total'' }, { $addFields: { category: ''Total'' } }],\n ageGroups: [\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 365] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''Under 1''\n },\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 1825] },\n { $gte: [''$childsAge'', 365] }\n ]\n },\n then: ''Under 5''\n }\n ],\n default: ''Over 5''\n }\n }\n }\n },\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n category: ''$_id.par'',\n total: ''$totalCustomer''\n }\n }\n ]\n }\n },\n {\n $project: {\n mergedArray: { $concatArrays: [''$totals'', ''$ageGroups''] }\n }\n },\n { $unwind: ''$mergedArray'' },\n { $replaceRoot: { newRoot: ''$mergedArray'' } },\n {\n $addFields: {\n order: {\n $cond: {\n if: { $eq: [''$category'', ''Total''] },\n then: 1,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''Under 1''] },\n then: 2,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''Under 5''] },\n then: 3,\n else: 4\n }\n }\n }\n }\n }\n }\n }\n },\n {\n $sort: {\n order: 1\n }\n },\n { $project: { total: 1, category: 1 } }\n]","collection":"analyticsRegistrations","template-tags":{"filterGender":{"id":"46d35bb0-9f4f-a718-3a30-c67b33ebfbbd","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null},"filterEvent":{"id":"1e389631-be8c-fe8d-ce92-18066d89fb39","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"ba70e3f4-7b8e-02e5-2762-8e2174e0b651","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"d700b567-972d-4291-274e-1fb46830afc1","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"ea45ef14-a48c-031a-9105-1d97f9a69f69","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}}},"type":"native"},"id":11,"parameter_mappings":[],"display":"bar","entity_id":"g6QTDGvlih9yRnNCJqvy9","collection_preview":true,"visualization_s', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(565, 1, 'ettings":{"graph.show_values":true,"graph.x_axis.labels_enabled":false,"table.cell_column":"total","graph.series_order_dimension":null,"graph.y_axis.labels_enabled":false,"graph.label_value_frequency":"fit","graph.metrics":["total"],"graph.y_axis.axis_enabled":true,"table.column_formatting":[{"columns":[],"type":"single","operator":"=","value":"","color":"#509EE3","highlight_row":false}],"graph.label_value_formatting":"auto","graph.series_order":null,"table.pivot_column":"category","column_settings":{"[\"name\",\"Total\"]":{"show_mini_bar":false}},"graph.dimensions":["category"]},"is_write":false,"parameters":[{"id":"46d35bb0-9f4f-a718-3a30-c67b33ebfbbd","type":"date/month-year","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"1e389631-be8c-fe8d-ce92-18066d89fb39","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"ba70e3f4-7b8e-02e5-2762-8e2174e0b651","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"d700b567-972d-4291-274e-1fb46830afc1","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"ea45ef14-a48c-031a-9105-1d97f9a69f69","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(566, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by gender","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterGender":{"id":"714d5902-296d-8cee-ed3c-103c588a855a","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"90028ce9-3f5d-246a-8b0e-9221adb5128a","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"8f889b01-8027-df24-1000-aa0e7cd2123e","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"1b5d8679-3ac1-295e-94c5-709031bb6279","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"bb02d443-ba05-0c59-5887-eb51b5e72b90","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , { \"$group\": {\n \"_id\": {\n \"gender\": \"$gender\"\n },\n \"count\": {\n \"$sum\": 1\n },\n }\n },\n { \"$project\": {\n \"_id\": false,\n \"gender\": \"$_id.gender\",\n \"count\": true\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Gender'': \"$allInfo.gender\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }}\n]","collection":"analyticsRegistrations"},"type":"native"},"id":1,"parameter_mappings":[],"display":"bar","entity_id":"Ksk2s3aUAdBmDtMTNwtH3","collection_preview":true,"visualization_settings":{"table.columns":[],"table.pivot_column":"count","table.cell_column":"Gender","graph.dimensions":[],"graph.show_goal":false,"graph.show_values":true,"graph.metrics":[null]},"is_write":false,"parameters":[{"id":"714d5902-296d-8cee-ed3c-103c588a855a","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"90028ce9-3f5d-246a-8b0e-9221adb5128a","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"8f889b01-8027-df24-1000-aa0e7cd2123e","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"1b5d8679-3ac1-295e-94c5-709031bb6279","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"bb02d443-ba05-0c59-5887-eb51b5e72b90","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uu', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(566, 1, 'id":null}', NULL); INSERT INTO SYSTEM_LOB_STREAM VALUES(567, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by age","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterGender":{"id":"46d35bb0-9f4f-a718-3a30-c67b33ebfbbd","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"1e389631-be8c-fe8d-ce92-18066d89fb39","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"ba70e3f4-7b8e-02e5-2762-8e2174e0b651","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"d700b567-972d-4291-274e-1fb46830afc1","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"ea45ef14-a48c-031a-9105-1d97f9a69f69","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}},"collection":"analyticsRegistrations","query":"[\n {\n $match: {\n $and: [{ _id: { $ne: null } }\n [[{{ filterDate }} ]]\n [[{{ filterGender }} ]]\n [[{{ filterEvent }}]]\n [[{{ filterState }}]]\n [[{{ filterOffice }}]]\n ]\n }\n },\n {\n $facet: {\n totals: [{ $count: ''total'' }, { $addFields: { category: ''Total'' } }],\n ageGroups: [\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 365] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''Under 1''\n },\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 1825] },\n { $gte: [''$childsAge'', 365] }\n ]\n },\n then: ''Under 5''\n }\n ],\n default: ''Over 5''\n }\n }\n }\n },\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n category: ''$_id.par'',\n total: ''$totalCustomer''\n }\n }\n ]\n }\n },\n {\n $project: {\n mergedArray: { $concatArrays: [''$totals'', ''$ageGroups''] }\n }\n },\n { $unwind: ''$mergedArray'' },\n { $replaceRoot: { newRoot: ''$mergedArray'' } },\n {\n $addFields: {\n order: {\n $cond: {\n if: { $eq: [''$category'', ''Total''] },\n then: 1,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''Under 1''] },\n then: 2,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''Under 5''] },\n then: 3,\n else: 4\n }\n }\n }\n }\n }\n }\n }\n },\n {\n $sort: {\n order: 1\n }\n },\n { $project: { total: 1, category: 1 } }\n]"},"database":2},"id":11,"parameter_mappings":[],"display":"bar","entity_id":"g6QTDGvlih9yRnNCJqvy9","collection_preview":true,"visualization_settings', NULL); INSERT INTO SYSTEM_LOB_STREAM VALUES(567, 1, '":{"graph.show_values":true,"graph.x_axis.labels_enabled":false,"table.cell_column":"total","graph.series_order_dimension":null,"graph.y_axis.labels_enabled":false,"graph.label_value_frequency":"fit","graph.metrics":["total"],"graph.y_axis.axis_enabled":true,"table.column_formatting":[{"columns":[],"type":"single","operator":"=","value":"","color":"#509EE3","highlight_row":false}],"graph.label_value_formatting":"auto","graph.series_order":null,"table.pivot_column":"category","column_settings":{"[\"name\",\"Total\"]":{"show_mini_bar":false}},"graph.dimensions":["category"]},"is_write":false,"parameters":[{"id":"46d35bb0-9f4f-a718-3a30-c67b33ebfbbd","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"1e389631-be8c-fe8d-ce92-18066d89fb39","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"ba70e3f4-7b8e-02e5-2762-8e2174e0b651","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"d700b567-972d-4291-274e-1fb46830afc1","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"ea45ef14-a48c-031a-9105-1d97f9a69f69","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(568, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":10,"query_type":"native","name":"Literacy of parents","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n fathersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersLiteracy\": \"$fathersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": \"$_id\"\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"fathersLiteracy\"\n }}\n ]\n , mothersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersLiteracy\": \"$mothersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$addFields: {\n literacy: \"mothersLiteracy\"\n }}\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersLiteracy\", \"$mothersLiteracy\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Category'': \"$allInfo._id\"\n , ''Literacy'': \"$allInfo.literacy\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Literacy\": -1\n }\n }\n]\n","template-tags":{"filterGender":{"id":"e8218caf-e2aa-573e-1776-02cffff42462","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"bf69e085-3c01-7924-5108-7151c85dc371","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}}},"database":2},"id":18,"parameter_mappings":[],"display":"bar","entity_id":"eRSJUaHW6haiucK8BtpC_","collection_preview":true,"visualization_settings":{"graph.show_values":true,"graph.label_value_formatting":"auto","graph.dimensions":["Category","Literacy"],"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"e8218caf-e2aa-573e-1776-02cffff42462","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"bf69e085-3c01-7924-5108-7151c85dc371","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","type":"string/=","tar', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(568, 1, 'get":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(568, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by age","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterGender":{"id":"46d35bb0-9f4f-a718-3a30-c67b33ebfbbd","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"1e389631-be8c-fe8d-ce92-18066d89fb39","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"ba70e3f4-7b8e-02e5-2762-8e2174e0b651","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"d700b567-972d-4291-274e-1fb46830afc1","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"ea45ef14-a48c-031a-9105-1d97f9a69f69","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}},"collection":"analyticsRegistrations","query":"[\n {\n $match: {\n $and: [{ _id: { $ne: null } }\n [[{{ filterDate }} ]]\n [[{{ filterGender }} ]]\n [[{{ filterEvent }}]]\n [[{{ filterState }}]]\n [[{{ filterOffice }}]]\n ]\n }\n },\n {\n $facet: {\n totals: [{ $count: ''total'' }, { $addFields: { category: ''Total'' } }],\n ageGroups: [\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 365] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''Under 1''\n },\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 1825] },\n { $gte: [''$childsAge'', 365] }\n ]\n },\n then: ''Under 5''\n }\n ],\n default: ''Over 5''\n }\n }\n }\n },\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n category: ''$_id.par'',\n total: ''$totalCustomer''\n }\n }\n ]\n }\n },\n {\n $project: {\n mergedArray: { $concatArrays: [''$totals'', ''$ageGroups''] }\n }\n },\n { $unwind: ''$mergedArray'' },\n { $replaceRoot: { newRoot: ''$mergedArray'' } },\n {\n $addFields: {\n order: {\n $cond: {\n if: { $eq: [''$category'', ''Total''] },\n then: 1,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''Under 1''] },\n then: 2,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''Under 5''] },\n then: 3,\n else: 4\n }\n }\n }\n }\n }\n }\n }\n },\n {\n $sort: {\n order: 1\n }\n },\n { $project: { total: 1, category: 1 } }\n]"},"database":2},"id":11,"parameter_mappings":[],"display":"bar","entity_id":"g6QTDGvlih9yRnNCJqvy9","collection_preview":true,"visualization_settings', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(568, 1, '":{"graph.show_values":true,"graph.x_axis.labels_enabled":false,"table.cell_column":"total","graph.series_order_dimension":null,"graph.y_axis.labels_enabled":false,"graph.label_value_frequency":"fit","graph.metrics":["total"],"graph.y_axis.axis_enabled":true,"table.column_formatting":[{"columns":[],"type":"single","operator":"=","value":"","color":"#509EE3","highlight_row":false}],"graph.label_value_formatting":"auto","graph.series_order":null,"table.pivot_column":"category","column_settings":{"[\"name\",\"Total\"]":{"show_mini_bar":false}},"graph.dimensions":["category"]},"is_write":false,"parameters":[{"id":"46d35bb0-9f4f-a718-3a30-c67b33ebfbbd","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"1e389631-be8c-fe8d-ce92-18066d89fb39","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"ba70e3f4-7b8e-02e5-2762-8e2174e0b651","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"d700b567-972d-4291-274e-1fb46830afc1","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"ea45ef14-a48c-031a-9105-1d97f9a69f69","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(569, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":10,"query_type":"native","name":"Literacy of parents","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n fathersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersLiteracy\": \"$fathersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": \"$_id\"\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"fathersLiteracy\"\n }}\n ]\n , mothersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersLiteracy\": \"$mothersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$addFields: {\n literacy: \"mothersLiteracy\"\n }}\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersLiteracy\", \"$mothersLiteracy\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Category'': \"$allInfo._id\"\n , ''Literacy'': \"$allInfo.literacy\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Literacy\": -1\n }\n }\n]\n","template-tags":{"filterGender":{"id":"e8218caf-e2aa-573e-1776-02cffff42462","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"bf69e085-3c01-7924-5108-7151c85dc371","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}}},"database":2},"id":18,"parameter_mappings":[],"display":"bar","entity_id":"eRSJUaHW6haiucK8BtpC_","collection_preview":true,"visualization_settings":{"graph.show_values":true,"graph.label_value_formatting":"auto","graph.dimensions":["Category","Literacy"],"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"e8218caf-e2aa-573e-1776-02cffff42462","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"bf69e085-3c01-7924-5108-7151c85dc371","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","type":"string/=","tar', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(569, 1, 'get":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); INSERT INTO "PUBLIC"."REVISION" VALUES (244, 'Card', 16, 1, TIMESTAMP WITH TIME ZONE '2022-12-16 13:13:36.431+00', '{"description":null,"archived":false,"collection_position":null,"table_id":22,"database_id":2,"enable_embedding":false,"collection_id":null,"query_type":"query","name":"Total Registrations (without native query)","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"query","query":{"aggregation":[["count"]],"source-table":22},"database":2},"id":16,"parameter_mappings":[],"display":"scalar","entity_id":"BOot6oon80vLb791-gzQb","collection_preview":true,"visualization_settings":{},"is_write":false,"parameters":[],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL), -(247, 'Card', 11, 1, TIMESTAMP WITH TIME ZONE '2022-12-16 13:14:54.833+00', SYSTEM_COMBINE_CLOB(563), FALSE, FALSE, NULL), -(248, 'Card', 11, 1, TIMESTAMP WITH TIME ZONE '2022-12-16 13:15:05.811+00', SYSTEM_COMBINE_CLOB(564), FALSE, FALSE, NULL), -(249, 'Card', 1, 1, TIMESTAMP WITH TIME ZONE '2022-12-16 13:15:44.565+00', SYSTEM_COMBINE_CLOB(565), FALSE, FALSE, NULL), -(266, 'Card', 11, 1, TIMESTAMP WITH TIME ZONE '2022-12-16 13:40:00.101+00', SYSTEM_COMBINE_CLOB(566), FALSE, FALSE, NULL), -(267, 'Card', 11, 1, TIMESTAMP WITH TIME ZONE '2022-12-16 13:40:09.121+00', SYSTEM_COMBINE_CLOB(567), FALSE, FALSE, NULL), -(282, 'Card', 18, 1, TIMESTAMP WITH TIME ZONE '2022-12-19 08:37:34.14+00', SYSTEM_COMBINE_CLOB(568), FALSE, TRUE, NULL), +(247, 'Card', 11, 1, TIMESTAMP WITH TIME ZONE '2022-12-16 13:14:54.833+00', SYSTEM_COMBINE_CLOB(564), FALSE, FALSE, NULL), +(248, 'Card', 11, 1, TIMESTAMP WITH TIME ZONE '2022-12-16 13:15:05.811+00', SYSTEM_COMBINE_CLOB(565), FALSE, FALSE, NULL), +(249, 'Card', 1, 1, TIMESTAMP WITH TIME ZONE '2022-12-16 13:15:44.565+00', SYSTEM_COMBINE_CLOB(566), FALSE, FALSE, NULL), +(266, 'Card', 11, 1, TIMESTAMP WITH TIME ZONE '2022-12-16 13:40:00.101+00', SYSTEM_COMBINE_CLOB(567), FALSE, FALSE, NULL), +(267, 'Card', 11, 1, TIMESTAMP WITH TIME ZONE '2022-12-16 13:40:09.121+00', SYSTEM_COMBINE_CLOB(568), FALSE, FALSE, NULL), +(282, 'Card', 18, 1, TIMESTAMP WITH TIME ZONE '2022-12-19 08:37:34.14+00', SYSTEM_COMBINE_CLOB(569), FALSE, TRUE, NULL), (283, 'Card', 19, 1, TIMESTAMP WITH TIME ZONE '2022-12-19 08:50:07.847+00', '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":11,"query_type":"native","name":"Live births by Order","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterGender":{"id":"a666e98b-e623-90ba-d4d8-a871c18b99aa","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"9cf30dcd-6044-2331-bcf2-4542534ad91c","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"1ca050d1-c518-b429-bbd0-d6d252bdfd61","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"beccc634-814a-9420-d087-07b4285b8659","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"9e3a2f1d-031c-0bd1-0818-6efa8b490cfe","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}},"query":"[\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }},\n {\n \"$group\": {\n \"_id\": {\n \"birthOrder\": \"$birthOrder\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"birthOrder\": \"$_id.birthOrder\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"birthOrder\": 1\n }\n }\n]","collection":"analyticsRegistrations"},"type":"native"},"id":19,"parameter_mappings":[],"display":"bar","entity_id":"L6nXdi04nvxgEh1eJYrwR","collection_preview":true,"visualization_settings":{"pie.dimension":"birthOrder","pie.metric":"count","graph.dimensions":["birthOrder"],"graph.series_order_dimension":null,"graph.series_order":null,"graph.metrics":["count"]},"is_write":false,"parameters":[{"id":"a666e98b-e623-90ba-d4d8-a871c18b99aa","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"9cf30dcd-6044-2331-bcf2-4542534ad91c","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"1ca050d1-c518-b429-bbd0-d6d252bdfd61","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"beccc634-814a-9420-d087-07b4285b8659","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"9e3a2f1d-031c-0bd1-0818-6efa8b490cfe","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', FALSE, TRUE, NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(569, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":11,"query_type":"native","name":"Live births by Order","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterGender":{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","name":"filterGender","display-name":"Filtergender","type":"text"},"filterEvent":{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","name":"filterEvent","display-name":"Filterevent","type":"text"},"filterState":{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","name":"filterState","display-name":"Filterstate","type":"text"},"filterOffice":{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","name":"filterOffice","display-name":"Filteroffice","type":"text"}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , birthOrder: ''$birthOrder''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$eq: [''$birthOrder'', 1]}] }, then: ''1''},\n {case: {$and: [{$eq: [''$birthOrder'', 2]}] }, then: ''2''},\n {case: {$and: [{$eq: [''$birthOrder'', 3]}] }, then: ''3''},\n {case: {$and: [{$eq: [''$birthOrder'', 4]}] }, then: ''4''},\n {case: {$and: [{$eq: [''$birthOrder'', 5]}] }, then: ''5''},\n {case: {$and: [{$gte: [''$birthOrder'', 6]}] }, then: ''6+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''birthOrder'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"birthOrder\": 1\n }\n }\n]","collection":"analyticsRegistrations"},"type":"native"},"id":19,"parameter_mappings":[],"display":"bar","entity_id":"L6nXdi04nvxgEh1eJYrwR","collection_preview":true,"visualization_settings":{"pie.dimension":"birthOrder","pie.metric":"count","graph.dimensions":["birthOrder"],"graph.series_order_dimension":null,"graph.series_order":null,"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","type":"category","target":["variable",["template-tag","filterGender"]],"name":"Filtergender","slug":"filterGender"},{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","type":"category","target":["variable",["template-tag","filterEvent"]],"name":"Filterevent","slug":"filterEvent"},{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","type":"category","target":[', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(569, 1, '"variable",["template-tag","filterState"]],"name":"Filterstate","slug":"filterState"},{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","type":"category","target":["variable",["template-tag","filterOffice"]],"name":"Filteroffice","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(570, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":11,"query_type":"native","name":"Live births by Order","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterGender":{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","name":"filterGender","display-name":"Filtergender","type":"text"},"filterEvent":{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","name":"filterEvent","display-name":"Filterevent","type":"text"},"filterState":{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","name":"filterState","display-name":"Filterstate","type":"text"},"filterOffice":{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","name":"filterOffice","display-name":"Filteroffice","type":"text"}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , birthOrder: ''$birthOrder''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$eq: [''$birthOrder'', 1]}] }, then: ''1''},\n {case: {$and: [{$eq: [''$birthOrder'', 2]}] }, then: ''2''},\n {case: {$and: [{$eq: [''$birthOrder'', 3]}] }, then: ''3''},\n {case: {$and: [{$eq: [''$birthOrder'', 4]}] }, then: ''4''},\n {case: {$and: [{$eq: [''$birthOrder'', 5]}] }, then: ''5''},\n {case: {$and: [{$gte: [''$birthOrder'', 6]}] }, then: ''6+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''birthOrder'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"birthOrder\": 1\n }\n }\n]","collection":"analyticsRegistrations"},"type":"native"},"id":19,"parameter_mappings":[],"display":"bar","entity_id":"L6nXdi04nvxgEh1eJYrwR","collection_preview":true,"visualization_settings":{"graph.show_values":true,"pie.dimension":"birthOrder","graph.series_order_dimension":null,"graph.x_axis.title_text":"Birth Order","graph.metrics":["Count"],"graph.series_order":null,"pie.metric":"count","series_settings":{"Count":{"color":"#7172AD"}},"graph.dimensions":["birthOrder"]},"is_write":false,"parameters":[{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","type":"category","target":["variable",["template-tag","filterGender"]],"name":"Filtergender","slug":"filterGender"},{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","type":"category","target":["variable",["template-tag","filterEvent"]],"na', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(570, 1, 'me":"Filterevent","slug":"filterEvent"},{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","type":"category","target":["variable",["template-tag","filterState"]],"name":"Filterstate","slug":"filterState"},{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","type":"category","target":["variable",["template-tag","filterOffice"]],"name":"Filteroffice","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(571, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":11,"query_type":"native","name":"Live births by Order","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterGender":{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","name":"filterGender","display-name":"Filtergender","type":"text"},"filterEvent":{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","name":"filterEvent","display-name":"Filterevent","type":"text"},"filterState":{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","name":"filterState","display-name":"Filterstate","type":"text"},"filterOffice":{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","name":"filterOffice","display-name":"Filteroffice","type":"text"}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , birthOrder: ''$birthOrder''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$eq: [''$birthOrder'', 1]}] }, then: ''1''},\n {case: {$and: [{$eq: [''$birthOrder'', 2]}] }, then: ''2''},\n {case: {$and: [{$eq: [''$birthOrder'', 3]}] }, then: ''3''},\n {case: {$and: [{$eq: [''$birthOrder'', 4]}] }, then: ''4''},\n {case: {$and: [{$eq: [''$birthOrder'', 5]}] }, then: ''5''},\n {case: {$and: [{$gte: [''$birthOrder'', 6]}] }, then: ''6+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Order\": 1\n }\n }\n]","collection":"analyticsRegistrations"},"type":"native"},"id":19,"parameter_mappings":[],"display":"bar","entity_id":"L6nXdi04nvxgEh1eJYrwR","collection_preview":true,"visualization_settings":{"graph.show_values":true,"pie.dimension":"birthOrder","graph.series_order_dimension":null,"graph.x_axis.title_text":"Birth Order","graph.metrics":["Count"],"graph.series_order":null,"pie.metric":"count","series_settings":{"Count":{"color":"#7172AD"}},"graph.dimensions":["Order"]},"is_write":false,"parameters":[{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","type":"category","target":["variable",["template-tag","filterGender"]],"name":"Filtergender","slug":"filterGender"},{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","type":"category","target":["variable",["template-tag","filterEvent"]],"name":"Filtereven', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(571, 1, 't","slug":"filterEvent"},{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","type":"category","target":["variable",["template-tag","filterState"]],"name":"Filterstate","slug":"filterState"},{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","type":"category","target":["variable",["template-tag","filterOffice"]],"name":"Filteroffice","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(572, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":12,"query_type":"native","name":"Live births by age of Mother","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterGender":{"id":"56559614-c685-9d81-d44b-a688fe5b103b","name":"filterGender","display-name":"Filtergender","type":"text"},"filterEvent":{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","name":"filterEvent","display-name":"Filterevent","type":"text"},"filterState":{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","name":"filterState","display-name":"Filterstate","type":"text"},"filterOffice":{"id":"8b07b619-ea79-a772-e83a-92f986ab040c","name":"filterOffice","display-name":"Filteroffice","type":"text"}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , mothersAge: ''$mothersAgeAtBirthOfChildInYears''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [ {gte: [''$mothersAge'', 9.0]}, {lte: [''$mothersAge'', 14.0]}] }, then: ''9-14''},\n {case: {$and: [ {gt: [''$mothersAge'', 14]}, {lte: [''$mothersAge'', 19]}] }, then: ''15-19''},\n {case: {$and: [ {gt: [''$mothersAge'', 19]}, {lte: [''$mothersAge'', 24]}] }, then: ''20-24''},\n {case: {$and: [ {gt: [''$mothersAge'', 24]}, {lte: [''$mothersAge'', 29]}] }, then: ''25-29''},\n {case: {$and: [ {gt: [''$mothersAge'', 29]}, {lte: [''$mothersAge'', 34]}] }, then: ''30-34''},\n {case: {$and: [ {gt: [''$mothersAge'', 34]}, {lte: [''$mothersAge'', 39]}] }, then: ''35-39''},\n {case: {$and: [ {gt: [''$mothersAge'', 39]}, {lte: [''$mothersAge'', 44]}] }, then: ''40-44''},\n {case: {$and: [ {gt: [''$mothersAge'', 44]}, {lte: [''$mothersAge'', 49]}] }, then: ''45-49''},\n {case: {$and: [ {gt: [''$mothersAge'', 49]}, {lte: [''$mothersAge'', 54]}] }, then: ''50-54''},\n {case: {$and: [ {gt: [''$mothersAge'', 54]}, {lte: [''$mothersAge'', 59]}] }, then: ''55-59''},\n {case: {$and: [ {gt: [''$mothersAge'', 59]} ]}, then: ''60+''}\n\n \n\n\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Order\": 1\n }\n }\n]","collection":"analyticsRegistrations"},"type":"', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(572, 1, 'native"},"id":20,"parameter_mappings":[],"display":"table","entity_id":"PcnknQN2IYs_mJkwA8yRq","collection_preview":true,"visualization_settings":{"table.pivot_column":"Order","table.cell_column":"Count"},"is_write":false,"parameters":[{"id":"56559614-c685-9d81-d44b-a688fe5b103b","type":"category","target":["variable",["template-tag","filterGender"]],"name":"Filtergender","slug":"filterGender"},{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","type":"category","target":["variable",["template-tag","filterEvent"]],"name":"Filterevent","slug":"filterEvent"},{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","type":"category","target":["variable",["template-tag","filterState"]],"name":"Filterstate","slug":"filterState"},{"id":"8b07b619-ea79-a772-e83a-92f986ab040c","type":"category","target":["variable",["template-tag","filterOffice"]],"name":"Filteroffice","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(573, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":12,"query_type":"native","name":"Live births by age of Mother","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterGender":{"id":"56559614-c685-9d81-d44b-a688fe5b103b","name":"filterGender","display-name":"Filtergender","type":"text"},"filterEvent":{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","name":"filterEvent","display-name":"Filterevent","type":"text"},"filterState":{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","name":"filterState","display-name":"Filterstate","type":"text"},"filterOffice":{"id":"8b07b619-ea79-a772-e83a-92f986ab040c","name":"filterOffice","display-name":"Filteroffice","type":"text"}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , mothersAge: ''$mothersAgeAtBirthOfChildInYears''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$gte: [''$mothersAge'', 9]}, {$lt: [''$mothersAge'', 15]}] }, then: ''9-14''},\n {case: {$and: [{$gte: [''$mothersAge'', 15]}, {$lt: [''$mothersAge'', 20]}] }, then: ''15-19''},\n {case: {$and: [{$gte: [''$mothersAge'', 20]}, {$lt: [''$mothersAge'', 25]}] }, then: ''20-24''},\n {case: {$and: [{$gte: [''$mothersAge'', 25]}, {$lt: [''$mothersAge'', 30]}] }, then: ''25-29''},\n {case: {$and: [{$gte: [''$mothersAge'', 30]}, {$lt: [''$mothersAge'', 35]}] }, then: ''30-34''},\n {case: {$and: [{$gte: [''$mothersAge'', 35]}, {$lt: [''$mothersAge'', 40]}] }, then: ''35-39''},\n {case: {$and: [{$gte: [''$mothersAge'', 40]}, {$lt: [''$mothersAge'', 45]}] }, then: ''40-44''},\n {case: {$and: [{$gte: [''$mothersAge'', 45]}, {$lt: [''$mothersAge'', 50]}] }, then: ''45-49''},\n {case: {$and: [{$gte: [''$mothersAge'', 50]}, {$lt: [''$mothersAge'', 55]}] }, then: ''50-54''},\n {case: {$and: [{$gte: [''$mothersAge'', 55]}, {$lt: [''$mothersAge'', 60]}] }, then: ''55-59''},\n {case: {$and: [{$gte: [''$mothersAge'', 60]}] }, then: ''60+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Count\": -1\n }\n }\n]","collection":"analyticsRegistrations"},"type":"native"},"id"', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(573, 1, ':20,"parameter_mappings":[],"display":"bar","entity_id":"PcnknQN2IYs_mJkwA8yRq","collection_preview":true,"visualization_settings":{"table.pivot_column":"Order","table.cell_column":"Count","graph.dimensions":["Order"],"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"56559614-c685-9d81-d44b-a688fe5b103b","type":"category","target":["variable",["template-tag","filterGender"]],"name":"Filtergender","slug":"filterGender"},{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","type":"category","target":["variable",["template-tag","filterEvent"]],"name":"Filterevent","slug":"filterEvent"},{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","type":"category","target":["variable",["template-tag","filterState"]],"name":"Filterstate","slug":"filterState"},{"id":"8b07b619-ea79-a772-e83a-92f986ab040c","type":"category","target":["variable",["template-tag","filterOffice"]],"name":"Filteroffice","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(574, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":12,"query_type":"native","name":"Live births by age of Mother","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , mothersAge: ''$mothersAgeAtBirthOfChildInYears''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$gte: [''$mothersAge'', 9]}, {$lt: [''$mothersAge'', 15]}] }, then: ''9-14''},\n {case: {$and: [{$gte: [''$mothersAge'', 15]}, {$lt: [''$mothersAge'', 20]}] }, then: ''15-19''},\n {case: {$and: [{$gte: [''$mothersAge'', 20]}, {$lt: [''$mothersAge'', 25]}] }, then: ''20-24''},\n {case: {$and: [{$gte: [''$mothersAge'', 25]}, {$lt: [''$mothersAge'', 30]}] }, then: ''25-29''},\n {case: {$and: [{$gte: [''$mothersAge'', 30]}, {$lt: [''$mothersAge'', 35]}] }, then: ''30-34''},\n {case: {$and: [{$gte: [''$mothersAge'', 35]}, {$lt: [''$mothersAge'', 40]}] }, then: ''35-39''},\n {case: {$and: [{$gte: [''$mothersAge'', 40]}, {$lt: [''$mothersAge'', 45]}] }, then: ''40-44''},\n {case: {$and: [{$gte: [''$mothersAge'', 45]}, {$lt: [''$mothersAge'', 50]}] }, then: ''45-49''},\n {case: {$and: [{$gte: [''$mothersAge'', 50]}, {$lt: [''$mothersAge'', 55]}] }, then: ''50-54''},\n {case: {$and: [{$gte: [''$mothersAge'', 55]}, {$lt: [''$mothersAge'', 60]}] }, then: ''55-59''},\n {case: {$and: [{$gte: [''$mothersAge'', 60]}] }, then: ''60+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Count\": -1\n }\n }\n]","template-tags":{"filterGender":{"id":"56559614-c685-9d81-d44b-a688fe5b103b","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","name":"filterState","display-name":', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(574, 1, '"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"8b07b619-ea79-a772-e83a-92f986ab040c","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}}},"database":2},"id":20,"parameter_mappings":[],"display":"bar","entity_id":"PcnknQN2IYs_mJkwA8yRq","collection_preview":true,"visualization_settings":{"table.pivot_column":"Order","table.cell_column":"Count","graph.dimensions":["Order"],"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"56559614-c685-9d81-d44b-a688fe5b103b","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"8b07b619-ea79-a772-e83a-92f986ab040c","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(575, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":14,"query_type":"native","name":"Live Births by Level of Education of Parent","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n fathersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersAttainment\": \"$fathersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": \"$_id\"\n , count: \"$count\"\n }},\n {$addFields: {\n attainment: \"fathersAttainment\"\n }}\n ]\n , mothersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersAttainment\": \"$mothersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": \"$_id\"\n , count: \"$count\"\n }},\n {$addFields: {\n attainment: \"mothersAttainment\"\n }}\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersAttainment\", \"$mothersAttainment\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Educational Attainment'': \"$allInfo._id\"\n , ''Attainment'': \"$allInfo.attainment\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Attainment\": -1\n }\n }\n]\n","template-tags":{"filterGender":{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}}},"database":2},"id":21,"parameter_mappings":[],"display":"bar","entity_id":"W6bdia0Vw-6PC1efnHIR4","collection_preview":true,"visualization_settings":{"pie.dimension":"Category","pie.metric":"Count","graph.dimensions":["Educational Attainment","Attainment"],"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","type":"string/=","target":["dimension",["template-tag","filte', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(575, 1, 'rEvent"]],"name":"Event","slug":"filterEvent"},{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(576, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":11,"query_type":"native","name":"Live births by Order","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , birthOrder: ''$birthOrder''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$eq: [''$birthOrder'', 1]}] }, then: ''1''},\n {case: {$and: [{$eq: [''$birthOrder'', 2]}] }, then: ''2''},\n {case: {$and: [{$eq: [''$birthOrder'', 3]}] }, then: ''3''},\n {case: {$and: [{$eq: [''$birthOrder'', 4]}] }, then: ''4''},\n {case: {$and: [{$eq: [''$birthOrder'', 5]}] }, then: ''5''},\n {case: {$and: [{$gte: [''$birthOrder'', 6]}] }, then: ''6+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Order\": 1\n }\n }\n]","template-tags":{"filterGender":{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"996f1d61-a845-0afe-bb4c-f36ac4ab32be","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}}},"database":2},"id":19,"parameter_mappings":[],"display":"bar","entity_id":"L6nXdi04nvxgEh1eJYrwR","collection_preview":true,"visualization_settings":{"graph.show_values":true,"pie.dimension":"birthOrder","gra', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(576, 1, 'ph.series_order_dimension":null,"graph.x_axis.title_text":"Birth Order","graph.metrics":["Count"],"graph.series_order":null,"pie.metric":"count","series_settings":{"Count":{"color":"#7172AD"}},"graph.dimensions":["Order"]},"is_write":false,"parameters":[{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"996f1d61-a845-0afe-bb4c-f36ac4ab32be","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(577, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":10,"query_type":"native","name":"Literacy of parents","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n fathersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersLiteracy\": \"$fathersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": \"$_id\"\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"fathersLiteracy\"\n }}\n ]\n , mothersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersLiteracy\": \"$mothersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$addFields: {\n literacy: \"mothersLiteracy\"\n }}\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersLiteracy\", \"$mothersLiteracy\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Category'': \"$allInfo._id\"\n , ''Literacy'': \"$allInfo.literacy\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Literacy\": -1\n }\n }\n]\n","template-tags":{"filterGender":{"id":"e8218caf-e2aa-573e-1776-02cffff42462","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"bf69e085-3c01-7924-5108-7151c85dc371","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}}},"database":2},"id":18,"parameter_mappings":[],"display":"bar","entity_id":"eRSJUaHW6haiucK8BtpC_","collection_preview":true,"visualization_settings":{"graph.show_values":true,"graph.label_value_formatting":"auto","graph.dimensions":["Category","Literacy"],"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"e8218caf-e2aa-573e-1776-02cffff42462","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"bf69e085-3c01-7924-5108-7151c85dc371","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"0debbb0c-3e5f-021c-9188-', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(577, 1, '83371bf19895","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(578, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":12,"query_type":"native","name":"Live births by age of Mother","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , mothersAge: ''$mothersAgeAtBirthOfChildInYears''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$gte: [''$mothersAge'', 9]}, {$lt: [''$mothersAge'', 15]}] }, then: ''9-14''},\n {case: {$and: [{$gte: [''$mothersAge'', 15]}, {$lt: [''$mothersAge'', 20]}] }, then: ''15-19''},\n {case: {$and: [{$gte: [''$mothersAge'', 20]}, {$lt: [''$mothersAge'', 25]}] }, then: ''20-24''},\n {case: {$and: [{$gte: [''$mothersAge'', 25]}, {$lt: [''$mothersAge'', 30]}] }, then: ''25-29''},\n {case: {$and: [{$gte: [''$mothersAge'', 30]}, {$lt: [''$mothersAge'', 35]}] }, then: ''30-34''},\n {case: {$and: [{$gte: [''$mothersAge'', 35]}, {$lt: [''$mothersAge'', 40]}] }, then: ''35-39''},\n {case: {$and: [{$gte: [''$mothersAge'', 40]}, {$lt: [''$mothersAge'', 45]}] }, then: ''40-44''},\n {case: {$and: [{$gte: [''$mothersAge'', 45]}, {$lt: [''$mothersAge'', 50]}] }, then: ''45-49''},\n {case: {$and: [{$gte: [''$mothersAge'', 50]}, {$lt: [''$mothersAge'', 55]}] }, then: ''50-54''},\n {case: {$and: [{$gte: [''$mothersAge'', 55]}, {$lt: [''$mothersAge'', 60]}] }, then: ''55-59''},\n {case: {$and: [{$gte: [''$mothersAge'', 60]}] }, then: ''60+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Count\": -1\n }\n }\n]","template-tags":{"filterGender":{"id":"56559614-c685-9d81-d44b-a688fe5b103b","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11",', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(578, 1, '"name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"8b07b619-ea79-a772-e83a-92f986ab040c","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}}},"database":2},"id":20,"parameter_mappings":[],"display":"bar","entity_id":"PcnknQN2IYs_mJkwA8yRq","collection_preview":true,"visualization_settings":{"table.pivot_column":"Order","table.cell_column":"Count","graph.dimensions":["Order"],"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"56559614-c685-9d81-d44b-a688fe5b103b","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"8b07b619-ea79-a772-e83a-92f986ab040c","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(579, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":14,"query_type":"native","name":"Live Births by Level of Education of Parent","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n fathersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersAttainment\": \"$fathersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": \"$_id\"\n , count: \"$count\"\n }},\n {$addFields: {\n attainment: \"fathersAttainment\"\n }}\n ]\n , mothersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersAttainment\": \"$mothersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": \"$_id\"\n , count: \"$count\"\n }},\n {$addFields: {\n attainment: \"mothersAttainment\"\n }}\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersAttainment\", \"$mothersAttainment\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Educational Attainment'': \"$allInfo._id\"\n , ''Attainment'': \"$allInfo.attainment\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Attainment\": -1\n }\n }\n]\n","template-tags":{"filterGender":{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}}},"database":2},"id":21,"parameter_mappings":[],"display":"bar","entity_id":"W6bdia0Vw-6PC1efnHIR4","collection_preview":true,"visualization_settings":{"pie.dimension":"Category","pie.metric":"Count","graph.dimensions":["Educational Attainment","Attainment"],"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","type":"string/=","target"', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(579, 1, ':["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(580, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":14,"query_type":"native","name":"Live Births by Level of Education of Parent","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n fathersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersAttainment\": \"$fathersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": \"$_id\"\n , count: \"$count\"\n }},\n {$addFields: {\n attainment: \"fathersAttainment\"\n }}\n ]\n , mothersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersAttainment\": \"$mothersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": \"$_id\"\n , count: \"$count\"\n }},\n {$addFields: {\n attainment: \"mothersAttainment\"\n }}\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersAttainment\", \"$mothersAttainment\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Educational Attainment'': \"$allInfo._id\"\n , ''Attainment'': \"$allInfo.attainment\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Attainment\": -1\n }\n }\n]\n","template-tags":{"filterGender":{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}}},"database":2},"id":21,"parameter_mappings":[],"display":"bar","entity_id":"W6bdia0Vw-6PC1efnHIR4","collection_preview":true,"visualization_settings":{"pie.dimension":"Category","pie.metric":"Count","graph.dimensions":["Educational Attainment","Attainment"],"graph.show_values":true,"graph.x_axis.axis_enabled":"compact","graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"8', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(580, 1, 'e0c3f0a-82b1-067f-aeaf-69750553ec6e","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(581, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":14,"query_type":"native","name":"Live Births by Level of Education of Parent","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n fathersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersAttainment\": \"$fathersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": \"$_id\"\n , count: \"$count\"\n }},\n {$addFields: {\n attainment: \"fathersAttainment\"\n }}\n ]\n , mothersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersAttainment\": \"$mothersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": \"$_id\"\n , count: \"$count\"\n }},\n {$addFields: {\n attainment: \"mothersAttainment\"\n }}\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersAttainment\", \"$mothersAttainment\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Educational Attainment'': \"$allInfo._id\"\n , ''Attainment'': \"$allInfo.attainment\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Attainment\": -1\n }\n }\n]\n","template-tags":{"filterGender":{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}}},"database":2},"id":21,"parameter_mappings":[],"display":"bar","entity_id":"W6bdia0Vw-6PC1efnHIR4","collection_preview":true,"visualization_settings":{"pie.dimension":"Category","pie.metric":"Count","graph.dimensions":["Educational Attainment","Attainment"],"graph.show_values":true,"graph.x_axis.axis_enabled":true,"graph.y_axis.auto_split":true,"graph.y_axis.auto_range":true,"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","type":"string/=","target":["dimension",["template-tag","filter', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(581, 1, 'Gender"]],"name":"Gender","slug":"filterGender"},{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(582, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":14,"query_type":"native","name":"Live Births by Level of Education of Parent","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n fathersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersAttainment\": \"$fathersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": \"$_id\"\n , count: \"$count\"\n }},\n {$addFields: {\n attainment: \"fathersAttainment\"\n }}\n ]\n , mothersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersAttainment\": \"$mothersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": \"$_id\"\n , count: \"$count\"\n }},\n {$addFields: {\n attainment: \"mothersAttainment\"\n }}\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersAttainment\", \"$mothersAttainment\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Educational Attainment'': \"$allInfo._id\"\n , ''Attainment'': \"$allInfo.attainment\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Attainment\": -1\n }\n }\n]\n","template-tags":{"filterGender":{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}}},"database":2},"id":21,"parameter_mappings":[],"display":"row","entity_id":"W6bdia0Vw-6PC1efnHIR4","collection_preview":true,"visualization_settings":{"pie.dimension":"Category","pie.metric":"Count","graph.dimensions":["Educational Attainment","Attainment"],"graph.show_values":true,"graph.x_axis.axis_enabled":true,"graph.y_axis.auto_split":true,"graph.y_axis.auto_range":true,"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","type":"string/=","target":["dimension",["template-tag","filter', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(570, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":11,"query_type":"native","name":"Live births by Order","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterGender":{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","name":"filterGender","display-name":"Filtergender","type":"text"},"filterEvent":{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","name":"filterEvent","display-name":"Filterevent","type":"text"},"filterState":{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","name":"filterState","display-name":"Filterstate","type":"text"},"filterOffice":{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","name":"filterOffice","display-name":"Filteroffice","type":"text"}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , birthOrder: ''$birthOrder''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$eq: [''$birthOrder'', 1]}] }, then: ''1''},\n {case: {$and: [{$eq: [''$birthOrder'', 2]}] }, then: ''2''},\n {case: {$and: [{$eq: [''$birthOrder'', 3]}] }, then: ''3''},\n {case: {$and: [{$eq: [''$birthOrder'', 4]}] }, then: ''4''},\n {case: {$and: [{$eq: [''$birthOrder'', 5]}] }, then: ''5''},\n {case: {$and: [{$gte: [''$birthOrder'', 6]}] }, then: ''6+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''birthOrder'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"birthOrder\": 1\n }\n }\n]","collection":"analyticsRegistrations"},"type":"native"},"id":19,"parameter_mappings":[],"display":"bar","entity_id":"L6nXdi04nvxgEh1eJYrwR","collection_preview":true,"visualization_settings":{"pie.dimension":"birthOrder","pie.metric":"count","graph.dimensions":["birthOrder"],"graph.series_order_dimension":null,"graph.series_order":null,"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","type":"category","target":["variable",["template-tag","filterGender"]],"name":"Filtergender","slug":"filterGender"},{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","type":"category","target":["variable",["template-tag","filterEvent"]],"name":"Filterevent","slug":"filterEvent"},{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","type":"category","target":[', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(570, 1, '"variable",["template-tag","filterState"]],"name":"Filterstate","slug":"filterState"},{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","type":"category","target":["variable",["template-tag","filterOffice"]],"name":"Filteroffice","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(571, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":11,"query_type":"native","name":"Live births by Order","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterGender":{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","name":"filterGender","display-name":"Filtergender","type":"text"},"filterEvent":{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","name":"filterEvent","display-name":"Filterevent","type":"text"},"filterState":{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","name":"filterState","display-name":"Filterstate","type":"text"},"filterOffice":{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","name":"filterOffice","display-name":"Filteroffice","type":"text"}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , birthOrder: ''$birthOrder''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$eq: [''$birthOrder'', 1]}] }, then: ''1''},\n {case: {$and: [{$eq: [''$birthOrder'', 2]}] }, then: ''2''},\n {case: {$and: [{$eq: [''$birthOrder'', 3]}] }, then: ''3''},\n {case: {$and: [{$eq: [''$birthOrder'', 4]}] }, then: ''4''},\n {case: {$and: [{$eq: [''$birthOrder'', 5]}] }, then: ''5''},\n {case: {$and: [{$gte: [''$birthOrder'', 6]}] }, then: ''6+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''birthOrder'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"birthOrder\": 1\n }\n }\n]","collection":"analyticsRegistrations"},"type":"native"},"id":19,"parameter_mappings":[],"display":"bar","entity_id":"L6nXdi04nvxgEh1eJYrwR","collection_preview":true,"visualization_settings":{"graph.show_values":true,"pie.dimension":"birthOrder","graph.series_order_dimension":null,"graph.x_axis.title_text":"Birth Order","graph.metrics":["Count"],"graph.series_order":null,"pie.metric":"count","series_settings":{"Count":{"color":"#7172AD"}},"graph.dimensions":["birthOrder"]},"is_write":false,"parameters":[{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","type":"category","target":["variable",["template-tag","filterGender"]],"name":"Filtergender","slug":"filterGender"},{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","type":"category","target":["variable",["template-tag","filterEvent"]],"na', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(571, 1, 'me":"Filterevent","slug":"filterEvent"},{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","type":"category","target":["variable",["template-tag","filterState"]],"name":"Filterstate","slug":"filterState"},{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","type":"category","target":["variable",["template-tag","filterOffice"]],"name":"Filteroffice","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(572, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":11,"query_type":"native","name":"Live births by Order","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterGender":{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","name":"filterGender","display-name":"Filtergender","type":"text"},"filterEvent":{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","name":"filterEvent","display-name":"Filterevent","type":"text"},"filterState":{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","name":"filterState","display-name":"Filterstate","type":"text"},"filterOffice":{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","name":"filterOffice","display-name":"Filteroffice","type":"text"}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , birthOrder: ''$birthOrder''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$eq: [''$birthOrder'', 1]}] }, then: ''1''},\n {case: {$and: [{$eq: [''$birthOrder'', 2]}] }, then: ''2''},\n {case: {$and: [{$eq: [''$birthOrder'', 3]}] }, then: ''3''},\n {case: {$and: [{$eq: [''$birthOrder'', 4]}] }, then: ''4''},\n {case: {$and: [{$eq: [''$birthOrder'', 5]}] }, then: ''5''},\n {case: {$and: [{$gte: [''$birthOrder'', 6]}] }, then: ''6+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Order\": 1\n }\n }\n]","collection":"analyticsRegistrations"},"type":"native"},"id":19,"parameter_mappings":[],"display":"bar","entity_id":"L6nXdi04nvxgEh1eJYrwR","collection_preview":true,"visualization_settings":{"graph.show_values":true,"pie.dimension":"birthOrder","graph.series_order_dimension":null,"graph.x_axis.title_text":"Birth Order","graph.metrics":["Count"],"graph.series_order":null,"pie.metric":"count","series_settings":{"Count":{"color":"#7172AD"}},"graph.dimensions":["Order"]},"is_write":false,"parameters":[{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","type":"category","target":["variable",["template-tag","filterGender"]],"name":"Filtergender","slug":"filterGender"},{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","type":"category","target":["variable",["template-tag","filterEvent"]],"name":"Filtereven', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(572, 1, 't","slug":"filterEvent"},{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","type":"category","target":["variable",["template-tag","filterState"]],"name":"Filterstate","slug":"filterState"},{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","type":"category","target":["variable",["template-tag","filterOffice"]],"name":"Filteroffice","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(573, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":12,"query_type":"native","name":"Live births by age of Mother","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterGender":{"id":"56559614-c685-9d81-d44b-a688fe5b103b","name":"filterGender","display-name":"Filtergender","type":"text"},"filterEvent":{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","name":"filterEvent","display-name":"Filterevent","type":"text"},"filterState":{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","name":"filterState","display-name":"Filterstate","type":"text"},"filterOffice":{"id":"8b07b619-ea79-a772-e83a-92f986ab040c","name":"filterOffice","display-name":"Filteroffice","type":"text"}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , mothersAge: ''$mothersAgeAtBirthOfChildInYears''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [ {gte: [''$mothersAge'', 9.0]}, {lte: [''$mothersAge'', 14.0]}] }, then: ''9-14''},\n {case: {$and: [ {gt: [''$mothersAge'', 14]}, {lte: [''$mothersAge'', 19]}] }, then: ''15-19''},\n {case: {$and: [ {gt: [''$mothersAge'', 19]}, {lte: [''$mothersAge'', 24]}] }, then: ''20-24''},\n {case: {$and: [ {gt: [''$mothersAge'', 24]}, {lte: [''$mothersAge'', 29]}] }, then: ''25-29''},\n {case: {$and: [ {gt: [''$mothersAge'', 29]}, {lte: [''$mothersAge'', 34]}] }, then: ''30-34''},\n {case: {$and: [ {gt: [''$mothersAge'', 34]}, {lte: [''$mothersAge'', 39]}] }, then: ''35-39''},\n {case: {$and: [ {gt: [''$mothersAge'', 39]}, {lte: [''$mothersAge'', 44]}] }, then: ''40-44''},\n {case: {$and: [ {gt: [''$mothersAge'', 44]}, {lte: [''$mothersAge'', 49]}] }, then: ''45-49''},\n {case: {$and: [ {gt: [''$mothersAge'', 49]}, {lte: [''$mothersAge'', 54]}] }, then: ''50-54''},\n {case: {$and: [ {gt: [''$mothersAge'', 54]}, {lte: [''$mothersAge'', 59]}] }, then: ''55-59''},\n {case: {$and: [ {gt: [''$mothersAge'', 59]} ]}, then: ''60+''}\n\n \n\n\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Order\": 1\n }\n }\n]","collection":"analyticsRegistrations"},"type":"', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(573, 1, 'native"},"id":20,"parameter_mappings":[],"display":"table","entity_id":"PcnknQN2IYs_mJkwA8yRq","collection_preview":true,"visualization_settings":{"table.pivot_column":"Order","table.cell_column":"Count"},"is_write":false,"parameters":[{"id":"56559614-c685-9d81-d44b-a688fe5b103b","type":"category","target":["variable",["template-tag","filterGender"]],"name":"Filtergender","slug":"filterGender"},{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","type":"category","target":["variable",["template-tag","filterEvent"]],"name":"Filterevent","slug":"filterEvent"},{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","type":"category","target":["variable",["template-tag","filterState"]],"name":"Filterstate","slug":"filterState"},{"id":"8b07b619-ea79-a772-e83a-92f986ab040c","type":"category","target":["variable",["template-tag","filterOffice"]],"name":"Filteroffice","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(574, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":12,"query_type":"native","name":"Live births by age of Mother","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterGender":{"id":"56559614-c685-9d81-d44b-a688fe5b103b","name":"filterGender","display-name":"Filtergender","type":"text"},"filterEvent":{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","name":"filterEvent","display-name":"Filterevent","type":"text"},"filterState":{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","name":"filterState","display-name":"Filterstate","type":"text"},"filterOffice":{"id":"8b07b619-ea79-a772-e83a-92f986ab040c","name":"filterOffice","display-name":"Filteroffice","type":"text"}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , mothersAge: ''$mothersAgeAtBirthOfChildInYears''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$gte: [''$mothersAge'', 9]}, {$lt: [''$mothersAge'', 15]}] }, then: ''9-14''},\n {case: {$and: [{$gte: [''$mothersAge'', 15]}, {$lt: [''$mothersAge'', 20]}] }, then: ''15-19''},\n {case: {$and: [{$gte: [''$mothersAge'', 20]}, {$lt: [''$mothersAge'', 25]}] }, then: ''20-24''},\n {case: {$and: [{$gte: [''$mothersAge'', 25]}, {$lt: [''$mothersAge'', 30]}] }, then: ''25-29''},\n {case: {$and: [{$gte: [''$mothersAge'', 30]}, {$lt: [''$mothersAge'', 35]}] }, then: ''30-34''},\n {case: {$and: [{$gte: [''$mothersAge'', 35]}, {$lt: [''$mothersAge'', 40]}] }, then: ''35-39''},\n {case: {$and: [{$gte: [''$mothersAge'', 40]}, {$lt: [''$mothersAge'', 45]}] }, then: ''40-44''},\n {case: {$and: [{$gte: [''$mothersAge'', 45]}, {$lt: [''$mothersAge'', 50]}] }, then: ''45-49''},\n {case: {$and: [{$gte: [''$mothersAge'', 50]}, {$lt: [''$mothersAge'', 55]}] }, then: ''50-54''},\n {case: {$and: [{$gte: [''$mothersAge'', 55]}, {$lt: [''$mothersAge'', 60]}] }, then: ''55-59''},\n {case: {$and: [{$gte: [''$mothersAge'', 60]}] }, then: ''60+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Count\": -1\n }\n }\n]","collection":"analyticsRegistrations"},"type":"native"},"id"', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(574, 1, ':20,"parameter_mappings":[],"display":"bar","entity_id":"PcnknQN2IYs_mJkwA8yRq","collection_preview":true,"visualization_settings":{"table.pivot_column":"Order","table.cell_column":"Count","graph.dimensions":["Order"],"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"56559614-c685-9d81-d44b-a688fe5b103b","type":"category","target":["variable",["template-tag","filterGender"]],"name":"Filtergender","slug":"filterGender"},{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","type":"category","target":["variable",["template-tag","filterEvent"]],"name":"Filterevent","slug":"filterEvent"},{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","type":"category","target":["variable",["template-tag","filterState"]],"name":"Filterstate","slug":"filterState"},{"id":"8b07b619-ea79-a772-e83a-92f986ab040c","type":"category","target":["variable",["template-tag","filterOffice"]],"name":"Filteroffice","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(575, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":12,"query_type":"native","name":"Live births by age of Mother","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , mothersAge: ''$mothersAgeAtBirthOfChildInYears''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$gte: [''$mothersAge'', 9]}, {$lt: [''$mothersAge'', 15]}] }, then: ''9-14''},\n {case: {$and: [{$gte: [''$mothersAge'', 15]}, {$lt: [''$mothersAge'', 20]}] }, then: ''15-19''},\n {case: {$and: [{$gte: [''$mothersAge'', 20]}, {$lt: [''$mothersAge'', 25]}] }, then: ''20-24''},\n {case: {$and: [{$gte: [''$mothersAge'', 25]}, {$lt: [''$mothersAge'', 30]}] }, then: ''25-29''},\n {case: {$and: [{$gte: [''$mothersAge'', 30]}, {$lt: [''$mothersAge'', 35]}] }, then: ''30-34''},\n {case: {$and: [{$gte: [''$mothersAge'', 35]}, {$lt: [''$mothersAge'', 40]}] }, then: ''35-39''},\n {case: {$and: [{$gte: [''$mothersAge'', 40]}, {$lt: [''$mothersAge'', 45]}] }, then: ''40-44''},\n {case: {$and: [{$gte: [''$mothersAge'', 45]}, {$lt: [''$mothersAge'', 50]}] }, then: ''45-49''},\n {case: {$and: [{$gte: [''$mothersAge'', 50]}, {$lt: [''$mothersAge'', 55]}] }, then: ''50-54''},\n {case: {$and: [{$gte: [''$mothersAge'', 55]}, {$lt: [''$mothersAge'', 60]}] }, then: ''55-59''},\n {case: {$and: [{$gte: [''$mothersAge'', 60]}] }, then: ''60+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Count\": -1\n }\n }\n]","template-tags":{"filterGender":{"id":"56559614-c685-9d81-d44b-a688fe5b103b","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","name":"filterState","display-name":', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(575, 1, '"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"8b07b619-ea79-a772-e83a-92f986ab040c","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}}},"database":2},"id":20,"parameter_mappings":[],"display":"bar","entity_id":"PcnknQN2IYs_mJkwA8yRq","collection_preview":true,"visualization_settings":{"table.pivot_column":"Order","table.cell_column":"Count","graph.dimensions":["Order"],"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"56559614-c685-9d81-d44b-a688fe5b103b","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"8b07b619-ea79-a772-e83a-92f986ab040c","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(576, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":14,"query_type":"native","name":"Live Births by Level of Education of Parent","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n fathersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersAttainment\": \"$fathersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": \"$_id\"\n , count: \"$count\"\n }},\n {$addFields: {\n attainment: \"fathersAttainment\"\n }}\n ]\n , mothersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersAttainment\": \"$mothersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": \"$_id\"\n , count: \"$count\"\n }},\n {$addFields: {\n attainment: \"mothersAttainment\"\n }}\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersAttainment\", \"$mothersAttainment\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Educational Attainment'': \"$allInfo._id\"\n , ''Attainment'': \"$allInfo.attainment\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Attainment\": -1\n }\n }\n]\n","template-tags":{"filterGender":{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}}},"database":2},"id":21,"parameter_mappings":[],"display":"bar","entity_id":"W6bdia0Vw-6PC1efnHIR4","collection_preview":true,"visualization_settings":{"pie.dimension":"Category","pie.metric":"Count","graph.dimensions":["Educational Attainment","Attainment"],"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","type":"string/=","target":["dimension",["template-tag","filte', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(576, 1, 'rEvent"]],"name":"Event","slug":"filterEvent"},{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(577, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":11,"query_type":"native","name":"Live births by Order","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , birthOrder: ''$birthOrder''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$eq: [''$birthOrder'', 1]}] }, then: ''1''},\n {case: {$and: [{$eq: [''$birthOrder'', 2]}] }, then: ''2''},\n {case: {$and: [{$eq: [''$birthOrder'', 3]}] }, then: ''3''},\n {case: {$and: [{$eq: [''$birthOrder'', 4]}] }, then: ''4''},\n {case: {$and: [{$eq: [''$birthOrder'', 5]}] }, then: ''5''},\n {case: {$and: [{$gte: [''$birthOrder'', 6]}] }, then: ''6+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Order\": 1\n }\n }\n]","template-tags":{"filterGender":{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"996f1d61-a845-0afe-bb4c-f36ac4ab32be","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}}},"database":2},"id":19,"parameter_mappings":[],"display":"bar","entity_id":"L6nXdi04nvxgEh1eJYrwR","collection_preview":true,"visualization_settings":{"graph.show_values":true,"pie.dimension":"birthOrder","gra', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(577, 1, 'ph.series_order_dimension":null,"graph.x_axis.title_text":"Birth Order","graph.metrics":["Count"],"graph.series_order":null,"pie.metric":"count","series_settings":{"Count":{"color":"#7172AD"}},"graph.dimensions":["Order"]},"is_write":false,"parameters":[{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"996f1d61-a845-0afe-bb4c-f36ac4ab32be","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(578, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":10,"query_type":"native","name":"Literacy of parents","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n fathersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersLiteracy\": \"$fathersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": \"$_id\"\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"fathersLiteracy\"\n }}\n ]\n , mothersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersLiteracy\": \"$mothersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$addFields: {\n literacy: \"mothersLiteracy\"\n }}\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersLiteracy\", \"$mothersLiteracy\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Category'': \"$allInfo._id\"\n , ''Literacy'': \"$allInfo.literacy\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Literacy\": -1\n }\n }\n]\n","template-tags":{"filterGender":{"id":"e8218caf-e2aa-573e-1776-02cffff42462","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"bf69e085-3c01-7924-5108-7151c85dc371","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}}},"database":2},"id":18,"parameter_mappings":[],"display":"bar","entity_id":"eRSJUaHW6haiucK8BtpC_","collection_preview":true,"visualization_settings":{"graph.show_values":true,"graph.label_value_formatting":"auto","graph.dimensions":["Category","Literacy"],"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"e8218caf-e2aa-573e-1776-02cffff42462","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"bf69e085-3c01-7924-5108-7151c85dc371","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"0debbb0c-3e5f-021c-9188-', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(578, 1, '83371bf19895","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(579, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":12,"query_type":"native","name":"Live births by age of Mother","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , mothersAge: ''$mothersAgeAtBirthOfChildInYears''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$gte: [''$mothersAge'', 9]}, {$lt: [''$mothersAge'', 15]}] }, then: ''9-14''},\n {case: {$and: [{$gte: [''$mothersAge'', 15]}, {$lt: [''$mothersAge'', 20]}] }, then: ''15-19''},\n {case: {$and: [{$gte: [''$mothersAge'', 20]}, {$lt: [''$mothersAge'', 25]}] }, then: ''20-24''},\n {case: {$and: [{$gte: [''$mothersAge'', 25]}, {$lt: [''$mothersAge'', 30]}] }, then: ''25-29''},\n {case: {$and: [{$gte: [''$mothersAge'', 30]}, {$lt: [''$mothersAge'', 35]}] }, then: ''30-34''},\n {case: {$and: [{$gte: [''$mothersAge'', 35]}, {$lt: [''$mothersAge'', 40]}] }, then: ''35-39''},\n {case: {$and: [{$gte: [''$mothersAge'', 40]}, {$lt: [''$mothersAge'', 45]}] }, then: ''40-44''},\n {case: {$and: [{$gte: [''$mothersAge'', 45]}, {$lt: [''$mothersAge'', 50]}] }, then: ''45-49''},\n {case: {$and: [{$gte: [''$mothersAge'', 50]}, {$lt: [''$mothersAge'', 55]}] }, then: ''50-54''},\n {case: {$and: [{$gte: [''$mothersAge'', 55]}, {$lt: [''$mothersAge'', 60]}] }, then: ''55-59''},\n {case: {$and: [{$gte: [''$mothersAge'', 60]}] }, then: ''60+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Count\": -1\n }\n }\n]","template-tags":{"filterGender":{"id":"56559614-c685-9d81-d44b-a688fe5b103b","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11",', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(579, 1, '"name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"8b07b619-ea79-a772-e83a-92f986ab040c","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}}},"database":2},"id":20,"parameter_mappings":[],"display":"bar","entity_id":"PcnknQN2IYs_mJkwA8yRq","collection_preview":true,"visualization_settings":{"table.pivot_column":"Order","table.cell_column":"Count","graph.dimensions":["Order"],"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"56559614-c685-9d81-d44b-a688fe5b103b","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"8b07b619-ea79-a772-e83a-92f986ab040c","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(580, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":14,"query_type":"native","name":"Live Births by Level of Education of Parent","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n fathersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersAttainment\": \"$fathersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": \"$_id\"\n , count: \"$count\"\n }},\n {$addFields: {\n attainment: \"fathersAttainment\"\n }}\n ]\n , mothersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersAttainment\": \"$mothersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": \"$_id\"\n , count: \"$count\"\n }},\n {$addFields: {\n attainment: \"mothersAttainment\"\n }}\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersAttainment\", \"$mothersAttainment\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Educational Attainment'': \"$allInfo._id\"\n , ''Attainment'': \"$allInfo.attainment\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Attainment\": -1\n }\n }\n]\n","template-tags":{"filterGender":{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}}},"database":2},"id":21,"parameter_mappings":[],"display":"bar","entity_id":"W6bdia0Vw-6PC1efnHIR4","collection_preview":true,"visualization_settings":{"pie.dimension":"Category","pie.metric":"Count","graph.dimensions":["Educational Attainment","Attainment"],"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","type":"string/=","target"', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(580, 1, ':["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(581, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":14,"query_type":"native","name":"Live Births by Level of Education of Parent","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n fathersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersAttainment\": \"$fathersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": \"$_id\"\n , count: \"$count\"\n }},\n {$addFields: {\n attainment: \"fathersAttainment\"\n }}\n ]\n , mothersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersAttainment\": \"$mothersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": \"$_id\"\n , count: \"$count\"\n }},\n {$addFields: {\n attainment: \"mothersAttainment\"\n }}\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersAttainment\", \"$mothersAttainment\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Educational Attainment'': \"$allInfo._id\"\n , ''Attainment'': \"$allInfo.attainment\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Attainment\": -1\n }\n }\n]\n","template-tags":{"filterGender":{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}}},"database":2},"id":21,"parameter_mappings":[],"display":"bar","entity_id":"W6bdia0Vw-6PC1efnHIR4","collection_preview":true,"visualization_settings":{"pie.dimension":"Category","pie.metric":"Count","graph.dimensions":["Educational Attainment","Attainment"],"graph.show_values":true,"graph.x_axis.axis_enabled":"compact","graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"8', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(581, 1, 'e0c3f0a-82b1-067f-aeaf-69750553ec6e","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(582, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":14,"query_type":"native","name":"Live Births by Level of Education of Parent","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n fathersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersAttainment\": \"$fathersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": \"$_id\"\n , count: \"$count\"\n }},\n {$addFields: {\n attainment: \"fathersAttainment\"\n }}\n ]\n , mothersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersAttainment\": \"$mothersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": \"$_id\"\n , count: \"$count\"\n }},\n {$addFields: {\n attainment: \"mothersAttainment\"\n }}\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersAttainment\", \"$mothersAttainment\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Educational Attainment'': \"$allInfo._id\"\n , ''Attainment'': \"$allInfo.attainment\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Attainment\": -1\n }\n }\n]\n","template-tags":{"filterGender":{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}}},"database":2},"id":21,"parameter_mappings":[],"display":"bar","entity_id":"W6bdia0Vw-6PC1efnHIR4","collection_preview":true,"visualization_settings":{"pie.dimension":"Category","pie.metric":"Count","graph.dimensions":["Educational Attainment","Attainment"],"graph.show_values":true,"graph.x_axis.axis_enabled":true,"graph.y_axis.auto_split":true,"graph.y_axis.auto_range":true,"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","type":"string/=","target":["dimension",["template-tag","filter', NULL); INSERT INTO SYSTEM_LOB_STREAM VALUES(582, 1, 'Gender"]],"name":"Gender","slug":"filterGender"},{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(583, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":14,"query_type":"native","name":"Live Births by Level of Education of Parent","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n fathersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersAttainment\": \"$fathersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": \"$_id\"\n , count: \"$count\"\n }},\n {$addFields: {\n attainment: \"fathersAttainment\"\n }}\n ]\n , mothersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersAttainment\": \"$mothersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": \"$_id\"\n , count: \"$count\"\n }},\n {$addFields: {\n attainment: \"mothersAttainment\"\n }}\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersAttainment\", \"$mothersAttainment\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Educational Attainment'': \"$allInfo._id\"\n , ''Attainment'': \"$allInfo.attainment\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Attainment\": -1\n }\n }\n]\n","template-tags":{"filterGender":{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}}},"database":2},"id":21,"parameter_mappings":[],"display":"bar","entity_id":"W6bdia0Vw-6PC1efnHIR4","collection_preview":true,"visualization_settings":{"pie.dimension":"Educational Attainment","pie.metric":"Count","graph.dimensions":["Educational Attainment","Attainment"],"graph.show_values":true,"graph.x_axis.axis_enabled":true,"graph.y_axis.auto_split":true,"graph.y_axis.auto_range":true,"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","type":"string/=","target":["dimension",["templat', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(583, 1, 'e-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(584, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":14,"query_type":"native","name":"Live Births by Level of Education of Parent","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n fathersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersAttainment\": \"$fathersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": \"$_id\"\n , count: \"$count\"\n }},\n {$addFields: {\n attainment: \"fathersAttainment\"\n }}\n ]\n , mothersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersAttainment\": \"$mothersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": \"$_id\"\n , count: \"$count\"\n }},\n {$addFields: {\n attainment: \"mothersAttainment\"\n }}\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersAttainment\", \"$mothersAttainment\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Educational Attainment'': \"$allInfo._id\"\n , ''Attainment'': \"$allInfo.attainment\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Attainment\": -1\n }\n }\n]\n","template-tags":{"filterGender":{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}}},"database":2},"id":21,"parameter_mappings":[],"display":"bar","entity_id":"W6bdia0Vw-6PC1efnHIR4","collection_preview":true,"visualization_settings":{"graph.show_values":true,"pie.dimension":"Educational Attainment","graph.x_axis.axis_enabled":true,"graph.y_axis.auto_split":true,"graph.metrics":["Count"],"pie.metric":"Count","series_settings":{"mothersAttainment":{"title":"mother"},"fathersAttainment":{"title":"father"}},"graph.y_axis.auto_range":true,"graph.dimensions":["Educational Attainment","Attainment"]},"is_write":false,"parameter', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(584, 1, 's":[{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(585, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":10,"query_type":"native","name":"Literacy of parents","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n fathersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersLiteracy\": \"$fathersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": \"$_id\"\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"fathersLiteracy\"\n }}\n ]\n , mothersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersLiteracy\": \"$mothersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$addFields: {\n literacy: \"mothersLiteracy\"\n }}\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersLiteracy\", \"$mothersLiteracy\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Category'': \"$allInfo._id\"\n , ''Literacy'': \"$allInfo.literacy\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Literacy\": -1\n }\n }\n]\n","template-tags":{"filterGender":{"id":"e8218caf-e2aa-573e-1776-02cffff42462","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"bf69e085-3c01-7924-5108-7151c85dc371","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}}},"database":2},"id":18,"parameter_mappings":[],"display":"bar","entity_id":"eRSJUaHW6haiucK8BtpC_","collection_preview":true,"visualization_settings":{"graph.show_values":true,"graph.label_value_formatting":"auto","graph.dimensions":["Category","Literacy"],"series_settings":{"mothersLiteracy":{"title":"mother"},"fathersLiteracy":{"title":"father"}},"graph.x_axis.title_text":"Literacy","graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"e8218caf-e2aa-573e-1776-02cffff42462","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"bf69e085-3c01-7924-5108-7151c85dc371","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","type":"s', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(585, 1, 'tring/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(583, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":14,"query_type":"native","name":"Live Births by Level of Education of Parent","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n fathersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersAttainment\": \"$fathersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": \"$_id\"\n , count: \"$count\"\n }},\n {$addFields: {\n attainment: \"fathersAttainment\"\n }}\n ]\n , mothersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersAttainment\": \"$mothersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": \"$_id\"\n , count: \"$count\"\n }},\n {$addFields: {\n attainment: \"mothersAttainment\"\n }}\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersAttainment\", \"$mothersAttainment\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Educational Attainment'': \"$allInfo._id\"\n , ''Attainment'': \"$allInfo.attainment\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Attainment\": -1\n }\n }\n]\n","template-tags":{"filterGender":{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}}},"database":2},"id":21,"parameter_mappings":[],"display":"row","entity_id":"W6bdia0Vw-6PC1efnHIR4","collection_preview":true,"visualization_settings":{"pie.dimension":"Category","pie.metric":"Count","graph.dimensions":["Educational Attainment","Attainment"],"graph.show_values":true,"graph.x_axis.axis_enabled":true,"graph.y_axis.auto_split":true,"graph.y_axis.auto_range":true,"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","type":"string/=","target":["dimension",["template-tag","filter', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(583, 1, 'Gender"]],"name":"Gender","slug":"filterGender"},{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(584, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":14,"query_type":"native","name":"Live Births by Level of Education of Parent","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n fathersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersAttainment\": \"$fathersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": \"$_id\"\n , count: \"$count\"\n }},\n {$addFields: {\n attainment: \"fathersAttainment\"\n }}\n ]\n , mothersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersAttainment\": \"$mothersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": \"$_id\"\n , count: \"$count\"\n }},\n {$addFields: {\n attainment: \"mothersAttainment\"\n }}\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersAttainment\", \"$mothersAttainment\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Educational Attainment'': \"$allInfo._id\"\n , ''Attainment'': \"$allInfo.attainment\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Attainment\": -1\n }\n }\n]\n","template-tags":{"filterGender":{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}}},"database":2},"id":21,"parameter_mappings":[],"display":"bar","entity_id":"W6bdia0Vw-6PC1efnHIR4","collection_preview":true,"visualization_settings":{"pie.dimension":"Educational Attainment","pie.metric":"Count","graph.dimensions":["Educational Attainment","Attainment"],"graph.show_values":true,"graph.x_axis.axis_enabled":true,"graph.y_axis.auto_split":true,"graph.y_axis.auto_range":true,"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","type":"string/=","target":["dimension",["templat', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(584, 1, 'e-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(585, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":14,"query_type":"native","name":"Live Births by Level of Education of Parent","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n fathersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersAttainment\": \"$fathersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": \"$_id\"\n , count: \"$count\"\n }},\n {$addFields: {\n attainment: \"fathersAttainment\"\n }}\n ]\n , mothersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersAttainment\": \"$mothersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": \"$_id\"\n , count: \"$count\"\n }},\n {$addFields: {\n attainment: \"mothersAttainment\"\n }}\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersAttainment\", \"$mothersAttainment\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Educational Attainment'': \"$allInfo._id\"\n , ''Attainment'': \"$allInfo.attainment\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Attainment\": -1\n }\n }\n]\n","template-tags":{"filterGender":{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}}},"database":2},"id":21,"parameter_mappings":[],"display":"bar","entity_id":"W6bdia0Vw-6PC1efnHIR4","collection_preview":true,"visualization_settings":{"graph.show_values":true,"pie.dimension":"Educational Attainment","graph.x_axis.axis_enabled":true,"graph.y_axis.auto_split":true,"graph.metrics":["Count"],"pie.metric":"Count","series_settings":{"mothersAttainment":{"title":"mother"},"fathersAttainment":{"title":"father"}},"graph.y_axis.auto_range":true,"graph.dimensions":["Educational Attainment","Attainment"]},"is_write":false,"parameter', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(585, 1, 's":[{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(586, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":10,"query_type":"native","name":"Literacy of parents","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n fathersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersLiteracy\": \"$fathersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": \"$_id\"\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"fathersLiteracy\"\n }}\n ]\n , mothersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersLiteracy\": \"$mothersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$addFields: {\n literacy: \"mothersLiteracy\"\n }}\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersLiteracy\", \"$mothersLiteracy\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Category'': \"$allInfo._id\"\n , ''Literacy'': \"$allInfo.literacy\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Literacy\": -1\n }\n }\n]\n","template-tags":{"filterGender":{"id":"e8218caf-e2aa-573e-1776-02cffff42462","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"bf69e085-3c01-7924-5108-7151c85dc371","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}}},"database":2},"id":18,"parameter_mappings":[],"display":"bar","entity_id":"eRSJUaHW6haiucK8BtpC_","collection_preview":true,"visualization_settings":{"graph.show_values":true,"graph.label_value_formatting":"auto","graph.dimensions":["Category","Literacy"],"series_settings":{"mothersLiteracy":{"title":"mother"},"fathersLiteracy":{"title":"father"}},"graph.x_axis.title_text":"Literacy","graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"e8218caf-e2aa-573e-1776-02cffff42462","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"bf69e085-3c01-7924-5108-7151c85dc371","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","type":"s', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(586, 1, 'tring/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); INSERT INTO "PUBLIC"."REVISION" VALUES -(284, 'Card', 19, 1, TIMESTAMP WITH TIME ZONE '2022-12-19 09:28:20.21+00', SYSTEM_COMBINE_CLOB(569), FALSE, FALSE, NULL), -(285, 'Card', 19, 1, TIMESTAMP WITH TIME ZONE '2022-12-19 09:31:08.227+00', SYSTEM_COMBINE_CLOB(570), FALSE, FALSE, NULL), -(286, 'Card', 19, 1, TIMESTAMP WITH TIME ZONE '2022-12-19 09:31:47.848+00', SYSTEM_COMBINE_CLOB(571), FALSE, FALSE, NULL), -(287, 'Card', 20, 1, TIMESTAMP WITH TIME ZONE '2022-12-19 09:56:45.344+00', SYSTEM_COMBINE_CLOB(572), FALSE, TRUE, NULL), -(288, 'Card', 20, 1, TIMESTAMP WITH TIME ZONE '2022-12-19 10:14:19.745+00', SYSTEM_COMBINE_CLOB(573), FALSE, FALSE, NULL), -(289, 'Card', 20, 1, TIMESTAMP WITH TIME ZONE '2022-12-19 10:18:25.788+00', SYSTEM_COMBINE_CLOB(574), FALSE, FALSE, NULL), -(290, 'Card', 21, 1, TIMESTAMP WITH TIME ZONE '2022-12-19 10:32:35.267+00', SYSTEM_COMBINE_CLOB(575), FALSE, TRUE, NULL), -(302, 'Card', 19, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 05:52:36.051+00', SYSTEM_COMBINE_CLOB(576), FALSE, FALSE, NULL), -(303, 'Card', 18, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 05:53:22.356+00', SYSTEM_COMBINE_CLOB(577), FALSE, FALSE, NULL), -(304, 'Card', 20, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 05:58:12.624+00', SYSTEM_COMBINE_CLOB(578), FALSE, FALSE, NULL), -(305, 'Card', 21, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 05:59:05.275+00', SYSTEM_COMBINE_CLOB(579), FALSE, FALSE, NULL), -(323, 'Card', 21, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 06:57:45.674+00', SYSTEM_COMBINE_CLOB(580), FALSE, FALSE, NULL), -(324, 'Card', 21, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 06:58:51.449+00', SYSTEM_COMBINE_CLOB(581), FALSE, FALSE, NULL), -(327, 'Card', 21, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 07:02:29.825+00', SYSTEM_COMBINE_CLOB(582), FALSE, FALSE, NULL), -(330, 'Card', 21, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 07:03:35.831+00', SYSTEM_COMBINE_CLOB(583), FALSE, FALSE, NULL), -(333, 'Card', 21, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 07:10:28.973+00', SYSTEM_COMBINE_CLOB(584), FALSE, FALSE, NULL), -(336, 'Card', 18, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 07:24:45.777+00', SYSTEM_COMBINE_CLOB(585), FALSE, FALSE, NULL), +(284, 'Card', 19, 1, TIMESTAMP WITH TIME ZONE '2022-12-19 09:28:20.21+00', SYSTEM_COMBINE_CLOB(570), FALSE, FALSE, NULL), +(285, 'Card', 19, 1, TIMESTAMP WITH TIME ZONE '2022-12-19 09:31:08.227+00', SYSTEM_COMBINE_CLOB(571), FALSE, FALSE, NULL), +(286, 'Card', 19, 1, TIMESTAMP WITH TIME ZONE '2022-12-19 09:31:47.848+00', SYSTEM_COMBINE_CLOB(572), FALSE, FALSE, NULL), +(287, 'Card', 20, 1, TIMESTAMP WITH TIME ZONE '2022-12-19 09:56:45.344+00', SYSTEM_COMBINE_CLOB(573), FALSE, TRUE, NULL), +(288, 'Card', 20, 1, TIMESTAMP WITH TIME ZONE '2022-12-19 10:14:19.745+00', SYSTEM_COMBINE_CLOB(574), FALSE, FALSE, NULL), +(289, 'Card', 20, 1, TIMESTAMP WITH TIME ZONE '2022-12-19 10:18:25.788+00', SYSTEM_COMBINE_CLOB(575), FALSE, FALSE, NULL), +(290, 'Card', 21, 1, TIMESTAMP WITH TIME ZONE '2022-12-19 10:32:35.267+00', SYSTEM_COMBINE_CLOB(576), FALSE, TRUE, NULL), +(302, 'Card', 19, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 05:52:36.051+00', SYSTEM_COMBINE_CLOB(577), FALSE, FALSE, NULL), +(303, 'Card', 18, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 05:53:22.356+00', SYSTEM_COMBINE_CLOB(578), FALSE, FALSE, NULL), +(304, 'Card', 20, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 05:58:12.624+00', SYSTEM_COMBINE_CLOB(579), FALSE, FALSE, NULL), +(305, 'Card', 21, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 05:59:05.275+00', SYSTEM_COMBINE_CLOB(580), FALSE, FALSE, NULL), +(323, 'Card', 21, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 06:57:45.674+00', SYSTEM_COMBINE_CLOB(581), FALSE, FALSE, NULL), +(324, 'Card', 21, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 06:58:51.449+00', SYSTEM_COMBINE_CLOB(582), FALSE, FALSE, NULL), +(327, 'Card', 21, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 07:02:29.825+00', SYSTEM_COMBINE_CLOB(583), FALSE, FALSE, NULL), +(330, 'Card', 21, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 07:03:35.831+00', SYSTEM_COMBINE_CLOB(584), FALSE, FALSE, NULL), +(333, 'Card', 21, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 07:10:28.973+00', SYSTEM_COMBINE_CLOB(585), FALSE, FALSE, NULL), +(336, 'Card', 18, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 07:24:45.777+00', SYSTEM_COMBINE_CLOB(586), FALSE, FALSE, NULL), (351, 'Card', 26, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 08:34:27.517+00', '{"description":null,"archived":false,"collection_position":null,"table_id":22,"database_id":2,"enable_embedding":false,"collection_id":null,"query_type":"query","name":"Birth order by mother''s age","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"query","query":{"source-table":22,"expressions":{"MothersAgeGroup":["case",[[["<",["field",350,null],14],"9-14"],[["<",["field",350,null],19],"15-19"],[["<",["field",350,null],24],"20-24"],[["<",["field",350,null],29],"25-29"],[["<",["field",350,null],34],"30-34"],[["<",["field",350,null],39],"35-39"],[["<",["field",350,null],44],"40-44"],[["<",["field",350,null],49],"45-49"],[["<",["field",350,null],54],"50-54"],[["<",["field",350,null],59],"55-59"],[[">",["field",350,null],59],"60+"]]],"BirthOrder":["field",346,null]},"aggregation":[["count"]],"breakout":[["expression","MothersAgeGroup"],["expression","BirthOrder"]]},"database":2},"id":26,"parameter_mappings":[],"display":"table","entity_id":"rqIKCYaUJtkwCiLzYcfii","collection_preview":true,"visualization_settings":{"table.pivot":true,"table.pivot_column":"MothersAgeGroup","table.cell_column":"count"},"is_write":false,"parameters":[],"dataset":false,"public_uuid":null}', FALSE, TRUE, NULL), (352, 'Card', 26, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 08:46:50.763+00', '{"description":null,"archived":false,"collection_position":null,"table_id":22,"database_id":2,"enable_embedding":false,"collection_id":null,"query_type":"query","name":"Birth order by mother''s age","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"query":{"source-table":22,"expressions":{"MothersAgeGroup":["case",[[["<",["field",350,null],14],"9-14"],[["<",["field",350,null],19],"15-19"],[["<",["field",350,null],24],"20-24"],[["<",["field",350,null],29],"25-29"],[["<",["field",350,null],34],"30-34"],[["<",["field",350,null],39],"35-39"],[["<",["field",350,null],44],"40-44"],[["<",["field",350,null],49],"45-49"],[["<",["field",350,null],54],"50-54"],[["<",["field",350,null],59],"55-59"],[[">",["field",350,null],59],"60+"]]],"BirthOrderGroup":["case",[[["=",["field",346,null],1],"1"],[["=",["field",346,null],2],"2"],[["=",["field",346,null],3],"3"],[["=",["field",346,null],4],"4"],[["=",["field",346,null],5],"5"],[[">",["field",346,null],6],"6+"]]]},"aggregation":[["count"]],"breakout":[["expression","BirthOrderGroup"],["expression","MothersAgeGroup"]]},"type":"query"},"id":26,"parameter_mappings":[],"display":"table","entity_id":"rqIKCYaUJtkwCiLzYcfii","collection_preview":true,"visualization_settings":{"table.pivot":true,"table.pivot_column":"BirthOrderGroup","table.cell_column":"count"},"is_write":false,"parameters":[],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL); INSERT INTO "PUBLIC"."REVISION" VALUES @@ -175096,164 +175106,164 @@ INSERT INTO "PUBLIC"."REVISION" VALUES (359, 'Card', 27, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 09:21:07.333+00', '{"description":null,"archived":false,"collection_position":null,"table_id":22,"database_id":2,"enable_embedding":false,"collection_id":9,"query_type":"query","name":"Place of birth","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"query","query":{"source-table":22,"expressions":{"PlaceOfBirth":["case",[[["=",["field",338,null],"BUS"],"Bus"],[["=",["field",338,null],"CAR_TAXI"],"Taxi"],[["=",["field",338,null],"HEALTH_FACILITY"],"Health facility"],[["=",["field",338,null],"MATERNITY_HOME"],"Maternity home"],[["=",["field",338,null],"PRIVATE_HOME"],"Private home"],[["=",["field",338,null],"TRADITIONAL_DOCTORS"],"Traditional doctors"]]]},"aggregation":[["count"]],"breakout":[["expression","PlaceOfBirth"]]},"database":2},"id":27,"parameter_mappings":[],"display":"pie","entity_id":"AfR2OybIvG3i-a1qt-k0u","collection_preview":true,"visualization_settings":{},"is_write":false,"parameters":[],"dataset":false,"public_uuid":null}', FALSE, TRUE, NULL), (364, 'Card', 28, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 09:26:38.503+00', '{"description":null,"archived":false,"collection_position":null,"table_id":68,"database_id":2,"enable_embedding":false,"collection_id":17,"query_type":"query","name":"Corrections by type","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"query","query":{"source-table":68,"expressions":{"ReasonForCorrection":["case",[[["=",["field",617,null],"CLERICAL_ERROR"],"Clerical error"],[["=",["field",617,null],"JUDICIAL_ORDER"],"Judicial order"]]]},"aggregation":[["count"]],"breakout":[["expression","ReasonForCorrection"]]},"database":2},"id":28,"parameter_mappings":[],"display":"pie","entity_id":"__hZ2xD-7VCBJ7mLFxB9Y","collection_preview":true,"visualization_settings":{},"is_write":false,"parameters":[],"dataset":false,"public_uuid":null}', FALSE, TRUE, NULL), (369, 'Card', 29, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 09:32:38.019+00', '{"description":null,"archived":false,"collection_position":null,"table_id":22,"database_id":2,"enable_embedding":false,"collection_id":15,"query_type":"query","name":"Live Births by Type of Birth","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"query":{"source-table":22,"expressions":{"TypeOfBirth":["case",[[["=",["field",342,null],"SINGLE"],"Single"],[["=",["field",342,null],"TWIN"],"Twin"],[["=",["field",342,null],"TRIPLET"],"Triplet"],[["=",["field",342,null],"QUADRUPLET"],"Quadruplet"]]]},"aggregation":[["count"]],"breakout":[["expression","TypeOfBirth"]],"order-by":[["desc",["aggregation",0,null]]]},"type":"query"},"id":29,"parameter_mappings":[],"display":"pie","entity_id":"GOqql9fnmIgyeOChWso6x","collection_preview":true,"visualization_settings":{},"is_write":false,"parameters":[],"dataset":false,"public_uuid":null}', FALSE, TRUE, NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(586, 0, '{"description":"This leaderboard is showing the result of past 30 days","archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Leaderboard by Registrars for last 30 days","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"practitionerName\": \"$practitionerName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"practitionerName\": \"$_id.practitionerName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"practitionerName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Registrar Name'': \"$allInfo.practitionerName\"\n , ''Registrations'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n }},\n {\n $limit: 10\n }\n]","template-tags":{"filterGender":{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/relative","default":"past30days"}}},"database":2},"id":12,"parameter_mappings":[],"display":"row","entity_id":"VxeUMjNq8eLaHweLGUvYF","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.cell_column":"Percentage","graph.series_order_dimension":null,"graph.x_axis.title_text":"Registrars","graph.metrics":["Registrations"],"graph.label_value_formatting":"full","graph.series_order":null,"table.pivot_column":"Registrations","series_settings":{"Registrations":{"color":"#509EE3"}},"graph.dimensions":["Registrar Name"],"stackable.stack_type":null},"is_write":false,"parameters":[{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(586, 1, '":"Event","slug":"filterEvent"},{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","type":"date/relative","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate","default":"past30days"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(587, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":10,"query_type":"native","name":"Literacy of parents","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n fathersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersLiteracy\": \"$fathersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"fathersLiteracy\"\n }}\n ]\n , mothersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersLiteracy\": \"$mothersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id.mothersLiteracy\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id.mothersLiteracy\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , \"count\": \"$qty\"\n }},\n {$addFields: {\n literacy: \"mothersLiteracy\"\n }}\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersLiteracy\", \"$mothersLiteracy\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Category'': \"$allInfo._id\"\n , ''Literacy'': \"$allInfo.literacy\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Literacy\": 1\n }\n }\n]\n","template-tags":{"filterGender":{"id":"e8218caf-e2aa-573e-1776-02cffff42462","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"bf69e085-3c01-7924-5108-7151c85dc371","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","name":"filterDate","display-name":"Date","type":"dimension","dimension":["f', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(587, 1, 'ield",354,null],"widget-type":"date/month-year","default":null}}},"database":2},"id":18,"parameter_mappings":[],"display":"bar","entity_id":"eRSJUaHW6haiucK8BtpC_","collection_preview":true,"visualization_settings":{"graph.show_values":true,"graph.label_value_formatting":"auto","graph.dimensions":["Category","Literacy"],"series_settings":{"mothersLiteracy":{"title":"mother"},"fathersLiteracy":{"title":"father"}},"graph.x_axis.title_text":"Literacy","graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"e8218caf-e2aa-573e-1776-02cffff42462","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"bf69e085-3c01-7924-5108-7151c85dc371","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(588, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":14,"query_type":"native","name":"Live Births by Level of Education of Parent","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n fathersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersAttainment\": \"$fathersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"KORANIC\"] },\n then: \"Koranic\"\n },\n {\n case: { $eq: [\"$_id\", \"MODERN\"] },\n then: \"Modern\"\n },\n {\n case: { $eq: [\"$_id\", \"HIGHER_SCHOOL\"] },\n then: \"Higher School\"\n },\n {\n case: { $eq: [\"$_id\", \"PRIMARY\"] },\n then: \"Primary\"\n },\n {\n case: { $eq: [\"$_id\", \"UNIVERSITY\"] },\n then: \"University\"\n },\n {\n case: { $eq: [\"$_id\", \"POLYTECNIC_NCE\"] },\n then: \"Polytecnic NCE\"\n },\n {\n case: { $eq: [\"$_id\", \"SECONDARY\"] },\n then: \"Secondary\"\n }\n ],\n default: \"Others\"\n }\n }\n , count: \"$count\"\n }},\n {$addFields: {\n attainment: \"fathersAttainment\"\n }}\n ]\n , mothersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersAttainment\": \"$mothersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"KORANIC\"] },\n then: \"Koranic\"\n },\n {\n case: { $eq: [\"$_id\", \"MODERN\"] },\n then: \"Modern\"\n },\n {\n case: { $eq: [\"$_id\", \"HIGHER_SCHOOL\"] },\n then: \"Higher School\"\n },\n {\n case: { $eq: [\"$_id\", \"PRIMARY\"] },\n then: \"Primary\"\n },\n {\n case: { $eq: [\"$_id\", \"UNIVERSITY\"] },\n then: \"University\"\n },\n {\n case: { $eq: [\"$_id\", \"POLYTECNIC_NCE\"] },\n then: \"Polytecnic NCE\"\n },\n {\n case: { $eq: [\"$_id\", \"SECONDARY\"] },\n ', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(588, 1, ' then: \"Secondary\"\n }\n ],\n default: \"Others\"\n }\n }\n , count: \"$count\"\n }},\n {$addFields: {\n attainment: \"mothersAttainment\"\n }}\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersAttainment\", \"$mothersAttainment\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Educational Attainment'': \"$allInfo._id\"\n , ''Attainment'': \"$allInfo.attainment\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Attainment\": 1\n }\n }\n]\n","template-tags":{"filterGender":{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}}},"database":2},"id":21,"parameter_mappings":[],"display":"bar","entity_id":"W6bdia0Vw-6PC1efnHIR4","collection_preview":true,"visualization_settings":{"graph.show_values":true,"pie.dimension":"Educational Attainment","graph.x_axis.axis_enabled":true,"graph.y_axis.auto_split":true,"graph.metrics":["Count"],"pie.metric":"Count","series_settings":{"mothersAttainment":{"title":"mother"},"fathersAttainment":{"title":"father"}},"graph.y_axis.auto_range":true,"graph.dimensions":["Educational Attainment","Attainment"]},"is_write":false,"parameters":[{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(589, 0, '{"description":"This leaderboard is showing the result of past 30 days","archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Leaderboard by Registrars","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"practitionerName\": \"$practitionerName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"practitionerName\": \"$_id.practitionerName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"practitionerName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Registrar Name'': \"$allInfo.practitionerName\"\n , ''Registrations'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n }},\n {\n $limit: 10\n }\n]","template-tags":{"filterGender":{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/relative","default":"past30days"}}},"database":2},"id":12,"parameter_mappings":[],"display":"row","entity_id":"VxeUMjNq8eLaHweLGUvYF","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.cell_column":"Percentage","graph.series_order_dimension":null,"graph.x_axis.title_text":"Registrars","graph.metrics":["Registrations"],"graph.label_value_formatting":"full","graph.series_order":null,"table.pivot_column":"Registrations","series_settings":{"Registrations":{"color":"#509EE3"}},"graph.dimensions":["Registrar Name"],"stackable.stack_type":null},"is_write":false,"parameters":[{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(589, 1, '"filterEvent"},{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","type":"date/relative","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate","default":"past30days"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(590, 0, '{"description":"This leaderboard is showing the result of past 30 days","archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Leaderboard by Registrars","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"practitionerName\": \"$practitionerName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"practitionerName\": \"$_id.practitionerName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"practitionerName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Registrar Name'': \"$allInfo.practitionerName\"\n , ''Registrations'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n }},\n {\n $limit: 10\n }\n]","template-tags":{"filterGender":{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/relative","default":"past30days"}}},"database":2},"id":12,"parameter_mappings":[],"display":"row","entity_id":"VxeUMjNq8eLaHweLGUvYF","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.cell_column":"Percentage","graph.series_order_dimension":null,"graph.x_axis.title_text":"Registrars","graph.metrics":["Percentage"],"graph.label_value_formatting":"full","graph.series_order":null,"table.pivot_column":"Registrations","series_settings":{"Registrations":{"color":"#509EE3"}},"graph.dimensions":["Registrar Name"],"stackable.stack_type":null},"is_write":false,"parameters":[{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"fi', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(590, 1, 'lterEvent"},{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","type":"date/relative","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate","default":"past30days"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(591, 0, '{"description":"This leaderboard is showing the result of past 30 days","archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Leaderboard by Registrars","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"practitionerName\": \"$practitionerName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"practitionerName\": \"$_id.practitionerName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"practitionerName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Registrar Name'': \"$allInfo.practitionerName\"\n , ''Registrations'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n }},\n {\n $limit: 10\n }\n]","template-tags":{"filterGender":{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/relative","default":"past30days"}}},"database":2},"id":12,"parameter_mappings":[],"display":"row","entity_id":"VxeUMjNq8eLaHweLGUvYF","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.cell_column":"Percentage","graph.series_order_dimension":null,"graph.x_axis.title_text":"Registrars","graph.metrics":["Registrations"],"graph.label_value_formatting":"full","graph.series_order":null,"table.pivot_column":"Registrations","series_settings":{"Registrations":{"color":"#509EE3"}},"graph.dimensions":["Registrar Name"],"stackable.stack_type":null},"is_write":false,"parameters":[{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(591, 1, '"filterEvent"},{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","type":"date/relative","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate","default":"past30days"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(592, 0, '{"description":"This leaderboard is showing the result of past 30 days","archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Leaderboard by Registrars","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"practitionerName\": \"$practitionerName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"practitionerName\": \"$_id.practitionerName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"practitionerName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Registrar Name'': \"$allInfo.practitionerName\"\n , ''Registrations'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n }},\n {\n $limit: 20\n }\n]","template-tags":{"filterGender":{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/relative","default":"past30days"}}},"database":2},"id":12,"parameter_mappings":[],"display":"row","entity_id":"VxeUMjNq8eLaHweLGUvYF","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.cell_column":"Percentage","graph.series_order_dimension":null,"graph.x_axis.title_text":"Registrars","graph.metrics":["Registrations"],"graph.label_value_formatting":"full","graph.series_order":null,"table.pivot_column":"Registrations","series_settings":{"Registrations":{"color":"#509EE3"}},"graph.dimensions":["Registrar Name"],"stackable.stack_type":null},"is_write":false,"parameters":[{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(587, 0, '{"description":"This leaderboard is showing the result of past 30 days","archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Leaderboard by Registrars for last 30 days","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"practitionerName\": \"$practitionerName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"practitionerName\": \"$_id.practitionerName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"practitionerName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Registrar Name'': \"$allInfo.practitionerName\"\n , ''Registrations'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n }},\n {\n $limit: 10\n }\n]","template-tags":{"filterGender":{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/relative","default":"past30days"}}},"database":2},"id":12,"parameter_mappings":[],"display":"row","entity_id":"VxeUMjNq8eLaHweLGUvYF","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.cell_column":"Percentage","graph.series_order_dimension":null,"graph.x_axis.title_text":"Registrars","graph.metrics":["Registrations"],"graph.label_value_formatting":"full","graph.series_order":null,"table.pivot_column":"Registrations","series_settings":{"Registrations":{"color":"#509EE3"}},"graph.dimensions":["Registrar Name"],"stackable.stack_type":null},"is_write":false,"parameters":[{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(587, 1, '":"Event","slug":"filterEvent"},{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","type":"date/relative","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate","default":"past30days"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(588, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":10,"query_type":"native","name":"Literacy of parents","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n fathersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersLiteracy\": \"$fathersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"fathersLiteracy\"\n }}\n ]\n , mothersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersLiteracy\": \"$mothersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id.mothersLiteracy\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id.mothersLiteracy\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , \"count\": \"$qty\"\n }},\n {$addFields: {\n literacy: \"mothersLiteracy\"\n }}\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersLiteracy\", \"$mothersLiteracy\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Category'': \"$allInfo._id\"\n , ''Literacy'': \"$allInfo.literacy\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Literacy\": 1\n }\n }\n]\n","template-tags":{"filterGender":{"id":"e8218caf-e2aa-573e-1776-02cffff42462","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"bf69e085-3c01-7924-5108-7151c85dc371","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","name":"filterDate","display-name":"Date","type":"dimension","dimension":["f', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(588, 1, 'ield",354,null],"widget-type":"date/month-year","default":null}}},"database":2},"id":18,"parameter_mappings":[],"display":"bar","entity_id":"eRSJUaHW6haiucK8BtpC_","collection_preview":true,"visualization_settings":{"graph.show_values":true,"graph.label_value_formatting":"auto","graph.dimensions":["Category","Literacy"],"series_settings":{"mothersLiteracy":{"title":"mother"},"fathersLiteracy":{"title":"father"}},"graph.x_axis.title_text":"Literacy","graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"e8218caf-e2aa-573e-1776-02cffff42462","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"bf69e085-3c01-7924-5108-7151c85dc371","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(589, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":14,"query_type":"native","name":"Live Births by Level of Education of Parent","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n fathersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersAttainment\": \"$fathersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"KORANIC\"] },\n then: \"Koranic\"\n },\n {\n case: { $eq: [\"$_id\", \"MODERN\"] },\n then: \"Modern\"\n },\n {\n case: { $eq: [\"$_id\", \"HIGHER_SCHOOL\"] },\n then: \"Higher School\"\n },\n {\n case: { $eq: [\"$_id\", \"PRIMARY\"] },\n then: \"Primary\"\n },\n {\n case: { $eq: [\"$_id\", \"UNIVERSITY\"] },\n then: \"University\"\n },\n {\n case: { $eq: [\"$_id\", \"POLYTECNIC_NCE\"] },\n then: \"Polytecnic NCE\"\n },\n {\n case: { $eq: [\"$_id\", \"SECONDARY\"] },\n then: \"Secondary\"\n }\n ],\n default: \"Others\"\n }\n }\n , count: \"$count\"\n }},\n {$addFields: {\n attainment: \"fathersAttainment\"\n }}\n ]\n , mothersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersAttainment\": \"$mothersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"KORANIC\"] },\n then: \"Koranic\"\n },\n {\n case: { $eq: [\"$_id\", \"MODERN\"] },\n then: \"Modern\"\n },\n {\n case: { $eq: [\"$_id\", \"HIGHER_SCHOOL\"] },\n then: \"Higher School\"\n },\n {\n case: { $eq: [\"$_id\", \"PRIMARY\"] },\n then: \"Primary\"\n },\n {\n case: { $eq: [\"$_id\", \"UNIVERSITY\"] },\n then: \"University\"\n },\n {\n case: { $eq: [\"$_id\", \"POLYTECNIC_NCE\"] },\n then: \"Polytecnic NCE\"\n },\n {\n case: { $eq: [\"$_id\", \"SECONDARY\"] },\n ', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(589, 1, ' then: \"Secondary\"\n }\n ],\n default: \"Others\"\n }\n }\n , count: \"$count\"\n }},\n {$addFields: {\n attainment: \"mothersAttainment\"\n }}\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersAttainment\", \"$mothersAttainment\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Educational Attainment'': \"$allInfo._id\"\n , ''Attainment'': \"$allInfo.attainment\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Attainment\": 1\n }\n }\n]\n","template-tags":{"filterGender":{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}}},"database":2},"id":21,"parameter_mappings":[],"display":"bar","entity_id":"W6bdia0Vw-6PC1efnHIR4","collection_preview":true,"visualization_settings":{"graph.show_values":true,"pie.dimension":"Educational Attainment","graph.x_axis.axis_enabled":true,"graph.y_axis.auto_split":true,"graph.metrics":["Count"],"pie.metric":"Count","series_settings":{"mothersAttainment":{"title":"mother"},"fathersAttainment":{"title":"father"}},"graph.y_axis.auto_range":true,"graph.dimensions":["Educational Attainment","Attainment"]},"is_write":false,"parameters":[{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(590, 0, '{"description":"This leaderboard is showing the result of past 30 days","archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Leaderboard by Registrars","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"practitionerName\": \"$practitionerName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"practitionerName\": \"$_id.practitionerName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"practitionerName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Registrar Name'': \"$allInfo.practitionerName\"\n , ''Registrations'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n }},\n {\n $limit: 10\n }\n]","template-tags":{"filterGender":{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/relative","default":"past30days"}}},"database":2},"id":12,"parameter_mappings":[],"display":"row","entity_id":"VxeUMjNq8eLaHweLGUvYF","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.cell_column":"Percentage","graph.series_order_dimension":null,"graph.x_axis.title_text":"Registrars","graph.metrics":["Registrations"],"graph.label_value_formatting":"full","graph.series_order":null,"table.pivot_column":"Registrations","series_settings":{"Registrations":{"color":"#509EE3"}},"graph.dimensions":["Registrar Name"],"stackable.stack_type":null},"is_write":false,"parameters":[{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(590, 1, '"filterEvent"},{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","type":"date/relative","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate","default":"past30days"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(591, 0, '{"description":"This leaderboard is showing the result of past 30 days","archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Leaderboard by Registrars","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"practitionerName\": \"$practitionerName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"practitionerName\": \"$_id.practitionerName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"practitionerName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Registrar Name'': \"$allInfo.practitionerName\"\n , ''Registrations'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n }},\n {\n $limit: 10\n }\n]","template-tags":{"filterGender":{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/relative","default":"past30days"}}},"database":2},"id":12,"parameter_mappings":[],"display":"row","entity_id":"VxeUMjNq8eLaHweLGUvYF","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.cell_column":"Percentage","graph.series_order_dimension":null,"graph.x_axis.title_text":"Registrars","graph.metrics":["Percentage"],"graph.label_value_formatting":"full","graph.series_order":null,"table.pivot_column":"Registrations","series_settings":{"Registrations":{"color":"#509EE3"}},"graph.dimensions":["Registrar Name"],"stackable.stack_type":null},"is_write":false,"parameters":[{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"fi', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(591, 1, 'lterEvent"},{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","type":"date/relative","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate","default":"past30days"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(592, 0, '{"description":"This leaderboard is showing the result of past 30 days","archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Leaderboard by Registrars","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"practitionerName\": \"$practitionerName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"practitionerName\": \"$_id.practitionerName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"practitionerName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Registrar Name'': \"$allInfo.practitionerName\"\n , ''Registrations'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n }},\n {\n $limit: 10\n }\n]","template-tags":{"filterGender":{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/relative","default":"past30days"}}},"database":2},"id":12,"parameter_mappings":[],"display":"row","entity_id":"VxeUMjNq8eLaHweLGUvYF","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.cell_column":"Percentage","graph.series_order_dimension":null,"graph.x_axis.title_text":"Registrars","graph.metrics":["Registrations"],"graph.label_value_formatting":"full","graph.series_order":null,"table.pivot_column":"Registrations","series_settings":{"Registrations":{"color":"#509EE3"}},"graph.dimensions":["Registrar Name"],"stackable.stack_type":null},"is_write":false,"parameters":[{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":', NULL); INSERT INTO SYSTEM_LOB_STREAM VALUES(592, 1, '"filterEvent"},{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","type":"date/relative","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate","default":"past30days"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(593, 0, '{"description":"This leaderboard is showing the result of past 30 days","archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Leaderboard by Registrars","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"practitionerName\": \"$practitionerName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"practitionerName\": \"$_id.practitionerName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"practitionerName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Registrar Name'': \"$allInfo.practitionerName\"\n , ''Registrations'': \"$allInfo.count\"\n }},\n {\n $limit: 20\n }\n]","template-tags":{"filterGender":{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/relative","default":"past30days"}}},"database":2},"id":12,"parameter_mappings":[],"display":"row","entity_id":"VxeUMjNq8eLaHweLGUvYF","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.cell_column":"Percentage","graph.series_order_dimension":null,"graph.x_axis.title_text":"Registrars","graph.metrics":["Registrations"],"graph.label_value_formatting":"full","graph.series_order":null,"table.pivot_column":"Registrations","series_settings":{"Registrations":{"color":"#509EE3"}},"graph.dimensions":["Registrar Name"],"stackable.stack_type":null},"is_write":false,"parameters":[{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","type":"string/=","target":[', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(593, 1, '"dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","type":"date/relative","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate","default":"past30days"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(594, 0, '{"description":"This leaderboard is showing the result of past 30 days","archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Leaderboard by Registrars","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"practitionerName\": \"$practitionerName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"practitionerName\": \"$_id.practitionerName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"practitionerName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Registrar Name'': \"$allInfo.practitionerName\"\n , ''Registrations'': \"$allInfo.count\"\n }},\n {\n $limit: 10\n }\n]","template-tags":{"filterGender":{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/relative","default":"past30days"}}},"database":2},"id":12,"parameter_mappings":[],"display":"row","entity_id":"VxeUMjNq8eLaHweLGUvYF","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.cell_column":"Percentage","graph.series_order_dimension":null,"graph.x_axis.title_text":"Registrars","graph.metrics":["Registrations"],"graph.label_value_formatting":"full","graph.series_order":null,"table.pivot_column":"Registrations","series_settings":{"Registrations":{"color":"#509EE3"}},"graph.dimensions":["Registrar Name"],"stackable.stack_type":null},"is_write":false,"parameters":[{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","type":"string/=","target":[', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(593, 0, '{"description":"This leaderboard is showing the result of past 30 days","archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Leaderboard by Registrars","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"practitionerName\": \"$practitionerName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"practitionerName\": \"$_id.practitionerName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"practitionerName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Registrar Name'': \"$allInfo.practitionerName\"\n , ''Registrations'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n }},\n {\n $limit: 20\n }\n]","template-tags":{"filterGender":{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/relative","default":"past30days"}}},"database":2},"id":12,"parameter_mappings":[],"display":"row","entity_id":"VxeUMjNq8eLaHweLGUvYF","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.cell_column":"Percentage","graph.series_order_dimension":null,"graph.x_axis.title_text":"Registrars","graph.metrics":["Registrations"],"graph.label_value_formatting":"full","graph.series_order":null,"table.pivot_column":"Registrations","series_settings":{"Registrations":{"color":"#509EE3"}},"graph.dimensions":["Registrar Name"],"stackable.stack_type":null},"is_write":false,"parameters":[{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(593, 1, '"filterEvent"},{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","type":"date/relative","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate","default":"past30days"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(594, 0, '{"description":"This leaderboard is showing the result of past 30 days","archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Leaderboard by Registrars","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"practitionerName\": \"$practitionerName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"practitionerName\": \"$_id.practitionerName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"practitionerName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Registrar Name'': \"$allInfo.practitionerName\"\n , ''Registrations'': \"$allInfo.count\"\n }},\n {\n $limit: 20\n }\n]","template-tags":{"filterGender":{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/relative","default":"past30days"}}},"database":2},"id":12,"parameter_mappings":[],"display":"row","entity_id":"VxeUMjNq8eLaHweLGUvYF","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.cell_column":"Percentage","graph.series_order_dimension":null,"graph.x_axis.title_text":"Registrars","graph.metrics":["Registrations"],"graph.label_value_formatting":"full","graph.series_order":null,"table.pivot_column":"Registrations","series_settings":{"Registrations":{"color":"#509EE3"}},"graph.dimensions":["Registrar Name"],"stackable.stack_type":null},"is_write":false,"parameters":[{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","type":"string/=","target":[', NULL); INSERT INTO SYSTEM_LOB_STREAM VALUES(594, 1, '"dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","type":"date/relative","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate","default":"past30days"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(595, 0, '{"description":"This leaderboard is showing the result of past 30 days","archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Leaderboard by Registrars","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"practitionerName\": \"$practitionerName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"practitionerName\": \"$_id.practitionerName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"practitionerName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Registrar Name'': \"$allInfo.practitionerName\"\n , ''Registrations'': \"$allInfo.count\"\n }},\n {\n $limit: 10\n }\n]","template-tags":{"filterGender":{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/relative","default":"thisday"}}},"database":2},"id":12,"parameter_mappings":[],"display":"row","entity_id":"VxeUMjNq8eLaHweLGUvYF","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.cell_column":"Percentage","graph.series_order_dimension":null,"graph.x_axis.title_text":"Registrars","graph.metrics":["Registrations"],"graph.label_value_formatting":"full","graph.series_order":null,"table.pivot_column":"Registrations","series_settings":{"Registrations":{"color":"#509EE3"}},"graph.dimensions":["Registrar Name"],"stackable.stack_type":null},"is_write":false,"parameters":[{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","type":"string/=","target":["di', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(595, 1, 'mension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","type":"date/relative","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate","default":"thisday"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(596, 0, '{"description":"This leaderboard is showing the result of past 30 days","archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Leaderboard by Registrars","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterGender":{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/relative","default":"past30days"}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"practitionerName\": \"$practitionerName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"practitionerName\": \"$_id.practitionerName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"practitionerName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Registrar Name'': \"$allInfo.practitionerName\"\n , ''Registrations'': \"$allInfo.count\"\n }},\n {\n $limit: 10\n }\n]","collection":"analyticsRegistrations"},"type":"native"},"id":12,"parameter_mappings":[],"display":"row","entity_id":"VxeUMjNq8eLaHweLGUvYF","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.cell_column":"Percentage","graph.series_order_dimension":null,"graph.x_axis.title_text":"Registrars","graph.metrics":["Registrations"],"graph.label_value_formatting":"full","graph.series_order":null,"table.pivot_column":"Registrations","series_settings":{"Registrations":{"color":"#509EE3"}},"graph.dimensions":["Registrar Name"],"stackable.stack_type":null},"is_write":false,"parameters":[{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","type":"string/=","target":[', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(596, 1, '"dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","type":"date/relative","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate","default":"past30days"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(597, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Live births registered by age of child v2","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterDate":{"id":"84b2ec9e-eea8-e9ee-160f-57a211462c2a","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/relative","default":null},"filterGender":{"id":"7d3014f2-7de5-b2b0-fb10-0796ecc6fe38","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"086c0846-69f4-a2b9-16b8-86af040bf2c8","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"537bc06b-acf9-9d28-3c92-346d83ce5156","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"5626fb9c-14cd-0fe8-2254-687e292aeb7b","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null}},"query":"[\n {\n $match: {\n $and: [{ _id: { $ne: null } }\n [[{{ filterDate }} ]]\n [[{{ filterGender }} ]]\n [[{{ filterEvent }}]]\n [[{{ filterState }}]]\n [[{{ filterOffice }}]]\n ]\n }\n },\n {\n $facet: {\n totals: [{ $count: ''total'' }, { $addFields: { category: ''Total'' } }],\n ageGroups: [\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 365] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''< 1''\n },\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 1825] },\n { $gte: [''$childsAge'', 365] }\n ]\n },\n then: ''< 5''\n }\n ],\n default: ''5+''\n }\n }\n }\n },\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n category: ''$_id.par'',\n total: ''$totalCustomer''\n }\n }\n ]\n }\n },\n {\n $project: {\n mergedArray: { $concatArrays: [''$totals'', ''$ageGroups''] }\n }\n },\n { $unwind: ''$mergedArray'' },\n { $replaceRoot: { newRoot: ''$mergedArray'' } },\n {\n $addFields: {\n order: {\n $cond: {\n if: { $eq: [''$category'', ''Total''] },\n then: 1,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''< 1''] },\n then: 2,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''< 5''] },\n then: 3,\n else: 4\n }\n }\n }\n }\n }\n }\n }\n },\n {\n $sort: {\n order: 1\n }\n },\n { $project: { total: 1, category: 1 } },\n {\n $sort: {\n category: -1\n }\n },\n]","collection":"analyticsRegistrations"},"type":"native"},"id":31,"parameter_mappings":[],"display":"bar","entity_id":"hTP9EUEq13VA1N_H-258l","co', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(597, 1, 'llection_preview":true,"visualization_settings":{"graph.y_axis.title_text":"Total","graph.show_values":true,"graph.series_order_dimension":null,"graph.x_axis.title_text":"Category","graph.metrics":["total"],"graph.series_order":null,"series_settings":{"4":{"title":"Under age 5","color":"#509EE3"},"7":{"color":"#F9D45C","title":"Over age 5"},"12":{"color":"#A989C5","title":"Under age 1"},"23":{"title":"Total"}},"graph.dimensions":["category","total"],"stackable.stack_type":"stacked"},"is_write":false,"parameters":[{"id":"84b2ec9e-eea8-e9ee-160f-57a211462c2a","type":"date/relative","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"7d3014f2-7de5-b2b0-fb10-0796ecc6fe38","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"086c0846-69f4-a2b9-16b8-86af040bf2c8","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"537bc06b-acf9-9d28-3c92-346d83ce5156","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"5626fb9c-14cd-0fe8-2254-687e292aeb7b","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(598, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by age","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterDate":{"id":"84b2ec9e-eea8-e9ee-160f-57a211462c2a","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/relative","default":null},"filterGender":{"id":"7d3014f2-7de5-b2b0-fb10-0796ecc6fe38","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"086c0846-69f4-a2b9-16b8-86af040bf2c8","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"537bc06b-acf9-9d28-3c92-346d83ce5156","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"5626fb9c-14cd-0fe8-2254-687e292aeb7b","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null}},"query":"[\n {\n $match: {\n $and: [{ _id: { $ne: null } }\n [[{{ filterDate }} ]]\n [[{{ filterGender }} ]]\n [[{{ filterEvent }}]]\n [[{{ filterState }}]]\n [[{{ filterOffice }}]]\n ]\n }\n },\n {\n $facet: {\n totals: [{ $count: ''total'' }, { $addFields: { category: ''Total'' } }],\n ageGroups: [\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 365] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''< 1''\n },\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 1825] },\n { $gte: [''$childsAge'', 365] }\n ]\n },\n then: ''< 5''\n }\n ],\n default: ''5+''\n }\n }\n }\n },\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n category: ''$_id.par'',\n total: ''$totalCustomer''\n }\n }\n ]\n }\n },\n {\n $project: {\n mergedArray: { $concatArrays: [''$totals'', ''$ageGroups''] }\n }\n },\n { $unwind: ''$mergedArray'' },\n { $replaceRoot: { newRoot: ''$mergedArray'' } },\n {\n $addFields: {\n order: {\n $cond: {\n if: { $eq: [''$category'', ''Total''] },\n then: 1,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''< 1''] },\n then: 2,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''< 5''] },\n then: 3,\n else: 4\n }\n }\n }\n }\n }\n }\n }\n },\n {\n $sort: {\n order: 1\n }\n },\n { $project: { total: 1, category: 1 } },\n {\n $sort: {\n category: -1\n }\n },\n]","collection":"analyticsRegistrations"},"type":"native"},"id":31,"parameter_mappings":[],"display":"bar","entity_id":"hTP9EUEq13VA1N_H-258l","collection_preview":tru', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(598, 1, 'e,"visualization_settings":{"graph.y_axis.title_text":"Total","graph.show_values":true,"graph.series_order_dimension":null,"graph.x_axis.title_text":"Category","graph.metrics":["total"],"graph.series_order":null,"series_settings":{"4":{"title":"Under age 5","color":"#509EE3"},"7":{"color":"#F9D45C","title":"Over age 5"},"12":{"color":"#A989C5","title":"Under age 1"},"23":{"title":"Total"}},"graph.dimensions":["category","total"],"stackable.stack_type":"stacked"},"is_write":false,"parameters":[{"id":"84b2ec9e-eea8-e9ee-160f-57a211462c2a","type":"date/relative","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"7d3014f2-7de5-b2b0-fb10-0796ecc6fe38","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"086c0846-69f4-a2b9-16b8-86af040bf2c8","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"537bc06b-acf9-9d28-3c92-346d83ce5156","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"5626fb9c-14cd-0fe8-2254-687e292aeb7b","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(595, 0, '{"description":"This leaderboard is showing the result of past 30 days","archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Leaderboard by Registrars","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"practitionerName\": \"$practitionerName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"practitionerName\": \"$_id.practitionerName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"practitionerName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Registrar Name'': \"$allInfo.practitionerName\"\n , ''Registrations'': \"$allInfo.count\"\n }},\n {\n $limit: 10\n }\n]","template-tags":{"filterGender":{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/relative","default":"past30days"}}},"database":2},"id":12,"parameter_mappings":[],"display":"row","entity_id":"VxeUMjNq8eLaHweLGUvYF","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.cell_column":"Percentage","graph.series_order_dimension":null,"graph.x_axis.title_text":"Registrars","graph.metrics":["Registrations"],"graph.label_value_formatting":"full","graph.series_order":null,"table.pivot_column":"Registrations","series_settings":{"Registrations":{"color":"#509EE3"}},"graph.dimensions":["Registrar Name"],"stackable.stack_type":null},"is_write":false,"parameters":[{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","type":"string/=","target":[', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(595, 1, '"dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","type":"date/relative","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate","default":"past30days"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(596, 0, '{"description":"This leaderboard is showing the result of past 30 days","archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Leaderboard by Registrars","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"practitionerName\": \"$practitionerName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"practitionerName\": \"$_id.practitionerName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"practitionerName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Registrar Name'': \"$allInfo.practitionerName\"\n , ''Registrations'': \"$allInfo.count\"\n }},\n {\n $limit: 10\n }\n]","template-tags":{"filterGender":{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/relative","default":"thisday"}}},"database":2},"id":12,"parameter_mappings":[],"display":"row","entity_id":"VxeUMjNq8eLaHweLGUvYF","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.cell_column":"Percentage","graph.series_order_dimension":null,"graph.x_axis.title_text":"Registrars","graph.metrics":["Registrations"],"graph.label_value_formatting":"full","graph.series_order":null,"table.pivot_column":"Registrations","series_settings":{"Registrations":{"color":"#509EE3"}},"graph.dimensions":["Registrar Name"],"stackable.stack_type":null},"is_write":false,"parameters":[{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","type":"string/=","target":["di', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(596, 1, 'mension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","type":"date/relative","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate","default":"thisday"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(597, 0, '{"description":"This leaderboard is showing the result of past 30 days","archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Leaderboard by Registrars","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterGender":{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/relative","default":"past30days"}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"practitionerName\": \"$practitionerName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"practitionerName\": \"$_id.practitionerName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"practitionerName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Registrar Name'': \"$allInfo.practitionerName\"\n , ''Registrations'': \"$allInfo.count\"\n }},\n {\n $limit: 10\n }\n]","collection":"analyticsRegistrations"},"type":"native"},"id":12,"parameter_mappings":[],"display":"row","entity_id":"VxeUMjNq8eLaHweLGUvYF","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.cell_column":"Percentage","graph.series_order_dimension":null,"graph.x_axis.title_text":"Registrars","graph.metrics":["Registrations"],"graph.label_value_formatting":"full","graph.series_order":null,"table.pivot_column":"Registrations","series_settings":{"Registrations":{"color":"#509EE3"}},"graph.dimensions":["Registrar Name"],"stackable.stack_type":null},"is_write":false,"parameters":[{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","type":"string/=","target":[', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(597, 1, '"dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","type":"date/relative","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate","default":"past30days"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(598, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Live births registered by age of child v2","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterDate":{"id":"84b2ec9e-eea8-e9ee-160f-57a211462c2a","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/relative","default":null},"filterGender":{"id":"7d3014f2-7de5-b2b0-fb10-0796ecc6fe38","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"086c0846-69f4-a2b9-16b8-86af040bf2c8","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"537bc06b-acf9-9d28-3c92-346d83ce5156","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"5626fb9c-14cd-0fe8-2254-687e292aeb7b","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null}},"query":"[\n {\n $match: {\n $and: [{ _id: { $ne: null } }\n [[{{ filterDate }} ]]\n [[{{ filterGender }} ]]\n [[{{ filterEvent }}]]\n [[{{ filterState }}]]\n [[{{ filterOffice }}]]\n ]\n }\n },\n {\n $facet: {\n totals: [{ $count: ''total'' }, { $addFields: { category: ''Total'' } }],\n ageGroups: [\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 365] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''< 1''\n },\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 1825] },\n { $gte: [''$childsAge'', 365] }\n ]\n },\n then: ''< 5''\n }\n ],\n default: ''5+''\n }\n }\n }\n },\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n category: ''$_id.par'',\n total: ''$totalCustomer''\n }\n }\n ]\n }\n },\n {\n $project: {\n mergedArray: { $concatArrays: [''$totals'', ''$ageGroups''] }\n }\n },\n { $unwind: ''$mergedArray'' },\n { $replaceRoot: { newRoot: ''$mergedArray'' } },\n {\n $addFields: {\n order: {\n $cond: {\n if: { $eq: [''$category'', ''Total''] },\n then: 1,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''< 1''] },\n then: 2,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''< 5''] },\n then: 3,\n else: 4\n }\n }\n }\n }\n }\n }\n }\n },\n {\n $sort: {\n order: 1\n }\n },\n { $project: { total: 1, category: 1 } },\n {\n $sort: {\n category: -1\n }\n },\n]","collection":"analyticsRegistrations"},"type":"native"},"id":31,"parameter_mappings":[],"display":"bar","entity_id":"hTP9EUEq13VA1N_H-258l","co', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(598, 1, 'llection_preview":true,"visualization_settings":{"graph.y_axis.title_text":"Total","graph.show_values":true,"graph.series_order_dimension":null,"graph.x_axis.title_text":"Category","graph.metrics":["total"],"graph.series_order":null,"series_settings":{"4":{"title":"Under age 5","color":"#509EE3"},"7":{"color":"#F9D45C","title":"Over age 5"},"12":{"color":"#A989C5","title":"Under age 1"},"23":{"title":"Total"}},"graph.dimensions":["category","total"],"stackable.stack_type":"stacked"},"is_write":false,"parameters":[{"id":"84b2ec9e-eea8-e9ee-160f-57a211462c2a","type":"date/relative","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"7d3014f2-7de5-b2b0-fb10-0796ecc6fe38","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"086c0846-69f4-a2b9-16b8-86af040bf2c8","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"537bc06b-acf9-9d28-3c92-346d83ce5156","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"5626fb9c-14cd-0fe8-2254-687e292aeb7b","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); INSERT INTO SYSTEM_LOB_STREAM VALUES(599, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by age","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterDate":{"id":"84b2ec9e-eea8-e9ee-160f-57a211462c2a","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/relative","default":null},"filterGender":{"id":"7d3014f2-7de5-b2b0-fb10-0796ecc6fe38","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"086c0846-69f4-a2b9-16b8-86af040bf2c8","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"537bc06b-acf9-9d28-3c92-346d83ce5156","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"5626fb9c-14cd-0fe8-2254-687e292aeb7b","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null}},"query":"[\n {\n $match: {\n $and: [{ _id: { $ne: null } }\n [[{{ filterDate }} ]]\n [[{{ filterGender }} ]]\n [[{{ filterEvent }}]]\n [[{{ filterState }}]]\n [[{{ filterOffice }}]]\n ]\n }\n },\n {\n $facet: {\n totals: [{ $count: ''total'' }, { $addFields: { category: ''Total'' } }],\n ageGroups: [\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 365] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''< 1''\n },\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 1825] },\n { $gte: [''$childsAge'', 365] }\n ]\n },\n then: ''< 5''\n }\n ],\n default: ''5+''\n }\n }\n }\n },\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n category: ''$_id.par'',\n total: ''$totalCustomer''\n }\n }\n ]\n }\n },\n {\n $project: {\n mergedArray: { $concatArrays: [''$totals'', ''$ageGroups''] }\n }\n },\n { $unwind: ''$mergedArray'' },\n { $replaceRoot: { newRoot: ''$mergedArray'' } },\n {\n $addFields: {\n order: {\n $cond: {\n if: { $eq: [''$category'', ''Total''] },\n then: 1,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''< 1''] },\n then: 2,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''< 5''] },\n then: 3,\n else: 4\n }\n }\n }\n }\n }\n }\n }\n },\n {\n $sort: {\n order: 1\n }\n },\n { $project: { total: 1, category: 1 } },\n {\n $sort: {\n category: -1\n }\n },\n]","collection":"analyticsRegistrations"},"type":"native"},"id":31,"parameter_mappings":[],"display":"bar","entity_id":"hTP9EUEq13VA1N_H-258l","collection_preview":tru', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(599, 1, 'e,"visualization_settings":{"graph.y_axis.title_text":"Total","graph.show_values":true,"graph.series_order_dimension":null,"graph.x_axis.title_text":"Category","graph.metrics":["total"],"graph.series_order":null,"series_settings":{"4":{"title":"Under age 5","color":"#509EE3"},"7":{"title":"Over age 5","color":"#509EE3"},"12":{"title":"Under age 1","color":"#509EE3"},"23":{"color":"#F9D45C","title":"Total"}},"graph.dimensions":["category","total"],"stackable.stack_type":"stacked"},"is_write":false,"parameters":[{"id":"84b2ec9e-eea8-e9ee-160f-57a211462c2a","type":"date/relative","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"7d3014f2-7de5-b2b0-fb10-0796ecc6fe38","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"086c0846-69f4-a2b9-16b8-86af040bf2c8","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"537bc06b-acf9-9d28-3c92-346d83ce5156","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"5626fb9c-14cd-0fe8-2254-687e292aeb7b","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(599, 1, 'e,"visualization_settings":{"graph.y_axis.title_text":"Total","graph.show_values":true,"graph.series_order_dimension":null,"graph.x_axis.title_text":"Category","graph.metrics":["total"],"graph.series_order":null,"series_settings":{"4":{"title":"Under age 5","color":"#509EE3"},"7":{"color":"#F9D45C","title":"Over age 5"},"12":{"color":"#A989C5","title":"Under age 1"},"23":{"title":"Total"}},"graph.dimensions":["category","total"],"stackable.stack_type":"stacked"},"is_write":false,"parameters":[{"id":"84b2ec9e-eea8-e9ee-160f-57a211462c2a","type":"date/relative","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"7d3014f2-7de5-b2b0-fb10-0796ecc6fe38","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"086c0846-69f4-a2b9-16b8-86af040bf2c8","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"537bc06b-acf9-9d28-3c92-346d83ce5156","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"5626fb9c-14cd-0fe8-2254-687e292aeb7b","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(600, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by age","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterDate":{"id":"84b2ec9e-eea8-e9ee-160f-57a211462c2a","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/relative","default":null},"filterGender":{"id":"7d3014f2-7de5-b2b0-fb10-0796ecc6fe38","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"086c0846-69f4-a2b9-16b8-86af040bf2c8","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"537bc06b-acf9-9d28-3c92-346d83ce5156","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"5626fb9c-14cd-0fe8-2254-687e292aeb7b","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null}},"query":"[\n {\n $match: {\n $and: [{ _id: { $ne: null } }\n [[{{ filterDate }} ]]\n [[{{ filterGender }} ]]\n [[{{ filterEvent }}]]\n [[{{ filterState }}]]\n [[{{ filterOffice }}]]\n ]\n }\n },\n {\n $facet: {\n totals: [{ $count: ''total'' }, { $addFields: { category: ''Total'' } }],\n ageGroups: [\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 365] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''< 1''\n },\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 1825] },\n { $gte: [''$childsAge'', 365] }\n ]\n },\n then: ''< 5''\n }\n ],\n default: ''5+''\n }\n }\n }\n },\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n category: ''$_id.par'',\n total: ''$totalCustomer''\n }\n }\n ]\n }\n },\n {\n $project: {\n mergedArray: { $concatArrays: [''$totals'', ''$ageGroups''] }\n }\n },\n { $unwind: ''$mergedArray'' },\n { $replaceRoot: { newRoot: ''$mergedArray'' } },\n {\n $addFields: {\n order: {\n $cond: {\n if: { $eq: [''$category'', ''Total''] },\n then: 1,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''< 1''] },\n then: 2,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''< 5''] },\n then: 3,\n else: 4\n }\n }\n }\n }\n }\n }\n }\n },\n {\n $sort: {\n order: 1\n }\n },\n { $project: { total: 1, category: 1 } },\n {\n $sort: {\n category: -1\n }\n },\n]","collection":"analyticsRegistrations"},"type":"native"},"id":31,"parameter_mappings":[],"display":"bar","entity_id":"hTP9EUEq13VA1N_H-258l","collection_preview":tru', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(600, 1, 'e,"visualization_settings":{"graph.y_axis.title_text":"Total","graph.show_values":true,"graph.series_order_dimension":null,"graph.x_axis.title_text":"Category","graph.metrics":["total"],"graph.series_order":null,"series_settings":{"4":{"title":"Under age 5","color":"#509EE3"},"7":{"title":"Over age 5","color":"#509EE3"},"12":{"title":"Under age 1","color":"#509EE3"},"23":{"color":"#F9D45C","title":"Total"}},"graph.dimensions":["category","total"],"stackable.stack_type":"stacked"},"is_write":false,"parameters":[{"id":"84b2ec9e-eea8-e9ee-160f-57a211462c2a","type":"date/relative","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"7d3014f2-7de5-b2b0-fb10-0796ecc6fe38","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"086c0846-69f4-a2b9-16b8-86af040bf2c8","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"537bc06b-acf9-9d28-3c92-346d83ce5156","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"5626fb9c-14cd-0fe8-2254-687e292aeb7b","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); INSERT INTO "PUBLIC"."REVISION" VALUES -(394, 'Card', 12, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 10:04:17.126+00', SYSTEM_COMBINE_CLOB(586), FALSE, FALSE, NULL), +(394, 'Card', 12, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 10:04:17.126+00', SYSTEM_COMBINE_CLOB(587), FALSE, FALSE, NULL), (395, 'Card', 30, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 10:12:01.212+00', '{"description":null,"archived":false,"collection_position":null,"table_id":22,"database_id":2,"enable_embedding":false,"collection_id":8,"query_type":"query","name":"Certificates issued","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"query","query":{"source-table":22,"aggregation":[["count"]],"expressions":{"Status":["case",[[["=",["field",651,null],"REGISTERED"],"Not Certified"],[["=",["field",651,null],"CERTIFIED"],"Certified"]]]},"breakout":[["expression","Status"]]},"database":2},"id":30,"parameter_mappings":[],"display":"pie","entity_id":"i9_4VwkR62cl03HLkb9e7","collection_preview":true,"visualization_settings":{},"is_write":false,"parameters":[],"dataset":false,"public_uuid":null}', FALSE, TRUE, NULL), -(402, 'Card', 18, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 10:52:54.697+00', SYSTEM_COMBINE_CLOB(587), FALSE, FALSE, NULL), -(403, 'Card', 21, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 11:07:50.598+00', SYSTEM_COMBINE_CLOB(588), FALSE, FALSE, NULL), -(404, 'Card', 12, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 11:08:29.56+00', SYSTEM_COMBINE_CLOB(589), FALSE, FALSE, NULL), -(405, 'Card', 12, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 11:09:37.642+00', SYSTEM_COMBINE_CLOB(590), FALSE, FALSE, NULL), -(406, 'Card', 12, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 11:10:03.401+00', SYSTEM_COMBINE_CLOB(591), FALSE, FALSE, NULL), -(407, 'Card', 12, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 11:10:24.529+00', SYSTEM_COMBINE_CLOB(592), FALSE, FALSE, NULL), -(408, 'Card', 12, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 11:11:13.446+00', SYSTEM_COMBINE_CLOB(593), FALSE, FALSE, NULL), -(409, 'Card', 12, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 11:11:32.817+00', SYSTEM_COMBINE_CLOB(594), FALSE, FALSE, NULL), -(414, 'Card', 12, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 12:22:44.277+00', SYSTEM_COMBINE_CLOB(595), FALSE, FALSE, NULL), -(415, 'Card', 12, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 12:23:27.126+00', SYSTEM_COMBINE_CLOB(596), FALSE, FALSE, NULL), -(419, 'Card', 31, 1, TIMESTAMP WITH TIME ZONE '2022-12-21 07:21:48.04+00', SYSTEM_COMBINE_CLOB(597), FALSE, TRUE, NULL), -(420, 'Card', 31, 1, TIMESTAMP WITH TIME ZONE '2022-12-21 07:22:41.144+00', SYSTEM_COMBINE_CLOB(598), FALSE, FALSE, NULL), -(421, 'Card', 31, 1, TIMESTAMP WITH TIME ZONE '2022-12-21 07:24:43.811+00', SYSTEM_COMBINE_CLOB(599), FALSE, FALSE, NULL), +(402, 'Card', 18, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 10:52:54.697+00', SYSTEM_COMBINE_CLOB(588), FALSE, FALSE, NULL), +(403, 'Card', 21, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 11:07:50.598+00', SYSTEM_COMBINE_CLOB(589), FALSE, FALSE, NULL), +(404, 'Card', 12, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 11:08:29.56+00', SYSTEM_COMBINE_CLOB(590), FALSE, FALSE, NULL), +(405, 'Card', 12, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 11:09:37.642+00', SYSTEM_COMBINE_CLOB(591), FALSE, FALSE, NULL), +(406, 'Card', 12, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 11:10:03.401+00', SYSTEM_COMBINE_CLOB(592), FALSE, FALSE, NULL), +(407, 'Card', 12, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 11:10:24.529+00', SYSTEM_COMBINE_CLOB(593), FALSE, FALSE, NULL), +(408, 'Card', 12, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 11:11:13.446+00', SYSTEM_COMBINE_CLOB(594), FALSE, FALSE, NULL), +(409, 'Card', 12, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 11:11:32.817+00', SYSTEM_COMBINE_CLOB(595), FALSE, FALSE, NULL), +(414, 'Card', 12, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 12:22:44.277+00', SYSTEM_COMBINE_CLOB(596), FALSE, FALSE, NULL), +(415, 'Card', 12, 1, TIMESTAMP WITH TIME ZONE '2022-12-20 12:23:27.126+00', SYSTEM_COMBINE_CLOB(597), FALSE, FALSE, NULL), +(419, 'Card', 31, 1, TIMESTAMP WITH TIME ZONE '2022-12-21 07:21:48.04+00', SYSTEM_COMBINE_CLOB(598), FALSE, TRUE, NULL), +(420, 'Card', 31, 1, TIMESTAMP WITH TIME ZONE '2022-12-21 07:22:41.144+00', SYSTEM_COMBINE_CLOB(599), FALSE, FALSE, NULL), +(421, 'Card', 31, 1, TIMESTAMP WITH TIME ZONE '2022-12-21 07:24:43.811+00', SYSTEM_COMBINE_CLOB(600), FALSE, FALSE, NULL), (430, 'Card', 27, 1, TIMESTAMP WITH TIME ZONE '2022-12-21 07:32:07.284+00', '{"description":null,"archived":false,"collection_position":null,"table_id":22,"database_id":2,"enable_embedding":false,"collection_id":9,"query_type":"query","name":"Place of birth","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"query","query":{"aggregation":[["count"]],"breakout":[["expression","PlaceOfBirth"]],"expressions":{"PlaceOfBirth":["case",[[["=",["field",338,null],"BUS"],"Bus"],[["=",["field",338,null],"CAR_TAXI"],"Taxi"],[["=",["field",338,null],"HEALTH_FACILITY"],"Health Facility"],[["=",["field",338,null],"MATERNITY_HOME"],"Maternity Home"],[["=",["field",338,null],"PRIVATE_HOME"],"Private Home"],[["=",["field",338,null],"TRADITIONAL_DOCTORS"],"Traditional Doctors"]]]},"filter":["and",["=",["field",538,null],"Birth"],["time-interval",["field",354,null],"current","year"]],"source-table":22},"database":2},"id":27,"parameter_mappings":[],"display":"pie","entity_id":"AfR2OybIvG3i-a1qt-k0u","collection_preview":true,"visualization_settings":{},"is_write":false,"parameters":[],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL), (431, 'Card', 28, 1, TIMESTAMP WITH TIME ZONE '2022-12-21 07:32:38.954+00', '{"description":null,"archived":false,"collection_position":null,"table_id":68,"database_id":2,"enable_embedding":false,"collection_id":17,"query_type":"query","name":"Corrections by type","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"query","query":{"aggregation":[["count"]],"breakout":[["expression","ReasonForCorrection"]],"expressions":{"ReasonForCorrection":["case",[[["=",["field",617,null],"CLERICAL_ERROR"],"Clerical Error"],[["=",["field",617,null],"JUDICIAL_ORDER"],"Judicial Order"]]]},"filter":["and",["=",["field",650,null],"Birth"],["time-interval",["field",640,null],"current","year"]],"source-table":68},"database":2},"id":28,"parameter_mappings":[],"display":"pie","entity_id":"__hZ2xD-7VCBJ7mLFxB9Y","collection_preview":true,"visualization_settings":{},"is_write":false,"parameters":[],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(600, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by gender","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterGender":{"id":"714d5902-296d-8cee-ed3c-103c588a855a","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"90028ce9-3f5d-246a-8b0e-9221adb5128a","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"8f889b01-8027-df24-1000-aa0e7cd2123e","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"1b5d8679-3ac1-295e-94c5-709031bb6279","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"bb02d443-ba05-0c59-5887-eb51b5e72b90","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , { \"$group\": {\n \"_id\": {\n \"gender\": \"$gender\"\n },\n \"count\": {\n \"$sum\": 1\n },\n }\n },\n { \"$project\": {\n \"_id\": false,\n \"gender\": \"$_id.gender\",\n \"count\": true\n }\n },\n {$match: {\n \"gender\": {$ne: null}\n }}\n \n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Gender'': \"$allInfo.gender\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }}\n]","collection":"analyticsRegistrations"},"type":"native"},"id":1,"parameter_mappings":[],"display":"bar","entity_id":"Ksk2s3aUAdBmDtMTNwtH3","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.columns":[],"table.cell_column":"Gender","graph.series_order_dimension":null,"graph.metrics":["Count"],"graph.series_order":null,"table.pivot_column":"count","graph.dimensions":["Gender"]},"is_write":false,"parameters":[{"id":"714d5902-296d-8cee-ed3c-103c588a855a","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"90028ce9-3f5d-246a-8b0e-9221adb5128a","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"8f889b01-8027-df24-1000-aa0e7cd2123e","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"1b5d8679-3ac1-295e-94c5-709031bb6279","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"bb02d443-ba05-0c59-5887-eb51b5e72b90","type":"dat', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(600, 1, 'e/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(601, 0, '{"description":"This widget will show the result of past 30 days (default)","archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Leaderboard by Registrars","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterGender":{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/relative","default":"past30days"}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"practitionerName\": \"$practitionerName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"practitionerName\": \"$_id.practitionerName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"practitionerName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Registrar Name'': \"$allInfo.practitionerName\"\n , ''Registrations'': \"$allInfo.count\"\n }},\n {\n $limit: 10\n }\n]","collection":"analyticsRegistrations"},"type":"native"},"id":12,"parameter_mappings":[],"display":"row","entity_id":"VxeUMjNq8eLaHweLGUvYF","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.cell_column":"Percentage","graph.series_order_dimension":null,"graph.x_axis.title_text":"Registrars","graph.metrics":["Registrations"],"graph.label_value_formatting":"full","graph.series_order":null,"table.pivot_column":"Registrations","series_settings":{"Registrations":{"color":"#509EE3"}},"graph.dimensions":["Registrar Name"],"stackable.stack_type":null},"is_write":false,"parameters":[{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","type":"string/=","targe', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(601, 1, 't":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","type":"date/relative","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate","default":"past30days"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(602, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by gender","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterGender":{"id":"714d5902-296d-8cee-ed3c-103c588a855a","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"90028ce9-3f5d-246a-8b0e-9221adb5128a","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"8f889b01-8027-df24-1000-aa0e7cd2123e","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"1b5d8679-3ac1-295e-94c5-709031bb6279","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"bb02d443-ba05-0c59-5887-eb51b5e72b90","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , { \"$group\": {\n \"_id\": {\n \"gender\": \"$gender\"\n },\n \"count\": {\n \"$sum\": 1\n },\n }\n },\n { \"$project\": {\n \"_id\": false,\n \"gender\": \"$_id.gender\",\n \"count\": true\n }\n },\n {$match: {\n \"gender\": {$ne: null}\n }}\n \n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Gender'': \"$allInfo.gender\"\n , ''Registrations'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }}\n]","collection":"analyticsRegistrations"},"type":"native"},"id":1,"parameter_mappings":[],"display":"bar","entity_id":"Ksk2s3aUAdBmDtMTNwtH3","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.columns":[],"table.cell_column":"Gender","graph.series_order_dimension":null,"graph.metrics":["Registrations"],"graph.series_order":null,"table.pivot_column":"count","graph.dimensions":["Gender"]},"is_write":false,"parameters":[{"id":"714d5902-296d-8cee-ed3c-103c588a855a","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"90028ce9-3f5d-246a-8b0e-9221adb5128a","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"8f889b01-8027-df24-1000-aa0e7cd2123e","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"1b5d8679-3ac1-295e-94c5-709031bb6279","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"bb02d443-ba05-0c59-5887-eb51b5e72', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(602, 1, 'b90","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(603, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by gender","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterGender":{"id":"714d5902-296d-8cee-ed3c-103c588a855a","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"90028ce9-3f5d-246a-8b0e-9221adb5128a","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"8f889b01-8027-df24-1000-aa0e7cd2123e","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"1b5d8679-3ac1-295e-94c5-709031bb6279","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"bb02d443-ba05-0c59-5887-eb51b5e72b90","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , { \"$group\": {\n \"_id\": {\n \"gender\": \"$gender\"\n },\n \"count\": {\n \"$sum\": 1\n },\n }\n },\n { \"$project\": {\n \"_id\": false,\n \"gender\": \"$_id.gender\",\n \"count\": true\n }\n },\n {$match: {\n \"gender\": {$ne: null}\n }}\n \n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Gender'': \"$allInfo.gender\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }}\n]","collection":"analyticsRegistrations"},"type":"native"},"id":1,"parameter_mappings":[],"display":"bar","entity_id":"Ksk2s3aUAdBmDtMTNwtH3","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.columns":[],"table.cell_column":"Gender","graph.series_order_dimension":null,"graph.metrics":["Count"],"graph.series_order":null,"table.pivot_column":"count","graph.dimensions":["Gender"]},"is_write":false,"parameters":[{"id":"714d5902-296d-8cee-ed3c-103c588a855a","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"90028ce9-3f5d-246a-8b0e-9221adb5128a","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"8f889b01-8027-df24-1000-aa0e7cd2123e","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"1b5d8679-3ac1-295e-94c5-709031bb6279","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"bb02d443-ba05-0c59-5887-eb51b5e72b90","type":"dat', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(603, 1, 'e/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(601, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by gender","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterGender":{"id":"714d5902-296d-8cee-ed3c-103c588a855a","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"90028ce9-3f5d-246a-8b0e-9221adb5128a","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"8f889b01-8027-df24-1000-aa0e7cd2123e","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"1b5d8679-3ac1-295e-94c5-709031bb6279","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"bb02d443-ba05-0c59-5887-eb51b5e72b90","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , { \"$group\": {\n \"_id\": {\n \"gender\": \"$gender\"\n },\n \"count\": {\n \"$sum\": 1\n },\n }\n },\n { \"$project\": {\n \"_id\": false,\n \"gender\": \"$_id.gender\",\n \"count\": true\n }\n },\n {$match: {\n \"gender\": {$ne: null}\n }}\n \n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Gender'': \"$allInfo.gender\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }}\n]","collection":"analyticsRegistrations"},"type":"native"},"id":1,"parameter_mappings":[],"display":"bar","entity_id":"Ksk2s3aUAdBmDtMTNwtH3","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.columns":[],"table.cell_column":"Gender","graph.series_order_dimension":null,"graph.metrics":["Count"],"graph.series_order":null,"table.pivot_column":"count","graph.dimensions":["Gender"]},"is_write":false,"parameters":[{"id":"714d5902-296d-8cee-ed3c-103c588a855a","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"90028ce9-3f5d-246a-8b0e-9221adb5128a","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"8f889b01-8027-df24-1000-aa0e7cd2123e","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"1b5d8679-3ac1-295e-94c5-709031bb6279","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"bb02d443-ba05-0c59-5887-eb51b5e72b90","type":"dat', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(601, 1, 'e/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(602, 0, '{"description":"This widget will show the result of past 30 days (default)","archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Leaderboard by Registrars","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterGender":{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/relative","default":"past30days"}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"practitionerName\": \"$practitionerName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"practitionerName\": \"$_id.practitionerName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"practitionerName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Registrar Name'': \"$allInfo.practitionerName\"\n , ''Registrations'': \"$allInfo.count\"\n }},\n {\n $limit: 10\n }\n]","collection":"analyticsRegistrations"},"type":"native"},"id":12,"parameter_mappings":[],"display":"row","entity_id":"VxeUMjNq8eLaHweLGUvYF","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.cell_column":"Percentage","graph.series_order_dimension":null,"graph.x_axis.title_text":"Registrars","graph.metrics":["Registrations"],"graph.label_value_formatting":"full","graph.series_order":null,"table.pivot_column":"Registrations","series_settings":{"Registrations":{"color":"#509EE3"}},"graph.dimensions":["Registrar Name"],"stackable.stack_type":null},"is_write":false,"parameters":[{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","type":"string/=","targe', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(602, 1, 't":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","type":"date/relative","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate","default":"past30days"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(603, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by gender","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterGender":{"id":"714d5902-296d-8cee-ed3c-103c588a855a","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"90028ce9-3f5d-246a-8b0e-9221adb5128a","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"8f889b01-8027-df24-1000-aa0e7cd2123e","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"1b5d8679-3ac1-295e-94c5-709031bb6279","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"bb02d443-ba05-0c59-5887-eb51b5e72b90","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , { \"$group\": {\n \"_id\": {\n \"gender\": \"$gender\"\n },\n \"count\": {\n \"$sum\": 1\n },\n }\n },\n { \"$project\": {\n \"_id\": false,\n \"gender\": \"$_id.gender\",\n \"count\": true\n }\n },\n {$match: {\n \"gender\": {$ne: null}\n }}\n \n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Gender'': \"$allInfo.gender\"\n , ''Registrations'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }}\n]","collection":"analyticsRegistrations"},"type":"native"},"id":1,"parameter_mappings":[],"display":"bar","entity_id":"Ksk2s3aUAdBmDtMTNwtH3","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.columns":[],"table.cell_column":"Gender","graph.series_order_dimension":null,"graph.metrics":["Registrations"],"graph.series_order":null,"table.pivot_column":"count","graph.dimensions":["Gender"]},"is_write":false,"parameters":[{"id":"714d5902-296d-8cee-ed3c-103c588a855a","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"90028ce9-3f5d-246a-8b0e-9221adb5128a","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"8f889b01-8027-df24-1000-aa0e7cd2123e","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"1b5d8679-3ac1-295e-94c5-709031bb6279","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"bb02d443-ba05-0c59-5887-eb51b5e72', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(603, 1, 'b90","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(604, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by gender","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterGender":{"id":"714d5902-296d-8cee-ed3c-103c588a855a","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"90028ce9-3f5d-246a-8b0e-9221adb5128a","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"8f889b01-8027-df24-1000-aa0e7cd2123e","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"1b5d8679-3ac1-295e-94c5-709031bb6279","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"bb02d443-ba05-0c59-5887-eb51b5e72b90","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , { \"$group\": {\n \"_id\": {\n \"gender\": \"$gender\"\n },\n \"count\": {\n \"$sum\": 1\n },\n }\n },\n { \"$project\": {\n \"_id\": false,\n \"gender\": \"$_id.gender\",\n \"count\": true\n }\n },\n {$match: {\n \"gender\": {$ne: null}\n }}\n \n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Gender'': \"$allInfo.gender\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }}\n]","collection":"analyticsRegistrations"},"type":"native"},"id":1,"parameter_mappings":[],"display":"bar","entity_id":"Ksk2s3aUAdBmDtMTNwtH3","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.columns":[],"table.cell_column":"Gender","graph.series_order_dimension":null,"graph.metrics":["Count"],"graph.series_order":null,"table.pivot_column":"count","graph.dimensions":["Gender"]},"is_write":false,"parameters":[{"id":"714d5902-296d-8cee-ed3c-103c588a855a","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"90028ce9-3f5d-246a-8b0e-9221adb5128a","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"8f889b01-8027-df24-1000-aa0e7cd2123e","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"1b5d8679-3ac1-295e-94c5-709031bb6279","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"bb02d443-ba05-0c59-5887-eb51b5e72b90","type":"dat', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(604, 1, 'e/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); INSERT INTO "PUBLIC"."REVISION" VALUES -(438, 'Card', 1, 1, TIMESTAMP WITH TIME ZONE '2022-12-21 10:50:07.484+00', SYSTEM_COMBINE_CLOB(600), FALSE, FALSE, NULL), -(439, 'Card', 12, 1, TIMESTAMP WITH TIME ZONE '2022-12-21 10:51:09.204+00', SYSTEM_COMBINE_CLOB(601), FALSE, FALSE, NULL), -(440, 'Card', 1, 1, TIMESTAMP WITH TIME ZONE '2022-12-21 10:54:08.766+00', SYSTEM_COMBINE_CLOB(602), FALSE, FALSE, NULL), -(441, 'Card', 1, 1, TIMESTAMP WITH TIME ZONE '2022-12-21 10:54:51.594+00', SYSTEM_COMBINE_CLOB(603), FALSE, FALSE, NULL), +(438, 'Card', 1, 1, TIMESTAMP WITH TIME ZONE '2022-12-21 10:50:07.484+00', SYSTEM_COMBINE_CLOB(601), FALSE, FALSE, NULL), +(439, 'Card', 12, 1, TIMESTAMP WITH TIME ZONE '2022-12-21 10:51:09.204+00', SYSTEM_COMBINE_CLOB(602), FALSE, FALSE, NULL), +(440, 'Card', 1, 1, TIMESTAMP WITH TIME ZONE '2022-12-21 10:54:08.766+00', SYSTEM_COMBINE_CLOB(603), FALSE, FALSE, NULL), +(441, 'Card', 1, 1, TIMESTAMP WITH TIME ZONE '2022-12-21 10:54:51.594+00', SYSTEM_COMBINE_CLOB(604), FALSE, FALSE, NULL), (442, 'Card', 1, 1, TIMESTAMP WITH TIME ZONE '2022-12-21 10:57:18.951+00', '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by gender","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterDate":{"id":"56bcad79-0f63-fedb-353f-06d76542e554","name":"filterDate","display-name":"Filterdate","type":"text"},"filterGender":{"id":"1db3e4d1-30e4-b363-17a0-da2e6a738d96","name":"filterGender","display-name":"Filtergender","type":"text"},"filterEvent":{"id":"44beaa9e-5267-84ba-f544-6122407db01b","name":"filterEvent","display-name":"Filterevent","type":"text"},"filterState":{"id":"cc89381c-80b2-8721-6c42-64b9ac1f3932","name":"filterState","display-name":"Filterstate","type":"text"},"filterOffice":{"id":"2b1d42f4-11a7-0113-3a30-70ed4b8ac7ae","name":"filterOffice","display-name":"Filteroffice","type":"text"}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , { \"$group\": {\n \"_id\": {\n \"gender\": \"$gender\"\n },\n \"registrations\": {\n \"$sum\": 1\n },\n }\n },\n { \"$project\": {\n \"_id\": false,\n \"gender\": \"$_id.gender\",\n \"registrations\": true\n }\n },\n {$match: {\n \"gender\": {$ne: null}\n }}\n \n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Gender'': \"$allInfo.gender\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.registrations'', 100]}, ''$totalCount'']}\n , ''Registrations'': \"$allInfo.registrations\"\n \n }}\n]","collection":"analyticsRegistrations"},"type":"native"},"id":1,"parameter_mappings":[],"display":"bar","entity_id":"Ksk2s3aUAdBmDtMTNwtH3","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.columns":[],"table.cell_column":"Gender","graph.series_order_dimension":null,"graph.metrics":["Registrations"],"graph.series_order":null,"table.pivot_column":"count","series_settings":{"Registrations":{"show_series_values":true}},"graph.dimensions":["Gender"]},"is_write":false,"parameters":[{"id":"56bcad79-0f63-fedb-353f-06d76542e554","type":"category","target":["variable",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"},{"id":"1db3e4d1-30e4-b363-17a0-da2e6a738d96","type":"category","target":["variable",["template-tag","filterGender"]],"name":"Filtergender","slug":"filterGender"},{"id":"44beaa9e-5267-84ba-f544-6122407db01b","type":"category","target":["variable",["template-tag","filterEvent"]],"name":"Filterevent","slug":"filterEvent"},{"id":"cc89381c-80b2-8721-6c42-64b9ac1f3932","type":"category","target":["variable",["template-tag","filterState"]],"name":"Filterstate","slug":"filterState"},{"id":"2b1d42f4-11a7-0113-3a30-70ed4b8ac7ae","type":"category","target":["variable",["template-tag","filterOffice"]],"name":"Filteroffice","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL); INSERT INTO "PUBLIC"."REVISION" VALUES (443, 'Card', 1, 1, TIMESTAMP WITH TIME ZONE '2022-12-21 10:58:34.876+00', '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by gender","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterDate":{"id":"56bcad79-0f63-fedb-353f-06d76542e554","name":"filterDate","display-name":"Filterdate","type":"text"},"filterGender":{"id":"1db3e4d1-30e4-b363-17a0-da2e6a738d96","name":"filterGender","display-name":"Filtergender","type":"text"},"filterEvent":{"id":"44beaa9e-5267-84ba-f544-6122407db01b","name":"filterEvent","display-name":"Filterevent","type":"text"},"filterState":{"id":"cc89381c-80b2-8721-6c42-64b9ac1f3932","name":"filterState","display-name":"Filterstate","type":"text"},"filterOffice":{"id":"2b1d42f4-11a7-0113-3a30-70ed4b8ac7ae","name":"filterOffice","display-name":"Filteroffice","type":"text"}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , { \"$group\": {\n \"_id\": {\n \"gender\": \"$gender\"\n },\n \"count\": {\n \"$sum\": 1\n },\n }\n },\n { \"$project\": {\n \"_id\": false,\n \"gender\": \"$_id.gender\",\n \"count\": true\n }\n },\n {$match: {\n \"gender\": {$ne: null}\n }}\n \n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Gender'': \"$allInfo.gender\"\n , ''Registrations'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n }}\n]","collection":"analyticsRegistrations"},"type":"native"},"id":1,"parameter_mappings":[],"display":"bar","entity_id":"Ksk2s3aUAdBmDtMTNwtH3","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.columns":[],"table.cell_column":"Gender","graph.series_order_dimension":null,"graph.metrics":["Registrations"],"graph.series_order":null,"table.pivot_column":"count","series_settings":{"Registrations":{"color":"#509EE3","show_series_values":true}},"graph.dimensions":["Gender"]},"is_write":false,"parameters":[{"id":"56bcad79-0f63-fedb-353f-06d76542e554","type":"category","target":["variable",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"},{"id":"1db3e4d1-30e4-b363-17a0-da2e6a738d96","type":"category","target":["variable",["template-tag","filterGender"]],"name":"Filtergender","slug":"filterGender"},{"id":"44beaa9e-5267-84ba-f544-6122407db01b","type":"category","target":["variable",["template-tag","filterEvent"]],"name":"Filterevent","slug":"filterEvent"},{"id":"cc89381c-80b2-8721-6c42-64b9ac1f3932","type":"category","target":["variable",["template-tag","filterState"]],"name":"Filterstate","slug":"filterState"},{"id":"2b1d42f4-11a7-0113-3a30-70ed4b8ac7ae","type":"category","target":["variable",["template-tag","filterOffice"]],"name":"Filteroffice","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(604, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by gender","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , { \"$group\": {\n \"_id\": {\n \"gender\": \"$gender\"\n },\n \"count\": {\n \"$sum\": 1\n },\n }\n },\n { \"$project\": {\n \"_id\": false,\n \"gender\": \"$_id.gender\",\n \"count\": true\n }\n },\n {$match: {\n \"gender\": {$ne: null}\n }}\n \n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Gender'': \"$allInfo.gender\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }}\n]","template-tags":{"filterDate":{"id":"57523c92-bc05-e144-f15d-a07fc78322c2","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/relative","default":null},"filterGender":{"id":"f7834d58-4acc-cc46-0aee-08d1421f1ff1","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"af46a4e6-571c-e47f-e8ab-2cf527f54d68","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"a771e085-c491-259c-3020-bb9f97cf56f4","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"09bc4ac9-1847-d645-24c9-4f2892e147d0","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null}}},"database":2},"id":1,"parameter_mappings":[],"display":"bar","entity_id":"Ksk2s3aUAdBmDtMTNwtH3","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.columns":[],"table.cell_column":"Gender","graph.series_order_dimension":null,"graph.metrics":["Count"],"graph.series_order":null,"table.pivot_column":"count","series_settings":{"Registrations":{"color":"#509EE3","show_series_values":true}},"graph.dimensions":["Gender"]},"is_write":false,"parameters":[{"id":"57523c92-bc05-e144-f15d-a07fc78322c2","type":"date/relative","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"f7834d58-4acc-cc46-0aee-08d1421f1ff1","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"af46a4e6-571c-e47f-e8ab-2cf527f54d68","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"a771e085-c491-259c-3020-bb9f97cf56f4","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(604, 1, '":"filterState"},{"id":"09bc4ac9-1847-d645-24c9-4f2892e147d0","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(605, 0, '{"description":"This widget will show the result of past 30 days (default)","archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Leaderboard of Registrars","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterGender":{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/relative","default":"past30days"}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"practitionerName\": \"$practitionerName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"practitionerName\": \"$_id.practitionerName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"practitionerName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Registrar Name'': \"$allInfo.practitionerName\"\n , ''Registrations'': \"$allInfo.count\"\n }},\n {\n $limit: 10\n }\n]","collection":"analyticsRegistrations"},"type":"native"},"id":12,"parameter_mappings":[],"display":"row","entity_id":"VxeUMjNq8eLaHweLGUvYF","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.cell_column":"Percentage","graph.series_order_dimension":null,"graph.x_axis.title_text":"Registrars","graph.metrics":["Registrations"],"graph.label_value_formatting":"full","graph.series_order":null,"table.pivot_column":"Registrations","series_settings":{"Registrations":{"color":"#509EE3"}},"graph.dimensions":["Registrar Name"],"stackable.stack_type":null},"is_write":false,"parameters":[{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","type":"string/=","targe', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(605, 1, 't":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","type":"date/relative","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate","default":"past30days"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(606, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":7,"query_type":"native","name":"Completeness Rate","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterEvent":{"id":"545955ab-f6ec-0de1-3f4e-ce9e50e91e82","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"63587bed-9b53-1d2a-5396-317e766e7de8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterGender":{"id":"92951985-5ced-b397-b9b6-ea5a04ef29d5","name":"filterGender","display-name":"Filtergender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterDate":{"id":"778705c5-e02b-4b7e-1379-c87c41870dd5","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",571,null],"widget-type":"date/range","default":null}},"query":"[\n {\n $addFields: {\n date: { $dateFromString: { dateString: ''$date''}} \n }\n },\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterDate }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n ]\n }}, \n {\n $addFields: {\n date: { $dateToString: {\n date: {$dateFromParts: {\n year: { $add: [ { $year: \"$date\" }, 1 ] },\n month: { $month: \"$date\" },\n day: { $dayOfMonth: \"$date\" }\n }\n }}}\n }\n },\n {\n $lookup: {\n from: \"analyticsRegistrations\",\n let: { name: \"$name\", date: \"$date\" },\n as: \"registrations\",\n pipeline: [\n {$group: {\n _id: { \n date: { $dateToString: { format: \"%Y-%m-%d\", date: \"$createdAt\" } }, \n stateName: \"$stateName\"\n },\n total: { $sum: 1 }\n }},\n {$addFields:{stateName: ''$_id.stateName'', date: {$dateToString: { date: { $dateFromString: { dateString: ''$_id.date''}}}}}},\n {\n $match:\n {\n $expr:\n {\n $and:\n [\n { $eq: [ \"$date\", \"$$date\" ] },\n { $eq: [ \"$stateName\", \"$$name\" ] }\n ]\n }\n }\n } \n ] \n }\n },\n\n {$addFields: {\n totalRegistrations: {\n $reduce: {\n input: \"$registrations\",\n initialValue: 0,\n in: { $add: [ \"$$value\", \"$$this.total\" ] }\n } \n \n } \n }},\n{$addFields: {estimate: ''$estimate.estimatedNumberOfBirths''}},\n {\n $group: {\n _id: null,\n totalRegistrations: { $sum: ''$totalRegistrations'' },\n estimate: { $sum:''$estimatedNumberOfBirths'' }\n }\n },\n {$addFields: {\n percentage: {\n $cond: {\n if: { $eq: [ \"$totalRegistrations\", 0 ] },\n then: 0,\n else: {\n $cond: {\n if: { $eq: [ \"$estimate\", 0 ] },\n then: 0,\n else: {$divide: [''$totalRegistrations'', ''$estimate'']}\n }\n }\n }\n } \n }}, \n {$project: {_id: false, percentage: ''$percentage''}} \n]","collection":"analyticsRegistrations"},"type":"native"},"id":13,"parameter_mappings":[', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(606, 1, '],"display":"gauge","entity_id":"RUK20xOu8Io0PvT4a332Q","collection_preview":true,"visualization_settings":{"table.pivot_column":"percentage","table.cell_column":"foo","gauge.segments":[{"min":0,"max":0.25,"color":"#ED6E6E","label":""},{"min":0.25,"max":0.75,"color":"#F9CF48","label":""},{"min":0.75,"max":1,"color":"#84BB4C","label":""}],"column_settings":{"[\"name\",\"percentage\"]":{"scale":100,"suffix":" %"}}},"is_write":false,"parameters":[{"id":"545955ab-f6ec-0de1-3f4e-ce9e50e91e82","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"63587bed-9b53-1d2a-5396-317e766e7de8","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"92951985-5ced-b397-b9b6-ea5a04ef29d5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Filtergender","slug":"filterGender"},{"id":"778705c5-e02b-4b7e-1379-c87c41870dd5","type":"date/range","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(607, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":6,"query_type":"native","name":" Completeness Rates by State","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterGender":{"id":"9e84f2a4-2b4c-dc2a-6529-b508bbeedb40","name":"filterGender","display-name":"Filtergender","type":"text"},"filterDate":{"id":"00f44aca-d69e-e96d-fe06-3a75520a7a56","name":"filterDate","display-name":"Filterdate","type":"text"},"filterEvent":{"id":"2e51c7f1-4ab9-fe06-d4d4-0b1ecdc4daf1","name":"filterEvent","display-name":"Filterevent","type":"text"},"filterState":{"id":"c7c17369-6fda-f065-f3c6-3270b4494260","name":"filterState","display-name":"Filterstate","type":"text"}},"query":"[\n {\n $addFields: {\n date: { $dateToString: {\n date: {$dateFromParts: {\n year: { $add: [ { $year: \"$date\" }, 1 ] },\n month: { $month: \"$date\" },\n day: { $dayOfMonth: \"$date\" }\n }\n }}}\n }\n }, \n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterDate }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n ]\n }}, \n {\n $lookup: {\n from: \"analyticsRegistrations\",\n let: { name: \"$name\", date: \"$date\" },\n as: \"registrations\",\n pipeline: [\n {$group: {\n _id: { \n date: { $dateToString: { format: \"%Y-%m-%d\", date: \"$createdAt\" } }, \n stateName: \"$stateName\"\n },\n total: { $sum: 1 }\n }},\n {$addFields:{stateName: ''$_id.stateName'', date: {$dateToString: { date: { $dateFromString: { dateString: ''$_id.date''}}}}}},\n {\n $match:\n {\n $expr:\n {\n $and:\n [\n { $eq: [ \"$date\", \"$$date\" ] },\n { $eq: [ \"$stateName\", \"$$name\" ] }\n ]\n }\n }\n } \n ] \n }\n },\n\n {$addFields: {\n totalRegistrations: {\n $reduce: {\n input: \"$registrations\",\n initialValue: 0,\n in: { $add: [ \"$$value\", \"$$this.total\" ] }\n } \n \n } \n }},\n{$addFields: {estimate: ''$estimate.estimatedNumberOfBirths''}},\n {\n $group: {\n _id: {name: \"$name\"},\n totalRegistrations: { $sum: ''$totalRegistrations'' },\n estimate: { $sum:''$estimatedNumberOfBirths'' }\n }\n },\n {$addFields: {\n percentage: {\n $cond: {\n if: { $eq: [ \"$totalRegistrations\", 0 ] },\n then: 0,\n else: {\n $cond: {\n if: { $eq: [ \"$estimate\", 0 ] },\n then: 0,\n else: {$divide: [''$totalRegistrations'', ''$estimate'']}\n }\n }\n }\n } \n }}, \n {$project: {\n state: ''$_id.name'',\n percentage: {$round: [{$multiply: [''$percentage'', 100] }, 0]},\n test: ''[[ {{ filterDate }} ]]''\n }}\n \n]","collection":"analyticsPopulationEstimatesPerDay"},"type":"native"},"id":9,"parameter_mappings":[],"display":"map","entity_id":"9t73rF7ixsw9EVOWpx7ab","collection_preview":true,"visualization_settings":{"map.type":"region","map.region":"910cd1de-9dbd-c36c-96bd-39d55ad9b84f","map.metric":"percentage","map.dime', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(607, 1, 'nsion":"state","table.pivot_column":"_id","table.cell_column":"percentage"},"is_write":false,"parameters":[{"id":"9e84f2a4-2b4c-dc2a-6529-b508bbeedb40","type":"category","target":["variable",["template-tag","filterGender"]],"name":"Filtergender","slug":"filterGender"},{"id":"00f44aca-d69e-e96d-fe06-3a75520a7a56","type":"category","target":["variable",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"},{"id":"2e51c7f1-4ab9-fe06-d4d4-0b1ecdc4daf1","type":"category","target":["variable",["template-tag","filterEvent"]],"name":"Filterevent","slug":"filterEvent"},{"id":"c7c17369-6fda-f065-f3c6-3270b4494260","type":"category","target":["variable",["template-tag","filterState"]],"name":"Filterstate","slug":"filterState"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(608, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":6,"query_type":"native","name":" Completeness Rates by State","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterDate":{"id":"00f44aca-d69e-e96d-fe06-3a75520a7a56","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",571,null],"widget-type":"date/range","default":null},"filterState":{"id":"f884c63f-cae1-253b-a66a-e9d1284f25b2","name":"filterState","display-name":"Filterstate","type":"dimension","dimension":["field",572,null],"widget-type":"string/=","default":null}},"query":"[\n {\n $addFields: {\n date: { $dateToString: {\n date: {$dateFromParts: {\n year: { $add: [ { $year: \"$date\" }, 1 ] },\n month: { $month: \"$date\" },\n day: { $dayOfMonth: \"$date\" }\n }\n }}}\n }\n }, \n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterState }} ]]\n ]\n }}, \n {\n $lookup: {\n from: \"analyticsRegistrations\",\n let: { name: \"$name\", date: \"$date\" },\n as: \"registrations\",\n pipeline: [\n {$group: {\n _id: { \n date: { $dateToString: { format: \"%Y-%m-%d\", date: \"$createdAt\" } }, \n stateName: \"$stateName\"\n },\n total: { $sum: 1 }\n }},\n {$addFields:{stateName: ''$_id.stateName'', date: {$dateToString: { date: { $dateFromString: { dateString: ''$_id.date''}}}}}},\n {\n $match:\n {\n $expr:\n {\n $and:\n [\n { $eq: [ \"$date\", \"$$date\" ] },\n { $eq: [ \"$stateName\", \"$$name\" ] }\n ]\n }\n }\n } \n ] \n }\n },\n\n {$addFields: {\n totalRegistrations: {\n $reduce: {\n input: \"$registrations\",\n initialValue: 0,\n in: { $add: [ \"$$value\", \"$$this.total\" ] }\n } \n \n } \n }},\n{$addFields: {estimate: ''$estimate.estimatedNumberOfBirths''}},\n {\n $group: {\n _id: {name: \"$name\"},\n totalRegistrations: { $sum: ''$totalRegistrations'' },\n estimate: { $sum:''$estimatedNumberOfBirths'' }\n }\n },\n {$addFields: {\n percentage: {\n $cond: {\n if: { $eq: [ \"$totalRegistrations\", 0 ] },\n then: 0,\n else: {\n $cond: {\n if: { $eq: [ \"$estimate\", 0 ] },\n then: 0,\n else: {$divide: [''$totalRegistrations'', ''$estimate'']}\n }\n }\n }\n } \n }}, \n {$project: {\n state: ''$_id.name'',\n percentage: {$round: [{$multiply: [''$percentage'', 100] }, 0]}\n }}\n \n]","collection":"analyticsPopulationEstimatesPerDay"},"type":"native"},"id":9,"parameter_mappings":[],"display":"map","entity_id":"9t73rF7ixsw9EVOWpx7ab","collection_preview":true,"visualization_settings":{"map.type":"region","map.region":"910cd1de-9dbd-c36c-96bd-39d55ad9b84f","map.metric":"percentage","map.dimension":"state","table.pivot_column":"_id","table.cell_column":"percentage"},"is_write":false,"parameters":[{"id":"00f44aca-d69e-e96d-fe06-3a75520a7a56","type":"date/range","target":["dimension",["template-tag","filterDate"]', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(608, 1, '],"name":"Filterdate","slug":"filterDate"},{"id":"f884c63f-cae1-253b-a66a-e9d1284f25b2","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"Filterstate","slug":"filterState"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(605, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by gender","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , { \"$group\": {\n \"_id\": {\n \"gender\": \"$gender\"\n },\n \"count\": {\n \"$sum\": 1\n },\n }\n },\n { \"$project\": {\n \"_id\": false,\n \"gender\": \"$_id.gender\",\n \"count\": true\n }\n },\n {$match: {\n \"gender\": {$ne: null}\n }}\n \n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Gender'': \"$allInfo.gender\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }}\n]","template-tags":{"filterDate":{"id":"57523c92-bc05-e144-f15d-a07fc78322c2","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/relative","default":null},"filterGender":{"id":"f7834d58-4acc-cc46-0aee-08d1421f1ff1","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"af46a4e6-571c-e47f-e8ab-2cf527f54d68","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"a771e085-c491-259c-3020-bb9f97cf56f4","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"09bc4ac9-1847-d645-24c9-4f2892e147d0","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null}}},"database":2},"id":1,"parameter_mappings":[],"display":"bar","entity_id":"Ksk2s3aUAdBmDtMTNwtH3","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.columns":[],"table.cell_column":"Gender","graph.series_order_dimension":null,"graph.metrics":["Count"],"graph.series_order":null,"table.pivot_column":"count","series_settings":{"Registrations":{"color":"#509EE3","show_series_values":true}},"graph.dimensions":["Gender"]},"is_write":false,"parameters":[{"id":"57523c92-bc05-e144-f15d-a07fc78322c2","type":"date/relative","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"f7834d58-4acc-cc46-0aee-08d1421f1ff1","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"af46a4e6-571c-e47f-e8ab-2cf527f54d68","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"a771e085-c491-259c-3020-bb9f97cf56f4","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(605, 1, '":"filterState"},{"id":"09bc4ac9-1847-d645-24c9-4f2892e147d0","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(606, 0, '{"description":"This widget will show the result of past 30 days (default)","archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Leaderboard of Registrars","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterGender":{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",352,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/relative","default":"past30days"}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"practitionerName\": \"$practitionerName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"practitionerName\": \"$_id.practitionerName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"practitionerName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Registrar Name'': \"$allInfo.practitionerName\"\n , ''Registrations'': \"$allInfo.count\"\n }},\n {\n $limit: 10\n }\n]","collection":"analyticsRegistrations"},"type":"native"},"id":12,"parameter_mappings":[],"display":"row","entity_id":"VxeUMjNq8eLaHweLGUvYF","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.cell_column":"Percentage","graph.series_order_dimension":null,"graph.x_axis.title_text":"Registrars","graph.metrics":["Registrations"],"graph.label_value_formatting":"full","graph.series_order":null,"table.pivot_column":"Registrations","series_settings":{"Registrations":{"color":"#509EE3"}},"graph.dimensions":["Registrar Name"],"stackable.stack_type":null},"is_write":false,"parameters":[{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","type":"string/=","targe', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(606, 1, 't":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","type":"date/relative","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate","default":"past30days"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(607, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":7,"query_type":"native","name":"Completeness Rate","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterEvent":{"id":"545955ab-f6ec-0de1-3f4e-ce9e50e91e82","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"63587bed-9b53-1d2a-5396-317e766e7de8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterGender":{"id":"92951985-5ced-b397-b9b6-ea5a04ef29d5","name":"filterGender","display-name":"Filtergender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterDate":{"id":"778705c5-e02b-4b7e-1379-c87c41870dd5","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",571,null],"widget-type":"date/range","default":null}},"query":"[\n {\n $addFields: {\n date: { $dateFromString: { dateString: ''$date''}} \n }\n },\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterDate }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n ]\n }}, \n {\n $addFields: {\n date: { $dateToString: {\n date: {$dateFromParts: {\n year: { $add: [ { $year: \"$date\" }, 1 ] },\n month: { $month: \"$date\" },\n day: { $dayOfMonth: \"$date\" }\n }\n }}}\n }\n },\n {\n $lookup: {\n from: \"analyticsRegistrations\",\n let: { name: \"$name\", date: \"$date\" },\n as: \"registrations\",\n pipeline: [\n {$group: {\n _id: { \n date: { $dateToString: { format: \"%Y-%m-%d\", date: \"$createdAt\" } }, \n stateName: \"$stateName\"\n },\n total: { $sum: 1 }\n }},\n {$addFields:{stateName: ''$_id.stateName'', date: {$dateToString: { date: { $dateFromString: { dateString: ''$_id.date''}}}}}},\n {\n $match:\n {\n $expr:\n {\n $and:\n [\n { $eq: [ \"$date\", \"$$date\" ] },\n { $eq: [ \"$stateName\", \"$$name\" ] }\n ]\n }\n }\n } \n ] \n }\n },\n\n {$addFields: {\n totalRegistrations: {\n $reduce: {\n input: \"$registrations\",\n initialValue: 0,\n in: { $add: [ \"$$value\", \"$$this.total\" ] }\n } \n \n } \n }},\n{$addFields: {estimate: ''$estimate.estimatedNumberOfBirths''}},\n {\n $group: {\n _id: null,\n totalRegistrations: { $sum: ''$totalRegistrations'' },\n estimate: { $sum:''$estimatedNumberOfBirths'' }\n }\n },\n {$addFields: {\n percentage: {\n $cond: {\n if: { $eq: [ \"$totalRegistrations\", 0 ] },\n then: 0,\n else: {\n $cond: {\n if: { $eq: [ \"$estimate\", 0 ] },\n then: 0,\n else: {$divide: [''$totalRegistrations'', ''$estimate'']}\n }\n }\n }\n } \n }}, \n {$project: {_id: false, percentage: ''$percentage''}} \n]","collection":"analyticsRegistrations"},"type":"native"},"id":13,"parameter_mappings":[', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(607, 1, '],"display":"gauge","entity_id":"RUK20xOu8Io0PvT4a332Q","collection_preview":true,"visualization_settings":{"table.pivot_column":"percentage","table.cell_column":"foo","gauge.segments":[{"min":0,"max":0.25,"color":"#ED6E6E","label":""},{"min":0.25,"max":0.75,"color":"#F9CF48","label":""},{"min":0.75,"max":1,"color":"#84BB4C","label":""}],"column_settings":{"[\"name\",\"percentage\"]":{"scale":100,"suffix":" %"}}},"is_write":false,"parameters":[{"id":"545955ab-f6ec-0de1-3f4e-ce9e50e91e82","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"63587bed-9b53-1d2a-5396-317e766e7de8","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"92951985-5ced-b397-b9b6-ea5a04ef29d5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Filtergender","slug":"filterGender"},{"id":"778705c5-e02b-4b7e-1379-c87c41870dd5","type":"date/range","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(608, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":6,"query_type":"native","name":" Completeness Rates by State","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterGender":{"id":"9e84f2a4-2b4c-dc2a-6529-b508bbeedb40","name":"filterGender","display-name":"Filtergender","type":"text"},"filterDate":{"id":"00f44aca-d69e-e96d-fe06-3a75520a7a56","name":"filterDate","display-name":"Filterdate","type":"text"},"filterEvent":{"id":"2e51c7f1-4ab9-fe06-d4d4-0b1ecdc4daf1","name":"filterEvent","display-name":"Filterevent","type":"text"},"filterState":{"id":"c7c17369-6fda-f065-f3c6-3270b4494260","name":"filterState","display-name":"Filterstate","type":"text"}},"query":"[\n {\n $addFields: {\n date: { $dateToString: {\n date: {$dateFromParts: {\n year: { $add: [ { $year: \"$date\" }, 1 ] },\n month: { $month: \"$date\" },\n day: { $dayOfMonth: \"$date\" }\n }\n }}}\n }\n }, \n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterDate }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n ]\n }}, \n {\n $lookup: {\n from: \"analyticsRegistrations\",\n let: { name: \"$name\", date: \"$date\" },\n as: \"registrations\",\n pipeline: [\n {$group: {\n _id: { \n date: { $dateToString: { format: \"%Y-%m-%d\", date: \"$createdAt\" } }, \n stateName: \"$stateName\"\n },\n total: { $sum: 1 }\n }},\n {$addFields:{stateName: ''$_id.stateName'', date: {$dateToString: { date: { $dateFromString: { dateString: ''$_id.date''}}}}}},\n {\n $match:\n {\n $expr:\n {\n $and:\n [\n { $eq: [ \"$date\", \"$$date\" ] },\n { $eq: [ \"$stateName\", \"$$name\" ] }\n ]\n }\n }\n } \n ] \n }\n },\n\n {$addFields: {\n totalRegistrations: {\n $reduce: {\n input: \"$registrations\",\n initialValue: 0,\n in: { $add: [ \"$$value\", \"$$this.total\" ] }\n } \n \n } \n }},\n{$addFields: {estimate: ''$estimate.estimatedNumberOfBirths''}},\n {\n $group: {\n _id: {name: \"$name\"},\n totalRegistrations: { $sum: ''$totalRegistrations'' },\n estimate: { $sum:''$estimatedNumberOfBirths'' }\n }\n },\n {$addFields: {\n percentage: {\n $cond: {\n if: { $eq: [ \"$totalRegistrations\", 0 ] },\n then: 0,\n else: {\n $cond: {\n if: { $eq: [ \"$estimate\", 0 ] },\n then: 0,\n else: {$divide: [''$totalRegistrations'', ''$estimate'']}\n }\n }\n }\n } \n }}, \n {$project: {\n state: ''$_id.name'',\n percentage: {$round: [{$multiply: [''$percentage'', 100] }, 0]},\n test: ''[[ {{ filterDate }} ]]''\n }}\n \n]","collection":"analyticsPopulationEstimatesPerDay"},"type":"native"},"id":9,"parameter_mappings":[],"display":"map","entity_id":"9t73rF7ixsw9EVOWpx7ab","collection_preview":true,"visualization_settings":{"map.type":"region","map.region":"910cd1de-9dbd-c36c-96bd-39d55ad9b84f","map.metric":"percentage","map.dime', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(608, 1, 'nsion":"state","table.pivot_column":"_id","table.cell_column":"percentage"},"is_write":false,"parameters":[{"id":"9e84f2a4-2b4c-dc2a-6529-b508bbeedb40","type":"category","target":["variable",["template-tag","filterGender"]],"name":"Filtergender","slug":"filterGender"},{"id":"00f44aca-d69e-e96d-fe06-3a75520a7a56","type":"category","target":["variable",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"},{"id":"2e51c7f1-4ab9-fe06-d4d4-0b1ecdc4daf1","type":"category","target":["variable",["template-tag","filterEvent"]],"name":"Filterevent","slug":"filterEvent"},{"id":"c7c17369-6fda-f065-f3c6-3270b4494260","type":"category","target":["variable",["template-tag","filterState"]],"name":"Filterstate","slug":"filterState"}],"dataset":false,"public_uuid":null}', NULL); INSERT INTO SYSTEM_LOB_STREAM VALUES(609, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":6,"query_type":"native","name":" Completeness Rates by State","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterDate":{"id":"00f44aca-d69e-e96d-fe06-3a75520a7a56","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",571,null],"widget-type":"date/range","default":null},"filterState":{"id":"f884c63f-cae1-253b-a66a-e9d1284f25b2","name":"filterState","display-name":"Filterstate","type":"dimension","dimension":["field",572,null],"widget-type":"string/=","default":null}},"query":"[\n {\n $addFields: {\n date: { $dateToString: {\n date: {$dateFromParts: {\n year: { $add: [ { $year: \"$date\" }, 1 ] },\n month: { $month: \"$date\" },\n day: { $dayOfMonth: \"$date\" }\n }\n }}}\n }\n }, \n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterState }} ]]\n ]\n }}, \n {\n $lookup: {\n from: \"analyticsRegistrations\",\n let: { name: \"$name\", date: \"$date\" },\n as: \"registrations\",\n pipeline: [\n {$group: {\n _id: { \n date: { $dateToString: { format: \"%Y-%m-%d\", date: \"$createdAt\" } }, \n stateName: \"$stateName\"\n },\n total: { $sum: 1 }\n }},\n {$addFields:{stateName: ''$_id.stateName'', date: {$dateToString: { date: { $dateFromString: { dateString: ''$_id.date''}}}}}},\n {\n $match:\n {\n $expr:\n {\n $and:\n [\n { $eq: [ \"$date\", \"$$date\" ] },\n { $eq: [ \"$stateName\", \"$$name\" ] }\n ]\n }\n }\n } \n ] \n }\n },\n\n {$addFields: {\n totalRegistrations: {\n $reduce: {\n input: \"$registrations\",\n initialValue: 0,\n in: { $add: [ \"$$value\", \"$$this.total\" ] }\n } \n \n } \n }},\n{$addFields: {estimate: ''$estimate.estimatedNumberOfBirths''}},\n {\n $group: {\n _id: {name: \"$name\"},\n totalRegistrations: { $sum: ''$totalRegistrations'' },\n estimate: { $sum:''$estimatedNumberOfBirths'' }\n }\n },\n {$addFields: {\n percentage: {\n $cond: {\n if: { $eq: [ \"$totalRegistrations\", 0 ] },\n then: 0,\n else: {\n $cond: {\n if: { $eq: [ \"$estimate\", 0 ] },\n then: 0,\n else: {$divide: [''$totalRegistrations'', ''$estimate'']}\n }\n }\n }\n } \n }}, \n {$project: {\n state: ''$_id.name'',\n percentage: {$round: [{$multiply: [''$percentage'', 100] }, 0]}\n }}\n \n]","collection":"analyticsPopulationEstimatesPerDay"},"type":"native"},"id":9,"parameter_mappings":[],"display":"map","entity_id":"9t73rF7ixsw9EVOWpx7ab","collection_preview":true,"visualization_settings":{"map.type":"region","map.region":"910cd1de-9dbd-c36c-96bd-39d55ad9b84f","map.metric":"percentage","map.dimension":"state","table.pivot_column":"_id","table.cell_column":"percentage"},"is_write":false,"parameters":[{"id":"00f44aca-d69e-e96d-fe06-3a75520a7a56","type":"date/range","target":["dimension",["template-tag","filterDate"]', NULL); INSERT INTO SYSTEM_LOB_STREAM VALUES(609, 1, '],"name":"Filterdate","slug":"filterDate"},{"id":"f884c63f-cae1-253b-a66a-e9d1284f25b2","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"Filterstate","slug":"filterState"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(610, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":6,"query_type":"native","name":" Completeness Rates by State","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterDate":{"id":"00f44aca-d69e-e96d-fe06-3a75520a7a56","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",571,null],"widget-type":"date/range","default":null},"filterState":{"id":"f884c63f-cae1-253b-a66a-e9d1284f25b2","name":"filterState","display-name":"Filterstate","type":"dimension","dimension":["field",572,null],"widget-type":"string/=","default":null}},"query":"[\n {\n $addFields: {\n date: { $dateToString: {\n date: {$dateFromParts: {\n year: { $add: [ { $year: \"$date\" }, 1 ] },\n month: { $month: \"$date\" },\n day: { $dayOfMonth: \"$date\" }\n }\n }}}\n }\n }, \n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterState }} ]]\n ]\n }}, \n {\n $lookup: {\n from: \"analyticsRegistrations\",\n let: { name: \"$name\", date: \"$date\" },\n as: \"registrations\",\n pipeline: [\n {$group: {\n _id: { \n date: { $dateToString: { format: \"%Y-%m-%d\", date: \"$createdAt\" } }, \n stateName: \"$stateName\"\n },\n total: { $sum: 1 }\n }},\n {$addFields:{stateName: ''$_id.stateName'', date: {$dateToString: { date: { $dateFromString: { dateString: ''$_id.date''}}}}}},\n {\n $match:\n {\n $expr:\n {\n $and:\n [\n { $eq: [ \"$date\", \"$$date\" ] },\n { $eq: [ \"$stateName\", \"$$name\" ] }\n ]\n }\n }\n } \n ] \n }\n },\n\n {$addFields: {\n totalRegistrations: {\n $reduce: {\n input: \"$registrations\",\n initialValue: 0,\n in: { $add: [ \"$$value\", \"$$this.total\" ] }\n } \n \n } \n }},\n{$addFields: {estimate: ''$estimate.estimatedNumberOfBirths''}},\n {\n $group: {\n _id: {name: \"$name\"},\n totalRegistrations: { $sum: ''$totalRegistrations'' },\n estimate: { $sum:''$estimatedNumberOfBirths'' }\n }\n },\n {$addFields: {\n percentage: {\n $cond: {\n if: { $eq: [ \"$totalRegistrations\", 0 ] },\n then: 0,\n else: {\n $cond: {\n if: { $eq: [ \"$estimate\", 0 ] },\n then: 0,\n else: {$divide: [''$totalRegistrations'', ''$estimate'']}\n }\n }\n }\n } \n }}, \n {$project: {\n state: ''$_id.name'',\n percentage: {$round: [{$multiply: [''$percentage'', 100] }, 0]}\n }}\n \n]","collection":"analyticsPopulationEstimatesPerDay"},"type":"native"},"id":9,"parameter_mappings":[],"display":"map","entity_id":"9t73rF7ixsw9EVOWpx7ab","collection_preview":true,"visualization_settings":{"map.type":"region","map.region":"910cd1de-9dbd-c36c-96bd-39d55ad9b84f","map.metric":"percentage","map.dimension":"state","table.pivot_column":"_id","table.cell_column":"percentage"},"is_write":false,"parameters":[{"id":"00f44aca-d69e-e96d-fe06-3a75520a7a56","type":"date/range","target":["dimension",["template-tag","filterDate"]', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(610, 1, '],"name":"Filterdate","slug":"filterDate"},{"id":"f884c63f-cae1-253b-a66a-e9d1284f25b2","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"Filterstate","slug":"filterState"}],"dataset":false,"public_uuid":null}', NULL); INSERT INTO "PUBLIC"."REVISION" VALUES -(444, 'Card', 1, 1, TIMESTAMP WITH TIME ZONE '2022-12-21 11:04:42.033+00', SYSTEM_COMBINE_CLOB(604), FALSE, FALSE, NULL), -(445, 'Card', 12, 1, TIMESTAMP WITH TIME ZONE '2022-12-22 08:17:00.357+00', SYSTEM_COMBINE_CLOB(605), FALSE, FALSE, NULL), -(453, 'Card', 13, 1, TIMESTAMP WITH TIME ZONE '2022-12-22 12:03:42.573+00', SYSTEM_COMBINE_CLOB(606), FALSE, FALSE, NULL), -(457, 'Card', 9, 1, TIMESTAMP WITH TIME ZONE '2022-12-22 13:45:51.027+00', SYSTEM_COMBINE_CLOB(607), FALSE, FALSE, NULL), -(458, 'Card', 9, 1, TIMESTAMP WITH TIME ZONE '2022-12-22 13:50:18.849+00', SYSTEM_COMBINE_CLOB(608), FALSE, FALSE, NULL), -(459, 'Card', 9, 1, TIMESTAMP WITH TIME ZONE '2022-12-22 13:50:35.114+00', SYSTEM_COMBINE_CLOB(609), FALSE, FALSE, NULL), +(444, 'Card', 1, 1, TIMESTAMP WITH TIME ZONE '2022-12-21 11:04:42.033+00', SYSTEM_COMBINE_CLOB(605), FALSE, FALSE, NULL), +(445, 'Card', 12, 1, TIMESTAMP WITH TIME ZONE '2022-12-22 08:17:00.357+00', SYSTEM_COMBINE_CLOB(606), FALSE, FALSE, NULL), +(453, 'Card', 13, 1, TIMESTAMP WITH TIME ZONE '2022-12-22 12:03:42.573+00', SYSTEM_COMBINE_CLOB(607), FALSE, FALSE, NULL), +(457, 'Card', 9, 1, TIMESTAMP WITH TIME ZONE '2022-12-22 13:45:51.027+00', SYSTEM_COMBINE_CLOB(608), FALSE, FALSE, NULL), +(458, 'Card', 9, 1, TIMESTAMP WITH TIME ZONE '2022-12-22 13:50:18.849+00', SYSTEM_COMBINE_CLOB(609), FALSE, FALSE, NULL), +(459, 'Card', 9, 1, TIMESTAMP WITH TIME ZONE '2022-12-22 13:50:35.114+00', SYSTEM_COMBINE_CLOB(610), FALSE, FALSE, NULL), (462, 'Card', 9, 1, TIMESTAMP WITH TIME ZONE '2022-12-22 13:58:31.47+00', '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":6,"query_type":"native","name":" Completeness Rates by State","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterDate":{"id":"00f44aca-d69e-e96d-fe06-3a75520a7a56","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",571,null],"widget-type":"date/range","default":null},"filterState":{"id":"f884c63f-cae1-253b-a66a-e9d1284f25b2","name":"filterState","display-name":"Filterstate","type":"dimension","dimension":["field",572,null],"widget-type":"string/=","default":null}},"query":"[\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterState }} ]]\n ]\n }}, \n {\n $lookup: {\n from: \"analyticsRegistrations\",\n let: { name: \"$name\", date: \"$date\" },\n as: \"registrations\",\n pipeline: [\n {$group: {\n _id: { \n date: { $dateToString: { format: \"%Y-%m-%d\", date: \"$createdAt\" } }, \n stateName: \"$stateName\"\n },\n total: { $sum: 1 }\n }},\n {$addFields:{stateName: ''$_id.stateName'', date: {$dateToString: { date: { $dateFromString: { dateString: ''$_id.date''}}}}}},\n {\n $match:\n {\n $expr:\n {\n $and:\n [\n { $eq: [ \"$date\", \"$$date\" ] },\n { $eq: [ \"$stateName\", \"$$name\" ] }\n ]\n }\n }\n } \n ] \n }\n },\n\n {$addFields: {\n totalRegistrations: {\n $reduce: {\n input: \"$registrations\",\n initialValue: 0,\n in: { $add: [ \"$$value\", \"$$this.total\" ] }\n } \n \n } \n }},\n{$addFields: {estimate: ''$estimate.estimatedNumberOfBirths''}},\n {\n $group: {\n _id: {name: \"$name\"},\n totalRegistrations: { $sum: ''$totalRegistrations'' },\n estimate: { $sum:''$estimatedNumberOfBirths'' }\n }\n },\n {$addFields: {\n percentage: {\n $cond: {\n if: { $eq: [ \"$totalRegistrations\", 0 ] },\n then: 0,\n else: {\n $cond: {\n if: { $eq: [ \"$estimate\", 0 ] },\n then: 0,\n else: {$divide: [''$totalRegistrations'', ''$estimate'']}\n }\n }\n }\n } \n }}, \n {$project: {\n _id: false,\n State: ''$_id.name'',\n ''Completeness Rate'': {$round: [{$multiply: [''$percentage'', 100] }, 0]}\n }}\n \n]","collection":"analyticsPopulationEstimatesPerDay"},"type":"native"},"id":9,"parameter_mappings":[],"display":"map","entity_id":"9t73rF7ixsw9EVOWpx7ab","collection_preview":true,"visualization_settings":{"map.type":"region","map.region":"910cd1de-9dbd-c36c-96bd-39d55ad9b84f","map.metric":"percentage","map.dimension":"state","table.pivot_column":"_id","table.cell_column":"percentage"},"is_write":false,"parameters":[{"id":"00f44aca-d69e-e96d-fe06-3a75520a7a56","type":"date/range","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"},{"id":"f884c63f-cae1-253b-a66a-e9d1284f25b2","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"Filterstate","slug":"filterState"}],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(610, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":7,"query_type":"native","name":"Completeness Rate","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsPopulationEstimatesPerDay","query":"[\n {\n $addFields: {\n date: { $dateToString: {\n date: {$dateFromParts: {\n year: { $add: [ { $year: \"$date\" }, 1 ] },\n month: { $month: \"$date\" },\n day: { $dayOfMonth: \"$date\" }\n }\n }}}\n }\n },\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterDate }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n ]\n }}, \n {\n $lookup: {\n from: \"analyticsRegistrations\",\n let: { name: \"$name\", date: \"$date\" },\n as: \"registrations\",\n pipeline: [\n {$group: {\n _id: { \n date: { $dateToString: { format: \"%Y-%m-%d\", date: \"$createdAt\" } }, \n stateName: \"$stateName\"\n },\n total: { $sum: 1 }\n }},\n {$addFields:{stateName: ''$_id.stateName'', date: {$dateToString: { date: { $dateFromString: { dateString: ''$_id.date''}}}}}},\n {\n $match:\n {\n $expr:\n {\n $and:\n [\n { $eq: [ \"$date\", \"$$date\" ] },\n { $eq: [ \"$stateName\", \"$$name\" ] }\n ]\n }\n }\n } \n ] \n }\n },\n\n {$addFields: {\n totalRegistrations: {\n $reduce: {\n input: \"$registrations\",\n initialValue: 0,\n in: { $add: [ \"$$value\", \"$$this.total\" ] }\n } \n \n } \n }},\n{$addFields: {estimate: ''$estimate.estimatedNumberOfBirths''}},\n {\n $group: {\n _id: null,\n totalRegistrations: { $sum: ''$totalRegistrations'' },\n estimate: { $sum:''$estimatedNumberOfBirths'' }\n }\n },\n {$addFields: {\n percentage: {\n $cond: {\n if: { $eq: [ \"$totalRegistrations\", 0 ] },\n then: 0,\n else: {\n $cond: {\n if: { $eq: [ \"$estimate\", 0 ] },\n then: 0,\n else: {$divide: [''$totalRegistrations'', ''$estimate'']}\n }\n }\n }\n } \n }}, \n {$project: {_id: false, percentage: ''$percentage''}} \n]","template-tags":{"filterEvent":{"id":"545955ab-f6ec-0de1-3f4e-ce9e50e91e82","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"63587bed-9b53-1d2a-5396-317e766e7de8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterGender":{"id":"92951985-5ced-b397-b9b6-ea5a04ef29d5","name":"filterGender","display-name":"Filtergender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterDate":{"id":"fcf90832-e5e8-d1f2-86bf-4601339adab5","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",571,null],"widget-type":"date/range","default":null}}},"database":2},"id":13,"parameter_mappings":[],"display":"table","entity_id":"RUK20xOu8Io0PvT4a332Q","collection_preview":true,"visualizatio', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(610, 1, 'n_settings":{"table.pivot_column":"percentage","table.cell_column":"foo","gauge.segments":[{"min":0,"max":0.25,"color":"#ED6E6E","label":""},{"min":0.25,"max":0.75,"color":"#F9CF48","label":""},{"min":0.75,"max":1,"color":"#84BB4C","label":""}],"column_settings":{"[\"name\",\"percentage\"]":{"scale":100,"suffix":" %"}}},"is_write":false,"parameters":[{"id":"545955ab-f6ec-0de1-3f4e-ce9e50e91e82","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"63587bed-9b53-1d2a-5396-317e766e7de8","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"92951985-5ced-b397-b9b6-ea5a04ef29d5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Filtergender","slug":"filterGender"},{"id":"fcf90832-e5e8-d1f2-86bf-4601339adab5","type":"date/range","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(611, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":7,"query_type":"native","name":"Completeness Rate","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsPopulationEstimatesPerDay","query":"[\n {\n $addFields: {\n date: { $dateToString: {\n date: {$dateFromParts: {\n year: { $add: [ { $year: \"$date\" }, 1 ] },\n month: { $month: \"$date\" },\n day: { $dayOfMonth: \"$date\" }\n }\n }}}\n }\n },\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterDate }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n ]\n }}, \n {\n $lookup: {\n from: \"analyticsRegistrations\",\n let: { name: \"$name\", date: \"$date\" },\n as: \"registrations\",\n pipeline: [\n {$group: {\n _id: { \n date: { $dateToString: { format: \"%Y-%m-%d\", date: \"$createdAt\" } }, \n stateName: \"$stateName\"\n },\n total: { $sum: 1 }\n }},\n {$addFields:{stateName: ''$_id.stateName'', date: {$dateToString: { date: { $dateFromString: { dateString: ''$_id.date''}}}}}},\n {\n $match:\n {\n $expr:\n {\n $and:\n [\n { $eq: [ \"$date\", \"$$date\" ] },\n { $eq: [ \"$stateName\", \"$$name\" ] }\n ]\n }\n }\n } \n ] \n }\n },\n\n {$addFields: {\n totalRegistrations: {\n $reduce: {\n input: \"$registrations\",\n initialValue: 0,\n in: { $add: [ \"$$value\", \"$$this.total\" ] }\n } \n \n } \n }},\n{$addFields: {estimate: ''$estimate.estimatedNumberOfBirths''}},\n {\n $group: {\n _id: null,\n totalRegistrations: { $sum: ''$totalRegistrations'' },\n estimate: { $sum:''$estimatedNumberOfBirths'' }\n }\n },\n {$addFields: {\n percentage: {\n $cond: {\n if: { $eq: [ \"$totalRegistrations\", 0 ] },\n then: 0,\n else: {\n $cond: {\n if: { $eq: [ \"$estimate\", 0 ] },\n then: 0,\n else: {$divide: [''$totalRegistrations'', ''$estimate'']}\n }\n }\n }\n } \n }}, \n {$project: {_id: false, percentage: ''$percentage''}} \n]","template-tags":{"filterEvent":{"id":"545955ab-f6ec-0de1-3f4e-ce9e50e91e82","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"63587bed-9b53-1d2a-5396-317e766e7de8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterGender":{"id":"92951985-5ced-b397-b9b6-ea5a04ef29d5","name":"filterGender","display-name":"Filtergender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterDate":{"id":"fcf90832-e5e8-d1f2-86bf-4601339adab5","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",571,null],"widget-type":"date/range","default":null}}},"database":2},"id":13,"parameter_mappings":[],"display":"gauge","entity_id":"RUK20xOu8Io0PvT4a332Q","collection_preview":true,"visualizatio', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(611, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":7,"query_type":"native","name":"Completeness Rate","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsPopulationEstimatesPerDay","query":"[\n {\n $addFields: {\n date: { $dateToString: {\n date: {$dateFromParts: {\n year: { $add: [ { $year: \"$date\" }, 1 ] },\n month: { $month: \"$date\" },\n day: { $dayOfMonth: \"$date\" }\n }\n }}}\n }\n },\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterDate }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n ]\n }}, \n {\n $lookup: {\n from: \"analyticsRegistrations\",\n let: { name: \"$name\", date: \"$date\" },\n as: \"registrations\",\n pipeline: [\n {$group: {\n _id: { \n date: { $dateToString: { format: \"%Y-%m-%d\", date: \"$createdAt\" } }, \n stateName: \"$stateName\"\n },\n total: { $sum: 1 }\n }},\n {$addFields:{stateName: ''$_id.stateName'', date: {$dateToString: { date: { $dateFromString: { dateString: ''$_id.date''}}}}}},\n {\n $match:\n {\n $expr:\n {\n $and:\n [\n { $eq: [ \"$date\", \"$$date\" ] },\n { $eq: [ \"$stateName\", \"$$name\" ] }\n ]\n }\n }\n } \n ] \n }\n },\n\n {$addFields: {\n totalRegistrations: {\n $reduce: {\n input: \"$registrations\",\n initialValue: 0,\n in: { $add: [ \"$$value\", \"$$this.total\" ] }\n } \n \n } \n }},\n{$addFields: {estimate: ''$estimate.estimatedNumberOfBirths''}},\n {\n $group: {\n _id: null,\n totalRegistrations: { $sum: ''$totalRegistrations'' },\n estimate: { $sum:''$estimatedNumberOfBirths'' }\n }\n },\n {$addFields: {\n percentage: {\n $cond: {\n if: { $eq: [ \"$totalRegistrations\", 0 ] },\n then: 0,\n else: {\n $cond: {\n if: { $eq: [ \"$estimate\", 0 ] },\n then: 0,\n else: {$divide: [''$totalRegistrations'', ''$estimate'']}\n }\n }\n }\n } \n }}, \n {$project: {_id: false, percentage: ''$percentage''}} \n]","template-tags":{"filterEvent":{"id":"545955ab-f6ec-0de1-3f4e-ce9e50e91e82","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"63587bed-9b53-1d2a-5396-317e766e7de8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterGender":{"id":"92951985-5ced-b397-b9b6-ea5a04ef29d5","name":"filterGender","display-name":"Filtergender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterDate":{"id":"fcf90832-e5e8-d1f2-86bf-4601339adab5","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",571,null],"widget-type":"date/range","default":null}}},"database":2},"id":13,"parameter_mappings":[],"display":"table","entity_id":"RUK20xOu8Io0PvT4a332Q","collection_preview":true,"visualizatio', NULL); INSERT INTO SYSTEM_LOB_STREAM VALUES(611, 1, 'n_settings":{"table.pivot_column":"percentage","table.cell_column":"foo","gauge.segments":[{"min":0,"max":0.25,"color":"#ED6E6E","label":""},{"min":0.25,"max":0.75,"color":"#F9CF48","label":""},{"min":0.75,"max":1,"color":"#84BB4C","label":""}],"column_settings":{"[\"name\",\"percentage\"]":{"scale":100,"suffix":" %"}}},"is_write":false,"parameters":[{"id":"545955ab-f6ec-0de1-3f4e-ce9e50e91e82","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"63587bed-9b53-1d2a-5396-317e766e7de8","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"92951985-5ced-b397-b9b6-ea5a04ef29d5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Filtergender","slug":"filterGender"},{"id":"fcf90832-e5e8-d1f2-86bf-4601339adab5","type":"date/range","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(612, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":7,"query_type":"native","name":"Completeness Rate","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsPopulationEstimatesPerDay","query":"[\n {\n $addFields: {\n date: { $dateFromParts: {\n year: { $add: [ { $year: \"$date\" }, 1 ] },\n month: { $month: \"$date\" },\n day: { $dayOfMonth: \"$date\" }\n }\n }\n }\n },\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterDate }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n ]\n }}, \n {\n $lookup: {\n from: \"analyticsRegistrations\",\n let: { name: \"$name\", date: {$dateToString: {date: \"$date\" }}},\n as: \"registrations\",\n pipeline: [\n {$group: {\n _id: { \n date: { $dateToString: { format: \"%Y-%m-%d\", date: \"$createdAt\" } }, \n stateName: \"$stateName\"\n },\n total: { $sum: 1 }\n }},\n {$addFields:{stateName: ''$_id.stateName'', date: {$dateToString: { date: { $dateFromString: { dateString: ''$_id.date''}}}}}},\n {\n $match:\n {\n $expr:\n {\n $and:\n [\n { $eq: [ \"$date\", \"$$date\" ] },\n { $eq: [ \"$stateName\", \"$$name\" ] }\n ]\n }\n }\n } \n ] \n }\n },\n\n {$addFields: {\n totalRegistrations: {\n $reduce: {\n input: \"$registrations\",\n initialValue: 0,\n in: { $add: [ \"$$value\", \"$$this.total\" ] }\n } \n \n } \n }},\n{$addFields: {estimate: ''$estimate.estimatedNumberOfBirths''}},\n {\n $group: {\n _id: null,\n totalRegistrations: { $sum: ''$totalRegistrations'' },\n estimate: { $sum:''$estimatedNumberOfBirths'' }\n }\n },\n {$addFields: {\n percentage: {\n $cond: {\n if: { $eq: [ \"$totalRegistrations\", 0 ] },\n then: 0,\n else: {\n $cond: {\n if: { $eq: [ \"$estimate\", 0 ] },\n then: 0,\n else: {$divide: [''$totalRegistrations'', ''$estimate'']}\n }\n }\n }\n } \n }}, \n {$project: {_id: false, percentage: ''$percentage''}} \n]","template-tags":{"filterEvent":{"id":"545955ab-f6ec-0de1-3f4e-ce9e50e91e82","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"63587bed-9b53-1d2a-5396-317e766e7de8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterGender":{"id":"92951985-5ced-b397-b9b6-ea5a04ef29d5","name":"filterGender","display-name":"Filtergender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterDate":{"id":"fcf90832-e5e8-d1f2-86bf-4601339adab5","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",571,null],"widget-type":"date/range","default":null}}},"database":2},"id":13,"parameter_mappings":[],"display":"gauge","entity_id":"RUK20xOu8Io0PvT4a332Q","collection_preview":true,"visualization_settings":{"', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(612, 1, 'table.pivot_column":"percentage","table.cell_column":"foo","gauge.segments":[{"min":0,"max":0.25,"color":"#ED6E6E","label":""},{"min":0.25,"max":0.75,"color":"#F9CF48","label":""},{"min":0.75,"max":1,"color":"#84BB4C","label":""}],"column_settings":{"[\"name\",\"percentage\"]":{"scale":100,"suffix":" %"}}},"is_write":false,"parameters":[{"id":"545955ab-f6ec-0de1-3f4e-ce9e50e91e82","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"63587bed-9b53-1d2a-5396-317e766e7de8","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"92951985-5ced-b397-b9b6-ea5a04ef29d5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Filtergender","slug":"filterGender"},{"id":"fcf90832-e5e8-d1f2-86bf-4601339adab5","type":"date/range","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(613, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":7,"query_type":"native","name":"Completeness Rate","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterEvent":{"id":"545955ab-f6ec-0de1-3f4e-ce9e50e91e82","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"63587bed-9b53-1d2a-5396-317e766e7de8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",572,null],"widget-type":"string/=","default":null},"filterGender":{"id":"92951985-5ced-b397-b9b6-ea5a04ef29d5","name":"filterGender","display-name":"Filtergender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterDate":{"id":"fcf90832-e5e8-d1f2-86bf-4601339adab5","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",571,null],"widget-type":"date/range","default":null}},"query":"[\n {\n $addFields: {\n date: { $dateFromParts: {\n year: { $add: [ { $year: \"$date\" }, 1 ] },\n month: { $month: \"$date\" },\n day: { $dayOfMonth: \"$date\" }\n }\n }\n }\n },\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterDate }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n ]\n }}, \n {\n $lookup: {\n from: \"analyticsRegistrations\",\n let: { name: \"$name\", date: {$dateToString: {date: \"$date\" }}},\n as: \"registrations\",\n pipeline: [\n {$group: {\n _id: { \n date: { $dateToString: { format: \"%Y-%m-%d\", date: \"$createdAt\" } }, \n stateName: \"$stateName\"\n },\n total: { $sum: 1 }\n }},\n {$addFields:{stateName: ''$_id.stateName'', date: {$dateToString: { date: { $dateFromString: { dateString: ''$_id.date''}}}}}},\n {\n $match:\n {\n $expr:\n {\n $and:\n [\n { $eq: [ \"$date\", \"$$date\" ] },\n { $eq: [ \"$stateName\", \"$$name\" ] }\n ]\n }\n }\n } \n ] \n }\n },\n\n {$addFields: {\n totalRegistrations: {\n $reduce: {\n input: \"$registrations\",\n initialValue: 0,\n in: { $add: [ \"$$value\", \"$$this.total\" ] }\n } \n \n } \n }},\n{$addFields: {estimate: ''$estimate.estimatedNumberOfBirths''}},\n {\n $group: {\n _id: null,\n totalRegistrations: { $sum: ''$totalRegistrations'' },\n estimate: { $sum:''$estimatedNumberOfBirths'' }\n }\n },\n {$addFields: {\n percentage: {\n $cond: {\n if: { $eq: [ \"$totalRegistrations\", 0 ] },\n then: 0,\n else: {\n $cond: {\n if: { $eq: [ \"$estimate\", 0 ] },\n then: 0,\n else: {$divide: [''$totalRegistrations'', ''$estimate'']}\n }\n }\n }\n } \n }}, \n {$project: {_id: false, percentage: ''$percentage''}} \n]","collection":"analyticsPopulationEstimatesPerDay"},"type":"native"},"id":13,"parameter_mappings":[],"display":"gauge","entity_id":"RUK20xOu8Io0PvT4a332Q","collection_preview":true,"visualization_settings":{"', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(612, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":7,"query_type":"native","name":"Completeness Rate","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsPopulationEstimatesPerDay","query":"[\n {\n $addFields: {\n date: { $dateToString: {\n date: {$dateFromParts: {\n year: { $add: [ { $year: \"$date\" }, 1 ] },\n month: { $month: \"$date\" },\n day: { $dayOfMonth: \"$date\" }\n }\n }}}\n }\n },\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterDate }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n ]\n }}, \n {\n $lookup: {\n from: \"analyticsRegistrations\",\n let: { name: \"$name\", date: \"$date\" },\n as: \"registrations\",\n pipeline: [\n {$group: {\n _id: { \n date: { $dateToString: { format: \"%Y-%m-%d\", date: \"$createdAt\" } }, \n stateName: \"$stateName\"\n },\n total: { $sum: 1 }\n }},\n {$addFields:{stateName: ''$_id.stateName'', date: {$dateToString: { date: { $dateFromString: { dateString: ''$_id.date''}}}}}},\n {\n $match:\n {\n $expr:\n {\n $and:\n [\n { $eq: [ \"$date\", \"$$date\" ] },\n { $eq: [ \"$stateName\", \"$$name\" ] }\n ]\n }\n }\n } \n ] \n }\n },\n\n {$addFields: {\n totalRegistrations: {\n $reduce: {\n input: \"$registrations\",\n initialValue: 0,\n in: { $add: [ \"$$value\", \"$$this.total\" ] }\n } \n \n } \n }},\n{$addFields: {estimate: ''$estimate.estimatedNumberOfBirths''}},\n {\n $group: {\n _id: null,\n totalRegistrations: { $sum: ''$totalRegistrations'' },\n estimate: { $sum:''$estimatedNumberOfBirths'' }\n }\n },\n {$addFields: {\n percentage: {\n $cond: {\n if: { $eq: [ \"$totalRegistrations\", 0 ] },\n then: 0,\n else: {\n $cond: {\n if: { $eq: [ \"$estimate\", 0 ] },\n then: 0,\n else: {$divide: [''$totalRegistrations'', ''$estimate'']}\n }\n }\n }\n } \n }}, \n {$project: {_id: false, percentage: ''$percentage''}} \n]","template-tags":{"filterEvent":{"id":"545955ab-f6ec-0de1-3f4e-ce9e50e91e82","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"63587bed-9b53-1d2a-5396-317e766e7de8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterGender":{"id":"92951985-5ced-b397-b9b6-ea5a04ef29d5","name":"filterGender","display-name":"Filtergender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterDate":{"id":"fcf90832-e5e8-d1f2-86bf-4601339adab5","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",571,null],"widget-type":"date/range","default":null}}},"database":2},"id":13,"parameter_mappings":[],"display":"gauge","entity_id":"RUK20xOu8Io0PvT4a332Q","collection_preview":true,"visualizatio', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(612, 1, 'n_settings":{"table.pivot_column":"percentage","table.cell_column":"foo","gauge.segments":[{"min":0,"max":0.25,"color":"#ED6E6E","label":""},{"min":0.25,"max":0.75,"color":"#F9CF48","label":""},{"min":0.75,"max":1,"color":"#84BB4C","label":""}],"column_settings":{"[\"name\",\"percentage\"]":{"scale":100,"suffix":" %"}}},"is_write":false,"parameters":[{"id":"545955ab-f6ec-0de1-3f4e-ce9e50e91e82","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"63587bed-9b53-1d2a-5396-317e766e7de8","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"92951985-5ced-b397-b9b6-ea5a04ef29d5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Filtergender","slug":"filterGender"},{"id":"fcf90832-e5e8-d1f2-86bf-4601339adab5","type":"date/range","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(613, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":7,"query_type":"native","name":"Completeness Rate","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsPopulationEstimatesPerDay","query":"[\n {\n $addFields: {\n date: { $dateFromParts: {\n year: { $add: [ { $year: \"$date\" }, 1 ] },\n month: { $month: \"$date\" },\n day: { $dayOfMonth: \"$date\" }\n }\n }\n }\n },\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterDate }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n ]\n }}, \n {\n $lookup: {\n from: \"analyticsRegistrations\",\n let: { name: \"$name\", date: {$dateToString: {date: \"$date\" }}},\n as: \"registrations\",\n pipeline: [\n {$group: {\n _id: { \n date: { $dateToString: { format: \"%Y-%m-%d\", date: \"$createdAt\" } }, \n stateName: \"$stateName\"\n },\n total: { $sum: 1 }\n }},\n {$addFields:{stateName: ''$_id.stateName'', date: {$dateToString: { date: { $dateFromString: { dateString: ''$_id.date''}}}}}},\n {\n $match:\n {\n $expr:\n {\n $and:\n [\n { $eq: [ \"$date\", \"$$date\" ] },\n { $eq: [ \"$stateName\", \"$$name\" ] }\n ]\n }\n }\n } \n ] \n }\n },\n\n {$addFields: {\n totalRegistrations: {\n $reduce: {\n input: \"$registrations\",\n initialValue: 0,\n in: { $add: [ \"$$value\", \"$$this.total\" ] }\n } \n \n } \n }},\n{$addFields: {estimate: ''$estimate.estimatedNumberOfBirths''}},\n {\n $group: {\n _id: null,\n totalRegistrations: { $sum: ''$totalRegistrations'' },\n estimate: { $sum:''$estimatedNumberOfBirths'' }\n }\n },\n {$addFields: {\n percentage: {\n $cond: {\n if: { $eq: [ \"$totalRegistrations\", 0 ] },\n then: 0,\n else: {\n $cond: {\n if: { $eq: [ \"$estimate\", 0 ] },\n then: 0,\n else: {$divide: [''$totalRegistrations'', ''$estimate'']}\n }\n }\n }\n } \n }}, \n {$project: {_id: false, percentage: ''$percentage''}} \n]","template-tags":{"filterEvent":{"id":"545955ab-f6ec-0de1-3f4e-ce9e50e91e82","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"63587bed-9b53-1d2a-5396-317e766e7de8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterGender":{"id":"92951985-5ced-b397-b9b6-ea5a04ef29d5","name":"filterGender","display-name":"Filtergender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterDate":{"id":"fcf90832-e5e8-d1f2-86bf-4601339adab5","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",571,null],"widget-type":"date/range","default":null}}},"database":2},"id":13,"parameter_mappings":[],"display":"gauge","entity_id":"RUK20xOu8Io0PvT4a332Q","collection_preview":true,"visualization_settings":{"', NULL); INSERT INTO SYSTEM_LOB_STREAM VALUES(613, 1, 'table.pivot_column":"percentage","table.cell_column":"foo","gauge.segments":[{"min":0,"max":0.25,"color":"#ED6E6E","label":""},{"min":0.25,"max":0.75,"color":"#F9CF48","label":""},{"min":0.75,"max":1,"color":"#84BB4C","label":""}],"column_settings":{"[\"name\",\"percentage\"]":{"scale":100,"suffix":" %"}}},"is_write":false,"parameters":[{"id":"545955ab-f6ec-0de1-3f4e-ce9e50e91e82","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"63587bed-9b53-1d2a-5396-317e766e7de8","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"92951985-5ced-b397-b9b6-ea5a04ef29d5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Filtergender","slug":"filterGender"},{"id":"fcf90832-e5e8-d1f2-86bf-4601339adab5","type":"date/range","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(614, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":7,"query_type":"native","name":"Completeness Rate","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterEvent":{"id":"545955ab-f6ec-0de1-3f4e-ce9e50e91e82","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"63587bed-9b53-1d2a-5396-317e766e7de8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",572,null],"widget-type":"string/=","default":null},"filterGender":{"id":"92951985-5ced-b397-b9b6-ea5a04ef29d5","name":"filterGender","display-name":"Filtergender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterDate":{"id":"fcf90832-e5e8-d1f2-86bf-4601339adab5","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",571,null],"widget-type":"date/range","default":null}},"query":"[\n {\n $addFields: {\n date: { $dateFromParts: {\n year: { $add: [ { $year: \"$date\" }, 1 ] },\n month: { $month: \"$date\" },\n day: { $dayOfMonth: \"$date\" }\n }\n }\n }\n },\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterDate }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n ]\n }}, \n {\n $lookup: {\n from: \"analyticsRegistrations\",\n let: { name: \"$name\", date: {$dateToString: {date: \"$date\" }}},\n as: \"registrations\",\n pipeline: [\n {$group: {\n _id: { \n date: { $dateToString: { format: \"%Y-%m-%d\", date: \"$createdAt\" } }, \n stateName: \"$stateName\"\n },\n total: { $sum: 1 }\n }},\n {$addFields:{stateName: ''$_id.stateName'', date: {$dateToString: { date: { $dateFromString: { dateString: ''$_id.date''}}}}}},\n {\n $match:\n {\n $expr:\n {\n $and:\n [\n { $eq: [ \"$date\", \"$$date\" ] },\n { $eq: [ \"$stateName\", \"$$name\" ] }\n ]\n }\n }\n } \n ] \n }\n },\n\n {$addFields: {\n totalRegistrations: {\n $reduce: {\n input: \"$registrations\",\n initialValue: 0,\n in: { $add: [ \"$$value\", \"$$this.total\" ] }\n } \n \n } \n }},\n{$addFields: {estimate: ''$estimate.estimatedNumberOfBirths''}},\n {\n $group: {\n _id: null,\n totalRegistrations: { $sum: ''$totalRegistrations'' },\n estimate: { $sum:''$estimatedNumberOfBirths'' }\n }\n },\n {$addFields: {\n percentage: {\n $cond: {\n if: { $eq: [ \"$totalRegistrations\", 0 ] },\n then: 0,\n else: {\n $cond: {\n if: { $eq: [ \"$estimate\", 0 ] },\n then: 0,\n else: {$divide: [''$totalRegistrations'', ''$estimate'']}\n }\n }\n }\n } \n }}, \n {$project: {_id: false, percentage: ''$percentage''}} \n]","collection":"analyticsPopulationEstimatesPerDay"},"type":"native"},"id":13,"parameter_mappings":[],"display":"scalar","entity_id":"RUK20xOu8Io0PvT4a332Q","collection_preview":true,"visualization_settings":{', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(614, 1, '"table.pivot_column":"percentage","table.cell_column":"foo","gauge.segments":[{"min":0,"max":0.25,"color":"#ED6E6E","label":""},{"min":0.25,"max":0.75,"color":"#F9CF48","label":""},{"min":0.75,"max":1,"color":"#84BB4C","label":""}],"column_settings":{"[\"name\",\"percentage\"]":{"scale":100,"suffix":" %"}}},"is_write":false,"parameters":[{"id":"545955ab-f6ec-0de1-3f4e-ce9e50e91e82","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"63587bed-9b53-1d2a-5396-317e766e7de8","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"92951985-5ced-b397-b9b6-ea5a04ef29d5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Filtergender","slug":"filterGender"},{"id":"fcf90832-e5e8-d1f2-86bf-4601339adab5","type":"date/range","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(615, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":7,"query_type":"native","name":"Completeness Rate","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterEvent":{"id":"545955ab-f6ec-0de1-3f4e-ce9e50e91e82","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"63587bed-9b53-1d2a-5396-317e766e7de8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",572,null],"widget-type":"string/=","default":null},"filterGender":{"id":"92951985-5ced-b397-b9b6-ea5a04ef29d5","name":"filterGender","display-name":"Filtergender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterDate":{"id":"fcf90832-e5e8-d1f2-86bf-4601339adab5","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",571,null],"widget-type":"date/range","default":null}},"query":"[\n {\n $addFields: {\n date: { $dateFromParts: {\n year: { $add: [ { $year: \"$date\" }, 1 ] },\n month: { $month: \"$date\" },\n day: { $dayOfMonth: \"$date\" }\n }\n }\n }\n },\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterDate }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n ]\n }}, \n {\n $lookup: {\n from: \"analyticsRegistrations\",\n let: { name: \"$name\", date: {$dateToString: {date: \"$date\" }}},\n as: \"registrations\",\n pipeline: [\n {$group: {\n _id: { \n date: { $dateToString: { format: \"%Y-%m-%d\", date: \"$createdAt\" } }, \n stateName: \"$stateName\"\n },\n total: { $sum: 1 }\n }},\n {$addFields:{stateName: ''$_id.stateName'', date: {$dateToString: { date: { $dateFromString: { dateString: ''$_id.date''}}}}}},\n {\n $match:\n {\n $expr:\n {\n $and:\n [\n { $eq: [ \"$date\", \"$$date\" ] },\n { $eq: [ \"$stateName\", \"$$name\" ] }\n ]\n }\n }\n } \n ] \n }\n },\n\n {$addFields: {\n totalRegistrations: {\n $reduce: {\n input: \"$registrations\",\n initialValue: 0,\n in: { $add: [ \"$$value\", \"$$this.total\" ] }\n } \n \n } \n }},\n{$addFields: {estimate: ''$estimate.estimatedNumberOfBirths''}},\n {\n $group: {\n _id: null,\n totalRegistrations: { $sum: ''$totalRegistrations'' },\n estimate: { $sum:''$estimatedNumberOfBirths'' }\n }\n },\n {$addFields: {\n percentage: {\n $cond: {\n if: { $eq: [ \"$totalRegistrations\", 0 ] },\n then: 0,\n else: {\n $cond: {\n if: { $eq: [ \"$estimate\", 0 ] },\n then: 0,\n else: {$divide: [''$totalRegistrations'', ''$estimate'']}\n }\n }\n }\n } \n }}, \n {$project: {_id: false, percentage: ''$percentage''}} \n]","collection":"analyticsPopulationEstimatesPerDay"},"type":"native"},"id":13,"parameter_mappings":[],"display":"gauge","entity_id":"RUK20xOu8Io0PvT4a332Q","collection_preview":true,"visualization_settings":{"', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(615, 1, 'table.pivot_column":"percentage","table.cell_column":"foo","gauge.segments":[{"min":0,"max":0.25,"color":"#ED6E6E","label":""},{"min":0.25,"max":0.75,"color":"#F9CF48","label":""},{"min":0.75,"max":1,"color":"#84BB4C","label":""}],"column_settings":{"[\"name\",\"percentage\"]":{"scale":100,"suffix":" %"}}},"is_write":false,"parameters":[{"id":"545955ab-f6ec-0de1-3f4e-ce9e50e91e82","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"63587bed-9b53-1d2a-5396-317e766e7de8","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"92951985-5ced-b397-b9b6-ea5a04ef29d5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Filtergender","slug":"filterGender"},{"id":"fcf90832-e5e8-d1f2-86bf-4601339adab5","type":"date/range","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(616, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":6,"query_type":"native","name":" Completeness Rates by State","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterDate":{"id":"00f44aca-d69e-e96d-fe06-3a75520a7a56","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",571,null],"widget-type":"date/range","default":null},"filterState":{"id":"f884c63f-cae1-253b-a66a-e9d1284f25b2","name":"filterState","display-name":"Filterstate","type":"dimension","dimension":["field",572,null],"widget-type":"string/=","default":null}},"query":"[\n {\n $addFields: {\n date: { $dateFromParts: {\n year: { $add: [ { $year: \"$date\" }, 1 ] },\n month: { $month: \"$date\" },\n day: { $dayOfMonth: \"$date\" }\n }\n }\n }\n }, \n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterState }} ]]\n ]\n }}, \n {\n $lookup: {\n from: \"analyticsRegistrations\",\n let: { name: \"$name\", date: \"$date\" },\n as: \"registrations\",\n pipeline: [\n {$group: {\n _id: { \n date: { $dateToString: { format: \"%Y-%m-%d\", date: \"$createdAt\" } }, \n stateName: \"$stateName\"\n },\n total: { $sum: 1 }\n }},\n \n {\n $match:\n {\n $expr:\n {\n $and:\n [\n { $eq: [ \"$_id.date\", { $dateToString: { format: \"%Y-%m-%d\", date: \"$$date\" }} ] },\n { $eq: [ \"$_id.stateName\", \"$$name\" ] }\n ]\n }\n }\n } \n ] \n }\n },\n\n {$addFields: {\n totalRegistrations: {\n $reduce: {\n input: \"$registrations\",\n initialValue: 0,\n in: { $add: [ \"$$value\", \"$$this.total\" ] }\n } \n \n } \n }},\n{$addFields: {estimate: ''$estimate.estimatedNumberOfBirths''}},\n {\n $group: {\n _id: {name: \"$name\"},\n totalRegistrations: { $sum: ''$totalRegistrations'' },\n estimate: { $sum:''$estimatedNumberOfBirths'' }\n }\n },\n {$addFields: {\n percentage: {\n $cond: {\n if: { $eq: [ \"$totalRegistrations\", 0 ] },\n then: 0,\n else: {\n $cond: {\n if: { $eq: [ \"$estimate\", 0 ] },\n then: 0,\n else: {$divide: [''$totalRegistrations'', ''$estimate'']}\n }\n }\n }\n } \n }}, \n {$project: {\n _id: false,\n State: ''$_id.name'',\n ''Completeness Rate'': {$round: [{$multiply: [''$percentage'', 100] }, 0]}\n }}\n \n]","collection":"analyticsPopulationEstimatesPerDay"},"type":"native"},"id":9,"parameter_mappings":[],"display":"map","entity_id":"9t73rF7ixsw9EVOWpx7ab","collection_preview":true,"visualization_settings":{"map.type":"region","map.region":"910cd1de-9dbd-c36c-96bd-39d55ad9b84f","map.metric":"percentage","map.dimension":"state","table.pivot_column":"_id","table.cell_column":"percentage"},"is_write":false,"parameters":[{"id":"00f44aca-d69e-e96d-fe06-3a75520a7a56","type":"date/range","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"},{"id":"f884c63f-cae1', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(616, 1, '-253b-a66a-e9d1284f25b2","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"Filterstate","slug":"filterState"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(617, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":11,"query_type":"native","name":"Live births by Order","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , birthOrder: ''$birthOrder''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$eq: [''$birthOrder'', 1]}] }, then: ''1''},\n {case: {$and: [{$eq: [''$birthOrder'', 2]}] }, then: ''2''},\n {case: {$and: [{$eq: [''$birthOrder'', 3]}] }, then: ''3''},\n {case: {$and: [{$eq: [''$birthOrder'', 4]}] }, then: ''4''},\n {case: {$and: [{$eq: [''$birthOrder'', 5]}] }, then: ''5''},\n {case: {$and: [{$gte: [''$birthOrder'', 6]}] }, then: ''6+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Order\": 1\n }\n }\n]","template-tags":{"filterGender":{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",339,null],"widget-type":"string/=","default":null},"filterDate":{"id":"996f1d61-a845-0afe-bb4c-f36ac4ab32be","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}}},"database":2},"id":19,"parameter_mappings":[],"display":"bar","entity_id":"L6nXdi04nvxgEh1eJYrwR","collection_preview":true,"visualization_settings":{"graph.show_values":true,"pie.dimension":"birthOrder","graph.', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(617, 1, 'series_order_dimension":null,"graph.x_axis.title_text":"Birth Order","graph.metrics":["Count"],"graph.series_order":null,"pie.metric":"count","series_settings":{"Count":{"color":"#7172AD"}},"graph.dimensions":["Order"]},"is_write":false,"parameters":[{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"996f1d61-a845-0afe-bb4c-f36ac4ab32be","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(618, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":12,"query_type":"native","name":"Live births by age of Mother","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , mothersAge: ''$mothersAgeAtBirthOfChildInYears''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$gte: [''$mothersAge'', 9]}, {$lt: [''$mothersAge'', 15]}] }, then: ''9-14''},\n {case: {$and: [{$gte: [''$mothersAge'', 15]}, {$lt: [''$mothersAge'', 20]}] }, then: ''15-19''},\n {case: {$and: [{$gte: [''$mothersAge'', 20]}, {$lt: [''$mothersAge'', 25]}] }, then: ''20-24''},\n {case: {$and: [{$gte: [''$mothersAge'', 25]}, {$lt: [''$mothersAge'', 30]}] }, then: ''25-29''},\n {case: {$and: [{$gte: [''$mothersAge'', 30]}, {$lt: [''$mothersAge'', 35]}] }, then: ''30-34''},\n {case: {$and: [{$gte: [''$mothersAge'', 35]}, {$lt: [''$mothersAge'', 40]}] }, then: ''35-39''},\n {case: {$and: [{$gte: [''$mothersAge'', 40]}, {$lt: [''$mothersAge'', 45]}] }, then: ''40-44''},\n {case: {$and: [{$gte: [''$mothersAge'', 45]}, {$lt: [''$mothersAge'', 50]}] }, then: ''45-49''},\n {case: {$and: [{$gte: [''$mothersAge'', 50]}, {$lt: [''$mothersAge'', 55]}] }, then: ''50-54''},\n {case: {$and: [{$gte: [''$mothersAge'', 55]}, {$lt: [''$mothersAge'', 60]}] }, then: ''55-59''},\n {case: {$and: [{$gte: [''$mothersAge'', 60]}] }, then: ''60+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Count\": -1\n }\n }\n]","template-tags":{"filterGender":{"id":"56559614-c685-9d81-d44b-a688fe5b103b","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11",', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(618, 1, '"name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"8b07b619-ea79-a772-e83a-92f986ab040c","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",339,null],"widget-type":"string/=","default":null},"filterDate":{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}}},"database":2},"id":20,"parameter_mappings":[],"display":"bar","entity_id":"PcnknQN2IYs_mJkwA8yRq","collection_preview":true,"visualization_settings":{"table.pivot_column":"Order","table.cell_column":"Count","graph.dimensions":["Order"],"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"56559614-c685-9d81-d44b-a688fe5b103b","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"8b07b619-ea79-a772-e83a-92f986ab040c","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(619, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":14,"query_type":"native","name":"Live Births by Level of Education of Parent","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n fathersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersAttainment\": \"$fathersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"KORANIC\"] },\n then: \"Koranic\"\n },\n {\n case: { $eq: [\"$_id\", \"MODERN\"] },\n then: \"Modern\"\n },\n {\n case: { $eq: [\"$_id\", \"HIGHER_SCHOOL\"] },\n then: \"Higher School\"\n },\n {\n case: { $eq: [\"$_id\", \"PRIMARY\"] },\n then: \"Primary\"\n },\n {\n case: { $eq: [\"$_id\", \"UNIVERSITY\"] },\n then: \"University\"\n },\n {\n case: { $eq: [\"$_id\", \"POLYTECNIC_NCE\"] },\n then: \"Polytecnic NCE\"\n },\n {\n case: { $eq: [\"$_id\", \"SECONDARY\"] },\n then: \"Secondary\"\n }\n ],\n default: \"Others\"\n }\n }\n , count: \"$count\"\n }},\n {$addFields: {\n attainment: \"fathersAttainment\"\n }}\n ]\n , mothersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersAttainment\": \"$mothersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"KORANIC\"] },\n then: \"Koranic\"\n },\n {\n case: { $eq: [\"$_id\", \"MODERN\"] },\n then: \"Modern\"\n },\n {\n case: { $eq: [\"$_id\", \"HIGHER_SCHOOL\"] },\n then: \"Higher School\"\n },\n {\n case: { $eq: [\"$_id\", \"PRIMARY\"] },\n then: \"Primary\"\n },\n {\n case: { $eq: [\"$_id\", \"UNIVERSITY\"] },\n then: \"University\"\n },\n {\n case: { $eq: [\"$_id\", \"POLYTECNIC_NCE\"] },\n then: \"Polytecnic NCE\"\n },\n {\n case: { $eq: [\"$_id\", \"SECONDARY\"] },\n ', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(619, 1, ' then: \"Secondary\"\n }\n ],\n default: \"Others\"\n }\n }\n , count: \"$count\"\n }},\n {$addFields: {\n attainment: \"mothersAttainment\"\n }}\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersAttainment\", \"$mothersAttainment\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Educational Attainment'': \"$allInfo._id\"\n , ''Attainment'': \"$allInfo.attainment\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Attainment\": 1\n }\n }\n]\n","template-tags":{"filterGender":{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",339,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}}},"database":2},"id":21,"parameter_mappings":[],"display":"bar","entity_id":"W6bdia0Vw-6PC1efnHIR4","collection_preview":true,"visualization_settings":{"graph.show_values":true,"pie.dimension":"Educational Attainment","graph.x_axis.axis_enabled":true,"graph.y_axis.auto_split":true,"graph.metrics":["Count"],"pie.metric":"Count","series_settings":{"mothersAttainment":{"title":"mother"},"fathersAttainment":{"title":"father"}},"graph.y_axis.auto_range":true,"graph.dimensions":["Educational Attainment","Attainment"]},"is_write":false,"parameters":[{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(620, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":10,"query_type":"native","name":"Literacy of parents","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n fathersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersLiteracy\": \"$fathersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"fathersLiteracy\"\n }}\n ]\n , mothersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersLiteracy\": \"$mothersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id.mothersLiteracy\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id.mothersLiteracy\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , \"count\": \"$qty\"\n }},\n {$addFields: {\n literacy: \"mothersLiteracy\"\n }}\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersLiteracy\", \"$mothersLiteracy\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Category'': \"$allInfo._id\"\n , ''Literacy'': \"$allInfo.literacy\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Literacy\": 1\n }\n }\n]\n","template-tags":{"filterGender":{"id":"e8218caf-e2aa-573e-1776-02cffff42462","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"bf69e085-3c01-7924-5108-7151c85dc371","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",339,null],"widget-type":"string/=","default":null},"filterDate":{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","name":"filterDate","display-name":"Date","type":"dimension","dimension":["fiel', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(620, 1, 'd",354,null],"widget-type":"date/month-year","default":null}}},"database":2},"id":18,"parameter_mappings":[],"display":"bar","entity_id":"eRSJUaHW6haiucK8BtpC_","collection_preview":true,"visualization_settings":{"graph.show_values":true,"graph.label_value_formatting":"auto","graph.dimensions":["Category","Literacy"],"series_settings":{"mothersLiteracy":{"title":"mother"},"fathersLiteracy":{"title":"father"}},"graph.x_axis.title_text":"Literacy","graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"e8218caf-e2aa-573e-1776-02cffff42462","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"bf69e085-3c01-7924-5108-7151c85dc371","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(621, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":11,"query_type":"native","name":"Live births by Order","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterGender":{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",339,null],"widget-type":"string/=","default":null},"filterDate":{"id":"996f1d61-a845-0afe-bb4c-f36ac4ab32be","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , birthOrder: ''$birthOrder''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$eq: [''$birthOrder'', 1]}] }, then: ''1''},\n {case: {$and: [{$eq: [''$birthOrder'', 2]}] }, then: ''2''},\n {case: {$and: [{$eq: [''$birthOrder'', 3]}] }, then: ''3''},\n {case: {$and: [{$eq: [''$birthOrder'', 4]}] }, then: ''4''},\n {case: {$and: [{$eq: [''$birthOrder'', 5]}] }, then: ''5''},\n {case: {$and: [{$gte: [''$birthOrder'', 6]}] }, then: ''6+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Order\": 1\n }\n }\n]","collection":"analyticsRegistrations"},"type":"native"},"id":19,"parameter_mappings":[],"display":"bar","entity_id":"L6nXdi04nvxgEh1eJYrwR","collection_preview":true,"visualization_settings":{"graph.show_values":true,"pie.dimension":"birthOrder","graph.', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(621, 1, 'series_order_dimension":null,"graph.x_axis.title_text":"Birth Order","graph.metrics":["Count"],"graph.series_order":null,"pie.metric":"count","series_settings":{"Count":{"color":"#7172AD"}},"graph.dimensions":["Order"]},"is_write":false,"parameters":[{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"996f1d61-a845-0afe-bb4c-f36ac4ab32be","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(622, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":7,"query_type":"native","name":"Completeness Rate","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {\n $addFields: {\n date: { $dateFromParts: {\n year: { $add: [ { $year: \"$date\" }, 1 ] },\n month: { $month: \"$date\" },\n day: { $dayOfMonth: \"$date\" }\n }\n }\n }\n },\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterDate }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n ]\n }}, \n {\n $lookup: {\n from: \"analyticsRegistrations\",\n let: { name: \"$name\", date: {$dateToString: {date: \"$date\" }}},\n as: \"registrations\",\n pipeline: [\n {$group: {\n _id: { \n date: { $dateToString: { format: \"%Y-%m-%d\", date: \"$createdAt\" } }, \n stateName: \"$stateName\"\n },\n total: { $sum: 1 }\n }},\n {$addFields:{stateName: ''$_id.stateName'', date: {$dateToString: { date: { $dateFromString: { dateString: ''$_id.date''}}}}}},\n {\n $match:\n {\n $expr:\n {\n $and:\n [\n { $eq: [ \"$date\", \"$$date\" ] },\n { $eq: [ \"$stateName\", \"$$name\" ] }\n ]\n }\n }\n } \n ] \n }\n },\n\n {$addFields: {\n totalRegistrations: {\n $reduce: {\n input: \"$registrations\",\n initialValue: 0,\n in: { $add: [ \"$$value\", \"$$this.total\" ] }\n } \n \n } \n }},\n{$addFields: {estimate: ''$estimate.estimatedNumberOfBirths''}},\n {\n $group: {\n _id: null,\n totalRegistrations: { $sum: ''$totalRegistrations'' },\n estimate: { $sum:''$estimatedNumberOfBirths'' }\n }\n },\n {$addFields: {\n percentage: {\n $cond: {\n if: { $eq: [ \"$totalRegistrations\", 0 ] },\n then: 0,\n else: {\n $cond: {\n if: { $eq: [ \"$estimate\", 0 ] },\n then: 0,\n else: {$divide: [''$totalRegistrations'', ''$estimate'']}\n }\n }\n }\n } \n }}, \n {$project: {_id: false, percentage: ''$percentage''}} \n]","template-tags":{"filterEvent":{"id":"545955ab-f6ec-0de1-3f4e-ce9e50e91e82","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"63587bed-9b53-1d2a-5396-317e766e7de8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",659,null],"widget-type":"string/=","default":null},"filterGender":{"id":"92951985-5ced-b397-b9b6-ea5a04ef29d5","name":"filterGender","display-name":"Filtergender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterDate":{"id":"fcf90832-e5e8-d1f2-86bf-4601339adab5","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",658,null],"widget-type":"date/month-year","default":null}}},"type":"native"},"id":13,"parameter_mappings":[],"display":"gauge","entity_id":"RUK20xOu8Io0PvT4a332Q","collection_preview":true,"visualization_settings":{"table.pivot_colu', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(622, 1, 'mn":"percentage","table.cell_column":"foo","gauge.segments":[{"min":0,"max":0.25,"color":"#ED6E6E","label":""},{"min":0.25,"max":0.75,"color":"#F9CF48","label":""},{"min":0.75,"max":1,"color":"#84BB4C","label":""}],"column_settings":{"[\"name\",\"percentage\"]":{"scale":100,"suffix":" %"}}},"is_write":false,"parameters":[{"id":"545955ab-f6ec-0de1-3f4e-ce9e50e91e82","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"63587bed-9b53-1d2a-5396-317e766e7de8","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"92951985-5ced-b397-b9b6-ea5a04ef29d5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Filtergender","slug":"filterGender"},{"id":"fcf90832-e5e8-d1f2-86bf-4601339adab5","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(623, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":10,"query_type":"native","name":"Literacy of parents","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {$facet: {\n fathersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersLiteracy\": \"$fathersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"fathersLiteracy\"\n }}\n ]\n , mothersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersLiteracy\": \"$mothersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id.mothersLiteracy\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id.mothersLiteracy\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , \"count\": \"$qty\"\n }},\n {$addFields: {\n literacy: \"mothersLiteracy\"\n }}\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersLiteracy\", \"$mothersLiteracy\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Category'': \"$allInfo._id\"\n , ''Literacy'': \"$allInfo.literacy\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Literacy\": 1\n }\n }\n]\n","template-tags":{"filterGender":{"id":"e8218caf-e2aa-573e-1776-02cffff42462","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"bf69e085-3c01-7924-5108-7151c85dc371","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null]', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(623, 1, ',"widget-type":"date/month-year","default":null}}},"type":"native"},"id":18,"parameter_mappings":[],"display":"bar","entity_id":"eRSJUaHW6haiucK8BtpC_","collection_preview":true,"visualization_settings":{"graph.show_values":true,"graph.label_value_formatting":"auto","graph.dimensions":["Category","Literacy"],"series_settings":{"mothersLiteracy":{"title":"mother"},"fathersLiteracy":{"title":"father"}},"graph.x_axis.title_text":"Literacy","graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"e8218caf-e2aa-573e-1776-02cffff42462","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"bf69e085-3c01-7924-5108-7151c85dc371","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(624, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":12,"query_type":"native","name":"Live births by age of Mother","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , mothersAge: ''$mothersAgeAtBirthOfChildInYears''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$gte: [''$mothersAge'', 9]}, {$lt: [''$mothersAge'', 15]}] }, then: ''9-14''},\n {case: {$and: [{$gte: [''$mothersAge'', 15]}, {$lt: [''$mothersAge'', 20]}] }, then: ''15-19''},\n {case: {$and: [{$gte: [''$mothersAge'', 20]}, {$lt: [''$mothersAge'', 25]}] }, then: ''20-24''},\n {case: {$and: [{$gte: [''$mothersAge'', 25]}, {$lt: [''$mothersAge'', 30]}] }, then: ''25-29''},\n {case: {$and: [{$gte: [''$mothersAge'', 30]}, {$lt: [''$mothersAge'', 35]}] }, then: ''30-34''},\n {case: {$and: [{$gte: [''$mothersAge'', 35]}, {$lt: [''$mothersAge'', 40]}] }, then: ''35-39''},\n {case: {$and: [{$gte: [''$mothersAge'', 40]}, {$lt: [''$mothersAge'', 45]}] }, then: ''40-44''},\n {case: {$and: [{$gte: [''$mothersAge'', 45]}, {$lt: [''$mothersAge'', 50]}] }, then: ''45-49''},\n {case: {$and: [{$gte: [''$mothersAge'', 50]}, {$lt: [''$mothersAge'', 55]}] }, then: ''50-54''},\n {case: {$and: [{$gte: [''$mothersAge'', 55]}, {$lt: [''$mothersAge'', 60]}] }, then: ''55-59''},\n {case: {$and: [{$gte: [''$mothersAge'', 60]}] }, then: ''60+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Count\": -1\n }\n }\n]","template-tags":{"filterGender":{"id":"56559614-c685-9d81-d44b-a688fe5b103b","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","name":"filt', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(624, 1, 'erState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"8b07b619-ea79-a772-e83a-92f986ab040c","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null}}},"type":"native"},"id":20,"parameter_mappings":[],"display":"bar","entity_id":"PcnknQN2IYs_mJkwA8yRq","collection_preview":true,"visualization_settings":{"table.pivot_column":"Order","table.cell_column":"Count","graph.dimensions":["Order"],"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"56559614-c685-9d81-d44b-a688fe5b103b","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"8b07b619-ea79-a772-e83a-92f986ab040c","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(625, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":14,"query_type":"native","name":"Live Births by Level of Education of Parent","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {$facet: {\n fathersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersAttainment\": \"$fathersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"KORANIC\"] },\n then: \"Koranic\"\n },\n {\n case: { $eq: [\"$_id\", \"MODERN\"] },\n then: \"Modern\"\n },\n {\n case: { $eq: [\"$_id\", \"HIGHER_SCHOOL\"] },\n then: \"Higher School\"\n },\n {\n case: { $eq: [\"$_id\", \"PRIMARY\"] },\n then: \"Primary\"\n },\n {\n case: { $eq: [\"$_id\", \"UNIVERSITY\"] },\n then: \"University\"\n },\n {\n case: { $eq: [\"$_id\", \"POLYTECNIC_NCE\"] },\n then: \"Polytecnic NCE\"\n },\n {\n case: { $eq: [\"$_id\", \"SECONDARY\"] },\n then: \"Secondary\"\n }\n ],\n default: \"Others\"\n }\n }\n , count: \"$count\"\n }},\n {$addFields: {\n attainment: \"fathersAttainment\"\n }}\n ]\n , mothersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersAttainment\": \"$mothersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"KORANIC\"] },\n then: \"Koranic\"\n },\n {\n case: { $eq: [\"$_id\", \"MODERN\"] },\n then: \"Modern\"\n },\n {\n case: { $eq: [\"$_id\", \"HIGHER_SCHOOL\"] },\n then: \"Higher School\"\n },\n {\n case: { $eq: [\"$_id\", \"PRIMARY\"] },\n then: \"Primary\"\n },\n {\n case: { $eq: [\"$_id\", \"UNIVERSITY\"] },\n then: \"University\"\n },\n {\n case: { $eq: [\"$_id\", \"POLYTECNIC_NCE\"] },\n then: \"Polytecnic NCE\"\n },\n {\n case: { $eq: [\"$_id\", \"SECONDARY\"] },\n ', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(625, 1, ' then: \"Secondary\"\n }\n ],\n default: \"Others\"\n }\n }\n , count: \"$count\"\n }},\n {$addFields: {\n attainment: \"mothersAttainment\"\n }}\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersAttainment\", \"$mothersAttainment\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Educational Attainment'': \"$allInfo._id\"\n , ''Attainment'': \"$allInfo.attainment\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Attainment\": 1\n }\n }\n]\n","template-tags":{"filterGender":{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null}}},"type":"native"},"id":21,"parameter_mappings":[],"display":"bar","entity_id":"W6bdia0Vw-6PC1efnHIR4","collection_preview":true,"visualization_settings":{"graph.show_values":true,"pie.dimension":"Educational Attainment","graph.x_axis.axis_enabled":true,"graph.y_axis.auto_split":true,"graph.metrics":["Count"],"pie.metric":"Count","series_settings":{"mothersAttainment":{"title":"mother"},"fathersAttainment":{"title":"father"}},"graph.y_axis.auto_range":true,"graph.dimensions":["Educational Attainment","Attainment"]},"is_write":false,"parameters":[{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(626, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":11,"query_type":"native","name":"Live births by Order","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , birthOrder: ''$birthOrder''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$eq: [''$birthOrder'', 1]}] }, then: ''1''},\n {case: {$and: [{$eq: [''$birthOrder'', 2]}] }, then: ''2''},\n {case: {$and: [{$eq: [''$birthOrder'', 3]}] }, then: ''3''},\n {case: {$and: [{$eq: [''$birthOrder'', 4]}] }, then: ''4''},\n {case: {$and: [{$eq: [''$birthOrder'', 5]}] }, then: ''5''},\n {case: {$and: [{$gte: [''$birthOrder'', 6]}] }, then: ''6+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Order\": 1\n }\n }\n]","template-tags":{"filterGender":{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"996f1d61-a845-0afe-bb4c-f36ac4ab32be","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null}}},"type":"native"},"id":19,"parameter_mappings":[],"display":"bar","entity_id":"L6nXdi04nvxgEh1eJYrwR","collection_preview":true,"visualization_settings":{"graph.show_values":true,"pie.dimension":"birthOrder","graph.series_or', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(626, 1, 'der_dimension":null,"graph.x_axis.title_text":"Birth Order","graph.metrics":["Count"],"graph.series_order":null,"pie.metric":"count","series_settings":{"Count":{"color":"#7172AD"}},"graph.dimensions":["Order"]},"is_write":false,"parameters":[{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"996f1d61-a845-0afe-bb4c-f36ac4ab32be","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(627, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":6,"query_type":"native","name":" Completeness Rates by State","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterDate":{"id":"00f44aca-d69e-e96d-fe06-3a75520a7a56","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",658,null],"widget-type":"date/month-year","default":null},"filterState":{"id":"f884c63f-cae1-253b-a66a-e9d1284f25b2","name":"filterState","display-name":"Filterstate","type":"dimension","dimension":["field",659,null],"widget-type":"string/=","default":null}},"query":"[\n {\n $addFields: {\n date: { $dateFromParts: {\n year: { $add: [ { $year: \"$date\" }, 1 ] },\n month: { $month: \"$date\" },\n day: { $dayOfMonth: \"$date\" }\n }\n }\n }\n }, \n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterState }} ]]\n ]\n }}, \n {\n $lookup: {\n from: \"registrations\",\n let: { name: \"$name\", date: \"$date\" },\n as: \"registrations\",\n pipeline: [\n {$group: {\n _id: { \n date: { $dateToString: { format: \"%Y-%m-%d\", date: \"$createdAt\" } }, \n stateName: \"$stateName\"\n },\n total: { $sum: 1 }\n }},\n \n {\n $match:\n {\n $expr:\n {\n $and:\n [\n { $eq: [ \"$_id.date\", { $dateToString: { format: \"%Y-%m-%d\", date: \"$$date\" }} ] },\n { $eq: [ \"$_id.stateName\", \"$$name\" ] }\n ]\n }\n }\n } \n ] \n }\n },\n\n {$addFields: {\n totalRegistrations: {\n $reduce: {\n input: \"$registrations\",\n initialValue: 0,\n in: { $add: [ \"$$value\", \"$$this.total\" ] }\n } \n \n } \n }},\n{$addFields: {estimate: ''$estimate.estimatedNumberOfBirths''}},\n {\n $group: {\n _id: {name: \"$name\"},\n totalRegistrations: { $sum: ''$totalRegistrations'' },\n estimate: { $sum:''$estimatedNumberOfBirths'' }\n }\n },\n {$addFields: {\n percentage: {\n $cond: {\n if: { $eq: [ \"$totalRegistrations\", 0 ] },\n then: 0,\n else: {\n $cond: {\n if: { $eq: [ \"$estimate\", 0 ] },\n then: 0,\n else: {$divide: [''$totalRegistrations'', ''$estimate'']}\n }\n }\n }\n } \n }}, \n {$project: {\n _id: false,\n State: ''$_id.name'',\n ''Completeness Rate'': {$round: [{$multiply: [''$percentage'', 100] }, 0]}\n }}\n \n]","collection":"populationEstimatesPerDay"},"database":3},"id":9,"parameter_mappings":[],"display":"map","entity_id":"9t73rF7ixsw9EVOWpx7ab","collection_preview":true,"visualization_settings":{"map.type":"region","map.region":"910cd1de-9dbd-c36c-96bd-39d55ad9b84f","map.metric":"percentage","map.dimension":"state","table.pivot_column":"_id","table.cell_column":"percentage"},"is_write":false,"parameters":[{"id":"00f44aca-d69e-e96d-fe06-3a75520a7a56","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"},{"id":"f884c63f-cae1-253b-a6', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(627, 1, '6a-e9d1284f25b2","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"Filterstate","slug":"filterState"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(614, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":7,"query_type":"native","name":"Completeness Rate","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterEvent":{"id":"545955ab-f6ec-0de1-3f4e-ce9e50e91e82","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"63587bed-9b53-1d2a-5396-317e766e7de8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",572,null],"widget-type":"string/=","default":null},"filterGender":{"id":"92951985-5ced-b397-b9b6-ea5a04ef29d5","name":"filterGender","display-name":"Filtergender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterDate":{"id":"fcf90832-e5e8-d1f2-86bf-4601339adab5","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",571,null],"widget-type":"date/range","default":null}},"query":"[\n {\n $addFields: {\n date: { $dateFromParts: {\n year: { $add: [ { $year: \"$date\" }, 1 ] },\n month: { $month: \"$date\" },\n day: { $dayOfMonth: \"$date\" }\n }\n }\n }\n },\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterDate }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n ]\n }}, \n {\n $lookup: {\n from: \"analyticsRegistrations\",\n let: { name: \"$name\", date: {$dateToString: {date: \"$date\" }}},\n as: \"registrations\",\n pipeline: [\n {$group: {\n _id: { \n date: { $dateToString: { format: \"%Y-%m-%d\", date: \"$createdAt\" } }, \n stateName: \"$stateName\"\n },\n total: { $sum: 1 }\n }},\n {$addFields:{stateName: ''$_id.stateName'', date: {$dateToString: { date: { $dateFromString: { dateString: ''$_id.date''}}}}}},\n {\n $match:\n {\n $expr:\n {\n $and:\n [\n { $eq: [ \"$date\", \"$$date\" ] },\n { $eq: [ \"$stateName\", \"$$name\" ] }\n ]\n }\n }\n } \n ] \n }\n },\n\n {$addFields: {\n totalRegistrations: {\n $reduce: {\n input: \"$registrations\",\n initialValue: 0,\n in: { $add: [ \"$$value\", \"$$this.total\" ] }\n } \n \n } \n }},\n{$addFields: {estimate: ''$estimate.estimatedNumberOfBirths''}},\n {\n $group: {\n _id: null,\n totalRegistrations: { $sum: ''$totalRegistrations'' },\n estimate: { $sum:''$estimatedNumberOfBirths'' }\n }\n },\n {$addFields: {\n percentage: {\n $cond: {\n if: { $eq: [ \"$totalRegistrations\", 0 ] },\n then: 0,\n else: {\n $cond: {\n if: { $eq: [ \"$estimate\", 0 ] },\n then: 0,\n else: {$divide: [''$totalRegistrations'', ''$estimate'']}\n }\n }\n }\n } \n }}, \n {$project: {_id: false, percentage: ''$percentage''}} \n]","collection":"analyticsPopulationEstimatesPerDay"},"type":"native"},"id":13,"parameter_mappings":[],"display":"gauge","entity_id":"RUK20xOu8Io0PvT4a332Q","collection_preview":true,"visualization_settings":{"', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(614, 1, 'table.pivot_column":"percentage","table.cell_column":"foo","gauge.segments":[{"min":0,"max":0.25,"color":"#ED6E6E","label":""},{"min":0.25,"max":0.75,"color":"#F9CF48","label":""},{"min":0.75,"max":1,"color":"#84BB4C","label":""}],"column_settings":{"[\"name\",\"percentage\"]":{"scale":100,"suffix":" %"}}},"is_write":false,"parameters":[{"id":"545955ab-f6ec-0de1-3f4e-ce9e50e91e82","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"63587bed-9b53-1d2a-5396-317e766e7de8","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"92951985-5ced-b397-b9b6-ea5a04ef29d5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Filtergender","slug":"filterGender"},{"id":"fcf90832-e5e8-d1f2-86bf-4601339adab5","type":"date/range","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(615, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":7,"query_type":"native","name":"Completeness Rate","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterEvent":{"id":"545955ab-f6ec-0de1-3f4e-ce9e50e91e82","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"63587bed-9b53-1d2a-5396-317e766e7de8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",572,null],"widget-type":"string/=","default":null},"filterGender":{"id":"92951985-5ced-b397-b9b6-ea5a04ef29d5","name":"filterGender","display-name":"Filtergender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterDate":{"id":"fcf90832-e5e8-d1f2-86bf-4601339adab5","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",571,null],"widget-type":"date/range","default":null}},"query":"[\n {\n $addFields: {\n date: { $dateFromParts: {\n year: { $add: [ { $year: \"$date\" }, 1 ] },\n month: { $month: \"$date\" },\n day: { $dayOfMonth: \"$date\" }\n }\n }\n }\n },\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterDate }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n ]\n }}, \n {\n $lookup: {\n from: \"analyticsRegistrations\",\n let: { name: \"$name\", date: {$dateToString: {date: \"$date\" }}},\n as: \"registrations\",\n pipeline: [\n {$group: {\n _id: { \n date: { $dateToString: { format: \"%Y-%m-%d\", date: \"$createdAt\" } }, \n stateName: \"$stateName\"\n },\n total: { $sum: 1 }\n }},\n {$addFields:{stateName: ''$_id.stateName'', date: {$dateToString: { date: { $dateFromString: { dateString: ''$_id.date''}}}}}},\n {\n $match:\n {\n $expr:\n {\n $and:\n [\n { $eq: [ \"$date\", \"$$date\" ] },\n { $eq: [ \"$stateName\", \"$$name\" ] }\n ]\n }\n }\n } \n ] \n }\n },\n\n {$addFields: {\n totalRegistrations: {\n $reduce: {\n input: \"$registrations\",\n initialValue: 0,\n in: { $add: [ \"$$value\", \"$$this.total\" ] }\n } \n \n } \n }},\n{$addFields: {estimate: ''$estimate.estimatedNumberOfBirths''}},\n {\n $group: {\n _id: null,\n totalRegistrations: { $sum: ''$totalRegistrations'' },\n estimate: { $sum:''$estimatedNumberOfBirths'' }\n }\n },\n {$addFields: {\n percentage: {\n $cond: {\n if: { $eq: [ \"$totalRegistrations\", 0 ] },\n then: 0,\n else: {\n $cond: {\n if: { $eq: [ \"$estimate\", 0 ] },\n then: 0,\n else: {$divide: [''$totalRegistrations'', ''$estimate'']}\n }\n }\n }\n } \n }}, \n {$project: {_id: false, percentage: ''$percentage''}} \n]","collection":"analyticsPopulationEstimatesPerDay"},"type":"native"},"id":13,"parameter_mappings":[],"display":"scalar","entity_id":"RUK20xOu8Io0PvT4a332Q","collection_preview":true,"visualization_settings":{', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(615, 1, '"table.pivot_column":"percentage","table.cell_column":"foo","gauge.segments":[{"min":0,"max":0.25,"color":"#ED6E6E","label":""},{"min":0.25,"max":0.75,"color":"#F9CF48","label":""},{"min":0.75,"max":1,"color":"#84BB4C","label":""}],"column_settings":{"[\"name\",\"percentage\"]":{"scale":100,"suffix":" %"}}},"is_write":false,"parameters":[{"id":"545955ab-f6ec-0de1-3f4e-ce9e50e91e82","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"63587bed-9b53-1d2a-5396-317e766e7de8","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"92951985-5ced-b397-b9b6-ea5a04ef29d5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Filtergender","slug":"filterGender"},{"id":"fcf90832-e5e8-d1f2-86bf-4601339adab5","type":"date/range","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(616, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":7,"query_type":"native","name":"Completeness Rate","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterEvent":{"id":"545955ab-f6ec-0de1-3f4e-ce9e50e91e82","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"63587bed-9b53-1d2a-5396-317e766e7de8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",572,null],"widget-type":"string/=","default":null},"filterGender":{"id":"92951985-5ced-b397-b9b6-ea5a04ef29d5","name":"filterGender","display-name":"Filtergender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterDate":{"id":"fcf90832-e5e8-d1f2-86bf-4601339adab5","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",571,null],"widget-type":"date/range","default":null}},"query":"[\n {\n $addFields: {\n date: { $dateFromParts: {\n year: { $add: [ { $year: \"$date\" }, 1 ] },\n month: { $month: \"$date\" },\n day: { $dayOfMonth: \"$date\" }\n }\n }\n }\n },\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterDate }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n ]\n }}, \n {\n $lookup: {\n from: \"analyticsRegistrations\",\n let: { name: \"$name\", date: {$dateToString: {date: \"$date\" }}},\n as: \"registrations\",\n pipeline: [\n {$group: {\n _id: { \n date: { $dateToString: { format: \"%Y-%m-%d\", date: \"$createdAt\" } }, \n stateName: \"$stateName\"\n },\n total: { $sum: 1 }\n }},\n {$addFields:{stateName: ''$_id.stateName'', date: {$dateToString: { date: { $dateFromString: { dateString: ''$_id.date''}}}}}},\n {\n $match:\n {\n $expr:\n {\n $and:\n [\n { $eq: [ \"$date\", \"$$date\" ] },\n { $eq: [ \"$stateName\", \"$$name\" ] }\n ]\n }\n }\n } \n ] \n }\n },\n\n {$addFields: {\n totalRegistrations: {\n $reduce: {\n input: \"$registrations\",\n initialValue: 0,\n in: { $add: [ \"$$value\", \"$$this.total\" ] }\n } \n \n } \n }},\n{$addFields: {estimate: ''$estimate.estimatedNumberOfBirths''}},\n {\n $group: {\n _id: null,\n totalRegistrations: { $sum: ''$totalRegistrations'' },\n estimate: { $sum:''$estimatedNumberOfBirths'' }\n }\n },\n {$addFields: {\n percentage: {\n $cond: {\n if: { $eq: [ \"$totalRegistrations\", 0 ] },\n then: 0,\n else: {\n $cond: {\n if: { $eq: [ \"$estimate\", 0 ] },\n then: 0,\n else: {$divide: [''$totalRegistrations'', ''$estimate'']}\n }\n }\n }\n } \n }}, \n {$project: {_id: false, percentage: ''$percentage''}} \n]","collection":"analyticsPopulationEstimatesPerDay"},"type":"native"},"id":13,"parameter_mappings":[],"display":"gauge","entity_id":"RUK20xOu8Io0PvT4a332Q","collection_preview":true,"visualization_settings":{"', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(616, 1, 'table.pivot_column":"percentage","table.cell_column":"foo","gauge.segments":[{"min":0,"max":0.25,"color":"#ED6E6E","label":""},{"min":0.25,"max":0.75,"color":"#F9CF48","label":""},{"min":0.75,"max":1,"color":"#84BB4C","label":""}],"column_settings":{"[\"name\",\"percentage\"]":{"scale":100,"suffix":" %"}}},"is_write":false,"parameters":[{"id":"545955ab-f6ec-0de1-3f4e-ce9e50e91e82","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"63587bed-9b53-1d2a-5396-317e766e7de8","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"92951985-5ced-b397-b9b6-ea5a04ef29d5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Filtergender","slug":"filterGender"},{"id":"fcf90832-e5e8-d1f2-86bf-4601339adab5","type":"date/range","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(617, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":6,"query_type":"native","name":" Completeness Rates by State","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterDate":{"id":"00f44aca-d69e-e96d-fe06-3a75520a7a56","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",571,null],"widget-type":"date/range","default":null},"filterState":{"id":"f884c63f-cae1-253b-a66a-e9d1284f25b2","name":"filterState","display-name":"Filterstate","type":"dimension","dimension":["field",572,null],"widget-type":"string/=","default":null}},"query":"[\n {\n $addFields: {\n date: { $dateFromParts: {\n year: { $add: [ { $year: \"$date\" }, 1 ] },\n month: { $month: \"$date\" },\n day: { $dayOfMonth: \"$date\" }\n }\n }\n }\n }, \n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterState }} ]]\n ]\n }}, \n {\n $lookup: {\n from: \"analyticsRegistrations\",\n let: { name: \"$name\", date: \"$date\" },\n as: \"registrations\",\n pipeline: [\n {$group: {\n _id: { \n date: { $dateToString: { format: \"%Y-%m-%d\", date: \"$createdAt\" } }, \n stateName: \"$stateName\"\n },\n total: { $sum: 1 }\n }},\n \n {\n $match:\n {\n $expr:\n {\n $and:\n [\n { $eq: [ \"$_id.date\", { $dateToString: { format: \"%Y-%m-%d\", date: \"$$date\" }} ] },\n { $eq: [ \"$_id.stateName\", \"$$name\" ] }\n ]\n }\n }\n } \n ] \n }\n },\n\n {$addFields: {\n totalRegistrations: {\n $reduce: {\n input: \"$registrations\",\n initialValue: 0,\n in: { $add: [ \"$$value\", \"$$this.total\" ] }\n } \n \n } \n }},\n{$addFields: {estimate: ''$estimate.estimatedNumberOfBirths''}},\n {\n $group: {\n _id: {name: \"$name\"},\n totalRegistrations: { $sum: ''$totalRegistrations'' },\n estimate: { $sum:''$estimatedNumberOfBirths'' }\n }\n },\n {$addFields: {\n percentage: {\n $cond: {\n if: { $eq: [ \"$totalRegistrations\", 0 ] },\n then: 0,\n else: {\n $cond: {\n if: { $eq: [ \"$estimate\", 0 ] },\n then: 0,\n else: {$divide: [''$totalRegistrations'', ''$estimate'']}\n }\n }\n }\n } \n }}, \n {$project: {\n _id: false,\n State: ''$_id.name'',\n ''Completeness Rate'': {$round: [{$multiply: [''$percentage'', 100] }, 0]}\n }}\n \n]","collection":"analyticsPopulationEstimatesPerDay"},"type":"native"},"id":9,"parameter_mappings":[],"display":"map","entity_id":"9t73rF7ixsw9EVOWpx7ab","collection_preview":true,"visualization_settings":{"map.type":"region","map.region":"910cd1de-9dbd-c36c-96bd-39d55ad9b84f","map.metric":"percentage","map.dimension":"state","table.pivot_column":"_id","table.cell_column":"percentage"},"is_write":false,"parameters":[{"id":"00f44aca-d69e-e96d-fe06-3a75520a7a56","type":"date/range","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"},{"id":"f884c63f-cae1', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(617, 1, '-253b-a66a-e9d1284f25b2","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"Filterstate","slug":"filterState"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(618, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":11,"query_type":"native","name":"Live births by Order","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , birthOrder: ''$birthOrder''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$eq: [''$birthOrder'', 1]}] }, then: ''1''},\n {case: {$and: [{$eq: [''$birthOrder'', 2]}] }, then: ''2''},\n {case: {$and: [{$eq: [''$birthOrder'', 3]}] }, then: ''3''},\n {case: {$and: [{$eq: [''$birthOrder'', 4]}] }, then: ''4''},\n {case: {$and: [{$eq: [''$birthOrder'', 5]}] }, then: ''5''},\n {case: {$and: [{$gte: [''$birthOrder'', 6]}] }, then: ''6+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Order\": 1\n }\n }\n]","template-tags":{"filterGender":{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",339,null],"widget-type":"string/=","default":null},"filterDate":{"id":"996f1d61-a845-0afe-bb4c-f36ac4ab32be","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}}},"database":2},"id":19,"parameter_mappings":[],"display":"bar","entity_id":"L6nXdi04nvxgEh1eJYrwR","collection_preview":true,"visualization_settings":{"graph.show_values":true,"pie.dimension":"birthOrder","graph.', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(618, 1, 'series_order_dimension":null,"graph.x_axis.title_text":"Birth Order","graph.metrics":["Count"],"graph.series_order":null,"pie.metric":"count","series_settings":{"Count":{"color":"#7172AD"}},"graph.dimensions":["Order"]},"is_write":false,"parameters":[{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"996f1d61-a845-0afe-bb4c-f36ac4ab32be","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(619, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":12,"query_type":"native","name":"Live births by age of Mother","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , mothersAge: ''$mothersAgeAtBirthOfChildInYears''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$gte: [''$mothersAge'', 9]}, {$lt: [''$mothersAge'', 15]}] }, then: ''9-14''},\n {case: {$and: [{$gte: [''$mothersAge'', 15]}, {$lt: [''$mothersAge'', 20]}] }, then: ''15-19''},\n {case: {$and: [{$gte: [''$mothersAge'', 20]}, {$lt: [''$mothersAge'', 25]}] }, then: ''20-24''},\n {case: {$and: [{$gte: [''$mothersAge'', 25]}, {$lt: [''$mothersAge'', 30]}] }, then: ''25-29''},\n {case: {$and: [{$gte: [''$mothersAge'', 30]}, {$lt: [''$mothersAge'', 35]}] }, then: ''30-34''},\n {case: {$and: [{$gte: [''$mothersAge'', 35]}, {$lt: [''$mothersAge'', 40]}] }, then: ''35-39''},\n {case: {$and: [{$gte: [''$mothersAge'', 40]}, {$lt: [''$mothersAge'', 45]}] }, then: ''40-44''},\n {case: {$and: [{$gte: [''$mothersAge'', 45]}, {$lt: [''$mothersAge'', 50]}] }, then: ''45-49''},\n {case: {$and: [{$gte: [''$mothersAge'', 50]}, {$lt: [''$mothersAge'', 55]}] }, then: ''50-54''},\n {case: {$and: [{$gte: [''$mothersAge'', 55]}, {$lt: [''$mothersAge'', 60]}] }, then: ''55-59''},\n {case: {$and: [{$gte: [''$mothersAge'', 60]}] }, then: ''60+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Count\": -1\n }\n }\n]","template-tags":{"filterGender":{"id":"56559614-c685-9d81-d44b-a688fe5b103b","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11",', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(619, 1, '"name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"8b07b619-ea79-a772-e83a-92f986ab040c","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",339,null],"widget-type":"string/=","default":null},"filterDate":{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}}},"database":2},"id":20,"parameter_mappings":[],"display":"bar","entity_id":"PcnknQN2IYs_mJkwA8yRq","collection_preview":true,"visualization_settings":{"table.pivot_column":"Order","table.cell_column":"Count","graph.dimensions":["Order"],"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"56559614-c685-9d81-d44b-a688fe5b103b","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"8b07b619-ea79-a772-e83a-92f986ab040c","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(620, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":14,"query_type":"native","name":"Live Births by Level of Education of Parent","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n fathersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersAttainment\": \"$fathersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"KORANIC\"] },\n then: \"Koranic\"\n },\n {\n case: { $eq: [\"$_id\", \"MODERN\"] },\n then: \"Modern\"\n },\n {\n case: { $eq: [\"$_id\", \"HIGHER_SCHOOL\"] },\n then: \"Higher School\"\n },\n {\n case: { $eq: [\"$_id\", \"PRIMARY\"] },\n then: \"Primary\"\n },\n {\n case: { $eq: [\"$_id\", \"UNIVERSITY\"] },\n then: \"University\"\n },\n {\n case: { $eq: [\"$_id\", \"POLYTECNIC_NCE\"] },\n then: \"Polytecnic NCE\"\n },\n {\n case: { $eq: [\"$_id\", \"SECONDARY\"] },\n then: \"Secondary\"\n }\n ],\n default: \"Others\"\n }\n }\n , count: \"$count\"\n }},\n {$addFields: {\n attainment: \"fathersAttainment\"\n }}\n ]\n , mothersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersAttainment\": \"$mothersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"KORANIC\"] },\n then: \"Koranic\"\n },\n {\n case: { $eq: [\"$_id\", \"MODERN\"] },\n then: \"Modern\"\n },\n {\n case: { $eq: [\"$_id\", \"HIGHER_SCHOOL\"] },\n then: \"Higher School\"\n },\n {\n case: { $eq: [\"$_id\", \"PRIMARY\"] },\n then: \"Primary\"\n },\n {\n case: { $eq: [\"$_id\", \"UNIVERSITY\"] },\n then: \"University\"\n },\n {\n case: { $eq: [\"$_id\", \"POLYTECNIC_NCE\"] },\n then: \"Polytecnic NCE\"\n },\n {\n case: { $eq: [\"$_id\", \"SECONDARY\"] },\n ', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(620, 1, ' then: \"Secondary\"\n }\n ],\n default: \"Others\"\n }\n }\n , count: \"$count\"\n }},\n {$addFields: {\n attainment: \"mothersAttainment\"\n }}\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersAttainment\", \"$mothersAttainment\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Educational Attainment'': \"$allInfo._id\"\n , ''Attainment'': \"$allInfo.attainment\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Attainment\": 1\n }\n }\n]\n","template-tags":{"filterGender":{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",339,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}}},"database":2},"id":21,"parameter_mappings":[],"display":"bar","entity_id":"W6bdia0Vw-6PC1efnHIR4","collection_preview":true,"visualization_settings":{"graph.show_values":true,"pie.dimension":"Educational Attainment","graph.x_axis.axis_enabled":true,"graph.y_axis.auto_split":true,"graph.metrics":["Count"],"pie.metric":"Count","series_settings":{"mothersAttainment":{"title":"mother"},"fathersAttainment":{"title":"father"}},"graph.y_axis.auto_range":true,"graph.dimensions":["Educational Attainment","Attainment"]},"is_write":false,"parameters":[{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(621, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":10,"query_type":"native","name":"Literacy of parents","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"analyticsRegistrations","query":"[\n {$facet: {\n fathersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersLiteracy\": \"$fathersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"fathersLiteracy\"\n }}\n ]\n , mothersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersLiteracy\": \"$mothersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id.mothersLiteracy\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id.mothersLiteracy\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , \"count\": \"$qty\"\n }},\n {$addFields: {\n literacy: \"mothersLiteracy\"\n }}\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersLiteracy\", \"$mothersLiteracy\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Category'': \"$allInfo._id\"\n , ''Literacy'': \"$allInfo.literacy\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Literacy\": 1\n }\n }\n]\n","template-tags":{"filterGender":{"id":"e8218caf-e2aa-573e-1776-02cffff42462","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"bf69e085-3c01-7924-5108-7151c85dc371","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",339,null],"widget-type":"string/=","default":null},"filterDate":{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","name":"filterDate","display-name":"Date","type":"dimension","dimension":["fiel', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(621, 1, 'd",354,null],"widget-type":"date/month-year","default":null}}},"database":2},"id":18,"parameter_mappings":[],"display":"bar","entity_id":"eRSJUaHW6haiucK8BtpC_","collection_preview":true,"visualization_settings":{"graph.show_values":true,"graph.label_value_formatting":"auto","graph.dimensions":["Category","Literacy"],"series_settings":{"mothersLiteracy":{"title":"mother"},"fathersLiteracy":{"title":"father"}},"graph.x_axis.title_text":"Literacy","graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"e8218caf-e2aa-573e-1776-02cffff42462","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"bf69e085-3c01-7924-5108-7151c85dc371","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(622, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":2,"enable_embedding":false,"collection_id":11,"query_type":"native","name":"Live births by Order","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":2,"native":{"template-tags":{"filterGender":{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",336,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",538,null],"widget-type":"string/=","default":null},"filterState":{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","name":"filterState","display-name":"State","type":"dimension","dimension":["field",340,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",339,null],"widget-type":"string/=","default":null},"filterDate":{"id":"996f1d61-a845-0afe-bb4c-f36ac4ab32be","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",354,null],"widget-type":"date/month-year","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , birthOrder: ''$birthOrder''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$eq: [''$birthOrder'', 1]}] }, then: ''1''},\n {case: {$and: [{$eq: [''$birthOrder'', 2]}] }, then: ''2''},\n {case: {$and: [{$eq: [''$birthOrder'', 3]}] }, then: ''3''},\n {case: {$and: [{$eq: [''$birthOrder'', 4]}] }, then: ''4''},\n {case: {$and: [{$eq: [''$birthOrder'', 5]}] }, then: ''5''},\n {case: {$and: [{$gte: [''$birthOrder'', 6]}] }, then: ''6+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Order\": 1\n }\n }\n]","collection":"analyticsRegistrations"},"type":"native"},"id":19,"parameter_mappings":[],"display":"bar","entity_id":"L6nXdi04nvxgEh1eJYrwR","collection_preview":true,"visualization_settings":{"graph.show_values":true,"pie.dimension":"birthOrder","graph.', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(622, 1, 'series_order_dimension":null,"graph.x_axis.title_text":"Birth Order","graph.metrics":["Count"],"graph.series_order":null,"pie.metric":"count","series_settings":{"Count":{"color":"#7172AD"}},"graph.dimensions":["Order"]},"is_write":false,"parameters":[{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"996f1d61-a845-0afe-bb4c-f36ac4ab32be","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(623, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":7,"query_type":"native","name":"Completeness Rate","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {\n $addFields: {\n date: { $dateFromParts: {\n year: { $add: [ { $year: \"$date\" }, 1 ] },\n month: { $month: \"$date\" },\n day: { $dayOfMonth: \"$date\" }\n }\n }\n }\n },\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterDate }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n ]\n }}, \n {\n $lookup: {\n from: \"analyticsRegistrations\",\n let: { name: \"$name\", date: {$dateToString: {date: \"$date\" }}},\n as: \"registrations\",\n pipeline: [\n {$group: {\n _id: { \n date: { $dateToString: { format: \"%Y-%m-%d\", date: \"$createdAt\" } }, \n stateName: \"$stateName\"\n },\n total: { $sum: 1 }\n }},\n {$addFields:{stateName: ''$_id.stateName'', date: {$dateToString: { date: { $dateFromString: { dateString: ''$_id.date''}}}}}},\n {\n $match:\n {\n $expr:\n {\n $and:\n [\n { $eq: [ \"$date\", \"$$date\" ] },\n { $eq: [ \"$stateName\", \"$$name\" ] }\n ]\n }\n }\n } \n ] \n }\n },\n\n {$addFields: {\n totalRegistrations: {\n $reduce: {\n input: \"$registrations\",\n initialValue: 0,\n in: { $add: [ \"$$value\", \"$$this.total\" ] }\n } \n \n } \n }},\n{$addFields: {estimate: ''$estimate.estimatedNumberOfBirths''}},\n {\n $group: {\n _id: null,\n totalRegistrations: { $sum: ''$totalRegistrations'' },\n estimate: { $sum:''$estimatedNumberOfBirths'' }\n }\n },\n {$addFields: {\n percentage: {\n $cond: {\n if: { $eq: [ \"$totalRegistrations\", 0 ] },\n then: 0,\n else: {\n $cond: {\n if: { $eq: [ \"$estimate\", 0 ] },\n then: 0,\n else: {$divide: [''$totalRegistrations'', ''$estimate'']}\n }\n }\n }\n } \n }}, \n {$project: {_id: false, percentage: ''$percentage''}} \n]","template-tags":{"filterEvent":{"id":"545955ab-f6ec-0de1-3f4e-ce9e50e91e82","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"63587bed-9b53-1d2a-5396-317e766e7de8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",659,null],"widget-type":"string/=","default":null},"filterGender":{"id":"92951985-5ced-b397-b9b6-ea5a04ef29d5","name":"filterGender","display-name":"Filtergender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterDate":{"id":"fcf90832-e5e8-d1f2-86bf-4601339adab5","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",658,null],"widget-type":"date/month-year","default":null}}},"type":"native"},"id":13,"parameter_mappings":[],"display":"gauge","entity_id":"RUK20xOu8Io0PvT4a332Q","collection_preview":true,"visualization_settings":{"table.pivot_colu', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(623, 1, 'mn":"percentage","table.cell_column":"foo","gauge.segments":[{"min":0,"max":0.25,"color":"#ED6E6E","label":""},{"min":0.25,"max":0.75,"color":"#F9CF48","label":""},{"min":0.75,"max":1,"color":"#84BB4C","label":""}],"column_settings":{"[\"name\",\"percentage\"]":{"scale":100,"suffix":" %"}}},"is_write":false,"parameters":[{"id":"545955ab-f6ec-0de1-3f4e-ce9e50e91e82","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"63587bed-9b53-1d2a-5396-317e766e7de8","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"92951985-5ced-b397-b9b6-ea5a04ef29d5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Filtergender","slug":"filterGender"},{"id":"fcf90832-e5e8-d1f2-86bf-4601339adab5","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(624, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":10,"query_type":"native","name":"Literacy of parents","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {$facet: {\n fathersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersLiteracy\": \"$fathersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"fathersLiteracy\"\n }}\n ]\n , mothersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersLiteracy\": \"$mothersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id.mothersLiteracy\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id.mothersLiteracy\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , \"count\": \"$qty\"\n }},\n {$addFields: {\n literacy: \"mothersLiteracy\"\n }}\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersLiteracy\", \"$mothersLiteracy\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Category'': \"$allInfo._id\"\n , ''Literacy'': \"$allInfo.literacy\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Literacy\": 1\n }\n }\n]\n","template-tags":{"filterGender":{"id":"e8218caf-e2aa-573e-1776-02cffff42462","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"bf69e085-3c01-7924-5108-7151c85dc371","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null]', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(624, 1, ',"widget-type":"date/month-year","default":null}}},"type":"native"},"id":18,"parameter_mappings":[],"display":"bar","entity_id":"eRSJUaHW6haiucK8BtpC_","collection_preview":true,"visualization_settings":{"graph.show_values":true,"graph.label_value_formatting":"auto","graph.dimensions":["Category","Literacy"],"series_settings":{"mothersLiteracy":{"title":"mother"},"fathersLiteracy":{"title":"father"}},"graph.x_axis.title_text":"Literacy","graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"e8218caf-e2aa-573e-1776-02cffff42462","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"bf69e085-3c01-7924-5108-7151c85dc371","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(625, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":12,"query_type":"native","name":"Live births by age of Mother","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , mothersAge: ''$mothersAgeAtBirthOfChildInYears''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$gte: [''$mothersAge'', 9]}, {$lt: [''$mothersAge'', 15]}] }, then: ''9-14''},\n {case: {$and: [{$gte: [''$mothersAge'', 15]}, {$lt: [''$mothersAge'', 20]}] }, then: ''15-19''},\n {case: {$and: [{$gte: [''$mothersAge'', 20]}, {$lt: [''$mothersAge'', 25]}] }, then: ''20-24''},\n {case: {$and: [{$gte: [''$mothersAge'', 25]}, {$lt: [''$mothersAge'', 30]}] }, then: ''25-29''},\n {case: {$and: [{$gte: [''$mothersAge'', 30]}, {$lt: [''$mothersAge'', 35]}] }, then: ''30-34''},\n {case: {$and: [{$gte: [''$mothersAge'', 35]}, {$lt: [''$mothersAge'', 40]}] }, then: ''35-39''},\n {case: {$and: [{$gte: [''$mothersAge'', 40]}, {$lt: [''$mothersAge'', 45]}] }, then: ''40-44''},\n {case: {$and: [{$gte: [''$mothersAge'', 45]}, {$lt: [''$mothersAge'', 50]}] }, then: ''45-49''},\n {case: {$and: [{$gte: [''$mothersAge'', 50]}, {$lt: [''$mothersAge'', 55]}] }, then: ''50-54''},\n {case: {$and: [{$gte: [''$mothersAge'', 55]}, {$lt: [''$mothersAge'', 60]}] }, then: ''55-59''},\n {case: {$and: [{$gte: [''$mothersAge'', 60]}] }, then: ''60+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Count\": -1\n }\n }\n]","template-tags":{"filterGender":{"id":"56559614-c685-9d81-d44b-a688fe5b103b","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","name":"filt', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(625, 1, 'erState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"8b07b619-ea79-a772-e83a-92f986ab040c","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null}}},"type":"native"},"id":20,"parameter_mappings":[],"display":"bar","entity_id":"PcnknQN2IYs_mJkwA8yRq","collection_preview":true,"visualization_settings":{"table.pivot_column":"Order","table.cell_column":"Count","graph.dimensions":["Order"],"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"56559614-c685-9d81-d44b-a688fe5b103b","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"8b07b619-ea79-a772-e83a-92f986ab040c","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(626, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":14,"query_type":"native","name":"Live Births by Level of Education of Parent","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {$facet: {\n fathersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersAttainment\": \"$fathersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"KORANIC\"] },\n then: \"Koranic\"\n },\n {\n case: { $eq: [\"$_id\", \"MODERN\"] },\n then: \"Modern\"\n },\n {\n case: { $eq: [\"$_id\", \"HIGHER_SCHOOL\"] },\n then: \"Higher School\"\n },\n {\n case: { $eq: [\"$_id\", \"PRIMARY\"] },\n then: \"Primary\"\n },\n {\n case: { $eq: [\"$_id\", \"UNIVERSITY\"] },\n then: \"University\"\n },\n {\n case: { $eq: [\"$_id\", \"POLYTECNIC_NCE\"] },\n then: \"Polytecnic NCE\"\n },\n {\n case: { $eq: [\"$_id\", \"SECONDARY\"] },\n then: \"Secondary\"\n }\n ],\n default: \"Others\"\n }\n }\n , count: \"$count\"\n }},\n {$addFields: {\n attainment: \"fathersAttainment\"\n }}\n ]\n , mothersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersAttainment\": \"$mothersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"KORANIC\"] },\n then: \"Koranic\"\n },\n {\n case: { $eq: [\"$_id\", \"MODERN\"] },\n then: \"Modern\"\n },\n {\n case: { $eq: [\"$_id\", \"HIGHER_SCHOOL\"] },\n then: \"Higher School\"\n },\n {\n case: { $eq: [\"$_id\", \"PRIMARY\"] },\n then: \"Primary\"\n },\n {\n case: { $eq: [\"$_id\", \"UNIVERSITY\"] },\n then: \"University\"\n },\n {\n case: { $eq: [\"$_id\", \"POLYTECNIC_NCE\"] },\n then: \"Polytecnic NCE\"\n },\n {\n case: { $eq: [\"$_id\", \"SECONDARY\"] },\n ', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(626, 1, ' then: \"Secondary\"\n }\n ],\n default: \"Others\"\n }\n }\n , count: \"$count\"\n }},\n {$addFields: {\n attainment: \"mothersAttainment\"\n }}\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersAttainment\", \"$mothersAttainment\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Educational Attainment'': \"$allInfo._id\"\n , ''Attainment'': \"$allInfo.attainment\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Attainment\": 1\n }\n }\n]\n","template-tags":{"filterGender":{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null}}},"type":"native"},"id":21,"parameter_mappings":[],"display":"bar","entity_id":"W6bdia0Vw-6PC1efnHIR4","collection_preview":true,"visualization_settings":{"graph.show_values":true,"pie.dimension":"Educational Attainment","graph.x_axis.axis_enabled":true,"graph.y_axis.auto_split":true,"graph.metrics":["Count"],"pie.metric":"Count","series_settings":{"mothersAttainment":{"title":"mother"},"fathersAttainment":{"title":"father"}},"graph.y_axis.auto_range":true,"graph.dimensions":["Educational Attainment","Attainment"]},"is_write":false,"parameters":[{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(627, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":11,"query_type":"native","name":"Live births by Order","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , birthOrder: ''$birthOrder''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$eq: [''$birthOrder'', 1]}] }, then: ''1''},\n {case: {$and: [{$eq: [''$birthOrder'', 2]}] }, then: ''2''},\n {case: {$and: [{$eq: [''$birthOrder'', 3]}] }, then: ''3''},\n {case: {$and: [{$eq: [''$birthOrder'', 4]}] }, then: ''4''},\n {case: {$and: [{$eq: [''$birthOrder'', 5]}] }, then: ''5''},\n {case: {$and: [{$gte: [''$birthOrder'', 6]}] }, then: ''6+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Order\": 1\n }\n }\n]","template-tags":{"filterGender":{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"996f1d61-a845-0afe-bb4c-f36ac4ab32be","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null}}},"type":"native"},"id":19,"parameter_mappings":[],"display":"bar","entity_id":"L6nXdi04nvxgEh1eJYrwR","collection_preview":true,"visualization_settings":{"graph.show_values":true,"pie.dimension":"birthOrder","graph.series_or', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(627, 1, 'der_dimension":null,"graph.x_axis.title_text":"Birth Order","graph.metrics":["Count"],"graph.series_order":null,"pie.metric":"count","series_settings":{"Count":{"color":"#7172AD"}},"graph.dimensions":["Order"]},"is_write":false,"parameters":[{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"996f1d61-a845-0afe-bb4c-f36ac4ab32be","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(628, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":6,"query_type":"native","name":" Completeness Rates by State","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterDate":{"id":"00f44aca-d69e-e96d-fe06-3a75520a7a56","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",658,null],"widget-type":"date/month-year","default":null},"filterState":{"id":"f884c63f-cae1-253b-a66a-e9d1284f25b2","name":"filterState","display-name":"Filterstate","type":"dimension","dimension":["field",659,null],"widget-type":"string/=","default":null}},"query":"[\n {\n $addFields: {\n date: { $dateFromParts: {\n year: { $add: [ { $year: \"$date\" }, 1 ] },\n month: { $month: \"$date\" },\n day: { $dayOfMonth: \"$date\" }\n }\n }\n }\n }, \n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterState }} ]]\n ]\n }}, \n {\n $lookup: {\n from: \"registrations\",\n let: { name: \"$name\", date: \"$date\" },\n as: \"registrations\",\n pipeline: [\n {$group: {\n _id: { \n date: { $dateToString: { format: \"%Y-%m-%d\", date: \"$createdAt\" } }, \n stateName: \"$stateName\"\n },\n total: { $sum: 1 }\n }},\n \n {\n $match:\n {\n $expr:\n {\n $and:\n [\n { $eq: [ \"$_id.date\", { $dateToString: { format: \"%Y-%m-%d\", date: \"$$date\" }} ] },\n { $eq: [ \"$_id.stateName\", \"$$name\" ] }\n ]\n }\n }\n } \n ] \n }\n },\n\n {$addFields: {\n totalRegistrations: {\n $reduce: {\n input: \"$registrations\",\n initialValue: 0,\n in: { $add: [ \"$$value\", \"$$this.total\" ] }\n } \n \n } \n }},\n{$addFields: {estimate: ''$estimate.estimatedNumberOfBirths''}},\n {\n $group: {\n _id: {name: \"$name\"},\n totalRegistrations: { $sum: ''$totalRegistrations'' },\n estimate: { $sum:''$estimatedNumberOfBirths'' }\n }\n },\n {$addFields: {\n percentage: {\n $cond: {\n if: { $eq: [ \"$totalRegistrations\", 0 ] },\n then: 0,\n else: {\n $cond: {\n if: { $eq: [ \"$estimate\", 0 ] },\n then: 0,\n else: {$divide: [''$totalRegistrations'', ''$estimate'']}\n }\n }\n }\n } \n }}, \n {$project: {\n _id: false,\n State: ''$_id.name'',\n ''Completeness Rate'': {$round: [{$multiply: [''$percentage'', 100] }, 0]}\n }}\n \n]","collection":"populationEstimatesPerDay"},"database":3},"id":9,"parameter_mappings":[],"display":"map","entity_id":"9t73rF7ixsw9EVOWpx7ab","collection_preview":true,"visualization_settings":{"map.type":"region","map.region":"910cd1de-9dbd-c36c-96bd-39d55ad9b84f","map.metric":"percentage","map.dimension":"state","table.pivot_column":"_id","table.cell_column":"percentage"},"is_write":false,"parameters":[{"id":"00f44aca-d69e-e96d-fe06-3a75520a7a56","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"},{"id":"f884c63f-cae1-253b-a6', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(628, 1, '6a-e9d1284f25b2","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"Filterstate","slug":"filterState"}],"dataset":false,"public_uuid":null}', NULL); INSERT INTO "PUBLIC"."REVISION" VALUES -(463, 'Card', 13, 1, TIMESTAMP WITH TIME ZONE '2022-12-22 14:02:22.347+00', SYSTEM_COMBINE_CLOB(610), FALSE, FALSE, NULL), -(464, 'Card', 13, 1, TIMESTAMP WITH TIME ZONE '2022-12-22 14:02:31.999+00', SYSTEM_COMBINE_CLOB(611), FALSE, FALSE, NULL), -(465, 'Card', 13, 1, TIMESTAMP WITH TIME ZONE '2022-12-22 17:41:43.058+00', SYSTEM_COMBINE_CLOB(612), FALSE, FALSE, NULL), -(470, 'Card', 13, 1, TIMESTAMP WITH TIME ZONE '2022-12-23 09:05:33.917+00', SYSTEM_COMBINE_CLOB(613), FALSE, FALSE, NULL), -(471, 'Card', 13, 1, TIMESTAMP WITH TIME ZONE '2022-12-23 09:05:45.567+00', SYSTEM_COMBINE_CLOB(614), FALSE, FALSE, NULL), -(472, 'Card', 13, 1, TIMESTAMP WITH TIME ZONE '2022-12-23 09:05:53.406+00', SYSTEM_COMBINE_CLOB(615), FALSE, FALSE, NULL), -(473, 'Card', 9, 1, TIMESTAMP WITH TIME ZONE '2022-12-23 09:39:38.712+00', SYSTEM_COMBINE_CLOB(616), FALSE, FALSE, NULL), -(476, 'Card', 19, 1, TIMESTAMP WITH TIME ZONE '2022-12-23 11:30:38.65+00', SYSTEM_COMBINE_CLOB(617), FALSE, FALSE, NULL), -(477, 'Card', 20, 1, TIMESTAMP WITH TIME ZONE '2022-12-23 11:32:17.355+00', SYSTEM_COMBINE_CLOB(618), FALSE, FALSE, NULL), -(478, 'Card', 21, 1, TIMESTAMP WITH TIME ZONE '2022-12-23 11:32:37.019+00', SYSTEM_COMBINE_CLOB(619), FALSE, FALSE, NULL), -(479, 'Card', 18, 1, TIMESTAMP WITH TIME ZONE '2022-12-23 11:32:53.796+00', SYSTEM_COMBINE_CLOB(620), FALSE, FALSE, NULL), -(485, 'Card', 19, 1, TIMESTAMP WITH TIME ZONE '2022-12-23 11:37:13.288+00', SYSTEM_COMBINE_CLOB(621), FALSE, FALSE, NULL), +(463, 'Card', 13, 1, TIMESTAMP WITH TIME ZONE '2022-12-22 14:02:22.347+00', SYSTEM_COMBINE_CLOB(611), FALSE, FALSE, NULL), +(464, 'Card', 13, 1, TIMESTAMP WITH TIME ZONE '2022-12-22 14:02:31.999+00', SYSTEM_COMBINE_CLOB(612), FALSE, FALSE, NULL), +(465, 'Card', 13, 1, TIMESTAMP WITH TIME ZONE '2022-12-22 17:41:43.058+00', SYSTEM_COMBINE_CLOB(613), FALSE, FALSE, NULL), +(470, 'Card', 13, 1, TIMESTAMP WITH TIME ZONE '2022-12-23 09:05:33.917+00', SYSTEM_COMBINE_CLOB(614), FALSE, FALSE, NULL), +(471, 'Card', 13, 1, TIMESTAMP WITH TIME ZONE '2022-12-23 09:05:45.567+00', SYSTEM_COMBINE_CLOB(615), FALSE, FALSE, NULL), +(472, 'Card', 13, 1, TIMESTAMP WITH TIME ZONE '2022-12-23 09:05:53.406+00', SYSTEM_COMBINE_CLOB(616), FALSE, FALSE, NULL), +(473, 'Card', 9, 1, TIMESTAMP WITH TIME ZONE '2022-12-23 09:39:38.712+00', SYSTEM_COMBINE_CLOB(617), FALSE, FALSE, NULL), +(476, 'Card', 19, 1, TIMESTAMP WITH TIME ZONE '2022-12-23 11:30:38.65+00', SYSTEM_COMBINE_CLOB(618), FALSE, FALSE, NULL), +(477, 'Card', 20, 1, TIMESTAMP WITH TIME ZONE '2022-12-23 11:32:17.355+00', SYSTEM_COMBINE_CLOB(619), FALSE, FALSE, NULL), +(478, 'Card', 21, 1, TIMESTAMP WITH TIME ZONE '2022-12-23 11:32:37.019+00', SYSTEM_COMBINE_CLOB(620), FALSE, FALSE, NULL), +(479, 'Card', 18, 1, TIMESTAMP WITH TIME ZONE '2022-12-23 11:32:53.796+00', SYSTEM_COMBINE_CLOB(621), FALSE, FALSE, NULL), +(485, 'Card', 19, 1, TIMESTAMP WITH TIME ZONE '2022-12-23 11:37:13.288+00', SYSTEM_COMBINE_CLOB(622), FALSE, FALSE, NULL), (488, 'Card', 30, 1, TIMESTAMP WITH TIME ZONE '2022-12-29 10:12:04.156+00', '{"description":null,"archived":false,"collection_position":null,"table_id":70,"database_id":3,"enable_embedding":false,"collection_id":8,"query_type":"query","name":"Certificates issued","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"query":{"source-table":70,"expressions":{"Status":["case",[[["=",["field",682,null],"REGISTERED"],"Not Certified"],[["=",["field",682,null],"CERTIFIED"],"Certified"]]]},"aggregation":[["count"]],"breakout":[["expression","Status"]]},"type":"query"},"id":30,"parameter_mappings":[],"display":"pie","entity_id":"i9_4VwkR62cl03HLkb9e7","collection_preview":true,"visualization_settings":{},"is_write":false,"parameters":[],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL), -(489, 'Card', 13, 1, TIMESTAMP WITH TIME ZONE '2022-12-29 10:14:18.341+00', SYSTEM_COMBINE_CLOB(622), FALSE, FALSE, NULL), +(489, 'Card', 13, 1, TIMESTAMP WITH TIME ZONE '2022-12-29 10:14:18.341+00', SYSTEM_COMBINE_CLOB(623), FALSE, FALSE, NULL), (490, 'Card', 28, 1, TIMESTAMP WITH TIME ZONE '2022-12-29 10:16:49.4+00', '{"description":null,"archived":false,"collection_position":null,"table_id":71,"database_id":3,"enable_embedding":false,"collection_id":17,"query_type":"query","name":"Corrections by type","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"query","query":{"source-table":71,"expressions":{"ReasonForCorrection":["case",[[["=",["field",688,null],"CLERICAL_ERROR"],"Clerical Error"],[["=",["field",688,null],"JUDICIAL_ORDER"],"Judicial Order"]]]},"filter":["and",["=",["field",693,null],"Birth"],["time-interval",["field",695,null],"current","year"]],"aggregation":[["count"]],"breakout":[["expression","ReasonForCorrection"]]},"database":3},"id":28,"parameter_mappings":[],"display":"pie","entity_id":"__hZ2xD-7VCBJ7mLFxB9Y","collection_preview":true,"visualization_settings":{},"is_write":false,"parameters":[],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL), -(491, 'Card', 18, 1, TIMESTAMP WITH TIME ZONE '2022-12-29 10:18:49.961+00', SYSTEM_COMBINE_CLOB(623), FALSE, FALSE, NULL), -(492, 'Card', 20, 1, TIMESTAMP WITH TIME ZONE '2022-12-29 10:20:09.525+00', SYSTEM_COMBINE_CLOB(624), FALSE, FALSE, NULL), -(493, 'Card', 21, 1, TIMESTAMP WITH TIME ZONE '2022-12-29 10:21:28.929+00', SYSTEM_COMBINE_CLOB(625), FALSE, FALSE, NULL), -(494, 'Card', 19, 1, TIMESTAMP WITH TIME ZONE '2022-12-29 10:22:57.541+00', SYSTEM_COMBINE_CLOB(626), FALSE, FALSE, NULL), -(495, 'Card', 9, 1, TIMESTAMP WITH TIME ZONE '2022-12-29 10:24:24.266+00', SYSTEM_COMBINE_CLOB(627), FALSE, FALSE, NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(628, 0, '{"description":"Those who were under 1 year age at the time of registration","archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Age under 1 year","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n \"childsAgeInDaysAtDeclaration\": {\n \"$lte\": 365\n }\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n \"childsAgeInDaysAtDeclaration\": {\n \"$lte\": 365\n }\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , { \"$group\": {\n \"_id\": {\n \"gender\": \"$gender\"\n },\n \"count\": {\n \"$sum\": 1\n },\n }\n },\n { \"$project\": {\n \"_id\": false,\n \"gender\": \"$_id.gender\",\n \"count\": true\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Gender'': \"$allInfo.gender\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }}\n]","template-tags":{"filterGender":{"id":"cb98e793-8e53-1c97-650e-a02494c83f92","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"5761782f-224e-a408-7ca4-53e2c8675c1a","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"b37cbcc8-2f00-7cbc-7fe7-f1bb06d7360b","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"afb955cd-8d16-cefa-b646-e9c72bfa71cf","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}}},"type":"native"},"id":2,"parameter_mappings":[],"display":"bar","entity_id":"nbbCJ21ti500TiOUVV2tq","collection_preview":true,"visualization_settings":{"table.columns":[{"name":"Gender","fieldRef":["field","Gender",{"base-type":"type/Text"}],"enabled":true},{"name":"Count","fieldRef":["field","Count",{"base-type":"type/Integer"}],"enabled":true},{"name":"Percentage","fieldRef":["field","Percentage",{"base-type":"type/Float"}],"enabled":true}],"table.pivot_column":"count","table.cell_column":"Gender","graph.dimensions":["Gender"],"graph.series_order_dimension":null,"graph.series_order":null,"graph.show_values":true,"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"cb98e793-8e53-1c97-650e-a02494c83f92","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"5761782f-224e-a408-7ca4-53e2c8675c1a","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"b37cbcc8-2f00-7cbc-7fe7-f1bb06d7360b","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"afb955cd-8d16-cefa-b646-e9c72bfa71cf","type":"string/=","target":["dimension",["template-', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(628, 1, 'tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); +(491, 'Card', 18, 1, TIMESTAMP WITH TIME ZONE '2022-12-29 10:18:49.961+00', SYSTEM_COMBINE_CLOB(624), FALSE, FALSE, NULL), +(492, 'Card', 20, 1, TIMESTAMP WITH TIME ZONE '2022-12-29 10:20:09.525+00', SYSTEM_COMBINE_CLOB(625), FALSE, FALSE, NULL), +(493, 'Card', 21, 1, TIMESTAMP WITH TIME ZONE '2022-12-29 10:21:28.929+00', SYSTEM_COMBINE_CLOB(626), FALSE, FALSE, NULL), +(494, 'Card', 19, 1, TIMESTAMP WITH TIME ZONE '2022-12-29 10:22:57.541+00', SYSTEM_COMBINE_CLOB(627), FALSE, FALSE, NULL), +(495, 'Card', 9, 1, TIMESTAMP WITH TIME ZONE '2022-12-29 10:24:24.266+00', SYSTEM_COMBINE_CLOB(628), FALSE, FALSE, NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(629, 0, '{"description":"Those who were under 1 year age at the time of registration","archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Age under 1 year","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n \"childsAgeInDaysAtDeclaration\": {\n \"$lte\": 365\n }\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n \"childsAgeInDaysAtDeclaration\": {\n \"$lte\": 365\n }\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , { \"$group\": {\n \"_id\": {\n \"gender\": \"$gender\"\n },\n \"count\": {\n \"$sum\": 1\n },\n }\n },\n { \"$project\": {\n \"_id\": false,\n \"gender\": \"$_id.gender\",\n \"count\": true\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Gender'': \"$allInfo.gender\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }}\n]","template-tags":{"filterGender":{"id":"cb98e793-8e53-1c97-650e-a02494c83f92","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"5761782f-224e-a408-7ca4-53e2c8675c1a","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"b37cbcc8-2f00-7cbc-7fe7-f1bb06d7360b","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"afb955cd-8d16-cefa-b646-e9c72bfa71cf","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}}},"type":"native"},"id":2,"parameter_mappings":[],"display":"bar","entity_id":"nbbCJ21ti500TiOUVV2tq","collection_preview":true,"visualization_settings":{"table.columns":[{"name":"Gender","fieldRef":["field","Gender",{"base-type":"type/Text"}],"enabled":true},{"name":"Count","fieldRef":["field","Count",{"base-type":"type/Integer"}],"enabled":true},{"name":"Percentage","fieldRef":["field","Percentage",{"base-type":"type/Float"}],"enabled":true}],"table.pivot_column":"count","table.cell_column":"Gender","graph.dimensions":["Gender"],"graph.series_order_dimension":null,"graph.series_order":null,"graph.show_values":true,"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"cb98e793-8e53-1c97-650e-a02494c83f92","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"5761782f-224e-a408-7ca4-53e2c8675c1a","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"b37cbcc8-2f00-7cbc-7fe7-f1bb06d7360b","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"afb955cd-8d16-cefa-b646-e9c72bfa71cf","type":"string/=","target":["dimension",["template-', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(629, 1, 'tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); INSERT INTO "PUBLIC"."REVISION" VALUES (496, 'Card', 29, 1, TIMESTAMP WITH TIME ZONE '2022-12-29 10:25:22.889+00', '{"description":null,"archived":false,"collection_position":null,"table_id":70,"database_id":3,"enable_embedding":false,"collection_id":15,"query_type":"query","name":"Live Births by Type of Birth","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"query","query":{"source-table":70,"expressions":{"TypeOfBirth":["case",[[["=",["field",674,null],"SINGLE"],"Single"],[["=",["field",674,null],"TWIN"],"Twin"],[["=",["field",674,null],"TRIPLET"],"Triplet"],[["=",["field",674,null],"QUADRUPLET"],"Quadruplet"]]]},"aggregation":[["count"]],"breakout":[["expression","TypeOfBirth"]],"order-by":[["desc",["aggregation",0,null]]]},"database":3},"id":29,"parameter_mappings":[],"display":"pie","entity_id":"GOqql9fnmIgyeOChWso6x","collection_preview":true,"visualization_settings":{},"is_write":false,"parameters":[],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL), -(497, 'Card', 2, 1, TIMESTAMP WITH TIME ZONE '2022-12-29 10:26:26.823+00', SYSTEM_COMBINE_CLOB(628), FALSE, FALSE, NULL), +(497, 'Card', 2, 1, TIMESTAMP WITH TIME ZONE '2022-12-29 10:26:26.823+00', SYSTEM_COMBINE_CLOB(629), FALSE, FALSE, NULL), (498, 'Card', 4, 1, TIMESTAMP WITH TIME ZONE '2022-12-29 10:27:42.103+00', '{"description":"Those who were under 1 year age at the time of registration (in bar chart)","archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Age under 5 years","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n \"childsAgeInDaysAtDeclaration\": {\n \"$lte\": 1825\n }\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n \"childsAgeInDaysAtDeclaration\": {\n \"$lte\": 1825\n }\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , { \"$group\": {\n \"_id\": {\n \"gender\": \"$gender\"\n },\n \"count\": {\n \"$sum\": 1\n },\n }\n },\n { \"$project\": {\n \"_id\": false,\n \"gender\": \"$_id.gender\",\n \"count\": true\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Gender'': \"$allInfo.gender\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }}\n]","template-tags":{"filterGender":{"id":"20e2c029-3679-018c-24d6-484d76a11d32","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"91aa0f89-bfc5-64ee-f07e-2f7b7e7ef6d9","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"00b3ab49-d6ce-c6cf-ae25-9b472e0ba093","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"accbacb5-9d7d-c299-3a26-20dd34d7f29e","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}}},"type":"native"},"id":4,"parameter_mappings":[],"display":"bar","entity_id":"fln_xwOYWPvA6slmtJM8d","collection_preview":true,"visualization_settings":{"table.pivot_column":"Gender","table.cell_column":"Count","graph.dimensions":["Gender"],"graph.show_values":true,"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"20e2c029-3679-018c-24d6-484d76a11d32","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"91aa0f89-bfc5-64ee-f07e-2f7b7e7ef6d9","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"00b3ab49-d6ce-c6cf-ae25-9b472e0ba093","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"accbacb5-9d7d-c299-3a26-20dd34d7f29e","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(629, 0, '{"description":"This widget will show the result of past 30 days (default)","archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Leaderboard of Registrars","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterGender":{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"practitionerName\": \"$practitionerName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"practitionerName\": \"$_id.practitionerName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"practitionerName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Registrar Name'': \"$allInfo.practitionerName\"\n , ''Registrations'': \"$allInfo.count\"\n }},\n {\n $limit: 10\n }\n]","collection":"registrations"},"database":3},"id":12,"parameter_mappings":[],"display":"row","entity_id":"VxeUMjNq8eLaHweLGUvYF","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.cell_column":"Percentage","graph.series_order_dimension":null,"graph.x_axis.title_text":"Registrars","graph.metrics":["Registrations"],"graph.label_value_formatting":"full","graph.series_order":null,"table.pivot_column":"Registrations","series_settings":{"Registrations":{"color":"#509EE3"}},"graph.dimensions":["Registrar Name"],"stackable.stack_type":null},"is_write":false,"parameters":[{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","type":"string/=","target":["dimension"', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(629, 1, ',["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(630, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by age","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"template-tags":{"filterGender":{"id":"46d35bb0-9f4f-a718-3a30-c67b33ebfbbd","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"1e389631-be8c-fe8d-ce92-18066d89fb39","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"ba70e3f4-7b8e-02e5-2762-8e2174e0b651","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"d700b567-972d-4291-274e-1fb46830afc1","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null},"filterDate":{"id":"ea45ef14-a48c-031a-9105-1d97f9a69f69","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null}},"collection":"registrations","query":"[\n {\n $match: {\n $and: [{ _id: { $ne: null } }\n [[{{ filterDate }} ]]\n [[{{ filterGender }} ]]\n [[{{ filterEvent }}]]\n [[{{ filterState }}]]\n [[{{ filterOffice }}]]\n ]\n }\n },\n {\n $facet: {\n totals: [{ $count: ''total'' }, { $addFields: { category: ''Total'' } }],\n ageGroups: [\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 365] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''Under 1''\n },\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 1825] },\n { $gte: [''$childsAge'', 365] }\n ]\n },\n then: ''Under 5''\n }\n ],\n default: ''Over 5''\n }\n }\n }\n },\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n category: ''$_id.par'',\n total: ''$totalCustomer''\n }\n }\n ]\n }\n },\n {\n $project: {\n mergedArray: { $concatArrays: [''$totals'', ''$ageGroups''] }\n }\n },\n { $unwind: ''$mergedArray'' },\n { $replaceRoot: { newRoot: ''$mergedArray'' } },\n {\n $addFields: {\n order: {\n $cond: {\n if: { $eq: [''$category'', ''Total''] },\n then: 1,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''Under 1''] },\n then: 2,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''Under 5''] },\n then: 3,\n else: 4\n }\n }\n }\n }\n }\n }\n }\n },\n {\n $sort: {\n order: 1\n }\n },\n { $project: { total: 1, category: 1 } }\n]"},"type":"native"},"id":11,"parameter_mappings":[],"display":"bar","entity_id":"g6QTDGvlih9yRnNCJqvy9","collection_preview":true,"visualization_settings":{"graph', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(630, 1, '.show_values":true,"graph.x_axis.labels_enabled":false,"table.cell_column":"total","graph.series_order_dimension":null,"graph.y_axis.labels_enabled":false,"graph.label_value_frequency":"fit","graph.metrics":["total"],"graph.y_axis.axis_enabled":true,"table.column_formatting":[{"columns":[],"type":"single","operator":"=","value":"","color":"#509EE3","highlight_row":false}],"graph.label_value_formatting":"auto","graph.series_order":null,"table.pivot_column":"category","column_settings":{"[\"name\",\"Total\"]":{"show_mini_bar":false}},"graph.dimensions":["category"]},"is_write":false,"parameters":[{"id":"46d35bb0-9f4f-a718-3a30-c67b33ebfbbd","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"1e389631-be8c-fe8d-ce92-18066d89fb39","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"ba70e3f4-7b8e-02e5-2762-8e2174e0b651","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"d700b567-972d-4291-274e-1fb46830afc1","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"ea45ef14-a48c-031a-9105-1d97f9a69f69","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(631, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by age","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterDate":{"id":"84b2ec9e-eea8-e9ee-160f-57a211462c2a","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/relative","default":null},"filterGender":{"id":"7d3014f2-7de5-b2b0-fb10-0796ecc6fe38","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"086c0846-69f4-a2b9-16b8-86af040bf2c8","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"537bc06b-acf9-9d28-3c92-346d83ce5156","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"5626fb9c-14cd-0fe8-2254-687e292aeb7b","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}},"query":"[\n {\n $match: {\n $and: [{ _id: { $ne: null } }\n [[{{ filterDate }} ]]\n [[{{ filterGender }} ]]\n [[{{ filterEvent }}]]\n [[{{ filterState }}]]\n [[{{ filterOffice }}]]\n ]\n }\n },\n {\n $facet: {\n totals: [{ $count: ''total'' }, { $addFields: { category: ''Total'' } }],\n ageGroups: [\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 365] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''< 1''\n },\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 1825] },\n { $gte: [''$childsAge'', 365] }\n ]\n },\n then: ''< 5''\n }\n ],\n default: ''5+''\n }\n }\n }\n },\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n category: ''$_id.par'',\n total: ''$totalCustomer''\n }\n }\n ]\n }\n },\n {\n $project: {\n mergedArray: { $concatArrays: [''$totals'', ''$ageGroups''] }\n }\n },\n { $unwind: ''$mergedArray'' },\n { $replaceRoot: { newRoot: ''$mergedArray'' } },\n {\n $addFields: {\n order: {\n $cond: {\n if: { $eq: [''$category'', ''Total''] },\n then: 1,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''< 1''] },\n then: 2,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''< 5''] },\n then: 3,\n else: 4\n }\n }\n }\n }\n }\n }\n }\n },\n {\n $sort: {\n order: 1\n }\n },\n { $project: { total: 1, category: 1 } },\n {\n $sort: {\n category: -1\n }\n },\n]","collection":"registrations"},"database":3},"id":31,"parameter_mappings":[],"display":"bar","entity_id":"hTP9EUEq13VA1N_H-258l","collection_preview":true,"visual', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(631, 1, 'ization_settings":{"graph.y_axis.title_text":"Total","graph.show_values":true,"graph.series_order_dimension":null,"graph.x_axis.title_text":"Category","graph.metrics":["total"],"graph.series_order":null,"series_settings":{"4":{"title":"Under age 5","color":"#509EE3"},"7":{"title":"Over age 5","color":"#509EE3"},"12":{"title":"Under age 1","color":"#509EE3"},"23":{"color":"#F9D45C","title":"Total"}},"graph.dimensions":["category","total"],"stackable.stack_type":"stacked"},"is_write":false,"parameters":[{"id":"84b2ec9e-eea8-e9ee-160f-57a211462c2a","type":"date/relative","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"7d3014f2-7de5-b2b0-fb10-0796ecc6fe38","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"086c0846-69f4-a2b9-16b8-86af040bf2c8","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"537bc06b-acf9-9d28-3c92-346d83ce5156","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"5626fb9c-14cd-0fe8-2254-687e292aeb7b","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(632, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by gender","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , { \"$group\": {\n \"_id\": {\n \"gender\": \"$gender\"\n },\n \"count\": {\n \"$sum\": 1\n },\n }\n },\n { \"$project\": {\n \"_id\": false,\n \"gender\": \"$_id.gender\",\n \"count\": true\n }\n },\n {$match: {\n \"gender\": {$ne: null}\n }}\n \n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Gender'': \"$allInfo.gender\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }}\n]","template-tags":{"filterDate":{"id":"57523c92-bc05-e144-f15d-a07fc78322c2","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/relative","default":null},"filterGender":{"id":"f7834d58-4acc-cc46-0aee-08d1421f1ff1","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"af46a4e6-571c-e47f-e8ab-2cf527f54d68","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"a771e085-c491-259c-3020-bb9f97cf56f4","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"09bc4ac9-1847-d645-24c9-4f2892e147d0","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}}},"type":"native"},"id":1,"parameter_mappings":[],"display":"bar","entity_id":"Ksk2s3aUAdBmDtMTNwtH3","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.columns":[],"table.cell_column":"Gender","graph.series_order_dimension":null,"graph.metrics":["Count"],"graph.series_order":null,"table.pivot_column":"count","series_settings":{"Registrations":{"color":"#509EE3","show_series_values":true}},"graph.dimensions":["Gender"]},"is_write":false,"parameters":[{"id":"57523c92-bc05-e144-f15d-a07fc78322c2","type":"date/relative","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"f7834d58-4acc-cc46-0aee-08d1421f1ff1","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"af46a4e6-571c-e47f-e8ab-2cf527f54d68","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"a771e085-c491-259c-3020-bb9f97cf56f4","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filter', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(632, 1, 'State"},{"id":"09bc4ac9-1847-d645-24c9-4f2892e147d0","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(630, 0, '{"description":"This widget will show the result of past 30 days (default)","archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Leaderboard of Registrars","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterGender":{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"practitionerName\": \"$practitionerName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"practitionerName\": \"$_id.practitionerName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"practitionerName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Registrar Name'': \"$allInfo.practitionerName\"\n , ''Registrations'': \"$allInfo.count\"\n }},\n {\n $limit: 10\n }\n]","collection":"registrations"},"database":3},"id":12,"parameter_mappings":[],"display":"row","entity_id":"VxeUMjNq8eLaHweLGUvYF","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.cell_column":"Percentage","graph.series_order_dimension":null,"graph.x_axis.title_text":"Registrars","graph.metrics":["Registrations"],"graph.label_value_formatting":"full","graph.series_order":null,"table.pivot_column":"Registrations","series_settings":{"Registrations":{"color":"#509EE3"}},"graph.dimensions":["Registrar Name"],"stackable.stack_type":null},"is_write":false,"parameters":[{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","type":"string/=","target":["dimension"', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(630, 1, ',["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(631, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by age","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"template-tags":{"filterGender":{"id":"46d35bb0-9f4f-a718-3a30-c67b33ebfbbd","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"1e389631-be8c-fe8d-ce92-18066d89fb39","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"ba70e3f4-7b8e-02e5-2762-8e2174e0b651","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"d700b567-972d-4291-274e-1fb46830afc1","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null},"filterDate":{"id":"ea45ef14-a48c-031a-9105-1d97f9a69f69","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null}},"collection":"registrations","query":"[\n {\n $match: {\n $and: [{ _id: { $ne: null } }\n [[{{ filterDate }} ]]\n [[{{ filterGender }} ]]\n [[{{ filterEvent }}]]\n [[{{ filterState }}]]\n [[{{ filterOffice }}]]\n ]\n }\n },\n {\n $facet: {\n totals: [{ $count: ''total'' }, { $addFields: { category: ''Total'' } }],\n ageGroups: [\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 365] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''Under 1''\n },\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 1825] },\n { $gte: [''$childsAge'', 365] }\n ]\n },\n then: ''Under 5''\n }\n ],\n default: ''Over 5''\n }\n }\n }\n },\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n category: ''$_id.par'',\n total: ''$totalCustomer''\n }\n }\n ]\n }\n },\n {\n $project: {\n mergedArray: { $concatArrays: [''$totals'', ''$ageGroups''] }\n }\n },\n { $unwind: ''$mergedArray'' },\n { $replaceRoot: { newRoot: ''$mergedArray'' } },\n {\n $addFields: {\n order: {\n $cond: {\n if: { $eq: [''$category'', ''Total''] },\n then: 1,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''Under 1''] },\n then: 2,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''Under 5''] },\n then: 3,\n else: 4\n }\n }\n }\n }\n }\n }\n }\n },\n {\n $sort: {\n order: 1\n }\n },\n { $project: { total: 1, category: 1 } }\n]"},"type":"native"},"id":11,"parameter_mappings":[],"display":"bar","entity_id":"g6QTDGvlih9yRnNCJqvy9","collection_preview":true,"visualization_settings":{"graph', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(631, 1, '.show_values":true,"graph.x_axis.labels_enabled":false,"table.cell_column":"total","graph.series_order_dimension":null,"graph.y_axis.labels_enabled":false,"graph.label_value_frequency":"fit","graph.metrics":["total"],"graph.y_axis.axis_enabled":true,"table.column_formatting":[{"columns":[],"type":"single","operator":"=","value":"","color":"#509EE3","highlight_row":false}],"graph.label_value_formatting":"auto","graph.series_order":null,"table.pivot_column":"category","column_settings":{"[\"name\",\"Total\"]":{"show_mini_bar":false}},"graph.dimensions":["category"]},"is_write":false,"parameters":[{"id":"46d35bb0-9f4f-a718-3a30-c67b33ebfbbd","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"1e389631-be8c-fe8d-ce92-18066d89fb39","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"ba70e3f4-7b8e-02e5-2762-8e2174e0b651","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"d700b567-972d-4291-274e-1fb46830afc1","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"ea45ef14-a48c-031a-9105-1d97f9a69f69","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(632, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by age","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterDate":{"id":"84b2ec9e-eea8-e9ee-160f-57a211462c2a","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/relative","default":null},"filterGender":{"id":"7d3014f2-7de5-b2b0-fb10-0796ecc6fe38","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"086c0846-69f4-a2b9-16b8-86af040bf2c8","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"537bc06b-acf9-9d28-3c92-346d83ce5156","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"5626fb9c-14cd-0fe8-2254-687e292aeb7b","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}},"query":"[\n {\n $match: {\n $and: [{ _id: { $ne: null } }\n [[{{ filterDate }} ]]\n [[{{ filterGender }} ]]\n [[{{ filterEvent }}]]\n [[{{ filterState }}]]\n [[{{ filterOffice }}]]\n ]\n }\n },\n {\n $facet: {\n totals: [{ $count: ''total'' }, { $addFields: { category: ''Total'' } }],\n ageGroups: [\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 365] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''< 1''\n },\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 1825] },\n { $gte: [''$childsAge'', 365] }\n ]\n },\n then: ''< 5''\n }\n ],\n default: ''5+''\n }\n }\n }\n },\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n category: ''$_id.par'',\n total: ''$totalCustomer''\n }\n }\n ]\n }\n },\n {\n $project: {\n mergedArray: { $concatArrays: [''$totals'', ''$ageGroups''] }\n }\n },\n { $unwind: ''$mergedArray'' },\n { $replaceRoot: { newRoot: ''$mergedArray'' } },\n {\n $addFields: {\n order: {\n $cond: {\n if: { $eq: [''$category'', ''Total''] },\n then: 1,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''< 1''] },\n then: 2,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''< 5''] },\n then: 3,\n else: 4\n }\n }\n }\n }\n }\n }\n }\n },\n {\n $sort: {\n order: 1\n }\n },\n { $project: { total: 1, category: 1 } },\n {\n $sort: {\n category: -1\n }\n },\n]","collection":"registrations"},"database":3},"id":31,"parameter_mappings":[],"display":"bar","entity_id":"hTP9EUEq13VA1N_H-258l","collection_preview":true,"visual', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(632, 1, 'ization_settings":{"graph.y_axis.title_text":"Total","graph.show_values":true,"graph.series_order_dimension":null,"graph.x_axis.title_text":"Category","graph.metrics":["total"],"graph.series_order":null,"series_settings":{"4":{"title":"Under age 5","color":"#509EE3"},"7":{"title":"Over age 5","color":"#509EE3"},"12":{"title":"Under age 1","color":"#509EE3"},"23":{"color":"#F9D45C","title":"Total"}},"graph.dimensions":["category","total"],"stackable.stack_type":"stacked"},"is_write":false,"parameters":[{"id":"84b2ec9e-eea8-e9ee-160f-57a211462c2a","type":"date/relative","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"7d3014f2-7de5-b2b0-fb10-0796ecc6fe38","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"086c0846-69f4-a2b9-16b8-86af040bf2c8","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"537bc06b-acf9-9d28-3c92-346d83ce5156","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"5626fb9c-14cd-0fe8-2254-687e292aeb7b","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(633, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by gender","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , { \"$group\": {\n \"_id\": {\n \"gender\": \"$gender\"\n },\n \"count\": {\n \"$sum\": 1\n },\n }\n },\n { \"$project\": {\n \"_id\": false,\n \"gender\": \"$_id.gender\",\n \"count\": true\n }\n },\n {$match: {\n \"gender\": {$ne: null}\n }}\n \n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Gender'': \"$allInfo.gender\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }}\n]","template-tags":{"filterDate":{"id":"57523c92-bc05-e144-f15d-a07fc78322c2","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/relative","default":null},"filterGender":{"id":"f7834d58-4acc-cc46-0aee-08d1421f1ff1","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"af46a4e6-571c-e47f-e8ab-2cf527f54d68","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"a771e085-c491-259c-3020-bb9f97cf56f4","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"09bc4ac9-1847-d645-24c9-4f2892e147d0","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}}},"type":"native"},"id":1,"parameter_mappings":[],"display":"bar","entity_id":"Ksk2s3aUAdBmDtMTNwtH3","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.columns":[],"table.cell_column":"Gender","graph.series_order_dimension":null,"graph.metrics":["Count"],"graph.series_order":null,"table.pivot_column":"count","series_settings":{"Registrations":{"color":"#509EE3","show_series_values":true}},"graph.dimensions":["Gender"]},"is_write":false,"parameters":[{"id":"57523c92-bc05-e144-f15d-a07fc78322c2","type":"date/relative","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"f7834d58-4acc-cc46-0aee-08d1421f1ff1","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"af46a4e6-571c-e47f-e8ab-2cf527f54d68","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"a771e085-c491-259c-3020-bb9f97cf56f4","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filter', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(633, 1, 'State"},{"id":"09bc4ac9-1847-d645-24c9-4f2892e147d0","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); INSERT INTO "PUBLIC"."REVISION" VALUES -(499, 'Card', 12, 1, TIMESTAMP WITH TIME ZONE '2022-12-29 10:29:03.007+00', SYSTEM_COMBINE_CLOB(629), FALSE, FALSE, NULL), -(500, 'Card', 11, 1, TIMESTAMP WITH TIME ZONE '2022-12-29 10:30:04.231+00', SYSTEM_COMBINE_CLOB(630), FALSE, FALSE, NULL), -(501, 'Card', 31, 1, TIMESTAMP WITH TIME ZONE '2022-12-29 10:31:02.445+00', SYSTEM_COMBINE_CLOB(631), FALSE, FALSE, NULL), -(502, 'Card', 1, 1, TIMESTAMP WITH TIME ZONE '2022-12-29 10:31:53.665+00', SYSTEM_COMBINE_CLOB(632), FALSE, FALSE, NULL), +(499, 'Card', 12, 1, TIMESTAMP WITH TIME ZONE '2022-12-29 10:29:03.007+00', SYSTEM_COMBINE_CLOB(630), FALSE, FALSE, NULL), +(500, 'Card', 11, 1, TIMESTAMP WITH TIME ZONE '2022-12-29 10:30:04.231+00', SYSTEM_COMBINE_CLOB(631), FALSE, FALSE, NULL), +(501, 'Card', 31, 1, TIMESTAMP WITH TIME ZONE '2022-12-29 10:31:02.445+00', SYSTEM_COMBINE_CLOB(632), FALSE, FALSE, NULL), +(502, 'Card', 1, 1, TIMESTAMP WITH TIME ZONE '2022-12-29 10:31:53.665+00', SYSTEM_COMBINE_CLOB(633), FALSE, FALSE, NULL), (503, 'Card', 10, 1, TIMESTAMP WITH TIME ZONE '2022-12-29 10:32:36.044+00', '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Total Registrations","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterGender":{"id":"053e22d6-e6e4-b616-8a72-cd33a1476315","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"cda8c18e-0863-d59e-4846-e6622917d67e","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"65249c37-7695-8cb3-8e07-7083a1b456a4","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"eefc749d-e0cc-e166-a295-d9c52e783c05","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}},"query":"[\n {$match: {\n $and: [\n {_id: {$ne: null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {$group: { \n _id: {}\n , totalCount: {$sum: NumberInt(1)}\n }} \n , {$project: { \n _id : NumberInt(0)\n , totalRegistrations: \"$totalCount\"\n }}\n]","collection":"registrations"},"database":3},"id":10,"parameter_mappings":[],"display":"scalar","entity_id":"BKDzBlQYMhO5wQWhVbytt","collection_preview":true,"visualization_settings":{},"is_write":false,"parameters":[{"id":"053e22d6-e6e4-b616-8a72-cd33a1476315","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"cda8c18e-0863-d59e-4846-e6622917d67e","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"65249c37-7695-8cb3-8e07-7083a1b456a4","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"eefc749d-e0cc-e166-a295-d9c52e783c05","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL), (504, 'Card', 8, 1, TIMESTAMP WITH TIME ZONE '2022-12-29 10:33:14.279+00', '{"description":"Those who registered after 1 year of birth","archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":5,"query_type":"native","name":"Delayed Birth Registration","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n \"childsAgeInDaysAtDeclaration\": {\n \"$gte\": 365\n }\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n \"childsAgeInDaysAtDeclaration\": {\n \"$gte\": 365\n }\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , { \"$group\": {\n \"_id\": {\n \"gender\": \"$gender\"\n },\n \"count\": {\n \"$sum\": 1\n },\n }\n },\n { \"$project\": {\n \"_id\": false,\n \"gender\": \"$_id.gender\",\n \"count\": true\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Gender'': \"$allInfo.gender\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }}\n]","template-tags":{"filterGender":{"id":"3bffb6db-9e95-50fa-12fd-dda03857f422","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"85e9c397-723a-65c1-df67-4172fbdeea93","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"99ca6028-9f6d-7549-0ab6-660eba6323ef","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"1e669469-e672-c46e-49f4-30efe8cd1191","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}}},"type":"native"},"id":8,"parameter_mappings":[],"display":"bar","entity_id":"MkeDZBr_8kshqVAdiACxv","collection_preview":true,"visualization_settings":{"table.pivot_column":"Gender","table.cell_column":"Count","graph.dimensions":["Gender"],"graph.show_values":true,"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"3bffb6db-9e95-50fa-12fd-dda03857f422","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"85e9c397-723a-65c1-df67-4172fbdeea93","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"99ca6028-9f6d-7549-0ab6-660eba6323ef","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"1e669469-e672-c46e-49f4-30efe8cd1191","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL); INSERT INTO "PUBLIC"."REVISION" VALUES @@ -175262,18 +175272,18 @@ INSERT INTO "PUBLIC"."REVISION" VALUES INSERT INTO "PUBLIC"."REVISION" VALUES (507, 'Card', 6, 1, TIMESTAMP WITH TIME ZONE '2022-12-29 10:34:51.02+00', '{"description":"Those who were registered within 30 days of birth","archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":5,"query_type":"native","name":"Within legally stipulated period","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"template-tags":{"filterGender":{"id":"17df9448-b493-4181-215b-67b245b002a0","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"ed14456d-7b78-9730-8a38-240630157985","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"5bd8f8bc-c416-c538-b008-7d0e52275d91","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"8dfa9d7c-05f3-d445-6a7d-03582599bb28","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}},"collection":"registrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n \"childsAgeInDaysAtDeclaration\": {\n \"$lte\": 30\n }\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n \"childsAgeInDaysAtDeclaration\": {\n \"$lte\": 30\n }\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , { \"$group\": {\n \"_id\": {\n \"gender\": \"$gender\"\n },\n \"count\": {\n \"$sum\": 1\n },\n }\n },\n { \"$project\": {\n \"_id\": false,\n \"gender\": \"$_id.gender\",\n \"count\": true\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Gender'': \"$allInfo.gender\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }}\n]"},"type":"native"},"id":6,"parameter_mappings":[],"display":"bar","entity_id":"lyVkSLROwXmq-KGRr307r","collection_preview":true,"visualization_settings":{"table.pivot_column":"Gender","table.cell_column":"Count","graph.dimensions":["Gender"],"graph.show_values":true,"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"17df9448-b493-4181-215b-67b245b002a0","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"ed14456d-7b78-9730-8a38-240630157985","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"5bd8f8bc-c416-c538-b008-7d0e52275d91","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"8dfa9d7c-05f3-d445-6a7d-03582599bb28","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL), (508, 'Card', 27, 1, TIMESTAMP WITH TIME ZONE '2022-12-29 10:35:53.991+00', '{"description":null,"archived":false,"collection_position":null,"table_id":70,"database_id":3,"enable_embedding":false,"collection_id":9,"query_type":"query","name":"Place of birth","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"query":{"source-table":70,"expressions":{"PlaceOfBirth":["case",[[["=",["field",668,null],"BUS"],"Bus"],[["=",["field",668,null],"CAR_TAXI"],"Taxi"],[["=",["field",668,null],"HEALTH_FACILITY"],"Health Facility"],[["=",["field",668,null],"MATERNITY_HOME"],"Maternity Home"],[["=",["field",668,null],"PRIVATE_HOME"],"Private Home"],[["=",["field",668,null],"TRADITIONAL_DOCTORS"],"Traditional Doctors"]]]},"filter":["and",["=",["field",666,null],"Birth"],["time-interval",["field",677,null],"current","year"]],"aggregation":[["count"]],"breakout":[["expression","PlaceOfBirth"]]},"type":"query"},"id":27,"parameter_mappings":[],"display":"pie","entity_id":"AfR2OybIvG3i-a1qt-k0u","collection_preview":true,"visualization_settings":{},"is_write":false,"parameters":[],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(633, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":7,"query_type":"native","name":"Completeness Rate","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterEvent":{"id":"545955ab-f6ec-0de1-3f4e-ce9e50e91e82","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"63587bed-9b53-1d2a-5396-317e766e7de8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",659,null],"widget-type":"string/=","default":null},"filterGender":{"id":"92951985-5ced-b397-b9b6-ea5a04ef29d5","name":"filterGender","display-name":"Filtergender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterDate":{"id":"fcf90832-e5e8-d1f2-86bf-4601339adab5","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",658,null],"widget-type":"date/month-year","default":null}},"query":"[\n {\n $addFields: {\n date: { $dateFromParts: {\n year: { $add: [ { $year: \"$date\" }, 1 ] },\n month: { $month: \"$date\" },\n day: { $dayOfMonth: \"$date\" }\n }\n }\n }\n },\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterDate }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n ]\n }}, \n {\n $lookup: {\n from: \"analyticsRegistrations\",\n let: { name: \"$name\", date: {$dateToString: {date: \"$date\" }}},\n as: \"registrations\",\n pipeline: [\n {$group: {\n _id: { \n date: { $dateToString: { format: \"%Y-%m-%d\", date: \"$createdAt\" } }, \n stateName: \"$stateName\"\n },\n total: { $sum: 1 }\n }},\n {$addFields:{stateName: ''$_id.stateName'', date: {$dateToString: { date: { $dateFromString: { dateString: ''$_id.date''}}}}}},\n {\n $match:\n {\n $expr:\n {\n $and:\n [\n { $eq: [ \"$date\", \"$$date\" ] },\n { $eq: [ \"$stateName\", \"$$name\" ] }\n ]\n }\n }\n } \n ] \n }\n },\n\n {$addFields: {\n totalRegistrations: {\n $reduce: {\n input: \"$registrations\",\n initialValue: 0,\n in: { $add: [ \"$$value\", \"$$this.total\" ] }\n } \n \n } \n }},\n{$addFields: {estimate: ''$estimate.estimatedNumberOfBirths''}},\n {\n $group: {\n _id: null,\n totalRegistrations: { $sum: ''$totalRegistrations'' },\n estimate: { $sum:''$estimatedNumberOfBirths'' }\n }\n },\n {$addFields: {\n percentage: {\n $cond: {\n if: { $eq: [ \"$totalRegistrations\", 0 ] },\n then: 0,\n else: {\n $cond: {\n if: { $eq: [ \"$estimate\", 0 ] },\n then: 0,\n else: {$divide: [''$totalRegistrations'', ''$estimate'']}\n }\n }\n }\n } \n }}, \n {$project: {_id: false, percentage: ''$percentage''}} \n]","collection":"populationEstimatesPerDay"},"database":3},"id":13,"parameter_mappings":[],"display":"gauge","entity_id":"RUK20xOu8Io0PvT4a332Q","collection_preview":true,"visualization_settings":{"tabl', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(633, 1, 'e.pivot_column":"percentage","table.cell_column":"foo","gauge.segments":[{"min":0,"max":0.25,"color":"#ED6E6E","label":""},{"min":0.25,"max":0.75,"color":"#F9CF48","label":""},{"min":0.75,"max":1,"color":"#84BB4C","label":""}],"column_settings":{"[\"name\",\"percentage\"]":{"scale":100,"suffix":" %"}}},"is_write":false,"parameters":[{"id":"545955ab-f6ec-0de1-3f4e-ce9e50e91e82","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"63587bed-9b53-1d2a-5396-317e766e7de8","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"92951985-5ced-b397-b9b6-ea5a04ef29d5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Filtergender","slug":"filterGender"},{"id":"fcf90832-e5e8-d1f2-86bf-4601339adab5","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(634, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":7,"query_type":"native","name":"Completeness Rate","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterEvent":{"id":"545955ab-f6ec-0de1-3f4e-ce9e50e91e82","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"63587bed-9b53-1d2a-5396-317e766e7de8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",659,null],"widget-type":"string/=","default":null},"filterGender":{"id":"92951985-5ced-b397-b9b6-ea5a04ef29d5","name":"filterGender","display-name":"Filtergender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterDate":{"id":"fcf90832-e5e8-d1f2-86bf-4601339adab5","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",658,null],"widget-type":"date/month-year","default":null}},"query":"[\n {\n $addFields: {\n date: { $dateFromParts: {\n year: { $add: [ { $year: \"$date\" }, 1 ] },\n month: { $month: \"$date\" },\n day: { $dayOfMonth: \"$date\" }\n }\n }\n }\n },\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterDate }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n ]\n }}, \n {\n $lookup: {\n from: \"registrations\",\n let: { name: \"$name\", date: {$dateToString: {date: \"$date\" }}},\n as: \"registrations\",\n pipeline: [\n {$group: {\n _id: { \n date: { $dateToString: { format: \"%Y-%m-%d\", date: \"$createdAt\" } }, \n stateName: \"$stateName\"\n },\n total: { $sum: 1 }\n }},\n {$addFields:{stateName: ''$_id.stateName'', date: {$dateToString: { date: { $dateFromString: { dateString: ''$_id.date''}}}}}},\n {\n $match:\n {\n $expr:\n {\n $and:\n [\n { $eq: [ \"$date\", \"$$date\" ] },\n { $eq: [ \"$stateName\", \"$$name\" ] }\n ]\n }\n }\n } \n ] \n }\n },\n\n {$addFields: {\n totalRegistrations: {\n $reduce: {\n input: \"$registrations\",\n initialValue: 0,\n in: { $add: [ \"$$value\", \"$$this.total\" ] }\n } \n \n } \n }},\n{$addFields: {estimate: ''$estimate.estimatedNumberOfBirths''}},\n {\n $group: {\n _id: null,\n totalRegistrations: { $sum: ''$totalRegistrations'' },\n estimate: { $sum:''$estimatedNumberOfBirths'' }\n }\n },\n {$addFields: {\n percentage: {\n $cond: {\n if: { $eq: [ \"$totalRegistrations\", 0 ] },\n then: 0,\n else: {\n $cond: {\n if: { $eq: [ \"$estimate\", 0 ] },\n then: 0,\n else: {$divide: [''$totalRegistrations'', ''$estimate'']}\n }\n }\n }\n } \n }}, \n {$project: {_id: false, percentage: ''$percentage''}} \n]","collection":"populationEstimatesPerDay"},"database":3},"id":13,"parameter_mappings":[],"display":"gauge","entity_id":"RUK20xOu8Io0PvT4a332Q","collection_preview":true,"visualization_settings":{"table.pivot_c', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(634, 1, 'olumn":"percentage","table.cell_column":"foo","gauge.segments":[{"min":0,"max":0.25,"color":"#ED6E6E","label":""},{"min":0.25,"max":0.75,"color":"#F9CF48","label":""},{"min":0.75,"max":1,"color":"#84BB4C","label":""}],"column_settings":{"[\"name\",\"percentage\"]":{"scale":100,"suffix":" %"}}},"is_write":false,"parameters":[{"id":"545955ab-f6ec-0de1-3f4e-ce9e50e91e82","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"63587bed-9b53-1d2a-5396-317e766e7de8","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"92951985-5ced-b397-b9b6-ea5a04ef29d5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Filtergender","slug":"filterGender"},{"id":"fcf90832-e5e8-d1f2-86bf-4601339adab5","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(635, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":7,"query_type":"native","name":"Completeness Rate","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterEvent":{"id":"545955ab-f6ec-0de1-3f4e-ce9e50e91e82","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"63587bed-9b53-1d2a-5396-317e766e7de8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",659,null],"widget-type":"string/=","default":null},"filterGender":{"id":"92951985-5ced-b397-b9b6-ea5a04ef29d5","name":"filterGender","display-name":"Filtergender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterDate":{"id":"fcf90832-e5e8-d1f2-86bf-4601339adab5","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",658,null],"widget-type":"date/month-year","default":null}},"query":"[\n {\n $addFields: {\n date: {\n $dateFromParts: {\n year: { $add: [{ $year: ''$date'' }, 1] },\n month: { $month: ''$date'' },\n day: { $dayOfMonth: ''$date'' }\n }\n }\n }\n },\n {\n $match: {\n $and: [\n { _id: { $ne: null } }\n [[ {{ filterGender }} ]]\n [[ {{ filterDate }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n ]\n }\n },\n {\n $lookup: {\n from: ''registrations'',\n let: {\n name: ''$name'',\n date: { $dateToString: { format: ''%Y-%m-%d'', date: ''$date'' } }\n },\n as: ''registrations'',\n pipeline: [\n {\n $addFields: {\n date: { $dateToString: { format: ''%Y-%m-%d'', date: ''$createdAt'' } }\n }\n },\n {\n $match: {\n $expr: {\n $and: [\n { $eq: [''$date'', ''$$date''] },\n { $eq: [''$stateName'', ''$$name''] }\n ]\n }\n }\n },\n {\n $group: {\n _id: {\n date: {\n $dateToString: { format: ''%Y-%m-%d'', date: ''$createdAt'' }\n },\n stateName: ''$stateName''\n },\n total: { $sum: 1 }\n }\n },\n { $addFields: { stateName: ''$_id.stateName'' } }\n ]\n }\n },\n\n {\n $addFields: {\n totalRegistrations: {\n $reduce: {\n input: ''$registrations'',\n initialValue: 0,\n in: { $add: [''$$value'', ''$$this.total''] }\n }\n }\n }\n },\n { $addFields: { estimate: ''$estimate.estimatedNumberOfBirths'' } },\n {\n $group: {\n _id: null,\n totalRegistrations: { $sum: ''$totalRegistrations'' },\n estimate: { $sum: ''$estimatedNumberOfBirths'' }\n }\n },\n {\n $addFields: {\n percentage: {\n $cond: {\n if: { $eq: [''$totalRegistrations'', 0] },\n then: 0,\n else: {\n $cond: {\n if: { $eq: [''$estimate'', 0] },\n then: 0,\n else: { $divide: [''$totalRegistrations'', ''$estimate''] }\n }\n }\n }\n }\n }\n },\n { $project: { _id: false, percentage: ''$percentage'' } }\n]\n","collection":"populationEstimatesPerDay"},"database":3},"id":13,"parameter_mappings":[],"display":"gauge","entity_id":"RUK20xOu8Io0PvT4a332Q","collection_preview":true,"visualization_settings":{"table.pivot_column":"percentage","table.cell_column":"foo","gauge.segments":[{"min":0,"max":0.25,"color":"#ED6E6E","label":""},{"min":0.25,"max":0.75,"color":"#F9CF48","label":""},{"min":0.75,"max":1,"color":"#84BB4C","label":""}],"column_settings":{"[\"name\",\"percentage\"]":{"scale":100,"suffix":" %"}}},"is_write":false,"parameters":[{"id":"545955ab-f6ec-0de1-3f4e-ce9e50e91e82","type":"string/=","target":["dimension",["template-tag","filterEvent"]]', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(635, 1, ',"name":"Event","slug":"filterEvent"},{"id":"63587bed-9b53-1d2a-5396-317e766e7de8","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"92951985-5ced-b397-b9b6-ea5a04ef29d5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Filtergender","slug":"filterGender"},{"id":"fcf90832-e5e8-d1f2-86bf-4601339adab5","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(634, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":7,"query_type":"native","name":"Completeness Rate","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterEvent":{"id":"545955ab-f6ec-0de1-3f4e-ce9e50e91e82","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"63587bed-9b53-1d2a-5396-317e766e7de8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",659,null],"widget-type":"string/=","default":null},"filterGender":{"id":"92951985-5ced-b397-b9b6-ea5a04ef29d5","name":"filterGender","display-name":"Filtergender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterDate":{"id":"fcf90832-e5e8-d1f2-86bf-4601339adab5","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",658,null],"widget-type":"date/month-year","default":null}},"query":"[\n {\n $addFields: {\n date: { $dateFromParts: {\n year: { $add: [ { $year: \"$date\" }, 1 ] },\n month: { $month: \"$date\" },\n day: { $dayOfMonth: \"$date\" }\n }\n }\n }\n },\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterDate }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n ]\n }}, \n {\n $lookup: {\n from: \"analyticsRegistrations\",\n let: { name: \"$name\", date: {$dateToString: {date: \"$date\" }}},\n as: \"registrations\",\n pipeline: [\n {$group: {\n _id: { \n date: { $dateToString: { format: \"%Y-%m-%d\", date: \"$createdAt\" } }, \n stateName: \"$stateName\"\n },\n total: { $sum: 1 }\n }},\n {$addFields:{stateName: ''$_id.stateName'', date: {$dateToString: { date: { $dateFromString: { dateString: ''$_id.date''}}}}}},\n {\n $match:\n {\n $expr:\n {\n $and:\n [\n { $eq: [ \"$date\", \"$$date\" ] },\n { $eq: [ \"$stateName\", \"$$name\" ] }\n ]\n }\n }\n } \n ] \n }\n },\n\n {$addFields: {\n totalRegistrations: {\n $reduce: {\n input: \"$registrations\",\n initialValue: 0,\n in: { $add: [ \"$$value\", \"$$this.total\" ] }\n } \n \n } \n }},\n{$addFields: {estimate: ''$estimate.estimatedNumberOfBirths''}},\n {\n $group: {\n _id: null,\n totalRegistrations: { $sum: ''$totalRegistrations'' },\n estimate: { $sum:''$estimatedNumberOfBirths'' }\n }\n },\n {$addFields: {\n percentage: {\n $cond: {\n if: { $eq: [ \"$totalRegistrations\", 0 ] },\n then: 0,\n else: {\n $cond: {\n if: { $eq: [ \"$estimate\", 0 ] },\n then: 0,\n else: {$divide: [''$totalRegistrations'', ''$estimate'']}\n }\n }\n }\n } \n }}, \n {$project: {_id: false, percentage: ''$percentage''}} \n]","collection":"populationEstimatesPerDay"},"database":3},"id":13,"parameter_mappings":[],"display":"gauge","entity_id":"RUK20xOu8Io0PvT4a332Q","collection_preview":true,"visualization_settings":{"tabl', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(634, 1, 'e.pivot_column":"percentage","table.cell_column":"foo","gauge.segments":[{"min":0,"max":0.25,"color":"#ED6E6E","label":""},{"min":0.25,"max":0.75,"color":"#F9CF48","label":""},{"min":0.75,"max":1,"color":"#84BB4C","label":""}],"column_settings":{"[\"name\",\"percentage\"]":{"scale":100,"suffix":" %"}}},"is_write":false,"parameters":[{"id":"545955ab-f6ec-0de1-3f4e-ce9e50e91e82","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"63587bed-9b53-1d2a-5396-317e766e7de8","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"92951985-5ced-b397-b9b6-ea5a04ef29d5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Filtergender","slug":"filterGender"},{"id":"fcf90832-e5e8-d1f2-86bf-4601339adab5","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(635, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":7,"query_type":"native","name":"Completeness Rate","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterEvent":{"id":"545955ab-f6ec-0de1-3f4e-ce9e50e91e82","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"63587bed-9b53-1d2a-5396-317e766e7de8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",659,null],"widget-type":"string/=","default":null},"filterGender":{"id":"92951985-5ced-b397-b9b6-ea5a04ef29d5","name":"filterGender","display-name":"Filtergender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterDate":{"id":"fcf90832-e5e8-d1f2-86bf-4601339adab5","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",658,null],"widget-type":"date/month-year","default":null}},"query":"[\n {\n $addFields: {\n date: { $dateFromParts: {\n year: { $add: [ { $year: \"$date\" }, 1 ] },\n month: { $month: \"$date\" },\n day: { $dayOfMonth: \"$date\" }\n }\n }\n }\n },\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterDate }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n ]\n }}, \n {\n $lookup: {\n from: \"registrations\",\n let: { name: \"$name\", date: {$dateToString: {date: \"$date\" }}},\n as: \"registrations\",\n pipeline: [\n {$group: {\n _id: { \n date: { $dateToString: { format: \"%Y-%m-%d\", date: \"$createdAt\" } }, \n stateName: \"$stateName\"\n },\n total: { $sum: 1 }\n }},\n {$addFields:{stateName: ''$_id.stateName'', date: {$dateToString: { date: { $dateFromString: { dateString: ''$_id.date''}}}}}},\n {\n $match:\n {\n $expr:\n {\n $and:\n [\n { $eq: [ \"$date\", \"$$date\" ] },\n { $eq: [ \"$stateName\", \"$$name\" ] }\n ]\n }\n }\n } \n ] \n }\n },\n\n {$addFields: {\n totalRegistrations: {\n $reduce: {\n input: \"$registrations\",\n initialValue: 0,\n in: { $add: [ \"$$value\", \"$$this.total\" ] }\n } \n \n } \n }},\n{$addFields: {estimate: ''$estimate.estimatedNumberOfBirths''}},\n {\n $group: {\n _id: null,\n totalRegistrations: { $sum: ''$totalRegistrations'' },\n estimate: { $sum:''$estimatedNumberOfBirths'' }\n }\n },\n {$addFields: {\n percentage: {\n $cond: {\n if: { $eq: [ \"$totalRegistrations\", 0 ] },\n then: 0,\n else: {\n $cond: {\n if: { $eq: [ \"$estimate\", 0 ] },\n then: 0,\n else: {$divide: [''$totalRegistrations'', ''$estimate'']}\n }\n }\n }\n } \n }}, \n {$project: {_id: false, percentage: ''$percentage''}} \n]","collection":"populationEstimatesPerDay"},"database":3},"id":13,"parameter_mappings":[],"display":"gauge","entity_id":"RUK20xOu8Io0PvT4a332Q","collection_preview":true,"visualization_settings":{"table.pivot_c', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(635, 1, 'olumn":"percentage","table.cell_column":"foo","gauge.segments":[{"min":0,"max":0.25,"color":"#ED6E6E","label":""},{"min":0.25,"max":0.75,"color":"#F9CF48","label":""},{"min":0.75,"max":1,"color":"#84BB4C","label":""}],"column_settings":{"[\"name\",\"percentage\"]":{"scale":100,"suffix":" %"}}},"is_write":false,"parameters":[{"id":"545955ab-f6ec-0de1-3f4e-ce9e50e91e82","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"63587bed-9b53-1d2a-5396-317e766e7de8","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"92951985-5ced-b397-b9b6-ea5a04ef29d5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Filtergender","slug":"filterGender"},{"id":"fcf90832-e5e8-d1f2-86bf-4601339adab5","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(636, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":7,"query_type":"native","name":"Completeness Rate","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterEvent":{"id":"545955ab-f6ec-0de1-3f4e-ce9e50e91e82","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"63587bed-9b53-1d2a-5396-317e766e7de8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",659,null],"widget-type":"string/=","default":null},"filterGender":{"id":"92951985-5ced-b397-b9b6-ea5a04ef29d5","name":"filterGender","display-name":"Filtergender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterDate":{"id":"fcf90832-e5e8-d1f2-86bf-4601339adab5","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",658,null],"widget-type":"date/month-year","default":null}},"query":"[\n {\n $addFields: {\n date: {\n $dateFromParts: {\n year: { $add: [{ $year: ''$date'' }, 1] },\n month: { $month: ''$date'' },\n day: { $dayOfMonth: ''$date'' }\n }\n }\n }\n },\n {\n $match: {\n $and: [\n { _id: { $ne: null } }\n [[ {{ filterGender }} ]]\n [[ {{ filterDate }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n ]\n }\n },\n {\n $lookup: {\n from: ''registrations'',\n let: {\n name: ''$name'',\n date: { $dateToString: { format: ''%Y-%m-%d'', date: ''$date'' } }\n },\n as: ''registrations'',\n pipeline: [\n {\n $addFields: {\n date: { $dateToString: { format: ''%Y-%m-%d'', date: ''$createdAt'' } }\n }\n },\n {\n $match: {\n $expr: {\n $and: [\n { $eq: [''$date'', ''$$date''] },\n { $eq: [''$stateName'', ''$$name''] }\n ]\n }\n }\n },\n {\n $group: {\n _id: {\n date: {\n $dateToString: { format: ''%Y-%m-%d'', date: ''$createdAt'' }\n },\n stateName: ''$stateName''\n },\n total: { $sum: 1 }\n }\n },\n { $addFields: { stateName: ''$_id.stateName'' } }\n ]\n }\n },\n\n {\n $addFields: {\n totalRegistrations: {\n $reduce: {\n input: ''$registrations'',\n initialValue: 0,\n in: { $add: [''$$value'', ''$$this.total''] }\n }\n }\n }\n },\n { $addFields: { estimate: ''$estimate.estimatedNumberOfBirths'' } },\n {\n $group: {\n _id: null,\n totalRegistrations: { $sum: ''$totalRegistrations'' },\n estimate: { $sum: ''$estimatedNumberOfBirths'' }\n }\n },\n {\n $addFields: {\n percentage: {\n $cond: {\n if: { $eq: [''$totalRegistrations'', 0] },\n then: 0,\n else: {\n $cond: {\n if: { $eq: [''$estimate'', 0] },\n then: 0,\n else: { $divide: [''$totalRegistrations'', ''$estimate''] }\n }\n }\n }\n }\n }\n },\n { $project: { _id: false, percentage: ''$percentage'' } }\n]\n","collection":"populationEstimatesPerDay"},"database":3},"id":13,"parameter_mappings":[],"display":"gauge","entity_id":"RUK20xOu8Io0PvT4a332Q","collection_preview":true,"visualization_settings":{"table.pivot_column":"percentage","table.cell_column":"foo","gauge.segments":[{"min":0,"max":0.25,"color":"#ED6E6E","label":""},{"min":0.25,"max":0.75,"color":"#F9CF48","label":""},{"min":0.75,"max":1,"color":"#84BB4C","label":""}],"column_settings":{"[\"name\",\"percentage\"]":{"scale":100,"suffix":" %"}}},"is_write":false,"parameters":[{"id":"545955ab-f6ec-0de1-3f4e-ce9e50e91e82","type":"string/=","target":["dimension",["template-tag","filterEvent"]]', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(636, 1, ',"name":"Event","slug":"filterEvent"},{"id":"63587bed-9b53-1d2a-5396-317e766e7de8","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"92951985-5ced-b397-b9b6-ea5a04ef29d5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Filtergender","slug":"filterGender"},{"id":"fcf90832-e5e8-d1f2-86bf-4601339adab5","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); INSERT INTO "PUBLIC"."REVISION" VALUES -(513, 'Card', 13, 1, TIMESTAMP WITH TIME ZONE '2022-12-29 11:13:45.011+00', SYSTEM_COMBINE_CLOB(633), FALSE, FALSE, NULL), +(513, 'Card', 13, 1, TIMESTAMP WITH TIME ZONE '2022-12-29 11:13:45.011+00', SYSTEM_COMBINE_CLOB(634), FALSE, FALSE, NULL), (520, 'Card', 16, 1, TIMESTAMP WITH TIME ZONE '2022-12-29 11:34:27.868+00', '{"description":null,"archived":false,"collection_position":null,"table_id":70,"database_id":3,"enable_embedding":false,"collection_id":null,"query_type":"query","name":"Total Registrations (without native query)","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"query","query":{"source-table":70,"aggregation":[["count"]]},"database":3},"id":16,"parameter_mappings":[],"display":"scalar","entity_id":"BOot6oon80vLb791-gzQb","collection_preview":true,"visualization_settings":{},"is_write":false,"parameters":[],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL), (521, 'Card', 14, 1, TIMESTAMP WITH TIME ZONE '2022-12-29 11:40:47.616+00', '{"description":null,"archived":false,"collection_position":null,"table_id":70,"database_id":3,"enable_embedding":false,"collection_id":null,"query_type":"query","name":"Registrations over time","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"query":{"source-table":70,"filter":["and",["=",["field",666,null],"Birth"],["time-interval",["field",677,null],"current","year"]],"aggregation":[["count"]],"breakout":[["field",677,{"temporal-unit":"day"}]]},"type":"query"},"id":14,"parameter_mappings":[],"display":"line","entity_id":"qNwCeJEl62KWFEc_8ueNS","collection_preview":true,"visualization_settings":{"graph.dimensions":["createdAt"],"graph.metrics":["count"]},"is_write":false,"parameters":[],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL), -(524, 'Card', 13, 1, TIMESTAMP WITH TIME ZONE '2022-12-29 11:45:15.943+00', SYSTEM_COMBINE_CLOB(634), FALSE, FALSE, NULL), -(525, 'Card', 13, 1, TIMESTAMP WITH TIME ZONE '2022-12-29 12:18:27.505+00', SYSTEM_COMBINE_CLOB(635), FALSE, FALSE, NULL), +(524, 'Card', 13, 1, TIMESTAMP WITH TIME ZONE '2022-12-29 11:45:15.943+00', SYSTEM_COMBINE_CLOB(635), FALSE, FALSE, NULL), +(525, 'Card', 13, 1, TIMESTAMP WITH TIME ZONE '2022-12-29 12:18:27.505+00', SYSTEM_COMBINE_CLOB(636), FALSE, FALSE, NULL), (526, 'Card', 13, 1, TIMESTAMP WITH TIME ZONE '2022-12-29 13:36:03.704+00', '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":7,"query_type":"native","name":"Completeness Rate","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterDate":{"id":"7e3afad2-42a4-9a14-5b31-682bb7d61ac2","name":"filterDate","display-name":"Filterdate","type":"text"},"filterState":{"id":"1f3f4237-bceb-1188-a732-80eea58169b8","name":"filterState","display-name":"Filterstate","type":"text"}},"query":"[\n {\n $group: {\n _id: {\n date: { $dateToString: { format: ''%Y-%m-%d'', date: ''$createdAt'' } },\n stateName: ''$stateName''\n },\n total: { $sum: 1 }\n }\n },\n { $addFields: { estimatedNumberOfBirths: 0, stateName: ''$_id.stateName'', date: {$dateFromString: {dateString: ''$_id.date'' } }}},\n { $unionWith: { coll: ''populationEstimatesPerDay'', pipeline: [{$addFields: {stateName: ''$name'', date: {\n $dateFromParts: {\n year: { $add: [{ $year: ''$date'' }, 1] },\n month: { $month: ''$date'' },\n day: { $dayOfMonth: ''$date'' }\n }\n }}}]}},\n\n{ $group: {\n _id: {\n date: ''$date'',\n stateName: ''$stateName''\n },\n totalRegistrations: { $sum: ''$total'' },\n estimate: { $sum: ''$estimatedNumberOfBirths'' }, \n }},\n {$addFields:{stateName: ''$_id.stateName'', date: ''$_id.date''}},\n {\n $match: {\n $and: [\n { _id: { $ne: null } }\n [[ {{ filterDate }} ]]\n [[ {{ filterState }} ]]\n ]\n }\n }, \n {\n $group: {\n _id: null,\n totalRegistrations: { $sum: ''$totalRegistrations'' },\n estimate: { $sum: ''$estimate'' }\n }\n }, \n {\n $addFields: {\n percentage: {\n $cond: {\n if: { $eq: [''$totalRegistrations'', 0] },\n then: 0,\n else: {\n $cond: {\n if: { $eq: [''$estimate'', 0] },\n then: 0,\n else: { $divide: [''$totalRegistrations'', ''$estimate''] }\n }\n }\n }\n }\n }\n },\n { $project: { _id: false, percentage: ''$percentage'' } } \n]","collection":"populationEstimatesPerDay"},"database":3},"id":13,"parameter_mappings":[],"display":"gauge","entity_id":"RUK20xOu8Io0PvT4a332Q","collection_preview":true,"visualization_settings":{"table.pivot_column":"percentage","table.cell_column":"foo","gauge.segments":[{"min":0,"max":0.25,"color":"#ED6E6E","label":""},{"min":0.25,"max":0.75,"color":"#F9CF48","label":""},{"min":0.75,"max":1,"color":"#84BB4C","label":""}],"column_settings":{"[\"name\",\"percentage\"]":{"scale":100,"suffix":" %"}}},"is_write":false,"parameters":[{"id":"7e3afad2-42a4-9a14-5b31-682bb7d61ac2","type":"category","target":["variable",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"},{"id":"1f3f4237-bceb-1188-a732-80eea58169b8","type":"category","target":["variable",["template-tag","filterState"]],"name":"Filterstate","slug":"filterState"}],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL); INSERT INTO "PUBLIC"."REVISION" VALUES (527, 'Card', 9, 1, TIMESTAMP WITH TIME ZONE '2022-12-29 13:40:19.524+00', '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":6,"query_type":"native","name":" Completeness Rates by State","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterDate":{"id":"1e69ed7b-8ae8-6cfe-0c1c-ae93f5048bee","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null},"filterState":{"id":"f9f00080-004f-1c25-e71b-af69fb2fc1b1","name":"filterState","display-name":"Filterstate","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null}},"query":"[\n {\n $group: {\n _id: {\n date: { $dateToString: { format: ''%Y-%m-%d'', date: ''$createdAt'' } },\n stateName: ''$stateName''\n },\n total: { $sum: 1 }\n }\n },\n { $addFields: { estimatedNumberOfBirths: 0, stateName: ''$_id.stateName'', date: {$dateFromString: {dateString: ''$_id.date'' } }}},\n { $unionWith: { coll: ''populationEstimatesPerDay'', pipeline: [{$addFields: {stateName: ''$name'', date: {\n $dateFromParts: {\n year: { $add: [{ $year: ''$date'' }, 1] },\n month: { $month: ''$date'' },\n day: { $dayOfMonth: ''$date'' }\n }\n }}}]}},\n\n{ $group: {\n _id: {\n date: ''$date'',\n stateName: ''$stateName''\n },\n totalRegistrations: { $sum: ''$total'' },\n estimate: { $sum: ''$estimatedNumberOfBirths'' }, \n }},\n {$addFields:{stateName: ''$_id.stateName'', date: ''$_id.date''}},\n{\n $match: {\n $and: [\n { _id: { $ne: null } }\n [[ {{ filterDate }} ]]\n [[ {{ filterState }} ]]\n ]\n }\n}, \n{\n $group: {\n _id: {name: \"$stateName\"},\n totalRegistrations: { $sum: ''$totalRegistrations'' },\n estimate: { $sum: ''$estimate'' }\n }\n}, \n{$addFields: {\n percentage: {\n $cond: {\n if: { $eq: [ \"$totalRegistrations\", 0 ] },\n then: 0,\n else: {\n $cond: {\n if: { $eq: [ \"$estimate\", 0 ] },\n then: 0,\n else: {$divide: [''$totalRegistrations'', ''$estimate'']}\n }\n }\n }\n} \n}}, \n{$project: {\n _id: false,\n State: ''$_id.name'',\n ''Completeness Rate'': {$round: [{$multiply: [''$percentage'', 100] }, 0]}\n}} \n]","collection":"populationEstimatesPerDay"},"database":3},"id":9,"parameter_mappings":[],"display":"table","entity_id":"9t73rF7ixsw9EVOWpx7ab","collection_preview":true,"visualization_settings":{"map.type":"region","map.region":"910cd1de-9dbd-c36c-96bd-39d55ad9b84f","map.metric":"percentage","map.dimension":"state","table.pivot_column":"Completeness Rate","table.cell_column":"State"},"is_write":false,"parameters":[{"id":"1e69ed7b-8ae8-6cfe-0c1c-ae93f5048bee","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"},{"id":"f9f00080-004f-1c25-e71b-af69fb2fc1b1","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"Filterstate","slug":"filterState"}],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL), @@ -175288,129 +175298,129 @@ INSERT INTO "PUBLIC"."REVISION" VALUES (540, 'Card', 14, 1, TIMESTAMP WITH TIME ZONE '2023-01-24 10:10:26.732+00', '{"description":null,"archived":false,"collection_position":null,"table_id":70,"database_id":3,"enable_embedding":false,"collection_id":null,"query_type":"query","name":"Registrations over time","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"query":{"aggregation":[["count"]],"breakout":[["field",677,{"temporal-unit":"day"}]],"filter":["=",["field",666,null],"Birth"],"source-table":70},"type":"query"},"id":14,"parameter_mappings":[],"display":"line","entity_id":"qNwCeJEl62KWFEc_8ueNS","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_trendline":false,"graph.show_values":false,"graph.x_axis.axis_enabled":true,"graph.x_axis.title_text":"Over Time","graph.metrics":["count"],"column_settings":{"[\"ref\",[\"field\",677,null]]":{"date_abbreviate":true}},"graph.x_axis.scale":"timeseries","graph.dimensions":["createdAt"]},"is_write":false,"parameters":[],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL), (541, 'Card', 32, 1, TIMESTAMP WITH TIME ZONE '2023-01-24 10:30:25.481+00', '{"description":null,"archived":false,"collection_position":null,"table_id":70,"database_id":3,"enable_embedding":false,"collection_id":18,"query_type":"query","name":"Registrations by State","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"query":{"source-table":70,"aggregation":[["count"]],"breakout":[["field",671,null]],"order-by":[["desc",["aggregation",0,null]]],"limit":10},"type":"query"},"id":32,"parameter_mappings":[],"display":"row","entity_id":"Ja4C9jmYDwEnYTid4pLzA","collection_preview":true,"visualization_settings":{"map.type":"region","map.region":"us_states","graph.dimensions":["stateName"],"graph.metrics":["count"]},"is_write":false,"parameters":[],"dataset":false,"public_uuid":null}', FALSE, TRUE, NULL), (542, 'Card', 9, 1, TIMESTAMP WITH TIME ZONE '2023-01-24 10:39:47.887+00', '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":6,"query_type":"native","name":" Completeness Rates by State (%)","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {\n $group: {\n _id: {\n date: { $dateToString: { format: ''%Y-%m-%d'', date: ''$createdAt'' } },\n stateName: ''$stateName''\n },\n total: { $sum: 1 }\n }\n },\n { $addFields: { estimatedNumberOfBirths: 0, stateName: ''$_id.stateName'', date: {$dateFromString: {dateString: ''$_id.date'' } }}},\n { $unionWith: { coll: ''populationEstimatesPerDay'', pipeline: [{$addFields: {stateName: ''$name'', date: {\n $dateFromParts: {\n year: { $add: [{ $year: ''$date'' }, 1] },\n month: { $month: ''$date'' },\n day: { $dayOfMonth: ''$date'' }\n }\n }}}]}},\n\n{ $group: {\n _id: {\n date: ''$date'',\n stateName: ''$stateName''\n },\n totalRegistrations: { $sum: ''$total'' },\n estimate: { $sum: ''$estimatedNumberOfBirths'' }, \n }},\n {$addFields:{stateName: ''$_id.stateName'', date: ''$_id.date''}},\n{\n $match: {\n $and: [\n { _id: { $ne: null } }\n [[ {{ filterDate }} ]]\n [[ {{ filterState }} ]]\n ]\n }\n}, \n{\n $group: {\n _id: {name: \"$stateName\"},\n totalRegistrations: { $sum: ''$totalRegistrations'' },\n estimate: { $sum: ''$estimate'' }\n }\n}, \n{$addFields: {\n percentage: {\n $cond: {\n if: { $eq: [ \"$totalRegistrations\", 0 ] },\n then: 0,\n else: {\n $cond: {\n if: { $eq: [ \"$estimate\", 0 ] },\n then: 0,\n else: {$divide: [''$totalRegistrations'', ''$estimate'']}\n }\n }\n }\n} \n}}, \n{$project: {\n _id: false,\n State: ''$_id.name'',\n ''Completeness Rate'': {$round: [{$multiply: [''$percentage'', 100] }, 0]}\n}} \n]","template-tags":{"filterDate":{"id":"1e69ed7b-8ae8-6cfe-0c1c-ae93f5048bee","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",658,null],"widget-type":"date/month-year","default":null},"filterState":{"id":"f9f00080-004f-1c25-e71b-af69fb2fc1b1","name":"filterState","display-name":"Filterstate","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null}}},"type":"native"},"id":9,"parameter_mappings":[],"display":"map","entity_id":"9t73rF7ixsw9EVOWpx7ab","collection_preview":true,"visualization_settings":{"map.type":"region","map.region":"910cd1de-9dbd-c36c-96bd-39d55ad9b84f","map.metric":"percentage","map.dimension":"state","table.pivot_column":"Completeness Rate","table.cell_column":"State"},"is_write":false,"parameters":[{"id":"1e69ed7b-8ae8-6cfe-0c1c-ae93f5048bee","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"},{"id":"f9f00080-004f-1c25-e71b-af69fb2fc1b1","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"Filterstate","slug":"filterState"}],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(636, 0, '{"description":"","archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Leaderboard of Registrars","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterGender":{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"practitionerName\": \"$practitionerName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"practitionerName\": \"$_id.practitionerName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"practitionerName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Registrar Name'': \"$allInfo.practitionerName\"\n , ''Registrations'': \"$allInfo.count\"\n }},\n {\n $limit: 10\n }\n]","collection":"registrations"},"database":3},"id":12,"parameter_mappings":[],"display":"row","entity_id":"VxeUMjNq8eLaHweLGUvYF","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.cell_column":"Percentage","graph.series_order_dimension":null,"graph.x_axis.title_text":"Registrars","graph.metrics":["Registrations"],"graph.label_value_formatting":"full","graph.series_order":null,"table.pivot_column":"Registrations","series_settings":{"Registrations":{"color":"#509EE3"}},"graph.dimensions":["Registrar Name"],"stackable.stack_type":null},"is_write":false,"parameters":[{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"fi', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(636, 1, 'lterState"},{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(637, 0, '{"description":"","archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Leaderboard of Registrars","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"practitionerName\": \"$practitionerName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"practitionerName\": \"$_id.practitionerName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"practitionerName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Registrar Name'': \"$allInfo.practitionerName\"\n , ''Registrations'': \"$allInfo.count\"\n }},\n {\n $limit: 10\n }\n]","template-tags":{"filterGender":{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null}}},"type":"native"},"id":12,"parameter_mappings":[],"display":"row","entity_id":"VxeUMjNq8eLaHweLGUvYF","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.cell_column":"Percentage","graph.series_order_dimension":null,"graph.x_axis.title_text":"Registrars","graph.metrics":["Registrations"],"graph.label_value_formatting":"full","graph.series_order":null,"table.pivot_column":"Registrations","series_settings":{"Registrations":{"color":"#509EE3"}},"graph.dimensions":["Registrar Name"],"stackable.stack_type":null},"is_write":false,"parameters":[{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"f', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(637, 1, 'ilterState"},{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(637, 0, '{"description":"","archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Leaderboard of Registrars","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterGender":{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"practitionerName\": \"$practitionerName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"practitionerName\": \"$_id.practitionerName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"practitionerName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Registrar Name'': \"$allInfo.practitionerName\"\n , ''Registrations'': \"$allInfo.count\"\n }},\n {\n $limit: 10\n }\n]","collection":"registrations"},"database":3},"id":12,"parameter_mappings":[],"display":"row","entity_id":"VxeUMjNq8eLaHweLGUvYF","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.cell_column":"Percentage","graph.series_order_dimension":null,"graph.x_axis.title_text":"Registrars","graph.metrics":["Registrations"],"graph.label_value_formatting":"full","graph.series_order":null,"table.pivot_column":"Registrations","series_settings":{"Registrations":{"color":"#509EE3"}},"graph.dimensions":["Registrar Name"],"stackable.stack_type":null},"is_write":false,"parameters":[{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"fi', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(637, 1, 'lterState"},{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(638, 0, '{"description":"","archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Leaderboard of Registrars","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"practitionerName\": \"$practitionerName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"practitionerName\": \"$_id.practitionerName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"practitionerName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Registrar Name'': \"$allInfo.practitionerName\"\n , ''Registrations'': \"$allInfo.count\"\n }},\n {\n $limit: 10\n }\n]","template-tags":{"filterGender":{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null}}},"type":"native"},"id":12,"parameter_mappings":[],"display":"row","entity_id":"VxeUMjNq8eLaHweLGUvYF","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.cell_column":"Percentage","graph.series_order_dimension":null,"graph.x_axis.title_text":"Registrars","graph.metrics":["Registrations"],"graph.label_value_formatting":"full","graph.series_order":null,"table.pivot_column":"Registrations","series_settings":{"Registrations":{"color":"#509EE3"}},"graph.dimensions":["Registrar Name"],"stackable.stack_type":null},"is_write":false,"parameters":[{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"f', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(638, 1, 'ilterState"},{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); INSERT INTO "PUBLIC"."REVISION" VALUES -(543, 'Card', 12, 1, TIMESTAMP WITH TIME ZONE '2023-01-24 11:20:30.221+00', SYSTEM_COMBINE_CLOB(636), FALSE, FALSE, NULL), -(544, 'Card', 12, 1, TIMESTAMP WITH TIME ZONE '2023-01-24 11:20:41.435+00', SYSTEM_COMBINE_CLOB(637), FALSE, FALSE, NULL), +(543, 'Card', 12, 1, TIMESTAMP WITH TIME ZONE '2023-01-24 11:20:30.221+00', SYSTEM_COMBINE_CLOB(637), FALSE, FALSE, NULL), +(544, 'Card', 12, 1, TIMESTAMP WITH TIME ZONE '2023-01-24 11:20:41.435+00', SYSTEM_COMBINE_CLOB(638), FALSE, FALSE, NULL), (545, 'Card', 33, 1, TIMESTAMP WITH TIME ZONE '2023-01-24 11:31:41.215+00', '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":18,"query_type":"native","name":"Registrations by State","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"collection":"registrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"stateName\": \"$stateName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"stateName\": \"$_id.stateName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"stateName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''State Name'': \"$allInfo.stateName\"\n , ''Registrations'': \"$allInfo.count\"\n }},\n {\n $limit: 10\n }\n]","template-tags":{"filterDate":{"id":"f86f592c-2219-063c-8dc4-ca623c06a3ca","name":"filterDate","display-name":"Filterdate","type":"text"},"filterGender":{"id":"91f3014a-fb66-6724-708c-8e89f56e2779","name":"filterGender","display-name":"Filtergender","type":"text"},"filterEvent":{"id":"757a20cf-8f70-6857-0ed5-acb310688b3a","name":"filterEvent","display-name":"Filterevent","type":"text"},"filterState":{"id":"9384f1c8-b896-7ddb-6f32-204beba13dd3","name":"filterState","display-name":"Filterstate","type":"text"},"filterOffice":{"id":"58ab4870-ee4a-8362-2689-440572bb65de","name":"filterOffice","display-name":"Filteroffice","type":"text"}}},"database":3},"id":33,"parameter_mappings":[],"display":"row","entity_id":"g5hTQaT1d2p1OX0tU90WQ","collection_preview":true,"visualization_settings":{"graph.dimensions":["State Name"],"graph.metrics":["Registrations"]},"is_write":false,"parameters":[{"id":"f86f592c-2219-063c-8dc4-ca623c06a3ca","type":"category","target":["variable",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"},{"id":"91f3014a-fb66-6724-708c-8e89f56e2779","type":"category","target":["variable",["template-tag","filterGender"]],"name":"Filtergender","slug":"filterGender"},{"id":"757a20cf-8f70-6857-0ed5-acb310688b3a","type":"category","target":["variable",["template-tag","filterEvent"]],"name":"Filterevent","slug":"filterEvent"},{"id":"9384f1c8-b896-7ddb-6f32-204beba13dd3","type":"category","target":["variable",["template-tag","filterState"]],"name":"Filterstate","slug":"filterState"},{"id":"58ab4870-ee4a-8362-2689-440572bb65de","type":"category","target":["variable",["template-tag","filterOffice"]],"name":"Filteroffice","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', FALSE, TRUE, NULL); INSERT INTO "PUBLIC"."REVISION" VALUES (546, 'Card', 32, 1, TIMESTAMP WITH TIME ZONE '2023-01-24 11:32:03.235+00', '{"description":null,"archived":true,"collection_position":null,"table_id":70,"database_id":3,"enable_embedding":false,"collection_id":18,"query_type":"query","name":"Registrations by State","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"query":{"source-table":70,"aggregation":[["count"]],"breakout":[["field",671,null]],"order-by":[["desc",["aggregation",0,null]]],"limit":10},"type":"query"},"id":32,"parameter_mappings":[],"display":"row","entity_id":"Ja4C9jmYDwEnYTid4pLzA","collection_preview":true,"visualization_settings":{"map.type":"region","map.region":"us_states","graph.dimensions":["stateName"],"graph.metrics":["count"]},"is_write":false,"parameters":[],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL), (547, 'Card', 33, 1, TIMESTAMP WITH TIME ZONE '2023-01-24 11:33:36.306+00', '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":18,"query_type":"native","name":"Registrations by State","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"template-tags":{"filterDate":{"id":"f86f592c-2219-063c-8dc4-ca623c06a3ca","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null},"filterGender":{"id":"91f3014a-fb66-6724-708c-8e89f56e2779","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"757a20cf-8f70-6857-0ed5-acb310688b3a","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":["Birth"]},"filterState":{"id":"9384f1c8-b896-7ddb-6f32-204beba13dd3","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"58ab4870-ee4a-8362-2689-440572bb65de","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"stateName\": \"$stateName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"stateName\": \"$_id.stateName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"stateName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''State Name'': \"$allInfo.stateName\"\n , ''Registrations'': \"$allInfo.count\"\n }},\n {\n $limit: 10\n }\n]","collection":"registrations"},"type":"native"},"id":33,"parameter_mappings":[],"display":"row","entity_id":"g5hTQaT1d2p1OX0tU90WQ","collection_preview":true,"visualization_settings":{"graph.dimensions":["State Name"],"graph.metrics":["Registrations"]},"is_write":false,"parameters":[{"id":"f86f592c-2219-063c-8dc4-ca623c06a3ca","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"91f3014a-fb66-6724-708c-8e89f56e2779","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"757a20cf-8f70-6857-0ed5-acb310688b3a","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent","default":["Birth"]},{"id":"9384f1c8-b896-7ddb-6f32-204beba13dd3","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"58ab4870-ee4a-8362-2689-440572bb65de","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(638, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":12,"query_type":"native","name":"Live births by age of Mother","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , mothersAge: ''$mothersAgeAtBirthOfChildInYears''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$gte: [''$mothersAge'', 9]}, {$lt: [''$mothersAge'', 15]}] }, then: ''09-14''},\n {case: {$and: [{$gte: [''$mothersAge'', 15]}, {$lt: [''$mothersAge'', 20]}] }, then: ''15-19''},\n {case: {$and: [{$gte: [''$mothersAge'', 20]}, {$lt: [''$mothersAge'', 25]}] }, then: ''20-24''},\n {case: {$and: [{$gte: [''$mothersAge'', 25]}, {$lt: [''$mothersAge'', 30]}] }, then: ''25-29''},\n {case: {$and: [{$gte: [''$mothersAge'', 30]}, {$lt: [''$mothersAge'', 35]}] }, then: ''30-34''},\n {case: {$and: [{$gte: [''$mothersAge'', 35]}, {$lt: [''$mothersAge'', 40]}] }, then: ''35-39''},\n {case: {$and: [{$gte: [''$mothersAge'', 40]}, {$lt: [''$mothersAge'', 45]}] }, then: ''40-44''},\n {case: {$and: [{$gte: [''$mothersAge'', 45]}, {$lt: [''$mothersAge'', 50]}] }, then: ''45-49''},\n {case: {$and: [{$gte: [''$mothersAge'', 50]}, {$lt: [''$mothersAge'', 55]}] }, then: ''50-54''},\n {case: {$and: [{$gte: [''$mothersAge'', 55]}, {$lt: [''$mothersAge'', 60]}] }, then: ''55-59''},\n {case: {$and: [{$gte: [''$mothersAge'', 60]}] }, then: ''60+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Order\": 1\n }\n }\n]","template-tags":{"filterGender":{"id":"56559614-c685-9d81-d44b-a688fe5b103b","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","name":"filt', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(638, 1, 'erState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"8b07b619-ea79-a772-e83a-92f986ab040c","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null}}},"type":"native"},"id":20,"parameter_mappings":[],"display":"bar","entity_id":"PcnknQN2IYs_mJkwA8yRq","collection_preview":true,"visualization_settings":{"table.pivot_column":"Order","table.cell_column":"Count","graph.dimensions":["Order"],"graph.x_axis.title_text":"Age","graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"56559614-c685-9d81-d44b-a688fe5b103b","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"8b07b619-ea79-a772-e83a-92f986ab040c","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(639, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":14,"query_type":"native","name":"Live Births by Level of Education of Parent","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterGender":{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null}},"query":"[\n {$facet: {\n fathersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersAttainment\": \"$fathersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"KORANIC\"] },\n then: \"Koranic\"\n },\n {\n case: { $eq: [\"$_id\", \"MODERN\"] },\n then: \"Modern\"\n },\n {\n case: { $eq: [\"$_id\", \"HIGHER_SCHOOL\"] },\n then: \"Higher School\"\n },\n {\n case: { $eq: [\"$_id\", \"PRIMARY\"] },\n then: \"Primary\"\n },\n {\n case: { $eq: [\"$_id\", \"UNIVERSITY\"] },\n then: \"University\"\n },\n {\n case: { $eq: [\"$_id\", \"POLYTECNIC_NCE\"] },\n then: \"Polytecnic NCE\"\n },\n {\n case: { $eq: [\"$_id\", \"SECONDARY\"] },\n then: \"Secondary\"\n }\n ],\n default: \"Others\"\n }\n }\n , count: \"$count\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {$addFields: {\n attainment: \"fathersAttainment\"\n }}\n ]\n , mothersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersAttainment\": \"$mothersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\":', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(639, 1, ' {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"KORANIC\"] },\n then: \"Koranic\"\n },\n {\n case: { $eq: [\"$_id\", \"MODERN\"] },\n then: \"Modern\"\n },\n {\n case: { $eq: [\"$_id\", \"HIGHER_SCHOOL\"] },\n then: \"Higher School\"\n },\n {\n case: { $eq: [\"$_id\", \"PRIMARY\"] },\n then: \"Primary\"\n },\n {\n case: { $eq: [\"$_id\", \"UNIVERSITY\"] },\n then: \"University\"\n },\n {\n case: { $eq: [\"$_id\", \"POLYTECNIC_NCE\"] },\n then: \"Polytecnic NCE\"\n },\n {\n case: { $eq: [\"$_id\", \"SECONDARY\"] },\n then: \"Secondary\"\n }\n ],\n default: \"Others\"\n }\n }\n , count: \"$count\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {$addFields: {\n attainment: \"mothersAttainment\"\n }}\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersAttainment\", \"$mothersAttainment\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Educational Attainment'': \"$allInfo._id\"\n , ''Relationship'': \"$allInfo.attainment\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Relationship\": 1\n }\n }\n]\n","collection":"registrations"},"database":3},"id":21,"parameter_mappings":[],"display":"bar","entity_id":"W6bdia0Vw-6PC1efnHIR4","collection_preview":true,"visualization_settings":{"graph.show_values":true,"pie.dimension":"Educational Attainment","graph.x_axis.axis_enabled":true,"graph.y_axis.auto_split":true,"graph.metrics":["Count"],"pie.metric":"Count","series_settings":{"mothersAttainment":{"title":"mother"},"fathersAttainment":{"title":"father"}},"graph.y_axis.auto_range":true,"graph.dimensions":["Educational Attainment","Relationship"]},"is_write":false,"parameters":[{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(640, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":18,"query_type":"native","name":"Registrations by State","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"template-tags":{"filterDate":{"id":"f86f592c-2219-063c-8dc4-ca623c06a3ca","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null},"filterGender":{"id":"91f3014a-fb66-6724-708c-8e89f56e2779","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"757a20cf-8f70-6857-0ed5-acb310688b3a","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":["Birth"]},"filterState":{"id":"9384f1c8-b896-7ddb-6f32-204beba13dd3","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"58ab4870-ee4a-8362-2689-440572bb65de","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"stateName\": \"$stateName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"stateName\": \"$_id.stateName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"stateName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''State Name'': \"$allInfo.stateName\"\n , ''Registrations'': \"$allInfo.count\"\n }},\n {\n $limit: 10\n }\n]","collection":"registrations"},"type":"native"},"id":33,"parameter_mappings":[],"display":"row","entity_id":"g5hTQaT1d2p1OX0tU90WQ","collection_preview":true,"visualization_settings":{"graph.dimensions":["State Name"],"graph.show_values":true,"graph.metrics":["Registrations"]},"is_write":false,"parameters":[{"id":"f86f592c-2219-063c-8dc4-ca623c06a3ca","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"91f3014a-fb66-6724-708c-8e89f56e2779","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"757a20cf-8f70-6857-0ed5-acb310688b3a","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent","default":["Birth"]},{"id":"9384f1c8-b896-7ddb-6f32-204beba13dd3","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"58ab4870-ee4a-8362-2689-440572bb65de","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":fa', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(640, 1, 'lse,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(641, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":10,"query_type":"native","name":"Literacy of parents","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {$facet: {\n fathersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersLiteracy\": \"$fathersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"fathersLiteracy\"\n }}\n ]\n ,mothersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersLiteracy\": \"$mothersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"mothersLiteracy\"\n }}\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersLiteracy\", \"$mothersLiteracy\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Category'': \"$allInfo._id\"\n , ''Literacy'': \"$allInfo.literacy\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Literacy\": 1\n }\n }\n]\n","template-tags":{"filterGender":{"id":"e8218caf-e2aa-573e-1776-02cffff42462","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"bf69e085-3c01-7924-5108-7151c85dc371","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"fi', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(641, 1, 'lterDate":{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null}}},"type":"native"},"id":18,"parameter_mappings":[],"display":"bar","entity_id":"eRSJUaHW6haiucK8BtpC_","collection_preview":true,"visualization_settings":{"graph.show_values":true,"graph.label_value_formatting":"auto","graph.dimensions":["Category","Literacy"],"series_settings":{"mothersLiteracy":{"title":"mother"},"fathersLiteracy":{"title":"father"}},"graph.x_axis.title_text":"Literacy","graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"e8218caf-e2aa-573e-1776-02cffff42462","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"bf69e085-3c01-7924-5108-7151c85dc371","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(642, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":10,"query_type":"native","name":"Literacy of parents","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {$facet: {\n fathersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersLiteracy\": \"$fathersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"fathersLiteracy\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n }\n ]\n ,mothersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersLiteracy\": \"$mothersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"mothersLiteracy\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n }\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersLiteracy\", \"$mothersLiteracy\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Category'': \"$allInfo._id\"\n , ''Literacy'': \"$allInfo.literacy\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Literacy\": 1\n }\n }\n]\n","template-tags":{"filterGender":{"id":"e8218caf-e2aa-573e-1776-02cffff42462","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"bf69e085-3c01-7924-5108-7151c85dc371","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","name":"filterOffice","', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(642, 1, 'display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null}}},"type":"native"},"id":18,"parameter_mappings":[],"display":"bar","entity_id":"eRSJUaHW6haiucK8BtpC_","collection_preview":true,"visualization_settings":{"graph.show_values":true,"graph.label_value_formatting":"auto","graph.dimensions":["Category","Literacy"],"series_settings":{"mothersLiteracy":{"title":"mother"},"fathersLiteracy":{"title":"father"}},"graph.x_axis.title_text":"Literacy","graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"e8218caf-e2aa-573e-1776-02cffff42462","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"bf69e085-3c01-7924-5108-7151c85dc371","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(643, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":10,"query_type":"native","name":"Literacy of parents","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterGender":{"id":"e8218caf-e2aa-573e-1776-02cffff42462","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"bf69e085-3c01-7924-5108-7151c85dc371","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null}},"query":"[\n {$facet: {\n fathersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersLiteracy\": \"$fathersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"fathersLiteracy\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n }\n ]\n ,mothersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersLiteracy\": \"$mothersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"mothersLiteracy\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n }\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersLiteracy\", \"$mothersLiteracy\" ]\n }\n }\', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(643, 1, 'n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Category'': \"$allInfo._id\"\n , ''Literacy'': \"$allInfo.literacy\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Literacy\": 1\n }\n }\n]\n","collection":"registrations"},"database":3},"id":18,"parameter_mappings":[],"display":"bar","entity_id":"eRSJUaHW6haiucK8BtpC_","collection_preview":true,"visualization_settings":{"graph.show_values":true,"graph.label_value_formatting":"auto","graph.dimensions":["Category","Literacy"],"series_settings":{"mothersLiteracy":{"title":"mother"},"fathersLiteracy":{"title":"father"}},"graph.x_axis.title_text":"Literacy","graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"e8218caf-e2aa-573e-1776-02cffff42462","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"bf69e085-3c01-7924-5108-7151c85dc371","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(644, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by age","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {\n $match: {\n $and: [{ _id: { $ne: null } }\n [[{{ filterDate }} ]]\n [[{{ filterGender }} ]]\n [[{{ filterEvent }}]]\n [[{{ filterState }}]]\n [[{{ filterOffice }}]]\n ]\n }\n },\n {\n $facet: {\n totals: [{ $count: ''total'' }, { $addFields: { category: ''Total'' } }],\n ageGroups: [\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 365] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''< 1''\n }\n ],\n default: ''''\n }\n }\n }\n },\n {$match: {\n par: {$ne: ''''}\n }}\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n category: ''$_id.par'',\n total: ''$totalCustomer''\n }\n }\n ],\n ageGroups2: [\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 1825] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''< 5''\n }\n ],\n default: ''5+''\n }\n }\n }\n },\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n category: ''$_id.par'',\n total: ''$totalCustomer''\n }\n }\n ],\n }\n },\n {\n $project: {\n mergedArray: { $concatArrays: [''$totals'', ''$ageGroups'', ''$ageGroups2''] }\n }\n },\n { $unwind: ''$mergedArray'' },\n { $replaceRoot: { newRoot: ''$mergedArray'' } },\n {\n $addFields: {\n order: {\n $cond: {\n if: { $eq: [''$category'', ''Total''] },\n then: 1,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''< 1''] },\n then: 2,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''< 5''] },\n then: 3,\n else: 4\n }\n }\n }\n }\n }\n }\n }\n },\n {\n $sort: {\n order: 1\n }\n },\n { $project: { total: 1, category: 1 } },\n {\n $sort: {\n category: -1\n }\n },\n]","template-tags":{"filterDate":{"id":"84b2ec9e-eea8-e9ee-160f-57a211462c2a","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null},"filterGender":{"id":"7d3014f2-7de5-b2b0-fb10-0796ecc6fe38","name":"filterGender","display', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(644, 1, '-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"086c0846-69f4-a2b9-16b8-86af040bf2c8","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"537bc06b-acf9-9d28-3c92-346d83ce5156","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"5626fb9c-14cd-0fe8-2254-687e292aeb7b","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}}},"type":"native"},"id":31,"parameter_mappings":[],"display":"bar","entity_id":"hTP9EUEq13VA1N_H-258l","collection_preview":true,"visualization_settings":{"graph.y_axis.title_text":"Total","graph.show_values":true,"graph.x_axis.labels_enabled":false,"graph.series_order_dimension":"total","stackable.stack_display":"bar","graph.x_axis.title_text":"Category","graph.label_value_frequency":"fit","graph.metrics":["total"],"graph.label_value_formatting":"auto","graph.series_order":[{"key":"20,085","color":"#7172AD","enabled":true,"name":"20,085"},{"key":"17,956","color":"#F9D45C","enabled":true,"name":"17,956"},{"key":"20,082","color":"#F2A86F","enabled":true,"name":"20,082"},{"key":"3","color":"#EF8C8C","enabled":true,"name":"3"},{"key":"2,129","color":"#98D9D9","enabled":true,"name":"2,129"}],"series_settings":{"4":{"title":"Under age 5","color":"#509EE3"},"7":{"title":"Over age 5","color":"#509EE3"},"12":{"title":"Under age 1","color":"#509EE3"},"23":{"color":"#F9D45C","title":"Total"},"20,085":{"axis":null}},"graph.dimensions":["category","total"],"stackable.stack_type":"stacked"},"is_write":false,"parameters":[{"id":"84b2ec9e-eea8-e9ee-160f-57a211462c2a","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"7d3014f2-7de5-b2b0-fb10-0796ecc6fe38","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"086c0846-69f4-a2b9-16b8-86af040bf2c8","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"537bc06b-acf9-9d28-3c92-346d83ce5156","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"5626fb9c-14cd-0fe8-2254-687e292aeb7b","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(645, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":18,"query_type":"native","name":"Registrations by State","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"template-tags":{"filterDate":{"id":"f86f592c-2219-063c-8dc4-ca623c06a3ca","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null},"filterGender":{"id":"91f3014a-fb66-6724-708c-8e89f56e2779","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"757a20cf-8f70-6857-0ed5-acb310688b3a","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":["Birth"]},"filterState":{"id":"9384f1c8-b896-7ddb-6f32-204beba13dd3","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"58ab4870-ee4a-8362-2689-440572bb65de","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"stateName\": \"$stateName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"stateName\": \"$_id.stateName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"stateName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''State Name'': \"$allInfo.stateName\"\n , ''Registrations'': \"$allInfo.count\"\n }},\n {\n $limit: 10\n }\n]","collection":"registrations"},"type":"native"},"id":33,"parameter_mappings":[],"display":"row","entity_id":"g5hTQaT1d2p1OX0tU90WQ","collection_preview":true,"visualization_settings":{"graph.dimensions":["State Name"],"graph.show_values":true,"graph.y_axis.title_text":"No. of registrations","graph.metrics":["Registrations"]},"is_write":false,"parameters":[{"id":"f86f592c-2219-063c-8dc4-ca623c06a3ca","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"91f3014a-fb66-6724-708c-8e89f56e2779","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"757a20cf-8f70-6857-0ed5-acb310688b3a","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent","default":["Birth"]},{"id":"9384f1c8-b896-7ddb-6f32-204beba13dd3","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"58ab4870-ee4a-8362-2689-440572bb65de","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"na', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(645, 1, 'me":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(639, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":12,"query_type":"native","name":"Live births by age of Mother","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , mothersAge: ''$mothersAgeAtBirthOfChildInYears''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$gte: [''$mothersAge'', 9]}, {$lt: [''$mothersAge'', 15]}] }, then: ''09-14''},\n {case: {$and: [{$gte: [''$mothersAge'', 15]}, {$lt: [''$mothersAge'', 20]}] }, then: ''15-19''},\n {case: {$and: [{$gte: [''$mothersAge'', 20]}, {$lt: [''$mothersAge'', 25]}] }, then: ''20-24''},\n {case: {$and: [{$gte: [''$mothersAge'', 25]}, {$lt: [''$mothersAge'', 30]}] }, then: ''25-29''},\n {case: {$and: [{$gte: [''$mothersAge'', 30]}, {$lt: [''$mothersAge'', 35]}] }, then: ''30-34''},\n {case: {$and: [{$gte: [''$mothersAge'', 35]}, {$lt: [''$mothersAge'', 40]}] }, then: ''35-39''},\n {case: {$and: [{$gte: [''$mothersAge'', 40]}, {$lt: [''$mothersAge'', 45]}] }, then: ''40-44''},\n {case: {$and: [{$gte: [''$mothersAge'', 45]}, {$lt: [''$mothersAge'', 50]}] }, then: ''45-49''},\n {case: {$and: [{$gte: [''$mothersAge'', 50]}, {$lt: [''$mothersAge'', 55]}] }, then: ''50-54''},\n {case: {$and: [{$gte: [''$mothersAge'', 55]}, {$lt: [''$mothersAge'', 60]}] }, then: ''55-59''},\n {case: {$and: [{$gte: [''$mothersAge'', 60]}] }, then: ''60+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Order\": 1\n }\n }\n]","template-tags":{"filterGender":{"id":"56559614-c685-9d81-d44b-a688fe5b103b","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","name":"filt', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(639, 1, 'erState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"8b07b619-ea79-a772-e83a-92f986ab040c","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null}}},"type":"native"},"id":20,"parameter_mappings":[],"display":"bar","entity_id":"PcnknQN2IYs_mJkwA8yRq","collection_preview":true,"visualization_settings":{"table.pivot_column":"Order","table.cell_column":"Count","graph.dimensions":["Order"],"graph.x_axis.title_text":"Age","graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"56559614-c685-9d81-d44b-a688fe5b103b","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"8b07b619-ea79-a772-e83a-92f986ab040c","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(640, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":14,"query_type":"native","name":"Live Births by Level of Education of Parent","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterGender":{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null}},"query":"[\n {$facet: {\n fathersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersAttainment\": \"$fathersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"KORANIC\"] },\n then: \"Koranic\"\n },\n {\n case: { $eq: [\"$_id\", \"MODERN\"] },\n then: \"Modern\"\n },\n {\n case: { $eq: [\"$_id\", \"HIGHER_SCHOOL\"] },\n then: \"Higher School\"\n },\n {\n case: { $eq: [\"$_id\", \"PRIMARY\"] },\n then: \"Primary\"\n },\n {\n case: { $eq: [\"$_id\", \"UNIVERSITY\"] },\n then: \"University\"\n },\n {\n case: { $eq: [\"$_id\", \"POLYTECNIC_NCE\"] },\n then: \"Polytecnic NCE\"\n },\n {\n case: { $eq: [\"$_id\", \"SECONDARY\"] },\n then: \"Secondary\"\n }\n ],\n default: \"Others\"\n }\n }\n , count: \"$count\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {$addFields: {\n attainment: \"fathersAttainment\"\n }}\n ]\n , mothersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersAttainment\": \"$mothersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\":', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(640, 1, ' {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"KORANIC\"] },\n then: \"Koranic\"\n },\n {\n case: { $eq: [\"$_id\", \"MODERN\"] },\n then: \"Modern\"\n },\n {\n case: { $eq: [\"$_id\", \"HIGHER_SCHOOL\"] },\n then: \"Higher School\"\n },\n {\n case: { $eq: [\"$_id\", \"PRIMARY\"] },\n then: \"Primary\"\n },\n {\n case: { $eq: [\"$_id\", \"UNIVERSITY\"] },\n then: \"University\"\n },\n {\n case: { $eq: [\"$_id\", \"POLYTECNIC_NCE\"] },\n then: \"Polytecnic NCE\"\n },\n {\n case: { $eq: [\"$_id\", \"SECONDARY\"] },\n then: \"Secondary\"\n }\n ],\n default: \"Others\"\n }\n }\n , count: \"$count\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {$addFields: {\n attainment: \"mothersAttainment\"\n }}\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersAttainment\", \"$mothersAttainment\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Educational Attainment'': \"$allInfo._id\"\n , ''Relationship'': \"$allInfo.attainment\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Relationship\": 1\n }\n }\n]\n","collection":"registrations"},"database":3},"id":21,"parameter_mappings":[],"display":"bar","entity_id":"W6bdia0Vw-6PC1efnHIR4","collection_preview":true,"visualization_settings":{"graph.show_values":true,"pie.dimension":"Educational Attainment","graph.x_axis.axis_enabled":true,"graph.y_axis.auto_split":true,"graph.metrics":["Count"],"pie.metric":"Count","series_settings":{"mothersAttainment":{"title":"mother"},"fathersAttainment":{"title":"father"}},"graph.y_axis.auto_range":true,"graph.dimensions":["Educational Attainment","Relationship"]},"is_write":false,"parameters":[{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(641, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":18,"query_type":"native","name":"Registrations by State","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"template-tags":{"filterDate":{"id":"f86f592c-2219-063c-8dc4-ca623c06a3ca","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null},"filterGender":{"id":"91f3014a-fb66-6724-708c-8e89f56e2779","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"757a20cf-8f70-6857-0ed5-acb310688b3a","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":["Birth"]},"filterState":{"id":"9384f1c8-b896-7ddb-6f32-204beba13dd3","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"58ab4870-ee4a-8362-2689-440572bb65de","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"stateName\": \"$stateName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"stateName\": \"$_id.stateName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"stateName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''State Name'': \"$allInfo.stateName\"\n , ''Registrations'': \"$allInfo.count\"\n }},\n {\n $limit: 10\n }\n]","collection":"registrations"},"type":"native"},"id":33,"parameter_mappings":[],"display":"row","entity_id":"g5hTQaT1d2p1OX0tU90WQ","collection_preview":true,"visualization_settings":{"graph.dimensions":["State Name"],"graph.show_values":true,"graph.metrics":["Registrations"]},"is_write":false,"parameters":[{"id":"f86f592c-2219-063c-8dc4-ca623c06a3ca","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"91f3014a-fb66-6724-708c-8e89f56e2779","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"757a20cf-8f70-6857-0ed5-acb310688b3a","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent","default":["Birth"]},{"id":"9384f1c8-b896-7ddb-6f32-204beba13dd3","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"58ab4870-ee4a-8362-2689-440572bb65de","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":fa', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(641, 1, 'lse,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(642, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":10,"query_type":"native","name":"Literacy of parents","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {$facet: {\n fathersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersLiteracy\": \"$fathersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"fathersLiteracy\"\n }}\n ]\n ,mothersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersLiteracy\": \"$mothersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"mothersLiteracy\"\n }}\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersLiteracy\", \"$mothersLiteracy\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Category'': \"$allInfo._id\"\n , ''Literacy'': \"$allInfo.literacy\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Literacy\": 1\n }\n }\n]\n","template-tags":{"filterGender":{"id":"e8218caf-e2aa-573e-1776-02cffff42462","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"bf69e085-3c01-7924-5108-7151c85dc371","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"fi', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(642, 1, 'lterDate":{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null}}},"type":"native"},"id":18,"parameter_mappings":[],"display":"bar","entity_id":"eRSJUaHW6haiucK8BtpC_","collection_preview":true,"visualization_settings":{"graph.show_values":true,"graph.label_value_formatting":"auto","graph.dimensions":["Category","Literacy"],"series_settings":{"mothersLiteracy":{"title":"mother"},"fathersLiteracy":{"title":"father"}},"graph.x_axis.title_text":"Literacy","graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"e8218caf-e2aa-573e-1776-02cffff42462","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"bf69e085-3c01-7924-5108-7151c85dc371","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(643, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":10,"query_type":"native","name":"Literacy of parents","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {$facet: {\n fathersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersLiteracy\": \"$fathersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"fathersLiteracy\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n }\n ]\n ,mothersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersLiteracy\": \"$mothersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"mothersLiteracy\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n }\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersLiteracy\", \"$mothersLiteracy\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Category'': \"$allInfo._id\"\n , ''Literacy'': \"$allInfo.literacy\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Literacy\": 1\n }\n }\n]\n","template-tags":{"filterGender":{"id":"e8218caf-e2aa-573e-1776-02cffff42462","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"bf69e085-3c01-7924-5108-7151c85dc371","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","name":"filterOffice","', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(643, 1, 'display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null}}},"type":"native"},"id":18,"parameter_mappings":[],"display":"bar","entity_id":"eRSJUaHW6haiucK8BtpC_","collection_preview":true,"visualization_settings":{"graph.show_values":true,"graph.label_value_formatting":"auto","graph.dimensions":["Category","Literacy"],"series_settings":{"mothersLiteracy":{"title":"mother"},"fathersLiteracy":{"title":"father"}},"graph.x_axis.title_text":"Literacy","graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"e8218caf-e2aa-573e-1776-02cffff42462","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"bf69e085-3c01-7924-5108-7151c85dc371","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(644, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":10,"query_type":"native","name":"Literacy of parents","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterGender":{"id":"e8218caf-e2aa-573e-1776-02cffff42462","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"bf69e085-3c01-7924-5108-7151c85dc371","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null}},"query":"[\n {$facet: {\n fathersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersLiteracy\": \"$fathersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"fathersLiteracy\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n }\n ]\n ,mothersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersLiteracy\": \"$mothersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"mothersLiteracy\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n }\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersLiteracy\", \"$mothersLiteracy\" ]\n }\n }\', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(644, 1, 'n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Category'': \"$allInfo._id\"\n , ''Literacy'': \"$allInfo.literacy\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Literacy\": 1\n }\n }\n]\n","collection":"registrations"},"database":3},"id":18,"parameter_mappings":[],"display":"bar","entity_id":"eRSJUaHW6haiucK8BtpC_","collection_preview":true,"visualization_settings":{"graph.show_values":true,"graph.label_value_formatting":"auto","graph.dimensions":["Category","Literacy"],"series_settings":{"mothersLiteracy":{"title":"mother"},"fathersLiteracy":{"title":"father"}},"graph.x_axis.title_text":"Literacy","graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"e8218caf-e2aa-573e-1776-02cffff42462","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"bf69e085-3c01-7924-5108-7151c85dc371","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(645, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by age","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {\n $match: {\n $and: [{ _id: { $ne: null } }\n [[{{ filterDate }} ]]\n [[{{ filterGender }} ]]\n [[{{ filterEvent }}]]\n [[{{ filterState }}]]\n [[{{ filterOffice }}]]\n ]\n }\n },\n {\n $facet: {\n totals: [{ $count: ''total'' }, { $addFields: { category: ''Total'' } }],\n ageGroups: [\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 365] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''< 1''\n }\n ],\n default: ''''\n }\n }\n }\n },\n {$match: {\n par: {$ne: ''''}\n }}\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n category: ''$_id.par'',\n total: ''$totalCustomer''\n }\n }\n ],\n ageGroups2: [\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 1825] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''< 5''\n }\n ],\n default: ''5+''\n }\n }\n }\n },\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n category: ''$_id.par'',\n total: ''$totalCustomer''\n }\n }\n ],\n }\n },\n {\n $project: {\n mergedArray: { $concatArrays: [''$totals'', ''$ageGroups'', ''$ageGroups2''] }\n }\n },\n { $unwind: ''$mergedArray'' },\n { $replaceRoot: { newRoot: ''$mergedArray'' } },\n {\n $addFields: {\n order: {\n $cond: {\n if: { $eq: [''$category'', ''Total''] },\n then: 1,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''< 1''] },\n then: 2,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''< 5''] },\n then: 3,\n else: 4\n }\n }\n }\n }\n }\n }\n }\n },\n {\n $sort: {\n order: 1\n }\n },\n { $project: { total: 1, category: 1 } },\n {\n $sort: {\n category: -1\n }\n },\n]","template-tags":{"filterDate":{"id":"84b2ec9e-eea8-e9ee-160f-57a211462c2a","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null},"filterGender":{"id":"7d3014f2-7de5-b2b0-fb10-0796ecc6fe38","name":"filterGender","display', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(645, 1, '-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"086c0846-69f4-a2b9-16b8-86af040bf2c8","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"537bc06b-acf9-9d28-3c92-346d83ce5156","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"5626fb9c-14cd-0fe8-2254-687e292aeb7b","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}}},"type":"native"},"id":31,"parameter_mappings":[],"display":"bar","entity_id":"hTP9EUEq13VA1N_H-258l","collection_preview":true,"visualization_settings":{"graph.y_axis.title_text":"Total","graph.show_values":true,"graph.x_axis.labels_enabled":false,"graph.series_order_dimension":"total","stackable.stack_display":"bar","graph.x_axis.title_text":"Category","graph.label_value_frequency":"fit","graph.metrics":["total"],"graph.label_value_formatting":"auto","graph.series_order":[{"key":"20,085","color":"#7172AD","enabled":true,"name":"20,085"},{"key":"17,956","color":"#F9D45C","enabled":true,"name":"17,956"},{"key":"20,082","color":"#F2A86F","enabled":true,"name":"20,082"},{"key":"3","color":"#EF8C8C","enabled":true,"name":"3"},{"key":"2,129","color":"#98D9D9","enabled":true,"name":"2,129"}],"series_settings":{"4":{"title":"Under age 5","color":"#509EE3"},"7":{"title":"Over age 5","color":"#509EE3"},"12":{"title":"Under age 1","color":"#509EE3"},"23":{"color":"#F9D45C","title":"Total"},"20,085":{"axis":null}},"graph.dimensions":["category","total"],"stackable.stack_type":"stacked"},"is_write":false,"parameters":[{"id":"84b2ec9e-eea8-e9ee-160f-57a211462c2a","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"7d3014f2-7de5-b2b0-fb10-0796ecc6fe38","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"086c0846-69f4-a2b9-16b8-86af040bf2c8","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"537bc06b-acf9-9d28-3c92-346d83ce5156","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"5626fb9c-14cd-0fe8-2254-687e292aeb7b","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(646, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":18,"query_type":"native","name":"Registrations by State","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"template-tags":{"filterDate":{"id":"f86f592c-2219-063c-8dc4-ca623c06a3ca","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null},"filterGender":{"id":"91f3014a-fb66-6724-708c-8e89f56e2779","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"757a20cf-8f70-6857-0ed5-acb310688b3a","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":["Birth"]},"filterState":{"id":"9384f1c8-b896-7ddb-6f32-204beba13dd3","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"58ab4870-ee4a-8362-2689-440572bb65de","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"stateName\": \"$stateName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"stateName\": \"$_id.stateName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"stateName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''State Name'': \"$allInfo.stateName\"\n , ''Registrations'': \"$allInfo.count\"\n }},\n {\n $limit: 10\n }\n]","collection":"registrations"},"type":"native"},"id":33,"parameter_mappings":[],"display":"row","entity_id":"g5hTQaT1d2p1OX0tU90WQ","collection_preview":true,"visualization_settings":{"graph.dimensions":["State Name"],"graph.show_values":true,"graph.y_axis.title_text":"No. of registrations","graph.metrics":["Registrations"]},"is_write":false,"parameters":[{"id":"f86f592c-2219-063c-8dc4-ca623c06a3ca","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"91f3014a-fb66-6724-708c-8e89f56e2779","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"757a20cf-8f70-6857-0ed5-acb310688b3a","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent","default":["Birth"]},{"id":"9384f1c8-b896-7ddb-6f32-204beba13dd3","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"58ab4870-ee4a-8362-2689-440572bb65de","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"na', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(646, 1, 'me":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); INSERT INTO "PUBLIC"."REVISION" VALUES -(548, 'Card', 20, 1, TIMESTAMP WITH TIME ZONE '2023-01-24 11:54:15.873+00', SYSTEM_COMBINE_CLOB(638), FALSE, FALSE, NULL), -(549, 'Card', 21, 1, TIMESTAMP WITH TIME ZONE '2023-01-24 12:10:26.951+00', SYSTEM_COMBINE_CLOB(639), FALSE, FALSE, NULL), -(558, 'Card', 33, 1, TIMESTAMP WITH TIME ZONE '2023-01-24 13:24:30.824+00', SYSTEM_COMBINE_CLOB(640), FALSE, FALSE, NULL), +(548, 'Card', 20, 1, TIMESTAMP WITH TIME ZONE '2023-01-24 11:54:15.873+00', SYSTEM_COMBINE_CLOB(639), FALSE, FALSE, NULL), +(549, 'Card', 21, 1, TIMESTAMP WITH TIME ZONE '2023-01-24 12:10:26.951+00', SYSTEM_COMBINE_CLOB(640), FALSE, FALSE, NULL), +(558, 'Card', 33, 1, TIMESTAMP WITH TIME ZONE '2023-01-24 13:24:30.824+00', SYSTEM_COMBINE_CLOB(641), FALSE, FALSE, NULL), (559, 'Card', 30, 1, TIMESTAMP WITH TIME ZONE '2023-01-24 13:25:15.18+00', '{"description":null,"archived":false,"collection_position":null,"table_id":70,"database_id":3,"enable_embedding":false,"collection_id":8,"query_type":"query","name":"% of Total Registrations Certified","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"query":{"source-table":70,"expressions":{"Status":["case",[[["=",["field",682,null],"REGISTERED"],"Not Certified"],[["=",["field",682,null],"CERTIFIED"],"Certified"]]]},"aggregation":[["count"]],"breakout":[["expression","Status"]]},"type":"query"},"id":30,"parameter_mappings":[],"display":"pie","entity_id":"i9_4VwkR62cl03HLkb9e7","collection_preview":true,"visualization_settings":{},"is_write":false,"parameters":[],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL), (560, 'Card', 27, 1, TIMESTAMP WITH TIME ZONE '2023-01-24 13:27:14.017+00', '{"description":null,"archived":false,"collection_position":null,"table_id":70,"database_id":3,"enable_embedding":false,"collection_id":9,"query_type":"query","name":"Place of birth","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"query":{"aggregation":[["count"]],"breakout":[["expression","PlaceOfBirth"]],"expressions":{"PlaceOfBirth":["case",[[["=",["field",668,null],"BUS"],"Bus"],[["=",["field",668,null],"CAR_TAXI"],"Taxi"],[["=",["field",668,null],"HEALTH_FACILITY"],"Health Facility"],[["=",["field",668,null],"MATERNITY_HOME"],"Maternity Home"],[["=",["field",668,null],"PRIVATE_HOME"],"Private Home"],[["=",["field",668,null],"TRADITIONAL_DOCTORS"],"Traditional Doctors"]]]},"filter":["=",["field",666,null],"Birth"],"source-table":70},"type":"query"},"id":27,"parameter_mappings":[],"display":"pie","entity_id":"AfR2OybIvG3i-a1qt-k0u","collection_preview":true,"visualization_settings":{},"is_write":false,"parameters":[],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL), -(561, 'Card', 18, 1, TIMESTAMP WITH TIME ZONE '2023-01-24 13:45:39.039+00', SYSTEM_COMBINE_CLOB(641), FALSE, FALSE, NULL), -(562, 'Card', 18, 1, TIMESTAMP WITH TIME ZONE '2023-01-24 13:48:01.01+00', SYSTEM_COMBINE_CLOB(642), FALSE, FALSE, NULL), -(563, 'Card', 18, 1, TIMESTAMP WITH TIME ZONE '2023-01-24 13:49:46.42+00', SYSTEM_COMBINE_CLOB(643), FALSE, FALSE, NULL), -(568, 'Card', 31, 1, TIMESTAMP WITH TIME ZONE '2023-01-25 07:30:28.341+00', SYSTEM_COMBINE_CLOB(644), FALSE, FALSE, NULL), -(569, 'Card', 33, 1, TIMESTAMP WITH TIME ZONE '2023-01-25 07:42:00.381+00', SYSTEM_COMBINE_CLOB(645), FALSE, FALSE, NULL), +(561, 'Card', 18, 1, TIMESTAMP WITH TIME ZONE '2023-01-24 13:45:39.039+00', SYSTEM_COMBINE_CLOB(642), FALSE, FALSE, NULL), +(562, 'Card', 18, 1, TIMESTAMP WITH TIME ZONE '2023-01-24 13:48:01.01+00', SYSTEM_COMBINE_CLOB(643), FALSE, FALSE, NULL), +(563, 'Card', 18, 1, TIMESTAMP WITH TIME ZONE '2023-01-24 13:49:46.42+00', SYSTEM_COMBINE_CLOB(644), FALSE, FALSE, NULL), +(568, 'Card', 31, 1, TIMESTAMP WITH TIME ZONE '2023-01-25 07:30:28.341+00', SYSTEM_COMBINE_CLOB(645), FALSE, FALSE, NULL), +(569, 'Card', 33, 1, TIMESTAMP WITH TIME ZONE '2023-01-25 07:42:00.381+00', SYSTEM_COMBINE_CLOB(646), FALSE, FALSE, NULL), (573, 'Card', 14, 1, TIMESTAMP WITH TIME ZONE '2023-01-25 12:20:12.734+00', '{"description":null,"archived":false,"collection_position":null,"table_id":70,"database_id":3,"enable_embedding":false,"collection_id":null,"query_type":"query","name":"Registrations over time","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"query":{"aggregation":[["count"]],"breakout":[["field",677,{"temporal-unit":"month"}]],"filter":["and",["=",["field",666,null],"Birth"],["time-interval",["field",677,null],-12,"month"]],"source-table":70},"type":"query"},"id":14,"parameter_mappings":[],"display":"line","entity_id":"qNwCeJEl62KWFEc_8ueNS","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_trendline":false,"graph.show_values":false,"graph.x_axis.axis_enabled":true,"graph.x_axis.title_text":"Over Time","graph.metrics":["count"],"column_settings":{"[\"ref\",[\"field\",677,null]]":{"date_abbreviate":true}},"graph.x_axis.scale":"timeseries","graph.dimensions":["createdAt"]},"is_write":false,"parameters":[],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(646, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":18,"query_type":"native","name":"Registrations by State","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"template-tags":{"filterDate":{"id":"f86f592c-2219-063c-8dc4-ca623c06a3ca","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null},"filterGender":{"id":"91f3014a-fb66-6724-708c-8e89f56e2779","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"757a20cf-8f70-6857-0ed5-acb310688b3a","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":["Birth"]},"filterState":{"id":"9384f1c8-b896-7ddb-6f32-204beba13dd3","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"58ab4870-ee4a-8362-2689-440572bb65de","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"stateName\": \"$stateName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"stateName\": \"$_id.stateName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"stateName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''State Name'': \"$allInfo.stateName\"\n , ''Registrations'': \"$allInfo.count\"\n }}\n]","collection":"registrations"},"type":"native"},"id":33,"parameter_mappings":[],"display":"row","entity_id":"g5hTQaT1d2p1OX0tU90WQ","collection_preview":true,"visualization_settings":{"graph.dimensions":["State Name"],"graph.show_values":true,"graph.y_axis.title_text":"No. of registrations","graph.metrics":["Registrations"]},"is_write":false,"parameters":[{"id":"f86f592c-2219-063c-8dc4-ca623c06a3ca","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"91f3014a-fb66-6724-708c-8e89f56e2779","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"757a20cf-8f70-6857-0ed5-acb310688b3a","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent","default":["Birth"]},{"id":"9384f1c8-b896-7ddb-6f32-204beba13dd3","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"58ab4870-ee4a-8362-2689-440572bb65de","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOf', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(646, 1, 'fice"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(647, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by age","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {\n $match: {\n $and: [{ _id: { $ne: null } }\n [[{{ filterDate }} ]]\n [[{{ filterGender }} ]]\n [[{{ filterEvent }}]]\n [[{{ filterState }}]]\n [[{{ filterOffice }}]]\n ]\n }\n },\n {\n $facet: {\n totals: [{ $count: ''total'' }, { $addFields: { category: ''Total'' } }],\n ageGroups: [\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 365] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''< 1''\n }\n ],\n default: ''''\n }\n }\n }\n },\n {$match: {\n par: {$ne: ''''}\n }}\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n category: ''$_id.par'',\n total: ''$totalCustomer''\n }\n }\n ],\n ageGroups2: [\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 1825] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''< 5''\n }\n ],\n default: ''5+''\n }\n }\n }\n },\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n category: ''$_id.par'',\n total: ''$totalCustomer''\n }\n }\n ],\n }\n },\n {\n $project: {\n mergedArray: { $concatArrays: [''$totals'', ''$ageGroups'', ''$ageGroups2''] }\n }\n },\n { $unwind: ''$mergedArray'' },\n { $replaceRoot: { newRoot: ''$mergedArray'' } },\n {\n $addFields: {\n order: {\n $cond: {\n if: { $eq: [''$category'', ''Total''] },\n then: 1,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''< 1''] },\n then: 2,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''< 5''] },\n then: 3,\n else: 4\n }\n }\n }\n }\n }\n }\n }\n },\n {\n $sort: {\n order: 1\n }\n },\n { $project: { total: 1, category: 1 } },\n {\n $sort: {\n category: -1\n }\n },\n]","template-tags":{"filterDate":{"id":"84b2ec9e-eea8-e9ee-160f-57a211462c2a","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null},"filterGender":{"id":"7d3014f2-7de5-b2b0-fb10-0796ecc6fe38","name":"filterGender","display', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(647, 1, '-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"086c0846-69f4-a2b9-16b8-86af040bf2c8","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"537bc06b-acf9-9d28-3c92-346d83ce5156","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"5626fb9c-14cd-0fe8-2254-687e292aeb7b","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}}},"type":"native"},"id":31,"parameter_mappings":[],"display":"bar","entity_id":"hTP9EUEq13VA1N_H-258l","collection_preview":true,"visualization_settings":{"graph.y_axis.title_text":"Total","graph.show_values":true,"graph.x_axis.labels_enabled":false,"graph.series_order_dimension":null,"stackable.stack_display":"bar","graph.x_axis.title_text":"Category","graph.label_value_frequency":"fit","graph.metrics":["total"],"graph.label_value_formatting":"auto","graph.series_order":null,"series_settings":{"4":{"title":"Under age 5","color":"#509EE3"},"7":{"title":"Over age 5","color":"#509EE3"},"12":{"title":"Under age 1","color":"#509EE3"},"23":{"color":"#F9D45C","title":"Total"},"20,085":{"axis":null},"total":{"color":"#8A5EB0"}},"graph.dimensions":["category"],"stackable.stack_type":"stacked"},"is_write":false,"parameters":[{"id":"84b2ec9e-eea8-e9ee-160f-57a211462c2a","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"7d3014f2-7de5-b2b0-fb10-0796ecc6fe38","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"086c0846-69f4-a2b9-16b8-86af040bf2c8","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"537bc06b-acf9-9d28-3c92-346d83ce5156","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"5626fb9c-14cd-0fe8-2254-687e292aeb7b","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(648, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by gender","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , { \"$group\": {\n \"_id\": {\n \"gender\": \"$gender\"\n },\n \"count\": {\n \"$sum\": 1\n },\n }\n },\n { \"$project\": {\n \"_id\": false,\n \"gender\": \"$_id.gender\",\n \"count\": true\n }\n },\n {$match: {\n \"gender\": {$ne: null}\n }}\n \n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Gender'': \"$allInfo.gender\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }}\n]","template-tags":{"filterDate":{"id":"57523c92-bc05-e144-f15d-a07fc78322c2","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/relative","default":null},"filterGender":{"id":"f7834d58-4acc-cc46-0aee-08d1421f1ff1","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"af46a4e6-571c-e47f-e8ab-2cf527f54d68","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"a771e085-c491-259c-3020-bb9f97cf56f4","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"09bc4ac9-1847-d645-24c9-4f2892e147d0","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}}},"type":"native"},"id":1,"parameter_mappings":[],"display":"bar","entity_id":"Ksk2s3aUAdBmDtMTNwtH3","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.columns":[],"table.cell_column":"Gender","graph.series_order_dimension":null,"graph.metrics":["Count"],"graph.series_order":null,"table.pivot_column":"count","series_settings":{"Registrations":{"color":"#509EE3","show_series_values":true},"Count":{"color":"#69C8C8"}},"graph.dimensions":["Gender"]},"is_write":false,"parameters":[{"id":"57523c92-bc05-e144-f15d-a07fc78322c2","type":"date/relative","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"f7834d58-4acc-cc46-0aee-08d1421f1ff1","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"af46a4e6-571c-e47f-e8ab-2cf527f54d68","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"a771e085-c491-259c-3020-bb9f97cf56f4","type":"string/=","target":["dimension",["template-tag","filterState"]],"', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(648, 1, 'name":"State","slug":"filterState"},{"id":"09bc4ac9-1847-d645-24c9-4f2892e147d0","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(649, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":18,"query_type":"native","name":"Registrations by State","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"template-tags":{"filterDate":{"id":"f86f592c-2219-063c-8dc4-ca623c06a3ca","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null},"filterGender":{"id":"91f3014a-fb66-6724-708c-8e89f56e2779","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"757a20cf-8f70-6857-0ed5-acb310688b3a","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":["Birth"]},"filterState":{"id":"9384f1c8-b896-7ddb-6f32-204beba13dd3","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"58ab4870-ee4a-8362-2689-440572bb65de","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"stateName\": \"$stateName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"stateName\": \"$_id.stateName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"stateName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''State Name'': \"$allInfo.stateName\"\n , ''Registrations'': \"$allInfo.count\"\n }}\n]","collection":"registrations"},"type":"native"},"id":33,"parameter_mappings":[],"display":"row","entity_id":"g5hTQaT1d2p1OX0tU90WQ","collection_preview":true,"visualization_settings":{"series_settings":{"Registrations":{"color":"#ED8535"}},"graph.dimensions":["State Name"],"graph.show_values":true,"graph.y_axis.title_text":"No. of registrations","graph.metrics":["Registrations"]},"is_write":false,"parameters":[{"id":"f86f592c-2219-063c-8dc4-ca623c06a3ca","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"91f3014a-fb66-6724-708c-8e89f56e2779","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"757a20cf-8f70-6857-0ed5-acb310688b3a","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent","default":["Birth"]},{"id":"9384f1c8-b896-7ddb-6f32-204beba13dd3","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"58ab4870-ee4a-8362-2689-440572bb65de","type":"string/=","target":["dimension",["templat', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(649, 1, 'e-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(650, 0, '{"description":"","archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Leaderboard of Registrars","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"practitionerName\": \"$practitionerName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"practitionerName\": \"$_id.practitionerName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"practitionerName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Registrar Name'': \"$allInfo.practitionerName\"\n , ''Registrations'': \"$allInfo.count\"\n }},\n {\n $limit: 30\n }\n]","template-tags":{"filterGender":{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null}}},"type":"native"},"id":12,"parameter_mappings":[],"display":"row","entity_id":"VxeUMjNq8eLaHweLGUvYF","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.cell_column":"Percentage","graph.series_order_dimension":null,"graph.x_axis.title_text":"Registrars","graph.metrics":["Registrations"],"graph.label_value_formatting":"full","graph.series_order":null,"table.pivot_column":"Registrations","series_settings":{"Registrations":{"color":"#509EE3"}},"graph.dimensions":["Registrar Name"],"stackable.stack_type":null},"is_write":false,"parameters":[{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"f', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(650, 1, 'ilterState"},{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(647, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":18,"query_type":"native","name":"Registrations by State","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"template-tags":{"filterDate":{"id":"f86f592c-2219-063c-8dc4-ca623c06a3ca","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null},"filterGender":{"id":"91f3014a-fb66-6724-708c-8e89f56e2779","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"757a20cf-8f70-6857-0ed5-acb310688b3a","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":["Birth"]},"filterState":{"id":"9384f1c8-b896-7ddb-6f32-204beba13dd3","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"58ab4870-ee4a-8362-2689-440572bb65de","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"stateName\": \"$stateName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"stateName\": \"$_id.stateName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"stateName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''State Name'': \"$allInfo.stateName\"\n , ''Registrations'': \"$allInfo.count\"\n }}\n]","collection":"registrations"},"type":"native"},"id":33,"parameter_mappings":[],"display":"row","entity_id":"g5hTQaT1d2p1OX0tU90WQ","collection_preview":true,"visualization_settings":{"graph.dimensions":["State Name"],"graph.show_values":true,"graph.y_axis.title_text":"No. of registrations","graph.metrics":["Registrations"]},"is_write":false,"parameters":[{"id":"f86f592c-2219-063c-8dc4-ca623c06a3ca","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"91f3014a-fb66-6724-708c-8e89f56e2779","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"757a20cf-8f70-6857-0ed5-acb310688b3a","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent","default":["Birth"]},{"id":"9384f1c8-b896-7ddb-6f32-204beba13dd3","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"58ab4870-ee4a-8362-2689-440572bb65de","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOf', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(647, 1, 'fice"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(648, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by age","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {\n $match: {\n $and: [{ _id: { $ne: null } }\n [[{{ filterDate }} ]]\n [[{{ filterGender }} ]]\n [[{{ filterEvent }}]]\n [[{{ filterState }}]]\n [[{{ filterOffice }}]]\n ]\n }\n },\n {\n $facet: {\n totals: [{ $count: ''total'' }, { $addFields: { category: ''Total'' } }],\n ageGroups: [\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 365] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''< 1''\n }\n ],\n default: ''''\n }\n }\n }\n },\n {$match: {\n par: {$ne: ''''}\n }}\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n category: ''$_id.par'',\n total: ''$totalCustomer''\n }\n }\n ],\n ageGroups2: [\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 1825] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''< 5''\n }\n ],\n default: ''5+''\n }\n }\n }\n },\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n category: ''$_id.par'',\n total: ''$totalCustomer''\n }\n }\n ],\n }\n },\n {\n $project: {\n mergedArray: { $concatArrays: [''$totals'', ''$ageGroups'', ''$ageGroups2''] }\n }\n },\n { $unwind: ''$mergedArray'' },\n { $replaceRoot: { newRoot: ''$mergedArray'' } },\n {\n $addFields: {\n order: {\n $cond: {\n if: { $eq: [''$category'', ''Total''] },\n then: 1,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''< 1''] },\n then: 2,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''< 5''] },\n then: 3,\n else: 4\n }\n }\n }\n }\n }\n }\n }\n },\n {\n $sort: {\n order: 1\n }\n },\n { $project: { total: 1, category: 1 } },\n {\n $sort: {\n category: -1\n }\n },\n]","template-tags":{"filterDate":{"id":"84b2ec9e-eea8-e9ee-160f-57a211462c2a","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null},"filterGender":{"id":"7d3014f2-7de5-b2b0-fb10-0796ecc6fe38","name":"filterGender","display', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(648, 1, '-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"086c0846-69f4-a2b9-16b8-86af040bf2c8","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"537bc06b-acf9-9d28-3c92-346d83ce5156","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"5626fb9c-14cd-0fe8-2254-687e292aeb7b","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}}},"type":"native"},"id":31,"parameter_mappings":[],"display":"bar","entity_id":"hTP9EUEq13VA1N_H-258l","collection_preview":true,"visualization_settings":{"graph.y_axis.title_text":"Total","graph.show_values":true,"graph.x_axis.labels_enabled":false,"graph.series_order_dimension":null,"stackable.stack_display":"bar","graph.x_axis.title_text":"Category","graph.label_value_frequency":"fit","graph.metrics":["total"],"graph.label_value_formatting":"auto","graph.series_order":null,"series_settings":{"4":{"title":"Under age 5","color":"#509EE3"},"7":{"title":"Over age 5","color":"#509EE3"},"12":{"title":"Under age 1","color":"#509EE3"},"23":{"color":"#F9D45C","title":"Total"},"20,085":{"axis":null},"total":{"color":"#8A5EB0"}},"graph.dimensions":["category"],"stackable.stack_type":"stacked"},"is_write":false,"parameters":[{"id":"84b2ec9e-eea8-e9ee-160f-57a211462c2a","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"7d3014f2-7de5-b2b0-fb10-0796ecc6fe38","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"086c0846-69f4-a2b9-16b8-86af040bf2c8","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"537bc06b-acf9-9d28-3c92-346d83ce5156","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"5626fb9c-14cd-0fe8-2254-687e292aeb7b","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(649, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by gender","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , { \"$group\": {\n \"_id\": {\n \"gender\": \"$gender\"\n },\n \"count\": {\n \"$sum\": 1\n },\n }\n },\n { \"$project\": {\n \"_id\": false,\n \"gender\": \"$_id.gender\",\n \"count\": true\n }\n },\n {$match: {\n \"gender\": {$ne: null}\n }}\n \n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Gender'': \"$allInfo.gender\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }}\n]","template-tags":{"filterDate":{"id":"57523c92-bc05-e144-f15d-a07fc78322c2","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/relative","default":null},"filterGender":{"id":"f7834d58-4acc-cc46-0aee-08d1421f1ff1","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"af46a4e6-571c-e47f-e8ab-2cf527f54d68","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"a771e085-c491-259c-3020-bb9f97cf56f4","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"09bc4ac9-1847-d645-24c9-4f2892e147d0","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}}},"type":"native"},"id":1,"parameter_mappings":[],"display":"bar","entity_id":"Ksk2s3aUAdBmDtMTNwtH3","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.columns":[],"table.cell_column":"Gender","graph.series_order_dimension":null,"graph.metrics":["Count"],"graph.series_order":null,"table.pivot_column":"count","series_settings":{"Registrations":{"color":"#509EE3","show_series_values":true},"Count":{"color":"#69C8C8"}},"graph.dimensions":["Gender"]},"is_write":false,"parameters":[{"id":"57523c92-bc05-e144-f15d-a07fc78322c2","type":"date/relative","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"f7834d58-4acc-cc46-0aee-08d1421f1ff1","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"af46a4e6-571c-e47f-e8ab-2cf527f54d68","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"a771e085-c491-259c-3020-bb9f97cf56f4","type":"string/=","target":["dimension",["template-tag","filterState"]],"', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(649, 1, 'name":"State","slug":"filterState"},{"id":"09bc4ac9-1847-d645-24c9-4f2892e147d0","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(650, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":18,"query_type":"native","name":"Registrations by State","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"template-tags":{"filterDate":{"id":"f86f592c-2219-063c-8dc4-ca623c06a3ca","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null},"filterGender":{"id":"91f3014a-fb66-6724-708c-8e89f56e2779","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"757a20cf-8f70-6857-0ed5-acb310688b3a","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":["Birth"]},"filterState":{"id":"9384f1c8-b896-7ddb-6f32-204beba13dd3","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"58ab4870-ee4a-8362-2689-440572bb65de","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"stateName\": \"$stateName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"stateName\": \"$_id.stateName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"stateName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''State Name'': \"$allInfo.stateName\"\n , ''Registrations'': \"$allInfo.count\"\n }}\n]","collection":"registrations"},"type":"native"},"id":33,"parameter_mappings":[],"display":"row","entity_id":"g5hTQaT1d2p1OX0tU90WQ","collection_preview":true,"visualization_settings":{"series_settings":{"Registrations":{"color":"#ED8535"}},"graph.dimensions":["State Name"],"graph.show_values":true,"graph.y_axis.title_text":"No. of registrations","graph.metrics":["Registrations"]},"is_write":false,"parameters":[{"id":"f86f592c-2219-063c-8dc4-ca623c06a3ca","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"91f3014a-fb66-6724-708c-8e89f56e2779","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"757a20cf-8f70-6857-0ed5-acb310688b3a","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent","default":["Birth"]},{"id":"9384f1c8-b896-7ddb-6f32-204beba13dd3","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"58ab4870-ee4a-8362-2689-440572bb65de","type":"string/=","target":["dimension",["templat', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(650, 1, 'e-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(651, 0, '{"description":"","archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Leaderboard of Registrars","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"practitionerName\": \"$practitionerName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"practitionerName\": \"$_id.practitionerName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"practitionerName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Registrar Name'': \"$allInfo.practitionerName\"\n , ''Registrations'': \"$allInfo.count\"\n }},\n {\n $limit: 30\n }\n]","template-tags":{"filterGender":{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null}}},"type":"native"},"id":12,"parameter_mappings":[],"display":"row","entity_id":"VxeUMjNq8eLaHweLGUvYF","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.cell_column":"Percentage","graph.series_order_dimension":null,"graph.x_axis.title_text":"Registrars","graph.metrics":["Registrations"],"graph.label_value_formatting":"full","graph.series_order":null,"table.pivot_column":"Registrations","series_settings":{"Registrations":{"color":"#509EE3"}},"graph.dimensions":["Registrar Name"],"stackable.stack_type":null},"is_write":false,"parameters":[{"id":"b288ecc8-38b4-f4f3-b4bf-fe10b1a567b5","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"ec1ff9e7-75a1-b336-9d16-2492471a20f4","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"69f31f7f-da03-4eae-fa1a-9e64b3278ba8","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"f', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(651, 1, 'ilterState"},{"id":"a0cbb9fa-29b4-05bd-fa95-84e485a444e3","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"},{"id":"b51746bd-9fd8-c0df-eb92-8e6c61bbac21","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); INSERT INTO "PUBLIC"."REVISION" VALUES (574, 'Card', 14, 1, TIMESTAMP WITH TIME ZONE '2023-01-25 12:20:43.943+00', '{"description":null,"archived":false,"collection_position":null,"table_id":70,"database_id":3,"enable_embedding":false,"collection_id":null,"query_type":"query","name":"Registrations over time","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"query","query":{"aggregation":[["count"]],"breakout":[["field",677,{"temporal-unit":"week"}]],"filter":["and",["=",["field",666,null],"Birth"],["time-interval",["field",677,null],-12,"month"]],"source-table":70},"database":3},"id":14,"parameter_mappings":[],"display":"line","entity_id":"qNwCeJEl62KWFEc_8ueNS","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_trendline":false,"graph.show_values":false,"graph.x_axis.axis_enabled":true,"graph.x_axis.title_text":"Over Time","graph.metrics":["count"],"column_settings":{"[\"ref\",[\"field\",677,null]]":{"date_abbreviate":true}},"graph.x_axis.scale":"timeseries","graph.dimensions":["createdAt"]},"is_write":false,"parameters":[],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL), (575, 'Card', 14, 1, TIMESTAMP WITH TIME ZONE '2023-01-25 12:21:52.777+00', '{"description":null,"archived":false,"collection_position":null,"table_id":70,"database_id":3,"enable_embedding":false,"collection_id":null,"query_type":"query","name":"Registrations over time","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"query":{"aggregation":[["count"]],"breakout":[["field",677,{"temporal-unit":"month"}]],"filter":["and",["=",["field",666,null],"Birth"],["time-interval",["field",677,null],-12,"month"]],"source-table":70},"type":"query"},"id":14,"parameter_mappings":[],"display":"line","entity_id":"qNwCeJEl62KWFEc_8ueNS","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_trendline":false,"graph.show_values":false,"graph.x_axis.axis_enabled":true,"graph.x_axis.title_text":"Over Time","graph.metrics":["count"],"column_settings":{"[\"ref\",[\"field\",677,null]]":{"date_abbreviate":true}},"graph.x_axis.scale":"timeseries","graph.dimensions":["createdAt"]},"is_write":false,"parameters":[],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL), -(576, 'Card', 33, 1, TIMESTAMP WITH TIME ZONE '2023-01-25 12:25:18.848+00', SYSTEM_COMBINE_CLOB(646), FALSE, FALSE, NULL), -(579, 'Card', 31, 1, TIMESTAMP WITH TIME ZONE '2023-01-25 12:31:36.008+00', SYSTEM_COMBINE_CLOB(647), FALSE, FALSE, NULL), -(580, 'Card', 1, 1, TIMESTAMP WITH TIME ZONE '2023-01-25 12:33:01.375+00', SYSTEM_COMBINE_CLOB(648), FALSE, FALSE, NULL), -(581, 'Card', 33, 1, TIMESTAMP WITH TIME ZONE '2023-01-25 12:33:59.488+00', SYSTEM_COMBINE_CLOB(649), FALSE, FALSE, NULL), +(576, 'Card', 33, 1, TIMESTAMP WITH TIME ZONE '2023-01-25 12:25:18.848+00', SYSTEM_COMBINE_CLOB(647), FALSE, FALSE, NULL), +(579, 'Card', 31, 1, TIMESTAMP WITH TIME ZONE '2023-01-25 12:31:36.008+00', SYSTEM_COMBINE_CLOB(648), FALSE, FALSE, NULL), +(580, 'Card', 1, 1, TIMESTAMP WITH TIME ZONE '2023-01-25 12:33:01.375+00', SYSTEM_COMBINE_CLOB(649), FALSE, FALSE, NULL), +(581, 'Card', 33, 1, TIMESTAMP WITH TIME ZONE '2023-01-25 12:33:59.488+00', SYSTEM_COMBINE_CLOB(650), FALSE, FALSE, NULL), (582, 'Card', 30, 1, TIMESTAMP WITH TIME ZONE '2023-01-25 12:34:39.511+00', '{"description":null,"archived":false,"collection_position":null,"table_id":70,"database_id":3,"enable_embedding":false,"collection_id":8,"query_type":"query","name":"% of Total Registrations Certified","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"query":{"aggregation":[["count"]],"breakout":[["expression","Status"]],"expressions":{"Status":["case",[[["=",["field",682,null],"REGISTERED"],"Not Certified"],[["=",["field",682,null],"CERTIFIED"],"Certified"]]]},"filter":["and",["=",["field",666,null],"Birth"],["time-interval",["field",677,null],-12,"month"]],"source-table":70},"type":"query"},"id":30,"parameter_mappings":[],"display":"pie","entity_id":"i9_4VwkR62cl03HLkb9e7","collection_preview":true,"visualization_settings":{"pie.colors":{"Certified":"#E75454","Not Certified":"#F7C4C4"}},"is_write":false,"parameters":[],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL), -(585, 'Card', 12, 1, TIMESTAMP WITH TIME ZONE '2023-01-25 12:42:53.396+00', SYSTEM_COMBINE_CLOB(650), FALSE, FALSE, NULL), +(585, 'Card', 12, 1, TIMESTAMP WITH TIME ZONE '2023-01-25 12:42:53.396+00', SYSTEM_COMBINE_CLOB(651), FALSE, FALSE, NULL), (588, 'Card', 29, 1, TIMESTAMP WITH TIME ZONE '2023-01-25 13:36:37.205+00', '{"description":null,"archived":false,"collection_position":null,"table_id":70,"database_id":3,"enable_embedding":false,"collection_id":15,"query_type":"query","name":"Live Births by Type of Birth","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"query":{"aggregation":[["count"]],"breakout":[["expression","TypeOfBirth"]],"expressions":{"TypeOfBirth":["case",[[["=",["field",674,null],"SINGLE"],"Single"],[["=",["field",674,null],"TWIN"],"Twin"],[["=",["field",674,null],"TRIPLET"],"Triplet"],[["=",["field",674,null],"QUADRUPLET"],"Quadruplet"]]]},"filter":["and",["=",["field",666,null],"Birth"],["time-interval",["field",677,null],-12,"month"]],"order-by":[["desc",["aggregation",0,null]]],"source-table":70},"type":"query"},"id":29,"parameter_mappings":[],"display":"pie","entity_id":"GOqql9fnmIgyeOChWso6x","collection_preview":true,"visualization_settings":{"pie.colors":{"Quadruplet":"#FBE499","Single":"#F7C41F"}},"is_write":false,"parameters":[],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(651, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":10,"query_type":"native","name":"Live birth by literacy of parents","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterGender":{"id":"e8218caf-e2aa-573e-1776-02cffff42462","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"bf69e085-3c01-7924-5108-7151c85dc371","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null}},"query":"[\n {$facet: {\n fathersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersLiteracy\": \"$fathersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"fathersLiteracy\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n }\n ]\n ,mothersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersLiteracy\": \"$mothersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"mothersLiteracy\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n }\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersLiteracy\", \"$mothersLiteracy\" ]\n ', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(651, 1, ' }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Category'': \"$allInfo._id\"\n , ''Literacy'': \"$allInfo.literacy\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Literacy\": 1\n }\n }\n]\n","collection":"registrations"},"database":3},"id":18,"parameter_mappings":[],"display":"bar","entity_id":"eRSJUaHW6haiucK8BtpC_","collection_preview":true,"visualization_settings":{"graph.show_values":true,"graph.label_value_formatting":"auto","graph.dimensions":["Category","Literacy"],"series_settings":{"mothersLiteracy":{"title":"mother"},"fathersLiteracy":{"title":"father"}},"graph.x_axis.title_text":"Literacy","graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"e8218caf-e2aa-573e-1776-02cffff42462","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"bf69e085-3c01-7924-5108-7151c85dc371","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(652, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":10,"query_type":"native","name":"Live births by literacy of parents","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterGender":{"id":"e8218caf-e2aa-573e-1776-02cffff42462","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"bf69e085-3c01-7924-5108-7151c85dc371","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null}},"query":"[\n {$facet: {\n fathersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersLiteracy\": \"$fathersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"fathersLiteracy\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n }\n ]\n ,mothersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersLiteracy\": \"$mothersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"mothersLiteracy\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n }\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersLiteracy\", \"$mothersLiteracy\" ]\n ', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(652, 1, ' }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Category'': \"$allInfo._id\"\n , ''Literacy'': \"$allInfo.literacy\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Literacy\": 1\n }\n }\n]\n","collection":"registrations"},"database":3},"id":18,"parameter_mappings":[],"display":"bar","entity_id":"eRSJUaHW6haiucK8BtpC_","collection_preview":true,"visualization_settings":{"graph.show_values":true,"graph.label_value_formatting":"auto","graph.dimensions":["Category","Literacy"],"series_settings":{"mothersLiteracy":{"title":"mother"},"fathersLiteracy":{"title":"father"}},"graph.x_axis.title_text":"Literacy","graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"e8218caf-e2aa-573e-1776-02cffff42462","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"bf69e085-3c01-7924-5108-7151c85dc371","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(653, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":10,"query_type":"native","name":"Live Births by Literacy of Parents","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterGender":{"id":"e8218caf-e2aa-573e-1776-02cffff42462","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"bf69e085-3c01-7924-5108-7151c85dc371","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null}},"query":"[\n {$facet: {\n fathersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersLiteracy\": \"$fathersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"fathersLiteracy\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n }\n ]\n ,mothersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersLiteracy\": \"$mothersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"mothersLiteracy\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n }\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersLiteracy\", \"$mothersLiteracy\" ]\n ', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(652, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":10,"query_type":"native","name":"Live birth by literacy of parents","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterGender":{"id":"e8218caf-e2aa-573e-1776-02cffff42462","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"bf69e085-3c01-7924-5108-7151c85dc371","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null}},"query":"[\n {$facet: {\n fathersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersLiteracy\": \"$fathersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"fathersLiteracy\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n }\n ]\n ,mothersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersLiteracy\": \"$mothersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"mothersLiteracy\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n }\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersLiteracy\", \"$mothersLiteracy\" ]\n ', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(652, 1, ' }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Category'': \"$allInfo._id\"\n , ''Literacy'': \"$allInfo.literacy\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Literacy\": 1\n }\n }\n]\n","collection":"registrations"},"database":3},"id":18,"parameter_mappings":[],"display":"bar","entity_id":"eRSJUaHW6haiucK8BtpC_","collection_preview":true,"visualization_settings":{"graph.show_values":true,"graph.label_value_formatting":"auto","graph.dimensions":["Category","Literacy"],"series_settings":{"mothersLiteracy":{"title":"mother"},"fathersLiteracy":{"title":"father"}},"graph.x_axis.title_text":"Literacy","graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"e8218caf-e2aa-573e-1776-02cffff42462","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"bf69e085-3c01-7924-5108-7151c85dc371","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(653, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":10,"query_type":"native","name":"Live births by literacy of parents","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterGender":{"id":"e8218caf-e2aa-573e-1776-02cffff42462","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"bf69e085-3c01-7924-5108-7151c85dc371","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null}},"query":"[\n {$facet: {\n fathersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersLiteracy\": \"$fathersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"fathersLiteracy\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n }\n ]\n ,mothersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersLiteracy\": \"$mothersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"mothersLiteracy\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n }\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersLiteracy\", \"$mothersLiteracy\" ]\n ', NULL); INSERT INTO SYSTEM_LOB_STREAM VALUES(653, 1, ' }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Category'': \"$allInfo._id\"\n , ''Literacy'': \"$allInfo.literacy\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Literacy\": 1\n }\n }\n]\n","collection":"registrations"},"database":3},"id":18,"parameter_mappings":[],"display":"bar","entity_id":"eRSJUaHW6haiucK8BtpC_","collection_preview":true,"visualization_settings":{"graph.show_values":true,"graph.label_value_formatting":"auto","graph.dimensions":["Category","Literacy"],"series_settings":{"mothersLiteracy":{"title":"mother"},"fathersLiteracy":{"title":"father"}},"graph.x_axis.title_text":"Literacy","graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"e8218caf-e2aa-573e-1776-02cffff42462","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"bf69e085-3c01-7924-5108-7151c85dc371","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(654, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":10,"query_type":"native","name":"Live Births by Literacy of Parents","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterGender":{"id":"e8218caf-e2aa-573e-1776-02cffff42462","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"bf69e085-3c01-7924-5108-7151c85dc371","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null}},"query":"[\n {$facet: {\n fathersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersLiteracy\": \"$fathersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"fathersLiteracy\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n }\n ]\n ,mothersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersLiteracy\": \"$mothersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"mothersLiteracy\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n }\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersLiteracy\", \"$mothersLiteracy\" ]\n ', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(654, 1, ' }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Category'': \"$allInfo._id\"\n , ''Literacy'': \"$allInfo.literacy\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Literacy\": 1\n }\n }\n]\n","collection":"registrations"},"database":3},"id":18,"parameter_mappings":[],"display":"bar","entity_id":"eRSJUaHW6haiucK8BtpC_","collection_preview":true,"visualization_settings":{"graph.show_values":true,"graph.label_value_formatting":"auto","graph.dimensions":["Category","Literacy"],"series_settings":{"mothersLiteracy":{"title":"mother"},"fathersLiteracy":{"title":"father"}},"graph.x_axis.title_text":"Literacy","graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"e8218caf-e2aa-573e-1776-02cffff42462","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"bf69e085-3c01-7924-5108-7151c85dc371","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); INSERT INTO "PUBLIC"."REVISION" VALUES (589, 'Card', 14, 1, TIMESTAMP WITH TIME ZONE '2023-01-25 13:51:35.9+00', '{"description":null,"archived":false,"collection_position":null,"table_id":70,"database_id":3,"enable_embedding":false,"collection_id":null,"query_type":"query","name":"Registrations over time","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"query","query":{"aggregation":[["count"]],"breakout":[["field",677,{"temporal-unit":"month"}]],"filter":["=",["field",666,null],"Birth"],"source-table":70},"database":3},"id":14,"parameter_mappings":[],"display":"line","entity_id":"qNwCeJEl62KWFEc_8ueNS","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_trendline":false,"graph.show_values":false,"graph.x_axis.axis_enabled":true,"graph.x_axis.title_text":"Over Time","graph.metrics":["count"],"column_settings":{"[\"ref\",[\"field\",677,null]]":{"date_abbreviate":true}},"graph.x_axis.scale":"timeseries","graph.dimensions":["createdAt"]},"is_write":false,"parameters":[],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL), (590, 'Card', 28, 1, TIMESTAMP WITH TIME ZONE '2023-01-26 06:57:00.119+00', '{"description":null,"archived":false,"collection_position":null,"table_id":71,"database_id":3,"enable_embedding":false,"collection_id":17,"query_type":"query","name":"Corrections by type","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"query","query":{"source-table":71,"expressions":{"ReasonForCorrection":["case",[[["=",["field",688,null],"CLERICAL_ERROR"],"Clerical Error"],[["=",["field",688,null],"JUDICIAL_ORDER"],"Judicial Order"]]]},"filter":["and",["=",["field",693,null],"Birth"],["time-interval",["field",695,null],"current","year"]],"aggregation":[["count"]],"breakout":[["expression","ReasonForCorrection"]]},"database":3},"id":28,"parameter_mappings":[],"display":"pie","entity_id":"__hZ2xD-7VCBJ7mLFxB9Y","collection_preview":true,"visualization_settings":{"pie.colors":{"Clerical Error":"#8A5EB0"}},"is_write":false,"parameters":[],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL), -(593, 'Card', 18, 1, TIMESTAMP WITH TIME ZONE '2023-01-26 08:56:29.743+00', SYSTEM_COMBINE_CLOB(651), FALSE, FALSE, NULL), -(594, 'Card', 18, 1, TIMESTAMP WITH TIME ZONE '2023-01-26 08:56:46.886+00', SYSTEM_COMBINE_CLOB(652), FALSE, FALSE, NULL), -(595, 'Card', 18, 1, TIMESTAMP WITH TIME ZONE '2023-01-26 08:57:06.258+00', SYSTEM_COMBINE_CLOB(653), FALSE, FALSE, NULL), +(593, 'Card', 18, 1, TIMESTAMP WITH TIME ZONE '2023-01-26 08:56:29.743+00', SYSTEM_COMBINE_CLOB(652), FALSE, FALSE, NULL), +(594, 'Card', 18, 1, TIMESTAMP WITH TIME ZONE '2023-01-26 08:56:46.886+00', SYSTEM_COMBINE_CLOB(653), FALSE, FALSE, NULL), +(595, 'Card', 18, 1, TIMESTAMP WITH TIME ZONE '2023-01-26 08:57:06.258+00', SYSTEM_COMBINE_CLOB(654), FALSE, FALSE, NULL), (599, 'Card', 28, 1, TIMESTAMP WITH TIME ZONE '2023-01-26 09:00:03.216+00', '{"description":null,"archived":false,"collection_position":null,"table_id":71,"database_id":3,"enable_embedding":false,"collection_id":17,"query_type":"query","name":"Record Corrections by Type","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"query","query":{"source-table":71,"expressions":{"ReasonForCorrection":["case",[[["=",["field",688,null],"CLERICAL_ERROR"],"Clerical Error"],[["=",["field",688,null],"JUDICIAL_ORDER"],"Judicial Order"]]]},"filter":["and",["=",["field",693,null],"Birth"],["time-interval",["field",695,null],"current","year"]],"aggregation":[["count"]],"breakout":[["expression","ReasonForCorrection"]]},"database":3},"id":28,"parameter_mappings":[],"display":"pie","entity_id":"__hZ2xD-7VCBJ7mLFxB9Y","collection_preview":true,"visualization_settings":{"pie.colors":{"Clerical Error":"#8A5EB0"}},"is_write":false,"parameters":[],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL), (604, 'Dashboard', 3, 1, TIMESTAMP WITH TIME ZONE '2023-01-26 09:01:47.789+00', '{"description":null,"name":"Statistics Dashboard","cache_ttl":null,"cards":[{"size_x":5,"size_y":4,"row":0,"col":5,"id":21,"card_id":20,"series":[]},{"size_x":5,"size_y":4,"row":0,"col":0,"id":22,"card_id":19,"series":[]},{"size_x":4,"size_y":4,"row":0,"col":10,"id":24,"card_id":18,"series":[]},{"size_x":4,"size_y":4,"row":0,"col":14,"id":25,"card_id":21,"series":[]},{"size_x":9,"size_y":4,"row":4,"col":9,"id":29,"card_id":27,"series":[]},{"size_x":9,"size_y":4,"row":4,"col":0,"id":31,"card_id":29,"series":[]}]}', FALSE, FALSE, NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(654, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":11,"query_type":"native","name":"Live births by Order","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , birthOrder: ''$birthOrder''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$eq: [''$birthOrder'', 1]}] }, then: ''1''},\n {case: {$and: [{$eq: [''$birthOrder'', 2]}] }, then: ''2''},\n {case: {$and: [{$eq: [''$birthOrder'', 3]}] }, then: ''3''},\n {case: {$and: [{$eq: [''$birthOrder'', 4]}] }, then: ''4''},\n {case: {$and: [{$eq: [''$birthOrder'', 5]}] }, then: ''5''},\n {case: {$and: [{$gte: [''$birthOrder'', 6]}] }, then: ''6+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Order\": 1\n }\n }\n]","template-tags":{"filterGender":{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"996f1d61-a845-0afe-bb4c-f36ac4ab32be","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null}}},"type":"native"},"id":19,"parameter_mappings":[],"display":"bar","entity_id":"L6nXdi04nvxgEh1eJYrwR","collection_preview":true,"visualization_settings":{"graph.show_values":true,"pie.dimension":"birthOrder","graph.series_or', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(654, 1, 'der_dimension":null,"graph.x_axis.title_text":"Birth Order","graph.metrics":["Count"],"graph.series_order":null,"pie.metric":"count","series_settings":{"Count":{"color":"#F7C41F"}},"graph.dimensions":["Order"]},"is_write":false,"parameters":[{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"996f1d61-a845-0afe-bb4c-f36ac4ab32be","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(655, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":12,"query_type":"native","name":"Live births by age of Mother","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , mothersAge: ''$mothersAgeAtBirthOfChildInYears''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$gte: [''$mothersAge'', 9]}, {$lt: [''$mothersAge'', 15]}] }, then: ''09-14''},\n {case: {$and: [{$gte: [''$mothersAge'', 15]}, {$lt: [''$mothersAge'', 20]}] }, then: ''15-19''},\n {case: {$and: [{$gte: [''$mothersAge'', 20]}, {$lt: [''$mothersAge'', 25]}] }, then: ''20-24''},\n {case: {$and: [{$gte: [''$mothersAge'', 25]}, {$lt: [''$mothersAge'', 30]}] }, then: ''25-29''},\n {case: {$and: [{$gte: [''$mothersAge'', 30]}, {$lt: [''$mothersAge'', 35]}] }, then: ''30-34''},\n {case: {$and: [{$gte: [''$mothersAge'', 35]}, {$lt: [''$mothersAge'', 40]}] }, then: ''35-39''},\n {case: {$and: [{$gte: [''$mothersAge'', 40]}, {$lt: [''$mothersAge'', 45]}] }, then: ''40-44''},\n {case: {$and: [{$gte: [''$mothersAge'', 45]}, {$lt: [''$mothersAge'', 50]}] }, then: ''45-49''},\n {case: {$and: [{$gte: [''$mothersAge'', 50]}, {$lt: [''$mothersAge'', 55]}] }, then: ''50-54''},\n {case: {$and: [{$gte: [''$mothersAge'', 55]}, {$lt: [''$mothersAge'', 60]}] }, then: ''55-59''},\n {case: {$and: [{$gte: [''$mothersAge'', 60]}] }, then: ''60+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Order\": 1\n }\n }\n]","template-tags":{"filterGender":{"id":"56559614-c685-9d81-d44b-a688fe5b103b","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","name":"filt', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(655, 1, 'erState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"8b07b619-ea79-a772-e83a-92f986ab040c","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null}}},"type":"native"},"id":20,"parameter_mappings":[],"display":"bar","entity_id":"PcnknQN2IYs_mJkwA8yRq","collection_preview":true,"visualization_settings":{"graph.x_axis.title_text":"Age","graph.dimensions":["Order"],"table.cell_column":"Count","table.pivot_column":"Order","series_settings":{"Count":{"color":"#E75454"}},"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"56559614-c685-9d81-d44b-a688fe5b103b","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"8b07b619-ea79-a772-e83a-92f986ab040c","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(656, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":10,"query_type":"native","name":"Live Births by Literacy of Parents","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterGender":{"id":"e8218caf-e2aa-573e-1776-02cffff42462","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"bf69e085-3c01-7924-5108-7151c85dc371","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null}},"query":"[\n {$facet: {\n fathersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersLiteracy\": \"$fathersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"fathersLiteracy\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n }\n ]\n ,mothersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersLiteracy\": \"$mothersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"mothersLiteracy\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n }\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersLiteracy\", \"$mothersLiteracy\" ]\n ', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(656, 1, ' }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Category'': \"$allInfo._id\"\n , ''Literacy'': \"$allInfo.literacy\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Literacy\": 1\n }\n }\n]\n","collection":"registrations"},"database":3},"id":18,"parameter_mappings":[],"display":"bar","entity_id":"eRSJUaHW6haiucK8BtpC_","collection_preview":true,"visualization_settings":{"graph.show_values":true,"graph.label_value_formatting":"auto","graph.dimensions":["Category","Literacy"],"series_settings":{"mothersLiteracy":{"title":"mother","color":"#ED8535"},"fathersLiteracy":{"title":"father","color":"#8A5EB0"}},"graph.x_axis.title_text":"Literacy","graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"e8218caf-e2aa-573e-1776-02cffff42462","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"bf69e085-3c01-7924-5108-7151c85dc371","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(657, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":14,"query_type":"native","name":"Live Births by Level of Education of Parent","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterGender":{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null}},"query":"[\n {$facet: {\n fathersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersAttainment\": \"$fathersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"KORANIC\"] },\n then: \"Koranic\"\n },\n {\n case: { $eq: [\"$_id\", \"MODERN\"] },\n then: \"Modern\"\n },\n {\n case: { $eq: [\"$_id\", \"HIGHER_SCHOOL\"] },\n then: \"Higher School\"\n },\n {\n case: { $eq: [\"$_id\", \"PRIMARY\"] },\n then: \"Primary\"\n },\n {\n case: { $eq: [\"$_id\", \"UNIVERSITY\"] },\n then: \"University\"\n },\n {\n case: { $eq: [\"$_id\", \"POLYTECNIC_NCE\"] },\n then: \"Polytecnic NCE\"\n },\n {\n case: { $eq: [\"$_id\", \"SECONDARY\"] },\n then: \"Secondary\"\n }\n ],\n default: \"Others\"\n }\n }\n , count: \"$count\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {$addFields: {\n attainment: \"fathersAttainment\"\n }}\n ]\n , mothersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersAttainment\": \"$mothersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\":', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(657, 1, ' {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"KORANIC\"] },\n then: \"Koranic\"\n },\n {\n case: { $eq: [\"$_id\", \"MODERN\"] },\n then: \"Modern\"\n },\n {\n case: { $eq: [\"$_id\", \"HIGHER_SCHOOL\"] },\n then: \"Higher School\"\n },\n {\n case: { $eq: [\"$_id\", \"PRIMARY\"] },\n then: \"Primary\"\n },\n {\n case: { $eq: [\"$_id\", \"UNIVERSITY\"] },\n then: \"University\"\n },\n {\n case: { $eq: [\"$_id\", \"POLYTECNIC_NCE\"] },\n then: \"Polytecnic NCE\"\n },\n {\n case: { $eq: [\"$_id\", \"SECONDARY\"] },\n then: \"Secondary\"\n }\n ],\n default: \"Others\"\n }\n }\n , count: \"$count\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {$addFields: {\n attainment: \"mothersAttainment\"\n }}\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersAttainment\", \"$mothersAttainment\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Educational Attainment'': \"$allInfo._id\"\n , ''Relationship'': \"$allInfo.attainment\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Relationship\": 1\n }\n }\n]\n","collection":"registrations"},"database":3},"id":21,"parameter_mappings":[],"display":"bar","entity_id":"W6bdia0Vw-6PC1efnHIR4","collection_preview":true,"visualization_settings":{"graph.show_values":true,"pie.dimension":"Educational Attainment","graph.x_axis.axis_enabled":true,"graph.y_axis.auto_split":true,"graph.metrics":["Count"],"pie.metric":"Count","series_settings":{"mothersAttainment":{"title":"mother","color":"#E75454"},"fathersAttainment":{"title":"father","color":"#69C8C8"}},"graph.y_axis.auto_range":true,"graph.dimensions":["Educational Attainment","Relationship"]},"is_write":false,"parameters":[{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(655, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":11,"query_type":"native","name":"Live births by Order","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , birthOrder: ''$birthOrder''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$eq: [''$birthOrder'', 1]}] }, then: ''1''},\n {case: {$and: [{$eq: [''$birthOrder'', 2]}] }, then: ''2''},\n {case: {$and: [{$eq: [''$birthOrder'', 3]}] }, then: ''3''},\n {case: {$and: [{$eq: [''$birthOrder'', 4]}] }, then: ''4''},\n {case: {$and: [{$eq: [''$birthOrder'', 5]}] }, then: ''5''},\n {case: {$and: [{$gte: [''$birthOrder'', 6]}] }, then: ''6+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Order\": 1\n }\n }\n]","template-tags":{"filterGender":{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"996f1d61-a845-0afe-bb4c-f36ac4ab32be","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null}}},"type":"native"},"id":19,"parameter_mappings":[],"display":"bar","entity_id":"L6nXdi04nvxgEh1eJYrwR","collection_preview":true,"visualization_settings":{"graph.show_values":true,"pie.dimension":"birthOrder","graph.series_or', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(655, 1, 'der_dimension":null,"graph.x_axis.title_text":"Birth Order","graph.metrics":["Count"],"graph.series_order":null,"pie.metric":"count","series_settings":{"Count":{"color":"#F7C41F"}},"graph.dimensions":["Order"]},"is_write":false,"parameters":[{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"996f1d61-a845-0afe-bb4c-f36ac4ab32be","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(656, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":12,"query_type":"native","name":"Live births by age of Mother","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , mothersAge: ''$mothersAgeAtBirthOfChildInYears''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$gte: [''$mothersAge'', 9]}, {$lt: [''$mothersAge'', 15]}] }, then: ''09-14''},\n {case: {$and: [{$gte: [''$mothersAge'', 15]}, {$lt: [''$mothersAge'', 20]}] }, then: ''15-19''},\n {case: {$and: [{$gte: [''$mothersAge'', 20]}, {$lt: [''$mothersAge'', 25]}] }, then: ''20-24''},\n {case: {$and: [{$gte: [''$mothersAge'', 25]}, {$lt: [''$mothersAge'', 30]}] }, then: ''25-29''},\n {case: {$and: [{$gte: [''$mothersAge'', 30]}, {$lt: [''$mothersAge'', 35]}] }, then: ''30-34''},\n {case: {$and: [{$gte: [''$mothersAge'', 35]}, {$lt: [''$mothersAge'', 40]}] }, then: ''35-39''},\n {case: {$and: [{$gte: [''$mothersAge'', 40]}, {$lt: [''$mothersAge'', 45]}] }, then: ''40-44''},\n {case: {$and: [{$gte: [''$mothersAge'', 45]}, {$lt: [''$mothersAge'', 50]}] }, then: ''45-49''},\n {case: {$and: [{$gte: [''$mothersAge'', 50]}, {$lt: [''$mothersAge'', 55]}] }, then: ''50-54''},\n {case: {$and: [{$gte: [''$mothersAge'', 55]}, {$lt: [''$mothersAge'', 60]}] }, then: ''55-59''},\n {case: {$and: [{$gte: [''$mothersAge'', 60]}] }, then: ''60+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Order\": 1\n }\n }\n]","template-tags":{"filterGender":{"id":"56559614-c685-9d81-d44b-a688fe5b103b","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","name":"filt', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(656, 1, 'erState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"8b07b619-ea79-a772-e83a-92f986ab040c","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null}}},"type":"native"},"id":20,"parameter_mappings":[],"display":"bar","entity_id":"PcnknQN2IYs_mJkwA8yRq","collection_preview":true,"visualization_settings":{"graph.x_axis.title_text":"Age","graph.dimensions":["Order"],"table.cell_column":"Count","table.pivot_column":"Order","series_settings":{"Count":{"color":"#E75454"}},"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"56559614-c685-9d81-d44b-a688fe5b103b","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"8b07b619-ea79-a772-e83a-92f986ab040c","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(657, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":10,"query_type":"native","name":"Live Births by Literacy of Parents","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterGender":{"id":"e8218caf-e2aa-573e-1776-02cffff42462","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"bf69e085-3c01-7924-5108-7151c85dc371","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null}},"query":"[\n {$facet: {\n fathersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersLiteracy\": \"$fathersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"fathersLiteracy\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n }\n ]\n ,mothersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersLiteracy\": \"$mothersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"mothersLiteracy\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n }\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersLiteracy\", \"$mothersLiteracy\" ]\n ', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(657, 1, ' }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Category'': \"$allInfo._id\"\n , ''Literacy'': \"$allInfo.literacy\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Literacy\": 1\n }\n }\n]\n","collection":"registrations"},"database":3},"id":18,"parameter_mappings":[],"display":"bar","entity_id":"eRSJUaHW6haiucK8BtpC_","collection_preview":true,"visualization_settings":{"graph.show_values":true,"graph.label_value_formatting":"auto","graph.dimensions":["Category","Literacy"],"series_settings":{"mothersLiteracy":{"title":"mother","color":"#ED8535"},"fathersLiteracy":{"title":"father","color":"#8A5EB0"}},"graph.x_axis.title_text":"Literacy","graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"e8218caf-e2aa-573e-1776-02cffff42462","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"bf69e085-3c01-7924-5108-7151c85dc371","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(658, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":14,"query_type":"native","name":"Live Births by Level of Education of Parent","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterGender":{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null}},"query":"[\n {$facet: {\n fathersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersAttainment\": \"$fathersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"KORANIC\"] },\n then: \"Koranic\"\n },\n {\n case: { $eq: [\"$_id\", \"MODERN\"] },\n then: \"Modern\"\n },\n {\n case: { $eq: [\"$_id\", \"HIGHER_SCHOOL\"] },\n then: \"Higher School\"\n },\n {\n case: { $eq: [\"$_id\", \"PRIMARY\"] },\n then: \"Primary\"\n },\n {\n case: { $eq: [\"$_id\", \"UNIVERSITY\"] },\n then: \"University\"\n },\n {\n case: { $eq: [\"$_id\", \"POLYTECNIC_NCE\"] },\n then: \"Polytecnic NCE\"\n },\n {\n case: { $eq: [\"$_id\", \"SECONDARY\"] },\n then: \"Secondary\"\n }\n ],\n default: \"Others\"\n }\n }\n , count: \"$count\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {$addFields: {\n attainment: \"fathersAttainment\"\n }}\n ]\n , mothersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersAttainment\": \"$mothersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\":', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(658, 1, ' {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"KORANIC\"] },\n then: \"Koranic\"\n },\n {\n case: { $eq: [\"$_id\", \"MODERN\"] },\n then: \"Modern\"\n },\n {\n case: { $eq: [\"$_id\", \"HIGHER_SCHOOL\"] },\n then: \"Higher School\"\n },\n {\n case: { $eq: [\"$_id\", \"PRIMARY\"] },\n then: \"Primary\"\n },\n {\n case: { $eq: [\"$_id\", \"UNIVERSITY\"] },\n then: \"University\"\n },\n {\n case: { $eq: [\"$_id\", \"POLYTECNIC_NCE\"] },\n then: \"Polytecnic NCE\"\n },\n {\n case: { $eq: [\"$_id\", \"SECONDARY\"] },\n then: \"Secondary\"\n }\n ],\n default: \"Others\"\n }\n }\n , count: \"$count\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {$addFields: {\n attainment: \"mothersAttainment\"\n }}\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersAttainment\", \"$mothersAttainment\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Educational Attainment'': \"$allInfo._id\"\n , ''Relationship'': \"$allInfo.attainment\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Relationship\": 1\n }\n }\n]\n","collection":"registrations"},"database":3},"id":21,"parameter_mappings":[],"display":"bar","entity_id":"W6bdia0Vw-6PC1efnHIR4","collection_preview":true,"visualization_settings":{"graph.show_values":true,"pie.dimension":"Educational Attainment","graph.x_axis.axis_enabled":true,"graph.y_axis.auto_split":true,"graph.metrics":["Count"],"pie.metric":"Count","series_settings":{"mothersAttainment":{"title":"mother","color":"#E75454"},"fathersAttainment":{"title":"father","color":"#69C8C8"}},"graph.y_axis.auto_range":true,"graph.dimensions":["Educational Attainment","Relationship"]},"is_write":false,"parameters":[{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); INSERT INTO "PUBLIC"."REVISION" VALUES (605, 'Dashboard', 3, 1, TIMESTAMP WITH TIME ZONE '2023-01-26 09:02:46.141+00', '{"description":null,"name":"Statistics Dashboard","cache_ttl":null,"cards":[{"size_x":9,"size_y":4,"row":0,"col":9,"id":21,"card_id":20,"series":[]},{"size_x":9,"size_y":4,"row":0,"col":0,"id":22,"card_id":19,"series":[]},{"size_x":9,"size_y":4,"row":4,"col":0,"id":24,"card_id":18,"series":[]},{"size_x":9,"size_y":4,"row":4,"col":9,"id":25,"card_id":21,"series":[]},{"size_x":9,"size_y":4,"row":8,"col":0,"id":29,"card_id":27,"series":[]},{"size_x":9,"size_y":4,"row":8,"col":9,"id":31,"card_id":29,"series":[]}]}', FALSE, FALSE, NULL), (606, 'Dashboard', 3, 1, TIMESTAMP WITH TIME ZONE '2023-01-26 09:02:47.547+00', '{"description":null,"name":"Statistics Dashboard","cache_ttl":null,"cards":[{"size_x":9,"size_y":4,"row":0,"col":9,"id":21,"card_id":20,"series":[]},{"size_x":9,"size_y":4,"row":0,"col":0,"id":22,"card_id":19,"series":[]},{"size_x":9,"size_y":4,"row":4,"col":0,"id":24,"card_id":18,"series":[]},{"size_x":9,"size_y":4,"row":4,"col":9,"id":25,"card_id":21,"series":[]},{"size_x":9,"size_y":4,"row":8,"col":0,"id":29,"card_id":27,"series":[]},{"size_x":9,"size_y":4,"row":8,"col":9,"id":31,"card_id":29,"series":[]}]}', FALSE, FALSE, NULL), -(607, 'Card', 19, 1, TIMESTAMP WITH TIME ZONE '2023-01-26 09:06:07.884+00', SYSTEM_COMBINE_CLOB(654), FALSE, FALSE, NULL), -(608, 'Card', 20, 1, TIMESTAMP WITH TIME ZONE '2023-01-26 09:07:24.832+00', SYSTEM_COMBINE_CLOB(655), FALSE, FALSE, NULL), -(609, 'Card', 18, 1, TIMESTAMP WITH TIME ZONE '2023-01-26 09:07:59.564+00', SYSTEM_COMBINE_CLOB(656), FALSE, FALSE, NULL), -(610, 'Card', 21, 1, TIMESTAMP WITH TIME ZONE '2023-01-26 09:08:21.662+00', SYSTEM_COMBINE_CLOB(657), FALSE, FALSE, NULL), +(607, 'Card', 19, 1, TIMESTAMP WITH TIME ZONE '2023-01-26 09:06:07.884+00', SYSTEM_COMBINE_CLOB(655), FALSE, FALSE, NULL), +(608, 'Card', 20, 1, TIMESTAMP WITH TIME ZONE '2023-01-26 09:07:24.832+00', SYSTEM_COMBINE_CLOB(656), FALSE, FALSE, NULL), +(609, 'Card', 18, 1, TIMESTAMP WITH TIME ZONE '2023-01-26 09:07:59.564+00', SYSTEM_COMBINE_CLOB(657), FALSE, FALSE, NULL), +(610, 'Card', 21, 1, TIMESTAMP WITH TIME ZONE '2023-01-26 09:08:21.662+00', SYSTEM_COMBINE_CLOB(658), FALSE, FALSE, NULL), (611, 'Card', 27, 1, TIMESTAMP WITH TIME ZONE '2023-01-26 09:09:12.951+00', '{"description":null,"archived":false,"collection_position":null,"table_id":70,"database_id":3,"enable_embedding":false,"collection_id":9,"query_type":"query","name":"Place of birth","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"query":{"aggregation":[["count"]],"breakout":[["expression","PlaceOfBirth"]],"expressions":{"PlaceOfBirth":["case",[[["=",["field",668,null],"BUS"],"Bus"],[["=",["field",668,null],"CAR_TAXI"],"Taxi"],[["=",["field",668,null],"HEALTH_FACILITY"],"Health Facility"],[["=",["field",668,null],"MATERNITY_HOME"],"Maternity Home"],[["=",["field",668,null],"PRIVATE_HOME"],"Private Home"],[["=",["field",668,null],"TRADITIONAL_DOCTORS"],"Traditional Doctors"]]]},"filter":["and",["=",["field",666,null],"Birth"],["time-interval",["field",677,null],-12,"month"]],"source-table":70},"type":"query"},"id":27,"parameter_mappings":[],"display":"pie","entity_id":"AfR2OybIvG3i-a1qt-k0u","collection_preview":true,"visualization_settings":{"pie.colors":{"Health Facility":"#689636","Taxi":"#69C8C8"}},"is_write":false,"parameters":[],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL), (612, 'Card', 29, 1, TIMESTAMP WITH TIME ZONE '2023-01-26 09:10:07.391+00', '{"description":null,"archived":false,"collection_position":null,"table_id":70,"database_id":3,"enable_embedding":false,"collection_id":15,"query_type":"query","name":"Live Births by Type of Birth","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"query":{"aggregation":[["count"]],"breakout":[["expression","TypeOfBirth"]],"expressions":{"TypeOfBirth":["case",[[["=",["field",674,null],"SINGLE"],"Single"],[["=",["field",674,null],"TWIN"],"Twin"],[["=",["field",674,null],"TRIPLET"],"Triplet"],[["=",["field",674,null],"QUADRUPLET"],"Quadruplet"]]]},"filter":["and",["=",["field",666,null],"Birth"],["time-interval",["field",677,null],-12,"month"]],"order-by":[["desc",["aggregation",0,null]]],"source-table":70},"type":"query"},"id":29,"parameter_mappings":[],"display":"pie","entity_id":"GOqql9fnmIgyeOChWso6x","collection_preview":true,"visualization_settings":{"pie.colors":{"Quadruplet":"#8A5EB0","Single":"#F7C41F"}},"is_write":false,"parameters":[],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(658, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by Age","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {\n $match: {\n $and: [{ _id: { $ne: null } }\n [[{{ filterDate }} ]]\n [[{{ filterGender }} ]]\n [[{{ filterEvent }}]]\n [[{{ filterState }}]]\n [[{{ filterOffice }}]]\n ]\n }\n },\n {\n $facet: {\n totals: [{ $count: ''total'' }, { $addFields: { category: ''Total'' } }],\n ageGroups: [\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 365] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''< 1''\n }\n ],\n default: ''''\n }\n }\n }\n },\n {$match: {\n par: {$ne: ''''}\n }}\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n category: ''$_id.par'',\n total: ''$totalCustomer''\n }\n }\n ],\n ageGroups2: [\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 1825] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''< 5''\n }\n ],\n default: ''5+''\n }\n }\n }\n },\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n category: ''$_id.par'',\n total: ''$totalCustomer''\n }\n }\n ],\n }\n },\n {\n $project: {\n mergedArray: { $concatArrays: [''$totals'', ''$ageGroups'', ''$ageGroups2''] }\n }\n },\n { $unwind: ''$mergedArray'' },\n { $replaceRoot: { newRoot: ''$mergedArray'' } },\n {\n $addFields: {\n order: {\n $cond: {\n if: { $eq: [''$category'', ''Total''] },\n then: 1,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''< 1''] },\n then: 2,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''< 5''] },\n then: 3,\n else: 4\n }\n }\n }\n }\n }\n }\n }\n },\n {\n $sort: {\n order: 1\n }\n },\n { $project: { total: 1, category: 1 } },\n {\n $sort: {\n category: -1\n }\n },\n]","template-tags":{"filterDate":{"id":"84b2ec9e-eea8-e9ee-160f-57a211462c2a","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null},"filterGender":{"id":"7d3014f2-7de5-b2b0-fb10-0796ecc6fe38","name":"filterGender","display', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(658, 1, '-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"086c0846-69f4-a2b9-16b8-86af040bf2c8","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"537bc06b-acf9-9d28-3c92-346d83ce5156","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"5626fb9c-14cd-0fe8-2254-687e292aeb7b","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}}},"type":"native"},"id":31,"parameter_mappings":[],"display":"bar","entity_id":"hTP9EUEq13VA1N_H-258l","collection_preview":true,"visualization_settings":{"graph.y_axis.title_text":"Total","graph.show_values":true,"graph.x_axis.labels_enabled":false,"graph.series_order_dimension":null,"stackable.stack_display":"bar","graph.x_axis.title_text":"Category","graph.label_value_frequency":"fit","graph.metrics":["total"],"graph.label_value_formatting":"auto","graph.series_order":null,"series_settings":{"4":{"title":"Under age 5","color":"#509EE3"},"7":{"title":"Over age 5","color":"#509EE3"},"12":{"title":"Under age 1","color":"#509EE3"},"23":{"color":"#F9D45C","title":"Total"},"20,085":{"axis":null},"total":{"color":"#8A5EB0"}},"graph.dimensions":["category"],"stackable.stack_type":"stacked"},"is_write":false,"parameters":[{"id":"84b2ec9e-eea8-e9ee-160f-57a211462c2a","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"7d3014f2-7de5-b2b0-fb10-0796ecc6fe38","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"086c0846-69f4-a2b9-16b8-86af040bf2c8","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"537bc06b-acf9-9d28-3c92-346d83ce5156","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"5626fb9c-14cd-0fe8-2254-687e292aeb7b","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(659, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by Gender","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , { \"$group\": {\n \"_id\": {\n \"gender\": \"$gender\"\n },\n \"count\": {\n \"$sum\": 1\n },\n }\n },\n { \"$project\": {\n \"_id\": false,\n \"gender\": \"$_id.gender\",\n \"count\": true\n }\n },\n {$match: {\n \"gender\": {$ne: null}\n }}\n \n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Gender'': \"$allInfo.gender\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }}\n]","template-tags":{"filterDate":{"id":"57523c92-bc05-e144-f15d-a07fc78322c2","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/relative","default":null},"filterGender":{"id":"f7834d58-4acc-cc46-0aee-08d1421f1ff1","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"af46a4e6-571c-e47f-e8ab-2cf527f54d68","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"a771e085-c491-259c-3020-bb9f97cf56f4","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"09bc4ac9-1847-d645-24c9-4f2892e147d0","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}}},"type":"native"},"id":1,"parameter_mappings":[],"display":"bar","entity_id":"Ksk2s3aUAdBmDtMTNwtH3","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.columns":[],"table.cell_column":"Gender","graph.series_order_dimension":null,"graph.metrics":["Count"],"graph.series_order":null,"table.pivot_column":"count","series_settings":{"Registrations":{"color":"#509EE3","show_series_values":true},"Count":{"color":"#69C8C8"}},"graph.dimensions":["Gender"]},"is_write":false,"parameters":[{"id":"57523c92-bc05-e144-f15d-a07fc78322c2","type":"date/relative","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"f7834d58-4acc-cc46-0aee-08d1421f1ff1","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"af46a4e6-571c-e47f-e8ab-2cf527f54d68","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"a771e085-c491-259c-3020-bb9f97cf56f4","type":"string/=","target":["dimension",["template-tag","filterState"]],"', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(659, 1, 'name":"State","slug":"filterState"},{"id":"09bc4ac9-1847-d645-24c9-4f2892e147d0","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(660, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by Age","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {\n $match: {\n $and: [{ _id: { $ne: null } }\n [[{{ filterDate }} ]]\n [[{{ filterGender }} ]]\n [[{{ filterEvent }}]]\n [[{{ filterState }}]]\n [[{{ filterOffice }}]]\n ]\n }\n },\n {\n $facet: {\n totals: [{ $count: ''Total'' }, { $addFields: { Category: ''Total'' } }],\n ageGroups: [\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 365] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''< 1''\n }\n ],\n default: ''''\n }\n }\n }\n },\n {$match: {\n par: {$ne: ''''}\n }}\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n Category: ''$_id.par'',\n Total: ''$totalCustomer''\n }\n }\n ],\n ageGroups2: [\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 1825] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''< 5''\n }\n ],\n default: ''5+''\n }\n }\n }\n },\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n Category: ''$_id.par'',\n Total: ''$totalCustomer''\n }\n }\n ],\n }\n },\n {\n $project: {\n mergedArray: { $concatArrays: [''$totals'', ''$ageGroups'', ''$ageGroups2''] }\n }\n },\n { $unwind: ''$mergedArray'' },\n { $replaceRoot: { newRoot: ''$mergedArray'' } },\n {\n $addFields: {\n order: {\n $cond: {\n if: { $eq: [''$Category'', ''Total''] },\n then: 1,\n else: {\n $cond: {\n if: { $eq: [''$Category'', ''< 1''] },\n then: 2,\n else: {\n $cond: {\n if: { $eq: [''$Category'', ''< 5''] },\n then: 3,\n else: 4\n }\n }\n }\n }\n }\n }\n }\n },\n {\n $sort: {\n order: 1\n }\n },\n { $project: { Total: 1, Category: 1 } },\n {\n $sort: {\n Category: -1\n }\n },\n]","template-tags":{"filterDate":{"id":"84b2ec9e-eea8-e9ee-160f-57a211462c2a","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null},"filterGender":{"id":"7d3014f2-7de5-b2b0-fb10-0796ecc6fe38","name":"filterGender","display', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(660, 1, '-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"086c0846-69f4-a2b9-16b8-86af040bf2c8","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"537bc06b-acf9-9d28-3c92-346d83ce5156","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"5626fb9c-14cd-0fe8-2254-687e292aeb7b","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}}},"type":"native"},"id":31,"parameter_mappings":[],"display":"bar","entity_id":"hTP9EUEq13VA1N_H-258l","collection_preview":true,"visualization_settings":{"graph.y_axis.title_text":"Total","graph.show_values":true,"graph.x_axis.labels_enabled":false,"graph.series_order_dimension":null,"stackable.stack_display":"bar","graph.x_axis.title_text":"Category","graph.label_value_frequency":"fit","graph.metrics":["Total"],"graph.label_value_formatting":"auto","graph.series_order":null,"series_settings":{"4":{"title":"Under age 5","color":"#509EE3"},"7":{"title":"Over age 5","color":"#509EE3"},"12":{"title":"Under age 1","color":"#509EE3"},"23":{"color":"#F9D45C","title":"Total"},"total":{"color":"#8A5EB0"},"20,085":{"axis":null},"Total":{"color":"#8A5EB0"}},"graph.dimensions":["Category"],"stackable.stack_type":"stacked"},"is_write":false,"parameters":[{"id":"84b2ec9e-eea8-e9ee-160f-57a211462c2a","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"7d3014f2-7de5-b2b0-fb10-0796ecc6fe38","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"086c0846-69f4-a2b9-16b8-86af040bf2c8","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"537bc06b-acf9-9d28-3c92-346d83ce5156","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"5626fb9c-14cd-0fe8-2254-687e292aeb7b","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(661, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":10,"query_type":"native","name":"Live Births by Literacy of Parents","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterGender":{"id":"e8218caf-e2aa-573e-1776-02cffff42462","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"bf69e085-3c01-7924-5108-7151c85dc371","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null}},"query":"[\n {$facet: {\n fathersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersLiteracy\": \"$fathersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"Father\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n }\n ]\n ,mothersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersLiteracy\": \"$mothersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"Mother\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n }\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersLiteracy\", \"$mothersLiteracy\" ]\n }\n }\n ', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(661, 1, ' }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Category'': \"$allInfo._id\"\n , ''Literacy'': \"$allInfo.literacy\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Literacy\": 1\n }\n }\n]\n","collection":"registrations"},"database":3},"id":18,"parameter_mappings":[],"display":"bar","entity_id":"eRSJUaHW6haiucK8BtpC_","collection_preview":true,"visualization_settings":{"graph.show_values":true,"graph.label_value_formatting":"auto","graph.dimensions":["Category","Literacy"],"series_settings":{"Mother":{"color":"#ED8535"},"mothersLiteracy":{"title":"mother","color":"#ED8535"},"fathersLiteracy":{"title":"father","color":"#8A5EB0"},"Father":{"color":"#8A5EB0"}},"graph.x_axis.title_text":"Literacy","graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"e8218caf-e2aa-573e-1776-02cffff42462","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"bf69e085-3c01-7924-5108-7151c85dc371","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(662, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":14,"query_type":"native","name":"Live Births by Level of Education of Parent","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterGender":{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null}},"query":"[\n {$facet: {\n fathersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersAttainment\": \"$fathersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"KORANIC\"] },\n then: \"Koranic\"\n },\n {\n case: { $eq: [\"$_id\", \"MODERN\"] },\n then: \"Modern\"\n },\n {\n case: { $eq: [\"$_id\", \"HIGHER_SCHOOL\"] },\n then: \"Higher School\"\n },\n {\n case: { $eq: [\"$_id\", \"PRIMARY\"] },\n then: \"Primary\"\n },\n {\n case: { $eq: [\"$_id\", \"UNIVERSITY\"] },\n then: \"University\"\n },\n {\n case: { $eq: [\"$_id\", \"POLYTECNIC_NCE\"] },\n then: \"Polytecnic NCE\"\n },\n {\n case: { $eq: [\"$_id\", \"SECONDARY\"] },\n then: \"Secondary\"\n }\n ],\n default: \"Others\"\n }\n }\n , count: \"$count\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {$addFields: {\n attainment: \"Father\"\n }}\n ]\n , mothersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersAttainment\": \"$mothersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n ', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(662, 1, ' $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"KORANIC\"] },\n then: \"Koranic\"\n },\n {\n case: { $eq: [\"$_id\", \"MODERN\"] },\n then: \"Modern\"\n },\n {\n case: { $eq: [\"$_id\", \"HIGHER_SCHOOL\"] },\n then: \"Higher School\"\n },\n {\n case: { $eq: [\"$_id\", \"PRIMARY\"] },\n then: \"Primary\"\n },\n {\n case: { $eq: [\"$_id\", \"UNIVERSITY\"] },\n then: \"University\"\n },\n {\n case: { $eq: [\"$_id\", \"POLYTECNIC_NCE\"] },\n then: \"Polytecnic NCE\"\n },\n {\n case: { $eq: [\"$_id\", \"SECONDARY\"] },\n then: \"Secondary\"\n }\n ],\n default: \"Others\"\n }\n }\n , count: \"$count\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {$addFields: {\n attainment: \"Mother\"\n }}\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersAttainment\", \"$mothersAttainment\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Educational Attainment'': \"$allInfo._id\"\n , ''Relationship'': \"$allInfo.attainment\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Relationship\": 1\n }\n }\n]\n","collection":"registrations"},"database":3},"id":21,"parameter_mappings":[],"display":"bar","entity_id":"W6bdia0Vw-6PC1efnHIR4","collection_preview":true,"visualization_settings":{"graph.show_values":true,"pie.dimension":"Educational Attainment","graph.x_axis.axis_enabled":true,"graph.y_axis.auto_split":true,"graph.metrics":["Count"],"pie.metric":"Count","series_settings":{"Mother":{"color":"#E75454"},"fathersAttainment":{"title":"father","color":"#69C8C8"},"mothersAttainment":{"title":"mother","color":"#E75454"},"Father":{"color":"#69C8C8"}},"graph.y_axis.auto_range":true,"graph.dimensions":["Educational Attainment","Relationship"]},"is_write":false,"parameters":[{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(663, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":11,"query_type":"native","name":"Live Births by Order","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , birthOrder: ''$birthOrder''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$eq: [''$birthOrder'', 1]}] }, then: ''1''},\n {case: {$and: [{$eq: [''$birthOrder'', 2]}] }, then: ''2''},\n {case: {$and: [{$eq: [''$birthOrder'', 3]}] }, then: ''3''},\n {case: {$and: [{$eq: [''$birthOrder'', 4]}] }, then: ''4''},\n {case: {$and: [{$eq: [''$birthOrder'', 5]}] }, then: ''5''},\n {case: {$and: [{$gte: [''$birthOrder'', 6]}] }, then: ''6+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Order\": 1\n }\n }\n]","template-tags":{"filterGender":{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"996f1d61-a845-0afe-bb4c-f36ac4ab32be","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null}}},"type":"native"},"id":19,"parameter_mappings":[],"display":"bar","entity_id":"L6nXdi04nvxgEh1eJYrwR","collection_preview":true,"visualization_settings":{"graph.show_values":true,"pie.dimension":"birthOrder","graph.series_or', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(663, 1, 'der_dimension":null,"graph.x_axis.title_text":"Birth Order","graph.metrics":["Count"],"graph.series_order":null,"pie.metric":"count","series_settings":{"Count":{"color":"#F7C41F"}},"graph.dimensions":["Order"]},"is_write":false,"parameters":[{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"996f1d61-a845-0afe-bb4c-f36ac4ab32be","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(664, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":12,"query_type":"native","name":"Live Births by Age of Mother","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , mothersAge: ''$mothersAgeAtBirthOfChildInYears''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$gte: [''$mothersAge'', 9]}, {$lt: [''$mothersAge'', 15]}] }, then: ''09-14''},\n {case: {$and: [{$gte: [''$mothersAge'', 15]}, {$lt: [''$mothersAge'', 20]}] }, then: ''15-19''},\n {case: {$and: [{$gte: [''$mothersAge'', 20]}, {$lt: [''$mothersAge'', 25]}] }, then: ''20-24''},\n {case: {$and: [{$gte: [''$mothersAge'', 25]}, {$lt: [''$mothersAge'', 30]}] }, then: ''25-29''},\n {case: {$and: [{$gte: [''$mothersAge'', 30]}, {$lt: [''$mothersAge'', 35]}] }, then: ''30-34''},\n {case: {$and: [{$gte: [''$mothersAge'', 35]}, {$lt: [''$mothersAge'', 40]}] }, then: ''35-39''},\n {case: {$and: [{$gte: [''$mothersAge'', 40]}, {$lt: [''$mothersAge'', 45]}] }, then: ''40-44''},\n {case: {$and: [{$gte: [''$mothersAge'', 45]}, {$lt: [''$mothersAge'', 50]}] }, then: ''45-49''},\n {case: {$and: [{$gte: [''$mothersAge'', 50]}, {$lt: [''$mothersAge'', 55]}] }, then: ''50-54''},\n {case: {$and: [{$gte: [''$mothersAge'', 55]}, {$lt: [''$mothersAge'', 60]}] }, then: ''55-59''},\n {case: {$and: [{$gte: [''$mothersAge'', 60]}] }, then: ''60+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Order\": 1\n }\n }\n]","template-tags":{"filterGender":{"id":"56559614-c685-9d81-d44b-a688fe5b103b","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","name":"filt', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(664, 1, 'erState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"8b07b619-ea79-a772-e83a-92f986ab040c","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null}}},"type":"native"},"id":20,"parameter_mappings":[],"display":"bar","entity_id":"PcnknQN2IYs_mJkwA8yRq","collection_preview":true,"visualization_settings":{"graph.x_axis.title_text":"Age","graph.dimensions":["Order"],"table.cell_column":"Count","table.pivot_column":"Order","series_settings":{"Count":{"color":"#E75454"}},"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"56559614-c685-9d81-d44b-a688fe5b103b","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"8b07b619-ea79-a772-e83a-92f986ab040c","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(659, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by Age","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {\n $match: {\n $and: [{ _id: { $ne: null } }\n [[{{ filterDate }} ]]\n [[{{ filterGender }} ]]\n [[{{ filterEvent }}]]\n [[{{ filterState }}]]\n [[{{ filterOffice }}]]\n ]\n }\n },\n {\n $facet: {\n totals: [{ $count: ''total'' }, { $addFields: { category: ''Total'' } }],\n ageGroups: [\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 365] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''< 1''\n }\n ],\n default: ''''\n }\n }\n }\n },\n {$match: {\n par: {$ne: ''''}\n }}\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n category: ''$_id.par'',\n total: ''$totalCustomer''\n }\n }\n ],\n ageGroups2: [\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 1825] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''< 5''\n }\n ],\n default: ''5+''\n }\n }\n }\n },\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n category: ''$_id.par'',\n total: ''$totalCustomer''\n }\n }\n ],\n }\n },\n {\n $project: {\n mergedArray: { $concatArrays: [''$totals'', ''$ageGroups'', ''$ageGroups2''] }\n }\n },\n { $unwind: ''$mergedArray'' },\n { $replaceRoot: { newRoot: ''$mergedArray'' } },\n {\n $addFields: {\n order: {\n $cond: {\n if: { $eq: [''$category'', ''Total''] },\n then: 1,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''< 1''] },\n then: 2,\n else: {\n $cond: {\n if: { $eq: [''$category'', ''< 5''] },\n then: 3,\n else: 4\n }\n }\n }\n }\n }\n }\n }\n },\n {\n $sort: {\n order: 1\n }\n },\n { $project: { total: 1, category: 1 } },\n {\n $sort: {\n category: -1\n }\n },\n]","template-tags":{"filterDate":{"id":"84b2ec9e-eea8-e9ee-160f-57a211462c2a","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null},"filterGender":{"id":"7d3014f2-7de5-b2b0-fb10-0796ecc6fe38","name":"filterGender","display', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(659, 1, '-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"086c0846-69f4-a2b9-16b8-86af040bf2c8","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"537bc06b-acf9-9d28-3c92-346d83ce5156","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"5626fb9c-14cd-0fe8-2254-687e292aeb7b","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}}},"type":"native"},"id":31,"parameter_mappings":[],"display":"bar","entity_id":"hTP9EUEq13VA1N_H-258l","collection_preview":true,"visualization_settings":{"graph.y_axis.title_text":"Total","graph.show_values":true,"graph.x_axis.labels_enabled":false,"graph.series_order_dimension":null,"stackable.stack_display":"bar","graph.x_axis.title_text":"Category","graph.label_value_frequency":"fit","graph.metrics":["total"],"graph.label_value_formatting":"auto","graph.series_order":null,"series_settings":{"4":{"title":"Under age 5","color":"#509EE3"},"7":{"title":"Over age 5","color":"#509EE3"},"12":{"title":"Under age 1","color":"#509EE3"},"23":{"color":"#F9D45C","title":"Total"},"20,085":{"axis":null},"total":{"color":"#8A5EB0"}},"graph.dimensions":["category"],"stackable.stack_type":"stacked"},"is_write":false,"parameters":[{"id":"84b2ec9e-eea8-e9ee-160f-57a211462c2a","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"7d3014f2-7de5-b2b0-fb10-0796ecc6fe38","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"086c0846-69f4-a2b9-16b8-86af040bf2c8","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"537bc06b-acf9-9d28-3c92-346d83ce5156","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"5626fb9c-14cd-0fe8-2254-687e292aeb7b","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(660, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by Gender","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , { \"$group\": {\n \"_id\": {\n \"gender\": \"$gender\"\n },\n \"count\": {\n \"$sum\": 1\n },\n }\n },\n { \"$project\": {\n \"_id\": false,\n \"gender\": \"$_id.gender\",\n \"count\": true\n }\n },\n {$match: {\n \"gender\": {$ne: null}\n }}\n \n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Gender'': \"$allInfo.gender\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }}\n]","template-tags":{"filterDate":{"id":"57523c92-bc05-e144-f15d-a07fc78322c2","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/relative","default":null},"filterGender":{"id":"f7834d58-4acc-cc46-0aee-08d1421f1ff1","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"af46a4e6-571c-e47f-e8ab-2cf527f54d68","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"a771e085-c491-259c-3020-bb9f97cf56f4","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"09bc4ac9-1847-d645-24c9-4f2892e147d0","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}}},"type":"native"},"id":1,"parameter_mappings":[],"display":"bar","entity_id":"Ksk2s3aUAdBmDtMTNwtH3","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_values":true,"table.columns":[],"table.cell_column":"Gender","graph.series_order_dimension":null,"graph.metrics":["Count"],"graph.series_order":null,"table.pivot_column":"count","series_settings":{"Registrations":{"color":"#509EE3","show_series_values":true},"Count":{"color":"#69C8C8"}},"graph.dimensions":["Gender"]},"is_write":false,"parameters":[{"id":"57523c92-bc05-e144-f15d-a07fc78322c2","type":"date/relative","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"f7834d58-4acc-cc46-0aee-08d1421f1ff1","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"af46a4e6-571c-e47f-e8ab-2cf527f54d68","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"a771e085-c491-259c-3020-bb9f97cf56f4","type":"string/=","target":["dimension",["template-tag","filterState"]],"', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(660, 1, 'name":"State","slug":"filterState"},{"id":"09bc4ac9-1847-d645-24c9-4f2892e147d0","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(661, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":4,"query_type":"native","name":"Registrations by Age","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {\n $match: {\n $and: [{ _id: { $ne: null } }\n [[{{ filterDate }} ]]\n [[{{ filterGender }} ]]\n [[{{ filterEvent }}]]\n [[{{ filterState }}]]\n [[{{ filterOffice }}]]\n ]\n }\n },\n {\n $facet: {\n totals: [{ $count: ''Total'' }, { $addFields: { Category: ''Total'' } }],\n ageGroups: [\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 365] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''< 1''\n }\n ],\n default: ''''\n }\n }\n }\n },\n {$match: {\n par: {$ne: ''''}\n }}\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n Category: ''$_id.par'',\n Total: ''$totalCustomer''\n }\n }\n ],\n ageGroups2: [\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 1825] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''< 5''\n }\n ],\n default: ''5+''\n }\n }\n }\n },\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n Category: ''$_id.par'',\n Total: ''$totalCustomer''\n }\n }\n ],\n }\n },\n {\n $project: {\n mergedArray: { $concatArrays: [''$totals'', ''$ageGroups'', ''$ageGroups2''] }\n }\n },\n { $unwind: ''$mergedArray'' },\n { $replaceRoot: { newRoot: ''$mergedArray'' } },\n {\n $addFields: {\n order: {\n $cond: {\n if: { $eq: [''$Category'', ''Total''] },\n then: 1,\n else: {\n $cond: {\n if: { $eq: [''$Category'', ''< 1''] },\n then: 2,\n else: {\n $cond: {\n if: { $eq: [''$Category'', ''< 5''] },\n then: 3,\n else: 4\n }\n }\n }\n }\n }\n }\n }\n },\n {\n $sort: {\n order: 1\n }\n },\n { $project: { Total: 1, Category: 1 } },\n {\n $sort: {\n Category: -1\n }\n },\n]","template-tags":{"filterDate":{"id":"84b2ec9e-eea8-e9ee-160f-57a211462c2a","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null},"filterGender":{"id":"7d3014f2-7de5-b2b0-fb10-0796ecc6fe38","name":"filterGender","display', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(661, 1, '-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"086c0846-69f4-a2b9-16b8-86af040bf2c8","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"537bc06b-acf9-9d28-3c92-346d83ce5156","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"5626fb9c-14cd-0fe8-2254-687e292aeb7b","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}}},"type":"native"},"id":31,"parameter_mappings":[],"display":"bar","entity_id":"hTP9EUEq13VA1N_H-258l","collection_preview":true,"visualization_settings":{"graph.y_axis.title_text":"Total","graph.show_values":true,"graph.x_axis.labels_enabled":false,"graph.series_order_dimension":null,"stackable.stack_display":"bar","graph.x_axis.title_text":"Category","graph.label_value_frequency":"fit","graph.metrics":["Total"],"graph.label_value_formatting":"auto","graph.series_order":null,"series_settings":{"4":{"title":"Under age 5","color":"#509EE3"},"7":{"title":"Over age 5","color":"#509EE3"},"12":{"title":"Under age 1","color":"#509EE3"},"23":{"color":"#F9D45C","title":"Total"},"total":{"color":"#8A5EB0"},"20,085":{"axis":null},"Total":{"color":"#8A5EB0"}},"graph.dimensions":["Category"],"stackable.stack_type":"stacked"},"is_write":false,"parameters":[{"id":"84b2ec9e-eea8-e9ee-160f-57a211462c2a","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"7d3014f2-7de5-b2b0-fb10-0796ecc6fe38","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"086c0846-69f4-a2b9-16b8-86af040bf2c8","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"537bc06b-acf9-9d28-3c92-346d83ce5156","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"5626fb9c-14cd-0fe8-2254-687e292aeb7b","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(662, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":10,"query_type":"native","name":"Live Births by Literacy of Parents","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterGender":{"id":"e8218caf-e2aa-573e-1776-02cffff42462","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"bf69e085-3c01-7924-5108-7151c85dc371","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null}},"query":"[\n {$facet: {\n fathersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersLiteracy\": \"$fathersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"Father\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n }\n ]\n ,mothersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersLiteracy\": \"$mothersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"Mother\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n }\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersLiteracy\", \"$mothersLiteracy\" ]\n }\n }\n ', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(662, 1, ' }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Category'': \"$allInfo._id\"\n , ''Literacy'': \"$allInfo.literacy\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Literacy\": 1\n }\n }\n]\n","collection":"registrations"},"database":3},"id":18,"parameter_mappings":[],"display":"bar","entity_id":"eRSJUaHW6haiucK8BtpC_","collection_preview":true,"visualization_settings":{"graph.show_values":true,"graph.label_value_formatting":"auto","graph.dimensions":["Category","Literacy"],"series_settings":{"Mother":{"color":"#ED8535"},"mothersLiteracy":{"title":"mother","color":"#ED8535"},"fathersLiteracy":{"title":"father","color":"#8A5EB0"},"Father":{"color":"#8A5EB0"}},"graph.x_axis.title_text":"Literacy","graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"e8218caf-e2aa-573e-1776-02cffff42462","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"bf69e085-3c01-7924-5108-7151c85dc371","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(663, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":14,"query_type":"native","name":"Live Births by Level of Education of Parent","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterGender":{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null}},"query":"[\n {$facet: {\n fathersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersAttainment\": \"$fathersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"KORANIC\"] },\n then: \"Koranic\"\n },\n {\n case: { $eq: [\"$_id\", \"MODERN\"] },\n then: \"Modern\"\n },\n {\n case: { $eq: [\"$_id\", \"HIGHER_SCHOOL\"] },\n then: \"Higher School\"\n },\n {\n case: { $eq: [\"$_id\", \"PRIMARY\"] },\n then: \"Primary\"\n },\n {\n case: { $eq: [\"$_id\", \"UNIVERSITY\"] },\n then: \"University\"\n },\n {\n case: { $eq: [\"$_id\", \"POLYTECNIC_NCE\"] },\n then: \"Polytecnic NCE\"\n },\n {\n case: { $eq: [\"$_id\", \"SECONDARY\"] },\n then: \"Secondary\"\n }\n ],\n default: \"Others\"\n }\n }\n , count: \"$count\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {$addFields: {\n attainment: \"Father\"\n }}\n ]\n , mothersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersAttainment\": \"$mothersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n ', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(663, 1, ' $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"KORANIC\"] },\n then: \"Koranic\"\n },\n {\n case: { $eq: [\"$_id\", \"MODERN\"] },\n then: \"Modern\"\n },\n {\n case: { $eq: [\"$_id\", \"HIGHER_SCHOOL\"] },\n then: \"Higher School\"\n },\n {\n case: { $eq: [\"$_id\", \"PRIMARY\"] },\n then: \"Primary\"\n },\n {\n case: { $eq: [\"$_id\", \"UNIVERSITY\"] },\n then: \"University\"\n },\n {\n case: { $eq: [\"$_id\", \"POLYTECNIC_NCE\"] },\n then: \"Polytecnic NCE\"\n },\n {\n case: { $eq: [\"$_id\", \"SECONDARY\"] },\n then: \"Secondary\"\n }\n ],\n default: \"Others\"\n }\n }\n , count: \"$count\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {$addFields: {\n attainment: \"Mother\"\n }}\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersAttainment\", \"$mothersAttainment\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Educational Attainment'': \"$allInfo._id\"\n , ''Relationship'': \"$allInfo.attainment\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Relationship\": 1\n }\n }\n]\n","collection":"registrations"},"database":3},"id":21,"parameter_mappings":[],"display":"bar","entity_id":"W6bdia0Vw-6PC1efnHIR4","collection_preview":true,"visualization_settings":{"graph.show_values":true,"pie.dimension":"Educational Attainment","graph.x_axis.axis_enabled":true,"graph.y_axis.auto_split":true,"graph.metrics":["Count"],"pie.metric":"Count","series_settings":{"Mother":{"color":"#E75454"},"fathersAttainment":{"title":"father","color":"#69C8C8"},"mothersAttainment":{"title":"mother","color":"#E75454"},"Father":{"color":"#69C8C8"}},"graph.y_axis.auto_range":true,"graph.dimensions":["Educational Attainment","Relationship"]},"is_write":false,"parameters":[{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(664, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":11,"query_type":"native","name":"Live Births by Order","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , birthOrder: ''$birthOrder''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$eq: [''$birthOrder'', 1]}] }, then: ''1''},\n {case: {$and: [{$eq: [''$birthOrder'', 2]}] }, then: ''2''},\n {case: {$and: [{$eq: [''$birthOrder'', 3]}] }, then: ''3''},\n {case: {$and: [{$eq: [''$birthOrder'', 4]}] }, then: ''4''},\n {case: {$and: [{$eq: [''$birthOrder'', 5]}] }, then: ''5''},\n {case: {$and: [{$gte: [''$birthOrder'', 6]}] }, then: ''6+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Order\": 1\n }\n }\n]","template-tags":{"filterGender":{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"996f1d61-a845-0afe-bb4c-f36ac4ab32be","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null}}},"type":"native"},"id":19,"parameter_mappings":[],"display":"bar","entity_id":"L6nXdi04nvxgEh1eJYrwR","collection_preview":true,"visualization_settings":{"graph.show_values":true,"pie.dimension":"birthOrder","graph.series_or', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(664, 1, 'der_dimension":null,"graph.x_axis.title_text":"Birth Order","graph.metrics":["Count"],"graph.series_order":null,"pie.metric":"count","series_settings":{"Count":{"color":"#F7C41F"}},"graph.dimensions":["Order"]},"is_write":false,"parameters":[{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"996f1d61-a845-0afe-bb4c-f36ac4ab32be","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(665, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":12,"query_type":"native","name":"Live Births by Age of Mother","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , mothersAge: ''$mothersAgeAtBirthOfChildInYears''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$gte: [''$mothersAge'', 9]}, {$lt: [''$mothersAge'', 15]}] }, then: ''09-14''},\n {case: {$and: [{$gte: [''$mothersAge'', 15]}, {$lt: [''$mothersAge'', 20]}] }, then: ''15-19''},\n {case: {$and: [{$gte: [''$mothersAge'', 20]}, {$lt: [''$mothersAge'', 25]}] }, then: ''20-24''},\n {case: {$and: [{$gte: [''$mothersAge'', 25]}, {$lt: [''$mothersAge'', 30]}] }, then: ''25-29''},\n {case: {$and: [{$gte: [''$mothersAge'', 30]}, {$lt: [''$mothersAge'', 35]}] }, then: ''30-34''},\n {case: {$and: [{$gte: [''$mothersAge'', 35]}, {$lt: [''$mothersAge'', 40]}] }, then: ''35-39''},\n {case: {$and: [{$gte: [''$mothersAge'', 40]}, {$lt: [''$mothersAge'', 45]}] }, then: ''40-44''},\n {case: {$and: [{$gte: [''$mothersAge'', 45]}, {$lt: [''$mothersAge'', 50]}] }, then: ''45-49''},\n {case: {$and: [{$gte: [''$mothersAge'', 50]}, {$lt: [''$mothersAge'', 55]}] }, then: ''50-54''},\n {case: {$and: [{$gte: [''$mothersAge'', 55]}, {$lt: [''$mothersAge'', 60]}] }, then: ''55-59''},\n {case: {$and: [{$gte: [''$mothersAge'', 60]}] }, then: ''60+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Order\": 1\n }\n }\n]","template-tags":{"filterGender":{"id":"56559614-c685-9d81-d44b-a688fe5b103b","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","name":"filt', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(665, 1, 'erState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"8b07b619-ea79-a772-e83a-92f986ab040c","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null}}},"type":"native"},"id":20,"parameter_mappings":[],"display":"bar","entity_id":"PcnknQN2IYs_mJkwA8yRq","collection_preview":true,"visualization_settings":{"graph.x_axis.title_text":"Age","graph.dimensions":["Order"],"table.cell_column":"Count","table.pivot_column":"Order","series_settings":{"Count":{"color":"#E75454"}},"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"56559614-c685-9d81-d44b-a688fe5b103b","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"8b07b619-ea79-a772-e83a-92f986ab040c","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); INSERT INTO "PUBLIC"."REVISION" VALUES -(613, 'Card', 31, 1, TIMESTAMP WITH TIME ZONE '2023-01-26 09:17:57.006+00', SYSTEM_COMBINE_CLOB(658), FALSE, FALSE, NULL), -(614, 'Card', 1, 1, TIMESTAMP WITH TIME ZONE '2023-01-26 09:18:10.107+00', SYSTEM_COMBINE_CLOB(659), FALSE, FALSE, NULL), +(613, 'Card', 31, 1, TIMESTAMP WITH TIME ZONE '2023-01-26 09:17:57.006+00', SYSTEM_COMBINE_CLOB(659), FALSE, FALSE, NULL), +(614, 'Card', 1, 1, TIMESTAMP WITH TIME ZONE '2023-01-26 09:18:10.107+00', SYSTEM_COMBINE_CLOB(660), FALSE, FALSE, NULL), (615, 'Card', 14, 1, TIMESTAMP WITH TIME ZONE '2023-01-26 09:18:54.412+00', '{"description":null,"archived":false,"collection_position":null,"table_id":70,"database_id":3,"enable_embedding":false,"collection_id":null,"query_type":"query","name":"Registrations over Time","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"query","query":{"aggregation":[["count"]],"breakout":[["field",677,{"temporal-unit":"month"}]],"filter":["=",["field",666,null],"Birth"],"source-table":70},"database":3},"id":14,"parameter_mappings":[],"display":"line","entity_id":"qNwCeJEl62KWFEc_8ueNS","collection_preview":true,"visualization_settings":{"graph.show_goal":false,"graph.show_trendline":false,"graph.show_values":false,"graph.x_axis.axis_enabled":true,"graph.x_axis.title_text":"Over Time","graph.metrics":["count"],"column_settings":{"[\"ref\",[\"field\",677,null]]":{"date_abbreviate":true}},"graph.x_axis.scale":"timeseries","graph.dimensions":["createdAt"]},"is_write":false,"parameters":[],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL), -(616, 'Card', 31, 1, TIMESTAMP WITH TIME ZONE '2023-01-26 09:25:34.776+00', SYSTEM_COMBINE_CLOB(660), FALSE, FALSE, NULL), +(616, 'Card', 31, 1, TIMESTAMP WITH TIME ZONE '2023-01-26 09:25:34.776+00', SYSTEM_COMBINE_CLOB(661), FALSE, FALSE, NULL), (617, 'Card', 28, 1, TIMESTAMP WITH TIME ZONE '2023-01-26 09:28:44.234+00', '{"description":null,"archived":false,"collection_position":null,"table_id":71,"database_id":3,"enable_embedding":false,"collection_id":17,"query_type":"query","name":"Record Corrections by Type","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"query","query":{"source-table":71,"expressions":{"Reason":["case",[[["=",["field",688,null],"CLERICAL_ERROR"],"Clerical Error"],[["=",["field",688,null],"JUDICIAL_ORDER"],"Judicial Order"]]]},"filter":["=",["field",693,null],"Birth"],"aggregation":[["count"]],"breakout":[["expression","Reason"]]},"database":3},"id":28,"parameter_mappings":[],"display":"pie","entity_id":"__hZ2xD-7VCBJ7mLFxB9Y","collection_preview":true,"visualization_settings":{"pie.colors":{"Clerical Error":"#8A5EB0"}},"is_write":false,"parameters":[],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL), -(618, 'Card', 18, 1, TIMESTAMP WITH TIME ZONE '2023-01-26 09:34:47.978+00', SYSTEM_COMBINE_CLOB(661), FALSE, FALSE, NULL), -(619, 'Card', 21, 1, TIMESTAMP WITH TIME ZONE '2023-01-26 09:36:24.497+00', SYSTEM_COMBINE_CLOB(662), FALSE, FALSE, NULL), -(620, 'Card', 19, 1, TIMESTAMP WITH TIME ZONE '2023-01-26 09:36:39.789+00', SYSTEM_COMBINE_CLOB(663), FALSE, FALSE, NULL), -(621, 'Card', 20, 1, TIMESTAMP WITH TIME ZONE '2023-01-26 09:36:55.075+00', SYSTEM_COMBINE_CLOB(664), FALSE, FALSE, NULL), +(618, 'Card', 18, 1, TIMESTAMP WITH TIME ZONE '2023-01-26 09:34:47.978+00', SYSTEM_COMBINE_CLOB(662), FALSE, FALSE, NULL), +(619, 'Card', 21, 1, TIMESTAMP WITH TIME ZONE '2023-01-26 09:36:24.497+00', SYSTEM_COMBINE_CLOB(663), FALSE, FALSE, NULL), +(620, 'Card', 19, 1, TIMESTAMP WITH TIME ZONE '2023-01-26 09:36:39.789+00', SYSTEM_COMBINE_CLOB(664), FALSE, FALSE, NULL), +(621, 'Card', 20, 1, TIMESTAMP WITH TIME ZONE '2023-01-26 09:36:55.075+00', SYSTEM_COMBINE_CLOB(665), FALSE, FALSE, NULL), (622, 'Card', 27, 1, TIMESTAMP WITH TIME ZONE '2023-01-26 09:37:31.846+00', '{"description":null,"archived":false,"collection_position":null,"table_id":70,"database_id":3,"enable_embedding":false,"collection_id":9,"query_type":"query","name":"Live Births by Place of Birth","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"query":{"aggregation":[["count"]],"breakout":[["expression","PlaceOfBirth"]],"expressions":{"PlaceOfBirth":["case",[[["=",["field",668,null],"BUS"],"Bus"],[["=",["field",668,null],"CAR_TAXI"],"Taxi"],[["=",["field",668,null],"HEALTH_FACILITY"],"Health Facility"],[["=",["field",668,null],"MATERNITY_HOME"],"Maternity Home"],[["=",["field",668,null],"PRIVATE_HOME"],"Private Home"],[["=",["field",668,null],"TRADITIONAL_DOCTORS"],"Traditional Doctors"]]]},"filter":["and",["=",["field",666,null],"Birth"],["time-interval",["field",677,null],-12,"month"]],"source-table":70},"type":"query"},"id":27,"parameter_mappings":[],"display":"pie","entity_id":"AfR2OybIvG3i-a1qt-k0u","collection_preview":true,"visualization_settings":{"pie.colors":{"Health Facility":"#689636","Taxi":"#69C8C8"}},"is_write":false,"parameters":[],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(665, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":12,"query_type":"native","name":"Live Births by Age of Mother","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , mothersAge: ''$mothersAgeAtBirthOfChildInYears''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$gte: [''$mothersAge'', 9]}, {$lt: [''$mothersAge'', 15]}] }, then: ''09-14''},\n {case: {$and: [{$gte: [''$mothersAge'', 15]}, {$lt: [''$mothersAge'', 20]}] }, then: ''15-19''},\n {case: {$and: [{$gte: [''$mothersAge'', 20]}, {$lt: [''$mothersAge'', 25]}] }, then: ''20-24''},\n {case: {$and: [{$gte: [''$mothersAge'', 25]}, {$lt: [''$mothersAge'', 30]}] }, then: ''25-29''},\n {case: {$and: [{$gte: [''$mothersAge'', 30]}, {$lt: [''$mothersAge'', 35]}] }, then: ''30-34''},\n {case: {$and: [{$gte: [''$mothersAge'', 35]}, {$lt: [''$mothersAge'', 40]}] }, then: ''35-39''},\n {case: {$and: [{$gte: [''$mothersAge'', 40]}, {$lt: [''$mothersAge'', 45]}] }, then: ''40-44''},\n {case: {$and: [{$gte: [''$mothersAge'', 45]}, {$lt: [''$mothersAge'', 50]}] }, then: ''45-49''},\n {case: {$and: [{$gte: [''$mothersAge'', 50]}, {$lt: [''$mothersAge'', 55]}] }, then: ''50-54''},\n {case: {$and: [{$gte: [''$mothersAge'', 55]}, {$lt: [''$mothersAge'', 60]}] }, then: ''55-59''},\n {case: {$and: [{$gte: [''$mothersAge'', 60]}] }, then: ''60+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Order\": 1\n }\n }\n]","template-tags":{"filterGender":{"id":"56559614-c685-9d81-d44b-a688fe5b103b","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","name":"filt', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(665, 1, 'erState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"8b07b619-ea79-a772-e83a-92f986ab040c","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null}}},"type":"native"},"id":20,"parameter_mappings":[],"display":"bar","entity_id":"PcnknQN2IYs_mJkwA8yRq","collection_preview":true,"visualization_settings":{"graph.x_axis.title_text":"Age","graph.dimensions":["Order"],"table.cell_column":"Count","table.pivot_column":"Order","series_settings":{"Count":{"color":"#E75454"}},"graph.show_values":true,"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"56559614-c685-9d81-d44b-a688fe5b103b","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"8b07b619-ea79-a772-e83a-92f986ab040c","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(666, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":12,"query_type":"native","name":"Live Births by Age of Mother","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , mothersAge: ''$mothersAgeAtBirthOfChildInYears''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$gte: [''$mothersAge'', 9]}, {$lt: [''$mothersAge'', 15]}] }, then: ''09-14''},\n {case: {$and: [{$gte: [''$mothersAge'', 15]}, {$lt: [''$mothersAge'', 20]}] }, then: ''15-19''},\n {case: {$and: [{$gte: [''$mothersAge'', 20]}, {$lt: [''$mothersAge'', 25]}] }, then: ''20-24''},\n {case: {$and: [{$gte: [''$mothersAge'', 25]}, {$lt: [''$mothersAge'', 30]}] }, then: ''25-29''},\n {case: {$and: [{$gte: [''$mothersAge'', 30]}, {$lt: [''$mothersAge'', 35]}] }, then: ''30-34''},\n {case: {$and: [{$gte: [''$mothersAge'', 35]}, {$lt: [''$mothersAge'', 40]}] }, then: ''35-39''},\n {case: {$and: [{$gte: [''$mothersAge'', 40]}, {$lt: [''$mothersAge'', 45]}] }, then: ''40-44''},\n {case: {$and: [{$gte: [''$mothersAge'', 45]}, {$lt: [''$mothersAge'', 50]}] }, then: ''45-49''},\n {case: {$and: [{$gte: [''$mothersAge'', 50]}, {$lt: [''$mothersAge'', 55]}] }, then: ''50-54''},\n {case: {$and: [{$gte: [''$mothersAge'', 55]}, {$lt: [''$mothersAge'', 60]}] }, then: ''55-59''},\n {case: {$and: [{$gte: [''$mothersAge'', 60]}] }, then: ''60+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Order\": 1\n }\n }\n]","template-tags":{"filterGender":{"id":"56559614-c685-9d81-d44b-a688fe5b103b","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","name":"filt', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(666, 1, 'erState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"8b07b619-ea79-a772-e83a-92f986ab040c","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null}}},"type":"native"},"id":20,"parameter_mappings":[],"display":"bar","entity_id":"PcnknQN2IYs_mJkwA8yRq","collection_preview":true,"visualization_settings":{"graph.x_axis.title_text":"Age","graph.dimensions":["Order"],"table.cell_column":"Count","table.pivot_column":"Order","series_settings":{"Count":{"color":"#E75454"}},"graph.show_values":true,"graph.metrics":["Count"]},"is_write":false,"parameters":[{"id":"56559614-c685-9d81-d44b-a688fe5b103b","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"8b07b619-ea79-a772-e83a-92f986ab040c","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); INSERT INTO "PUBLIC"."REVISION" VALUES (623, 'Card', 30, 1, TIMESTAMP WITH TIME ZONE '2023-01-26 09:45:02.502+00', '{"description":null,"archived":false,"collection_position":null,"table_id":70,"database_id":3,"enable_embedding":false,"collection_id":8,"query_type":"query","name":"% of Total Registrations Certified","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"query","query":{"aggregation":[["count"]],"breakout":[["expression","Status"]],"expressions":{"Status":["case",[[["=",["field",682,null],"REGISTERED"],"Not Certified"],[["=",["field",682,null],"CERTIFIED"],"Certified"]]]},"filter":["=",["field",666,null],"Birth"],"source-table":70},"database":3},"id":30,"parameter_mappings":[],"display":"pie","entity_id":"i9_4VwkR62cl03HLkb9e7","collection_preview":true,"visualization_settings":{"pie.colors":{"Certified":"#E75454","Not Certified":"#F7C4C4"}},"is_write":false,"parameters":[],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL), (624, 'Card', 16, 1, TIMESTAMP WITH TIME ZONE '2023-01-26 09:45:41.043+00', '{"description":null,"archived":false,"collection_position":null,"table_id":70,"database_id":3,"enable_embedding":false,"collection_id":null,"query_type":"query","name":"Total Registrations (without native query)","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"query","query":{"aggregation":[["count"]],"filter":["=",["field",666,null],"Birth"],"source-table":70},"database":3},"id":16,"parameter_mappings":[],"display":"scalar","entity_id":"BOot6oon80vLb791-gzQb","collection_preview":true,"visualization_settings":{},"is_write":false,"parameters":[],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL), (627, 'Card', 27, 1, TIMESTAMP WITH TIME ZONE '2023-01-26 09:55:15.363+00', '{"description":null,"archived":false,"collection_position":null,"table_id":70,"database_id":3,"enable_embedding":false,"collection_id":9,"query_type":"query","name":"Live Births by Place of Birth","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"query","query":{"aggregation":[["count"]],"breakout":[["expression","PlaceOfBirth"]],"expressions":{"PlaceOfBirth":["case",[[["=",["field",668,null],"BUS"],"Bus"],[["=",["field",668,null],"CAR_TAXI"],"Taxi"],[["=",["field",668,null],"HEALTH_FACILITY"],"Health Facility"],[["=",["field",668,null],"MATERNITY_HOME"],"Maternity Home"],[["=",["field",668,null],"PRIVATE_HOME"],"Private Home"],[["=",["field",668,null],"TRADITIONAL_DOCTORS"],"Traditional Doctors"]]]},"filter":["=",["field",666,null],"Birth"],"source-table":70},"database":3},"id":27,"parameter_mappings":[],"display":"pie","entity_id":"AfR2OybIvG3i-a1qt-k0u","collection_preview":true,"visualization_settings":{"pie.colors":{"Health Facility":"#689636","Taxi":"#69C8C8"}},"is_write":false,"parameters":[],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL), (628, 'Card', 29, 1, TIMESTAMP WITH TIME ZONE '2023-01-26 09:55:42.924+00', '{"description":null,"archived":false,"collection_position":null,"table_id":70,"database_id":3,"enable_embedding":false,"collection_id":15,"query_type":"query","name":"Live Births by Type of Birth","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"query","query":{"aggregation":[["count"]],"breakout":[["expression","TypeOfBirth"]],"expressions":{"TypeOfBirth":["case",[[["=",["field",674,null],"SINGLE"],"Single"],[["=",["field",674,null],"TWIN"],"Twin"],[["=",["field",674,null],"TRIPLET"],"Triplet"],[["=",["field",674,null],"QUADRUPLET"],"Quadruplet"]]]},"filter":["=",["field",666,null],"Birth"],"order-by":[["desc",["aggregation",0,null]]],"source-table":70},"database":3},"id":29,"parameter_mappings":[],"display":"pie","entity_id":"GOqql9fnmIgyeOChWso6x","collection_preview":true,"visualization_settings":{"pie.colors":{"Quadruplet":"#8A5EB0","Single":"#F7C41F"}},"is_write":false,"parameters":[],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL), -(632, 'Card', 20, 1, TIMESTAMP WITH TIME ZONE '2023-01-31 07:20:23.922+00', SYSTEM_COMBINE_CLOB(665), FALSE, FALSE, NULL); +(632, 'Card', 20, 1, TIMESTAMP WITH TIME ZONE '2023-01-31 07:20:23.922+00', SYSTEM_COMBINE_CLOB(666), FALSE, FALSE, NULL); INSERT INTO "PUBLIC"."REVISION" VALUES (633, 'Card', 27, 1, TIMESTAMP WITH TIME ZONE '2023-02-02 09:02:21.279+00', '{"description":null,"archived":false,"collection_position":null,"table_id":70,"database_id":3,"enable_embedding":false,"collection_id":9,"query_type":"query","name":"Live Births by Place of Birth","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"query":{"aggregation":[["count"]],"breakout":[["expression","PlaceOfBirth"]],"expressions":{"PlaceOfBirth":["case",[[["=",["field",668,null],"BUS"],"Bus"],[["=",["field",668,null],"CAR_TAXI"],"Taxi"],[["=",["field",668,null],"HEALTH_FACILITY"],"Health Facility"],[["=",["field",668,null],"MATERNITY_HOME"],"Maternity Home"],[["=",["field",668,null],"PRIVATE_HOME"],"Private Home"],[["=",["field",668,null],"TRADITIONAL_DOCTORS"],"Traditional Doctors"],[["=",["field",668,null],"SPIRITUAL_HOMES"],"Spritual Homes"]]]},"filter":["=",["field",666,null],"Birth"],"source-table":70},"type":"query"},"id":27,"parameter_mappings":[],"display":"pie","entity_id":"AfR2OybIvG3i-a1qt-k0u","collection_preview":true,"visualization_settings":{"pie.colors":{"Health Facility":"#689636","Taxi":"#69C8C8"}},"is_write":false,"parameters":[],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL), (634, 'Card', 27, 1, TIMESTAMP WITH TIME ZONE '2023-02-02 09:03:27.973+00', '{"description":null,"archived":false,"collection_position":null,"table_id":70,"database_id":3,"enable_embedding":false,"collection_id":9,"query_type":"query","name":"Live Births by Place of Birth","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"query":{"aggregation":[["count"]],"breakout":[["expression","PlaceOfBirth"]],"expressions":{"PlaceOfBirth":["case",[[["=",["field",668,null],"BUS"],"Bus"],[["=",["field",668,null],"CAR_TAXI"],"Taxi"],[["=",["field",668,null],"HEALTH_FACILITY"],"Health Facility"],[["=",["field",668,null],"MATERNITY_HOME"],"Maternity Home"],[["=",["field",668,null],"PRIVATE_HOME"],"Private Home"],[["=",["field",668,null],"TRADITIONAL_DOCTORS"],"Traditional Doctors"],[["=",["field",668,null],"SPIRITUAL_HOMES"],"Spritual Homes"]]]},"filter":["=",["field",666,null],"Birth"],"source-table":70},"type":"query"},"id":27,"parameter_mappings":[],"display":"pie","entity_id":"AfR2OybIvG3i-a1qt-k0u","collection_preview":true,"visualization_settings":{"pie.colors":{"Health Facility":"#689636","Taxi":"#69C8C8"}},"is_write":false,"parameters":[],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL), @@ -175421,16 +175431,16 @@ INSERT INTO "PUBLIC"."REVISION" VALUES (639, 'Dashboard', 4, 1, TIMESTAMP WITH TIME ZONE '2023-02-22 17:25:31.429+07', '{"description":null,"name":"Leaderboard","cache_ttl":null,"cards":[{"size_x":2,"size_y":2,"row":0,"col":0,"id":37,"card_id":12,"series":[]}]}', FALSE, FALSE, NULL), (640, 'Dashboard', 4, 1, TIMESTAMP WITH TIME ZONE '2023-02-22 17:25:31.526+07', '{"description":null,"name":"Leaderboard","cache_ttl":null,"cards":[{"size_x":5,"size_y":4,"row":0,"col":0,"id":37,"card_id":12,"series":[]}]}', FALSE, FALSE, NULL), (641, 'Dashboard', 4, 1, TIMESTAMP WITH TIME ZONE '2023-02-22 17:25:31.631+07', '{"description":null,"name":"Leaderboard","cache_ttl":null,"cards":[{"size_x":5,"size_y":4,"row":0,"col":0,"id":37,"card_id":12,"series":[]}]}', FALSE, FALSE, NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(666, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":11,"query_type":"native","name":"Live Births by Order","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterGender":{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","name":"filterOffice","display-name":"District","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"996f1d61-a845-0afe-bb4c-f36ac4ab32be","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , birthOrder: ''$birthOrder''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$eq: [''$birthOrder'', 1]}] }, then: ''1''},\n {case: {$and: [{$eq: [''$birthOrder'', 2]}] }, then: ''2''},\n {case: {$and: [{$eq: [''$birthOrder'', 3]}] }, then: ''3''},\n {case: {$and: [{$eq: [''$birthOrder'', 4]}] }, then: ''4''},\n {case: {$and: [{$eq: [''$birthOrder'', 5]}] }, then: ''5''},\n {case: {$and: [{$gte: [''$birthOrder'', 6]}] }, then: ''6+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Order\": 1\n }\n }\n]","collection":"registrations"},"database":3},"id":19,"parameter_mappings":[],"display":"bar","entity_id":"L6nXdi04nvxgEh1eJYrwR","collection_preview":true,"visualization_settings":{"graph.show_values":true,"pie.dimension":"birthOrder","graph.seri', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(666, 1, 'es_order_dimension":null,"graph.x_axis.title_text":"Birth Order","graph.metrics":[null],"graph.series_order":null,"pie.metric":"count","series_settings":{"Count":{"color":"#F7C41F"}},"graph.dimensions":[]},"is_write":false,"parameters":[{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"District","slug":"filterOffice"},{"id":"996f1d61-a845-0afe-bb4c-f36ac4ab32be","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(667, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":18,"query_type":"native","name":"Registrations by state","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"template-tags":{"filterDate":{"id":"f86f592c-2219-063c-8dc4-ca623c06a3ca","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null},"filterGender":{"id":"91f3014a-fb66-6724-708c-8e89f56e2779","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"757a20cf-8f70-6857-0ed5-acb310688b3a","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":["Birth"]},"filterState":{"id":"9384f1c8-b896-7ddb-6f32-204beba13dd3","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"58ab4870-ee4a-8362-2689-440572bb65de","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"stateName\": \"$stateName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"stateName\": \"$_id.stateName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"stateName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''State Name'': \"$allInfo.stateName\"\n , ''Registrations'': \"$allInfo.count\"\n }}\n]","collection":"registrations"},"type":"native"},"id":33,"parameter_mappings":[],"display":"row","entity_id":"g5hTQaT1d2p1OX0tU90WQ","collection_preview":true,"visualization_settings":{"series_settings":{"Registrations":{"color":"#ED8535"}},"graph.dimensions":["State Name"],"graph.show_values":true,"graph.y_axis.title_text":"No. of registrations","graph.metrics":["Registrations"]},"is_write":false,"parameters":[{"id":"f86f592c-2219-063c-8dc4-ca623c06a3ca","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"91f3014a-fb66-6724-708c-8e89f56e2779","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"757a20cf-8f70-6857-0ed5-acb310688b3a","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent","default":["Birth"]},{"id":"9384f1c8-b896-7ddb-6f32-204beba13dd3","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"58ab4870-ee4a-8362-2689-440572bb65de","type":"string/=","target":["dimension",["templat', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(667, 1, 'e-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(668, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":18,"query_type":"native","name":"Registrations by State","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"template-tags":{"filterDate":{"id":"f86f592c-2219-063c-8dc4-ca623c06a3ca","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null},"filterGender":{"id":"91f3014a-fb66-6724-708c-8e89f56e2779","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"757a20cf-8f70-6857-0ed5-acb310688b3a","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":["Birth"]},"filterState":{"id":"9384f1c8-b896-7ddb-6f32-204beba13dd3","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"58ab4870-ee4a-8362-2689-440572bb65de","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"stateName\": \"$stateName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"stateName\": \"$_id.stateName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"stateName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''State Name'': \"$allInfo.stateName\"\n , ''Registrations'': \"$allInfo.count\"\n }}\n]","collection":"registrations"},"type":"native"},"id":33,"parameter_mappings":[],"display":"table","entity_id":"g5hTQaT1d2p1OX0tU90WQ","collection_preview":true,"visualization_settings":{"series_settings":{"Registrations":{"color":"#ED8535"}},"graph.dimensions":["State Name"],"graph.show_values":true,"graph.y_axis.title_text":"No. of registrations","table.pivot_column":"State Name","table.cell_column":"Registrations","graph.metrics":["Registrations"]},"is_write":false,"parameters":[{"id":"f86f592c-2219-063c-8dc4-ca623c06a3ca","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"91f3014a-fb66-6724-708c-8e89f56e2779","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"757a20cf-8f70-6857-0ed5-acb310688b3a","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent","default":["Birth"]},{"id":"9384f1c8-b896-7ddb-6f32-204beba13dd3","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"58ab4870-ee4a-8', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(668, 1, '362-2689-440572bb65de","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(669, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":18,"query_type":"native","name":"Registrations by State","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"template-tags":{"filterDate":{"id":"f86f592c-2219-063c-8dc4-ca623c06a3ca","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null},"filterGender":{"id":"91f3014a-fb66-6724-708c-8e89f56e2779","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"757a20cf-8f70-6857-0ed5-acb310688b3a","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":["Birth"]},"filterState":{"id":"9384f1c8-b896-7ddb-6f32-204beba13dd3","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"58ab4870-ee4a-8362-2689-440572bb65de","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"stateName\": \"$stateName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"stateName\": \"$_id.stateName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"stateName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''State Name'': \"$allInfo.stateName\"\n , ''Registrations'': \"$allInfo.count\"\n }}\n]","collection":"registrations"},"type":"native"},"id":33,"parameter_mappings":[],"display":"table","entity_id":"g5hTQaT1d2p1OX0tU90WQ","collection_preview":true,"visualization_settings":{"series_settings":{"Registrations":{"color":"#ED8535"}},"graph.dimensions":["State Name"],"graph.show_values":true,"graph.y_axis.title_text":"No. of registrations","table.pivot_column":"State Name","table.cell_column":"Registrations","column_settings":{"[\"name\",\"State Name\"]":{"column_title":"State"}},"graph.metrics":["Registrations"]},"is_write":false,"parameters":[{"id":"f86f592c-2219-063c-8dc4-ca623c06a3ca","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"91f3014a-fb66-6724-708c-8e89f56e2779","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"757a20cf-8f70-6857-0ed5-acb310688b3a","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent","default":["Birth"]},{"id":"9384f1c8-b896-7ddb-6f32-204beba13dd3","type":"string/=","target":["dimension",["template-tag","f', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(669, 1, 'ilterState"]],"name":"State","slug":"filterState"},{"id":"58ab4870-ee4a-8362-2689-440572bb65de","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(670, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":18,"query_type":"native","name":"Registrations by State","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"template-tags":{"filterDate":{"id":"f86f592c-2219-063c-8dc4-ca623c06a3ca","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null},"filterGender":{"id":"91f3014a-fb66-6724-708c-8e89f56e2779","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"757a20cf-8f70-6857-0ed5-acb310688b3a","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":["Birth"]},"filterState":{"id":"9384f1c8-b896-7ddb-6f32-204beba13dd3","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"58ab4870-ee4a-8362-2689-440572bb65de","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"stateName\": \"$stateName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"stateName\": \"$_id.stateName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"stateName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''State Name'': \"$allInfo.stateName\"\n , ''Registrations'': \"$allInfo.count\"\n }}\n]","collection":"registrations"},"type":"native"},"id":33,"parameter_mappings":[],"display":"table","entity_id":"g5hTQaT1d2p1OX0tU90WQ","collection_preview":true,"visualization_settings":{"series_settings":{"Registrations":{"color":"#ED8535"}},"graph.dimensions":["State Name"],"graph.show_values":true,"graph.y_axis.title_text":"No. of registrations","table.pivot_column":"State Name","table.cell_column":"Registrations","column_settings":{"[\"name\",\"State Name\"]":{"column_title":"State Name"}},"graph.metrics":["Registrations"]},"is_write":false,"parameters":[{"id":"f86f592c-2219-063c-8dc4-ca623c06a3ca","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"91f3014a-fb66-6724-708c-8e89f56e2779","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"757a20cf-8f70-6857-0ed5-acb310688b3a","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent","default":["Birth"]},{"id":"9384f1c8-b896-7ddb-6f32-204beba13dd3","type":"string/=","target":["dimension",["template-ta', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(670, 1, 'g","filterState"]],"name":"State","slug":"filterState"},{"id":"58ab4870-ee4a-8362-2689-440572bb65de","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(667, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":11,"query_type":"native","name":"Live Births by Order","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterGender":{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","name":"filterOffice","display-name":"District","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"996f1d61-a845-0afe-bb4c-f36ac4ab32be","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , birthOrder: ''$birthOrder''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$eq: [''$birthOrder'', 1]}] }, then: ''1''},\n {case: {$and: [{$eq: [''$birthOrder'', 2]}] }, then: ''2''},\n {case: {$and: [{$eq: [''$birthOrder'', 3]}] }, then: ''3''},\n {case: {$and: [{$eq: [''$birthOrder'', 4]}] }, then: ''4''},\n {case: {$and: [{$eq: [''$birthOrder'', 5]}] }, then: ''5''},\n {case: {$and: [{$gte: [''$birthOrder'', 6]}] }, then: ''6+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Order\": 1\n }\n }\n]","collection":"registrations"},"database":3},"id":19,"parameter_mappings":[],"display":"bar","entity_id":"L6nXdi04nvxgEh1eJYrwR","collection_preview":true,"visualization_settings":{"graph.show_values":true,"pie.dimension":"birthOrder","graph.seri', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(667, 1, 'es_order_dimension":null,"graph.x_axis.title_text":"Birth Order","graph.metrics":[null],"graph.series_order":null,"pie.metric":"count","series_settings":{"Count":{"color":"#F7C41F"}},"graph.dimensions":[]},"is_write":false,"parameters":[{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"District","slug":"filterOffice"},{"id":"996f1d61-a845-0afe-bb4c-f36ac4ab32be","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(668, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":18,"query_type":"native","name":"Registrations by state","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"template-tags":{"filterDate":{"id":"f86f592c-2219-063c-8dc4-ca623c06a3ca","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null},"filterGender":{"id":"91f3014a-fb66-6724-708c-8e89f56e2779","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"757a20cf-8f70-6857-0ed5-acb310688b3a","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":["Birth"]},"filterState":{"id":"9384f1c8-b896-7ddb-6f32-204beba13dd3","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"58ab4870-ee4a-8362-2689-440572bb65de","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"stateName\": \"$stateName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"stateName\": \"$_id.stateName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"stateName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''State Name'': \"$allInfo.stateName\"\n , ''Registrations'': \"$allInfo.count\"\n }}\n]","collection":"registrations"},"type":"native"},"id":33,"parameter_mappings":[],"display":"row","entity_id":"g5hTQaT1d2p1OX0tU90WQ","collection_preview":true,"visualization_settings":{"series_settings":{"Registrations":{"color":"#ED8535"}},"graph.dimensions":["State Name"],"graph.show_values":true,"graph.y_axis.title_text":"No. of registrations","graph.metrics":["Registrations"]},"is_write":false,"parameters":[{"id":"f86f592c-2219-063c-8dc4-ca623c06a3ca","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"91f3014a-fb66-6724-708c-8e89f56e2779","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"757a20cf-8f70-6857-0ed5-acb310688b3a","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent","default":["Birth"]},{"id":"9384f1c8-b896-7ddb-6f32-204beba13dd3","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"58ab4870-ee4a-8362-2689-440572bb65de","type":"string/=","target":["dimension",["templat', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(668, 1, 'e-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(669, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":18,"query_type":"native","name":"Registrations by State","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"template-tags":{"filterDate":{"id":"f86f592c-2219-063c-8dc4-ca623c06a3ca","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null},"filterGender":{"id":"91f3014a-fb66-6724-708c-8e89f56e2779","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"757a20cf-8f70-6857-0ed5-acb310688b3a","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":["Birth"]},"filterState":{"id":"9384f1c8-b896-7ddb-6f32-204beba13dd3","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"58ab4870-ee4a-8362-2689-440572bb65de","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"stateName\": \"$stateName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"stateName\": \"$_id.stateName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"stateName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''State Name'': \"$allInfo.stateName\"\n , ''Registrations'': \"$allInfo.count\"\n }}\n]","collection":"registrations"},"type":"native"},"id":33,"parameter_mappings":[],"display":"table","entity_id":"g5hTQaT1d2p1OX0tU90WQ","collection_preview":true,"visualization_settings":{"series_settings":{"Registrations":{"color":"#ED8535"}},"graph.dimensions":["State Name"],"graph.show_values":true,"graph.y_axis.title_text":"No. of registrations","table.pivot_column":"State Name","table.cell_column":"Registrations","graph.metrics":["Registrations"]},"is_write":false,"parameters":[{"id":"f86f592c-2219-063c-8dc4-ca623c06a3ca","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"91f3014a-fb66-6724-708c-8e89f56e2779","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"757a20cf-8f70-6857-0ed5-acb310688b3a","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent","default":["Birth"]},{"id":"9384f1c8-b896-7ddb-6f32-204beba13dd3","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"58ab4870-ee4a-8', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(669, 1, '362-2689-440572bb65de","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(670, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":18,"query_type":"native","name":"Registrations by State","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"template-tags":{"filterDate":{"id":"f86f592c-2219-063c-8dc4-ca623c06a3ca","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null},"filterGender":{"id":"91f3014a-fb66-6724-708c-8e89f56e2779","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"757a20cf-8f70-6857-0ed5-acb310688b3a","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":["Birth"]},"filterState":{"id":"9384f1c8-b896-7ddb-6f32-204beba13dd3","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"58ab4870-ee4a-8362-2689-440572bb65de","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"stateName\": \"$stateName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"stateName\": \"$_id.stateName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"stateName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''State Name'': \"$allInfo.stateName\"\n , ''Registrations'': \"$allInfo.count\"\n }}\n]","collection":"registrations"},"type":"native"},"id":33,"parameter_mappings":[],"display":"table","entity_id":"g5hTQaT1d2p1OX0tU90WQ","collection_preview":true,"visualization_settings":{"series_settings":{"Registrations":{"color":"#ED8535"}},"graph.dimensions":["State Name"],"graph.show_values":true,"graph.y_axis.title_text":"No. of registrations","table.pivot_column":"State Name","table.cell_column":"Registrations","column_settings":{"[\"name\",\"State Name\"]":{"column_title":"State"}},"graph.metrics":["Registrations"]},"is_write":false,"parameters":[{"id":"f86f592c-2219-063c-8dc4-ca623c06a3ca","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"91f3014a-fb66-6724-708c-8e89f56e2779","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"757a20cf-8f70-6857-0ed5-acb310688b3a","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent","default":["Birth"]},{"id":"9384f1c8-b896-7ddb-6f32-204beba13dd3","type":"string/=","target":["dimension",["template-tag","f', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(670, 1, 'ilterState"]],"name":"State","slug":"filterState"},{"id":"58ab4870-ee4a-8362-2689-440572bb65de","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(671, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":18,"query_type":"native","name":"Registrations by State","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"template-tags":{"filterDate":{"id":"f86f592c-2219-063c-8dc4-ca623c06a3ca","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null},"filterGender":{"id":"91f3014a-fb66-6724-708c-8e89f56e2779","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"757a20cf-8f70-6857-0ed5-acb310688b3a","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":["Birth"]},"filterState":{"id":"9384f1c8-b896-7ddb-6f32-204beba13dd3","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"58ab4870-ee4a-8362-2689-440572bb65de","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"stateName\": \"$stateName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"stateName\": \"$_id.stateName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"stateName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''State Name'': \"$allInfo.stateName\"\n , ''Registrations'': \"$allInfo.count\"\n }}\n]","collection":"registrations"},"type":"native"},"id":33,"parameter_mappings":[],"display":"table","entity_id":"g5hTQaT1d2p1OX0tU90WQ","collection_preview":true,"visualization_settings":{"series_settings":{"Registrations":{"color":"#ED8535"}},"graph.dimensions":["State Name"],"graph.show_values":true,"graph.y_axis.title_text":"No. of registrations","table.pivot_column":"State Name","table.cell_column":"Registrations","column_settings":{"[\"name\",\"State Name\"]":{"column_title":"State Name"}},"graph.metrics":["Registrations"]},"is_write":false,"parameters":[{"id":"f86f592c-2219-063c-8dc4-ca623c06a3ca","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"91f3014a-fb66-6724-708c-8e89f56e2779","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"757a20cf-8f70-6857-0ed5-acb310688b3a","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent","default":["Birth"]},{"id":"9384f1c8-b896-7ddb-6f32-204beba13dd3","type":"string/=","target":["dimension",["template-ta', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(671, 1, 'g","filterState"]],"name":"State","slug":"filterState"},{"id":"58ab4870-ee4a-8362-2689-440572bb65de","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); INSERT INTO "PUBLIC"."REVISION" VALUES (645, 'Dashboard', 4, 1, TIMESTAMP WITH TIME ZONE '2023-02-24 15:14:52.796+07', '{"description":null,"name":"Leaderboard","cache_ttl":null,"cards":[{"size_x":5,"size_y":4,"row":0,"col":0,"id":37,"card_id":12,"series":[]},{"size_x":2,"size_y":2,"row":0,"col":0,"id":38,"card_id":33,"series":[]}]}', FALSE, FALSE, NULL), (646, 'Dashboard', 4, 1, TIMESTAMP WITH TIME ZONE '2023-02-24 15:14:53.037+07', '{"description":null,"name":"Leaderboard","cache_ttl":null,"cards":[{"size_x":9,"size_y":8,"row":0,"col":0,"id":37,"card_id":12,"series":[]},{"size_x":9,"size_y":8,"row":0,"col":9,"id":38,"card_id":33,"series":[]}]}', FALSE, FALSE, NULL), @@ -175438,21 +175448,21 @@ INSERT INTO "PUBLIC"."REVISION" VALUES (648, 'Dashboard', 4, 1, TIMESTAMP WITH TIME ZONE '2023-02-24 15:18:29.713+07', '{"description":null,"name":"Leaderboard","cache_ttl":null,"cards":[{"size_x":9,"size_y":8,"row":0,"col":0,"id":37,"card_id":12,"series":[]},{"size_x":9,"size_y":8,"row":0,"col":9,"id":38,"card_id":33,"series":[]}]}', FALSE, FALSE, NULL), (649, 'Dashboard', 4, 1, TIMESTAMP WITH TIME ZONE '2023-02-24 15:18:29.883+07', '{"description":null,"name":"Leaderboard","cache_ttl":null,"cards":[{"size_x":9,"size_y":8,"row":0,"col":0,"id":37,"card_id":12,"series":[]},{"size_x":9,"size_y":8,"row":0,"col":9,"id":38,"card_id":33,"series":[]}]}', FALSE, FALSE, NULL), (650, 'Dashboard', 4, 1, TIMESTAMP WITH TIME ZONE '2023-02-24 15:18:29.917+07', '{"description":null,"name":"Leaderboard","cache_ttl":null,"cards":[{"size_x":9,"size_y":8,"row":0,"col":0,"id":37,"card_id":12,"series":[]},{"size_x":9,"size_y":8,"row":0,"col":9,"id":38,"card_id":33,"series":[]}]}', FALSE, FALSE, NULL), -(651, 'Card', 19, 1, TIMESTAMP WITH TIME ZONE '2023-05-08 13:32:28.803+06', SYSTEM_COMBINE_CLOB(666), FALSE, FALSE, NULL), -(660, 'Card', 33, 1, TIMESTAMP WITH TIME ZONE '2023-05-09 14:05:01.745+06', SYSTEM_COMBINE_CLOB(667), FALSE, FALSE, NULL), -(661, 'Card', 33, 1, TIMESTAMP WITH TIME ZONE '2023-05-09 14:05:20.153+06', SYSTEM_COMBINE_CLOB(668), FALSE, FALSE, NULL), -(662, 'Card', 33, 1, TIMESTAMP WITH TIME ZONE '2023-05-09 14:06:24.683+06', SYSTEM_COMBINE_CLOB(669), FALSE, FALSE, NULL), -(663, 'Card', 33, 1, TIMESTAMP WITH TIME ZONE '2023-05-09 14:07:29.162+06', SYSTEM_COMBINE_CLOB(670), FALSE, FALSE, NULL), +(651, 'Card', 19, 1, TIMESTAMP WITH TIME ZONE '2023-05-08 13:32:28.803+06', SYSTEM_COMBINE_CLOB(667), FALSE, FALSE, NULL), +(660, 'Card', 33, 1, TIMESTAMP WITH TIME ZONE '2023-05-09 14:05:01.745+06', SYSTEM_COMBINE_CLOB(668), FALSE, FALSE, NULL), +(661, 'Card', 33, 1, TIMESTAMP WITH TIME ZONE '2023-05-09 14:05:20.153+06', SYSTEM_COMBINE_CLOB(669), FALSE, FALSE, NULL), +(662, 'Card', 33, 1, TIMESTAMP WITH TIME ZONE '2023-05-09 14:06:24.683+06', SYSTEM_COMBINE_CLOB(670), FALSE, FALSE, NULL), +(663, 'Card', 33, 1, TIMESTAMP WITH TIME ZONE '2023-05-09 14:07:29.162+06', SYSTEM_COMBINE_CLOB(671), FALSE, FALSE, NULL), (664, 'Dashboard', 3, 1, TIMESTAMP WITH TIME ZONE '2023-05-09 14:12:25.201+06', '{"description":null,"name":"Statistics Dashboard","cache_ttl":null,"cards":[{"size_x":9,"size_y":4,"row":0,"col":9,"id":21,"card_id":20,"series":[]},{"size_x":9,"size_y":4,"row":8,"col":0,"id":29,"card_id":27,"series":[]}]}', FALSE, FALSE, NULL), (665, 'Dashboard', 3, 1, TIMESTAMP WITH TIME ZONE '2023-05-09 14:12:25.215+06', '{"description":null,"name":"Statistics Dashboard","cache_ttl":null,"cards":[{"size_x":9,"size_y":4,"row":0,"col":9,"id":21,"card_id":20,"series":[]},{"size_x":9,"size_y":4,"row":8,"col":0,"id":29,"card_id":27,"series":[]}]}', FALSE, FALSE, NULL), (666, 'Dashboard', 3, 1, TIMESTAMP WITH TIME ZONE '2023-05-09 14:12:25.223+06', '{"description":null,"name":"Statistics Dashboard","cache_ttl":null,"cards":[{"size_x":9,"size_y":4,"row":0,"col":9,"id":21,"card_id":20,"series":[]},{"size_x":9,"size_y":4,"row":8,"col":0,"id":29,"card_id":27,"series":[]}]}', FALSE, FALSE, NULL), (667, 'Dashboard', 3, 1, TIMESTAMP WITH TIME ZONE '2023-05-09 14:12:25.234+06', '{"description":null,"name":"Statistics Dashboard","cache_ttl":null,"cards":[{"size_x":9,"size_y":4,"row":0,"col":9,"id":21,"card_id":20,"series":[]},{"size_x":9,"size_y":4,"row":8,"col":0,"id":29,"card_id":27,"series":[]}]}', FALSE, FALSE, NULL), (668, 'Dashboard', 3, 1, TIMESTAMP WITH TIME ZONE '2023-05-09 14:12:25.253+06', '{"description":null,"name":"Statistics Dashboard","cache_ttl":null,"cards":[{"size_x":9,"size_y":4,"row":0,"col":9,"id":21,"card_id":20,"series":[]},{"size_x":9,"size_y":4,"row":0,"col":0,"id":29,"card_id":27,"series":[]}]}', FALSE, FALSE, NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(671, 0, '{"description":null,"archived":true,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":11,"query_type":"native","name":"Live Births by Order","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterGender":{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","name":"filterOffice","display-name":"District","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"996f1d61-a845-0afe-bb4c-f36ac4ab32be","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , birthOrder: ''$birthOrder''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$eq: [''$birthOrder'', 1]}] }, then: ''1''},\n {case: {$and: [{$eq: [''$birthOrder'', 2]}] }, then: ''2''},\n {case: {$and: [{$eq: [''$birthOrder'', 3]}] }, then: ''3''},\n {case: {$and: [{$eq: [''$birthOrder'', 4]}] }, then: ''4''},\n {case: {$and: [{$eq: [''$birthOrder'', 5]}] }, then: ''5''},\n {case: {$and: [{$gte: [''$birthOrder'', 6]}] }, then: ''6+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Order\": 1\n }\n }\n]","collection":"registrations"},"database":3},"id":19,"parameter_mappings":[],"display":"bar","entity_id":"L6nXdi04nvxgEh1eJYrwR","collection_preview":true,"visualization_settings":{"graph.show_values":true,"pie.dimension":"birthOrder","graph.serie', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(671, 1, 's_order_dimension":null,"graph.x_axis.title_text":"Birth Order","graph.metrics":[null],"graph.series_order":null,"pie.metric":"count","series_settings":{"Count":{"color":"#F7C41F"}},"graph.dimensions":[]},"is_write":false,"parameters":[{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"District","slug":"filterOffice"},{"id":"996f1d61-a845-0afe-bb4c-f36ac4ab32be","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(672, 0, '{"description":null,"archived":true,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":11,"query_type":"native","name":"Live Births by Order","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterGender":{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","name":"filterOffice","display-name":"District","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"996f1d61-a845-0afe-bb4c-f36ac4ab32be","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , birthOrder: ''$birthOrder''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$eq: [''$birthOrder'', 1]}] }, then: ''1''},\n {case: {$and: [{$eq: [''$birthOrder'', 2]}] }, then: ''2''},\n {case: {$and: [{$eq: [''$birthOrder'', 3]}] }, then: ''3''},\n {case: {$and: [{$eq: [''$birthOrder'', 4]}] }, then: ''4''},\n {case: {$and: [{$eq: [''$birthOrder'', 5]}] }, then: ''5''},\n {case: {$and: [{$gte: [''$birthOrder'', 6]}] }, then: ''6+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Order\": 1\n }\n }\n]","collection":"registrations"},"database":3},"id":19,"parameter_mappings":[],"display":"bar","entity_id":"L6nXdi04nvxgEh1eJYrwR","collection_preview":true,"visualization_settings":{"graph.show_values":true,"pie.dimension":"birthOrder","graph.serie', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(672, 1, 's_order_dimension":null,"graph.x_axis.title_text":"Birth Order","graph.metrics":[null],"graph.series_order":null,"pie.metric":"count","series_settings":{"Count":{"color":"#F7C41F"}},"graph.dimensions":[]},"is_write":false,"parameters":[{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"District","slug":"filterOffice"},{"id":"996f1d61-a845-0afe-bb4c-f36ac4ab32be","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}],"dataset":false,"public_uuid":null}', NULL); INSERT INTO "PUBLIC"."REVISION" VALUES (669, 'Dashboard', 3, 1, TIMESTAMP WITH TIME ZONE '2023-05-09 14:12:25.285+06', '{"description":null,"name":"Statistics Dashboard","cache_ttl":null,"cards":[{"size_x":9,"size_y":4,"row":0,"col":9,"id":21,"card_id":20,"series":[]},{"size_x":9,"size_y":4,"row":0,"col":0,"id":29,"card_id":27,"series":[]}]}', FALSE, FALSE, NULL), -(670, 'Card', 19, 1, TIMESTAMP WITH TIME ZONE '2023-05-09 14:14:19.307+06', SYSTEM_COMBINE_CLOB(671), FALSE, FALSE, NULL), +(670, 'Card', 19, 1, TIMESTAMP WITH TIME ZONE '2023-05-09 14:14:19.307+06', SYSTEM_COMBINE_CLOB(672), FALSE, FALSE, NULL), (671, 'Card', 29, 1, TIMESTAMP WITH TIME ZONE '2023-05-09 14:14:27.284+06', '{"description":null,"archived":true,"collection_position":null,"table_id":70,"database_id":3,"enable_embedding":false,"collection_id":15,"query_type":"query","name":"Live Births by Type of Birth","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"query","query":{"aggregation":[["count"]],"breakout":[["expression","TypeOfBirth"]],"expressions":{"TypeOfBirth":["case",[[["=",["field",674,null],"SINGLE"],"Single"],[["=",["field",674,null],"TWIN"],"Twin"],[["=",["field",674,null],"TRIPLET"],"Triplet"],[["=",["field",674,null],"QUADRUPLET"],"Quadruplet"]]]},"filter":["=",["field",666,null],"Birth"],"order-by":[["desc",["aggregation",0,null]]],"source-table":70},"database":3},"id":29,"parameter_mappings":[],"display":"pie","entity_id":"GOqql9fnmIgyeOChWso6x","collection_preview":true,"visualization_settings":{"pie.colors":{"Quadruplet":"#8A5EB0","Single":"#F7C41F"}},"is_write":false,"parameters":[],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL), (672, 'Dashboard', 1, 1, TIMESTAMP WITH TIME ZONE '2023-05-09 14:16:17.22+06', '{"description":null,"name":"Births registered by age of child","cache_ttl":null,"cards":[{"size_x":9,"size_y":5,"row":0,"col":0,"id":1,"card_id":1,"series":[]},{"size_x":9,"size_y":5,"row":0,"col":9,"id":2,"card_id":2,"series":[]},{"size_x":9,"size_y":5,"row":5,"col":0,"id":4,"card_id":4,"series":[]}]}', FALSE, FALSE, NULL), (673, 'Card', 32, 1, TIMESTAMP WITH TIME ZONE '2023-05-09 14:17:29.731+06', '{"description":null,"archived":false,"collection_position":null,"table_id":70,"database_id":3,"enable_embedding":false,"collection_id":18,"query_type":"query","name":"Registrations by State","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"query":{"source-table":70,"aggregation":[["count"]],"breakout":[["field",671,null]],"order-by":[["desc",["aggregation",0,null]]],"limit":10},"type":"query"},"id":32,"parameter_mappings":[],"display":"row","entity_id":"Ja4C9jmYDwEnYTid4pLzA","collection_preview":true,"visualization_settings":{"map.type":"region","map.region":"us_states","graph.dimensions":["stateName"],"graph.metrics":["count"]},"is_write":false,"parameters":[],"dataset":false,"public_uuid":null}', FALSE, FALSE, NULL), @@ -175467,29 +175477,29 @@ INSERT INTO "PUBLIC"."REVISION" VALUES (681, 'Dashboard', 2, 1, TIMESTAMP WITH TIME ZONE '2023-05-09 14:57:32.99+06', '{"description":null,"name":"Registrations Dashboard","cache_ttl":null,"cards":[{"size_x":4,"size_y":4,"row":0,"col":14,"id":14,"card_id":1,"series":[]},{"size_x":13,"size_y":5,"row":4,"col":5,"id":15,"card_id":9,"series":[]},{"size_x":5,"size_y":5,"row":4,"col":0,"id":17,"card_id":13,"series":[]},{"size_x":12,"size_y":4,"row":9,"col":0,"id":18,"card_id":14,"series":[]},{"size_x":3,"size_y":4,"row":0,"col":0,"id":20,"card_id":16,"series":[]},{"size_x":5,"size_y":4,"row":0,"col":9,"id":33,"card_id":31,"series":[]},{"size_x":6,"size_y":4,"row":0,"col":3,"id":34,"card_id":30,"series":[]},{"size_x":6,"size_y":4,"row":9,"col":12,"id":36,"card_id":28,"series":[]}]}', FALSE, FALSE, NULL), (682, 'Dashboard', 2, 1, TIMESTAMP WITH TIME ZONE '2023-05-09 16:27:35.107+06', '{"description":null,"name":"Registrations Dashboard","cache_ttl":null,"cards":[{"size_x":4,"size_y":4,"row":0,"col":14,"id":14,"card_id":1,"series":[]},{"size_x":13,"size_y":5,"row":4,"col":5,"id":15,"card_id":9,"series":[]},{"size_x":5,"size_y":5,"row":4,"col":0,"id":17,"card_id":13,"series":[]},{"size_x":12,"size_y":4,"row":9,"col":0,"id":18,"card_id":14,"series":[]},{"size_x":3,"size_y":4,"row":0,"col":0,"id":20,"card_id":16,"series":[]},{"size_x":5,"size_y":4,"row":0,"col":9,"id":33,"card_id":31,"series":[]},{"size_x":6,"size_y":4,"row":0,"col":3,"id":34,"card_id":30,"series":[]},{"size_x":6,"size_y":4,"row":9,"col":12,"id":36,"card_id":28,"series":[]}]}', FALSE, FALSE, NULL), (683, 'Dashboard', 2, 1, TIMESTAMP WITH TIME ZONE '2023-05-09 16:27:35.163+06', '{"description":null,"name":"Registrations Dashboard","cache_ttl":null,"cards":[{"size_x":4,"size_y":4,"row":0,"col":14,"id":14,"card_id":1,"series":[]},{"size_x":13,"size_y":5,"row":4,"col":5,"id":15,"card_id":9,"series":[]},{"size_x":5,"size_y":5,"row":4,"col":0,"id":17,"card_id":13,"series":[]},{"size_x":12,"size_y":4,"row":9,"col":0,"id":18,"card_id":14,"series":[]},{"size_x":3,"size_y":4,"row":0,"col":0,"id":20,"card_id":16,"series":[]},{"size_x":5,"size_y":4,"row":0,"col":9,"id":33,"card_id":31,"series":[]},{"size_x":6,"size_y":4,"row":0,"col":3,"id":34,"card_id":30,"series":[]},{"size_x":6,"size_y":4,"row":9,"col":12,"id":36,"card_id":28,"series":[]}]}', FALSE, FALSE, NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(672, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":12,"query_type":"native","name":"Live Births by Age of Mother","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterDistrict }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterDistrict }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , mothersAge: ''$mothersAgeAtBirthOfChildInYears''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$gte: [''$mothersAge'', 9]}, {$lt: [''$mothersAge'', 15]}] }, then: ''09-14''},\n {case: {$and: [{$gte: [''$mothersAge'', 15]}, {$lt: [''$mothersAge'', 20]}] }, then: ''15-19''},\n {case: {$and: [{$gte: [''$mothersAge'', 20]}, {$lt: [''$mothersAge'', 25]}] }, then: ''20-24''},\n {case: {$and: [{$gte: [''$mothersAge'', 25]}, {$lt: [''$mothersAge'', 30]}] }, then: ''25-29''},\n {case: {$and: [{$gte: [''$mothersAge'', 30]}, {$lt: [''$mothersAge'', 35]}] }, then: ''30-34''},\n {case: {$and: [{$gte: [''$mothersAge'', 35]}, {$lt: [''$mothersAge'', 40]}] }, then: ''35-39''},\n {case: {$and: [{$gte: [''$mothersAge'', 40]}, {$lt: [''$mothersAge'', 45]}] }, then: ''40-44''},\n {case: {$and: [{$gte: [''$mothersAge'', 45]}, {$lt: [''$mothersAge'', 50]}] }, then: ''45-49''},\n {case: {$and: [{$gte: [''$mothersAge'', 50]}, {$lt: [''$mothersAge'', 55]}] }, then: ''50-54''},\n {case: {$and: [{$gte: [''$mothersAge'', 55]}, {$lt: [''$mothersAge'', 60]}] }, then: ''55-59''},\n {case: {$and: [{$gte: [''$mothersAge'', 60]}] }, then: ''60+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Order\": 1\n }\n }\n]","template-tags":{"filterGender":{"id":"56559614-c685-9d81-d44b-a688fe5b103b","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","name":"', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(672, 1, 'filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterDate":{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null},"filterDistrict":{"id":"0d1e592a-47dc-e5ed-9522-613ab64ea6c2","name":"filterDistrict","display-name":"District","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null}}},"type":"native"},"id":20,"parameter_mappings":[],"display":"bar","entity_id":"PcnknQN2IYs_mJkwA8yRq","collection_preview":true,"visualization_settings":{"graph.x_axis.title_text":"Age","graph.dimensions":[],"table.cell_column":"Count","table.pivot_column":"Order","series_settings":{"Count":{"color":"#E75454"}},"graph.show_values":true,"graph.metrics":[null]},"is_write":false,"parameters":[{"id":"56559614-c685-9d81-d44b-a688fe5b103b","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"0d1e592a-47dc-e5ed-9522-613ab64ea6c2","type":"string/=","target":["dimension",["template-tag","filterDistrict"]],"name":"District","slug":"filterDistrict"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(673, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":12,"query_type":"native","name":"Live Births by Age of Mother","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterGender":{"id":"56559614-c685-9d81-d44b-a688fe5b103b","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterDate":{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null},"filterDistrict":{"id":"0d1e592a-47dc-e5ed-9522-613ab64ea6c2","name":"filterDistrict","display-name":"District","type":"dimension","dimension":["field",723,null],"widget-type":"string/=","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterDistrict }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterDistrict }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , mothersAge: ''$mothersAgeAtBirthOfChildInYears''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$gte: [''$mothersAge'', 9]}, {$lt: [''$mothersAge'', 15]}] }, then: ''09-14''},\n {case: {$and: [{$gte: [''$mothersAge'', 15]}, {$lt: [''$mothersAge'', 20]}] }, then: ''15-19''},\n {case: {$and: [{$gte: [''$mothersAge'', 20]}, {$lt: [''$mothersAge'', 25]}] }, then: ''20-24''},\n {case: {$and: [{$gte: [''$mothersAge'', 25]}, {$lt: [''$mothersAge'', 30]}] }, then: ''25-29''},\n {case: {$and: [{$gte: [''$mothersAge'', 30]}, {$lt: [''$mothersAge'', 35]}] }, then: ''30-34''},\n {case: {$and: [{$gte: [''$mothersAge'', 35]}, {$lt: [''$mothersAge'', 40]}] }, then: ''35-39''},\n {case: {$and: [{$gte: [''$mothersAge'', 40]}, {$lt: [''$mothersAge'', 45]}] }, then: ''40-44''},\n {case: {$and: [{$gte: [''$mothersAge'', 45]}, {$lt: [''$mothersAge'', 50]}] }, then: ''45-49''},\n {case: {$and: [{$gte: [''$mothersAge'', 50]}, {$lt: [''$mothersAge'', 55]}] }, then: ''50-54''},\n {case: {$and: [{$gte: [''$mothersAge'', 55]}, {$lt: [''$mothersAge'', 60]}] }, then: ''55-59''},\n {case: {$and: [{$gte: [''$mothersAge'', 60]}] }, then: ''60+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(673, 1, '\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Order\": 1\n }\n }\n]","collection":"registrations"},"database":3},"id":20,"parameter_mappings":[],"display":"bar","entity_id":"PcnknQN2IYs_mJkwA8yRq","collection_preview":true,"visualization_settings":{"graph.x_axis.title_text":"Age","graph.dimensions":[],"table.cell_column":"Count","table.pivot_column":"Order","series_settings":{"Count":{"color":"#E75454"}},"graph.show_values":true,"graph.metrics":[null]},"is_write":false,"parameters":[{"id":"56559614-c685-9d81-d44b-a688fe5b103b","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"0d1e592a-47dc-e5ed-9522-613ab64ea6c2","type":"string/=","target":["dimension",["template-tag","filterDistrict"]],"name":"District","slug":"filterDistrict"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(673, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":12,"query_type":"native","name":"Live Births by Age of Mother","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"collection":"registrations","query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterDistrict }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterDistrict }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , mothersAge: ''$mothersAgeAtBirthOfChildInYears''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$gte: [''$mothersAge'', 9]}, {$lt: [''$mothersAge'', 15]}] }, then: ''09-14''},\n {case: {$and: [{$gte: [''$mothersAge'', 15]}, {$lt: [''$mothersAge'', 20]}] }, then: ''15-19''},\n {case: {$and: [{$gte: [''$mothersAge'', 20]}, {$lt: [''$mothersAge'', 25]}] }, then: ''20-24''},\n {case: {$and: [{$gte: [''$mothersAge'', 25]}, {$lt: [''$mothersAge'', 30]}] }, then: ''25-29''},\n {case: {$and: [{$gte: [''$mothersAge'', 30]}, {$lt: [''$mothersAge'', 35]}] }, then: ''30-34''},\n {case: {$and: [{$gte: [''$mothersAge'', 35]}, {$lt: [''$mothersAge'', 40]}] }, then: ''35-39''},\n {case: {$and: [{$gte: [''$mothersAge'', 40]}, {$lt: [''$mothersAge'', 45]}] }, then: ''40-44''},\n {case: {$and: [{$gte: [''$mothersAge'', 45]}, {$lt: [''$mothersAge'', 50]}] }, then: ''45-49''},\n {case: {$and: [{$gte: [''$mothersAge'', 50]}, {$lt: [''$mothersAge'', 55]}] }, then: ''50-54''},\n {case: {$and: [{$gte: [''$mothersAge'', 55]}, {$lt: [''$mothersAge'', 60]}] }, then: ''55-59''},\n {case: {$and: [{$gte: [''$mothersAge'', 60]}] }, then: ''60+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Order\": 1\n }\n }\n]","template-tags":{"filterGender":{"id":"56559614-c685-9d81-d44b-a688fe5b103b","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","name":"', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(673, 1, 'filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterDate":{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null},"filterDistrict":{"id":"0d1e592a-47dc-e5ed-9522-613ab64ea6c2","name":"filterDistrict","display-name":"District","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null}}},"type":"native"},"id":20,"parameter_mappings":[],"display":"bar","entity_id":"PcnknQN2IYs_mJkwA8yRq","collection_preview":true,"visualization_settings":{"graph.x_axis.title_text":"Age","graph.dimensions":[],"table.cell_column":"Count","table.pivot_column":"Order","series_settings":{"Count":{"color":"#E75454"}},"graph.show_values":true,"graph.metrics":[null]},"is_write":false,"parameters":[{"id":"56559614-c685-9d81-d44b-a688fe5b103b","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"0d1e592a-47dc-e5ed-9522-613ab64ea6c2","type":"string/=","target":["dimension",["template-tag","filterDistrict"]],"name":"District","slug":"filterDistrict"}],"dataset":false,"public_uuid":null}', NULL); INSERT INTO SYSTEM_LOB_STREAM VALUES(674, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":12,"query_type":"native","name":"Live Births by Age of Mother","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterGender":{"id":"56559614-c685-9d81-d44b-a688fe5b103b","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterDate":{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null},"filterDistrict":{"id":"0d1e592a-47dc-e5ed-9522-613ab64ea6c2","name":"filterDistrict","display-name":"District","type":"dimension","dimension":["field",723,null],"widget-type":"string/=","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterDistrict }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterDistrict }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , mothersAge: ''$mothersAgeAtBirthOfChildInYears''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$gte: [''$mothersAge'', 9]}, {$lt: [''$mothersAge'', 15]}] }, then: ''09-14''},\n {case: {$and: [{$gte: [''$mothersAge'', 15]}, {$lt: [''$mothersAge'', 20]}] }, then: ''15-19''},\n {case: {$and: [{$gte: [''$mothersAge'', 20]}, {$lt: [''$mothersAge'', 25]}] }, then: ''20-24''},\n {case: {$and: [{$gte: [''$mothersAge'', 25]}, {$lt: [''$mothersAge'', 30]}] }, then: ''25-29''},\n {case: {$and: [{$gte: [''$mothersAge'', 30]}, {$lt: [''$mothersAge'', 35]}] }, then: ''30-34''},\n {case: {$and: [{$gte: [''$mothersAge'', 35]}, {$lt: [''$mothersAge'', 40]}] }, then: ''35-39''},\n {case: {$and: [{$gte: [''$mothersAge'', 40]}, {$lt: [''$mothersAge'', 45]}] }, then: ''40-44''},\n {case: {$and: [{$gte: [''$mothersAge'', 45]}, {$lt: [''$mothersAge'', 50]}] }, then: ''45-49''},\n {case: {$and: [{$gte: [''$mothersAge'', 50]}, {$lt: [''$mothersAge'', 55]}] }, then: ''50-54''},\n {case: {$and: [{$gte: [''$mothersAge'', 55]}, {$lt: [''$mothersAge'', 60]}] }, then: ''55-59''},\n {case: {$and: [{$gte: [''$mothersAge'', 60]}] }, then: ''60+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(674, 1, '\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Order\": 1\n }\n }\n]","collection":"registrations"},"database":3},"id":20,"parameter_mappings":[],"display":"table","entity_id":"PcnknQN2IYs_mJkwA8yRq","collection_preview":true,"visualization_settings":{"graph.x_axis.title_text":"Age","graph.dimensions":[],"table.cell_column":"Count","table.pivot_column":"Order","series_settings":{"Count":{"color":"#E75454"}},"graph.show_values":true,"graph.metrics":[null]},"is_write":false,"parameters":[{"id":"56559614-c685-9d81-d44b-a688fe5b103b","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"0d1e592a-47dc-e5ed-9522-613ab64ea6c2","type":"string/=","target":["dimension",["template-tag","filterDistrict"]],"name":"District","slug":"filterDistrict"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(674, 1, '\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Order\": 1\n }\n }\n]","collection":"registrations"},"database":3},"id":20,"parameter_mappings":[],"display":"bar","entity_id":"PcnknQN2IYs_mJkwA8yRq","collection_preview":true,"visualization_settings":{"graph.x_axis.title_text":"Age","graph.dimensions":[],"table.cell_column":"Count","table.pivot_column":"Order","series_settings":{"Count":{"color":"#E75454"}},"graph.show_values":true,"graph.metrics":[null]},"is_write":false,"parameters":[{"id":"56559614-c685-9d81-d44b-a688fe5b103b","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"0d1e592a-47dc-e5ed-9522-613ab64ea6c2","type":"string/=","target":["dimension",["template-tag","filterDistrict"]],"name":"District","slug":"filterDistrict"}],"dataset":false,"public_uuid":null}', NULL); INSERT INTO SYSTEM_LOB_STREAM VALUES(675, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":12,"query_type":"native","name":"Live Births by Age of Mother","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterGender":{"id":"56559614-c685-9d81-d44b-a688fe5b103b","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterDate":{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null},"filterDistrict":{"id":"0d1e592a-47dc-e5ed-9522-613ab64ea6c2","name":"filterDistrict","display-name":"District","type":"dimension","dimension":["field",723,null],"widget-type":"string/=","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterDistrict }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterDistrict }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , mothersAge: ''$mothersAgeAtBirthOfChildInYears''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$gte: [''$mothersAge'', 9]}, {$lt: [''$mothersAge'', 15]}] }, then: ''09-14''},\n {case: {$and: [{$gte: [''$mothersAge'', 15]}, {$lt: [''$mothersAge'', 20]}] }, then: ''15-19''},\n {case: {$and: [{$gte: [''$mothersAge'', 20]}, {$lt: [''$mothersAge'', 25]}] }, then: ''20-24''},\n {case: {$and: [{$gte: [''$mothersAge'', 25]}, {$lt: [''$mothersAge'', 30]}] }, then: ''25-29''},\n {case: {$and: [{$gte: [''$mothersAge'', 30]}, {$lt: [''$mothersAge'', 35]}] }, then: ''30-34''},\n {case: {$and: [{$gte: [''$mothersAge'', 35]}, {$lt: [''$mothersAge'', 40]}] }, then: ''35-39''},\n {case: {$and: [{$gte: [''$mothersAge'', 40]}, {$lt: [''$mothersAge'', 45]}] }, then: ''40-44''},\n {case: {$and: [{$gte: [''$mothersAge'', 45]}, {$lt: [''$mothersAge'', 50]}] }, then: ''45-49''},\n {case: {$and: [{$gte: [''$mothersAge'', 50]}, {$lt: [''$mothersAge'', 55]}] }, then: ''50-54''},\n {case: {$and: [{$gte: [''$mothersAge'', 55]}, {$lt: [''$mothersAge'', 60]}] }, then: ''55-59''},\n {case: {$and: [{$gte: [''$mothersAge'', 60]}] }, then: ''60+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(675, 1, '\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Order\": 1\n }\n }\n]","collection":"registrations"},"database":3},"id":20,"parameter_mappings":[],"display":"bar","entity_id":"PcnknQN2IYs_mJkwA8yRq","collection_preview":true,"visualization_settings":{"graph.show_values":true,"table.cell_column":"Count","graph.series_order_dimension":null,"graph.x_axis.title_text":"Age","graph.metrics":["Count"],"graph.series_order":null,"table.pivot_column":"Order","series_settings":{"Count":{"color":"#E75454"}},"graph.dimensions":["Order"]},"is_write":false,"parameters":[{"id":"56559614-c685-9d81-d44b-a688fe5b103b","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"0d1e592a-47dc-e5ed-9522-613ab64ea6c2","type":"string/=","target":["dimension",["template-tag","filterDistrict"]],"name":"District","slug":"filterDistrict"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(675, 1, '\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Order\": 1\n }\n }\n]","collection":"registrations"},"database":3},"id":20,"parameter_mappings":[],"display":"table","entity_id":"PcnknQN2IYs_mJkwA8yRq","collection_preview":true,"visualization_settings":{"graph.x_axis.title_text":"Age","graph.dimensions":[],"table.cell_column":"Count","table.pivot_column":"Order","series_settings":{"Count":{"color":"#E75454"}},"graph.show_values":true,"graph.metrics":[null]},"is_write":false,"parameters":[{"id":"56559614-c685-9d81-d44b-a688fe5b103b","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"0d1e592a-47dc-e5ed-9522-613ab64ea6c2","type":"string/=","target":["dimension",["template-tag","filterDistrict"]],"name":"District","slug":"filterDistrict"}],"dataset":false,"public_uuid":null}', NULL); INSERT INTO SYSTEM_LOB_STREAM VALUES(676, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":12,"query_type":"native","name":"Live Births by Age of Mother","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterGender":{"id":"56559614-c685-9d81-d44b-a688fe5b103b","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterDate":{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null},"filterDistrict":{"id":"0d1e592a-47dc-e5ed-9522-613ab64ea6c2","name":"filterDistrict","display-name":"District","type":"dimension","dimension":["field",723,null],"widget-type":"string/=","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterDistrict }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterDistrict }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , mothersAge: ''$mothersAgeAtBirthOfChildInYears''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$gte: [''$mothersAge'', 9]}, {$lt: [''$mothersAge'', 15]}] }, then: ''09-14''},\n {case: {$and: [{$gte: [''$mothersAge'', 15]}, {$lt: [''$mothersAge'', 20]}] }, then: ''15-19''},\n {case: {$and: [{$gte: [''$mothersAge'', 20]}, {$lt: [''$mothersAge'', 25]}] }, then: ''20-24''},\n {case: {$and: [{$gte: [''$mothersAge'', 25]}, {$lt: [''$mothersAge'', 30]}] }, then: ''25-29''},\n {case: {$and: [{$gte: [''$mothersAge'', 30]}, {$lt: [''$mothersAge'', 35]}] }, then: ''30-34''},\n {case: {$and: [{$gte: [''$mothersAge'', 35]}, {$lt: [''$mothersAge'', 40]}] }, then: ''35-39''},\n {case: {$and: [{$gte: [''$mothersAge'', 40]}, {$lt: [''$mothersAge'', 45]}] }, then: ''40-44''},\n {case: {$and: [{$gte: [''$mothersAge'', 45]}, {$lt: [''$mothersAge'', 50]}] }, then: ''45-49''},\n {case: {$and: [{$gte: [''$mothersAge'', 50]}, {$lt: [''$mothersAge'', 55]}] }, then: ''50-54''},\n {case: {$and: [{$gte: [''$mothersAge'', 55]}, {$lt: [''$mothersAge'', 60]}] }, then: ''55-59''},\n {case: {$and: [{$gte: [''$mothersAge'', 60]}] }, then: ''60+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''', NULL); INSERT INTO SYSTEM_LOB_STREAM VALUES(676, 1, '\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Order\": 1\n }\n }\n]","collection":"registrations"},"database":3},"id":20,"parameter_mappings":[],"display":"bar","entity_id":"PcnknQN2IYs_mJkwA8yRq","collection_preview":true,"visualization_settings":{"graph.show_values":true,"table.cell_column":"Count","graph.series_order_dimension":null,"graph.x_axis.title_text":"Age","graph.metrics":["Count"],"graph.series_order":null,"table.pivot_column":"Order","series_settings":{"Count":{"color":"#E75454"}},"graph.dimensions":["Order"]},"is_write":false,"parameters":[{"id":"56559614-c685-9d81-d44b-a688fe5b103b","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"0d1e592a-47dc-e5ed-9522-613ab64ea6c2","type":"string/=","target":["dimension",["template-tag","filterDistrict"]],"name":"District","slug":"filterDistrict"}],"dataset":false,"public_uuid":null}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(677, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":18,"query_type":"native","name":"Registrations by State","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"template-tags":{"filterDate":{"id":"f86f592c-2219-063c-8dc4-ca623c06a3ca","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null},"filterGender":{"id":"91f3014a-fb66-6724-708c-8e89f56e2779","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"757a20cf-8f70-6857-0ed5-acb310688b3a","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":["Birth"]},"filterState":{"id":"9384f1c8-b896-7ddb-6f32-204beba13dd3","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"58ab4870-ee4a-8362-2689-440572bb65de","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"stateName\": \"$stateName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"stateName\": \"$_id.stateName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"stateName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''State Name'': \"$allInfo.stateName\"\n , ''Registrations'': \"$allInfo.count\"\n }}\n]","collection":"registrations"},"type":"native"},"id":33,"parameter_mappings":[],"display":"row","entity_id":"g5hTQaT1d2p1OX0tU90WQ","collection_preview":true,"visualization_settings":{"series_settings":{"Registrations":{"color":"#ED8535"}},"graph.dimensions":["State Name"],"graph.show_values":true,"graph.y_axis.title_text":"No. of registrations","table.pivot_column":"State Name","table.cell_column":"Registrations","column_settings":{"[\"name\",\"State Name\"]":{"column_title":"State Name"}},"graph.metrics":["Registrations"]},"is_write":false,"parameters":[{"id":"f86f592c-2219-063c-8dc4-ca623c06a3ca","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"91f3014a-fb66-6724-708c-8e89f56e2779","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"757a20cf-8f70-6857-0ed5-acb310688b3a","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent","default":["Birth"]},{"id":"9384f1c8-b896-7ddb-6f32-204beba13dd3","type":"string/=","target":["dimension",["template-tag"', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(677, 1, ',"filterState"]],"name":"State","slug":"filterState"},{"id":"58ab4870-ee4a-8362-2689-440572bb65de","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(677, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":12,"query_type":"native","name":"Live Births by Age of Mother","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"type":"native","native":{"template-tags":{"filterGender":{"id":"56559614-c685-9d81-d44b-a688fe5b103b","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterDate":{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null},"filterDistrict":{"id":"0d1e592a-47dc-e5ed-9522-613ab64ea6c2","name":"filterDistrict","display-name":"District","type":"dimension","dimension":["field",723,null],"widget-type":"string/=","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterDistrict }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterDistrict }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , mothersAge: ''$mothersAgeAtBirthOfChildInYears''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$gte: [''$mothersAge'', 9]}, {$lt: [''$mothersAge'', 15]}] }, then: ''09-14''},\n {case: {$and: [{$gte: [''$mothersAge'', 15]}, {$lt: [''$mothersAge'', 20]}] }, then: ''15-19''},\n {case: {$and: [{$gte: [''$mothersAge'', 20]}, {$lt: [''$mothersAge'', 25]}] }, then: ''20-24''},\n {case: {$and: [{$gte: [''$mothersAge'', 25]}, {$lt: [''$mothersAge'', 30]}] }, then: ''25-29''},\n {case: {$and: [{$gte: [''$mothersAge'', 30]}, {$lt: [''$mothersAge'', 35]}] }, then: ''30-34''},\n {case: {$and: [{$gte: [''$mothersAge'', 35]}, {$lt: [''$mothersAge'', 40]}] }, then: ''35-39''},\n {case: {$and: [{$gte: [''$mothersAge'', 40]}, {$lt: [''$mothersAge'', 45]}] }, then: ''40-44''},\n {case: {$and: [{$gte: [''$mothersAge'', 45]}, {$lt: [''$mothersAge'', 50]}] }, then: ''45-49''},\n {case: {$and: [{$gte: [''$mothersAge'', 50]}, {$lt: [''$mothersAge'', 55]}] }, then: ''50-54''},\n {case: {$and: [{$gte: [''$mothersAge'', 55]}, {$lt: [''$mothersAge'', 60]}] }, then: ''55-59''},\n {case: {$and: [{$gte: [''$mothersAge'', 60]}] }, then: ''60+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(677, 1, '\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Order\": 1\n }\n }\n]","collection":"registrations"},"database":3},"id":20,"parameter_mappings":[],"display":"bar","entity_id":"PcnknQN2IYs_mJkwA8yRq","collection_preview":true,"visualization_settings":{"graph.show_values":true,"table.cell_column":"Count","graph.series_order_dimension":null,"graph.x_axis.title_text":"Age","graph.metrics":["Count"],"graph.series_order":null,"table.pivot_column":"Order","series_settings":{"Count":{"color":"#E75454"}},"graph.dimensions":["Order"]},"is_write":false,"parameters":[{"id":"56559614-c685-9d81-d44b-a688fe5b103b","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"0d1e592a-47dc-e5ed-9522-613ab64ea6c2","type":"string/=","target":["dimension",["template-tag","filterDistrict"]],"name":"District","slug":"filterDistrict"}],"dataset":false,"public_uuid":null}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(678, 0, '{"description":null,"archived":false,"collection_position":null,"table_id":null,"database_id":3,"enable_embedding":false,"collection_id":18,"query_type":"native","name":"Registrations by State","creator_id":1,"made_public_by_id":null,"embedding_params":null,"cache_ttl":null,"dataset_query":{"database":3,"native":{"template-tags":{"filterDate":{"id":"f86f592c-2219-063c-8dc4-ca623c06a3ca","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null},"filterGender":{"id":"91f3014a-fb66-6724-708c-8e89f56e2779","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"757a20cf-8f70-6857-0ed5-acb310688b3a","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":["Birth"]},"filterState":{"id":"9384f1c8-b896-7ddb-6f32-204beba13dd3","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"58ab4870-ee4a-8362-2689-440572bb65de","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"stateName\": \"$stateName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"stateName\": \"$_id.stateName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"stateName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''State Name'': \"$allInfo.stateName\"\n , ''Registrations'': \"$allInfo.count\"\n }}\n]","collection":"registrations"},"type":"native"},"id":33,"parameter_mappings":[],"display":"row","entity_id":"g5hTQaT1d2p1OX0tU90WQ","collection_preview":true,"visualization_settings":{"series_settings":{"Registrations":{"color":"#ED8535"}},"graph.dimensions":["State Name"],"graph.show_values":true,"graph.y_axis.title_text":"No. of registrations","table.pivot_column":"State Name","table.cell_column":"Registrations","column_settings":{"[\"name\",\"State Name\"]":{"column_title":"State Name"}},"graph.metrics":["Registrations"]},"is_write":false,"parameters":[{"id":"f86f592c-2219-063c-8dc4-ca623c06a3ca","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"91f3014a-fb66-6724-708c-8e89f56e2779","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"757a20cf-8f70-6857-0ed5-acb310688b3a","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent","default":["Birth"]},{"id":"9384f1c8-b896-7ddb-6f32-204beba13dd3","type":"string/=","target":["dimension",["template-tag"', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(678, 1, ',"filterState"]],"name":"State","slug":"filterState"},{"id":"58ab4870-ee4a-8362-2689-440572bb65de","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}],"dataset":false,"public_uuid":null}', NULL); INSERT INTO "PUBLIC"."REVISION" VALUES (684, 'Dashboard', 2, 1, TIMESTAMP WITH TIME ZONE '2023-05-09 16:47:14.416+06', '{"description":null,"name":"Registrations Dashboard","cache_ttl":null,"cards":[{"size_x":4,"size_y":4,"row":0,"col":14,"id":14,"card_id":1,"series":[]},{"size_x":13,"size_y":5,"row":4,"col":5,"id":15,"card_id":9,"series":[]},{"size_x":5,"size_y":5,"row":4,"col":0,"id":17,"card_id":13,"series":[]},{"size_x":12,"size_y":4,"row":9,"col":0,"id":18,"card_id":14,"series":[]},{"size_x":3,"size_y":4,"row":0,"col":0,"id":20,"card_id":16,"series":[]},{"size_x":5,"size_y":4,"row":0,"col":9,"id":33,"card_id":31,"series":[]},{"size_x":6,"size_y":4,"row":0,"col":3,"id":34,"card_id":30,"series":[]},{"size_x":6,"size_y":4,"row":9,"col":12,"id":36,"card_id":28,"series":[]}]}', FALSE, FALSE, NULL), (685, 'Dashboard', 2, 1, TIMESTAMP WITH TIME ZONE '2023-05-09 16:47:14.45+06', '{"description":null,"name":"Registrations Dashboard","cache_ttl":null,"cards":[{"size_x":4,"size_y":4,"row":0,"col":14,"id":14,"card_id":1,"series":[]},{"size_x":13,"size_y":5,"row":4,"col":5,"id":15,"card_id":9,"series":[]},{"size_x":5,"size_y":5,"row":4,"col":0,"id":17,"card_id":13,"series":[]},{"size_x":12,"size_y":4,"row":9,"col":0,"id":18,"card_id":14,"series":[]},{"size_x":3,"size_y":4,"row":0,"col":0,"id":20,"card_id":16,"series":[]},{"size_x":5,"size_y":4,"row":0,"col":9,"id":33,"card_id":31,"series":[]},{"size_x":6,"size_y":4,"row":0,"col":3,"id":34,"card_id":30,"series":[]},{"size_x":6,"size_y":4,"row":9,"col":12,"id":36,"card_id":28,"series":[]}]}', FALSE, FALSE, NULL), (686, 'Dashboard', 2, 1, TIMESTAMP WITH TIME ZONE '2023-05-09 16:49:13.313+06', '{"description":null,"name":"Registrations Dashboard","cache_ttl":null,"cards":[{"size_x":4,"size_y":4,"row":0,"col":14,"id":14,"card_id":1,"series":[]},{"size_x":13,"size_y":5,"row":4,"col":5,"id":15,"card_id":9,"series":[]},{"size_x":5,"size_y":5,"row":4,"col":0,"id":17,"card_id":13,"series":[]},{"size_x":12,"size_y":4,"row":9,"col":0,"id":18,"card_id":14,"series":[]},{"size_x":3,"size_y":4,"row":0,"col":0,"id":20,"card_id":16,"series":[]},{"size_x":5,"size_y":4,"row":0,"col":9,"id":33,"card_id":31,"series":[]},{"size_x":6,"size_y":4,"row":0,"col":3,"id":34,"card_id":30,"series":[]},{"size_x":6,"size_y":4,"row":9,"col":12,"id":36,"card_id":28,"series":[]}]}', FALSE, FALSE, NULL), (687, 'Dashboard', 2, 1, TIMESTAMP WITH TIME ZONE '2023-05-09 16:49:13.346+06', '{"description":null,"name":"Registrations Dashboard","cache_ttl":null,"cards":[{"size_x":4,"size_y":4,"row":0,"col":14,"id":14,"card_id":1,"series":[]},{"size_x":13,"size_y":5,"row":4,"col":5,"id":15,"card_id":9,"series":[]},{"size_x":5,"size_y":5,"row":4,"col":0,"id":17,"card_id":13,"series":[]},{"size_x":12,"size_y":4,"row":9,"col":0,"id":18,"card_id":14,"series":[]},{"size_x":3,"size_y":4,"row":0,"col":0,"id":20,"card_id":16,"series":[]},{"size_x":5,"size_y":4,"row":0,"col":9,"id":33,"card_id":31,"series":[]},{"size_x":6,"size_y":4,"row":0,"col":3,"id":34,"card_id":30,"series":[]},{"size_x":6,"size_y":4,"row":9,"col":12,"id":36,"card_id":28,"series":[]}]}', FALSE, FALSE, NULL), -(688, 'Card', 20, 1, TIMESTAMP WITH TIME ZONE '2023-05-10 16:22:20.612+06', SYSTEM_COMBINE_CLOB(672), FALSE, FALSE, NULL), -(689, 'Card', 20, 1, TIMESTAMP WITH TIME ZONE '2023-05-10 16:29:52.716+06', SYSTEM_COMBINE_CLOB(673), FALSE, FALSE, NULL), -(690, 'Card', 20, 1, TIMESTAMP WITH TIME ZONE '2023-05-10 16:30:03.225+06', SYSTEM_COMBINE_CLOB(674), FALSE, FALSE, NULL), -(691, 'Card', 20, 1, TIMESTAMP WITH TIME ZONE '2023-05-10 16:30:59.041+06', SYSTEM_COMBINE_CLOB(675), FALSE, FALSE, NULL), -(692, 'Card', 20, 1, TIMESTAMP WITH TIME ZONE '2023-05-10 16:31:24.896+06', SYSTEM_COMBINE_CLOB(676), FALSE, FALSE, NULL), -(693, 'Card', 33, 1, TIMESTAMP WITH TIME ZONE '2023-05-10 16:31:56.545+06', SYSTEM_COMBINE_CLOB(677), FALSE, FALSE, NULL), +(688, 'Card', 20, 1, TIMESTAMP WITH TIME ZONE '2023-05-10 16:22:20.612+06', SYSTEM_COMBINE_CLOB(673), FALSE, FALSE, NULL), +(689, 'Card', 20, 1, TIMESTAMP WITH TIME ZONE '2023-05-10 16:29:52.716+06', SYSTEM_COMBINE_CLOB(674), FALSE, FALSE, NULL), +(690, 'Card', 20, 1, TIMESTAMP WITH TIME ZONE '2023-05-10 16:30:03.225+06', SYSTEM_COMBINE_CLOB(675), FALSE, FALSE, NULL), +(691, 'Card', 20, 1, TIMESTAMP WITH TIME ZONE '2023-05-10 16:30:59.041+06', SYSTEM_COMBINE_CLOB(676), FALSE, FALSE, NULL), +(692, 'Card', 20, 1, TIMESTAMP WITH TIME ZONE '2023-05-10 16:31:24.896+06', SYSTEM_COMBINE_CLOB(677), FALSE, FALSE, NULL), +(693, 'Card', 33, 1, TIMESTAMP WITH TIME ZONE '2023-05-10 16:31:56.545+06', SYSTEM_COMBINE_CLOB(678), FALSE, FALSE, NULL), (694, 'Dashboard', 3, 1, TIMESTAMP WITH TIME ZONE '2023-05-11 12:15:00.602+06', '{"description":null,"name":"Statistics Dashboard","cache_ttl":null,"cards":[{"size_x":9,"size_y":4,"row":0,"col":9,"id":21,"card_id":20,"series":[]},{"size_x":9,"size_y":4,"row":0,"col":0,"id":29,"card_id":27,"series":[]}]}', FALSE, FALSE, NULL); INSERT INTO "PUBLIC"."REVISION" VALUES (695, 'Dashboard', 3, 1, TIMESTAMP WITH TIME ZONE '2023-05-11 12:15:00.658+06', '{"description":null,"name":"Statistics Dashboard","cache_ttl":null,"cards":[{"size_x":9,"size_y":4,"row":0,"col":9,"id":21,"card_id":20,"series":[]},{"size_x":9,"size_y":4,"row":0,"col":0,"id":29,"card_id":27,"series":[]}]}', FALSE, FALSE, NULL), @@ -175721,28 +175731,28 @@ INSERT INTO "PUBLIC"."REPORT_CARD" VALUES INSERT INTO "PUBLIC"."REPORT_CARD" VALUES (13, TIMESTAMP '2022-12-16 10:23:02.863', TIMESTAMP WITH TIME ZONE '2024-02-13 17:55:17.696342+06', 'Completeness Rate', NULL, 'gauge', '{"database":3,"native":{"collection":"registrations","query":"[\n {\n $group: {\n _id: {\n date: { $dateToString: { format: ''%Y-%m-%d'', date: ''$createdAt'' } },\n stateName: ''$stateName''\n },\n total: { $sum: 1 }\n }\n },\n { $addFields: { estimatedNumberOfBirths: 0, stateName: ''$_id.stateName'', date: {$dateFromString: {dateString: ''$_id.date'' } }}},\n { $unionWith: { coll: ''populationEstimatesPerDay'', pipeline: [{$addFields: {stateName: ''$name'', date: ''$date''}}]}},\n{ $group: {\n _id: {\n date: ''$date'',\n stateName: ''$stateName''\n },\n totalRegistrations: { $sum: ''$total'' },\n estimate: { $sum: ''$estimatedNumberOfBirths'' }, \n }},\n {$addFields:{stateName: ''$_id.stateName'', date: ''$_id.date''}},\n {\n $match: {\n $and: [\n { _id: { $ne: null } }\n [[ {{ filterDate }} ]]\n [[ {{ filterState }} ]]\n ]\n }\n }, \n {\n $group: {\n _id: null,\n totalRegistrations: { $sum: ''$totalRegistrations'' },\n estimate: { $sum: ''$estimate'' }\n }\n }, \n {\n $addFields: {\n percentage: {\n $cond: {\n if: { $eq: [''$totalRegistrations'', 0] },\n then: 0,\n else: {\n $cond: {\n if: { $eq: [''$estimate'', 0] },\n then: 0,\n else: { $divide: [''$totalRegistrations'', ''$estimate''] }\n }\n }\n }\n }\n }\n },\n { $project: { _id: false, percentage: ''$percentage'', totalRegistrations: ''$totalRegistrations'', estimate: ''$estimate'' } } \n]","template-tags":{"filterDate":{"id":"56e116a3-0612-74c2-b84a-28f672d719ef","name":"filterDate","display-name":"Filterdate","type":"dimension","dimension":["field",658,null],"widget-type":"date/all-options","default":null},"filterState":{"id":"8735e3f7-fcc5-2a78-8fad-0b88ae7b9a12","name":"filterState","display-name":"Filterstate","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null}}},"type":"native"}', '{"table.pivot_column":"percentage","gauge.segments":[{"min":0,"max":0.25,"color":"#ED6E6E","label":""},{"min":0.25,"max":0.75,"color":"#F9CF48","label":""},{"min":0.75,"max":1,"color":"#84BB4C","label":""}],"column_settings":{"[\"name\",\"percentage\"]":{"scale":100,"suffix":" %"}},"table.cell_column":"totalRegistrations"}', 1, 3, NULL, 'native', FALSE, 7, NULL, NULL, FALSE, NULL, NULL, '[{"display_name":"percentage","field_ref":["field","percentage",{"base-type":"type/Float"}],"name":"percentage","base_type":"type/Float","effective_type":"type/Float","semantic_type":null,"fingerprint":{"global":{"distinct-count":1,"nil%":0.0}}},{"display_name":"totalRegistrations","field_ref":["field","totalRegistrations",{"base-type":"type/Integer"}],"name":"totalRegistrations","base_type":"type/Integer","effective_type":"type/Integer","semantic_type":null,"fingerprint":{"global":{"distinct-count":1,"nil%":0.0}}},{"display_name":"estimate","field_ref":["field","estimate",{"base-type":"type/Float"}],"name":"estimate","base_type":"type/Float","effective_type":"type/Float","semantic_type":null,"fingerprint":{"global":{"distinct-count":1,"nil%":0.0}}}]', NULL, FALSE, 'RUK20xOu8Io0PvT4a332Q', '[{"id":"56e116a3-0612-74c2-b84a-28f672d719ef","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Filterdate","slug":"filterDate"},{"id":"8735e3f7-fcc5-2a78-8fad-0b88ae7b9a12","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"Filterstate","slug":"filterState"}]', '[]', TRUE), (14, TIMESTAMP '2022-12-16 10:43:38.23', TIMESTAMP WITH TIME ZONE '2024-02-13 17:55:17.787139+06', 'Registrations over Time', NULL, 'line', '{"type":"query","query":{"aggregation":[["count"]],"breakout":[["field",677,{"temporal-unit":"month"}]],"filter":["=",["field",666,null],"Birth"],"source-table":70},"database":3}', '{"graph.show_goal":false,"graph.show_trendline":false,"graph.show_values":false,"graph.x_axis.axis_enabled":true,"graph.x_axis.title_text":"Over Time","graph.metrics":["count"],"column_settings":{"[\"ref\",[\"field\",677,null]]":{"date_abbreviate":true}},"graph.x_axis.scale":"timeseries","graph.dimensions":["createdAt"]}', 1, 3, 70, 'query', FALSE, NULL, NULL, NULL, FALSE, NULL, NULL, '[{"description":null,"semantic_type":"type/CreationTimestamp","coercion_strategy":null,"unit":"month","name":"createdAt","settings":null,"field_ref":["field",677,{"temporal-unit":"month"}],"effective_type":"type/Instant","id":677,"visibility_type":"normal","display_name":"CreatedAt","fingerprint":{"global":{"distinct-count":26,"nil%":0.0},"type":{"type/DateTime":{"earliest":"2022-12-08T08:03:53.732Z","latest":"2022-12-21T14:00:11.284Z"}}},"base_type":"type/Instant"},{"display_name":"Count","semantic_type":"type/Quantity","field_ref":["aggregation",0],"name":"count","base_type":"type/BigInteger","effective_type":"type/BigInteger","fingerprint":{"global":{"distinct-count":1,"nil%":0.0},"type":{"type/Number":{"min":3.0,"q1":3.0,"q3":3.0,"max":3.0,"sd":null,"avg":3.0}}}}]', NULL, FALSE, 'qNwCeJEl62KWFEc_8ueNS', '[]', '[]', TRUE); -INSERT INTO SYSTEM_LOB_STREAM VALUES(678, 0, '{"type":"native","native":{"template-tags":{"filterGender":{"id":"e8218caf-e2aa-573e-1776-02cffff42462","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"bf69e085-3c01-7924-5108-7151c85dc371","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null}},"query":"[\n {$facet: {\n fathersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersLiteracy\": \"$fathersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"Father\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n }\n ]\n ,mothersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersLiteracy\": \"$mothersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"Mother\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n }\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersLiteracy\", \"$mothersLiteracy\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Category'': \"$allInfo._id\"\n , ''Literacy'': \"$allInfo.literacy\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Literacy\": 1\n }\n }\n]\n","collection":"registr', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(678, 1, 'ations"},"database":3}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(679, 0, '{"type":"native","native":{"template-tags":{"filterGender":{"id":"e8218caf-e2aa-573e-1776-02cffff42462","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"bf69e085-3c01-7924-5108-7151c85dc371","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null}},"query":"[\n {$facet: {\n fathersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersLiteracy\": \"$fathersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"Father\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n }\n ]\n ,mothersLiteracy: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersLiteracy\": \"$mothersLiteracy\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersLiteracy\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"LITERATE\"] },\n then: \"Literate\"\n },\n {\n case: { $eq: [\"$_id\", \"ILLITERATE\"] },\n then: \"Illiterate\"\n }\n ],\n default: \"\"\n }\n }\n , count: \"$count\"\n }}\n {$addFields: {\n literacy: \"Mother\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n }\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersLiteracy\", \"$mothersLiteracy\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Category'': \"$allInfo._id\"\n , ''Literacy'': \"$allInfo.literacy\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Literacy\": 1\n }\n }\n]\n","collection":"registr', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(679, 1, 'ations"},"database":3}', NULL); INSERT INTO "PUBLIC"."REPORT_CARD" VALUES (16, TIMESTAMP '2022-12-16 13:06:40.361', TIMESTAMP WITH TIME ZONE '2024-02-13 17:55:17.555088+06', 'Total Registrations (without native query)', NULL, 'scalar', '{"type":"query","query":{"aggregation":[["count"]],"filter":["=",["field",666,null],"Birth"],"source-table":70},"database":3}', '{}', 1, 3, 70, 'query', FALSE, NULL, NULL, NULL, FALSE, NULL, NULL, '[{"display_name":"Count","semantic_type":"type/Quantity","field_ref":["aggregation",0],"name":"count","base_type":"type/BigInteger","effective_type":"type/BigInteger","fingerprint":{"global":{"distinct-count":1,"nil%":0.0},"type":{"type/Number":{"min":3.0,"q1":3.0,"q3":3.0,"max":3.0,"sd":null,"avg":3.0}}}}]', NULL, FALSE, 'BOot6oon80vLb791-gzQb', '[]', '[]', TRUE), -(18, TIMESTAMP '2022-12-19 08:37:34.118', TIMESTAMP WITH TIME ZONE '2023-01-26 09:34:47.945+06', 'Live Births by Literacy of Parents', NULL, 'bar', SYSTEM_COMBINE_CLOB(678), '{"graph.show_values":true,"graph.label_value_formatting":"auto","graph.dimensions":["Category","Literacy"],"series_settings":{"Mother":{"color":"#ED8535"},"mothersLiteracy":{"title":"mother","color":"#ED8535"},"fathersLiteracy":{"title":"father","color":"#8A5EB0"},"Father":{"color":"#8A5EB0"}},"graph.x_axis.title_text":"Literacy","graph.metrics":["Count"]}', 1, 3, NULL, 'native', TRUE, 10, NULL, NULL, FALSE, NULL, NULL, '[{"display_name":"Category","field_ref":["field","Category",{"base-type":"type/Text"}],"name":"Category","base_type":"type/Text","effective_type":"type/Text","semantic_type":null,"fingerprint":{"global":{"distinct-count":1,"nil%":0.0}}},{"display_name":"Literacy","field_ref":["field","Literacy",{"base-type":"type/Text"}],"name":"Literacy","base_type":"type/Text","effective_type":"type/Text","semantic_type":null,"fingerprint":{"global":{"distinct-count":1,"nil%":0.0}}},{"display_name":"Count","field_ref":["field","Count",{"base-type":"type/Integer"}],"name":"Count","base_type":"type/Integer","effective_type":"type/Integer","semantic_type":null,"fingerprint":{"global":{"distinct-count":1,"nil%":0.0}}}]', NULL, FALSE, 'eRSJUaHW6haiucK8BtpC_', '[{"id":"e8218caf-e2aa-573e-1776-02cffff42462","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"bf69e085-3c01-7924-5108-7151c85dc371","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}]', '[]', TRUE), +(18, TIMESTAMP '2022-12-19 08:37:34.118', TIMESTAMP WITH TIME ZONE '2023-01-26 09:34:47.945+06', 'Live Births by Literacy of Parents', NULL, 'bar', SYSTEM_COMBINE_CLOB(679), '{"graph.show_values":true,"graph.label_value_formatting":"auto","graph.dimensions":["Category","Literacy"],"series_settings":{"Mother":{"color":"#ED8535"},"mothersLiteracy":{"title":"mother","color":"#ED8535"},"fathersLiteracy":{"title":"father","color":"#8A5EB0"},"Father":{"color":"#8A5EB0"}},"graph.x_axis.title_text":"Literacy","graph.metrics":["Count"]}', 1, 3, NULL, 'native', TRUE, 10, NULL, NULL, FALSE, NULL, NULL, '[{"display_name":"Category","field_ref":["field","Category",{"base-type":"type/Text"}],"name":"Category","base_type":"type/Text","effective_type":"type/Text","semantic_type":null,"fingerprint":{"global":{"distinct-count":1,"nil%":0.0}}},{"display_name":"Literacy","field_ref":["field","Literacy",{"base-type":"type/Text"}],"name":"Literacy","base_type":"type/Text","effective_type":"type/Text","semantic_type":null,"fingerprint":{"global":{"distinct-count":1,"nil%":0.0}}},{"display_name":"Count","field_ref":["field","Count",{"base-type":"type/Integer"}],"name":"Count","base_type":"type/Integer","effective_type":"type/Integer","semantic_type":null,"fingerprint":{"global":{"distinct-count":1,"nil%":0.0}}}]', NULL, FALSE, 'eRSJUaHW6haiucK8BtpC_', '[{"id":"e8218caf-e2aa-573e-1776-02cffff42462","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"bf69e085-3c01-7924-5108-7151c85dc371","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"6a8590c0-c44b-6cb5-1927-bf56805a21a7","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"0debbb0c-3e5f-021c-9188-83371bf19895","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"d17f4f32-f1f3-5666-2cf8-b6735eef97b0","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}]', '[]', TRUE), (19, TIMESTAMP '2022-12-19 08:50:07.838', TIMESTAMP WITH TIME ZONE '2023-05-09 14:14:19.27+06', 'Live Births by Order', NULL, 'bar', '{"type":"native","native":{"template-tags":{"filterGender":{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","name":"filterOffice","display-name":"District","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"996f1d61-a845-0afe-bb4c-f36ac4ab32be","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , birthOrder: ''$birthOrder''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$eq: [''$birthOrder'', 1]}] }, then: ''1''},\n {case: {$and: [{$eq: [''$birthOrder'', 2]}] }, then: ''2''},\n {case: {$and: [{$eq: [''$birthOrder'', 3]}] }, then: ''3''},\n {case: {$and: [{$eq: [''$birthOrder'', 4]}] }, then: ''4''},\n {case: {$and: [{$eq: [''$birthOrder'', 5]}] }, then: ''5''},\n {case: {$and: [{$gte: [''$birthOrder'', 6]}] }, then: ''6+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.category\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Order\": 1\n }\n }\n]","collection":"registrations"},"database":3}', '{"graph.show_values":true,"pie.dimension":"birthOrder","graph.series_order_dimension":null,"graph.x_axis.title_text":"Birth Order","graph.metrics":[null],"graph.series_order":null,"pie.metric":"count","series_settings":{"Count":{"color":"#F7C41F"}},"graph.dimensions":[]}', 1, 3, NULL, 'native', TRUE, 11, NULL, NULL, FALSE, NULL, NULL, '[]', NULL, FALSE, 'L6nXdi04nvxgEh1eJYrwR', '[{"id":"7335b5ec-6aa2-3c6e-fc23-b8d6526592a4","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"95aa438c-e710-4c95-1ce3-1de5858df3b6","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"aa6006c9-d593-07e3-ab90-62f764a51ebe","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"8f65e91d-33a7-6447-1bf2-b2b318fce33d","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"District","slug":"filterOffice"},{"id":"996f1d61-a845-0afe-bb4c-f36ac4ab32be","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}]', '[]', TRUE); -INSERT INTO SYSTEM_LOB_STREAM VALUES(679, 0, '{"type":"native","native":{"template-tags":{"filterGender":{"id":"56559614-c685-9d81-d44b-a688fe5b103b","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterDate":{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null},"filterDistrict":{"id":"0d1e592a-47dc-e5ed-9522-613ab64ea6c2","name":"filterDistrict","display-name":"District","type":"dimension","dimension":["field",723,null],"widget-type":"string/=","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterDistrict }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterDistrict }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , mothersAge: ''$mothersAgeAtBirthOfChildInYears''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$gte: [''$mothersAge'', 9]}, {$lt: [''$mothersAge'', 15]}] }, then: ''09-14''},\n {case: {$and: [{$gte: [''$mothersAge'', 15]}, {$lt: [''$mothersAge'', 20]}] }, then: ''15-19''},\n {case: {$and: [{$gte: [''$mothersAge'', 20]}, {$lt: [''$mothersAge'', 25]}] }, then: ''20-24''},\n {case: {$and: [{$gte: [''$mothersAge'', 25]}, {$lt: [''$mothersAge'', 30]}] }, then: ''25-29''},\n {case: {$and: [{$gte: [''$mothersAge'', 30]}, {$lt: [''$mothersAge'', 35]}] }, then: ''30-34''},\n {case: {$and: [{$gte: [''$mothersAge'', 35]}, {$lt: [''$mothersAge'', 40]}] }, then: ''35-39''},\n {case: {$and: [{$gte: [''$mothersAge'', 40]}, {$lt: [''$mothersAge'', 45]}] }, then: ''40-44''},\n {case: {$and: [{$gte: [''$mothersAge'', 45]}, {$lt: [''$mothersAge'', 50]}] }, then: ''45-49''},\n {case: {$and: [{$gte: [''$mothersAge'', 50]}, {$lt: [''$mothersAge'', 55]}] }, then: ''50-54''},\n {case: {$and: [{$gte: [''$mothersAge'', 55]}, {$lt: [''$mothersAge'', 60]}] }, then: ''55-59''},\n {case: {$and: [{$gte: [''$mothersAge'', 60]}] }, then: ''60+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.cate', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(679, 1, 'gory\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Order\": 1\n }\n }\n]","collection":"registrations"},"database":3}', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(680, 0, '{"type":"native","native":{"template-tags":{"filterGender":{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null}},"query":"[\n {$facet: {\n fathersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersAttainment\": \"$fathersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"KORANIC\"] },\n then: \"Koranic\"\n },\n {\n case: { $eq: [\"$_id\", \"MODERN\"] },\n then: \"Modern\"\n },\n {\n case: { $eq: [\"$_id\", \"HIGHER_SCHOOL\"] },\n then: \"Higher School\"\n },\n {\n case: { $eq: [\"$_id\", \"PRIMARY\"] },\n then: \"Primary\"\n },\n {\n case: { $eq: [\"$_id\", \"UNIVERSITY\"] },\n then: \"University\"\n },\n {\n case: { $eq: [\"$_id\", \"POLYTECNIC_NCE\"] },\n then: \"Polytecnic NCE\"\n },\n {\n case: { $eq: [\"$_id\", \"SECONDARY\"] },\n then: \"Secondary\"\n }\n ],\n default: \"Others\"\n }\n }\n , count: \"$count\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {$addFields: {\n attainment: \"Father\"\n }}\n ]\n , mothersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersAttainment\": \"$mothersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"KORANIC\"] },\n then: \"Koranic\"\n },\n {\n case: { $eq: [\"$_id\", \"MODERN\"] },\n then: \"Modern\"\n ', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(680, 1, ' },\n {\n case: { $eq: [\"$_id\", \"HIGHER_SCHOOL\"] },\n then: \"Higher School\"\n },\n {\n case: { $eq: [\"$_id\", \"PRIMARY\"] },\n then: \"Primary\"\n },\n {\n case: { $eq: [\"$_id\", \"UNIVERSITY\"] },\n then: \"University\"\n },\n {\n case: { $eq: [\"$_id\", \"POLYTECNIC_NCE\"] },\n then: \"Polytecnic NCE\"\n },\n {\n case: { $eq: [\"$_id\", \"SECONDARY\"] },\n then: \"Secondary\"\n }\n ],\n default: \"Others\"\n }\n }\n , count: \"$count\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {$addFields: {\n attainment: \"Mother\"\n }}\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersAttainment\", \"$mothersAttainment\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Educational Attainment'': \"$allInfo._id\"\n , ''Relationship'': \"$allInfo.attainment\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Relationship\": 1\n }\n }\n]\n","collection":"registrations"},"database":3}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(680, 0, '{"type":"native","native":{"template-tags":{"filterGender":{"id":"56559614-c685-9d81-d44b-a688fe5b103b","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterDate":{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/month-year","default":null},"filterDistrict":{"id":"0d1e592a-47dc-e5ed-9522-613ab64ea6c2","name":"filterDistrict","display-name":"District","type":"dimension","dimension":["field",723,null],"widget-type":"string/=","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterDistrict }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": false,\n \"totalCount\": \"$qty\"\n }}\n \n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterDistrict }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {$project: {\n _id: NumberInt(0)\n , mothersAge: ''$mothersAgeAtBirthOfChildInYears''\n \n }}\n , {$addFields: {\n orders: {$switch:\n {\n branches: [\n {case: {$and: [{$gte: [''$mothersAge'', 9]}, {$lt: [''$mothersAge'', 15]}] }, then: ''09-14''},\n {case: {$and: [{$gte: [''$mothersAge'', 15]}, {$lt: [''$mothersAge'', 20]}] }, then: ''15-19''},\n {case: {$and: [{$gte: [''$mothersAge'', 20]}, {$lt: [''$mothersAge'', 25]}] }, then: ''20-24''},\n {case: {$and: [{$gte: [''$mothersAge'', 25]}, {$lt: [''$mothersAge'', 30]}] }, then: ''25-29''},\n {case: {$and: [{$gte: [''$mothersAge'', 30]}, {$lt: [''$mothersAge'', 35]}] }, then: ''30-34''},\n {case: {$and: [{$gte: [''$mothersAge'', 35]}, {$lt: [''$mothersAge'', 40]}] }, then: ''35-39''},\n {case: {$and: [{$gte: [''$mothersAge'', 40]}, {$lt: [''$mothersAge'', 45]}] }, then: ''40-44''},\n {case: {$and: [{$gte: [''$mothersAge'', 45]}, {$lt: [''$mothersAge'', 50]}] }, then: ''45-49''},\n {case: {$and: [{$gte: [''$mothersAge'', 50]}, {$lt: [''$mothersAge'', 55]}] }, then: ''50-54''},\n {case: {$and: [{$gte: [''$mothersAge'', 55]}, {$lt: [''$mothersAge'', 60]}] }, then: ''55-59''},\n {case: {$and: [{$gte: [''$mothersAge'', 60]}] }, then: ''60+''}\n ], \n default: ''''\n }}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n }}\n , {$match: {\n orders: {$ne: ''''}\n }}\n , {$project: {\n _id: NumberInt(0)\n , orders: ''$orders''\n , totalCount: \"$totalCount\"\n }}\n \n , {$group: { \n _id: { orders: ''$orders''}\n , totalCount: {$sum: NumberInt(1)}\n }} , {$project: {\n _id: NumberInt(0)\n , ''category'': ''$_id.orders''\n , ''count'': ''$totalCount''\n }}\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''Order'': \"$allInfo.cate', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(680, 1, 'gory\"\n , ''Count'': \"$allInfo.count\"\n , ''Percentage'': {$divide: [{$multiply: [''$allInfo.count'', 100]}, ''$totalCount'']}\n \n }},\n {\n \"$sort\": {\n \"Order\": 1\n }\n }\n]","collection":"registrations"},"database":3}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(681, 0, '{"type":"native","native":{"template-tags":{"filterGender":{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":null},"filterState":{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","name":"filterOffice","display-name":"LGA","type":"dimension","dimension":["field",670,null],"widget-type":"string/=","default":null},"filterDate":{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null}},"query":"[\n {$facet: {\n fathersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"fathersAttainment\": \"$fathersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.fathersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"KORANIC\"] },\n then: \"Koranic\"\n },\n {\n case: { $eq: [\"$_id\", \"MODERN\"] },\n then: \"Modern\"\n },\n {\n case: { $eq: [\"$_id\", \"HIGHER_SCHOOL\"] },\n then: \"Higher School\"\n },\n {\n case: { $eq: [\"$_id\", \"PRIMARY\"] },\n then: \"Primary\"\n },\n {\n case: { $eq: [\"$_id\", \"UNIVERSITY\"] },\n then: \"University\"\n },\n {\n case: { $eq: [\"$_id\", \"POLYTECNIC_NCE\"] },\n then: \"Polytecnic NCE\"\n },\n {\n case: { $eq: [\"$_id\", \"SECONDARY\"] },\n then: \"Secondary\"\n }\n ],\n default: \"Others\"\n }\n }\n , count: \"$count\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {$addFields: {\n attainment: \"Father\"\n }}\n ]\n , mothersAttainment: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n [[ {{ filterDate }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": { \"mothersAttainment\": \"$mothersEducationalAttainment\" } \n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id.mothersAttainment\"\n , \"count\": \"$qty\"\n }},\n {$match: {\n \"_id\": {$ne: null}\n }}\n , {$project: {\n _id: NumberInt(0)\n , \"_id\": {\n $switch: {\n branches: [\n {\n case: { $eq: [\"$_id\", \"KORANIC\"] },\n then: \"Koranic\"\n },\n {\n case: { $eq: [\"$_id\", \"MODERN\"] },\n then: \"Modern\"\n ', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(681, 1, ' },\n {\n case: { $eq: [\"$_id\", \"HIGHER_SCHOOL\"] },\n then: \"Higher School\"\n },\n {\n case: { $eq: [\"$_id\", \"PRIMARY\"] },\n then: \"Primary\"\n },\n {\n case: { $eq: [\"$_id\", \"UNIVERSITY\"] },\n then: \"University\"\n },\n {\n case: { $eq: [\"$_id\", \"POLYTECNIC_NCE\"] },\n then: \"Polytecnic NCE\"\n },\n {\n case: { $eq: [\"$_id\", \"SECONDARY\"] },\n then: \"Secondary\"\n }\n ],\n default: \"Others\"\n }\n }\n , count: \"$count\"\n }},\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {$addFields: {\n attainment: \"Mother\"\n }}\n ]\n }},\n {\n $project: {\n allInfo: {\n $concatArrays: [ \"$fathersAttainment\", \"$mothersAttainment\" ]\n }\n }\n }, {\n $unwind: \"$allInfo\"\n },\n {$project: {\n _id: NumberInt(0)\n , ''Educational Attainment'': \"$allInfo._id\"\n , ''Relationship'': \"$allInfo.attainment\"\n , ''Count'': \"$allInfo.count\"\n }},\n {\n \"$sort\": {\n \"Relationship\": 1\n }\n }\n]\n","collection":"registrations"},"database":3}', NULL); INSERT INTO "PUBLIC"."REPORT_CARD" VALUES -(20, TIMESTAMP '2022-12-19 09:56:45.336', TIMESTAMP WITH TIME ZONE '2024-02-13 18:52:50.823378+06', 'Live Births by Age of Mother', NULL, 'bar', SYSTEM_COMBINE_CLOB(679), '{"graph.show_values":true,"table.cell_column":"Count","graph.series_order_dimension":null,"graph.x_axis.title_text":"Age","graph.metrics":["Count"],"graph.series_order":null,"table.pivot_column":"Order","series_settings":{"Count":{"color":"#E75454"}},"graph.dimensions":["Order"]}', 1, 3, NULL, 'native', FALSE, 12, NULL, NULL, FALSE, NULL, NULL, '[{"display_name":"Order","field_ref":["field","Order",{"base-type":"type/Text"}],"name":"Order","base_type":"type/Text","effective_type":"type/Text","semantic_type":null,"fingerprint":{"global":{"distinct-count":1,"nil%":0.0}}},{"display_name":"Count","field_ref":["field","Count",{"base-type":"type/Integer"}],"name":"Count","base_type":"type/Integer","effective_type":"type/Integer","semantic_type":null,"fingerprint":{"global":{"distinct-count":1,"nil%":0.0}}},{"display_name":"Percentage","field_ref":["field","Percentage",{"base-type":"type/Float"}],"name":"Percentage","base_type":"type/Float","effective_type":"type/Float","semantic_type":null,"fingerprint":{"global":{"distinct-count":1,"nil%":0.0}}}]', NULL, FALSE, 'PcnknQN2IYs_mJkwA8yRq', '[{"id":"56559614-c685-9d81-d44b-a688fe5b103b","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"0d1e592a-47dc-e5ed-9522-613ab64ea6c2","type":"string/=","target":["dimension",["template-tag","filterDistrict"]],"name":"District","slug":"filterDistrict"}]', '[]', TRUE), -(21, TIMESTAMP '2022-12-19 10:32:35.258', TIMESTAMP WITH TIME ZONE '2023-01-26 09:36:24.473+06', 'Live Births by Level of Education of Parent', NULL, 'bar', SYSTEM_COMBINE_CLOB(680), '{"graph.show_values":true,"pie.dimension":"Educational Attainment","graph.x_axis.axis_enabled":true,"graph.y_axis.auto_split":true,"graph.metrics":["Count"],"pie.metric":"Count","series_settings":{"Mother":{"color":"#E75454"},"fathersAttainment":{"title":"father","color":"#69C8C8"},"mothersAttainment":{"title":"mother","color":"#E75454"},"Father":{"color":"#69C8C8"}},"graph.y_axis.auto_range":true,"graph.dimensions":["Educational Attainment","Relationship"]}', 1, 3, NULL, 'native', TRUE, 14, NULL, NULL, FALSE, NULL, NULL, '[{"display_name":"Educational Attainment","field_ref":["field","Educational Attainment",{"base-type":"type/Text"}],"name":"Educational Attainment","base_type":"type/Text","effective_type":"type/Text","semantic_type":null,"fingerprint":{"global":{"distinct-count":1,"nil%":0.0}}},{"display_name":"Relationship","field_ref":["field","Relationship",{"base-type":"type/Text"}],"name":"Relationship","base_type":"type/Text","effective_type":"type/Text","semantic_type":null,"fingerprint":{"global":{"distinct-count":1,"nil%":0.0}}},{"display_name":"Count","field_ref":["field","Count",{"base-type":"type/Integer"}],"name":"Count","base_type":"type/Integer","effective_type":"type/Integer","semantic_type":null,"fingerprint":{"global":{"distinct-count":1,"nil%":0.0}}}]', NULL, FALSE, 'W6bdia0Vw-6PC1efnHIR4', '[{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}]', '[]', TRUE); +(20, TIMESTAMP '2022-12-19 09:56:45.336', TIMESTAMP WITH TIME ZONE '2024-10-21 18:05:58.370517+06', 'Live Births by Age of Mother', NULL, 'bar', SYSTEM_COMBINE_CLOB(680), '{"graph.show_values":true,"table.cell_column":"Count","graph.series_order_dimension":null,"graph.x_axis.title_text":"Age","graph.metrics":["Count"],"graph.series_order":null,"table.pivot_column":"Order","series_settings":{"Count":{"color":"#E75454"}},"graph.dimensions":["Order"]}', 1, 3, NULL, 'native', FALSE, 12, NULL, NULL, FALSE, NULL, NULL, '[{"display_name":"Order","field_ref":["field","Order",{"base-type":"type/Text"}],"name":"Order","base_type":"type/Text","effective_type":"type/Text","semantic_type":null,"fingerprint":{"global":{"distinct-count":10,"nil%":0.0}}},{"display_name":"Count","field_ref":["field","Count",{"base-type":"type/Integer"}],"name":"Count","base_type":"type/Integer","effective_type":"type/Integer","semantic_type":null,"fingerprint":{"global":{"distinct-count":7,"nil%":0.0}}},{"display_name":"Percentage","field_ref":["field","Percentage",{"base-type":"type/Float"}],"name":"Percentage","base_type":"type/Float","effective_type":"type/Float","semantic_type":null,"fingerprint":{"global":{"distinct-count":7,"nil%":0.0}}}]', NULL, FALSE, 'PcnknQN2IYs_mJkwA8yRq', '[{"id":"56559614-c685-9d81-d44b-a688fe5b103b","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"cd1a4146-89c8-79a8-3ea0-145647317de1","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"f105fc3f-8509-e01b-cd4e-bf3ea930da11","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"557cb4d2-a41c-3867-3703-360b7e03aeb7","type":"date/month-year","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"0d1e592a-47dc-e5ed-9522-613ab64ea6c2","type":"string/=","target":["dimension",["template-tag","filterDistrict"]],"name":"District","slug":"filterDistrict"}]', '[]', TRUE), +(21, TIMESTAMP '2022-12-19 10:32:35.258', TIMESTAMP WITH TIME ZONE '2023-01-26 09:36:24.473+06', 'Live Births by Level of Education of Parent', NULL, 'bar', SYSTEM_COMBINE_CLOB(681), '{"graph.show_values":true,"pie.dimension":"Educational Attainment","graph.x_axis.axis_enabled":true,"graph.y_axis.auto_split":true,"graph.metrics":["Count"],"pie.metric":"Count","series_settings":{"Mother":{"color":"#E75454"},"fathersAttainment":{"title":"father","color":"#69C8C8"},"mothersAttainment":{"title":"mother","color":"#E75454"},"Father":{"color":"#69C8C8"}},"graph.y_axis.auto_range":true,"graph.dimensions":["Educational Attainment","Relationship"]}', 1, 3, NULL, 'native', TRUE, 14, NULL, NULL, FALSE, NULL, NULL, '[{"display_name":"Educational Attainment","field_ref":["field","Educational Attainment",{"base-type":"type/Text"}],"name":"Educational Attainment","base_type":"type/Text","effective_type":"type/Text","semantic_type":null,"fingerprint":{"global":{"distinct-count":1,"nil%":0.0}}},{"display_name":"Relationship","field_ref":["field","Relationship",{"base-type":"type/Text"}],"name":"Relationship","base_type":"type/Text","effective_type":"type/Text","semantic_type":null,"fingerprint":{"global":{"distinct-count":1,"nil%":0.0}}},{"display_name":"Count","field_ref":["field","Count",{"base-type":"type/Integer"}],"name":"Count","base_type":"type/Integer","effective_type":"type/Integer","semantic_type":null,"fingerprint":{"global":{"distinct-count":1,"nil%":0.0}}}]', NULL, FALSE, 'W6bdia0Vw-6PC1efnHIR4', '[{"id":"a94c0fd1-e550-61f5-bf93-6745782a3236","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"8e0c3f0a-82b1-067f-aeaf-69750553ec6e","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"bdbcbf25-7d5e-f7a9-27f7-1bce6a670ec1","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"e7f94a82-3d11-349f-1011-235d052a57cb","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"LGA","slug":"filterOffice"},{"id":"b6d5ee98-e1eb-8e7d-6c1c-77350781da39","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"}]', '[]', TRUE); INSERT INTO "PUBLIC"."REPORT_CARD" VALUES (27, TIMESTAMP '2022-12-20 09:21:07.317', TIMESTAMP WITH TIME ZONE '2024-02-13 18:52:50.823378+06', 'Live Births by Place of Birth', NULL, 'pie', '{"database":3,"query":{"aggregation":[["count"]],"breakout":[["expression","PlaceOfBirth"]],"expressions":{"PlaceOfBirth":["case",[[["=",["field",668,null],"HEALTH_FACILITY"],"Health Facility"],[["=",["field",668,null],"ADMIN_STRUCTURE"],"Admin Structure"],[["=",["field",668,null],"CRVS_OFFICE"],"CRVS Office"],[["=",["field",668,null],"PRIVATE_HOME"],"Private Home"],[["=",["field",668,null],"OTHER"],"Other"]]]},"filter":["=",["field",666,null],"Birth"],"source-table":70},"type":"query"}', '{"pie.colors":{"Health Facility":"#689636","Taxi":"#69C8C8"}}', 1, 3, 70, 'query', FALSE, 9, NULL, NULL, FALSE, NULL, NULL, '[{"display_name":"PlaceOfBirth","field_ref":["expression","PlaceOfBirth"],"name":"PlaceOfBirth","base_type":"type/Text","effective_type":"type/Text","semantic_type":null,"fingerprint":{"global":{"distinct-count":1,"nil%":0.0},"type":{"type/Text":{"percent-json":0.0,"percent-url":0.0,"percent-email":0.0,"percent-state":0.0,"average-length":15.0}}}},{"display_name":"Count","semantic_type":"type/Quantity","field_ref":["aggregation",0],"name":"count","base_type":"type/BigInteger","effective_type":"type/BigInteger","fingerprint":{"global":{"distinct-count":1,"nil%":0.0},"type":{"type/Number":{"min":3.0,"q1":3.0,"q3":3.0,"max":3.0,"sd":null,"avg":3.0}}}}]', NULL, FALSE, 'AfR2OybIvG3i-a1qt-k0u', '[]', '[]', TRUE), (28, TIMESTAMP '2022-12-20 09:26:38.493', TIMESTAMP WITH TIME ZONE '2024-02-13 17:55:17.815316+06', 'Record Corrections by Type', NULL, 'pie', '{"database":3,"query":{"aggregation":[["count"]],"breakout":[["expression","Reason"]],"expressions":{"Reason":["case",[[["=",["field",688,null],"CLERICAL_ERROR"],"Clerical Error"],[["=",["field",688,null],"JUDICIAL_ORDER"],"Judicial Order"],[["=",["field",688,null],"MATERIAL_ERROR"],"Material Error"],[["=",["field",688,null],"MATERIAL_OMISSION"],"Material Omission"],[["=",["field",688,null],"OTHER"],"Other"]]]},"filter":["=",["field",693,null],"Birth"],"source-table":71},"type":"query"}', '{"pie.colors":{"Clerical Error":"#8A5EB0"}}', 1, 3, 71, 'query', FALSE, 17, NULL, NULL, FALSE, NULL, NULL, '[{"display_name":"Reason","field_ref":["expression","Reason"],"name":"Reason","base_type":"type/Text","effective_type":"type/Text","semantic_type":null,"fingerprint":{"global":{"distinct-count":0,"nil%":null},"type":{"type/Text":{"percent-json":null,"percent-url":null,"percent-email":null,"percent-state":null,"average-length":null}}}},{"display_name":"Count","semantic_type":"type/Quantity","field_ref":["aggregation",0],"name":"count","base_type":"type/BigInteger","effective_type":"type/BigInteger","fingerprint":{"global":{"distinct-count":0,"nil%":null},"type":{"type/Number":{"min":null,"q1":null,"q3":null,"max":null,"sd":null,"avg":null}}}}]', NULL, FALSE, '__hZ2xD-7VCBJ7mLFxB9Y', '[]', '[]', TRUE), (29, TIMESTAMP '2022-12-20 09:32:37.984', TIMESTAMP WITH TIME ZONE '2023-05-09 14:14:27.238+06', 'Live Births by Type of Birth', NULL, 'pie', '{"type":"query","query":{"aggregation":[["count"]],"breakout":[["expression","TypeOfBirth"]],"expressions":{"TypeOfBirth":["case",[[["=",["field",674,null],"SINGLE"],"Single"],[["=",["field",674,null],"TWIN"],"Twin"],[["=",["field",674,null],"TRIPLET"],"Triplet"],[["=",["field",674,null],"QUADRUPLET"],"Quadruplet"]]]},"filter":["=",["field",666,null],"Birth"],"order-by":[["desc",["aggregation",0,null]]],"source-table":70},"database":3}', '{"pie.colors":{"Quadruplet":"#8A5EB0","Single":"#F7C41F"}}', 1, 3, 70, 'query', TRUE, 15, NULL, NULL, FALSE, NULL, NULL, '[{"base_type":"type/Text","name":"TypeOfBirth","display_name":"TypeOfBirth","expression_name":"TypeOfBirth","field_ref":["expression","TypeOfBirth"],"source":"breakout"},{"base_type":"type/BigInteger","semantic_type":"type/Quantity","name":"count","display_name":"Count","source":"aggregation","field_ref":["aggregation",0]}]', NULL, FALSE, 'GOqql9fnmIgyeOChWso6x', '[]', '[]', TRUE), (30, TIMESTAMP '2022-12-20 10:12:01.203', TIMESTAMP WITH TIME ZONE '2024-02-13 17:55:17.611559+06', '% of Total Registrations Certified', NULL, 'pie', '{"database":3,"query":{"aggregation":[["count"]],"breakout":[["expression","Status"]],"expressions":{"Status":["case",[[["=",["field",682,null],"REGISTERED"],"Not Certified"],[["=",["field",682,null],"CERTIFIED"],"Certified"],[["=",["field",682,null],"ISSUED"],"Issued"]]]},"filter":["=",["field",666,null],"Birth"],"source-table":70},"type":"query"}', '{"pie.colors":{"Certified":"#E75454","Not Certified":"#F7C4C4"}}', 1, 3, 70, 'query', FALSE, 8, NULL, NULL, FALSE, NULL, NULL, '[{"display_name":"Status","field_ref":["expression","Status"],"name":"Status","base_type":"type/Text","effective_type":"type/Text","semantic_type":"type/Category","fingerprint":{"global":{"distinct-count":2,"nil%":0.0},"type":{"type/Text":{"percent-json":0.0,"percent-url":0.0,"percent-email":0.0,"percent-state":0.0,"average-length":7.5}}}},{"display_name":"Count","semantic_type":"type/Quantity","field_ref":["aggregation",0],"name":"count","base_type":"type/BigInteger","effective_type":"type/BigInteger","fingerprint":{"global":{"distinct-count":2,"nil%":0.0},"type":{"type/Number":{"min":1.0,"q1":1.0,"q3":2.0,"max":2.0,"sd":0.7071067811865476,"avg":1.5}}}}]', NULL, FALSE, 'i9_4VwkR62cl03HLkb9e7', '[]', '[]', TRUE); -INSERT INTO SYSTEM_LOB_STREAM VALUES(681, 0, '{"database":3,"native":{"collection":"registrations","query":"[\n {\n $match: {\n $and: [{ _id: { $ne: null } }\n [[{{ filterDate }} ]]\n [[{{ filterGender }} ]]\n [[{{ filterEvent }}]]\n [[{{ filterState }}]]\n [[{{ filterOffice }}]]\n ]\n }\n },\n {\n $facet: {\n totals: [{ $count: ''Total'' }, { $addFields: { Category: ''Total'' } }],\n ageGroups: [\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 365] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''< 1''\n }\n ],\n default: ''''\n }\n }\n }\n },\n {$match: {\n par: {$ne: ''''}\n }}\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n Category: ''$_id.par'',\n Total: ''$totalCustomer''\n }\n }\n ],\n ageGroups2: [\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 1825] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''< 5''\n }\n ],\n default: ''5+''\n }\n }\n }\n },\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n Category: ''$_id.par'',\n Total: ''$totalCustomer''\n }\n }\n ],\n }\n },\n {\n $project: {\n mergedArray: { $concatArrays: [''$totals'', ''$ageGroups'', ''$ageGroups2''] }\n }\n },\n { $unwind: ''$mergedArray'' },\n { $replaceRoot: { newRoot: ''$mergedArray'' } },\n {\n $addFields: {\n order: {\n $cond: {\n if: { $eq: [''$Category'', ''Total''] },\n then: 1,\n else: {\n $cond: {\n if: { $eq: [''$Category'', ''< 1''] },\n then: 2,\n else: {\n $cond: {\n if: { $eq: [''$Category'', ''< 5''] },\n then: 3,\n else: 4\n }\n }\n }\n }\n }\n }\n }\n },\n {\n $sort: {\n order: 1\n }\n },\n { $project: { Total: 1, Category: 1 } },\n {\n $sort: {\n Category: -1\n }\n },\n]","template-tags":{"filterDate":{"id":"84b2ec9e-eea8-e9ee-160f-57a211462c2a","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null},"filterGender":{"id":"7d3014f2-7de5-b2b0-fb10-0796ecc6fe38","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"086c0846-69f4-a2b9-16b8-86af040bf2c8","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","de', NULL); -INSERT INTO SYSTEM_LOB_STREAM VALUES(681, 1, 'fault":null},"filterState":{"id":"537bc06b-acf9-9d28-3c92-346d83ce5156","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"5626fb9c-14cd-0fe8-2254-687e292aeb7b","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}}},"type":"native"}', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(682, 0, '{"database":3,"native":{"collection":"registrations","query":"[\n {\n $match: {\n $and: [{ _id: { $ne: null } }\n [[{{ filterDate }} ]]\n [[{{ filterGender }} ]]\n [[{{ filterEvent }}]]\n [[{{ filterState }}]]\n [[{{ filterOffice }}]]\n ]\n }\n },\n {\n $facet: {\n totals: [{ $count: ''Total'' }, { $addFields: { Category: ''Total'' } }],\n ageGroups: [\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 365] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''< 1''\n }\n ],\n default: ''''\n }\n }\n }\n },\n {$match: {\n par: {$ne: ''''}\n }}\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n Category: ''$_id.par'',\n Total: ''$totalCustomer''\n }\n }\n ],\n ageGroups2: [\n {\n $project: {\n _id: 0,\n childsAge: ''$childsAgeInDaysAtDeclaration''\n }\n },\n {\n $addFields: {\n par: {\n $switch: {\n branches: [\n {\n case: {\n $and: [\n { $lt: [''$childsAge'', 1825] },\n { $gte: [''$childsAge'', 0] }\n ]\n },\n then: ''< 5''\n }\n ],\n default: ''5+''\n }\n }\n }\n },\n {\n $project: {\n _id: 0,\n par: ''$par''\n }\n },\n {\n $group: {\n _id: { par: ''$par'' },\n totalCustomer: { $sum: 1 }\n }\n },\n {\n $project: {\n _id: 0,\n Category: ''$_id.par'',\n Total: ''$totalCustomer''\n }\n }\n ],\n }\n },\n {\n $project: {\n mergedArray: { $concatArrays: [''$totals'', ''$ageGroups'', ''$ageGroups2''] }\n }\n },\n { $unwind: ''$mergedArray'' },\n { $replaceRoot: { newRoot: ''$mergedArray'' } },\n {\n $addFields: {\n order: {\n $cond: {\n if: { $eq: [''$Category'', ''Total''] },\n then: 1,\n else: {\n $cond: {\n if: { $eq: [''$Category'', ''< 1''] },\n then: 2,\n else: {\n $cond: {\n if: { $eq: [''$Category'', ''< 5''] },\n then: 3,\n else: 4\n }\n }\n }\n }\n }\n }\n }\n },\n {\n $sort: {\n order: 1\n }\n },\n { $project: { Total: 1, Category: 1 } },\n {\n $sort: {\n Category: -1\n }\n },\n]","template-tags":{"filterDate":{"id":"84b2ec9e-eea8-e9ee-160f-57a211462c2a","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null},"filterGender":{"id":"7d3014f2-7de5-b2b0-fb10-0796ecc6fe38","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"086c0846-69f4-a2b9-16b8-86af040bf2c8","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","de', NULL); +INSERT INTO SYSTEM_LOB_STREAM VALUES(682, 1, 'fault":null},"filterState":{"id":"537bc06b-acf9-9d28-3c92-346d83ce5156","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"5626fb9c-14cd-0fe8-2254-687e292aeb7b","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}}},"type":"native"}', NULL); INSERT INTO "PUBLIC"."REPORT_CARD" VALUES -(31, TIMESTAMP '2022-12-21 07:21:47.991', TIMESTAMP WITH TIME ZONE '2024-02-13 17:55:17.570837+06', 'Registrations by Age', NULL, 'bar', SYSTEM_COMBINE_CLOB(681), '{"graph.y_axis.title_text":"Total","graph.show_values":true,"graph.x_axis.labels_enabled":false,"graph.series_order_dimension":null,"stackable.stack_display":"bar","graph.x_axis.title_text":"Category","graph.label_value_frequency":"fit","graph.metrics":["Total"],"graph.label_value_formatting":"auto","graph.series_order":null,"series_settings":{"4":{"title":"Under age 5","color":"#509EE3"},"7":{"title":"Over age 5","color":"#509EE3"},"12":{"title":"Under age 1","color":"#509EE3"},"23":{"color":"#F9D45C","title":"Total"},"total":{"color":"#8A5EB0"},"20,085":{"axis":null},"Total":{"color":"#8A5EB0"}},"graph.dimensions":["Category"],"stackable.stack_type":"stacked"}', 1, 3, NULL, 'native', FALSE, 4, NULL, NULL, FALSE, NULL, NULL, '[{"display_name":"Total","field_ref":["field","Total",{"base-type":"type/Integer"}],"name":"Total","base_type":"type/Integer","effective_type":"type/Integer","semantic_type":null,"fingerprint":{"global":{"distinct-count":1,"nil%":0.0}}},{"display_name":"Category","field_ref":["field","Category",{"base-type":"type/Text"}],"name":"Category","base_type":"type/Text","effective_type":"type/Text","semantic_type":null,"fingerprint":{"global":{"distinct-count":3,"nil%":0.0}}}]', NULL, FALSE, 'hTP9EUEq13VA1N_H-258l', '[{"id":"84b2ec9e-eea8-e9ee-160f-57a211462c2a","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"7d3014f2-7de5-b2b0-fb10-0796ecc6fe38","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"086c0846-69f4-a2b9-16b8-86af040bf2c8","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"537bc06b-acf9-9d28-3c92-346d83ce5156","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"5626fb9c-14cd-0fe8-2254-687e292aeb7b","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}]', '[]', TRUE), +(31, TIMESTAMP '2022-12-21 07:21:47.991', TIMESTAMP WITH TIME ZONE '2024-02-13 17:55:17.570837+06', 'Registrations by Age', NULL, 'bar', SYSTEM_COMBINE_CLOB(682), '{"graph.y_axis.title_text":"Total","graph.show_values":true,"graph.x_axis.labels_enabled":false,"graph.series_order_dimension":null,"stackable.stack_display":"bar","graph.x_axis.title_text":"Category","graph.label_value_frequency":"fit","graph.metrics":["Total"],"graph.label_value_formatting":"auto","graph.series_order":null,"series_settings":{"4":{"title":"Under age 5","color":"#509EE3"},"7":{"title":"Over age 5","color":"#509EE3"},"12":{"title":"Under age 1","color":"#509EE3"},"23":{"color":"#F9D45C","title":"Total"},"total":{"color":"#8A5EB0"},"20,085":{"axis":null},"Total":{"color":"#8A5EB0"}},"graph.dimensions":["Category"],"stackable.stack_type":"stacked"}', 1, 3, NULL, 'native', FALSE, 4, NULL, NULL, FALSE, NULL, NULL, '[{"display_name":"Total","field_ref":["field","Total",{"base-type":"type/Integer"}],"name":"Total","base_type":"type/Integer","effective_type":"type/Integer","semantic_type":null,"fingerprint":{"global":{"distinct-count":1,"nil%":0.0}}},{"display_name":"Category","field_ref":["field","Category",{"base-type":"type/Text"}],"name":"Category","base_type":"type/Text","effective_type":"type/Text","semantic_type":null,"fingerprint":{"global":{"distinct-count":3,"nil%":0.0}}}]', NULL, FALSE, 'hTP9EUEq13VA1N_H-258l', '[{"id":"84b2ec9e-eea8-e9ee-160f-57a211462c2a","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"7d3014f2-7de5-b2b0-fb10-0796ecc6fe38","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"086c0846-69f4-a2b9-16b8-86af040bf2c8","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent"},{"id":"537bc06b-acf9-9d28-3c92-346d83ce5156","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"5626fb9c-14cd-0fe8-2254-687e292aeb7b","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}]', '[]', TRUE), (32, TIMESTAMP '2023-01-24 10:30:25.392', TIMESTAMP WITH TIME ZONE '2023-05-09 14:17:29.726+06', 'Registrations by State', NULL, 'row', '{"database":3,"query":{"source-table":70,"aggregation":[["count"]],"breakout":[["field",671,null]],"order-by":[["desc",["aggregation",0,null]]],"limit":10},"type":"query"}', '{"map.type":"region","map.region":"us_states","graph.dimensions":["stateName"],"graph.metrics":["count"]}', 1, 3, 70, 'query', FALSE, 18, NULL, NULL, FALSE, NULL, NULL, '[{"description":null,"semantic_type":"type/State","coercion_strategy":null,"name":"stateName","settings":null,"field_ref":["field",671,null],"effective_type":"type/Text","id":671,"visibility_type":"normal","display_name":"StateName","fingerprint":{"global":{"distinct-count":6,"nil%":0},"type":{"type/Text":{"percent-json":0,"percent-url":0,"percent-email":0,"percent-state":0,"average-length":5.538461538461538}}},"base_type":"type/Text"},{"display_name":"Count","semantic_type":"type/Quantity","field_ref":["aggregation",0],"name":"count","base_type":"type/BigInteger","effective_type":"type/BigInteger","fingerprint":{"global":{"distinct-count":10,"nil%":0},"type":{"type/Number":{"min":705,"q1":790,"q3":1160,"max":1830,"sd":339.08923768104336,"avg":1043.2}}}}]', NULL, FALSE, 'Ja4C9jmYDwEnYTid4pLzA', '[]', '[]', TRUE), (33, TIMESTAMP '2023-01-24 11:31:40.926', TIMESTAMP WITH TIME ZONE '2024-02-13 18:52:57.284163+06', 'Registrations by State', NULL, 'row', '{"database":3,"native":{"template-tags":{"filterDate":{"id":"f86f592c-2219-063c-8dc4-ca623c06a3ca","name":"filterDate","display-name":"Date","type":"dimension","dimension":["field",677,null],"widget-type":"date/all-options","default":null},"filterGender":{"id":"91f3014a-fb66-6724-708c-8e89f56e2779","name":"filterGender","display-name":"Gender","type":"dimension","dimension":["field",680,null],"widget-type":"string/=","default":null},"filterEvent":{"id":"757a20cf-8f70-6857-0ed5-acb310688b3a","name":"filterEvent","display-name":"Event","type":"dimension","dimension":["field",666,null],"widget-type":"string/=","default":["Birth"]},"filterState":{"id":"9384f1c8-b896-7ddb-6f32-204beba13dd3","name":"filterState","display-name":"State","type":"dimension","dimension":["field",671,null],"widget-type":"string/=","default":null},"filterOffice":{"id":"58ab4870-ee4a-8362-2689-440572bb65de","name":"filterOffice","display-name":"Office","type":"dimension","dimension":["field",676,null],"widget-type":"string/=","default":null}},"query":"[\n {$facet: {\n totalCountInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\"$group\" : { \n \"_id\": null\n , \"qty\": {$sum: NumberInt(1)}\n }}\n , {\"$project\" : { \n \"_id\": \"$_id\"\n , \"totalCount\": \"$qty\"\n }}\n ]\n , otherInfo: [\n {$match: {\n $and: [\n {\"_id\": {\"$ne\": null}}\n [[ {{ filterDate }} ]]\n [[ {{ filterGender }} ]]\n [[ {{ filterEvent }} ]]\n [[ {{ filterState }} ]]\n [[ {{ filterOffice }} ]]\n ]\n }}\n , {\n \"$group\": {\n \"_id\": {\n \"stateName\": \"$stateName\"\n },\n \"count\": {\n \"$sum\": 1\n }\n }\n },\n {\n \"$sort\": {\n \"_id\": 1\n }\n },\n {\n \"$project\": {\n \"_id\": false,\n \"stateName\": \"$_id.stateName\",\n \"count\": true\n }\n },\n {\n \"$sort\": {\n \"count\": -1,\n \"stateName\": 1\n }\n }\n ]\n }}\n , {$replaceRoot: {\n newRoot: {\n $mergeObjects: [\n {allInfo: ''$otherInfo''}, {''$arrayElemAt'': [''$totalCountInfo'', 0]}\n ]\n }\n }}\n , {$unwind: ''$allInfo''}\n , {$project: {\n _id: NumberInt(0)\n , ''State Name'': \"$allInfo.stateName\"\n , ''Registrations'': \"$allInfo.count\"\n }}\n]","collection":"registrations"},"type":"native"}', '{"series_settings":{"Registrations":{"color":"#ED8535"}},"graph.dimensions":["State Name"],"graph.show_values":true,"graph.y_axis.title_text":"No. of registrations","table.pivot_column":"State Name","table.cell_column":"Registrations","column_settings":{"[\"name\",\"State Name\"]":{"column_title":"State Name"}},"graph.metrics":["Registrations"]}', 1, 3, NULL, 'native', FALSE, 18, NULL, NULL, FALSE, NULL, NULL, '[{"display_name":"State Name","field_ref":["field","State Name",{"base-type":"type/Text"}],"name":"State Name","base_type":"type/Text","effective_type":"type/Text","semantic_type":null,"fingerprint":{"global":{"distinct-count":1,"nil%":0.0}}},{"display_name":"Registrations","field_ref":["field","Registrations",{"base-type":"type/Integer"}],"name":"Registrations","base_type":"type/Integer","effective_type":"type/Integer","semantic_type":null,"fingerprint":{"global":{"distinct-count":1,"nil%":0.0}}}]', NULL, FALSE, 'g5hTQaT1d2p1OX0tU90WQ', '[{"id":"f86f592c-2219-063c-8dc4-ca623c06a3ca","type":"date/all-options","target":["dimension",["template-tag","filterDate"]],"name":"Date","slug":"filterDate"},{"id":"91f3014a-fb66-6724-708c-8e89f56e2779","type":"string/=","target":["dimension",["template-tag","filterGender"]],"name":"Gender","slug":"filterGender"},{"id":"757a20cf-8f70-6857-0ed5-acb310688b3a","type":"string/=","target":["dimension",["template-tag","filterEvent"]],"name":"Event","slug":"filterEvent","default":["Birth"]},{"id":"9384f1c8-b896-7ddb-6f32-204beba13dd3","type":"string/=","target":["dimension",["template-tag","filterState"]],"name":"State","slug":"filterState"},{"id":"58ab4870-ee4a-8362-2689-440572bb65de","type":"string/=","target":["dimension",["template-tag","filterOffice"]],"name":"Office","slug":"filterOffice"}]', '[]', TRUE); CREATE INDEX "PUBLIC"."IDX_CARD_CREATOR_ID" ON "PUBLIC"."REPORT_CARD"("CREATOR_ID" NULLS FIRST); @@ -175763,8 +175773,8 @@ CREATE CACHED TABLE "PUBLIC"."IMPLICIT_ACTION" COMMENT 'An action with dynamic p DROP TABLE IF EXISTS SYSTEM_LOB_STREAM; DROP ALIAS IF EXISTS SYSTEM_COMBINE_CLOB; DROP ALIAS IF EXISTS SYSTEM_COMBINE_BLOB; -ALTER TABLE "PUBLIC"."METABASE_FIELD" ADD CONSTRAINT "PUBLIC"."IDX_UNIQ_FIELD_TABLE_ID_PARENT_ID_NAME" UNIQUE("TABLE_ID", "PARENT_ID", "NAME"); ALTER TABLE "PUBLIC"."METRIC_IMPORTANT_FIELD" ADD CONSTRAINT "PUBLIC"."UNIQUE_METRIC_IMPORTANT_FIELD_METRIC_ID_FIELD_ID" UNIQUE("METRIC_ID", "FIELD_ID"); +ALTER TABLE "PUBLIC"."METABASE_FIELD" ADD CONSTRAINT "PUBLIC"."IDX_UNIQ_FIELD_TABLE_ID_PARENT_ID_NAME" UNIQUE("TABLE_ID", "PARENT_ID", "NAME"); ALTER TABLE "PUBLIC"."ACTION" ADD CONSTRAINT "PUBLIC"."CONSTRAINT_72C" UNIQUE("ENTITY_ID"); ALTER TABLE "PUBLIC"."PULSE_CARD" ADD CONSTRAINT "PUBLIC"."CONSTRAINT_A4" UNIQUE("ENTITY_ID"); ALTER TABLE "PUBLIC"."COLLECTION" ADD CONSTRAINT "PUBLIC"."UNIQUE_COLLECTION_PERSONAL_OWNER_ID" UNIQUE("PERSONAL_OWNER_ID"); @@ -175776,8 +175786,8 @@ ALTER TABLE "PUBLIC"."PARAMETER_CARD" ADD CONSTRAINT "PUBLIC"."CONSTRAINT_C3" UN ALTER TABLE "PUBLIC"."TIMELINE" ADD CONSTRAINT "PUBLIC"."CONSTRAINT_B2" UNIQUE("ENTITY_ID"); ALTER TABLE "PUBLIC"."DIMENSION" ADD CONSTRAINT "PUBLIC"."UNIQUE_DIMENSION_FIELD_ID" UNIQUE("FIELD_ID"); ALTER TABLE "PUBLIC"."PERMISSIONS_GROUP" ADD CONSTRAINT "PUBLIC"."UNIQUE_PERMISSIONS_GROUP_NAME" UNIQUE("NAME"); -ALTER TABLE "PUBLIC"."SEGMENT" ADD CONSTRAINT "PUBLIC"."CONSTRAINT_A" UNIQUE("ENTITY_ID"); ALTER TABLE "PUBLIC"."DASHBOARD_BOOKMARK" ADD CONSTRAINT "PUBLIC"."UNIQUE_DASHBOARD_BOOKMARK_USER_ID_DASHBOARD_ID" UNIQUE("USER_ID", "DASHBOARD_ID"); +ALTER TABLE "PUBLIC"."SEGMENT" ADD CONSTRAINT "PUBLIC"."CONSTRAINT_A" UNIQUE("ENTITY_ID"); ALTER TABLE "PUBLIC"."PERSISTED_INFO" ADD CONSTRAINT "PUBLIC"."CONSTRAINT_2" UNIQUE("CARD_ID"); ALTER TABLE "PUBLIC"."CORE_USER" ADD CONSTRAINT "PUBLIC"."CONSTRAINT_4" UNIQUE("EMAIL"); ALTER TABLE "PUBLIC"."PULSE_CHANNEL" ADD CONSTRAINT "PUBLIC"."CONSTRAINT_5" UNIQUE("ENTITY_ID"); @@ -175826,8 +175836,8 @@ ALTER TABLE "PUBLIC"."REPORT_CARD" ADD CONSTRAINT "PUBLIC"."FK_CARD_REF_USER_ID" ALTER TABLE "PUBLIC"."LOGIN_HISTORY" ADD CONSTRAINT "PUBLIC"."FK_LOGIN_HISTORY_SESSION_ID" FOREIGN KEY("SESSION_ID") REFERENCES "PUBLIC"."CORE_SESSION"("ID") ON DELETE SET NULL NOCHECK; ALTER TABLE "PUBLIC"."SANDBOXES" ADD CONSTRAINT "PUBLIC"."FK_SANDBOXES_REF_PERMISSIONS" FOREIGN KEY("PERMISSION_ID") REFERENCES "PUBLIC"."PERMISSIONS"("ID") ON DELETE CASCADE NOCHECK; ALTER TABLE "PUBLIC"."VIEW_LOG" ADD CONSTRAINT "PUBLIC"."FK_VIEW_LOG_REF_USER_ID" FOREIGN KEY("USER_ID") REFERENCES "PUBLIC"."CORE_USER"("ID") ON DELETE CASCADE NOCHECK; -ALTER TABLE "PUBLIC"."REPORT_CARDFAVORITE" ADD CONSTRAINT "PUBLIC"."FK_CARDFAVORITE_REF_CARD_ID" FOREIGN KEY("CARD_ID") REFERENCES "PUBLIC"."REPORT_CARD"("ID") ON DELETE CASCADE NOCHECK; ALTER TABLE "PUBLIC"."SANDBOXES" ADD CONSTRAINT "PUBLIC"."FK_GTAP_TABLE_ID" FOREIGN KEY("TABLE_ID") REFERENCES "PUBLIC"."METABASE_TABLE"("ID") ON DELETE CASCADE NOCHECK; +ALTER TABLE "PUBLIC"."REPORT_CARDFAVORITE" ADD CONSTRAINT "PUBLIC"."FK_CARDFAVORITE_REF_CARD_ID" FOREIGN KEY("CARD_ID") REFERENCES "PUBLIC"."REPORT_CARD"("ID") ON DELETE CASCADE NOCHECK; ALTER TABLE "PUBLIC"."IMPLICIT_ACTION" ADD CONSTRAINT "PUBLIC"."FK_IMPLICIT_ACTION_ACTION_ID" FOREIGN KEY("ACTION_ID") REFERENCES "PUBLIC"."ACTION"("ID") ON DELETE CASCADE NOCHECK; ALTER TABLE "PUBLIC"."TIMELINE_EVENT" ADD CONSTRAINT "PUBLIC"."FK_EVENTS_TIMELINE_ID" FOREIGN KEY("TIMELINE_ID") REFERENCES "PUBLIC"."TIMELINE"("ID") ON DELETE CASCADE NOCHECK; ALTER TABLE "PUBLIC"."PARAMETER_CARD" ADD CONSTRAINT "PUBLIC"."FK_PARAMETER_CARD_REF_CARD_ID" FOREIGN KEY("CARD_ID") REFERENCES "PUBLIC"."REPORT_CARD"("ID") ON DELETE CASCADE NOCHECK; diff --git a/packages/dashboards/run.sh b/packages/dashboards/run.sh index 6e42886719b..76a98c57eee 100644 --- a/packages/dashboards/run.sh +++ b/packages/dashboards/run.sh @@ -85,7 +85,7 @@ if [ -z "${OPENCRVS_METABASE_ADMIN_PASSWORD}" ]; then fi export MB_JETTY_PORT=${MB_JETTY_PORT:-4444} -export MB_DB_FILE=/data/metabase/metabase.mv.db +export MB_DB_FILE=${MB_DB_FILE:-'/data/metabase/metabase.mv.db'} export OPENCRVS_METABASE_ADMIN_PASSWORD_SALT=$(uuidgen) SALT_AND_PASSWORD=$OPENCRVS_METABASE_ADMIN_PASSWORD_SALT$OPENCRVS_METABASE_ADMIN_PASSWORD export OPENCRVS_METABASE_ADMIN_PASSWORD_HASH=$(java -cp $METABASE_JAR clojure.main -e "(require 'metabase.util.password) (println (metabase.util.password/hash-bcrypt \"$SALT_AND_PASSWORD\"))" 2>/dev/null | tail -n 1) From 0a479af5ab2d7600c213c8c6acfd3ec86652df61 Mon Sep 17 00:00:00 2001 From: Riku Rouvila Date: Thu, 14 Nov 2024 07:51:16 +0200 Subject: [PATCH 43/50] Use image size after processing as the resulting file size for image (#7961) --- packages/client/package.json | 1 + .../DocumentUploaderWithOption.tsx | 32 ++++++------- .../SimpleDocumentUploader.tsx | 2 +- .../typings/browser-image-compression.d.ts | 11 ----- yarn.lock | 45 +++++++------------ 5 files changed, 35 insertions(+), 56 deletions(-) delete mode 100644 packages/client/typings/browser-image-compression.d.ts diff --git a/packages/client/package.json b/packages/client/package.json index 2a7f8da301b..0281ca1f482 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -111,6 +111,7 @@ "@graphql-codegen/introspection": "^3.0.0", "@graphql-codegen/typescript": "^3.0.0", "@graphql-codegen/typescript-operations": "^3.0.0", + "@types/browser-image-compression": "^1.0.13", "@types/csv2json": "^1.4.5", "@types/enzyme": "^3.1.13", "@types/fetch-mock": "^7.3.0", diff --git a/packages/client/src/components/form/DocumentUploadField/DocumentUploaderWithOption.tsx b/packages/client/src/components/form/DocumentUploadField/DocumentUploaderWithOption.tsx index c8077eb715f..d97d679e9c5 100644 --- a/packages/client/src/components/form/DocumentUploadField/DocumentUploaderWithOption.tsx +++ b/packages/client/src/components/form/DocumentUploadField/DocumentUploaderWithOption.tsx @@ -73,13 +73,13 @@ type DocumentFields = { documentData: string } -export const getBase64String = (file: File) => { - return new Promise((resolve, reject) => { +const getBase64String = (file: File) => { + return new Promise((resolve, reject) => { const reader = new FileReader() reader.readAsDataURL(file) reader.onload = () => { if (reader.result) { - return resolve(reader.result) + return resolve(reader.result.toString()) } } reader.onerror = (error) => reject(error) @@ -152,26 +152,26 @@ export const DocumentUploaderWithOption = (props: IFullProps) => { if (props.compressImagesToSizeMB !== undefined) { options.maxSizeMB = props.compressImagesToSizeMB } - // disable compression with a falsy value - const resized = - Boolean(options.maxSizeMB) && - bytesToMB(uploadedImage.size) > options.maxSizeMB && - (await imageCompression(uploadedImage, options)) + if ( + !Boolean(options.maxSizeMB) || + bytesToMB(uploadedImage.size) <= options.maxSizeMB + ) { + return uploadedImage + } - const fileAsBase64 = await getBase64String(resized || uploadedImage) + const resized = await imageCompression(uploadedImage, options) - return fileAsBase64.toString() + return resized } const handleFileChange = async (uploadedImage: File) => { if (!uploadedImage) { return } - // If there is only one option available then it would stay selected const documentType = fields.documentType || dropdownOptions[0].value - let fileAsBase64: string + let processedFile: File const optionValues: [IFormFieldValue, string] = [ props.extraValue, documentType @@ -194,7 +194,7 @@ export const DocumentUploaderWithOption = (props: IFullProps) => { try { // Start processing - ;[fileAsBase64] = await Promise.all([ + ;[processedFile] = await Promise.all([ processImage(uploadedImage), minimumProcessingTime ]) @@ -223,9 +223,9 @@ export const DocumentUploaderWithOption = (props: IFullProps) => { const newDocument: IFileValue = { optionValues, - type: uploadedImage.type, - data: fileAsBase64.toString(), - fileSize: uploadedImage.size + type: processedFile.type, + data: await getBase64String(processedFile), + fileSize: processedFile.size } props.onComplete([...props.files, newDocument]) diff --git a/packages/client/src/components/form/DocumentUploadField/SimpleDocumentUploader.tsx b/packages/client/src/components/form/DocumentUploadField/SimpleDocumentUploader.tsx index ccb08a97011..1509acb6e90 100644 --- a/packages/client/src/components/form/DocumentUploadField/SimpleDocumentUploader.tsx +++ b/packages/client/src/components/form/DocumentUploadField/SimpleDocumentUploader.tsx @@ -21,7 +21,7 @@ import { import styled from 'styled-components' import { DocumentListPreview } from './DocumentListPreview' import { buttonMessages, formMessages as messages } from '@client/i18n/messages' -import { getBase64String } from './DocumentUploaderWithOption' +import { getBase64String } from '@client/utils/imageUtils' const DocumentUploader = styled(ImageUploader)` color: ${({ theme }) => theme.colors.primary}; diff --git a/packages/client/typings/browser-image-compression.d.ts b/packages/client/typings/browser-image-compression.d.ts deleted file mode 100644 index 495712b1ffe..00000000000 --- a/packages/client/typings/browser-image-compression.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * OpenCRVS is also distributed under the terms of the Civil Registration - * & Healthcare Disclaimer located at http://opencrvs.org/license. - * - * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. - */ -declare module 'browser-image-compression' diff --git a/yarn.lock b/yarn.lock index fa8f012e474..c3b160fe6dd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8063,6 +8063,13 @@ resolved "https://registry.npmjs.org/@types/boom/-/boom-7.3.5.tgz" integrity sha512-jBS0kU2s9W2sx+ILEyO4kxqIYLllqcUXTaVrBctvGptZ+4X3TWkkgY9+AmxdMPKrgiDDdLcfsaQCTu7bniLvgw== +"@types/browser-image-compression@^1.0.13": + version "1.0.13" + resolved "https://registry.yarnpkg.com/@types/browser-image-compression/-/browser-image-compression-1.0.13.tgz#184c293a0d88f29b1d23ecd5af54670d9242f7bc" + integrity sha512-S97bT2hBW/RPwFrB/tg62alucHzMJKgVCDFCHpTQkK4hS7OW9k5vOG1mvGBkc36OZVh9nHEATtysmw9MSRH1vQ== + dependencies: + browser-image-compression "*" + "@types/bunyan@^1.8.4": version "1.8.11" resolved "https://registry.npmjs.org/@types/bunyan/-/bunyan-1.8.11.tgz" @@ -10687,6 +10694,13 @@ browser-assert@^1.2.1: resolved "https://registry.npmjs.org/browser-assert/-/browser-assert-1.2.1.tgz" integrity sha512-nfulgvOR6S4gt9UKCeGJOuSGBPGiFT6oQ/2UBnvTY/5aQ1PnksW72fhZkM30DzoRRv2WpwZf1vHHEr3mtuXIWQ== +browser-image-compression@*: + version "2.0.2" + resolved "https://registry.yarnpkg.com/browser-image-compression/-/browser-image-compression-2.0.2.tgz#4d5ef8882e9e471d6d923715ceb9034499d14eaa" + integrity sha512-pBLlQyUf6yB8SmmngrcOw3EoS4RpQ1BcylI3T9Yqn7+4nrQTXJD4sJDe5ODnJdrvNMaio5OicFo75rDyJD2Ucw== + dependencies: + uzip "0.20201231.0" + browser-image-compression@^1.0.6: version "1.0.17" resolved "https://registry.npmjs.org/browser-image-compression/-/browser-image-compression-1.0.17.tgz" @@ -22790,16 +22804,7 @@ string-similarity@^4.0.1: resolved "https://registry.npmjs.org/string-similarity/-/string-similarity-4.0.4.tgz" integrity sha512-/q/8Q4Bl4ZKAPjj8WerIBJWALKkaPRfrvhfF8k/B23i4nzrlRj2/go1m90In7nG/3XDSbOo0+pu6RvCTM9RGMQ== -"string-width-cjs@npm:string-width@^4.2.0": - version "4.2.3" - resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -22959,7 +22964,7 @@ stringify-object@^3.3.0: is-obj "^1.0.1" is-regexp "^1.0.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -22980,13 +22985,6 @@ strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - strip-ansi@^7.0.1, strip-ansi@^7.1.0: version "7.1.0" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz" @@ -25132,7 +25130,7 @@ workbox-window@7.1.0, workbox-window@^7.1.0: "@types/trusted-types" "^2.0.2" workbox-core "7.1.0" -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -25159,15 +25157,6 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^8.0.1, wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz" From da4a0b5d288febd145128469b9fec7f42b46786e Mon Sep 17 00:00:00 2001 From: Riku Rouvila Date: Thu, 14 Nov 2024 11:40:12 +0200 Subject: [PATCH 44/50] add warn rule for 'any's in client package --- packages/client/.eslintrc.js | 1 + packages/client/codegen.ts | 2 + packages/client/package.json | 3 +- .../utils/gateway-deprecated-do-not-use.d.ts | 2 + packages/client/src/utils/gateway.ts | 2 + yarn.lock | 230 +----------------- 6 files changed, 12 insertions(+), 228 deletions(-) diff --git a/packages/client/.eslintrc.js b/packages/client/.eslintrc.js index 027692d5c79..1e6b7f19f15 100644 --- a/packages/client/.eslintrc.js +++ b/packages/client/.eslintrc.js @@ -22,6 +22,7 @@ module.exports = { }, rules: { 'react-hooks/exhaustive-deps': 'error', + '@typescript-eslint/no-explicit-any': 'warn', 'no-restricted-imports': [ 'error', { diff --git a/packages/client/codegen.ts b/packages/client/codegen.ts index a05b4e8263a..15021cfc2f8 100644 --- a/packages/client/codegen.ts +++ b/packages/client/codegen.ts @@ -45,6 +45,8 @@ const config: CodegenConfig = { /* * DO NOT EDIT! This file is auto-generated by yarn generate-gateway-types - see 'codegen.yml' */ + + /* eslint-disable */ import { PlainDate } from '@client/utils/date-formatting' ` diff --git a/packages/client/package.json b/packages/client/package.json index 0281ca1f482..2904fa44351 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -16,7 +16,7 @@ "open:cov": "yarn test && opener coverage/index.html", "lint": "yarn lint:css && yarn lint:ts", "lint:css": "stylelint 'src/**/*.{ts,tsx}'", - "lint:ts": "eslint --fix './src/**/*.{ts,tsx}' --max-warnings=0", + "lint:ts": "eslint --fix './src/**/*.{ts,tsx}' --max-warnings=349", "test:compilation": "tsc --noEmit", "extract:translations": "bash extract-translations.sh", "generate-gateway-types": "NODE_OPTIONS=--dns-result-order=ipv4first graphql-codegen --config codegen.ts && prettier --write src/utils/gateway.ts", @@ -162,7 +162,6 @@ "traverse": "^0.6.6", "ts-node": "^7.0.1", "typescript": "4.9.5", - "vite-plugin-babel-macros": "^1.0.6", "vite-plugin-pwa": "^0.20.0", "vitest": "0.25.5", "vitest-fetch-mock": "^0.2.1" diff --git a/packages/client/src/utils/gateway-deprecated-do-not-use.d.ts b/packages/client/src/utils/gateway-deprecated-do-not-use.d.ts index 65ba841ca1e..25bd67a334f 100644 --- a/packages/client/src/utils/gateway-deprecated-do-not-use.d.ts +++ b/packages/client/src/utils/gateway-deprecated-do-not-use.d.ts @@ -9,6 +9,8 @@ * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. */ +/* eslint-disable @typescript-eslint/no-explicit-any */ + import { GraphQLResolveInfo, GraphQLScalarType } from 'graphql' /** * This file is auto-generated by graphql-schema-typescript diff --git a/packages/client/src/utils/gateway.ts b/packages/client/src/utils/gateway.ts index e7c9d89484c..2381b895e76 100644 --- a/packages/client/src/utils/gateway.ts +++ b/packages/client/src/utils/gateway.ts @@ -12,6 +12,8 @@ /* * DO NOT EDIT! This file is auto-generated by yarn generate-gateway-types - see 'codegen.yml' */ + +/* eslint-disable */ import { PlainDate } from '@client/utils/date-formatting' export type Maybe = T | null diff --git a/yarn.lock b/yarn.lock index c3b160fe6dd..7921d4f2588 100644 --- a/yarn.lock +++ b/yarn.lock @@ -730,14 +730,6 @@ "@babel/highlight" "^7.24.6" picocolors "^1.0.0" -"@babel/code-frame@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.25.9.tgz#895b6c7e04a7271a0cbfd575d2e8131751914cc7" - integrity sha512-z88xeGxnzehn2sqZ8UdGQEvYErF1odv2CftxInpSYJt6uHuPe9YjahKZITGs3l5LeI9d2ROG+obuDAoSlqbNfQ== - dependencies: - "@babel/highlight" "^7.25.9" - picocolors "^1.0.0" - "@babel/compat-data@^7.20.5", "@babel/compat-data@^7.22.6", "@babel/compat-data@^7.22.9", "@babel/compat-data@^7.23.2": version "7.23.2" resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.23.2.tgz" @@ -763,11 +755,6 @@ resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.25.4.tgz#7d2a80ce229890edcf4cc259d4d696cb4dae2fcb" integrity sha512-+LGRog6RAsCJrrrg/IO6LGmpphNe5DiK30dGjCoxxeGv49B10/3XYGxPsAwrDlMFcFEvdAUavDT8r9k/hSyQqQ== -"@babel/compat-data@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.25.9.tgz#24b01c5db6a3ebf85661b4fb4a946a9bccc72ac8" - integrity sha512-yD+hEuJ/+wAJ4Ox2/rpNv5HIuPG82x3ZlQvYVn8iYCprdxzE7P1udpGF1jyjQVBU4dgznN+k2h103vxZ7NdPyw== - "@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.14.0", "@babel/core@^7.14.3", "@babel/core@^7.18.9", "@babel/core@^7.19.6", "@babel/core@^7.22.9": version "7.23.2" resolved "https://registry.npmjs.org/@babel/core/-/core-7.23.2.tgz" @@ -810,27 +797,6 @@ json5 "^2.2.3" semver "^6.3.1" -"@babel/core@^7.17.7": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.25.9.tgz#855a4cddcec4158f3f7afadacdab2a7de8af7434" - integrity sha512-WYvQviPw+Qyib0v92AwNIrdLISTp7RfDkM7bPqBvpbnhY4wq8HvHBZREVdYDXk98C8BkOIVnHAY3yvj7AVISxQ== - dependencies: - "@ampproject/remapping" "^2.2.0" - "@babel/code-frame" "^7.25.9" - "@babel/generator" "^7.25.9" - "@babel/helper-compilation-targets" "^7.25.9" - "@babel/helper-module-transforms" "^7.25.9" - "@babel/helpers" "^7.25.9" - "@babel/parser" "^7.25.9" - "@babel/template" "^7.25.9" - "@babel/traverse" "^7.25.9" - "@babel/types" "^7.25.9" - convert-source-map "^2.0.0" - debug "^4.1.0" - gensync "^1.0.0-beta.2" - json5 "^2.2.3" - semver "^6.3.1" - "@babel/core@^7.24.4": version "7.24.5" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.24.5.tgz#15ab5b98e101972d171aeef92ac70d8d6718f06a" @@ -953,16 +919,6 @@ "@jridgewell/trace-mapping" "^0.3.25" jsesc "^2.5.1" -"@babel/generator@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.25.9.tgz#c7e828ebe0c2baba103b712924699c9e8a6e32f0" - integrity sha512-omlUGkr5EaoIJrhLf9CJ0TvjBRpd9+AXRG//0GEQ9THSo8wPiTlbpy1/Ow8ZTrbXpjd9FHXfbFQx32I04ht0FA== - dependencies: - "@babel/types" "^7.25.9" - "@jridgewell/gen-mapping" "^0.3.5" - "@jridgewell/trace-mapping" "^0.3.25" - jsesc "^3.0.2" - "@babel/helper-annotate-as-pure@^7.22.5": version "7.22.5" resolved "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz" @@ -1047,17 +1003,6 @@ lru-cache "^5.1.1" semver "^6.3.1" -"@babel/helper-compilation-targets@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.9.tgz#55af025ce365be3cdc0c1c1e56c6af617ce88875" - integrity sha512-j9Db8Suy6yV/VHa4qzrj9yZfZxhLWQdVnRlXxmKLYlhWUVB1sB2G5sxuWYXk/whHD9iW76PmNzxZ4UCnTQTVEQ== - dependencies: - "@babel/compat-data" "^7.25.9" - "@babel/helper-validator-option" "^7.25.9" - browserslist "^4.24.0" - lru-cache "^5.1.1" - semver "^6.3.1" - "@babel/helper-create-class-features-plugin@^7.18.6", "@babel/helper-create-class-features-plugin@^7.22.11", "@babel/helper-create-class-features-plugin@^7.22.5": version "7.22.15" resolved "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.22.15.tgz" @@ -1232,14 +1177,6 @@ "@babel/traverse" "^7.24.7" "@babel/types" "^7.24.7" -"@babel/helper-module-imports@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz#e7f8d20602ebdbf9ebbea0a0751fb0f2a4141715" - integrity sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw== - dependencies: - "@babel/traverse" "^7.25.9" - "@babel/types" "^7.25.9" - "@babel/helper-module-transforms@^7.22.5", "@babel/helper-module-transforms@^7.23.0": version "7.23.0" resolved "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.23.0.tgz" @@ -1294,16 +1231,6 @@ "@babel/helper-validator-identifier" "^7.24.7" "@babel/traverse" "^7.25.2" -"@babel/helper-module-transforms@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.25.9.tgz#12e4fb2969197ef6d78ea8a2f24375ce85b425fb" - integrity sha512-TvLZY/F3+GvdRYFZFyxMvnsKi+4oJdgZzU3BoGN9Uc2d9C6zfNwJcKKhjqLAhK8i46mv93jsO74fDh3ih6rpHA== - dependencies: - "@babel/helper-module-imports" "^7.25.9" - "@babel/helper-simple-access" "^7.25.9" - "@babel/helper-validator-identifier" "^7.25.9" - "@babel/traverse" "^7.25.9" - "@babel/helper-optimise-call-expression@^7.22.5": version "7.22.5" resolved "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.22.5.tgz" @@ -1338,11 +1265,6 @@ resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.8.tgz#94ee67e8ec0e5d44ea7baeb51e571bd26af07878" integrity sha512-FFWx5142D8h2Mgr/iPVGH5G7w6jDn4jUSpZTyDnQO0Yn7Ks2Kuz6Pci8H6MPCoUJegd/UZQ3tAvfLCxQSnWWwg== -"@babel/helper-plugin-utils@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.9.tgz#9cbdd63a9443a2c92a725cca7ebca12cc8dd9f46" - integrity sha512-kSMlyUVdWe25rEsRGviIgOWnoT/nfABVWlqt9N19/dIPWViAOW2s9wznP5tURbs/IDuNk4gPy3YdYRgH3uxhBw== - "@babel/helper-remap-async-to-generator@^7.22.20", "@babel/helper-remap-async-to-generator@^7.22.5": version "7.22.20" resolved "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.22.20.tgz" @@ -1408,14 +1330,6 @@ "@babel/traverse" "^7.24.7" "@babel/types" "^7.24.7" -"@babel/helper-simple-access@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.25.9.tgz#6d51783299884a2c74618d6ef0f86820ec2e7739" - integrity sha512-c6WHXuiaRsJTyHYLJV75t9IqsmTbItYfdj99PnzYGQZkYKvan5/2jKJ7gu31J3/BJ/A18grImSPModuyG/Eo0Q== - dependencies: - "@babel/traverse" "^7.25.9" - "@babel/types" "^7.25.9" - "@babel/helper-skip-transparent-expression-wrappers@^7.22.5": version "7.22.5" resolved "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.22.5.tgz" @@ -1484,11 +1398,6 @@ resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz#5b3329c9a58803d5df425e5785865881a81ca48d" integrity sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ== -"@babel/helper-string-parser@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz#1aabb72ee72ed35789b4bbcad3ca2862ce614e8c" - integrity sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA== - "@babel/helper-validator-identifier@^7.22.20": version "7.22.20" resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz" @@ -1509,11 +1418,6 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz#75b889cfaf9e35c2aaf42cf0d72c8e91719251db" integrity sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w== -"@babel/helper-validator-identifier@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz#24b64e2c3ec7cd3b3c547729b8d16871f22cbdc7" - integrity sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ== - "@babel/helper-validator-option@^7.22.15": version "7.22.15" resolved "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.15.tgz" @@ -1539,11 +1443,6 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.24.8.tgz#3725cdeea8b480e86d34df15304806a06975e33d" integrity sha512-xb8t9tD1MHLungh/AIoWYN+gVHaB9kwlu8gffXGSt3FFEIT7RjS+xWbc2vUD1UTZdIpKj/ab3rdqJ7ufngyi2Q== -"@babel/helper-validator-option@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz#86e45bd8a49ab7e03f276577f96179653d41da72" - integrity sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw== - "@babel/helper-wrap-function@^7.22.20": version "7.22.20" resolved "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.22.20.tgz" @@ -1604,14 +1503,6 @@ "@babel/template" "^7.25.0" "@babel/types" "^7.25.6" -"@babel/helpers@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.25.9.tgz#9e26aa6fbefdbca4f8c8a1d66dc6f1c00ddadb0a" - integrity sha512-oKWp3+usOJSzDZOucZUAMayhPz/xVjzymyDzUN8dk0Wd3RWMlGLXi07UCQ/CgQVb8LvXx3XBajJH4XGgkt7H7g== - dependencies: - "@babel/template" "^7.25.9" - "@babel/types" "^7.25.9" - "@babel/highlight@^7.10.4", "@babel/highlight@^7.22.13": version "7.22.20" resolved "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz" @@ -1651,16 +1542,6 @@ js-tokens "^4.0.0" picocolors "^1.0.0" -"@babel/highlight@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.25.9.tgz#8141ce68fc73757946f983b343f1231f4691acc6" - integrity sha512-llL88JShoCsth8fF8R4SJnIn+WLvR6ccFxu1H3FlMhDontdcmZWf2HgIZ7AIqV3Xcck1idlohrN4EUBQz6klbw== - dependencies: - "@babel/helper-validator-identifier" "^7.25.9" - chalk "^2.4.2" - js-tokens "^4.0.0" - picocolors "^1.0.0" - "@babel/parser@^7.1.0", "@babel/parser@^7.14.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.8", "@babel/parser@^7.20.7", "@babel/parser@^7.22.15", "@babel/parser@^7.23.0", "@babel/parser@^7.8.3", "@babel/parser@^7.8.4": version "7.23.0" resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz" @@ -1693,13 +1574,6 @@ dependencies: "@babel/types" "^7.25.6" -"@babel/parser@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.25.9.tgz#8fcaa079ac7458facfddc5cd705cc8005e4d3817" - integrity sha512-aI3jjAAO1fh7vY/pBGsn1i9LDbRP43+asrRlkPuTXW5yHXtd1NgTEMudbBoDDxrf1daEEfPJqR+JBMakzrR4Dg== - dependencies: - "@babel/types" "^7.25.9" - "@babel/plugin-bugfix-firefox-class-in-computed-class-key@^7.25.3": version "7.25.3" resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.25.3.tgz#dca427b45a6c0f5c095a1c639dfe2476a3daba7f" @@ -1884,13 +1758,6 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-syntax-jsx@^7.16.7": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.25.9.tgz#a34313a178ea56f1951599b929c1ceacee719290" - integrity sha512-ld6oezHQMZsZfp6pWtbjaNDF2tiiCYYDqQszHt5VV437lewP9aSi2Of99CK0D0XB21k7FLgnLcmQKyKzynfeAA== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - "@babel/plugin-syntax-jsx@^7.24.7": version "7.24.7" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.24.7.tgz#39a1fa4a7e3d3d7f34e2acc6be585b718d30e02d" @@ -1954,13 +1821,6 @@ dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-syntax-typescript@^7.16.7": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.25.9.tgz#67dda2b74da43727cf21d46cf9afef23f4365399" - integrity sha512-hjMgRy5hb8uJJjUcdWunWVcoi9bGpJp8p5Ol1229PoN6aytsLwNMgmdftO23wnCLMfVmTwZDWMPNq/D1SY60JQ== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - "@babel/plugin-syntax-typescript@^7.24.7": version "7.25.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.25.4.tgz#04db9ce5a9043d9c635e75ae7969a2cd50ca97ff" @@ -3072,13 +2932,6 @@ dependencies: regenerator-runtime "^0.14.0" -"@babel/runtime@^7.12.5": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.25.9.tgz#65884fd6dc255a775402cc1d9811082918f4bf00" - integrity sha512-4zpTHZ9Cm6L9L+uIqghQX8ZXg8HKFcjYO3qHoO8zTmRm6HQUJ8SSJ+KRvbMBZn0EGVlT4DRYeQ/6hjlyXBh+Kg== - dependencies: - regenerator-runtime "^0.14.0" - "@babel/runtime@^7.13.10": version "7.25.6" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.25.6.tgz#9afc3289f7184d8d7f98b099884c26317b9264d2" @@ -3131,15 +2984,6 @@ "@babel/parser" "^7.25.0" "@babel/types" "^7.25.0" -"@babel/template@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.25.9.tgz#ecb62d81a8a6f5dc5fe8abfc3901fc52ddf15016" - integrity sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg== - dependencies: - "@babel/code-frame" "^7.25.9" - "@babel/parser" "^7.25.9" - "@babel/types" "^7.25.9" - "@babel/traverse@^7.14.0", "@babel/traverse@^7.16.8", "@babel/traverse@^7.18.9", "@babel/traverse@^7.23.2", "@babel/traverse@^7.4.5", "@babel/traverse@^7.8.3": version "7.23.2" resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz" @@ -3217,19 +3061,6 @@ debug "^4.3.1" globals "^11.1.0" -"@babel/traverse@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.25.9.tgz#a50f8fe49e7f69f53de5bea7e413cd35c5e13c84" - integrity sha512-ZCuvfwOwlz/bawvAuvcj8rrithP2/N55Tzz342AkTvq4qaWbGfmCk/tKhNaV2cthijKrPAA8SRJV5WWe7IBMJw== - dependencies: - "@babel/code-frame" "^7.25.9" - "@babel/generator" "^7.25.9" - "@babel/parser" "^7.25.9" - "@babel/template" "^7.25.9" - "@babel/types" "^7.25.9" - debug "^4.3.1" - globals "^11.1.0" - "@babel/types@^7.0.0", "@babel/types@^7.16.8", "@babel/types@^7.18.13", "@babel/types@^7.18.9", "@babel/types@^7.20.7", "@babel/types@^7.22.15", "@babel/types@^7.22.19", "@babel/types@^7.22.5", "@babel/types@^7.23.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": version "7.23.0" resolved "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz" @@ -3284,14 +3115,6 @@ "@babel/helper-validator-identifier" "^7.24.7" to-fast-properties "^2.0.0" -"@babel/types@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.25.9.tgz#620f35ea1f4233df529ec9a2668d2db26574deee" - integrity sha512-OwS2CM5KocvQ/k7dFJa8i5bNGJP0hXWfVCfDkqRFP1IreH1JDC7wG6eCYCi0+McbfT8OR/kNqsI0UU0xP9H6PQ== - dependencies: - "@babel/helper-string-parser" "^7.25.9" - "@babel/helper-validator-identifier" "^7.25.9" - "@balena/dockerignore@^1.0.2": version "1.0.2" resolved "https://registry.npmjs.org/@balena/dockerignore/-/dockerignore-1.0.2.tgz" @@ -8012,7 +7835,7 @@ "@types/babel__template" "*" "@types/babel__traverse" "*" -"@types/babel__core@^7.1.14", "@types/babel__core@^7.1.18", "@types/babel__core@^7.20.5": +"@types/babel__core@^7.1.14", "@types/babel__core@^7.20.5": version "7.20.5" resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.5.tgz#3df15f27ba85319caa07ba08d0721889bb39c017" integrity sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA== @@ -10346,15 +10169,6 @@ babel-plugin-macros@^2.0.0: cosmiconfig "^6.0.0" resolve "^1.12.0" -babel-plugin-macros@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/babel-plugin-macros/-/babel-plugin-macros-3.1.0.tgz#9ef6dc74deb934b4db344dc973ee851d148c50c1" - integrity sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg== - dependencies: - "@babel/runtime" "^7.12.5" - cosmiconfig "^7.0.0" - resolve "^1.19.0" - babel-plugin-polyfill-corejs2@^0.4.10: version "0.4.11" resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.11.tgz#30320dfe3ffe1a336c15afdcdafd6fd615b25e33" @@ -10772,16 +10586,6 @@ browserslist@^4.23.1, browserslist@^4.23.3: node-releases "^2.0.18" update-browserslist-db "^1.1.0" -browserslist@^4.24.0: - version "4.24.2" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.24.2.tgz#f5845bc91069dbd55ee89faf9822e1d885d16580" - integrity sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg== - dependencies: - caniuse-lite "^1.0.30001669" - electron-to-chromium "^1.5.41" - node-releases "^2.0.18" - update-browserslist-db "^1.1.1" - bs-logger@0.x: version "0.2.6" resolved "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz" @@ -11067,11 +10871,6 @@ caniuse-lite@^1.0.30001663: resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001664.tgz#d588d75c9682d3301956b05a3749652a80677df4" integrity sha512-AmE7k4dXiNKQipgn7a2xg558IRqPN3jMQY/rOsbxDhrd0tyChwbITBfiwtnqz8bi2M5mIWbxAYBvk7W7QBUS2g== -caniuse-lite@^1.0.30001669: - version "1.0.30001669" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001669.tgz#fda8f1d29a8bfdc42de0c170d7f34a9cf19ed7a3" - integrity sha512-DlWzFDJqstqtIVx1zeSpIMLjunf5SmwOw0N2Ck/QSQdS8PLS4+9HrLaYei4w8BIAL7IB/UEDu889d8vhCTPA0w== - capital-case@^1.0.4: version "1.0.4" resolved "https://registry.npmjs.org/capital-case/-/capital-case-1.0.4.tgz" @@ -11904,7 +11703,7 @@ cosmiconfig@^6.0.0: path-type "^4.0.0" yaml "^1.7.2" -cosmiconfig@^7, cosmiconfig@^7.0.0, cosmiconfig@^7.0.1, cosmiconfig@^7.1.0: +cosmiconfig@^7, cosmiconfig@^7.0.1, cosmiconfig@^7.1.0: version "7.1.0" resolved "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz" integrity sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA== @@ -12979,11 +12778,6 @@ electron-to-chromium@^1.5.28: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.29.tgz#aa592a3caa95d07cc26a66563accf99fa573a1ee" integrity sha512-PF8n2AlIhCKXQ+gTpiJi0VhcHDb69kYX4MtCiivctc2QD3XuNZ/XIOlbGzt7WAjjEev0TtaH6Cu3arZExm5DOw== -electron-to-chromium@^1.5.41: - version "1.5.45" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.45.tgz#fa592ce6a88b44d23acbc7453a2feab98996e6c9" - integrity sha512-vOzZS6uZwhhbkZbcRyiy99Wg+pYFV5hk+5YaECvx0+Z31NR3Tt5zS6dze2OepT6PCTzVzT0dIJItti+uAW5zmw== - email-validator@^2.0.4: version "2.0.4" resolved "https://registry.npmjs.org/email-validator/-/email-validator-2.0.4.tgz" @@ -17307,11 +17101,6 @@ jsesc@^2.5.1: resolved "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz" integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== -jsesc@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-3.0.2.tgz#bb8b09a6597ba426425f2e4a07245c3d00b9343e" - integrity sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g== - jsesc@~0.5.0: version "0.5.0" resolved "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz" @@ -21721,7 +21510,7 @@ resolve@1.1.7: resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" integrity sha512-9znBF0vBcaSN3W2j7wKvdERPwqTxSpCq+if5C0WoTCyV9n24rua28jeuQ2pL/HOf+yUe/Mef+H/5p60K0Id3bg== -resolve@^1.1.5, resolve@^1.10.0, resolve@^1.12.0, resolve@^1.14.2, resolve@^1.19.0, resolve@^1.20.0, resolve@^1.22.1, resolve@^1.22.4: +resolve@^1.1.5, resolve@^1.10.0, resolve@^1.12.0, resolve@^1.14.2, resolve@^1.20.0, resolve@^1.22.1, resolve@^1.22.4: version "1.22.8" resolved "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz" integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== @@ -24287,7 +24076,7 @@ update-browserslist-db@^1.0.13: escalade "^3.1.1" picocolors "^1.0.0" -update-browserslist-db@^1.1.0, update-browserslist-db@^1.1.1: +update-browserslist-db@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz#80846fba1d79e82547fb661f8d141e0945755fe5" integrity sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A== @@ -24520,17 +24309,6 @@ victory-vendor@^36.6.8: d3-time "^3.0.0" d3-timer "^3.0.1" -vite-plugin-babel-macros@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/vite-plugin-babel-macros/-/vite-plugin-babel-macros-1.0.6.tgz#d05cee3c38c620ccb534e38f412fdd899a3365b5" - integrity sha512-7cCT8jtu5UjpE46pH7RyVltWw5FbhDAtQliZ6QGqRNR5RUZKdAsB0CDjuF+VBoDpnl0KuESPu22SoNqXRYYWyQ== - dependencies: - "@babel/core" "^7.17.7" - "@babel/plugin-syntax-jsx" "^7.16.7" - "@babel/plugin-syntax-typescript" "^7.16.7" - "@types/babel__core" "^7.1.18" - babel-plugin-macros "^3.1.0" - vite-plugin-pwa@^0.20.0: version "0.20.0" resolved "https://registry.yarnpkg.com/vite-plugin-pwa/-/vite-plugin-pwa-0.20.0.tgz#1785c8cc8c11c89c0ba8c6557f29e2b58b14dd6d" From 970945f6dd6a75c3f04c3b17715e6fe042bf76c3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 15 Nov 2024 08:45:22 +0200 Subject: [PATCH 45/50] chore(deps): update dependency typescript to v5 (#7374) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: jamil314 Co-authored-by: Riku Rouvila --- packages/auth/package.json | 6 +- packages/auth/tsconfig.json | 24 +- packages/client/package.json | 5 +- packages/commons/package.json | 6 +- packages/commons/src/assignment.test.ts | 66 +- packages/commons/src/fhir/composition.ts | 2 +- .../commons/src/fhir/transformers/index.ts | 8 +- .../src/fhir/transformers/templates.ts | 7 +- packages/commons/src/fixtures/birth-bundle.ts | 12 +- packages/commons/src/fixtures/death-bundle.ts | 15 +- .../commons/src/fixtures/marriage-bundle.ts | 21 +- packages/components/package.json | 6 +- packages/components/src/Alert/Alert.tsx | 1 + .../components/src/Summary/components/Row.tsx | 1 + packages/components/src/Toast/Toast.tsx | 1 + packages/components/tsconfig.json | 21 +- packages/config/package.json | 54 +- .../src/handlers/locations/children.test.ts | 6 +- .../config/src/handlers/locations/handler.ts | 3 +- .../src/handlers/locations/hierarchy.test.ts | 6 +- packages/config/tsconfig.json | 26 +- packages/data-seeder/package.json | 2 +- packages/data-seeder/tsconfig.json | 22 +- packages/documents/package.json | 6 +- packages/documents/tsconfig.json | 1 - packages/gateway/package.json | 46 +- .../correction/root-resolvers.test.ts | 4 +- .../features/location/root-resolvers.test.ts | 13 +- .../__snapshots__/type-resolvers.test.ts.snap | 370 ++-- .../registration/root-resolvers.test.ts | 12 +- .../features/registration/type-resolvers.ts | 2 +- .../gateway/src/features/user/utils/index.ts | 2 +- packages/gateway/src/rate-limit.test.ts | 5 +- packages/gateway/test/setupJest.ts | 8 +- packages/gateway/tsconfig.json | 6 +- packages/login/package.json | 3 +- packages/metrics/package.json | 9 +- .../declarationsStarted/handler.test.ts | 5 +- .../features/declarationsStarted/handler.ts | 3 +- .../metrics/src/features/export/handler.ts | 4 +- .../features/getTimeLogged/handler.test.ts | 3 +- .../src/features/metrics/metricsGenerator.ts | 34 +- .../monthWiseEventEstimations/handler.test.ts | 3 +- .../__snapshots__/handler.test.ts.snap | 60 +- .../metrics/src/scripts/VSExportGenerator.ts | 14 +- packages/metrics/src/utils/authUtils.ts | 2 +- packages/metrics/tsconfig.json | 31 +- packages/migration/package.json | 2 +- packages/migration/tsconfig.json | 2 +- packages/notification/extract-translations.sh | 2 +- packages/notification/package.json | 9 +- .../notification/src/extract-translations.ts | 4 +- .../src/features/sms/user-handler.ts | 2 +- packages/notification/tsconfig.json | 23 +- packages/search/package.json | 9 +- .../search/src/features/reindex/handler.ts | 3 +- packages/search/src/test/utils.ts | 41 +- packages/search/src/utils/authUtils.ts | 2 +- packages/search/tsconfig.json | 2 +- packages/user-mgnt/package.json | 9 +- packages/user-mgnt/src/database.test.ts | 2 +- packages/user-mgnt/src/database.ts | 2 +- .../src/features/createUser/service.test.ts | 6 +- .../user-mgnt/src/features/system/handler.ts | 4 +- .../src/features/userAudit/handler.ts | 4 +- .../src/features/userSearchRecord/handler.ts | 4 +- packages/user-mgnt/src/utils/token.ts | 2 +- packages/user-mgnt/src/utils/userUtils.ts | 2 +- packages/user-mgnt/test/setupJest.ts | 4 +- packages/user-mgnt/tsconfig.json | 15 +- packages/webhooks/package.json | 9 +- .../src/features/manage/handler.test.ts | 4 +- .../webhooks/src/features/manage/handler.ts | 6 +- .../webhooks/src/features/manage/service.ts | 2 +- packages/webhooks/tsconfig.json | 32 +- packages/workflow/package.json | 9 +- .../state-transitions.test.ts.snap | 102 +- packages/workflow/src/records/fhir.ts | 8 +- .../workflow/src/records/handler/create.ts | 4 +- packages/workflow/src/test/utils.ts | 2 +- packages/workflow/src/utils/auth-utils.ts | 2 +- .../workflow/src/utils/duplicate-checker.ts | 8 +- packages/workflow/test/handlers.ts | 5 +- packages/workflow/test/mocks/locations.ts | 8 +- .../workflow/test/mocks/practitionerRole.ts | 3 +- .../workflow/test/mocks/records/archive.ts | 21 +- .../workflow/test/mocks/records/certify.ts | 32 +- .../test/mocks/records/readyForReview.ts | 26 +- .../workflow/test/mocks/records/register.ts | 26 +- packages/workflow/tsconfig.json | 4 +- yarn.lock | 1740 +++++++++-------- 91 files changed, 1701 insertions(+), 1474 deletions(-) diff --git a/packages/auth/package.json b/packages/auth/package.json index ceef33073d0..eea32652508 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -54,14 +54,14 @@ "eslint-config-prettier": "^9.0.0", "eslint-plugin-import": "^2.17.3", "eslint-plugin-prettier": "^4.0.0", - "jest": "27.5.1", + "jest": "29.7.0", "jest-fetch-mock": "^2.1.2", "nodemon": "^3.0.0", "prettier": "2.8.8", "redis-mock": "^0.56.0", - "ts-jest": "27.1.4", + "ts-jest": "29.2.5", "ts-node": "^6.1.1", - "typescript": "4.9.5" + "typescript": "5.6.3" }, "lint-staged": { "src/**/*.ts": [ diff --git a/packages/auth/tsconfig.json b/packages/auth/tsconfig.json index 00523a2349f..b09507251d6 100644 --- a/packages/auth/tsconfig.json +++ b/packages/auth/tsconfig.json @@ -2,9 +2,7 @@ "compilerOptions": { "baseUrl": "./src", "paths": { - "@auth/*": [ - "./*" - ] + "@auth/*": ["./*"] }, "target": "es6", "module": "commonjs", @@ -14,28 +12,16 @@ "sourceMap": true, "moduleResolution": "node", "rootDir": ".", - "lib": [ - "esnext.asynciterable", - "es6", - "es2017" - ], + "lib": ["esnext.asynciterable", "es6", "es2017"], "forceConsistentCasingInFileNames": true, "noImplicitReturns": true, "noImplicitThis": true, "noImplicitAny": true, "strictNullChecks": true, - "suppressImplicitAnyIndexErrors": true, "noUnusedLocals": true, - "types": [ - "fhir", - "jest" - ] + "types": ["fhir", "jest"] }, - "include": [ - "resources/**/*.ts", - "src/**/*.ts", - "typings" - ], + "include": ["resources/**/*.ts", "src/**/*.ts", "typings"], "exclude": [ "node_modules", "build", @@ -43,4 +29,4 @@ "acceptance-tests", "src/setupTests.ts" ] -} \ No newline at end of file +} diff --git a/packages/client/package.json b/packages/client/package.json index 2904fa44351..39031ccd533 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -69,6 +69,7 @@ "history": "^4.7.2", "html-to-pdfmake": "^2.5.13", "iframe-resizer-react": "^1.1.0", + "jsdom": "16.7.0", "jsdom-worker": "^0.3.0", "jwt-decode": "^2.2.0", "localforage": "^1.7.2", @@ -142,7 +143,7 @@ "eslint-config-prettier": "^9.0.0", "eslint-config-react-app": "^6.0.0", "eslint-plugin-flowtype": "^5.2.0", - "eslint-plugin-formatjs": "2.21.0", + "eslint-plugin-formatjs": "4.10.0", "eslint-plugin-import": "^2.17.3", "eslint-plugin-jsx-a11y": "^6.3.1", "eslint-plugin-prettier": "^4.0.0", @@ -161,7 +162,7 @@ "stylelint-processor-styled-components": "^1.10.0", "traverse": "^0.6.6", "ts-node": "^7.0.1", - "typescript": "4.9.5", + "typescript": "5.6.3", "vite-plugin-pwa": "^0.20.0", "vitest": "0.25.5", "vitest-fetch-mock": "^0.2.1" diff --git a/packages/commons/package.json b/packages/commons/package.json index 7f09b9826ea..56c28cbcc57 100644 --- a/packages/commons/package.json +++ b/packages/commons/package.json @@ -35,12 +35,12 @@ "@types/uuid": "^9.0.3", "date-fns": "^2.28.0", "elastic-apm-node": "^3.29.0", - "jest": "27.5.1", + "jest": "29.7.0", "jwt-decode": "^2.2.0", "lodash": "^4.17.10", "node-fetch": "^2.6.7", "pkg-up": "^3.1.0", - "typescript": "4.9.5", + "typescript": "5.6.3", "uuid": "^9.0.0", "pino": "^7.0.0" }, @@ -53,7 +53,7 @@ "eslint-plugin-prettier": "^4.0.0", "jest-fetch-mock": "^2.1.2", "pino-pretty": "^11.0.0", - "ts-jest": "27.1.4" + "ts-jest": "29.2.5" }, "lint-staged": { "src/**/*.ts": [ diff --git a/packages/commons/src/assignment.test.ts b/packages/commons/src/assignment.test.ts index d764b4a9bba..d09ed922476 100644 --- a/packages/commons/src/assignment.test.ts +++ b/packages/commons/src/assignment.test.ts @@ -50,7 +50,8 @@ it('finds assignment from the latest task', () => { ] }, focus: { - reference: 'Composition/c5811d36-934d-40f9-94b4-15194d562e45' + reference: + 'Composition/c5811d36-934d-40f9-94b4-15194d562e45' as `Composition/${UUID}` }, extension: [ { @@ -122,7 +123,8 @@ it("finds assignment when it's in TaskHistory and status HAS NOT changed", () => ] }, focus: { - reference: 'Composition/c5811d36-934d-40f9-94b4-15194d562e45' + reference: + 'Composition/c5811d36-934d-40f9-94b4-15194d562e45' as `Composition/${UUID}` }, identifier: [ { @@ -137,13 +139,15 @@ it("finds assignment when it's in TaskHistory and status HAS NOT changed", () => { url: 'http://opencrvs.org/specs/extension/regLastUser', valueReference: { - reference: 'Practitioner/00000000-0000-4000-8000-000000000001' + reference: + 'Practitioner/00000000-0000-4000-8000-000000000001' as `Practitioner/${UUID}` } }, { url: 'http://opencrvs.org/specs/extension/regLastOffice', valueReference: { - reference: 'Location/00000000-0000-4000-8000-000000000010' + reference: + 'Location/00000000-0000-4000-8000-000000000010' as `Location/${UUID}` } } ], @@ -268,7 +272,8 @@ it("does not find assignment when it's in TaskHistory and status HAS changed", ( ] }, focus: { - reference: 'Composition/c5811d36-934d-40f9-94b4-15194d562e45' + reference: + 'Composition/c5811d36-934d-40f9-94b4-15194d562e45' as `Composition/${UUID}` }, identifier: [ { @@ -283,13 +288,15 @@ it("does not find assignment when it's in TaskHistory and status HAS changed", ( { url: 'http://opencrvs.org/specs/extension/regLastUser', valueReference: { - reference: 'Practitioner/00000000-0000-4000-8000-000000000001' + reference: + 'Practitioner/00000000-0000-4000-8000-000000000001' as `Practitioner/${UUID}` } }, { url: 'http://opencrvs.org/specs/extension/regLastOffice', valueReference: { - reference: 'Location/00000000-0000-4000-8000-000000000010' + reference: + 'Location/00000000-0000-4000-8000-000000000010' as `Location/${UUID}` } } ], @@ -317,7 +324,8 @@ it("does not find assignment when it's in TaskHistory and status HAS changed", ( ] }, focus: { - reference: 'Composition/c5811d36-934d-40f9-94b4-15194d562e45' + reference: + 'Composition/c5811d36-934d-40f9-94b4-15194d562e45' as `Composition/${UUID}` }, identifier: [ { @@ -332,13 +340,15 @@ it("does not find assignment when it's in TaskHistory and status HAS changed", ( { url: 'http://opencrvs.org/specs/extension/regLastUser', valueReference: { - reference: 'Practitioner/00000000-0000-4000-8000-000000000002' + reference: + 'Practitioner/00000000-0000-4000-8000-000000000002' as `Practitioner/${UUID}` } }, { url: 'http://opencrvs.org/specs/extension/regLastOffice', valueReference: { - reference: 'Location/00000000-0000-4000-8000-000000000010' + reference: + 'Location/00000000-0000-4000-8000-000000000010' as `Location/${UUID}` } } ], @@ -366,7 +376,8 @@ it("does not find assignment when it's in TaskHistory and status HAS changed", ( ] }, focus: { - reference: 'Composition/c5811d36-934d-40f9-94b4-15194d562e45' + reference: + 'Composition/c5811d36-934d-40f9-94b4-15194d562e45' as `Composition/${UUID}` }, identifier: [ { @@ -381,13 +392,15 @@ it("does not find assignment when it's in TaskHistory and status HAS changed", ( { url: 'http://opencrvs.org/specs/extension/regLastUser', valueReference: { - reference: 'Practitioner/93e34962-cef1-446a-985f-ad0e46732939' + reference: + 'Practitioner/93e34962-cef1-446a-985f-ad0e46732939' as `Practitioner/${UUID}` } }, { url: 'http://opencrvs.org/specs/extension/regLastOffice', valueReference: { - reference: 'Location/347ef736-2359-48cc-a513-5b9fae487fb7' + reference: + 'Location/347ef736-2359-48cc-a513-5b9fae487fb7' as `Location/${UUID}` } } ], @@ -443,7 +456,8 @@ it("does not find assignment when it's in TaskHistory and status has afterwards ] }, focus: { - reference: 'Composition/c5811d36-934d-40f9-94b4-15194d562e45' + reference: + 'Composition/c5811d36-934d-40f9-94b4-15194d562e45' as `Composition/${UUID}` }, identifier: [ { @@ -459,13 +473,15 @@ it("does not find assignment when it's in TaskHistory and status has afterwards { url: 'http://opencrvs.org/specs/extension/regLastUser', valueReference: { - reference: 'Practitioner/00000000-0000-4000-8000-000000000001' + reference: + 'Practitioner/00000000-0000-4000-8000-000000000001' as `Practitioner/${UUID}` } }, { url: 'http://opencrvs.org/specs/extension/regLastOffice', valueReference: { - reference: 'Location/00000000-0000-4000-8000-000000000010' + reference: + 'Location/00000000-0000-4000-8000-000000000010' as `Location/${UUID}` } } ], @@ -492,7 +508,8 @@ it("does not find assignment when it's in TaskHistory and status has afterwards ] }, focus: { - reference: 'Composition/c5811d36-934d-40f9-94b4-15194d562e45' + reference: + 'Composition/c5811d36-934d-40f9-94b4-15194d562e45' as `Composition/${UUID}` }, identifier: [ { @@ -508,13 +525,15 @@ it("does not find assignment when it's in TaskHistory and status has afterwards { url: 'http://opencrvs.org/specs/extension/regLastUser', valueReference: { - reference: 'Practitioner/00000000-0000-4000-8000-000000000002' + reference: + 'Practitioner/00000000-0000-4000-8000-000000000002' as `Practitioner/${UUID}` } }, { url: 'http://opencrvs.org/specs/extension/regLastOffice', valueReference: { - reference: 'Location/00000000-0000-4000-8000-000000000010' + reference: + 'Location/00000000-0000-4000-8000-000000000010' as `Location/${UUID}` } } ], @@ -542,7 +561,8 @@ it("does not find assignment when it's in TaskHistory and status has afterwards ] }, focus: { - reference: 'Composition/c5811d36-934d-40f9-94b4-15194d562e45' + reference: + 'Composition/c5811d36-934d-40f9-94b4-15194d562e45' as `Composition/${UUID}` }, identifier: [ { @@ -557,13 +577,15 @@ it("does not find assignment when it's in TaskHistory and status has afterwards { url: 'http://opencrvs.org/specs/extension/regLastUser', valueReference: { - reference: 'Practitioner/93e34962-cef1-446a-985f-ad0e46732939' + reference: + 'Practitioner/93e34962-cef1-446a-985f-ad0e46732939' as `Practitioner/${UUID}` } }, { url: 'http://opencrvs.org/specs/extension/regLastOffice', valueReference: { - reference: 'Location/347ef736-2359-48cc-a513-5b9fae487fb7' + reference: + 'Location/347ef736-2359-48cc-a513-5b9fae487fb7' as `Location/${UUID}` } } ], diff --git a/packages/commons/src/fhir/composition.ts b/packages/commons/src/fhir/composition.ts index 8fd6ccbd975..cab311e3e89 100644 --- a/packages/commons/src/fhir/composition.ts +++ b/packages/commons/src/fhir/composition.ts @@ -171,7 +171,7 @@ type ReferenceType = export type CompositionSectionCode = ReferenceType['code'] -type ReferenceTypeByCode = Extract< +export type ReferenceTypeByCode = Extract< ReferenceType, { code: U } > diff --git a/packages/commons/src/fhir/transformers/index.ts b/packages/commons/src/fhir/transformers/index.ts index 1d74bea5730..7cafb772b06 100644 --- a/packages/commons/src/fhir/transformers/index.ts +++ b/packages/commons/src/fhir/transformers/index.ts @@ -95,7 +95,7 @@ import { CompositionSectionTitleByCode, EVENT_TYPE } from '..' -import { getUUID } from '../..' +import { getUUID, UUID } from '../..' import { replaceFromBundle } from '../../record' import { AddressInput, @@ -508,7 +508,7 @@ function createAddressBuilder( { url: 'http://opencrvs.org/specs/extension/part-of', valueReference: { - reference: `Location/${fieldValue}` + reference: `Location/${fieldValue as UUID}` } } ], @@ -642,7 +642,7 @@ function createLocationAddressBuilder( context ) - location.partOf = { reference: `Location/${fieldValue}` } + location.partOf = { reference: `Location/${fieldValue as UUID}` } } } } @@ -2090,7 +2090,7 @@ const builders: IFieldBuilders = { { url: 'http://opencrvs.org/specs/extension/part-of', valueReference: { - reference: `Location/${fieldValue}` + reference: `Location/${fieldValue as UUID}` } } ], diff --git a/packages/commons/src/fhir/transformers/templates.ts b/packages/commons/src/fhir/transformers/templates.ts index c8b7cd21f6c..e41eef55cfd 100644 --- a/packages/commons/src/fhir/transformers/templates.ts +++ b/packages/commons/src/fhir/transformers/templates.ts @@ -23,7 +23,6 @@ import { QuestionnaireResponse, RelatedPerson, Section, - EVENT_TYPE, Task } from '..' import { @@ -31,7 +30,9 @@ import { CompositionSectionTitle, CompositionSectionTitleByCode, DEATH_CORRECTION_ENCOUNTER_CODE, - PartialBy + EVENT_TYPE, + PartialBy, + ReferenceTypeByCode } from '../../types' import { UUID } from '../../uuid' @@ -126,7 +127,7 @@ export function createEncounterSection< }, entry: [ { - reference: `urn:uuid:${refUuid}` as const + reference: `urn:uuid:${refUuid}` as ReferenceTypeByCode['reference'] } ] } diff --git a/packages/commons/src/fixtures/birth-bundle.ts b/packages/commons/src/fixtures/birth-bundle.ts index 5d56140c106..1d604280aff 100644 --- a/packages/commons/src/fixtures/birth-bundle.ts +++ b/packages/commons/src/fixtures/birth-bundle.ts @@ -314,7 +314,8 @@ export const BIRTH_BUNDLE: SavedBundle< { url: 'http://opencrvs.org/specs/extension/part-of', valueReference: { - reference: 'Location/e66643ac-9ea9-4314-b842-f4fb3ad9e83a' + reference: + 'Location/e66643ac-9ea9-4314-b842-f4fb3ad9e83a' as `Location/${UUID}` } } ] @@ -455,7 +456,8 @@ export const BIRTH_BUNDLE: SavedBundle< { url: 'http://opencrvs.org/specs/extension/part-of', valueReference: { - reference: 'Location/e66643ac-9ea9-4314-b842-f4fb3ad9e83a' + reference: + 'Location/e66643ac-9ea9-4314-b842-f4fb3ad9e83a' as `Location/${UUID}` } } ] @@ -589,7 +591,8 @@ export const BIRTH_BUNDLE: SavedBundle< { url: 'http://opencrvs.org/specs/extension/regLastOffice', valueReference: { - reference: 'Location/e9e1b362-27c9-4ce1-82ad-57fe9d5650e4' + reference: + 'Location/e9e1b362-27c9-4ce1-82ad-57fe9d5650e4' as `Location/${UUID}` } }, { @@ -967,7 +970,8 @@ export const BIRTH_BUNDLE: SavedBundle< ], location: [ { - reference: 'Location/e9e1b362-27c9-4ce1-82ad-57fe9d5650e4' + reference: + 'Location/e9e1b362-27c9-4ce1-82ad-57fe9d5650e4' as `Location/${UUID}` } ], id: '5f675c08-9494-462f-9fac-043755b865ad' as UUID, diff --git a/packages/commons/src/fixtures/death-bundle.ts b/packages/commons/src/fixtures/death-bundle.ts index 079da560035..a0c94609195 100644 --- a/packages/commons/src/fixtures/death-bundle.ts +++ b/packages/commons/src/fixtures/death-bundle.ts @@ -373,7 +373,8 @@ export const DEATH_BUNDLE: SavedBundle< { url: 'http://opencrvs.org/specs/extension/part-of', valueReference: { - reference: 'Location/e66643ac-9ea9-4314-b842-f4fb3ad9e83a' + reference: + 'Location/e66643ac-9ea9-4314-b842-f4fb3ad9e83a' as `Location/${UUID}` } } ] @@ -530,13 +531,15 @@ export const DEATH_BUNDLE: SavedBundle< { url: 'http://opencrvs.org/specs/extension/regLastOffice', valueReference: { - reference: 'Location/e9e1b362-27c9-4ce1-82ad-57fe9d5650e4' + reference: + 'Location/e9e1b362-27c9-4ce1-82ad-57fe9d5650e4' as `Location/${UUID}` } }, { url: 'http://opencrvs.org/specs/extension/regLastUser', valueReference: { - reference: 'Practitioner/525094f5-3c5f-4e72-af3b-adda8617839f' + reference: + 'Practitioner/525094f5-3c5f-4e72-af3b-adda8617839f' as `Practitioner/${UUID}` } }, { @@ -628,7 +631,8 @@ export const DEATH_BUNDLE: SavedBundle< { url: 'http://opencrvs.org/specs/extension/part-of', valueReference: { - reference: 'Location/e66643ac-9ea9-4314-b842-f4fb3ad9e83a' + reference: + 'Location/e66643ac-9ea9-4314-b842-f4fb3ad9e83a' as `Location/${UUID}` } } ] @@ -1145,7 +1149,8 @@ export const DEATH_BUNDLE: SavedBundle< ], location: [ { - reference: 'Location/e9e1b362-27c9-4ce1-82ad-57fe9d5650e4' + reference: + 'Location/e9e1b362-27c9-4ce1-82ad-57fe9d5650e4' as `Location/${UUID}` } ], meta: { diff --git a/packages/commons/src/fixtures/marriage-bundle.ts b/packages/commons/src/fixtures/marriage-bundle.ts index 99a9fcbd075..8efe6f0d108 100644 --- a/packages/commons/src/fixtures/marriage-bundle.ts +++ b/packages/commons/src/fixtures/marriage-bundle.ts @@ -383,7 +383,8 @@ export const MARRIAGE_BUNDLE: Saved< { url: 'http://opencrvs.org/specs/extension/part-of', valueReference: { - reference: 'Location/e66643ac-9ea9-4314-b842-f4fb3ad9e83a' + reference: + 'Location/e66643ac-9ea9-4314-b842-f4fb3ad9e83a' as `Location/${UUID}` } } ] @@ -490,7 +491,8 @@ export const MARRIAGE_BUNDLE: Saved< { url: 'http://opencrvs.org/specs/extension/part-of', valueReference: { - reference: 'Location/e66643ac-9ea9-4314-b842-f4fb3ad9e83a' + reference: + 'Location/e66643ac-9ea9-4314-b842-f4fb3ad9e83a' as `Location/${UUID}` } } ] @@ -517,7 +519,8 @@ export const MARRIAGE_BUNDLE: Saved< ] }, focus: { - reference: 'Composition/b2e4d436-d7fb-4b0f-9674-628b5af8f42e' + reference: + 'Composition/b2e4d436-d7fb-4b0f-9674-628b5af8f42e' as `Composition/${UUID}` }, id: '6cc01269-6b36-4aa5-9bb0-21944d685e42' as UUID, identifier: [ @@ -566,13 +569,15 @@ export const MARRIAGE_BUNDLE: Saved< { url: 'http://opencrvs.org/specs/extension/regLastOffice', valueReference: { - reference: 'Location/e9e1b362-27c9-4ce1-82ad-57fe9d5650e4' + reference: + 'Location/e9e1b362-27c9-4ce1-82ad-57fe9d5650e4' as `Location/${UUID}` } }, { url: 'http://opencrvs.org/specs/extension/regLastUser', valueReference: { - reference: 'Practitioner/48455871-1636-46a1-8279-aaa76dec03d4' + reference: + 'Practitioner/48455871-1636-46a1-8279-aaa76dec03d4' as `Practitioner/${UUID}` } }, { @@ -865,7 +870,8 @@ export const MARRIAGE_BUNDLE: Saved< { url: 'http://opencrvs.org/specs/extension/part-of', valueReference: { - reference: 'Location/bbee20e1-68c4-4e0c-a0cd-44336341e005' + reference: + 'Location/bbee20e1-68c4-4e0c-a0cd-44336341e005' as `Location/${UUID}` } } ] @@ -906,7 +912,8 @@ export const MARRIAGE_BUNDLE: Saved< ], location: [ { - reference: 'Location/e9e1b362-27c9-4ce1-82ad-57fe9d5650e4' + reference: + 'Location/e9e1b362-27c9-4ce1-82ad-57fe9d5650e4' as `Location/${UUID}` } ], id: '5f675c08-9494-462f-9fac-043755b865ad' as UUID, diff --git a/packages/components/package.json b/packages/components/package.json index 392c3c78df0..5af66e1adda 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -8,7 +8,7 @@ "dependencies": { "@storybook/core-server": "^7.6.17", "css-animation": "^2.0.4", - "jest": "27.5.1", + "jest": "29.7.0", "patch-package": "^6.1.2", "phosphor-react": "^1.4.1", "polished": "^4.2.2", @@ -22,7 +22,7 @@ "react-tooltip": "^4.2.21", "recharts": "^2.5.0", "styled-components": "^5.2.0", - "ts-jest": "27.1.4", + "ts-jest": "29.2.5", "vite": "^5.0.0", "webfontloader": "^1.6.28" }, @@ -81,7 +81,7 @@ "stylelint-config-styled-components": "^0.1.1", "stylelint-processor-styled-components": "^1.10.0", "ts-dedent": "^2.2.0", - "typescript": "4.9.5" + "typescript": "5.6.3" }, "jest": { "collectCoverageFrom": [ diff --git a/packages/components/src/Alert/Alert.tsx b/packages/components/src/Alert/Alert.tsx index af5e031b61b..d42ec4d64ad 100644 --- a/packages/components/src/Alert/Alert.tsx +++ b/packages/components/src/Alert/Alert.tsx @@ -82,6 +82,7 @@ export interface IAlertProps extends React.HTMLAttributes { onActionClick?: (event?: React.MouseEvent) => void actionText?: string customIcon?: React.ReactNode + 'data-testid'?: string } /** diff --git a/packages/components/src/Summary/components/Row.tsx b/packages/components/src/Summary/components/Row.tsx index 5297491bba3..3f9cccd6820 100644 --- a/packages/components/src/Summary/components/Row.tsx +++ b/packages/components/src/Summary/components/Row.tsx @@ -54,6 +54,7 @@ export interface ISummaryRowProps placeholder?: React.ReactNode /** Is the summary value greyed / locked out */ locked?: boolean + 'data-testid'?: string } const RowValue = ({ diff --git a/packages/components/src/Toast/Toast.tsx b/packages/components/src/Toast/Toast.tsx index 5f9ec33398e..e0a2cc6d4a9 100644 --- a/packages/components/src/Toast/Toast.tsx +++ b/packages/components/src/Toast/Toast.tsx @@ -103,6 +103,7 @@ export interface IToastProps extends React.HTMLAttributes { onActionClick?: (event?: React.MouseEvent) => void actionText?: string duration?: number | null + 'data-testid'?: string } export function Toast({ diff --git a/packages/components/tsconfig.json b/packages/components/tsconfig.json index 842505e51cd..316988045da 100644 --- a/packages/components/tsconfig.json +++ b/packages/components/tsconfig.json @@ -4,11 +4,7 @@ "outDir": "lib/", "module": "ESNext", "target": "es6", - "lib": [ - "es6", - "dom", - "es2017" - ], + "lib": ["es6", "dom", "es2017"], "sourceMap": true, "allowJs": false, "declaration": true, @@ -21,19 +17,10 @@ "noImplicitThis": true, "noImplicitAny": true, "strictNullChecks": true, - "suppressImplicitAnyIndexErrors": true, "noUnusedLocals": false, "skipLibCheck": true, "declarationMap": true }, - "include": [ - "src/**/*.tsx", - "src/**/*.ts", - ".storybook", - "typings" - ], - "exclude": [ - "node_modules", - "lib" - ] -} \ No newline at end of file + "include": ["src/**/*.tsx", "src/**/*.ts", ".storybook", "typings"], + "exclude": ["node_modules", "lib"] +} diff --git a/packages/config/package.json b/packages/config/package.json index 713cd249ad2..6c8f3736752 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -53,9 +53,9 @@ "mockingoose": "^2.15.2", "nodemon": "^3.0.0", "prettier": "^2.5.0", - "ts-jest": "27.1.4", + "ts-jest": "29.2.5", "ts-node": "^6.1.1", - "typescript": "4.9.5" + "typescript": "5.6.3" }, "lint-staged": { "src/**/*.ts": [ @@ -65,29 +65,42 @@ }, "jest": { "transform": { - "^.+\\.tsx?$": "ts-jest" + "^.+\\.tsx?$": [ + "ts-jest", + { + "diagnostics": { + "ignoreCodes": [ + 2722, + 2532, + 2554, + 2339 + ] + } + } + ], + "^.+.tsx?$": [ + "ts-jest", + { + "diagnostics": { + "ignoreCodes": [ + 2722, + 2532, + 2554, + 2339 + ] + } + } + ] }, "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$", "moduleFileExtensions": [ - "ts", - "tsx", "js", - "jsx", "json", - "node" + "jsx", + "node", + "ts", + "tsx" ], - "globals": { - "ts-jest": { - "diagnostics": { - "ignoreCodes": [ - 2722, - 2532, - 2554, - 2339 - ] - } - } - }, "testEnvironment": "node", "setupFiles": [ "./test/setupJest.ts" @@ -96,8 +109,7 @@ "" ], "moduleNameMapper": { - "@config/(.*)": "/src/$1", - "@opencrvs/commons/(.*)": "@opencrvs/commons/build/dist/$1" + "@config/(.*)": "/src/$1" }, "coverageReporters": [ "json", diff --git a/packages/config/src/handlers/locations/children.test.ts b/packages/config/src/handlers/locations/children.test.ts index 80beae4574d..7090c357922 100644 --- a/packages/config/src/handlers/locations/children.test.ts +++ b/packages/config/src/handlers/locations/children.test.ts @@ -38,7 +38,7 @@ describe('resolveLocationChildren', () => { }) const uuid2 = fixtures.savedLocation({ id: 'uuid2' as UUID, - partOf: { reference: 'Location/uuid1' } + partOf: { reference: 'Location/uuid1' as `Location/${UUID}` } }) const result = resolveLocationChildren(uuid1, [uuid1, uuid2]) @@ -53,11 +53,11 @@ describe('resolveLocationChildren', () => { }) const uuid2 = fixtures.savedLocation({ id: 'uuid2' as UUID, - partOf: { reference: 'Location/uuid1' } + partOf: { reference: 'Location/uuid1' as `Location/${UUID}` } }) const uuid3 = fixtures.savedLocation({ id: 'uuid3' as UUID, - partOf: { reference: 'Location/uuid2' } + partOf: { reference: 'Location/uuid2' as `Location/${UUID}` } }) const result = resolveLocationChildren(uuid1, [uuid1, uuid2, uuid3]) diff --git a/packages/config/src/handlers/locations/handler.ts b/packages/config/src/handlers/locations/handler.ts index d2896c672d0..b0e7b9306ce 100644 --- a/packages/config/src/handlers/locations/handler.ts +++ b/packages/config/src/handlers/locations/handler.ts @@ -26,6 +26,7 @@ import { Location as FhirLocation } from '@opencrvs/commons/types' import { fetchFromHearth, sendToFhir } from '@config/services/hearth' +import { UUID } from '@opencrvs/commons' enum Code { CRVS_OFFICE = 'CRVS_OFFICE', @@ -234,7 +235,7 @@ async function batchLocationsHandler( })) .map( (location): BundleEntry => ({ - fullUrl: `urn:uuid:${uuid()}`, + fullUrl: `urn:uuid:${uuid() as UUID}`, resource: { ...composeFhirLocation(location), ...(location.statistics && { diff --git a/packages/config/src/handlers/locations/hierarchy.test.ts b/packages/config/src/handlers/locations/hierarchy.test.ts index 6969bbf9a55..eb323cdee3e 100644 --- a/packages/config/src/handlers/locations/hierarchy.test.ts +++ b/packages/config/src/handlers/locations/hierarchy.test.ts @@ -30,7 +30,7 @@ describe('resolveLocationParents', () => { }) const child = fixtures.savedLocation({ id: 'uuid2' as UUID, - partOf: { reference: 'Location/uuid1' } + partOf: { reference: 'Location/uuid1' as `Location/${UUID}` } }) const result = resolveLocationParents(child, [child, parent]) @@ -44,11 +44,11 @@ describe('resolveLocationParents', () => { }) const parent = fixtures.savedLocation({ id: 'uuid2' as UUID, - partOf: { reference: 'Location/uuid1' } + partOf: { reference: 'Location/uuid1' as `Location/${UUID}` } }) const child = fixtures.savedLocation({ id: 'uuid3' as UUID, - partOf: { reference: 'Location/uuid2' } + partOf: { reference: 'Location/uuid2' as `Location/${UUID}` } }) const locations = [child, parent, grandparent] diff --git a/packages/config/tsconfig.json b/packages/config/tsconfig.json index 77a36483279..6f273f39f92 100644 --- a/packages/config/tsconfig.json +++ b/packages/config/tsconfig.json @@ -2,22 +2,16 @@ "compilerOptions": { "baseUrl": "./src", "paths": { - "@config/*": [ - "./*" - ] + "@config/*": ["./*"] }, "target": "es6", - "module": "commonjs", + "module": "node16", "strict": true, "rootDir": ".", "sourceMap": true, "moduleResolution": "node16", "outDir": "build/dist", - "lib": [ - "esnext.asynciterable", - "es6", - "es2017" - ], + "lib": ["esnext.asynciterable", "es6", "es2017"], "forceConsistentCasingInFileNames": true, "noImplicitReturns": true, "noImplicitThis": true, @@ -25,16 +19,8 @@ "strictNullChecks": true, "noUnusedLocals": true, "skipLibCheck": true, - "types": [ - "fhir", - "jest" - ], + "types": ["fhir", "jest"] }, - "include": [ - "src/**/*.ts", - "typings" - ], - "exclude": [ - "node_modules" - ] + "include": ["src/**/*.ts", "typings"], + "exclude": ["node_modules"] } diff --git a/packages/data-seeder/package.json b/packages/data-seeder/package.json index bfef2576fad..8a620298c17 100644 --- a/packages/data-seeder/package.json +++ b/packages/data-seeder/package.json @@ -26,7 +26,7 @@ "node-fetch": "^2.6.1", "ts-node": "^6.1.1", "tsconfig-paths": "^3.13.0", - "typescript": "4.9.5", + "typescript": "5.6.3", "uuid": "^3.3.2", "zod": "^3.17.3" }, diff --git a/packages/data-seeder/tsconfig.json b/packages/data-seeder/tsconfig.json index ef04deb07bd..7912e46249f 100644 --- a/packages/data-seeder/tsconfig.json +++ b/packages/data-seeder/tsconfig.json @@ -4,9 +4,7 @@ "esModuleInterop": true, "baseUrl": "./src", "paths": { - "@data-seeder/*": [ - "./*" - ] + "@data-seeder/*": ["./*"] }, "target": "es6", "module": "commonjs", @@ -14,27 +12,15 @@ "sourceMap": true, "moduleResolution": "node", "rootDir": ".", - "lib": [ - "esnext.asynciterable", - "es6", - "es2019", - "DOM.Iterable" - ], + "lib": ["esnext.asynciterable", "es6", "es2019", "DOM.Iterable"], "forceConsistentCasingInFileNames": true, "noImplicitReturns": true, "noImplicitThis": true, "noImplicitAny": true, "strictNullChecks": true, - "suppressImplicitAnyIndexErrors": true, "allowSyntheticDefaultImports": true, "noUnusedLocals": true, - "types": [ - "node", - "fhir" - ] + "types": ["node", "fhir"] }, - "include": [ - "src/**/*.ts", - "typings" - ] + "include": ["src/**/*.ts", "typings"] } diff --git a/packages/documents/package.json b/packages/documents/package.json index 5a12eddcc3d..b072812e887 100644 --- a/packages/documents/package.json +++ b/packages/documents/package.json @@ -50,15 +50,15 @@ "eslint-plugin-prettier": "^4.0.0", "eslint-config-prettier": "^9.0.0", "@typescript-eslint/parser": "^4.5.0", - "jest": "27.5.1", + "jest": "29.7.0", "jest-fetch-mock": "^2.1.2", "nodemon": "^3.0.0", "prettier": "2.8.8", "eslint": "^7.11.0", "@typescript-eslint/eslint-plugin": "^4.5.0", - "ts-jest": "27.1.4", + "ts-jest": "29.2.5", "ts-node": "^6.1.1", - "typescript": "4.9.5" + "typescript": "5.6.3" }, "lint-staged": { "src/**/*.ts": [ diff --git a/packages/documents/tsconfig.json b/packages/documents/tsconfig.json index c56d46550d3..66f852f5d92 100644 --- a/packages/documents/tsconfig.json +++ b/packages/documents/tsconfig.json @@ -16,7 +16,6 @@ "noImplicitThis": true, "noImplicitAny": true, "strictNullChecks": true, - "suppressImplicitAnyIndexErrors": true, "noUnusedLocals": true, "types": ["fhir", "jest"] }, diff --git a/packages/gateway/package.json b/packages/gateway/package.json index c0a733f8440..36c72e99f74 100644 --- a/packages/gateway/package.json +++ b/packages/gateway/package.json @@ -94,16 +94,16 @@ "eslint-plugin-import": "^2.17.3", "eslint-plugin-prettier": "^4.0.0", "graphql-schema-typescript": "^1.5.0", - "jest": "27.5.1", + "jest": "29.7.0", "jest-fetch-mock": "^2.1.2", "lab-transform-typescript": "^3.0.1", "nodemon": "^3.0.0", "opener": "^1.5.1", "prettier": "2.8.8", "testcontainers": "^9.1.1", - "ts-jest": "27.1.4", + "ts-jest": "29.2.5", "ts-node": "^6.1.1", - "typescript": "4.9.5" + "typescript": "5.6.3" }, "lint-staged": { "src/**/*.graphql": [ @@ -116,29 +116,32 @@ }, "jest": { "transform": { - "^.+\\.tsx?$": "ts-jest" + "^.+\\.tsx?$": [ + "ts-jest" + ], + "^.+.tsx?$": [ + "ts-jest", + { + "diagnostics": { + "ignoreCodes": [ + 2722, + 2532, + 2554, + 2339 + ] + } + } + ] }, "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$", "moduleFileExtensions": [ - "ts", - "tsx", "js", - "jsx", "json", - "node" + "jsx", + "node", + "ts", + "tsx" ], - "globals": { - "ts-jest": { - "diagnostics": { - "ignoreCodes": [ - 2722, - 2532, - 2554, - 2339 - ] - } - } - }, "testEnvironment": "node", "//": "Test timeout is increased due to the fact that testcontainers can take a while to pull Docker images", "testTimeout": 30000, @@ -149,8 +152,7 @@ "" ], "moduleNameMapper": { - "@gateway/(.*)": "/src/$1", - "@opencrvs/commons/(.*)": "@opencrvs/commons/build/dist/$1" + "@gateway/(.*)": "/src/$1" }, "coverageReporters": [ "json", diff --git a/packages/gateway/src/features/correction/root-resolvers.test.ts b/packages/gateway/src/features/correction/root-resolvers.test.ts index c703c333483..9fdf491f6df 100644 --- a/packages/gateway/src/features/correction/root-resolvers.test.ts +++ b/packages/gateway/src/features/correction/root-resolvers.test.ts @@ -10,8 +10,8 @@ */ import { resolvers as rootResolvers } from '@gateway/features/correction/root-resolvers' import { readFileSync } from 'fs' -import * as fetchAny from 'jest-fetch-mock' -import * as jwt from 'jsonwebtoken' +import fetchAny from 'jest-fetch-mock' +import jwt from 'jsonwebtoken' const resolvers = rootResolvers as any describe('Correction root resolvers', () => { let registerCertifyToken: string diff --git a/packages/gateway/src/features/location/root-resolvers.test.ts b/packages/gateway/src/features/location/root-resolvers.test.ts index 1375f8d1fcc..509963b512c 100644 --- a/packages/gateway/src/features/location/root-resolvers.test.ts +++ b/packages/gateway/src/features/location/root-resolvers.test.ts @@ -14,6 +14,7 @@ import { } from '@opencrvs/commons/fixtures' import { resolvers } from '@gateway/features/location/root-resolvers' import * as fetchAny from 'jest-fetch-mock' +import { UUID } from '@opencrvs/commons' const fetch = fetchAny as any @@ -22,7 +23,9 @@ describe('Location root resolvers', () => { it('returns false if a location has administrative locations as its children', async () => { fetch.mockResponseOnce( JSON.stringify([ - savedAdministrativeLocation({ partOf: { reference: 'Location/1' } }) + savedAdministrativeLocation({ + partOf: { reference: 'Location/1' as `Location/${UUID}` } + }) ]) ) // @ts-ignore @@ -37,8 +40,12 @@ describe('Location root resolvers', () => { it('returns true if a location has no administrative locations as its children', async () => { fetch.mockResponseOnce( JSON.stringify([ - savedLocation({ partOf: { reference: 'Location/1' } }), - savedAdministrativeLocation({ partOf: { reference: 'Location/2' } }) + savedLocation({ + partOf: { reference: 'Location/1' as `Location/${UUID}` } + }), + savedAdministrativeLocation({ + partOf: { reference: 'Location/2' as `Location/${UUID}` } + }) ]) ) // @ts-ignore diff --git a/packages/gateway/src/features/registration/__snapshots__/type-resolvers.test.ts.snap b/packages/gateway/src/features/registration/__snapshots__/type-resolvers.test.ts.snap index 5db255f469c..0be73a6d5c3 100644 --- a/packages/gateway/src/features/registration/__snapshots__/type-resolvers.test.ts.snap +++ b/packages/gateway/src/features/registration/__snapshots__/type-resolvers.test.ts.snap @@ -1,13 +1,13 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`running a full aggregated birth FHIR bundle through resolvers produces a BirthRegistration object 1`] = ` -Object { - "fetchBirthRegistration": Object { - "_fhirIDMap": Object { +{ + "fetchBirthRegistration": { + "_fhirIDMap": { "composition": "09f39e17-ca23-4905-9ab3-f3649c4e3162", "encounter": "e7ed42ae-bd54-4d7c-ad9d-0af7506d1d64", "eventLocation": "565d957a-109a-4bf3-a3af-f0ad52c719cd", - "observation": Object { + "observation": { "attendantAtBirth": "942901b9-e03f-4209-953d-fd094e5e8231", "birthType": "78e42deb-c50e-43c8-853f-71ccc6398512", "weightAtBirth": "d47d4a55-bf18-4704-ac3a-0066e3ecff6f", @@ -16,14 +16,14 @@ Object { }, "attendantAtBirth": "PHYSICIAN", "birthType": "SINGLE", - "child": Object { + "child": { "_fhirID": null, "address": null, "age": null, "ageOfIndividualInYears": null, "birthDate": "2023-07-11", "dateOfMarriage": null, - "deceased": Object { + "deceased": { "deathDate": null, "deceased": null, }, @@ -32,26 +32,26 @@ Object { "exactDateOfBirthUnknown": null, "gender": "female", "id": "dfac3127-963e-4ef2-b875-3123e08da3d9", - "identifier": Array [ - Object { + "identifier": [ + { "fieldsModifiedByIdentity": null, "id": "2023B3VUXES", "otherType": null, "type": "BIRTH_REGISTRATION_NUMBER", }, - Object { + { "fieldsModifiedByIdentity": null, "id": "", "otherType": null, "type": "BIRTH_CONFIGURABLE_IDENTIFIER_1", }, - Object { + { "fieldsModifiedByIdentity": null, "id": "", "otherType": null, "type": "BIRTH_CONFIGURABLE_IDENTIFIER_2", }, - Object { + { "fieldsModifiedByIdentity": null, "id": "", "otherType": null, @@ -60,8 +60,8 @@ Object { ], "maritalStatus": null, "multipleBirth": null, - "name": Array [ - Object { + "name": [ + { "familyName": "Baumbach", "firstNames": "Isadore", "marriedLastName": null, @@ -77,7 +77,7 @@ Object { }, "childrenBornAliveToMother": null, "createdAt": "2023-08-11T05:26:26.000Z", - "eventLocation": Object { + "eventLocation": { "_fhirID": null, "address": null, "altitude": null, @@ -92,16 +92,16 @@ Object { "telecom": null, "type": "HEALTH_FACILITY", }, - "father": Object { + "father": { "_fhirID": null, - "address": Array [ - Object { + "address": [ + { "city": "South Jamelmouth", "country": "FAR", "district": "e66643ac-9ea9-4314-b842-f4fb3ad9e83a", "districtName": "Ibombo", "from": null, - "line": Array [ + "line": [ "12", "Usual Street", "Usual Residental Area", @@ -109,7 +109,7 @@ Object { "", "URBAN", ], - "lineName": Array [ + "lineName": [ "12", "Usual Street", "Usual Residental Area", @@ -131,7 +131,7 @@ Object { "ageOfIndividualInYears": null, "birthDate": "2003-07-11", "dateOfMarriage": "2021-07-11", - "deceased": Object { + "deceased": { "deathDate": null, "deceased": null, }, @@ -140,8 +140,8 @@ Object { "exactDateOfBirthUnknown": null, "gender": null, "id": "3ee05cf9-a550-4d7f-abde-54313f7bd41a", - "identifier": Array [ - Object { + "identifier": [ + { "fieldsModifiedByIdentity": null, "id": "8762475961", "otherType": null, @@ -150,8 +150,8 @@ Object { ], "maritalStatus": "MARRIED", "multipleBirth": null, - "name": Array [ - Object { + "name": [ + { "familyName": "Neil", "firstNames": "Baumbach", "marriedLastName": null, @@ -159,7 +159,7 @@ Object { "use": "en", }, ], - "nationality": Array [ + "nationality": [ "FAR", ], "occupation": "Bookkeeper", @@ -168,19 +168,19 @@ Object { "telecom": null, }, "foetalDeathsToMother": null, - "history": Array [ - Object { - "certificates": Array [ + "history": [ + { + "certificates": [ null, ], - "comments": Array [], + "comments": [], "date": "2023-10-02T13:51:55.645+00:00", "dhis2Notification": false, "duplicateOf": null, "hasShowedVerifiedDocument": false, - "input": Array [], + "input": [], "ipAddress": null, - "location": Object { + "location": { "_fhirID": null, "address": null, "altitude": null, @@ -197,7 +197,7 @@ Object { }, "noSupportingDocumentationRequired": false, "note": "", - "office": Object { + "office": { "_fhirID": null, "address": null, "altitude": null, @@ -213,7 +213,7 @@ Object { "type": "CRVS_OFFICE", }, "otherReason": "", - "output": Array [], + "output": [], "payment": null, "reason": null, "requester": "", @@ -225,17 +225,17 @@ Object { }, ], "id": "09f39e17-ca23-4905-9ab3-f3649c4e3162", - "informant": Object { + "informant": { "_fhirID": null, "_fhirIDPatient": "cd5693ed-dd33-4c3a-a9fc-7479b132a4ea", - "address": Array [ - Object { + "address": [ + { "city": "South Jamelmouth", "country": "FAR", "district": "e66643ac-9ea9-4314-b842-f4fb3ad9e83a", "districtName": "Ibombo", "from": null, - "line": Array [ + "line": [ "12", "Usual Street", "Usual Residental Area", @@ -249,7 +249,7 @@ Object { "", "URBAN", ], - "lineName": Array [ + "lineName": [ "12", "Usual Street", "Usual Residental Area", @@ -278,7 +278,7 @@ Object { "ageOfIndividualInYears": null, "birthDate": "2003-07-11", "dateOfMarriage": "2021-07-11", - "deceased": Object { + "deceased": { "deathDate": null, "deceased": null, }, @@ -287,8 +287,8 @@ Object { "exactDateOfBirthUnknown": null, "gender": null, "id": "a0fd7881-33e6-4751-a346-78f820aa3dbb", - "identifier": Array [ - Object { + "identifier": [ + { "fieldsModifiedByIdentity": null, "id": "2253499797", "otherType": null, @@ -297,8 +297,8 @@ Object { ], "maritalStatus": "MARRIED", "multipleBirth": 2, - "name": Array [ - Object { + "name": [ + { "familyName": "Baumbach", "firstNames": "Sophia", "marriedLastName": null, @@ -306,7 +306,7 @@ Object { "use": "en", }, ], - "nationality": Array [ + "nationality": [ "FAR", ], "occupation": "Farmer", @@ -317,16 +317,16 @@ Object { "telecom": null, }, "lastPreviousLiveBirth": null, - "mother": Object { + "mother": { "_fhirID": null, - "address": Array [ - Object { + "address": [ + { "city": "South Jamelmouth", "country": "FAR", "district": "e66643ac-9ea9-4314-b842-f4fb3ad9e83a", "districtName": "Ibombo", "from": null, - "line": Array [ + "line": [ "12", "Usual Street", "Usual Residental Area", @@ -340,7 +340,7 @@ Object { "", "URBAN", ], - "lineName": Array [ + "lineName": [ "12", "Usual Street", "Usual Residental Area", @@ -368,7 +368,7 @@ Object { "ageOfIndividualInYears": null, "birthDate": "2003-07-11", "dateOfMarriage": "2021-07-11", - "deceased": Object { + "deceased": { "deathDate": null, "deceased": null, }, @@ -377,8 +377,8 @@ Object { "exactDateOfBirthUnknown": null, "gender": null, "id": "cd5693ed-dd33-4c3a-a9fc-7479b132a4ea", - "identifier": Array [ - Object { + "identifier": [ + { "fieldsModifiedByIdentity": null, "id": "2253499797", "otherType": null, @@ -387,8 +387,8 @@ Object { ], "maritalStatus": "MARRIED", "multipleBirth": 2, - "name": Array [ - Object { + "name": [ + { "familyName": "Baumbach", "firstNames": "Sophia", "marriedLastName": null, @@ -396,14 +396,14 @@ Object { "use": "en", }, ], - "nationality": Array [ + "nationality": [ "FAR", ], "occupation": "Farmer", "photo": null, "reasonNotApplying": null, - "telecom": Array [ - Object { + "telecom": [ + { "system": "phone", "use": null, "value": "+260711384538", @@ -412,9 +412,9 @@ Object { }, "otherAttendantAtBirth": null, "questionnaire": null, - "registration": Object { + "registration": { "_fhirID": null, - "assignment": Object { + "assignment": { "avatarURL": "https://eu.ui-avatars.com/api/?background=DEE5F2&color=222&name=Kennedy Mweene", "firstName": "Kennedy", "lastName": "Mweene", @@ -424,7 +424,7 @@ Object { "attachments": null, "book": null, "brideSignature": null, - "certificates": Array [ + "certificates": [ null, ], "contact": "MOTHER", @@ -442,11 +442,11 @@ Object { "page": null, "paperFormID": null, "registrationNumber": "2023B3VUXES", - "status": Array [ - Object { + "status": [ + { "comments": null, "id": "358c0c75-9855-4812-b560-c1b5fbf48e5a", - "location": Object { + "location": { "_fhirID": null, "address": null, "altitude": null, @@ -461,7 +461,7 @@ Object { "telecom": null, "type": "ADMIN_STRUCTURE", }, - "office": Object { + "office": { "_fhirID": null, "address": null, "altitude": null, @@ -493,13 +493,13 @@ Object { `; exports[`running a full aggregated death FHIR bundle through resolvers produces a DeathRegistration object 1`] = ` -Object { - "fetchDeathRegistration": Object { - "_fhirIDMap": Object { +{ + "fetchDeathRegistration": { + "_fhirIDMap": { "composition": "a959c616-934a-4139-a123-37bb4a1be39e", "encounter": "e668f0dc-aacd-45be-bd5f-2a81c3161593", "eventLocation": "4ba43b39-547b-41a8-8af1-c515786f36e5", - "observation": Object { + "observation": { "causeOfDeath": "3cae74a3-042c-4faf-9dde-8b716d094033", "causeOfDeathEstablished": "fb98ff5b-3aa1-40c2-87bf-4bd6df091dd2", "causeOfDeathMethod": "ff9a538b-c551-4edc-9631-fa2169a37f20", @@ -515,16 +515,16 @@ Object { "causeOfDeathMethod": "PHYSICIAN", "createdAt": "2023-08-16T06:55:19.000Z", "deathDescription": null, - "deceased": Object { + "deceased": { "_fhirID": null, - "address": Array [ - Object { + "address": [ + { "city": "Rudyboro", "country": "FAR", "district": "e66643ac-9ea9-4314-b842-f4fb3ad9e83a", "districtName": "Ibombo", "from": null, - "line": Array [ + "line": [ "44444 Predovic Mount", "87740", "URBAN", @@ -532,7 +532,7 @@ Object { "", "URBAN", ], - "lineName": Array [ + "lineName": [ "44444 Predovic Mount", "87740", "URBAN", @@ -554,7 +554,7 @@ Object { "ageOfIndividualInYears": null, "birthDate": "1948-07-24", "dateOfMarriage": null, - "deceased": Object { + "deceased": { "deathDate": "2023-07-24", "deceased": null, }, @@ -563,20 +563,20 @@ Object { "exactDateOfBirthUnknown": null, "gender": "female", "id": "d55283fe-b5bc-497d-86f3-5370957b0642", - "identifier": Array [ - Object { + "identifier": [ + { "fieldsModifiedByIdentity": null, "id": "8360781537", "otherType": null, "type": "NATIONAL_ID", }, - Object { + { "fieldsModifiedByIdentity": null, "id": "565195261", "otherType": null, "type": "SOCIAL_SECURITY_NO", }, - Object { + { "fieldsModifiedByIdentity": null, "id": "2023DL1W8FV", "otherType": null, @@ -585,8 +585,8 @@ Object { ], "maritalStatus": "MARRIED", "multipleBirth": null, - "name": Array [ - Object { + "name": [ + { "familyName": "Pacocha", "firstNames": "Zack", "marriedLastName": null, @@ -594,7 +594,7 @@ Object { "use": "en", }, ], - "nationality": Array [ + "nationality": [ "FAR", ], "occupation": null, @@ -602,7 +602,7 @@ Object { "reasonNotApplying": null, "telecom": null, }, - "eventLocation": Object { + "eventLocation": { "_fhirID": null, "address": null, "altitude": null, @@ -617,14 +617,14 @@ Object { "telecom": null, "type": "HEALTH_FACILITY", }, - "father": Object { + "father": { "_fhirID": null, "address": null, "age": null, "ageOfIndividualInYears": null, "birthDate": null, "dateOfMarriage": null, - "deceased": Object { + "deceased": { "deathDate": null, "deceased": null, }, @@ -636,8 +636,8 @@ Object { "identifier": null, "maritalStatus": null, "multipleBirth": null, - "name": Array [ - Object { + "name": [ + { "familyName": "Pacocha", "firstNames": "", "marriedLastName": null, @@ -652,17 +652,17 @@ Object { "telecom": null, }, "femaleDependentsOfDeceased": 4, - "history": Array [ - Object { - "certificates": Array [], - "comments": Array [], + "history": [ + { + "certificates": [], + "comments": [], "date": "2023-09-22T11:52:48.611+00:00", "dhis2Notification": false, "duplicateOf": null, "hasShowedVerifiedDocument": false, - "input": Array [], + "input": [], "ipAddress": null, - "location": Object { + "location": { "_fhirID": null, "address": null, "altitude": null, @@ -679,7 +679,7 @@ Object { }, "noSupportingDocumentationRequired": false, "note": "", - "office": Object { + "office": { "_fhirID": null, "address": null, "altitude": null, @@ -695,7 +695,7 @@ Object { "type": "CRVS_OFFICE", }, "otherReason": "", - "output": Array [], + "output": [], "payment": null, "reason": null, "requester": "", @@ -707,17 +707,17 @@ Object { }, ], "id": "a959c616-934a-4139-a123-37bb4a1be39e", - "informant": Object { + "informant": { "_fhirID": null, "_fhirIDPatient": "9fbbb561-dd3c-4b9f-8765-829a4c75493e", - "address": Array [ - Object { + "address": [ + { "city": "New Julio", "country": "FAR", "district": "e66643ac-9ea9-4314-b842-f4fb3ad9e83a", "districtName": "Ibombo", "from": null, - "line": Array [ + "line": [ "817 Avis Point", "06074", "URBAN", @@ -725,7 +725,7 @@ Object { "", "URBAN", ], - "lineName": Array [ + "lineName": [ "817 Avis Point", "06074", "URBAN", @@ -748,7 +748,7 @@ Object { "ageOfIndividualInYears": null, "birthDate": "2003-08-16", "dateOfMarriage": null, - "deceased": Object { + "deceased": { "deathDate": null, "deceased": null, }, @@ -757,8 +757,8 @@ Object { "exactDateOfBirthUnknown": null, "gender": null, "id": "7106d752-1e34-47fe-8726-a9fd11042a4d", - "identifier": Array [ - Object { + "identifier": [ + { "fieldsModifiedByIdentity": null, "id": "2464716794", "otherType": null, @@ -767,8 +767,8 @@ Object { ], "maritalStatus": null, "multipleBirth": null, - "name": Array [ - Object { + "name": [ + { "familyName": "Pacocha", "firstNames": "Frank", "marriedLastName": null, @@ -776,7 +776,7 @@ Object { "use": "en", }, ], - "nationality": Array [ + "nationality": [ "FAR", ], "occupation": "consultant", @@ -789,14 +789,14 @@ Object { "maleDependentsOfDeceased": 3, "mannerOfDeath": "NATURAL_CAUSES", "medicalPractitioner": null, - "mother": Object { + "mother": { "_fhirID": null, "address": null, "age": null, "ageOfIndividualInYears": null, "birthDate": null, "dateOfMarriage": null, - "deceased": Object { + "deceased": { "deathDate": null, "deceased": null, }, @@ -808,8 +808,8 @@ Object { "identifier": null, "maritalStatus": null, "multipleBirth": null, - "name": Array [ - Object { + "name": [ + { "familyName": "Pacocha", "firstNames": "", "marriedLastName": null, @@ -824,11 +824,11 @@ Object { "telecom": null, }, "questionnaire": null, - "registration": Object { + "registration": { "_fhirID": null, "assignment": null, - "attachments": Array [ - Object { + "attachments": [ + { "_fhirID": null, "contentType": "image/png", "createdAt": null, @@ -842,7 +842,7 @@ Object { "type": "OTHER", "uri": "/ocrvs/d40e904b-53ff-4639-bdcf-a2ba8fb236f5.png", }, - Object { + { "_fhirID": null, "contentType": "image/png", "createdAt": null, @@ -859,7 +859,7 @@ Object { ], "book": null, "brideSignature": null, - "certificates": Array [], + "certificates": [], "contact": "SPOUSE", "contactEmail": "Frank24@gmail.com", "contactPhoneNumber": "+260734085893", @@ -875,11 +875,11 @@ Object { "page": null, "paperFormID": null, "registrationNumber": "2023DL1W8FV", - "status": Array [ - Object { + "status": [ + { "comments": null, "id": "b1a6925a-47ae-431e-8f61-4cd0929e8518", - "location": Object { + "location": { "_fhirID": null, "address": null, "altitude": null, @@ -894,7 +894,7 @@ Object { "telecom": null, "type": "ADMIN_STRUCTURE", }, - "office": Object { + "office": { "_fhirID": null, "address": null, "altitude": null, @@ -926,27 +926,27 @@ Object { `; exports[`running a full aggregated marriage FHIR bundle through resolvers produces a MarriageRegistration object 1`] = ` -Object { - "fetchMarriageRegistration": Object { - "_fhirIDMap": Object { +{ + "fetchMarriageRegistration": { + "_fhirIDMap": { "composition": "b2e4d436-d7fb-4b0f-9674-628b5af8f42e", "encounter": "669cb7d8-5963-4b49-b647-7463d9e135b5", "eventLocation": "461a4ba8-5592-4b1a-a30b-747150a01623", - "observation": Object { + "observation": { "typeOfMarriage": "c01c802f-e5fe-46d8-b35c-deffe87a6fd9", }, "questionnaireResponse": undefined, }, - "bride": Object { + "bride": { "_fhirID": null, - "address": Array [ - Object { + "address": [ + { "city": null, "country": "FAR", "district": "e66643ac-9ea9-4314-b842-f4fb3ad9e83a", "districtName": "Ibombo", "from": null, - "line": Array [ + "line": [ "", "", "", @@ -963,7 +963,7 @@ Object { "", "", ], - "lineName": Array [ + "lineName": [ "", "", "", @@ -994,7 +994,7 @@ Object { "ageOfIndividualInYears": null, "birthDate": "2001-02-22", "dateOfMarriage": "2021-02-24", - "deceased": Object { + "deceased": { "deathDate": null, "deceased": null, }, @@ -1003,14 +1003,14 @@ Object { "exactDateOfBirthUnknown": null, "gender": null, "id": "5b979fe9-eaa3-4c4e-87ab-ee48ea1abb16", - "identifier": Array [ - Object { + "identifier": [ + { "fieldsModifiedByIdentity": null, "id": "2323444434", "otherType": null, "type": "NATIONAL_ID", }, - Object { + { "fieldsModifiedByIdentity": null, "id": "2023MTNJUSI", "otherType": null, @@ -1019,8 +1019,8 @@ Object { ], "maritalStatus": null, "multipleBirth": null, - "name": Array [ - Object { + "name": [ + { "familyName": "test", "firstNames": "genie", "marriedLastName": null, @@ -1028,7 +1028,7 @@ Object { "use": "en", }, ], - "nationality": Array [ + "nationality": [ "FAR", ], "occupation": null, @@ -1037,15 +1037,15 @@ Object { "telecom": null, }, "createdAt": "2023-09-22T08:54:48.780Z", - "eventLocation": Object { + "eventLocation": { "_fhirID": null, - "address": Object { + "address": { "city": "", "country": "FAR", "district": "bbee20e1-68c4-4e0c-a0cd-44336341e005", "districtName": null, "from": null, - "line": Array [ + "line": [ "", "", "", @@ -1062,7 +1062,7 @@ Object { "", "", ], - "lineName": Array [ + "lineName": [ "", "", "", @@ -1100,16 +1100,16 @@ Object { "telecom": null, "type": null, }, - "groom": Object { + "groom": { "_fhirID": null, - "address": Array [ - Object { + "address": [ + { "city": null, "country": "FAR", "district": "e66643ac-9ea9-4314-b842-f4fb3ad9e83a", "districtName": "Ibombo", "from": null, - "line": Array [ + "line": [ "", "", "", @@ -1126,7 +1126,7 @@ Object { "", "", ], - "lineName": Array [ + "lineName": [ "", "", "", @@ -1157,7 +1157,7 @@ Object { "ageOfIndividualInYears": null, "birthDate": "1999-11-13", "dateOfMarriage": "2021-02-24", - "deceased": Object { + "deceased": { "deathDate": null, "deceased": null, }, @@ -1166,14 +1166,14 @@ Object { "exactDateOfBirthUnknown": null, "gender": null, "id": "1a5ad72e-9241-4358-a937-861cfdf44f4d", - "identifier": Array [ - Object { + "identifier": [ + { "fieldsModifiedByIdentity": null, "id": "8675646566", "otherType": null, "type": "NATIONAL_ID", }, - Object { + { "fieldsModifiedByIdentity": null, "id": "2023MTNJUSI", "otherType": null, @@ -1182,8 +1182,8 @@ Object { ], "maritalStatus": null, "multipleBirth": null, - "name": Array [ - Object { + "name": [ + { "familyName": "test", "firstNames": "george", "marriedLastName": null, @@ -1191,7 +1191,7 @@ Object { "use": "en", }, ], - "nationality": Array [ + "nationality": [ "FAR", ], "occupation": null, @@ -1199,17 +1199,17 @@ Object { "reasonNotApplying": null, "telecom": null, }, - "history": Array [ - Object { - "certificates": Array [], - "comments": Array [], + "history": [ + { + "certificates": [], + "comments": [], "date": "2023-09-22T08:54:57.825+00:00", "dhis2Notification": false, "duplicateOf": null, "hasShowedVerifiedDocument": false, - "input": Array [], + "input": [], "ipAddress": null, - "location": Object { + "location": { "_fhirID": null, "address": null, "altitude": null, @@ -1226,7 +1226,7 @@ Object { }, "noSupportingDocumentationRequired": false, "note": "", - "office": Object { + "office": { "_fhirID": null, "address": null, "altitude": null, @@ -1242,7 +1242,7 @@ Object { "type": "CRVS_OFFICE", }, "otherReason": "", - "output": Array [], + "output": [], "payment": null, "reason": null, "requester": "", @@ -1254,17 +1254,17 @@ Object { }, ], "id": "b2e4d436-d7fb-4b0f-9674-628b5af8f42e", - "informant": Object { + "informant": { "_fhirID": null, "_fhirIDPatient": "1a5ad72e-9241-4358-a937-861cfdf44f4d", - "address": Array [ - Object { + "address": [ + { "city": null, "country": "FAR", "district": "e66643ac-9ea9-4314-b842-f4fb3ad9e83a", "districtName": "Ibombo", "from": null, - "line": Array [ + "line": [ "", "", "", @@ -1281,7 +1281,7 @@ Object { "", "", ], - "lineName": Array [ + "lineName": [ "", "", "", @@ -1313,7 +1313,7 @@ Object { "ageOfIndividualInYears": null, "birthDate": "1999-11-13", "dateOfMarriage": "2021-02-24", - "deceased": Object { + "deceased": { "deathDate": null, "deceased": null, }, @@ -1322,14 +1322,14 @@ Object { "exactDateOfBirthUnknown": null, "gender": null, "id": "4065eb20-d02b-48d7-a783-5d7e452c7a7d", - "identifier": Array [ - Object { + "identifier": [ + { "fieldsModifiedByIdentity": null, "id": "8675646566", "otherType": null, "type": "NATIONAL_ID", }, - Object { + { "fieldsModifiedByIdentity": null, "id": "2023MTNJUSI", "otherType": null, @@ -1338,8 +1338,8 @@ Object { ], "maritalStatus": null, "multipleBirth": null, - "name": Array [ - Object { + "name": [ + { "familyName": "test", "firstNames": "george", "marriedLastName": null, @@ -1347,7 +1347,7 @@ Object { "use": "en", }, ], - "nationality": Array [ + "nationality": [ "FAR", ], "occupation": null, @@ -1358,9 +1358,9 @@ Object { "telecom": null, }, "questionnaire": null, - "registration": Object { + "registration": { "_fhirID": null, - "assignment": Object { + "assignment": { "avatarURL": "https://eu.ui-avatars.com/api/?background=DEE5F2&color=222&name=Kennedy Mweene", "firstName": "Kennedy", "lastName": "Mweene", @@ -1370,7 +1370,7 @@ Object { "attachments": null, "book": null, "brideSignature": "/mock-presigned-url", - "certificates": Array [], + "certificates": [], "contact": "GROOM", "contactEmail": "aaa@gmail.com", "contactPhoneNumber": null, @@ -1386,11 +1386,11 @@ Object { "page": null, "paperFormID": null, "registrationNumber": "2023MTNJUSI", - "status": Array [ - Object { + "status": [ + { "comments": null, "id": "6cc01269-6b36-4aa5-9bb0-21944d685e42", - "location": Object { + "location": { "_fhirID": null, "address": null, "altitude": null, @@ -1405,7 +1405,7 @@ Object { "telecom": null, "type": "ADMIN_STRUCTURE", }, - "office": Object { + "office": { "_fhirID": null, "address": null, "altitude": null, @@ -1432,7 +1432,7 @@ Object { }, "typeOfMarriage": "MONOGAMY", "updatedAt": null, - "witnessOne": Object { + "witnessOne": { "_fhirID": null, "_fhirIDPatient": "4512feb1-a96d-40b4-bfdc-7f437993bfa8", "address": null, @@ -1441,7 +1441,7 @@ Object { "ageOfIndividualInYears": null, "birthDate": null, "dateOfMarriage": null, - "deceased": Object { + "deceased": { "deathDate": null, "deceased": null, }, @@ -1453,8 +1453,8 @@ Object { "identifier": null, "maritalStatus": null, "multipleBirth": null, - "name": Array [ - Object { + "name": [ + { "familyName": "one", "firstNames": "wit", "marriedLastName": null, @@ -1470,7 +1470,7 @@ Object { "relationship": "HEAD_OF_GROOM_FAMILY", "telecom": null, }, - "witnessTwo": Object { + "witnessTwo": { "_fhirID": null, "_fhirIDPatient": "93de5304-f816-493e-968a-86c3a3d5ee7a", "address": null, @@ -1479,7 +1479,7 @@ Object { "ageOfIndividualInYears": null, "birthDate": null, "dateOfMarriage": null, - "deceased": Object { + "deceased": { "deathDate": null, "deceased": null, }, @@ -1491,8 +1491,8 @@ Object { "identifier": null, "maritalStatus": null, "multipleBirth": null, - "name": Array [ - Object { + "name": [ + { "familyName": "two", "firstNames": "wit", "marriedLastName": null, diff --git a/packages/gateway/src/features/registration/root-resolvers.test.ts b/packages/gateway/src/features/registration/root-resolvers.test.ts index a9370c03ab3..7e5ff589238 100644 --- a/packages/gateway/src/features/registration/root-resolvers.test.ts +++ b/packages/gateway/src/features/registration/root-resolvers.test.ts @@ -13,13 +13,13 @@ import { mockTaskBundle } from '@gateway/utils/testUtils' import { DOWNLOADED_EXTENSION_URL } from '@opencrvs/commons/types' import { readFileSync } from 'fs' import * as fetchAny from 'jest-fetch-mock' -import * as jwt from 'jsonwebtoken' +import { sign } from 'jsonwebtoken' import { UserInputError } from 'apollo-server-hapi' const fetch = fetchAny as fetchAny.FetchMock const resolvers = appResolvers as any -const registerCertifyToken = jwt.sign( +const registerCertifyToken = sign( { scope: ['register', 'certify'] }, readFileSync('./test/cert.key'), { @@ -30,7 +30,7 @@ const registerCertifyToken = jwt.sign( } ) -const validateToken = jwt.sign( +const validateToken = sign( { scope: ['validate'] }, readFileSync('./test/cert.key'), { @@ -41,7 +41,7 @@ const validateToken = jwt.sign( } ) -const declareToken = jwt.sign( +const declareToken = sign( { scope: ['declare'] }, readFileSync('./test/cert.key'), { @@ -52,7 +52,7 @@ const declareToken = jwt.sign( } ) -const certifyToken = jwt.sign( +const certifyToken = sign( { scope: ['certify'] }, readFileSync('./test/cert.key'), { @@ -62,7 +62,7 @@ const certifyToken = jwt.sign( } ) -const sysAdminToken = jwt.sign( +const sysAdminToken = sign( { scope: ['sysadmin'] }, readFileSync('./test/cert.key'), { diff --git a/packages/gateway/src/features/registration/type-resolvers.ts b/packages/gateway/src/features/registration/type-resolvers.ts index adea50cede8..a39433442d7 100644 --- a/packages/gateway/src/features/registration/type-resolvers.ts +++ b/packages/gateway/src/features/registration/type-resolvers.ts @@ -95,7 +95,7 @@ import { import { GQLQuestionnaireQuestion, GQLResolver } from '@gateway/graphql/schema' import { Context } from '@gateway/graphql/context' -import * as validateUUID from 'uuid-validate' +import validateUUID from 'uuid-validate' import { fetchTaskByCompositionIdFromHearth } from '@gateway/features/fhir/service' import { TaskInput } from 'fhir/r3' diff --git a/packages/gateway/src/features/user/utils/index.ts b/packages/gateway/src/features/user/utils/index.ts index dc9fd5c513b..d49f41ad60a 100644 --- a/packages/gateway/src/features/user/utils/index.ts +++ b/packages/gateway/src/features/user/utils/index.ts @@ -14,7 +14,7 @@ import { ISystemModelData, IUserModelData } from '@gateway/features/user/type-resolvers' -import * as decode from 'jwt-decode' +import decode from 'jwt-decode' import fetch from '@gateway/fetch' import { Scope } from '@opencrvs/commons/authentication' diff --git a/packages/gateway/src/rate-limit.test.ts b/packages/gateway/src/rate-limit.test.ts index c92c4178706..b9284765959 100644 --- a/packages/gateway/src/rate-limit.test.ts +++ b/packages/gateway/src/rate-limit.test.ts @@ -22,6 +22,7 @@ import { import { StartedTestContainer } from 'testcontainers' import { savedAdministrativeLocation } from '@opencrvs/commons/fixtures' import { createServer } from '@gateway/server' +import { UUID } from '@opencrvs/commons' const fetch = fetchAny as any const resolvers = rootResolvers as any @@ -226,7 +227,9 @@ describe('Rate limit', () => { const resolverCalls = Array.from({ length: 20 }, async () => { fetch.mockResponseOnce( JSON.stringify([ - savedAdministrativeLocation({ partOf: { reference: 'Location/1' } }) + savedAdministrativeLocation({ + partOf: { reference: 'Location/1' as `Location/${UUID}` } + }) ]) ) await locationResolvers.Query!.isLeafLevelLocation( diff --git a/packages/gateway/test/setupJest.ts b/packages/gateway/test/setupJest.ts index 001598ad33e..f25f932fab8 100644 --- a/packages/gateway/test/setupJest.ts +++ b/packages/gateway/test/setupJest.ts @@ -9,11 +9,9 @@ * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. */ import { join } from 'path' -import * as fetch from 'jest-fetch-mock' +import fetch from 'jest-fetch-mock' -const f = jest.requireActual('node-fetch') - -jest.setMock('node-fetch', { default: fetch, Headers: f.Headers }) -jest.setMock('@opencrvs/commons/monitoring') +jest.setMock('node-fetch', fetch) +jest.setMock('@opencrvs/commons/monitoring', {}) process.env.CERT_PUBLIC_KEY_PATH = join(__dirname, './cert.key.pub') diff --git a/packages/gateway/tsconfig.json b/packages/gateway/tsconfig.json index 753660361d6..7589b6bf40d 100644 --- a/packages/gateway/tsconfig.json +++ b/packages/gateway/tsconfig.json @@ -6,7 +6,7 @@ "@gateway/*": ["./*"] }, "target": "es6", - "module": "commonjs", + "module": "node16", "outDir": "build/dist", "sourceMap": true, "moduleResolution": "node16", @@ -19,7 +19,9 @@ "strictNullChecks": true, "allowSyntheticDefaultImports": true, "noUnusedLocals": true, - "types": ["fhir", "jest"] + "types": ["fhir", "jest"], + "esModuleInterop": true, + "allowJs": true }, "include": ["src/**/*.ts", "typings"], "exclude": ["node_modules", "build", "scripts", "acceptance-tests"] diff --git a/packages/login/package.json b/packages/login/package.json index dfe6b45e409..45e2f5e87fd 100644 --- a/packages/login/package.json +++ b/packages/login/package.json @@ -29,6 +29,7 @@ "focus-visible": "^5.0.2", "google-libphonenumber": "^3.2.32", "history": "^4.7.2", + "jsdom": "16.7.0", "localforage": "^1.7.2", "lodash": "^4.17.10", "lodash-es": "^4.17.0", @@ -107,7 +108,7 @@ "stylelint-config-styled-components": "^0.1.1", "stylelint-processor-styled-components": "^1.10.0", "ts-node": "^6.1.1", - "typescript": "4.9.5", + "typescript": "5.6.3", "vite": "^5.0.0", "vite-plugin-pwa": "^0.20.0", "vite-plugin-svgr": "^0.6.0", diff --git a/packages/metrics/package.json b/packages/metrics/package.json index 7803e111a47..c83d0414497 100644 --- a/packages/metrics/package.json +++ b/packages/metrics/package.json @@ -38,7 +38,7 @@ "node-fetch": "^2.6.7", "pino": "^7.0.0", "tsconfig-paths": "^3.13.0", - "typescript": "4.9.5" + "typescript": "5.6.3" }, "devDependencies": { "@types/archiver": "^3.0.0", @@ -51,7 +51,7 @@ "@types/jwt-decode": "^2.2.1", "@types/node-fetch": "^2.5.12", "cross-env": "^7.0.0", - "jest": "27.5.1", + "jest": "29.7.0", "jest-fetch-mock": "^2.1.2", "eslint": "^7.11.0", "@typescript-eslint/eslint-plugin": "^4.5.0", @@ -62,7 +62,7 @@ "mockingoose": "^2.15.2", "nodemon": "^3.0.0", "prettier": "2.8.8", - "ts-jest": "27.1.4", + "ts-jest": "29.2.5", "ts-node": "^6.1.1" }, "lint-staged": { @@ -92,8 +92,7 @@ "" ], "moduleNameMapper": { - "@metrics/(.*)": "/src/$1", - "@opencrvs/commons/(.*)": "@opencrvs/commons/build/dist/$1" + "@metrics/(.*)": "/src/$1" }, "coverageReporters": [ "json", diff --git a/packages/metrics/src/features/declarationsStarted/handler.test.ts b/packages/metrics/src/features/declarationsStarted/handler.test.ts index 7afdbd9284e..cfd640a0380 100644 --- a/packages/metrics/src/features/declarationsStarted/handler.test.ts +++ b/packages/metrics/src/features/declarationsStarted/handler.test.ts @@ -97,7 +97,8 @@ describe('verify declarationsStarted', () => { fixtures.savedLocation({ id: 'uuid2' as UUID, partOf: { - reference: 'Location/1490d3dd-71a9-47e8-b143-f9fc64f71294' + reference: + 'Location/1490d3dd-71a9-47e8-b143-f9fc64f71294' as `Location/${UUID}` } }) ]) @@ -122,7 +123,7 @@ describe('verify declarationsStarted', () => { const res = await service.fetchLocationWiseDeclarationsStarted( '1552469068679', '1554814894419', - 'Location/1490d3dd-71a9-47e8-b143-f9fc64f71294' + 'Location/1490d3dd-71a9-47e8-b143-f9fc64f71294' as `Location/${UUID}` ) expect(res).toEqual({ diff --git a/packages/metrics/src/features/declarationsStarted/handler.ts b/packages/metrics/src/features/declarationsStarted/handler.ts index 6c2eb7f29f5..08610325076 100644 --- a/packages/metrics/src/features/declarationsStarted/handler.ts +++ b/packages/metrics/src/features/declarationsStarted/handler.ts @@ -21,6 +21,7 @@ import { getAvgTimeSpentOnAppByPractitioners } from '@metrics/features/declarationsStarted/service' import { EVENT_TYPE } from '@metrics/features/metrics/utils' +import { UUID } from '@opencrvs/commons' export async function declarationsStartedHandler( request: Hapi.Request, @@ -69,7 +70,7 @@ export async function declarationStartedMetricsByPractitionersHandler( ) { const { timeStart, timeEnd, locationId, practitionerIds, event } = request.payload as IDeclarationStartedMetricsPayload - const locId = `Location/${locationId}` as const + const locId = `Location/${locationId}` as `Location/${UUID}` let declarationStartedMetricsByPractitioners: IDeclarationStartedMetricsByPractitioner[] = [] try { diff --git a/packages/metrics/src/features/export/handler.ts b/packages/metrics/src/features/export/handler.ts index 64c46be57fc..41a2bb91a79 100644 --- a/packages/metrics/src/features/export/handler.ts +++ b/packages/metrics/src/features/export/handler.ts @@ -11,9 +11,9 @@ import * as Hapi from '@hapi/hapi' import { query, getCSV } from '@metrics/influxdb/client' -import * as archiver from 'archiver' +import archiver from 'archiver' import { metricsHandler } from '@metrics/features/metrics/handler' -import * as stringify from 'csv-stringify' +import stringify from 'csv-stringify' import { fetchLocation } from '@metrics/api' import { EVENT } from '@metrics/features/metrics/constants' //import { EXPECTED_BIRTH_REGISTRATION_IN_DAYS } from '@metrics/constants' diff --git a/packages/metrics/src/features/getTimeLogged/handler.test.ts b/packages/metrics/src/features/getTimeLogged/handler.test.ts index f405afbde59..2daaf700c70 100644 --- a/packages/metrics/src/features/getTimeLogged/handler.test.ts +++ b/packages/metrics/src/features/getTimeLogged/handler.test.ts @@ -104,7 +104,8 @@ describe('verify time logged by practitioner handler', () => { fixtures.savedLocation({ id: 'uuid2' as UUID, partOf: { - reference: 'Location/94429795-0a09-4de8-8e1e-dssdr323' + reference: + 'Location/94429795-0a09-4de8-8e1e-dssdr323' as `Location/${UUID}` } }) ] diff --git a/packages/metrics/src/features/metrics/metricsGenerator.ts b/packages/metrics/src/features/metrics/metricsGenerator.ts index 332abfc7fb1..d7743714d4b 100644 --- a/packages/metrics/src/features/metrics/metricsGenerator.ts +++ b/packages/metrics/src/features/metrics/metricsGenerator.ts @@ -37,6 +37,7 @@ import { ResourceIdentifier, Location as FhirLocation } from '@opencrvs/commons/types' +import { UUID } from '@opencrvs/commons' interface IGroupedByGender { total: number gender: string @@ -116,18 +117,22 @@ interface IGenderBasisMetrics { total: number } -interface IGenderBasisPoint { - gender: string - over18: number - under18: number +interface ILocationPoint { locationLevel2?: string locationLevel3?: string locationLevel4?: string locationLevel5?: string } +interface IGenderBasisPoint extends ILocationPoint { + gender: string + over18: number + under18: number +} + type Payment = { total: number + [key: string]: any } export async function fetchCertificationPayments( @@ -433,7 +438,7 @@ export async function fetchKeyFigures( const keyFigures: IBirthKeyFigures[] = [] const queryLocationId = - `Location/${estimatedFigureForTargetDays.locationId}` as const + `Location/${estimatedFigureForTargetDays.locationId}` as `Location/${UUID}` const locationIds = await fetchLocationChildrenIds(queryLocationId) const [officeLocationInChildren, locationPlaceholders] = helpers.in( locationIds, @@ -1197,10 +1202,16 @@ export async function fetchRegistrationsGroupByTime( .map((item) => { const obj: Partial = {} keys.forEach((key, i) => { - // item[i+5] to ignore the first 5 values of json & count from index 5 - obj[key] = item[i + 5] - if (key === 'total') { - obj[key] = Number(item[i + 5]) + const value = item[i + 5] + switch (key) { + case 'total': + obj.total = Number(value) + break + case 'time': + case 'eventLocationType': + case 'timeLabel': + obj[key] = value as string + break } }) return obj as IMetricsTotalGroupByTime @@ -1217,7 +1228,8 @@ function populateGenderBasisMetrics( points.forEach((point: IGenderBasisPoint) => { const metrics = metricsArray.find( - (element) => element.location === point[locationLevel] + (element) => + element.location === point[locationLevel as keyof ILocationPoint] ) const femaleOver18 = point.gender === 'female' @@ -1244,7 +1256,7 @@ function populateGenderBasisMetrics( if (!metrics) { metricsArray.push({ - location: point[locationLevel], + location: point[locationLevel as keyof ILocationPoint] || '', femaleOver18: femaleOver18, maleOver18: maleOver18, maleUnder18: maleUnder18, diff --git a/packages/metrics/src/features/monthWiseEventEstimations/handler.test.ts b/packages/metrics/src/features/monthWiseEventEstimations/handler.test.ts index 10d1ee497a1..9fec6508a49 100644 --- a/packages/metrics/src/features/monthWiseEventEstimations/handler.test.ts +++ b/packages/metrics/src/features/monthWiseEventEstimations/handler.test.ts @@ -56,7 +56,8 @@ describe('verify monthWiseEventEstimations handler', () => { fixtures.savedLocation({ id: 'uuid2' as UUID, partOf: { - reference: 'Location/1490d3dd-71a9-47e8-b143-f9fc64f71294' + reference: + 'Location/1490d3dd-71a9-47e8-b143-f9fc64f71294' as `Location/${UUID}` } }) ]) diff --git a/packages/metrics/src/features/registration/__snapshots__/handler.test.ts.snap b/packages/metrics/src/features/registration/__snapshots__/handler.test.ts.snap index 0fab517b2e6..2a6827c9e75 100644 --- a/packages/metrics/src/features/registration/__snapshots__/handler.test.ts.snap +++ b/packages/metrics/src/features/registration/__snapshots__/handler.test.ts.snap @@ -1,15 +1,15 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`When an existing declaration is marked certified a birth declaration writes the declaration_event_duration to influxdb 1`] = ` -Object { - "fields": Object { +{ + "fields": { "compositionId": "1744fc19-95be-434b-8bc9-a76d6b81551b", "currentTaskId": "dcf1644e-362d-414f-b0cc-2b240eea8591", "durationInSeconds": 94381, "previousTaskId": "e172627c-8490-44da-a702-80a082f978f5", }, "measurement": "declaration_event_duration", - "tags": Object { + "tags": { "currentStatus": "CERTIFIED", "eventType": "BIRTH", "previousStatus": "REGISTERED", @@ -19,15 +19,15 @@ Object { `; exports[`When an existing declaration is marked certified a death declaration writes the delta between REGISTERED and CERTIFIED states to influxdb 1`] = ` -Object { - "fields": Object { +{ + "fields": { "compositionId": "62168b7e-7f80-4e2a-a7b0-1d33759c9d71", "currentTaskId": "75ba4bd8-009e-4a02-896c-148979dde09a", "durationInSeconds": 3564388, "previousTaskId": "e172627c-8490-44da-a702-80a082f978f5", }, "measurement": "declaration_event_duration", - "tags": Object { + "tags": { "currentStatus": "CERTIFIED", "eventType": "DEATH", "previousStatus": "REGISTERED", @@ -37,15 +37,15 @@ Object { `; exports[`When an existing declaration is marked certified writes the delta between REGISTERED and CERTIFIED states to influxdb 1`] = ` -Object { - "fields": Object { +{ + "fields": { "compositionId": "1744fc19-95be-434b-8bc9-a76d6b81551b", "currentTaskId": "dcf1644e-362d-414f-b0cc-2b240eea8591", "durationInSeconds": 94381, "previousTaskId": "e172627c-8490-44da-a702-80a082f978f5", }, "measurement": "declaration_event_duration", - "tags": Object { + "tags": { "currentStatus": "CERTIFIED", "eventType": "BIRTH", "previousStatus": "REGISTERED", @@ -55,15 +55,15 @@ Object { `; exports[`When an existing declaration is marked registered a death declaration writes the delta between REGISTERED and CERTIFIED states to influxdb 1`] = ` -Object { - "fields": Object { +{ + "fields": { "compositionId": "62168b7e-7f80-4e2a-a7b0-1d33759c9d71", "currentTaskId": "75ba4bd8-009e-4a02-896c-148979dde09a", "durationInSeconds": 3727875, "previousTaskId": "e172627c-8490-44da-a702-80a082f978f5", }, "measurement": "declaration_event_duration", - "tags": Object { + "tags": { "currentStatus": "REGISTERED", "eventType": "DEATH", "previousStatus": "DECLARED", @@ -73,15 +73,15 @@ Object { `; exports[`When an existing declaration is marked registered writes the delta between DECLARED and REGISTERED states to influxdb 1`] = ` -Object { - "fields": Object { +{ + "fields": { "compositionId": "80433e78-7042-4837-b888-a79c0181bf4e", "currentTaskId": "18ea2464-f843-45e2-93b1-8b026e0d93a4", "durationInSeconds": 170630, "previousTaskId": "e172627c-8490-44da-a702-80a082f978f5", }, "measurement": "declaration_event_duration", - "tags": Object { + "tags": { "currentStatus": "REGISTERED", "eventType": "BIRTH", "previousStatus": "DECLARED", @@ -91,15 +91,15 @@ Object { `; exports[`When an existing declaration is marked registered writes the delta between DECLARED and VALIDATED states to influxdb 1`] = ` -Object { - "fields": Object { +{ + "fields": { "compositionId": "80433e78-7042-4837-b888-a79c0181bf4e", "currentTaskId": "18ea2464-f843-45e2-93b1-8b026e0d93a4", "durationInSeconds": 170630, "previousTaskId": "e172627c-8490-44da-a702-80a082f978f5", }, "measurement": "declaration_event_duration", - "tags": Object { + "tags": { "currentStatus": "VALIDATED", "eventType": "BIRTH", "previousStatus": "DECLARED", @@ -109,15 +109,15 @@ Object { `; exports[`When an existing declaration is marked registered writes the delta between VALIDATED and REGISTERED states to influxdb 1`] = ` -Object { - "fields": Object { +{ + "fields": { "compositionId": "80433e78-7042-4837-b888-a79c0181bf4e", "currentTaskId": "18ea2464-f843-45e2-93b1-8b026e0d93a4", "durationInSeconds": 170630, "previousTaskId": "e172627c-8490-44da-a702-80a082f978f5", }, "measurement": "declaration_event_duration", - "tags": Object { + "tags": { "currentStatus": "REGISTERED", "eventType": "BIRTH", "previousStatus": "VALIDATED", @@ -127,15 +127,15 @@ Object { `; exports[`When an existing declaration is marked registered writes the delta between VALIDATED and WAITING_VALIDATION states to influxdb 1`] = ` -Object { - "fields": Object { +{ + "fields": { "compositionId": "80433e78-7042-4837-b888-a79c0181bf4e", "currentTaskId": "18ea2464-f843-45e2-93b1-8b026e0d93a4", "durationInSeconds": 170630, "previousTaskId": "e172627c-8490-44da-a702-80a082f978f5", }, "measurement": "declaration_event_duration", - "tags": Object { + "tags": { "currentStatus": "WAITING_VALIDATION", "eventType": "BIRTH", "previousStatus": "VALIDATED", @@ -145,12 +145,12 @@ Object { `; exports[`When an in-progress declaration is received writes the in complete field points to influxdb 1`] = ` -Object { - "fields": Object { +{ + "fields": { "compositionId": "b2fbb82c-a68d-4793-98e1-87484fc785c4", }, "measurement": "in_complete_fields", - "tags": Object { + "tags": { "eventType": "BIRTH", "missingFieldGroupId": "child-view-group", "missingFieldId": "placeOfBirth", @@ -163,12 +163,12 @@ Object { `; exports[`When an in-progress declaration is received writes the rejected points to influxdb 1`] = ` -Object { - "fields": Object { +{ + "fields": { "compositionId": "81278acf-6105-435e-b1c2-91619c8cf6e1", }, "measurement": "declarations_rejected", - "tags": Object { + "tags": { "eventType": "BIRTH", "officeLocation": "Location/2a520dc1-0a9a-48a1-a4b8-66f3075a9155", "startedBy": "4bb03541-116e-4ce2-8ea4-407f307f7579", diff --git a/packages/metrics/src/scripts/VSExportGenerator.ts b/packages/metrics/src/scripts/VSExportGenerator.ts index 0413ff0099f..12317a84465 100644 --- a/packages/metrics/src/scripts/VSExportGenerator.ts +++ b/packages/metrics/src/scripts/VSExportGenerator.ts @@ -48,12 +48,11 @@ interface IInformant extends IPatient { relationship: string } -const TITLE_MAP = { +const TITLE_MAP: { [key: string]: keyof IPatientComposition } = { 'Child details': 'child', 'Deceased details': 'deceased', [`Mother's details`]: 'mother', - [`Father's details`]: 'father', - [`Informant's details`]: 'informant' + [`Father's details`]: 'father' } type IBirthRow = { @@ -113,12 +112,15 @@ type IDeathRow = { informantState: string } -interface IFullComposition { - event: 'Birth' | 'Death' +interface IPatientComposition { deceased: IPatient child: IPatient father: IPatient mother: IPatient +} + +interface IFullComposition extends IPatientComposition { + event: 'Birth' | 'Death' informant: IInformant observations: IObservation officeLocation: string @@ -152,7 +154,7 @@ const OBSERVATION_CODE = { PRESENT_AT_BIRTH_REG: 'present-at-birth-reg' } -const EDUCATION_LEVEL_MAP = { +const EDUCATION_LEVEL_MAP: { [key: string]: string } = { PRIMARY_ISCED_1: 'Primary', POST_SECONDARY_ISCED_4: 'Secondary', FIRST_STAGE_TERTIARY_ISCED_5: 'Tertiary', diff --git a/packages/metrics/src/utils/authUtils.ts b/packages/metrics/src/utils/authUtils.ts index 6e7a703364a..09c52fbf5f5 100644 --- a/packages/metrics/src/utils/authUtils.ts +++ b/packages/metrics/src/utils/authUtils.ts @@ -8,7 +8,7 @@ * * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. */ -import * as decode from 'jwt-decode' +import decode = require('jwt-decode') export enum USER_SCOPE { DECLARE = 'declare', diff --git a/packages/metrics/tsconfig.json b/packages/metrics/tsconfig.json index 1d6eb14b8d8..ed19c3dc2b3 100644 --- a/packages/metrics/tsconfig.json +++ b/packages/metrics/tsconfig.json @@ -2,44 +2,25 @@ "compilerOptions": { "baseUrl": "./src", "paths": { - "@metrics/*": [ - "./*" - ] + "@metrics/*": ["./*"] }, "target": "es6", - "module": "commonjs", + "module": "node16", "outDir": "build/dist", "sourceMap": true, "allowSyntheticDefaultImports": true, "skipLibCheck": true, "moduleResolution": "node16", "rootDir": ".", - "lib": [ - "esnext.asynciterable", - "es6", - "es2017" - ], + "lib": ["esnext.asynciterable", "es6", "es2017"], "forceConsistentCasingInFileNames": true, "noImplicitReturns": true, "noImplicitThis": true, "noImplicitAny": true, "strictNullChecks": true, - "suppressImplicitAnyIndexErrors": true, "noUnusedLocals": true, - "types": [ - "fhir", - "jest" - ] + "types": ["fhir", "jest"] }, - "include": [ - "src/**/*.ts", - "scripts", - "typings" - ], - "exclude": [ - "node_modules", - "build", - "scripts", - "acceptance-tests" - ] + "include": ["src/**/*.ts", "scripts", "typings"], + "exclude": ["node_modules", "build", "scripts", "acceptance-tests"] } diff --git a/packages/migration/package.json b/packages/migration/package.json index d6adc3e205e..eb6bc114849 100644 --- a/packages/migration/package.json +++ b/packages/migration/package.json @@ -44,7 +44,7 @@ "mongodb": "^4.17.1", "prettier": "^2.5.0", "rimraf": "^5.0.0", - "typescript": "4.9.5" + "typescript": "5.6.3" }, "lint-staged": { "src/**/*.ts": [ diff --git a/packages/migration/tsconfig.json b/packages/migration/tsconfig.json index ec636545bdf..6192f632baf 100644 --- a/packages/migration/tsconfig.json +++ b/packages/migration/tsconfig.json @@ -7,7 +7,7 @@ "allowJs": true, "moduleResolution": "node16", "target": "esnext", - "module": "esnext", + "module": "node16", "esModuleInterop": true, "rootDir": ".", "outDir": "build/dist", diff --git a/packages/notification/extract-translations.sh b/packages/notification/extract-translations.sh index 66bc54d6b17..49408c3bf77 100755 --- a/packages/notification/extract-translations.sh +++ b/packages/notification/extract-translations.sh @@ -10,4 +10,4 @@ echo 'The Environment variable COUNTRY_CONFIG_PATH must be set in your Terminal, so we can check that your country configuration has all necessary translations. If you cd into your country configuration repo and run the command pwd, then this will display for you. Then run export COUNTRY_CONFIG_PATH= in this window and try to commit again please.. Currently:' echo $COUNTRY_CONFIG_PATH -yarn run ts-node -- --compiler-options='{"module": "commonjs"}' -r tsconfig-paths/register src/extract-translations.ts -- $COUNTRY_CONFIG_PATH +yarn run ts-node -- --compiler-options='{"module": "Node16"}' -r tsconfig-paths/register src/extract-translations.ts -- $COUNTRY_CONFIG_PATH diff --git a/packages/notification/package.json b/packages/notification/package.json index ab18ea69d83..0c580606925 100644 --- a/packages/notification/package.json +++ b/packages/notification/package.json @@ -35,7 +35,7 @@ "node-fetch": "^2.6.7", "pino": "^7.0.0", "tsconfig-paths": "^3.13.0", - "typescript": "4.9.5" + "typescript": "5.6.3" }, "devDependencies": { "@types/csv2json": "^1.4.5", @@ -56,11 +56,11 @@ "eslint-config-prettier": "^9.0.0", "eslint-plugin-import": "^2.17.3", "eslint-plugin-prettier": "^4.0.0", - "jest": "27.5.1", + "jest": "29.7.0", "jest-fetch-mock": "^2.1.2", "nodemon": "^3.0.0", "prettier": "2.8.8", - "ts-jest": "27.1.4", + "ts-jest": "29.2.5", "ts-node": "^6.1.1" }, "lint-staged": { @@ -78,8 +78,7 @@ "" ], "moduleNameMapper": { - "@notification/(.*)": "/src/$1", - "@opencrvs/commons/(.*)": "@opencrvs/commons/build/dist/$1" + "@notification/(.*)": "/src/$1" }, "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$", "setupFiles": [ diff --git a/packages/notification/src/extract-translations.ts b/packages/notification/src/extract-translations.ts index 224ed14b65e..059a7e46360 100644 --- a/packages/notification/src/extract-translations.ts +++ b/packages/notification/src/extract-translations.ts @@ -10,9 +10,9 @@ */ /* eslint-disable */ import { messageKeys } from '@notification/i18n/messages' -import * as chalk from 'chalk' +import chalk from 'chalk' import { Options, stringify } from 'csv-stringify' -import * as csv2json from 'csv2json' +import csv2json from 'csv2json' import * as fs from 'fs' import { promisify } from 'util' const csvStringify = promisify>, Options, string>( diff --git a/packages/notification/src/features/sms/user-handler.ts b/packages/notification/src/features/sms/user-handler.ts index 316a74d15ab..9441d697c14 100644 --- a/packages/notification/src/features/sms/user-handler.ts +++ b/packages/notification/src/features/sms/user-handler.ts @@ -31,7 +31,7 @@ interface IRetrieveUserNamePayload extends IMessageRecipient { interface IUserAuthCodePayload extends IMessageRecipient { code: string - notificationEvent: string + notificationEvent: keyof typeof templateNames } export async function sendUserCredentials( diff --git a/packages/notification/tsconfig.json b/packages/notification/tsconfig.json index d75963d65ac..287b2a2fc45 100644 --- a/packages/notification/tsconfig.json +++ b/packages/notification/tsconfig.json @@ -2,37 +2,24 @@ "compilerOptions": { "baseUrl": "./src", "paths": { - "@notification/*": [ - "./*" - ] + "@notification/*": ["./*"] }, "target": "es6", - "module": "commonjs", + "module": "node16", "outDir": "build/dist", "sourceMap": true, "moduleResolution": "node16", "rootDir": ".", - "lib": [ - "esnext.asynciterable", - "es6", - "es2017" - ], + "lib": ["esnext.asynciterable", "es6", "es2017"], "forceConsistentCasingInFileNames": true, "noImplicitReturns": true, "noImplicitThis": true, "noImplicitAny": true, "strictNullChecks": true, - "suppressImplicitAnyIndexErrors": true, "noUnusedLocals": true, - "types": [ - "fhir", - "jest" - ] + "types": ["fhir", "jest"] }, - "include": [ - "src/**/*.ts", - "typings", - ], + "include": ["src/**/*.ts", "typings"], "exclude": [ "node_modules", "build", diff --git a/packages/search/package.json b/packages/search/package.json index b67eecf7565..32df7e3888a 100644 --- a/packages/search/package.json +++ b/packages/search/package.json @@ -54,14 +54,14 @@ "@types/node": "18.11.18", "@types/uuid": "^3.4.4", "cross-env": "^7.0.0", - "jest": "27.5.1", + "jest": "29.7.0", "jest-fetch-mock": "^2.1.2", "nodemon": "^3.0.0", "prettier": "2.8.8", "testcontainers": "^9.1.1", - "ts-jest": "27.1.4", + "ts-jest": "29.2.5", "ts-node": "^6.1.1", - "typescript": "4.9.5" + "typescript": "5.6.3" }, "lint-staged": { "src/**/*.ts": [ @@ -90,8 +90,7 @@ "" ], "moduleNameMapper": { - "@search/(.*)": "/src/$1", - "@opencrvs/commons/(.*)": "@opencrvs/commons/build/dist/$1" + "@search/(.*)": "/src/$1" }, "coverageReporters": [ "json", diff --git a/packages/search/src/features/reindex/handler.ts b/packages/search/src/features/reindex/handler.ts index 4f7ffe93d8b..569709dfefc 100644 --- a/packages/search/src/features/reindex/handler.ts +++ b/packages/search/src/features/reindex/handler.ts @@ -10,7 +10,8 @@ */ import * as Hapi from '@hapi/hapi' import { logger } from '@opencrvs/commons' -import * as uuid from 'uuid' +import uuid = require('uuid') + import { prune } from './prune' import { backupLegacyIndex, reindex, updateAliases } from './reindex' diff --git a/packages/search/src/test/utils.ts b/packages/search/src/test/utils.ts index ebaa9f328a2..7c93cb17b68 100644 --- a/packages/search/src/test/utils.ts +++ b/packages/search/src/test/utils.ts @@ -365,7 +365,8 @@ export const mockBirthFhirBundle: SavedBundle< { url: 'http://opencrvs.org/specs/extension/part-of', valueReference: { - reference: 'Location/0f7684aa-8c65-4901-8318-bf1e22c247cb' + reference: + 'Location/0f7684aa-8c65-4901-8318-bf1e22c247cb' as `Location/${UUID}` } } ] @@ -399,13 +400,15 @@ export const mockBirthFhirBundle: SavedBundle< { url: 'http://opencrvs.org/specs/extension/regLastUser', valueReference: { - reference: 'Practitioner/4651d1cc-6072-4e34-bf20-b583f421a9f1' + reference: + 'Practitioner/4651d1cc-6072-4e34-bf20-b583f421a9f1' as `Practitioner/${UUID}` } }, { url: 'http://opencrvs.org/specs/extension/regLastOffice', valueReference: { - reference: 'Location/ce73938d-a188-4a78-9d19-35dfd4ca6957' + reference: + 'Location/ce73938d-a188-4a78-9d19-35dfd4ca6957' as `Location/${UUID}` } } ], @@ -438,7 +441,8 @@ export const mockBirthFhirBundle: SavedBundle< ] }, focus: { - reference: 'Composition/c8b8e843-c5e0-49b5-96d9-a702ddb46454' + reference: + 'Composition/c8b8e843-c5e0-49b5-96d9-a702ddb46454' as `Composition/${UUID}` }, meta: { lastUpdated: '2023-11-30T12:36:27.277+00:00', @@ -498,7 +502,8 @@ export const mockBirthFhirBundle: SavedBundle< status: 'active', mode: 'instance', partOf: { - reference: 'Location/ed6195ff-0f83-4852-832e-dc9db07151ff' + reference: + 'Location/ed6195ff-0f83-4852-832e-dc9db07151ff' as `Location/${UUID}` }, type: { coding: [ @@ -540,7 +545,8 @@ export const mockBirthFhirBundle: SavedBundle< status: 'active', mode: 'instance', partOf: { - reference: 'Location/0f7684aa-8c65-4901-8318-bf1e22c247cb' + reference: + 'Location/0f7684aa-8c65-4901-8318-bf1e22c247cb' as `Location/${UUID}` }, type: { coding: [ @@ -581,7 +587,8 @@ export const mockBirthFhirBundle: SavedBundle< status: 'active', mode: 'instance', partOf: { - reference: 'Location/af050fc6-5866-455a-9cd2-6437e34a3fbe' + reference: + 'Location/af050fc6-5866-455a-9cd2-6437e34a3fbe' as `Location/${UUID}` }, type: { coding: [ @@ -634,7 +641,8 @@ export const mockBirthFhirBundle: SavedBundle< ], location: [ { - reference: 'Location/ce73938d-a188-4a78-9d19-35dfd4ca6957' + reference: + 'Location/ce73938d-a188-4a78-9d19-35dfd4ca6957' as `Location/${UUID}` } ], meta: { @@ -665,7 +673,7 @@ export const mockBirthFhirBundle: SavedBundle< status: 'active', mode: 'instance', partOf: { - reference: 'Location/0' + reference: 'Location/0' as `Location/${UUID}` }, type: { coding: [ @@ -1321,7 +1329,8 @@ export const mockDeathFhirBundle: SavedBundle< { url: 'http://opencrvs.org/specs/extension/part-of', valueReference: { - reference: 'Location/e66643ac-9ea9-4314-b842-f4fb3ad9e83a' + reference: + 'Location/e66643ac-9ea9-4314-b842-f4fb3ad9e83a' as `Location/${UUID}` } } ] @@ -1478,13 +1487,15 @@ export const mockDeathFhirBundle: SavedBundle< { url: 'http://opencrvs.org/specs/extension/regLastOffice', valueReference: { - reference: 'Location/e9e1b362-27c9-4ce1-82ad-57fe9d5650e4' + reference: + 'Location/e9e1b362-27c9-4ce1-82ad-57fe9d5650e4' as `Location/${UUID}` } }, { url: 'http://opencrvs.org/specs/extension/regLastUser', valueReference: { - reference: 'Practitioner/525094f5-3c5f-4e72-af3b-adda8617839f' + reference: + 'Practitioner/525094f5-3c5f-4e72-af3b-adda8617839f' as `Practitioner/${UUID}` } }, { @@ -1576,7 +1587,8 @@ export const mockDeathFhirBundle: SavedBundle< { url: 'http://opencrvs.org/specs/extension/part-of', valueReference: { - reference: 'Location/e66643ac-9ea9-4314-b842-f4fb3ad9e83a' + reference: + 'Location/e66643ac-9ea9-4314-b842-f4fb3ad9e83a' as `Location/${UUID}` } } ] @@ -2093,7 +2105,8 @@ export const mockDeathFhirBundle: SavedBundle< ], location: [ { - reference: 'Location/e9e1b362-27c9-4ce1-82ad-57fe9d5650e4' + reference: + 'Location/e9e1b362-27c9-4ce1-82ad-57fe9d5650e4' as `Location/${UUID}` } ], meta: { diff --git a/packages/search/src/utils/authUtils.ts b/packages/search/src/utils/authUtils.ts index 9fd7e902692..106c79c0fe3 100644 --- a/packages/search/src/utils/authUtils.ts +++ b/packages/search/src/utils/authUtils.ts @@ -8,7 +8,7 @@ * * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. */ -import * as decode from 'jwt-decode' +import decode = require('jwt-decode') export enum USER_SCOPE { DECLARE = 'declare', diff --git a/packages/search/tsconfig.json b/packages/search/tsconfig.json index 2c3ebf2bb6b..0fe1033ee48 100644 --- a/packages/search/tsconfig.json +++ b/packages/search/tsconfig.json @@ -6,7 +6,7 @@ "@search/*": ["./*"] }, "target": "es6", - "module": "commonjs", + "module": "node16", "outDir": "build/dist", "sourceMap": true, "moduleResolution": "node16", diff --git a/packages/user-mgnt/package.json b/packages/user-mgnt/package.json index 5f863681ad9..e087d189648 100644 --- a/packages/user-mgnt/package.json +++ b/packages/user-mgnt/package.json @@ -49,13 +49,13 @@ "@types/node-fetch": "^2.5.12", "@types/uuid": "^3.4.3", "cross-env": "^7.0.0", - "jest": "27.5.1", + "jest": "29.7.0", "mockingoose": "^2.15.2", "nodemon": "^3.0.0", "prettier": "2.8.8", - "ts-jest": "27.1.4", + "ts-jest": "29.2.5", "ts-node": "^6.1.1", - "typescript": "4.9.5" + "typescript": "5.6.3" }, "lint-staged": { "src/**/*.ts": [ @@ -71,8 +71,7 @@ "" ], "moduleNameMapper": { - "@user-mgnt/(.*)": "/src/$1", - "@opencrvs/commons/(.*)": "@opencrvs/commons/build/dist/$1" + "@user-mgnt/(.*)": "/src/$1" }, "setupFiles": [ "./test/setupJest.ts" diff --git a/packages/user-mgnt/src/database.test.ts b/packages/user-mgnt/src/database.test.ts index 5077c71867f..5faf5c20526 100644 --- a/packages/user-mgnt/src/database.test.ts +++ b/packages/user-mgnt/src/database.test.ts @@ -17,7 +17,7 @@ jest.mock('mongoose', () => ({ disconnect: () => {} })) -import * as mongoose from 'mongoose' +import mongoose from 'mongoose' import { start, stop } from '@user-mgnt/database' import { logger } from '@opencrvs/commons' diff --git a/packages/user-mgnt/src/database.ts b/packages/user-mgnt/src/database.ts index cf4bedf42b1..6c881ec69f3 100644 --- a/packages/user-mgnt/src/database.ts +++ b/packages/user-mgnt/src/database.ts @@ -8,7 +8,7 @@ * * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. */ -import * as mongoose from 'mongoose' +import mongoose from 'mongoose' import { MONGO_URL } from '@user-mgnt/constants' import { logger } from '@opencrvs/commons' diff --git a/packages/user-mgnt/src/features/createUser/service.test.ts b/packages/user-mgnt/src/features/createUser/service.test.ts index c789ff750e2..435253d5625 100644 --- a/packages/user-mgnt/src/features/createUser/service.test.ts +++ b/packages/user-mgnt/src/features/createUser/service.test.ts @@ -10,9 +10,9 @@ */ import { generateUsername, sendCredentialsNotification } from './service' import User from '@user-mgnt/model/user' -import * as mockingoose from 'mockingoose' -import * as fetchMock from 'jest-fetch-mock' -import * as jwt from 'jsonwebtoken' +import mockingoose = require('mockingoose') +import fetchMock from 'jest-fetch-mock' +import jwt from 'jsonwebtoken' import { readFileSync } from 'fs' import { logger } from '@opencrvs/commons' diff --git a/packages/user-mgnt/src/features/system/handler.ts b/packages/user-mgnt/src/features/system/handler.ts index 664986db97b..65c618af077 100644 --- a/packages/user-mgnt/src/features/system/handler.ts +++ b/packages/user-mgnt/src/features/system/handler.ts @@ -29,7 +29,7 @@ import { pickSystem, types } from '@user-mgnt/utils/system' import { getTokenPayload, ITokenPayload } from '@user-mgnt/utils/token' import { statuses } from '@user-mgnt/utils/userUtils' import * as Joi from 'joi' -import * as uuid from 'uuid/v4' +import uuid from 'uuid/v4' export enum EventType { Birth = 'birth', @@ -47,7 +47,7 @@ interface IRegisterSystemPayload { dailyQuota: number webhook: WebHookPayload[] } - type: string + type: keyof typeof systemRoleScopes integratingSystemType: string } diff --git a/packages/user-mgnt/src/features/userAudit/handler.ts b/packages/user-mgnt/src/features/userAudit/handler.ts index 359dfc32163..adc25544071 100644 --- a/packages/user-mgnt/src/features/userAudit/handler.ts +++ b/packages/user-mgnt/src/features/userAudit/handler.ts @@ -24,8 +24,8 @@ import { postUserActionToMetrics } from '@user-mgnt/features/changePhone/handler interface IAuditUserPayload { userId: string auditedBy: string - action: string - reason: string + action: keyof typeof AUDIT_ACTION + reason: keyof typeof AUDIT_REASON comment: string } diff --git a/packages/user-mgnt/src/features/userSearchRecord/handler.ts b/packages/user-mgnt/src/features/userSearchRecord/handler.ts index d93dd234948..7829ed723cc 100644 --- a/packages/user-mgnt/src/features/userSearchRecord/handler.ts +++ b/packages/user-mgnt/src/features/userSearchRecord/handler.ts @@ -12,8 +12,8 @@ import { logger } from '@opencrvs/commons' import User, { IUserModel, Event } from '@user-mgnt/model/user' import { unauthorized } from '@hapi/boom' import * as Hapi from '@hapi/hapi' -import * as Joi from 'joi' -import * as uuid from 'uuid/v4' +import Joi from 'joi' +import uuid from 'uuid/v4' enum RegStatus { IN_PROGRESS = 'IN_PROGRESS', diff --git a/packages/user-mgnt/src/utils/token.ts b/packages/user-mgnt/src/utils/token.ts index a784a8ee0be..9381b107f2b 100644 --- a/packages/user-mgnt/src/utils/token.ts +++ b/packages/user-mgnt/src/utils/token.ts @@ -9,7 +9,7 @@ * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. */ -import * as decode from 'jwt-decode' +import decode from 'jwt-decode' export interface IAuthHeader { Authorization: string diff --git a/packages/user-mgnt/src/utils/userUtils.ts b/packages/user-mgnt/src/utils/userUtils.ts index 91e50a34c42..e18a417f2a7 100644 --- a/packages/user-mgnt/src/utils/userUtils.ts +++ b/packages/user-mgnt/src/utils/userUtils.ts @@ -10,7 +10,7 @@ */ import * as Hapi from '@hapi/hapi' import { ITokenPayload } from '@user-mgnt/utils/token' -import * as decode from 'jwt-decode' +import decode from 'jwt-decode' export const statuses = { PENDING: 'pending', diff --git a/packages/user-mgnt/test/setupJest.ts b/packages/user-mgnt/test/setupJest.ts index 851962c4743..986244842fa 100644 --- a/packages/user-mgnt/test/setupJest.ts +++ b/packages/user-mgnt/test/setupJest.ts @@ -9,7 +9,7 @@ * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. */ import { join } from 'path' -import * as fetch from 'jest-fetch-mock' +import fetch from 'jest-fetch-mock' process.env.CERT_PUBLIC_KEY_PATH = join(__dirname, './cert.key.pub') -jest.setMock('node-fetch', { default: fetch }) +jest.setMock('node-fetch', fetch) diff --git a/packages/user-mgnt/tsconfig.json b/packages/user-mgnt/tsconfig.json index 1c499cf0f56..ff9971a8a13 100644 --- a/packages/user-mgnt/tsconfig.json +++ b/packages/user-mgnt/tsconfig.json @@ -5,7 +5,7 @@ "@user-mgnt/*": ["./*"] }, "target": "es6", - "module": "commonjs", + "module": "node16", "rootDir": ".", "sourceMap": true, "moduleResolution": "node16", @@ -16,17 +16,10 @@ "noImplicitThis": true, "noImplicitAny": true, "strictNullChecks": true, - "suppressImplicitAnyIndexErrors": true, "noUnusedLocals": true, - "types": ["fhir", "jest"] + "types": ["fhir", "jest"], + "esModuleInterop": true }, "include": ["src/**/*.ts", "typings"], - "exclude": [ - "node_modules", - "build", - "scripts", - "acceptance-tests", - "src/setupTests.ts", - "src/**/*.test.ts" - ] + "exclude": ["node_modules", "build", "scripts", "acceptance-tests"] } diff --git a/packages/webhooks/package.json b/packages/webhooks/package.json index 5992277a416..b2c5f6c9fd2 100644 --- a/packages/webhooks/package.json +++ b/packages/webhooks/package.json @@ -56,13 +56,13 @@ "eslint-config-prettier": "^9.0.0", "eslint-plugin-import": "^2.17.3", "eslint-plugin-prettier": "^4.0.0", - "jest": "27.5.1", + "jest": "29.7.0", "mockingoose": "^2.15.2", "nodemon": "^3.0.0", "prettier": "2.8.8", - "ts-jest": "27.1.4", + "ts-jest": "29.2.5", "ts-node": "^6.1.1", - "typescript": "4.9.5" + "typescript": "5.6.3" }, "lint-staged": { "src/**/*.ts": [ @@ -78,8 +78,7 @@ "" ], "moduleNameMapper": { - "@webhooks/(.*)": "/src/$1", - "@opencrvs/commons/(.*)": "@opencrvs/commons/build/dist/$1" + "@webhooks/(.*)": "/src/$1" }, "setupFiles": [ "./test/setupJest.ts" diff --git a/packages/webhooks/src/features/manage/handler.test.ts b/packages/webhooks/src/features/manage/handler.test.ts index c224e31ee3c..32c04759760 100644 --- a/packages/webhooks/src/features/manage/handler.test.ts +++ b/packages/webhooks/src/features/manage/handler.test.ts @@ -12,13 +12,13 @@ import { createServer } from '@webhooks/server' import Webhook, { IWebhook } from '@webhooks/model/webhook' import { readFileSync } from 'fs' import * as fetchMock from 'jest-fetch-mock' -import * as jwt from 'jsonwebtoken' +import { sign } from 'jsonwebtoken' import * as mockingoose from 'mockingoose' import * as service from '@webhooks/features/manage/service' const fetch = fetchMock as fetchMock.FetchMock -const token = jwt.sign( +const token = sign( { scope: ['sysadmin', 'demo'] }, readFileSync('./test/cert.key'), { diff --git a/packages/webhooks/src/features/manage/handler.ts b/packages/webhooks/src/features/manage/handler.ts index 7965b309b6c..f6c5a94b528 100644 --- a/packages/webhooks/src/features/manage/handler.ts +++ b/packages/webhooks/src/features/manage/handler.ts @@ -20,7 +20,7 @@ import { import { internal } from '@hapi/boom' import Webhook, { TRIGGERS } from '@webhooks/model/webhook' import { logger } from '@opencrvs/commons' -import * as uuid from 'uuid/v4' +import uuid = require('uuid/v4') import fetch from 'node-fetch' import { resolve } from 'url' @@ -40,7 +40,7 @@ export async function subscribeWebhooksHandler( h: Hapi.ResponseToolkit ) { const { hub } = request.payload as ISubscribePayload - if (!TRIGGERS[TRIGGERS[hub.topic]]) { + if (!(hub.topic in TRIGGERS)) { return h .response({ hub: { @@ -109,7 +109,7 @@ export async function subscribeWebhooksHandler( createdBy, address: hub.callback, sha_secret: hub.secret, - trigger: TRIGGERS[TRIGGERS[hub.topic]] + trigger: hub.topic in TRIGGERS ? hub.topic : undefined } const challenge = generateChallenge() diff --git a/packages/webhooks/src/features/manage/service.ts b/packages/webhooks/src/features/manage/service.ts index 01b33b3ecea..1b26a9adf7b 100644 --- a/packages/webhooks/src/features/manage/service.ts +++ b/packages/webhooks/src/features/manage/service.ts @@ -8,7 +8,7 @@ * * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. */ -import * as decode from 'jwt-decode' +import decode = require('jwt-decode') import { USER_MANAGEMENT_URL } from '@webhooks/constants' import fetch from 'node-fetch' import * as crypto from 'crypto' diff --git a/packages/webhooks/tsconfig.json b/packages/webhooks/tsconfig.json index 7ce641db4b9..e0fe6589e6d 100644 --- a/packages/webhooks/tsconfig.json +++ b/packages/webhooks/tsconfig.json @@ -2,45 +2,25 @@ "compilerOptions": { "baseUrl": "./src", "paths": { - "@webhooks/*": [ - "./*" - ] + "@webhooks/*": ["./*"] }, "target": "es6", - "module": "commonjs", + "module": "node16", "allowSyntheticDefaultImports": true, "skipLibCheck": true, "outDir": "build/dist", "sourceMap": true, "moduleResolution": "node16", "rootDir": ".", - "lib": [ - "esnext.asynciterable", - "es6", - "es2017" - ], + "lib": ["esnext.asynciterable", "es6", "es2017"], "forceConsistentCasingInFileNames": true, "noImplicitReturns": true, "noImplicitThis": true, "noImplicitAny": true, "strictNullChecks": true, - "suppressImplicitAnyIndexErrors": true, "noUnusedLocals": true, - "types": [ - "fhir", - "jest" - ] + "types": ["fhir", "jest"] }, - "include": [ - "resources/**/*.ts", - "src/**/*.ts", - "typings" - ], - "exclude": [ - "node_modules", - "build", - "scripts", - "acceptance-tests", - "src/setupTests.ts" - ] + "include": ["resources/**/*.ts", "src/**/*.ts", "typings"], + "exclude": ["node_modules", "build", "scripts", "acceptance-tests"] } diff --git a/packages/workflow/package.json b/packages/workflow/package.json index a19c4feca68..a3cc1fa5f5d 100644 --- a/packages/workflow/package.json +++ b/packages/workflow/package.json @@ -52,13 +52,13 @@ "@typescript-eslint/parser": "^4.5.0", "cross-env": "^7.0.0", "eslint": "^7.11.0", - "jest": "27.5.1", + "jest": "29.7.0", "msw": "^1.3.2", "nodemon": "^3.0.0", "prettier": "2.8.8", - "ts-jest": "27.1.4", + "ts-jest": "29.2.5", "ts-node": "^6.1.1", - "typescript": "4.9.5" + "typescript": "5.6.3" }, "lint-staged": { "src/**/*.ts": [ @@ -88,8 +88,7 @@ ], "moduleNameMapper": { "@workflow/(.*)": "/src/$1", - "@test/(.*)": "/test/$1", - "@opencrvs/commons/(.*)": "@opencrvs/commons/build/dist/$1" + "@test/(.*)": "/test/$1" }, "coverageReporters": [ "json", diff --git a/packages/workflow/src/records/__snapshots__/state-transitions.test.ts.snap b/packages/workflow/src/records/__snapshots__/state-transitions.test.ts.snap index 70295086ff7..d9b9c86c559 100644 --- a/packages/workflow/src/records/__snapshots__/state-transitions.test.ts.snap +++ b/packages/workflow/src/records/__snapshots__/state-transitions.test.ts.snap @@ -1,116 +1,116 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`functions that take record from one state to another * -> correction requested should be defined: changed resources 1`] = ` -Array [ - Object { - "businessStatus": Object { - "coding": Array [ - Object { +[ + { + "businessStatus": { + "coding": [ + { "code": "CORRECTION_REQUESTED", "system": "http://opencrvs.org/specs/reg-status", }, ], }, - "code": Object { - "coding": Array [ - Object { + "code": { + "coding": [ + { "code": "BIRTH", "system": "http://opencrvs.org/specs/types", }, ], }, - "encounter": Object { + "encounter": { "reference": "STATIC", }, - "extension": Array [ - Object { + "extension": [ + { "url": "http://opencrvs.org/specs/extension/informants-signature", "valueString": "/ocrvs/c647d125-68ee-4794-b320-d472aadd8c09.png", }, - Object { + { "url": "http://opencrvs.org/specs/extension/contact-person-phone-number", "valueString": "+260745645645", }, - Object { + { "url": "http://opencrvs.org/specs/extension/contact-person-email", "valueString": "informant@example.com", }, - Object { + { "url": "http://opencrvs.org/specs/extension/timeLoggedMS", "valueInteger": 0, }, - Object { + { "url": "http://opencrvs.org/specs/extension/paymentDetails", - "valueReference": Object { + "valueReference": { "reference": "STATIC", }, }, - Object { + { "url": "http://opencrvs.org/specs/extension/noSupportingDocumentationRequired", "valueBoolean": true, }, - Object { + { "url": "http://opencrvs.org/specs/extension/requestingIndividual", "valueString": "MOTHER", }, - Object { + { "url": "http://opencrvs.org/specs/extension/hasShowedVerifiedDocument", "valueBoolean": true, }, - Object { + { "url": "http://opencrvs.org/specs/extension/regLastUser", - "valueReference": Object { + "valueReference": { "reference": "Practitioner/7dc24408-d409-4ec0-bd9d-4a5aa817dcab", }, }, - Object { + { "url": "http://opencrvs.org/specs/extension/regLastOffice", - "valueReference": Object { + "valueReference": { "reference": "Location/61e07903-bf3c-4bd9-9b20-6cf0e3bb982c", }, }, ], - "focus": Object { + "focus": { "reference": "Composition/c5811d36-934d-40f9-94b4-15194d562e45", }, "id": "8dae3f40-70f8-4463-aae1-fd56aec0c8ee", - "identifier": Array [ - Object { + "identifier": [ + { "system": "http://opencrvs.org/specs/id/draft-id", "value": "03d087a0-1e20-4443-aca3-d48461d4d597", }, - Object { + { "system": "http://opencrvs.org/specs/id/birth-tracking-id", "value": "BF6W25K", }, - Object { + { "system": "http://opencrvs.org/specs/id/birth-registration-number", "value": "2023BF6W25K", }, ], - "input": Array [], + "input": [], "intent": "proposal", "lastModified": "STATIC", - "note": Array [ - Object { + "note": [ + { "text": "Both mother and father were present", }, - Object { + { "text": "Note", }, ], - "output": Array [], - "reason": Object { - "extension": Array [ - Object { + "output": [], + "reason": { + "extension": [ + { "url": "http://opencrvs.org/specs/extension/otherReason", "valueString": "Other reason", }, ], "text": "OTHER", }, - "requester": Object { - "agent": Object { + "requester": { + "agent": { "reference": "Practitioner/7dc24408-d409-4ec0-bd9d-4a5aa817dcab", }, }, @@ -121,37 +121,37 @@ Array [ `; exports[`functions that take record from one state to another * -> correction requested should be defined: new resources 1`] = ` -Array [ - Object { - "detail": Array [ - Object { - "amount": Object { +[ + { + "detail": [ + { + "amount": { "value": 100, }, "date": "2021-08-10T10:00:00.000Z", - "type": Object { - "coding": Array [ - Object { + "type": { + "coding": [ + { "code": "MANUAL", }, ], }, }, ], - "outcome": Object { - "coding": Array [ - Object { + "outcome": { + "coding": [ + { "code": "COMPLETED", }, ], }, "resourceType": "PaymentReconciliation", "status": "active", - "total": Object { + "total": { "value": 100, }, }, - Object { + { "resourceType": "Encounter", "status": "finished", }, diff --git a/packages/workflow/src/records/fhir.ts b/packages/workflow/src/records/fhir.ts index 78d714d1b95..5c4b0cf3b36 100644 --- a/packages/workflow/src/records/fhir.ts +++ b/packages/workflow/src/records/fhir.ts @@ -1225,7 +1225,7 @@ function toSavedTask( function toSavedRelatedPerson( relatedPersion: RelatedPerson & { - patient: { reference: `urn:uuid:${string}` } + patient: { reference: `urn:uuid:${UUID}` } }, id: UUID, resourceBundle: Bundle, @@ -1367,8 +1367,10 @@ export function toSavedBundle( fullUrl: responseBundle.entry[index].response.location, resource: toSavedTask( { - ...entry.resource, - focus: { reference: entry.resource.focus.reference } + ...(entry.resource as Task), + focus: { + reference: entry.resource.focus.reference + } }, urlReferenceToUUID(responseBundle.entry[index].response.location), resourceBundle, diff --git a/packages/workflow/src/records/handler/create.ts b/packages/workflow/src/records/handler/create.ts index d0613b9d4ea..73a69ca43eb 100644 --- a/packages/workflow/src/records/handler/create.ts +++ b/packages/workflow/src/records/handler/create.ts @@ -74,7 +74,7 @@ import { toValidated, toWaitingForExternalValidationState } from '@workflow/records/state-transitions' -import { logger } from '@opencrvs/commons' +import { logger, UUID } from '@opencrvs/commons' const requestSchema = z.object({ event: z.custom(), @@ -175,7 +175,7 @@ async function createRecord( recordDetails: z.TypeOf['record'], event: z.TypeOf['event'], token: string, - duplicateIds: Array<{ id: string; trackingId: string }> + duplicateIds: Array<{ id: UUID; trackingId: string }> ): Promise { const inputBundle = buildFHIRBundle(recordDetails, event) const trackingId = await generateTrackingIdForEvents( diff --git a/packages/workflow/src/test/utils.ts b/packages/workflow/src/test/utils.ts index 7193ce5b35f..e0cf976c34e 100644 --- a/packages/workflow/src/test/utils.ts +++ b/packages/workflow/src/test/utils.ts @@ -185,7 +185,7 @@ export const testFhirBundle: StrictBundle< }, { url: 'http://opencrvs.org/specs/extension/regLastOffice', - valueReference: { reference: 'Location/123' } + valueReference: { reference: 'Location/123' as `Location/${UUID}` } } ] } diff --git a/packages/workflow/src/utils/auth-utils.ts b/packages/workflow/src/utils/auth-utils.ts index abc2516490f..d92f1bf09a2 100644 --- a/packages/workflow/src/utils/auth-utils.ts +++ b/packages/workflow/src/utils/auth-utils.ts @@ -8,7 +8,7 @@ * * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. */ -import * as decode from 'jwt-decode' +import decode = require('jwt-decode') import * as Hapi from '@hapi/hapi' import { hasScope } from '@opencrvs/commons/authentication' diff --git a/packages/workflow/src/utils/duplicate-checker.ts b/packages/workflow/src/utils/duplicate-checker.ts index 7c16ebc0815..11db4c9eb5a 100644 --- a/packages/workflow/src/utils/duplicate-checker.ts +++ b/packages/workflow/src/utils/duplicate-checker.ts @@ -9,7 +9,7 @@ * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. */ import nodeFetch from 'node-fetch' -import { IAuthHeader } from '@opencrvs/commons' +import { IAuthHeader, UUID } from '@opencrvs/commons' import { addExtensionsToTask, addRelatesToToComposition, @@ -90,7 +90,7 @@ const searchBirthDuplicates = async ( async function findBirthDuplicateIds( authHeader: IAuthHeader, birthRegDetails: BirthRegistration -): Promise<{ id: string; trackingId: string }[]> { +): Promise<{ id: UUID; trackingId: string }[]> { if (!birthRegDetails || !birthRegDetails.child) { return [] } @@ -111,7 +111,7 @@ async function findBirthDuplicateIds( async function findDeathDuplicateIds( authHeader: IAuthHeader, deathRegDetails: DeathRegistration -): Promise<{ id: string; trackingId: string }[]> { +): Promise<{ id: UUID; trackingId: string }[]> { if (!deathRegDetails || !deathRegDetails.deceased) { return [] } @@ -168,7 +168,7 @@ export function updateTaskWithDuplicateIds( export function updateCompositionWithDuplicateIds( composition: Composition, - duplicateIds: { id: string; trackingId: string }[] + duplicateIds: { id: UUID; trackingId: string }[] ) { const relatesTo: NonNullable = duplicateIds.map( (duplicate) => ({ diff --git a/packages/workflow/test/handlers.ts b/packages/workflow/test/handlers.ts index cdb5c2e6cda..e2cec74d1e0 100644 --- a/packages/workflow/test/handlers.ts +++ b/packages/workflow/test/handlers.ts @@ -47,13 +47,14 @@ const hierarchyHandler = rest.get( fixtures.savedAdministrativeLocation({ id: '0f7684aa-8c65-4901-8318-bf1e22c247cb' as UUID, name: 'Ibombo', - partOf: { reference: 'Location/0' } + partOf: { reference: 'Location/0' as `Location/${UUID}` } }), fixtures.savedAdministrativeLocation({ id: 'ce73938d-a188-4a78-9d19-35dfd4ca6957' as UUID, name: 'Ibombo District Office', partOf: { - reference: 'Location/0f7684aa-8c65-4901-8318-bf1e22c247cb' + reference: + 'Location/0f7684aa-8c65-4901-8318-bf1e22c247cb' as `Location/${UUID}` } }) ]) diff --git a/packages/workflow/test/mocks/locations.ts b/packages/workflow/test/mocks/locations.ts index 07f13d02e11..5a32307344c 100644 --- a/packages/workflow/test/mocks/locations.ts +++ b/packages/workflow/test/mocks/locations.ts @@ -24,7 +24,8 @@ export const office: SavedLocation = { status: 'active', mode: 'instance', partOf: { - reference: 'Location/0f7684aa-8c65-4901-8318-bf1e22c247cb' + reference: + 'Location/0f7684aa-8c65-4901-8318-bf1e22c247cb' as `Location/${UUID}` }, type: { coding: [ @@ -67,7 +68,8 @@ export const district: SavedLocation = { status: 'active', mode: 'instance', partOf: { - reference: 'Location/ed6195ff-0f83-4852-832e-dc9db07151ff' + reference: + 'Location/ed6195ff-0f83-4852-832e-dc9db07151ff' as `Location/${UUID}` }, type: { coding: [ @@ -111,7 +113,7 @@ export const state: SavedLocation = { status: 'active', mode: 'instance', partOf: { - reference: 'Location/0' + reference: 'Location/0' as `Location/${UUID}` }, type: { coding: [ diff --git a/packages/workflow/test/mocks/practitionerRole.ts b/packages/workflow/test/mocks/practitionerRole.ts index 6db9533a502..adb0881fea4 100644 --- a/packages/workflow/test/mocks/practitionerRole.ts +++ b/packages/workflow/test/mocks/practitionerRole.ts @@ -47,7 +47,8 @@ export const practitionerRoleBundle: SavedBundle = { ], location: [ { - reference: 'Location/ce73938d-a188-4a78-9d19-35dfd4ca6957' + reference: + 'Location/ce73938d-a188-4a78-9d19-35dfd4ca6957' as `Location/${UUID}` } ], meta: { diff --git a/packages/workflow/test/mocks/records/archive.ts b/packages/workflow/test/mocks/records/archive.ts index 632aa960176..0f35e10a188 100644 --- a/packages/workflow/test/mocks/records/archive.ts +++ b/packages/workflow/test/mocks/records/archive.ts @@ -65,13 +65,15 @@ export const ARCHIVED_BIRTH_RECORD: SavedBundle< { url: 'http://opencrvs.org/specs/extension/regLastUser', valueReference: { - reference: 'Practitioner/8c3ce648-5a04-4e19-8ffb-5b98019ef100' + reference: + 'Practitioner/8c3ce648-5a04-4e19-8ffb-5b98019ef100' as `Practitioner/${UUID}` } }, { url: 'http://opencrvs.org/specs/extension/regLastOffice', valueReference: { - reference: 'Location/7d9f973f-f606-42f8-a92e-58953f0576ba' + reference: + 'Location/7d9f973f-f606-42f8-a92e-58953f0576ba' as `Location/${UUID}` } } ], @@ -104,7 +106,8 @@ export const ARCHIVED_BIRTH_RECORD: SavedBundle< ] }, focus: { - reference: 'Composition/ef1bd844-a72b-42c3-b12b-13cb2a7c157c' + reference: + 'Composition/ef1bd844-a72b-42c3-b12b-13cb2a7c157c' as `Composition/${UUID}` }, meta: { lastUpdated: '2023-12-21T13:04:28.938+00:00', @@ -129,12 +132,14 @@ export const ARCHIVED_BIRTH_RECORD: SavedBundle< ] }, focus: { - reference: 'Composition/ef1bd844-a72b-42c3-b12b-13cb2a7c157c' + reference: + 'Composition/ef1bd844-a72b-42c3-b12b-13cb2a7c157c' as `Composition/${UUID}` }, id: '529a2252-597f-4651-9c53-fb0b68403247' as UUID, requester: { agent: { - reference: 'Practitioner/8c3ce648-5a04-4e19-8ffb-5b98019ef100' + reference: + 'Practitioner/8c3ce648-5a04-4e19-8ffb-5b98019ef100' as `Practitioner/${UUID}` } }, identifier: [ @@ -155,13 +160,15 @@ export const ARCHIVED_BIRTH_RECORD: SavedBundle< { url: 'http://opencrvs.org/specs/extension/regLastUser', valueReference: { - reference: 'Practitioner/8c3ce648-5a04-4e19-8ffb-5b98019ef100' + reference: + 'Practitioner/8c3ce648-5a04-4e19-8ffb-5b98019ef100' as `Practitioner/${UUID}` } }, { url: 'http://opencrvs.org/specs/extension/regLastOffice', valueReference: { - reference: 'Location/7d9f973f-f606-42f8-a92e-58953f0576ba' + reference: + 'Location/7d9f973f-f606-42f8-a92e-58953f0576ba' as `Location/${UUID}` } } ], diff --git a/packages/workflow/test/mocks/records/certify.ts b/packages/workflow/test/mocks/records/certify.ts index fa1e804431d..e0711989151 100644 --- a/packages/workflow/test/mocks/records/certify.ts +++ b/packages/workflow/test/mocks/records/certify.ts @@ -405,7 +405,8 @@ export const CERTIFIED_BIRTH_RECORD: SavedBundle< { url: 'http://opencrvs.org/specs/extension/part-of', valueReference: { - reference: 'Location/fe107046-f90b-4c10-a165-827b0c5c8d79' + reference: + 'Location/fe107046-f90b-4c10-a165-827b0c5c8d79' as `Location/${UUID}` } } ] @@ -431,7 +432,8 @@ export const CERTIFIED_BIRTH_RECORD: SavedBundle< { url: 'http://opencrvs.org/specs/extension/collector', valueReference: { - reference: 'RelatedPerson/219a94d9-92cf-4b7d-a082-368736c4eff5' + reference: + 'RelatedPerson/219a94d9-92cf-4b7d-a082-368736c4eff5' as `RelatedPerson/${UUID}` } }, { @@ -479,12 +481,14 @@ export const CERTIFIED_BIRTH_RECORD: SavedBundle< ] }, focus: { - reference: 'Composition/9d377df7-8e18-46ce-b7c2-99393ddf3410' + reference: + 'Composition/9d377df7-8e18-46ce-b7c2-99393ddf3410' as `Composition/${UUID}` }, id: '8c80cb66-6068-4ae8-97cb-bb65b75788b9' as UUID, requester: { agent: { - reference: 'Practitioner/e46e1ed0-3869-48fe-8c7b-0859647649a7' + reference: + 'Practitioner/e46e1ed0-3869-48fe-8c7b-0859647649a7' as `Practitioner/${UUID}` } }, identifier: [ @@ -509,13 +513,15 @@ export const CERTIFIED_BIRTH_RECORD: SavedBundle< { url: 'http://opencrvs.org/specs/extension/regLastUser', valueReference: { - reference: 'Practitioner/e46e1ed0-3869-48fe-8c7b-0859647649a7' + reference: + 'Practitioner/e46e1ed0-3869-48fe-8c7b-0859647649a7' as `Practitioner/${UUID}` } }, { url: 'http://opencrvs.org/specs/extension/regLastOffice', valueReference: { - reference: 'Location/4a9f7b1a-01b9-4ab5-977b-8942b2c20273' + reference: + 'Location/4a9f7b1a-01b9-4ab5-977b-8942b2c20273' as `Location/${UUID}` } } ], @@ -580,7 +586,8 @@ export const CERTIFIED_BIRTH_RECORD: SavedBundle< status: 'active', mode: 'instance', partOf: { - reference: 'Location/fe107046-f90b-4c10-a165-827b0c5c8d79' + reference: + 'Location/fe107046-f90b-4c10-a165-827b0c5c8d79' as `Location/${UUID}` }, type: { coding: [ @@ -626,7 +633,8 @@ export const CERTIFIED_BIRTH_RECORD: SavedBundle< status: 'active', mode: 'instance', partOf: { - reference: 'Location/e452aebe-5ce1-43dd-b2cd-d5628ff2b706' + reference: + 'Location/e452aebe-5ce1-43dd-b2cd-d5628ff2b706' as `Location/${UUID}` }, type: { coding: [ @@ -668,7 +676,8 @@ export const CERTIFIED_BIRTH_RECORD: SavedBundle< status: 'active', mode: 'instance', partOf: { - reference: 'Location/fe107046-f90b-4c10-a165-827b0c5c8d79' + reference: + 'Location/fe107046-f90b-4c10-a165-827b0c5c8d79' as `Location/${UUID}` }, type: { coding: [ @@ -746,7 +755,8 @@ export const CERTIFIED_BIRTH_RECORD: SavedBundle< ], location: [ { - reference: 'Location/4a9f7b1a-01b9-4ab5-977b-8942b2c20273' + reference: + 'Location/4a9f7b1a-01b9-4ab5-977b-8942b2c20273' as `Location/${UUID}` } ], meta: { @@ -777,7 +787,7 @@ export const CERTIFIED_BIRTH_RECORD: SavedBundle< status: 'active', mode: 'instance', partOf: { - reference: 'Location/0' + reference: 'Location/0' as `Location/${UUID}` }, type: { coding: [ diff --git a/packages/workflow/test/mocks/records/readyForReview.ts b/packages/workflow/test/mocks/records/readyForReview.ts index 2324d9c0f41..61c73f285d9 100644 --- a/packages/workflow/test/mocks/records/readyForReview.ts +++ b/packages/workflow/test/mocks/records/readyForReview.ts @@ -338,7 +338,8 @@ export const READY_FOR_REVIEW_BIRTH_RECORD: SavedBundle< { url: 'http://opencrvs.org/specs/extension/part-of', valueReference: { - reference: 'Location/0f7684aa-8c65-4901-8318-bf1e22c247cb' + reference: + 'Location/0f7684aa-8c65-4901-8318-bf1e22c247cb' as `Location/${UUID}` } } ] @@ -372,13 +373,15 @@ export const READY_FOR_REVIEW_BIRTH_RECORD: SavedBundle< { url: 'http://opencrvs.org/specs/extension/regLastUser', valueReference: { - reference: 'Practitioner/4651d1cc-6072-4e34-bf20-b583f421a9f1' + reference: + 'Practitioner/4651d1cc-6072-4e34-bf20-b583f421a9f1' as `Practitioner/${UUID}` } }, { url: 'http://opencrvs.org/specs/extension/regLastOffice', valueReference: { - reference: 'Location/ce73938d-a188-4a78-9d19-35dfd4ca6957' + reference: + 'Location/ce73938d-a188-4a78-9d19-35dfd4ca6957' as `Location/${UUID}` } } ], @@ -411,7 +414,8 @@ export const READY_FOR_REVIEW_BIRTH_RECORD: SavedBundle< ] }, focus: { - reference: 'Composition/c8b8e843-c5e0-49b5-96d9-a702ddb46454' + reference: + 'Composition/c8b8e843-c5e0-49b5-96d9-a702ddb46454' as `Composition/${UUID}` }, meta: { lastUpdated: '2023-11-30T12:36:27.277+00:00', @@ -471,7 +475,8 @@ export const READY_FOR_REVIEW_BIRTH_RECORD: SavedBundle< status: 'active', mode: 'instance', partOf: { - reference: 'Location/ed6195ff-0f83-4852-832e-dc9db07151ff' + reference: + 'Location/ed6195ff-0f83-4852-832e-dc9db07151ff' as `Location/${UUID}` }, type: { coding: [ @@ -513,7 +518,8 @@ export const READY_FOR_REVIEW_BIRTH_RECORD: SavedBundle< status: 'active', mode: 'instance', partOf: { - reference: 'Location/0f7684aa-8c65-4901-8318-bf1e22c247cb' + reference: + 'Location/0f7684aa-8c65-4901-8318-bf1e22c247cb' as `Location/${UUID}` }, type: { coding: [ @@ -554,7 +560,8 @@ export const READY_FOR_REVIEW_BIRTH_RECORD: SavedBundle< status: 'active', mode: 'instance', partOf: { - reference: 'Location/af050fc6-5866-455a-9cd2-6437e34a3fbe' + reference: + 'Location/af050fc6-5866-455a-9cd2-6437e34a3fbe' as `Location/${UUID}` }, type: { coding: [ @@ -607,7 +614,8 @@ export const READY_FOR_REVIEW_BIRTH_RECORD: SavedBundle< ], location: [ { - reference: 'Location/ce73938d-a188-4a78-9d19-35dfd4ca6957' + reference: + 'Location/ce73938d-a188-4a78-9d19-35dfd4ca6957' as `Location/${UUID}` } ], meta: { @@ -638,7 +646,7 @@ export const READY_FOR_REVIEW_BIRTH_RECORD: SavedBundle< status: 'active', mode: 'instance', partOf: { - reference: 'Location/0' + reference: 'Location/0' as `Location/${UUID}` }, type: { coding: [ diff --git a/packages/workflow/test/mocks/records/register.ts b/packages/workflow/test/mocks/records/register.ts index 5d7eeb50893..2f3aff1ea60 100644 --- a/packages/workflow/test/mocks/records/register.ts +++ b/packages/workflow/test/mocks/records/register.ts @@ -365,7 +365,8 @@ export const REGISTERED_BIRTH_RECORD: SavedBundle< { url: 'http://opencrvs.org/specs/extension/part-of', valueReference: { - reference: 'Location/c535b9a2-da47-41d0-b0ac-5891e31eeb9f' + reference: + 'Location/c535b9a2-da47-41d0-b0ac-5891e31eeb9f' as `Location/${UUID}` } } ] @@ -414,7 +415,8 @@ export const REGISTERED_BIRTH_RECORD: SavedBundle< ] }, focus: { - reference: 'Composition/7a790b68-9433-47b8-b595-66aae80d044a' + reference: + 'Composition/7a790b68-9433-47b8-b595-66aae80d044a' as `Composition/${UUID}` }, id: 'df49e854-25b3-46b0-b6ea-e2f7f82ea297' as UUID, requester: { @@ -448,13 +450,15 @@ export const REGISTERED_BIRTH_RECORD: SavedBundle< { url: 'http://opencrvs.org/specs/extension/regLastUser', valueReference: { - reference: 'Practitioner/1a3cf855-1132-427f-b125-93c03d79b57f' + reference: + 'Practitioner/1a3cf855-1132-427f-b125-93c03d79b57f' as `Practitioner/${UUID}` } }, { url: 'http://opencrvs.org/specs/extension/regLastOffice', valueReference: { - reference: 'Location/0fad590a-41e4-4b82-a9ab-e8f32c2e7e84' + reference: + 'Location/0fad590a-41e4-4b82-a9ab-e8f32c2e7e84' as `Location/${UUID}` } } ], @@ -519,7 +523,8 @@ export const REGISTERED_BIRTH_RECORD: SavedBundle< status: 'active', mode: 'instance', partOf: { - reference: 'Location/c535b9a2-da47-41d0-b0ac-5891e31eeb9f' + reference: + 'Location/c535b9a2-da47-41d0-b0ac-5891e31eeb9f' as `Location/${UUID}` }, type: { coding: [ @@ -565,7 +570,8 @@ export const REGISTERED_BIRTH_RECORD: SavedBundle< status: 'active', mode: 'instance', partOf: { - reference: 'Location/3fba5456-91e9-4a36-951d-d433173203e8' + reference: + 'Location/3fba5456-91e9-4a36-951d-d433173203e8' as `Location/${UUID}` }, type: { coding: [ @@ -635,7 +641,8 @@ export const REGISTERED_BIRTH_RECORD: SavedBundle< status: 'active', mode: 'instance', partOf: { - reference: 'Location/c535b9a2-da47-41d0-b0ac-5891e31eeb9f' + reference: + 'Location/c535b9a2-da47-41d0-b0ac-5891e31eeb9f' as `Location/${UUID}` }, type: { coding: [ @@ -688,7 +695,8 @@ export const REGISTERED_BIRTH_RECORD: SavedBundle< ], location: [ { - reference: 'Location/0fad590a-41e4-4b82-a9ab-e8f32c2e7e84' + reference: + 'Location/0fad590a-41e4-4b82-a9ab-e8f32c2e7e84' as `Location/${UUID}` } ], meta: { @@ -719,7 +727,7 @@ export const REGISTERED_BIRTH_RECORD: SavedBundle< status: 'active', mode: 'instance', partOf: { - reference: 'Location/0' + reference: 'Location/0' as `Location/${UUID}` }, type: { coding: [ diff --git a/packages/workflow/tsconfig.json b/packages/workflow/tsconfig.json index 19bc08df75f..ceef8c93344 100644 --- a/packages/workflow/tsconfig.json +++ b/packages/workflow/tsconfig.json @@ -3,10 +3,10 @@ "baseUrl": "./src", "paths": { "@test/*": ["../test/*"], - "@workflow/*": ["./*"], + "@workflow/*": ["./*"] }, "target": "es6", - "module": "commonjs", + "module": "node16", "outDir": "build/dist", "sourceMap": true, "moduleResolution": "node16", diff --git a/yarn.lock b/yarn.lock index 7921d4f2588..ee0a33fa1d8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -730,6 +730,23 @@ "@babel/highlight" "^7.24.6" picocolors "^1.0.0" +"@babel/code-frame@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.25.9.tgz#895b6c7e04a7271a0cbfd575d2e8131751914cc7" + integrity sha512-z88xeGxnzehn2sqZ8UdGQEvYErF1odv2CftxInpSYJt6uHuPe9YjahKZITGs3l5LeI9d2ROG+obuDAoSlqbNfQ== + dependencies: + "@babel/highlight" "^7.25.9" + picocolors "^1.0.0" + +"@babel/code-frame@^7.26.0": + version "7.26.2" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.26.2.tgz#4b5fab97d33338eff916235055f0ebc21e573a85" + integrity sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ== + dependencies: + "@babel/helper-validator-identifier" "^7.25.9" + js-tokens "^4.0.0" + picocolors "^1.0.0" + "@babel/compat-data@^7.20.5", "@babel/compat-data@^7.22.6", "@babel/compat-data@^7.22.9", "@babel/compat-data@^7.23.2": version "7.23.2" resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.23.2.tgz" @@ -755,7 +772,33 @@ resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.25.4.tgz#7d2a80ce229890edcf4cc259d4d696cb4dae2fcb" integrity sha512-+LGRog6RAsCJrrrg/IO6LGmpphNe5DiK30dGjCoxxeGv49B10/3XYGxPsAwrDlMFcFEvdAUavDT8r9k/hSyQqQ== -"@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.14.0", "@babel/core@^7.14.3", "@babel/core@^7.18.9", "@babel/core@^7.19.6", "@babel/core@^7.22.9": +"@babel/compat-data@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.25.9.tgz#24b01c5db6a3ebf85661b4fb4a946a9bccc72ac8" + integrity sha512-yD+hEuJ/+wAJ4Ox2/rpNv5HIuPG82x3ZlQvYVn8iYCprdxzE7P1udpGF1jyjQVBU4dgznN+k2h103vxZ7NdPyw== + +"@babel/core@^7.11.6", "@babel/core@^7.20.12", "@babel/core@^7.23.0", "@babel/core@^7.23.2": + version "7.25.2" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.25.2.tgz#ed8eec275118d7613e77a352894cd12ded8eba77" + integrity sha512-BBt3opiCOxUr9euZ5/ro/Xv8/V7yJ5bjYMqG/C1YAo8MIKAnumZalCN+msbci3Pigy4lIQfPUpfMM27HMGaYEA== + dependencies: + "@ampproject/remapping" "^2.2.0" + "@babel/code-frame" "^7.24.7" + "@babel/generator" "^7.25.0" + "@babel/helper-compilation-targets" "^7.25.2" + "@babel/helper-module-transforms" "^7.25.2" + "@babel/helpers" "^7.25.0" + "@babel/parser" "^7.25.0" + "@babel/template" "^7.25.0" + "@babel/traverse" "^7.25.2" + "@babel/types" "^7.25.2" + convert-source-map "^2.0.0" + debug "^4.1.0" + gensync "^1.0.0-beta.2" + json5 "^2.2.3" + semver "^6.3.1" + +"@babel/core@^7.12.3", "@babel/core@^7.14.0", "@babel/core@^7.14.3", "@babel/core@^7.18.9", "@babel/core@^7.19.6", "@babel/core@^7.22.9": version "7.23.2" resolved "https://registry.npmjs.org/@babel/core/-/core-7.23.2.tgz" integrity sha512-n7s51eWdaWZ3vGT2tD4T7J6eJs3QoBXydv7vkUM06Bf1cbVD2Kc2UrkzhiQwobfV7NwOnQXYL7UBJ5VPU+RGoQ== @@ -776,21 +819,42 @@ json5 "^2.2.3" semver "^6.3.1" -"@babel/core@^7.11.6", "@babel/core@^7.20.12", "@babel/core@^7.23.0", "@babel/core@^7.23.2": - version "7.25.2" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.25.2.tgz#ed8eec275118d7613e77a352894cd12ded8eba77" - integrity sha512-BBt3opiCOxUr9euZ5/ro/Xv8/V7yJ5bjYMqG/C1YAo8MIKAnumZalCN+msbci3Pigy4lIQfPUpfMM27HMGaYEA== +"@babel/core@^7.17.7": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.25.9.tgz#855a4cddcec4158f3f7afadacdab2a7de8af7434" + integrity sha512-WYvQviPw+Qyib0v92AwNIrdLISTp7RfDkM7bPqBvpbnhY4wq8HvHBZREVdYDXk98C8BkOIVnHAY3yvj7AVISxQ== dependencies: "@ampproject/remapping" "^2.2.0" - "@babel/code-frame" "^7.24.7" - "@babel/generator" "^7.25.0" - "@babel/helper-compilation-targets" "^7.25.2" - "@babel/helper-module-transforms" "^7.25.2" - "@babel/helpers" "^7.25.0" - "@babel/parser" "^7.25.0" - "@babel/template" "^7.25.0" - "@babel/traverse" "^7.25.2" - "@babel/types" "^7.25.2" + "@babel/code-frame" "^7.25.9" + "@babel/generator" "^7.25.9" + "@babel/helper-compilation-targets" "^7.25.9" + "@babel/helper-module-transforms" "^7.25.9" + "@babel/helpers" "^7.25.9" + "@babel/parser" "^7.25.9" + "@babel/template" "^7.25.9" + "@babel/traverse" "^7.25.9" + "@babel/types" "^7.25.9" + convert-source-map "^2.0.0" + debug "^4.1.0" + gensync "^1.0.0-beta.2" + json5 "^2.2.3" + semver "^6.3.1" + +"@babel/core@^7.23.9": + version "7.26.0" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.26.0.tgz#d78b6023cc8f3114ccf049eb219613f74a747b40" + integrity sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg== + dependencies: + "@ampproject/remapping" "^2.2.0" + "@babel/code-frame" "^7.26.0" + "@babel/generator" "^7.26.0" + "@babel/helper-compilation-targets" "^7.25.9" + "@babel/helper-module-transforms" "^7.26.0" + "@babel/helpers" "^7.26.0" + "@babel/parser" "^7.26.0" + "@babel/template" "^7.25.9" + "@babel/traverse" "^7.25.9" + "@babel/types" "^7.26.0" convert-source-map "^2.0.0" debug "^4.1.0" gensync "^1.0.0-beta.2" @@ -839,27 +903,6 @@ json5 "^2.2.3" semver "^6.3.1" -"@babel/core@^7.7.2", "@babel/core@^7.8.0": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.24.7.tgz#b676450141e0b52a3d43bc91da86aa608f950ac4" - integrity sha512-nykK+LEK86ahTkX/3TgauT0ikKoNCfKHEaZYTUVupJdTLzGNvrblu4u6fa7DhZONAltdf8e662t/abY8idrd/g== - dependencies: - "@ampproject/remapping" "^2.2.0" - "@babel/code-frame" "^7.24.7" - "@babel/generator" "^7.24.7" - "@babel/helper-compilation-targets" "^7.24.7" - "@babel/helper-module-transforms" "^7.24.7" - "@babel/helpers" "^7.24.7" - "@babel/parser" "^7.24.7" - "@babel/template" "^7.24.7" - "@babel/traverse" "^7.24.7" - "@babel/types" "^7.24.7" - convert-source-map "^2.0.0" - debug "^4.1.0" - gensync "^1.0.0-beta.2" - json5 "^2.2.3" - semver "^6.3.1" - "@babel/eslint-parser@^7.14.3": version "7.22.15" resolved "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.22.15.tgz" @@ -919,6 +962,27 @@ "@jridgewell/trace-mapping" "^0.3.25" jsesc "^2.5.1" +"@babel/generator@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.25.9.tgz#c7e828ebe0c2baba103b712924699c9e8a6e32f0" + integrity sha512-omlUGkr5EaoIJrhLf9CJ0TvjBRpd9+AXRG//0GEQ9THSo8wPiTlbpy1/Ow8ZTrbXpjd9FHXfbFQx32I04ht0FA== + dependencies: + "@babel/types" "^7.25.9" + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.25" + jsesc "^3.0.2" + +"@babel/generator@^7.26.0": + version "7.26.2" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.26.2.tgz#87b75813bec87916210e5e01939a4c823d6bb74f" + integrity sha512-zevQbhbau95nkoxSq3f/DC/SC+EEOUZd3DYqfSkMhY2/wfSeaHV1Ew4vk8e+x8lja31IbyuUa2uQ3JONqKbysw== + dependencies: + "@babel/parser" "^7.26.2" + "@babel/types" "^7.26.0" + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.25" + jsesc "^3.0.2" + "@babel/helper-annotate-as-pure@^7.22.5": version "7.22.5" resolved "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz" @@ -1003,6 +1067,17 @@ lru-cache "^5.1.1" semver "^6.3.1" +"@babel/helper-compilation-targets@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.9.tgz#55af025ce365be3cdc0c1c1e56c6af617ce88875" + integrity sha512-j9Db8Suy6yV/VHa4qzrj9yZfZxhLWQdVnRlXxmKLYlhWUVB1sB2G5sxuWYXk/whHD9iW76PmNzxZ4UCnTQTVEQ== + dependencies: + "@babel/compat-data" "^7.25.9" + "@babel/helper-validator-option" "^7.25.9" + browserslist "^4.24.0" + lru-cache "^5.1.1" + semver "^6.3.1" + "@babel/helper-create-class-features-plugin@^7.18.6", "@babel/helper-create-class-features-plugin@^7.22.11", "@babel/helper-create-class-features-plugin@^7.22.5": version "7.22.15" resolved "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.22.15.tgz" @@ -1177,6 +1252,14 @@ "@babel/traverse" "^7.24.7" "@babel/types" "^7.24.7" +"@babel/helper-module-imports@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz#e7f8d20602ebdbf9ebbea0a0751fb0f2a4141715" + integrity sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw== + dependencies: + "@babel/traverse" "^7.25.9" + "@babel/types" "^7.25.9" + "@babel/helper-module-transforms@^7.22.5", "@babel/helper-module-transforms@^7.23.0": version "7.23.0" resolved "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.23.0.tgz" @@ -1231,6 +1314,25 @@ "@babel/helper-validator-identifier" "^7.24.7" "@babel/traverse" "^7.25.2" +"@babel/helper-module-transforms@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.25.9.tgz#12e4fb2969197ef6d78ea8a2f24375ce85b425fb" + integrity sha512-TvLZY/F3+GvdRYFZFyxMvnsKi+4oJdgZzU3BoGN9Uc2d9C6zfNwJcKKhjqLAhK8i46mv93jsO74fDh3ih6rpHA== + dependencies: + "@babel/helper-module-imports" "^7.25.9" + "@babel/helper-simple-access" "^7.25.9" + "@babel/helper-validator-identifier" "^7.25.9" + "@babel/traverse" "^7.25.9" + +"@babel/helper-module-transforms@^7.26.0": + version "7.26.0" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz#8ce54ec9d592695e58d84cd884b7b5c6a2fdeeae" + integrity sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw== + dependencies: + "@babel/helper-module-imports" "^7.25.9" + "@babel/helper-validator-identifier" "^7.25.9" + "@babel/traverse" "^7.25.9" + "@babel/helper-optimise-call-expression@^7.22.5": version "7.22.5" resolved "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.22.5.tgz" @@ -1265,6 +1367,11 @@ resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.8.tgz#94ee67e8ec0e5d44ea7baeb51e571bd26af07878" integrity sha512-FFWx5142D8h2Mgr/iPVGH5G7w6jDn4jUSpZTyDnQO0Yn7Ks2Kuz6Pci8H6MPCoUJegd/UZQ3tAvfLCxQSnWWwg== +"@babel/helper-plugin-utils@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.9.tgz#9cbdd63a9443a2c92a725cca7ebca12cc8dd9f46" + integrity sha512-kSMlyUVdWe25rEsRGviIgOWnoT/nfABVWlqt9N19/dIPWViAOW2s9wznP5tURbs/IDuNk4gPy3YdYRgH3uxhBw== + "@babel/helper-remap-async-to-generator@^7.22.20", "@babel/helper-remap-async-to-generator@^7.22.5": version "7.22.20" resolved "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.22.20.tgz" @@ -1330,6 +1437,14 @@ "@babel/traverse" "^7.24.7" "@babel/types" "^7.24.7" +"@babel/helper-simple-access@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.25.9.tgz#6d51783299884a2c74618d6ef0f86820ec2e7739" + integrity sha512-c6WHXuiaRsJTyHYLJV75t9IqsmTbItYfdj99PnzYGQZkYKvan5/2jKJ7gu31J3/BJ/A18grImSPModuyG/Eo0Q== + dependencies: + "@babel/traverse" "^7.25.9" + "@babel/types" "^7.25.9" + "@babel/helper-skip-transparent-expression-wrappers@^7.22.5": version "7.22.5" resolved "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.22.5.tgz" @@ -1398,6 +1513,11 @@ resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz#5b3329c9a58803d5df425e5785865881a81ca48d" integrity sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ== +"@babel/helper-string-parser@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz#1aabb72ee72ed35789b4bbcad3ca2862ce614e8c" + integrity sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA== + "@babel/helper-validator-identifier@^7.22.20": version "7.22.20" resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz" @@ -1418,6 +1538,11 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz#75b889cfaf9e35c2aaf42cf0d72c8e91719251db" integrity sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w== +"@babel/helper-validator-identifier@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz#24b64e2c3ec7cd3b3c547729b8d16871f22cbdc7" + integrity sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ== + "@babel/helper-validator-option@^7.22.15": version "7.22.15" resolved "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.15.tgz" @@ -1443,6 +1568,11 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.24.8.tgz#3725cdeea8b480e86d34df15304806a06975e33d" integrity sha512-xb8t9tD1MHLungh/AIoWYN+gVHaB9kwlu8gffXGSt3FFEIT7RjS+xWbc2vUD1UTZdIpKj/ab3rdqJ7ufngyi2Q== +"@babel/helper-validator-option@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz#86e45bd8a49ab7e03f276577f96179653d41da72" + integrity sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw== + "@babel/helper-wrap-function@^7.22.20": version "7.22.20" resolved "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.22.20.tgz" @@ -1487,14 +1617,6 @@ "@babel/template" "^7.24.6" "@babel/types" "^7.24.6" -"@babel/helpers@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.24.7.tgz#aa2ccda29f62185acb5d42fb4a3a1b1082107416" - integrity sha512-NlmJJtvcw72yRJRcnCmGvSi+3jDEg8qFu3z0AFoymmzLx5ERVWyzd9kVXr7Th9/8yIJi2Zc6av4Tqz3wFs8QWg== - dependencies: - "@babel/template" "^7.24.7" - "@babel/types" "^7.24.7" - "@babel/helpers@^7.25.0": version "7.25.6" resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.25.6.tgz#57ee60141829ba2e102f30711ffe3afab357cc60" @@ -1503,6 +1625,22 @@ "@babel/template" "^7.25.0" "@babel/types" "^7.25.6" +"@babel/helpers@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.25.9.tgz#9e26aa6fbefdbca4f8c8a1d66dc6f1c00ddadb0a" + integrity sha512-oKWp3+usOJSzDZOucZUAMayhPz/xVjzymyDzUN8dk0Wd3RWMlGLXi07UCQ/CgQVb8LvXx3XBajJH4XGgkt7H7g== + dependencies: + "@babel/template" "^7.25.9" + "@babel/types" "^7.25.9" + +"@babel/helpers@^7.26.0": + version "7.26.0" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.26.0.tgz#30e621f1eba5aa45fe6f4868d2e9154d884119a4" + integrity sha512-tbhNuIxNcVb21pInl3ZSjksLCvgdZy9KwJ8brv993QtIVKJBBkYXz4q4ZbAv31GdnC+R90np23L5FbEBlthAEw== + dependencies: + "@babel/template" "^7.25.9" + "@babel/types" "^7.26.0" + "@babel/highlight@^7.10.4", "@babel/highlight@^7.22.13": version "7.22.20" resolved "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz" @@ -1542,11 +1680,28 @@ js-tokens "^4.0.0" picocolors "^1.0.0" +"@babel/highlight@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.25.9.tgz#8141ce68fc73757946f983b343f1231f4691acc6" + integrity sha512-llL88JShoCsth8fF8R4SJnIn+WLvR6ccFxu1H3FlMhDontdcmZWf2HgIZ7AIqV3Xcck1idlohrN4EUBQz6klbw== + dependencies: + "@babel/helper-validator-identifier" "^7.25.9" + chalk "^2.4.2" + js-tokens "^4.0.0" + picocolors "^1.0.0" + "@babel/parser@^7.1.0", "@babel/parser@^7.14.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.8", "@babel/parser@^7.20.7", "@babel/parser@^7.22.15", "@babel/parser@^7.23.0", "@babel/parser@^7.8.3", "@babel/parser@^7.8.4": version "7.23.0" resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz" integrity sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw== +"@babel/parser@^7.23.9", "@babel/parser@^7.25.9", "@babel/parser@^7.26.0", "@babel/parser@^7.26.2": + version "7.26.2" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.26.2.tgz#fd7b6f487cfea09889557ef5d4eeb9ff9a5abd11" + integrity sha512-DWMCZH9WA4Maitz2q21SRKHo9QXZxkDsbNZoVD62gusNtNBBqDg9i7uOhASfTfIGNzW+O+r7+jAlM8dwphcJKQ== + dependencies: + "@babel/types" "^7.26.0" + "@babel/parser@^7.24.0": version "7.24.4" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.24.4.tgz#234487a110d89ad5a3ed4a8a566c36b9453e8c88" @@ -1758,6 +1913,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" +"@babel/plugin-syntax-jsx@^7.16.7", "@babel/plugin-syntax-jsx@^7.7.2": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.25.9.tgz#a34313a178ea56f1951599b929c1ceacee719290" + integrity sha512-ld6oezHQMZsZfp6pWtbjaNDF2tiiCYYDqQszHt5VV437lewP9aSi2Of99CK0D0XB21k7FLgnLcmQKyKzynfeAA== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/plugin-syntax-jsx@^7.24.7": version "7.24.7" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.24.7.tgz#39a1fa4a7e3d3d7f34e2acc6be585b718d30e02d" @@ -1821,6 +1983,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.14.5" +"@babel/plugin-syntax-typescript@^7.16.7": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.25.9.tgz#67dda2b74da43727cf21d46cf9afef23f4365399" + integrity sha512-hjMgRy5hb8uJJjUcdWunWVcoi9bGpJp8p5Ol1229PoN6aytsLwNMgmdftO23wnCLMfVmTwZDWMPNq/D1SY60JQ== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/plugin-syntax-typescript@^7.24.7": version "7.25.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.25.4.tgz#04db9ce5a9043d9c635e75ae7969a2cd50ca97ff" @@ -2932,6 +3101,13 @@ dependencies: regenerator-runtime "^0.14.0" +"@babel/runtime@^7.12.5": + version "7.26.0" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.26.0.tgz#8600c2f595f277c60815256418b85356a65173c1" + integrity sha512-FDSOghenHTiToteC/QRlv2q3DhPZ/oOXTBoirfWNx1Cx3TMVcGWQtMMmQcSvb/JjpNeGzx8Pq/b4fKEJuWm1sw== + dependencies: + regenerator-runtime "^0.14.0" + "@babel/runtime@^7.13.10": version "7.25.6" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.25.6.tgz#9afc3289f7184d8d7f98b099884c26317b9264d2" @@ -2984,6 +3160,15 @@ "@babel/parser" "^7.25.0" "@babel/types" "^7.25.0" +"@babel/template@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.25.9.tgz#ecb62d81a8a6f5dc5fe8abfc3901fc52ddf15016" + integrity sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg== + dependencies: + "@babel/code-frame" "^7.25.9" + "@babel/parser" "^7.25.9" + "@babel/types" "^7.25.9" + "@babel/traverse@^7.14.0", "@babel/traverse@^7.16.8", "@babel/traverse@^7.18.9", "@babel/traverse@^7.23.2", "@babel/traverse@^7.4.5", "@babel/traverse@^7.8.3": version "7.23.2" resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz" @@ -3032,7 +3217,7 @@ debug "^4.3.1" globals "^11.1.0" -"@babel/traverse@^7.24.7", "@babel/traverse@^7.7.2": +"@babel/traverse@^7.24.7": version "7.24.7" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.24.7.tgz#de2b900163fa741721ba382163fe46a936c40cf5" integrity sha512-yb65Ed5S/QAcewNPh0nZczy9JdYXkkAbIsEo+P7BE7yO3txAY30Y/oPa3QkQ5It3xVG2kpKMg9MsdxZaO31uKA== @@ -3061,6 +3246,19 @@ debug "^4.3.1" globals "^11.1.0" +"@babel/traverse@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.25.9.tgz#a50f8fe49e7f69f53de5bea7e413cd35c5e13c84" + integrity sha512-ZCuvfwOwlz/bawvAuvcj8rrithP2/N55Tzz342AkTvq4qaWbGfmCk/tKhNaV2cthijKrPAA8SRJV5WWe7IBMJw== + dependencies: + "@babel/code-frame" "^7.25.9" + "@babel/generator" "^7.25.9" + "@babel/parser" "^7.25.9" + "@babel/template" "^7.25.9" + "@babel/types" "^7.25.9" + debug "^4.3.1" + globals "^11.1.0" + "@babel/types@^7.0.0", "@babel/types@^7.16.8", "@babel/types@^7.18.13", "@babel/types@^7.18.9", "@babel/types@^7.20.7", "@babel/types@^7.22.15", "@babel/types@^7.22.19", "@babel/types@^7.22.5", "@babel/types@^7.23.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": version "7.23.0" resolved "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz" @@ -3115,6 +3313,22 @@ "@babel/helper-validator-identifier" "^7.24.7" to-fast-properties "^2.0.0" +"@babel/types@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.25.9.tgz#620f35ea1f4233df529ec9a2668d2db26574deee" + integrity sha512-OwS2CM5KocvQ/k7dFJa8i5bNGJP0hXWfVCfDkqRFP1IreH1JDC7wG6eCYCi0+McbfT8OR/kNqsI0UU0xP9H6PQ== + dependencies: + "@babel/helper-string-parser" "^7.25.9" + "@babel/helper-validator-identifier" "^7.25.9" + +"@babel/types@^7.26.0": + version "7.26.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.26.0.tgz#deabd08d6b753bc8e0f198f8709fb575e31774ff" + integrity sha512-Z/yiTPj+lDVnF7lWeKCIJzaIkI0vYO87dMpZ4bg4TDrFe4XXLFWL1TbXU27gBP3QccxV9mZICCrnjnYlJjXHOA== + dependencies: + "@babel/helper-string-parser" "^7.25.9" + "@babel/helper-validator-identifier" "^7.25.9" + "@balena/dockerignore@^1.0.2": version "1.0.2" resolved "https://registry.npmjs.org/@balena/dockerignore/-/dockerignore-1.0.2.tgz" @@ -3643,14 +3857,6 @@ resolved "https://registry.npmjs.org/@foliojs-fork/restructure/-/restructure-2.0.2.tgz" integrity sha512-59SgoZ3EXbkfSX7b63tsou/SDGzwUEK6MuB5sKqgVK1/XE0fxmpsOb9DQI8LXW3KfGnAjImCGhhEb7uPPAUVNA== -"@formatjs/ecma402-abstract@1.11.3": - version "1.11.3" - resolved "https://registry.yarnpkg.com/@formatjs/ecma402-abstract/-/ecma402-abstract-1.11.3.tgz#f25276dfd4ef3dac90da667c3961d8aa9732e384" - integrity sha512-kP/Buv5vVFMAYLHNvvUzr0lwRTU0u2WTy44Tqwku1X3C3lJ5dKqDCYVqA8wL+Y19Bq+MwHgxqd5FZJRCIsLRyQ== - dependencies: - "@formatjs/intl-localematcher" "0.2.24" - tslib "^2.1.0" - "@formatjs/ecma402-abstract@1.11.4": version "1.11.4" resolved "https://registry.yarnpkg.com/@formatjs/ecma402-abstract/-/ecma402-abstract-1.11.4.tgz#b962dfc4ae84361f9f08fbce411b4e4340930eda" @@ -3659,6 +3865,14 @@ "@formatjs/intl-localematcher" "0.2.25" tslib "^2.1.0" +"@formatjs/ecma402-abstract@1.14.3": + version "1.14.3" + resolved "https://registry.yarnpkg.com/@formatjs/ecma402-abstract/-/ecma402-abstract-1.14.3.tgz#6428f243538a11126180d121ce8d4b2f17465738" + integrity sha512-SlsbRC/RX+/zg4AApWIFNDdkLtFbkq3LNoZWXZCE/nHVKqoIJyaoQyge/I0Y38vLxowUn9KTtXgusLD91+orbg== + dependencies: + "@formatjs/intl-localematcher" "0.2.32" + tslib "^2.4.0" + "@formatjs/fast-memoize@1.2.1": version "1.2.1" resolved "https://registry.yarnpkg.com/@formatjs/fast-memoize/-/fast-memoize-1.2.1.tgz#e6f5aee2e4fd0ca5edba6eba7668e2d855e0fc21" @@ -3666,15 +3880,6 @@ dependencies: tslib "^2.1.0" -"@formatjs/icu-messageformat-parser@2.0.18": - version "2.0.18" - resolved "https://registry.yarnpkg.com/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.0.18.tgz#b09e8f16b88e988fd125e7c5810300e8a6dd2c42" - integrity sha512-vquIzsAJJmZ5jWVH8dEgUKcbG4yu3KqtyPet+q35SW5reLOvblkfeCXTRW2TpIwNXzdVqsJBwjbTiRiSU9JxwQ== - dependencies: - "@formatjs/ecma402-abstract" "1.11.3" - "@formatjs/icu-skeleton-parser" "1.3.5" - tslib "^2.1.0" - "@formatjs/icu-messageformat-parser@2.1.0": version "2.1.0" resolved "https://registry.yarnpkg.com/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.1.0.tgz#a54293dd7f098d6a6f6a084ab08b6d54a3e8c12d" @@ -3684,13 +3889,22 @@ "@formatjs/icu-skeleton-parser" "1.3.6" tslib "^2.1.0" -"@formatjs/icu-skeleton-parser@1.3.5": - version "1.3.5" - resolved "https://registry.yarnpkg.com/@formatjs/icu-skeleton-parser/-/icu-skeleton-parser-1.3.5.tgz#babc93a1c36383cf87cbb3d2f2145d26c2f7cb40" - integrity sha512-Nhyo2/6kG7ZfgeEfo02sxviOuBcvtzH6SYUharj3DLCDJH3A/4OxkKcmx/2PWGX4bc6iSieh+FA94CsKDxnZBQ== +"@formatjs/icu-messageformat-parser@2.3.1": + version "2.3.1" + resolved "https://registry.yarnpkg.com/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.3.1.tgz#953080ea5c053bc73bdf55d0a524a3c3c133ae6b" + integrity sha512-knF2AkAKN4Upv4oIiKY4Wd/dLH68TNMPgV/tJMu/T6FP9aQwbv8fpj7U3lkyniPaNVxvia56Gxax8MKOjtxLSQ== dependencies: - "@formatjs/ecma402-abstract" "1.11.3" - tslib "^2.1.0" + "@formatjs/ecma402-abstract" "1.14.3" + "@formatjs/icu-skeleton-parser" "1.3.18" + tslib "^2.4.0" + +"@formatjs/icu-skeleton-parser@1.3.18": + version "1.3.18" + resolved "https://registry.yarnpkg.com/@formatjs/icu-skeleton-parser/-/icu-skeleton-parser-1.3.18.tgz#7aed3d60e718c8ad6b0e64820be44daa1e29eeeb" + integrity sha512-ND1ZkZfmLPcHjAH1sVpkpQxA+QYfOX3py3SjKWMUVGDow18gZ0WPqz3F+pJLYQMpS2LnnQ5zYR2jPVYTbRwMpg== + dependencies: + "@formatjs/ecma402-abstract" "1.14.3" + tslib "^2.4.0" "@formatjs/icu-skeleton-parser@1.3.6": version "1.3.6" @@ -3718,13 +3932,6 @@ "@formatjs/intl-localematcher" "0.2.25" tslib "^2.1.0" -"@formatjs/intl-localematcher@0.2.24": - version "0.2.24" - resolved "https://registry.yarnpkg.com/@formatjs/intl-localematcher/-/intl-localematcher-0.2.24.tgz#b49fd753c0f54421f26a3c1d0e9cf98a3966e78f" - integrity sha512-K/HRGo6EMnCbhpth/y3u4rW4aXkmQNqRe1L2G+Y5jNr3v0gYhvaucV8WixNju/INAMbPBlbsRBRo/nfjnoOnxQ== - dependencies: - tslib "^2.1.0" - "@formatjs/intl-localematcher@0.2.25": version "0.2.25" resolved "https://registry.yarnpkg.com/@formatjs/intl-localematcher/-/intl-localematcher-0.2.25.tgz#60892fe1b271ec35ba07a2eb018a2dd7bca6ea3a" @@ -3732,6 +3939,13 @@ dependencies: tslib "^2.1.0" +"@formatjs/intl-localematcher@0.2.32": + version "0.2.32" + resolved "https://registry.yarnpkg.com/@formatjs/intl-localematcher/-/intl-localematcher-0.2.32.tgz#00d4d307cd7d514b298e15a11a369b86c8933ec1" + integrity sha512-k/MEBstff4sttohyEpXxCmC3MqbUn9VvHGlZ8fauLzkbwXmVrEeyzS+4uhrvAk9DWU9/7otYWxyDox4nT/KVLQ== + dependencies: + tslib "^2.4.0" + "@formatjs/intl@2.2.1": version "2.2.1" resolved "https://registry.yarnpkg.com/@formatjs/intl/-/intl-2.2.1.tgz#6daf4dabed055b17f467f0aa1bc073a626bc9189" @@ -3745,16 +3959,18 @@ intl-messageformat "9.13.0" tslib "^2.1.0" -"@formatjs/ts-transformer@3.9.2": - version "3.9.2" - resolved "https://registry.yarnpkg.com/@formatjs/ts-transformer/-/ts-transformer-3.9.2.tgz#958582b16ed9125fd904c051a9dda1ecd2474a5a" - integrity sha512-Iff+ca1ue3IOb/PDNANR6++EArwlyMpW+t6AL4MG5sordpgflsIh8BMz6nGs+/tUOjP0xioNAu/acYiQ+rW5Bw== +"@formatjs/ts-transformer@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@formatjs/ts-transformer/-/ts-transformer-3.13.0.tgz#61185278fb153d61e56fabbeed6d4fc8a0ee3af5" + integrity sha512-TshsXkt2loK2GWFJFYTrlNThfCd4ubcEpokl9FWzGoR5f5e2FOxDPs69nTqw+7jodlKtx4VaTSfpNMtPvD9ZfQ== dependencies: - "@formatjs/icu-messageformat-parser" "2.0.18" + "@formatjs/icu-messageformat-parser" "2.3.1" + "@types/json-stable-stringify" "^1.0.32" "@types/node" "14 || 16 || 17" chalk "^4.0.0" - tslib "^2.1.0" - typescript "^4.5" + json-stable-stringify "^1.0.1" + tslib "^2.4.0" + typescript "^4.7 || 5" "@graphql-codegen/add@^5.0.0", "@graphql-codegen/add@^5.0.3": version "5.0.3" @@ -4967,113 +5183,128 @@ resolved "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.5.1.tgz#260fe7239602fe5130a94f1aa386eff54b014bba" - integrity sha512-kZ/tNpS3NXn0mlXXXPNuDZnb4c0oZ20r4K5eemM2k30ZC3G0T02nXUvyhf5YdbXWHPEJLc9qGLxEZ216MdL+Zg== +"@jest/console@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.7.0.tgz#cd4822dbdb84529265c5a2bdb529a3c9cc950ffc" + integrity sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg== dependencies: - "@jest/types" "^27.5.1" + "@jest/types" "^29.6.3" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^27.5.1" - jest-util "^27.5.1" + jest-message-util "^29.7.0" + jest-util "^29.7.0" slash "^3.0.0" -"@jest/core@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.5.1.tgz#267ac5f704e09dc52de2922cbf3af9edcd64b626" - integrity sha512-AK6/UTrvQD0Cd24NSqmIA6rKsu0tKIxfiCducZvqxYdmMisOYAsdItspT+fQDQYARPf8XgjAFZi0ogW2agH5nQ== +"@jest/core@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.7.0.tgz#b6cccc239f30ff36609658c5a5e2291757ce448f" + integrity sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg== dependencies: - "@jest/console" "^27.5.1" - "@jest/reporters" "^27.5.1" - "@jest/test-result" "^27.5.1" - "@jest/transform" "^27.5.1" - "@jest/types" "^27.5.1" + "@jest/console" "^29.7.0" + "@jest/reporters" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" - emittery "^0.8.1" + ci-info "^3.2.0" exit "^0.1.2" graceful-fs "^4.2.9" - jest-changed-files "^27.5.1" - jest-config "^27.5.1" - jest-haste-map "^27.5.1" - jest-message-util "^27.5.1" - jest-regex-util "^27.5.1" - jest-resolve "^27.5.1" - jest-resolve-dependencies "^27.5.1" - jest-runner "^27.5.1" - jest-runtime "^27.5.1" - jest-snapshot "^27.5.1" - jest-util "^27.5.1" - jest-validate "^27.5.1" - jest-watcher "^27.5.1" + jest-changed-files "^29.7.0" + jest-config "^29.7.0" + jest-haste-map "^29.7.0" + jest-message-util "^29.7.0" + jest-regex-util "^29.6.3" + jest-resolve "^29.7.0" + jest-resolve-dependencies "^29.7.0" + jest-runner "^29.7.0" + jest-runtime "^29.7.0" + jest-snapshot "^29.7.0" + jest-util "^29.7.0" + jest-validate "^29.7.0" + jest-watcher "^29.7.0" micromatch "^4.0.4" - rimraf "^3.0.0" + pretty-format "^29.7.0" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.5.1.tgz#d7425820511fe7158abbecc010140c3fd3be9c74" - integrity sha512-/WQjhPJe3/ghaol/4Bq480JKXV/Rfw8nQdN7f41fM8VDHLcxKXou6QyXAh3EFr9/bVG3x74z1NWDkP87EiY8gA== +"@jest/environment@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.7.0.tgz#24d61f54ff1f786f3cd4073b4b94416383baf2a7" + integrity sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw== dependencies: - "@jest/fake-timers" "^27.5.1" - "@jest/types" "^27.5.1" + "@jest/fake-timers" "^29.7.0" + "@jest/types" "^29.6.3" "@types/node" "*" - jest-mock "^27.5.1" + jest-mock "^29.7.0" + +"@jest/expect-utils@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.7.0.tgz#023efe5d26a8a70f21677d0a1afc0f0a44e3a1c6" + integrity sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA== + dependencies: + jest-get-type "^29.6.3" + +"@jest/expect@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.7.0.tgz#76a3edb0cb753b70dfbfe23283510d3d45432bf2" + integrity sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ== + dependencies: + expect "^29.7.0" + jest-snapshot "^29.7.0" -"@jest/fake-timers@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.5.1.tgz#76979745ce0579c8a94a4678af7a748eda8ada74" - integrity sha512-/aPowoolwa07k7/oM3aASneNeBGCmGQsc3ugN4u6s4C/+s5M64MFo/+djTdiwcbQlRfFElGuDXWzaWj6QgKObQ== +"@jest/fake-timers@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.7.0.tgz#fd91bf1fffb16d7d0d24a426ab1a47a49881a565" + integrity sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ== dependencies: - "@jest/types" "^27.5.1" - "@sinonjs/fake-timers" "^8.0.1" + "@jest/types" "^29.6.3" + "@sinonjs/fake-timers" "^10.0.2" "@types/node" "*" - jest-message-util "^27.5.1" - jest-mock "^27.5.1" - jest-util "^27.5.1" + jest-message-util "^29.7.0" + jest-mock "^29.7.0" + jest-util "^29.7.0" -"@jest/globals@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.5.1.tgz#7ac06ce57ab966566c7963431cef458434601b2b" - integrity sha512-ZEJNB41OBQQgGzgyInAv0UUfDDj3upmHydjieSxFvTRuZElrx7tXg/uVQ5hYVEwiXs3+aMsAeEc9X7xiSKCm4Q== +"@jest/globals@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.7.0.tgz#8d9290f9ec47ff772607fa864ca1d5a2efae1d4d" + integrity sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ== dependencies: - "@jest/environment" "^27.5.1" - "@jest/types" "^27.5.1" - expect "^27.5.1" + "@jest/environment" "^29.7.0" + "@jest/expect" "^29.7.0" + "@jest/types" "^29.6.3" + jest-mock "^29.7.0" -"@jest/reporters@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.5.1.tgz#ceda7be96170b03c923c37987b64015812ffec04" - integrity sha512-cPXh9hWIlVJMQkVk84aIvXuBB4uQQmFqZiacloFuGiP3ah1sbCxCosidXFDfqG8+6fO1oR2dTJTlsOy4VFmUfw== +"@jest/reporters@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.7.0.tgz#04b262ecb3b8faa83b0b3d321623972393e8f4c7" + integrity sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^27.5.1" - "@jest/test-result" "^27.5.1" - "@jest/transform" "^27.5.1" - "@jest/types" "^27.5.1" + "@jest/console" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" + "@jridgewell/trace-mapping" "^0.3.18" "@types/node" "*" chalk "^4.0.0" collect-v8-coverage "^1.0.0" exit "^0.1.2" - glob "^7.1.2" + glob "^7.1.3" graceful-fs "^4.2.9" istanbul-lib-coverage "^3.0.0" - istanbul-lib-instrument "^5.1.0" + istanbul-lib-instrument "^6.0.0" istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.1.3" - jest-haste-map "^27.5.1" - jest-resolve "^27.5.1" - jest-util "^27.5.1" - jest-worker "^27.5.1" + jest-message-util "^29.7.0" + jest-util "^29.7.0" + jest-worker "^29.7.0" slash "^3.0.0" - source-map "^0.6.0" string-length "^4.0.1" - terminal-link "^2.0.0" - v8-to-istanbul "^8.1.0" + strip-ansi "^6.0.0" + v8-to-istanbul "^9.0.1" "@jest/schemas@^29.6.3": version "29.6.3" @@ -5082,57 +5313,36 @@ dependencies: "@sinclair/typebox" "^0.27.8" -"@jest/source-map@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-27.5.1.tgz#6608391e465add4205eae073b55e7f279e04e8cf" - integrity sha512-y9NIHUYF3PJRlHk98NdC/N1gl88BL08aQQgu4k4ZopQkCw9t9cV8mtl3TV8b/YCB8XaVTFrmUTAJvjsntDireg== +"@jest/source-map@^29.6.3": + version "29.6.3" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-29.6.3.tgz#d90ba772095cf37a34a5eb9413f1b562a08554c4" + integrity sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw== dependencies: + "@jridgewell/trace-mapping" "^0.3.18" callsites "^3.0.0" graceful-fs "^4.2.9" - source-map "^0.6.0" -"@jest/test-result@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.5.1.tgz#56a6585fa80f7cdab72b8c5fc2e871d03832f5bb" - integrity sha512-EW35l2RYFUcUQxFJz5Cv5MTOxlJIQs4I7gxzi2zVU7PJhOwfYq1MdC5nhSmYjX1gmMmLPvB3sIaC+BkcHRBfag== +"@jest/test-result@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.7.0.tgz#8db9a80aa1a097bb2262572686734baed9b1657c" + integrity sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA== dependencies: - "@jest/console" "^27.5.1" - "@jest/types" "^27.5.1" + "@jest/console" "^29.7.0" + "@jest/types" "^29.6.3" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.5.1.tgz#4057e0e9cea4439e544c6353c6affe58d095745b" - integrity sha512-LCheJF7WB2+9JuCS7VB/EmGIdQuhtqjRNI9A43idHv3E4KltCTsPsLxvdaubFHSYwY/fNjMWjl6vNRhDiN7vpQ== - dependencies: - "@jest/test-result" "^27.5.1" - graceful-fs "^4.2.9" - jest-haste-map "^27.5.1" - jest-runtime "^27.5.1" - -"@jest/transform@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.5.1.tgz#6c3501dcc00c4c08915f292a600ece5ecfe1f409" - integrity sha512-ipON6WtYgl/1329g5AIJVbUuEh0wZVbdpGwC99Jw4LwuoBNS95MVphU6zOeD9pDkon+LLbFL7lOQRapbB8SCHw== +"@jest/test-sequencer@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz#6cef977ce1d39834a3aea887a1726628a6f072ce" + integrity sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw== dependencies: - "@babel/core" "^7.1.0" - "@jest/types" "^27.5.1" - babel-plugin-istanbul "^6.1.1" - chalk "^4.0.0" - convert-source-map "^1.4.0" - fast-json-stable-stringify "^2.0.0" + "@jest/test-result" "^29.7.0" graceful-fs "^4.2.9" - jest-haste-map "^27.5.1" - jest-regex-util "^27.5.1" - jest-util "^27.5.1" - micromatch "^4.0.4" - pirates "^4.0.4" + jest-haste-map "^29.7.0" slash "^3.0.0" - source-map "^0.6.1" - write-file-atomic "^3.0.0" -"@jest/transform@^29.3.1": +"@jest/transform@^29.3.1", "@jest/transform@^29.7.0": version "29.7.0" resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.7.0.tgz#df2dd9c346c7d7768b8a06639994640c642e284c" integrity sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw== @@ -5164,17 +5374,6 @@ "@types/yargs" "^15.0.0" chalk "^4.0.0" -"@jest/types@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.5.1.tgz#3c79ec4a8ba61c170bf937bcf9e98a9df175ec80" - integrity sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw== - dependencies: - "@types/istanbul-lib-coverage" "^2.0.0" - "@types/istanbul-reports" "^3.0.0" - "@types/node" "*" - "@types/yargs" "^16.0.0" - chalk "^4.0.0" - "@jest/types@^29.6.3": version "29.6.3" resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.6.3.tgz#1131f8cf634e7e84c5e77bab12f052af585fba59" @@ -6687,19 +6886,19 @@ resolved "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz" integrity sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw== -"@sinonjs/commons@^1.7.0": - version "1.8.6" - resolved "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.6.tgz" - integrity sha512-Ky+XkAkqPZSm3NLBeUng77EBQl3cmeJhITaGHdYH8kjVB+aun3S4XBRti2zt17mtt0mIUDiNxYeoJm6drVvBJQ== +"@sinonjs/commons@^3.0.0": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-3.0.1.tgz#1029357e44ca901a615585f6d27738dbc89084cd" + integrity sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ== dependencies: type-detect "4.0.8" -"@sinonjs/fake-timers@^8.0.1": - version "8.1.0" - resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-8.1.0.tgz#3fdc2b6cb58935b21bfb8d1625eb1300484316e7" - integrity sha512-OAPJUAtgeINhh/TAlUID4QTs53Njm7xzddaVlEs/SXwgtiD1tW22zAB/W1wdqfrpmikgaWQ9Fw6Ws+hsiRm5Vg== +"@sinonjs/fake-timers@^10.0.2": + version "10.3.0" + resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz#55fdff1ecab9f354019129daf4df0dd4d923ea66" + integrity sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA== dependencies: - "@sinonjs/commons" "^1.7.0" + "@sinonjs/commons" "^3.0.0" "@smithy/abort-controller@^2.0.12": version "2.0.12" @@ -7756,7 +7955,7 @@ "@tootallnate/once@1": version "1.1.2" - resolved "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz" + resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== "@tootallnate/once@2": @@ -7835,7 +8034,7 @@ "@types/babel__template" "*" "@types/babel__traverse" "*" -"@types/babel__core@^7.1.14", "@types/babel__core@^7.20.5": +"@types/babel__core@^7.1.14", "@types/babel__core@^7.1.18", "@types/babel__core@^7.20.5": version "7.20.5" resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.5.tgz#3df15f27ba85319caa07ba08d0721889bb39c017" integrity sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA== @@ -7861,7 +8060,7 @@ "@babel/parser" "^7.1.0" "@babel/types" "^7.0.0" -"@types/babel__traverse@*", "@types/babel__traverse@^7.0.4", "@types/babel__traverse@^7.0.6", "@types/babel__traverse@^7.18.0": +"@types/babel__traverse@*", "@types/babel__traverse@^7.0.6", "@types/babel__traverse@^7.18.0": version "7.20.3" resolved "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.3.tgz" integrity sha512-Lsh766rGEFbaxMIDH7Qa+Yha8cMVI3qAK6CHt3OR0YfxOIn5Z54iHiyDRycHrBqeIiqGa20Kpsv1cavfBKkRSw== @@ -8108,10 +8307,10 @@ resolved "https://registry.npmjs.org/@types/escodegen/-/escodegen-0.0.6.tgz" integrity sha512-AjwI4MvWx3HAOaZqYsjKWyEObT9lcVV0Y0V8nXo6cXzN8ZiMxVhf6F3d/UNvXVGKrEzL/Dluc5p+y9GkzlTWig== -"@types/eslint@8": - version "8.56.7" - resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.56.7.tgz#c33b5b5a9cfb66881beb7b5be6c34aa3e81d3366" - integrity sha512-SjDvI/x3zsZnOkYZ3lCt9lOZWZLB2jIlNKz+LBgCtDurK0JZcwucxYHn1w2BJkD34dgX9Tjnak0txtq4WTggEA== +"@types/eslint@7 || 8": + version "8.56.12" + resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.56.12.tgz#1657c814ffeba4d2f84c0d4ba0f44ca7ea1ca53a" + integrity sha512-03ruubjWyOHlmljCVoxSuNDdmfZDzsrrz0P2LeJsOXr+ZwFQ+0yQIwNCwt/GYhV7Z31fgtXJTAEs+FYlEL851g== dependencies: "@types/estree" "*" "@types/json-schema" "*" @@ -8202,7 +8401,7 @@ resolved "https://registry.npmjs.org/@types/google-libphonenumber/-/google-libphonenumber-7.4.30.tgz" integrity sha512-Td1X1ayRxePEm6/jPHUBs2tT6TzW1lrVB6ZX7ViPGellyzO/0xMNi+wx5nH6jEitjznq276VGIqjK5qAju0XVw== -"@types/graceful-fs@^4.1.2", "@types/graceful-fs@^4.1.3": +"@types/graceful-fs@^4.1.3": version "4.1.9" resolved "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz" integrity sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ== @@ -8372,6 +8571,11 @@ resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz" integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== +"@types/json-stable-stringify@^1.0.32": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@types/json-stable-stringify/-/json-stable-stringify-1.1.0.tgz#41393e6b7a9a67221607346af4a79783aeb28aea" + integrity sha512-ESTsHWB72QQq+pjUFIbEz9uSCZppD31YrVkbt2rnUciTYEvcwN6uZIhX5JZeBHqRlFJ41x/7MewCs7E2Qux6Cg== + "@types/json5@^0.0.29": version "0.0.29" resolved "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz" @@ -8556,10 +8760,10 @@ "@types/node" "*" "@types/pdfkit" "*" -"@types/prettier@^2.1.5": - version "2.7.3" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.3.tgz#3e51a17e291d01d17d3fc61422015a933af7a08f" - integrity sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA== +"@types/picomatch@^2.3.0": + version "2.3.4" + resolved "https://registry.yarnpkg.com/@types/picomatch/-/picomatch-2.3.4.tgz#00c5b3eee51cd690f76b8213c625adc9bc4b9aa6" + integrity sha512-0so8lU8O5zatZS/2Fi4zrwks+vZv7e0dygrgEZXljODXBig97l4cPQD+9LabXfGJOWwoRkTVz6Q4edZvD12UOA== "@types/pretty-hrtime@^1.0.0": version "1.0.3" @@ -8913,13 +9117,6 @@ dependencies: "@types/yargs-parser" "*" -"@types/yargs@^16.0.0": - version "16.0.9" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-16.0.9.tgz#ba506215e45f7707e6cbcaf386981155b7ab956e" - integrity sha512-tHhzvkFXZQeTECenFoRljLBYPZJ7jAVxqqtEI0qTLOmuultnFp4I9yKE17vTuhf7BkhCu7I4XuemPgikDVuYqA== - dependencies: - "@types/yargs-parser" "*" - "@types/yargs@^17.0.8": version "17.0.33" resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.33.tgz#8c32303da83eec050a84b3c7ae7b9f922d13e32d" @@ -8983,10 +9180,10 @@ resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.33.0.tgz" integrity sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ== -"@typescript-eslint/types@5.62.0": - version "5.62.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.62.0.tgz#258607e60effa309f067608931c3df6fed41fd2f" - integrity sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ== +"@typescript-eslint/types@5.45.0": + version "5.45.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.45.0.tgz#794760b9037ee4154c09549ef5a96599621109c5" + integrity sha512-QQij+u/vgskA66azc9dCmx+rev79PzX8uDHpsqSjEFtfF2gBUTRCpvYMh2gw2ghkJabNkPlSUCimsyBEQZd1DA== "@typescript-eslint/typescript-estree@4.33.0": version "4.33.0" @@ -9001,13 +9198,13 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/typescript-estree@^5.9.1": - version "5.62.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz#7d17794b77fabcac615d6a48fb143330d962eb9b" - integrity sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA== +"@typescript-eslint/typescript-estree@5.45.0": + version "5.45.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.45.0.tgz#f70a0d646d7f38c0dfd6936a5e171a77f1e5291d" + integrity sha512-maRhLGSzqUpFcZgXxg1qc/+H0bT36lHK4APhp0AEUVrpSwXiRAomm/JGjSG+kNUio5kAa3uekCYu/47cnGn5EQ== dependencies: - "@typescript-eslint/types" "5.62.0" - "@typescript-eslint/visitor-keys" "5.62.0" + "@typescript-eslint/types" "5.45.0" + "@typescript-eslint/visitor-keys" "5.45.0" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" @@ -9022,12 +9219,12 @@ "@typescript-eslint/types" "4.33.0" eslint-visitor-keys "^2.0.0" -"@typescript-eslint/visitor-keys@5.62.0": - version "5.62.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz#2174011917ce582875954ffe2f6912d5931e353e" - integrity sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw== +"@typescript-eslint/visitor-keys@5.45.0": + version "5.45.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.45.0.tgz#e0d160e9e7fdb7f8da697a5b78e7a14a22a70528" + integrity sha512-jc6Eccbn2RtQPr1s7th6jJWQHBHI6GBVQkCHoJFQ5UreaKm59Vxw+ynQUPPY2u2Amquc+7tmEoC2G52ApsGNNg== dependencies: - "@typescript-eslint/types" "5.62.0" + "@typescript-eslint/types" "5.45.0" eslint-visitor-keys "^3.3.0" "@vitejs/plugin-react@^3.0.1": @@ -9222,7 +9419,7 @@ JSONStream@^1.3.5: abab@^2.0.3, abab@^2.0.5: version "2.0.6" - resolved "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz" + resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.6.tgz#41b80f2c871d19686216b82309231cfd3cb3d291" integrity sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA== abbrev@1: @@ -9262,7 +9459,7 @@ accepts@~1.3.5, accepts@~1.3.8: acorn-globals@^6.0.0: version "6.0.0" - resolved "https://registry.npmjs.org/acorn-globals/-/acorn-globals-6.0.0.tgz" + resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-6.0.0.tgz#46cdd39f0f8ff08a876619b55f5ac8a6dc770b45" integrity sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg== dependencies: acorn "^7.1.1" @@ -9302,7 +9499,7 @@ acorn@^7.0.0, acorn@^7.1.1, acorn@^7.4.0, acorn@^7.4.1: resolved "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^8.10.0, acorn@^8.2.4, acorn@^8.4.1, acorn@^8.8.0, acorn@^8.8.1, acorn@^8.8.2: +acorn@^8.10.0, acorn@^8.4.1, acorn@^8.8.0, acorn@^8.8.1, acorn@^8.8.2: version "8.10.0" resolved "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz" integrity sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw== @@ -9312,6 +9509,11 @@ acorn@^8.11.3: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.12.1.tgz#71616bdccbe25e27a54439e0046e89ca76df2248" integrity sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg== +acorn@^8.2.4: + version "8.14.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.14.0.tgz#063e2c70cac5fb4f6467f0b11152e04c682795b0" + integrity sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA== + add-dom-event-listener@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/add-dom-event-listener/-/add-dom-event-listener-1.1.0.tgz" @@ -10107,16 +10309,15 @@ babel-core@^7.0.0-bridge.0: resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-7.0.0-bridge.0.tgz#95a492ddd90f9b4e9a4a1da14eb335b87b634ece" integrity sha512-poPX9mZH/5CSanm50Q+1toVci6pv5KSRv/5TWCwtzQS5XEwn40BcCrgIeMFWP9CKKIniKXNxoIOnOq4VVlGXhg== -babel-jest@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.5.1.tgz#a1bf8d61928edfefd21da27eb86a695bfd691444" - integrity sha512-cdQ5dXjGRd0IBRATiQ4mZGlGlRE8kJpjPOixdNRdT+m3UcNqmYWN6rK6nvtXYfY3D76cb8s/O1Ss8ea24PIwcg== +babel-jest@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.7.0.tgz#f4369919225b684c56085998ac63dbd05be020d5" + integrity sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg== dependencies: - "@jest/transform" "^27.5.1" - "@jest/types" "^27.5.1" + "@jest/transform" "^29.7.0" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" - babel-preset-jest "^27.5.1" + babel-preset-jest "^29.6.3" chalk "^4.0.0" graceful-fs "^4.2.9" slash "^3.0.0" @@ -10150,14 +10351,14 @@ babel-plugin-istanbul@^6.1.1: istanbul-lib-instrument "^5.0.4" test-exclude "^6.0.0" -babel-plugin-jest-hoist@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-27.5.1.tgz#9be98ecf28c331eb9f5df9c72d6f89deb8181c2e" - integrity sha512-50wCwD5EMNW4aRpOwtqzyZHIewTYNxLA4nhB+09d8BIssfNfzBRhkBIHiaPv1Si226TQSvp8gxAJm2iY2qs2hQ== +babel-plugin-jest-hoist@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz#aadbe943464182a8922c3c927c3067ff40d24626" + integrity sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg== dependencies: "@babel/template" "^7.3.3" "@babel/types" "^7.3.3" - "@types/babel__core" "^7.0.0" + "@types/babel__core" "^7.1.14" "@types/babel__traverse" "^7.0.6" babel-plugin-macros@^2.0.0: @@ -10169,6 +10370,15 @@ babel-plugin-macros@^2.0.0: cosmiconfig "^6.0.0" resolve "^1.12.0" +babel-plugin-macros@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/babel-plugin-macros/-/babel-plugin-macros-3.1.0.tgz#9ef6dc74deb934b4db344dc973ee851d148c50c1" + integrity sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg== + dependencies: + "@babel/runtime" "^7.12.5" + cosmiconfig "^7.0.0" + resolve "^1.19.0" + babel-plugin-polyfill-corejs2@^0.4.10: version "0.4.11" resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.11.tgz#30320dfe3ffe1a336c15afdcdafd6fd615b25e33" @@ -10289,12 +10499,12 @@ babel-preset-fbjs@^3.4.0: "@babel/plugin-transform-template-literals" "^7.0.0" babel-plugin-syntax-trailing-function-commas "^7.0.0-beta.0" -babel-preset-jest@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-27.5.1.tgz#91f10f58034cb7989cb4f962b69fa6eef6a6bc81" - integrity sha512-Nptf2FzlPCWYuJg41HBqXVT8ym6bXOevuCTbhxlUpjwtysGaIWFvDEjp4y+G7fl13FgOdjs7P/DmErqH7da0Ag== +babel-preset-jest@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz#fa05fa510e7d493896d7b0dd2033601c840f171c" + integrity sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA== dependencies: - babel-plugin-jest-hoist "^27.5.1" + babel-plugin-jest-hoist "^29.6.3" babel-preset-current-node-syntax "^1.0.0" babel-runtime@6.x, babel-runtime@^6.26.0: @@ -10530,7 +10740,7 @@ browser-or-node@^2.1.1: browser-process-hrtime@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz" + resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626" integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow== browser-resolve@^1.8.1: @@ -10586,9 +10796,19 @@ browserslist@^4.23.1, browserslist@^4.23.3: node-releases "^2.0.18" update-browserslist-db "^1.1.0" -bs-logger@0.x: +browserslist@^4.24.0: + version "4.24.2" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.24.2.tgz#f5845bc91069dbd55ee89faf9822e1d885d16580" + integrity sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg== + dependencies: + caniuse-lite "^1.0.30001669" + electron-to-chromium "^1.5.41" + node-releases "^2.0.18" + update-browserslist-db "^1.1.1" + +bs-logger@^0.2.6: version "0.2.6" - resolved "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz" + resolved "https://registry.yarnpkg.com/bs-logger/-/bs-logger-0.2.6.tgz#eb7d365307a72cf974cc6cda76b68354ad336bd8" integrity sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog== dependencies: fast-json-stable-stringify "2.x" @@ -10871,6 +11091,11 @@ caniuse-lite@^1.0.30001663: resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001664.tgz#d588d75c9682d3301956b05a3749652a80677df4" integrity sha512-AmE7k4dXiNKQipgn7a2xg558IRqPN3jMQY/rOsbxDhrd0tyChwbITBfiwtnqz8bi2M5mIWbxAYBvk7W7QBUS2g== +caniuse-lite@^1.0.30001669: + version "1.0.30001680" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001680.tgz#5380ede637a33b9f9f1fc6045ea99bd142f3da5e" + integrity sha512-rPQy70G6AGUMnbwS1z6Xg+RkHYPAi18ihs47GH0jcxIG7wArmPgY3XbS2sRdBbxJljp3thdT8BIqv9ccCypiPA== + capital-case@^1.0.4: version "1.0.4" resolved "https://registry.npmjs.org/capital-case/-/capital-case-1.0.4.tgz" @@ -11607,7 +11832,7 @@ conventional-recommended-bump@7.0.1: git-semver-tags "^5.0.0" meow "^8.1.2" -convert-source-map@^1.4.0, convert-source-map@^1.5.0, convert-source-map@^1.5.1, convert-source-map@^1.6.0: +convert-source-map@^1.5.0, convert-source-map@^1.5.1: version "1.9.0" resolved "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz" integrity sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A== @@ -11703,7 +11928,7 @@ cosmiconfig@^6.0.0: path-type "^4.0.0" yaml "^1.7.2" -cosmiconfig@^7, cosmiconfig@^7.0.1, cosmiconfig@^7.1.0: +cosmiconfig@^7, cosmiconfig@^7.0.0, cosmiconfig@^7.0.1, cosmiconfig@^7.1.0: version "7.1.0" resolved "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz" integrity sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA== @@ -11786,6 +12011,19 @@ create-emotion@^9.2.12: stylis "^3.5.0" stylis-rule-sheet "^0.0.10" +create-jest@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/create-jest/-/create-jest-29.7.0.tgz#a355c5b3cb1e1af02ba177fe7afd7feee49a5320" + integrity sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q== + dependencies: + "@jest/types" "^29.6.3" + chalk "^4.0.0" + exit "^0.1.2" + graceful-fs "^4.2.9" + jest-config "^29.7.0" + jest-util "^29.7.0" + prompts "^2.0.1" + create-require@^1.1.0: version "1.1.1" resolved "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz" @@ -11922,17 +12160,17 @@ cssfilter@0.0.10: cssom@^0.4.4: version "0.4.4" - resolved "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz" + resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.4.4.tgz#5a66cf93d2d0b661d80bf6a44fb65f5c2e4e0a10" integrity sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw== cssom@~0.3.6: version "0.3.8" - resolved "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz" + resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.8.tgz#9f1276f5b2b463f2114d3f2c75250af8c1a36f4a" integrity sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg== cssstyle@^2.3.0: version "2.3.0" - resolved "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz" + resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-2.3.0.tgz#ff665a0ddbdc31864b09647f34163443d90b0852" integrity sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A== dependencies: cssom "~0.3.6" @@ -12085,7 +12323,7 @@ dash-ast@^2.0.1: data-urls@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/data-urls/-/data-urls-2.0.0.tgz" + resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-2.0.0.tgz#156485a72963a970f5d5821aaf642bef2bf2db9b" integrity sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ== dependencies: abab "^2.0.3" @@ -12201,7 +12439,7 @@ decimal.js-light@^2.4.1: decimal.js@^10.2.1: version "10.4.3" - resolved "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz" + resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.4.3.tgz#1044092884d245d1b7f65725fa4ad4c6f781cc23" integrity sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA== decode-uri-component@^0.2.0, decode-uri-component@^0.2.2: @@ -12221,11 +12459,16 @@ decompress-response@^6.0.0: dependencies: mimic-response "^3.1.0" -dedent@0.7.0, dedent@^0.7.0: +dedent@0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" integrity sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA== +dedent@^1.0.0: + version "1.5.3" + resolved "https://registry.yarnpkg.com/dedent/-/dedent-1.5.3.tgz#99aee19eb9bae55a67327717b6e848d0bf777e5a" + integrity sha512-NHQtfOOW68WD8lgypbLA5oT+Bt0xXJhiYvoR6SmmNXZfpzOGXwdKWmcwG8N7PwVVWV3eF/68nmD9BaJSsTBhyQ== + deep-eql@^4.1.3: version "4.1.3" resolved "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz" @@ -12455,11 +12698,6 @@ diff-sequences@^26.6.2: resolved "https://registry.npmjs.org/diff-sequences/-/diff-sequences-26.6.2.tgz" integrity sha512-Mv/TDa3nZ9sbc5soK+OoA74BsS3mL37yixCvUAQkiuA4Wz6YtwP/K47n2rv2ovzHZvoiQeA5FTQOschKkEwB0Q== -diff-sequences@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.5.1.tgz#eaecc0d327fd68c8d9672a1e64ab8dccb2ef5327" - integrity sha512-k1gCAXAsNgLwEL+Y8Wvl+M6oEFj5bgazfZULpS5CneoPPXRaCCW7dm+q21Ky2VEE5X+VeRDBVg1Pcvvsr4TtNQ== - diff-sequences@^29.6.3: version "29.6.3" resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.6.3.tgz#4deaf894d11407c51efc8418012f9e70b84ea921" @@ -12573,7 +12811,7 @@ domelementtype@^2.3.0: domexception@^2.0.1: version "2.0.1" - resolved "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz" + resolved "https://registry.yarnpkg.com/domexception/-/domexception-2.0.1.tgz#fb44aefba793e1574b0af6aed2801d057529f304" integrity sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg== dependencies: webidl-conversions "^5.0.0" @@ -12705,6 +12943,13 @@ ee-first@1.1.1: resolved "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz" integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== +ejs@^3.1.10, ejs@^3.1.8: + version "3.1.10" + resolved "https://registry.yarnpkg.com/ejs/-/ejs-3.1.10.tgz#69ab8358b14e896f80cc39e62087b88500c3ac3b" + integrity sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA== + dependencies: + jake "^10.8.5" + ejs@^3.1.6, ejs@^3.1.7: version "3.1.9" resolved "https://registry.npmjs.org/ejs/-/ejs-3.1.9.tgz" @@ -12712,13 +12957,6 @@ ejs@^3.1.6, ejs@^3.1.7: dependencies: jake "^10.8.5" -ejs@^3.1.8: - version "3.1.10" - resolved "https://registry.yarnpkg.com/ejs/-/ejs-3.1.10.tgz#69ab8358b14e896f80cc39e62087b88500c3ac3b" - integrity sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA== - dependencies: - jake "^10.8.5" - elastic-apm-node@^3.29.0: version "3.51.0" resolved "https://registry.yarnpkg.com/elastic-apm-node/-/elastic-apm-node-3.51.0.tgz#2ee35156b41f8e1e000623bba15aee19553756fe" @@ -12778,21 +13016,31 @@ electron-to-chromium@^1.5.28: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.29.tgz#aa592a3caa95d07cc26a66563accf99fa573a1ee" integrity sha512-PF8n2AlIhCKXQ+gTpiJi0VhcHDb69kYX4MtCiivctc2QD3XuNZ/XIOlbGzt7WAjjEev0TtaH6Cu3arZExm5DOw== +electron-to-chromium@^1.5.41: + version "1.5.58" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.58.tgz#d90bd7a04d9223dce4e72316e14492140ec9af40" + integrity sha512-al2l4r+24ZFL7WzyPTlyD0fC33LLzvxqLCwurtBibVPghRGO9hSTl+tis8t1kD7biPiH/en4U0I7o/nQbYeoVA== + email-validator@^2.0.4: version "2.0.4" resolved "https://registry.npmjs.org/email-validator/-/email-validator-2.0.4.tgz" integrity sha512-gYCwo7kh5S3IDyZPLZf6hSS0MnZT8QmJFqYvbqlDZSbwdZlY6QZWxJ4i/6UhITOJ4XzyI647Bm2MXKCLqnJ4nQ== -emittery@^0.8.1: - version "0.8.1" - resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.8.1.tgz#bb23cc86d03b30aa75a7f734819dee2e1ba70860" - integrity sha512-uDfvUjVrfGJJhymx/kz6prltenw1u7WrCg1oa94zYY8xxVpLLUu045LAT0dhDZdXG58/EpPL/5kA180fQ/qudg== +emittery@^0.13.1: + version "0.13.1" + resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.13.1.tgz#c04b8c3457490e0847ae51fced3af52d338e3dad" + integrity sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ== -emoji-regex@^10.0.0, emoji-regex@^10.3.0: +emoji-regex@10.3.0, emoji-regex@^10.3.0: version "10.3.0" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-10.3.0.tgz#76998b9268409eb3dae3de989254d456e70cfe23" integrity sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw== +emoji-regex@^10.2.1: + version "10.4.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-10.4.0.tgz#03553afea80b3975749cfcb36f776ca268e413d4" + integrity sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw== + emoji-regex@^7.0.1: version "7.0.3" resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz" @@ -13572,18 +13820,22 @@ eslint-plugin-flowtype@^5.2.0: lodash "^4.17.15" string-natural-compare "^3.0.1" -eslint-plugin-formatjs@2.21.0: - version "2.21.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-formatjs/-/eslint-plugin-formatjs-2.21.0.tgz#cc728dc914722dd221f4213bb1144629a29a9eb2" - integrity sha512-YY69wKUSaVcrxxishknqWxLhd2orPFDBLzRN9fu6QGkfQ2dt7+DHMumm+7iBNxLdS5zozAjNVSgp8NnauZvxRQ== - dependencies: - "@formatjs/icu-messageformat-parser" "2.0.18" - "@formatjs/ts-transformer" "3.9.2" - "@types/eslint" "8" - "@typescript-eslint/typescript-estree" "^5.9.1" - emoji-regex "^10.0.0" - tslib "^2.1.0" - typescript "^4.5" +eslint-plugin-formatjs@4.10.0: + version "4.10.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-formatjs/-/eslint-plugin-formatjs-4.10.0.tgz#05da23f75b4ce507c90df93ff07be2b6e70ffbc5" + integrity sha512-YvNF72NVMkIevgJrX5xTkIj4eBCeiweM2/61ppP2eEni3FP4pDXy9UFsOhtxJVISTBH0UEAqz3xhRjqi1q+qag== + dependencies: + "@formatjs/icu-messageformat-parser" "2.3.1" + "@formatjs/ts-transformer" "3.13.0" + "@types/eslint" "7 || 8" + "@types/picomatch" "^2.3.0" + "@typescript-eslint/typescript-estree" "5.45.0" + emoji-regex "^10.2.1" + magic-string "^0.29.0" + picomatch "^2.3.1" + tslib "2.4.0" + typescript "^4.7 || 5" + unicode-emoji-utils "^1.1.1" eslint-plugin-import@^2.17.3: version "2.31.0" @@ -13937,15 +14189,16 @@ exit@^0.1.2: resolved "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz" integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ== -expect@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/expect/-/expect-27.5.1.tgz#83ce59f1e5bdf5f9d2b94b61d2050db48f3fef74" - integrity sha512-E1q5hSUG2AmYQwQJ041nvgpkODHQvB+RKlB4IYdru6uJsyFTRyZAP463M+1lINorwbqAmUggi6+WwkD8lCS/Dw== +expect@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-29.7.0.tgz#578874590dcb3214514084c08115d8aee61e11bc" + integrity sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw== dependencies: - "@jest/types" "^27.5.1" - jest-get-type "^27.5.1" - jest-matcher-utils "^27.5.1" - jest-message-util "^27.5.1" + "@jest/expect-utils" "^29.7.0" + jest-get-type "^29.6.3" + jest-matcher-utils "^29.7.0" + jest-message-util "^29.7.0" + jest-util "^29.7.0" exponential-backoff@^3.1.1: version "3.1.1" @@ -14447,9 +14700,9 @@ foreground-child@^3.1.0: signal-exit "^4.0.1" form-data@^3.0.0: - version "3.0.1" - resolved "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz" - integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg== + version "3.0.2" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.2.tgz#83ad9ced7c03feaad97e293d6f6091011e1659c8" + integrity sha512-sJe+TQb2vIaIyO783qN6BlMYWMw3WBOHA1Ay2qxsnjuafEOQFJ2JakedOQirT6D5XPRxDvS7AHYyem9fTpb4LQ== dependencies: asynckit "^0.4.0" combined-stream "^1.0.8" @@ -15417,7 +15670,7 @@ html-element-map@^1.2.0: html-encoding-sniffer@^2.0.1: version "2.0.1" - resolved "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz" + resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz#42a6dc4fd33f00281176e8b23759ca4e4fa185f3" integrity sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ== dependencies: whatwg-encoding "^1.0.5" @@ -15472,7 +15725,7 @@ http-headers@^3.0.2: http-proxy-agent@^4.0.1: version "4.0.1" - resolved "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz" + resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz#8a8c8ef7f5932ccf953c296ca8291b95aa74aa3a" integrity sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg== dependencies: "@tootallnate/once" "1" @@ -16166,7 +16419,7 @@ is-port-reachable@4.0.0: is-potential-custom-element-name@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz" + resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5" integrity sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ== is-regex@^1.0.4, is-regex@^1.0.5, is-regex@^1.1.4: @@ -16282,11 +16535,6 @@ is-typed-array@^1.1.13: dependencies: which-typed-array "^1.1.14" -is-typedarray@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz" - integrity sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA== - is-unc-path@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz" @@ -16383,7 +16631,7 @@ istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: resolved "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz" integrity sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw== -istanbul-lib-instrument@^5.0.4, istanbul-lib-instrument@^5.1.0: +istanbul-lib-instrument@^5.0.4: version "5.2.1" resolved "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz" integrity sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg== @@ -16394,6 +16642,17 @@ istanbul-lib-instrument@^5.0.4, istanbul-lib-instrument@^5.1.0: istanbul-lib-coverage "^3.2.0" semver "^6.3.0" +istanbul-lib-instrument@^6.0.0: + version "6.0.3" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz#fa15401df6c15874bcb2105f773325d78c666765" + integrity sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q== + dependencies: + "@babel/core" "^7.23.9" + "@babel/parser" "^7.23.9" + "@istanbuljs/schema" "^0.1.3" + istanbul-lib-coverage "^3.2.0" + semver "^7.5.4" + istanbul-lib-report@^3.0.0: version "3.0.1" resolved "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz" @@ -16472,89 +16731,87 @@ jake@^10.8.5: filelist "^1.0.4" minimatch "^3.1.2" -jest-changed-files@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.5.1.tgz#a348aed00ec9bf671cc58a66fcbe7c3dfd6a68f5" - integrity sha512-buBLMiByfWGCoMsLLzGUUSpAmIAGnbR2KJoMN10ziLhOLvP4e0SlypHnAel8iqQXTrcbmfEY9sSqae5sgUsTvw== +jest-changed-files@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.7.0.tgz#1c06d07e77c78e1585d020424dedc10d6e17ac3a" + integrity sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w== dependencies: - "@jest/types" "^27.5.1" execa "^5.0.0" - throat "^6.0.1" + jest-util "^29.7.0" + p-limit "^3.1.0" -jest-circus@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.5.1.tgz#37a5a4459b7bf4406e53d637b49d22c65d125ecc" - integrity sha512-D95R7x5UtlMA5iBYsOHFFbMD/GVA4R/Kdq15f7xYWUfWHBto9NYRsOvnSauTgdF+ogCpJ4tyKOXhUifxS65gdw== +jest-circus@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.7.0.tgz#b6817a45fcc835d8b16d5962d0c026473ee3668a" + integrity sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw== dependencies: - "@jest/environment" "^27.5.1" - "@jest/test-result" "^27.5.1" - "@jest/types" "^27.5.1" + "@jest/environment" "^29.7.0" + "@jest/expect" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/types" "^29.6.3" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" - dedent "^0.7.0" - expect "^27.5.1" + dedent "^1.0.0" is-generator-fn "^2.0.0" - jest-each "^27.5.1" - jest-matcher-utils "^27.5.1" - jest-message-util "^27.5.1" - jest-runtime "^27.5.1" - jest-snapshot "^27.5.1" - jest-util "^27.5.1" - pretty-format "^27.5.1" + jest-each "^29.7.0" + jest-matcher-utils "^29.7.0" + jest-message-util "^29.7.0" + jest-runtime "^29.7.0" + jest-snapshot "^29.7.0" + jest-util "^29.7.0" + p-limit "^3.1.0" + pretty-format "^29.7.0" + pure-rand "^6.0.0" slash "^3.0.0" stack-utils "^2.0.3" - throat "^6.0.1" -jest-cli@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.5.1.tgz#278794a6e6458ea8029547e6c6cbf673bd30b145" - integrity sha512-Hc6HOOwYq4/74/c62dEE3r5elx8wjYqxY0r0G/nFrLDPMFRu6RA/u8qINOIkvhxG7mMQ5EJsOGfRpI8L6eFUVw== +jest-cli@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.7.0.tgz#5592c940798e0cae677eec169264f2d839a37995" + integrity sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg== dependencies: - "@jest/core" "^27.5.1" - "@jest/test-result" "^27.5.1" - "@jest/types" "^27.5.1" + "@jest/core" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/types" "^29.6.3" chalk "^4.0.0" + create-jest "^29.7.0" exit "^0.1.2" - graceful-fs "^4.2.9" import-local "^3.0.2" - jest-config "^27.5.1" - jest-util "^27.5.1" - jest-validate "^27.5.1" - prompts "^2.0.1" - yargs "^16.2.0" + jest-config "^29.7.0" + jest-util "^29.7.0" + jest-validate "^29.7.0" + yargs "^17.3.1" -jest-config@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.5.1.tgz#5c387de33dca3f99ad6357ddeccd91bf3a0e4a41" - integrity sha512-5sAsjm6tGdsVbW9ahcChPAFCk4IlkQUknH5AvKjuLTSlcO/wCZKyFdn7Rg0EkC+OGgWODEy2hDpWB1PgzH0JNA== +jest-config@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.7.0.tgz#bcbda8806dbcc01b1e316a46bb74085a84b0245f" + integrity sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ== dependencies: - "@babel/core" "^7.8.0" - "@jest/test-sequencer" "^27.5.1" - "@jest/types" "^27.5.1" - babel-jest "^27.5.1" + "@babel/core" "^7.11.6" + "@jest/test-sequencer" "^29.7.0" + "@jest/types" "^29.6.3" + babel-jest "^29.7.0" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" - glob "^7.1.1" + glob "^7.1.3" graceful-fs "^4.2.9" - jest-circus "^27.5.1" - jest-environment-jsdom "^27.5.1" - jest-environment-node "^27.5.1" - jest-get-type "^27.5.1" - jest-jasmine2 "^27.5.1" - jest-regex-util "^27.5.1" - jest-resolve "^27.5.1" - jest-runner "^27.5.1" - jest-util "^27.5.1" - jest-validate "^27.5.1" + jest-circus "^29.7.0" + jest-environment-node "^29.7.0" + jest-get-type "^29.6.3" + jest-regex-util "^29.6.3" + jest-resolve "^29.7.0" + jest-runner "^29.7.0" + jest-util "^29.7.0" + jest-validate "^29.7.0" micromatch "^4.0.4" parse-json "^5.2.0" - pretty-format "^27.5.1" + pretty-format "^29.7.0" slash "^3.0.0" strip-json-comments "^3.1.1" -"jest-diff@>=29.4.3 < 30", jest-diff@^29.4.1: +"jest-diff@>=29.4.3 < 30", jest-diff@^29.4.1, jest-diff@^29.7.0: version "29.7.0" resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.7.0.tgz#017934a66ebb7ecf6f205e84699be10afd70458a" integrity sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw== @@ -16574,58 +16831,35 @@ jest-diff@^26.0.0: jest-get-type "^26.3.0" pretty-format "^26.6.2" -jest-diff@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.5.1.tgz#a07f5011ac9e6643cf8a95a462b7b1ecf6680def" - integrity sha512-m0NvkX55LDt9T4mctTEgnZk3fmEg3NRYutvMPWM/0iPnkFj2wIeF45O1718cMSOFO1vINkqmxqD8vE37uTEbqw== - dependencies: - chalk "^4.0.0" - diff-sequences "^27.5.1" - jest-get-type "^27.5.1" - pretty-format "^27.5.1" - -jest-docblock@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-27.5.1.tgz#14092f364a42c6108d42c33c8cf30e058e25f6c0" - integrity sha512-rl7hlABeTsRYxKiUfpHrQrG4e2obOiTQWfMEH3PxPjOtdsfLQO4ReWSZaQ7DETm4xu07rl4q/h4zcKXyU0/OzQ== +jest-docblock@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-29.7.0.tgz#8fddb6adc3cdc955c93e2a87f61cfd350d5d119a" + integrity sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g== dependencies: detect-newline "^3.0.0" -jest-each@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.5.1.tgz#5bc87016f45ed9507fed6e4702a5b468a5b2c44e" - integrity sha512-1Ff6p+FbhT/bXQnEouYy00bkNSY7OUpfIcmdl8vZ31A1UUaurOLPA8a8BbJOF2RDUElwJhmeaV7LnagI+5UwNQ== +jest-each@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.7.0.tgz#162a9b3f2328bdd991beaabffbb74745e56577d1" + integrity sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ== dependencies: - "@jest/types" "^27.5.1" + "@jest/types" "^29.6.3" chalk "^4.0.0" - jest-get-type "^27.5.1" - jest-util "^27.5.1" - pretty-format "^27.5.1" - -jest-environment-jsdom@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.5.1.tgz#ea9ccd1fc610209655a77898f86b2b559516a546" - integrity sha512-TFBvkTC1Hnnnrka/fUb56atfDtJ9VMZ94JkjTbggl1PEpwrYtUBKMezB3inLmWqQsXYLcMwNoDQwoBTAvFfsfw== - dependencies: - "@jest/environment" "^27.5.1" - "@jest/fake-timers" "^27.5.1" - "@jest/types" "^27.5.1" - "@types/node" "*" - jest-mock "^27.5.1" - jest-util "^27.5.1" - jsdom "^16.6.0" - -jest-environment-node@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.5.1.tgz#dedc2cfe52fab6b8f5714b4808aefa85357a365e" - integrity sha512-Jt4ZUnxdOsTGwSRAfKEnE6BcwsSPNOijjwifq5sDFSA2kesnXTvNqKHYgM0hDq3549Uf/KzdXNYn4wMZJPlFLw== - dependencies: - "@jest/environment" "^27.5.1" - "@jest/fake-timers" "^27.5.1" - "@jest/types" "^27.5.1" + jest-get-type "^29.6.3" + jest-util "^29.7.0" + pretty-format "^29.7.0" + +jest-environment-node@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.7.0.tgz#0b93e111dda8ec120bc8300e6d1fb9576e164376" + integrity sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw== + dependencies: + "@jest/environment" "^29.7.0" + "@jest/fake-timers" "^29.7.0" + "@jest/types" "^29.6.3" "@types/node" "*" - jest-mock "^27.5.1" - jest-util "^27.5.1" + jest-mock "^29.7.0" + jest-util "^29.7.0" jest-fetch-mock@^2.1.2: version "2.1.2" @@ -16640,36 +16874,11 @@ jest-get-type@^26.3.0: resolved "https://registry.npmjs.org/jest-get-type/-/jest-get-type-26.3.0.tgz" integrity sha512-TpfaviN1R2pQWkIihlfEanwOXK0zcxrKEE4MlU6Tn7keoXdN6/3gK/xl0yEh8DOunn5pOVGKf8hB4R9gVh04ig== -jest-get-type@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.5.1.tgz#3cd613c507b0f7ace013df407a1c1cd578bcb4f1" - integrity sha512-2KY95ksYSaK7DMBWQn6dQz3kqAf3BB64y2udeG+hv4KfSOb9qwcYQstTJc1KCbsix+wLZWZYN8t7nwX3GOBLRw== - jest-get-type@^29.6.3: version "29.6.3" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.6.3.tgz#36f499fdcea197c1045a127319c0481723908fd1" integrity sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw== -jest-haste-map@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.5.1.tgz#9fd8bd7e7b4fa502d9c6164c5640512b4e811e7f" - integrity sha512-7GgkZ4Fw4NFbMSDSpZwXeBiIbx+t/46nJ2QitkOjvwPYyZmqttu2TDSimMHP1EkPOi4xUZAN1doE5Vd25H4Jng== - dependencies: - "@jest/types" "^27.5.1" - "@types/graceful-fs" "^4.1.2" - "@types/node" "*" - anymatch "^3.0.3" - fb-watchman "^2.0.0" - graceful-fs "^4.2.9" - jest-regex-util "^27.5.1" - jest-serializer "^27.5.1" - jest-util "^27.5.1" - jest-worker "^27.5.1" - micromatch "^4.0.4" - walker "^1.0.7" - optionalDependencies: - fsevents "^2.3.2" - jest-haste-map@^29.7.0: version "29.7.0" resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.7.0.tgz#3c2396524482f5a0506376e6c858c3bbcc17b104" @@ -16689,214 +16898,163 @@ jest-haste-map@^29.7.0: optionalDependencies: fsevents "^2.3.2" -jest-jasmine2@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.5.1.tgz#a037b0034ef49a9f3d71c4375a796f3b230d1ac4" - integrity sha512-jtq7VVyG8SqAorDpApwiJJImd0V2wv1xzdheGHRGyuT7gZm6gG47QEskOlzsN1PG/6WNaCo5pmwMHDf3AkG2pQ== +jest-leak-detector@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz#5b7ec0dadfdfec0ca383dc9aa016d36b5ea4c728" + integrity sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw== dependencies: - "@jest/environment" "^27.5.1" - "@jest/source-map" "^27.5.1" - "@jest/test-result" "^27.5.1" - "@jest/types" "^27.5.1" - "@types/node" "*" - chalk "^4.0.0" - co "^4.6.0" - expect "^27.5.1" - is-generator-fn "^2.0.0" - jest-each "^27.5.1" - jest-matcher-utils "^27.5.1" - jest-message-util "^27.5.1" - jest-runtime "^27.5.1" - jest-snapshot "^27.5.1" - jest-util "^27.5.1" - pretty-format "^27.5.1" - throat "^6.0.1" - -jest-leak-detector@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.5.1.tgz#6ec9d54c3579dd6e3e66d70e3498adf80fde3fb8" - integrity sha512-POXfWAMvfU6WMUXftV4HolnJfnPOGEu10fscNCA76KBpRRhcMN2c8d3iT2pxQS3HLbA+5X4sOUPzYO2NUyIlHQ== - dependencies: - jest-get-type "^27.5.1" - pretty-format "^27.5.1" - -jest-matcher-utils@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.5.1.tgz#9c0cdbda8245bc22d2331729d1091308b40cf8ab" - integrity sha512-z2uTx/T6LBaCoNWNFWwChLBKYxTMcGBRjAt+2SbP929/Fflb9aa5LGma654Rz8z9HLxsrUaYzxE9T/EFIL/PAw== + jest-get-type "^29.6.3" + pretty-format "^29.7.0" + +jest-matcher-utils@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz#ae8fec79ff249fd592ce80e3ee474e83a6c44f12" + integrity sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g== dependencies: chalk "^4.0.0" - jest-diff "^27.5.1" - jest-get-type "^27.5.1" - pretty-format "^27.5.1" + jest-diff "^29.7.0" + jest-get-type "^29.6.3" + pretty-format "^29.7.0" -jest-message-util@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.5.1.tgz#bdda72806da10d9ed6425e12afff38cd1458b6cf" - integrity sha512-rMyFe1+jnyAAf+NHwTclDz0eAaLkVDdKVHHBFWsBWHnnh5YeJMNWWsv7AbFYXfK3oTqvL7VTWkhNLu1jX24D+g== +jest-message-util@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.7.0.tgz#8bc392e204e95dfe7564abbe72a404e28e51f7f3" + integrity sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^27.5.1" + "@jest/types" "^29.6.3" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.9" micromatch "^4.0.4" - pretty-format "^27.5.1" + pretty-format "^29.7.0" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.5.1.tgz#19948336d49ef4d9c52021d34ac7b5f36ff967d6" - integrity sha512-K4jKbY1d4ENhbrG2zuPWaQBvDly+iZ2yAW+T1fATN78hc0sInwn7wZB8XtlNnvHug5RMwV897Xm4LqmPM4e2Og== +jest-mock@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.7.0.tgz#4e836cf60e99c6fcfabe9f99d017f3fdd50a6347" + integrity sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw== dependencies: - "@jest/types" "^27.5.1" + "@jest/types" "^29.6.3" "@types/node" "*" + jest-util "^29.7.0" jest-pnp-resolver@^1.2.2: version "1.2.3" resolved "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz" integrity sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w== -jest-regex-util@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.5.1.tgz#4da143f7e9fd1e542d4aa69617b38e4a78365b95" - integrity sha512-4bfKq2zie+x16okqDXjXn9ql2B0dScQu+vcwe4TvFVhkVyuWLqpZrZtXxLLWoXYgn0E87I6r6GRYHF7wFZBUvg== - jest-regex-util@^29.6.3: version "29.6.3" resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.6.3.tgz#4a556d9c776af68e1c5f48194f4d0327d24e8a52" integrity sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg== -jest-resolve-dependencies@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.5.1.tgz#d811ecc8305e731cc86dd79741ee98fed06f1da8" - integrity sha512-QQOOdY4PE39iawDn5rzbIePNigfe5B9Z91GDD1ae/xNDlu9kaat8QQ5EKnNmVWPV54hUdxCVwwj6YMgR2O7IOg== +jest-resolve-dependencies@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz#1b04f2c095f37fc776ff40803dc92921b1e88428" + integrity sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA== dependencies: - "@jest/types" "^27.5.1" - jest-regex-util "^27.5.1" - jest-snapshot "^27.5.1" + jest-regex-util "^29.6.3" + jest-snapshot "^29.7.0" -jest-resolve@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.5.1.tgz#a2f1c5a0796ec18fe9eb1536ac3814c23617b384" - integrity sha512-FFDy8/9E6CV83IMbDpcjOhumAQPDyETnU2KZ1O98DwTnz8AOBsW/Xv3GySr1mOZdItLR+zDZ7I/UdTFbgSOVCw== +jest-resolve@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.7.0.tgz#64d6a8992dd26f635ab0c01e5eef4399c6bcbc30" + integrity sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA== dependencies: - "@jest/types" "^27.5.1" chalk "^4.0.0" graceful-fs "^4.2.9" - jest-haste-map "^27.5.1" + jest-haste-map "^29.7.0" jest-pnp-resolver "^1.2.2" - jest-util "^27.5.1" - jest-validate "^27.5.1" + jest-util "^29.7.0" + jest-validate "^29.7.0" resolve "^1.20.0" - resolve.exports "^1.1.0" + resolve.exports "^2.0.0" slash "^3.0.0" -jest-runner@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.5.1.tgz#071b27c1fa30d90540805c5645a0ec167c7b62e5" - integrity sha512-g4NPsM4mFCOwFKXO4p/H/kWGdJp9V8kURY2lX8Me2drgXqG7rrZAx5kv+5H7wtt/cdFIjhqYx1HrlqWHaOvDaQ== +jest-runner@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.7.0.tgz#809af072d408a53dcfd2e849a4c976d3132f718e" + integrity sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ== dependencies: - "@jest/console" "^27.5.1" - "@jest/environment" "^27.5.1" - "@jest/test-result" "^27.5.1" - "@jest/transform" "^27.5.1" - "@jest/types" "^27.5.1" + "@jest/console" "^29.7.0" + "@jest/environment" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" "@types/node" "*" chalk "^4.0.0" - emittery "^0.8.1" + emittery "^0.13.1" graceful-fs "^4.2.9" - jest-docblock "^27.5.1" - jest-environment-jsdom "^27.5.1" - jest-environment-node "^27.5.1" - jest-haste-map "^27.5.1" - jest-leak-detector "^27.5.1" - jest-message-util "^27.5.1" - jest-resolve "^27.5.1" - jest-runtime "^27.5.1" - jest-util "^27.5.1" - jest-worker "^27.5.1" - source-map-support "^0.5.6" - throat "^6.0.1" - -jest-runtime@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.5.1.tgz#4896003d7a334f7e8e4a53ba93fb9bcd3db0a1af" - integrity sha512-o7gxw3Gf+H2IGt8fv0RiyE1+r83FJBRruoA+FXrlHw6xEyBsU8ugA6IPfTdVyA0w8HClpbK+DGJxH59UrNMx8A== - dependencies: - "@jest/environment" "^27.5.1" - "@jest/fake-timers" "^27.5.1" - "@jest/globals" "^27.5.1" - "@jest/source-map" "^27.5.1" - "@jest/test-result" "^27.5.1" - "@jest/transform" "^27.5.1" - "@jest/types" "^27.5.1" + jest-docblock "^29.7.0" + jest-environment-node "^29.7.0" + jest-haste-map "^29.7.0" + jest-leak-detector "^29.7.0" + jest-message-util "^29.7.0" + jest-resolve "^29.7.0" + jest-runtime "^29.7.0" + jest-util "^29.7.0" + jest-watcher "^29.7.0" + jest-worker "^29.7.0" + p-limit "^3.1.0" + source-map-support "0.5.13" + +jest-runtime@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.7.0.tgz#efecb3141cf7d3767a3a0cc8f7c9990587d3d817" + integrity sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ== + dependencies: + "@jest/environment" "^29.7.0" + "@jest/fake-timers" "^29.7.0" + "@jest/globals" "^29.7.0" + "@jest/source-map" "^29.6.3" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/node" "*" chalk "^4.0.0" cjs-module-lexer "^1.0.0" collect-v8-coverage "^1.0.0" - execa "^5.0.0" glob "^7.1.3" graceful-fs "^4.2.9" - jest-haste-map "^27.5.1" - jest-message-util "^27.5.1" - jest-mock "^27.5.1" - jest-regex-util "^27.5.1" - jest-resolve "^27.5.1" - jest-snapshot "^27.5.1" - jest-util "^27.5.1" + jest-haste-map "^29.7.0" + jest-message-util "^29.7.0" + jest-mock "^29.7.0" + jest-regex-util "^29.6.3" + jest-resolve "^29.7.0" + jest-snapshot "^29.7.0" + jest-util "^29.7.0" slash "^3.0.0" strip-bom "^4.0.0" -jest-serializer@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-27.5.1.tgz#81438410a30ea66fd57ff730835123dea1fb1f64" - integrity sha512-jZCyo6iIxO1aqUxpuBlwTDMkzOAJS4a3eYz3YzgxxVQFwLeSA7Jfq5cbqCY+JLvTDrWirgusI/0KwxKMgrdf7w== - dependencies: - "@types/node" "*" - graceful-fs "^4.2.9" - -jest-snapshot@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.5.1.tgz#b668d50d23d38054a51b42c4039cab59ae6eb6a1" - integrity sha512-yYykXI5a0I31xX67mgeLw1DZ0bJB+gpq5IpSuCAoyDi0+BhgU/RIrL+RTzDmkNTchvDFWKP8lp+w/42Z3us5sA== +jest-snapshot@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.7.0.tgz#c2c574c3f51865da1bb329036778a69bf88a6be5" + integrity sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw== dependencies: - "@babel/core" "^7.7.2" + "@babel/core" "^7.11.6" "@babel/generator" "^7.7.2" + "@babel/plugin-syntax-jsx" "^7.7.2" "@babel/plugin-syntax-typescript" "^7.7.2" - "@babel/traverse" "^7.7.2" - "@babel/types" "^7.0.0" - "@jest/transform" "^27.5.1" - "@jest/types" "^27.5.1" - "@types/babel__traverse" "^7.0.4" - "@types/prettier" "^2.1.5" + "@babel/types" "^7.3.3" + "@jest/expect-utils" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^27.5.1" + expect "^29.7.0" graceful-fs "^4.2.9" - jest-diff "^27.5.1" - jest-get-type "^27.5.1" - jest-haste-map "^27.5.1" - jest-matcher-utils "^27.5.1" - jest-message-util "^27.5.1" - jest-util "^27.5.1" + jest-diff "^29.7.0" + jest-get-type "^29.6.3" + jest-matcher-utils "^29.7.0" + jest-message-util "^29.7.0" + jest-util "^29.7.0" natural-compare "^1.4.0" - pretty-format "^27.5.1" - semver "^7.3.2" - -jest-util@^27.0.0, jest-util@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.5.1.tgz#3ba9771e8e31a0b85da48fe0b0891fb86c01c2f9" - integrity sha512-Kv2o/8jNvX1MQ0KGtw480E/w4fBCDOnH6+6DmeKi6LZUIlKA5kwY0YNdlzaWTiVgxqAqik11QyxDOKk543aKXw== - dependencies: - "@jest/types" "^27.5.1" - "@types/node" "*" - chalk "^4.0.0" - ci-info "^3.2.0" - graceful-fs "^4.2.9" - picomatch "^2.2.3" + pretty-format "^29.7.0" + semver "^7.5.3" -jest-util@^29.7.0: +jest-util@^29.0.0, jest-util@^29.7.0: version "29.7.0" resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.7.0.tgz#23c2b62bfb22be82b44de98055802ff3710fc0bc" integrity sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA== @@ -16908,40 +17066,32 @@ jest-util@^29.7.0: graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-validate@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.5.1.tgz#9197d54dc0bdb52260b8db40b46ae668e04df067" - integrity sha512-thkNli0LYTmOI1tDB3FI1S1RTp/Bqyd9pTarJwL87OIBFuqEb5Apv5EaApEudYg4g86e3CT6kM0RowkhtEnCBQ== +jest-validate@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.7.0.tgz#7bf705511c64da591d46b15fce41400d52147d9c" + integrity sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw== dependencies: - "@jest/types" "^27.5.1" + "@jest/types" "^29.6.3" camelcase "^6.2.0" chalk "^4.0.0" - jest-get-type "^27.5.1" + jest-get-type "^29.6.3" leven "^3.1.0" - pretty-format "^27.5.1" + pretty-format "^29.7.0" -jest-watcher@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.5.1.tgz#71bd85fb9bde3a2c2ec4dc353437971c43c642a2" - integrity sha512-z676SuD6Z8o8qbmEGhoEUFOM1+jfEiL3DXHK/xgEiG2EyNYfFG60jluWcupY6dATjfEsKQuibReS1djInQnoVw== +jest-watcher@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.7.0.tgz#7810d30d619c3a62093223ce6bb359ca1b28a2f2" + integrity sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g== dependencies: - "@jest/test-result" "^27.5.1" - "@jest/types" "^27.5.1" + "@jest/test-result" "^29.7.0" + "@jest/types" "^29.6.3" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" - jest-util "^27.5.1" + emittery "^0.13.1" + jest-util "^29.7.0" string-length "^4.0.1" -jest-worker@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.5.1.tgz#8d146f0900e8973b106b6f73cc1e9a8cb86f8db0" - integrity sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg== - dependencies: - "@types/node" "*" - merge-stream "^2.0.0" - supports-color "^8.0.0" - jest-worker@^29.7.0: version "29.7.0" resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.7.0.tgz#acad073acbbaeb7262bd5389e1bcf43e10058d4a" @@ -16952,14 +17102,15 @@ jest-worker@^29.7.0: merge-stream "^2.0.0" supports-color "^8.0.0" -jest@27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest/-/jest-27.5.1.tgz#dadf33ba70a779be7a6fc33015843b51494f63fc" - integrity sha512-Yn0mADZB89zTtjkPJEXwrac3LHudkQMR+Paqa8uxJHCBr9agxztUifWCyiYrjhMPBoUVBjyny0I7XH6ozDr7QQ== +jest@29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-29.7.0.tgz#994676fc24177f088f1c5e3737f5697204ff2613" + integrity sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw== dependencies: - "@jest/core" "^27.5.1" + "@jest/core" "^29.7.0" + "@jest/types" "^29.6.3" import-local "^3.0.2" - jest-cli "^27.5.1" + jest-cli "^29.7.0" jiti@^1.17.1: version "1.20.0" @@ -17063,7 +17214,7 @@ jsdom-worker@^0.3.0: mitt "^3.0.0" uuid-v4 "^0.1.0" -jsdom@^16.6.0: +jsdom@16.7.0: version "16.7.0" resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-16.7.0.tgz#918ae71965424b197c819f8183a754e18977b710" integrity sha512-u9Smc2G1USStM+s/x1ru5Sxrl6mPYCbByG1U/hUmqaVsm4tbNyS7CicOSRyuGQYZhTu0h84qkZZQ/I+dzizSVw== @@ -17101,6 +17252,11 @@ jsesc@^2.5.1: resolved "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz" integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== +jsesc@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-3.0.2.tgz#bb8b09a6597ba426425f2e4a07245c3d00b9343e" + integrity sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g== + jsesc@~0.5.0: version "0.5.0" resolved "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz" @@ -17155,6 +17311,16 @@ json-stable-stringify-without-jsonify@^1.0.1: resolved "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz" integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== +json-stable-stringify@^1.0.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.1.1.tgz#52d4361b47d49168bcc4e564189a42e5a7439454" + integrity sha512-SU/971Kt5qVQfJpyDveVhQ/vya+5hvrjClFOcr8c0Fq5aODJjMwutrOfCU+eCnVD5gpx1Q3fEqkyom77zH1iIg== + dependencies: + call-bind "^1.0.5" + isarray "^2.0.5" + jsonify "^0.0.1" + object-keys "^1.1.1" + json-stream@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/json-stream/-/json-stream-1.0.0.tgz" @@ -17173,11 +17339,6 @@ json-to-pretty-yaml@^1.2.2: remedial "^1.0.7" remove-trailing-spaces "^1.0.6" -json5@2.x, json5@^2.2.0, json5@^2.2.2, json5@^2.2.3: - version "2.2.3" - resolved "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz" - integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== - json5@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz" @@ -17185,6 +17346,11 @@ json5@^1.0.2: dependencies: minimist "^1.2.0" +json5@^2.2.0, json5@^2.2.2, json5@^2.2.3: + version "2.2.3" + resolved "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz" + integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== + jsonc-parser@3.2.0: version "3.2.0" resolved "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz" @@ -17206,6 +17372,11 @@ jsonfile@^6.0.1: optionalDependencies: graceful-fs "^4.1.6" +jsonify@^0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.1.tgz#2aa3111dae3d34a0f151c63f3a45d995d9420978" + integrity sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg== + jsonparse@^1.2.0, jsonparse@^1.3.1: version "1.3.1" resolved "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz" @@ -17723,7 +17894,7 @@ lodash.isundefined@^3.0.1: resolved "https://registry.npmjs.org/lodash.isundefined/-/lodash.isundefined-3.0.1.tgz" integrity sha512-MXB1is3s899/cD8jheYYE2V9qTHwKvt+npCwpD+1Sxm3Q3cECXCiYHjeHWXNwr6Q0SOBPrYUDxendrO6goVTEA== -lodash.memoize@4.x: +lodash.memoize@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" integrity sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag== @@ -17937,6 +18108,13 @@ magic-string@^0.27.0: dependencies: "@jridgewell/sourcemap-codec" "^1.4.13" +magic-string@^0.29.0: + version "0.29.0" + resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.29.0.tgz#f034f79f8c43dba4ae1730ffb5e8c4e084b16cf3" + integrity sha512-WcfidHrDjMY+eLjlU+8OvwREqHwpgCeKVBUpQ3OhYYuvfaYCUgcbuBzappNzZvg/v8onU3oQj+BYpkOJe9Iw4Q== + dependencies: + "@jridgewell/sourcemap-codec" "^1.4.13" + magic-string@^0.30.0: version "0.30.5" resolved "https://registry.npmjs.org/magic-string/-/magic-string-0.30.5.tgz" @@ -17966,7 +18144,7 @@ make-dir@^3.0.2: dependencies: semver "^6.0.0" -make-error@1.x, make-error@^1.1.1, make-error@^1.3.2: +make-error@^1.1.1, make-error@^1.3.2, make-error@^1.3.6: version "1.3.6" resolved "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== @@ -19153,9 +19331,9 @@ nullthrows@^1.1.1: integrity sha512-2vPPEi+Z7WqML2jZYddDIfy5Dqb0r2fze2zTxNNknZaFpVHU3mFB3R+DWeJWGVx0ecvttSGlJTI+WG+8Z4cDWw== nwsapi@^2.2.0: - version "2.2.7" - resolved "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.7.tgz" - integrity sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ== + version "2.2.13" + resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.13.tgz#e56b4e98960e7a040e5474536587e599c4ff4655" + integrity sha512-cTGB9ptp9dY9A5VbMSe7fQBcl/tt22Vcqdq8+eN93rblOuE0aCFu4aZ2vMwct/2t+lFnosm8RkQW1I0Omb1UtQ== nx@19.0.5, "nx@>=17.1.2 < 20": version "19.0.5" @@ -19545,7 +19723,7 @@ p-finally@^1.0.0: resolved "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz" integrity sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow== -p-limit@3.1.0, p-limit@^3.0.2: +p-limit@3.1.0, p-limit@^3.0.2, p-limit@^3.1.0: version "3.1.0" resolved "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz" integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== @@ -19753,7 +19931,7 @@ parse5-htmlparser2-tree-adapter@^7.0.0: parse5@6.0.1: version "6.0.1" - resolved "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw== parse5@^7.0.0: @@ -20254,15 +20432,6 @@ pretty-format@^26.0.0, pretty-format@^26.6.2: ansi-styles "^4.0.0" react-is "^17.0.1" -pretty-format@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.5.1.tgz#2181879fdea51a7a5851fb39d920faa63f01d88e" - integrity sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ== - dependencies: - ansi-regex "^5.0.1" - ansi-styles "^5.0.0" - react-is "^17.0.1" - pretty-format@^29.7.0: version "29.7.0" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.7.0.tgz#ca42c758310f365bfa71a0bda0a807160b776812" @@ -20403,9 +20572,11 @@ pseudomap@^1.0.2: integrity sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ== psl@^1.1.33: - version "1.9.0" - resolved "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz" - integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag== + version "1.10.0" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.10.0.tgz#1450f7e16f922c3beeb7bd9db3f312635018fa15" + integrity sha512-KSKHEbjAnpUuAUserOq0FxGXCUrzC3WniuSJhvdbs102rL55266ZcHBqLWOsG30spQMlPdpy7icATiAQehg/iA== + dependencies: + punycode "^2.3.1" pstree.remy@^1.1.8: version "1.1.8" @@ -20456,6 +20627,11 @@ punycode@^2.1.0, punycode@^2.1.1: resolved "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz" integrity sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA== +punycode@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" + integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== + puppeteer-core@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/puppeteer-core/-/puppeteer-core-2.1.1.tgz#e9b3fbc1237b4f66e25999832229e9db3e0b90ed" @@ -20472,6 +20648,11 @@ puppeteer-core@^2.1.1: rimraf "^2.6.1" ws "^6.1.0" +pure-rand@^6.0.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/pure-rand/-/pure-rand-6.1.0.tgz#d173cf23258231976ccbdb05247c9787957604f2" + integrity sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA== + pvtsutils@^1.3.2, pvtsutils@^1.3.5: version "1.3.5" resolved "https://registry.npmjs.org/pvtsutils/-/pvtsutils-1.3.5.tgz" @@ -20537,7 +20718,7 @@ querystring@^0.2.1: querystringify@^2.1.1: version "2.2.0" - resolved "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz" + resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6" integrity sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ== queue-microtask@^1.2.2: @@ -21455,7 +21636,7 @@ require-main-filename@^2.0.0: requires-port@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz" + resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" integrity sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ== reselect@^4.1.8: @@ -21500,17 +21681,17 @@ resolve-pkg-maps@^1.0.0: resolved "https://registry.yarnpkg.com/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz#616b3dc2c57056b5588c31cdf4b3d64db133720f" integrity sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw== -resolve.exports@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-1.1.1.tgz#05cfd5b3edf641571fd46fa608b610dda9ead999" - integrity sha512-/NtpHNDN7jWhAaQ9BvBUYZ6YTXsRBgfqWFWP7BZBaoMJO/I3G5OFzvTuWNlZC3aPjins1F+TNrLKsGbH4rfsRQ== +resolve.exports@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-2.0.2.tgz#f8c934b8e6a13f539e38b7098e2e36134f01e800" + integrity sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg== resolve@1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" integrity sha512-9znBF0vBcaSN3W2j7wKvdERPwqTxSpCq+if5C0WoTCyV9n24rua28jeuQ2pL/HOf+yUe/Mef+H/5p60K0Id3bg== -resolve@^1.1.5, resolve@^1.10.0, resolve@^1.12.0, resolve@^1.14.2, resolve@^1.20.0, resolve@^1.22.1, resolve@^1.22.4: +resolve@^1.1.5, resolve@^1.10.0, resolve@^1.12.0, resolve@^1.14.2, resolve@^1.19.0, resolve@^1.20.0, resolve@^1.22.1, resolve@^1.22.4: version "1.22.8" resolved "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz" integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== @@ -21783,7 +21964,7 @@ sax@>=0.6.0, sax@^1.2.4: saxes@^5.0.1: version "5.0.1" - resolved "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz" + resolved "https://registry.yarnpkg.com/saxes/-/saxes-5.0.1.tgz#eebab953fa3b7608dbe94e5dadb15c888fa6696d" integrity sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw== dependencies: xmlchars "^2.2.0" @@ -21841,23 +22022,28 @@ seedrandom@3.x.x: resolved "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz" integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== -semver@7.x, semver@^7.0.0, semver@^7.1.1, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.5.3, semver@^7.5.4: +semver@^6.0.0, semver@^6.3.0, semver@^6.3.1: + version "6.3.1" + resolved "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz" + integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== + +semver@^7.0.0, semver@^7.1.1, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.5.3, semver@^7.5.4: version "7.5.4" resolved "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz" integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== dependencies: lru-cache "^6.0.0" -semver@^6.0.0, semver@^6.3.0, semver@^6.3.1: - version "6.3.1" - resolved "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz" - integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== - semver@^7.3.8: version "7.6.2" resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.2.tgz#1e3b34759f896e8f14d6134732ce798aeb0c6e13" integrity sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w== +semver@^7.6.3: + version "7.6.3" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" + integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== + send@0.19.0: version "0.19.0" resolved "https://registry.yarnpkg.com/send/-/send-0.19.0.tgz#bbc5a388c8ea6c048967049dbeac0e4a3f09d7f8" @@ -22272,6 +22458,14 @@ source-map-js@^1.2.1: resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.1.tgz#1ce5650fddd87abc099eda37dcff024c2667ae46" integrity sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA== +source-map-support@0.5.13: + version "0.5.13" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.13.tgz#31b24a9c2e73c2de85066c0feb7d44767ed52932" + integrity sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + source-map-support@0.5.x, source-map-support@^0.5.16, source-map-support@^0.5.17, source-map-support@^0.5.6, source-map-support@~0.5.20: version "0.5.21" resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz" @@ -22280,7 +22474,7 @@ source-map-support@0.5.x, source-map-support@^0.5.16, source-map-support@^0.5.17 buffer-from "^1.0.0" source-map "^0.6.0" -source-map@0.7.x, source-map@^0.7.2, source-map@^0.7.3: +source-map@0.7.x, source-map@^0.7.2: version "0.7.4" resolved "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz" integrity sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA== @@ -22593,7 +22787,16 @@ string-similarity@^4.0.1: resolved "https://registry.npmjs.org/string-similarity/-/string-similarity-4.0.4.tgz" integrity sha512-/q/8Q4Bl4ZKAPjj8WerIBJWALKkaPRfrvhfF8k/B23i4nzrlRj2/go1m90In7nG/3XDSbOo0+pu6RvCTM9RGMQ== -"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0": + version "4.2.3" + resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -22753,7 +22956,7 @@ stringify-object@^3.3.0: is-obj "^1.0.1" is-regexp "^1.0.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": version "6.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -22774,6 +22977,13 @@ strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + strip-ansi@^7.0.1, strip-ansi@^7.1.0: version "7.1.0" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz" @@ -23017,7 +23227,7 @@ supports-color@^8.0.0, supports-color@^8.1.1: dependencies: has-flag "^4.0.0" -supports-hyperlinks@^2.0.0, supports-hyperlinks@^2.3.0: +supports-hyperlinks@^2.3.0: version "2.3.0" resolved "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.3.0.tgz" integrity sha512-RpsAZlpWcDwOPQA22aCH4J0t7L8JmAvsCxfOSEwm7cQs3LshN36QaTkwd70DnBOXDWGssw2eUoc8CaRWT0XunA== @@ -23066,7 +23276,7 @@ symbol-observable@^4.0.0: symbol-tree@^3.2.4: version "3.2.4" - resolved "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz" + resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== synchronous-promise@^2.0.15: @@ -23196,14 +23406,6 @@ tempy@^1.0.1: type-fest "^0.16.0" unique-string "^2.0.0" -terminal-link@^2.0.0: - version "2.1.1" - resolved "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz" - integrity sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ== - dependencies: - ansi-escapes "^4.2.1" - supports-hyperlinks "^2.0.0" - terser@^5.17.4: version "5.31.0" resolved "https://registry.yarnpkg.com/terser/-/terser-5.31.0.tgz#06eef86f17007dbad4593f11a574c7f5eb02c6a1" @@ -23281,11 +23483,6 @@ thread-stream@^0.15.1: dependencies: real-require "^0.1.0" -throat@^6.0.1: - version "6.0.2" - resolved "https://registry.yarnpkg.com/throat/-/throat-6.0.2.tgz#51a3fbb5e11ae72e2cf74861ed5c8020f89f29fe" - integrity sha512-WKexMoJj3vEuK0yFEapj8y64V0A6xcuPuK9Gt1d0R+dzCSJc0lHqQytAbSB4cDAK0dWh4T0E2ETkoLE2WZ41OQ== - through2@^2.0.0, through2@^2.0.1, through2@^2.0.3, through2@~2.0.3: version "2.0.5" resolved "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz" @@ -23427,9 +23624,9 @@ touch@^3.1.0: nopt "~1.0.10" tough-cookie@^4.0.0: - version "4.1.3" - resolved "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz" - integrity sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw== + version "4.1.4" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.1.4.tgz#945f1461b45b5a8c76821c33ea49c3ac192c1b36" + integrity sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag== dependencies: psl "^1.1.33" punycode "^2.1.1" @@ -23445,7 +23642,7 @@ tr46@^1.0.1: tr46@^2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-2.1.0.tgz#fa87aa81ca5d5941da8cbf1f9b749dc969a4e240" integrity sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw== dependencies: punycode "^2.1.1" @@ -23511,19 +23708,20 @@ ts-invariant@^0.4.0: dependencies: tslib "^1.9.3" -ts-jest@27.1.4: - version "27.1.4" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-27.1.4.tgz#84d42cf0f4e7157a52e7c64b1492c46330943e00" - integrity sha512-qjkZlVPWVctAezwsOD1OPzbZ+k7zA5z3oxII4dGdZo5ggX/PL7kvwTM0pXTr10fAtbiVpJaL3bWd502zAhpgSQ== +ts-jest@29.2.5: + version "29.2.5" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-29.2.5.tgz#591a3c108e1f5ebd013d3152142cb5472b399d63" + integrity sha512-KD8zB2aAZrcKIdGk4OwpJggeLcH1FgrICqDSROWqlnJXGCXK4Mn6FcdK2B6670Xr73lHMG1kHw8R87A0ecZ+vA== dependencies: - bs-logger "0.x" - fast-json-stable-stringify "2.x" - jest-util "^27.0.0" - json5 "2.x" - lodash.memoize "4.x" - make-error "1.x" - semver "7.x" - yargs-parser "20.x" + bs-logger "^0.2.6" + ejs "^3.1.10" + fast-json-stable-stringify "^2.1.0" + jest-util "^29.0.0" + json5 "^2.2.3" + lodash.memoize "^4.1.2" + make-error "^1.3.6" + semver "^7.6.3" + yargs-parser "^21.1.1" ts-log@^2.2.3: version "2.2.5" @@ -23612,6 +23810,11 @@ tslib@2.0.1: resolved "https://registry.npmjs.org/tslib/-/tslib-2.0.1.tgz" integrity sha512-SgIkNheinmEBgx1IUNirK0TUD4X9yjjBRTqqjggWCU3pUEqIk3/Uwl3yRixYKT6WjQuGiwDv4NomL3wqRCj+CQ== +tslib@2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" + integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== + tslib@2.6.2, tslib@^2.0.0, tslib@^2.0.1, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.3.0, tslib@^2.3.1, tslib@^2.4.0, tslib@^2.5.0, tslib@^2.6.1, tslib@^2.6.2: version "2.6.2" resolved "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz" @@ -23827,27 +24030,15 @@ typed-array-length@^1.0.5, typed-array-length@^1.0.6: is-typed-array "^1.1.13" possible-typed-array-names "^1.0.0" -typedarray-to-buffer@^3.1.5: - version "3.1.5" - resolved "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz" - integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q== - dependencies: - is-typedarray "^1.0.0" - typedarray@^0.0.6: version "0.0.6" resolved "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz" integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA== -typescript@4.9.5, typescript@^4.5: - version "4.9.5" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" - integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== - -"typescript@>=3 < 6": - version "5.4.5" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.4.5.tgz#42ccef2c571fdbd0f6718b1d1f5e6e5ef006f611" - integrity sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ== +typescript@5.6.3, "typescript@^4.7 || 5", "typescript@>=3 < 6": + version "5.6.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.6.3.tgz#5f3449e31c9d94febb17de03cc081dd56d81db5b" + integrity sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw== typical@^2.6.1: version "2.6.1" @@ -23929,6 +24120,13 @@ unicode-canonical-property-names-ecmascript@^2.0.0: resolved "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz" integrity sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ== +unicode-emoji-utils@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/unicode-emoji-utils/-/unicode-emoji-utils-1.2.0.tgz#4f9452fcab0e3816ff1d93412d06ee1a1ba2cdc0" + integrity sha512-djUB91p/6oYpgps4W5K/MAvM+UspoAANHSUW495BrxeLRoned3iNPEDQgrKx9LbLq93VhNz0NWvI61vcfrwYoA== + dependencies: + emoji-regex "10.3.0" + unicode-match-property-ecmascript@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz" @@ -24023,7 +24221,7 @@ universalify@^0.1.0: universalify@^0.2.0: version "0.2.0" - resolved "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.2.0.tgz#6451760566fa857534745ab1dde952d1b1761be0" integrity sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg== universalify@^2.0.0: @@ -24076,7 +24274,7 @@ update-browserslist-db@^1.0.13: escalade "^3.1.1" picocolors "^1.0.0" -update-browserslist-db@^1.1.0: +update-browserslist-db@^1.1.0, update-browserslist-db@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz#80846fba1d79e82547fb661f8d141e0945755fe5" integrity sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A== @@ -24115,7 +24313,7 @@ uri-js@^4.2.2: url-parse@^1.5.3: version "1.5.10" - resolved "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz" + resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.10.tgz#9d3c2f736c1d75dd3bd2be507dcc111f1e2ea9c1" integrity sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ== dependencies: querystringify "^2.1.1" @@ -24219,15 +24417,6 @@ v8-compile-cache@^2.0.3, v8-compile-cache@^2.3.0: resolved "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.4.0.tgz" integrity sha512-ocyWc3bAHBB/guyqJQVI5o4BZkPhznPYUG2ea80Gond/BgNWpap8TOmLSeeQG7bnh2KMISxskdADG59j7zruhw== -v8-to-istanbul@^8.1.0: - version "8.1.1" - resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-8.1.1.tgz#77b752fd3975e31bbcef938f85e9bd1c7a8d60ed" - integrity sha512-FGtKtv3xIpR6BYhvgH8MI/y78oT7d8Au3ww4QIxymrCtZEh5b8gCw2siywE+puhEmuWKDtmfrvF5UlB298ut3w== - dependencies: - "@types/istanbul-lib-coverage" "^2.0.1" - convert-source-map "^1.6.0" - source-map "^0.7.3" - v8-to-istanbul@^9.0.0: version "9.1.3" resolved "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.3.tgz" @@ -24237,6 +24426,15 @@ v8-to-istanbul@^9.0.0: "@types/istanbul-lib-coverage" "^2.0.1" convert-source-map "^2.0.0" +v8-to-istanbul@^9.0.1: + version "9.3.0" + resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz#b9572abfa62bd556c16d75fdebc1a411d5ff3175" + integrity sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA== + dependencies: + "@jridgewell/trace-mapping" "^0.3.12" + "@types/istanbul-lib-coverage" "^2.0.1" + convert-source-map "^2.0.0" + validate-npm-package-license@3.0.4, validate-npm-package-license@^3.0.1, validate-npm-package-license@^3.0.4: version "3.0.4" resolved "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz" @@ -24309,6 +24507,17 @@ victory-vendor@^36.6.8: d3-time "^3.0.0" d3-timer "^3.0.1" +vite-plugin-babel-macros@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/vite-plugin-babel-macros/-/vite-plugin-babel-macros-1.0.6.tgz#d05cee3c38c620ccb534e38f412fdd899a3365b5" + integrity sha512-7cCT8jtu5UjpE46pH7RyVltWw5FbhDAtQliZ6QGqRNR5RUZKdAsB0CDjuF+VBoDpnl0KuESPu22SoNqXRYYWyQ== + dependencies: + "@babel/core" "^7.17.7" + "@babel/plugin-syntax-jsx" "^7.16.7" + "@babel/plugin-syntax-typescript" "^7.16.7" + "@types/babel__core" "^7.1.18" + babel-plugin-macros "^3.1.0" + vite-plugin-pwa@^0.20.0: version "0.20.0" resolved "https://registry.yarnpkg.com/vite-plugin-pwa/-/vite-plugin-pwa-0.20.0.tgz#1785c8cc8c11c89c0ba8c6557f29e2b58b14dd6d" @@ -24431,19 +24640,19 @@ vitest@0.25.8, vitest@^0.25.5: w3c-hr-time@^1.0.2: version "1.0.2" - resolved "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz" + resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz#0a89cdf5cc15822df9c360543676963e0cc308cd" integrity sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ== dependencies: browser-process-hrtime "^1.0.0" w3c-xmlserializer@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz" + resolved "https://registry.yarnpkg.com/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz#3e7104a05b75146cc60f564380b7f683acf1020a" integrity sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA== dependencies: xml-name-validator "^3.0.0" -walker@^1.0.7, walker@^1.0.8: +walker@^1.0.8: version "1.0.8" resolved "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz" integrity sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ== @@ -24514,12 +24723,12 @@ webidl-conversions@^4.0.2: webidl-conversions@^5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-5.0.0.tgz#ae59c8a00b121543a2acc65c0434f57b0fc11aff" integrity sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA== webidl-conversions@^6.1.0: version "6.1.0" - resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-6.1.0.tgz#9111b4d7ea80acd40f5270d666621afa78b69514" integrity sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w== webidl-conversions@^7.0.0: @@ -24546,7 +24755,7 @@ webpack-virtual-modules@^0.5.0: whatwg-encoding@^1.0.5: version "1.0.5" - resolved "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz" + resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0" integrity sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw== dependencies: iconv-lite "0.4.24" @@ -24558,7 +24767,7 @@ whatwg-fetch@^2.0.4: whatwg-mimetype@^2.3.0: version "2.3.0" - resolved "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz" + resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== whatwg-mimetype@^3.0.0: @@ -24593,7 +24802,7 @@ whatwg-url@^7.0.0: whatwg-url@^8.0.0, whatwg-url@^8.5.0: version "8.7.0" - resolved "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.7.0.tgz" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-8.7.0.tgz#656a78e510ff8f3937bc0bcbe9f5c0ac35941b77" integrity sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg== dependencies: lodash "^4.7.0" @@ -24908,7 +25117,7 @@ workbox-window@7.1.0, workbox-window@^7.1.0: "@types/trusted-types" "^2.0.2" workbox-core "7.1.0" -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": version "7.0.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -24935,6 +25144,15 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^8.0.1, wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz" @@ -24975,16 +25193,6 @@ write-file-atomic@^2.3.0, write-file-atomic@^2.4.2: imurmurhash "^0.1.4" signal-exit "^3.0.2" -write-file-atomic@^3.0.0: - version "3.0.3" - resolved "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz" - integrity sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q== - dependencies: - imurmurhash "^0.1.4" - is-typedarray "^1.0.0" - signal-exit "^3.0.2" - typedarray-to-buffer "^3.1.5" - write-file-atomic@^4.0.2: version "4.0.2" resolved "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz" @@ -25022,9 +25230,9 @@ ws@^6.1.0: async-limiter "~1.0.0" ws@^7.4.6: - version "7.5.9" - resolved "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz" - integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q== + version "7.5.10" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.10.tgz#58b5c20dc281633f6c19113f39b349bd8bd558d9" + integrity sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ== ws@^8.12.0, ws@^8.2.3: version "8.14.2" @@ -25038,7 +25246,7 @@ ws@^8.13.0, ws@^8.15.0: xml-name-validator@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz" + resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw== xml2js@^0.5.0: @@ -25061,7 +25269,7 @@ xmlbuilder@~11.0.0: xmlchars@^2.2.0: version "2.2.0" - resolved "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz" + resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw== xmldoc@^1.1.2: @@ -25141,11 +25349,6 @@ yaml@~2.5.0: resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.5.1.tgz#c9772aacf62cb7494a95b0c4f1fb065b563db130" integrity sha512-bLQOjaX/ADgQ20isPJRvF0iRUHIxVhYvr53Of7wGcWlO2jvtUlH5m87DsmulFVxRpNLOnI4tB6p/oh8D7kpn9Q== -yargs-parser@20.x, yargs-parser@^20.2.2, yargs-parser@^20.2.3, yargs-parser@^20.2.9: - version "20.2.9" - resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz" - integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== - yargs-parser@21.1.1, yargs-parser@^21.1.1: version "21.1.1" resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz" @@ -25167,6 +25370,11 @@ yargs-parser@^18.1.2: camelcase "^5.0.0" decamelize "^1.2.0" +yargs-parser@^20.2.2, yargs-parser@^20.2.3, yargs-parser@^20.2.9: + version "20.2.9" + resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz" + integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== + yargs@17.7.2, yargs@^17.0.0, yargs@^17.3.1, yargs@^17.6.2, yargs@^17.7.2: version "17.7.2" resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269" From 616b5c4edfba4f18266b3dc29eca9f64cde5f516 Mon Sep 17 00:00:00 2001 From: Riku Rouvila Date: Fri, 15 Nov 2024 09:47:53 +0200 Subject: [PATCH 46/50] Revert "chore(deps): update dependency typescript to v5 (#7374)" This reverts commit 970945f6dd6a75c3f04c3b17715e6fe042bf76c3. --- packages/auth/package.json | 6 +- packages/auth/tsconfig.json | 24 +- packages/client/package.json | 5 +- packages/commons/package.json | 6 +- packages/commons/src/assignment.test.ts | 66 +- packages/commons/src/fhir/composition.ts | 2 +- .../commons/src/fhir/transformers/index.ts | 8 +- .../src/fhir/transformers/templates.ts | 7 +- packages/commons/src/fixtures/birth-bundle.ts | 12 +- packages/commons/src/fixtures/death-bundle.ts | 15 +- .../commons/src/fixtures/marriage-bundle.ts | 21 +- packages/components/package.json | 6 +- packages/components/src/Alert/Alert.tsx | 1 - .../components/src/Summary/components/Row.tsx | 1 - packages/components/src/Toast/Toast.tsx | 1 - packages/components/tsconfig.json | 21 +- packages/config/package.json | 54 +- .../src/handlers/locations/children.test.ts | 6 +- .../config/src/handlers/locations/handler.ts | 3 +- .../src/handlers/locations/hierarchy.test.ts | 6 +- packages/config/tsconfig.json | 26 +- packages/data-seeder/package.json | 2 +- packages/data-seeder/tsconfig.json | 22 +- packages/documents/package.json | 6 +- packages/documents/tsconfig.json | 1 + packages/gateway/package.json | 46 +- .../correction/root-resolvers.test.ts | 4 +- .../features/location/root-resolvers.test.ts | 13 +- .../__snapshots__/type-resolvers.test.ts.snap | 370 ++-- .../registration/root-resolvers.test.ts | 12 +- .../features/registration/type-resolvers.ts | 2 +- .../gateway/src/features/user/utils/index.ts | 2 +- packages/gateway/src/rate-limit.test.ts | 5 +- packages/gateway/test/setupJest.ts | 8 +- packages/gateway/tsconfig.json | 6 +- packages/login/package.json | 3 +- packages/metrics/package.json | 9 +- .../declarationsStarted/handler.test.ts | 5 +- .../features/declarationsStarted/handler.ts | 3 +- .../metrics/src/features/export/handler.ts | 4 +- .../features/getTimeLogged/handler.test.ts | 3 +- .../src/features/metrics/metricsGenerator.ts | 34 +- .../monthWiseEventEstimations/handler.test.ts | 3 +- .../__snapshots__/handler.test.ts.snap | 60 +- .../metrics/src/scripts/VSExportGenerator.ts | 14 +- packages/metrics/src/utils/authUtils.ts | 2 +- packages/metrics/tsconfig.json | 31 +- packages/migration/package.json | 2 +- packages/migration/tsconfig.json | 2 +- packages/notification/extract-translations.sh | 2 +- packages/notification/package.json | 9 +- .../notification/src/extract-translations.ts | 4 +- .../src/features/sms/user-handler.ts | 2 +- packages/notification/tsconfig.json | 23 +- packages/search/package.json | 9 +- .../search/src/features/reindex/handler.ts | 3 +- packages/search/src/test/utils.ts | 41 +- packages/search/src/utils/authUtils.ts | 2 +- packages/search/tsconfig.json | 2 +- packages/user-mgnt/package.json | 9 +- packages/user-mgnt/src/database.test.ts | 2 +- packages/user-mgnt/src/database.ts | 2 +- .../src/features/createUser/service.test.ts | 6 +- .../user-mgnt/src/features/system/handler.ts | 4 +- .../src/features/userAudit/handler.ts | 4 +- .../src/features/userSearchRecord/handler.ts | 4 +- packages/user-mgnt/src/utils/token.ts | 2 +- packages/user-mgnt/src/utils/userUtils.ts | 2 +- packages/user-mgnt/test/setupJest.ts | 4 +- packages/user-mgnt/tsconfig.json | 15 +- packages/webhooks/package.json | 9 +- .../src/features/manage/handler.test.ts | 4 +- .../webhooks/src/features/manage/handler.ts | 6 +- .../webhooks/src/features/manage/service.ts | 2 +- packages/webhooks/tsconfig.json | 32 +- packages/workflow/package.json | 9 +- .../state-transitions.test.ts.snap | 102 +- packages/workflow/src/records/fhir.ts | 8 +- .../workflow/src/records/handler/create.ts | 4 +- packages/workflow/src/test/utils.ts | 2 +- packages/workflow/src/utils/auth-utils.ts | 2 +- .../workflow/src/utils/duplicate-checker.ts | 8 +- packages/workflow/test/handlers.ts | 5 +- packages/workflow/test/mocks/locations.ts | 8 +- .../workflow/test/mocks/practitionerRole.ts | 3 +- .../workflow/test/mocks/records/archive.ts | 21 +- .../workflow/test/mocks/records/certify.ts | 32 +- .../test/mocks/records/readyForReview.ts | 26 +- .../workflow/test/mocks/records/register.ts | 26 +- packages/workflow/tsconfig.json | 4 +- yarn.lock | 1740 ++++++++--------- 91 files changed, 1474 insertions(+), 1701 deletions(-) diff --git a/packages/auth/package.json b/packages/auth/package.json index eea32652508..ceef33073d0 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -54,14 +54,14 @@ "eslint-config-prettier": "^9.0.0", "eslint-plugin-import": "^2.17.3", "eslint-plugin-prettier": "^4.0.0", - "jest": "29.7.0", + "jest": "27.5.1", "jest-fetch-mock": "^2.1.2", "nodemon": "^3.0.0", "prettier": "2.8.8", "redis-mock": "^0.56.0", - "ts-jest": "29.2.5", + "ts-jest": "27.1.4", "ts-node": "^6.1.1", - "typescript": "5.6.3" + "typescript": "4.9.5" }, "lint-staged": { "src/**/*.ts": [ diff --git a/packages/auth/tsconfig.json b/packages/auth/tsconfig.json index b09507251d6..00523a2349f 100644 --- a/packages/auth/tsconfig.json +++ b/packages/auth/tsconfig.json @@ -2,7 +2,9 @@ "compilerOptions": { "baseUrl": "./src", "paths": { - "@auth/*": ["./*"] + "@auth/*": [ + "./*" + ] }, "target": "es6", "module": "commonjs", @@ -12,16 +14,28 @@ "sourceMap": true, "moduleResolution": "node", "rootDir": ".", - "lib": ["esnext.asynciterable", "es6", "es2017"], + "lib": [ + "esnext.asynciterable", + "es6", + "es2017" + ], "forceConsistentCasingInFileNames": true, "noImplicitReturns": true, "noImplicitThis": true, "noImplicitAny": true, "strictNullChecks": true, + "suppressImplicitAnyIndexErrors": true, "noUnusedLocals": true, - "types": ["fhir", "jest"] + "types": [ + "fhir", + "jest" + ] }, - "include": ["resources/**/*.ts", "src/**/*.ts", "typings"], + "include": [ + "resources/**/*.ts", + "src/**/*.ts", + "typings" + ], "exclude": [ "node_modules", "build", @@ -29,4 +43,4 @@ "acceptance-tests", "src/setupTests.ts" ] -} +} \ No newline at end of file diff --git a/packages/client/package.json b/packages/client/package.json index 39031ccd533..2904fa44351 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -69,7 +69,6 @@ "history": "^4.7.2", "html-to-pdfmake": "^2.5.13", "iframe-resizer-react": "^1.1.0", - "jsdom": "16.7.0", "jsdom-worker": "^0.3.0", "jwt-decode": "^2.2.0", "localforage": "^1.7.2", @@ -143,7 +142,7 @@ "eslint-config-prettier": "^9.0.0", "eslint-config-react-app": "^6.0.0", "eslint-plugin-flowtype": "^5.2.0", - "eslint-plugin-formatjs": "4.10.0", + "eslint-plugin-formatjs": "2.21.0", "eslint-plugin-import": "^2.17.3", "eslint-plugin-jsx-a11y": "^6.3.1", "eslint-plugin-prettier": "^4.0.0", @@ -162,7 +161,7 @@ "stylelint-processor-styled-components": "^1.10.0", "traverse": "^0.6.6", "ts-node": "^7.0.1", - "typescript": "5.6.3", + "typescript": "4.9.5", "vite-plugin-pwa": "^0.20.0", "vitest": "0.25.5", "vitest-fetch-mock": "^0.2.1" diff --git a/packages/commons/package.json b/packages/commons/package.json index 56c28cbcc57..7f09b9826ea 100644 --- a/packages/commons/package.json +++ b/packages/commons/package.json @@ -35,12 +35,12 @@ "@types/uuid": "^9.0.3", "date-fns": "^2.28.0", "elastic-apm-node": "^3.29.0", - "jest": "29.7.0", + "jest": "27.5.1", "jwt-decode": "^2.2.0", "lodash": "^4.17.10", "node-fetch": "^2.6.7", "pkg-up": "^3.1.0", - "typescript": "5.6.3", + "typescript": "4.9.5", "uuid": "^9.0.0", "pino": "^7.0.0" }, @@ -53,7 +53,7 @@ "eslint-plugin-prettier": "^4.0.0", "jest-fetch-mock": "^2.1.2", "pino-pretty": "^11.0.0", - "ts-jest": "29.2.5" + "ts-jest": "27.1.4" }, "lint-staged": { "src/**/*.ts": [ diff --git a/packages/commons/src/assignment.test.ts b/packages/commons/src/assignment.test.ts index d09ed922476..d764b4a9bba 100644 --- a/packages/commons/src/assignment.test.ts +++ b/packages/commons/src/assignment.test.ts @@ -50,8 +50,7 @@ it('finds assignment from the latest task', () => { ] }, focus: { - reference: - 'Composition/c5811d36-934d-40f9-94b4-15194d562e45' as `Composition/${UUID}` + reference: 'Composition/c5811d36-934d-40f9-94b4-15194d562e45' }, extension: [ { @@ -123,8 +122,7 @@ it("finds assignment when it's in TaskHistory and status HAS NOT changed", () => ] }, focus: { - reference: - 'Composition/c5811d36-934d-40f9-94b4-15194d562e45' as `Composition/${UUID}` + reference: 'Composition/c5811d36-934d-40f9-94b4-15194d562e45' }, identifier: [ { @@ -139,15 +137,13 @@ it("finds assignment when it's in TaskHistory and status HAS NOT changed", () => { url: 'http://opencrvs.org/specs/extension/regLastUser', valueReference: { - reference: - 'Practitioner/00000000-0000-4000-8000-000000000001' as `Practitioner/${UUID}` + reference: 'Practitioner/00000000-0000-4000-8000-000000000001' } }, { url: 'http://opencrvs.org/specs/extension/regLastOffice', valueReference: { - reference: - 'Location/00000000-0000-4000-8000-000000000010' as `Location/${UUID}` + reference: 'Location/00000000-0000-4000-8000-000000000010' } } ], @@ -272,8 +268,7 @@ it("does not find assignment when it's in TaskHistory and status HAS changed", ( ] }, focus: { - reference: - 'Composition/c5811d36-934d-40f9-94b4-15194d562e45' as `Composition/${UUID}` + reference: 'Composition/c5811d36-934d-40f9-94b4-15194d562e45' }, identifier: [ { @@ -288,15 +283,13 @@ it("does not find assignment when it's in TaskHistory and status HAS changed", ( { url: 'http://opencrvs.org/specs/extension/regLastUser', valueReference: { - reference: - 'Practitioner/00000000-0000-4000-8000-000000000001' as `Practitioner/${UUID}` + reference: 'Practitioner/00000000-0000-4000-8000-000000000001' } }, { url: 'http://opencrvs.org/specs/extension/regLastOffice', valueReference: { - reference: - 'Location/00000000-0000-4000-8000-000000000010' as `Location/${UUID}` + reference: 'Location/00000000-0000-4000-8000-000000000010' } } ], @@ -324,8 +317,7 @@ it("does not find assignment when it's in TaskHistory and status HAS changed", ( ] }, focus: { - reference: - 'Composition/c5811d36-934d-40f9-94b4-15194d562e45' as `Composition/${UUID}` + reference: 'Composition/c5811d36-934d-40f9-94b4-15194d562e45' }, identifier: [ { @@ -340,15 +332,13 @@ it("does not find assignment when it's in TaskHistory and status HAS changed", ( { url: 'http://opencrvs.org/specs/extension/regLastUser', valueReference: { - reference: - 'Practitioner/00000000-0000-4000-8000-000000000002' as `Practitioner/${UUID}` + reference: 'Practitioner/00000000-0000-4000-8000-000000000002' } }, { url: 'http://opencrvs.org/specs/extension/regLastOffice', valueReference: { - reference: - 'Location/00000000-0000-4000-8000-000000000010' as `Location/${UUID}` + reference: 'Location/00000000-0000-4000-8000-000000000010' } } ], @@ -376,8 +366,7 @@ it("does not find assignment when it's in TaskHistory and status HAS changed", ( ] }, focus: { - reference: - 'Composition/c5811d36-934d-40f9-94b4-15194d562e45' as `Composition/${UUID}` + reference: 'Composition/c5811d36-934d-40f9-94b4-15194d562e45' }, identifier: [ { @@ -392,15 +381,13 @@ it("does not find assignment when it's in TaskHistory and status HAS changed", ( { url: 'http://opencrvs.org/specs/extension/regLastUser', valueReference: { - reference: - 'Practitioner/93e34962-cef1-446a-985f-ad0e46732939' as `Practitioner/${UUID}` + reference: 'Practitioner/93e34962-cef1-446a-985f-ad0e46732939' } }, { url: 'http://opencrvs.org/specs/extension/regLastOffice', valueReference: { - reference: - 'Location/347ef736-2359-48cc-a513-5b9fae487fb7' as `Location/${UUID}` + reference: 'Location/347ef736-2359-48cc-a513-5b9fae487fb7' } } ], @@ -456,8 +443,7 @@ it("does not find assignment when it's in TaskHistory and status has afterwards ] }, focus: { - reference: - 'Composition/c5811d36-934d-40f9-94b4-15194d562e45' as `Composition/${UUID}` + reference: 'Composition/c5811d36-934d-40f9-94b4-15194d562e45' }, identifier: [ { @@ -473,15 +459,13 @@ it("does not find assignment when it's in TaskHistory and status has afterwards { url: 'http://opencrvs.org/specs/extension/regLastUser', valueReference: { - reference: - 'Practitioner/00000000-0000-4000-8000-000000000001' as `Practitioner/${UUID}` + reference: 'Practitioner/00000000-0000-4000-8000-000000000001' } }, { url: 'http://opencrvs.org/specs/extension/regLastOffice', valueReference: { - reference: - 'Location/00000000-0000-4000-8000-000000000010' as `Location/${UUID}` + reference: 'Location/00000000-0000-4000-8000-000000000010' } } ], @@ -508,8 +492,7 @@ it("does not find assignment when it's in TaskHistory and status has afterwards ] }, focus: { - reference: - 'Composition/c5811d36-934d-40f9-94b4-15194d562e45' as `Composition/${UUID}` + reference: 'Composition/c5811d36-934d-40f9-94b4-15194d562e45' }, identifier: [ { @@ -525,15 +508,13 @@ it("does not find assignment when it's in TaskHistory and status has afterwards { url: 'http://opencrvs.org/specs/extension/regLastUser', valueReference: { - reference: - 'Practitioner/00000000-0000-4000-8000-000000000002' as `Practitioner/${UUID}` + reference: 'Practitioner/00000000-0000-4000-8000-000000000002' } }, { url: 'http://opencrvs.org/specs/extension/regLastOffice', valueReference: { - reference: - 'Location/00000000-0000-4000-8000-000000000010' as `Location/${UUID}` + reference: 'Location/00000000-0000-4000-8000-000000000010' } } ], @@ -561,8 +542,7 @@ it("does not find assignment when it's in TaskHistory and status has afterwards ] }, focus: { - reference: - 'Composition/c5811d36-934d-40f9-94b4-15194d562e45' as `Composition/${UUID}` + reference: 'Composition/c5811d36-934d-40f9-94b4-15194d562e45' }, identifier: [ { @@ -577,15 +557,13 @@ it("does not find assignment when it's in TaskHistory and status has afterwards { url: 'http://opencrvs.org/specs/extension/regLastUser', valueReference: { - reference: - 'Practitioner/93e34962-cef1-446a-985f-ad0e46732939' as `Practitioner/${UUID}` + reference: 'Practitioner/93e34962-cef1-446a-985f-ad0e46732939' } }, { url: 'http://opencrvs.org/specs/extension/regLastOffice', valueReference: { - reference: - 'Location/347ef736-2359-48cc-a513-5b9fae487fb7' as `Location/${UUID}` + reference: 'Location/347ef736-2359-48cc-a513-5b9fae487fb7' } } ], diff --git a/packages/commons/src/fhir/composition.ts b/packages/commons/src/fhir/composition.ts index cab311e3e89..8fd6ccbd975 100644 --- a/packages/commons/src/fhir/composition.ts +++ b/packages/commons/src/fhir/composition.ts @@ -171,7 +171,7 @@ type ReferenceType = export type CompositionSectionCode = ReferenceType['code'] -export type ReferenceTypeByCode = Extract< +type ReferenceTypeByCode = Extract< ReferenceType, { code: U } > diff --git a/packages/commons/src/fhir/transformers/index.ts b/packages/commons/src/fhir/transformers/index.ts index 7cafb772b06..1d74bea5730 100644 --- a/packages/commons/src/fhir/transformers/index.ts +++ b/packages/commons/src/fhir/transformers/index.ts @@ -95,7 +95,7 @@ import { CompositionSectionTitleByCode, EVENT_TYPE } from '..' -import { getUUID, UUID } from '../..' +import { getUUID } from '../..' import { replaceFromBundle } from '../../record' import { AddressInput, @@ -508,7 +508,7 @@ function createAddressBuilder( { url: 'http://opencrvs.org/specs/extension/part-of', valueReference: { - reference: `Location/${fieldValue as UUID}` + reference: `Location/${fieldValue}` } } ], @@ -642,7 +642,7 @@ function createLocationAddressBuilder( context ) - location.partOf = { reference: `Location/${fieldValue as UUID}` } + location.partOf = { reference: `Location/${fieldValue}` } } } } @@ -2090,7 +2090,7 @@ const builders: IFieldBuilders = { { url: 'http://opencrvs.org/specs/extension/part-of', valueReference: { - reference: `Location/${fieldValue as UUID}` + reference: `Location/${fieldValue}` } } ], diff --git a/packages/commons/src/fhir/transformers/templates.ts b/packages/commons/src/fhir/transformers/templates.ts index e41eef55cfd..c8b7cd21f6c 100644 --- a/packages/commons/src/fhir/transformers/templates.ts +++ b/packages/commons/src/fhir/transformers/templates.ts @@ -23,6 +23,7 @@ import { QuestionnaireResponse, RelatedPerson, Section, + EVENT_TYPE, Task } from '..' import { @@ -30,9 +31,7 @@ import { CompositionSectionTitle, CompositionSectionTitleByCode, DEATH_CORRECTION_ENCOUNTER_CODE, - EVENT_TYPE, - PartialBy, - ReferenceTypeByCode + PartialBy } from '../../types' import { UUID } from '../../uuid' @@ -127,7 +126,7 @@ export function createEncounterSection< }, entry: [ { - reference: `urn:uuid:${refUuid}` as ReferenceTypeByCode['reference'] + reference: `urn:uuid:${refUuid}` as const } ] } diff --git a/packages/commons/src/fixtures/birth-bundle.ts b/packages/commons/src/fixtures/birth-bundle.ts index 1d604280aff..5d56140c106 100644 --- a/packages/commons/src/fixtures/birth-bundle.ts +++ b/packages/commons/src/fixtures/birth-bundle.ts @@ -314,8 +314,7 @@ export const BIRTH_BUNDLE: SavedBundle< { url: 'http://opencrvs.org/specs/extension/part-of', valueReference: { - reference: - 'Location/e66643ac-9ea9-4314-b842-f4fb3ad9e83a' as `Location/${UUID}` + reference: 'Location/e66643ac-9ea9-4314-b842-f4fb3ad9e83a' } } ] @@ -456,8 +455,7 @@ export const BIRTH_BUNDLE: SavedBundle< { url: 'http://opencrvs.org/specs/extension/part-of', valueReference: { - reference: - 'Location/e66643ac-9ea9-4314-b842-f4fb3ad9e83a' as `Location/${UUID}` + reference: 'Location/e66643ac-9ea9-4314-b842-f4fb3ad9e83a' } } ] @@ -591,8 +589,7 @@ export const BIRTH_BUNDLE: SavedBundle< { url: 'http://opencrvs.org/specs/extension/regLastOffice', valueReference: { - reference: - 'Location/e9e1b362-27c9-4ce1-82ad-57fe9d5650e4' as `Location/${UUID}` + reference: 'Location/e9e1b362-27c9-4ce1-82ad-57fe9d5650e4' } }, { @@ -970,8 +967,7 @@ export const BIRTH_BUNDLE: SavedBundle< ], location: [ { - reference: - 'Location/e9e1b362-27c9-4ce1-82ad-57fe9d5650e4' as `Location/${UUID}` + reference: 'Location/e9e1b362-27c9-4ce1-82ad-57fe9d5650e4' } ], id: '5f675c08-9494-462f-9fac-043755b865ad' as UUID, diff --git a/packages/commons/src/fixtures/death-bundle.ts b/packages/commons/src/fixtures/death-bundle.ts index a0c94609195..079da560035 100644 --- a/packages/commons/src/fixtures/death-bundle.ts +++ b/packages/commons/src/fixtures/death-bundle.ts @@ -373,8 +373,7 @@ export const DEATH_BUNDLE: SavedBundle< { url: 'http://opencrvs.org/specs/extension/part-of', valueReference: { - reference: - 'Location/e66643ac-9ea9-4314-b842-f4fb3ad9e83a' as `Location/${UUID}` + reference: 'Location/e66643ac-9ea9-4314-b842-f4fb3ad9e83a' } } ] @@ -531,15 +530,13 @@ export const DEATH_BUNDLE: SavedBundle< { url: 'http://opencrvs.org/specs/extension/regLastOffice', valueReference: { - reference: - 'Location/e9e1b362-27c9-4ce1-82ad-57fe9d5650e4' as `Location/${UUID}` + reference: 'Location/e9e1b362-27c9-4ce1-82ad-57fe9d5650e4' } }, { url: 'http://opencrvs.org/specs/extension/regLastUser', valueReference: { - reference: - 'Practitioner/525094f5-3c5f-4e72-af3b-adda8617839f' as `Practitioner/${UUID}` + reference: 'Practitioner/525094f5-3c5f-4e72-af3b-adda8617839f' } }, { @@ -631,8 +628,7 @@ export const DEATH_BUNDLE: SavedBundle< { url: 'http://opencrvs.org/specs/extension/part-of', valueReference: { - reference: - 'Location/e66643ac-9ea9-4314-b842-f4fb3ad9e83a' as `Location/${UUID}` + reference: 'Location/e66643ac-9ea9-4314-b842-f4fb3ad9e83a' } } ] @@ -1149,8 +1145,7 @@ export const DEATH_BUNDLE: SavedBundle< ], location: [ { - reference: - 'Location/e9e1b362-27c9-4ce1-82ad-57fe9d5650e4' as `Location/${UUID}` + reference: 'Location/e9e1b362-27c9-4ce1-82ad-57fe9d5650e4' } ], meta: { diff --git a/packages/commons/src/fixtures/marriage-bundle.ts b/packages/commons/src/fixtures/marriage-bundle.ts index 8efe6f0d108..99a9fcbd075 100644 --- a/packages/commons/src/fixtures/marriage-bundle.ts +++ b/packages/commons/src/fixtures/marriage-bundle.ts @@ -383,8 +383,7 @@ export const MARRIAGE_BUNDLE: Saved< { url: 'http://opencrvs.org/specs/extension/part-of', valueReference: { - reference: - 'Location/e66643ac-9ea9-4314-b842-f4fb3ad9e83a' as `Location/${UUID}` + reference: 'Location/e66643ac-9ea9-4314-b842-f4fb3ad9e83a' } } ] @@ -491,8 +490,7 @@ export const MARRIAGE_BUNDLE: Saved< { url: 'http://opencrvs.org/specs/extension/part-of', valueReference: { - reference: - 'Location/e66643ac-9ea9-4314-b842-f4fb3ad9e83a' as `Location/${UUID}` + reference: 'Location/e66643ac-9ea9-4314-b842-f4fb3ad9e83a' } } ] @@ -519,8 +517,7 @@ export const MARRIAGE_BUNDLE: Saved< ] }, focus: { - reference: - 'Composition/b2e4d436-d7fb-4b0f-9674-628b5af8f42e' as `Composition/${UUID}` + reference: 'Composition/b2e4d436-d7fb-4b0f-9674-628b5af8f42e' }, id: '6cc01269-6b36-4aa5-9bb0-21944d685e42' as UUID, identifier: [ @@ -569,15 +566,13 @@ export const MARRIAGE_BUNDLE: Saved< { url: 'http://opencrvs.org/specs/extension/regLastOffice', valueReference: { - reference: - 'Location/e9e1b362-27c9-4ce1-82ad-57fe9d5650e4' as `Location/${UUID}` + reference: 'Location/e9e1b362-27c9-4ce1-82ad-57fe9d5650e4' } }, { url: 'http://opencrvs.org/specs/extension/regLastUser', valueReference: { - reference: - 'Practitioner/48455871-1636-46a1-8279-aaa76dec03d4' as `Practitioner/${UUID}` + reference: 'Practitioner/48455871-1636-46a1-8279-aaa76dec03d4' } }, { @@ -870,8 +865,7 @@ export const MARRIAGE_BUNDLE: Saved< { url: 'http://opencrvs.org/specs/extension/part-of', valueReference: { - reference: - 'Location/bbee20e1-68c4-4e0c-a0cd-44336341e005' as `Location/${UUID}` + reference: 'Location/bbee20e1-68c4-4e0c-a0cd-44336341e005' } } ] @@ -912,8 +906,7 @@ export const MARRIAGE_BUNDLE: Saved< ], location: [ { - reference: - 'Location/e9e1b362-27c9-4ce1-82ad-57fe9d5650e4' as `Location/${UUID}` + reference: 'Location/e9e1b362-27c9-4ce1-82ad-57fe9d5650e4' } ], id: '5f675c08-9494-462f-9fac-043755b865ad' as UUID, diff --git a/packages/components/package.json b/packages/components/package.json index 5af66e1adda..392c3c78df0 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -8,7 +8,7 @@ "dependencies": { "@storybook/core-server": "^7.6.17", "css-animation": "^2.0.4", - "jest": "29.7.0", + "jest": "27.5.1", "patch-package": "^6.1.2", "phosphor-react": "^1.4.1", "polished": "^4.2.2", @@ -22,7 +22,7 @@ "react-tooltip": "^4.2.21", "recharts": "^2.5.0", "styled-components": "^5.2.0", - "ts-jest": "29.2.5", + "ts-jest": "27.1.4", "vite": "^5.0.0", "webfontloader": "^1.6.28" }, @@ -81,7 +81,7 @@ "stylelint-config-styled-components": "^0.1.1", "stylelint-processor-styled-components": "^1.10.0", "ts-dedent": "^2.2.0", - "typescript": "5.6.3" + "typescript": "4.9.5" }, "jest": { "collectCoverageFrom": [ diff --git a/packages/components/src/Alert/Alert.tsx b/packages/components/src/Alert/Alert.tsx index d42ec4d64ad..af5e031b61b 100644 --- a/packages/components/src/Alert/Alert.tsx +++ b/packages/components/src/Alert/Alert.tsx @@ -82,7 +82,6 @@ export interface IAlertProps extends React.HTMLAttributes { onActionClick?: (event?: React.MouseEvent) => void actionText?: string customIcon?: React.ReactNode - 'data-testid'?: string } /** diff --git a/packages/components/src/Summary/components/Row.tsx b/packages/components/src/Summary/components/Row.tsx index 3f9cccd6820..5297491bba3 100644 --- a/packages/components/src/Summary/components/Row.tsx +++ b/packages/components/src/Summary/components/Row.tsx @@ -54,7 +54,6 @@ export interface ISummaryRowProps placeholder?: React.ReactNode /** Is the summary value greyed / locked out */ locked?: boolean - 'data-testid'?: string } const RowValue = ({ diff --git a/packages/components/src/Toast/Toast.tsx b/packages/components/src/Toast/Toast.tsx index e0a2cc6d4a9..5f9ec33398e 100644 --- a/packages/components/src/Toast/Toast.tsx +++ b/packages/components/src/Toast/Toast.tsx @@ -103,7 +103,6 @@ export interface IToastProps extends React.HTMLAttributes { onActionClick?: (event?: React.MouseEvent) => void actionText?: string duration?: number | null - 'data-testid'?: string } export function Toast({ diff --git a/packages/components/tsconfig.json b/packages/components/tsconfig.json index 316988045da..842505e51cd 100644 --- a/packages/components/tsconfig.json +++ b/packages/components/tsconfig.json @@ -4,7 +4,11 @@ "outDir": "lib/", "module": "ESNext", "target": "es6", - "lib": ["es6", "dom", "es2017"], + "lib": [ + "es6", + "dom", + "es2017" + ], "sourceMap": true, "allowJs": false, "declaration": true, @@ -17,10 +21,19 @@ "noImplicitThis": true, "noImplicitAny": true, "strictNullChecks": true, + "suppressImplicitAnyIndexErrors": true, "noUnusedLocals": false, "skipLibCheck": true, "declarationMap": true }, - "include": ["src/**/*.tsx", "src/**/*.ts", ".storybook", "typings"], - "exclude": ["node_modules", "lib"] -} + "include": [ + "src/**/*.tsx", + "src/**/*.ts", + ".storybook", + "typings" + ], + "exclude": [ + "node_modules", + "lib" + ] +} \ No newline at end of file diff --git a/packages/config/package.json b/packages/config/package.json index 6c8f3736752..713cd249ad2 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -53,9 +53,9 @@ "mockingoose": "^2.15.2", "nodemon": "^3.0.0", "prettier": "^2.5.0", - "ts-jest": "29.2.5", + "ts-jest": "27.1.4", "ts-node": "^6.1.1", - "typescript": "5.6.3" + "typescript": "4.9.5" }, "lint-staged": { "src/**/*.ts": [ @@ -65,42 +65,29 @@ }, "jest": { "transform": { - "^.+\\.tsx?$": [ - "ts-jest", - { - "diagnostics": { - "ignoreCodes": [ - 2722, - 2532, - 2554, - 2339 - ] - } - } - ], - "^.+.tsx?$": [ - "ts-jest", - { - "diagnostics": { - "ignoreCodes": [ - 2722, - 2532, - 2554, - 2339 - ] - } - } - ] + "^.+\\.tsx?$": "ts-jest" }, "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$", "moduleFileExtensions": [ + "ts", + "tsx", "js", - "json", "jsx", - "node", - "ts", - "tsx" + "json", + "node" ], + "globals": { + "ts-jest": { + "diagnostics": { + "ignoreCodes": [ + 2722, + 2532, + 2554, + 2339 + ] + } + } + }, "testEnvironment": "node", "setupFiles": [ "./test/setupJest.ts" @@ -109,7 +96,8 @@ "" ], "moduleNameMapper": { - "@config/(.*)": "/src/$1" + "@config/(.*)": "/src/$1", + "@opencrvs/commons/(.*)": "@opencrvs/commons/build/dist/$1" }, "coverageReporters": [ "json", diff --git a/packages/config/src/handlers/locations/children.test.ts b/packages/config/src/handlers/locations/children.test.ts index 7090c357922..80beae4574d 100644 --- a/packages/config/src/handlers/locations/children.test.ts +++ b/packages/config/src/handlers/locations/children.test.ts @@ -38,7 +38,7 @@ describe('resolveLocationChildren', () => { }) const uuid2 = fixtures.savedLocation({ id: 'uuid2' as UUID, - partOf: { reference: 'Location/uuid1' as `Location/${UUID}` } + partOf: { reference: 'Location/uuid1' } }) const result = resolveLocationChildren(uuid1, [uuid1, uuid2]) @@ -53,11 +53,11 @@ describe('resolveLocationChildren', () => { }) const uuid2 = fixtures.savedLocation({ id: 'uuid2' as UUID, - partOf: { reference: 'Location/uuid1' as `Location/${UUID}` } + partOf: { reference: 'Location/uuid1' } }) const uuid3 = fixtures.savedLocation({ id: 'uuid3' as UUID, - partOf: { reference: 'Location/uuid2' as `Location/${UUID}` } + partOf: { reference: 'Location/uuid2' } }) const result = resolveLocationChildren(uuid1, [uuid1, uuid2, uuid3]) diff --git a/packages/config/src/handlers/locations/handler.ts b/packages/config/src/handlers/locations/handler.ts index b0e7b9306ce..d2896c672d0 100644 --- a/packages/config/src/handlers/locations/handler.ts +++ b/packages/config/src/handlers/locations/handler.ts @@ -26,7 +26,6 @@ import { Location as FhirLocation } from '@opencrvs/commons/types' import { fetchFromHearth, sendToFhir } from '@config/services/hearth' -import { UUID } from '@opencrvs/commons' enum Code { CRVS_OFFICE = 'CRVS_OFFICE', @@ -235,7 +234,7 @@ async function batchLocationsHandler( })) .map( (location): BundleEntry => ({ - fullUrl: `urn:uuid:${uuid() as UUID}`, + fullUrl: `urn:uuid:${uuid()}`, resource: { ...composeFhirLocation(location), ...(location.statistics && { diff --git a/packages/config/src/handlers/locations/hierarchy.test.ts b/packages/config/src/handlers/locations/hierarchy.test.ts index eb323cdee3e..6969bbf9a55 100644 --- a/packages/config/src/handlers/locations/hierarchy.test.ts +++ b/packages/config/src/handlers/locations/hierarchy.test.ts @@ -30,7 +30,7 @@ describe('resolveLocationParents', () => { }) const child = fixtures.savedLocation({ id: 'uuid2' as UUID, - partOf: { reference: 'Location/uuid1' as `Location/${UUID}` } + partOf: { reference: 'Location/uuid1' } }) const result = resolveLocationParents(child, [child, parent]) @@ -44,11 +44,11 @@ describe('resolveLocationParents', () => { }) const parent = fixtures.savedLocation({ id: 'uuid2' as UUID, - partOf: { reference: 'Location/uuid1' as `Location/${UUID}` } + partOf: { reference: 'Location/uuid1' } }) const child = fixtures.savedLocation({ id: 'uuid3' as UUID, - partOf: { reference: 'Location/uuid2' as `Location/${UUID}` } + partOf: { reference: 'Location/uuid2' } }) const locations = [child, parent, grandparent] diff --git a/packages/config/tsconfig.json b/packages/config/tsconfig.json index 6f273f39f92..77a36483279 100644 --- a/packages/config/tsconfig.json +++ b/packages/config/tsconfig.json @@ -2,16 +2,22 @@ "compilerOptions": { "baseUrl": "./src", "paths": { - "@config/*": ["./*"] + "@config/*": [ + "./*" + ] }, "target": "es6", - "module": "node16", + "module": "commonjs", "strict": true, "rootDir": ".", "sourceMap": true, "moduleResolution": "node16", "outDir": "build/dist", - "lib": ["esnext.asynciterable", "es6", "es2017"], + "lib": [ + "esnext.asynciterable", + "es6", + "es2017" + ], "forceConsistentCasingInFileNames": true, "noImplicitReturns": true, "noImplicitThis": true, @@ -19,8 +25,16 @@ "strictNullChecks": true, "noUnusedLocals": true, "skipLibCheck": true, - "types": ["fhir", "jest"] + "types": [ + "fhir", + "jest" + ], }, - "include": ["src/**/*.ts", "typings"], - "exclude": ["node_modules"] + "include": [ + "src/**/*.ts", + "typings" + ], + "exclude": [ + "node_modules" + ] } diff --git a/packages/data-seeder/package.json b/packages/data-seeder/package.json index 8a620298c17..bfef2576fad 100644 --- a/packages/data-seeder/package.json +++ b/packages/data-seeder/package.json @@ -26,7 +26,7 @@ "node-fetch": "^2.6.1", "ts-node": "^6.1.1", "tsconfig-paths": "^3.13.0", - "typescript": "5.6.3", + "typescript": "4.9.5", "uuid": "^3.3.2", "zod": "^3.17.3" }, diff --git a/packages/data-seeder/tsconfig.json b/packages/data-seeder/tsconfig.json index 7912e46249f..ef04deb07bd 100644 --- a/packages/data-seeder/tsconfig.json +++ b/packages/data-seeder/tsconfig.json @@ -4,7 +4,9 @@ "esModuleInterop": true, "baseUrl": "./src", "paths": { - "@data-seeder/*": ["./*"] + "@data-seeder/*": [ + "./*" + ] }, "target": "es6", "module": "commonjs", @@ -12,15 +14,27 @@ "sourceMap": true, "moduleResolution": "node", "rootDir": ".", - "lib": ["esnext.asynciterable", "es6", "es2019", "DOM.Iterable"], + "lib": [ + "esnext.asynciterable", + "es6", + "es2019", + "DOM.Iterable" + ], "forceConsistentCasingInFileNames": true, "noImplicitReturns": true, "noImplicitThis": true, "noImplicitAny": true, "strictNullChecks": true, + "suppressImplicitAnyIndexErrors": true, "allowSyntheticDefaultImports": true, "noUnusedLocals": true, - "types": ["node", "fhir"] + "types": [ + "node", + "fhir" + ] }, - "include": ["src/**/*.ts", "typings"] + "include": [ + "src/**/*.ts", + "typings" + ] } diff --git a/packages/documents/package.json b/packages/documents/package.json index b072812e887..5a12eddcc3d 100644 --- a/packages/documents/package.json +++ b/packages/documents/package.json @@ -50,15 +50,15 @@ "eslint-plugin-prettier": "^4.0.0", "eslint-config-prettier": "^9.0.0", "@typescript-eslint/parser": "^4.5.0", - "jest": "29.7.0", + "jest": "27.5.1", "jest-fetch-mock": "^2.1.2", "nodemon": "^3.0.0", "prettier": "2.8.8", "eslint": "^7.11.0", "@typescript-eslint/eslint-plugin": "^4.5.0", - "ts-jest": "29.2.5", + "ts-jest": "27.1.4", "ts-node": "^6.1.1", - "typescript": "5.6.3" + "typescript": "4.9.5" }, "lint-staged": { "src/**/*.ts": [ diff --git a/packages/documents/tsconfig.json b/packages/documents/tsconfig.json index 66f852f5d92..c56d46550d3 100644 --- a/packages/documents/tsconfig.json +++ b/packages/documents/tsconfig.json @@ -16,6 +16,7 @@ "noImplicitThis": true, "noImplicitAny": true, "strictNullChecks": true, + "suppressImplicitAnyIndexErrors": true, "noUnusedLocals": true, "types": ["fhir", "jest"] }, diff --git a/packages/gateway/package.json b/packages/gateway/package.json index 36c72e99f74..c0a733f8440 100644 --- a/packages/gateway/package.json +++ b/packages/gateway/package.json @@ -94,16 +94,16 @@ "eslint-plugin-import": "^2.17.3", "eslint-plugin-prettier": "^4.0.0", "graphql-schema-typescript": "^1.5.0", - "jest": "29.7.0", + "jest": "27.5.1", "jest-fetch-mock": "^2.1.2", "lab-transform-typescript": "^3.0.1", "nodemon": "^3.0.0", "opener": "^1.5.1", "prettier": "2.8.8", "testcontainers": "^9.1.1", - "ts-jest": "29.2.5", + "ts-jest": "27.1.4", "ts-node": "^6.1.1", - "typescript": "5.6.3" + "typescript": "4.9.5" }, "lint-staged": { "src/**/*.graphql": [ @@ -116,32 +116,29 @@ }, "jest": { "transform": { - "^.+\\.tsx?$": [ - "ts-jest" - ], - "^.+.tsx?$": [ - "ts-jest", - { - "diagnostics": { - "ignoreCodes": [ - 2722, - 2532, - 2554, - 2339 - ] - } - } - ] + "^.+\\.tsx?$": "ts-jest" }, "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$", "moduleFileExtensions": [ + "ts", + "tsx", "js", - "json", "jsx", - "node", - "ts", - "tsx" + "json", + "node" ], + "globals": { + "ts-jest": { + "diagnostics": { + "ignoreCodes": [ + 2722, + 2532, + 2554, + 2339 + ] + } + } + }, "testEnvironment": "node", "//": "Test timeout is increased due to the fact that testcontainers can take a while to pull Docker images", "testTimeout": 30000, @@ -152,7 +149,8 @@ "" ], "moduleNameMapper": { - "@gateway/(.*)": "/src/$1" + "@gateway/(.*)": "/src/$1", + "@opencrvs/commons/(.*)": "@opencrvs/commons/build/dist/$1" }, "coverageReporters": [ "json", diff --git a/packages/gateway/src/features/correction/root-resolvers.test.ts b/packages/gateway/src/features/correction/root-resolvers.test.ts index 9fdf491f6df..c703c333483 100644 --- a/packages/gateway/src/features/correction/root-resolvers.test.ts +++ b/packages/gateway/src/features/correction/root-resolvers.test.ts @@ -10,8 +10,8 @@ */ import { resolvers as rootResolvers } from '@gateway/features/correction/root-resolvers' import { readFileSync } from 'fs' -import fetchAny from 'jest-fetch-mock' -import jwt from 'jsonwebtoken' +import * as fetchAny from 'jest-fetch-mock' +import * as jwt from 'jsonwebtoken' const resolvers = rootResolvers as any describe('Correction root resolvers', () => { let registerCertifyToken: string diff --git a/packages/gateway/src/features/location/root-resolvers.test.ts b/packages/gateway/src/features/location/root-resolvers.test.ts index 509963b512c..1375f8d1fcc 100644 --- a/packages/gateway/src/features/location/root-resolvers.test.ts +++ b/packages/gateway/src/features/location/root-resolvers.test.ts @@ -14,7 +14,6 @@ import { } from '@opencrvs/commons/fixtures' import { resolvers } from '@gateway/features/location/root-resolvers' import * as fetchAny from 'jest-fetch-mock' -import { UUID } from '@opencrvs/commons' const fetch = fetchAny as any @@ -23,9 +22,7 @@ describe('Location root resolvers', () => { it('returns false if a location has administrative locations as its children', async () => { fetch.mockResponseOnce( JSON.stringify([ - savedAdministrativeLocation({ - partOf: { reference: 'Location/1' as `Location/${UUID}` } - }) + savedAdministrativeLocation({ partOf: { reference: 'Location/1' } }) ]) ) // @ts-ignore @@ -40,12 +37,8 @@ describe('Location root resolvers', () => { it('returns true if a location has no administrative locations as its children', async () => { fetch.mockResponseOnce( JSON.stringify([ - savedLocation({ - partOf: { reference: 'Location/1' as `Location/${UUID}` } - }), - savedAdministrativeLocation({ - partOf: { reference: 'Location/2' as `Location/${UUID}` } - }) + savedLocation({ partOf: { reference: 'Location/1' } }), + savedAdministrativeLocation({ partOf: { reference: 'Location/2' } }) ]) ) // @ts-ignore diff --git a/packages/gateway/src/features/registration/__snapshots__/type-resolvers.test.ts.snap b/packages/gateway/src/features/registration/__snapshots__/type-resolvers.test.ts.snap index 0be73a6d5c3..5db255f469c 100644 --- a/packages/gateway/src/features/registration/__snapshots__/type-resolvers.test.ts.snap +++ b/packages/gateway/src/features/registration/__snapshots__/type-resolvers.test.ts.snap @@ -1,13 +1,13 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`running a full aggregated birth FHIR bundle through resolvers produces a BirthRegistration object 1`] = ` -{ - "fetchBirthRegistration": { - "_fhirIDMap": { +Object { + "fetchBirthRegistration": Object { + "_fhirIDMap": Object { "composition": "09f39e17-ca23-4905-9ab3-f3649c4e3162", "encounter": "e7ed42ae-bd54-4d7c-ad9d-0af7506d1d64", "eventLocation": "565d957a-109a-4bf3-a3af-f0ad52c719cd", - "observation": { + "observation": Object { "attendantAtBirth": "942901b9-e03f-4209-953d-fd094e5e8231", "birthType": "78e42deb-c50e-43c8-853f-71ccc6398512", "weightAtBirth": "d47d4a55-bf18-4704-ac3a-0066e3ecff6f", @@ -16,14 +16,14 @@ exports[`running a full aggregated birth FHIR bundle through resolvers produces }, "attendantAtBirth": "PHYSICIAN", "birthType": "SINGLE", - "child": { + "child": Object { "_fhirID": null, "address": null, "age": null, "ageOfIndividualInYears": null, "birthDate": "2023-07-11", "dateOfMarriage": null, - "deceased": { + "deceased": Object { "deathDate": null, "deceased": null, }, @@ -32,26 +32,26 @@ exports[`running a full aggregated birth FHIR bundle through resolvers produces "exactDateOfBirthUnknown": null, "gender": "female", "id": "dfac3127-963e-4ef2-b875-3123e08da3d9", - "identifier": [ - { + "identifier": Array [ + Object { "fieldsModifiedByIdentity": null, "id": "2023B3VUXES", "otherType": null, "type": "BIRTH_REGISTRATION_NUMBER", }, - { + Object { "fieldsModifiedByIdentity": null, "id": "", "otherType": null, "type": "BIRTH_CONFIGURABLE_IDENTIFIER_1", }, - { + Object { "fieldsModifiedByIdentity": null, "id": "", "otherType": null, "type": "BIRTH_CONFIGURABLE_IDENTIFIER_2", }, - { + Object { "fieldsModifiedByIdentity": null, "id": "", "otherType": null, @@ -60,8 +60,8 @@ exports[`running a full aggregated birth FHIR bundle through resolvers produces ], "maritalStatus": null, "multipleBirth": null, - "name": [ - { + "name": Array [ + Object { "familyName": "Baumbach", "firstNames": "Isadore", "marriedLastName": null, @@ -77,7 +77,7 @@ exports[`running a full aggregated birth FHIR bundle through resolvers produces }, "childrenBornAliveToMother": null, "createdAt": "2023-08-11T05:26:26.000Z", - "eventLocation": { + "eventLocation": Object { "_fhirID": null, "address": null, "altitude": null, @@ -92,16 +92,16 @@ exports[`running a full aggregated birth FHIR bundle through resolvers produces "telecom": null, "type": "HEALTH_FACILITY", }, - "father": { + "father": Object { "_fhirID": null, - "address": [ - { + "address": Array [ + Object { "city": "South Jamelmouth", "country": "FAR", "district": "e66643ac-9ea9-4314-b842-f4fb3ad9e83a", "districtName": "Ibombo", "from": null, - "line": [ + "line": Array [ "12", "Usual Street", "Usual Residental Area", @@ -109,7 +109,7 @@ exports[`running a full aggregated birth FHIR bundle through resolvers produces "", "URBAN", ], - "lineName": [ + "lineName": Array [ "12", "Usual Street", "Usual Residental Area", @@ -131,7 +131,7 @@ exports[`running a full aggregated birth FHIR bundle through resolvers produces "ageOfIndividualInYears": null, "birthDate": "2003-07-11", "dateOfMarriage": "2021-07-11", - "deceased": { + "deceased": Object { "deathDate": null, "deceased": null, }, @@ -140,8 +140,8 @@ exports[`running a full aggregated birth FHIR bundle through resolvers produces "exactDateOfBirthUnknown": null, "gender": null, "id": "3ee05cf9-a550-4d7f-abde-54313f7bd41a", - "identifier": [ - { + "identifier": Array [ + Object { "fieldsModifiedByIdentity": null, "id": "8762475961", "otherType": null, @@ -150,8 +150,8 @@ exports[`running a full aggregated birth FHIR bundle through resolvers produces ], "maritalStatus": "MARRIED", "multipleBirth": null, - "name": [ - { + "name": Array [ + Object { "familyName": "Neil", "firstNames": "Baumbach", "marriedLastName": null, @@ -159,7 +159,7 @@ exports[`running a full aggregated birth FHIR bundle through resolvers produces "use": "en", }, ], - "nationality": [ + "nationality": Array [ "FAR", ], "occupation": "Bookkeeper", @@ -168,19 +168,19 @@ exports[`running a full aggregated birth FHIR bundle through resolvers produces "telecom": null, }, "foetalDeathsToMother": null, - "history": [ - { - "certificates": [ + "history": Array [ + Object { + "certificates": Array [ null, ], - "comments": [], + "comments": Array [], "date": "2023-10-02T13:51:55.645+00:00", "dhis2Notification": false, "duplicateOf": null, "hasShowedVerifiedDocument": false, - "input": [], + "input": Array [], "ipAddress": null, - "location": { + "location": Object { "_fhirID": null, "address": null, "altitude": null, @@ -197,7 +197,7 @@ exports[`running a full aggregated birth FHIR bundle through resolvers produces }, "noSupportingDocumentationRequired": false, "note": "", - "office": { + "office": Object { "_fhirID": null, "address": null, "altitude": null, @@ -213,7 +213,7 @@ exports[`running a full aggregated birth FHIR bundle through resolvers produces "type": "CRVS_OFFICE", }, "otherReason": "", - "output": [], + "output": Array [], "payment": null, "reason": null, "requester": "", @@ -225,17 +225,17 @@ exports[`running a full aggregated birth FHIR bundle through resolvers produces }, ], "id": "09f39e17-ca23-4905-9ab3-f3649c4e3162", - "informant": { + "informant": Object { "_fhirID": null, "_fhirIDPatient": "cd5693ed-dd33-4c3a-a9fc-7479b132a4ea", - "address": [ - { + "address": Array [ + Object { "city": "South Jamelmouth", "country": "FAR", "district": "e66643ac-9ea9-4314-b842-f4fb3ad9e83a", "districtName": "Ibombo", "from": null, - "line": [ + "line": Array [ "12", "Usual Street", "Usual Residental Area", @@ -249,7 +249,7 @@ exports[`running a full aggregated birth FHIR bundle through resolvers produces "", "URBAN", ], - "lineName": [ + "lineName": Array [ "12", "Usual Street", "Usual Residental Area", @@ -278,7 +278,7 @@ exports[`running a full aggregated birth FHIR bundle through resolvers produces "ageOfIndividualInYears": null, "birthDate": "2003-07-11", "dateOfMarriage": "2021-07-11", - "deceased": { + "deceased": Object { "deathDate": null, "deceased": null, }, @@ -287,8 +287,8 @@ exports[`running a full aggregated birth FHIR bundle through resolvers produces "exactDateOfBirthUnknown": null, "gender": null, "id": "a0fd7881-33e6-4751-a346-78f820aa3dbb", - "identifier": [ - { + "identifier": Array [ + Object { "fieldsModifiedByIdentity": null, "id": "2253499797", "otherType": null, @@ -297,8 +297,8 @@ exports[`running a full aggregated birth FHIR bundle through resolvers produces ], "maritalStatus": "MARRIED", "multipleBirth": 2, - "name": [ - { + "name": Array [ + Object { "familyName": "Baumbach", "firstNames": "Sophia", "marriedLastName": null, @@ -306,7 +306,7 @@ exports[`running a full aggregated birth FHIR bundle through resolvers produces "use": "en", }, ], - "nationality": [ + "nationality": Array [ "FAR", ], "occupation": "Farmer", @@ -317,16 +317,16 @@ exports[`running a full aggregated birth FHIR bundle through resolvers produces "telecom": null, }, "lastPreviousLiveBirth": null, - "mother": { + "mother": Object { "_fhirID": null, - "address": [ - { + "address": Array [ + Object { "city": "South Jamelmouth", "country": "FAR", "district": "e66643ac-9ea9-4314-b842-f4fb3ad9e83a", "districtName": "Ibombo", "from": null, - "line": [ + "line": Array [ "12", "Usual Street", "Usual Residental Area", @@ -340,7 +340,7 @@ exports[`running a full aggregated birth FHIR bundle through resolvers produces "", "URBAN", ], - "lineName": [ + "lineName": Array [ "12", "Usual Street", "Usual Residental Area", @@ -368,7 +368,7 @@ exports[`running a full aggregated birth FHIR bundle through resolvers produces "ageOfIndividualInYears": null, "birthDate": "2003-07-11", "dateOfMarriage": "2021-07-11", - "deceased": { + "deceased": Object { "deathDate": null, "deceased": null, }, @@ -377,8 +377,8 @@ exports[`running a full aggregated birth FHIR bundle through resolvers produces "exactDateOfBirthUnknown": null, "gender": null, "id": "cd5693ed-dd33-4c3a-a9fc-7479b132a4ea", - "identifier": [ - { + "identifier": Array [ + Object { "fieldsModifiedByIdentity": null, "id": "2253499797", "otherType": null, @@ -387,8 +387,8 @@ exports[`running a full aggregated birth FHIR bundle through resolvers produces ], "maritalStatus": "MARRIED", "multipleBirth": 2, - "name": [ - { + "name": Array [ + Object { "familyName": "Baumbach", "firstNames": "Sophia", "marriedLastName": null, @@ -396,14 +396,14 @@ exports[`running a full aggregated birth FHIR bundle through resolvers produces "use": "en", }, ], - "nationality": [ + "nationality": Array [ "FAR", ], "occupation": "Farmer", "photo": null, "reasonNotApplying": null, - "telecom": [ - { + "telecom": Array [ + Object { "system": "phone", "use": null, "value": "+260711384538", @@ -412,9 +412,9 @@ exports[`running a full aggregated birth FHIR bundle through resolvers produces }, "otherAttendantAtBirth": null, "questionnaire": null, - "registration": { + "registration": Object { "_fhirID": null, - "assignment": { + "assignment": Object { "avatarURL": "https://eu.ui-avatars.com/api/?background=DEE5F2&color=222&name=Kennedy Mweene", "firstName": "Kennedy", "lastName": "Mweene", @@ -424,7 +424,7 @@ exports[`running a full aggregated birth FHIR bundle through resolvers produces "attachments": null, "book": null, "brideSignature": null, - "certificates": [ + "certificates": Array [ null, ], "contact": "MOTHER", @@ -442,11 +442,11 @@ exports[`running a full aggregated birth FHIR bundle through resolvers produces "page": null, "paperFormID": null, "registrationNumber": "2023B3VUXES", - "status": [ - { + "status": Array [ + Object { "comments": null, "id": "358c0c75-9855-4812-b560-c1b5fbf48e5a", - "location": { + "location": Object { "_fhirID": null, "address": null, "altitude": null, @@ -461,7 +461,7 @@ exports[`running a full aggregated birth FHIR bundle through resolvers produces "telecom": null, "type": "ADMIN_STRUCTURE", }, - "office": { + "office": Object { "_fhirID": null, "address": null, "altitude": null, @@ -493,13 +493,13 @@ exports[`running a full aggregated birth FHIR bundle through resolvers produces `; exports[`running a full aggregated death FHIR bundle through resolvers produces a DeathRegistration object 1`] = ` -{ - "fetchDeathRegistration": { - "_fhirIDMap": { +Object { + "fetchDeathRegistration": Object { + "_fhirIDMap": Object { "composition": "a959c616-934a-4139-a123-37bb4a1be39e", "encounter": "e668f0dc-aacd-45be-bd5f-2a81c3161593", "eventLocation": "4ba43b39-547b-41a8-8af1-c515786f36e5", - "observation": { + "observation": Object { "causeOfDeath": "3cae74a3-042c-4faf-9dde-8b716d094033", "causeOfDeathEstablished": "fb98ff5b-3aa1-40c2-87bf-4bd6df091dd2", "causeOfDeathMethod": "ff9a538b-c551-4edc-9631-fa2169a37f20", @@ -515,16 +515,16 @@ exports[`running a full aggregated death FHIR bundle through resolvers produces "causeOfDeathMethod": "PHYSICIAN", "createdAt": "2023-08-16T06:55:19.000Z", "deathDescription": null, - "deceased": { + "deceased": Object { "_fhirID": null, - "address": [ - { + "address": Array [ + Object { "city": "Rudyboro", "country": "FAR", "district": "e66643ac-9ea9-4314-b842-f4fb3ad9e83a", "districtName": "Ibombo", "from": null, - "line": [ + "line": Array [ "44444 Predovic Mount", "87740", "URBAN", @@ -532,7 +532,7 @@ exports[`running a full aggregated death FHIR bundle through resolvers produces "", "URBAN", ], - "lineName": [ + "lineName": Array [ "44444 Predovic Mount", "87740", "URBAN", @@ -554,7 +554,7 @@ exports[`running a full aggregated death FHIR bundle through resolvers produces "ageOfIndividualInYears": null, "birthDate": "1948-07-24", "dateOfMarriage": null, - "deceased": { + "deceased": Object { "deathDate": "2023-07-24", "deceased": null, }, @@ -563,20 +563,20 @@ exports[`running a full aggregated death FHIR bundle through resolvers produces "exactDateOfBirthUnknown": null, "gender": "female", "id": "d55283fe-b5bc-497d-86f3-5370957b0642", - "identifier": [ - { + "identifier": Array [ + Object { "fieldsModifiedByIdentity": null, "id": "8360781537", "otherType": null, "type": "NATIONAL_ID", }, - { + Object { "fieldsModifiedByIdentity": null, "id": "565195261", "otherType": null, "type": "SOCIAL_SECURITY_NO", }, - { + Object { "fieldsModifiedByIdentity": null, "id": "2023DL1W8FV", "otherType": null, @@ -585,8 +585,8 @@ exports[`running a full aggregated death FHIR bundle through resolvers produces ], "maritalStatus": "MARRIED", "multipleBirth": null, - "name": [ - { + "name": Array [ + Object { "familyName": "Pacocha", "firstNames": "Zack", "marriedLastName": null, @@ -594,7 +594,7 @@ exports[`running a full aggregated death FHIR bundle through resolvers produces "use": "en", }, ], - "nationality": [ + "nationality": Array [ "FAR", ], "occupation": null, @@ -602,7 +602,7 @@ exports[`running a full aggregated death FHIR bundle through resolvers produces "reasonNotApplying": null, "telecom": null, }, - "eventLocation": { + "eventLocation": Object { "_fhirID": null, "address": null, "altitude": null, @@ -617,14 +617,14 @@ exports[`running a full aggregated death FHIR bundle through resolvers produces "telecom": null, "type": "HEALTH_FACILITY", }, - "father": { + "father": Object { "_fhirID": null, "address": null, "age": null, "ageOfIndividualInYears": null, "birthDate": null, "dateOfMarriage": null, - "deceased": { + "deceased": Object { "deathDate": null, "deceased": null, }, @@ -636,8 +636,8 @@ exports[`running a full aggregated death FHIR bundle through resolvers produces "identifier": null, "maritalStatus": null, "multipleBirth": null, - "name": [ - { + "name": Array [ + Object { "familyName": "Pacocha", "firstNames": "", "marriedLastName": null, @@ -652,17 +652,17 @@ exports[`running a full aggregated death FHIR bundle through resolvers produces "telecom": null, }, "femaleDependentsOfDeceased": 4, - "history": [ - { - "certificates": [], - "comments": [], + "history": Array [ + Object { + "certificates": Array [], + "comments": Array [], "date": "2023-09-22T11:52:48.611+00:00", "dhis2Notification": false, "duplicateOf": null, "hasShowedVerifiedDocument": false, - "input": [], + "input": Array [], "ipAddress": null, - "location": { + "location": Object { "_fhirID": null, "address": null, "altitude": null, @@ -679,7 +679,7 @@ exports[`running a full aggregated death FHIR bundle through resolvers produces }, "noSupportingDocumentationRequired": false, "note": "", - "office": { + "office": Object { "_fhirID": null, "address": null, "altitude": null, @@ -695,7 +695,7 @@ exports[`running a full aggregated death FHIR bundle through resolvers produces "type": "CRVS_OFFICE", }, "otherReason": "", - "output": [], + "output": Array [], "payment": null, "reason": null, "requester": "", @@ -707,17 +707,17 @@ exports[`running a full aggregated death FHIR bundle through resolvers produces }, ], "id": "a959c616-934a-4139-a123-37bb4a1be39e", - "informant": { + "informant": Object { "_fhirID": null, "_fhirIDPatient": "9fbbb561-dd3c-4b9f-8765-829a4c75493e", - "address": [ - { + "address": Array [ + Object { "city": "New Julio", "country": "FAR", "district": "e66643ac-9ea9-4314-b842-f4fb3ad9e83a", "districtName": "Ibombo", "from": null, - "line": [ + "line": Array [ "817 Avis Point", "06074", "URBAN", @@ -725,7 +725,7 @@ exports[`running a full aggregated death FHIR bundle through resolvers produces "", "URBAN", ], - "lineName": [ + "lineName": Array [ "817 Avis Point", "06074", "URBAN", @@ -748,7 +748,7 @@ exports[`running a full aggregated death FHIR bundle through resolvers produces "ageOfIndividualInYears": null, "birthDate": "2003-08-16", "dateOfMarriage": null, - "deceased": { + "deceased": Object { "deathDate": null, "deceased": null, }, @@ -757,8 +757,8 @@ exports[`running a full aggregated death FHIR bundle through resolvers produces "exactDateOfBirthUnknown": null, "gender": null, "id": "7106d752-1e34-47fe-8726-a9fd11042a4d", - "identifier": [ - { + "identifier": Array [ + Object { "fieldsModifiedByIdentity": null, "id": "2464716794", "otherType": null, @@ -767,8 +767,8 @@ exports[`running a full aggregated death FHIR bundle through resolvers produces ], "maritalStatus": null, "multipleBirth": null, - "name": [ - { + "name": Array [ + Object { "familyName": "Pacocha", "firstNames": "Frank", "marriedLastName": null, @@ -776,7 +776,7 @@ exports[`running a full aggregated death FHIR bundle through resolvers produces "use": "en", }, ], - "nationality": [ + "nationality": Array [ "FAR", ], "occupation": "consultant", @@ -789,14 +789,14 @@ exports[`running a full aggregated death FHIR bundle through resolvers produces "maleDependentsOfDeceased": 3, "mannerOfDeath": "NATURAL_CAUSES", "medicalPractitioner": null, - "mother": { + "mother": Object { "_fhirID": null, "address": null, "age": null, "ageOfIndividualInYears": null, "birthDate": null, "dateOfMarriage": null, - "deceased": { + "deceased": Object { "deathDate": null, "deceased": null, }, @@ -808,8 +808,8 @@ exports[`running a full aggregated death FHIR bundle through resolvers produces "identifier": null, "maritalStatus": null, "multipleBirth": null, - "name": [ - { + "name": Array [ + Object { "familyName": "Pacocha", "firstNames": "", "marriedLastName": null, @@ -824,11 +824,11 @@ exports[`running a full aggregated death FHIR bundle through resolvers produces "telecom": null, }, "questionnaire": null, - "registration": { + "registration": Object { "_fhirID": null, "assignment": null, - "attachments": [ - { + "attachments": Array [ + Object { "_fhirID": null, "contentType": "image/png", "createdAt": null, @@ -842,7 +842,7 @@ exports[`running a full aggregated death FHIR bundle through resolvers produces "type": "OTHER", "uri": "/ocrvs/d40e904b-53ff-4639-bdcf-a2ba8fb236f5.png", }, - { + Object { "_fhirID": null, "contentType": "image/png", "createdAt": null, @@ -859,7 +859,7 @@ exports[`running a full aggregated death FHIR bundle through resolvers produces ], "book": null, "brideSignature": null, - "certificates": [], + "certificates": Array [], "contact": "SPOUSE", "contactEmail": "Frank24@gmail.com", "contactPhoneNumber": "+260734085893", @@ -875,11 +875,11 @@ exports[`running a full aggregated death FHIR bundle through resolvers produces "page": null, "paperFormID": null, "registrationNumber": "2023DL1W8FV", - "status": [ - { + "status": Array [ + Object { "comments": null, "id": "b1a6925a-47ae-431e-8f61-4cd0929e8518", - "location": { + "location": Object { "_fhirID": null, "address": null, "altitude": null, @@ -894,7 +894,7 @@ exports[`running a full aggregated death FHIR bundle through resolvers produces "telecom": null, "type": "ADMIN_STRUCTURE", }, - "office": { + "office": Object { "_fhirID": null, "address": null, "altitude": null, @@ -926,27 +926,27 @@ exports[`running a full aggregated death FHIR bundle through resolvers produces `; exports[`running a full aggregated marriage FHIR bundle through resolvers produces a MarriageRegistration object 1`] = ` -{ - "fetchMarriageRegistration": { - "_fhirIDMap": { +Object { + "fetchMarriageRegistration": Object { + "_fhirIDMap": Object { "composition": "b2e4d436-d7fb-4b0f-9674-628b5af8f42e", "encounter": "669cb7d8-5963-4b49-b647-7463d9e135b5", "eventLocation": "461a4ba8-5592-4b1a-a30b-747150a01623", - "observation": { + "observation": Object { "typeOfMarriage": "c01c802f-e5fe-46d8-b35c-deffe87a6fd9", }, "questionnaireResponse": undefined, }, - "bride": { + "bride": Object { "_fhirID": null, - "address": [ - { + "address": Array [ + Object { "city": null, "country": "FAR", "district": "e66643ac-9ea9-4314-b842-f4fb3ad9e83a", "districtName": "Ibombo", "from": null, - "line": [ + "line": Array [ "", "", "", @@ -963,7 +963,7 @@ exports[`running a full aggregated marriage FHIR bundle through resolvers produc "", "", ], - "lineName": [ + "lineName": Array [ "", "", "", @@ -994,7 +994,7 @@ exports[`running a full aggregated marriage FHIR bundle through resolvers produc "ageOfIndividualInYears": null, "birthDate": "2001-02-22", "dateOfMarriage": "2021-02-24", - "deceased": { + "deceased": Object { "deathDate": null, "deceased": null, }, @@ -1003,14 +1003,14 @@ exports[`running a full aggregated marriage FHIR bundle through resolvers produc "exactDateOfBirthUnknown": null, "gender": null, "id": "5b979fe9-eaa3-4c4e-87ab-ee48ea1abb16", - "identifier": [ - { + "identifier": Array [ + Object { "fieldsModifiedByIdentity": null, "id": "2323444434", "otherType": null, "type": "NATIONAL_ID", }, - { + Object { "fieldsModifiedByIdentity": null, "id": "2023MTNJUSI", "otherType": null, @@ -1019,8 +1019,8 @@ exports[`running a full aggregated marriage FHIR bundle through resolvers produc ], "maritalStatus": null, "multipleBirth": null, - "name": [ - { + "name": Array [ + Object { "familyName": "test", "firstNames": "genie", "marriedLastName": null, @@ -1028,7 +1028,7 @@ exports[`running a full aggregated marriage FHIR bundle through resolvers produc "use": "en", }, ], - "nationality": [ + "nationality": Array [ "FAR", ], "occupation": null, @@ -1037,15 +1037,15 @@ exports[`running a full aggregated marriage FHIR bundle through resolvers produc "telecom": null, }, "createdAt": "2023-09-22T08:54:48.780Z", - "eventLocation": { + "eventLocation": Object { "_fhirID": null, - "address": { + "address": Object { "city": "", "country": "FAR", "district": "bbee20e1-68c4-4e0c-a0cd-44336341e005", "districtName": null, "from": null, - "line": [ + "line": Array [ "", "", "", @@ -1062,7 +1062,7 @@ exports[`running a full aggregated marriage FHIR bundle through resolvers produc "", "", ], - "lineName": [ + "lineName": Array [ "", "", "", @@ -1100,16 +1100,16 @@ exports[`running a full aggregated marriage FHIR bundle through resolvers produc "telecom": null, "type": null, }, - "groom": { + "groom": Object { "_fhirID": null, - "address": [ - { + "address": Array [ + Object { "city": null, "country": "FAR", "district": "e66643ac-9ea9-4314-b842-f4fb3ad9e83a", "districtName": "Ibombo", "from": null, - "line": [ + "line": Array [ "", "", "", @@ -1126,7 +1126,7 @@ exports[`running a full aggregated marriage FHIR bundle through resolvers produc "", "", ], - "lineName": [ + "lineName": Array [ "", "", "", @@ -1157,7 +1157,7 @@ exports[`running a full aggregated marriage FHIR bundle through resolvers produc "ageOfIndividualInYears": null, "birthDate": "1999-11-13", "dateOfMarriage": "2021-02-24", - "deceased": { + "deceased": Object { "deathDate": null, "deceased": null, }, @@ -1166,14 +1166,14 @@ exports[`running a full aggregated marriage FHIR bundle through resolvers produc "exactDateOfBirthUnknown": null, "gender": null, "id": "1a5ad72e-9241-4358-a937-861cfdf44f4d", - "identifier": [ - { + "identifier": Array [ + Object { "fieldsModifiedByIdentity": null, "id": "8675646566", "otherType": null, "type": "NATIONAL_ID", }, - { + Object { "fieldsModifiedByIdentity": null, "id": "2023MTNJUSI", "otherType": null, @@ -1182,8 +1182,8 @@ exports[`running a full aggregated marriage FHIR bundle through resolvers produc ], "maritalStatus": null, "multipleBirth": null, - "name": [ - { + "name": Array [ + Object { "familyName": "test", "firstNames": "george", "marriedLastName": null, @@ -1191,7 +1191,7 @@ exports[`running a full aggregated marriage FHIR bundle through resolvers produc "use": "en", }, ], - "nationality": [ + "nationality": Array [ "FAR", ], "occupation": null, @@ -1199,17 +1199,17 @@ exports[`running a full aggregated marriage FHIR bundle through resolvers produc "reasonNotApplying": null, "telecom": null, }, - "history": [ - { - "certificates": [], - "comments": [], + "history": Array [ + Object { + "certificates": Array [], + "comments": Array [], "date": "2023-09-22T08:54:57.825+00:00", "dhis2Notification": false, "duplicateOf": null, "hasShowedVerifiedDocument": false, - "input": [], + "input": Array [], "ipAddress": null, - "location": { + "location": Object { "_fhirID": null, "address": null, "altitude": null, @@ -1226,7 +1226,7 @@ exports[`running a full aggregated marriage FHIR bundle through resolvers produc }, "noSupportingDocumentationRequired": false, "note": "", - "office": { + "office": Object { "_fhirID": null, "address": null, "altitude": null, @@ -1242,7 +1242,7 @@ exports[`running a full aggregated marriage FHIR bundle through resolvers produc "type": "CRVS_OFFICE", }, "otherReason": "", - "output": [], + "output": Array [], "payment": null, "reason": null, "requester": "", @@ -1254,17 +1254,17 @@ exports[`running a full aggregated marriage FHIR bundle through resolvers produc }, ], "id": "b2e4d436-d7fb-4b0f-9674-628b5af8f42e", - "informant": { + "informant": Object { "_fhirID": null, "_fhirIDPatient": "1a5ad72e-9241-4358-a937-861cfdf44f4d", - "address": [ - { + "address": Array [ + Object { "city": null, "country": "FAR", "district": "e66643ac-9ea9-4314-b842-f4fb3ad9e83a", "districtName": "Ibombo", "from": null, - "line": [ + "line": Array [ "", "", "", @@ -1281,7 +1281,7 @@ exports[`running a full aggregated marriage FHIR bundle through resolvers produc "", "", ], - "lineName": [ + "lineName": Array [ "", "", "", @@ -1313,7 +1313,7 @@ exports[`running a full aggregated marriage FHIR bundle through resolvers produc "ageOfIndividualInYears": null, "birthDate": "1999-11-13", "dateOfMarriage": "2021-02-24", - "deceased": { + "deceased": Object { "deathDate": null, "deceased": null, }, @@ -1322,14 +1322,14 @@ exports[`running a full aggregated marriage FHIR bundle through resolvers produc "exactDateOfBirthUnknown": null, "gender": null, "id": "4065eb20-d02b-48d7-a783-5d7e452c7a7d", - "identifier": [ - { + "identifier": Array [ + Object { "fieldsModifiedByIdentity": null, "id": "8675646566", "otherType": null, "type": "NATIONAL_ID", }, - { + Object { "fieldsModifiedByIdentity": null, "id": "2023MTNJUSI", "otherType": null, @@ -1338,8 +1338,8 @@ exports[`running a full aggregated marriage FHIR bundle through resolvers produc ], "maritalStatus": null, "multipleBirth": null, - "name": [ - { + "name": Array [ + Object { "familyName": "test", "firstNames": "george", "marriedLastName": null, @@ -1347,7 +1347,7 @@ exports[`running a full aggregated marriage FHIR bundle through resolvers produc "use": "en", }, ], - "nationality": [ + "nationality": Array [ "FAR", ], "occupation": null, @@ -1358,9 +1358,9 @@ exports[`running a full aggregated marriage FHIR bundle through resolvers produc "telecom": null, }, "questionnaire": null, - "registration": { + "registration": Object { "_fhirID": null, - "assignment": { + "assignment": Object { "avatarURL": "https://eu.ui-avatars.com/api/?background=DEE5F2&color=222&name=Kennedy Mweene", "firstName": "Kennedy", "lastName": "Mweene", @@ -1370,7 +1370,7 @@ exports[`running a full aggregated marriage FHIR bundle through resolvers produc "attachments": null, "book": null, "brideSignature": "/mock-presigned-url", - "certificates": [], + "certificates": Array [], "contact": "GROOM", "contactEmail": "aaa@gmail.com", "contactPhoneNumber": null, @@ -1386,11 +1386,11 @@ exports[`running a full aggregated marriage FHIR bundle through resolvers produc "page": null, "paperFormID": null, "registrationNumber": "2023MTNJUSI", - "status": [ - { + "status": Array [ + Object { "comments": null, "id": "6cc01269-6b36-4aa5-9bb0-21944d685e42", - "location": { + "location": Object { "_fhirID": null, "address": null, "altitude": null, @@ -1405,7 +1405,7 @@ exports[`running a full aggregated marriage FHIR bundle through resolvers produc "telecom": null, "type": "ADMIN_STRUCTURE", }, - "office": { + "office": Object { "_fhirID": null, "address": null, "altitude": null, @@ -1432,7 +1432,7 @@ exports[`running a full aggregated marriage FHIR bundle through resolvers produc }, "typeOfMarriage": "MONOGAMY", "updatedAt": null, - "witnessOne": { + "witnessOne": Object { "_fhirID": null, "_fhirIDPatient": "4512feb1-a96d-40b4-bfdc-7f437993bfa8", "address": null, @@ -1441,7 +1441,7 @@ exports[`running a full aggregated marriage FHIR bundle through resolvers produc "ageOfIndividualInYears": null, "birthDate": null, "dateOfMarriage": null, - "deceased": { + "deceased": Object { "deathDate": null, "deceased": null, }, @@ -1453,8 +1453,8 @@ exports[`running a full aggregated marriage FHIR bundle through resolvers produc "identifier": null, "maritalStatus": null, "multipleBirth": null, - "name": [ - { + "name": Array [ + Object { "familyName": "one", "firstNames": "wit", "marriedLastName": null, @@ -1470,7 +1470,7 @@ exports[`running a full aggregated marriage FHIR bundle through resolvers produc "relationship": "HEAD_OF_GROOM_FAMILY", "telecom": null, }, - "witnessTwo": { + "witnessTwo": Object { "_fhirID": null, "_fhirIDPatient": "93de5304-f816-493e-968a-86c3a3d5ee7a", "address": null, @@ -1479,7 +1479,7 @@ exports[`running a full aggregated marriage FHIR bundle through resolvers produc "ageOfIndividualInYears": null, "birthDate": null, "dateOfMarriage": null, - "deceased": { + "deceased": Object { "deathDate": null, "deceased": null, }, @@ -1491,8 +1491,8 @@ exports[`running a full aggregated marriage FHIR bundle through resolvers produc "identifier": null, "maritalStatus": null, "multipleBirth": null, - "name": [ - { + "name": Array [ + Object { "familyName": "two", "firstNames": "wit", "marriedLastName": null, diff --git a/packages/gateway/src/features/registration/root-resolvers.test.ts b/packages/gateway/src/features/registration/root-resolvers.test.ts index 7e5ff589238..a9370c03ab3 100644 --- a/packages/gateway/src/features/registration/root-resolvers.test.ts +++ b/packages/gateway/src/features/registration/root-resolvers.test.ts @@ -13,13 +13,13 @@ import { mockTaskBundle } from '@gateway/utils/testUtils' import { DOWNLOADED_EXTENSION_URL } from '@opencrvs/commons/types' import { readFileSync } from 'fs' import * as fetchAny from 'jest-fetch-mock' -import { sign } from 'jsonwebtoken' +import * as jwt from 'jsonwebtoken' import { UserInputError } from 'apollo-server-hapi' const fetch = fetchAny as fetchAny.FetchMock const resolvers = appResolvers as any -const registerCertifyToken = sign( +const registerCertifyToken = jwt.sign( { scope: ['register', 'certify'] }, readFileSync('./test/cert.key'), { @@ -30,7 +30,7 @@ const registerCertifyToken = sign( } ) -const validateToken = sign( +const validateToken = jwt.sign( { scope: ['validate'] }, readFileSync('./test/cert.key'), { @@ -41,7 +41,7 @@ const validateToken = sign( } ) -const declareToken = sign( +const declareToken = jwt.sign( { scope: ['declare'] }, readFileSync('./test/cert.key'), { @@ -52,7 +52,7 @@ const declareToken = sign( } ) -const certifyToken = sign( +const certifyToken = jwt.sign( { scope: ['certify'] }, readFileSync('./test/cert.key'), { @@ -62,7 +62,7 @@ const certifyToken = sign( } ) -const sysAdminToken = sign( +const sysAdminToken = jwt.sign( { scope: ['sysadmin'] }, readFileSync('./test/cert.key'), { diff --git a/packages/gateway/src/features/registration/type-resolvers.ts b/packages/gateway/src/features/registration/type-resolvers.ts index a39433442d7..adea50cede8 100644 --- a/packages/gateway/src/features/registration/type-resolvers.ts +++ b/packages/gateway/src/features/registration/type-resolvers.ts @@ -95,7 +95,7 @@ import { import { GQLQuestionnaireQuestion, GQLResolver } from '@gateway/graphql/schema' import { Context } from '@gateway/graphql/context' -import validateUUID from 'uuid-validate' +import * as validateUUID from 'uuid-validate' import { fetchTaskByCompositionIdFromHearth } from '@gateway/features/fhir/service' import { TaskInput } from 'fhir/r3' diff --git a/packages/gateway/src/features/user/utils/index.ts b/packages/gateway/src/features/user/utils/index.ts index d49f41ad60a..dc9fd5c513b 100644 --- a/packages/gateway/src/features/user/utils/index.ts +++ b/packages/gateway/src/features/user/utils/index.ts @@ -14,7 +14,7 @@ import { ISystemModelData, IUserModelData } from '@gateway/features/user/type-resolvers' -import decode from 'jwt-decode' +import * as decode from 'jwt-decode' import fetch from '@gateway/fetch' import { Scope } from '@opencrvs/commons/authentication' diff --git a/packages/gateway/src/rate-limit.test.ts b/packages/gateway/src/rate-limit.test.ts index b9284765959..c92c4178706 100644 --- a/packages/gateway/src/rate-limit.test.ts +++ b/packages/gateway/src/rate-limit.test.ts @@ -22,7 +22,6 @@ import { import { StartedTestContainer } from 'testcontainers' import { savedAdministrativeLocation } from '@opencrvs/commons/fixtures' import { createServer } from '@gateway/server' -import { UUID } from '@opencrvs/commons' const fetch = fetchAny as any const resolvers = rootResolvers as any @@ -227,9 +226,7 @@ describe('Rate limit', () => { const resolverCalls = Array.from({ length: 20 }, async () => { fetch.mockResponseOnce( JSON.stringify([ - savedAdministrativeLocation({ - partOf: { reference: 'Location/1' as `Location/${UUID}` } - }) + savedAdministrativeLocation({ partOf: { reference: 'Location/1' } }) ]) ) await locationResolvers.Query!.isLeafLevelLocation( diff --git a/packages/gateway/test/setupJest.ts b/packages/gateway/test/setupJest.ts index f25f932fab8..001598ad33e 100644 --- a/packages/gateway/test/setupJest.ts +++ b/packages/gateway/test/setupJest.ts @@ -9,9 +9,11 @@ * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. */ import { join } from 'path' -import fetch from 'jest-fetch-mock' +import * as fetch from 'jest-fetch-mock' -jest.setMock('node-fetch', fetch) -jest.setMock('@opencrvs/commons/monitoring', {}) +const f = jest.requireActual('node-fetch') + +jest.setMock('node-fetch', { default: fetch, Headers: f.Headers }) +jest.setMock('@opencrvs/commons/monitoring') process.env.CERT_PUBLIC_KEY_PATH = join(__dirname, './cert.key.pub') diff --git a/packages/gateway/tsconfig.json b/packages/gateway/tsconfig.json index 7589b6bf40d..753660361d6 100644 --- a/packages/gateway/tsconfig.json +++ b/packages/gateway/tsconfig.json @@ -6,7 +6,7 @@ "@gateway/*": ["./*"] }, "target": "es6", - "module": "node16", + "module": "commonjs", "outDir": "build/dist", "sourceMap": true, "moduleResolution": "node16", @@ -19,9 +19,7 @@ "strictNullChecks": true, "allowSyntheticDefaultImports": true, "noUnusedLocals": true, - "types": ["fhir", "jest"], - "esModuleInterop": true, - "allowJs": true + "types": ["fhir", "jest"] }, "include": ["src/**/*.ts", "typings"], "exclude": ["node_modules", "build", "scripts", "acceptance-tests"] diff --git a/packages/login/package.json b/packages/login/package.json index 45e2f5e87fd..dfe6b45e409 100644 --- a/packages/login/package.json +++ b/packages/login/package.json @@ -29,7 +29,6 @@ "focus-visible": "^5.0.2", "google-libphonenumber": "^3.2.32", "history": "^4.7.2", - "jsdom": "16.7.0", "localforage": "^1.7.2", "lodash": "^4.17.10", "lodash-es": "^4.17.0", @@ -108,7 +107,7 @@ "stylelint-config-styled-components": "^0.1.1", "stylelint-processor-styled-components": "^1.10.0", "ts-node": "^6.1.1", - "typescript": "5.6.3", + "typescript": "4.9.5", "vite": "^5.0.0", "vite-plugin-pwa": "^0.20.0", "vite-plugin-svgr": "^0.6.0", diff --git a/packages/metrics/package.json b/packages/metrics/package.json index c83d0414497..7803e111a47 100644 --- a/packages/metrics/package.json +++ b/packages/metrics/package.json @@ -38,7 +38,7 @@ "node-fetch": "^2.6.7", "pino": "^7.0.0", "tsconfig-paths": "^3.13.0", - "typescript": "5.6.3" + "typescript": "4.9.5" }, "devDependencies": { "@types/archiver": "^3.0.0", @@ -51,7 +51,7 @@ "@types/jwt-decode": "^2.2.1", "@types/node-fetch": "^2.5.12", "cross-env": "^7.0.0", - "jest": "29.7.0", + "jest": "27.5.1", "jest-fetch-mock": "^2.1.2", "eslint": "^7.11.0", "@typescript-eslint/eslint-plugin": "^4.5.0", @@ -62,7 +62,7 @@ "mockingoose": "^2.15.2", "nodemon": "^3.0.0", "prettier": "2.8.8", - "ts-jest": "29.2.5", + "ts-jest": "27.1.4", "ts-node": "^6.1.1" }, "lint-staged": { @@ -92,7 +92,8 @@ "" ], "moduleNameMapper": { - "@metrics/(.*)": "/src/$1" + "@metrics/(.*)": "/src/$1", + "@opencrvs/commons/(.*)": "@opencrvs/commons/build/dist/$1" }, "coverageReporters": [ "json", diff --git a/packages/metrics/src/features/declarationsStarted/handler.test.ts b/packages/metrics/src/features/declarationsStarted/handler.test.ts index cfd640a0380..7afdbd9284e 100644 --- a/packages/metrics/src/features/declarationsStarted/handler.test.ts +++ b/packages/metrics/src/features/declarationsStarted/handler.test.ts @@ -97,8 +97,7 @@ describe('verify declarationsStarted', () => { fixtures.savedLocation({ id: 'uuid2' as UUID, partOf: { - reference: - 'Location/1490d3dd-71a9-47e8-b143-f9fc64f71294' as `Location/${UUID}` + reference: 'Location/1490d3dd-71a9-47e8-b143-f9fc64f71294' } }) ]) @@ -123,7 +122,7 @@ describe('verify declarationsStarted', () => { const res = await service.fetchLocationWiseDeclarationsStarted( '1552469068679', '1554814894419', - 'Location/1490d3dd-71a9-47e8-b143-f9fc64f71294' as `Location/${UUID}` + 'Location/1490d3dd-71a9-47e8-b143-f9fc64f71294' ) expect(res).toEqual({ diff --git a/packages/metrics/src/features/declarationsStarted/handler.ts b/packages/metrics/src/features/declarationsStarted/handler.ts index 08610325076..6c2eb7f29f5 100644 --- a/packages/metrics/src/features/declarationsStarted/handler.ts +++ b/packages/metrics/src/features/declarationsStarted/handler.ts @@ -21,7 +21,6 @@ import { getAvgTimeSpentOnAppByPractitioners } from '@metrics/features/declarationsStarted/service' import { EVENT_TYPE } from '@metrics/features/metrics/utils' -import { UUID } from '@opencrvs/commons' export async function declarationsStartedHandler( request: Hapi.Request, @@ -70,7 +69,7 @@ export async function declarationStartedMetricsByPractitionersHandler( ) { const { timeStart, timeEnd, locationId, practitionerIds, event } = request.payload as IDeclarationStartedMetricsPayload - const locId = `Location/${locationId}` as `Location/${UUID}` + const locId = `Location/${locationId}` as const let declarationStartedMetricsByPractitioners: IDeclarationStartedMetricsByPractitioner[] = [] try { diff --git a/packages/metrics/src/features/export/handler.ts b/packages/metrics/src/features/export/handler.ts index 41a2bb91a79..64c46be57fc 100644 --- a/packages/metrics/src/features/export/handler.ts +++ b/packages/metrics/src/features/export/handler.ts @@ -11,9 +11,9 @@ import * as Hapi from '@hapi/hapi' import { query, getCSV } from '@metrics/influxdb/client' -import archiver from 'archiver' +import * as archiver from 'archiver' import { metricsHandler } from '@metrics/features/metrics/handler' -import stringify from 'csv-stringify' +import * as stringify from 'csv-stringify' import { fetchLocation } from '@metrics/api' import { EVENT } from '@metrics/features/metrics/constants' //import { EXPECTED_BIRTH_REGISTRATION_IN_DAYS } from '@metrics/constants' diff --git a/packages/metrics/src/features/getTimeLogged/handler.test.ts b/packages/metrics/src/features/getTimeLogged/handler.test.ts index 2daaf700c70..f405afbde59 100644 --- a/packages/metrics/src/features/getTimeLogged/handler.test.ts +++ b/packages/metrics/src/features/getTimeLogged/handler.test.ts @@ -104,8 +104,7 @@ describe('verify time logged by practitioner handler', () => { fixtures.savedLocation({ id: 'uuid2' as UUID, partOf: { - reference: - 'Location/94429795-0a09-4de8-8e1e-dssdr323' as `Location/${UUID}` + reference: 'Location/94429795-0a09-4de8-8e1e-dssdr323' } }) ] diff --git a/packages/metrics/src/features/metrics/metricsGenerator.ts b/packages/metrics/src/features/metrics/metricsGenerator.ts index d7743714d4b..332abfc7fb1 100644 --- a/packages/metrics/src/features/metrics/metricsGenerator.ts +++ b/packages/metrics/src/features/metrics/metricsGenerator.ts @@ -37,7 +37,6 @@ import { ResourceIdentifier, Location as FhirLocation } from '@opencrvs/commons/types' -import { UUID } from '@opencrvs/commons' interface IGroupedByGender { total: number gender: string @@ -117,22 +116,18 @@ interface IGenderBasisMetrics { total: number } -interface ILocationPoint { +interface IGenderBasisPoint { + gender: string + over18: number + under18: number locationLevel2?: string locationLevel3?: string locationLevel4?: string locationLevel5?: string } -interface IGenderBasisPoint extends ILocationPoint { - gender: string - over18: number - under18: number -} - type Payment = { total: number - [key: string]: any } export async function fetchCertificationPayments( @@ -438,7 +433,7 @@ export async function fetchKeyFigures( const keyFigures: IBirthKeyFigures[] = [] const queryLocationId = - `Location/${estimatedFigureForTargetDays.locationId}` as `Location/${UUID}` + `Location/${estimatedFigureForTargetDays.locationId}` as const const locationIds = await fetchLocationChildrenIds(queryLocationId) const [officeLocationInChildren, locationPlaceholders] = helpers.in( locationIds, @@ -1202,16 +1197,10 @@ export async function fetchRegistrationsGroupByTime( .map((item) => { const obj: Partial = {} keys.forEach((key, i) => { - const value = item[i + 5] - switch (key) { - case 'total': - obj.total = Number(value) - break - case 'time': - case 'eventLocationType': - case 'timeLabel': - obj[key] = value as string - break + // item[i+5] to ignore the first 5 values of json & count from index 5 + obj[key] = item[i + 5] + if (key === 'total') { + obj[key] = Number(item[i + 5]) } }) return obj as IMetricsTotalGroupByTime @@ -1228,8 +1217,7 @@ function populateGenderBasisMetrics( points.forEach((point: IGenderBasisPoint) => { const metrics = metricsArray.find( - (element) => - element.location === point[locationLevel as keyof ILocationPoint] + (element) => element.location === point[locationLevel] ) const femaleOver18 = point.gender === 'female' @@ -1256,7 +1244,7 @@ function populateGenderBasisMetrics( if (!metrics) { metricsArray.push({ - location: point[locationLevel as keyof ILocationPoint] || '', + location: point[locationLevel], femaleOver18: femaleOver18, maleOver18: maleOver18, maleUnder18: maleUnder18, diff --git a/packages/metrics/src/features/monthWiseEventEstimations/handler.test.ts b/packages/metrics/src/features/monthWiseEventEstimations/handler.test.ts index 9fec6508a49..10d1ee497a1 100644 --- a/packages/metrics/src/features/monthWiseEventEstimations/handler.test.ts +++ b/packages/metrics/src/features/monthWiseEventEstimations/handler.test.ts @@ -56,8 +56,7 @@ describe('verify monthWiseEventEstimations handler', () => { fixtures.savedLocation({ id: 'uuid2' as UUID, partOf: { - reference: - 'Location/1490d3dd-71a9-47e8-b143-f9fc64f71294' as `Location/${UUID}` + reference: 'Location/1490d3dd-71a9-47e8-b143-f9fc64f71294' } }) ]) diff --git a/packages/metrics/src/features/registration/__snapshots__/handler.test.ts.snap b/packages/metrics/src/features/registration/__snapshots__/handler.test.ts.snap index 2a6827c9e75..0fab517b2e6 100644 --- a/packages/metrics/src/features/registration/__snapshots__/handler.test.ts.snap +++ b/packages/metrics/src/features/registration/__snapshots__/handler.test.ts.snap @@ -1,15 +1,15 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`When an existing declaration is marked certified a birth declaration writes the declaration_event_duration to influxdb 1`] = ` -{ - "fields": { +Object { + "fields": Object { "compositionId": "1744fc19-95be-434b-8bc9-a76d6b81551b", "currentTaskId": "dcf1644e-362d-414f-b0cc-2b240eea8591", "durationInSeconds": 94381, "previousTaskId": "e172627c-8490-44da-a702-80a082f978f5", }, "measurement": "declaration_event_duration", - "tags": { + "tags": Object { "currentStatus": "CERTIFIED", "eventType": "BIRTH", "previousStatus": "REGISTERED", @@ -19,15 +19,15 @@ exports[`When an existing declaration is marked certified a birth declaration wr `; exports[`When an existing declaration is marked certified a death declaration writes the delta between REGISTERED and CERTIFIED states to influxdb 1`] = ` -{ - "fields": { +Object { + "fields": Object { "compositionId": "62168b7e-7f80-4e2a-a7b0-1d33759c9d71", "currentTaskId": "75ba4bd8-009e-4a02-896c-148979dde09a", "durationInSeconds": 3564388, "previousTaskId": "e172627c-8490-44da-a702-80a082f978f5", }, "measurement": "declaration_event_duration", - "tags": { + "tags": Object { "currentStatus": "CERTIFIED", "eventType": "DEATH", "previousStatus": "REGISTERED", @@ -37,15 +37,15 @@ exports[`When an existing declaration is marked certified a death declaration wr `; exports[`When an existing declaration is marked certified writes the delta between REGISTERED and CERTIFIED states to influxdb 1`] = ` -{ - "fields": { +Object { + "fields": Object { "compositionId": "1744fc19-95be-434b-8bc9-a76d6b81551b", "currentTaskId": "dcf1644e-362d-414f-b0cc-2b240eea8591", "durationInSeconds": 94381, "previousTaskId": "e172627c-8490-44da-a702-80a082f978f5", }, "measurement": "declaration_event_duration", - "tags": { + "tags": Object { "currentStatus": "CERTIFIED", "eventType": "BIRTH", "previousStatus": "REGISTERED", @@ -55,15 +55,15 @@ exports[`When an existing declaration is marked certified writes the delta betwe `; exports[`When an existing declaration is marked registered a death declaration writes the delta between REGISTERED and CERTIFIED states to influxdb 1`] = ` -{ - "fields": { +Object { + "fields": Object { "compositionId": "62168b7e-7f80-4e2a-a7b0-1d33759c9d71", "currentTaskId": "75ba4bd8-009e-4a02-896c-148979dde09a", "durationInSeconds": 3727875, "previousTaskId": "e172627c-8490-44da-a702-80a082f978f5", }, "measurement": "declaration_event_duration", - "tags": { + "tags": Object { "currentStatus": "REGISTERED", "eventType": "DEATH", "previousStatus": "DECLARED", @@ -73,15 +73,15 @@ exports[`When an existing declaration is marked registered a death declaration w `; exports[`When an existing declaration is marked registered writes the delta between DECLARED and REGISTERED states to influxdb 1`] = ` -{ - "fields": { +Object { + "fields": Object { "compositionId": "80433e78-7042-4837-b888-a79c0181bf4e", "currentTaskId": "18ea2464-f843-45e2-93b1-8b026e0d93a4", "durationInSeconds": 170630, "previousTaskId": "e172627c-8490-44da-a702-80a082f978f5", }, "measurement": "declaration_event_duration", - "tags": { + "tags": Object { "currentStatus": "REGISTERED", "eventType": "BIRTH", "previousStatus": "DECLARED", @@ -91,15 +91,15 @@ exports[`When an existing declaration is marked registered writes the delta betw `; exports[`When an existing declaration is marked registered writes the delta between DECLARED and VALIDATED states to influxdb 1`] = ` -{ - "fields": { +Object { + "fields": Object { "compositionId": "80433e78-7042-4837-b888-a79c0181bf4e", "currentTaskId": "18ea2464-f843-45e2-93b1-8b026e0d93a4", "durationInSeconds": 170630, "previousTaskId": "e172627c-8490-44da-a702-80a082f978f5", }, "measurement": "declaration_event_duration", - "tags": { + "tags": Object { "currentStatus": "VALIDATED", "eventType": "BIRTH", "previousStatus": "DECLARED", @@ -109,15 +109,15 @@ exports[`When an existing declaration is marked registered writes the delta betw `; exports[`When an existing declaration is marked registered writes the delta between VALIDATED and REGISTERED states to influxdb 1`] = ` -{ - "fields": { +Object { + "fields": Object { "compositionId": "80433e78-7042-4837-b888-a79c0181bf4e", "currentTaskId": "18ea2464-f843-45e2-93b1-8b026e0d93a4", "durationInSeconds": 170630, "previousTaskId": "e172627c-8490-44da-a702-80a082f978f5", }, "measurement": "declaration_event_duration", - "tags": { + "tags": Object { "currentStatus": "REGISTERED", "eventType": "BIRTH", "previousStatus": "VALIDATED", @@ -127,15 +127,15 @@ exports[`When an existing declaration is marked registered writes the delta betw `; exports[`When an existing declaration is marked registered writes the delta between VALIDATED and WAITING_VALIDATION states to influxdb 1`] = ` -{ - "fields": { +Object { + "fields": Object { "compositionId": "80433e78-7042-4837-b888-a79c0181bf4e", "currentTaskId": "18ea2464-f843-45e2-93b1-8b026e0d93a4", "durationInSeconds": 170630, "previousTaskId": "e172627c-8490-44da-a702-80a082f978f5", }, "measurement": "declaration_event_duration", - "tags": { + "tags": Object { "currentStatus": "WAITING_VALIDATION", "eventType": "BIRTH", "previousStatus": "VALIDATED", @@ -145,12 +145,12 @@ exports[`When an existing declaration is marked registered writes the delta betw `; exports[`When an in-progress declaration is received writes the in complete field points to influxdb 1`] = ` -{ - "fields": { +Object { + "fields": Object { "compositionId": "b2fbb82c-a68d-4793-98e1-87484fc785c4", }, "measurement": "in_complete_fields", - "tags": { + "tags": Object { "eventType": "BIRTH", "missingFieldGroupId": "child-view-group", "missingFieldId": "placeOfBirth", @@ -163,12 +163,12 @@ exports[`When an in-progress declaration is received writes the in complete fiel `; exports[`When an in-progress declaration is received writes the rejected points to influxdb 1`] = ` -{ - "fields": { +Object { + "fields": Object { "compositionId": "81278acf-6105-435e-b1c2-91619c8cf6e1", }, "measurement": "declarations_rejected", - "tags": { + "tags": Object { "eventType": "BIRTH", "officeLocation": "Location/2a520dc1-0a9a-48a1-a4b8-66f3075a9155", "startedBy": "4bb03541-116e-4ce2-8ea4-407f307f7579", diff --git a/packages/metrics/src/scripts/VSExportGenerator.ts b/packages/metrics/src/scripts/VSExportGenerator.ts index 12317a84465..0413ff0099f 100644 --- a/packages/metrics/src/scripts/VSExportGenerator.ts +++ b/packages/metrics/src/scripts/VSExportGenerator.ts @@ -48,11 +48,12 @@ interface IInformant extends IPatient { relationship: string } -const TITLE_MAP: { [key: string]: keyof IPatientComposition } = { +const TITLE_MAP = { 'Child details': 'child', 'Deceased details': 'deceased', [`Mother's details`]: 'mother', - [`Father's details`]: 'father' + [`Father's details`]: 'father', + [`Informant's details`]: 'informant' } type IBirthRow = { @@ -112,15 +113,12 @@ type IDeathRow = { informantState: string } -interface IPatientComposition { +interface IFullComposition { + event: 'Birth' | 'Death' deceased: IPatient child: IPatient father: IPatient mother: IPatient -} - -interface IFullComposition extends IPatientComposition { - event: 'Birth' | 'Death' informant: IInformant observations: IObservation officeLocation: string @@ -154,7 +152,7 @@ const OBSERVATION_CODE = { PRESENT_AT_BIRTH_REG: 'present-at-birth-reg' } -const EDUCATION_LEVEL_MAP: { [key: string]: string } = { +const EDUCATION_LEVEL_MAP = { PRIMARY_ISCED_1: 'Primary', POST_SECONDARY_ISCED_4: 'Secondary', FIRST_STAGE_TERTIARY_ISCED_5: 'Tertiary', diff --git a/packages/metrics/src/utils/authUtils.ts b/packages/metrics/src/utils/authUtils.ts index 09c52fbf5f5..6e7a703364a 100644 --- a/packages/metrics/src/utils/authUtils.ts +++ b/packages/metrics/src/utils/authUtils.ts @@ -8,7 +8,7 @@ * * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. */ -import decode = require('jwt-decode') +import * as decode from 'jwt-decode' export enum USER_SCOPE { DECLARE = 'declare', diff --git a/packages/metrics/tsconfig.json b/packages/metrics/tsconfig.json index ed19c3dc2b3..1d6eb14b8d8 100644 --- a/packages/metrics/tsconfig.json +++ b/packages/metrics/tsconfig.json @@ -2,25 +2,44 @@ "compilerOptions": { "baseUrl": "./src", "paths": { - "@metrics/*": ["./*"] + "@metrics/*": [ + "./*" + ] }, "target": "es6", - "module": "node16", + "module": "commonjs", "outDir": "build/dist", "sourceMap": true, "allowSyntheticDefaultImports": true, "skipLibCheck": true, "moduleResolution": "node16", "rootDir": ".", - "lib": ["esnext.asynciterable", "es6", "es2017"], + "lib": [ + "esnext.asynciterable", + "es6", + "es2017" + ], "forceConsistentCasingInFileNames": true, "noImplicitReturns": true, "noImplicitThis": true, "noImplicitAny": true, "strictNullChecks": true, + "suppressImplicitAnyIndexErrors": true, "noUnusedLocals": true, - "types": ["fhir", "jest"] + "types": [ + "fhir", + "jest" + ] }, - "include": ["src/**/*.ts", "scripts", "typings"], - "exclude": ["node_modules", "build", "scripts", "acceptance-tests"] + "include": [ + "src/**/*.ts", + "scripts", + "typings" + ], + "exclude": [ + "node_modules", + "build", + "scripts", + "acceptance-tests" + ] } diff --git a/packages/migration/package.json b/packages/migration/package.json index eb6bc114849..d6adc3e205e 100644 --- a/packages/migration/package.json +++ b/packages/migration/package.json @@ -44,7 +44,7 @@ "mongodb": "^4.17.1", "prettier": "^2.5.0", "rimraf": "^5.0.0", - "typescript": "5.6.3" + "typescript": "4.9.5" }, "lint-staged": { "src/**/*.ts": [ diff --git a/packages/migration/tsconfig.json b/packages/migration/tsconfig.json index 6192f632baf..ec636545bdf 100644 --- a/packages/migration/tsconfig.json +++ b/packages/migration/tsconfig.json @@ -7,7 +7,7 @@ "allowJs": true, "moduleResolution": "node16", "target": "esnext", - "module": "node16", + "module": "esnext", "esModuleInterop": true, "rootDir": ".", "outDir": "build/dist", diff --git a/packages/notification/extract-translations.sh b/packages/notification/extract-translations.sh index 49408c3bf77..66bc54d6b17 100755 --- a/packages/notification/extract-translations.sh +++ b/packages/notification/extract-translations.sh @@ -10,4 +10,4 @@ echo 'The Environment variable COUNTRY_CONFIG_PATH must be set in your Terminal, so we can check that your country configuration has all necessary translations. If you cd into your country configuration repo and run the command pwd, then this will display for you. Then run export COUNTRY_CONFIG_PATH= in this window and try to commit again please.. Currently:' echo $COUNTRY_CONFIG_PATH -yarn run ts-node -- --compiler-options='{"module": "Node16"}' -r tsconfig-paths/register src/extract-translations.ts -- $COUNTRY_CONFIG_PATH +yarn run ts-node -- --compiler-options='{"module": "commonjs"}' -r tsconfig-paths/register src/extract-translations.ts -- $COUNTRY_CONFIG_PATH diff --git a/packages/notification/package.json b/packages/notification/package.json index 0c580606925..ab18ea69d83 100644 --- a/packages/notification/package.json +++ b/packages/notification/package.json @@ -35,7 +35,7 @@ "node-fetch": "^2.6.7", "pino": "^7.0.0", "tsconfig-paths": "^3.13.0", - "typescript": "5.6.3" + "typescript": "4.9.5" }, "devDependencies": { "@types/csv2json": "^1.4.5", @@ -56,11 +56,11 @@ "eslint-config-prettier": "^9.0.0", "eslint-plugin-import": "^2.17.3", "eslint-plugin-prettier": "^4.0.0", - "jest": "29.7.0", + "jest": "27.5.1", "jest-fetch-mock": "^2.1.2", "nodemon": "^3.0.0", "prettier": "2.8.8", - "ts-jest": "29.2.5", + "ts-jest": "27.1.4", "ts-node": "^6.1.1" }, "lint-staged": { @@ -78,7 +78,8 @@ "" ], "moduleNameMapper": { - "@notification/(.*)": "/src/$1" + "@notification/(.*)": "/src/$1", + "@opencrvs/commons/(.*)": "@opencrvs/commons/build/dist/$1" }, "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$", "setupFiles": [ diff --git a/packages/notification/src/extract-translations.ts b/packages/notification/src/extract-translations.ts index 059a7e46360..224ed14b65e 100644 --- a/packages/notification/src/extract-translations.ts +++ b/packages/notification/src/extract-translations.ts @@ -10,9 +10,9 @@ */ /* eslint-disable */ import { messageKeys } from '@notification/i18n/messages' -import chalk from 'chalk' +import * as chalk from 'chalk' import { Options, stringify } from 'csv-stringify' -import csv2json from 'csv2json' +import * as csv2json from 'csv2json' import * as fs from 'fs' import { promisify } from 'util' const csvStringify = promisify>, Options, string>( diff --git a/packages/notification/src/features/sms/user-handler.ts b/packages/notification/src/features/sms/user-handler.ts index 9441d697c14..316a74d15ab 100644 --- a/packages/notification/src/features/sms/user-handler.ts +++ b/packages/notification/src/features/sms/user-handler.ts @@ -31,7 +31,7 @@ interface IRetrieveUserNamePayload extends IMessageRecipient { interface IUserAuthCodePayload extends IMessageRecipient { code: string - notificationEvent: keyof typeof templateNames + notificationEvent: string } export async function sendUserCredentials( diff --git a/packages/notification/tsconfig.json b/packages/notification/tsconfig.json index 287b2a2fc45..d75963d65ac 100644 --- a/packages/notification/tsconfig.json +++ b/packages/notification/tsconfig.json @@ -2,24 +2,37 @@ "compilerOptions": { "baseUrl": "./src", "paths": { - "@notification/*": ["./*"] + "@notification/*": [ + "./*" + ] }, "target": "es6", - "module": "node16", + "module": "commonjs", "outDir": "build/dist", "sourceMap": true, "moduleResolution": "node16", "rootDir": ".", - "lib": ["esnext.asynciterable", "es6", "es2017"], + "lib": [ + "esnext.asynciterable", + "es6", + "es2017" + ], "forceConsistentCasingInFileNames": true, "noImplicitReturns": true, "noImplicitThis": true, "noImplicitAny": true, "strictNullChecks": true, + "suppressImplicitAnyIndexErrors": true, "noUnusedLocals": true, - "types": ["fhir", "jest"] + "types": [ + "fhir", + "jest" + ] }, - "include": ["src/**/*.ts", "typings"], + "include": [ + "src/**/*.ts", + "typings", + ], "exclude": [ "node_modules", "build", diff --git a/packages/search/package.json b/packages/search/package.json index 32df7e3888a..b67eecf7565 100644 --- a/packages/search/package.json +++ b/packages/search/package.json @@ -54,14 +54,14 @@ "@types/node": "18.11.18", "@types/uuid": "^3.4.4", "cross-env": "^7.0.0", - "jest": "29.7.0", + "jest": "27.5.1", "jest-fetch-mock": "^2.1.2", "nodemon": "^3.0.0", "prettier": "2.8.8", "testcontainers": "^9.1.1", - "ts-jest": "29.2.5", + "ts-jest": "27.1.4", "ts-node": "^6.1.1", - "typescript": "5.6.3" + "typescript": "4.9.5" }, "lint-staged": { "src/**/*.ts": [ @@ -90,7 +90,8 @@ "" ], "moduleNameMapper": { - "@search/(.*)": "/src/$1" + "@search/(.*)": "/src/$1", + "@opencrvs/commons/(.*)": "@opencrvs/commons/build/dist/$1" }, "coverageReporters": [ "json", diff --git a/packages/search/src/features/reindex/handler.ts b/packages/search/src/features/reindex/handler.ts index 569709dfefc..4f7ffe93d8b 100644 --- a/packages/search/src/features/reindex/handler.ts +++ b/packages/search/src/features/reindex/handler.ts @@ -10,8 +10,7 @@ */ import * as Hapi from '@hapi/hapi' import { logger } from '@opencrvs/commons' -import uuid = require('uuid') - +import * as uuid from 'uuid' import { prune } from './prune' import { backupLegacyIndex, reindex, updateAliases } from './reindex' diff --git a/packages/search/src/test/utils.ts b/packages/search/src/test/utils.ts index 7c93cb17b68..ebaa9f328a2 100644 --- a/packages/search/src/test/utils.ts +++ b/packages/search/src/test/utils.ts @@ -365,8 +365,7 @@ export const mockBirthFhirBundle: SavedBundle< { url: 'http://opencrvs.org/specs/extension/part-of', valueReference: { - reference: - 'Location/0f7684aa-8c65-4901-8318-bf1e22c247cb' as `Location/${UUID}` + reference: 'Location/0f7684aa-8c65-4901-8318-bf1e22c247cb' } } ] @@ -400,15 +399,13 @@ export const mockBirthFhirBundle: SavedBundle< { url: 'http://opencrvs.org/specs/extension/regLastUser', valueReference: { - reference: - 'Practitioner/4651d1cc-6072-4e34-bf20-b583f421a9f1' as `Practitioner/${UUID}` + reference: 'Practitioner/4651d1cc-6072-4e34-bf20-b583f421a9f1' } }, { url: 'http://opencrvs.org/specs/extension/regLastOffice', valueReference: { - reference: - 'Location/ce73938d-a188-4a78-9d19-35dfd4ca6957' as `Location/${UUID}` + reference: 'Location/ce73938d-a188-4a78-9d19-35dfd4ca6957' } } ], @@ -441,8 +438,7 @@ export const mockBirthFhirBundle: SavedBundle< ] }, focus: { - reference: - 'Composition/c8b8e843-c5e0-49b5-96d9-a702ddb46454' as `Composition/${UUID}` + reference: 'Composition/c8b8e843-c5e0-49b5-96d9-a702ddb46454' }, meta: { lastUpdated: '2023-11-30T12:36:27.277+00:00', @@ -502,8 +498,7 @@ export const mockBirthFhirBundle: SavedBundle< status: 'active', mode: 'instance', partOf: { - reference: - 'Location/ed6195ff-0f83-4852-832e-dc9db07151ff' as `Location/${UUID}` + reference: 'Location/ed6195ff-0f83-4852-832e-dc9db07151ff' }, type: { coding: [ @@ -545,8 +540,7 @@ export const mockBirthFhirBundle: SavedBundle< status: 'active', mode: 'instance', partOf: { - reference: - 'Location/0f7684aa-8c65-4901-8318-bf1e22c247cb' as `Location/${UUID}` + reference: 'Location/0f7684aa-8c65-4901-8318-bf1e22c247cb' }, type: { coding: [ @@ -587,8 +581,7 @@ export const mockBirthFhirBundle: SavedBundle< status: 'active', mode: 'instance', partOf: { - reference: - 'Location/af050fc6-5866-455a-9cd2-6437e34a3fbe' as `Location/${UUID}` + reference: 'Location/af050fc6-5866-455a-9cd2-6437e34a3fbe' }, type: { coding: [ @@ -641,8 +634,7 @@ export const mockBirthFhirBundle: SavedBundle< ], location: [ { - reference: - 'Location/ce73938d-a188-4a78-9d19-35dfd4ca6957' as `Location/${UUID}` + reference: 'Location/ce73938d-a188-4a78-9d19-35dfd4ca6957' } ], meta: { @@ -673,7 +665,7 @@ export const mockBirthFhirBundle: SavedBundle< status: 'active', mode: 'instance', partOf: { - reference: 'Location/0' as `Location/${UUID}` + reference: 'Location/0' }, type: { coding: [ @@ -1329,8 +1321,7 @@ export const mockDeathFhirBundle: SavedBundle< { url: 'http://opencrvs.org/specs/extension/part-of', valueReference: { - reference: - 'Location/e66643ac-9ea9-4314-b842-f4fb3ad9e83a' as `Location/${UUID}` + reference: 'Location/e66643ac-9ea9-4314-b842-f4fb3ad9e83a' } } ] @@ -1487,15 +1478,13 @@ export const mockDeathFhirBundle: SavedBundle< { url: 'http://opencrvs.org/specs/extension/regLastOffice', valueReference: { - reference: - 'Location/e9e1b362-27c9-4ce1-82ad-57fe9d5650e4' as `Location/${UUID}` + reference: 'Location/e9e1b362-27c9-4ce1-82ad-57fe9d5650e4' } }, { url: 'http://opencrvs.org/specs/extension/regLastUser', valueReference: { - reference: - 'Practitioner/525094f5-3c5f-4e72-af3b-adda8617839f' as `Practitioner/${UUID}` + reference: 'Practitioner/525094f5-3c5f-4e72-af3b-adda8617839f' } }, { @@ -1587,8 +1576,7 @@ export const mockDeathFhirBundle: SavedBundle< { url: 'http://opencrvs.org/specs/extension/part-of', valueReference: { - reference: - 'Location/e66643ac-9ea9-4314-b842-f4fb3ad9e83a' as `Location/${UUID}` + reference: 'Location/e66643ac-9ea9-4314-b842-f4fb3ad9e83a' } } ] @@ -2105,8 +2093,7 @@ export const mockDeathFhirBundle: SavedBundle< ], location: [ { - reference: - 'Location/e9e1b362-27c9-4ce1-82ad-57fe9d5650e4' as `Location/${UUID}` + reference: 'Location/e9e1b362-27c9-4ce1-82ad-57fe9d5650e4' } ], meta: { diff --git a/packages/search/src/utils/authUtils.ts b/packages/search/src/utils/authUtils.ts index 106c79c0fe3..9fd7e902692 100644 --- a/packages/search/src/utils/authUtils.ts +++ b/packages/search/src/utils/authUtils.ts @@ -8,7 +8,7 @@ * * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. */ -import decode = require('jwt-decode') +import * as decode from 'jwt-decode' export enum USER_SCOPE { DECLARE = 'declare', diff --git a/packages/search/tsconfig.json b/packages/search/tsconfig.json index 0fe1033ee48..2c3ebf2bb6b 100644 --- a/packages/search/tsconfig.json +++ b/packages/search/tsconfig.json @@ -6,7 +6,7 @@ "@search/*": ["./*"] }, "target": "es6", - "module": "node16", + "module": "commonjs", "outDir": "build/dist", "sourceMap": true, "moduleResolution": "node16", diff --git a/packages/user-mgnt/package.json b/packages/user-mgnt/package.json index e087d189648..5f863681ad9 100644 --- a/packages/user-mgnt/package.json +++ b/packages/user-mgnt/package.json @@ -49,13 +49,13 @@ "@types/node-fetch": "^2.5.12", "@types/uuid": "^3.4.3", "cross-env": "^7.0.0", - "jest": "29.7.0", + "jest": "27.5.1", "mockingoose": "^2.15.2", "nodemon": "^3.0.0", "prettier": "2.8.8", - "ts-jest": "29.2.5", + "ts-jest": "27.1.4", "ts-node": "^6.1.1", - "typescript": "5.6.3" + "typescript": "4.9.5" }, "lint-staged": { "src/**/*.ts": [ @@ -71,7 +71,8 @@ "" ], "moduleNameMapper": { - "@user-mgnt/(.*)": "/src/$1" + "@user-mgnt/(.*)": "/src/$1", + "@opencrvs/commons/(.*)": "@opencrvs/commons/build/dist/$1" }, "setupFiles": [ "./test/setupJest.ts" diff --git a/packages/user-mgnt/src/database.test.ts b/packages/user-mgnt/src/database.test.ts index 5faf5c20526..5077c71867f 100644 --- a/packages/user-mgnt/src/database.test.ts +++ b/packages/user-mgnt/src/database.test.ts @@ -17,7 +17,7 @@ jest.mock('mongoose', () => ({ disconnect: () => {} })) -import mongoose from 'mongoose' +import * as mongoose from 'mongoose' import { start, stop } from '@user-mgnt/database' import { logger } from '@opencrvs/commons' diff --git a/packages/user-mgnt/src/database.ts b/packages/user-mgnt/src/database.ts index 6c881ec69f3..cf4bedf42b1 100644 --- a/packages/user-mgnt/src/database.ts +++ b/packages/user-mgnt/src/database.ts @@ -8,7 +8,7 @@ * * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. */ -import mongoose from 'mongoose' +import * as mongoose from 'mongoose' import { MONGO_URL } from '@user-mgnt/constants' import { logger } from '@opencrvs/commons' diff --git a/packages/user-mgnt/src/features/createUser/service.test.ts b/packages/user-mgnt/src/features/createUser/service.test.ts index 435253d5625..c789ff750e2 100644 --- a/packages/user-mgnt/src/features/createUser/service.test.ts +++ b/packages/user-mgnt/src/features/createUser/service.test.ts @@ -10,9 +10,9 @@ */ import { generateUsername, sendCredentialsNotification } from './service' import User from '@user-mgnt/model/user' -import mockingoose = require('mockingoose') -import fetchMock from 'jest-fetch-mock' -import jwt from 'jsonwebtoken' +import * as mockingoose from 'mockingoose' +import * as fetchMock from 'jest-fetch-mock' +import * as jwt from 'jsonwebtoken' import { readFileSync } from 'fs' import { logger } from '@opencrvs/commons' diff --git a/packages/user-mgnt/src/features/system/handler.ts b/packages/user-mgnt/src/features/system/handler.ts index 65c618af077..664986db97b 100644 --- a/packages/user-mgnt/src/features/system/handler.ts +++ b/packages/user-mgnt/src/features/system/handler.ts @@ -29,7 +29,7 @@ import { pickSystem, types } from '@user-mgnt/utils/system' import { getTokenPayload, ITokenPayload } from '@user-mgnt/utils/token' import { statuses } from '@user-mgnt/utils/userUtils' import * as Joi from 'joi' -import uuid from 'uuid/v4' +import * as uuid from 'uuid/v4' export enum EventType { Birth = 'birth', @@ -47,7 +47,7 @@ interface IRegisterSystemPayload { dailyQuota: number webhook: WebHookPayload[] } - type: keyof typeof systemRoleScopes + type: string integratingSystemType: string } diff --git a/packages/user-mgnt/src/features/userAudit/handler.ts b/packages/user-mgnt/src/features/userAudit/handler.ts index adc25544071..359dfc32163 100644 --- a/packages/user-mgnt/src/features/userAudit/handler.ts +++ b/packages/user-mgnt/src/features/userAudit/handler.ts @@ -24,8 +24,8 @@ import { postUserActionToMetrics } from '@user-mgnt/features/changePhone/handler interface IAuditUserPayload { userId: string auditedBy: string - action: keyof typeof AUDIT_ACTION - reason: keyof typeof AUDIT_REASON + action: string + reason: string comment: string } diff --git a/packages/user-mgnt/src/features/userSearchRecord/handler.ts b/packages/user-mgnt/src/features/userSearchRecord/handler.ts index 7829ed723cc..d93dd234948 100644 --- a/packages/user-mgnt/src/features/userSearchRecord/handler.ts +++ b/packages/user-mgnt/src/features/userSearchRecord/handler.ts @@ -12,8 +12,8 @@ import { logger } from '@opencrvs/commons' import User, { IUserModel, Event } from '@user-mgnt/model/user' import { unauthorized } from '@hapi/boom' import * as Hapi from '@hapi/hapi' -import Joi from 'joi' -import uuid from 'uuid/v4' +import * as Joi from 'joi' +import * as uuid from 'uuid/v4' enum RegStatus { IN_PROGRESS = 'IN_PROGRESS', diff --git a/packages/user-mgnt/src/utils/token.ts b/packages/user-mgnt/src/utils/token.ts index 9381b107f2b..a784a8ee0be 100644 --- a/packages/user-mgnt/src/utils/token.ts +++ b/packages/user-mgnt/src/utils/token.ts @@ -9,7 +9,7 @@ * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. */ -import decode from 'jwt-decode' +import * as decode from 'jwt-decode' export interface IAuthHeader { Authorization: string diff --git a/packages/user-mgnt/src/utils/userUtils.ts b/packages/user-mgnt/src/utils/userUtils.ts index e18a417f2a7..91e50a34c42 100644 --- a/packages/user-mgnt/src/utils/userUtils.ts +++ b/packages/user-mgnt/src/utils/userUtils.ts @@ -10,7 +10,7 @@ */ import * as Hapi from '@hapi/hapi' import { ITokenPayload } from '@user-mgnt/utils/token' -import decode from 'jwt-decode' +import * as decode from 'jwt-decode' export const statuses = { PENDING: 'pending', diff --git a/packages/user-mgnt/test/setupJest.ts b/packages/user-mgnt/test/setupJest.ts index 986244842fa..851962c4743 100644 --- a/packages/user-mgnt/test/setupJest.ts +++ b/packages/user-mgnt/test/setupJest.ts @@ -9,7 +9,7 @@ * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. */ import { join } from 'path' -import fetch from 'jest-fetch-mock' +import * as fetch from 'jest-fetch-mock' process.env.CERT_PUBLIC_KEY_PATH = join(__dirname, './cert.key.pub') -jest.setMock('node-fetch', fetch) +jest.setMock('node-fetch', { default: fetch }) diff --git a/packages/user-mgnt/tsconfig.json b/packages/user-mgnt/tsconfig.json index ff9971a8a13..1c499cf0f56 100644 --- a/packages/user-mgnt/tsconfig.json +++ b/packages/user-mgnt/tsconfig.json @@ -5,7 +5,7 @@ "@user-mgnt/*": ["./*"] }, "target": "es6", - "module": "node16", + "module": "commonjs", "rootDir": ".", "sourceMap": true, "moduleResolution": "node16", @@ -16,10 +16,17 @@ "noImplicitThis": true, "noImplicitAny": true, "strictNullChecks": true, + "suppressImplicitAnyIndexErrors": true, "noUnusedLocals": true, - "types": ["fhir", "jest"], - "esModuleInterop": true + "types": ["fhir", "jest"] }, "include": ["src/**/*.ts", "typings"], - "exclude": ["node_modules", "build", "scripts", "acceptance-tests"] + "exclude": [ + "node_modules", + "build", + "scripts", + "acceptance-tests", + "src/setupTests.ts", + "src/**/*.test.ts" + ] } diff --git a/packages/webhooks/package.json b/packages/webhooks/package.json index b2c5f6c9fd2..5992277a416 100644 --- a/packages/webhooks/package.json +++ b/packages/webhooks/package.json @@ -56,13 +56,13 @@ "eslint-config-prettier": "^9.0.0", "eslint-plugin-import": "^2.17.3", "eslint-plugin-prettier": "^4.0.0", - "jest": "29.7.0", + "jest": "27.5.1", "mockingoose": "^2.15.2", "nodemon": "^3.0.0", "prettier": "2.8.8", - "ts-jest": "29.2.5", + "ts-jest": "27.1.4", "ts-node": "^6.1.1", - "typescript": "5.6.3" + "typescript": "4.9.5" }, "lint-staged": { "src/**/*.ts": [ @@ -78,7 +78,8 @@ "" ], "moduleNameMapper": { - "@webhooks/(.*)": "/src/$1" + "@webhooks/(.*)": "/src/$1", + "@opencrvs/commons/(.*)": "@opencrvs/commons/build/dist/$1" }, "setupFiles": [ "./test/setupJest.ts" diff --git a/packages/webhooks/src/features/manage/handler.test.ts b/packages/webhooks/src/features/manage/handler.test.ts index 32c04759760..c224e31ee3c 100644 --- a/packages/webhooks/src/features/manage/handler.test.ts +++ b/packages/webhooks/src/features/manage/handler.test.ts @@ -12,13 +12,13 @@ import { createServer } from '@webhooks/server' import Webhook, { IWebhook } from '@webhooks/model/webhook' import { readFileSync } from 'fs' import * as fetchMock from 'jest-fetch-mock' -import { sign } from 'jsonwebtoken' +import * as jwt from 'jsonwebtoken' import * as mockingoose from 'mockingoose' import * as service from '@webhooks/features/manage/service' const fetch = fetchMock as fetchMock.FetchMock -const token = sign( +const token = jwt.sign( { scope: ['sysadmin', 'demo'] }, readFileSync('./test/cert.key'), { diff --git a/packages/webhooks/src/features/manage/handler.ts b/packages/webhooks/src/features/manage/handler.ts index f6c5a94b528..7965b309b6c 100644 --- a/packages/webhooks/src/features/manage/handler.ts +++ b/packages/webhooks/src/features/manage/handler.ts @@ -20,7 +20,7 @@ import { import { internal } from '@hapi/boom' import Webhook, { TRIGGERS } from '@webhooks/model/webhook' import { logger } from '@opencrvs/commons' -import uuid = require('uuid/v4') +import * as uuid from 'uuid/v4' import fetch from 'node-fetch' import { resolve } from 'url' @@ -40,7 +40,7 @@ export async function subscribeWebhooksHandler( h: Hapi.ResponseToolkit ) { const { hub } = request.payload as ISubscribePayload - if (!(hub.topic in TRIGGERS)) { + if (!TRIGGERS[TRIGGERS[hub.topic]]) { return h .response({ hub: { @@ -109,7 +109,7 @@ export async function subscribeWebhooksHandler( createdBy, address: hub.callback, sha_secret: hub.secret, - trigger: hub.topic in TRIGGERS ? hub.topic : undefined + trigger: TRIGGERS[TRIGGERS[hub.topic]] } const challenge = generateChallenge() diff --git a/packages/webhooks/src/features/manage/service.ts b/packages/webhooks/src/features/manage/service.ts index 1b26a9adf7b..01b33b3ecea 100644 --- a/packages/webhooks/src/features/manage/service.ts +++ b/packages/webhooks/src/features/manage/service.ts @@ -8,7 +8,7 @@ * * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. */ -import decode = require('jwt-decode') +import * as decode from 'jwt-decode' import { USER_MANAGEMENT_URL } from '@webhooks/constants' import fetch from 'node-fetch' import * as crypto from 'crypto' diff --git a/packages/webhooks/tsconfig.json b/packages/webhooks/tsconfig.json index e0fe6589e6d..7ce641db4b9 100644 --- a/packages/webhooks/tsconfig.json +++ b/packages/webhooks/tsconfig.json @@ -2,25 +2,45 @@ "compilerOptions": { "baseUrl": "./src", "paths": { - "@webhooks/*": ["./*"] + "@webhooks/*": [ + "./*" + ] }, "target": "es6", - "module": "node16", + "module": "commonjs", "allowSyntheticDefaultImports": true, "skipLibCheck": true, "outDir": "build/dist", "sourceMap": true, "moduleResolution": "node16", "rootDir": ".", - "lib": ["esnext.asynciterable", "es6", "es2017"], + "lib": [ + "esnext.asynciterable", + "es6", + "es2017" + ], "forceConsistentCasingInFileNames": true, "noImplicitReturns": true, "noImplicitThis": true, "noImplicitAny": true, "strictNullChecks": true, + "suppressImplicitAnyIndexErrors": true, "noUnusedLocals": true, - "types": ["fhir", "jest"] + "types": [ + "fhir", + "jest" + ] }, - "include": ["resources/**/*.ts", "src/**/*.ts", "typings"], - "exclude": ["node_modules", "build", "scripts", "acceptance-tests"] + "include": [ + "resources/**/*.ts", + "src/**/*.ts", + "typings" + ], + "exclude": [ + "node_modules", + "build", + "scripts", + "acceptance-tests", + "src/setupTests.ts" + ] } diff --git a/packages/workflow/package.json b/packages/workflow/package.json index a3cc1fa5f5d..a19c4feca68 100644 --- a/packages/workflow/package.json +++ b/packages/workflow/package.json @@ -52,13 +52,13 @@ "@typescript-eslint/parser": "^4.5.0", "cross-env": "^7.0.0", "eslint": "^7.11.0", - "jest": "29.7.0", + "jest": "27.5.1", "msw": "^1.3.2", "nodemon": "^3.0.0", "prettier": "2.8.8", - "ts-jest": "29.2.5", + "ts-jest": "27.1.4", "ts-node": "^6.1.1", - "typescript": "5.6.3" + "typescript": "4.9.5" }, "lint-staged": { "src/**/*.ts": [ @@ -88,7 +88,8 @@ ], "moduleNameMapper": { "@workflow/(.*)": "/src/$1", - "@test/(.*)": "/test/$1" + "@test/(.*)": "/test/$1", + "@opencrvs/commons/(.*)": "@opencrvs/commons/build/dist/$1" }, "coverageReporters": [ "json", diff --git a/packages/workflow/src/records/__snapshots__/state-transitions.test.ts.snap b/packages/workflow/src/records/__snapshots__/state-transitions.test.ts.snap index d9b9c86c559..70295086ff7 100644 --- a/packages/workflow/src/records/__snapshots__/state-transitions.test.ts.snap +++ b/packages/workflow/src/records/__snapshots__/state-transitions.test.ts.snap @@ -1,116 +1,116 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`functions that take record from one state to another * -> correction requested should be defined: changed resources 1`] = ` -[ - { - "businessStatus": { - "coding": [ - { +Array [ + Object { + "businessStatus": Object { + "coding": Array [ + Object { "code": "CORRECTION_REQUESTED", "system": "http://opencrvs.org/specs/reg-status", }, ], }, - "code": { - "coding": [ - { + "code": Object { + "coding": Array [ + Object { "code": "BIRTH", "system": "http://opencrvs.org/specs/types", }, ], }, - "encounter": { + "encounter": Object { "reference": "STATIC", }, - "extension": [ - { + "extension": Array [ + Object { "url": "http://opencrvs.org/specs/extension/informants-signature", "valueString": "/ocrvs/c647d125-68ee-4794-b320-d472aadd8c09.png", }, - { + Object { "url": "http://opencrvs.org/specs/extension/contact-person-phone-number", "valueString": "+260745645645", }, - { + Object { "url": "http://opencrvs.org/specs/extension/contact-person-email", "valueString": "informant@example.com", }, - { + Object { "url": "http://opencrvs.org/specs/extension/timeLoggedMS", "valueInteger": 0, }, - { + Object { "url": "http://opencrvs.org/specs/extension/paymentDetails", - "valueReference": { + "valueReference": Object { "reference": "STATIC", }, }, - { + Object { "url": "http://opencrvs.org/specs/extension/noSupportingDocumentationRequired", "valueBoolean": true, }, - { + Object { "url": "http://opencrvs.org/specs/extension/requestingIndividual", "valueString": "MOTHER", }, - { + Object { "url": "http://opencrvs.org/specs/extension/hasShowedVerifiedDocument", "valueBoolean": true, }, - { + Object { "url": "http://opencrvs.org/specs/extension/regLastUser", - "valueReference": { + "valueReference": Object { "reference": "Practitioner/7dc24408-d409-4ec0-bd9d-4a5aa817dcab", }, }, - { + Object { "url": "http://opencrvs.org/specs/extension/regLastOffice", - "valueReference": { + "valueReference": Object { "reference": "Location/61e07903-bf3c-4bd9-9b20-6cf0e3bb982c", }, }, ], - "focus": { + "focus": Object { "reference": "Composition/c5811d36-934d-40f9-94b4-15194d562e45", }, "id": "8dae3f40-70f8-4463-aae1-fd56aec0c8ee", - "identifier": [ - { + "identifier": Array [ + Object { "system": "http://opencrvs.org/specs/id/draft-id", "value": "03d087a0-1e20-4443-aca3-d48461d4d597", }, - { + Object { "system": "http://opencrvs.org/specs/id/birth-tracking-id", "value": "BF6W25K", }, - { + Object { "system": "http://opencrvs.org/specs/id/birth-registration-number", "value": "2023BF6W25K", }, ], - "input": [], + "input": Array [], "intent": "proposal", "lastModified": "STATIC", - "note": [ - { + "note": Array [ + Object { "text": "Both mother and father were present", }, - { + Object { "text": "Note", }, ], - "output": [], - "reason": { - "extension": [ - { + "output": Array [], + "reason": Object { + "extension": Array [ + Object { "url": "http://opencrvs.org/specs/extension/otherReason", "valueString": "Other reason", }, ], "text": "OTHER", }, - "requester": { - "agent": { + "requester": Object { + "agent": Object { "reference": "Practitioner/7dc24408-d409-4ec0-bd9d-4a5aa817dcab", }, }, @@ -121,37 +121,37 @@ exports[`functions that take record from one state to another * -> correction re `; exports[`functions that take record from one state to another * -> correction requested should be defined: new resources 1`] = ` -[ - { - "detail": [ - { - "amount": { +Array [ + Object { + "detail": Array [ + Object { + "amount": Object { "value": 100, }, "date": "2021-08-10T10:00:00.000Z", - "type": { - "coding": [ - { + "type": Object { + "coding": Array [ + Object { "code": "MANUAL", }, ], }, }, ], - "outcome": { - "coding": [ - { + "outcome": Object { + "coding": Array [ + Object { "code": "COMPLETED", }, ], }, "resourceType": "PaymentReconciliation", "status": "active", - "total": { + "total": Object { "value": 100, }, }, - { + Object { "resourceType": "Encounter", "status": "finished", }, diff --git a/packages/workflow/src/records/fhir.ts b/packages/workflow/src/records/fhir.ts index 5c4b0cf3b36..78d714d1b95 100644 --- a/packages/workflow/src/records/fhir.ts +++ b/packages/workflow/src/records/fhir.ts @@ -1225,7 +1225,7 @@ function toSavedTask( function toSavedRelatedPerson( relatedPersion: RelatedPerson & { - patient: { reference: `urn:uuid:${UUID}` } + patient: { reference: `urn:uuid:${string}` } }, id: UUID, resourceBundle: Bundle, @@ -1367,10 +1367,8 @@ export function toSavedBundle( fullUrl: responseBundle.entry[index].response.location, resource: toSavedTask( { - ...(entry.resource as Task), - focus: { - reference: entry.resource.focus.reference - } + ...entry.resource, + focus: { reference: entry.resource.focus.reference } }, urlReferenceToUUID(responseBundle.entry[index].response.location), resourceBundle, diff --git a/packages/workflow/src/records/handler/create.ts b/packages/workflow/src/records/handler/create.ts index 73a69ca43eb..d0613b9d4ea 100644 --- a/packages/workflow/src/records/handler/create.ts +++ b/packages/workflow/src/records/handler/create.ts @@ -74,7 +74,7 @@ import { toValidated, toWaitingForExternalValidationState } from '@workflow/records/state-transitions' -import { logger, UUID } from '@opencrvs/commons' +import { logger } from '@opencrvs/commons' const requestSchema = z.object({ event: z.custom(), @@ -175,7 +175,7 @@ async function createRecord( recordDetails: z.TypeOf['record'], event: z.TypeOf['event'], token: string, - duplicateIds: Array<{ id: UUID; trackingId: string }> + duplicateIds: Array<{ id: string; trackingId: string }> ): Promise { const inputBundle = buildFHIRBundle(recordDetails, event) const trackingId = await generateTrackingIdForEvents( diff --git a/packages/workflow/src/test/utils.ts b/packages/workflow/src/test/utils.ts index e0cf976c34e..7193ce5b35f 100644 --- a/packages/workflow/src/test/utils.ts +++ b/packages/workflow/src/test/utils.ts @@ -185,7 +185,7 @@ export const testFhirBundle: StrictBundle< }, { url: 'http://opencrvs.org/specs/extension/regLastOffice', - valueReference: { reference: 'Location/123' as `Location/${UUID}` } + valueReference: { reference: 'Location/123' } } ] } diff --git a/packages/workflow/src/utils/auth-utils.ts b/packages/workflow/src/utils/auth-utils.ts index d92f1bf09a2..abc2516490f 100644 --- a/packages/workflow/src/utils/auth-utils.ts +++ b/packages/workflow/src/utils/auth-utils.ts @@ -8,7 +8,7 @@ * * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. */ -import decode = require('jwt-decode') +import * as decode from 'jwt-decode' import * as Hapi from '@hapi/hapi' import { hasScope } from '@opencrvs/commons/authentication' diff --git a/packages/workflow/src/utils/duplicate-checker.ts b/packages/workflow/src/utils/duplicate-checker.ts index 11db4c9eb5a..7c16ebc0815 100644 --- a/packages/workflow/src/utils/duplicate-checker.ts +++ b/packages/workflow/src/utils/duplicate-checker.ts @@ -9,7 +9,7 @@ * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. */ import nodeFetch from 'node-fetch' -import { IAuthHeader, UUID } from '@opencrvs/commons' +import { IAuthHeader } from '@opencrvs/commons' import { addExtensionsToTask, addRelatesToToComposition, @@ -90,7 +90,7 @@ const searchBirthDuplicates = async ( async function findBirthDuplicateIds( authHeader: IAuthHeader, birthRegDetails: BirthRegistration -): Promise<{ id: UUID; trackingId: string }[]> { +): Promise<{ id: string; trackingId: string }[]> { if (!birthRegDetails || !birthRegDetails.child) { return [] } @@ -111,7 +111,7 @@ async function findBirthDuplicateIds( async function findDeathDuplicateIds( authHeader: IAuthHeader, deathRegDetails: DeathRegistration -): Promise<{ id: UUID; trackingId: string }[]> { +): Promise<{ id: string; trackingId: string }[]> { if (!deathRegDetails || !deathRegDetails.deceased) { return [] } @@ -168,7 +168,7 @@ export function updateTaskWithDuplicateIds( export function updateCompositionWithDuplicateIds( composition: Composition, - duplicateIds: { id: UUID; trackingId: string }[] + duplicateIds: { id: string; trackingId: string }[] ) { const relatesTo: NonNullable = duplicateIds.map( (duplicate) => ({ diff --git a/packages/workflow/test/handlers.ts b/packages/workflow/test/handlers.ts index e2cec74d1e0..cdb5c2e6cda 100644 --- a/packages/workflow/test/handlers.ts +++ b/packages/workflow/test/handlers.ts @@ -47,14 +47,13 @@ const hierarchyHandler = rest.get( fixtures.savedAdministrativeLocation({ id: '0f7684aa-8c65-4901-8318-bf1e22c247cb' as UUID, name: 'Ibombo', - partOf: { reference: 'Location/0' as `Location/${UUID}` } + partOf: { reference: 'Location/0' } }), fixtures.savedAdministrativeLocation({ id: 'ce73938d-a188-4a78-9d19-35dfd4ca6957' as UUID, name: 'Ibombo District Office', partOf: { - reference: - 'Location/0f7684aa-8c65-4901-8318-bf1e22c247cb' as `Location/${UUID}` + reference: 'Location/0f7684aa-8c65-4901-8318-bf1e22c247cb' } }) ]) diff --git a/packages/workflow/test/mocks/locations.ts b/packages/workflow/test/mocks/locations.ts index 5a32307344c..07f13d02e11 100644 --- a/packages/workflow/test/mocks/locations.ts +++ b/packages/workflow/test/mocks/locations.ts @@ -24,8 +24,7 @@ export const office: SavedLocation = { status: 'active', mode: 'instance', partOf: { - reference: - 'Location/0f7684aa-8c65-4901-8318-bf1e22c247cb' as `Location/${UUID}` + reference: 'Location/0f7684aa-8c65-4901-8318-bf1e22c247cb' }, type: { coding: [ @@ -68,8 +67,7 @@ export const district: SavedLocation = { status: 'active', mode: 'instance', partOf: { - reference: - 'Location/ed6195ff-0f83-4852-832e-dc9db07151ff' as `Location/${UUID}` + reference: 'Location/ed6195ff-0f83-4852-832e-dc9db07151ff' }, type: { coding: [ @@ -113,7 +111,7 @@ export const state: SavedLocation = { status: 'active', mode: 'instance', partOf: { - reference: 'Location/0' as `Location/${UUID}` + reference: 'Location/0' }, type: { coding: [ diff --git a/packages/workflow/test/mocks/practitionerRole.ts b/packages/workflow/test/mocks/practitionerRole.ts index adb0881fea4..6db9533a502 100644 --- a/packages/workflow/test/mocks/practitionerRole.ts +++ b/packages/workflow/test/mocks/practitionerRole.ts @@ -47,8 +47,7 @@ export const practitionerRoleBundle: SavedBundle = { ], location: [ { - reference: - 'Location/ce73938d-a188-4a78-9d19-35dfd4ca6957' as `Location/${UUID}` + reference: 'Location/ce73938d-a188-4a78-9d19-35dfd4ca6957' } ], meta: { diff --git a/packages/workflow/test/mocks/records/archive.ts b/packages/workflow/test/mocks/records/archive.ts index 0f35e10a188..632aa960176 100644 --- a/packages/workflow/test/mocks/records/archive.ts +++ b/packages/workflow/test/mocks/records/archive.ts @@ -65,15 +65,13 @@ export const ARCHIVED_BIRTH_RECORD: SavedBundle< { url: 'http://opencrvs.org/specs/extension/regLastUser', valueReference: { - reference: - 'Practitioner/8c3ce648-5a04-4e19-8ffb-5b98019ef100' as `Practitioner/${UUID}` + reference: 'Practitioner/8c3ce648-5a04-4e19-8ffb-5b98019ef100' } }, { url: 'http://opencrvs.org/specs/extension/regLastOffice', valueReference: { - reference: - 'Location/7d9f973f-f606-42f8-a92e-58953f0576ba' as `Location/${UUID}` + reference: 'Location/7d9f973f-f606-42f8-a92e-58953f0576ba' } } ], @@ -106,8 +104,7 @@ export const ARCHIVED_BIRTH_RECORD: SavedBundle< ] }, focus: { - reference: - 'Composition/ef1bd844-a72b-42c3-b12b-13cb2a7c157c' as `Composition/${UUID}` + reference: 'Composition/ef1bd844-a72b-42c3-b12b-13cb2a7c157c' }, meta: { lastUpdated: '2023-12-21T13:04:28.938+00:00', @@ -132,14 +129,12 @@ export const ARCHIVED_BIRTH_RECORD: SavedBundle< ] }, focus: { - reference: - 'Composition/ef1bd844-a72b-42c3-b12b-13cb2a7c157c' as `Composition/${UUID}` + reference: 'Composition/ef1bd844-a72b-42c3-b12b-13cb2a7c157c' }, id: '529a2252-597f-4651-9c53-fb0b68403247' as UUID, requester: { agent: { - reference: - 'Practitioner/8c3ce648-5a04-4e19-8ffb-5b98019ef100' as `Practitioner/${UUID}` + reference: 'Practitioner/8c3ce648-5a04-4e19-8ffb-5b98019ef100' } }, identifier: [ @@ -160,15 +155,13 @@ export const ARCHIVED_BIRTH_RECORD: SavedBundle< { url: 'http://opencrvs.org/specs/extension/regLastUser', valueReference: { - reference: - 'Practitioner/8c3ce648-5a04-4e19-8ffb-5b98019ef100' as `Practitioner/${UUID}` + reference: 'Practitioner/8c3ce648-5a04-4e19-8ffb-5b98019ef100' } }, { url: 'http://opencrvs.org/specs/extension/regLastOffice', valueReference: { - reference: - 'Location/7d9f973f-f606-42f8-a92e-58953f0576ba' as `Location/${UUID}` + reference: 'Location/7d9f973f-f606-42f8-a92e-58953f0576ba' } } ], diff --git a/packages/workflow/test/mocks/records/certify.ts b/packages/workflow/test/mocks/records/certify.ts index e0711989151..fa1e804431d 100644 --- a/packages/workflow/test/mocks/records/certify.ts +++ b/packages/workflow/test/mocks/records/certify.ts @@ -405,8 +405,7 @@ export const CERTIFIED_BIRTH_RECORD: SavedBundle< { url: 'http://opencrvs.org/specs/extension/part-of', valueReference: { - reference: - 'Location/fe107046-f90b-4c10-a165-827b0c5c8d79' as `Location/${UUID}` + reference: 'Location/fe107046-f90b-4c10-a165-827b0c5c8d79' } } ] @@ -432,8 +431,7 @@ export const CERTIFIED_BIRTH_RECORD: SavedBundle< { url: 'http://opencrvs.org/specs/extension/collector', valueReference: { - reference: - 'RelatedPerson/219a94d9-92cf-4b7d-a082-368736c4eff5' as `RelatedPerson/${UUID}` + reference: 'RelatedPerson/219a94d9-92cf-4b7d-a082-368736c4eff5' } }, { @@ -481,14 +479,12 @@ export const CERTIFIED_BIRTH_RECORD: SavedBundle< ] }, focus: { - reference: - 'Composition/9d377df7-8e18-46ce-b7c2-99393ddf3410' as `Composition/${UUID}` + reference: 'Composition/9d377df7-8e18-46ce-b7c2-99393ddf3410' }, id: '8c80cb66-6068-4ae8-97cb-bb65b75788b9' as UUID, requester: { agent: { - reference: - 'Practitioner/e46e1ed0-3869-48fe-8c7b-0859647649a7' as `Practitioner/${UUID}` + reference: 'Practitioner/e46e1ed0-3869-48fe-8c7b-0859647649a7' } }, identifier: [ @@ -513,15 +509,13 @@ export const CERTIFIED_BIRTH_RECORD: SavedBundle< { url: 'http://opencrvs.org/specs/extension/regLastUser', valueReference: { - reference: - 'Practitioner/e46e1ed0-3869-48fe-8c7b-0859647649a7' as `Practitioner/${UUID}` + reference: 'Practitioner/e46e1ed0-3869-48fe-8c7b-0859647649a7' } }, { url: 'http://opencrvs.org/specs/extension/regLastOffice', valueReference: { - reference: - 'Location/4a9f7b1a-01b9-4ab5-977b-8942b2c20273' as `Location/${UUID}` + reference: 'Location/4a9f7b1a-01b9-4ab5-977b-8942b2c20273' } } ], @@ -586,8 +580,7 @@ export const CERTIFIED_BIRTH_RECORD: SavedBundle< status: 'active', mode: 'instance', partOf: { - reference: - 'Location/fe107046-f90b-4c10-a165-827b0c5c8d79' as `Location/${UUID}` + reference: 'Location/fe107046-f90b-4c10-a165-827b0c5c8d79' }, type: { coding: [ @@ -633,8 +626,7 @@ export const CERTIFIED_BIRTH_RECORD: SavedBundle< status: 'active', mode: 'instance', partOf: { - reference: - 'Location/e452aebe-5ce1-43dd-b2cd-d5628ff2b706' as `Location/${UUID}` + reference: 'Location/e452aebe-5ce1-43dd-b2cd-d5628ff2b706' }, type: { coding: [ @@ -676,8 +668,7 @@ export const CERTIFIED_BIRTH_RECORD: SavedBundle< status: 'active', mode: 'instance', partOf: { - reference: - 'Location/fe107046-f90b-4c10-a165-827b0c5c8d79' as `Location/${UUID}` + reference: 'Location/fe107046-f90b-4c10-a165-827b0c5c8d79' }, type: { coding: [ @@ -755,8 +746,7 @@ export const CERTIFIED_BIRTH_RECORD: SavedBundle< ], location: [ { - reference: - 'Location/4a9f7b1a-01b9-4ab5-977b-8942b2c20273' as `Location/${UUID}` + reference: 'Location/4a9f7b1a-01b9-4ab5-977b-8942b2c20273' } ], meta: { @@ -787,7 +777,7 @@ export const CERTIFIED_BIRTH_RECORD: SavedBundle< status: 'active', mode: 'instance', partOf: { - reference: 'Location/0' as `Location/${UUID}` + reference: 'Location/0' }, type: { coding: [ diff --git a/packages/workflow/test/mocks/records/readyForReview.ts b/packages/workflow/test/mocks/records/readyForReview.ts index 61c73f285d9..2324d9c0f41 100644 --- a/packages/workflow/test/mocks/records/readyForReview.ts +++ b/packages/workflow/test/mocks/records/readyForReview.ts @@ -338,8 +338,7 @@ export const READY_FOR_REVIEW_BIRTH_RECORD: SavedBundle< { url: 'http://opencrvs.org/specs/extension/part-of', valueReference: { - reference: - 'Location/0f7684aa-8c65-4901-8318-bf1e22c247cb' as `Location/${UUID}` + reference: 'Location/0f7684aa-8c65-4901-8318-bf1e22c247cb' } } ] @@ -373,15 +372,13 @@ export const READY_FOR_REVIEW_BIRTH_RECORD: SavedBundle< { url: 'http://opencrvs.org/specs/extension/regLastUser', valueReference: { - reference: - 'Practitioner/4651d1cc-6072-4e34-bf20-b583f421a9f1' as `Practitioner/${UUID}` + reference: 'Practitioner/4651d1cc-6072-4e34-bf20-b583f421a9f1' } }, { url: 'http://opencrvs.org/specs/extension/regLastOffice', valueReference: { - reference: - 'Location/ce73938d-a188-4a78-9d19-35dfd4ca6957' as `Location/${UUID}` + reference: 'Location/ce73938d-a188-4a78-9d19-35dfd4ca6957' } } ], @@ -414,8 +411,7 @@ export const READY_FOR_REVIEW_BIRTH_RECORD: SavedBundle< ] }, focus: { - reference: - 'Composition/c8b8e843-c5e0-49b5-96d9-a702ddb46454' as `Composition/${UUID}` + reference: 'Composition/c8b8e843-c5e0-49b5-96d9-a702ddb46454' }, meta: { lastUpdated: '2023-11-30T12:36:27.277+00:00', @@ -475,8 +471,7 @@ export const READY_FOR_REVIEW_BIRTH_RECORD: SavedBundle< status: 'active', mode: 'instance', partOf: { - reference: - 'Location/ed6195ff-0f83-4852-832e-dc9db07151ff' as `Location/${UUID}` + reference: 'Location/ed6195ff-0f83-4852-832e-dc9db07151ff' }, type: { coding: [ @@ -518,8 +513,7 @@ export const READY_FOR_REVIEW_BIRTH_RECORD: SavedBundle< status: 'active', mode: 'instance', partOf: { - reference: - 'Location/0f7684aa-8c65-4901-8318-bf1e22c247cb' as `Location/${UUID}` + reference: 'Location/0f7684aa-8c65-4901-8318-bf1e22c247cb' }, type: { coding: [ @@ -560,8 +554,7 @@ export const READY_FOR_REVIEW_BIRTH_RECORD: SavedBundle< status: 'active', mode: 'instance', partOf: { - reference: - 'Location/af050fc6-5866-455a-9cd2-6437e34a3fbe' as `Location/${UUID}` + reference: 'Location/af050fc6-5866-455a-9cd2-6437e34a3fbe' }, type: { coding: [ @@ -614,8 +607,7 @@ export const READY_FOR_REVIEW_BIRTH_RECORD: SavedBundle< ], location: [ { - reference: - 'Location/ce73938d-a188-4a78-9d19-35dfd4ca6957' as `Location/${UUID}` + reference: 'Location/ce73938d-a188-4a78-9d19-35dfd4ca6957' } ], meta: { @@ -646,7 +638,7 @@ export const READY_FOR_REVIEW_BIRTH_RECORD: SavedBundle< status: 'active', mode: 'instance', partOf: { - reference: 'Location/0' as `Location/${UUID}` + reference: 'Location/0' }, type: { coding: [ diff --git a/packages/workflow/test/mocks/records/register.ts b/packages/workflow/test/mocks/records/register.ts index 2f3aff1ea60..5d7eeb50893 100644 --- a/packages/workflow/test/mocks/records/register.ts +++ b/packages/workflow/test/mocks/records/register.ts @@ -365,8 +365,7 @@ export const REGISTERED_BIRTH_RECORD: SavedBundle< { url: 'http://opencrvs.org/specs/extension/part-of', valueReference: { - reference: - 'Location/c535b9a2-da47-41d0-b0ac-5891e31eeb9f' as `Location/${UUID}` + reference: 'Location/c535b9a2-da47-41d0-b0ac-5891e31eeb9f' } } ] @@ -415,8 +414,7 @@ export const REGISTERED_BIRTH_RECORD: SavedBundle< ] }, focus: { - reference: - 'Composition/7a790b68-9433-47b8-b595-66aae80d044a' as `Composition/${UUID}` + reference: 'Composition/7a790b68-9433-47b8-b595-66aae80d044a' }, id: 'df49e854-25b3-46b0-b6ea-e2f7f82ea297' as UUID, requester: { @@ -450,15 +448,13 @@ export const REGISTERED_BIRTH_RECORD: SavedBundle< { url: 'http://opencrvs.org/specs/extension/regLastUser', valueReference: { - reference: - 'Practitioner/1a3cf855-1132-427f-b125-93c03d79b57f' as `Practitioner/${UUID}` + reference: 'Practitioner/1a3cf855-1132-427f-b125-93c03d79b57f' } }, { url: 'http://opencrvs.org/specs/extension/regLastOffice', valueReference: { - reference: - 'Location/0fad590a-41e4-4b82-a9ab-e8f32c2e7e84' as `Location/${UUID}` + reference: 'Location/0fad590a-41e4-4b82-a9ab-e8f32c2e7e84' } } ], @@ -523,8 +519,7 @@ export const REGISTERED_BIRTH_RECORD: SavedBundle< status: 'active', mode: 'instance', partOf: { - reference: - 'Location/c535b9a2-da47-41d0-b0ac-5891e31eeb9f' as `Location/${UUID}` + reference: 'Location/c535b9a2-da47-41d0-b0ac-5891e31eeb9f' }, type: { coding: [ @@ -570,8 +565,7 @@ export const REGISTERED_BIRTH_RECORD: SavedBundle< status: 'active', mode: 'instance', partOf: { - reference: - 'Location/3fba5456-91e9-4a36-951d-d433173203e8' as `Location/${UUID}` + reference: 'Location/3fba5456-91e9-4a36-951d-d433173203e8' }, type: { coding: [ @@ -641,8 +635,7 @@ export const REGISTERED_BIRTH_RECORD: SavedBundle< status: 'active', mode: 'instance', partOf: { - reference: - 'Location/c535b9a2-da47-41d0-b0ac-5891e31eeb9f' as `Location/${UUID}` + reference: 'Location/c535b9a2-da47-41d0-b0ac-5891e31eeb9f' }, type: { coding: [ @@ -695,8 +688,7 @@ export const REGISTERED_BIRTH_RECORD: SavedBundle< ], location: [ { - reference: - 'Location/0fad590a-41e4-4b82-a9ab-e8f32c2e7e84' as `Location/${UUID}` + reference: 'Location/0fad590a-41e4-4b82-a9ab-e8f32c2e7e84' } ], meta: { @@ -727,7 +719,7 @@ export const REGISTERED_BIRTH_RECORD: SavedBundle< status: 'active', mode: 'instance', partOf: { - reference: 'Location/0' as `Location/${UUID}` + reference: 'Location/0' }, type: { coding: [ diff --git a/packages/workflow/tsconfig.json b/packages/workflow/tsconfig.json index ceef8c93344..19bc08df75f 100644 --- a/packages/workflow/tsconfig.json +++ b/packages/workflow/tsconfig.json @@ -3,10 +3,10 @@ "baseUrl": "./src", "paths": { "@test/*": ["../test/*"], - "@workflow/*": ["./*"] + "@workflow/*": ["./*"], }, "target": "es6", - "module": "node16", + "module": "commonjs", "outDir": "build/dist", "sourceMap": true, "moduleResolution": "node16", diff --git a/yarn.lock b/yarn.lock index ee0a33fa1d8..7921d4f2588 100644 --- a/yarn.lock +++ b/yarn.lock @@ -730,23 +730,6 @@ "@babel/highlight" "^7.24.6" picocolors "^1.0.0" -"@babel/code-frame@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.25.9.tgz#895b6c7e04a7271a0cbfd575d2e8131751914cc7" - integrity sha512-z88xeGxnzehn2sqZ8UdGQEvYErF1odv2CftxInpSYJt6uHuPe9YjahKZITGs3l5LeI9d2ROG+obuDAoSlqbNfQ== - dependencies: - "@babel/highlight" "^7.25.9" - picocolors "^1.0.0" - -"@babel/code-frame@^7.26.0": - version "7.26.2" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.26.2.tgz#4b5fab97d33338eff916235055f0ebc21e573a85" - integrity sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ== - dependencies: - "@babel/helper-validator-identifier" "^7.25.9" - js-tokens "^4.0.0" - picocolors "^1.0.0" - "@babel/compat-data@^7.20.5", "@babel/compat-data@^7.22.6", "@babel/compat-data@^7.22.9", "@babel/compat-data@^7.23.2": version "7.23.2" resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.23.2.tgz" @@ -772,33 +755,7 @@ resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.25.4.tgz#7d2a80ce229890edcf4cc259d4d696cb4dae2fcb" integrity sha512-+LGRog6RAsCJrrrg/IO6LGmpphNe5DiK30dGjCoxxeGv49B10/3XYGxPsAwrDlMFcFEvdAUavDT8r9k/hSyQqQ== -"@babel/compat-data@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.25.9.tgz#24b01c5db6a3ebf85661b4fb4a946a9bccc72ac8" - integrity sha512-yD+hEuJ/+wAJ4Ox2/rpNv5HIuPG82x3ZlQvYVn8iYCprdxzE7P1udpGF1jyjQVBU4dgznN+k2h103vxZ7NdPyw== - -"@babel/core@^7.11.6", "@babel/core@^7.20.12", "@babel/core@^7.23.0", "@babel/core@^7.23.2": - version "7.25.2" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.25.2.tgz#ed8eec275118d7613e77a352894cd12ded8eba77" - integrity sha512-BBt3opiCOxUr9euZ5/ro/Xv8/V7yJ5bjYMqG/C1YAo8MIKAnumZalCN+msbci3Pigy4lIQfPUpfMM27HMGaYEA== - dependencies: - "@ampproject/remapping" "^2.2.0" - "@babel/code-frame" "^7.24.7" - "@babel/generator" "^7.25.0" - "@babel/helper-compilation-targets" "^7.25.2" - "@babel/helper-module-transforms" "^7.25.2" - "@babel/helpers" "^7.25.0" - "@babel/parser" "^7.25.0" - "@babel/template" "^7.25.0" - "@babel/traverse" "^7.25.2" - "@babel/types" "^7.25.2" - convert-source-map "^2.0.0" - debug "^4.1.0" - gensync "^1.0.0-beta.2" - json5 "^2.2.3" - semver "^6.3.1" - -"@babel/core@^7.12.3", "@babel/core@^7.14.0", "@babel/core@^7.14.3", "@babel/core@^7.18.9", "@babel/core@^7.19.6", "@babel/core@^7.22.9": +"@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.14.0", "@babel/core@^7.14.3", "@babel/core@^7.18.9", "@babel/core@^7.19.6", "@babel/core@^7.22.9": version "7.23.2" resolved "https://registry.npmjs.org/@babel/core/-/core-7.23.2.tgz" integrity sha512-n7s51eWdaWZ3vGT2tD4T7J6eJs3QoBXydv7vkUM06Bf1cbVD2Kc2UrkzhiQwobfV7NwOnQXYL7UBJ5VPU+RGoQ== @@ -819,42 +776,21 @@ json5 "^2.2.3" semver "^6.3.1" -"@babel/core@^7.17.7": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.25.9.tgz#855a4cddcec4158f3f7afadacdab2a7de8af7434" - integrity sha512-WYvQviPw+Qyib0v92AwNIrdLISTp7RfDkM7bPqBvpbnhY4wq8HvHBZREVdYDXk98C8BkOIVnHAY3yvj7AVISxQ== - dependencies: - "@ampproject/remapping" "^2.2.0" - "@babel/code-frame" "^7.25.9" - "@babel/generator" "^7.25.9" - "@babel/helper-compilation-targets" "^7.25.9" - "@babel/helper-module-transforms" "^7.25.9" - "@babel/helpers" "^7.25.9" - "@babel/parser" "^7.25.9" - "@babel/template" "^7.25.9" - "@babel/traverse" "^7.25.9" - "@babel/types" "^7.25.9" - convert-source-map "^2.0.0" - debug "^4.1.0" - gensync "^1.0.0-beta.2" - json5 "^2.2.3" - semver "^6.3.1" - -"@babel/core@^7.23.9": - version "7.26.0" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.26.0.tgz#d78b6023cc8f3114ccf049eb219613f74a747b40" - integrity sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg== +"@babel/core@^7.11.6", "@babel/core@^7.20.12", "@babel/core@^7.23.0", "@babel/core@^7.23.2": + version "7.25.2" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.25.2.tgz#ed8eec275118d7613e77a352894cd12ded8eba77" + integrity sha512-BBt3opiCOxUr9euZ5/ro/Xv8/V7yJ5bjYMqG/C1YAo8MIKAnumZalCN+msbci3Pigy4lIQfPUpfMM27HMGaYEA== dependencies: "@ampproject/remapping" "^2.2.0" - "@babel/code-frame" "^7.26.0" - "@babel/generator" "^7.26.0" - "@babel/helper-compilation-targets" "^7.25.9" - "@babel/helper-module-transforms" "^7.26.0" - "@babel/helpers" "^7.26.0" - "@babel/parser" "^7.26.0" - "@babel/template" "^7.25.9" - "@babel/traverse" "^7.25.9" - "@babel/types" "^7.26.0" + "@babel/code-frame" "^7.24.7" + "@babel/generator" "^7.25.0" + "@babel/helper-compilation-targets" "^7.25.2" + "@babel/helper-module-transforms" "^7.25.2" + "@babel/helpers" "^7.25.0" + "@babel/parser" "^7.25.0" + "@babel/template" "^7.25.0" + "@babel/traverse" "^7.25.2" + "@babel/types" "^7.25.2" convert-source-map "^2.0.0" debug "^4.1.0" gensync "^1.0.0-beta.2" @@ -903,6 +839,27 @@ json5 "^2.2.3" semver "^6.3.1" +"@babel/core@^7.7.2", "@babel/core@^7.8.0": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.24.7.tgz#b676450141e0b52a3d43bc91da86aa608f950ac4" + integrity sha512-nykK+LEK86ahTkX/3TgauT0ikKoNCfKHEaZYTUVupJdTLzGNvrblu4u6fa7DhZONAltdf8e662t/abY8idrd/g== + dependencies: + "@ampproject/remapping" "^2.2.0" + "@babel/code-frame" "^7.24.7" + "@babel/generator" "^7.24.7" + "@babel/helper-compilation-targets" "^7.24.7" + "@babel/helper-module-transforms" "^7.24.7" + "@babel/helpers" "^7.24.7" + "@babel/parser" "^7.24.7" + "@babel/template" "^7.24.7" + "@babel/traverse" "^7.24.7" + "@babel/types" "^7.24.7" + convert-source-map "^2.0.0" + debug "^4.1.0" + gensync "^1.0.0-beta.2" + json5 "^2.2.3" + semver "^6.3.1" + "@babel/eslint-parser@^7.14.3": version "7.22.15" resolved "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.22.15.tgz" @@ -962,27 +919,6 @@ "@jridgewell/trace-mapping" "^0.3.25" jsesc "^2.5.1" -"@babel/generator@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.25.9.tgz#c7e828ebe0c2baba103b712924699c9e8a6e32f0" - integrity sha512-omlUGkr5EaoIJrhLf9CJ0TvjBRpd9+AXRG//0GEQ9THSo8wPiTlbpy1/Ow8ZTrbXpjd9FHXfbFQx32I04ht0FA== - dependencies: - "@babel/types" "^7.25.9" - "@jridgewell/gen-mapping" "^0.3.5" - "@jridgewell/trace-mapping" "^0.3.25" - jsesc "^3.0.2" - -"@babel/generator@^7.26.0": - version "7.26.2" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.26.2.tgz#87b75813bec87916210e5e01939a4c823d6bb74f" - integrity sha512-zevQbhbau95nkoxSq3f/DC/SC+EEOUZd3DYqfSkMhY2/wfSeaHV1Ew4vk8e+x8lja31IbyuUa2uQ3JONqKbysw== - dependencies: - "@babel/parser" "^7.26.2" - "@babel/types" "^7.26.0" - "@jridgewell/gen-mapping" "^0.3.5" - "@jridgewell/trace-mapping" "^0.3.25" - jsesc "^3.0.2" - "@babel/helper-annotate-as-pure@^7.22.5": version "7.22.5" resolved "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz" @@ -1067,17 +1003,6 @@ lru-cache "^5.1.1" semver "^6.3.1" -"@babel/helper-compilation-targets@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.9.tgz#55af025ce365be3cdc0c1c1e56c6af617ce88875" - integrity sha512-j9Db8Suy6yV/VHa4qzrj9yZfZxhLWQdVnRlXxmKLYlhWUVB1sB2G5sxuWYXk/whHD9iW76PmNzxZ4UCnTQTVEQ== - dependencies: - "@babel/compat-data" "^7.25.9" - "@babel/helper-validator-option" "^7.25.9" - browserslist "^4.24.0" - lru-cache "^5.1.1" - semver "^6.3.1" - "@babel/helper-create-class-features-plugin@^7.18.6", "@babel/helper-create-class-features-plugin@^7.22.11", "@babel/helper-create-class-features-plugin@^7.22.5": version "7.22.15" resolved "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.22.15.tgz" @@ -1252,14 +1177,6 @@ "@babel/traverse" "^7.24.7" "@babel/types" "^7.24.7" -"@babel/helper-module-imports@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz#e7f8d20602ebdbf9ebbea0a0751fb0f2a4141715" - integrity sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw== - dependencies: - "@babel/traverse" "^7.25.9" - "@babel/types" "^7.25.9" - "@babel/helper-module-transforms@^7.22.5", "@babel/helper-module-transforms@^7.23.0": version "7.23.0" resolved "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.23.0.tgz" @@ -1314,25 +1231,6 @@ "@babel/helper-validator-identifier" "^7.24.7" "@babel/traverse" "^7.25.2" -"@babel/helper-module-transforms@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.25.9.tgz#12e4fb2969197ef6d78ea8a2f24375ce85b425fb" - integrity sha512-TvLZY/F3+GvdRYFZFyxMvnsKi+4oJdgZzU3BoGN9Uc2d9C6zfNwJcKKhjqLAhK8i46mv93jsO74fDh3ih6rpHA== - dependencies: - "@babel/helper-module-imports" "^7.25.9" - "@babel/helper-simple-access" "^7.25.9" - "@babel/helper-validator-identifier" "^7.25.9" - "@babel/traverse" "^7.25.9" - -"@babel/helper-module-transforms@^7.26.0": - version "7.26.0" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz#8ce54ec9d592695e58d84cd884b7b5c6a2fdeeae" - integrity sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw== - dependencies: - "@babel/helper-module-imports" "^7.25.9" - "@babel/helper-validator-identifier" "^7.25.9" - "@babel/traverse" "^7.25.9" - "@babel/helper-optimise-call-expression@^7.22.5": version "7.22.5" resolved "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.22.5.tgz" @@ -1367,11 +1265,6 @@ resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.8.tgz#94ee67e8ec0e5d44ea7baeb51e571bd26af07878" integrity sha512-FFWx5142D8h2Mgr/iPVGH5G7w6jDn4jUSpZTyDnQO0Yn7Ks2Kuz6Pci8H6MPCoUJegd/UZQ3tAvfLCxQSnWWwg== -"@babel/helper-plugin-utils@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.9.tgz#9cbdd63a9443a2c92a725cca7ebca12cc8dd9f46" - integrity sha512-kSMlyUVdWe25rEsRGviIgOWnoT/nfABVWlqt9N19/dIPWViAOW2s9wznP5tURbs/IDuNk4gPy3YdYRgH3uxhBw== - "@babel/helper-remap-async-to-generator@^7.22.20", "@babel/helper-remap-async-to-generator@^7.22.5": version "7.22.20" resolved "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.22.20.tgz" @@ -1437,14 +1330,6 @@ "@babel/traverse" "^7.24.7" "@babel/types" "^7.24.7" -"@babel/helper-simple-access@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.25.9.tgz#6d51783299884a2c74618d6ef0f86820ec2e7739" - integrity sha512-c6WHXuiaRsJTyHYLJV75t9IqsmTbItYfdj99PnzYGQZkYKvan5/2jKJ7gu31J3/BJ/A18grImSPModuyG/Eo0Q== - dependencies: - "@babel/traverse" "^7.25.9" - "@babel/types" "^7.25.9" - "@babel/helper-skip-transparent-expression-wrappers@^7.22.5": version "7.22.5" resolved "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.22.5.tgz" @@ -1513,11 +1398,6 @@ resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz#5b3329c9a58803d5df425e5785865881a81ca48d" integrity sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ== -"@babel/helper-string-parser@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz#1aabb72ee72ed35789b4bbcad3ca2862ce614e8c" - integrity sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA== - "@babel/helper-validator-identifier@^7.22.20": version "7.22.20" resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz" @@ -1538,11 +1418,6 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz#75b889cfaf9e35c2aaf42cf0d72c8e91719251db" integrity sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w== -"@babel/helper-validator-identifier@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz#24b64e2c3ec7cd3b3c547729b8d16871f22cbdc7" - integrity sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ== - "@babel/helper-validator-option@^7.22.15": version "7.22.15" resolved "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.15.tgz" @@ -1568,11 +1443,6 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.24.8.tgz#3725cdeea8b480e86d34df15304806a06975e33d" integrity sha512-xb8t9tD1MHLungh/AIoWYN+gVHaB9kwlu8gffXGSt3FFEIT7RjS+xWbc2vUD1UTZdIpKj/ab3rdqJ7ufngyi2Q== -"@babel/helper-validator-option@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz#86e45bd8a49ab7e03f276577f96179653d41da72" - integrity sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw== - "@babel/helper-wrap-function@^7.22.20": version "7.22.20" resolved "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.22.20.tgz" @@ -1617,6 +1487,14 @@ "@babel/template" "^7.24.6" "@babel/types" "^7.24.6" +"@babel/helpers@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.24.7.tgz#aa2ccda29f62185acb5d42fb4a3a1b1082107416" + integrity sha512-NlmJJtvcw72yRJRcnCmGvSi+3jDEg8qFu3z0AFoymmzLx5ERVWyzd9kVXr7Th9/8yIJi2Zc6av4Tqz3wFs8QWg== + dependencies: + "@babel/template" "^7.24.7" + "@babel/types" "^7.24.7" + "@babel/helpers@^7.25.0": version "7.25.6" resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.25.6.tgz#57ee60141829ba2e102f30711ffe3afab357cc60" @@ -1625,22 +1503,6 @@ "@babel/template" "^7.25.0" "@babel/types" "^7.25.6" -"@babel/helpers@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.25.9.tgz#9e26aa6fbefdbca4f8c8a1d66dc6f1c00ddadb0a" - integrity sha512-oKWp3+usOJSzDZOucZUAMayhPz/xVjzymyDzUN8dk0Wd3RWMlGLXi07UCQ/CgQVb8LvXx3XBajJH4XGgkt7H7g== - dependencies: - "@babel/template" "^7.25.9" - "@babel/types" "^7.25.9" - -"@babel/helpers@^7.26.0": - version "7.26.0" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.26.0.tgz#30e621f1eba5aa45fe6f4868d2e9154d884119a4" - integrity sha512-tbhNuIxNcVb21pInl3ZSjksLCvgdZy9KwJ8brv993QtIVKJBBkYXz4q4ZbAv31GdnC+R90np23L5FbEBlthAEw== - dependencies: - "@babel/template" "^7.25.9" - "@babel/types" "^7.26.0" - "@babel/highlight@^7.10.4", "@babel/highlight@^7.22.13": version "7.22.20" resolved "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz" @@ -1680,28 +1542,11 @@ js-tokens "^4.0.0" picocolors "^1.0.0" -"@babel/highlight@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.25.9.tgz#8141ce68fc73757946f983b343f1231f4691acc6" - integrity sha512-llL88JShoCsth8fF8R4SJnIn+WLvR6ccFxu1H3FlMhDontdcmZWf2HgIZ7AIqV3Xcck1idlohrN4EUBQz6klbw== - dependencies: - "@babel/helper-validator-identifier" "^7.25.9" - chalk "^2.4.2" - js-tokens "^4.0.0" - picocolors "^1.0.0" - "@babel/parser@^7.1.0", "@babel/parser@^7.14.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.8", "@babel/parser@^7.20.7", "@babel/parser@^7.22.15", "@babel/parser@^7.23.0", "@babel/parser@^7.8.3", "@babel/parser@^7.8.4": version "7.23.0" resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz" integrity sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw== -"@babel/parser@^7.23.9", "@babel/parser@^7.25.9", "@babel/parser@^7.26.0", "@babel/parser@^7.26.2": - version "7.26.2" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.26.2.tgz#fd7b6f487cfea09889557ef5d4eeb9ff9a5abd11" - integrity sha512-DWMCZH9WA4Maitz2q21SRKHo9QXZxkDsbNZoVD62gusNtNBBqDg9i7uOhASfTfIGNzW+O+r7+jAlM8dwphcJKQ== - dependencies: - "@babel/types" "^7.26.0" - "@babel/parser@^7.24.0": version "7.24.4" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.24.4.tgz#234487a110d89ad5a3ed4a8a566c36b9453e8c88" @@ -1913,13 +1758,6 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-syntax-jsx@^7.16.7", "@babel/plugin-syntax-jsx@^7.7.2": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.25.9.tgz#a34313a178ea56f1951599b929c1ceacee719290" - integrity sha512-ld6oezHQMZsZfp6pWtbjaNDF2tiiCYYDqQszHt5VV437lewP9aSi2Of99CK0D0XB21k7FLgnLcmQKyKzynfeAA== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - "@babel/plugin-syntax-jsx@^7.24.7": version "7.24.7" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.24.7.tgz#39a1fa4a7e3d3d7f34e2acc6be585b718d30e02d" @@ -1983,13 +1821,6 @@ dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-syntax-typescript@^7.16.7": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.25.9.tgz#67dda2b74da43727cf21d46cf9afef23f4365399" - integrity sha512-hjMgRy5hb8uJJjUcdWunWVcoi9bGpJp8p5Ol1229PoN6aytsLwNMgmdftO23wnCLMfVmTwZDWMPNq/D1SY60JQ== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - "@babel/plugin-syntax-typescript@^7.24.7": version "7.25.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.25.4.tgz#04db9ce5a9043d9c635e75ae7969a2cd50ca97ff" @@ -3101,13 +2932,6 @@ dependencies: regenerator-runtime "^0.14.0" -"@babel/runtime@^7.12.5": - version "7.26.0" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.26.0.tgz#8600c2f595f277c60815256418b85356a65173c1" - integrity sha512-FDSOghenHTiToteC/QRlv2q3DhPZ/oOXTBoirfWNx1Cx3TMVcGWQtMMmQcSvb/JjpNeGzx8Pq/b4fKEJuWm1sw== - dependencies: - regenerator-runtime "^0.14.0" - "@babel/runtime@^7.13.10": version "7.25.6" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.25.6.tgz#9afc3289f7184d8d7f98b099884c26317b9264d2" @@ -3160,15 +2984,6 @@ "@babel/parser" "^7.25.0" "@babel/types" "^7.25.0" -"@babel/template@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.25.9.tgz#ecb62d81a8a6f5dc5fe8abfc3901fc52ddf15016" - integrity sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg== - dependencies: - "@babel/code-frame" "^7.25.9" - "@babel/parser" "^7.25.9" - "@babel/types" "^7.25.9" - "@babel/traverse@^7.14.0", "@babel/traverse@^7.16.8", "@babel/traverse@^7.18.9", "@babel/traverse@^7.23.2", "@babel/traverse@^7.4.5", "@babel/traverse@^7.8.3": version "7.23.2" resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz" @@ -3217,7 +3032,7 @@ debug "^4.3.1" globals "^11.1.0" -"@babel/traverse@^7.24.7": +"@babel/traverse@^7.24.7", "@babel/traverse@^7.7.2": version "7.24.7" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.24.7.tgz#de2b900163fa741721ba382163fe46a936c40cf5" integrity sha512-yb65Ed5S/QAcewNPh0nZczy9JdYXkkAbIsEo+P7BE7yO3txAY30Y/oPa3QkQ5It3xVG2kpKMg9MsdxZaO31uKA== @@ -3246,19 +3061,6 @@ debug "^4.3.1" globals "^11.1.0" -"@babel/traverse@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.25.9.tgz#a50f8fe49e7f69f53de5bea7e413cd35c5e13c84" - integrity sha512-ZCuvfwOwlz/bawvAuvcj8rrithP2/N55Tzz342AkTvq4qaWbGfmCk/tKhNaV2cthijKrPAA8SRJV5WWe7IBMJw== - dependencies: - "@babel/code-frame" "^7.25.9" - "@babel/generator" "^7.25.9" - "@babel/parser" "^7.25.9" - "@babel/template" "^7.25.9" - "@babel/types" "^7.25.9" - debug "^4.3.1" - globals "^11.1.0" - "@babel/types@^7.0.0", "@babel/types@^7.16.8", "@babel/types@^7.18.13", "@babel/types@^7.18.9", "@babel/types@^7.20.7", "@babel/types@^7.22.15", "@babel/types@^7.22.19", "@babel/types@^7.22.5", "@babel/types@^7.23.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": version "7.23.0" resolved "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz" @@ -3313,22 +3115,6 @@ "@babel/helper-validator-identifier" "^7.24.7" to-fast-properties "^2.0.0" -"@babel/types@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.25.9.tgz#620f35ea1f4233df529ec9a2668d2db26574deee" - integrity sha512-OwS2CM5KocvQ/k7dFJa8i5bNGJP0hXWfVCfDkqRFP1IreH1JDC7wG6eCYCi0+McbfT8OR/kNqsI0UU0xP9H6PQ== - dependencies: - "@babel/helper-string-parser" "^7.25.9" - "@babel/helper-validator-identifier" "^7.25.9" - -"@babel/types@^7.26.0": - version "7.26.0" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.26.0.tgz#deabd08d6b753bc8e0f198f8709fb575e31774ff" - integrity sha512-Z/yiTPj+lDVnF7lWeKCIJzaIkI0vYO87dMpZ4bg4TDrFe4XXLFWL1TbXU27gBP3QccxV9mZICCrnjnYlJjXHOA== - dependencies: - "@babel/helper-string-parser" "^7.25.9" - "@babel/helper-validator-identifier" "^7.25.9" - "@balena/dockerignore@^1.0.2": version "1.0.2" resolved "https://registry.npmjs.org/@balena/dockerignore/-/dockerignore-1.0.2.tgz" @@ -3857,6 +3643,14 @@ resolved "https://registry.npmjs.org/@foliojs-fork/restructure/-/restructure-2.0.2.tgz" integrity sha512-59SgoZ3EXbkfSX7b63tsou/SDGzwUEK6MuB5sKqgVK1/XE0fxmpsOb9DQI8LXW3KfGnAjImCGhhEb7uPPAUVNA== +"@formatjs/ecma402-abstract@1.11.3": + version "1.11.3" + resolved "https://registry.yarnpkg.com/@formatjs/ecma402-abstract/-/ecma402-abstract-1.11.3.tgz#f25276dfd4ef3dac90da667c3961d8aa9732e384" + integrity sha512-kP/Buv5vVFMAYLHNvvUzr0lwRTU0u2WTy44Tqwku1X3C3lJ5dKqDCYVqA8wL+Y19Bq+MwHgxqd5FZJRCIsLRyQ== + dependencies: + "@formatjs/intl-localematcher" "0.2.24" + tslib "^2.1.0" + "@formatjs/ecma402-abstract@1.11.4": version "1.11.4" resolved "https://registry.yarnpkg.com/@formatjs/ecma402-abstract/-/ecma402-abstract-1.11.4.tgz#b962dfc4ae84361f9f08fbce411b4e4340930eda" @@ -3865,14 +3659,6 @@ "@formatjs/intl-localematcher" "0.2.25" tslib "^2.1.0" -"@formatjs/ecma402-abstract@1.14.3": - version "1.14.3" - resolved "https://registry.yarnpkg.com/@formatjs/ecma402-abstract/-/ecma402-abstract-1.14.3.tgz#6428f243538a11126180d121ce8d4b2f17465738" - integrity sha512-SlsbRC/RX+/zg4AApWIFNDdkLtFbkq3LNoZWXZCE/nHVKqoIJyaoQyge/I0Y38vLxowUn9KTtXgusLD91+orbg== - dependencies: - "@formatjs/intl-localematcher" "0.2.32" - tslib "^2.4.0" - "@formatjs/fast-memoize@1.2.1": version "1.2.1" resolved "https://registry.yarnpkg.com/@formatjs/fast-memoize/-/fast-memoize-1.2.1.tgz#e6f5aee2e4fd0ca5edba6eba7668e2d855e0fc21" @@ -3880,6 +3666,15 @@ dependencies: tslib "^2.1.0" +"@formatjs/icu-messageformat-parser@2.0.18": + version "2.0.18" + resolved "https://registry.yarnpkg.com/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.0.18.tgz#b09e8f16b88e988fd125e7c5810300e8a6dd2c42" + integrity sha512-vquIzsAJJmZ5jWVH8dEgUKcbG4yu3KqtyPet+q35SW5reLOvblkfeCXTRW2TpIwNXzdVqsJBwjbTiRiSU9JxwQ== + dependencies: + "@formatjs/ecma402-abstract" "1.11.3" + "@formatjs/icu-skeleton-parser" "1.3.5" + tslib "^2.1.0" + "@formatjs/icu-messageformat-parser@2.1.0": version "2.1.0" resolved "https://registry.yarnpkg.com/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.1.0.tgz#a54293dd7f098d6a6f6a084ab08b6d54a3e8c12d" @@ -3889,22 +3684,13 @@ "@formatjs/icu-skeleton-parser" "1.3.6" tslib "^2.1.0" -"@formatjs/icu-messageformat-parser@2.3.1": - version "2.3.1" - resolved "https://registry.yarnpkg.com/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.3.1.tgz#953080ea5c053bc73bdf55d0a524a3c3c133ae6b" - integrity sha512-knF2AkAKN4Upv4oIiKY4Wd/dLH68TNMPgV/tJMu/T6FP9aQwbv8fpj7U3lkyniPaNVxvia56Gxax8MKOjtxLSQ== - dependencies: - "@formatjs/ecma402-abstract" "1.14.3" - "@formatjs/icu-skeleton-parser" "1.3.18" - tslib "^2.4.0" - -"@formatjs/icu-skeleton-parser@1.3.18": - version "1.3.18" - resolved "https://registry.yarnpkg.com/@formatjs/icu-skeleton-parser/-/icu-skeleton-parser-1.3.18.tgz#7aed3d60e718c8ad6b0e64820be44daa1e29eeeb" - integrity sha512-ND1ZkZfmLPcHjAH1sVpkpQxA+QYfOX3py3SjKWMUVGDow18gZ0WPqz3F+pJLYQMpS2LnnQ5zYR2jPVYTbRwMpg== +"@formatjs/icu-skeleton-parser@1.3.5": + version "1.3.5" + resolved "https://registry.yarnpkg.com/@formatjs/icu-skeleton-parser/-/icu-skeleton-parser-1.3.5.tgz#babc93a1c36383cf87cbb3d2f2145d26c2f7cb40" + integrity sha512-Nhyo2/6kG7ZfgeEfo02sxviOuBcvtzH6SYUharj3DLCDJH3A/4OxkKcmx/2PWGX4bc6iSieh+FA94CsKDxnZBQ== dependencies: - "@formatjs/ecma402-abstract" "1.14.3" - tslib "^2.4.0" + "@formatjs/ecma402-abstract" "1.11.3" + tslib "^2.1.0" "@formatjs/icu-skeleton-parser@1.3.6": version "1.3.6" @@ -3932,6 +3718,13 @@ "@formatjs/intl-localematcher" "0.2.25" tslib "^2.1.0" +"@formatjs/intl-localematcher@0.2.24": + version "0.2.24" + resolved "https://registry.yarnpkg.com/@formatjs/intl-localematcher/-/intl-localematcher-0.2.24.tgz#b49fd753c0f54421f26a3c1d0e9cf98a3966e78f" + integrity sha512-K/HRGo6EMnCbhpth/y3u4rW4aXkmQNqRe1L2G+Y5jNr3v0gYhvaucV8WixNju/INAMbPBlbsRBRo/nfjnoOnxQ== + dependencies: + tslib "^2.1.0" + "@formatjs/intl-localematcher@0.2.25": version "0.2.25" resolved "https://registry.yarnpkg.com/@formatjs/intl-localematcher/-/intl-localematcher-0.2.25.tgz#60892fe1b271ec35ba07a2eb018a2dd7bca6ea3a" @@ -3939,13 +3732,6 @@ dependencies: tslib "^2.1.0" -"@formatjs/intl-localematcher@0.2.32": - version "0.2.32" - resolved "https://registry.yarnpkg.com/@formatjs/intl-localematcher/-/intl-localematcher-0.2.32.tgz#00d4d307cd7d514b298e15a11a369b86c8933ec1" - integrity sha512-k/MEBstff4sttohyEpXxCmC3MqbUn9VvHGlZ8fauLzkbwXmVrEeyzS+4uhrvAk9DWU9/7otYWxyDox4nT/KVLQ== - dependencies: - tslib "^2.4.0" - "@formatjs/intl@2.2.1": version "2.2.1" resolved "https://registry.yarnpkg.com/@formatjs/intl/-/intl-2.2.1.tgz#6daf4dabed055b17f467f0aa1bc073a626bc9189" @@ -3959,18 +3745,16 @@ intl-messageformat "9.13.0" tslib "^2.1.0" -"@formatjs/ts-transformer@3.13.0": - version "3.13.0" - resolved "https://registry.yarnpkg.com/@formatjs/ts-transformer/-/ts-transformer-3.13.0.tgz#61185278fb153d61e56fabbeed6d4fc8a0ee3af5" - integrity sha512-TshsXkt2loK2GWFJFYTrlNThfCd4ubcEpokl9FWzGoR5f5e2FOxDPs69nTqw+7jodlKtx4VaTSfpNMtPvD9ZfQ== +"@formatjs/ts-transformer@3.9.2": + version "3.9.2" + resolved "https://registry.yarnpkg.com/@formatjs/ts-transformer/-/ts-transformer-3.9.2.tgz#958582b16ed9125fd904c051a9dda1ecd2474a5a" + integrity sha512-Iff+ca1ue3IOb/PDNANR6++EArwlyMpW+t6AL4MG5sordpgflsIh8BMz6nGs+/tUOjP0xioNAu/acYiQ+rW5Bw== dependencies: - "@formatjs/icu-messageformat-parser" "2.3.1" - "@types/json-stable-stringify" "^1.0.32" + "@formatjs/icu-messageformat-parser" "2.0.18" "@types/node" "14 || 16 || 17" chalk "^4.0.0" - json-stable-stringify "^1.0.1" - tslib "^2.4.0" - typescript "^4.7 || 5" + tslib "^2.1.0" + typescript "^4.5" "@graphql-codegen/add@^5.0.0", "@graphql-codegen/add@^5.0.3": version "5.0.3" @@ -5183,128 +4967,113 @@ resolved "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^29.7.0": - version "29.7.0" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.7.0.tgz#cd4822dbdb84529265c5a2bdb529a3c9cc950ffc" - integrity sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg== +"@jest/console@^27.5.1": + version "27.5.1" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.5.1.tgz#260fe7239602fe5130a94f1aa386eff54b014bba" + integrity sha512-kZ/tNpS3NXn0mlXXXPNuDZnb4c0oZ20r4K5eemM2k30ZC3G0T02nXUvyhf5YdbXWHPEJLc9qGLxEZ216MdL+Zg== dependencies: - "@jest/types" "^29.6.3" + "@jest/types" "^27.5.1" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^29.7.0" - jest-util "^29.7.0" + jest-message-util "^27.5.1" + jest-util "^27.5.1" slash "^3.0.0" -"@jest/core@^29.7.0": - version "29.7.0" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.7.0.tgz#b6cccc239f30ff36609658c5a5e2291757ce448f" - integrity sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg== +"@jest/core@^27.5.1": + version "27.5.1" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.5.1.tgz#267ac5f704e09dc52de2922cbf3af9edcd64b626" + integrity sha512-AK6/UTrvQD0Cd24NSqmIA6rKsu0tKIxfiCducZvqxYdmMisOYAsdItspT+fQDQYARPf8XgjAFZi0ogW2agH5nQ== dependencies: - "@jest/console" "^29.7.0" - "@jest/reporters" "^29.7.0" - "@jest/test-result" "^29.7.0" - "@jest/transform" "^29.7.0" - "@jest/types" "^29.6.3" + "@jest/console" "^27.5.1" + "@jest/reporters" "^27.5.1" + "@jest/test-result" "^27.5.1" + "@jest/transform" "^27.5.1" + "@jest/types" "^27.5.1" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" - ci-info "^3.2.0" + emittery "^0.8.1" exit "^0.1.2" graceful-fs "^4.2.9" - jest-changed-files "^29.7.0" - jest-config "^29.7.0" - jest-haste-map "^29.7.0" - jest-message-util "^29.7.0" - jest-regex-util "^29.6.3" - jest-resolve "^29.7.0" - jest-resolve-dependencies "^29.7.0" - jest-runner "^29.7.0" - jest-runtime "^29.7.0" - jest-snapshot "^29.7.0" - jest-util "^29.7.0" - jest-validate "^29.7.0" - jest-watcher "^29.7.0" + jest-changed-files "^27.5.1" + jest-config "^27.5.1" + jest-haste-map "^27.5.1" + jest-message-util "^27.5.1" + jest-regex-util "^27.5.1" + jest-resolve "^27.5.1" + jest-resolve-dependencies "^27.5.1" + jest-runner "^27.5.1" + jest-runtime "^27.5.1" + jest-snapshot "^27.5.1" + jest-util "^27.5.1" + jest-validate "^27.5.1" + jest-watcher "^27.5.1" micromatch "^4.0.4" - pretty-format "^29.7.0" + rimraf "^3.0.0" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^29.7.0": - version "29.7.0" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.7.0.tgz#24d61f54ff1f786f3cd4073b4b94416383baf2a7" - integrity sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw== +"@jest/environment@^27.5.1": + version "27.5.1" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.5.1.tgz#d7425820511fe7158abbecc010140c3fd3be9c74" + integrity sha512-/WQjhPJe3/ghaol/4Bq480JKXV/Rfw8nQdN7f41fM8VDHLcxKXou6QyXAh3EFr9/bVG3x74z1NWDkP87EiY8gA== dependencies: - "@jest/fake-timers" "^29.7.0" - "@jest/types" "^29.6.3" + "@jest/fake-timers" "^27.5.1" + "@jest/types" "^27.5.1" "@types/node" "*" - jest-mock "^29.7.0" - -"@jest/expect-utils@^29.7.0": - version "29.7.0" - resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.7.0.tgz#023efe5d26a8a70f21677d0a1afc0f0a44e3a1c6" - integrity sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA== - dependencies: - jest-get-type "^29.6.3" - -"@jest/expect@^29.7.0": - version "29.7.0" - resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.7.0.tgz#76a3edb0cb753b70dfbfe23283510d3d45432bf2" - integrity sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ== - dependencies: - expect "^29.7.0" - jest-snapshot "^29.7.0" + jest-mock "^27.5.1" -"@jest/fake-timers@^29.7.0": - version "29.7.0" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.7.0.tgz#fd91bf1fffb16d7d0d24a426ab1a47a49881a565" - integrity sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ== +"@jest/fake-timers@^27.5.1": + version "27.5.1" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.5.1.tgz#76979745ce0579c8a94a4678af7a748eda8ada74" + integrity sha512-/aPowoolwa07k7/oM3aASneNeBGCmGQsc3ugN4u6s4C/+s5M64MFo/+djTdiwcbQlRfFElGuDXWzaWj6QgKObQ== dependencies: - "@jest/types" "^29.6.3" - "@sinonjs/fake-timers" "^10.0.2" + "@jest/types" "^27.5.1" + "@sinonjs/fake-timers" "^8.0.1" "@types/node" "*" - jest-message-util "^29.7.0" - jest-mock "^29.7.0" - jest-util "^29.7.0" + jest-message-util "^27.5.1" + jest-mock "^27.5.1" + jest-util "^27.5.1" -"@jest/globals@^29.7.0": - version "29.7.0" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.7.0.tgz#8d9290f9ec47ff772607fa864ca1d5a2efae1d4d" - integrity sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ== +"@jest/globals@^27.5.1": + version "27.5.1" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.5.1.tgz#7ac06ce57ab966566c7963431cef458434601b2b" + integrity sha512-ZEJNB41OBQQgGzgyInAv0UUfDDj3upmHydjieSxFvTRuZElrx7tXg/uVQ5hYVEwiXs3+aMsAeEc9X7xiSKCm4Q== dependencies: - "@jest/environment" "^29.7.0" - "@jest/expect" "^29.7.0" - "@jest/types" "^29.6.3" - jest-mock "^29.7.0" + "@jest/environment" "^27.5.1" + "@jest/types" "^27.5.1" + expect "^27.5.1" -"@jest/reporters@^29.7.0": - version "29.7.0" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.7.0.tgz#04b262ecb3b8faa83b0b3d321623972393e8f4c7" - integrity sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg== +"@jest/reporters@^27.5.1": + version "27.5.1" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.5.1.tgz#ceda7be96170b03c923c37987b64015812ffec04" + integrity sha512-cPXh9hWIlVJMQkVk84aIvXuBB4uQQmFqZiacloFuGiP3ah1sbCxCosidXFDfqG8+6fO1oR2dTJTlsOy4VFmUfw== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^29.7.0" - "@jest/test-result" "^29.7.0" - "@jest/transform" "^29.7.0" - "@jest/types" "^29.6.3" - "@jridgewell/trace-mapping" "^0.3.18" + "@jest/console" "^27.5.1" + "@jest/test-result" "^27.5.1" + "@jest/transform" "^27.5.1" + "@jest/types" "^27.5.1" "@types/node" "*" chalk "^4.0.0" collect-v8-coverage "^1.0.0" exit "^0.1.2" - glob "^7.1.3" + glob "^7.1.2" graceful-fs "^4.2.9" istanbul-lib-coverage "^3.0.0" - istanbul-lib-instrument "^6.0.0" + istanbul-lib-instrument "^5.1.0" istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.1.3" - jest-message-util "^29.7.0" - jest-util "^29.7.0" - jest-worker "^29.7.0" + jest-haste-map "^27.5.1" + jest-resolve "^27.5.1" + jest-util "^27.5.1" + jest-worker "^27.5.1" slash "^3.0.0" + source-map "^0.6.0" string-length "^4.0.1" - strip-ansi "^6.0.0" - v8-to-istanbul "^9.0.1" + terminal-link "^2.0.0" + v8-to-istanbul "^8.1.0" "@jest/schemas@^29.6.3": version "29.6.3" @@ -5313,36 +5082,57 @@ dependencies: "@sinclair/typebox" "^0.27.8" -"@jest/source-map@^29.6.3": - version "29.6.3" - resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-29.6.3.tgz#d90ba772095cf37a34a5eb9413f1b562a08554c4" - integrity sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw== +"@jest/source-map@^27.5.1": + version "27.5.1" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-27.5.1.tgz#6608391e465add4205eae073b55e7f279e04e8cf" + integrity sha512-y9NIHUYF3PJRlHk98NdC/N1gl88BL08aQQgu4k4ZopQkCw9t9cV8mtl3TV8b/YCB8XaVTFrmUTAJvjsntDireg== dependencies: - "@jridgewell/trace-mapping" "^0.3.18" callsites "^3.0.0" graceful-fs "^4.2.9" + source-map "^0.6.0" -"@jest/test-result@^29.7.0": - version "29.7.0" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.7.0.tgz#8db9a80aa1a097bb2262572686734baed9b1657c" - integrity sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA== +"@jest/test-result@^27.5.1": + version "27.5.1" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.5.1.tgz#56a6585fa80f7cdab72b8c5fc2e871d03832f5bb" + integrity sha512-EW35l2RYFUcUQxFJz5Cv5MTOxlJIQs4I7gxzi2zVU7PJhOwfYq1MdC5nhSmYjX1gmMmLPvB3sIaC+BkcHRBfag== dependencies: - "@jest/console" "^29.7.0" - "@jest/types" "^29.6.3" + "@jest/console" "^27.5.1" + "@jest/types" "^27.5.1" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^29.7.0": - version "29.7.0" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz#6cef977ce1d39834a3aea887a1726628a6f072ce" - integrity sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw== +"@jest/test-sequencer@^27.5.1": + version "27.5.1" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.5.1.tgz#4057e0e9cea4439e544c6353c6affe58d095745b" + integrity sha512-LCheJF7WB2+9JuCS7VB/EmGIdQuhtqjRNI9A43idHv3E4KltCTsPsLxvdaubFHSYwY/fNjMWjl6vNRhDiN7vpQ== dependencies: - "@jest/test-result" "^29.7.0" + "@jest/test-result" "^27.5.1" graceful-fs "^4.2.9" - jest-haste-map "^29.7.0" + jest-haste-map "^27.5.1" + jest-runtime "^27.5.1" + +"@jest/transform@^27.5.1": + version "27.5.1" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.5.1.tgz#6c3501dcc00c4c08915f292a600ece5ecfe1f409" + integrity sha512-ipON6WtYgl/1329g5AIJVbUuEh0wZVbdpGwC99Jw4LwuoBNS95MVphU6zOeD9pDkon+LLbFL7lOQRapbB8SCHw== + dependencies: + "@babel/core" "^7.1.0" + "@jest/types" "^27.5.1" + babel-plugin-istanbul "^6.1.1" + chalk "^4.0.0" + convert-source-map "^1.4.0" + fast-json-stable-stringify "^2.0.0" + graceful-fs "^4.2.9" + jest-haste-map "^27.5.1" + jest-regex-util "^27.5.1" + jest-util "^27.5.1" + micromatch "^4.0.4" + pirates "^4.0.4" slash "^3.0.0" + source-map "^0.6.1" + write-file-atomic "^3.0.0" -"@jest/transform@^29.3.1", "@jest/transform@^29.7.0": +"@jest/transform@^29.3.1": version "29.7.0" resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.7.0.tgz#df2dd9c346c7d7768b8a06639994640c642e284c" integrity sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw== @@ -5374,6 +5164,17 @@ "@types/yargs" "^15.0.0" chalk "^4.0.0" +"@jest/types@^27.5.1": + version "27.5.1" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.5.1.tgz#3c79ec4a8ba61c170bf937bcf9e98a9df175ec80" + integrity sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw== + dependencies: + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^3.0.0" + "@types/node" "*" + "@types/yargs" "^16.0.0" + chalk "^4.0.0" + "@jest/types@^29.6.3": version "29.6.3" resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.6.3.tgz#1131f8cf634e7e84c5e77bab12f052af585fba59" @@ -6886,19 +6687,19 @@ resolved "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz" integrity sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw== -"@sinonjs/commons@^3.0.0": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-3.0.1.tgz#1029357e44ca901a615585f6d27738dbc89084cd" - integrity sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ== +"@sinonjs/commons@^1.7.0": + version "1.8.6" + resolved "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.6.tgz" + integrity sha512-Ky+XkAkqPZSm3NLBeUng77EBQl3cmeJhITaGHdYH8kjVB+aun3S4XBRti2zt17mtt0mIUDiNxYeoJm6drVvBJQ== dependencies: type-detect "4.0.8" -"@sinonjs/fake-timers@^10.0.2": - version "10.3.0" - resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz#55fdff1ecab9f354019129daf4df0dd4d923ea66" - integrity sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA== +"@sinonjs/fake-timers@^8.0.1": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-8.1.0.tgz#3fdc2b6cb58935b21bfb8d1625eb1300484316e7" + integrity sha512-OAPJUAtgeINhh/TAlUID4QTs53Njm7xzddaVlEs/SXwgtiD1tW22zAB/W1wdqfrpmikgaWQ9Fw6Ws+hsiRm5Vg== dependencies: - "@sinonjs/commons" "^3.0.0" + "@sinonjs/commons" "^1.7.0" "@smithy/abort-controller@^2.0.12": version "2.0.12" @@ -7955,7 +7756,7 @@ "@tootallnate/once@1": version "1.1.2" - resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" + resolved "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz" integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== "@tootallnate/once@2": @@ -8034,7 +7835,7 @@ "@types/babel__template" "*" "@types/babel__traverse" "*" -"@types/babel__core@^7.1.14", "@types/babel__core@^7.1.18", "@types/babel__core@^7.20.5": +"@types/babel__core@^7.1.14", "@types/babel__core@^7.20.5": version "7.20.5" resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.5.tgz#3df15f27ba85319caa07ba08d0721889bb39c017" integrity sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA== @@ -8060,7 +7861,7 @@ "@babel/parser" "^7.1.0" "@babel/types" "^7.0.0" -"@types/babel__traverse@*", "@types/babel__traverse@^7.0.6", "@types/babel__traverse@^7.18.0": +"@types/babel__traverse@*", "@types/babel__traverse@^7.0.4", "@types/babel__traverse@^7.0.6", "@types/babel__traverse@^7.18.0": version "7.20.3" resolved "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.3.tgz" integrity sha512-Lsh766rGEFbaxMIDH7Qa+Yha8cMVI3qAK6CHt3OR0YfxOIn5Z54iHiyDRycHrBqeIiqGa20Kpsv1cavfBKkRSw== @@ -8307,10 +8108,10 @@ resolved "https://registry.npmjs.org/@types/escodegen/-/escodegen-0.0.6.tgz" integrity sha512-AjwI4MvWx3HAOaZqYsjKWyEObT9lcVV0Y0V8nXo6cXzN8ZiMxVhf6F3d/UNvXVGKrEzL/Dluc5p+y9GkzlTWig== -"@types/eslint@7 || 8": - version "8.56.12" - resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.56.12.tgz#1657c814ffeba4d2f84c0d4ba0f44ca7ea1ca53a" - integrity sha512-03ruubjWyOHlmljCVoxSuNDdmfZDzsrrz0P2LeJsOXr+ZwFQ+0yQIwNCwt/GYhV7Z31fgtXJTAEs+FYlEL851g== +"@types/eslint@8": + version "8.56.7" + resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.56.7.tgz#c33b5b5a9cfb66881beb7b5be6c34aa3e81d3366" + integrity sha512-SjDvI/x3zsZnOkYZ3lCt9lOZWZLB2jIlNKz+LBgCtDurK0JZcwucxYHn1w2BJkD34dgX9Tjnak0txtq4WTggEA== dependencies: "@types/estree" "*" "@types/json-schema" "*" @@ -8401,7 +8202,7 @@ resolved "https://registry.npmjs.org/@types/google-libphonenumber/-/google-libphonenumber-7.4.30.tgz" integrity sha512-Td1X1ayRxePEm6/jPHUBs2tT6TzW1lrVB6ZX7ViPGellyzO/0xMNi+wx5nH6jEitjznq276VGIqjK5qAju0XVw== -"@types/graceful-fs@^4.1.3": +"@types/graceful-fs@^4.1.2", "@types/graceful-fs@^4.1.3": version "4.1.9" resolved "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz" integrity sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ== @@ -8571,11 +8372,6 @@ resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz" integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== -"@types/json-stable-stringify@^1.0.32": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@types/json-stable-stringify/-/json-stable-stringify-1.1.0.tgz#41393e6b7a9a67221607346af4a79783aeb28aea" - integrity sha512-ESTsHWB72QQq+pjUFIbEz9uSCZppD31YrVkbt2rnUciTYEvcwN6uZIhX5JZeBHqRlFJ41x/7MewCs7E2Qux6Cg== - "@types/json5@^0.0.29": version "0.0.29" resolved "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz" @@ -8760,10 +8556,10 @@ "@types/node" "*" "@types/pdfkit" "*" -"@types/picomatch@^2.3.0": - version "2.3.4" - resolved "https://registry.yarnpkg.com/@types/picomatch/-/picomatch-2.3.4.tgz#00c5b3eee51cd690f76b8213c625adc9bc4b9aa6" - integrity sha512-0so8lU8O5zatZS/2Fi4zrwks+vZv7e0dygrgEZXljODXBig97l4cPQD+9LabXfGJOWwoRkTVz6Q4edZvD12UOA== +"@types/prettier@^2.1.5": + version "2.7.3" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.3.tgz#3e51a17e291d01d17d3fc61422015a933af7a08f" + integrity sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA== "@types/pretty-hrtime@^1.0.0": version "1.0.3" @@ -9117,6 +8913,13 @@ dependencies: "@types/yargs-parser" "*" +"@types/yargs@^16.0.0": + version "16.0.9" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-16.0.9.tgz#ba506215e45f7707e6cbcaf386981155b7ab956e" + integrity sha512-tHhzvkFXZQeTECenFoRljLBYPZJ7jAVxqqtEI0qTLOmuultnFp4I9yKE17vTuhf7BkhCu7I4XuemPgikDVuYqA== + dependencies: + "@types/yargs-parser" "*" + "@types/yargs@^17.0.8": version "17.0.33" resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.33.tgz#8c32303da83eec050a84b3c7ae7b9f922d13e32d" @@ -9180,10 +8983,10 @@ resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.33.0.tgz" integrity sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ== -"@typescript-eslint/types@5.45.0": - version "5.45.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.45.0.tgz#794760b9037ee4154c09549ef5a96599621109c5" - integrity sha512-QQij+u/vgskA66azc9dCmx+rev79PzX8uDHpsqSjEFtfF2gBUTRCpvYMh2gw2ghkJabNkPlSUCimsyBEQZd1DA== +"@typescript-eslint/types@5.62.0": + version "5.62.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.62.0.tgz#258607e60effa309f067608931c3df6fed41fd2f" + integrity sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ== "@typescript-eslint/typescript-estree@4.33.0": version "4.33.0" @@ -9198,13 +9001,13 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/typescript-estree@5.45.0": - version "5.45.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.45.0.tgz#f70a0d646d7f38c0dfd6936a5e171a77f1e5291d" - integrity sha512-maRhLGSzqUpFcZgXxg1qc/+H0bT36lHK4APhp0AEUVrpSwXiRAomm/JGjSG+kNUio5kAa3uekCYu/47cnGn5EQ== +"@typescript-eslint/typescript-estree@^5.9.1": + version "5.62.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz#7d17794b77fabcac615d6a48fb143330d962eb9b" + integrity sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA== dependencies: - "@typescript-eslint/types" "5.45.0" - "@typescript-eslint/visitor-keys" "5.45.0" + "@typescript-eslint/types" "5.62.0" + "@typescript-eslint/visitor-keys" "5.62.0" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" @@ -9219,12 +9022,12 @@ "@typescript-eslint/types" "4.33.0" eslint-visitor-keys "^2.0.0" -"@typescript-eslint/visitor-keys@5.45.0": - version "5.45.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.45.0.tgz#e0d160e9e7fdb7f8da697a5b78e7a14a22a70528" - integrity sha512-jc6Eccbn2RtQPr1s7th6jJWQHBHI6GBVQkCHoJFQ5UreaKm59Vxw+ynQUPPY2u2Amquc+7tmEoC2G52ApsGNNg== +"@typescript-eslint/visitor-keys@5.62.0": + version "5.62.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz#2174011917ce582875954ffe2f6912d5931e353e" + integrity sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw== dependencies: - "@typescript-eslint/types" "5.45.0" + "@typescript-eslint/types" "5.62.0" eslint-visitor-keys "^3.3.0" "@vitejs/plugin-react@^3.0.1": @@ -9419,7 +9222,7 @@ JSONStream@^1.3.5: abab@^2.0.3, abab@^2.0.5: version "2.0.6" - resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.6.tgz#41b80f2c871d19686216b82309231cfd3cb3d291" + resolved "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz" integrity sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA== abbrev@1: @@ -9459,7 +9262,7 @@ accepts@~1.3.5, accepts@~1.3.8: acorn-globals@^6.0.0: version "6.0.0" - resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-6.0.0.tgz#46cdd39f0f8ff08a876619b55f5ac8a6dc770b45" + resolved "https://registry.npmjs.org/acorn-globals/-/acorn-globals-6.0.0.tgz" integrity sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg== dependencies: acorn "^7.1.1" @@ -9499,7 +9302,7 @@ acorn@^7.0.0, acorn@^7.1.1, acorn@^7.4.0, acorn@^7.4.1: resolved "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^8.10.0, acorn@^8.4.1, acorn@^8.8.0, acorn@^8.8.1, acorn@^8.8.2: +acorn@^8.10.0, acorn@^8.2.4, acorn@^8.4.1, acorn@^8.8.0, acorn@^8.8.1, acorn@^8.8.2: version "8.10.0" resolved "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz" integrity sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw== @@ -9509,11 +9312,6 @@ acorn@^8.11.3: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.12.1.tgz#71616bdccbe25e27a54439e0046e89ca76df2248" integrity sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg== -acorn@^8.2.4: - version "8.14.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.14.0.tgz#063e2c70cac5fb4f6467f0b11152e04c682795b0" - integrity sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA== - add-dom-event-listener@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/add-dom-event-listener/-/add-dom-event-listener-1.1.0.tgz" @@ -10309,15 +10107,16 @@ babel-core@^7.0.0-bridge.0: resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-7.0.0-bridge.0.tgz#95a492ddd90f9b4e9a4a1da14eb335b87b634ece" integrity sha512-poPX9mZH/5CSanm50Q+1toVci6pv5KSRv/5TWCwtzQS5XEwn40BcCrgIeMFWP9CKKIniKXNxoIOnOq4VVlGXhg== -babel-jest@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.7.0.tgz#f4369919225b684c56085998ac63dbd05be020d5" - integrity sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg== +babel-jest@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.5.1.tgz#a1bf8d61928edfefd21da27eb86a695bfd691444" + integrity sha512-cdQ5dXjGRd0IBRATiQ4mZGlGlRE8kJpjPOixdNRdT+m3UcNqmYWN6rK6nvtXYfY3D76cb8s/O1Ss8ea24PIwcg== dependencies: - "@jest/transform" "^29.7.0" + "@jest/transform" "^27.5.1" + "@jest/types" "^27.5.1" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" - babel-preset-jest "^29.6.3" + babel-preset-jest "^27.5.1" chalk "^4.0.0" graceful-fs "^4.2.9" slash "^3.0.0" @@ -10351,14 +10150,14 @@ babel-plugin-istanbul@^6.1.1: istanbul-lib-instrument "^5.0.4" test-exclude "^6.0.0" -babel-plugin-jest-hoist@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz#aadbe943464182a8922c3c927c3067ff40d24626" - integrity sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg== +babel-plugin-jest-hoist@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-27.5.1.tgz#9be98ecf28c331eb9f5df9c72d6f89deb8181c2e" + integrity sha512-50wCwD5EMNW4aRpOwtqzyZHIewTYNxLA4nhB+09d8BIssfNfzBRhkBIHiaPv1Si226TQSvp8gxAJm2iY2qs2hQ== dependencies: "@babel/template" "^7.3.3" "@babel/types" "^7.3.3" - "@types/babel__core" "^7.1.14" + "@types/babel__core" "^7.0.0" "@types/babel__traverse" "^7.0.6" babel-plugin-macros@^2.0.0: @@ -10370,15 +10169,6 @@ babel-plugin-macros@^2.0.0: cosmiconfig "^6.0.0" resolve "^1.12.0" -babel-plugin-macros@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/babel-plugin-macros/-/babel-plugin-macros-3.1.0.tgz#9ef6dc74deb934b4db344dc973ee851d148c50c1" - integrity sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg== - dependencies: - "@babel/runtime" "^7.12.5" - cosmiconfig "^7.0.0" - resolve "^1.19.0" - babel-plugin-polyfill-corejs2@^0.4.10: version "0.4.11" resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.11.tgz#30320dfe3ffe1a336c15afdcdafd6fd615b25e33" @@ -10499,12 +10289,12 @@ babel-preset-fbjs@^3.4.0: "@babel/plugin-transform-template-literals" "^7.0.0" babel-plugin-syntax-trailing-function-commas "^7.0.0-beta.0" -babel-preset-jest@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz#fa05fa510e7d493896d7b0dd2033601c840f171c" - integrity sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA== +babel-preset-jest@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-27.5.1.tgz#91f10f58034cb7989cb4f962b69fa6eef6a6bc81" + integrity sha512-Nptf2FzlPCWYuJg41HBqXVT8ym6bXOevuCTbhxlUpjwtysGaIWFvDEjp4y+G7fl13FgOdjs7P/DmErqH7da0Ag== dependencies: - babel-plugin-jest-hoist "^29.6.3" + babel-plugin-jest-hoist "^27.5.1" babel-preset-current-node-syntax "^1.0.0" babel-runtime@6.x, babel-runtime@^6.26.0: @@ -10740,7 +10530,7 @@ browser-or-node@^2.1.1: browser-process-hrtime@^1.0.0: version "1.0.0" - resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626" + resolved "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz" integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow== browser-resolve@^1.8.1: @@ -10796,19 +10586,9 @@ browserslist@^4.23.1, browserslist@^4.23.3: node-releases "^2.0.18" update-browserslist-db "^1.1.0" -browserslist@^4.24.0: - version "4.24.2" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.24.2.tgz#f5845bc91069dbd55ee89faf9822e1d885d16580" - integrity sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg== - dependencies: - caniuse-lite "^1.0.30001669" - electron-to-chromium "^1.5.41" - node-releases "^2.0.18" - update-browserslist-db "^1.1.1" - -bs-logger@^0.2.6: +bs-logger@0.x: version "0.2.6" - resolved "https://registry.yarnpkg.com/bs-logger/-/bs-logger-0.2.6.tgz#eb7d365307a72cf974cc6cda76b68354ad336bd8" + resolved "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz" integrity sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog== dependencies: fast-json-stable-stringify "2.x" @@ -11091,11 +10871,6 @@ caniuse-lite@^1.0.30001663: resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001664.tgz#d588d75c9682d3301956b05a3749652a80677df4" integrity sha512-AmE7k4dXiNKQipgn7a2xg558IRqPN3jMQY/rOsbxDhrd0tyChwbITBfiwtnqz8bi2M5mIWbxAYBvk7W7QBUS2g== -caniuse-lite@^1.0.30001669: - version "1.0.30001680" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001680.tgz#5380ede637a33b9f9f1fc6045ea99bd142f3da5e" - integrity sha512-rPQy70G6AGUMnbwS1z6Xg+RkHYPAi18ihs47GH0jcxIG7wArmPgY3XbS2sRdBbxJljp3thdT8BIqv9ccCypiPA== - capital-case@^1.0.4: version "1.0.4" resolved "https://registry.npmjs.org/capital-case/-/capital-case-1.0.4.tgz" @@ -11832,7 +11607,7 @@ conventional-recommended-bump@7.0.1: git-semver-tags "^5.0.0" meow "^8.1.2" -convert-source-map@^1.5.0, convert-source-map@^1.5.1: +convert-source-map@^1.4.0, convert-source-map@^1.5.0, convert-source-map@^1.5.1, convert-source-map@^1.6.0: version "1.9.0" resolved "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz" integrity sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A== @@ -11928,7 +11703,7 @@ cosmiconfig@^6.0.0: path-type "^4.0.0" yaml "^1.7.2" -cosmiconfig@^7, cosmiconfig@^7.0.0, cosmiconfig@^7.0.1, cosmiconfig@^7.1.0: +cosmiconfig@^7, cosmiconfig@^7.0.1, cosmiconfig@^7.1.0: version "7.1.0" resolved "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz" integrity sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA== @@ -12011,19 +11786,6 @@ create-emotion@^9.2.12: stylis "^3.5.0" stylis-rule-sheet "^0.0.10" -create-jest@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/create-jest/-/create-jest-29.7.0.tgz#a355c5b3cb1e1af02ba177fe7afd7feee49a5320" - integrity sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q== - dependencies: - "@jest/types" "^29.6.3" - chalk "^4.0.0" - exit "^0.1.2" - graceful-fs "^4.2.9" - jest-config "^29.7.0" - jest-util "^29.7.0" - prompts "^2.0.1" - create-require@^1.1.0: version "1.1.1" resolved "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz" @@ -12160,17 +11922,17 @@ cssfilter@0.0.10: cssom@^0.4.4: version "0.4.4" - resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.4.4.tgz#5a66cf93d2d0b661d80bf6a44fb65f5c2e4e0a10" + resolved "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz" integrity sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw== cssom@~0.3.6: version "0.3.8" - resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.8.tgz#9f1276f5b2b463f2114d3f2c75250af8c1a36f4a" + resolved "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz" integrity sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg== cssstyle@^2.3.0: version "2.3.0" - resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-2.3.0.tgz#ff665a0ddbdc31864b09647f34163443d90b0852" + resolved "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz" integrity sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A== dependencies: cssom "~0.3.6" @@ -12323,7 +12085,7 @@ dash-ast@^2.0.1: data-urls@^2.0.0: version "2.0.0" - resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-2.0.0.tgz#156485a72963a970f5d5821aaf642bef2bf2db9b" + resolved "https://registry.npmjs.org/data-urls/-/data-urls-2.0.0.tgz" integrity sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ== dependencies: abab "^2.0.3" @@ -12439,7 +12201,7 @@ decimal.js-light@^2.4.1: decimal.js@^10.2.1: version "10.4.3" - resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.4.3.tgz#1044092884d245d1b7f65725fa4ad4c6f781cc23" + resolved "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz" integrity sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA== decode-uri-component@^0.2.0, decode-uri-component@^0.2.2: @@ -12459,16 +12221,11 @@ decompress-response@^6.0.0: dependencies: mimic-response "^3.1.0" -dedent@0.7.0: +dedent@0.7.0, dedent@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" integrity sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA== -dedent@^1.0.0: - version "1.5.3" - resolved "https://registry.yarnpkg.com/dedent/-/dedent-1.5.3.tgz#99aee19eb9bae55a67327717b6e848d0bf777e5a" - integrity sha512-NHQtfOOW68WD8lgypbLA5oT+Bt0xXJhiYvoR6SmmNXZfpzOGXwdKWmcwG8N7PwVVWV3eF/68nmD9BaJSsTBhyQ== - deep-eql@^4.1.3: version "4.1.3" resolved "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz" @@ -12698,6 +12455,11 @@ diff-sequences@^26.6.2: resolved "https://registry.npmjs.org/diff-sequences/-/diff-sequences-26.6.2.tgz" integrity sha512-Mv/TDa3nZ9sbc5soK+OoA74BsS3mL37yixCvUAQkiuA4Wz6YtwP/K47n2rv2ovzHZvoiQeA5FTQOschKkEwB0Q== +diff-sequences@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.5.1.tgz#eaecc0d327fd68c8d9672a1e64ab8dccb2ef5327" + integrity sha512-k1gCAXAsNgLwEL+Y8Wvl+M6oEFj5bgazfZULpS5CneoPPXRaCCW7dm+q21Ky2VEE5X+VeRDBVg1Pcvvsr4TtNQ== + diff-sequences@^29.6.3: version "29.6.3" resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.6.3.tgz#4deaf894d11407c51efc8418012f9e70b84ea921" @@ -12811,7 +12573,7 @@ domelementtype@^2.3.0: domexception@^2.0.1: version "2.0.1" - resolved "https://registry.yarnpkg.com/domexception/-/domexception-2.0.1.tgz#fb44aefba793e1574b0af6aed2801d057529f304" + resolved "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz" integrity sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg== dependencies: webidl-conversions "^5.0.0" @@ -12943,13 +12705,6 @@ ee-first@1.1.1: resolved "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz" integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== -ejs@^3.1.10, ejs@^3.1.8: - version "3.1.10" - resolved "https://registry.yarnpkg.com/ejs/-/ejs-3.1.10.tgz#69ab8358b14e896f80cc39e62087b88500c3ac3b" - integrity sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA== - dependencies: - jake "^10.8.5" - ejs@^3.1.6, ejs@^3.1.7: version "3.1.9" resolved "https://registry.npmjs.org/ejs/-/ejs-3.1.9.tgz" @@ -12957,6 +12712,13 @@ ejs@^3.1.6, ejs@^3.1.7: dependencies: jake "^10.8.5" +ejs@^3.1.8: + version "3.1.10" + resolved "https://registry.yarnpkg.com/ejs/-/ejs-3.1.10.tgz#69ab8358b14e896f80cc39e62087b88500c3ac3b" + integrity sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA== + dependencies: + jake "^10.8.5" + elastic-apm-node@^3.29.0: version "3.51.0" resolved "https://registry.yarnpkg.com/elastic-apm-node/-/elastic-apm-node-3.51.0.tgz#2ee35156b41f8e1e000623bba15aee19553756fe" @@ -13016,31 +12778,21 @@ electron-to-chromium@^1.5.28: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.29.tgz#aa592a3caa95d07cc26a66563accf99fa573a1ee" integrity sha512-PF8n2AlIhCKXQ+gTpiJi0VhcHDb69kYX4MtCiivctc2QD3XuNZ/XIOlbGzt7WAjjEev0TtaH6Cu3arZExm5DOw== -electron-to-chromium@^1.5.41: - version "1.5.58" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.58.tgz#d90bd7a04d9223dce4e72316e14492140ec9af40" - integrity sha512-al2l4r+24ZFL7WzyPTlyD0fC33LLzvxqLCwurtBibVPghRGO9hSTl+tis8t1kD7biPiH/en4U0I7o/nQbYeoVA== - email-validator@^2.0.4: version "2.0.4" resolved "https://registry.npmjs.org/email-validator/-/email-validator-2.0.4.tgz" integrity sha512-gYCwo7kh5S3IDyZPLZf6hSS0MnZT8QmJFqYvbqlDZSbwdZlY6QZWxJ4i/6UhITOJ4XzyI647Bm2MXKCLqnJ4nQ== -emittery@^0.13.1: - version "0.13.1" - resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.13.1.tgz#c04b8c3457490e0847ae51fced3af52d338e3dad" - integrity sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ== +emittery@^0.8.1: + version "0.8.1" + resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.8.1.tgz#bb23cc86d03b30aa75a7f734819dee2e1ba70860" + integrity sha512-uDfvUjVrfGJJhymx/kz6prltenw1u7WrCg1oa94zYY8xxVpLLUu045LAT0dhDZdXG58/EpPL/5kA180fQ/qudg== -emoji-regex@10.3.0, emoji-regex@^10.3.0: +emoji-regex@^10.0.0, emoji-regex@^10.3.0: version "10.3.0" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-10.3.0.tgz#76998b9268409eb3dae3de989254d456e70cfe23" integrity sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw== -emoji-regex@^10.2.1: - version "10.4.0" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-10.4.0.tgz#03553afea80b3975749cfcb36f776ca268e413d4" - integrity sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw== - emoji-regex@^7.0.1: version "7.0.3" resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz" @@ -13820,22 +13572,18 @@ eslint-plugin-flowtype@^5.2.0: lodash "^4.17.15" string-natural-compare "^3.0.1" -eslint-plugin-formatjs@4.10.0: - version "4.10.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-formatjs/-/eslint-plugin-formatjs-4.10.0.tgz#05da23f75b4ce507c90df93ff07be2b6e70ffbc5" - integrity sha512-YvNF72NVMkIevgJrX5xTkIj4eBCeiweM2/61ppP2eEni3FP4pDXy9UFsOhtxJVISTBH0UEAqz3xhRjqi1q+qag== - dependencies: - "@formatjs/icu-messageformat-parser" "2.3.1" - "@formatjs/ts-transformer" "3.13.0" - "@types/eslint" "7 || 8" - "@types/picomatch" "^2.3.0" - "@typescript-eslint/typescript-estree" "5.45.0" - emoji-regex "^10.2.1" - magic-string "^0.29.0" - picomatch "^2.3.1" - tslib "2.4.0" - typescript "^4.7 || 5" - unicode-emoji-utils "^1.1.1" +eslint-plugin-formatjs@2.21.0: + version "2.21.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-formatjs/-/eslint-plugin-formatjs-2.21.0.tgz#cc728dc914722dd221f4213bb1144629a29a9eb2" + integrity sha512-YY69wKUSaVcrxxishknqWxLhd2orPFDBLzRN9fu6QGkfQ2dt7+DHMumm+7iBNxLdS5zozAjNVSgp8NnauZvxRQ== + dependencies: + "@formatjs/icu-messageformat-parser" "2.0.18" + "@formatjs/ts-transformer" "3.9.2" + "@types/eslint" "8" + "@typescript-eslint/typescript-estree" "^5.9.1" + emoji-regex "^10.0.0" + tslib "^2.1.0" + typescript "^4.5" eslint-plugin-import@^2.17.3: version "2.31.0" @@ -14189,16 +13937,15 @@ exit@^0.1.2: resolved "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz" integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ== -expect@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/expect/-/expect-29.7.0.tgz#578874590dcb3214514084c08115d8aee61e11bc" - integrity sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw== +expect@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/expect/-/expect-27.5.1.tgz#83ce59f1e5bdf5f9d2b94b61d2050db48f3fef74" + integrity sha512-E1q5hSUG2AmYQwQJ041nvgpkODHQvB+RKlB4IYdru6uJsyFTRyZAP463M+1lINorwbqAmUggi6+WwkD8lCS/Dw== dependencies: - "@jest/expect-utils" "^29.7.0" - jest-get-type "^29.6.3" - jest-matcher-utils "^29.7.0" - jest-message-util "^29.7.0" - jest-util "^29.7.0" + "@jest/types" "^27.5.1" + jest-get-type "^27.5.1" + jest-matcher-utils "^27.5.1" + jest-message-util "^27.5.1" exponential-backoff@^3.1.1: version "3.1.1" @@ -14700,9 +14447,9 @@ foreground-child@^3.1.0: signal-exit "^4.0.1" form-data@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.2.tgz#83ad9ced7c03feaad97e293d6f6091011e1659c8" - integrity sha512-sJe+TQb2vIaIyO783qN6BlMYWMw3WBOHA1Ay2qxsnjuafEOQFJ2JakedOQirT6D5XPRxDvS7AHYyem9fTpb4LQ== + version "3.0.1" + resolved "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz" + integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg== dependencies: asynckit "^0.4.0" combined-stream "^1.0.8" @@ -15670,7 +15417,7 @@ html-element-map@^1.2.0: html-encoding-sniffer@^2.0.1: version "2.0.1" - resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz#42a6dc4fd33f00281176e8b23759ca4e4fa185f3" + resolved "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz" integrity sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ== dependencies: whatwg-encoding "^1.0.5" @@ -15725,7 +15472,7 @@ http-headers@^3.0.2: http-proxy-agent@^4.0.1: version "4.0.1" - resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz#8a8c8ef7f5932ccf953c296ca8291b95aa74aa3a" + resolved "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz" integrity sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg== dependencies: "@tootallnate/once" "1" @@ -16419,7 +16166,7 @@ is-port-reachable@4.0.0: is-potential-custom-element-name@^1.0.1: version "1.0.1" - resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5" + resolved "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz" integrity sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ== is-regex@^1.0.4, is-regex@^1.0.5, is-regex@^1.1.4: @@ -16535,6 +16282,11 @@ is-typed-array@^1.1.13: dependencies: which-typed-array "^1.1.14" +is-typedarray@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz" + integrity sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA== + is-unc-path@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz" @@ -16631,7 +16383,7 @@ istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: resolved "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz" integrity sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw== -istanbul-lib-instrument@^5.0.4: +istanbul-lib-instrument@^5.0.4, istanbul-lib-instrument@^5.1.0: version "5.2.1" resolved "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz" integrity sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg== @@ -16642,17 +16394,6 @@ istanbul-lib-instrument@^5.0.4: istanbul-lib-coverage "^3.2.0" semver "^6.3.0" -istanbul-lib-instrument@^6.0.0: - version "6.0.3" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz#fa15401df6c15874bcb2105f773325d78c666765" - integrity sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q== - dependencies: - "@babel/core" "^7.23.9" - "@babel/parser" "^7.23.9" - "@istanbuljs/schema" "^0.1.3" - istanbul-lib-coverage "^3.2.0" - semver "^7.5.4" - istanbul-lib-report@^3.0.0: version "3.0.1" resolved "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz" @@ -16731,87 +16472,89 @@ jake@^10.8.5: filelist "^1.0.4" minimatch "^3.1.2" -jest-changed-files@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.7.0.tgz#1c06d07e77c78e1585d020424dedc10d6e17ac3a" - integrity sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w== +jest-changed-files@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.5.1.tgz#a348aed00ec9bf671cc58a66fcbe7c3dfd6a68f5" + integrity sha512-buBLMiByfWGCoMsLLzGUUSpAmIAGnbR2KJoMN10ziLhOLvP4e0SlypHnAel8iqQXTrcbmfEY9sSqae5sgUsTvw== dependencies: + "@jest/types" "^27.5.1" execa "^5.0.0" - jest-util "^29.7.0" - p-limit "^3.1.0" + throat "^6.0.1" -jest-circus@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.7.0.tgz#b6817a45fcc835d8b16d5962d0c026473ee3668a" - integrity sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw== +jest-circus@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.5.1.tgz#37a5a4459b7bf4406e53d637b49d22c65d125ecc" + integrity sha512-D95R7x5UtlMA5iBYsOHFFbMD/GVA4R/Kdq15f7xYWUfWHBto9NYRsOvnSauTgdF+ogCpJ4tyKOXhUifxS65gdw== dependencies: - "@jest/environment" "^29.7.0" - "@jest/expect" "^29.7.0" - "@jest/test-result" "^29.7.0" - "@jest/types" "^29.6.3" + "@jest/environment" "^27.5.1" + "@jest/test-result" "^27.5.1" + "@jest/types" "^27.5.1" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" - dedent "^1.0.0" + dedent "^0.7.0" + expect "^27.5.1" is-generator-fn "^2.0.0" - jest-each "^29.7.0" - jest-matcher-utils "^29.7.0" - jest-message-util "^29.7.0" - jest-runtime "^29.7.0" - jest-snapshot "^29.7.0" - jest-util "^29.7.0" - p-limit "^3.1.0" - pretty-format "^29.7.0" - pure-rand "^6.0.0" + jest-each "^27.5.1" + jest-matcher-utils "^27.5.1" + jest-message-util "^27.5.1" + jest-runtime "^27.5.1" + jest-snapshot "^27.5.1" + jest-util "^27.5.1" + pretty-format "^27.5.1" slash "^3.0.0" stack-utils "^2.0.3" + throat "^6.0.1" -jest-cli@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.7.0.tgz#5592c940798e0cae677eec169264f2d839a37995" - integrity sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg== +jest-cli@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.5.1.tgz#278794a6e6458ea8029547e6c6cbf673bd30b145" + integrity sha512-Hc6HOOwYq4/74/c62dEE3r5elx8wjYqxY0r0G/nFrLDPMFRu6RA/u8qINOIkvhxG7mMQ5EJsOGfRpI8L6eFUVw== dependencies: - "@jest/core" "^29.7.0" - "@jest/test-result" "^29.7.0" - "@jest/types" "^29.6.3" + "@jest/core" "^27.5.1" + "@jest/test-result" "^27.5.1" + "@jest/types" "^27.5.1" chalk "^4.0.0" - create-jest "^29.7.0" exit "^0.1.2" + graceful-fs "^4.2.9" import-local "^3.0.2" - jest-config "^29.7.0" - jest-util "^29.7.0" - jest-validate "^29.7.0" - yargs "^17.3.1" + jest-config "^27.5.1" + jest-util "^27.5.1" + jest-validate "^27.5.1" + prompts "^2.0.1" + yargs "^16.2.0" -jest-config@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.7.0.tgz#bcbda8806dbcc01b1e316a46bb74085a84b0245f" - integrity sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ== +jest-config@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.5.1.tgz#5c387de33dca3f99ad6357ddeccd91bf3a0e4a41" + integrity sha512-5sAsjm6tGdsVbW9ahcChPAFCk4IlkQUknH5AvKjuLTSlcO/wCZKyFdn7Rg0EkC+OGgWODEy2hDpWB1PgzH0JNA== dependencies: - "@babel/core" "^7.11.6" - "@jest/test-sequencer" "^29.7.0" - "@jest/types" "^29.6.3" - babel-jest "^29.7.0" + "@babel/core" "^7.8.0" + "@jest/test-sequencer" "^27.5.1" + "@jest/types" "^27.5.1" + babel-jest "^27.5.1" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" - glob "^7.1.3" + glob "^7.1.1" graceful-fs "^4.2.9" - jest-circus "^29.7.0" - jest-environment-node "^29.7.0" - jest-get-type "^29.6.3" - jest-regex-util "^29.6.3" - jest-resolve "^29.7.0" - jest-runner "^29.7.0" - jest-util "^29.7.0" - jest-validate "^29.7.0" + jest-circus "^27.5.1" + jest-environment-jsdom "^27.5.1" + jest-environment-node "^27.5.1" + jest-get-type "^27.5.1" + jest-jasmine2 "^27.5.1" + jest-regex-util "^27.5.1" + jest-resolve "^27.5.1" + jest-runner "^27.5.1" + jest-util "^27.5.1" + jest-validate "^27.5.1" micromatch "^4.0.4" parse-json "^5.2.0" - pretty-format "^29.7.0" + pretty-format "^27.5.1" slash "^3.0.0" strip-json-comments "^3.1.1" -"jest-diff@>=29.4.3 < 30", jest-diff@^29.4.1, jest-diff@^29.7.0: +"jest-diff@>=29.4.3 < 30", jest-diff@^29.4.1: version "29.7.0" resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.7.0.tgz#017934a66ebb7ecf6f205e84699be10afd70458a" integrity sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw== @@ -16831,35 +16574,58 @@ jest-diff@^26.0.0: jest-get-type "^26.3.0" pretty-format "^26.6.2" -jest-docblock@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-29.7.0.tgz#8fddb6adc3cdc955c93e2a87f61cfd350d5d119a" - integrity sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g== +jest-diff@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.5.1.tgz#a07f5011ac9e6643cf8a95a462b7b1ecf6680def" + integrity sha512-m0NvkX55LDt9T4mctTEgnZk3fmEg3NRYutvMPWM/0iPnkFj2wIeF45O1718cMSOFO1vINkqmxqD8vE37uTEbqw== dependencies: - detect-newline "^3.0.0" + chalk "^4.0.0" + diff-sequences "^27.5.1" + jest-get-type "^27.5.1" + pretty-format "^27.5.1" -jest-each@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.7.0.tgz#162a9b3f2328bdd991beaabffbb74745e56577d1" - integrity sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ== +jest-docblock@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-27.5.1.tgz#14092f364a42c6108d42c33c8cf30e058e25f6c0" + integrity sha512-rl7hlABeTsRYxKiUfpHrQrG4e2obOiTQWfMEH3PxPjOtdsfLQO4ReWSZaQ7DETm4xu07rl4q/h4zcKXyU0/OzQ== dependencies: - "@jest/types" "^29.6.3" - chalk "^4.0.0" - jest-get-type "^29.6.3" - jest-util "^29.7.0" - pretty-format "^29.7.0" + detect-newline "^3.0.0" -jest-environment-node@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.7.0.tgz#0b93e111dda8ec120bc8300e6d1fb9576e164376" - integrity sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw== +jest-each@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.5.1.tgz#5bc87016f45ed9507fed6e4702a5b468a5b2c44e" + integrity sha512-1Ff6p+FbhT/bXQnEouYy00bkNSY7OUpfIcmdl8vZ31A1UUaurOLPA8a8BbJOF2RDUElwJhmeaV7LnagI+5UwNQ== dependencies: - "@jest/environment" "^29.7.0" - "@jest/fake-timers" "^29.7.0" - "@jest/types" "^29.6.3" + "@jest/types" "^27.5.1" + chalk "^4.0.0" + jest-get-type "^27.5.1" + jest-util "^27.5.1" + pretty-format "^27.5.1" + +jest-environment-jsdom@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.5.1.tgz#ea9ccd1fc610209655a77898f86b2b559516a546" + integrity sha512-TFBvkTC1Hnnnrka/fUb56atfDtJ9VMZ94JkjTbggl1PEpwrYtUBKMezB3inLmWqQsXYLcMwNoDQwoBTAvFfsfw== + dependencies: + "@jest/environment" "^27.5.1" + "@jest/fake-timers" "^27.5.1" + "@jest/types" "^27.5.1" "@types/node" "*" - jest-mock "^29.7.0" - jest-util "^29.7.0" + jest-mock "^27.5.1" + jest-util "^27.5.1" + jsdom "^16.6.0" + +jest-environment-node@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.5.1.tgz#dedc2cfe52fab6b8f5714b4808aefa85357a365e" + integrity sha512-Jt4ZUnxdOsTGwSRAfKEnE6BcwsSPNOijjwifq5sDFSA2kesnXTvNqKHYgM0hDq3549Uf/KzdXNYn4wMZJPlFLw== + dependencies: + "@jest/environment" "^27.5.1" + "@jest/fake-timers" "^27.5.1" + "@jest/types" "^27.5.1" + "@types/node" "*" + jest-mock "^27.5.1" + jest-util "^27.5.1" jest-fetch-mock@^2.1.2: version "2.1.2" @@ -16874,11 +16640,36 @@ jest-get-type@^26.3.0: resolved "https://registry.npmjs.org/jest-get-type/-/jest-get-type-26.3.0.tgz" integrity sha512-TpfaviN1R2pQWkIihlfEanwOXK0zcxrKEE4MlU6Tn7keoXdN6/3gK/xl0yEh8DOunn5pOVGKf8hB4R9gVh04ig== +jest-get-type@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.5.1.tgz#3cd613c507b0f7ace013df407a1c1cd578bcb4f1" + integrity sha512-2KY95ksYSaK7DMBWQn6dQz3kqAf3BB64y2udeG+hv4KfSOb9qwcYQstTJc1KCbsix+wLZWZYN8t7nwX3GOBLRw== + jest-get-type@^29.6.3: version "29.6.3" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.6.3.tgz#36f499fdcea197c1045a127319c0481723908fd1" integrity sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw== +jest-haste-map@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.5.1.tgz#9fd8bd7e7b4fa502d9c6164c5640512b4e811e7f" + integrity sha512-7GgkZ4Fw4NFbMSDSpZwXeBiIbx+t/46nJ2QitkOjvwPYyZmqttu2TDSimMHP1EkPOi4xUZAN1doE5Vd25H4Jng== + dependencies: + "@jest/types" "^27.5.1" + "@types/graceful-fs" "^4.1.2" + "@types/node" "*" + anymatch "^3.0.3" + fb-watchman "^2.0.0" + graceful-fs "^4.2.9" + jest-regex-util "^27.5.1" + jest-serializer "^27.5.1" + jest-util "^27.5.1" + jest-worker "^27.5.1" + micromatch "^4.0.4" + walker "^1.0.7" + optionalDependencies: + fsevents "^2.3.2" + jest-haste-map@^29.7.0: version "29.7.0" resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.7.0.tgz#3c2396524482f5a0506376e6c858c3bbcc17b104" @@ -16898,163 +16689,214 @@ jest-haste-map@^29.7.0: optionalDependencies: fsevents "^2.3.2" -jest-leak-detector@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz#5b7ec0dadfdfec0ca383dc9aa016d36b5ea4c728" - integrity sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw== +jest-jasmine2@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.5.1.tgz#a037b0034ef49a9f3d71c4375a796f3b230d1ac4" + integrity sha512-jtq7VVyG8SqAorDpApwiJJImd0V2wv1xzdheGHRGyuT7gZm6gG47QEskOlzsN1PG/6WNaCo5pmwMHDf3AkG2pQ== dependencies: - jest-get-type "^29.6.3" - pretty-format "^29.7.0" - -jest-matcher-utils@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz#ae8fec79ff249fd592ce80e3ee474e83a6c44f12" - integrity sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g== + "@jest/environment" "^27.5.1" + "@jest/source-map" "^27.5.1" + "@jest/test-result" "^27.5.1" + "@jest/types" "^27.5.1" + "@types/node" "*" + chalk "^4.0.0" + co "^4.6.0" + expect "^27.5.1" + is-generator-fn "^2.0.0" + jest-each "^27.5.1" + jest-matcher-utils "^27.5.1" + jest-message-util "^27.5.1" + jest-runtime "^27.5.1" + jest-snapshot "^27.5.1" + jest-util "^27.5.1" + pretty-format "^27.5.1" + throat "^6.0.1" + +jest-leak-detector@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.5.1.tgz#6ec9d54c3579dd6e3e66d70e3498adf80fde3fb8" + integrity sha512-POXfWAMvfU6WMUXftV4HolnJfnPOGEu10fscNCA76KBpRRhcMN2c8d3iT2pxQS3HLbA+5X4sOUPzYO2NUyIlHQ== + dependencies: + jest-get-type "^27.5.1" + pretty-format "^27.5.1" + +jest-matcher-utils@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.5.1.tgz#9c0cdbda8245bc22d2331729d1091308b40cf8ab" + integrity sha512-z2uTx/T6LBaCoNWNFWwChLBKYxTMcGBRjAt+2SbP929/Fflb9aa5LGma654Rz8z9HLxsrUaYzxE9T/EFIL/PAw== dependencies: chalk "^4.0.0" - jest-diff "^29.7.0" - jest-get-type "^29.6.3" - pretty-format "^29.7.0" + jest-diff "^27.5.1" + jest-get-type "^27.5.1" + pretty-format "^27.5.1" -jest-message-util@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.7.0.tgz#8bc392e204e95dfe7564abbe72a404e28e51f7f3" - integrity sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w== +jest-message-util@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.5.1.tgz#bdda72806da10d9ed6425e12afff38cd1458b6cf" + integrity sha512-rMyFe1+jnyAAf+NHwTclDz0eAaLkVDdKVHHBFWsBWHnnh5YeJMNWWsv7AbFYXfK3oTqvL7VTWkhNLu1jX24D+g== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^29.6.3" + "@jest/types" "^27.5.1" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.9" micromatch "^4.0.4" - pretty-format "^29.7.0" + pretty-format "^27.5.1" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.7.0.tgz#4e836cf60e99c6fcfabe9f99d017f3fdd50a6347" - integrity sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw== +jest-mock@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.5.1.tgz#19948336d49ef4d9c52021d34ac7b5f36ff967d6" + integrity sha512-K4jKbY1d4ENhbrG2zuPWaQBvDly+iZ2yAW+T1fATN78hc0sInwn7wZB8XtlNnvHug5RMwV897Xm4LqmPM4e2Og== dependencies: - "@jest/types" "^29.6.3" + "@jest/types" "^27.5.1" "@types/node" "*" - jest-util "^29.7.0" jest-pnp-resolver@^1.2.2: version "1.2.3" resolved "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz" integrity sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w== +jest-regex-util@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.5.1.tgz#4da143f7e9fd1e542d4aa69617b38e4a78365b95" + integrity sha512-4bfKq2zie+x16okqDXjXn9ql2B0dScQu+vcwe4TvFVhkVyuWLqpZrZtXxLLWoXYgn0E87I6r6GRYHF7wFZBUvg== + jest-regex-util@^29.6.3: version "29.6.3" resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.6.3.tgz#4a556d9c776af68e1c5f48194f4d0327d24e8a52" integrity sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg== -jest-resolve-dependencies@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz#1b04f2c095f37fc776ff40803dc92921b1e88428" - integrity sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA== +jest-resolve-dependencies@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.5.1.tgz#d811ecc8305e731cc86dd79741ee98fed06f1da8" + integrity sha512-QQOOdY4PE39iawDn5rzbIePNigfe5B9Z91GDD1ae/xNDlu9kaat8QQ5EKnNmVWPV54hUdxCVwwj6YMgR2O7IOg== dependencies: - jest-regex-util "^29.6.3" - jest-snapshot "^29.7.0" + "@jest/types" "^27.5.1" + jest-regex-util "^27.5.1" + jest-snapshot "^27.5.1" -jest-resolve@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.7.0.tgz#64d6a8992dd26f635ab0c01e5eef4399c6bcbc30" - integrity sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA== +jest-resolve@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.5.1.tgz#a2f1c5a0796ec18fe9eb1536ac3814c23617b384" + integrity sha512-FFDy8/9E6CV83IMbDpcjOhumAQPDyETnU2KZ1O98DwTnz8AOBsW/Xv3GySr1mOZdItLR+zDZ7I/UdTFbgSOVCw== dependencies: + "@jest/types" "^27.5.1" chalk "^4.0.0" graceful-fs "^4.2.9" - jest-haste-map "^29.7.0" + jest-haste-map "^27.5.1" jest-pnp-resolver "^1.2.2" - jest-util "^29.7.0" - jest-validate "^29.7.0" + jest-util "^27.5.1" + jest-validate "^27.5.1" resolve "^1.20.0" - resolve.exports "^2.0.0" + resolve.exports "^1.1.0" slash "^3.0.0" -jest-runner@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.7.0.tgz#809af072d408a53dcfd2e849a4c976d3132f718e" - integrity sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ== +jest-runner@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.5.1.tgz#071b27c1fa30d90540805c5645a0ec167c7b62e5" + integrity sha512-g4NPsM4mFCOwFKXO4p/H/kWGdJp9V8kURY2lX8Me2drgXqG7rrZAx5kv+5H7wtt/cdFIjhqYx1HrlqWHaOvDaQ== dependencies: - "@jest/console" "^29.7.0" - "@jest/environment" "^29.7.0" - "@jest/test-result" "^29.7.0" - "@jest/transform" "^29.7.0" - "@jest/types" "^29.6.3" + "@jest/console" "^27.5.1" + "@jest/environment" "^27.5.1" + "@jest/test-result" "^27.5.1" + "@jest/transform" "^27.5.1" + "@jest/types" "^27.5.1" "@types/node" "*" chalk "^4.0.0" - emittery "^0.13.1" + emittery "^0.8.1" graceful-fs "^4.2.9" - jest-docblock "^29.7.0" - jest-environment-node "^29.7.0" - jest-haste-map "^29.7.0" - jest-leak-detector "^29.7.0" - jest-message-util "^29.7.0" - jest-resolve "^29.7.0" - jest-runtime "^29.7.0" - jest-util "^29.7.0" - jest-watcher "^29.7.0" - jest-worker "^29.7.0" - p-limit "^3.1.0" - source-map-support "0.5.13" - -jest-runtime@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.7.0.tgz#efecb3141cf7d3767a3a0cc8f7c9990587d3d817" - integrity sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ== - dependencies: - "@jest/environment" "^29.7.0" - "@jest/fake-timers" "^29.7.0" - "@jest/globals" "^29.7.0" - "@jest/source-map" "^29.6.3" - "@jest/test-result" "^29.7.0" - "@jest/transform" "^29.7.0" - "@jest/types" "^29.6.3" - "@types/node" "*" + jest-docblock "^27.5.1" + jest-environment-jsdom "^27.5.1" + jest-environment-node "^27.5.1" + jest-haste-map "^27.5.1" + jest-leak-detector "^27.5.1" + jest-message-util "^27.5.1" + jest-resolve "^27.5.1" + jest-runtime "^27.5.1" + jest-util "^27.5.1" + jest-worker "^27.5.1" + source-map-support "^0.5.6" + throat "^6.0.1" + +jest-runtime@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.5.1.tgz#4896003d7a334f7e8e4a53ba93fb9bcd3db0a1af" + integrity sha512-o7gxw3Gf+H2IGt8fv0RiyE1+r83FJBRruoA+FXrlHw6xEyBsU8ugA6IPfTdVyA0w8HClpbK+DGJxH59UrNMx8A== + dependencies: + "@jest/environment" "^27.5.1" + "@jest/fake-timers" "^27.5.1" + "@jest/globals" "^27.5.1" + "@jest/source-map" "^27.5.1" + "@jest/test-result" "^27.5.1" + "@jest/transform" "^27.5.1" + "@jest/types" "^27.5.1" chalk "^4.0.0" cjs-module-lexer "^1.0.0" collect-v8-coverage "^1.0.0" + execa "^5.0.0" glob "^7.1.3" graceful-fs "^4.2.9" - jest-haste-map "^29.7.0" - jest-message-util "^29.7.0" - jest-mock "^29.7.0" - jest-regex-util "^29.6.3" - jest-resolve "^29.7.0" - jest-snapshot "^29.7.0" - jest-util "^29.7.0" + jest-haste-map "^27.5.1" + jest-message-util "^27.5.1" + jest-mock "^27.5.1" + jest-regex-util "^27.5.1" + jest-resolve "^27.5.1" + jest-snapshot "^27.5.1" + jest-util "^27.5.1" slash "^3.0.0" strip-bom "^4.0.0" -jest-snapshot@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.7.0.tgz#c2c574c3f51865da1bb329036778a69bf88a6be5" - integrity sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw== +jest-serializer@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-27.5.1.tgz#81438410a30ea66fd57ff730835123dea1fb1f64" + integrity sha512-jZCyo6iIxO1aqUxpuBlwTDMkzOAJS4a3eYz3YzgxxVQFwLeSA7Jfq5cbqCY+JLvTDrWirgusI/0KwxKMgrdf7w== dependencies: - "@babel/core" "^7.11.6" + "@types/node" "*" + graceful-fs "^4.2.9" + +jest-snapshot@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.5.1.tgz#b668d50d23d38054a51b42c4039cab59ae6eb6a1" + integrity sha512-yYykXI5a0I31xX67mgeLw1DZ0bJB+gpq5IpSuCAoyDi0+BhgU/RIrL+RTzDmkNTchvDFWKP8lp+w/42Z3us5sA== + dependencies: + "@babel/core" "^7.7.2" "@babel/generator" "^7.7.2" - "@babel/plugin-syntax-jsx" "^7.7.2" "@babel/plugin-syntax-typescript" "^7.7.2" - "@babel/types" "^7.3.3" - "@jest/expect-utils" "^29.7.0" - "@jest/transform" "^29.7.0" - "@jest/types" "^29.6.3" + "@babel/traverse" "^7.7.2" + "@babel/types" "^7.0.0" + "@jest/transform" "^27.5.1" + "@jest/types" "^27.5.1" + "@types/babel__traverse" "^7.0.4" + "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^29.7.0" + expect "^27.5.1" graceful-fs "^4.2.9" - jest-diff "^29.7.0" - jest-get-type "^29.6.3" - jest-matcher-utils "^29.7.0" - jest-message-util "^29.7.0" - jest-util "^29.7.0" + jest-diff "^27.5.1" + jest-get-type "^27.5.1" + jest-haste-map "^27.5.1" + jest-matcher-utils "^27.5.1" + jest-message-util "^27.5.1" + jest-util "^27.5.1" natural-compare "^1.4.0" - pretty-format "^29.7.0" - semver "^7.5.3" + pretty-format "^27.5.1" + semver "^7.3.2" + +jest-util@^27.0.0, jest-util@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.5.1.tgz#3ba9771e8e31a0b85da48fe0b0891fb86c01c2f9" + integrity sha512-Kv2o/8jNvX1MQ0KGtw480E/w4fBCDOnH6+6DmeKi6LZUIlKA5kwY0YNdlzaWTiVgxqAqik11QyxDOKk543aKXw== + dependencies: + "@jest/types" "^27.5.1" + "@types/node" "*" + chalk "^4.0.0" + ci-info "^3.2.0" + graceful-fs "^4.2.9" + picomatch "^2.2.3" -jest-util@^29.0.0, jest-util@^29.7.0: +jest-util@^29.7.0: version "29.7.0" resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.7.0.tgz#23c2b62bfb22be82b44de98055802ff3710fc0bc" integrity sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA== @@ -17066,32 +16908,40 @@ jest-util@^29.0.0, jest-util@^29.7.0: graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-validate@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.7.0.tgz#7bf705511c64da591d46b15fce41400d52147d9c" - integrity sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw== +jest-validate@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.5.1.tgz#9197d54dc0bdb52260b8db40b46ae668e04df067" + integrity sha512-thkNli0LYTmOI1tDB3FI1S1RTp/Bqyd9pTarJwL87OIBFuqEb5Apv5EaApEudYg4g86e3CT6kM0RowkhtEnCBQ== dependencies: - "@jest/types" "^29.6.3" + "@jest/types" "^27.5.1" camelcase "^6.2.0" chalk "^4.0.0" - jest-get-type "^29.6.3" + jest-get-type "^27.5.1" leven "^3.1.0" - pretty-format "^29.7.0" + pretty-format "^27.5.1" -jest-watcher@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.7.0.tgz#7810d30d619c3a62093223ce6bb359ca1b28a2f2" - integrity sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g== +jest-watcher@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.5.1.tgz#71bd85fb9bde3a2c2ec4dc353437971c43c642a2" + integrity sha512-z676SuD6Z8o8qbmEGhoEUFOM1+jfEiL3DXHK/xgEiG2EyNYfFG60jluWcupY6dATjfEsKQuibReS1djInQnoVw== dependencies: - "@jest/test-result" "^29.7.0" - "@jest/types" "^29.6.3" + "@jest/test-result" "^27.5.1" + "@jest/types" "^27.5.1" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" - emittery "^0.13.1" - jest-util "^29.7.0" + jest-util "^27.5.1" string-length "^4.0.1" +jest-worker@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.5.1.tgz#8d146f0900e8973b106b6f73cc1e9a8cb86f8db0" + integrity sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg== + dependencies: + "@types/node" "*" + merge-stream "^2.0.0" + supports-color "^8.0.0" + jest-worker@^29.7.0: version "29.7.0" resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.7.0.tgz#acad073acbbaeb7262bd5389e1bcf43e10058d4a" @@ -17102,15 +16952,14 @@ jest-worker@^29.7.0: merge-stream "^2.0.0" supports-color "^8.0.0" -jest@29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest/-/jest-29.7.0.tgz#994676fc24177f088f1c5e3737f5697204ff2613" - integrity sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw== +jest@27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest/-/jest-27.5.1.tgz#dadf33ba70a779be7a6fc33015843b51494f63fc" + integrity sha512-Yn0mADZB89zTtjkPJEXwrac3LHudkQMR+Paqa8uxJHCBr9agxztUifWCyiYrjhMPBoUVBjyny0I7XH6ozDr7QQ== dependencies: - "@jest/core" "^29.7.0" - "@jest/types" "^29.6.3" + "@jest/core" "^27.5.1" import-local "^3.0.2" - jest-cli "^29.7.0" + jest-cli "^27.5.1" jiti@^1.17.1: version "1.20.0" @@ -17214,7 +17063,7 @@ jsdom-worker@^0.3.0: mitt "^3.0.0" uuid-v4 "^0.1.0" -jsdom@16.7.0: +jsdom@^16.6.0: version "16.7.0" resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-16.7.0.tgz#918ae71965424b197c819f8183a754e18977b710" integrity sha512-u9Smc2G1USStM+s/x1ru5Sxrl6mPYCbByG1U/hUmqaVsm4tbNyS7CicOSRyuGQYZhTu0h84qkZZQ/I+dzizSVw== @@ -17252,11 +17101,6 @@ jsesc@^2.5.1: resolved "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz" integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== -jsesc@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-3.0.2.tgz#bb8b09a6597ba426425f2e4a07245c3d00b9343e" - integrity sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g== - jsesc@~0.5.0: version "0.5.0" resolved "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz" @@ -17311,16 +17155,6 @@ json-stable-stringify-without-jsonify@^1.0.1: resolved "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz" integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== -json-stable-stringify@^1.0.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.1.1.tgz#52d4361b47d49168bcc4e564189a42e5a7439454" - integrity sha512-SU/971Kt5qVQfJpyDveVhQ/vya+5hvrjClFOcr8c0Fq5aODJjMwutrOfCU+eCnVD5gpx1Q3fEqkyom77zH1iIg== - dependencies: - call-bind "^1.0.5" - isarray "^2.0.5" - jsonify "^0.0.1" - object-keys "^1.1.1" - json-stream@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/json-stream/-/json-stream-1.0.0.tgz" @@ -17339,6 +17173,11 @@ json-to-pretty-yaml@^1.2.2: remedial "^1.0.7" remove-trailing-spaces "^1.0.6" +json5@2.x, json5@^2.2.0, json5@^2.2.2, json5@^2.2.3: + version "2.2.3" + resolved "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz" + integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== + json5@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz" @@ -17346,11 +17185,6 @@ json5@^1.0.2: dependencies: minimist "^1.2.0" -json5@^2.2.0, json5@^2.2.2, json5@^2.2.3: - version "2.2.3" - resolved "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz" - integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== - jsonc-parser@3.2.0: version "3.2.0" resolved "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz" @@ -17372,11 +17206,6 @@ jsonfile@^6.0.1: optionalDependencies: graceful-fs "^4.1.6" -jsonify@^0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.1.tgz#2aa3111dae3d34a0f151c63f3a45d995d9420978" - integrity sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg== - jsonparse@^1.2.0, jsonparse@^1.3.1: version "1.3.1" resolved "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz" @@ -17894,7 +17723,7 @@ lodash.isundefined@^3.0.1: resolved "https://registry.npmjs.org/lodash.isundefined/-/lodash.isundefined-3.0.1.tgz" integrity sha512-MXB1is3s899/cD8jheYYE2V9qTHwKvt+npCwpD+1Sxm3Q3cECXCiYHjeHWXNwr6Q0SOBPrYUDxendrO6goVTEA== -lodash.memoize@^4.1.2: +lodash.memoize@4.x: version "4.1.2" resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" integrity sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag== @@ -18108,13 +17937,6 @@ magic-string@^0.27.0: dependencies: "@jridgewell/sourcemap-codec" "^1.4.13" -magic-string@^0.29.0: - version "0.29.0" - resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.29.0.tgz#f034f79f8c43dba4ae1730ffb5e8c4e084b16cf3" - integrity sha512-WcfidHrDjMY+eLjlU+8OvwREqHwpgCeKVBUpQ3OhYYuvfaYCUgcbuBzappNzZvg/v8onU3oQj+BYpkOJe9Iw4Q== - dependencies: - "@jridgewell/sourcemap-codec" "^1.4.13" - magic-string@^0.30.0: version "0.30.5" resolved "https://registry.npmjs.org/magic-string/-/magic-string-0.30.5.tgz" @@ -18144,7 +17966,7 @@ make-dir@^3.0.2: dependencies: semver "^6.0.0" -make-error@^1.1.1, make-error@^1.3.2, make-error@^1.3.6: +make-error@1.x, make-error@^1.1.1, make-error@^1.3.2: version "1.3.6" resolved "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== @@ -19331,9 +19153,9 @@ nullthrows@^1.1.1: integrity sha512-2vPPEi+Z7WqML2jZYddDIfy5Dqb0r2fze2zTxNNknZaFpVHU3mFB3R+DWeJWGVx0ecvttSGlJTI+WG+8Z4cDWw== nwsapi@^2.2.0: - version "2.2.13" - resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.13.tgz#e56b4e98960e7a040e5474536587e599c4ff4655" - integrity sha512-cTGB9ptp9dY9A5VbMSe7fQBcl/tt22Vcqdq8+eN93rblOuE0aCFu4aZ2vMwct/2t+lFnosm8RkQW1I0Omb1UtQ== + version "2.2.7" + resolved "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.7.tgz" + integrity sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ== nx@19.0.5, "nx@>=17.1.2 < 20": version "19.0.5" @@ -19723,7 +19545,7 @@ p-finally@^1.0.0: resolved "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz" integrity sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow== -p-limit@3.1.0, p-limit@^3.0.2, p-limit@^3.1.0: +p-limit@3.1.0, p-limit@^3.0.2: version "3.1.0" resolved "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz" integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== @@ -19931,7 +19753,7 @@ parse5-htmlparser2-tree-adapter@^7.0.0: parse5@6.0.1: version "6.0.1" - resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" + resolved "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz" integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw== parse5@^7.0.0: @@ -20432,6 +20254,15 @@ pretty-format@^26.0.0, pretty-format@^26.6.2: ansi-styles "^4.0.0" react-is "^17.0.1" +pretty-format@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.5.1.tgz#2181879fdea51a7a5851fb39d920faa63f01d88e" + integrity sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ== + dependencies: + ansi-regex "^5.0.1" + ansi-styles "^5.0.0" + react-is "^17.0.1" + pretty-format@^29.7.0: version "29.7.0" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.7.0.tgz#ca42c758310f365bfa71a0bda0a807160b776812" @@ -20572,11 +20403,9 @@ pseudomap@^1.0.2: integrity sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ== psl@^1.1.33: - version "1.10.0" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.10.0.tgz#1450f7e16f922c3beeb7bd9db3f312635018fa15" - integrity sha512-KSKHEbjAnpUuAUserOq0FxGXCUrzC3WniuSJhvdbs102rL55266ZcHBqLWOsG30spQMlPdpy7icATiAQehg/iA== - dependencies: - punycode "^2.3.1" + version "1.9.0" + resolved "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz" + integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag== pstree.remy@^1.1.8: version "1.1.8" @@ -20627,11 +20456,6 @@ punycode@^2.1.0, punycode@^2.1.1: resolved "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz" integrity sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA== -punycode@^2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" - integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== - puppeteer-core@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/puppeteer-core/-/puppeteer-core-2.1.1.tgz#e9b3fbc1237b4f66e25999832229e9db3e0b90ed" @@ -20648,11 +20472,6 @@ puppeteer-core@^2.1.1: rimraf "^2.6.1" ws "^6.1.0" -pure-rand@^6.0.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/pure-rand/-/pure-rand-6.1.0.tgz#d173cf23258231976ccbdb05247c9787957604f2" - integrity sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA== - pvtsutils@^1.3.2, pvtsutils@^1.3.5: version "1.3.5" resolved "https://registry.npmjs.org/pvtsutils/-/pvtsutils-1.3.5.tgz" @@ -20718,7 +20537,7 @@ querystring@^0.2.1: querystringify@^2.1.1: version "2.2.0" - resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6" + resolved "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz" integrity sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ== queue-microtask@^1.2.2: @@ -21636,7 +21455,7 @@ require-main-filename@^2.0.0: requires-port@^1.0.0: version "1.0.0" - resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" + resolved "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz" integrity sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ== reselect@^4.1.8: @@ -21681,17 +21500,17 @@ resolve-pkg-maps@^1.0.0: resolved "https://registry.yarnpkg.com/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz#616b3dc2c57056b5588c31cdf4b3d64db133720f" integrity sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw== -resolve.exports@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-2.0.2.tgz#f8c934b8e6a13f539e38b7098e2e36134f01e800" - integrity sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg== +resolve.exports@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-1.1.1.tgz#05cfd5b3edf641571fd46fa608b610dda9ead999" + integrity sha512-/NtpHNDN7jWhAaQ9BvBUYZ6YTXsRBgfqWFWP7BZBaoMJO/I3G5OFzvTuWNlZC3aPjins1F+TNrLKsGbH4rfsRQ== resolve@1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" integrity sha512-9znBF0vBcaSN3W2j7wKvdERPwqTxSpCq+if5C0WoTCyV9n24rua28jeuQ2pL/HOf+yUe/Mef+H/5p60K0Id3bg== -resolve@^1.1.5, resolve@^1.10.0, resolve@^1.12.0, resolve@^1.14.2, resolve@^1.19.0, resolve@^1.20.0, resolve@^1.22.1, resolve@^1.22.4: +resolve@^1.1.5, resolve@^1.10.0, resolve@^1.12.0, resolve@^1.14.2, resolve@^1.20.0, resolve@^1.22.1, resolve@^1.22.4: version "1.22.8" resolved "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz" integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== @@ -21964,7 +21783,7 @@ sax@>=0.6.0, sax@^1.2.4: saxes@^5.0.1: version "5.0.1" - resolved "https://registry.yarnpkg.com/saxes/-/saxes-5.0.1.tgz#eebab953fa3b7608dbe94e5dadb15c888fa6696d" + resolved "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz" integrity sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw== dependencies: xmlchars "^2.2.0" @@ -22022,28 +21841,23 @@ seedrandom@3.x.x: resolved "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz" integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== -semver@^6.0.0, semver@^6.3.0, semver@^6.3.1: - version "6.3.1" - resolved "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz" - integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== - -semver@^7.0.0, semver@^7.1.1, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.5.3, semver@^7.5.4: +semver@7.x, semver@^7.0.0, semver@^7.1.1, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.5.3, semver@^7.5.4: version "7.5.4" resolved "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz" integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== dependencies: lru-cache "^6.0.0" +semver@^6.0.0, semver@^6.3.0, semver@^6.3.1: + version "6.3.1" + resolved "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz" + integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== + semver@^7.3.8: version "7.6.2" resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.2.tgz#1e3b34759f896e8f14d6134732ce798aeb0c6e13" integrity sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w== -semver@^7.6.3: - version "7.6.3" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" - integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== - send@0.19.0: version "0.19.0" resolved "https://registry.yarnpkg.com/send/-/send-0.19.0.tgz#bbc5a388c8ea6c048967049dbeac0e4a3f09d7f8" @@ -22458,14 +22272,6 @@ source-map-js@^1.2.1: resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.1.tgz#1ce5650fddd87abc099eda37dcff024c2667ae46" integrity sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA== -source-map-support@0.5.13: - version "0.5.13" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.13.tgz#31b24a9c2e73c2de85066c0feb7d44767ed52932" - integrity sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - source-map-support@0.5.x, source-map-support@^0.5.16, source-map-support@^0.5.17, source-map-support@^0.5.6, source-map-support@~0.5.20: version "0.5.21" resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz" @@ -22474,7 +22280,7 @@ source-map-support@0.5.x, source-map-support@^0.5.16, source-map-support@^0.5.17 buffer-from "^1.0.0" source-map "^0.6.0" -source-map@0.7.x, source-map@^0.7.2: +source-map@0.7.x, source-map@^0.7.2, source-map@^0.7.3: version "0.7.4" resolved "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz" integrity sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA== @@ -22787,16 +22593,7 @@ string-similarity@^4.0.1: resolved "https://registry.npmjs.org/string-similarity/-/string-similarity-4.0.4.tgz" integrity sha512-/q/8Q4Bl4ZKAPjj8WerIBJWALKkaPRfrvhfF8k/B23i4nzrlRj2/go1m90In7nG/3XDSbOo0+pu6RvCTM9RGMQ== -"string-width-cjs@npm:string-width@^4.2.0": - version "4.2.3" - resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -22956,7 +22753,7 @@ stringify-object@^3.3.0: is-obj "^1.0.1" is-regexp "^1.0.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -22977,13 +22774,6 @@ strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - strip-ansi@^7.0.1, strip-ansi@^7.1.0: version "7.1.0" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz" @@ -23227,7 +23017,7 @@ supports-color@^8.0.0, supports-color@^8.1.1: dependencies: has-flag "^4.0.0" -supports-hyperlinks@^2.3.0: +supports-hyperlinks@^2.0.0, supports-hyperlinks@^2.3.0: version "2.3.0" resolved "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.3.0.tgz" integrity sha512-RpsAZlpWcDwOPQA22aCH4J0t7L8JmAvsCxfOSEwm7cQs3LshN36QaTkwd70DnBOXDWGssw2eUoc8CaRWT0XunA== @@ -23276,7 +23066,7 @@ symbol-observable@^4.0.0: symbol-tree@^3.2.4: version "3.2.4" - resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" + resolved "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz" integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== synchronous-promise@^2.0.15: @@ -23406,6 +23196,14 @@ tempy@^1.0.1: type-fest "^0.16.0" unique-string "^2.0.0" +terminal-link@^2.0.0: + version "2.1.1" + resolved "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz" + integrity sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ== + dependencies: + ansi-escapes "^4.2.1" + supports-hyperlinks "^2.0.0" + terser@^5.17.4: version "5.31.0" resolved "https://registry.yarnpkg.com/terser/-/terser-5.31.0.tgz#06eef86f17007dbad4593f11a574c7f5eb02c6a1" @@ -23483,6 +23281,11 @@ thread-stream@^0.15.1: dependencies: real-require "^0.1.0" +throat@^6.0.1: + version "6.0.2" + resolved "https://registry.yarnpkg.com/throat/-/throat-6.0.2.tgz#51a3fbb5e11ae72e2cf74861ed5c8020f89f29fe" + integrity sha512-WKexMoJj3vEuK0yFEapj8y64V0A6xcuPuK9Gt1d0R+dzCSJc0lHqQytAbSB4cDAK0dWh4T0E2ETkoLE2WZ41OQ== + through2@^2.0.0, through2@^2.0.1, through2@^2.0.3, through2@~2.0.3: version "2.0.5" resolved "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz" @@ -23624,9 +23427,9 @@ touch@^3.1.0: nopt "~1.0.10" tough-cookie@^4.0.0: - version "4.1.4" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.1.4.tgz#945f1461b45b5a8c76821c33ea49c3ac192c1b36" - integrity sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag== + version "4.1.3" + resolved "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz" + integrity sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw== dependencies: psl "^1.1.33" punycode "^2.1.1" @@ -23642,7 +23445,7 @@ tr46@^1.0.1: tr46@^2.1.0: version "2.1.0" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-2.1.0.tgz#fa87aa81ca5d5941da8cbf1f9b749dc969a4e240" + resolved "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz" integrity sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw== dependencies: punycode "^2.1.1" @@ -23708,20 +23511,19 @@ ts-invariant@^0.4.0: dependencies: tslib "^1.9.3" -ts-jest@29.2.5: - version "29.2.5" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-29.2.5.tgz#591a3c108e1f5ebd013d3152142cb5472b399d63" - integrity sha512-KD8zB2aAZrcKIdGk4OwpJggeLcH1FgrICqDSROWqlnJXGCXK4Mn6FcdK2B6670Xr73lHMG1kHw8R87A0ecZ+vA== +ts-jest@27.1.4: + version "27.1.4" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-27.1.4.tgz#84d42cf0f4e7157a52e7c64b1492c46330943e00" + integrity sha512-qjkZlVPWVctAezwsOD1OPzbZ+k7zA5z3oxII4dGdZo5ggX/PL7kvwTM0pXTr10fAtbiVpJaL3bWd502zAhpgSQ== dependencies: - bs-logger "^0.2.6" - ejs "^3.1.10" - fast-json-stable-stringify "^2.1.0" - jest-util "^29.0.0" - json5 "^2.2.3" - lodash.memoize "^4.1.2" - make-error "^1.3.6" - semver "^7.6.3" - yargs-parser "^21.1.1" + bs-logger "0.x" + fast-json-stable-stringify "2.x" + jest-util "^27.0.0" + json5 "2.x" + lodash.memoize "4.x" + make-error "1.x" + semver "7.x" + yargs-parser "20.x" ts-log@^2.2.3: version "2.2.5" @@ -23810,11 +23612,6 @@ tslib@2.0.1: resolved "https://registry.npmjs.org/tslib/-/tslib-2.0.1.tgz" integrity sha512-SgIkNheinmEBgx1IUNirK0TUD4X9yjjBRTqqjggWCU3pUEqIk3/Uwl3yRixYKT6WjQuGiwDv4NomL3wqRCj+CQ== -tslib@2.4.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" - integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== - tslib@2.6.2, tslib@^2.0.0, tslib@^2.0.1, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.3.0, tslib@^2.3.1, tslib@^2.4.0, tslib@^2.5.0, tslib@^2.6.1, tslib@^2.6.2: version "2.6.2" resolved "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz" @@ -24030,15 +23827,27 @@ typed-array-length@^1.0.5, typed-array-length@^1.0.6: is-typed-array "^1.1.13" possible-typed-array-names "^1.0.0" +typedarray-to-buffer@^3.1.5: + version "3.1.5" + resolved "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz" + integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q== + dependencies: + is-typedarray "^1.0.0" + typedarray@^0.0.6: version "0.0.6" resolved "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz" integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA== -typescript@5.6.3, "typescript@^4.7 || 5", "typescript@>=3 < 6": - version "5.6.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.6.3.tgz#5f3449e31c9d94febb17de03cc081dd56d81db5b" - integrity sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw== +typescript@4.9.5, typescript@^4.5: + version "4.9.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" + integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== + +"typescript@>=3 < 6": + version "5.4.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.4.5.tgz#42ccef2c571fdbd0f6718b1d1f5e6e5ef006f611" + integrity sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ== typical@^2.6.1: version "2.6.1" @@ -24120,13 +23929,6 @@ unicode-canonical-property-names-ecmascript@^2.0.0: resolved "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz" integrity sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ== -unicode-emoji-utils@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/unicode-emoji-utils/-/unicode-emoji-utils-1.2.0.tgz#4f9452fcab0e3816ff1d93412d06ee1a1ba2cdc0" - integrity sha512-djUB91p/6oYpgps4W5K/MAvM+UspoAANHSUW495BrxeLRoned3iNPEDQgrKx9LbLq93VhNz0NWvI61vcfrwYoA== - dependencies: - emoji-regex "10.3.0" - unicode-match-property-ecmascript@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz" @@ -24221,7 +24023,7 @@ universalify@^0.1.0: universalify@^0.2.0: version "0.2.0" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.2.0.tgz#6451760566fa857534745ab1dde952d1b1761be0" + resolved "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz" integrity sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg== universalify@^2.0.0: @@ -24274,7 +24076,7 @@ update-browserslist-db@^1.0.13: escalade "^3.1.1" picocolors "^1.0.0" -update-browserslist-db@^1.1.0, update-browserslist-db@^1.1.1: +update-browserslist-db@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz#80846fba1d79e82547fb661f8d141e0945755fe5" integrity sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A== @@ -24313,7 +24115,7 @@ uri-js@^4.2.2: url-parse@^1.5.3: version "1.5.10" - resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.10.tgz#9d3c2f736c1d75dd3bd2be507dcc111f1e2ea9c1" + resolved "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz" integrity sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ== dependencies: querystringify "^2.1.1" @@ -24417,6 +24219,15 @@ v8-compile-cache@^2.0.3, v8-compile-cache@^2.3.0: resolved "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.4.0.tgz" integrity sha512-ocyWc3bAHBB/guyqJQVI5o4BZkPhznPYUG2ea80Gond/BgNWpap8TOmLSeeQG7bnh2KMISxskdADG59j7zruhw== +v8-to-istanbul@^8.1.0: + version "8.1.1" + resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-8.1.1.tgz#77b752fd3975e31bbcef938f85e9bd1c7a8d60ed" + integrity sha512-FGtKtv3xIpR6BYhvgH8MI/y78oT7d8Au3ww4QIxymrCtZEh5b8gCw2siywE+puhEmuWKDtmfrvF5UlB298ut3w== + dependencies: + "@types/istanbul-lib-coverage" "^2.0.1" + convert-source-map "^1.6.0" + source-map "^0.7.3" + v8-to-istanbul@^9.0.0: version "9.1.3" resolved "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.3.tgz" @@ -24426,15 +24237,6 @@ v8-to-istanbul@^9.0.0: "@types/istanbul-lib-coverage" "^2.0.1" convert-source-map "^2.0.0" -v8-to-istanbul@^9.0.1: - version "9.3.0" - resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz#b9572abfa62bd556c16d75fdebc1a411d5ff3175" - integrity sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA== - dependencies: - "@jridgewell/trace-mapping" "^0.3.12" - "@types/istanbul-lib-coverage" "^2.0.1" - convert-source-map "^2.0.0" - validate-npm-package-license@3.0.4, validate-npm-package-license@^3.0.1, validate-npm-package-license@^3.0.4: version "3.0.4" resolved "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz" @@ -24507,17 +24309,6 @@ victory-vendor@^36.6.8: d3-time "^3.0.0" d3-timer "^3.0.1" -vite-plugin-babel-macros@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/vite-plugin-babel-macros/-/vite-plugin-babel-macros-1.0.6.tgz#d05cee3c38c620ccb534e38f412fdd899a3365b5" - integrity sha512-7cCT8jtu5UjpE46pH7RyVltWw5FbhDAtQliZ6QGqRNR5RUZKdAsB0CDjuF+VBoDpnl0KuESPu22SoNqXRYYWyQ== - dependencies: - "@babel/core" "^7.17.7" - "@babel/plugin-syntax-jsx" "^7.16.7" - "@babel/plugin-syntax-typescript" "^7.16.7" - "@types/babel__core" "^7.1.18" - babel-plugin-macros "^3.1.0" - vite-plugin-pwa@^0.20.0: version "0.20.0" resolved "https://registry.yarnpkg.com/vite-plugin-pwa/-/vite-plugin-pwa-0.20.0.tgz#1785c8cc8c11c89c0ba8c6557f29e2b58b14dd6d" @@ -24640,19 +24431,19 @@ vitest@0.25.8, vitest@^0.25.5: w3c-hr-time@^1.0.2: version "1.0.2" - resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz#0a89cdf5cc15822df9c360543676963e0cc308cd" + resolved "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz" integrity sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ== dependencies: browser-process-hrtime "^1.0.0" w3c-xmlserializer@^2.0.0: version "2.0.0" - resolved "https://registry.yarnpkg.com/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz#3e7104a05b75146cc60f564380b7f683acf1020a" + resolved "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz" integrity sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA== dependencies: xml-name-validator "^3.0.0" -walker@^1.0.8: +walker@^1.0.7, walker@^1.0.8: version "1.0.8" resolved "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz" integrity sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ== @@ -24723,12 +24514,12 @@ webidl-conversions@^4.0.2: webidl-conversions@^5.0.0: version "5.0.0" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-5.0.0.tgz#ae59c8a00b121543a2acc65c0434f57b0fc11aff" + resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz" integrity sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA== webidl-conversions@^6.1.0: version "6.1.0" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-6.1.0.tgz#9111b4d7ea80acd40f5270d666621afa78b69514" + resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz" integrity sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w== webidl-conversions@^7.0.0: @@ -24755,7 +24546,7 @@ webpack-virtual-modules@^0.5.0: whatwg-encoding@^1.0.5: version "1.0.5" - resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0" + resolved "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz" integrity sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw== dependencies: iconv-lite "0.4.24" @@ -24767,7 +24558,7 @@ whatwg-fetch@^2.0.4: whatwg-mimetype@^2.3.0: version "2.3.0" - resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" + resolved "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz" integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== whatwg-mimetype@^3.0.0: @@ -24802,7 +24593,7 @@ whatwg-url@^7.0.0: whatwg-url@^8.0.0, whatwg-url@^8.5.0: version "8.7.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-8.7.0.tgz#656a78e510ff8f3937bc0bcbe9f5c0ac35941b77" + resolved "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.7.0.tgz" integrity sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg== dependencies: lodash "^4.7.0" @@ -25117,7 +24908,7 @@ workbox-window@7.1.0, workbox-window@^7.1.0: "@types/trusted-types" "^2.0.2" workbox-core "7.1.0" -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -25144,15 +24935,6 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^8.0.1, wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz" @@ -25193,6 +24975,16 @@ write-file-atomic@^2.3.0, write-file-atomic@^2.4.2: imurmurhash "^0.1.4" signal-exit "^3.0.2" +write-file-atomic@^3.0.0: + version "3.0.3" + resolved "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz" + integrity sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q== + dependencies: + imurmurhash "^0.1.4" + is-typedarray "^1.0.0" + signal-exit "^3.0.2" + typedarray-to-buffer "^3.1.5" + write-file-atomic@^4.0.2: version "4.0.2" resolved "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz" @@ -25230,9 +25022,9 @@ ws@^6.1.0: async-limiter "~1.0.0" ws@^7.4.6: - version "7.5.10" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.10.tgz#58b5c20dc281633f6c19113f39b349bd8bd558d9" - integrity sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ== + version "7.5.9" + resolved "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz" + integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q== ws@^8.12.0, ws@^8.2.3: version "8.14.2" @@ -25246,7 +25038,7 @@ ws@^8.13.0, ws@^8.15.0: xml-name-validator@^3.0.0: version "3.0.0" - resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" + resolved "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz" integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw== xml2js@^0.5.0: @@ -25269,7 +25061,7 @@ xmlbuilder@~11.0.0: xmlchars@^2.2.0: version "2.2.0" - resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" + resolved "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz" integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw== xmldoc@^1.1.2: @@ -25349,6 +25141,11 @@ yaml@~2.5.0: resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.5.1.tgz#c9772aacf62cb7494a95b0c4f1fb065b563db130" integrity sha512-bLQOjaX/ADgQ20isPJRvF0iRUHIxVhYvr53Of7wGcWlO2jvtUlH5m87DsmulFVxRpNLOnI4tB6p/oh8D7kpn9Q== +yargs-parser@20.x, yargs-parser@^20.2.2, yargs-parser@^20.2.3, yargs-parser@^20.2.9: + version "20.2.9" + resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz" + integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== + yargs-parser@21.1.1, yargs-parser@^21.1.1: version "21.1.1" resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz" @@ -25370,11 +25167,6 @@ yargs-parser@^18.1.2: camelcase "^5.0.0" decamelize "^1.2.0" -yargs-parser@^20.2.2, yargs-parser@^20.2.3, yargs-parser@^20.2.9: - version "20.2.9" - resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz" - integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== - yargs@17.7.2, yargs@^17.0.0, yargs@^17.3.1, yargs@^17.6.2, yargs@^17.7.2: version "17.7.2" resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269" From d657f151bf6de3b316b77f09c9f9df07ef704048 Mon Sep 17 00:00:00 2001 From: Markus Date: Fri, 15 Nov 2024 10:00:52 +0200 Subject: [PATCH 47/50] fix(practitioner-role-code): create migrations for unifying role format --- ...e-practitioner-role-type-to-string-json.ts | 29 ++++ ...tioner-role-history-type-to-string-json.ts | 27 ++++ packages/migration/src/utils/role-helper.ts | 147 ++++++++++++++++++ 3 files changed, 203 insertions(+) create mode 100644 packages/migration/src/migrations/hearth/20241114142053-update-practitioner-role-type-to-string-json.ts create mode 100644 packages/migration/src/migrations/hearth/20241114153937-update-practitioner-role-history-type-to-string-json.ts create mode 100644 packages/migration/src/utils/role-helper.ts diff --git a/packages/migration/src/migrations/hearth/20241114142053-update-practitioner-role-type-to-string-json.ts b/packages/migration/src/migrations/hearth/20241114142053-update-practitioner-role-type-to-string-json.ts new file mode 100644 index 00000000000..0ff6f6a0407 --- /dev/null +++ b/packages/migration/src/migrations/hearth/20241114142053-update-practitioner-role-type-to-string-json.ts @@ -0,0 +1,29 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * OpenCRVS is also distributed under the terms of the Civil Registration + * & Healthcare Disclaimer located at http://opencrvs.org/license. + * + * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. + */ + +import { + nonJSONRoleStringFilter, + updatePractitionerRoleCodeAggregate +} from '../../utils/role-helper.js' +import { Db } from 'mongodb' + +/** + * Fill out PractitionerRole "type system code" with the correct JSON format. + * Migration is partially done on packages/migration/src/migrations/hearth/20230127063226-update-practitioner-role.ts + * Depending on which version we are migrating from, it might not have targeted all cases. + */ +export const up = async (db: Db) => { + await db + .collection('PractitionerRole') + .updateMany(nonJSONRoleStringFilter, updatePractitionerRoleCodeAggregate) +} + +export const down = async (db: Db) => {} diff --git a/packages/migration/src/migrations/hearth/20241114153937-update-practitioner-role-history-type-to-string-json.ts b/packages/migration/src/migrations/hearth/20241114153937-update-practitioner-role-history-type-to-string-json.ts new file mode 100644 index 00000000000..1c5f8b58da6 --- /dev/null +++ b/packages/migration/src/migrations/hearth/20241114153937-update-practitioner-role-history-type-to-string-json.ts @@ -0,0 +1,27 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * OpenCRVS is also distributed under the terms of the Civil Registration + * & Healthcare Disclaimer located at http://opencrvs.org/license. + * + * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. + */ + +import { + nonJSONRoleStringFilter, + updatePractitionerRoleCodeAggregate +} from '../../utils/role-helper.js' +import { Db } from 'mongodb' + +/** + * Fill out PractitionerRole_history "type system code" with the correct JSON format. + * Migration was partially done on packages/migration/src/migrations/hearth/20230127063226-update-practitioner-role.ts against PractitionerRole. + */ +export const up = async (db: Db) => { + await db + .collection('PractitionerRole_history') + .updateMany(nonJSONRoleStringFilter, updatePractitionerRoleCodeAggregate) +} +export const down = async (db: Db) => {} diff --git a/packages/migration/src/utils/role-helper.ts b/packages/migration/src/utils/role-helper.ts new file mode 100644 index 00000000000..d340871ad44 --- /dev/null +++ b/packages/migration/src/utils/role-helper.ts @@ -0,0 +1,147 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * OpenCRVS is also distributed under the terms of the Civil Registration + * & Healthcare Disclaimer located at http://opencrvs.org/license. + * + * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. + */ + +export const userRoleLabels = { + FIELD_AGENT: [ + { label: 'Field Agent', lang: 'en' }, + { label: 'Agent de terrain', lang: 'fr' } + ], + REGISTRATION_AGENT: [ + { label: 'Registration Agent', lang: 'en' }, + { label: "Agent d'enregistrement", lang: 'fr' } + ], + LOCAL_REGISTRAR: [ + { label: 'Local Registrar', lang: 'en' }, + { label: 'Registraire local', lang: 'fr' } + ], + LOCAL_SYSTEM_ADMIN: [ + { label: 'Local System Admin', lang: 'en' }, + { label: 'Administrateur système local', lang: 'fr' } + ], + NATIONAL_SYSTEM_ADMIN: [ + { label: 'National System Admin', lang: 'en' }, + { label: 'Administrateur système national', lang: 'fr' } + ], + PERFORMANCE_MANAGEMENT: [ + { label: 'Performance Management', lang: 'en' }, + { label: 'Gestion des performances', lang: 'fr' } + ], + NATIONAL_REGISTRAR: [ + { label: 'National Registrar', lang: 'en' }, + { label: 'Registraire national', lang: 'fr' } + ] +} as const + +const typeSystemUrl = 'http://opencrvs.org/specs/types' +const roleSystemUrl = 'http://opencrvs.org/specs/roles' + +const userRoleSystemCodes = Object.keys(userRoleLabels) + +/** + * During the lifetime of the platform, format has changed from `ROLE_NAME` -> 'Role Name' -> { label: 'Role Name', lang: 'en' }. + * Find the ones not matching the latest format. + */ +export const nonJSONRoleStringFilter = { + 'code.coding': { + $elemMatch: { + system: roleSystemUrl, + code: { + $in: userRoleSystemCodes + } + } + }, + $or: [ + { + 'code.coding.system': { + $ne: typeSystemUrl + } + }, + { + 'code.coding': { + $elemMatch: { + system: typeSystemUrl, + code: { + $not: { + $regex: /^\[\{/ + } + } + } + } + } + ] +} + +/** + * Update role code to JSON string format + */ +export const updatePractitionerRoleCodeAggregate = [ + { + $addFields: { + code: { + $filter: { + input: '$code', + as: 'item', + cond: { + $not: { + $in: [ + typeSystemUrl, + { + $map: { + input: '$$item.coding', + as: 'coding', + in: '$$coding.system' + } + } + ] + } + } + } + } + } + }, + { + $addFields: { + code: { + $concatArrays: [ + '$code', + [ + { + coding: [ + { + system: typeSystemUrl, + code: { + $function: { + body: `function (code) { + const userRoleLabels = ${JSON.stringify( + userRoleLabels + )} + + return JSON.stringify(userRoleLabels[code]) + }`, + args: [ + { + $first: { + $first: '$code.coding.code' + } + } + ], + lang: 'js' + } + } + } + ] + } + ] + ] + } + } + } +] From 7e8d6c36c04c4b1d4be59283e2aa5e8da199dd96 Mon Sep 17 00:00:00 2001 From: Riku Rouvila Date: Fri, 15 Nov 2024 10:09:14 +0200 Subject: [PATCH 48/50] add release branches to vulnerability scanning --- .github/workflows/security-scans.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/security-scans.yml b/.github/workflows/security-scans.yml index 28b02d131be..e4f75a727c1 100644 --- a/.github/workflows/security-scans.yml +++ b/.github/workflows/security-scans.yml @@ -12,7 +12,9 @@ on: push: branches: - develop + - release-* pull_request: + workflow_dispatch: schedule: # Run every day at midnight - cron: '0 0 * * *' From c6d4cd6582a6a7ec69201df4294843d88cbf2905 Mon Sep 17 00:00:00 2001 From: Riku Rouvila Date: Fri, 15 Nov 2024 10:16:22 +0200 Subject: [PATCH 49/50] add manual security scanning job --- .github/workflows/security-scans.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/security-scans.yml b/.github/workflows/security-scans.yml index e4f75a727c1..b843033c6d2 100644 --- a/.github/workflows/security-scans.yml +++ b/.github/workflows/security-scans.yml @@ -49,6 +49,20 @@ jobs: scan-ref: '.' trivy-config: trivy.yaml + security-scan-manual: + if: github.event_name == 'workflow_dispatch' + runs-on: ubuntu-22.04 + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Run Trivy vulnerability scanner in fs mode + uses: aquasecurity/trivy-action@0.28.0 + with: + scan-type: 'fs' + scan-ref: '.' + trivy-config: trivy.yaml + security-scan-pull-request: if: github.event_name == 'pull_request' runs-on: ubuntu-22.04 From eb2894aee2f82586c359a4c2668d3af8b99f14ff Mon Sep 17 00:00:00 2001 From: Riku Rouvila Date: Mon, 18 Nov 2024 12:24:49 +0200 Subject: [PATCH 50/50] Events v2: Add some first structure for new events (#8002) --- packages/client/src/App.tsx | 7 + .../components/form/FormFieldGenerator.tsx | 1 + packages/client/src/v2-events/.eslintrc.js | 20 + packages/client/src/v2-events/index.ts | 12 + packages/client/src/v2-events/routes.ts | 11 + packages/client/src/v2-events/useEvents.ts | 12 + .../client/src/v2-events/workqueues/index.tsx | 16 + packages/events/.eslintrc.js | 24 + packages/events/.gitignore | 21 + packages/events/Dockerfile | 12 + packages/events/Dockerfile.dockerignore | 21 + packages/events/package.json | 51 +++ packages/events/src/environment.ts | 16 + packages/events/src/index.test.ts | 48 ++ packages/events/src/index.ts | 25 ++ packages/events/src/router.ts | 45 ++ packages/events/src/service/events.ts | 150 +++++++ .../events/src/storage/__mocks__/mongodb.ts | 31 ++ packages/events/src/storage/index.ts | 12 + packages/events/src/storage/mongodb.ts | 22 + packages/events/tsconfig.json | 25 ++ packages/events/vitest.config.ts | 18 + packages/gateway/src/v2-events/.eslintrc.js | 20 + yarn.lock | 421 +++++++++++++++++- 24 files changed, 1037 insertions(+), 4 deletions(-) create mode 100644 packages/client/src/v2-events/.eslintrc.js create mode 100644 packages/client/src/v2-events/index.ts create mode 100644 packages/client/src/v2-events/routes.ts create mode 100644 packages/client/src/v2-events/useEvents.ts create mode 100644 packages/client/src/v2-events/workqueues/index.tsx create mode 100644 packages/events/.eslintrc.js create mode 100644 packages/events/.gitignore create mode 100644 packages/events/Dockerfile create mode 100644 packages/events/Dockerfile.dockerignore create mode 100644 packages/events/package.json create mode 100644 packages/events/src/environment.ts create mode 100644 packages/events/src/index.test.ts create mode 100644 packages/events/src/index.ts create mode 100644 packages/events/src/router.ts create mode 100644 packages/events/src/service/events.ts create mode 100644 packages/events/src/storage/__mocks__/mongodb.ts create mode 100644 packages/events/src/storage/index.ts create mode 100644 packages/events/src/storage/mongodb.ts create mode 100644 packages/events/tsconfig.json create mode 100644 packages/events/vitest.config.ts create mode 100644 packages/gateway/src/v2-events/.eslintrc.js diff --git a/packages/client/src/App.tsx b/packages/client/src/App.tsx index 78e43a12276..6123a7fbb50 100644 --- a/packages/client/src/App.tsx +++ b/packages/client/src/App.tsx @@ -70,6 +70,8 @@ import { ReviewCorrection } from './views/ReviewCorrection/ReviewCorrection' import { ReviewCertificate } from './views/PrintCertificate/ReviewCertificateAction' import AllUserEmail from './views/SysAdmin/Communications/AllUserEmail/AllUserEmail' import { ReloadModal } from './views/Modals/ReloadModal' +import { Workqueues } from './v2-events/workqueues' +import { V2_ROOT_ROUTE } from './v2-events/routes' interface IAppProps { client?: ApolloClient @@ -537,6 +539,11 @@ export function App(props: IAppProps) { path={routes.PRINT_RECORD} component={PrintRecord} /> + diff --git a/packages/client/src/components/form/FormFieldGenerator.tsx b/packages/client/src/components/form/FormFieldGenerator.tsx index 098afd461ad..384c9f62b43 100644 --- a/packages/client/src/components/form/FormFieldGenerator.tsx +++ b/packages/client/src/components/form/FormFieldGenerator.tsx @@ -1160,6 +1160,7 @@ class FormSectionComponent extends React.Component { } const nestedFieldName = `${field.name}.nestedFields.${nestedField.name}` + const nestedFieldTouched = touched[field.name] && (touched[field.name] as unknown as ITouchedNestedFields) diff --git a/packages/client/src/v2-events/.eslintrc.js b/packages/client/src/v2-events/.eslintrc.js new file mode 100644 index 00000000000..bef662819b6 --- /dev/null +++ b/packages/client/src/v2-events/.eslintrc.js @@ -0,0 +1,20 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * OpenCRVS is also distributed under the terms of the Civil Registration + * & Healthcare Disclaimer located at http://opencrvs.org/license. + * + * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. + */ +module.exports = { + rules: { + 'no-restricted-imports': [ + 'error', + { + patterns: ['@client/*', '!@client/v2-events', '!@client/components'] + } + ] + } +} diff --git a/packages/client/src/v2-events/index.ts b/packages/client/src/v2-events/index.ts new file mode 100644 index 00000000000..9634905e3f9 --- /dev/null +++ b/packages/client/src/v2-events/index.ts @@ -0,0 +1,12 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * OpenCRVS is also distributed under the terms of the Civil Registration + * & Healthcare Disclaimer located at http://opencrvs.org/license. + * + * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. + */ + +export function noop() {} diff --git a/packages/client/src/v2-events/routes.ts b/packages/client/src/v2-events/routes.ts new file mode 100644 index 00000000000..4fdd9235d68 --- /dev/null +++ b/packages/client/src/v2-events/routes.ts @@ -0,0 +1,11 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * OpenCRVS is also distributed under the terms of the Civil Registration + * & Healthcare Disclaimer located at http://opencrvs.org/license. + * + * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. + */ +export const V2_ROOT_ROUTE = '/v2' diff --git a/packages/client/src/v2-events/useEvents.ts b/packages/client/src/v2-events/useEvents.ts new file mode 100644 index 00000000000..9634905e3f9 --- /dev/null +++ b/packages/client/src/v2-events/useEvents.ts @@ -0,0 +1,12 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * OpenCRVS is also distributed under the terms of the Civil Registration + * & Healthcare Disclaimer located at http://opencrvs.org/license. + * + * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. + */ + +export function noop() {} diff --git a/packages/client/src/v2-events/workqueues/index.tsx b/packages/client/src/v2-events/workqueues/index.tsx new file mode 100644 index 00000000000..60483d5a7da --- /dev/null +++ b/packages/client/src/v2-events/workqueues/index.tsx @@ -0,0 +1,16 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * OpenCRVS is also distributed under the terms of the Civil Registration + * & Healthcare Disclaimer located at http://opencrvs.org/license. + * + * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. + */ + +import React from 'react' + +export function Workqueues() { + return
This is where it starts from
+} diff --git a/packages/events/.eslintrc.js b/packages/events/.eslintrc.js new file mode 100644 index 00000000000..5bcd96d91fc --- /dev/null +++ b/packages/events/.eslintrc.js @@ -0,0 +1,24 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * OpenCRVS is also distributed under the terms of the Civil Registration + * & Healthcare Disclaimer located at http://opencrvs.org/license. + * + * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. + */ +module.exports = { + extends: '../../.eslintrc.js', + env: { + es6: true + }, + overrides: [ + { + files: ['*.ts'], + parserOptions: { + project: ['./tsconfig.json'] + } + } + ] +} diff --git a/packages/events/.gitignore b/packages/events/.gitignore new file mode 100644 index 00000000000..d30f40ef442 --- /dev/null +++ b/packages/events/.gitignore @@ -0,0 +1,21 @@ +# See https://help.github.com/ignore-files/ for more about ignoring files. + +# dependencies +/node_modules + +# testing +/coverage + +# production +/build + +# misc +.DS_Store +.env.local +.env.development.local +.env.test.local +.env.production.local + +npm-debug.log* +yarn-debug.log* +yarn-error.log* diff --git a/packages/events/Dockerfile b/packages/events/Dockerfile new file mode 100644 index 00000000000..74591820232 --- /dev/null +++ b/packages/events/Dockerfile @@ -0,0 +1,12 @@ +ARG BRANCH=develop +FROM opencrvs/ocrvs-base:${BRANCH} + +USER node + +WORKDIR /app/packages/events +COPY --chown=node:node packages/events/*.json /app/packages/events/ +RUN yarn install --frozen-lockfile +COPY --chown=node:node packages/events /app/packages/events +RUN yarn build + +CMD [ "yarn", "start:prod" ] \ No newline at end of file diff --git a/packages/events/Dockerfile.dockerignore b/packages/events/Dockerfile.dockerignore new file mode 100644 index 00000000000..d7287797dfb --- /dev/null +++ b/packages/events/Dockerfile.dockerignore @@ -0,0 +1,21 @@ +*.md +*.yml +*.yaml +.vscode +**/.git +**/test + +# From root +**/node_modules +**/coverage +**/.DS_Store +**/.env +**/*.log +.secrets/* +data +grafana + +# Exclude unused packages +packages/* +!packages/commons +!packages/events diff --git a/packages/events/package.json b/packages/events/package.json new file mode 100644 index 00000000000..a8cded785eb --- /dev/null +++ b/packages/events/package.json @@ -0,0 +1,51 @@ +{ + "name": "@opencrvs/events", + "version": "1.5.0", + "description": "OpenCRVS Events service", + "license": "MPL-2.0", + "private": true, + "scripts": { + "start": "cross-env NODE_ENV=development NODE_OPTIONS=--dns-result-order=ipv4first nodemon --exec ts-node -r tsconfig-paths/register src/index.ts", + "start:prod": "TS_NODE_BASEURL=./build/dist/src node -r tsconfig-paths/register build/dist/src/index.js", + "test": "yarn test:compilation && vitest run", + "lint": "eslint -c .eslintrc.js --fix ./src --max-warnings=0", + "precommit": "lint-staged", + "test:compilation": "tsc --noEmit", + "build": "tsc", + "build:clean": "rm -rf build" + }, + "dependencies": { + "@opencrvs/commons": "^1.3.0", + "@trpc/server": "^11.0.0-rc.532", + "app-module-path": "^2.2.0", + "envalid": "^8.0.0", + "mongodb": "6.9.0", + "superjson": "1.9.0-0", + "tsconfig-paths": "^3.13.0", + "zod": "^3.23.8" + }, + "devDependencies": { + "@typescript-eslint/eslint-plugin": "^4.5.0", + "@typescript-eslint/parser": "^4.5.0", + "cross-env": "^7.0.0", + "eslint": "^7.11.0", + "vite-tsconfig-paths": "^3.5.0", + "eslint-config-prettier": "^9.0.0", + "eslint-plugin-import": "^2.17.3", + "eslint-plugin-prettier": "^4.0.0", + "lint-staged": "^15.0.0", + "mongodb-memory-server": "^10.1.2", + "nodemon": "^3.0.0", + "prettier": "2.8.8", + "ts-jest": "27.1.4", + "ts-node": "^6.1.1", + "typescript": "4.9.5", + "vitest": "^2.1.5" + }, + "lint-staged": { + "src/**/*.{ts,graphql}": [ + "prettier --write", + "eslint -c .eslintrc.js --fix" + ] + } +} diff --git a/packages/events/src/environment.ts b/packages/events/src/environment.ts new file mode 100644 index 00000000000..5bf2d07fb4b --- /dev/null +++ b/packages/events/src/environment.ts @@ -0,0 +1,16 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * OpenCRVS is also distributed under the terms of the Civil Registration + * & Healthcare Disclaimer located at http://opencrvs.org/license. + * + * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. + */ + +import { cleanEnv, url } from 'envalid' + +export const env = cleanEnv(process.env, { + MONGO_URL: url({ devDefault: 'mongodb://localhost/events' }) +}) diff --git a/packages/events/src/index.test.ts b/packages/events/src/index.test.ts new file mode 100644 index 00000000000..f3690e08bd6 --- /dev/null +++ b/packages/events/src/index.test.ts @@ -0,0 +1,48 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * OpenCRVS is also distributed under the terms of the Civil Registration + * & Healthcare Disclaimer located at http://opencrvs.org/license. + * + * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. + */ +import { vi } from 'vitest' +import { appRouter, t } from './router' +import { + setupServer, + getClient, + resetServer +} from './storage/__mocks__/mongodb' + +const { createCallerFactory } = t + +vi.mock('@events/storage/mongodb') + +beforeAll(async () => { + await setupServer() +}) + +afterEach(async () => { + resetServer() +}) + +test('creating a declaration is an idempotent operation', async () => { + const createCaller = createCallerFactory(appRouter) + + const caller = createCaller({}) + const db = await getClient() + + await caller.event.create({ + transactionId: '1', + record: { type: 'birth', fields: [] } + }) + + await caller.event.create({ + transactionId: '1', + record: { type: 'birth', fields: [] } + }) + + expect(await db.collection('events').find().toArray()).toHaveLength(1) +}) diff --git a/packages/events/src/index.ts b/packages/events/src/index.ts new file mode 100644 index 00000000000..94bcad50752 --- /dev/null +++ b/packages/events/src/index.ts @@ -0,0 +1,25 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * OpenCRVS is also distributed under the terms of the Civil Registration + * & Healthcare Disclaimer located at http://opencrvs.org/license. + * + * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. + */ + +// eslint-disable-next-line import/no-unassigned-import +import '@opencrvs/commons/monitoring' + +// eslint-disable-next-line @typescript-eslint/no-var-requires +require('app-module-path').addPath(require('path').join(__dirname, '../')) + +import { appRouter } from './router' +import { createHTTPServer } from '@trpc/server/adapters/standalone' + +const server = createHTTPServer({ + router: appRouter +}) + +server.listen(5555) diff --git a/packages/events/src/router.ts b/packages/events/src/router.ts new file mode 100644 index 00000000000..e94a3eaf249 --- /dev/null +++ b/packages/events/src/router.ts @@ -0,0 +1,45 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * OpenCRVS is also distributed under the terms of the Civil Registration + * & Healthcare Disclaimer located at http://opencrvs.org/license. + * + * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. + */ + +import { initTRPC } from '@trpc/server' +import superjson from 'superjson' +import { z } from 'zod' +import { createEvent, EventInput, getEventById } from './service/events' + +export const t = initTRPC.create({ + transformer: superjson +}) + +const router = t.router +const publicProcedure = t.procedure + +/** + * @public + */ +export type AppRouter = typeof appRouter + +export const appRouter = router({ + event: router({ + create: publicProcedure + .input( + z.object({ + transactionId: z.string(), + record: EventInput + }) + ) + .mutation(async (options) => { + return createEvent(options.input.record, options.input.transactionId) + }), + get: publicProcedure.input(z.string()).query(async ({ input }) => { + return getEventById(input) + }) + }) +}) diff --git a/packages/events/src/service/events.ts b/packages/events/src/service/events.ts new file mode 100644 index 00000000000..cdba3f7e7e8 --- /dev/null +++ b/packages/events/src/service/events.ts @@ -0,0 +1,150 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * OpenCRVS is also distributed under the terms of the Civil Registration + * & Healthcare Disclaimer located at http://opencrvs.org/license. + * + * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. + */ + +import { getClient } from '@events/storage/mongodb' +import { getUUID } from '@opencrvs/commons' +import { z } from 'zod' + +export const EventInput = z.object({ + type: z.string(), + fields: z.array( + z.object({ + id: z.string(), + value: z.union([ + z.string(), + z.number(), + z.array( + z.object({ + optionValues: z.array(z.string()), + type: z.string(), + data: z.string(), + fileSize: z.number() + }) + ) + ]) + }) + ) +}) + +const ActionBase = z.object({ + type: z.enum([ + 'CREATED', + 'ASSIGNMENT', + 'UNASSIGNMENT', + 'REGISTERED', + 'VALIDATED', + 'CORRECTION', + 'DUPLICATES_DETECTED' + ]), + createdAt: z.date(), + createdBy: z.string(), + fields: z.array( + z.object({ + id: z.string(), + value: z.union([ + z.string(), + z.number(), + z.array( + z.object({ + optionValues: z.array(z.string()), + type: z.string(), + data: z.string(), + fileSize: z.number() + }) + ) + ]) + }) + ) +}) + +const Action = z.union([ + ActionBase.extend({ + type: z.enum(['CREATED']) + }), + ActionBase.extend({ + type: z.enum(['REGISTERED']), + identifiers: z.object({ + trackingId: z.string(), + registrationNumber: z.string() + }) + }) +]) + +export const Event = EventInput.extend({ + id: z.string(), + type: z.string(), // Should be replaced by a reference to a form version + createdAt: z.date(), + actions: z.array(Action) +}) +export type Event = z.infer + +const EventWithTransactionId = Event.extend({ + transactionId: z.string() +}) + +async function getEventByTransactionId(transactionId: string) { + const db = await getClient() + const collection = + db.collection>('events') + + const document = await collection.findOne({ transactionId }) + + return document +} +class EventNotFoundError extends Error { + constructor(id: string) { + super('Event not found with ID: ' + id) + } +} + +export async function getEventById(id: string) { + const db = await getClient() + const collection = db.collection>('events') + const event = await collection.findOne({ id: id }) + if (!event) { + throw new EventNotFoundError(id) + } + return event +} + +export async function createEvent( + eventInput: z.infer, + transactionId: string +): Promise { + const existingEvent = await getEventByTransactionId(transactionId) + if (existingEvent) { + return existingEvent + } + + const db = await getClient() + const collection = + db.collection>('events') + + const now = new Date() + const id = getUUID() + + await collection.insertOne({ + ...eventInput, + id, + transactionId, + createdAt: now, + actions: [ + { + type: 'CREATED', + createdAt: now, + createdBy: '123-123-123', + fields: [] + } + ] + }) + + return getEventById(id) +} diff --git a/packages/events/src/storage/__mocks__/mongodb.ts b/packages/events/src/storage/__mocks__/mongodb.ts new file mode 100644 index 00000000000..e8bcc3539b5 --- /dev/null +++ b/packages/events/src/storage/__mocks__/mongodb.ts @@ -0,0 +1,31 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * OpenCRVS is also distributed under the terms of the Civil Registration + * & Healthcare Disclaimer located at http://opencrvs.org/license. + * + * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. + */ +import { MongoMemoryServer } from 'mongodb-memory-server' +import { MongoClient } from 'mongodb' + +let server: MongoMemoryServer +let databaseName = 'events_' + Date.now() + +export async function setupServer() { + server = await MongoMemoryServer.create() +} + +export async function resetServer() { + databaseName = 'events_' + Date.now() +} + +export async function getClient() { + const uri = server.getUri() + const client = new MongoClient(uri) + await client.connect() + + return client.db(databaseName) +} diff --git a/packages/events/src/storage/index.ts b/packages/events/src/storage/index.ts new file mode 100644 index 00000000000..2f5099328f3 --- /dev/null +++ b/packages/events/src/storage/index.ts @@ -0,0 +1,12 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * OpenCRVS is also distributed under the terms of the Civil Registration + * & Healthcare Disclaimer located at http://opencrvs.org/license. + * + * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. + */ + +export * from './mongodb' diff --git a/packages/events/src/storage/mongodb.ts b/packages/events/src/storage/mongodb.ts new file mode 100644 index 00000000000..8704b24df87 --- /dev/null +++ b/packages/events/src/storage/mongodb.ts @@ -0,0 +1,22 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * OpenCRVS is also distributed under the terms of the Civil Registration + * & Healthcare Disclaimer located at http://opencrvs.org/license. + * + * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. + */ + +import { env } from '@events/environment' +import { MongoClient } from 'mongodb' + +const url = env.MONGO_URL +const client = new MongoClient(url) + +export async function getClient() { + await client.connect() + const db = client.db('events') + return db +} diff --git a/packages/events/tsconfig.json b/packages/events/tsconfig.json new file mode 100644 index 00000000000..b2b2050756c --- /dev/null +++ b/packages/events/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "baseUrl": "./src", + "strict": true, + "paths": { "@events/*": ["./*"] }, + "target": "es6", + "module": "commonjs", + "outDir": "build/dist", + "sourceMap": true, + "allowSyntheticDefaultImports": true, + "skipLibCheck": true, + "moduleResolution": "node", + "rootDir": ".", + "lib": ["esnext.asynciterable", "es6", "es2017"], + "forceConsistentCasingInFileNames": true, + "noImplicitReturns": true, + "noImplicitThis": true, + "noImplicitAny": true, + "strictNullChecks": true, + "noUnusedLocals": true, + "types": ["fhir", "jest"] + }, + "include": ["src/**/*.ts", "typings", "tslint-rules"], + "exclude": ["node_modules", "build", "scripts", "acceptance-tests"] +} diff --git a/packages/events/vitest.config.ts b/packages/events/vitest.config.ts new file mode 100644 index 00000000000..6e5b83777ab --- /dev/null +++ b/packages/events/vitest.config.ts @@ -0,0 +1,18 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * OpenCRVS is also distributed under the terms of the Civil Registration + * & Healthcare Disclaimer located at http://opencrvs.org/license. + * + * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. + */ +import { defineConfig } from 'vitest/config' +import tsconfigPaths from 'vite-tsconfig-paths' +export default defineConfig({ + plugins: [tsconfigPaths()], + test: { + globals: true + } +}) diff --git a/packages/gateway/src/v2-events/.eslintrc.js b/packages/gateway/src/v2-events/.eslintrc.js new file mode 100644 index 00000000000..67df70de721 --- /dev/null +++ b/packages/gateway/src/v2-events/.eslintrc.js @@ -0,0 +1,20 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * OpenCRVS is also distributed under the terms of the Civil Registration + * & Healthcare Disclaimer located at http://opencrvs.org/license. + * + * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. + */ +module.exports = { + rules: { + 'no-restricted-imports': [ + 'error', + { + patterns: ['@gateway/*', '!@gateway/v2-events'] + } + ] + } +} diff --git a/yarn.lock b/yarn.lock index 7921d4f2588..33209c89bf1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5248,6 +5248,11 @@ resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz" integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== +"@jridgewell/sourcemap-codec@^1.5.0": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz#3188bcb273a414b0d215fd22a58540b989b9409a" + integrity sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ== + "@jridgewell/trace-mapping@0.3.9": version "0.3.9" resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz" @@ -5372,6 +5377,13 @@ dependencies: sparse-bitfield "^3.0.3" +"@mongodb-js/saslprep@^1.1.5": + version "1.1.9" + resolved "https://registry.yarnpkg.com/@mongodb-js/saslprep/-/saslprep-1.1.9.tgz#e974bab8eca9faa88677d4ea4da8d09a52069004" + integrity sha512-tVkljjeEaAhCqTzajSdgbQ6gE6f3oneVwa3iXR6csiEwXXOFsiC6Uh9iAjAhXPtqa/XMDHWjjeNH/77m/Yq2dw== + dependencies: + sparse-bitfield "^3.0.3" + "@msgpackr-extract/msgpackr-extract-darwin-arm64@3.0.2": version "3.0.2" resolved "https://registry.yarnpkg.com/@msgpackr-extract/msgpackr-extract-darwin-arm64/-/msgpackr-extract-darwin-arm64-3.0.2.tgz#44d752c1a2dc113f15f781b7cc4f53a307e3fa38" @@ -7764,6 +7776,11 @@ resolved "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz" integrity sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A== +"@trpc/server@^11.0.0-rc.532": + version "11.0.0-rc.604" + resolved "https://registry.yarnpkg.com/@trpc/server/-/server-11.0.0-rc.604.tgz#99929ca7840fe1d01f0adefe35536d66778f02bd" + integrity sha512-JXn6XbheQwj2tWqKnAlWhGnIo6F7cSYWQ3SgPXdq+MCYKJBuSYrurj5NvreNCVAkVZmftjyUlIV+Hs2/se4GNg== + "@tsconfig/node10@^1.0.7": version "1.0.9" resolved "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz" @@ -8881,6 +8898,13 @@ resolved "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.3.tgz" integrity sha512-CiJJvcRtIgzadHCYXw7dqEnMNRjhGZlYK05Mj9OyktqV8uVT8fD2BFOB7S1uwBE3Kj2Z+4UyPmFw/Ixgw/LAlA== +"@types/whatwg-url@^11.0.2": + version "11.0.5" + resolved "https://registry.yarnpkg.com/@types/whatwg-url/-/whatwg-url-11.0.5.tgz#aaa2546e60f0c99209ca13360c32c78caf2c409f" + integrity sha512-coYR071JRaHa+xoEvvYqvnIHaVqaYrLPbsufM9BF63HkwI5Lgmy2QR8Q5K/lYDYo5AK82wOvSOS0UsLTpTG7uQ== + dependencies: + "@types/webidl-conversions" "*" + "@types/whatwg-url@^8.2.1": version "8.2.2" resolved "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-8.2.2.tgz" @@ -9060,6 +9084,65 @@ c8 "^7.12.0" vitest "0.25.8" +"@vitest/expect@2.1.5": + version "2.1.5" + resolved "https://registry.yarnpkg.com/@vitest/expect/-/expect-2.1.5.tgz#5a6afa6314cae7a61847927bb5bc038212ca7381" + integrity sha512-nZSBTW1XIdpZvEJyoP/Sy8fUg0b8od7ZpGDkTUcfJ7wz/VoZAFzFfLyxVxGFhUjJzhYqSbIpfMtl/+k/dpWa3Q== + dependencies: + "@vitest/spy" "2.1.5" + "@vitest/utils" "2.1.5" + chai "^5.1.2" + tinyrainbow "^1.2.0" + +"@vitest/mocker@2.1.5": + version "2.1.5" + resolved "https://registry.yarnpkg.com/@vitest/mocker/-/mocker-2.1.5.tgz#54ee50648bc0bb606dfc58e13edfacb8b9208324" + integrity sha512-XYW6l3UuBmitWqSUXTNXcVBUCRytDogBsWuNXQijc00dtnU/9OqpXWp4OJroVrad/gLIomAq9aW8yWDBtMthhQ== + dependencies: + "@vitest/spy" "2.1.5" + estree-walker "^3.0.3" + magic-string "^0.30.12" + +"@vitest/pretty-format@2.1.5", "@vitest/pretty-format@^2.1.5": + version "2.1.5" + resolved "https://registry.yarnpkg.com/@vitest/pretty-format/-/pretty-format-2.1.5.tgz#bc79b8826d4a63dc04f2a75d2944694039fa50aa" + integrity sha512-4ZOwtk2bqG5Y6xRGHcveZVr+6txkH7M2e+nPFd6guSoN638v/1XQ0K06eOpi0ptVU/2tW/pIU4IoPotY/GZ9fw== + dependencies: + tinyrainbow "^1.2.0" + +"@vitest/runner@2.1.5": + version "2.1.5" + resolved "https://registry.yarnpkg.com/@vitest/runner/-/runner-2.1.5.tgz#4d5e2ba2dfc0af74e4b0f9f3f8be020559b26ea9" + integrity sha512-pKHKy3uaUdh7X6p1pxOkgkVAFW7r2I818vHDthYLvUyjRfkKOU6P45PztOch4DZarWQne+VOaIMwA/erSSpB9g== + dependencies: + "@vitest/utils" "2.1.5" + pathe "^1.1.2" + +"@vitest/snapshot@2.1.5": + version "2.1.5" + resolved "https://registry.yarnpkg.com/@vitest/snapshot/-/snapshot-2.1.5.tgz#a09a8712547452a84e08b3ec97b270d9cc156b4f" + integrity sha512-zmYw47mhfdfnYbuhkQvkkzYroXUumrwWDGlMjpdUr4jBd3HZiV2w7CQHj+z7AAS4VOtWxI4Zt4bWt4/sKcoIjg== + dependencies: + "@vitest/pretty-format" "2.1.5" + magic-string "^0.30.12" + pathe "^1.1.2" + +"@vitest/spy@2.1.5": + version "2.1.5" + resolved "https://registry.yarnpkg.com/@vitest/spy/-/spy-2.1.5.tgz#f790d1394a5030644217ce73562e92465e83147e" + integrity sha512-aWZF3P0r3w6DiYTVskOYuhBc7EMc3jvn1TkBg8ttylFFRqNN2XGD7V5a4aQdk6QiUzZQ4klNBSpCLJgWNdIiNw== + dependencies: + tinyspy "^3.0.2" + +"@vitest/utils@2.1.5": + version "2.1.5" + resolved "https://registry.yarnpkg.com/@vitest/utils/-/utils-2.1.5.tgz#0e19ce677c870830a1573d33ee86b0d6109e9546" + integrity sha512-yfj6Yrp0Vesw2cwJbP+cl04OC+IHFsuQsrsJBL9pyGeQXE56v1UAOQco+SR55Vf1nQzfV0QJg1Qum7AaWUwwYg== + dependencies: + "@vitest/pretty-format" "2.1.5" + loupe "^3.1.2" + tinyrainbow "^1.2.0" + "@whatwg-node/events@^0.0.3": version "0.0.3" resolved "https://registry.npmjs.org/@whatwg-node/events/-/events-0.0.3.tgz" @@ -9965,6 +10048,11 @@ assertion-error@^1.1.0: resolved "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz" integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== +assertion-error@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-2.0.1.tgz#f641a196b335690b1070bf00b6e7593fec190bf7" + integrity sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA== + ast-transform@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/ast-transform/-/ast-transform-0.0.0.tgz#74944058887d8283e189d954600947bc98fe0062" @@ -10013,6 +10101,13 @@ async-lock@^1.4.0: resolved "https://registry.npmjs.org/async-lock/-/async-lock-1.4.0.tgz" integrity sha512-coglx5yIWuetakm3/1dsX9hxCNox22h7+V80RQOu2XUUMidtArxKoZoOtHUPuR84SycKTXzgGzAUR5hJxujyJQ== +async-mutex@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/async-mutex/-/async-mutex-0.5.0.tgz#353c69a0b9e75250971a64ac203b0ebfddd75482" + integrity sha512-1A94B18jkJ3DYq284ohPxoXbfTA5HsQ7/Mf4DEhcyLx3Bz27Rh59iScbB6EPiP+B+joue6YCxcMXSbFC1tZKwA== + dependencies: + tslib "^2.4.0" + async-retry@^1.2.1: version "1.3.3" resolved "https://registry.npmjs.org/async-retry/-/async-retry-1.3.3.tgz" @@ -10102,6 +10197,11 @@ axobject-query@~3.1.1: dependencies: deep-equal "^2.0.5" +b4a@^1.6.4: + version "1.6.7" + resolved "https://registry.yarnpkg.com/b4a/-/b4a-1.6.7.tgz#a99587d4ebbfbd5a6e3b21bdb5d5fa385767abe4" + integrity sha512-OnAYlL5b7LEkALw87fUVafQw5rVR9RjwGd4KUwNQ6DrrNmaVaUCgLipfVlzrPQ4tWOR9P0IXGNOx50jYCCdSJg== + babel-core@^7.0.0-bridge.0: version "7.0.0-bridge.0" resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-7.0.0-bridge.0.tgz#95a492ddd90f9b4e9a4a1da14eb335b87b634ece" @@ -10315,6 +10415,11 @@ balanced-match@^2.0.0: resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-2.0.0.tgz" integrity sha512-1ugUSr8BHXRnK23KfuYS+gVMC3LB8QGH9W1iGtDPsNWoQbgtXSExkBu2aDR4epiGWZOjZsj6lDl/N/AqqTC3UA== +bare-events@^2.2.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/bare-events/-/bare-events-2.5.0.tgz#305b511e262ffd8b9d5616b056464f8e1b3329cc" + integrity sha512-/E8dDe9dsbLyh2qrZ64PEPadOQ0F4gbl1sUJOrmph7xOiIxfY8vwab/4bFLh4Y88/Hk/ujKcrQKc+ps0mv873A== + base64-js@1.3.1: version "1.3.1" resolved "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz" @@ -10607,6 +10712,11 @@ bson@^4.7.2: dependencies: buffer "^5.6.0" +bson@^6.7.0: + version "6.9.0" + resolved "https://registry.yarnpkg.com/bson/-/bson-6.9.0.tgz#2be50049430dceaa9300402520fe03e4ed5fdfd6" + integrity sha512-X9hJeyeM0//Fus+0pc5dSUMhhrrmWwQUtdavaQeF3Ta6m69matZkGWV/MrBcnwUeLC8W9kwwc2hfkZgUuCX3Ig== + buffer-crc32@^0.2.1, buffer-crc32@^0.2.13, buffer-crc32@~0.2.3: version "0.2.13" resolved "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz" @@ -10735,6 +10845,11 @@ c8@^7.12.0: yargs "^16.2.0" yargs-parser "^20.2.9" +cac@^6.7.14: + version "6.7.14" + resolved "https://registry.yarnpkg.com/cac/-/cac-6.7.14.tgz#804e1e6f506ee363cb0e3ccbb09cad5dd9870959" + integrity sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ== + cacache@^17.0.0: version "17.1.4" resolved "https://registry.npmjs.org/cacache/-/cacache-17.1.4.tgz" @@ -10841,7 +10956,7 @@ camelcase@^5.0.0, camelcase@^5.3.1: resolved "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== -camelcase@^6.2.0: +camelcase@^6.2.0, camelcase@^6.3.0: version "6.3.0" resolved "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== @@ -10893,6 +11008,17 @@ chai@^4.3.6, chai@^4.3.7: pathval "^1.1.1" type-detect "^4.0.8" +chai@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/chai/-/chai-5.1.2.tgz#3afbc340b994ae3610ca519a6c70ace77ad4378d" + integrity sha512-aGtmf24DW6MLHHG5gCx4zaI3uBq3KRtxeVs0DjFH6Z0rDNbsvTxFASFvdj79pxjxZ8/5u3PIiN3IwEIQkiiuPw== + dependencies: + assertion-error "^2.0.1" + check-error "^2.1.1" + deep-eql "^5.0.1" + loupe "^3.1.0" + pathval "^2.0.0" + chalk-template@0.4.0: version "0.4.0" resolved "https://registry.npmjs.org/chalk-template/-/chalk-template-0.4.0.tgz" @@ -10997,6 +11123,11 @@ check-error@^1.0.3: dependencies: get-func-name "^2.0.2" +check-error@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/check-error/-/check-error-2.1.1.tgz#87eb876ae71ee388fa0471fe423f494be1d96ccc" + integrity sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw== + cheerio-select@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz" @@ -12174,7 +12305,7 @@ debug@^4: dependencies: ms "2.1.2" -debug@~4.3.6: +debug@^4.3.7, debug@~4.3.6: version "4.3.7" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.7.tgz#87945b4151a011d76d95a198d7111c865c360a52" integrity sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ== @@ -12233,6 +12364,11 @@ deep-eql@^4.1.3: dependencies: type-detect "^4.0.0" +deep-eql@^5.0.1: + version "5.0.2" + resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-5.0.2.tgz#4b756d8d770a9257300825d52a2c2cff99c3a341" + integrity sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q== + deep-equal@^1.0.0: version "1.1.1" resolved "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz" @@ -13183,6 +13319,11 @@ es-module-lexer@^0.9.3: resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-0.9.3.tgz#6f13db00cc38417137daf74366f535c8eb438f19" integrity sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ== +es-module-lexer@^1.5.4: + version "1.5.4" + resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-1.5.4.tgz#a8efec3a3da991e60efa6b633a7cad6ab8d26b78" + integrity sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw== + es-object-atoms@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/es-object-atoms/-/es-object-atoms-1.0.0.tgz#ddb55cd47ac2e240701260bc2a8e31ecb643d941" @@ -13832,6 +13973,13 @@ estree-walker@^2.0.2: resolved "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz" integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w== +estree-walker@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-3.0.3.tgz#67c3e549ec402a487b4fc193d1953a524752340d" + integrity sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g== + dependencies: + "@types/estree" "^1.0.0" + esutils@^2.0.2: version "2.0.3" resolved "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz" @@ -13937,6 +14085,11 @@ exit@^0.1.2: resolved "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz" integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ== +expect-type@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/expect-type/-/expect-type-1.1.0.tgz#a146e414250d13dfc49eafcfd1344a4060fa4c75" + integrity sha512-bFi65yM+xZgk+u/KRIpekdSYkTB5W1pEf0Lt8Q8Msh7b+eQ7LXVtIB1Bkm4fvclDEL1b2CZkMhv2mOeF8tMdkA== + expect@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/expect/-/expect-27.5.1.tgz#83ce59f1e5bdf5f9d2b94b61d2050db48f3fef74" @@ -14069,6 +14222,11 @@ fast-equals@^5.0.1: resolved "https://registry.yarnpkg.com/fast-equals/-/fast-equals-5.0.1.tgz#a4eefe3c5d1c0d021aeed0bc10ba5e0c12ee405d" integrity sha512-WF1Wi8PwwSY7/6Kx0vKXtw8RwuSGoM1bvDaJbu7MxDlR1vovZjIAKrnzyrThgAjm6JDTu0fVgWXDlMGspodfoQ== +fast-fifo@^1.2.0, fast-fifo@^1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/fast-fifo/-/fast-fifo-1.3.2.tgz#286e31de96eb96d38a97899815740ba2a4f3640c" + integrity sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ== + fast-glob@^3.0.3, fast-glob@^3.2.12, fast-glob@^3.2.9: version "3.3.1" resolved "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz" @@ -14306,7 +14464,7 @@ find-cache-dir@^2.0.0: make-dir "^2.0.0" pkg-dir "^3.0.0" -find-cache-dir@^3.0.0: +find-cache-dir@^3.0.0, find-cache-dir@^3.3.2: version "3.3.2" resolved "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz" integrity sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig== @@ -14423,6 +14581,11 @@ follow-redirects@^1.15.6: resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b" integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA== +follow-redirects@^1.15.9: + version "1.15.9" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.9.tgz#a604fa10e443bf98ca94228d9eebcc2e8a2c8ee1" + integrity sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ== + for-each@^0.3.3: version "0.3.3" resolved "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz" @@ -15533,6 +15696,14 @@ https-proxy-agent@^7.0.0, https-proxy-agent@^7.0.1: agent-base "^7.0.2" debug "4" +https-proxy-agent@^7.0.5: + version "7.0.5" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz#9e8b5013873299e11fab6fd548405da2d6c602b2" + integrity sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw== + dependencies: + agent-base "^7.0.2" + debug "4" + human-signals@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz" @@ -17494,7 +17665,7 @@ lines-and-columns@~2.0.3: resolved "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-2.0.3.tgz" integrity sha512-cNOjgCnLB+FnvWWtyRTzmB3POJ+cXxTA81LoW7u8JdmhfXzriropYwpjShnz1QLLWsQwY7nIxoDmcPTwphDK9w== -lint-staged@^15.2.10: +lint-staged@^15.0.0, lint-staged@^15.2.10: version "15.2.10" resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-15.2.10.tgz#92ac222f802ba911897dcf23671da5bb80643cd2" integrity sha512-5dY5t743e1byO19P9I4b3x8HJwalIznL5E1FWYnU6OWw33KxNBSLAc6Cy7F2PsFEO8FKnLwjwm5hx7aMF0jzZg== @@ -17840,6 +18011,11 @@ loupe@^2.3.6: dependencies: get-func-name "^2.0.1" +loupe@^3.1.0, loupe@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/loupe/-/loupe-3.1.2.tgz#c86e0696804a02218f2206124c45d8b15291a240" + integrity sha512-23I4pFZHmAemUnz8WZXbYRSKYj801VDaNv9ETuMh7IrMc7VuVVSo+Z9iLE3ni30+U48iDWfi30d3twAXBYmnCg== + lower-case-first@^2.0.2: version "2.0.2" resolved "https://registry.npmjs.org/lower-case-first/-/lower-case-first-2.0.2.tgz" @@ -17944,6 +18120,13 @@ magic-string@^0.30.0: dependencies: "@jridgewell/sourcemap-codec" "^1.4.15" +magic-string@^0.30.12: + version "0.30.12" + resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.30.12.tgz#9eb11c9d072b9bcb4940a5b2c2e1a217e4ee1a60" + integrity sha512-Ea8I3sQMVXr8JhN4z+H/d8zwo+tYDgHE9+5G4Wnrwhs0gaK9fXTKx0Tw5Xwsd/bCPTTZNRAdpyzvoeORe9LYpw== + dependencies: + "@jridgewell/sourcemap-codec" "^1.5.0" + make-dir@4.0.0, make-dir@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-4.0.0.tgz#c3c2307a771277cd9638305f915c29ae741b614e" @@ -18554,6 +18737,40 @@ mongodb-connection-string-url@^2.6.0: "@types/whatwg-url" "^8.2.1" whatwg-url "^11.0.0" +mongodb-connection-string-url@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/mongodb-connection-string-url/-/mongodb-connection-string-url-3.0.1.tgz#c13e6ac284ae401752ebafdb8cd7f16c6723b141" + integrity sha512-XqMGwRX0Lgn05TDB4PyG2h2kKO/FfWJyCzYQbIhXUxz7ETt0I/FqHjUeqj37irJ+Dl1ZtU82uYyj14u2XsZKfg== + dependencies: + "@types/whatwg-url" "^11.0.2" + whatwg-url "^13.0.0" + +mongodb-memory-server-core@10.1.2: + version "10.1.2" + resolved "https://registry.yarnpkg.com/mongodb-memory-server-core/-/mongodb-memory-server-core-10.1.2.tgz#4960f59e5c56a30dbde366ff69497b6ce5b2c4dc" + integrity sha512-5Wpz712CuDCKTn/40UZ+kMZlav4Y2imbpWuJU5wjuZk6s3+Jg8akTIBW9jQiFS8wgymu6iTg99Iw0XcypsLyQA== + dependencies: + async-mutex "^0.5.0" + camelcase "^6.3.0" + debug "^4.3.7" + find-cache-dir "^3.3.2" + follow-redirects "^1.15.9" + https-proxy-agent "^7.0.5" + mongodb "^6.9.0" + new-find-package-json "^2.0.0" + semver "^7.6.3" + tar-stream "^3.1.7" + tslib "^2.7.0" + yauzl "^3.1.3" + +mongodb-memory-server@^10.1.2: + version "10.1.2" + resolved "https://registry.yarnpkg.com/mongodb-memory-server/-/mongodb-memory-server-10.1.2.tgz#19412977dfba00af54c199bf75e34cb2a4aa9925" + integrity sha512-aDGEWuUVHTiBvaaq03LbpvvSk8IVtepbvp314p1cq7f2xdSpl7igMnYpPfYY5nkks1I5I6OL2ypHjaJj4kBp+g== + dependencies: + mongodb-memory-server-core "10.1.2" + tslib "^2.7.0" + mongodb@4.17.2, mongodb@^4.17.1: version "4.17.2" resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-4.17.2.tgz#237c0534e36a3449bd74c6bf6d32f87a1ca7200c" @@ -18566,6 +18783,24 @@ mongodb@4.17.2, mongodb@^4.17.1: "@aws-sdk/credential-providers" "^3.186.0" "@mongodb-js/saslprep" "^1.1.0" +mongodb@6.9.0: + version "6.9.0" + resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-6.9.0.tgz#743ebfff6b3c14b04ac6e00a55e30d4127d3016d" + integrity sha512-UMopBVx1LmEUbW/QE0Hw18u583PEDVQmUmVzzBRH0o/xtE9DBRA5ZYLOjpLIa03i8FXjzvQECJcqoMvCXftTUA== + dependencies: + "@mongodb-js/saslprep" "^1.1.5" + bson "^6.7.0" + mongodb-connection-string-url "^3.0.0" + +mongodb@^6.9.0: + version "6.10.0" + resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-6.10.0.tgz#20a9f1cf3c6829e75fc39e6d8c1c19f164209c2e" + integrity sha512-gP9vduuYWb9ZkDM546M+MP2qKVk5ZG2wPF63OvSRuUbqCR+11ZCAE1mOfllhlAG0wcoJY5yDL/rV3OmYEwXIzg== + dependencies: + "@mongodb-js/saslprep" "^1.1.5" + bson "^6.7.0" + mongodb-connection-string-url "^3.0.0" + mongoose@^6.11.3: version "6.13.0" resolved "https://registry.yarnpkg.com/mongoose/-/mongoose-6.13.0.tgz#465522876237e4112a895fbd1cb4a87c580bc613" @@ -18774,6 +19009,13 @@ neo-async@^2.5.0, neo-async@^2.6.2: resolved "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz" integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== +new-find-package-json@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/new-find-package-json/-/new-find-package-json-2.0.0.tgz#96553638781db35061f351e8ccb4d07126b6407d" + integrity sha512-lDcBsjBSMlj3LXH2v/FW3txlh2pYTjmbOXPYJD93HI5EwuLzI11tdHSIpUMmfq/IOsldj4Ps8M8flhm+pCK4Ew== + dependencies: + debug "^4.3.4" + next-line@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/next-line/-/next-line-1.1.0.tgz" @@ -19929,6 +20171,11 @@ pathval@^1.1.1: resolved "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz" integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== +pathval@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/pathval/-/pathval-2.0.0.tgz#7e2550b422601d4f6b8e26f1301bc8f15a741a25" + integrity sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA== + pdfmake@^0.2.5: version "0.2.7" resolved "https://registry.npmjs.org/pdfmake/-/pdfmake-0.2.7.tgz" @@ -20456,6 +20703,11 @@ punycode@^2.1.0, punycode@^2.1.1: resolved "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz" integrity sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA== +punycode@^2.3.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" + integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== + puppeteer-core@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/puppeteer-core/-/puppeteer-core-2.1.1.tgz#e9b3fbc1237b4f66e25999832229e9db3e0b90ed" @@ -20545,6 +20797,11 @@ queue-microtask@^1.2.2: resolved "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== +queue-tick@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/queue-tick/-/queue-tick-1.0.1.tgz#f6f07ac82c1fd60f82e098b417a80e52f1f4c142" + integrity sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag== + quick-format-unescaped@^4.0.3: version "4.0.4" resolved "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz" @@ -21858,6 +22115,11 @@ semver@^7.3.8: resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.2.tgz#1e3b34759f896e8f14d6134732ce798aeb0c6e13" integrity sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w== +semver@^7.6.3: + version "7.6.3" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" + integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== + send@0.19.0: version "0.19.0" resolved "https://registry.yarnpkg.com/send/-/send-0.19.0.tgz#bbc5a388c8ea6c048967049dbeac0e4a3f09d7f8" @@ -22083,6 +22345,11 @@ sift@16.0.1: resolved "https://registry.npmjs.org/sift/-/sift-16.0.1.tgz" integrity sha512-Wv6BjQ5zbhW7VFefWusVP33T/EM0vYikCaQ2qR8yULbsilAT8/wQaXvuQ3ptGLpoKx+lihJE3y2UTgKDyyNHZQ== +siginfo@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/siginfo/-/siginfo-2.0.0.tgz#32e76c70b79724e3bb567cb9d543eb858ccfaf30" + integrity sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g== + signal-exit@3.0.7, signal-exit@^3.0.2, signal-exit@^3.0.3, signal-exit@^3.0.7: version "3.0.7" resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz" @@ -22465,6 +22732,11 @@ stack-utils@^2.0.3: dependencies: escape-string-regexp "^2.0.0" +stackback@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/stackback/-/stackback-0.0.2.tgz#1ac8a0d9483848d1695e418b6d031a3c3ce68e3b" + integrity sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw== + stackframe@^1.3.4: version "1.3.4" resolved "https://registry.npmjs.org/stackframe/-/stackframe-1.3.4.tgz" @@ -22507,6 +22779,11 @@ statuses@2.0.1, statuses@^2.0.0: resolved "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz" integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== +std-env@^3.8.0: + version "3.8.0" + resolved "https://registry.yarnpkg.com/std-env/-/std-env-3.8.0.tgz#b56ffc1baf1a29dcc80a3bdf11d7fca7c315e7d5" + integrity sha512-Bc3YwwCB+OzldMxOXJIIvC6cPRWr/LxOp48CdQTOkPyk/t4JWWJbrilwBd7RJzKV8QW7tJkcgAmeuLLJugl5/w== + stop-iteration-iterator@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz#6a60be0b4ee757d1ed5254858ec66b10c49285e4" @@ -22548,6 +22825,17 @@ streamsearch@^1.1.0: resolved "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz" integrity sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg== +streamx@^2.15.0: + version "2.20.2" + resolved "https://registry.yarnpkg.com/streamx/-/streamx-2.20.2.tgz#6a8911959d6f307c19781a1d19ecd94b5f042d78" + integrity sha512-aDGDLU+j9tJcUdPGOaHmVF1u/hhI+CsGkT02V3OKlHDV7IukOI+nTWAGkiZEKCO35rWN1wIr4tS7YFr1f4qSvA== + dependencies: + fast-fifo "^1.3.2" + queue-tick "^1.0.1" + text-decoder "^1.1.0" + optionalDependencies: + bare-events "^2.2.0" + strict-event-emitter@^0.2.4: version "0.2.8" resolved "https://registry.npmjs.org/strict-event-emitter/-/strict-event-emitter-0.2.8.tgz" @@ -22991,6 +23279,14 @@ sucrase@^3.20.3: pirates "^4.0.1" ts-interface-checker "^0.1.9" +superjson@1.9.0-0: + version "1.9.0-0" + resolved "https://registry.yarnpkg.com/superjson/-/superjson-1.9.0-0.tgz#4de316ddf80a4693ec7e112882221452cde5ff3f" + integrity sha512-JZHRiW+yFgzRSqf+iwKtycGqfpLnt9ct6Oa0D6/yqDt0rD+hQZMeMdk648M+oshlyv4VLpW82ZkiMdFlairdHA== + dependencies: + debug "^4.3.1" + lodash.clonedeep "^4.5.0" + supports-color@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz" @@ -23127,6 +23423,15 @@ tar-stream@^2.0.0, tar-stream@^2.1.0, tar-stream@^2.1.4, tar-stream@^2.2.0, tar- inherits "^2.0.3" readable-stream "^3.1.1" +tar-stream@^3.1.7: + version "3.1.7" + resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-3.1.7.tgz#24b3fb5eabada19fe7338ed6d26e5f7c482e792b" + integrity sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ== + dependencies: + b4a "^1.6.4" + fast-fifo "^1.2.0" + streamx "^2.15.0" + tar@6.2.1, tar@^6.2.0: version "6.2.1" resolved "https://registry.yarnpkg.com/tar/-/tar-6.2.1.tgz#717549c541bc3c2af15751bea94b1dd068d4b03a" @@ -23245,6 +23550,11 @@ testcontainers@^9.1.1: tar-fs "^2.1.1" tmp "^0.2.1" +text-decoder@^1.1.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/text-decoder/-/text-decoder-1.2.1.tgz#e173f5121d97bfa3ff8723429ad5ba92e1ead67e" + integrity sha512-x9v3H/lTKIJKQQe7RPQkLfKAnc9lUTkWDypIQgTzPJAq+5/GCDHonmshfvlsNSj58yyshbIJJDLmU15qNERrXQ== + text-extensions@^1.0.0: version "1.9.0" resolved "https://registry.npmjs.org/text-extensions/-/text-extensions-1.9.0.tgz" @@ -23339,16 +23649,41 @@ tinybench@^2.3.1: resolved "https://registry.npmjs.org/tinybench/-/tinybench-2.5.1.tgz" integrity sha512-65NKvSuAVDP/n4CqH+a9w2kTlLReS9vhsAP06MWx+/89nMinJyB2icyl58RIcqCmIggpojIGeuJGhjU1aGMBSg== +tinybench@^2.9.0: + version "2.9.0" + resolved "https://registry.yarnpkg.com/tinybench/-/tinybench-2.9.0.tgz#103c9f8ba6d7237a47ab6dd1dcff77251863426b" + integrity sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg== + +tinyexec@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/tinyexec/-/tinyexec-0.3.1.tgz#0ab0daf93b43e2c211212396bdb836b468c97c98" + integrity sha512-WiCJLEECkO18gwqIp6+hJg0//p23HXp4S+gGtAKu3mI2F2/sXC4FvHvXvB0zJVVaTPhx1/tOwdbRsa1sOBIKqQ== + tinypool@^0.3.0: version "0.3.1" resolved "https://registry.npmjs.org/tinypool/-/tinypool-0.3.1.tgz" integrity sha512-zLA1ZXlstbU2rlpA4CIeVaqvWq41MTWqLY3FfsAXgC8+f7Pk7zroaJQxDgxn1xNudKW6Kmj4808rPFShUlIRmQ== +tinypool@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/tinypool/-/tinypool-1.0.2.tgz#706193cc532f4c100f66aa00b01c42173d9051b2" + integrity sha512-al6n+QEANGFOMf/dmUMsuS5/r9B06uwlyNjZZql/zv8J7ybHCgoihBNORZCY2mzUuAnomQa2JdhyHKzZxPCrFA== + +tinyrainbow@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/tinyrainbow/-/tinyrainbow-1.2.0.tgz#5c57d2fc0fb3d1afd78465c33ca885d04f02abb5" + integrity sha512-weEDEq7Z5eTHPDh4xjX789+fHfF+P8boiFB+0vbWzpbnbsEr/GRaohi/uMKxg8RZMXnl1ItAi/IUHWMsjDV7kQ== + tinyspy@^1.0.2: version "1.1.1" resolved "https://registry.npmjs.org/tinyspy/-/tinyspy-1.1.1.tgz" integrity sha512-UVq5AXt/gQlti7oxoIg5oi/9r0WpF7DGEVwXgqWSMmyN16+e3tl5lIvTaOpJ3TAtu5xFzWccFRM4R5NaWHF+4g== +tinyspy@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/tinyspy/-/tinyspy-3.0.2.tgz#86dd3cf3d737b15adcf17d7887c84a75201df20a" + integrity sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q== + title-case@^3.0.3: version "3.0.3" resolved "https://registry.npmjs.org/title-case/-/title-case-3.0.3.tgz" @@ -23457,6 +23792,13 @@ tr46@^3.0.0: dependencies: punycode "^2.1.1" +tr46@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-4.1.1.tgz#281a758dcc82aeb4fe38c7dfe4d11a395aac8469" + integrity sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw== + dependencies: + punycode "^2.3.0" + tr46@~0.0.3: version "0.0.3" resolved "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz" @@ -23622,6 +23964,11 @@ tslib@^1.10.0, tslib@^1.11.1, tslib@^1.13.0, tslib@^1.8.1, tslib@^1.9.3: resolved "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== +tslib@^2.7.0: + version "2.8.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f" + integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w== + tslib@~2.5.0: version "2.5.3" resolved "https://registry.npmjs.org/tslib/-/tslib-2.5.3.tgz" @@ -24309,6 +24656,17 @@ victory-vendor@^36.6.8: d3-time "^3.0.0" d3-timer "^3.0.1" +vite-node@2.1.5: + version "2.1.5" + resolved "https://registry.yarnpkg.com/vite-node/-/vite-node-2.1.5.tgz#cf28c637b2ebe65921f3118a165b7cf00a1cdf19" + integrity sha512-rd0QIgx74q4S1Rd56XIiL2cYEdyWn13cunYBIuqh9mpmQr7gGS0IxXoP8R6OaZtNQQLyXSWbd4rXKYUbhFpK5w== + dependencies: + cac "^6.7.14" + debug "^4.3.7" + es-module-lexer "^1.5.4" + pathe "^1.1.2" + vite "^5.0.0" + vite-plugin-pwa@^0.20.0: version "0.20.0" resolved "https://registry.yarnpkg.com/vite-plugin-pwa/-/vite-plugin-pwa-0.20.0.tgz#1785c8cc8c11c89c0ba8c6557f29e2b58b14dd6d" @@ -24429,6 +24787,32 @@ vitest@0.25.8, vitest@^0.25.5: tinyspy "^1.0.2" vite "^3.0.0 || ^4.0.0" +vitest@^2.1.5: + version "2.1.5" + resolved "https://registry.yarnpkg.com/vitest/-/vitest-2.1.5.tgz#a93b7b84a84650130727baae441354e6df118148" + integrity sha512-P4ljsdpuzRTPI/kbND2sDZ4VmieerR2c9szEZpjc+98Z9ebvnXmM5+0tHEKqYZumXqlvnmfWsjeFOjXVriDG7A== + dependencies: + "@vitest/expect" "2.1.5" + "@vitest/mocker" "2.1.5" + "@vitest/pretty-format" "^2.1.5" + "@vitest/runner" "2.1.5" + "@vitest/snapshot" "2.1.5" + "@vitest/spy" "2.1.5" + "@vitest/utils" "2.1.5" + chai "^5.1.2" + debug "^4.3.7" + expect-type "^1.1.0" + magic-string "^0.30.12" + pathe "^1.1.2" + std-env "^3.8.0" + tinybench "^2.9.0" + tinyexec "^0.3.1" + tinypool "^1.0.1" + tinyrainbow "^1.2.0" + vite "^5.0.0" + vite-node "2.1.5" + why-is-node-running "^2.3.0" + w3c-hr-time@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz" @@ -24574,6 +24958,14 @@ whatwg-url@^11.0.0: tr46 "^3.0.0" webidl-conversions "^7.0.0" +whatwg-url@^13.0.0: + version "13.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-13.0.0.tgz#b7b536aca48306394a34e44bda8e99f332410f8f" + integrity sha512-9WWbymnqj57+XEuqADHrCJ2eSXzn8WXIW/YSGaZtb2WKAInQ6CHfaUUcTyyver0p8BDg5StLQq8h1vtZuwmOig== + dependencies: + tr46 "^4.1.1" + webidl-conversions "^7.0.0" + whatwg-url@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz" @@ -24687,6 +25079,14 @@ which@^4.0.0: dependencies: isexe "^3.1.1" +why-is-node-running@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/why-is-node-running/-/why-is-node-running-2.3.0.tgz#a3f69a97107f494b3cdc3bdddd883a7d65cebf04" + integrity sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w== + dependencies: + siginfo "^2.0.0" + stackback "0.0.2" + wide-align@^1.1.5: version "1.1.5" resolved "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz" @@ -25234,6 +25634,14 @@ yauzl@^2.10.0: buffer-crc32 "~0.2.3" fd-slicer "~1.1.0" +yauzl@^3.1.3: + version "3.2.0" + resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-3.2.0.tgz#7b6cb548f09a48a6177ea0be8ece48deb7da45c0" + integrity sha512-Ow9nuGZE+qp1u4JIPvg+uCiUr7xGQWdff7JQSk5VGYTAZMDe2q8lxJ10ygv10qmSj031Ty/6FNJpLO4o1Sgc+w== + dependencies: + buffer-crc32 "~0.2.3" + pend "~1.2.0" + yn@3.1.1: version "3.1.1" resolved "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz" @@ -25307,3 +25715,8 @@ zod@^3.17.3: version "3.23.0" resolved "https://registry.yarnpkg.com/zod/-/zod-3.23.0.tgz#a25dab5052702834233e0041e9dd8b6a8480e744" integrity sha512-OFLT+LTocvabn6q76BTwVB0hExEBS0IduTr3cqZyMqEDbOnYmcU+y0tUAYbND4uwclpBGi4I4UUBGzylWpjLGA== + +zod@^3.23.8: + version "3.23.8" + resolved "https://registry.yarnpkg.com/zod/-/zod-3.23.8.tgz#e37b957b5d52079769fb8097099b592f0ef4067d" + integrity sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==