@eeplatform/basic-edu 1.3.8 → 1.3.10

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,17 @@
1
1
  # @eeplatform/basic-edu
2
2
 
3
+ ## 1.3.10
4
+
5
+ ### Patch Changes
6
+
7
+ - b98ccf2: Update indexes
8
+
9
+ ## 1.3.9
10
+
11
+ ### Patch Changes
12
+
13
+ - 1cad10f: Revise addBulk(), province is no longer required in CSV or excel file
14
+
3
15
  ## 1.3.8
4
16
 
5
17
  ### Patch Changes
package/dist/index.js CHANGED
@@ -4505,7 +4505,6 @@ function useSchoolRepo() {
4505
4505
  { key: { name: 1 } },
4506
4506
  { key: { createdAt: 1 } },
4507
4507
  { key: { name: "text" } },
4508
- { key: { cityMunicipalityPSGC: 1 }, unique: true, name: "unique_psgc" },
4509
4508
  { key: { id: 1, status: 1 }, unique: true, name: "unique_school_id" }
4510
4509
  ]);
4511
4510
  } catch (error) {
@@ -33239,10 +33238,6 @@ function useSchoolService() {
33239
33238
  errors.push(`Row ${rowNum}: name is required`);
33240
33239
  continue;
33241
33240
  }
33242
- if (!province) {
33243
- errors.push(`Row ${rowNum}: province is required`);
33244
- continue;
33245
- }
33246
33241
  if (!cityMunicipality) {
33247
33242
  errors.push(`Row ${rowNum}: city/municipality is required`);
33248
33243
  continue;
@@ -33287,14 +33282,20 @@ ${errors.slice(0, 5).join("\n")}${errors.length > 5 ? `
33287
33282
  session.startTransaction();
33288
33283
  const school = schools[i];
33289
33284
  try {
33290
- const provincePSGC = await getPSGCByName({
33291
- name: school.province ?? "",
33292
- type: "Prov"
33293
- });
33285
+ let provincePSGC = "";
33286
+ if (school.province) {
33287
+ const provinceData = await getPSGCByName({
33288
+ name: school.province,
33289
+ type: "Prov"
33290
+ });
33291
+ if (provinceData) {
33292
+ provincePSGC = provinceData.code ?? "";
33293
+ }
33294
+ }
33294
33295
  const cityMunPSGC = await getPSGCByName({
33295
33296
  name: school.cityMunicipality ?? "",
33296
33297
  type: "City",
33297
- prefix: provincePSGC ? provincePSGC.code.toString().slice(0, 5) : ""
33298
+ prefix: provincePSGC ? provincePSGC.toString().slice(0, 5) : ""
33298
33299
  });
33299
33300
  if (!cityMunPSGC) {
33300
33301
  throw new import_nodejs_utils18.BadRequestError(