@eeplatform/basic-edu 1.10.26 → 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/dist/index.mjs CHANGED
@@ -2953,8 +2953,8 @@ var addressSchema = Joi5.object({
2953
2953
  zipCode: Joi5.string().optional().allow("", null)
2954
2954
  });
2955
2955
  var TpersonContactSchema = Joi5.object({
2956
- lastName: Joi5.string().required(),
2957
- firstName: Joi5.string().required(),
2956
+ lastName: Joi5.string().optional().allow("", null),
2957
+ firstName: Joi5.string().optional().allow("", null),
2958
2958
  middleName: Joi5.string().optional().allow("", null),
2959
2959
  contactNumber: Joi5.string().optional().allow("", null)
2960
2960
  });
@@ -3035,11 +3035,11 @@ var schemaEnrollment = Joi5.object({
3035
3035
  // Added to match frontend
3036
3036
  learnerInfo: learnerInfoSchema.required(),
3037
3037
  parentGuardianInfo: Joi5.object({
3038
- father: TpersonContactSchema.required(),
3038
+ father: TpersonContactSchema.optional(),
3039
3039
  // Made required to match frontend
3040
- mother: TpersonContactSchema.required(),
3040
+ mother: TpersonContactSchema.optional(),
3041
3041
  // Made required to match frontend
3042
- legalGuardian: TpersonContactSchema.required()
3042
+ legalGuardian: TpersonContactSchema.optional()
3043
3043
  // Made required to match frontend
3044
3044
  }).required(),
3045
3045
  address: Joi5.object({
@@ -36183,29 +36183,6 @@ function useEnrollmentService() {
36183
36183
  enrollment.createdAt = /* @__PURE__ */ new Date();
36184
36184
  enrollment.deletedAt = "";
36185
36185
  delete enrollment.remarks;
36186
- if (!enrollment.learnerInfo.lrn) {
36187
- const counter = await getByName(enrollment.schoolId);
36188
- if (!counter) {
36189
- throw new InternalServerError10(
36190
- "Failed to retrieve enrollment counter"
36191
- );
36192
- }
36193
- const counterId = String(counter._id);
36194
- if (counter.updatedAt) {
36195
- const countUpdatedAtYear = new Date(
36196
- counter.updatedAt
36197
- ).getFullYear();
36198
- const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
36199
- if (countUpdatedAtYear < currentYear) {
36200
- counter.count = 0;
36201
- await resetById(counterId, session);
36202
- }
36203
- }
36204
- const newCount = padNumber(counter.count + 1);
36205
- const lrn = `${enrollment.schoolId}-${(/* @__PURE__ */ new Date()).getFullYear().toString().slice(2, 4)}-${newCount}`;
36206
- enrollment.learnerInfo.lrn = lrn;
36207
- await incrementById(counterId, session);
36208
- }
36209
36186
  enrollment.specialProgram = enrollment.specialProgram?.toString();
36210
36187
  enrollment.createdBy = enrollment.createdBy?.toString();
36211
36188
  if (enrollment.seniorHighInfo?.track) {