Skip to content

Commit

Permalink
fix: change type for schema v2 (#3813)
Browse files Browse the repository at this point in the history
Co-authored-by: Paul Gaucher <[email protected]>
  • Loading branch information
Pomarom and Pomarom authored Aug 17, 2024
1 parent d905310 commit bb2f8f5
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 14 deletions.
4 changes: 2 additions & 2 deletions server/src/common/actions/v2/person.v2.actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const getPersonV2 = async (nom: string, prenom: string, date_de_naissance
return personV2Db().findOne({
nom: nom.toLowerCase(),
prenom: prenom.toLowerCase(),
date_de_naissance: date_de_naissance,
date_de_naissance: new Date(date_de_naissance),
});
};
export const insertPersonV2 = async (nom: string, prenom: string, date_de_naissance: Date) => {
Expand All @@ -26,6 +26,6 @@ export const insertPersonV2 = async (nom: string, prenom: string, date_de_naissa
updated_at: new Date(),
nom: nom.toLowerCase(),
prenom: prenom.toLowerCase(),
date_de_naissance: date_de_naissance,
date_de_naissance: new Date(date_de_naissance),
});
};
Original file line number Diff line number Diff line change
Expand Up @@ -8932,7 +8932,10 @@ exports[`validation-schema should create validation schema for formationV2: form
"bsonType": "objectId",
},
"cfd": {
"bsonType": "string",
"bsonType": [
"string",
"null",
],
},
"created_at": {
"bsonType": "date",
Expand All @@ -8947,7 +8950,10 @@ exports[`validation-schema should create validation schema for formationV2: form
"bsonType": "objectId",
},
"rncp": {
"bsonType": "string",
"bsonType": [
"string",
"null",
],
},
"updated_at": {
"bsonType": "date",
Expand All @@ -8960,8 +8966,6 @@ exports[`validation-schema should create validation schema for formationV2: form
"updated_at",
"organisme_responsable_id",
"organisme_formateur_id",
"rncp",
"cfd",
],
}
`;
Expand Down Expand Up @@ -10892,10 +10896,16 @@ exports[`validation-schema should create validation schema for organismeV2: orga
"bsonType": "bool",
},
"siret": {
"bsonType": "string",
"bsonType": [
"string",
"null",
],
},
"uai": {
"bsonType": "string",
"bsonType": [
"string",
"null",
],
},
"updated_at": {
"bsonType": "date",
Expand All @@ -10906,8 +10916,6 @@ exports[`validation-schema should create validation schema for organismeV2: orga
"draft",
"created_at",
"updated_at",
"uai",
"siret",
],
}
`;
Expand Down
4 changes: 2 additions & 2 deletions shared/models/data/v2/formation.v2.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export const zFormationV2 = z.object({
updated_at: z.date(),
organisme_responsable_id: zObjectId,
organisme_formateur_id: zObjectId,
rncp: z.string(),
cfd: z.string(),
rncp: z.string().nullish(),
cfd: z.string().nullish(),
});

export type IFormationV2 = z.output<typeof zFormationV2>;
Expand Down
4 changes: 2 additions & 2 deletions shared/models/data/v2/organisme.v2.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export const zOrganismeV2 = z.object({
draft: z.boolean(),
created_at: z.date(),
updated_at: z.date(),
uai: z.string(),
siret: z.string(),
uai: z.string().nullish(),
siret: z.string().nullish(),
current_organisme_id: zObjectId.nullish(),
});

Expand Down

0 comments on commit bb2f8f5

Please sign in to comment.