From b07ac7380bcb52b85608c7c5ec941927e41ccb77 Mon Sep 17 00:00:00 2001 From: "Paul G." Date: Wed, 14 Aug 2024 13:38:49 +0200 Subject: [PATCH] fix: mise a jour effectif v2 model (#3808) Co-authored-by: Paul Gaucher --- .../mongodb/__snapshots__/validationSchema.test.ts.snap | 9 ++++++++- shared/models/data/v2/effectif.v2.model.ts | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/server/src/common/mongodb/__snapshots__/validationSchema.test.ts.snap b/server/src/common/mongodb/__snapshots__/validationSchema.test.ts.snap index b4a75535c..2253c3930 100644 --- a/server/src/common/mongodb/__snapshots__/validationSchema.test.ts.snap +++ b/server/src/common/mongodb/__snapshots__/validationSchema.test.ts.snap @@ -334,7 +334,14 @@ exports[`validation-schema should create validation schema for effectifV2: effec "date_de_naissance": { "anyOf": [ { - "bsonType": "date", + "anyOf": [ + { + "bsonType": "date", + }, + { + "bsonType": "string", + }, + ], }, { "bsonType": "null", diff --git a/shared/models/data/v2/effectif.v2.model.ts b/shared/models/data/v2/effectif.v2.model.ts index 8c6344709..81c1fda06 100644 --- a/shared/models/data/v2/effectif.v2.model.ts +++ b/shared/models/data/v2/effectif.v2.model.ts @@ -12,7 +12,7 @@ export const zEffectifV2Computed = z .object({ nom: z.string().nullish(), prenom: z.string().nullish(), - date_de_naissance: z.date().nullish(), + date_de_naissance: z.union([z.date(), z.string()]).nullish(), }) .nullish(); export const zEffectifV2 = z.object({