@eeplatform/basic-edu 1.10.31 → 1.10.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2970,7 +2970,9 @@ var learnerInfoSchema = Joi5.object({
|
|
|
2970
2970
|
firstName: Joi5.string().required(),
|
|
2971
2971
|
middleName: Joi5.string().optional().allow("", null),
|
|
2972
2972
|
extensionName: Joi5.string().optional().allow("", null),
|
|
2973
|
-
birthDate: Joi5.string().required()
|
|
2973
|
+
birthDate: Joi5.string().regex(/^\d{2}-\d{2}-\d{4}$/).required().messages({
|
|
2974
|
+
"string.pattern.base": "Birth date must be in the format DD-MM-YYYY"
|
|
2975
|
+
}),
|
|
2974
2976
|
sex: Joi5.string().required(),
|
|
2975
2977
|
// Changed to accept any string to match frontend
|
|
2976
2978
|
age: Joi5.number().integer().min(0).max(150).required(),
|
|
@@ -3138,6 +3140,7 @@ function MLearner(value) {
|
|
|
3138
3140
|
throw new BadRequestError8("Invalid specialProgram format");
|
|
3139
3141
|
}
|
|
3140
3142
|
}
|
|
3143
|
+
value.learnerInfo.birthDate = new Date(value.learnerInfo.birthDate);
|
|
3141
3144
|
return {
|
|
3142
3145
|
_id: value._id ?? void 0,
|
|
3143
3146
|
region: value.region,
|
|
@@ -5571,6 +5574,9 @@ function useEnrollmentService() {
|
|
|
5571
5574
|
enrollment.seniorHighInfo.strand = enrollment.seniorHighInfo?.strand?.toString();
|
|
5572
5575
|
}
|
|
5573
5576
|
enrollment.status = "active";
|
|
5577
|
+
enrollment.learnerInfo.birthDate = enrollment.learnerInfo.birthDate ? new Date(enrollment.learnerInfo.birthDate).toLocaleDateString(
|
|
5578
|
+
"en-GB"
|
|
5579
|
+
) : "";
|
|
5574
5580
|
await addLearner(enrollment, session);
|
|
5575
5581
|
}
|
|
5576
5582
|
const programScreening = await getByApplicantId(_id);
|