@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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @eeplatform/basic-edu
2
2
 
3
+ ## 1.10.35
4
+
5
+ ### Patch Changes
6
+
7
+ - 760c4fd: Fix enrollment service
8
+
3
9
  ## 1.10.34
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -3072,7 +3072,7 @@ var TpersonContactSchema = import_joi5.default.object({
3072
3072
  lastName: import_joi5.default.string().optional().allow("", null),
3073
3073
  firstName: import_joi5.default.string().optional().allow("", null),
3074
3074
  middleName: import_joi5.default.string().optional().allow("", null),
3075
- contactNumber: import_joi5.default.string().optional().allow("", null)
3075
+ contactNumber: import_joi5.default.string().length(11).optional().allow("", null)
3076
3076
  });
3077
3077
  var learnerInfoSchema = import_joi5.default.object({
3078
3078
  psaBirthCertificateNo: import_joi5.default.string().optional().allow("", null),
@@ -5552,6 +5552,29 @@ function useEnrollmentService() {
5552
5552
  }
5553
5553
  const enrollmentId = await _add(value, session);
5554
5554
  if (specialProgram) {
5555
+ if (value.gwa && specialProgram.gwa && value.gwa < specialProgram.gwa) {
5556
+ throw new import_nodejs_utils19.BadRequestError(
5557
+ `GWA ${value.gwa} does not meet the minimum requirement of ${specialProgram.gwa} for the selected special program.`
5558
+ );
5559
+ }
5560
+ if (value.subjects && value.subjects.length > 0 && specialProgram.subjects && specialProgram.subjects.length > 0) {
5561
+ value.subjects.forEach((subject) => {
5562
+ const requiredSubject = specialProgram.subjects?.find(
5563
+ (s) => s.title === subject.title
5564
+ );
5565
+ if (requiredSubject) {
5566
+ if (subject.grade && requiredSubject.grade && subject.grade < requiredSubject.grade) {
5567
+ throw new import_nodejs_utils19.BadRequestError(
5568
+ `Grade ${subject.grade} for subject ${subject.title} does not meet the minimum requirement of ${requiredSubject.grade} for the selected special program.`
5569
+ );
5570
+ }
5571
+ } else {
5572
+ throw new import_nodejs_utils19.BadRequestError(
5573
+ `Subject ${subject.title} is not among the required subjects for the selected special program.`
5574
+ );
5575
+ }
5576
+ });
5577
+ }
5555
5578
  await addProgramScreening(
5556
5579
  {
5557
5580
  school: String(value.school),