@eeplatform/nuxt-layer-common 1.7.30 → 1.7.31

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/nuxt-layer-common
2
2
 
3
+ ## 1.7.31
4
+
5
+ ### Patch Changes
6
+
7
+ - b19de01: Fix enrollment form address
8
+
3
9
  ## 1.7.30
4
10
 
5
11
  ### Patch Changes
@@ -116,7 +116,7 @@
116
116
  </v-row>
117
117
  </v-col>
118
118
 
119
- <v-col cols="2" class="pb-0">
119
+ <v-col cols="3" class="pb-0">
120
120
  <v-row no-gutters>
121
121
  <InputLabel class="text-capitalize" title="Grade Level" required />
122
122
  <v-col cols="12">
@@ -167,6 +167,28 @@
167
167
  </v-row>
168
168
  </v-col>
169
169
 
170
+ <v-col
171
+ v-if="
172
+ enrollment.specialProgram && selectedProgram.majors.length
173
+ "
174
+ cols="12"
175
+ >
176
+ <v-row no-gutters>
177
+ <InputLabel
178
+ class="text-capitalize"
179
+ title="Major"
180
+ required
181
+ />
182
+ <v-col cols="12">
183
+ <v-autocomplete
184
+ v-model="enrollment.specialProgramMajor"
185
+ :rules="[requiredRule]"
186
+ :items="selectedProgram.majors"
187
+ ></v-autocomplete>
188
+ </v-col>
189
+ </v-row>
190
+ </v-col>
191
+
170
192
  <v-col
171
193
  v-if="enrollment.specialProgram && selectedProgram.gwa"
172
194
  cols="12"
@@ -402,83 +424,35 @@
402
424
 
403
425
  <v-col cols="12" class="mt-4">
404
426
  <v-row>
405
- <v-col cols="6">
427
+ <v-col cols="3">
406
428
  <v-row no-gutters>
429
+ <InputLabel
430
+ class="text-capitalize"
431
+ title="Place of Birth(Municipality/City)"
432
+ required
433
+ />
407
434
  <v-col cols="12">
408
- <span class="font-weight-bold text-subtitle-1">
409
- Place of Birth
410
- </span>
435
+ <v-combobox
436
+ v-model="
437
+ enrollment.learnerInfo.placeOfBirth.cityMunicipality
438
+ "
439
+ :rules="[requiredRule]"
440
+ :items="birthCitiesMunicipalities"
441
+ item-title="name"
442
+ item-value="code"
443
+ :return-object="false"
444
+ :hide-no-data="false"
445
+ :loading="loadingBirthCityMun"
446
+ >
447
+ <template v-slot:no-data>
448
+ <v-list-item>
449
+ <v-list-item-title>
450
+ No results found. Press <kbd>enter</kbd> to search
451
+ </v-list-item-title>
452
+ </v-list-item>
453
+ </template>
454
+ </v-combobox>
411
455
  </v-col>
412
-
413
- <v-row>
414
- <v-col cols="6">
415
- <v-row no-gutters>
416
- <InputLabel
417
- class="text-capitalize"
418
- title="Province"
419
- required
420
- />
421
- <v-col cols="12">
422
- <v-combobox
423
- v-model="enrollment.learnerInfo.placeOfBirth.province"
424
- :rules="[requiredRule]"
425
- :items="birthProvinces"
426
- item-title="name"
427
- item-value="code"
428
- :return-object="false"
429
- :hide-no-data="false"
430
- :loading="loadingBirthProvinces"
431
- @keydown.enter="getBirthCityMun()"
432
- >
433
- <template v-slot:no-data>
434
- <v-list-item>
435
- <v-list-item-title>
436
- No results found. Press <kbd>enter</kbd> to
437
- search
438
- </v-list-item-title>
439
- </v-list-item>
440
- </template>
441
- </v-combobox>
442
- </v-col>
443
- </v-row>
444
- </v-col>
445
-
446
- <v-col cols="6">
447
- <v-row no-gutters>
448
- <InputLabel
449
- class="text-capitalize"
450
- title="Municipality/City"
451
- required
452
- />
453
- <v-col cols="12">
454
- <v-combobox
455
- v-model="
456
- enrollment.learnerInfo.placeOfBirth.cityMunicipality
457
- "
458
- :rules="[requiredRule]"
459
- :items="birthCitiesMunicipalities"
460
- item-title="name"
461
- item-value="code"
462
- :return-object="false"
463
- :hide-no-data="false"
464
- :disabled="
465
- !enrollment.learnerInfo.placeOfBirth.province
466
- "
467
- :loading="loadingBirthCityMun"
468
- >
469
- <template v-slot:no-data>
470
- <v-list-item>
471
- <v-list-item-title>
472
- No results found. Press <kbd>enter</kbd> to
473
- search
474
- </v-list-item-title>
475
- </v-list-item>
476
- </template>
477
- </v-combobox>
478
- </v-col>
479
- </v-row>
480
- </v-col>
481
- </v-row>
482
456
  </v-row>
483
457
  </v-col>
484
458
  </v-row>
@@ -736,22 +710,16 @@
736
710
 
737
711
  <v-col cols="3">
738
712
  <v-row no-gutters>
739
- <InputLabel
740
- class="text-capitalize"
741
- title="Province"
742
- required
743
- />
713
+ <InputLabel class="text-capitalize" title="Province" />
744
714
  <v-col cols="12">
745
715
  <v-combobox
746
716
  v-model="enrollment.address.current.province"
747
- :rules="[requiredRule]"
748
717
  :items="currentProvinces"
749
718
  item-title="name"
750
719
  item-value="code"
751
720
  :return-object="false"
752
721
  :hide-no-data="false"
753
722
  :loading="loadingCurrentProvinces"
754
- @keydown.enter="getCurrentCityMun()"
755
723
  >
756
724
  <template v-slot:no-data>
757
725
  <v-list-item>
@@ -783,7 +751,6 @@
783
751
  item-value="code"
784
752
  :return-object="false"
785
753
  :hide-no-data="false"
786
- :disabled="!enrollment.address.current.province"
787
754
  :loading="loadingCurrentCityMun"
788
755
  >
789
756
  <template v-slot:no-data>
@@ -912,15 +879,10 @@
912
879
 
913
880
  <v-col cols="3">
914
881
  <v-row no-gutters>
915
- <InputLabel
916
- class="text-capitalize"
917
- title="Province"
918
- required
919
- />
882
+ <InputLabel class="text-capitalize" title="Province" />
920
883
  <v-col cols="12">
921
884
  <v-combobox
922
885
  v-model="enrollment.address.permanent.province"
923
- :rules="[requiredRule]"
924
886
  :readonly="sameAsCurrentAddress"
925
887
  :items="permanentProvinces"
926
888
  item-title="name"
@@ -928,7 +890,7 @@
928
890
  :return-object="false"
929
891
  :hide-no-data="false"
930
892
  :loading="loadingPermanentProvinces"
931
- @keydown.enter="getPermanentCityMun()"
893
+ :disabled="sameAsCurrentAddress"
932
894
  >
933
895
  <template v-slot:no-data>
934
896
  <v-list-item>
@@ -961,7 +923,7 @@
961
923
  item-value="code"
962
924
  :return-object="false"
963
925
  :hide-no-data="false"
964
- :disabled="!enrollment.address.permanent.province"
926
+ :disabled="sameAsCurrentAddress"
965
927
  :loading="loadingPermanentCityMun"
966
928
  >
967
929
  <template v-slot:no-data>
@@ -1688,26 +1650,26 @@ watchEffect(() => {
1688
1650
  });
1689
1651
 
1690
1652
  const currentCitiesMunicipalities = ref<Array<Record<string, any>>>([]);
1691
- const selectedCurrentProvince = computed(() => {
1692
- return enrollment.value.address.current.province || "";
1693
- });
1694
1653
 
1695
1654
  const loadingCurrentCityMun = ref(false);
1696
1655
 
1697
1656
  const getCurrentCityMun = debounce(async () => {
1698
- if (!selectedCurrentProvince.value) {
1699
- currentCitiesMunicipalities.value = [];
1700
- return;
1701
- }
1702
-
1703
1657
  try {
1704
1658
  loadingCurrentCityMun.value = true;
1705
1659
  const res = await getAllPSGC({
1706
1660
  type: "City",
1707
- prefix: selectedCurrentProvince.value.slice(0, 5),
1708
- limit: 2000,
1661
+ prefix: enrollment.value.address.current.province
1662
+ ? enrollment.value.address.current.province.slice(0, 5)
1663
+ : "",
1664
+ limit: 1700,
1709
1665
  });
1710
- currentCitiesMunicipalities.value = res.items;
1666
+
1667
+ currentCitiesMunicipalities.value = res.items.map((i: any) => ({
1668
+ ...i,
1669
+ props: {
1670
+ subtitle: `${i.region}${i.province ? ` - ${i.province}` : ""}`,
1671
+ },
1672
+ }));
1711
1673
  } catch (error) {
1712
1674
  currentCitiesMunicipalities.value = [];
1713
1675
  } finally {
@@ -1715,9 +1677,14 @@ const getCurrentCityMun = debounce(async () => {
1715
1677
  }
1716
1678
  }, 500);
1717
1679
 
1718
- watch(selectedCurrentProvince, () => {
1719
- getCurrentCityMun();
1720
- });
1680
+ watch(
1681
+ () => enrollment.value.address.current.province,
1682
+ () => {
1683
+ getCurrentCityMun();
1684
+ }
1685
+ );
1686
+
1687
+ getCurrentCityMun();
1721
1688
 
1722
1689
  // Current Address - Barangays
1723
1690
  const currentBarangays = ref<Array<Record<string, any>>>([]);
@@ -1738,7 +1705,7 @@ const getCurrentBarangays = debounce(async () => {
1738
1705
  const res = await getAllPSGC({
1739
1706
  type: "Bgy",
1740
1707
  prefix: selectedCurrentCityMun.value.slice(0, 7),
1741
- limit: 200,
1708
+ limit: 1000,
1742
1709
  });
1743
1710
  currentBarangays.value = res.items;
1744
1711
  } catch (error) {
@@ -1774,26 +1741,26 @@ watchEffect(() => {
1774
1741
  });
1775
1742
 
1776
1743
  const permanentCitiesMunicipalities = ref<Array<Record<string, any>>>([]);
1777
- const selectedPermanentProvince = computed(() => {
1778
- return enrollment.value.address.permanent.province || "";
1779
- });
1780
1744
 
1781
1745
  const loadingPermanentCityMun = ref(false);
1782
1746
 
1783
1747
  const getPermanentCityMun = debounce(async () => {
1784
- if (!selectedPermanentProvince.value) {
1785
- permanentCitiesMunicipalities.value = [];
1786
- return;
1787
- }
1788
-
1789
1748
  try {
1790
1749
  loadingPermanentCityMun.value = true;
1791
1750
  const res = await getAllPSGC({
1792
1751
  type: "City",
1793
- prefix: selectedPermanentProvince.value.slice(0, 5),
1794
- limit: 200,
1752
+ prefix: enrollment.value.address.permanent.province
1753
+ ? enrollment.value.address.permanent.province.slice(0, 5)
1754
+ : "",
1755
+ limit: 1700,
1795
1756
  });
1796
- permanentCitiesMunicipalities.value = res.items;
1757
+
1758
+ permanentCitiesMunicipalities.value = res.items.map((i: any) => ({
1759
+ ...i,
1760
+ props: {
1761
+ subtitle: `${i.region}${i.province ? ` - ${i.province}` : ""}`,
1762
+ },
1763
+ }));
1797
1764
  } catch (error) {
1798
1765
  permanentCitiesMunicipalities.value = [];
1799
1766
  } finally {
@@ -1801,9 +1768,14 @@ const getPermanentCityMun = debounce(async () => {
1801
1768
  }
1802
1769
  }, 500);
1803
1770
 
1804
- watch(selectedPermanentProvince, () => {
1805
- getPermanentCityMun();
1806
- });
1771
+ watch(
1772
+ () => enrollment.value.address.permanent.province,
1773
+ () => {
1774
+ getPermanentCityMun();
1775
+ }
1776
+ );
1777
+
1778
+ getPermanentCityMun();
1807
1779
 
1808
1780
  // Permanent Address - Barangays
1809
1781
  const permanentBarangays = ref<Array<Record<string, any>>>([]);
@@ -1824,7 +1796,7 @@ const getPermanentBarangays = debounce(async () => {
1824
1796
  const res = await getAllPSGC({
1825
1797
  type: "Bgy",
1826
1798
  prefix: selectedPermanentCityMun.value.slice(0, 7),
1827
- limit: 200,
1799
+ limit: 1000,
1828
1800
  });
1829
1801
  permanentBarangays.value = res.items;
1830
1802
  } catch (error) {
@@ -1838,56 +1810,24 @@ watch(selectedPermanentCityMun, () => {
1838
1810
  getPermanentBarangays();
1839
1811
  });
1840
1812
 
1841
- // Place of Birth - Province and City/Municipality
1842
- const birthProvinces = ref<Array<Record<string, any>>>([]);
1843
-
1844
- const { data: dataBirthProvinces, status: statusBirthProvinces } =
1845
- await useLazyAsyncData("get-all-psgc-birth-provinces", () =>
1846
- getAllPSGC({
1847
- type: "Prov",
1848
- limit: 100,
1849
- })
1850
- );
1851
-
1852
- const loadingBirthProvinces = computed(
1853
- () => statusBirthProvinces.value === "pending"
1854
- );
1855
-
1856
- watchEffect(() => {
1857
- if (dataBirthProvinces.value) {
1858
- birthProvinces.value = dataBirthProvinces.value.items;
1859
- }
1860
- });
1861
-
1862
1813
  const birthCitiesMunicipalities = ref<Array<Record<string, any>>>([]);
1863
- const selectedBirthProvince = computed(() => {
1864
- const province = birthProvinces.value.find(
1865
- (p) => p.code === enrollment.value.learnerInfo.placeOfBirth.province
1866
- );
1867
-
1868
- if (!province) {
1869
- return "";
1870
- }
1871
-
1872
- return province.code;
1873
- });
1874
1814
 
1875
1815
  const loadingBirthCityMun = ref(false);
1876
1816
 
1877
1817
  const getBirthCityMun = debounce(async () => {
1878
- if (!selectedBirthProvince.value) {
1879
- birthCitiesMunicipalities.value = [];
1880
- return;
1881
- }
1882
-
1883
1818
  try {
1884
1819
  loadingBirthCityMun.value = true;
1885
1820
  const res = await getAllPSGC({
1886
1821
  type: "City",
1887
- prefix: selectedBirthProvince.value.slice(0, 5),
1888
- limit: 2000,
1822
+ limit: 1700,
1889
1823
  });
1890
- birthCitiesMunicipalities.value = res.items;
1824
+
1825
+ birthCitiesMunicipalities.value = res.items.map((i: any) => ({
1826
+ ...i,
1827
+ props: {
1828
+ subtitle: `${i.region}${i.province ? ` - ${i.province}` : ""}`,
1829
+ },
1830
+ }));
1891
1831
  } catch (error) {
1892
1832
  birthCitiesMunicipalities.value = [];
1893
1833
  } finally {
@@ -1895,61 +1835,216 @@ const getBirthCityMun = debounce(async () => {
1895
1835
  }
1896
1836
  }, 500);
1897
1837
 
1898
- watch(selectedBirthProvince, () => {
1899
- getBirthCityMun();
1900
- });
1838
+ getBirthCityMun();
1901
1839
 
1902
- // Auto-fill place of birth region and region name when province is selected
1840
+ // Auto-fill place of birth city/municipality name when selected
1903
1841
  watch(
1904
- () => enrollment.value.learnerInfo.placeOfBirth.province,
1842
+ () => enrollment.value.learnerInfo.placeOfBirth.cityMunicipality,
1843
+ (cityMunCode) => {
1844
+ if (!cityMunCode) {
1845
+ enrollment.value.learnerInfo.placeOfBirth.cityMunicipalityName = "";
1846
+ return;
1847
+ }
1848
+
1849
+ const cityMun = birthCitiesMunicipalities.value.find(
1850
+ (c) => c.code === cityMunCode
1851
+ );
1852
+ if (cityMun) {
1853
+ enrollment.value.learnerInfo.placeOfBirth.cityMunicipalityName =
1854
+ cityMun.name;
1855
+ enrollment.value.learnerInfo.placeOfBirth.province = cityMun.province
1856
+ ? cityMun.code.slice(0, 5) + "00000"
1857
+ : "";
1858
+ enrollment.value.learnerInfo.placeOfBirth.provinceName =
1859
+ cityMun.province ?? "";
1860
+ enrollment.value.learnerInfo.placeOfBirth.region =
1861
+ cityMun.code.slice(0, 2) + "00000000";
1862
+ enrollment.value.learnerInfo.placeOfBirth.regionName = cityMun.region;
1863
+ }
1864
+ }
1865
+ );
1866
+
1867
+ // Auto-fill current address province name when province is selected
1868
+ watch(
1869
+ () => enrollment.value.address.current.province,
1905
1870
  (provinceCode) => {
1906
1871
  if (!provinceCode) {
1907
- enrollment.value.learnerInfo.placeOfBirth.region = "";
1908
- enrollment.value.learnerInfo.placeOfBirth.regionName = "";
1909
- enrollment.value.learnerInfo.placeOfBirth.provinceName = "";
1910
- enrollment.value.learnerInfo.placeOfBirth.cityMunicipality = "";
1911
- enrollment.value.learnerInfo.placeOfBirth.cityMunicipalityName = "";
1872
+ enrollment.value.address.current.provinceName = "";
1873
+ enrollment.value.address.current.municipalityCity = "";
1874
+ enrollment.value.address.current.municipalityCityName = "";
1875
+ enrollment.value.address.current.barangay = "";
1876
+ enrollment.value.address.current.barangayName = "";
1877
+ enrollment.value.address.current.streetName = "";
1878
+ enrollment.value.address.current.houseNumber = "";
1912
1879
  return;
1913
1880
  }
1914
1881
 
1915
- const province = birthProvinces.value.find((p) => p.code === provinceCode);
1882
+ // Clear dependent fields when province changes
1883
+ enrollment.value.address.current.municipalityCity = "";
1884
+ enrollment.value.address.current.municipalityCityName = "";
1885
+ enrollment.value.address.current.barangay = "";
1886
+ enrollment.value.address.current.barangayName = "";
1887
+ enrollment.value.address.current.streetName = "";
1888
+ enrollment.value.address.current.houseNumber = "";
1889
+
1890
+ const province = currentProvinces.value.find(
1891
+ (p) => p.code === provinceCode
1892
+ );
1916
1893
  if (province) {
1917
- // Set province name
1918
- enrollment.value.learnerInfo.placeOfBirth.provinceName = province.name;
1894
+ enrollment.value.address.current.provinceName = province.name;
1895
+ }
1896
+ }
1897
+ );
1919
1898
 
1920
- // Get region code from province code (first 2 digits + zeros)
1921
- const regionCode = province.code.slice(0, 2) + "00000000";
1922
- enrollment.value.learnerInfo.placeOfBirth.region = regionCode;
1899
+ // Auto-fill current address city/municipality, province, and region when selected
1900
+ watch(
1901
+ () => enrollment.value.address.current.municipalityCity,
1902
+ (cityMunCode) => {
1903
+ if (!cityMunCode) {
1904
+ enrollment.value.address.current.municipalityCityName = "";
1905
+ enrollment.value.address.current.barangay = "";
1906
+ enrollment.value.address.current.barangayName = "";
1907
+ enrollment.value.address.current.streetName = "";
1908
+ enrollment.value.address.current.houseNumber = "";
1909
+ return;
1910
+ }
1923
1911
 
1924
- // Find and set region name
1925
- const region = regions.value.find((r) => r.code === regionCode);
1926
- if (region) {
1927
- enrollment.value.learnerInfo.placeOfBirth.regionName = region.name;
1928
- }
1912
+ // Clear dependent fields when city/municipality changes
1913
+ enrollment.value.address.current.barangay = "";
1914
+ enrollment.value.address.current.barangayName = "";
1915
+ enrollment.value.address.current.streetName = "";
1916
+ enrollment.value.address.current.houseNumber = "";
1917
+
1918
+ const cityMun = currentCitiesMunicipalities.value.find(
1919
+ (c) => c.code === cityMunCode
1920
+ );
1921
+ if (cityMun) {
1922
+ enrollment.value.address.current.municipalityCityName = cityMun.name;
1923
+ enrollment.value.address.current.province = cityMun.province
1924
+ ? cityMun.code.slice(0, 5) + "00000"
1925
+ : "";
1926
+ enrollment.value.address.current.provinceName = cityMun.province ?? "";
1927
+ enrollment.value.address.current.region =
1928
+ cityMun.code.slice(0, 2) + "00000000";
1929
+ enrollment.value.address.current.regionName = cityMun.region;
1929
1930
  }
1930
1931
  }
1931
1932
  );
1932
1933
 
1933
- // Auto-fill place of birth city/municipality name when selected
1934
+ // Auto-fill current address barangay name when selected
1934
1935
  watch(
1935
- () => enrollment.value.learnerInfo.placeOfBirth.cityMunicipality,
1936
+ () => enrollment.value.address.current.barangay,
1937
+ (barangayCode) => {
1938
+ if (!barangayCode) {
1939
+ enrollment.value.address.current.barangayName = "";
1940
+ return;
1941
+ }
1942
+
1943
+ const barangay = currentBarangays.value.find(
1944
+ (b) => b.code === barangayCode
1945
+ );
1946
+ if (barangay) {
1947
+ enrollment.value.address.current.barangayName = barangay.name;
1948
+ }
1949
+ }
1950
+ );
1951
+
1952
+ // Auto-fill permanent address province name when province is selected
1953
+ watch(
1954
+ () => enrollment.value.address.permanent.province,
1955
+ (provinceCode) => {
1956
+ // Don't clear fields if permanent address is same as current address
1957
+ if (sameAsCurrentAddress.value) {
1958
+ return;
1959
+ }
1960
+
1961
+ if (!provinceCode) {
1962
+ enrollment.value.address.permanent.provinceName = "";
1963
+ enrollment.value.address.permanent.municipalityCity = "";
1964
+ enrollment.value.address.permanent.municipalityCityName = "";
1965
+ enrollment.value.address.permanent.barangay = "";
1966
+ enrollment.value.address.permanent.barangayName = "";
1967
+ enrollment.value.address.permanent.streetName = "";
1968
+ enrollment.value.address.permanent.houseNumber = "";
1969
+ return;
1970
+ }
1971
+
1972
+ // Clear dependent fields when province changes
1973
+ enrollment.value.address.permanent.municipalityCity = "";
1974
+ enrollment.value.address.permanent.municipalityCityName = "";
1975
+ enrollment.value.address.permanent.barangay = "";
1976
+ enrollment.value.address.permanent.barangayName = "";
1977
+ enrollment.value.address.permanent.streetName = "";
1978
+ enrollment.value.address.permanent.houseNumber = "";
1979
+
1980
+ const province = permanentProvinces.value.find(
1981
+ (p) => p.code === provinceCode
1982
+ );
1983
+ if (province) {
1984
+ enrollment.value.address.permanent.provinceName = province.name;
1985
+ }
1986
+ }
1987
+ );
1988
+
1989
+ // Auto-fill permanent address city/municipality, province, and region when selected
1990
+ watch(
1991
+ () => enrollment.value.address.permanent.municipalityCity,
1936
1992
  (cityMunCode) => {
1993
+ // Don't clear fields if permanent address is same as current address
1994
+ if (sameAsCurrentAddress.value) {
1995
+ return;
1996
+ }
1997
+
1937
1998
  if (!cityMunCode) {
1938
- enrollment.value.learnerInfo.placeOfBirth.cityMunicipalityName = "";
1999
+ enrollment.value.address.permanent.municipalityCityName = "";
2000
+ enrollment.value.address.permanent.barangay = "";
2001
+ enrollment.value.address.permanent.barangayName = "";
2002
+ enrollment.value.address.permanent.streetName = "";
2003
+ enrollment.value.address.permanent.houseNumber = "";
1939
2004
  return;
1940
2005
  }
1941
2006
 
1942
- const cityMun = birthCitiesMunicipalities.value.find(
2007
+ // Clear dependent fields when city/municipality changes
2008
+ enrollment.value.address.permanent.barangay = "";
2009
+ enrollment.value.address.permanent.barangayName = "";
2010
+ enrollment.value.address.permanent.streetName = "";
2011
+ enrollment.value.address.permanent.houseNumber = "";
2012
+
2013
+ const cityMun = permanentCitiesMunicipalities.value.find(
1943
2014
  (c) => c.code === cityMunCode
1944
2015
  );
1945
2016
  if (cityMun) {
1946
- enrollment.value.learnerInfo.placeOfBirth.cityMunicipalityName =
1947
- cityMun.name;
2017
+ enrollment.value.address.permanent.municipalityCityName = cityMun.name;
2018
+ enrollment.value.address.permanent.province = cityMun.province
2019
+ ? cityMun.code.slice(0, 5) + "00000"
2020
+ : "";
2021
+ enrollment.value.address.permanent.provinceName = cityMun.province ?? "";
2022
+ enrollment.value.address.permanent.region =
2023
+ cityMun.code.slice(0, 2) + "00000000";
2024
+ enrollment.value.address.permanent.regionName = cityMun.region;
2025
+ }
2026
+ }
2027
+ );
2028
+
2029
+ // Auto-fill permanent address barangay name when selected
2030
+ watch(
2031
+ () => enrollment.value.address.permanent.barangay,
2032
+ (barangayCode) => {
2033
+ if (!barangayCode) {
2034
+ enrollment.value.address.permanent.barangayName = "";
2035
+ return;
2036
+ }
2037
+
2038
+ const barangay = permanentBarangays.value.find(
2039
+ (b) => b.code === barangayCode
2040
+ );
2041
+ if (barangay) {
2042
+ enrollment.value.address.permanent.barangayName = barangay.name;
1948
2043
  }
1949
2044
  }
1950
2045
  );
1951
2046
 
1952
- const { getAll } = useProgram();
2047
+ const { getAll: getSpecialPrograms } = useProgram();
1953
2048
 
1954
2049
  const programs = ref<Array<Record<string, any>>>([]);
1955
2050
 
@@ -1958,7 +2053,7 @@ const enrollmentSchool = computed(() => enrollment.value.school);
1958
2053
  const { data: getPrograms } = await useLazyAsyncData(
1959
2054
  `get-programs-as-options-enrollment-form-${enrollment.value.school}`,
1960
2055
  () =>
1961
- getAll({
2056
+ getSpecialPrograms({
1962
2057
  limit: 20,
1963
2058
  school: enrollment.value.school,
1964
2059
  }),
@@ -1996,19 +2091,11 @@ watchEffect(() => {
1996
2091
  });
1997
2092
 
1998
2093
  const hasSpecialProgram = computed(() => {
1999
- if (!programs.value.length) {
2000
- return false;
2001
- }
2002
-
2003
- const juniorHigh = ["grade-7", "grade-8", "grade-9", "grade-10"];
2004
-
2005
- const isJuniorHigh = juniorHigh.includes(enrollment.value.gradeLevel);
2006
-
2007
- if (isJuniorHigh && programs.value.length > 0) {
2008
- return true;
2009
- }
2094
+ const program = programs.value.filter((i) =>
2095
+ i.gradeLevels.includes(enrollment.value.gradeLevel)
2096
+ );
2010
2097
 
2011
- return false;
2098
+ return program.length > 0;
2012
2099
  });
2013
2100
 
2014
2101
  const schools = ref<TSchool[]>([]);
@@ -2111,7 +2198,9 @@ watch(selectedSchool, (val) => {
2111
2198
  watch(
2112
2199
  () => enrollment.value.gradeLevel,
2113
2200
  () => {
2114
- enrollment.value.returningLearnerInfo.lastGradeLevelCompleted = "";
2201
+ if (enrollment.value.returningLearnerInfo) {
2202
+ enrollment.value.returningLearnerInfo.lastGradeLevelCompleted = "";
2203
+ }
2115
2204
  }
2116
2205
  );
2117
2206
 
@@ -2338,16 +2427,26 @@ watch(enrollment, (val) => {
2338
2427
  enrollment.value.address.current.streetName = "";
2339
2428
  enrollment.value.address.current.sitio = "";
2340
2429
  enrollment.value.address.current.barangay = "";
2430
+ enrollment.value.address.current.barangayName = "";
2341
2431
  enrollment.value.address.current.municipalityCity = "";
2432
+ enrollment.value.address.current.municipalityCityName = "";
2342
2433
  enrollment.value.address.current.province = "";
2434
+ enrollment.value.address.current.provinceName = "";
2435
+ enrollment.value.address.current.region = "";
2436
+ enrollment.value.address.current.regionName = "";
2343
2437
  enrollment.value.address.current.country = "Philippines";
2344
2438
  enrollment.value.address.current.zipCode = "";
2345
2439
  enrollment.value.address.permanent.houseNumber = "";
2346
2440
  enrollment.value.address.permanent.streetName = "";
2347
2441
  enrollment.value.address.permanent.sitio = "";
2348
2442
  enrollment.value.address.permanent.barangay = "";
2443
+ enrollment.value.address.permanent.barangayName = "";
2349
2444
  enrollment.value.address.permanent.municipalityCity = "";
2445
+ enrollment.value.address.permanent.municipalityCityName = "";
2350
2446
  enrollment.value.address.permanent.province = "";
2447
+ enrollment.value.address.permanent.provinceName = "";
2448
+ enrollment.value.address.permanent.region = "";
2449
+ enrollment.value.address.permanent.regionName = "";
2351
2450
  enrollment.value.address.permanent.country = "Philippines";
2352
2451
  enrollment.value.address.permanent.zipCode = "";
2353
2452
  }
@@ -2363,10 +2462,20 @@ watchEffect(() => {
2363
2462
  enrollment.value.address.current.sitio;
2364
2463
  enrollment.value.address.permanent.barangay =
2365
2464
  enrollment.value.address.current.barangay;
2465
+ enrollment.value.address.permanent.barangayName =
2466
+ enrollment.value.address.current.barangayName;
2366
2467
  enrollment.value.address.permanent.municipalityCity =
2367
2468
  enrollment.value.address.current.municipalityCity;
2469
+ enrollment.value.address.permanent.municipalityCityName =
2470
+ enrollment.value.address.current.municipalityCityName;
2368
2471
  enrollment.value.address.permanent.province =
2369
2472
  enrollment.value.address.current.province;
2473
+ enrollment.value.address.permanent.provinceName =
2474
+ enrollment.value.address.current.provinceName;
2475
+ enrollment.value.address.permanent.region =
2476
+ enrollment.value.address.current.region;
2477
+ enrollment.value.address.permanent.regionName =
2478
+ enrollment.value.address.current.regionName;
2370
2479
  enrollment.value.address.permanent.country =
2371
2480
  enrollment.value.address.current.country || "Philippines";
2372
2481
  enrollment.value.address.permanent.zipCode =
@@ -2376,8 +2485,13 @@ watchEffect(() => {
2376
2485
  enrollment.value.address.permanent.streetName = "";
2377
2486
  enrollment.value.address.permanent.sitio = "";
2378
2487
  enrollment.value.address.permanent.barangay = "";
2488
+ enrollment.value.address.permanent.barangayName = "";
2379
2489
  enrollment.value.address.permanent.municipalityCity = "";
2490
+ enrollment.value.address.permanent.municipalityCityName = "";
2380
2491
  enrollment.value.address.permanent.province = "";
2492
+ enrollment.value.address.permanent.provinceName = "";
2493
+ enrollment.value.address.permanent.region = "";
2494
+ enrollment.value.address.permanent.regionName = "";
2381
2495
  enrollment.value.address.permanent.country = "Philippines";
2382
2496
  enrollment.value.address.permanent.zipCode = "";
2383
2497
  }
@@ -1,5 +1,9 @@
1
1
  export default function useBasicEdu() {
2
2
  const educationLevels = [
3
+ {
4
+ title: "Non Grade Level",
5
+ value: "non-grade-level",
6
+ },
3
7
  {
4
8
  title: "Elementary",
5
9
  value: "elementary",
@@ -37,6 +41,11 @@ export default function useBasicEdu() {
37
41
  }
38
42
 
39
43
  const gradeLevels = [
44
+ {
45
+ title: "Non-Grade Level",
46
+ value: "non-grade-level",
47
+ level: "non-grade-level",
48
+ },
40
49
  {
41
50
  title: "Kindergarten",
42
51
  value: "kindergarten",
@@ -72,6 +72,8 @@ export default function useEnrollment() {
72
72
  municipalityCityName: "",
73
73
  province: "",
74
74
  provinceName: "",
75
+ region: "",
76
+ regionName: "",
75
77
  country: "",
76
78
  zipCode: "",
77
79
  },
@@ -81,7 +83,10 @@ export default function useEnrollment() {
81
83
  sitio: "",
82
84
  barangay: "",
83
85
  municipalityCity: "",
86
+ municipalityCityName: "",
84
87
  province: "",
88
+ region: "",
89
+ regionName: "",
85
90
  country: "",
86
91
  zipCode: "",
87
92
  },
@@ -7,6 +7,7 @@ export function useProgram() {
7
7
  code: "",
8
8
  gwa: 0,
9
9
  subjects: [],
10
+ majors: [],
10
11
  description: "",
11
12
  gradeLevels: [],
12
13
  });
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@eeplatform/nuxt-layer-common",
3
3
  "license": "MIT",
4
4
  "type": "module",
5
- "version": "1.7.30",
5
+ "version": "1.7.31",
6
6
  "main": "./nuxt.config.ts",
7
7
  "publishConfig": {
8
8
  "access": "public"
@@ -17,6 +17,7 @@ declare type TTLearner = {
17
17
  specialProgram?: string;
18
18
  specialProgramName?: string;
19
19
  specialProgramCode?: string;
20
+ specialProgramMajor?: string;
20
21
  gwa?: number;
21
22
  subjects?: { title: string; grade: number }[];
22
23
  returningLearner: boolean;
@@ -94,6 +95,8 @@ declare type EnrAddress = {
94
95
  municipalityCityName?: string;
95
96
  province: string;
96
97
  provinceName?: string;
98
+ region?: string;
99
+ regionName?: string;
97
100
  country?: string;
98
101
  zipCode?: string;
99
102
  };
@@ -7,6 +7,7 @@ declare type TProgram = {
7
7
  gradeLevels?: string[];
8
8
  gwa?: number;
9
9
  subjects?: { title: string; grade: number }[];
10
+ majors?: { title: string; value: string }[];
10
11
  description?: string;
11
12
  status?: string;
12
13
  createdAt?: string;
@@ -21,7 +22,8 @@ declare type TProgramScreening = {
21
22
  schoolYear: string;
22
23
  gradeLevel: string;
23
24
  specialProgram: string;
24
- specialProgramName?: string;
25
+ specialProgramName: string;
26
+ specialProgramMajor: string;
25
27
  applicant: string;
26
28
  applicantName?: string;
27
29
  gwa?: number;