@eeplatform/basic-edu 1.9.0 → 1.9.2

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/dist/index.mjs CHANGED
@@ -1461,7 +1461,7 @@ function useCurriculumRepo() {
1461
1461
  try {
1462
1462
  _id = new ObjectId2(_id);
1463
1463
  } catch (error) {
1464
- throw new BadRequestError2("Invalid ID.");
1464
+ throw new BadRequestError2(namespace_collection + " Invalid ID.");
1465
1465
  }
1466
1466
  try {
1467
1467
  const res = await collection.updateOne(
@@ -1554,7 +1554,7 @@ function useCurriculumRepo() {
1554
1554
  try {
1555
1555
  _id = new ObjectId2(_id);
1556
1556
  } catch (error) {
1557
- throw new BadRequestError2("Invalid ID.");
1557
+ throw new BadRequestError2(namespace_collection + " Invalid ID.");
1558
1558
  }
1559
1559
  const cacheKey = makeCacheKey(namespace_collection, { _id: String(_id) });
1560
1560
  try {
@@ -1593,7 +1593,7 @@ function useCurriculumRepo() {
1593
1593
  try {
1594
1594
  _id = new ObjectId2(_id);
1595
1595
  } catch (error) {
1596
- throw new BadRequestError2("Invalid ID.");
1596
+ throw new BadRequestError2(namespace_collection + " Invalid ID.");
1597
1597
  }
1598
1598
  try {
1599
1599
  const res = await collection.updateOne(
@@ -2205,7 +2205,7 @@ function useSubjectRepo() {
2205
2205
  try {
2206
2206
  _id = new ObjectId4(_id);
2207
2207
  } catch (error) {
2208
- throw new BadRequestError5("Invalid ID.");
2208
+ throw new BadRequestError5(namespace_collection + " Invalid ID.");
2209
2209
  }
2210
2210
  try {
2211
2211
  const res = await collection.updateOne(
@@ -2327,7 +2327,7 @@ function useSubjectRepo() {
2327
2327
  try {
2328
2328
  _id = new ObjectId4(_id);
2329
2329
  } catch (error) {
2330
- throw new BadRequestError5("Invalid ID.");
2330
+ throw new BadRequestError5(namespace_collection + " Invalid ID.");
2331
2331
  }
2332
2332
  const cacheKey = makeCacheKey2(namespace_collection, { _id: String(_id) });
2333
2333
  try {
@@ -2469,7 +2469,7 @@ function useSubjectRepo() {
2469
2469
  try {
2470
2470
  _id = new ObjectId4(_id);
2471
2471
  } catch (error) {
2472
- throw new BadRequestError5("Invalid ID.");
2472
+ throw new BadRequestError5(namespace_collection + " Invalid ID.");
2473
2473
  }
2474
2474
  try {
2475
2475
  const res = await collection.updateOne(
@@ -3140,17 +3140,19 @@ function useEnrollmentRepo() {
3140
3140
  status = "active",
3141
3141
  school = "",
3142
3142
  schoolYear = "",
3143
- gradeLevelToEnroll = "",
3144
- createdBy = ""
3143
+ createdBy = "",
3144
+ gradeLevel = ""
3145
3145
  } = {}) {
3146
3146
  page = page > 0 ? page - 1 : 0;
3147
3147
  const query = {
3148
3148
  status
3149
3149
  };
3150
3150
  const cacheParams = {
3151
+ status,
3151
3152
  page,
3152
3153
  limit,
3153
- sort: JSON.stringify(sort)
3154
+ sort: JSON.stringify(sort),
3155
+ tag: "getAll"
3154
3156
  };
3155
3157
  if (createdBy) {
3156
3158
  try {
@@ -3172,30 +3174,11 @@ function useEnrollmentRepo() {
3172
3174
  query.schoolYear = schoolYear;
3173
3175
  cacheParams.schoolYear = schoolYear;
3174
3176
  }
3175
- if (gradeLevelToEnroll) {
3176
- query.gradeLevelToEnroll = gradeLevelToEnroll;
3177
- cacheParams.gradeLevelToEnroll = gradeLevelToEnroll;
3177
+ if (gradeLevel) {
3178
+ query.gradeLevel = gradeLevel;
3179
+ cacheParams.gradeLevel = gradeLevel;
3178
3180
  }
3179
3181
  sort = Object.keys(sort).length > 0 ? sort : { _id: -1 };
3180
- if (search) {
3181
- query.$or = [
3182
- { "learnerInfo.firstName": { $regex: search, $options: "i" } },
3183
- { "learnerInfo.lastName": { $regex: search, $options: "i" } },
3184
- { "learnerInfo.lrn": { $regex: search, $options: "i" } },
3185
- { schoolYear: { $regex: search, $options: "i" } },
3186
- { gradeLevelToEnroll: { $regex: search, $options: "i" } }
3187
- ];
3188
- }
3189
- if (search)
3190
- cacheParams.search = search;
3191
- if (status !== "active")
3192
- cacheParams.status = status;
3193
- if (school)
3194
- cacheParams.school = school;
3195
- if (schoolYear)
3196
- cacheParams.schoolYear = schoolYear;
3197
- if (gradeLevelToEnroll)
3198
- cacheParams.gradeLevelToEnroll = gradeLevelToEnroll;
3199
3182
  const cacheKey = makeCacheKey3(namespace_collection, cacheParams);
3200
3183
  logger8.log({
3201
3184
  level: "info",
@@ -3344,7 +3327,7 @@ function useEnrollmentRepo() {
3344
3327
  try {
3345
3328
  _id = new ObjectId6(_id);
3346
3329
  } catch (error) {
3347
- throw new BadRequestError8("Invalid ID.");
3330
+ throw new BadRequestError8(namespace_collection + " Invalid ID.");
3348
3331
  }
3349
3332
  const query = { _id };
3350
3333
  const cacheKeyOptions = { _id: _id.toString() };
@@ -3383,7 +3366,7 @@ function useEnrollmentRepo() {
3383
3366
  try {
3384
3367
  _id = new ObjectId6(_id);
3385
3368
  } catch (error) {
3386
- throw new BadRequestError8("Invalid ID.");
3369
+ throw new BadRequestError8(namespace_collection + " Invalid ID.");
3387
3370
  }
3388
3371
  try {
3389
3372
  const result = await collection.updateOne(
@@ -3644,7 +3627,7 @@ function useLearnerRepo() {
3644
3627
  try {
3645
3628
  _id = new ObjectId7(_id);
3646
3629
  } catch (error) {
3647
- throw new BadRequestError9("Invalid ID.");
3630
+ throw new BadRequestError9(namespace_collection + " Invalid ID.");
3648
3631
  }
3649
3632
  const query = { _id };
3650
3633
  const cacheKeyOptions = { _id: _id.toString() };
@@ -3751,7 +3734,7 @@ function useLearnerRepo() {
3751
3734
  try {
3752
3735
  _id = new ObjectId7(_id);
3753
3736
  } catch (error) {
3754
- throw new BadRequestError9("Invalid ID.");
3737
+ throw new BadRequestError9(namespace_collection + " Invalid ID.");
3755
3738
  }
3756
3739
  try {
3757
3740
  const result = await collection.updateOne(
@@ -3939,7 +3922,7 @@ function useBasicEduCountRepo() {
3939
3922
  try {
3940
3923
  _id = new ObjectId8(_id);
3941
3924
  } catch (error) {
3942
- throw new BadRequestError12("Invalid ID.");
3925
+ throw new BadRequestError12(namespace_collection + " Invalid ID.");
3943
3926
  }
3944
3927
  const query = { _id };
3945
3928
  const cacheKeyOptions = { _id: _id.toString() };
@@ -4010,7 +3993,7 @@ function useBasicEduCountRepo() {
4010
3993
  try {
4011
3994
  _id = new ObjectId8(_id);
4012
3995
  } catch (error) {
4013
- throw new BadRequestError12("Invalid ID.");
3996
+ throw new BadRequestError12(namespace_collection + " Invalid ID.");
4014
3997
  }
4015
3998
  try {
4016
3999
  const result = await collection.updateOne(
@@ -4028,7 +4011,7 @@ function useBasicEduCountRepo() {
4028
4011
  try {
4029
4012
  _id = new ObjectId8(_id);
4030
4013
  } catch (error) {
4031
- throw new BadRequestError12("Invalid ID.");
4014
+ throw new BadRequestError12(namespace_collection + " Invalid ID.");
4032
4015
  }
4033
4016
  try {
4034
4017
  const result = await collection.updateOne(
@@ -4307,7 +4290,7 @@ function useProgramScreeningRepo() {
4307
4290
  try {
4308
4291
  _id = new ObjectId10(_id);
4309
4292
  } catch (error) {
4310
- throw new BadRequestError14("Invalid ID.");
4293
+ throw new BadRequestError14(namespace_collection + " Invalid ID.");
4311
4294
  }
4312
4295
  const cacheKey = makeCacheKey6(namespace_collection, { _id: String(_id) });
4313
4296
  try {
@@ -4350,7 +4333,7 @@ function useProgramScreeningRepo() {
4350
4333
  try {
4351
4334
  _id = new ObjectId10(_id);
4352
4335
  } catch (error) {
4353
- throw new BadRequestError14("Invalid ID.");
4336
+ throw new BadRequestError14(namespace_collection + " Invalid ID.");
4354
4337
  }
4355
4338
  const cacheKey = makeCacheKey6(namespace_collection, {
4356
4339
  applicant: String(_id)
@@ -4456,7 +4439,7 @@ function useProgramScreeningRepo() {
4456
4439
  try {
4457
4440
  _id = new ObjectId10(_id);
4458
4441
  } catch (error) {
4459
- throw new BadRequestError14("Invalid ID.");
4442
+ throw new BadRequestError14(namespace_collection + " Invalid ID.");
4460
4443
  }
4461
4444
  try {
4462
4445
  await collection.updateOne(
@@ -4476,7 +4459,7 @@ function useProgramScreeningRepo() {
4476
4459
  try {
4477
4460
  _id = new ObjectId10(_id);
4478
4461
  } catch (error) {
4479
- throw new BadRequestError14("Invalid ID.");
4462
+ throw new BadRequestError14(namespace_collection + " Invalid ID.");
4480
4463
  }
4481
4464
  try {
4482
4465
  await collection.updateOne(
@@ -4493,7 +4476,7 @@ function useProgramScreeningRepo() {
4493
4476
  try {
4494
4477
  _id = new ObjectId10(_id);
4495
4478
  } catch (error2) {
4496
- throw new BadRequestError14("Invalid ID.");
4479
+ throw new BadRequestError14(namespace_collection + " Invalid ID.");
4497
4480
  }
4498
4481
  const { error } = schemaProgramScreeningUpdate.validate(value);
4499
4482
  if (error) {
@@ -4518,7 +4501,7 @@ function useProgramScreeningRepo() {
4518
4501
  try {
4519
4502
  _id = new ObjectId10(_id);
4520
4503
  } catch (error) {
4521
- throw new BadRequestError14("Invalid ID.");
4504
+ throw new BadRequestError14(namespace_collection + " Invalid ID.");
4522
4505
  }
4523
4506
  try {
4524
4507
  await collection.updateOne(
@@ -5064,7 +5047,7 @@ function useProgramRepo() {
5064
5047
  try {
5065
5048
  _id = new ObjectId12(_id);
5066
5049
  } catch (error) {
5067
- throw new BadRequestError17("Invalid ID.");
5050
+ throw new BadRequestError17(namespace_collection + " Invalid ID.");
5068
5051
  }
5069
5052
  const cacheKey = makeCacheKey7(namespace_collection, { _id: String(_id) });
5070
5053
  try {
@@ -5167,7 +5150,7 @@ function useProgramRepo() {
5167
5150
  try {
5168
5151
  _id = new ObjectId12(_id);
5169
5152
  } catch (error) {
5170
- throw new BadRequestError17("Invalid ID.");
5153
+ throw new BadRequestError17(namespace_collection + " Invalid ID.");
5171
5154
  }
5172
5155
  try {
5173
5156
  await collection.updateOne(
@@ -5185,7 +5168,7 @@ function useProgramRepo() {
5185
5168
  try {
5186
5169
  _id = new ObjectId12(_id);
5187
5170
  } catch (error) {
5188
- throw new BadRequestError17("Invalid ID.");
5171
+ throw new BadRequestError17(namespace_collection + " Invalid ID.");
5189
5172
  }
5190
5173
  try {
5191
5174
  await collection.updateOne(
@@ -5202,7 +5185,7 @@ function useProgramRepo() {
5202
5185
  try {
5203
5186
  _id = new ObjectId12(_id);
5204
5187
  } catch (error2) {
5205
- throw new BadRequestError17("Invalid ID.");
5188
+ throw new BadRequestError17(namespace_collection + " Invalid ID.");
5206
5189
  }
5207
5190
  const { error } = schemaProgramUpdate.validate(value);
5208
5191
  if (error) {
@@ -5684,7 +5667,7 @@ function useSchoolRepo() {
5684
5667
  try {
5685
5668
  _id = new ObjectId14(_id);
5686
5669
  } catch (error) {
5687
- throw new BadRequestError20("Invalid ID.");
5670
+ throw new BadRequestError20(namespace_collection + " Invalid ID.");
5688
5671
  }
5689
5672
  const query = { _id };
5690
5673
  const cacheKeyOptions = {
@@ -5733,7 +5716,7 @@ function useSchoolRepo() {
5733
5716
  try {
5734
5717
  createdBy = new ObjectId14(createdBy);
5735
5718
  } catch (error) {
5736
- throw new BadRequestError20("Invalid ID.");
5719
+ throw new BadRequestError20(namespace_collection + " Invalid ID.");
5737
5720
  }
5738
5721
  const cacheKey = makeCacheKey8(namespace_collection, { createdBy });
5739
5722
  try {
@@ -5814,7 +5797,7 @@ function useSchoolRepo() {
5814
5797
  try {
5815
5798
  _id = new ObjectId14(_id);
5816
5799
  } catch (error) {
5817
- throw new BadRequestError20("Invalid ID.");
5800
+ throw new BadRequestError20(namespace_collection + " Invalid ID.");
5818
5801
  }
5819
5802
  try {
5820
5803
  await collection.updateOne(
@@ -5848,7 +5831,7 @@ function useSchoolRepo() {
5848
5831
  try {
5849
5832
  _id = new ObjectId14(_id);
5850
5833
  } catch (error) {
5851
- throw new BadRequestError20("Invalid ID.");
5834
+ throw new BadRequestError20(namespace_collection + " Invalid ID.");
5852
5835
  }
5853
5836
  try {
5854
5837
  await collection.updateOne(
@@ -5894,7 +5877,7 @@ function useSchoolRepo() {
5894
5877
  try {
5895
5878
  _id = new ObjectId14(_id);
5896
5879
  } catch (error2) {
5897
- throw new BadRequestError20("Invalid ID.");
5880
+ throw new BadRequestError20(namespace_collection + " Invalid ID.");
5898
5881
  }
5899
5882
  try {
5900
5883
  await collection.updateOne({ _id }, { $set: options }, { session });
@@ -5908,7 +5891,7 @@ function useSchoolRepo() {
5908
5891
  try {
5909
5892
  _id = new ObjectId14(_id);
5910
5893
  } catch (error) {
5911
- throw new BadRequestError20("Invalid ID.");
5894
+ throw new BadRequestError20(namespace_collection + " Invalid ID.");
5912
5895
  }
5913
5896
  try {
5914
5897
  await collection.updateOne(
@@ -35077,9 +35060,12 @@ function useEnrollmentService() {
35077
35060
  if (!school) {
35078
35061
  throw new BadRequestError23("School not found.");
35079
35062
  }
35080
- const program = await getProgramById(payload.specialProgram ?? "");
35081
- if (payload.specialProgram && !program) {
35082
- throw new BadRequestError23("Special program not found.");
35063
+ let program = null;
35064
+ if (payload.specialProgram) {
35065
+ program = await getProgramById(payload.specialProgram ?? "");
35066
+ if (!program) {
35067
+ throw new BadRequestError23("Special program not found.");
35068
+ }
35083
35069
  }
35084
35070
  const enrollmentPromises = Array.from(
35085
35071
  { length: payload.numberOfApplications },
@@ -35242,7 +35228,8 @@ function useEnrollmentController() {
35242
35228
  school: Joi16.string().hex().optional().allow("", null),
35243
35229
  schoolYear: Joi16.string().optional().allow("", null),
35244
35230
  gradeLevelToEnroll: Joi16.string().optional().allow("", null),
35245
- createdBy: Joi16.string().hex().optional().allow("", null)
35231
+ createdBy: Joi16.string().hex().optional().allow("", null),
35232
+ gradeLevel: Joi16.string().optional().allow("", null)
35246
35233
  });
35247
35234
  const { error } = validation.validate(query);
35248
35235
  if (error) {
@@ -35255,6 +35242,7 @@ function useEnrollmentController() {
35255
35242
  const sort = req.query.sort ? String(req.query.sort).split(",") : "";
35256
35243
  const sortOrder = req.query.sortOrder ? String(req.query.sortOrder).split(",") : "";
35257
35244
  const createdBy = req.query.createdBy ?? "";
35245
+ const gradeLevel = req.query.gradeLevel ?? "";
35258
35246
  const sortObj = {};
35259
35247
  if (sort && sort.length > 0 && sortOrder && sortOrder.length > 0 && sort.length === sortOrder.length) {
35260
35248
  for (let i = 0; i < sort.length; i++) {
@@ -35271,8 +35259,8 @@ function useEnrollmentController() {
35271
35259
  status: req.query.status,
35272
35260
  school: req.query.school,
35273
35261
  schoolYear: req.query.schoolYear,
35274
- gradeLevelToEnroll: req.query.gradeLevelToEnroll,
35275
- createdBy
35262
+ createdBy,
35263
+ gradeLevel
35276
35264
  });
35277
35265
  res.json(result);
35278
35266
  return;
@@ -35482,7 +35470,7 @@ function useGradeLevelRepo() {
35482
35470
  try {
35483
35471
  _id = new ObjectId16(_id);
35484
35472
  } catch (error) {
35485
- throw new BadRequestError26("Invalid ID.");
35473
+ throw new BadRequestError26(namespace_collection + " Invalid ID.");
35486
35474
  }
35487
35475
  if (value.school && typeof value.school === "string") {
35488
35476
  try {
@@ -35616,7 +35604,7 @@ function useGradeLevelRepo() {
35616
35604
  try {
35617
35605
  _id = new ObjectId16(_id);
35618
35606
  } catch (error) {
35619
- throw new BadRequestError26("Invalid ID.");
35607
+ throw new BadRequestError26(namespace_collection + " Invalid ID.");
35620
35608
  }
35621
35609
  const cacheKey = makeCacheKey9(namespace_collection, { _id: String(_id) });
35622
35610
  try {
@@ -35674,7 +35662,7 @@ function useGradeLevelRepo() {
35674
35662
  try {
35675
35663
  _id = new ObjectId16(_id);
35676
35664
  } catch (error) {
35677
- throw new BadRequestError26("Invalid ID.");
35665
+ throw new BadRequestError26(namespace_collection + " Invalid ID.");
35678
35666
  }
35679
35667
  try {
35680
35668
  const res = await collection.updateOne(
@@ -36190,7 +36178,7 @@ function useRegionRepo() {
36190
36178
  try {
36191
36179
  _id = new ObjectId18(_id);
36192
36180
  } catch (error) {
36193
- throw new BadRequestError29("Invalid ID.");
36181
+ throw new BadRequestError29(namespace_collection + " Invalid ID.");
36194
36182
  }
36195
36183
  const cacheKey = makeCacheKey10(namespace_collection, { _id: String(_id) });
36196
36184
  try {
@@ -36277,7 +36265,7 @@ function useRegionRepo() {
36277
36265
  try {
36278
36266
  _id = new ObjectId18(_id);
36279
36267
  } catch (error) {
36280
- throw new BadRequestError29("Invalid ID.");
36268
+ throw new BadRequestError29(namespace_collection + " Invalid ID.");
36281
36269
  }
36282
36270
  try {
36283
36271
  await collection.updateOne(
@@ -36295,7 +36283,7 @@ function useRegionRepo() {
36295
36283
  try {
36296
36284
  _id = new ObjectId18(_id);
36297
36285
  } catch (error) {
36298
- throw new BadRequestError29("Invalid ID.");
36286
+ throw new BadRequestError29(namespace_collection + " Invalid ID.");
36299
36287
  }
36300
36288
  try {
36301
36289
  await collection.updateOne(
@@ -36687,7 +36675,7 @@ function useDivisionRepo() {
36687
36675
  try {
36688
36676
  _id = new ObjectId20(_id);
36689
36677
  } catch (error) {
36690
- throw new BadRequestError32("Invalid ID.");
36678
+ throw new BadRequestError32(namespace_collection + " Invalid ID.");
36691
36679
  }
36692
36680
  const cacheKey = makeCacheKey11(namespace_collection, { _id: String(_id) });
36693
36681
  try {
@@ -36774,7 +36762,7 @@ function useDivisionRepo() {
36774
36762
  try {
36775
36763
  _id = new ObjectId20(_id);
36776
36764
  } catch (error) {
36777
- throw new BadRequestError32("Invalid ID.");
36765
+ throw new BadRequestError32(namespace_collection + " Invalid ID.");
36778
36766
  }
36779
36767
  try {
36780
36768
  await collection.updateOne(
@@ -36799,7 +36787,7 @@ function useDivisionRepo() {
36799
36787
  try {
36800
36788
  _id = new ObjectId20(_id);
36801
36789
  } catch (error2) {
36802
- throw new BadRequestError32("Invalid ID.");
36790
+ throw new BadRequestError32(namespace_collection + " Invalid ID.");
36803
36791
  }
36804
36792
  if (options.region) {
36805
36793
  try {
@@ -36820,7 +36808,7 @@ function useDivisionRepo() {
36820
36808
  try {
36821
36809
  _id = new ObjectId20(_id);
36822
36810
  } catch (error) {
36823
- throw new BadRequestError32("Invalid ID.");
36811
+ throw new BadRequestError32(namespace_collection + " Invalid ID.");
36824
36812
  }
36825
36813
  try {
36826
36814
  await collection.updateOne(
@@ -37141,7 +37129,7 @@ function MAsset(value) {
37141
37129
  try {
37142
37130
  value._id = new ObjectId21();
37143
37131
  } catch (error2) {
37144
- throw new BadRequestError34("Invalid ID.");
37132
+ throw new BadRequestError34("Asset Invalid ID.");
37145
37133
  }
37146
37134
  }
37147
37135
  try {
@@ -37236,7 +37224,7 @@ function useAssetRepo() {
37236
37224
  try {
37237
37225
  _id = new ObjectId22(_id);
37238
37226
  } catch (error2) {
37239
- throw new BadRequestError35("Invalid ID.");
37227
+ throw new BadRequestError35(namespace_collection + " Invalid ID.");
37240
37228
  }
37241
37229
  try {
37242
37230
  const res = await collection.updateOne(
@@ -37256,7 +37244,7 @@ function useAssetRepo() {
37256
37244
  try {
37257
37245
  _id = new ObjectId22(_id);
37258
37246
  } catch (error) {
37259
- throw new BadRequestError35("Invalid ID.");
37247
+ throw new BadRequestError35(namespace_collection + " Invalid ID.");
37260
37248
  }
37261
37249
  try {
37262
37250
  const res = await collection.deleteOne({ _id });
@@ -37273,7 +37261,7 @@ function useAssetRepo() {
37273
37261
  try {
37274
37262
  _id = new ObjectId22(_id);
37275
37263
  } catch (error) {
37276
- throw new BadRequestError35("Invalid ID.");
37264
+ throw new BadRequestError35(namespace_collection + " Invalid ID.");
37277
37265
  }
37278
37266
  const cacheKey = makeCacheKey12(namespace_collection, { _id: String(_id) });
37279
37267
  const cachedData = await getCache(cacheKey);
@@ -37863,7 +37851,7 @@ function useStockCardRepository() {
37863
37851
  try {
37864
37852
  _id = new ObjectId24(_id);
37865
37853
  } catch (error) {
37866
- throw new BadRequestError38("Invalid ID.");
37854
+ throw new BadRequestError38(namespace_collection + " Invalid ID.");
37867
37855
  }
37868
37856
  const cacheKey = makeCacheKey13(namespace_collection, { _id: String(_id) });
37869
37857
  const cachedData = await getCache(cacheKey);
@@ -37904,7 +37892,7 @@ function useStockCardRepository() {
37904
37892
  try {
37905
37893
  id = new ObjectId24(id);
37906
37894
  } catch (error) {
37907
- throw new BadRequestError38("Invalid ID.");
37895
+ throw new BadRequestError38(namespace_collection + " Invalid ID.");
37908
37896
  }
37909
37897
  const query = {
37910
37898
  school,
@@ -38284,7 +38272,7 @@ function usePlantillaRepo() {
38284
38272
  try {
38285
38273
  _id = new ObjectId26(_id);
38286
38274
  } catch (error) {
38287
- throw new BadRequestError42("Invalid ID.");
38275
+ throw new BadRequestError42(namespace_collection + " Invalid ID.");
38288
38276
  }
38289
38277
  value.updatedAt = /* @__PURE__ */ new Date();
38290
38278
  try {
@@ -38384,7 +38372,7 @@ function usePlantillaRepo() {
38384
38372
  try {
38385
38373
  _id = new ObjectId26(_id);
38386
38374
  } catch (error) {
38387
- throw new BadRequestError42("Invalid ID.");
38375
+ throw new BadRequestError42(namespace_collection + " Invalid ID.");
38388
38376
  }
38389
38377
  const cacheKey = makeCacheKey14(namespace_collection, { _id: String(_id) });
38390
38378
  try {
@@ -38423,7 +38411,7 @@ function usePlantillaRepo() {
38423
38411
  try {
38424
38412
  _id = new ObjectId26(_id);
38425
38413
  } catch (error) {
38426
- throw new BadRequestError42("Invalid ID.");
38414
+ throw new BadRequestError42(namespace_collection + " Invalid ID.");
38427
38415
  }
38428
38416
  try {
38429
38417
  const res = await collection.updateOne(
@@ -39070,7 +39058,7 @@ function useSectionPresetRepo() {
39070
39058
  try {
39071
39059
  _id = new ObjectId28(_id);
39072
39060
  } catch (error) {
39073
- throw new BadRequestError46("Invalid ID.");
39061
+ throw new BadRequestError46(namespace_collection + " Invalid ID.");
39074
39062
  }
39075
39063
  const cacheKey = makeCacheKey15(namespace_collection, { _id: String(_id) });
39076
39064
  try {
@@ -39157,7 +39145,7 @@ function useSectionPresetRepo() {
39157
39145
  try {
39158
39146
  _id = new ObjectId28(_id);
39159
39147
  } catch (error) {
39160
- throw new BadRequestError46("Invalid ID.");
39148
+ throw new BadRequestError46(namespace_collection + " Invalid ID.");
39161
39149
  }
39162
39150
  try {
39163
39151
  await collection.updateOne(
@@ -39177,7 +39165,7 @@ function useSectionPresetRepo() {
39177
39165
  try {
39178
39166
  _id = new ObjectId28(_id);
39179
39167
  } catch (error) {
39180
- throw new BadRequestError46("Invalid ID.");
39168
+ throw new BadRequestError46(namespace_collection + " Invalid ID.");
39181
39169
  }
39182
39170
  try {
39183
39171
  await collection.updateOne(
@@ -39597,7 +39585,7 @@ function useSectionRepo() {
39597
39585
  try {
39598
39586
  _id = new ObjectId30(_id);
39599
39587
  } catch (error) {
39600
- throw new BadRequestError49("Invalid ID.");
39588
+ throw new BadRequestError49(namespace_collection + " Invalid ID.");
39601
39589
  }
39602
39590
  const cacheKey = makeCacheKey16(namespace_collection, { _id: String(_id) });
39603
39591
  try {
@@ -39732,7 +39720,7 @@ function useSectionRepo() {
39732
39720
  try {
39733
39721
  _id = new ObjectId30(_id);
39734
39722
  } catch (error) {
39735
- throw new BadRequestError49("Invalid ID.");
39723
+ throw new BadRequestError49(namespace_collection + " Invalid ID.");
39736
39724
  }
39737
39725
  if (field === "adviser" && value) {
39738
39726
  try {
@@ -39801,7 +39789,7 @@ function useSectionRepo() {
39801
39789
  try {
39802
39790
  _id = new ObjectId30(_id);
39803
39791
  } catch (error) {
39804
- throw new BadRequestError49("Invalid ID.");
39792
+ throw new BadRequestError49(namespace_collection + " Invalid ID.");
39805
39793
  }
39806
39794
  try {
39807
39795
  await collection.updateOne(
@@ -40385,7 +40373,7 @@ function useSectionSubjectRepo() {
40385
40373
  try {
40386
40374
  _id = new ObjectId34(_id);
40387
40375
  } catch (error) {
40388
- throw new BadRequestError53("Invalid ID.");
40376
+ throw new BadRequestError53(namespace_collection + " Invalid ID.");
40389
40377
  }
40390
40378
  const cacheKey = makeCacheKey18(namespace_collection, {
40391
40379
  _id: String(_id),
@@ -40575,7 +40563,7 @@ function useSectionSubjectRepo() {
40575
40563
  try {
40576
40564
  _id = new ObjectId34(_id);
40577
40565
  } catch (error) {
40578
- throw new BadRequestError53("Invalid ID.");
40566
+ throw new BadRequestError53(namespace_collection + " Invalid ID.");
40579
40567
  }
40580
40568
  if (field === "teacher" && value) {
40581
40569
  try {
@@ -40609,7 +40597,7 @@ function useSectionSubjectRepo() {
40609
40597
  try {
40610
40598
  _id = new ObjectId34(_id);
40611
40599
  } catch (error2) {
40612
- throw new BadRequestError53("Invalid ID.");
40600
+ throw new BadRequestError53(namespace_collection + " Invalid ID.");
40613
40601
  }
40614
40602
  if (value.teacher && typeof value.teacher === "string") {
40615
40603
  try {
@@ -40641,7 +40629,7 @@ function useSectionSubjectRepo() {
40641
40629
  try {
40642
40630
  _id = new ObjectId34(_id);
40643
40631
  } catch (error) {
40644
- throw new BadRequestError53("Invalid ID.");
40632
+ throw new BadRequestError53(namespace_collection + " Invalid ID.");
40645
40633
  }
40646
40634
  try {
40647
40635
  await collection.updateOne(
@@ -41076,7 +41064,7 @@ function useTeachingLoadRepo() {
41076
41064
  try {
41077
41065
  _id = new ObjectId36(_id);
41078
41066
  } catch (error) {
41079
- throw new BadRequestError56("Invalid ID.");
41067
+ throw new BadRequestError56(namespace_collection + " Invalid ID.");
41080
41068
  }
41081
41069
  if (value.teacher && typeof value.teacher === "string") {
41082
41070
  try {
@@ -41212,7 +41200,7 @@ function useTeachingLoadRepo() {
41212
41200
  try {
41213
41201
  _id = new ObjectId36(_id);
41214
41202
  } catch (error) {
41215
- throw new BadRequestError56("Invalid ID.");
41203
+ throw new BadRequestError56(namespace_collection + " Invalid ID.");
41216
41204
  }
41217
41205
  const cacheKey = makeCacheKey19(namespace_collection, { _id: String(_id) });
41218
41206
  try {
@@ -41251,7 +41239,7 @@ function useTeachingLoadRepo() {
41251
41239
  try {
41252
41240
  _id = new ObjectId36(_id);
41253
41241
  } catch (error) {
41254
- throw new BadRequestError56("Invalid ID.");
41242
+ throw new BadRequestError56(namespace_collection + " Invalid ID.");
41255
41243
  }
41256
41244
  try {
41257
41245
  const res = await collection.updateOne(
@@ -41704,7 +41692,7 @@ function useTeachingLoadSlotRepo() {
41704
41692
  try {
41705
41693
  _id = new ObjectId38(_id);
41706
41694
  } catch (error) {
41707
- throw new BadRequestError59("Invalid ID.");
41695
+ throw new BadRequestError59(namespace_collection + " Invalid ID.");
41708
41696
  }
41709
41697
  if (value.subject && typeof value.subject === "string") {
41710
41698
  try {
@@ -41853,7 +41841,7 @@ function useTeachingLoadSlotRepo() {
41853
41841
  try {
41854
41842
  _id = new ObjectId38(_id);
41855
41843
  } catch (error) {
41856
- throw new BadRequestError59("Invalid ID.");
41844
+ throw new BadRequestError59(namespace_collection + " Invalid ID.");
41857
41845
  }
41858
41846
  const cacheKey = makeCacheKey20(namespace_collection, { _id: String(_id) });
41859
41847
  try {
@@ -41892,7 +41880,7 @@ function useTeachingLoadSlotRepo() {
41892
41880
  try {
41893
41881
  _id = new ObjectId38(_id);
41894
41882
  } catch (error) {
41895
- throw new BadRequestError59("Invalid ID.");
41883
+ throw new BadRequestError59(namespace_collection + " Invalid ID.");
41896
41884
  }
41897
41885
  try {
41898
41886
  const res = await collection.updateOne(
@@ -42365,7 +42353,7 @@ function usePersonnelRepo() {
42365
42353
  try {
42366
42354
  _id = new ObjectId40(_id);
42367
42355
  } catch (error) {
42368
- throw new BadRequestError62("Invalid ID.");
42356
+ throw new BadRequestError62(namespace_collection + " Invalid ID.");
42369
42357
  }
42370
42358
  try {
42371
42359
  const res = await collection.updateOne(
@@ -42460,7 +42448,7 @@ function usePersonnelRepo() {
42460
42448
  try {
42461
42449
  _id = new ObjectId40(_id);
42462
42450
  } catch (error) {
42463
- throw new BadRequestError62("Invalid ID.");
42451
+ throw new BadRequestError62(namespace_collection + " Invalid ID.");
42464
42452
  }
42465
42453
  const cacheKey = makeCacheKey21(namespace_collection, { _id: String(_id) });
42466
42454
  try {
@@ -42499,7 +42487,7 @@ function usePersonnelRepo() {
42499
42487
  try {
42500
42488
  _id = new ObjectId40(_id);
42501
42489
  } catch (error) {
42502
- throw new BadRequestError62("Invalid ID.");
42490
+ throw new BadRequestError62(namespace_collection + " Invalid ID.");
42503
42491
  }
42504
42492
  try {
42505
42493
  const res = await collection.updateOne(
@@ -43612,7 +43600,7 @@ function useBuildingRepo() {
43612
43600
  try {
43613
43601
  _id = new ObjectId42(_id);
43614
43602
  } catch (error) {
43615
- throw new BadRequestError68("Invalid ID.");
43603
+ throw new BadRequestError68(namespace_collection + " Invalid ID.");
43616
43604
  }
43617
43605
  try {
43618
43606
  const res = await collection.updateOne(
@@ -43711,7 +43699,7 @@ function useBuildingRepo() {
43711
43699
  try {
43712
43700
  _id = new ObjectId42(_id);
43713
43701
  } catch (error) {
43714
- throw new BadRequestError68("Invalid ID.");
43702
+ throw new BadRequestError68(namespace_collection + " Invalid ID.");
43715
43703
  }
43716
43704
  const cacheKey = makeCacheKey22(namespace_collection, { _id: String(_id) });
43717
43705
  try {
@@ -43750,7 +43738,7 @@ function useBuildingRepo() {
43750
43738
  try {
43751
43739
  _id = new ObjectId42(_id);
43752
43740
  } catch (error) {
43753
- throw new BadRequestError68("Invalid ID.");
43741
+ throw new BadRequestError68(namespace_collection + " Invalid ID.");
43754
43742
  }
43755
43743
  try {
43756
43744
  const res = await collection.updateOne(
@@ -43885,7 +43873,7 @@ function useBuildingUnitRepo() {
43885
43873
  try {
43886
43874
  _id = new ObjectId43(_id);
43887
43875
  } catch (error2) {
43888
- throw new BadRequestError69("Invalid ID.");
43876
+ throw new BadRequestError69(namespace_collection + " Invalid ID.");
43889
43877
  }
43890
43878
  try {
43891
43879
  const res = await collection.updateOne(
@@ -44050,7 +44038,7 @@ function useBuildingUnitRepo() {
44050
44038
  try {
44051
44039
  _id = new ObjectId43(_id);
44052
44040
  } catch (error) {
44053
- throw new BadRequestError69("Invalid ID.");
44041
+ throw new BadRequestError69(namespace_collection + " Invalid ID.");
44054
44042
  }
44055
44043
  const cacheKey = makeCacheKey23(namespace_collection, { _id: String(_id) });
44056
44044
  try {
@@ -44179,7 +44167,7 @@ function useBuildingUnitRepo() {
44179
44167
  try {
44180
44168
  _id = new ObjectId43(_id);
44181
44169
  } catch (error) {
44182
- throw new BadRequestError69("Invalid ID.");
44170
+ throw new BadRequestError69(namespace_collection + " Invalid ID.");
44183
44171
  }
44184
44172
  try {
44185
44173
  const res = await collection.updateOne(