@eeplatform/nuxt-layer-common 1.7.29 → 1.7.30

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.
@@ -385,12 +385,13 @@
385
385
  <v-col cols="2">
386
386
  <v-row no-gutters>
387
387
  <v-col cols="12">
388
- <InputLabel class="text-capitalize" title="Sex" />
388
+ <InputLabel class="text-capitalize" title="Sex" required />
389
389
  </v-col>
390
390
  <v-col cols="12">
391
391
  <v-select
392
392
  v-model="enrollment.learnerInfo.sex"
393
393
  :items="['Male', 'Female']"
394
+ :rules="[requiredRule]"
394
395
  placeholder="Select Sex"
395
396
  ></v-select>
396
397
  </v-col>
@@ -401,35 +402,90 @@
401
402
 
402
403
  <v-col cols="12" class="mt-4">
403
404
  <v-row>
404
- <v-col cols="4">
405
+ <v-col cols="6">
405
406
  <v-row no-gutters>
406
- <InputLabel
407
- class="text-capitalize"
408
- title="Place of Birth (Municipality/City)"
409
- required
410
- />
411
407
  <v-col cols="12">
412
- <v-autocomplete
413
- v-model="enrollment.learnerInfo.placeOfBirth"
414
- :rules="[requiredRule]"
415
- :items="citiesMunicipalities"
416
- item-title="name"
417
- items-value="name"
418
- :hide-no-data="false"
419
- >
420
- <template v-slot:no-data>
421
- <v-list-item>
422
- <v-list-item-title>
423
- No results matching "<strong>search</strong>". Press
424
- <kbd>enter</kbd> to create a new one
425
- </v-list-item-title>
426
- </v-list-item>
427
- </template>
428
- </v-autocomplete>
408
+ <span class="font-weight-bold text-subtitle-1">
409
+ Place of Birth
410
+ </span>
429
411
  </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>
430
482
  </v-row>
431
483
  </v-col>
484
+ </v-row>
485
+ </v-col>
432
486
 
487
+ <v-col cols="12">
488
+ <v-row>
433
489
  <v-col cols="3">
434
490
  <v-row no-gutters>
435
491
  <InputLabel
@@ -458,14 +514,12 @@
458
514
  </v-col>
459
515
 
460
516
  <v-col cols="4">
461
- <v-row>
462
- <v-col cols="12" class="pb-0">
463
- <InputLabel
464
- class="text-capitalize"
465
- title="Indigenous People/Cultural Community"
466
- />
467
- </v-col>
468
- <v-col cols="9" class="pt-0">
517
+ <v-row no-gutters>
518
+ <InputLabel
519
+ class="text-capitalize"
520
+ title="Indigenous People/Cultural Community"
521
+ />
522
+ <v-col cols="12" class="pt-0">
469
523
  <v-combobox
470
524
  v-model="enrollment.learnerInfo.indigenousCommunity"
471
525
  :items="indigenousCommunitiesPhilippines"
@@ -483,21 +537,19 @@
483
537
  </v-col>
484
538
  </v-row>
485
539
  </v-col>
486
- </v-row>
487
- </v-col>
488
540
 
489
- <v-col cols="12">
490
- <v-row>
491
- <v-col cols="12" class="pb-0">
492
- <InputLabel
493
- class="text-capitalize"
494
- title="4Ps Household ID Number"
495
- />
496
- </v-col>
497
- <v-col cols="4" class="pt-0">
498
- <v-text-field
499
- v-model="enrollment.learnerInfo.fourPsHouseholdId"
500
- ></v-text-field>
541
+ <v-col cols="3">
542
+ <v-row no-gutters>
543
+ <InputLabel
544
+ class="text-capitalize"
545
+ title="4Ps Household ID Number"
546
+ />
547
+ <v-col cols="12" class="pt-0">
548
+ <v-text-field
549
+ v-model="enrollment.learnerInfo.fourPsHouseholdId"
550
+ ></v-text-field>
551
+ </v-col>
552
+ </v-row>
501
553
  </v-col>
502
554
  </v-row>
503
555
  </v-col>
@@ -665,48 +717,23 @@
665
717
 
666
718
  <v-col cols="12">
667
719
  <v-row>
668
- <v-col cols="3">
669
- <v-row no-gutters>
670
- <InputLabel class="text-capitalize" title="House No." />
671
- <v-col cols="12">
672
- <v-text-field
673
- v-model="enrollment.address.current.houseNumber"
674
- ></v-text-field>
675
- </v-col>
676
- </v-row>
677
- </v-col>
678
-
679
- <v-col cols="3">
680
- <v-row no-gutters>
681
- <InputLabel class="text-capitalize" title="Street" />
682
- <v-col cols="12">
683
- <v-text-field
684
- v-model="enrollment.address.current.streetName"
685
- ></v-text-field>
686
- </v-col>
687
- </v-row>
688
- </v-col>
689
-
690
720
  <v-col cols="3">
691
721
  <v-row no-gutters>
692
722
  <InputLabel
693
723
  class="text-capitalize"
694
- title="Barangay"
724
+ title="Country"
695
725
  required
696
726
  />
697
727
  <v-col cols="12">
698
728
  <v-text-field
699
- v-model="enrollment.address.current.barangay"
729
+ v-model="enrollment.address.current.country"
700
730
  :rules="[requiredRule]"
731
+ readonly
701
732
  ></v-text-field>
702
733
  </v-col>
703
734
  </v-row>
704
735
  </v-col>
705
- </v-row>
706
- </v-col>
707
736
 
708
- <v-col cols="12">
709
- <v-row>
710
737
  <v-col cols="3">
711
738
  <v-row no-gutters>
712
739
  <InputLabel
@@ -720,7 +747,7 @@
720
747
  :rules="[requiredRule]"
721
748
  :items="currentProvinces"
722
749
  item-title="name"
723
- item-value="name"
750
+ item-value="code"
724
751
  :return-object="false"
725
752
  :hide-no-data="false"
726
753
  :loading="loadingCurrentProvinces"
@@ -753,7 +780,7 @@
753
780
  :rules="[requiredRule]"
754
781
  :items="currentCitiesMunicipalities"
755
782
  item-title="name"
756
- item-value="name"
783
+ item-value="code"
757
784
  :return-object="false"
758
785
  :hide-no-data="false"
759
786
  :disabled="!enrollment.address.current.province"
@@ -773,34 +800,71 @@
773
800
  </v-row>
774
801
  </v-col>
775
802
 
803
+ <v-col cols="2">
804
+ <v-row no-gutters>
805
+ <InputLabel class="text-capitalize" title="Zip Code" />
806
+ <v-col cols="12">
807
+ <v-text-field
808
+ v-model="enrollment.address.current.zipCode"
809
+ ></v-text-field>
810
+ </v-col>
811
+ </v-row>
812
+ </v-col>
813
+ </v-row>
814
+ </v-col>
815
+
816
+ <v-col cols="12">
817
+ <v-row>
776
818
  <v-col cols="3">
777
819
  <v-row no-gutters>
778
820
  <InputLabel
779
821
  class="text-capitalize"
780
- title="Country"
822
+ title="Barangay"
781
823
  required
782
824
  />
783
825
  <v-col cols="12">
784
- <v-text-field
785
- v-model="enrollment.address.current.country"
826
+ <v-combobox
827
+ v-model="enrollment.address.current.barangay"
786
828
  :rules="[requiredRule]"
787
- readonly
829
+ :items="currentBarangays"
830
+ item-title="name"
831
+ item-value="code"
832
+ :return-object="false"
833
+ :hide-no-data="false"
834
+ :disabled="!enrollment.address.current.municipalityCity"
835
+ :loading="loadingCurrentBarangay"
836
+ >
837
+ <template v-slot:no-data>
838
+ <v-list-item>
839
+ <v-list-item-title>
840
+ No results matching "<strong>search</strong>".
841
+ Press
842
+ <kbd>enter</kbd> to create a new one
843
+ </v-list-item-title>
844
+ </v-list-item>
845
+ </template>
846
+ </v-combobox>
847
+ </v-col>
848
+ </v-row>
849
+ </v-col>
850
+
851
+ <v-col cols="3">
852
+ <v-row no-gutters>
853
+ <InputLabel class="text-capitalize" title="Street" />
854
+ <v-col cols="12">
855
+ <v-text-field
856
+ v-model="enrollment.address.current.streetName"
788
857
  ></v-text-field>
789
858
  </v-col>
790
859
  </v-row>
791
860
  </v-col>
792
861
 
793
- <v-col cols="2">
862
+ <v-col cols="3">
794
863
  <v-row no-gutters>
795
- <InputLabel
796
- class="text-capitalize"
797
- title="Zip Code"
798
- required
799
- />
864
+ <InputLabel class="text-capitalize" title="House No." />
800
865
  <v-col cols="12">
801
866
  <v-text-field
802
- v-model="enrollment.address.current.zipCode"
803
- :rules="[requiredRule]"
867
+ v-model="enrollment.address.current.houseNumber"
804
868
  ></v-text-field>
805
869
  </v-col>
806
870
  </v-row>
@@ -829,51 +893,23 @@
829
893
 
830
894
  <v-col cols="12">
831
895
  <v-row>
832
- <v-col cols="3">
833
- <v-row no-gutters>
834
- <InputLabel class="text-capitalize" title="House No." />
835
- <v-col cols="12">
836
- <v-text-field
837
- v-model="enrollment.address.permanent.houseNumber"
838
- :readonly="sameAsCurrentAddress"
839
- ></v-text-field>
840
- </v-col>
841
- </v-row>
842
- </v-col>
843
-
844
- <v-col cols="3">
845
- <v-row no-gutters>
846
- <InputLabel class="text-capitalize" title="Street" />
847
- <v-col cols="12">
848
- <v-text-field
849
- v-model="enrollment.address.permanent.streetName"
850
- :readonly="sameAsCurrentAddress"
851
- ></v-text-field>
852
- </v-col>
853
- </v-row>
854
- </v-col>
855
-
856
896
  <v-col cols="3">
857
897
  <v-row no-gutters>
858
898
  <InputLabel
859
899
  class="text-capitalize"
860
- title="Barangay"
900
+ title="Country"
861
901
  required
862
902
  />
863
903
  <v-col cols="12">
864
904
  <v-text-field
865
- v-model="enrollment.address.permanent.barangay"
905
+ v-model="enrollment.address.permanent.country"
866
906
  :rules="[requiredRule]"
867
907
  :readonly="sameAsCurrentAddress"
868
908
  ></v-text-field>
869
909
  </v-col>
870
910
  </v-row>
871
911
  </v-col>
872
- </v-row>
873
- </v-col>
874
912
 
875
- <v-col cols="12">
876
- <v-row>
877
913
  <v-col cols="3">
878
914
  <v-row no-gutters>
879
915
  <InputLabel
@@ -888,7 +924,7 @@
888
924
  :readonly="sameAsCurrentAddress"
889
925
  :items="permanentProvinces"
890
926
  item-title="name"
891
- item-value="name"
927
+ item-value="code"
892
928
  :return-object="false"
893
929
  :hide-no-data="false"
894
930
  :loading="loadingPermanentProvinces"
@@ -922,7 +958,7 @@
922
958
  :readonly="sameAsCurrentAddress"
923
959
  :items="permanentCitiesMunicipalities"
924
960
  item-title="name"
925
- item-value="name"
961
+ item-value="code"
926
962
  :return-object="false"
927
963
  :hide-no-data="false"
928
964
  :disabled="!enrollment.address.permanent.province"
@@ -942,34 +978,77 @@
942
978
  </v-row>
943
979
  </v-col>
944
980
 
981
+ <v-col cols="2">
982
+ <v-row no-gutters>
983
+ <InputLabel class="text-capitalize" title="Zip Code" />
984
+ <v-col cols="12">
985
+ <v-text-field
986
+ v-model="enrollment.address.permanent.zipCode"
987
+ :readonly="sameAsCurrentAddress"
988
+ ></v-text-field>
989
+ </v-col>
990
+ </v-row>
991
+ </v-col>
992
+ </v-row>
993
+ </v-col>
994
+
995
+ <v-col cols="12">
996
+ <v-row>
945
997
  <v-col cols="3">
946
998
  <v-row no-gutters>
947
999
  <InputLabel
948
1000
  class="text-capitalize"
949
- title="Country"
1001
+ title="Barangay"
950
1002
  required
951
1003
  />
952
1004
  <v-col cols="12">
953
- <v-text-field
954
- v-model="enrollment.address.permanent.country"
1005
+ <v-combobox
1006
+ v-model="enrollment.address.permanent.barangay"
955
1007
  :rules="[requiredRule]"
956
1008
  :readonly="sameAsCurrentAddress"
1009
+ :items="permanentBarangays"
1010
+ item-title="name"
1011
+ item-value="code"
1012
+ :return-object="false"
1013
+ :hide-no-data="false"
1014
+ :disabled="
1015
+ !enrollment.address.permanent.municipalityCity ||
1016
+ sameAsCurrentAddress
1017
+ "
1018
+ :loading="loadingPermanentBarangay"
1019
+ >
1020
+ <template v-slot:no-data>
1021
+ <v-list-item>
1022
+ <v-list-item-title>
1023
+ No results matching "<strong>search</strong>".
1024
+ Press
1025
+ <kbd>enter</kbd> to create a new one
1026
+ </v-list-item-title>
1027
+ </v-list-item>
1028
+ </template>
1029
+ </v-combobox>
1030
+ </v-col>
1031
+ </v-row>
1032
+ </v-col>
1033
+
1034
+ <v-col cols="3">
1035
+ <v-row no-gutters>
1036
+ <InputLabel class="text-capitalize" title="Street" />
1037
+ <v-col cols="12">
1038
+ <v-text-field
1039
+ v-model="enrollment.address.permanent.streetName"
1040
+ :readonly="sameAsCurrentAddress"
957
1041
  ></v-text-field>
958
1042
  </v-col>
959
1043
  </v-row>
960
1044
  </v-col>
961
1045
 
962
- <v-col cols="2">
1046
+ <v-col cols="3">
963
1047
  <v-row no-gutters>
964
- <InputLabel
965
- class="text-capitalize"
966
- title="Zip Code"
967
- required
968
- />
1048
+ <InputLabel class="text-capitalize" title="House No." />
969
1049
  <v-col cols="12">
970
1050
  <v-text-field
971
- v-model="enrollment.address.permanent.zipCode"
972
- :rules="[requiredRule]"
1051
+ v-model="enrollment.address.permanent.houseNumber"
973
1052
  :readonly="sameAsCurrentAddress"
974
1053
  ></v-text-field>
975
1054
  </v-col>
@@ -1332,21 +1411,21 @@
1332
1411
  </v-col>
1333
1412
  </v-row>
1334
1413
  </v-col>
1335
- </v-row>
1336
- </v-col>
1337
1414
 
1338
- <v-col cols="8">
1339
- <v-row no-gutters>
1340
- <InputLabel
1341
- class="text-capitalize"
1342
- title="Last School Attended"
1343
- :required="!isKindergarten"
1344
- />
1345
- <v-col cols="12">
1346
- <v-text-field
1347
- v-model="enrollment.returningLearnerInfo.lastSchoolAttended"
1348
- :rules="isKindergarten ? [] : [requiredRule]"
1349
- ></v-text-field>
1415
+ <v-col cols="6">
1416
+ <v-row no-gutters>
1417
+ <InputLabel
1418
+ class="text-capitalize"
1419
+ title="Last School Attended"
1420
+ :required="!isKindergarten"
1421
+ />
1422
+ <v-col cols="12">
1423
+ <v-text-field
1424
+ v-model="enrollment.returningLearnerInfo.lastSchoolAttended"
1425
+ :rules="isKindergarten ? [] : [requiredRule]"
1426
+ ></v-text-field>
1427
+ </v-col>
1428
+ </v-row>
1350
1429
  </v-col>
1351
1430
  </v-row>
1352
1431
  </v-col>
@@ -1610,15 +1689,7 @@ watchEffect(() => {
1610
1689
 
1611
1690
  const currentCitiesMunicipalities = ref<Array<Record<string, any>>>([]);
1612
1691
  const selectedCurrentProvince = computed(() => {
1613
- const province = currentProvinces.value.find(
1614
- (p) => p.name === enrollment.value.address.current.province
1615
- );
1616
-
1617
- if (!province) {
1618
- return "";
1619
- }
1620
-
1621
- return province.code;
1692
+ return enrollment.value.address.current.province || "";
1622
1693
  });
1623
1694
 
1624
1695
  const loadingCurrentCityMun = ref(false);
@@ -1648,6 +1719,39 @@ watch(selectedCurrentProvince, () => {
1648
1719
  getCurrentCityMun();
1649
1720
  });
1650
1721
 
1722
+ // Current Address - Barangays
1723
+ const currentBarangays = ref<Array<Record<string, any>>>([]);
1724
+ const selectedCurrentCityMun = computed(() => {
1725
+ return enrollment.value.address.current.municipalityCity || "";
1726
+ });
1727
+
1728
+ const loadingCurrentBarangay = ref(false);
1729
+
1730
+ const getCurrentBarangays = debounce(async () => {
1731
+ if (!selectedCurrentCityMun.value) {
1732
+ currentBarangays.value = [];
1733
+ return;
1734
+ }
1735
+
1736
+ try {
1737
+ loadingCurrentBarangay.value = true;
1738
+ const res = await getAllPSGC({
1739
+ type: "Bgy",
1740
+ prefix: selectedCurrentCityMun.value.slice(0, 7),
1741
+ limit: 200,
1742
+ });
1743
+ currentBarangays.value = res.items;
1744
+ } catch (error) {
1745
+ currentBarangays.value = [];
1746
+ } finally {
1747
+ loadingCurrentBarangay.value = false;
1748
+ }
1749
+ }, 500);
1750
+
1751
+ watch(selectedCurrentCityMun, () => {
1752
+ getCurrentBarangays();
1753
+ });
1754
+
1651
1755
  // Permanent Address - Province and City/Municipality
1652
1756
  const permanentProvinces = ref<Array<Record<string, any>>>([]);
1653
1757
 
@@ -1671,15 +1775,7 @@ watchEffect(() => {
1671
1775
 
1672
1776
  const permanentCitiesMunicipalities = ref<Array<Record<string, any>>>([]);
1673
1777
  const selectedPermanentProvince = computed(() => {
1674
- const province = permanentProvinces.value.find(
1675
- (p) => p.name === enrollment.value.address.permanent.province
1676
- );
1677
-
1678
- if (!province) {
1679
- return "";
1680
- }
1681
-
1682
- return province.code;
1778
+ return enrollment.value.address.permanent.province || "";
1683
1779
  });
1684
1780
 
1685
1781
  const loadingPermanentCityMun = ref(false);
@@ -1695,7 +1791,7 @@ const getPermanentCityMun = debounce(async () => {
1695
1791
  const res = await getAllPSGC({
1696
1792
  type: "City",
1697
1793
  prefix: selectedPermanentProvince.value.slice(0, 5),
1698
- limit: 2000,
1794
+ limit: 200,
1699
1795
  });
1700
1796
  permanentCitiesMunicipalities.value = res.items;
1701
1797
  } catch (error) {
@@ -1709,6 +1805,150 @@ watch(selectedPermanentProvince, () => {
1709
1805
  getPermanentCityMun();
1710
1806
  });
1711
1807
 
1808
+ // Permanent Address - Barangays
1809
+ const permanentBarangays = ref<Array<Record<string, any>>>([]);
1810
+ const selectedPermanentCityMun = computed(() => {
1811
+ return enrollment.value.address.permanent.municipalityCity || "";
1812
+ });
1813
+
1814
+ const loadingPermanentBarangay = ref(false);
1815
+
1816
+ const getPermanentBarangays = debounce(async () => {
1817
+ if (!selectedPermanentCityMun.value) {
1818
+ permanentBarangays.value = [];
1819
+ return;
1820
+ }
1821
+
1822
+ try {
1823
+ loadingPermanentBarangay.value = true;
1824
+ const res = await getAllPSGC({
1825
+ type: "Bgy",
1826
+ prefix: selectedPermanentCityMun.value.slice(0, 7),
1827
+ limit: 200,
1828
+ });
1829
+ permanentBarangays.value = res.items;
1830
+ } catch (error) {
1831
+ permanentBarangays.value = [];
1832
+ } finally {
1833
+ loadingPermanentBarangay.value = false;
1834
+ }
1835
+ }, 500);
1836
+
1837
+ watch(selectedPermanentCityMun, () => {
1838
+ getPermanentBarangays();
1839
+ });
1840
+
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
+ 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
+
1875
+ const loadingBirthCityMun = ref(false);
1876
+
1877
+ const getBirthCityMun = debounce(async () => {
1878
+ if (!selectedBirthProvince.value) {
1879
+ birthCitiesMunicipalities.value = [];
1880
+ return;
1881
+ }
1882
+
1883
+ try {
1884
+ loadingBirthCityMun.value = true;
1885
+ const res = await getAllPSGC({
1886
+ type: "City",
1887
+ prefix: selectedBirthProvince.value.slice(0, 5),
1888
+ limit: 2000,
1889
+ });
1890
+ birthCitiesMunicipalities.value = res.items;
1891
+ } catch (error) {
1892
+ birthCitiesMunicipalities.value = [];
1893
+ } finally {
1894
+ loadingBirthCityMun.value = false;
1895
+ }
1896
+ }, 500);
1897
+
1898
+ watch(selectedBirthProvince, () => {
1899
+ getBirthCityMun();
1900
+ });
1901
+
1902
+ // Auto-fill place of birth region and region name when province is selected
1903
+ watch(
1904
+ () => enrollment.value.learnerInfo.placeOfBirth.province,
1905
+ (provinceCode) => {
1906
+ 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 = "";
1912
+ return;
1913
+ }
1914
+
1915
+ const province = birthProvinces.value.find((p) => p.code === provinceCode);
1916
+ if (province) {
1917
+ // Set province name
1918
+ enrollment.value.learnerInfo.placeOfBirth.provinceName = province.name;
1919
+
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;
1923
+
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
+ }
1929
+ }
1930
+ }
1931
+ );
1932
+
1933
+ // Auto-fill place of birth city/municipality name when selected
1934
+ watch(
1935
+ () => enrollment.value.learnerInfo.placeOfBirth.cityMunicipality,
1936
+ (cityMunCode) => {
1937
+ if (!cityMunCode) {
1938
+ enrollment.value.learnerInfo.placeOfBirth.cityMunicipalityName = "";
1939
+ return;
1940
+ }
1941
+
1942
+ const cityMun = birthCitiesMunicipalities.value.find(
1943
+ (c) => c.code === cityMunCode
1944
+ );
1945
+ if (cityMun) {
1946
+ enrollment.value.learnerInfo.placeOfBirth.cityMunicipalityName =
1947
+ cityMun.name;
1948
+ }
1949
+ }
1950
+ );
1951
+
1712
1952
  const { getAll } = useProgram();
1713
1953
 
1714
1954
  const programs = ref<Array<Record<string, any>>>([]);
@@ -1953,11 +2193,16 @@ const allowedLastGradeLevels = computed(() => {
1953
2193
  const currentIndex = gradeOrder.indexOf(currentGrade);
1954
2194
  if (currentIndex === -1) return gradeLevels;
1955
2195
 
2196
+ // Special case for grade-1: include both kindergarten and kinder
2197
+ let startIndex;
2198
+ if (currentGrade === "grade-1") {
2199
+ startIndex = 0; // Include from kindergarten
2200
+ } else {
2201
+ startIndex = Math.max(0, currentIndex - 1);
2202
+ }
2203
+
1956
2204
  // Get grades that are equal to or one level below current grade
1957
- const allowedGrades = gradeOrder.slice(
1958
- Math.max(0, currentIndex - 1),
1959
- currentIndex + 1
1960
- );
2205
+ const allowedGrades = gradeOrder.slice(startIndex, currentIndex + 1);
1961
2206
 
1962
2207
  // Filter gradeLevels to only include allowed grades
1963
2208
  return gradeLevels.filter((level) => {
@@ -2064,7 +2309,12 @@ watch(enrollment, (val) => {
2064
2309
  enrollment.value.learnerInfo.lastName = "";
2065
2310
  enrollment.value.learnerInfo.extensionName = "";
2066
2311
  enrollment.value.learnerInfo.birthDate = "";
2067
- enrollment.value.learnerInfo.placeOfBirth = "";
2312
+ enrollment.value.learnerInfo.placeOfBirth.region = "";
2313
+ enrollment.value.learnerInfo.placeOfBirth.regionName = "";
2314
+ enrollment.value.learnerInfo.placeOfBirth.province = "";
2315
+ enrollment.value.learnerInfo.placeOfBirth.provinceName = "";
2316
+ enrollment.value.learnerInfo.placeOfBirth.cityMunicipality = "";
2317
+ enrollment.value.learnerInfo.placeOfBirth.cityMunicipalityName = "";
2068
2318
  enrollment.value.learnerInfo.sex = "";
2069
2319
  enrollment.value.learnerInfo.motherTongue = "";
2070
2320
  enrollment.value.learnerInfo.age = 0;