@eeplatform/basic-edu 1.10.30 → 1.10.32
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 -28
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -28
- 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,22 +3140,7 @@ function MLearner(value) {
|
|
|
3138
3140
|
throw new BadRequestError8("Invalid specialProgram format");
|
|
3139
3141
|
}
|
|
3140
3142
|
}
|
|
3141
|
-
|
|
3142
|
-
if (value.seniorHighInfo.track && typeof value.seniorHighInfo.track === "string") {
|
|
3143
|
-
try {
|
|
3144
|
-
value.seniorHighInfo.track = new ObjectId5(value.seniorHighInfo.track);
|
|
3145
|
-
} catch (error2) {
|
|
3146
|
-
throw new BadRequestError8("Invalid seniorHighInfo.track format");
|
|
3147
|
-
}
|
|
3148
|
-
}
|
|
3149
|
-
if (value.seniorHighInfo.strand && typeof value.seniorHighInfo.strand === "string") {
|
|
3150
|
-
try {
|
|
3151
|
-
value.seniorHighInfo.strand = new ObjectId5(value.seniorHighInfo.strand);
|
|
3152
|
-
} catch (error2) {
|
|
3153
|
-
throw new BadRequestError8("Invalid seniorHighInfo.strand format");
|
|
3154
|
-
}
|
|
3155
|
-
}
|
|
3156
|
-
}
|
|
3143
|
+
value.learnerInfo.birthDate = new Date(value.learnerInfo.birthDate);
|
|
3157
3144
|
return {
|
|
3158
3145
|
_id: value._id ?? void 0,
|
|
3159
3146
|
region: value.region,
|
|
@@ -3685,7 +3672,7 @@ function useLearnerRepo() {
|
|
|
3685
3672
|
}
|
|
3686
3673
|
if (strand) {
|
|
3687
3674
|
try {
|
|
3688
|
-
query["seniorHighInfo.strand"] =
|
|
3675
|
+
query["seniorHighInfo.strand"] = strand;
|
|
3689
3676
|
} catch (error) {
|
|
3690
3677
|
throw new BadRequestError10("Invalid seniorHighInfo.strand format");
|
|
3691
3678
|
}
|
|
@@ -3773,19 +3760,11 @@ function useLearnerRepo() {
|
|
|
3773
3760
|
cacheKeyOptions.specialProgram = "none";
|
|
3774
3761
|
}
|
|
3775
3762
|
if (value.track) {
|
|
3776
|
-
|
|
3777
|
-
query["seniorHighInfo.track"] = new ObjectId7(value.track);
|
|
3778
|
-
} catch (error2) {
|
|
3779
|
-
throw new BadRequestError10("Invalid track ID.");
|
|
3780
|
-
}
|
|
3763
|
+
query["seniorHighInfo.track"] = value.track;
|
|
3781
3764
|
cacheKeyOptions.track = value.track.toString();
|
|
3782
3765
|
}
|
|
3783
3766
|
if (value.strand) {
|
|
3784
|
-
|
|
3785
|
-
query["seniorHighInfo.strand"] = new ObjectId7(value.strand);
|
|
3786
|
-
} catch (error2) {
|
|
3787
|
-
throw new BadRequestError10("Invalid strand ID.");
|
|
3788
|
-
}
|
|
3767
|
+
query["seniorHighInfo.strand"] = value.strand;
|
|
3789
3768
|
cacheKeyOptions.strand = value.strand.toString();
|
|
3790
3769
|
}
|
|
3791
3770
|
const cacheKey = makeCacheKey4(namespace_collection, cacheKeyOptions);
|