@eeplatform/basic-edu 1.10.34 → 1.10.35

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
@@ -2961,7 +2961,7 @@ var TpersonContactSchema = Joi5.object({
2961
2961
  lastName: Joi5.string().optional().allow("", null),
2962
2962
  firstName: Joi5.string().optional().allow("", null),
2963
2963
  middleName: Joi5.string().optional().allow("", null),
2964
- contactNumber: Joi5.string().optional().allow("", null)
2964
+ contactNumber: Joi5.string().length(11).optional().allow("", null)
2965
2965
  });
2966
2966
  var learnerInfoSchema = Joi5.object({
2967
2967
  psaBirthCertificateNo: Joi5.string().optional().allow("", null),
@@ -5483,6 +5483,29 @@ function useEnrollmentService() {
5483
5483
  }
5484
5484
  const enrollmentId = await _add(value, session);
5485
5485
  if (specialProgram) {
5486
+ if (value.gwa && specialProgram.gwa && value.gwa < specialProgram.gwa) {
5487
+ throw new BadRequestError18(
5488
+ `GWA ${value.gwa} does not meet the minimum requirement of ${specialProgram.gwa} for the selected special program.`
5489
+ );
5490
+ }
5491
+ if (value.subjects && value.subjects.length > 0 && specialProgram.subjects && specialProgram.subjects.length > 0) {
5492
+ value.subjects.forEach((subject) => {
5493
+ const requiredSubject = specialProgram.subjects?.find(
5494
+ (s) => s.title === subject.title
5495
+ );
5496
+ if (requiredSubject) {
5497
+ if (subject.grade && requiredSubject.grade && subject.grade < requiredSubject.grade) {
5498
+ throw new BadRequestError18(
5499
+ `Grade ${subject.grade} for subject ${subject.title} does not meet the minimum requirement of ${requiredSubject.grade} for the selected special program.`
5500
+ );
5501
+ }
5502
+ } else {
5503
+ throw new BadRequestError18(
5504
+ `Subject ${subject.title} is not among the required subjects for the selected special program.`
5505
+ );
5506
+ }
5507
+ });
5508
+ }
5486
5509
  await addProgramScreening(
5487
5510
  {
5488
5511
  school: String(value.school),