@eeplatform/basic-edu 1.9.0 → 1.9.1
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 +7 -0
- package/dist/index.js +79 -76
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +79 -76
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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(
|
|
@@ -3344,7 +3344,7 @@ function useEnrollmentRepo() {
|
|
|
3344
3344
|
try {
|
|
3345
3345
|
_id = new ObjectId6(_id);
|
|
3346
3346
|
} catch (error) {
|
|
3347
|
-
throw new BadRequestError8("Invalid ID.");
|
|
3347
|
+
throw new BadRequestError8(namespace_collection + " Invalid ID.");
|
|
3348
3348
|
}
|
|
3349
3349
|
const query = { _id };
|
|
3350
3350
|
const cacheKeyOptions = { _id: _id.toString() };
|
|
@@ -3383,7 +3383,7 @@ function useEnrollmentRepo() {
|
|
|
3383
3383
|
try {
|
|
3384
3384
|
_id = new ObjectId6(_id);
|
|
3385
3385
|
} catch (error) {
|
|
3386
|
-
throw new BadRequestError8("Invalid ID.");
|
|
3386
|
+
throw new BadRequestError8(namespace_collection + " Invalid ID.");
|
|
3387
3387
|
}
|
|
3388
3388
|
try {
|
|
3389
3389
|
const result = await collection.updateOne(
|
|
@@ -3644,7 +3644,7 @@ function useLearnerRepo() {
|
|
|
3644
3644
|
try {
|
|
3645
3645
|
_id = new ObjectId7(_id);
|
|
3646
3646
|
} catch (error) {
|
|
3647
|
-
throw new BadRequestError9("Invalid ID.");
|
|
3647
|
+
throw new BadRequestError9(namespace_collection + " Invalid ID.");
|
|
3648
3648
|
}
|
|
3649
3649
|
const query = { _id };
|
|
3650
3650
|
const cacheKeyOptions = { _id: _id.toString() };
|
|
@@ -3751,7 +3751,7 @@ function useLearnerRepo() {
|
|
|
3751
3751
|
try {
|
|
3752
3752
|
_id = new ObjectId7(_id);
|
|
3753
3753
|
} catch (error) {
|
|
3754
|
-
throw new BadRequestError9("Invalid ID.");
|
|
3754
|
+
throw new BadRequestError9(namespace_collection + " Invalid ID.");
|
|
3755
3755
|
}
|
|
3756
3756
|
try {
|
|
3757
3757
|
const result = await collection.updateOne(
|
|
@@ -3939,7 +3939,7 @@ function useBasicEduCountRepo() {
|
|
|
3939
3939
|
try {
|
|
3940
3940
|
_id = new ObjectId8(_id);
|
|
3941
3941
|
} catch (error) {
|
|
3942
|
-
throw new BadRequestError12("Invalid ID.");
|
|
3942
|
+
throw new BadRequestError12(namespace_collection + " Invalid ID.");
|
|
3943
3943
|
}
|
|
3944
3944
|
const query = { _id };
|
|
3945
3945
|
const cacheKeyOptions = { _id: _id.toString() };
|
|
@@ -4010,7 +4010,7 @@ function useBasicEduCountRepo() {
|
|
|
4010
4010
|
try {
|
|
4011
4011
|
_id = new ObjectId8(_id);
|
|
4012
4012
|
} catch (error) {
|
|
4013
|
-
throw new BadRequestError12("Invalid ID.");
|
|
4013
|
+
throw new BadRequestError12(namespace_collection + " Invalid ID.");
|
|
4014
4014
|
}
|
|
4015
4015
|
try {
|
|
4016
4016
|
const result = await collection.updateOne(
|
|
@@ -4028,7 +4028,7 @@ function useBasicEduCountRepo() {
|
|
|
4028
4028
|
try {
|
|
4029
4029
|
_id = new ObjectId8(_id);
|
|
4030
4030
|
} catch (error) {
|
|
4031
|
-
throw new BadRequestError12("Invalid ID.");
|
|
4031
|
+
throw new BadRequestError12(namespace_collection + " Invalid ID.");
|
|
4032
4032
|
}
|
|
4033
4033
|
try {
|
|
4034
4034
|
const result = await collection.updateOne(
|
|
@@ -4307,7 +4307,7 @@ function useProgramScreeningRepo() {
|
|
|
4307
4307
|
try {
|
|
4308
4308
|
_id = new ObjectId10(_id);
|
|
4309
4309
|
} catch (error) {
|
|
4310
|
-
throw new BadRequestError14("Invalid ID.");
|
|
4310
|
+
throw new BadRequestError14(namespace_collection + " Invalid ID.");
|
|
4311
4311
|
}
|
|
4312
4312
|
const cacheKey = makeCacheKey6(namespace_collection, { _id: String(_id) });
|
|
4313
4313
|
try {
|
|
@@ -4350,7 +4350,7 @@ function useProgramScreeningRepo() {
|
|
|
4350
4350
|
try {
|
|
4351
4351
|
_id = new ObjectId10(_id);
|
|
4352
4352
|
} catch (error) {
|
|
4353
|
-
throw new BadRequestError14("Invalid ID.");
|
|
4353
|
+
throw new BadRequestError14(namespace_collection + " Invalid ID.");
|
|
4354
4354
|
}
|
|
4355
4355
|
const cacheKey = makeCacheKey6(namespace_collection, {
|
|
4356
4356
|
applicant: String(_id)
|
|
@@ -4456,7 +4456,7 @@ function useProgramScreeningRepo() {
|
|
|
4456
4456
|
try {
|
|
4457
4457
|
_id = new ObjectId10(_id);
|
|
4458
4458
|
} catch (error) {
|
|
4459
|
-
throw new BadRequestError14("Invalid ID.");
|
|
4459
|
+
throw new BadRequestError14(namespace_collection + " Invalid ID.");
|
|
4460
4460
|
}
|
|
4461
4461
|
try {
|
|
4462
4462
|
await collection.updateOne(
|
|
@@ -4476,7 +4476,7 @@ function useProgramScreeningRepo() {
|
|
|
4476
4476
|
try {
|
|
4477
4477
|
_id = new ObjectId10(_id);
|
|
4478
4478
|
} catch (error) {
|
|
4479
|
-
throw new BadRequestError14("Invalid ID.");
|
|
4479
|
+
throw new BadRequestError14(namespace_collection + " Invalid ID.");
|
|
4480
4480
|
}
|
|
4481
4481
|
try {
|
|
4482
4482
|
await collection.updateOne(
|
|
@@ -4493,7 +4493,7 @@ function useProgramScreeningRepo() {
|
|
|
4493
4493
|
try {
|
|
4494
4494
|
_id = new ObjectId10(_id);
|
|
4495
4495
|
} catch (error2) {
|
|
4496
|
-
throw new BadRequestError14("Invalid ID.");
|
|
4496
|
+
throw new BadRequestError14(namespace_collection + " Invalid ID.");
|
|
4497
4497
|
}
|
|
4498
4498
|
const { error } = schemaProgramScreeningUpdate.validate(value);
|
|
4499
4499
|
if (error) {
|
|
@@ -4518,7 +4518,7 @@ function useProgramScreeningRepo() {
|
|
|
4518
4518
|
try {
|
|
4519
4519
|
_id = new ObjectId10(_id);
|
|
4520
4520
|
} catch (error) {
|
|
4521
|
-
throw new BadRequestError14("Invalid ID.");
|
|
4521
|
+
throw new BadRequestError14(namespace_collection + " Invalid ID.");
|
|
4522
4522
|
}
|
|
4523
4523
|
try {
|
|
4524
4524
|
await collection.updateOne(
|
|
@@ -5064,7 +5064,7 @@ function useProgramRepo() {
|
|
|
5064
5064
|
try {
|
|
5065
5065
|
_id = new ObjectId12(_id);
|
|
5066
5066
|
} catch (error) {
|
|
5067
|
-
throw new BadRequestError17("Invalid ID.");
|
|
5067
|
+
throw new BadRequestError17(namespace_collection + " Invalid ID.");
|
|
5068
5068
|
}
|
|
5069
5069
|
const cacheKey = makeCacheKey7(namespace_collection, { _id: String(_id) });
|
|
5070
5070
|
try {
|
|
@@ -5167,7 +5167,7 @@ function useProgramRepo() {
|
|
|
5167
5167
|
try {
|
|
5168
5168
|
_id = new ObjectId12(_id);
|
|
5169
5169
|
} catch (error) {
|
|
5170
|
-
throw new BadRequestError17("Invalid ID.");
|
|
5170
|
+
throw new BadRequestError17(namespace_collection + " Invalid ID.");
|
|
5171
5171
|
}
|
|
5172
5172
|
try {
|
|
5173
5173
|
await collection.updateOne(
|
|
@@ -5185,7 +5185,7 @@ function useProgramRepo() {
|
|
|
5185
5185
|
try {
|
|
5186
5186
|
_id = new ObjectId12(_id);
|
|
5187
5187
|
} catch (error) {
|
|
5188
|
-
throw new BadRequestError17("Invalid ID.");
|
|
5188
|
+
throw new BadRequestError17(namespace_collection + " Invalid ID.");
|
|
5189
5189
|
}
|
|
5190
5190
|
try {
|
|
5191
5191
|
await collection.updateOne(
|
|
@@ -5202,7 +5202,7 @@ function useProgramRepo() {
|
|
|
5202
5202
|
try {
|
|
5203
5203
|
_id = new ObjectId12(_id);
|
|
5204
5204
|
} catch (error2) {
|
|
5205
|
-
throw new BadRequestError17("Invalid ID.");
|
|
5205
|
+
throw new BadRequestError17(namespace_collection + " Invalid ID.");
|
|
5206
5206
|
}
|
|
5207
5207
|
const { error } = schemaProgramUpdate.validate(value);
|
|
5208
5208
|
if (error) {
|
|
@@ -5684,7 +5684,7 @@ function useSchoolRepo() {
|
|
|
5684
5684
|
try {
|
|
5685
5685
|
_id = new ObjectId14(_id);
|
|
5686
5686
|
} catch (error) {
|
|
5687
|
-
throw new BadRequestError20("Invalid ID.");
|
|
5687
|
+
throw new BadRequestError20(namespace_collection + " Invalid ID.");
|
|
5688
5688
|
}
|
|
5689
5689
|
const query = { _id };
|
|
5690
5690
|
const cacheKeyOptions = {
|
|
@@ -5733,7 +5733,7 @@ function useSchoolRepo() {
|
|
|
5733
5733
|
try {
|
|
5734
5734
|
createdBy = new ObjectId14(createdBy);
|
|
5735
5735
|
} catch (error) {
|
|
5736
|
-
throw new BadRequestError20("Invalid ID.");
|
|
5736
|
+
throw new BadRequestError20(namespace_collection + " Invalid ID.");
|
|
5737
5737
|
}
|
|
5738
5738
|
const cacheKey = makeCacheKey8(namespace_collection, { createdBy });
|
|
5739
5739
|
try {
|
|
@@ -5814,7 +5814,7 @@ function useSchoolRepo() {
|
|
|
5814
5814
|
try {
|
|
5815
5815
|
_id = new ObjectId14(_id);
|
|
5816
5816
|
} catch (error) {
|
|
5817
|
-
throw new BadRequestError20("Invalid ID.");
|
|
5817
|
+
throw new BadRequestError20(namespace_collection + " Invalid ID.");
|
|
5818
5818
|
}
|
|
5819
5819
|
try {
|
|
5820
5820
|
await collection.updateOne(
|
|
@@ -5848,7 +5848,7 @@ function useSchoolRepo() {
|
|
|
5848
5848
|
try {
|
|
5849
5849
|
_id = new ObjectId14(_id);
|
|
5850
5850
|
} catch (error) {
|
|
5851
|
-
throw new BadRequestError20("Invalid ID.");
|
|
5851
|
+
throw new BadRequestError20(namespace_collection + " Invalid ID.");
|
|
5852
5852
|
}
|
|
5853
5853
|
try {
|
|
5854
5854
|
await collection.updateOne(
|
|
@@ -5894,7 +5894,7 @@ function useSchoolRepo() {
|
|
|
5894
5894
|
try {
|
|
5895
5895
|
_id = new ObjectId14(_id);
|
|
5896
5896
|
} catch (error2) {
|
|
5897
|
-
throw new BadRequestError20("Invalid ID.");
|
|
5897
|
+
throw new BadRequestError20(namespace_collection + " Invalid ID.");
|
|
5898
5898
|
}
|
|
5899
5899
|
try {
|
|
5900
5900
|
await collection.updateOne({ _id }, { $set: options }, { session });
|
|
@@ -5908,7 +5908,7 @@ function useSchoolRepo() {
|
|
|
5908
5908
|
try {
|
|
5909
5909
|
_id = new ObjectId14(_id);
|
|
5910
5910
|
} catch (error) {
|
|
5911
|
-
throw new BadRequestError20("Invalid ID.");
|
|
5911
|
+
throw new BadRequestError20(namespace_collection + " Invalid ID.");
|
|
5912
5912
|
}
|
|
5913
5913
|
try {
|
|
5914
5914
|
await collection.updateOne(
|
|
@@ -35077,9 +35077,12 @@ function useEnrollmentService() {
|
|
|
35077
35077
|
if (!school) {
|
|
35078
35078
|
throw new BadRequestError23("School not found.");
|
|
35079
35079
|
}
|
|
35080
|
-
|
|
35081
|
-
if (payload.specialProgram
|
|
35082
|
-
|
|
35080
|
+
let program = null;
|
|
35081
|
+
if (payload.specialProgram) {
|
|
35082
|
+
program = await getProgramById(payload.specialProgram ?? "");
|
|
35083
|
+
if (!program) {
|
|
35084
|
+
throw new BadRequestError23("Special program not found.");
|
|
35085
|
+
}
|
|
35083
35086
|
}
|
|
35084
35087
|
const enrollmentPromises = Array.from(
|
|
35085
35088
|
{ length: payload.numberOfApplications },
|
|
@@ -35482,7 +35485,7 @@ function useGradeLevelRepo() {
|
|
|
35482
35485
|
try {
|
|
35483
35486
|
_id = new ObjectId16(_id);
|
|
35484
35487
|
} catch (error) {
|
|
35485
|
-
throw new BadRequestError26("Invalid ID.");
|
|
35488
|
+
throw new BadRequestError26(namespace_collection + " Invalid ID.");
|
|
35486
35489
|
}
|
|
35487
35490
|
if (value.school && typeof value.school === "string") {
|
|
35488
35491
|
try {
|
|
@@ -35616,7 +35619,7 @@ function useGradeLevelRepo() {
|
|
|
35616
35619
|
try {
|
|
35617
35620
|
_id = new ObjectId16(_id);
|
|
35618
35621
|
} catch (error) {
|
|
35619
|
-
throw new BadRequestError26("Invalid ID.");
|
|
35622
|
+
throw new BadRequestError26(namespace_collection + " Invalid ID.");
|
|
35620
35623
|
}
|
|
35621
35624
|
const cacheKey = makeCacheKey9(namespace_collection, { _id: String(_id) });
|
|
35622
35625
|
try {
|
|
@@ -35674,7 +35677,7 @@ function useGradeLevelRepo() {
|
|
|
35674
35677
|
try {
|
|
35675
35678
|
_id = new ObjectId16(_id);
|
|
35676
35679
|
} catch (error) {
|
|
35677
|
-
throw new BadRequestError26("Invalid ID.");
|
|
35680
|
+
throw new BadRequestError26(namespace_collection + " Invalid ID.");
|
|
35678
35681
|
}
|
|
35679
35682
|
try {
|
|
35680
35683
|
const res = await collection.updateOne(
|
|
@@ -36190,7 +36193,7 @@ function useRegionRepo() {
|
|
|
36190
36193
|
try {
|
|
36191
36194
|
_id = new ObjectId18(_id);
|
|
36192
36195
|
} catch (error) {
|
|
36193
|
-
throw new BadRequestError29("Invalid ID.");
|
|
36196
|
+
throw new BadRequestError29(namespace_collection + " Invalid ID.");
|
|
36194
36197
|
}
|
|
36195
36198
|
const cacheKey = makeCacheKey10(namespace_collection, { _id: String(_id) });
|
|
36196
36199
|
try {
|
|
@@ -36277,7 +36280,7 @@ function useRegionRepo() {
|
|
|
36277
36280
|
try {
|
|
36278
36281
|
_id = new ObjectId18(_id);
|
|
36279
36282
|
} catch (error) {
|
|
36280
|
-
throw new BadRequestError29("Invalid ID.");
|
|
36283
|
+
throw new BadRequestError29(namespace_collection + " Invalid ID.");
|
|
36281
36284
|
}
|
|
36282
36285
|
try {
|
|
36283
36286
|
await collection.updateOne(
|
|
@@ -36295,7 +36298,7 @@ function useRegionRepo() {
|
|
|
36295
36298
|
try {
|
|
36296
36299
|
_id = new ObjectId18(_id);
|
|
36297
36300
|
} catch (error) {
|
|
36298
|
-
throw new BadRequestError29("Invalid ID.");
|
|
36301
|
+
throw new BadRequestError29(namespace_collection + " Invalid ID.");
|
|
36299
36302
|
}
|
|
36300
36303
|
try {
|
|
36301
36304
|
await collection.updateOne(
|
|
@@ -36687,7 +36690,7 @@ function useDivisionRepo() {
|
|
|
36687
36690
|
try {
|
|
36688
36691
|
_id = new ObjectId20(_id);
|
|
36689
36692
|
} catch (error) {
|
|
36690
|
-
throw new BadRequestError32("Invalid ID.");
|
|
36693
|
+
throw new BadRequestError32(namespace_collection + " Invalid ID.");
|
|
36691
36694
|
}
|
|
36692
36695
|
const cacheKey = makeCacheKey11(namespace_collection, { _id: String(_id) });
|
|
36693
36696
|
try {
|
|
@@ -36774,7 +36777,7 @@ function useDivisionRepo() {
|
|
|
36774
36777
|
try {
|
|
36775
36778
|
_id = new ObjectId20(_id);
|
|
36776
36779
|
} catch (error) {
|
|
36777
|
-
throw new BadRequestError32("Invalid ID.");
|
|
36780
|
+
throw new BadRequestError32(namespace_collection + " Invalid ID.");
|
|
36778
36781
|
}
|
|
36779
36782
|
try {
|
|
36780
36783
|
await collection.updateOne(
|
|
@@ -36799,7 +36802,7 @@ function useDivisionRepo() {
|
|
|
36799
36802
|
try {
|
|
36800
36803
|
_id = new ObjectId20(_id);
|
|
36801
36804
|
} catch (error2) {
|
|
36802
|
-
throw new BadRequestError32("Invalid ID.");
|
|
36805
|
+
throw new BadRequestError32(namespace_collection + " Invalid ID.");
|
|
36803
36806
|
}
|
|
36804
36807
|
if (options.region) {
|
|
36805
36808
|
try {
|
|
@@ -36820,7 +36823,7 @@ function useDivisionRepo() {
|
|
|
36820
36823
|
try {
|
|
36821
36824
|
_id = new ObjectId20(_id);
|
|
36822
36825
|
} catch (error) {
|
|
36823
|
-
throw new BadRequestError32("Invalid ID.");
|
|
36826
|
+
throw new BadRequestError32(namespace_collection + " Invalid ID.");
|
|
36824
36827
|
}
|
|
36825
36828
|
try {
|
|
36826
36829
|
await collection.updateOne(
|
|
@@ -37141,7 +37144,7 @@ function MAsset(value) {
|
|
|
37141
37144
|
try {
|
|
37142
37145
|
value._id = new ObjectId21();
|
|
37143
37146
|
} catch (error2) {
|
|
37144
|
-
throw new BadRequestError34("Invalid ID.");
|
|
37147
|
+
throw new BadRequestError34("Asset Invalid ID.");
|
|
37145
37148
|
}
|
|
37146
37149
|
}
|
|
37147
37150
|
try {
|
|
@@ -37236,7 +37239,7 @@ function useAssetRepo() {
|
|
|
37236
37239
|
try {
|
|
37237
37240
|
_id = new ObjectId22(_id);
|
|
37238
37241
|
} catch (error2) {
|
|
37239
|
-
throw new BadRequestError35("Invalid ID.");
|
|
37242
|
+
throw new BadRequestError35(namespace_collection + " Invalid ID.");
|
|
37240
37243
|
}
|
|
37241
37244
|
try {
|
|
37242
37245
|
const res = await collection.updateOne(
|
|
@@ -37256,7 +37259,7 @@ function useAssetRepo() {
|
|
|
37256
37259
|
try {
|
|
37257
37260
|
_id = new ObjectId22(_id);
|
|
37258
37261
|
} catch (error) {
|
|
37259
|
-
throw new BadRequestError35("Invalid ID.");
|
|
37262
|
+
throw new BadRequestError35(namespace_collection + " Invalid ID.");
|
|
37260
37263
|
}
|
|
37261
37264
|
try {
|
|
37262
37265
|
const res = await collection.deleteOne({ _id });
|
|
@@ -37273,7 +37276,7 @@ function useAssetRepo() {
|
|
|
37273
37276
|
try {
|
|
37274
37277
|
_id = new ObjectId22(_id);
|
|
37275
37278
|
} catch (error) {
|
|
37276
|
-
throw new BadRequestError35("Invalid ID.");
|
|
37279
|
+
throw new BadRequestError35(namespace_collection + " Invalid ID.");
|
|
37277
37280
|
}
|
|
37278
37281
|
const cacheKey = makeCacheKey12(namespace_collection, { _id: String(_id) });
|
|
37279
37282
|
const cachedData = await getCache(cacheKey);
|
|
@@ -37863,7 +37866,7 @@ function useStockCardRepository() {
|
|
|
37863
37866
|
try {
|
|
37864
37867
|
_id = new ObjectId24(_id);
|
|
37865
37868
|
} catch (error) {
|
|
37866
|
-
throw new BadRequestError38("Invalid ID.");
|
|
37869
|
+
throw new BadRequestError38(namespace_collection + " Invalid ID.");
|
|
37867
37870
|
}
|
|
37868
37871
|
const cacheKey = makeCacheKey13(namespace_collection, { _id: String(_id) });
|
|
37869
37872
|
const cachedData = await getCache(cacheKey);
|
|
@@ -37904,7 +37907,7 @@ function useStockCardRepository() {
|
|
|
37904
37907
|
try {
|
|
37905
37908
|
id = new ObjectId24(id);
|
|
37906
37909
|
} catch (error) {
|
|
37907
|
-
throw new BadRequestError38("Invalid ID.");
|
|
37910
|
+
throw new BadRequestError38(namespace_collection + " Invalid ID.");
|
|
37908
37911
|
}
|
|
37909
37912
|
const query = {
|
|
37910
37913
|
school,
|
|
@@ -38284,7 +38287,7 @@ function usePlantillaRepo() {
|
|
|
38284
38287
|
try {
|
|
38285
38288
|
_id = new ObjectId26(_id);
|
|
38286
38289
|
} catch (error) {
|
|
38287
|
-
throw new BadRequestError42("Invalid ID.");
|
|
38290
|
+
throw new BadRequestError42(namespace_collection + " Invalid ID.");
|
|
38288
38291
|
}
|
|
38289
38292
|
value.updatedAt = /* @__PURE__ */ new Date();
|
|
38290
38293
|
try {
|
|
@@ -38384,7 +38387,7 @@ function usePlantillaRepo() {
|
|
|
38384
38387
|
try {
|
|
38385
38388
|
_id = new ObjectId26(_id);
|
|
38386
38389
|
} catch (error) {
|
|
38387
|
-
throw new BadRequestError42("Invalid ID.");
|
|
38390
|
+
throw new BadRequestError42(namespace_collection + " Invalid ID.");
|
|
38388
38391
|
}
|
|
38389
38392
|
const cacheKey = makeCacheKey14(namespace_collection, { _id: String(_id) });
|
|
38390
38393
|
try {
|
|
@@ -38423,7 +38426,7 @@ function usePlantillaRepo() {
|
|
|
38423
38426
|
try {
|
|
38424
38427
|
_id = new ObjectId26(_id);
|
|
38425
38428
|
} catch (error) {
|
|
38426
|
-
throw new BadRequestError42("Invalid ID.");
|
|
38429
|
+
throw new BadRequestError42(namespace_collection + " Invalid ID.");
|
|
38427
38430
|
}
|
|
38428
38431
|
try {
|
|
38429
38432
|
const res = await collection.updateOne(
|
|
@@ -39070,7 +39073,7 @@ function useSectionPresetRepo() {
|
|
|
39070
39073
|
try {
|
|
39071
39074
|
_id = new ObjectId28(_id);
|
|
39072
39075
|
} catch (error) {
|
|
39073
|
-
throw new BadRequestError46("Invalid ID.");
|
|
39076
|
+
throw new BadRequestError46(namespace_collection + " Invalid ID.");
|
|
39074
39077
|
}
|
|
39075
39078
|
const cacheKey = makeCacheKey15(namespace_collection, { _id: String(_id) });
|
|
39076
39079
|
try {
|
|
@@ -39157,7 +39160,7 @@ function useSectionPresetRepo() {
|
|
|
39157
39160
|
try {
|
|
39158
39161
|
_id = new ObjectId28(_id);
|
|
39159
39162
|
} catch (error) {
|
|
39160
|
-
throw new BadRequestError46("Invalid ID.");
|
|
39163
|
+
throw new BadRequestError46(namespace_collection + " Invalid ID.");
|
|
39161
39164
|
}
|
|
39162
39165
|
try {
|
|
39163
39166
|
await collection.updateOne(
|
|
@@ -39177,7 +39180,7 @@ function useSectionPresetRepo() {
|
|
|
39177
39180
|
try {
|
|
39178
39181
|
_id = new ObjectId28(_id);
|
|
39179
39182
|
} catch (error) {
|
|
39180
|
-
throw new BadRequestError46("Invalid ID.");
|
|
39183
|
+
throw new BadRequestError46(namespace_collection + " Invalid ID.");
|
|
39181
39184
|
}
|
|
39182
39185
|
try {
|
|
39183
39186
|
await collection.updateOne(
|
|
@@ -39597,7 +39600,7 @@ function useSectionRepo() {
|
|
|
39597
39600
|
try {
|
|
39598
39601
|
_id = new ObjectId30(_id);
|
|
39599
39602
|
} catch (error) {
|
|
39600
|
-
throw new BadRequestError49("Invalid ID.");
|
|
39603
|
+
throw new BadRequestError49(namespace_collection + " Invalid ID.");
|
|
39601
39604
|
}
|
|
39602
39605
|
const cacheKey = makeCacheKey16(namespace_collection, { _id: String(_id) });
|
|
39603
39606
|
try {
|
|
@@ -39732,7 +39735,7 @@ function useSectionRepo() {
|
|
|
39732
39735
|
try {
|
|
39733
39736
|
_id = new ObjectId30(_id);
|
|
39734
39737
|
} catch (error) {
|
|
39735
|
-
throw new BadRequestError49("Invalid ID.");
|
|
39738
|
+
throw new BadRequestError49(namespace_collection + " Invalid ID.");
|
|
39736
39739
|
}
|
|
39737
39740
|
if (field === "adviser" && value) {
|
|
39738
39741
|
try {
|
|
@@ -39801,7 +39804,7 @@ function useSectionRepo() {
|
|
|
39801
39804
|
try {
|
|
39802
39805
|
_id = new ObjectId30(_id);
|
|
39803
39806
|
} catch (error) {
|
|
39804
|
-
throw new BadRequestError49("Invalid ID.");
|
|
39807
|
+
throw new BadRequestError49(namespace_collection + " Invalid ID.");
|
|
39805
39808
|
}
|
|
39806
39809
|
try {
|
|
39807
39810
|
await collection.updateOne(
|
|
@@ -40385,7 +40388,7 @@ function useSectionSubjectRepo() {
|
|
|
40385
40388
|
try {
|
|
40386
40389
|
_id = new ObjectId34(_id);
|
|
40387
40390
|
} catch (error) {
|
|
40388
|
-
throw new BadRequestError53("Invalid ID.");
|
|
40391
|
+
throw new BadRequestError53(namespace_collection + " Invalid ID.");
|
|
40389
40392
|
}
|
|
40390
40393
|
const cacheKey = makeCacheKey18(namespace_collection, {
|
|
40391
40394
|
_id: String(_id),
|
|
@@ -40575,7 +40578,7 @@ function useSectionSubjectRepo() {
|
|
|
40575
40578
|
try {
|
|
40576
40579
|
_id = new ObjectId34(_id);
|
|
40577
40580
|
} catch (error) {
|
|
40578
|
-
throw new BadRequestError53("Invalid ID.");
|
|
40581
|
+
throw new BadRequestError53(namespace_collection + " Invalid ID.");
|
|
40579
40582
|
}
|
|
40580
40583
|
if (field === "teacher" && value) {
|
|
40581
40584
|
try {
|
|
@@ -40609,7 +40612,7 @@ function useSectionSubjectRepo() {
|
|
|
40609
40612
|
try {
|
|
40610
40613
|
_id = new ObjectId34(_id);
|
|
40611
40614
|
} catch (error2) {
|
|
40612
|
-
throw new BadRequestError53("Invalid ID.");
|
|
40615
|
+
throw new BadRequestError53(namespace_collection + " Invalid ID.");
|
|
40613
40616
|
}
|
|
40614
40617
|
if (value.teacher && typeof value.teacher === "string") {
|
|
40615
40618
|
try {
|
|
@@ -40641,7 +40644,7 @@ function useSectionSubjectRepo() {
|
|
|
40641
40644
|
try {
|
|
40642
40645
|
_id = new ObjectId34(_id);
|
|
40643
40646
|
} catch (error) {
|
|
40644
|
-
throw new BadRequestError53("Invalid ID.");
|
|
40647
|
+
throw new BadRequestError53(namespace_collection + " Invalid ID.");
|
|
40645
40648
|
}
|
|
40646
40649
|
try {
|
|
40647
40650
|
await collection.updateOne(
|
|
@@ -41076,7 +41079,7 @@ function useTeachingLoadRepo() {
|
|
|
41076
41079
|
try {
|
|
41077
41080
|
_id = new ObjectId36(_id);
|
|
41078
41081
|
} catch (error) {
|
|
41079
|
-
throw new BadRequestError56("Invalid ID.");
|
|
41082
|
+
throw new BadRequestError56(namespace_collection + " Invalid ID.");
|
|
41080
41083
|
}
|
|
41081
41084
|
if (value.teacher && typeof value.teacher === "string") {
|
|
41082
41085
|
try {
|
|
@@ -41212,7 +41215,7 @@ function useTeachingLoadRepo() {
|
|
|
41212
41215
|
try {
|
|
41213
41216
|
_id = new ObjectId36(_id);
|
|
41214
41217
|
} catch (error) {
|
|
41215
|
-
throw new BadRequestError56("Invalid ID.");
|
|
41218
|
+
throw new BadRequestError56(namespace_collection + " Invalid ID.");
|
|
41216
41219
|
}
|
|
41217
41220
|
const cacheKey = makeCacheKey19(namespace_collection, { _id: String(_id) });
|
|
41218
41221
|
try {
|
|
@@ -41251,7 +41254,7 @@ function useTeachingLoadRepo() {
|
|
|
41251
41254
|
try {
|
|
41252
41255
|
_id = new ObjectId36(_id);
|
|
41253
41256
|
} catch (error) {
|
|
41254
|
-
throw new BadRequestError56("Invalid ID.");
|
|
41257
|
+
throw new BadRequestError56(namespace_collection + " Invalid ID.");
|
|
41255
41258
|
}
|
|
41256
41259
|
try {
|
|
41257
41260
|
const res = await collection.updateOne(
|
|
@@ -41704,7 +41707,7 @@ function useTeachingLoadSlotRepo() {
|
|
|
41704
41707
|
try {
|
|
41705
41708
|
_id = new ObjectId38(_id);
|
|
41706
41709
|
} catch (error) {
|
|
41707
|
-
throw new BadRequestError59("Invalid ID.");
|
|
41710
|
+
throw new BadRequestError59(namespace_collection + " Invalid ID.");
|
|
41708
41711
|
}
|
|
41709
41712
|
if (value.subject && typeof value.subject === "string") {
|
|
41710
41713
|
try {
|
|
@@ -41853,7 +41856,7 @@ function useTeachingLoadSlotRepo() {
|
|
|
41853
41856
|
try {
|
|
41854
41857
|
_id = new ObjectId38(_id);
|
|
41855
41858
|
} catch (error) {
|
|
41856
|
-
throw new BadRequestError59("Invalid ID.");
|
|
41859
|
+
throw new BadRequestError59(namespace_collection + " Invalid ID.");
|
|
41857
41860
|
}
|
|
41858
41861
|
const cacheKey = makeCacheKey20(namespace_collection, { _id: String(_id) });
|
|
41859
41862
|
try {
|
|
@@ -41892,7 +41895,7 @@ function useTeachingLoadSlotRepo() {
|
|
|
41892
41895
|
try {
|
|
41893
41896
|
_id = new ObjectId38(_id);
|
|
41894
41897
|
} catch (error) {
|
|
41895
|
-
throw new BadRequestError59("Invalid ID.");
|
|
41898
|
+
throw new BadRequestError59(namespace_collection + " Invalid ID.");
|
|
41896
41899
|
}
|
|
41897
41900
|
try {
|
|
41898
41901
|
const res = await collection.updateOne(
|
|
@@ -42365,7 +42368,7 @@ function usePersonnelRepo() {
|
|
|
42365
42368
|
try {
|
|
42366
42369
|
_id = new ObjectId40(_id);
|
|
42367
42370
|
} catch (error) {
|
|
42368
|
-
throw new BadRequestError62("Invalid ID.");
|
|
42371
|
+
throw new BadRequestError62(namespace_collection + " Invalid ID.");
|
|
42369
42372
|
}
|
|
42370
42373
|
try {
|
|
42371
42374
|
const res = await collection.updateOne(
|
|
@@ -42460,7 +42463,7 @@ function usePersonnelRepo() {
|
|
|
42460
42463
|
try {
|
|
42461
42464
|
_id = new ObjectId40(_id);
|
|
42462
42465
|
} catch (error) {
|
|
42463
|
-
throw new BadRequestError62("Invalid ID.");
|
|
42466
|
+
throw new BadRequestError62(namespace_collection + " Invalid ID.");
|
|
42464
42467
|
}
|
|
42465
42468
|
const cacheKey = makeCacheKey21(namespace_collection, { _id: String(_id) });
|
|
42466
42469
|
try {
|
|
@@ -42499,7 +42502,7 @@ function usePersonnelRepo() {
|
|
|
42499
42502
|
try {
|
|
42500
42503
|
_id = new ObjectId40(_id);
|
|
42501
42504
|
} catch (error) {
|
|
42502
|
-
throw new BadRequestError62("Invalid ID.");
|
|
42505
|
+
throw new BadRequestError62(namespace_collection + " Invalid ID.");
|
|
42503
42506
|
}
|
|
42504
42507
|
try {
|
|
42505
42508
|
const res = await collection.updateOne(
|
|
@@ -43612,7 +43615,7 @@ function useBuildingRepo() {
|
|
|
43612
43615
|
try {
|
|
43613
43616
|
_id = new ObjectId42(_id);
|
|
43614
43617
|
} catch (error) {
|
|
43615
|
-
throw new BadRequestError68("Invalid ID.");
|
|
43618
|
+
throw new BadRequestError68(namespace_collection + " Invalid ID.");
|
|
43616
43619
|
}
|
|
43617
43620
|
try {
|
|
43618
43621
|
const res = await collection.updateOne(
|
|
@@ -43711,7 +43714,7 @@ function useBuildingRepo() {
|
|
|
43711
43714
|
try {
|
|
43712
43715
|
_id = new ObjectId42(_id);
|
|
43713
43716
|
} catch (error) {
|
|
43714
|
-
throw new BadRequestError68("Invalid ID.");
|
|
43717
|
+
throw new BadRequestError68(namespace_collection + " Invalid ID.");
|
|
43715
43718
|
}
|
|
43716
43719
|
const cacheKey = makeCacheKey22(namespace_collection, { _id: String(_id) });
|
|
43717
43720
|
try {
|
|
@@ -43750,7 +43753,7 @@ function useBuildingRepo() {
|
|
|
43750
43753
|
try {
|
|
43751
43754
|
_id = new ObjectId42(_id);
|
|
43752
43755
|
} catch (error) {
|
|
43753
|
-
throw new BadRequestError68("Invalid ID.");
|
|
43756
|
+
throw new BadRequestError68(namespace_collection + " Invalid ID.");
|
|
43754
43757
|
}
|
|
43755
43758
|
try {
|
|
43756
43759
|
const res = await collection.updateOne(
|
|
@@ -43885,7 +43888,7 @@ function useBuildingUnitRepo() {
|
|
|
43885
43888
|
try {
|
|
43886
43889
|
_id = new ObjectId43(_id);
|
|
43887
43890
|
} catch (error2) {
|
|
43888
|
-
throw new BadRequestError69("Invalid ID.");
|
|
43891
|
+
throw new BadRequestError69(namespace_collection + " Invalid ID.");
|
|
43889
43892
|
}
|
|
43890
43893
|
try {
|
|
43891
43894
|
const res = await collection.updateOne(
|
|
@@ -44050,7 +44053,7 @@ function useBuildingUnitRepo() {
|
|
|
44050
44053
|
try {
|
|
44051
44054
|
_id = new ObjectId43(_id);
|
|
44052
44055
|
} catch (error) {
|
|
44053
|
-
throw new BadRequestError69("Invalid ID.");
|
|
44056
|
+
throw new BadRequestError69(namespace_collection + " Invalid ID.");
|
|
44054
44057
|
}
|
|
44055
44058
|
const cacheKey = makeCacheKey23(namespace_collection, { _id: String(_id) });
|
|
44056
44059
|
try {
|
|
@@ -44179,7 +44182,7 @@ function useBuildingUnitRepo() {
|
|
|
44179
44182
|
try {
|
|
44180
44183
|
_id = new ObjectId43(_id);
|
|
44181
44184
|
} catch (error) {
|
|
44182
|
-
throw new BadRequestError69("Invalid ID.");
|
|
44185
|
+
throw new BadRequestError69(namespace_collection + " Invalid ID.");
|
|
44183
44186
|
}
|
|
44184
44187
|
try {
|
|
44185
44188
|
const res = await collection.updateOne(
|