@eeplatform/basic-edu 1.10.19 → 1.10.21
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 -0
- package/dist/index.js +21 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3121,7 +3121,6 @@ function MLearner(value) {
|
|
|
3121
3121
|
if (value.specialProgram && typeof value.specialProgram === "string") {
|
|
3122
3122
|
try {
|
|
3123
3123
|
value.specialProgram = new ObjectId5(value.specialProgram);
|
|
3124
|
-
value.status = "screening";
|
|
3125
3124
|
} catch (error2) {
|
|
3126
3125
|
throw new BadRequestError8("Invalid specialProgram format");
|
|
3127
3126
|
}
|
|
@@ -34602,7 +34601,8 @@ function useSchoolController() {
|
|
|
34602
34601
|
updateStatusById: _updateStatusById,
|
|
34603
34602
|
updateFieldById: _updateFieldById,
|
|
34604
34603
|
updateById: _updateById,
|
|
34605
|
-
deleteById: _deleteById
|
|
34604
|
+
deleteById: _deleteById,
|
|
34605
|
+
getById: _getById
|
|
34606
34606
|
} = useSchoolRepo();
|
|
34607
34607
|
const {
|
|
34608
34608
|
add: _addSchool,
|
|
@@ -34843,6 +34843,22 @@ function useSchoolController() {
|
|
|
34843
34843
|
next(error2);
|
|
34844
34844
|
}
|
|
34845
34845
|
}
|
|
34846
|
+
async function getById(req, res, next) {
|
|
34847
|
+
const schoolId = req.params.id;
|
|
34848
|
+
const validation = Joi15.string().hex().required();
|
|
34849
|
+
const { error } = validation.validate(schoolId);
|
|
34850
|
+
if (error) {
|
|
34851
|
+
next(new BadRequestError23(`Validation error: ${error.message}`));
|
|
34852
|
+
return;
|
|
34853
|
+
}
|
|
34854
|
+
try {
|
|
34855
|
+
const school = await _getById(schoolId);
|
|
34856
|
+
res.status(200).json(school);
|
|
34857
|
+
return;
|
|
34858
|
+
} catch (error2) {
|
|
34859
|
+
next(error2);
|
|
34860
|
+
}
|
|
34861
|
+
}
|
|
34846
34862
|
return {
|
|
34847
34863
|
add,
|
|
34848
34864
|
getAll,
|
|
@@ -34853,7 +34869,8 @@ function useSchoolController() {
|
|
|
34853
34869
|
addBulk,
|
|
34854
34870
|
updateFieldById,
|
|
34855
34871
|
updateById,
|
|
34856
|
-
deleteById
|
|
34872
|
+
deleteById,
|
|
34873
|
+
getById
|
|
34857
34874
|
};
|
|
34858
34875
|
}
|
|
34859
34876
|
|
|
@@ -36158,7 +36175,6 @@ function useEnrollmentService() {
|
|
|
36158
36175
|
if (status === "accepted") {
|
|
36159
36176
|
delete enrollment._id;
|
|
36160
36177
|
enrollment.school = enrollment.school.toString();
|
|
36161
|
-
enrollment.status = "active";
|
|
36162
36178
|
enrollment.updatedAt = "";
|
|
36163
36179
|
enrollment.createdAt = /* @__PURE__ */ new Date();
|
|
36164
36180
|
enrollment.deletedAt = "";
|
|
@@ -36194,14 +36210,13 @@ function useEnrollmentService() {
|
|
|
36194
36210
|
if (enrollment.seniorHighInfo?.strand) {
|
|
36195
36211
|
enrollment.seniorHighInfo.strand = enrollment.seniorHighInfo?.strand?.toString();
|
|
36196
36212
|
}
|
|
36213
|
+
enrollment.status = "active";
|
|
36197
36214
|
await addLearner(enrollment, session);
|
|
36198
36215
|
}
|
|
36199
36216
|
const programScreening = await getByApplicantId(_id);
|
|
36200
36217
|
if (programScreening) {
|
|
36201
36218
|
if (["cancelled", "withdrawn"].includes(status)) {
|
|
36202
36219
|
await updateStatusByApplicantId(_id, "cancelled", session);
|
|
36203
|
-
} else {
|
|
36204
|
-
await updateStatusByApplicantId(_id, status, session);
|
|
36205
36220
|
}
|
|
36206
36221
|
}
|
|
36207
36222
|
await session.commitTransaction();
|