@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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @eeplatform/basic-edu
2
2
 
3
+ ## 1.10.32
4
+
5
+ ### Patch Changes
6
+
7
+ - e9a23b9: Fix birthdate format
8
+
9
+ ## 1.10.31
10
+
11
+ ### Patch Changes
12
+
13
+ - 208b73d: Remove ObjectId conversions for seniorHighInfo
14
+
3
15
  ## 1.10.30
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -260,7 +260,7 @@ type TLearnerInfo = {
260
260
  firstName: string;
261
261
  middleName?: string;
262
262
  extensionName?: string;
263
- birthDate: string;
263
+ birthDate: string | Date;
264
264
  sex: string;
265
265
  age: number;
266
266
  placeOfBirth: {
package/dist/index.js CHANGED
@@ -3081,7 +3081,9 @@ var learnerInfoSchema = import_joi5.default.object({
3081
3081
  firstName: import_joi5.default.string().required(),
3082
3082
  middleName: import_joi5.default.string().optional().allow("", null),
3083
3083
  extensionName: import_joi5.default.string().optional().allow("", null),
3084
- birthDate: import_joi5.default.string().required(),
3084
+ birthDate: import_joi5.default.string().regex(/^\d{2}-\d{2}-\d{4}$/).required().messages({
3085
+ "string.pattern.base": "Birth date must be in the format DD-MM-YYYY"
3086
+ }),
3085
3087
  sex: import_joi5.default.string().required(),
3086
3088
  // Changed to accept any string to match frontend
3087
3089
  age: import_joi5.default.number().integer().min(0).max(150).required(),
@@ -3249,22 +3251,7 @@ function MLearner(value) {
3249
3251
  throw new import_nodejs_utils8.BadRequestError("Invalid specialProgram format");
3250
3252
  }
3251
3253
  }
3252
- if (value.seniorHighInfo) {
3253
- if (value.seniorHighInfo.track && typeof value.seniorHighInfo.track === "string") {
3254
- try {
3255
- value.seniorHighInfo.track = new import_mongodb5.ObjectId(value.seniorHighInfo.track);
3256
- } catch (error2) {
3257
- throw new import_nodejs_utils8.BadRequestError("Invalid seniorHighInfo.track format");
3258
- }
3259
- }
3260
- if (value.seniorHighInfo.strand && typeof value.seniorHighInfo.strand === "string") {
3261
- try {
3262
- value.seniorHighInfo.strand = new import_mongodb5.ObjectId(value.seniorHighInfo.strand);
3263
- } catch (error2) {
3264
- throw new import_nodejs_utils8.BadRequestError("Invalid seniorHighInfo.strand format");
3265
- }
3266
- }
3267
- }
3254
+ value.learnerInfo.birthDate = new Date(value.learnerInfo.birthDate);
3268
3255
  return {
3269
3256
  _id: value._id ?? void 0,
3270
3257
  region: value.region,
@@ -3772,7 +3759,7 @@ function useLearnerRepo() {
3772
3759
  }
3773
3760
  if (strand) {
3774
3761
  try {
3775
- query["seniorHighInfo.strand"] = new import_mongodb7.ObjectId(strand);
3762
+ query["seniorHighInfo.strand"] = strand;
3776
3763
  } catch (error) {
3777
3764
  throw new import_nodejs_utils10.BadRequestError("Invalid seniorHighInfo.strand format");
3778
3765
  }
@@ -3860,19 +3847,11 @@ function useLearnerRepo() {
3860
3847
  cacheKeyOptions.specialProgram = "none";
3861
3848
  }
3862
3849
  if (value.track) {
3863
- try {
3864
- query["seniorHighInfo.track"] = new import_mongodb7.ObjectId(value.track);
3865
- } catch (error2) {
3866
- throw new import_nodejs_utils10.BadRequestError("Invalid track ID.");
3867
- }
3850
+ query["seniorHighInfo.track"] = value.track;
3868
3851
  cacheKeyOptions.track = value.track.toString();
3869
3852
  }
3870
3853
  if (value.strand) {
3871
- try {
3872
- query["seniorHighInfo.strand"] = new import_mongodb7.ObjectId(value.strand);
3873
- } catch (error2) {
3874
- throw new import_nodejs_utils10.BadRequestError("Invalid strand ID.");
3875
- }
3854
+ query["seniorHighInfo.strand"] = value.strand;
3876
3855
  cacheKeyOptions.strand = value.strand.toString();
3877
3856
  }
3878
3857
  const cacheKey = (0, import_nodejs_utils10.makeCacheKey)(namespace_collection, cacheKeyOptions);