@eeplatform/basic-edu 1.10.25 → 1.10.27
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.js +5 -28
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -28
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -3064,8 +3064,8 @@ var addressSchema = import_joi5.default.object({
|
|
|
3064
3064
|
zipCode: import_joi5.default.string().optional().allow("", null)
|
|
3065
3065
|
});
|
|
3066
3066
|
var TpersonContactSchema = import_joi5.default.object({
|
|
3067
|
-
lastName: import_joi5.default.string().
|
|
3068
|
-
firstName: import_joi5.default.string().
|
|
3067
|
+
lastName: import_joi5.default.string().optional().allow("", null),
|
|
3068
|
+
firstName: import_joi5.default.string().optional().allow("", null),
|
|
3069
3069
|
middleName: import_joi5.default.string().optional().allow("", null),
|
|
3070
3070
|
contactNumber: import_joi5.default.string().optional().allow("", null)
|
|
3071
3071
|
});
|
|
@@ -3146,11 +3146,11 @@ var schemaEnrollment = import_joi5.default.object({
|
|
|
3146
3146
|
// Added to match frontend
|
|
3147
3147
|
learnerInfo: learnerInfoSchema.required(),
|
|
3148
3148
|
parentGuardianInfo: import_joi5.default.object({
|
|
3149
|
-
father: TpersonContactSchema.
|
|
3149
|
+
father: TpersonContactSchema.optional(),
|
|
3150
3150
|
// Made required to match frontend
|
|
3151
|
-
mother: TpersonContactSchema.
|
|
3151
|
+
mother: TpersonContactSchema.optional(),
|
|
3152
3152
|
// Made required to match frontend
|
|
3153
|
-
legalGuardian: TpersonContactSchema.
|
|
3153
|
+
legalGuardian: TpersonContactSchema.optional()
|
|
3154
3154
|
// Made required to match frontend
|
|
3155
3155
|
}).required(),
|
|
3156
3156
|
address: import_joi5.default.object({
|
|
@@ -36213,29 +36213,6 @@ function useEnrollmentService() {
|
|
|
36213
36213
|
enrollment.createdAt = /* @__PURE__ */ new Date();
|
|
36214
36214
|
enrollment.deletedAt = "";
|
|
36215
36215
|
delete enrollment.remarks;
|
|
36216
|
-
if (!enrollment.learnerInfo.lrn) {
|
|
36217
|
-
const counter = await getByName(enrollment.schoolId);
|
|
36218
|
-
if (!counter) {
|
|
36219
|
-
throw new import_nodejs_utils32.InternalServerError(
|
|
36220
|
-
"Failed to retrieve enrollment counter"
|
|
36221
|
-
);
|
|
36222
|
-
}
|
|
36223
|
-
const counterId = String(counter._id);
|
|
36224
|
-
if (counter.updatedAt) {
|
|
36225
|
-
const countUpdatedAtYear = new Date(
|
|
36226
|
-
counter.updatedAt
|
|
36227
|
-
).getFullYear();
|
|
36228
|
-
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
36229
|
-
if (countUpdatedAtYear < currentYear) {
|
|
36230
|
-
counter.count = 0;
|
|
36231
|
-
await resetById(counterId, session);
|
|
36232
|
-
}
|
|
36233
|
-
}
|
|
36234
|
-
const newCount = padNumber(counter.count + 1);
|
|
36235
|
-
const lrn = `${enrollment.schoolId}-${(/* @__PURE__ */ new Date()).getFullYear().toString().slice(2, 4)}-${newCount}`;
|
|
36236
|
-
enrollment.learnerInfo.lrn = lrn;
|
|
36237
|
-
await incrementById(counterId, session);
|
|
36238
|
-
}
|
|
36239
36216
|
enrollment.specialProgram = enrollment.specialProgram?.toString();
|
|
36240
36217
|
enrollment.createdBy = enrollment.createdBy?.toString();
|
|
36241
36218
|
if (enrollment.seniorHighInfo?.track) {
|