iptdevs-design-system 2.7.29 → 2.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.
Files changed (40) hide show
  1. package/esm2020/lib/cod/cod-documents-section/cod-documents-section.component.mjs +16 -0
  2. package/esm2020/lib/cod/cod-form/cod-form.component.mjs +227 -0
  3. package/esm2020/lib/cod/cod.module.mjs +86 -0
  4. package/esm2020/lib/cod/logic/calculate-quotes.service.mjs +72 -0
  5. package/esm2020/lib/cod/logic/cod-form-controls.mjs +91 -0
  6. package/esm2020/lib/cod/logic/cod-form-steps.mjs +29 -0
  7. package/esm2020/lib/cod/logic/communicator.service.mjs +28 -0
  8. package/esm2020/lib/cod/logic/local-storage-cod.service.mjs +39 -0
  9. package/esm2020/lib/cod/steps/cod-form-step-five/cod-form-step-five.component.mjs +145 -0
  10. package/esm2020/lib/cod/steps/cod-form-step-four/cod-form-step-four.component.mjs +251 -0
  11. package/esm2020/lib/cod/steps/cod-form-step-one/cod-form-step-one.component.mjs +200 -0
  12. package/esm2020/lib/cod/steps/cod-form-step-three/cod-form-step-three.component.mjs +175 -0
  13. package/esm2020/lib/cod/steps/cod-form-step-two/cod-form-step-two.component.mjs +255 -0
  14. package/esm2020/lib/core/core.module.mjs +6 -3
  15. package/esm2020/lib/core/services/copies.service.mjs +17 -0
  16. package/esm2020/lib/core/utils/copies.mjs +214 -0
  17. package/esm2020/lib/design-system.module.mjs +8 -4
  18. package/esm2020/public-api.mjs +19 -1
  19. package/fesm2015/iptdevs-design-system.mjs +1790 -51
  20. package/fesm2015/iptdevs-design-system.mjs.map +1 -1
  21. package/fesm2020/iptdevs-design-system.mjs +1790 -51
  22. package/fesm2020/iptdevs-design-system.mjs.map +1 -1
  23. package/lib/cod/cod-documents-section/cod-documents-section.component.d.ts +8 -0
  24. package/lib/cod/cod-form/cod-form.component.d.ts +37 -0
  25. package/lib/cod/cod.module.d.ts +20 -0
  26. package/lib/cod/logic/calculate-quotes.service.d.ts +14 -0
  27. package/lib/cod/logic/cod-form-controls.d.ts +16 -0
  28. package/lib/cod/logic/cod-form-steps.d.ts +15 -0
  29. package/lib/cod/logic/communicator.service.d.ts +13 -0
  30. package/lib/cod/logic/local-storage-cod.service.d.ts +8 -0
  31. package/lib/cod/steps/cod-form-step-five/cod-form-step-five.component.d.ts +31 -0
  32. package/lib/cod/steps/cod-form-step-four/cod-form-step-four.component.d.ts +47 -0
  33. package/lib/cod/steps/cod-form-step-one/cod-form-step-one.component.d.ts +46 -0
  34. package/lib/cod/steps/cod-form-step-three/cod-form-step-three.component.d.ts +35 -0
  35. package/lib/cod/steps/cod-form-step-two/cod-form-step-two.component.d.ts +44 -0
  36. package/lib/core/services/copies.service.d.ts +7 -0
  37. package/lib/core/utils/copies.d.ts +1 -0
  38. package/lib/design-system.module.d.ts +2 -1
  39. package/package.json +1 -1
  40. package/public-api.d.ts +14 -0
@@ -4,6 +4,10 @@ import * as i3 from 'ng2-currency-mask';
4
4
  import { CurrencyMaskModule } from 'ng2-currency-mask';
5
5
  import * as i1 from '@angular/common';
6
6
  import { CommonModule, CurrencyPipe, TitleCasePipe } from '@angular/common';
7
+ import * as i11 from 'primeng/api';
8
+ import { MessageService } from 'primeng/api';
9
+ import * as i5$2 from 'primeng/tabview';
10
+ import { TabViewModule } from 'primeng/tabview';
7
11
  import * as i1$1 from '@angular/forms';
8
12
  import { Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
9
13
  import Swal from 'sweetalert2';
@@ -18,6 +22,14 @@ import * as i6 from '@angular/material/list';
18
22
  import { MatListModule } from '@angular/material/list';
19
23
  import { MatIconModule } from '@angular/material/icon';
20
24
  import { MatButtonModule } from '@angular/material/button';
25
+ import * as i7 from 'primeng/button';
26
+ import { ButtonModule } from 'primeng/button';
27
+ import * as moment from 'moment';
28
+ import { BehaviorSubject, map } from 'rxjs';
29
+ import * as i9 from 'primeng/table';
30
+ import { TableModule } from 'primeng/table';
31
+ import * as i5$1 from '@angular/material/checkbox';
32
+ import { MatCheckboxModule } from '@angular/material/checkbox';
21
33
  import * as i1$3 from '@angular/router';
22
34
 
23
35
  class AsideButtonComponent {
@@ -1826,6 +1838,444 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
1826
1838
  }]
1827
1839
  }] });
1828
1840
 
1841
+ class CodDocumentsSectionComponent {
1842
+ constructor() { }
1843
+ ngOnInit() {
1844
+ }
1845
+ }
1846
+ CodDocumentsSectionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CodDocumentsSectionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1847
+ CodDocumentsSectionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: CodDocumentsSectionComponent, selector: "ipt-cod-documents-section", ngImport: i0, template: "<div class=\"container flex flex-column bg-white border-round-2xl p-3 container animate__animated animate__fadeInUp\">\n\n <span class=\"bg-primary p-2 border-round mb-2 w-auto text-lg font-semibold\">Documentos del COD</span>\n\n <div *ngFor=\"let item of [1,2,3,4,5]\" class=\"document_item flex align-items-center p-2 border-round\">\n <span>Documento de identidad</span>\n <div class=\"ml-auto\">\n <button pButton pRipple type=\"button\" icon=\"pi pi-eye\" class=\"p-button-rounded p-button-sm ml-auto mr-1\"></button>\n <button pButton pRipple type=\"button\" icon=\"pi pi-trash\" class=\"p-button-rounded p-button-sm p-button-danger ml-auto\"></button>\n </div>\n </div>\n\n <hr>\n <button pButton pRipple type=\"button\" icon=\"pi pi-plus\" label=\"Agregar\" class=\"p-button-rounded p-button-sm ml-auto mt-2\"></button>\n\n</div>\n", styles: [".document_item{transition:.15s;gap:1rem;max-height:150px}.document_item:hover{cursor:pointer;box-shadow:#64646f33 0 7px 29px}\n"], directives: [{ type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }] });
1848
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CodDocumentsSectionComponent, decorators: [{
1849
+ type: Component,
1850
+ args: [{ selector: 'ipt-cod-documents-section', template: "<div class=\"container flex flex-column bg-white border-round-2xl p-3 container animate__animated animate__fadeInUp\">\n\n <span class=\"bg-primary p-2 border-round mb-2 w-auto text-lg font-semibold\">Documentos del COD</span>\n\n <div *ngFor=\"let item of [1,2,3,4,5]\" class=\"document_item flex align-items-center p-2 border-round\">\n <span>Documento de identidad</span>\n <div class=\"ml-auto\">\n <button pButton pRipple type=\"button\" icon=\"pi pi-eye\" class=\"p-button-rounded p-button-sm ml-auto mr-1\"></button>\n <button pButton pRipple type=\"button\" icon=\"pi pi-trash\" class=\"p-button-rounded p-button-sm p-button-danger ml-auto\"></button>\n </div>\n </div>\n\n <hr>\n <button pButton pRipple type=\"button\" icon=\"pi pi-plus\" label=\"Agregar\" class=\"p-button-rounded p-button-sm ml-auto mt-2\"></button>\n\n</div>\n", styles: [".document_item{transition:.15s;gap:1rem;max-height:150px}.document_item:hover{cursor:pointer;box-shadow:#64646f33 0 7px 29px}\n"] }]
1851
+ }], ctorParameters: function () { return []; } });
1852
+
1853
+ class LocalStorageCODService {
1854
+ constructor() { }
1855
+ getCodFormData(step, control) {
1856
+ if (step === 1)
1857
+ return localStorage.getItem(`COD FORM - step1(${control})`);
1858
+ if (step === 2)
1859
+ return localStorage.getItem(`COD FORM - step2(${control})`);
1860
+ if (step === 3)
1861
+ return localStorage.getItem(`COD FORM - step3(${control})`);
1862
+ if (step === 4)
1863
+ return localStorage.getItem(`COD FORM - step4(${control})`);
1864
+ if (step === 5)
1865
+ return localStorage.getItem(`COD FORM - step5(${control})`);
1866
+ return null;
1867
+ }
1868
+ setCodFormData(step, control, value) {
1869
+ if (step === 1)
1870
+ localStorage.setItem(`COD FORM - step1(${control})`, value);
1871
+ if (step === 2)
1872
+ localStorage.setItem(`COD FORM - step2(${control})`, value);
1873
+ if (step === 3)
1874
+ localStorage.setItem(`COD FORM - step3(${control})`, value);
1875
+ if (step === 4)
1876
+ localStorage.setItem(`COD FORM - step4(${control})`, value);
1877
+ if (step === 5)
1878
+ localStorage.setItem(`COD FORM - step5(${control})`, value);
1879
+ }
1880
+ }
1881
+ LocalStorageCODService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: LocalStorageCODService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1882
+ LocalStorageCODService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: LocalStorageCODService, providedIn: 'root' });
1883
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: LocalStorageCODService, decorators: [{
1884
+ type: Injectable,
1885
+ args: [{
1886
+ providedIn: 'root'
1887
+ }]
1888
+ }], ctorParameters: function () { return []; } });
1889
+
1890
+ class CodFormControls {
1891
+ constructor() {
1892
+ this.controls = [
1893
+ [
1894
+ { name: 'academic_plan', required: true, description: 'Plan académico' },
1895
+ { name: 'course_type', required: true, description: 'Tipo de curso' },
1896
+ { name: 'agreement_by_category', required: true, description: 'Convenio' },
1897
+ { name: 'english_level', required: true, description: 'Nivel de inglés' },
1898
+ { name: 'availible_courses', required: false, description: 'Cursos disponibles' },
1899
+ ],
1900
+ [
1901
+ { name: 'student_address', required: true, description: 'Dirección del estudiante' },
1902
+ { name: 'birthdate', required: true, description: 'Fecha de nacimiento del estudiante' },
1903
+ { name: 'country', required: true, description: 'País' },
1904
+ { name: 'state', required: true, description: 'Departamento o estado' },
1905
+ { name: 'city', required: true, description: 'Ciudad de residencia' },
1906
+ { name: 'student_id_card_type', required: true, description: 'Tipo de documento del estudiante' },
1907
+ { name: 'student_id_card', required: true, description: 'Documento del estudiante' },
1908
+ { name: 'student_last_name', required: true, description: 'Apellidos del estudiante' },
1909
+ { name: 'student_name', required: true, description: 'Nombres del estudiante' },
1910
+ { name: 'student_email', required: true, description: 'Correo del estudiante' },
1911
+ { name: 'nickname', required: true, description: 'Alias o nickname' },
1912
+ { name: 'gender', required: true, description: 'Género' },
1913
+ { name: 'age', required: true, description: 'Edad' },
1914
+ { name: 'student_occupation', required: true, description: 'Ocupación del estudiante' },
1915
+ { name: 'stratum', required: true, description: 'Estrato del estudiante' },
1916
+ { name: 'grade', required: true, description: 'Grado del estudiante' },
1917
+ { name: 'civil_status', required: true, description: 'Estado civil del estudiante' },
1918
+ { name: 'student_phone_indicative', required: true, description: 'Indicativo del estudiante' },
1919
+ { name: 'student_phone_number', required: true, description: 'Teléfono del estudiante' },
1920
+ { name: 'password', required: true, description: 'Contraseña del estudiante' },
1921
+ { name: 're_password', required: true, description: 'Confirmación de contraseña' },
1922
+ ],
1923
+ [
1924
+ { name: 'parent_id_card_type', required: true, description: 'Tipo de documento del acudiente' },
1925
+ { name: 'parent_id_card', required: true, description: 'Documento del acudiente' },
1926
+ { name: 'parent_last_name', required: true, description: 'Apellidos del acudiente' },
1927
+ { name: 'parent_name', required: true, description: 'Nombres del acudiente' },
1928
+ { name: 'needAtendant', required: true, description: '¿Requiere acudiente?' },
1929
+ { name: 'parent_phone_indicative', required: true, description: 'Indicativo del acudiente' },
1930
+ { name: 'parent_occupation', required: true, description: 'Ocupación del acudiente' },
1931
+ { name: 'parent_address', required: true, description: 'Dirección del acudiente' },
1932
+ { name: 'parent_phone_number', required: true, description: 'Teléfono del acudiente' }
1933
+ ],
1934
+ [
1935
+ { name: 'payment_date', required: true, description: 'Fecha de pago' },
1936
+ { name: 'program_price', required: true, description: 'Valor total del programa' },
1937
+ { name: 'payment_method', required: true, description: 'Método de pago' },
1938
+ { name: 'quota_times', required: true, description: 'Cantidad de cuotas' },
1939
+ { name: 'total_price', required: true, description: 'Precio total de la matricula' },
1940
+ ],
1941
+ [
1942
+ { name: 'marketing_reasons', required: true, description: '¿Cómo se enteró del programa?' },
1943
+ { name: 'observation', required: false, description: 'Observación' },
1944
+ { name: 'study_reasons', required: true, description: 'Motivo' },
1945
+ { name: 'terms', required: true, description: 'Términos y condiciones' },
1946
+ { name: 'disability', required: false, description: 'Discapacidad' },
1947
+ { name: 'multiculturalism_1', required: false, description: 'Multiculturalismo' },
1948
+ { name: 'multiculturalism_2', required: false, description: 'Multiculturalismo' },
1949
+ { name: 'multiculturalism_3', required: false, description: 'Multiculturalismo' },
1950
+ { name: 'multiculturalism_4', required: false, description: 'Multiculturalismo' },
1951
+ { name: 'multiculturalism_5', required: false, description: 'Multiculturalismo' },
1952
+ { name: 'multiculturalism_6', required: false, description: 'Multiculturalismo' },
1953
+ { name: 'health_regimen', required: true, description: 'Régimen de salud' }
1954
+ ],
1955
+ ];
1956
+ this.$controls = new BehaviorSubject([]);
1957
+ }
1958
+ getControlValues() {
1959
+ return this.$controls.asObservable();
1960
+ }
1961
+ // Cambiar los valores de los controls, ejemplo: true y false del checkbox
1962
+ changeValue(step, controlName, newValue) {
1963
+ const controls = { ...this.controls };
1964
+ let control = controls[step - 1].filter(element => element.name === controlName);
1965
+ control[0].required = newValue;
1966
+ this.$controls.next(controls);
1967
+ }
1968
+ }
1969
+ CodFormControls.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CodFormControls, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1970
+ CodFormControls.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CodFormControls, providedIn: 'root' });
1971
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CodFormControls, decorators: [{
1972
+ type: Injectable,
1973
+ args: [{
1974
+ providedIn: 'root'
1975
+ }]
1976
+ }], ctorParameters: function () { return []; } });
1977
+
1978
+ class CommercialService extends IPTGeneralService {
1979
+ constructor(http) {
1980
+ super();
1981
+ this.http = http;
1982
+ this.SERVICE_URL = 'commercial/api/';
1983
+ this.SERVICE_URL = this.baseUrl() + this.SERVICE_URL;
1984
+ }
1985
+ createCOD(request) {
1986
+ let serviceUrl = this.SERVICE_URL + 'post/cod';
1987
+ this.generateRequestParams(request);
1988
+ return this.http.post(serviceUrl, this.httpOptions);
1989
+ }
1990
+ getStudentCodHistory(token, student_id_card) {
1991
+ let serviceUrl = this.SERVICE_URL + 'post/obtain/cod/history/by/student';
1992
+ this.generateRequestParams({ token, student_id_card });
1993
+ return this.http.post(serviceUrl, this.httpOptions);
1994
+ }
1995
+ getCodHistoryAll(userToken) {
1996
+ let serviceUrl = this.SERVICE_URL + 'post/obtain/cod/history/all';
1997
+ this.generateRequestParams(userToken);
1998
+ return this.http.post(serviceUrl, this.httpOptions);
1999
+ }
2000
+ getCodHistoryByCourse(request) {
2001
+ let serviceUrl = this.SERVICE_URL + 'post/obtain/cod/history/by/course';
2002
+ this.generateRequestParams(request);
2003
+ return this.http.post(serviceUrl, this.httpOptions);
2004
+ }
2005
+ getDiscountCoupons(params) {
2006
+ let serviceUrl = this.SERVICE_URL + 'post/discount/coupon/search';
2007
+ this.generateRequestParams(params);
2008
+ return this.http.post(serviceUrl, this.httpOptions);
2009
+ }
2010
+ getCodPricesByAgreement(code) {
2011
+ let serviceUrl = this.SERVICE_URL + 'get/cod/prices/by/agreement/' + code;
2012
+ this.generateRequestParams(code);
2013
+ return this.http.get(serviceUrl, this.httpOptions);
2014
+ }
2015
+ }
2016
+ CommercialService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CommercialService, deps: [{ token: i1$2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
2017
+ CommercialService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CommercialService, providedIn: 'root' });
2018
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CommercialService, decorators: [{
2019
+ type: Injectable,
2020
+ args: [{ providedIn: 'root' }]
2021
+ }], ctorParameters: function () { return [{ type: i1$2.HttpClient }]; } });
2022
+
2023
+ class CodFormSteps {
2024
+ constructor() {
2025
+ this.localStorageCOD = new LocalStorageCODService();
2026
+ }
2027
+ readAndWriteLS(step, control) {
2028
+ if (this.localStorageCOD.getCodFormData(step, control)) {
2029
+ const value = this.localStorageCOD.getCodFormData(step, control);
2030
+ return { control, value };
2031
+ }
2032
+ else {
2033
+ return { control, value: '' };
2034
+ }
2035
+ }
2036
+ setDataInLocalStorage(step, control, value) {
2037
+ this.localStorageCOD.setCodFormData(step, control, value);
2038
+ }
2039
+ listenFormChanges(step, control, obs) {
2040
+ obs.subscribe(value => {
2041
+ this.setDataInLocalStorage(step, control, value);
2042
+ });
2043
+ }
2044
+ resetLocalStorage(controls) {
2045
+ controls.forEach(control => {
2046
+ localStorage.removeItem(control.name);
2047
+ });
2048
+ }
2049
+ }
2050
+
2051
+ const copies = {
2052
+ "es": {
2053
+ "modal_template": {
2054
+ "inputs": {
2055
+ "city": "Ingrese su ciudad de residencia",
2056
+ "country": "Ingresa tu pais de residencia",
2057
+ "comments": "Ingresa tus comentarios de registro ( Opcional )",
2058
+ "date_of_birth": "Ingresa tu fecha de nacimiento",
2059
+ "email": "Correo electronico",
2060
+ "id_card": "Documento de identidad",
2061
+ "last_name": "Apellidos",
2062
+ "name": "Nombres",
2063
+ "phone_number": "Numero de teléfono",
2064
+ "password": "Contraseña",
2065
+ "re_password": "Repetir contraseña",
2066
+ "role": "Seleccione el rol",
2067
+ "service_hour": "Horas de servicio",
2068
+ "id_card_type": "Ingresa tu tipo de documento",
2069
+ "phone_indicative": "Seleccione su indicativo",
2070
+ "state": "Seleccione su departamento",
2071
+ "file": "Seleccionar archivo",
2072
+ "contacted_contact": "Contactado...",
2073
+ "status_contact": "Status",
2074
+ "plan_contact": "Tipo Plan",
2075
+ "observations_contact": "Observaciones",
2076
+ },
2077
+ "validators": {
2078
+ "city": "Debe ingresar la ciudad de residencia",
2079
+ "country": "Debes ingresar el pais de residencia",
2080
+ "date_of_birth": "Debes ingrese la fecha de nacimiento",
2081
+ "email": "Recuerda usar correos con dominio @inglesparatodos.edu.co",
2082
+ "id_card": "Debes ingresar el número de documento.",
2083
+ "last_name": "Debes ingresar los apellidos del usuario.",
2084
+ "name": "Debes ingresar el nombre del usuario",
2085
+ "phone_number": "Debes ingresar un número de teléfono valido",
2086
+ "password": "Debe ser de minimo 7 digitos",
2087
+ "re_password": "Debe ser de minimo 7 digitos",
2088
+ "role": "Debe seleccionar un rol",
2089
+ "service_hour": "Debe ingresar las horas de servicio",
2090
+ "id_card_type": "Debes ingresar el tipo de documento",
2091
+ "phone_indicative": "Debes seleccionar un indicativo",
2092
+ "state": "Seleccione el departamento",
2093
+ "id_document": "Debe subir un archivo",
2094
+ "agreement_document": "Debe subir un archivo",
2095
+ "parent_id_document": "Debe subir un archivo",
2096
+ "comfanorte_document": "Debe subir un archivo",
2097
+ "contacted_contact": "Debe seleccionar forma de contactar cliente",
2098
+ "status_contact": "Debe seleccionar un estaus.",
2099
+ "plan_contact": "Debe seleccionar un plan",
2100
+ "observariones_contact": "Debe llenar el campo observaciones",
2101
+ }
2102
+ },
2103
+ "dashboard_template": {
2104
+ "inputs": {
2105
+ "agreement_by_category": "Convenio por categoria",
2106
+ "academic_level": "Ingrese el nivel academico ( Pregrado / Posgrado )",
2107
+ "academic_plan": 'Plan',
2108
+ "address": "ingrese su direccion",
2109
+ "agreement": "ingrese el convenio",
2110
+ "availible_courses": "Grupos disponibles",
2111
+ "birthdate": "Ingresa tu fecha de nacimiento",
2112
+ "city": "Ingrese su ciudad de residencia",
2113
+ "classroom": "Grupos Disponibles",
2114
+ "country": "Ingresa tu pais de residencia",
2115
+ "course_type": "Tipo de plan",
2116
+ "degree": "Nivel universitario",
2117
+ "comments": "Ingresa tus comentarios de registro ( Opcional )",
2118
+ "email": "Correo electronico",
2119
+ "email_ufps": "ingresa el correo electronico con dominio ufps.edu.co",
2120
+ "email_unipamplona": "Ingresa el correo con dominio unipamplona.edu.co",
2121
+ "financing_value": "Valor pagado",
2122
+ "financing_date": "Fecha de pago",
2123
+ "financing_responsable": "Recibido por",
2124
+ "financing_sales_check": "Numero de recibo",
2125
+ "financing_invoice_number": "Numero de recibo",
2126
+ "id_cod": "Numero de inscripcion",
2127
+ "id_card_type": "Ingresa tu tipo de documento",
2128
+ "id_card": "Documento de identidad",
2129
+ "id_financing": "Consecutivo",
2130
+ "id_payment": "Ingrese el número de recibo",
2131
+ "last_name": "Apellidos",
2132
+ "name": "Ingrese los nombres",
2133
+ "nickname": "Nickname",
2134
+ "needAtendant": "¿Requiere acudiente?",
2135
+ "marketing_reasons": "¿Cómo se entero del programa?",
2136
+ "level": "Seleccione el nivel",
2137
+ "observation": "Observaciones",
2138
+ "occupation": "Ocupacion",
2139
+ "password": "Contraseña",
2140
+ "phone_indicative": "Seleccione su indicativo",
2141
+ "phone_number": "Numero de teléfono",
2142
+ "paymentMethod": "Seleccione el metodo de pago",
2143
+ "payment_date": "Ingresa la fecha de pago",
2144
+ "program": "Ingrese el programa academico",
2145
+ "first_quota_price": "Ingrese el valor de la primera cuota",
2146
+ "quota_times": "Ingresar el numero de cuotas",
2147
+ "role": "Seleccione el rol",
2148
+ "re_password": "Repetir contraseña",
2149
+ "re_total_price": "Confirmar el valor total de la matricula",
2150
+ "service_hour": "Horas de servicio",
2151
+ "semester": "Semestre actual",
2152
+ "school_name": "Ingrese el nombre del colegio",
2153
+ "school_grade": "Grado escolar",
2154
+ "state": "Seleccione su departamento",
2155
+ "study_reasons": "Motivo",
2156
+ "total_price": "Ingrese el monto total de la matricula",
2157
+ "ufps_code": "Ingrese el codigo UFPS",
2158
+ "unipamplona_code": "Ingresa tu codigo UniPamplona",
2159
+ "type_coupon": "Ingrese el tipo de cupon"
2160
+ },
2161
+ "validators": {
2162
+ "academic_level": "Ingrese el nivel academico ( Pregrado / Posgrado )",
2163
+ "academic_plan": 'Plan',
2164
+ "address": "Debes ingresar su direccion",
2165
+ "agreement_by_category": "Convenio por categoria",
2166
+ "availible_courses": "Debes seleccionar el grupo",
2167
+ "birthdate": "Debes ingresar tu fecha de nacimiento",
2168
+ "city": "Debes ingresar la ciudad de residencia",
2169
+ "classroom": "Debe seleccionar los grupos disponibles",
2170
+ "country": "Debes ingresar el pais de residencia",
2171
+ "degree": "Debe seleccionar el nivel universitario",
2172
+ "email": "Recuerda usar correos con dominio @inglesparatodos.edu.co",
2173
+ "email_ufps": "ingresa el correo electronico con dominio ufps.edu.co",
2174
+ "email_unipamplona": "Ingresa el correo con dominio unipamplona.edu.co",
2175
+ "financing_value": "Debe ingresar el valor pagado de la cuota",
2176
+ "financing_date": "Debe ingresar la fecha de realizacion del pago",
2177
+ "financing_responsable": "Debe ingresar el nombre de quien recibe el pago",
2178
+ "financing_sales_check": "Debe ingresar el numero de recibo",
2179
+ "financing_invoice_number": "Debes ingresar el numero de recibo",
2180
+ "id_cod": "Ingrese el numero de inscripcion",
2181
+ "id_card_type": "Debes ingresar el tipo de documento",
2182
+ "id_card": "Debes ingresar el número de documento.",
2183
+ "id_payment": "Debe ingresar el número de recibo",
2184
+ "last_name": "Debes ingresar los apellidos del usuario.",
2185
+ "name": "Debes ingresar el nombre del usuario",
2186
+ "nickname": "Debes ingresar el nickname",
2187
+ "marketing_reasons": "¿Cómo se entero del programa?",
2188
+ "needAtendant": "Debes ingresar si requiere o no acudiente",
2189
+ "level": "Seleccione el nivel",
2190
+ "observation": "Observaciones",
2191
+ "occupation": "Debes ingresar la ocupacion",
2192
+ "password": "Debe ser de minimo 7 digitos",
2193
+ "paymentMethod": "Seleccione el metodo de pago",
2194
+ "payment_date": "Debe ingresa la fecha de pago",
2195
+ "phone_number": "Debes ingresar un número de teléfono valido",
2196
+ "phone_indicative": "Debes seleccionar un indicativo",
2197
+ "first_quota_price": "Debe ingresar el valor de la primera cuota",
2198
+ "quota_times": "Ingrese un número de cuotas válido",
2199
+ "program": "Debe ingresar el programa academico",
2200
+ "role": "Debe seleccionar un rol",
2201
+ "re_password": "Debe ser de minimo 7 digitos",
2202
+ "re_total_price": "Debe confirmar el valor total de la matricula",
2203
+ "semester": "Debe ingresar el semestre actual",
2204
+ "service_hour": "Debe ingresar las horas de servicio",
2205
+ "school_name": "Debe ingresar el nombre del colegio",
2206
+ "school_grade": "Debes ingresar el grado actual",
2207
+ "state": "Seleccione el departamento",
2208
+ "study_reasons": "Motivo",
2209
+ "total_price": "Debe ingresar el monto total de la matricula",
2210
+ "ufps_code": "Debe ingresar el codigo UFPS",
2211
+ "unipamplona_code": "Debes ingresar tu codigo UniPamplona"
2212
+ },
2213
+ },
2214
+ "attendant": {
2215
+ "inputs": {
2216
+ "address": "ingrese su direccion",
2217
+ "city": "Ingrese su ciudad de residencia",
2218
+ "country": "Ingresa tu pais de residencia",
2219
+ "id_card_type": "Ingresa tu tipo de documento",
2220
+ "id_card": "Documento de identidad",
2221
+ "last_name": "Apellidos",
2222
+ "name": "Ingrese los nombres",
2223
+ "phone_indicative": "Seleccione su indicativo",
2224
+ "phone_number": "Numero de teléfono",
2225
+ "state": "Seleccione su departamento",
2226
+ },
2227
+ "validators": {
2228
+ "address": "Debes ingresar su direccion",
2229
+ "city": "Debes ingresar la ciudad de residencia",
2230
+ "country": "Debes ingresar el pais de residencia",
2231
+ "id_card_type": "Debes ingresar el tipo de documento",
2232
+ "id_card": "Debes ingresar el número de documento.",
2233
+ "last_name": "Debes ingresar los apellidos del usuario.",
2234
+ "name": "Debes ingresar el nombre del usuario",
2235
+ "phone_number": "Debes ingresar un número de teléfono valido",
2236
+ "phone_indicative": "Debes seleccionar un indicativo",
2237
+ "state": "Seleccione el departamento",
2238
+ }
2239
+ },
2240
+ "menu": {
2241
+ "field1": "Home",
2242
+ "field2": "Groups",
2243
+ "field3": "Profile",
2244
+ "field5": "Score",
2245
+ "field4": "Search",
2246
+ "endField": "Cerrar Sesión"
2247
+ },
2248
+ "edit_profile": {
2249
+ "inputs": {
2250
+ "id_card": "Documento de identidad",
2251
+ "ufps_code": "Código de la universidad",
2252
+ "email": "Correo dominio @ufps.edu.co",
2253
+ "last_name": "Ingresa tus apellidos",
2254
+ "name": "Ingresa tus nombres",
2255
+ "phone": "Numero de teléfono",
2256
+ },
2257
+ },
2258
+ "en": {}
2259
+ }
2260
+ };
2261
+ function getCopies() {
2262
+ return copies;
2263
+ }
2264
+
2265
+ class CopiesService {
2266
+ constructor() {
2267
+ this.copies = getCopies();
2268
+ }
2269
+ }
2270
+ CopiesService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CopiesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2271
+ CopiesService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CopiesService, providedIn: 'root' });
2272
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CopiesService, decorators: [{
2273
+ type: Injectable,
2274
+ args: [{
2275
+ providedIn: 'root'
2276
+ }]
2277
+ }], ctorParameters: function () { return []; } });
2278
+
1829
2279
  class CourseService extends IPTGeneralService {
1830
2280
  constructor(http) {
1831
2281
  super();
@@ -1892,6 +2342,1335 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
1892
2342
  }]
1893
2343
  }], ctorParameters: function () { return [{ type: i1$2.HttpClient }]; } });
1894
2344
 
2345
+ class CommunicatorService {
2346
+ constructor() {
2347
+ this.$courseType = new BehaviorSubject('');
2348
+ this.$agreement = new BehaviorSubject('');
2349
+ }
2350
+ getSelectedCourseType() {
2351
+ return this.$courseType.asObservable();
2352
+ }
2353
+ setCurrentCourseType(value) {
2354
+ this.$courseType.next(value);
2355
+ }
2356
+ getSelectedAgreement() {
2357
+ return this.$agreement.asObservable();
2358
+ }
2359
+ setCurrentAgreement(value) {
2360
+ this.$agreement.next(value);
2361
+ }
2362
+ }
2363
+ CommunicatorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CommunicatorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2364
+ CommunicatorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CommunicatorService, providedIn: 'root' });
2365
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CommunicatorService, decorators: [{
2366
+ type: Injectable,
2367
+ args: [{ providedIn: 'root' }]
2368
+ }], ctorParameters: function () { return []; } });
2369
+
2370
+ class CodFormStepOneComponent extends CodFormSteps {
2371
+ constructor(fb, parameterService, copiesService, baseService, courseService, communicatorService) {
2372
+ super();
2373
+ this.fb = fb;
2374
+ this.parameterService = parameterService;
2375
+ this.copiesService = copiesService;
2376
+ this.baseService = baseService;
2377
+ this.courseService = courseService;
2378
+ this.communicatorService = communicatorService;
2379
+ this.changeStepEvent = new EventEmitter();
2380
+ this.availibleCourses = [];
2381
+ // Controls del formulario
2382
+ this.controls = new CodFormControls().controls[0];
2383
+ this.copies = this.copiesService.copies;
2384
+ }
2385
+ ngOnInit() {
2386
+ this.getParameters();
2387
+ this.initForm();
2388
+ this.startLocalStorageWork();
2389
+ this.setValuesByLocalStorage();
2390
+ this.codFormStepOne.controls['course_type'].valueChanges
2391
+ .subscribe(value => this.communicatorService.setCurrentCourseType(value));
2392
+ this.communicatorService.setCurrentAgreement(this.localStorageCOD.getCodFormData(1, 'agreement_by_category'));
2393
+ }
2394
+ /* Es necesario recorrer el array de controls de nuestro formulario para:
2395
+ ✅ Leer el Local Storage y setear los valores
2396
+ ✅ Subscribirse a los cambios del formulario para setear valores nuevos
2397
+
2398
+ Nota: la clase CodFormSteps() se encarga de toda la lógica de LS con los pasos del formulario del COD
2399
+ */
2400
+ startLocalStorageWork() {
2401
+ this.controls.forEach(control => {
2402
+ let localStorageValue = this.readAndWriteLS(1, control.name);
2403
+ this.codFormStepOne.controls[control.name].setValue(localStorageValue.value);
2404
+ this.listenFormChanges(1, control.name, this.codFormStepOne.controls[control.name].valueChanges);
2405
+ });
2406
+ }
2407
+ getParameters() {
2408
+ this.parameterService.getAllPlans().subscribe((response) => {
2409
+ this.plans = response.data;
2410
+ });
2411
+ this.parameterService.getLevels().subscribe((response) => {
2412
+ this.levels = response.data;
2413
+ });
2414
+ }
2415
+ initForm() {
2416
+ this.codFormStepOne = this.fb.group({
2417
+ academic_plan: ['', [Validators.required]],
2418
+ course_type: ['', [Validators.required]],
2419
+ agreement_by_category: ['', [Validators.required]],
2420
+ english_level: ['', [Validators.required]],
2421
+ availible_courses: ['', []],
2422
+ });
2423
+ }
2424
+ setValuesByLocalStorage() {
2425
+ const academicPlan = this.codFormStepOne.controls['academic_plan'].value || null;
2426
+ if (!academicPlan)
2427
+ return;
2428
+ this.selectAcademicPlan(academicPlan);
2429
+ const agreementByCategory = this.codFormStepOne.controls['agreement_by_category'].value || null;
2430
+ if (!agreementByCategory)
2431
+ return;
2432
+ this.getAvailibleCourses();
2433
+ const englishLevel = this.codFormStepOne.controls['english_level'].value || null;
2434
+ if (!englishLevel)
2435
+ return;
2436
+ this.getAvailibleCourses();
2437
+ }
2438
+ sendForm() {
2439
+ this.codFormStepOne.markAsTouched();
2440
+ if (this.codFormStepOne.invalid)
2441
+ return;
2442
+ // Movernos al paso 2
2443
+ this.changeStepEvent.emit(1);
2444
+ }
2445
+ resetForm() {
2446
+ this.resetLocalStorage(this.controls);
2447
+ this.codFormStepOne.reset();
2448
+ }
2449
+ // Eventos de los selects
2450
+ selectAcademicPlan(academic_plan) {
2451
+ if (academic_plan !== 'Plan') {
2452
+ this.codFormStepOne.controls['academic_plan'].setValue(academic_plan);
2453
+ this.getCourseType(academic_plan);
2454
+ this.getAgreementByPlan(academic_plan);
2455
+ }
2456
+ else {
2457
+ this.codFormStepOne.controls['academic_plan'].setValue(null);
2458
+ this.codFormStepOne.controls['course_type'].setValue(null);
2459
+ this.codFormStepOne.controls['agreement_by_category'].setValue(null);
2460
+ }
2461
+ }
2462
+ getCourseType(plan) {
2463
+ this.parameterService.getCoursesTypesByPlan(plan).subscribe((response) => {
2464
+ this.course_type = response.data;
2465
+ });
2466
+ }
2467
+ getAgreementByPlan(plan) {
2468
+ this.parameterService.getAgreementByCategory(plan).subscribe((response) => {
2469
+ this.agreements = response.data;
2470
+ });
2471
+ }
2472
+ selectCoursesTypesByPlan(coursesTypes) {
2473
+ if (coursesTypes !== 'Tipo de plan') {
2474
+ this.codFormStepOne.controls['course_type'].setValue(coursesTypes);
2475
+ this.getAvailibleCourses();
2476
+ }
2477
+ else {
2478
+ this.codFormStepOne.controls['course_type'].setValue(null);
2479
+ }
2480
+ }
2481
+ selectAgreementByCategory(agreementByCategories) {
2482
+ if (agreementByCategories !== 'Convenio por categoria') {
2483
+ this.codFormStepOne.controls['agreement_by_category'].setValue(agreementByCategories);
2484
+ this.communicatorService.setCurrentAgreement(agreementByCategories);
2485
+ this.getAvailibleCourses();
2486
+ }
2487
+ else {
2488
+ this.codFormStepOne.controls['agreement_by_category'].setValue(null);
2489
+ this.codFormStepOne.controls['school_name'].setValue(null);
2490
+ }
2491
+ }
2492
+ selectLevel(levels) {
2493
+ if (levels !== 'Nivel de inglés') {
2494
+ this.codFormStepOne.controls['english_level'].setValue(levels);
2495
+ this.getAvailibleCourses();
2496
+ }
2497
+ else {
2498
+ this.codFormStepOne.controls['english_level'].setValue(null);
2499
+ }
2500
+ }
2501
+ selectAvailibleCourses(availibleCourses) {
2502
+ if (availibleCourses !== 'Grupos disponibles') {
2503
+ this.codFormStepOne.controls['availible_courses'].setValue(availibleCourses);
2504
+ }
2505
+ else {
2506
+ this.codFormStepOne.controls['availible_courses'].setValue(null);
2507
+ this.codFormStepOne.controls['agreement_by_category'].setValue(null);
2508
+ this.codFormStepOne.controls['course_type'].setValue(null);
2509
+ this.codFormStepOne.controls['english_level'].setValue(null);
2510
+ }
2511
+ }
2512
+ validRequest() {
2513
+ return (this.codFormStepOne.controls['english_level'].value != '' &&
2514
+ this.codFormStepOne.controls['agreement_by_category'].value != '' &&
2515
+ this.codFormStepOne.controls['course_type'].value != '');
2516
+ }
2517
+ getAvailibleCourses() {
2518
+ this.availibleCourses = [];
2519
+ if (this.validRequest()) {
2520
+ let request_availibleCourses = {
2521
+ token: this.baseService.getUserToken(),
2522
+ english_level: this.codFormStepOne.controls['english_level'].value,
2523
+ agreement: this.codFormStepOne.controls['agreement_by_category'].value,
2524
+ course_type: this.codFormStepOne.controls['course_type'].value,
2525
+ };
2526
+ this.courseService
2527
+ .getAvailibleCourses(request_availibleCourses)
2528
+ .subscribe((response) => {
2529
+ if (response.data) {
2530
+ let courses = response.data;
2531
+ this.hasAvailableCourse = true;
2532
+ courses.forEach(course => {
2533
+ this.availibleCourses.push({
2534
+ code: course.code,
2535
+ name: `Curso ${course.modality === 1 ? 'Presencial' : 'Virtual'} ${course.course_type.name} (${course.english_level}) - Teacher ${course.teacher}, Fecha de inicio: ${course.to_start}`
2536
+ });
2537
+ });
2538
+ }
2539
+ else {
2540
+ this.hasAvailableCourse = false;
2541
+ this.codFormStepOne.controls['availible_courses'].setValue("");
2542
+ }
2543
+ });
2544
+ }
2545
+ }
2546
+ }
2547
+ CodFormStepOneComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CodFormStepOneComponent, deps: [{ token: i1$1.FormBuilder }, { token: ParameterService }, { token: CopiesService }, { token: BaseService }, { token: CourseService }, { token: CommunicatorService }], target: i0.ɵɵFactoryTarget.Component });
2548
+ CodFormStepOneComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: CodFormStepOneComponent, selector: "app-cod-form-step-one", outputs: { changeStepEvent: "changeStepEvent" }, usesInheritance: true, ngImport: i0, template: "<form [formGroup]=\"codFormStepOne\" class=\"grid\">\r\n <div class=\"col\">\r\n <ipt-select\r\n [initialValue]=\"codFormStepOne.controls['academic_plan'].value\"\r\n [selectCode]=\"codFormStepOne.controls['academic_plan'].value === null? 'Plan': codFormStepOne.controls['academic_plan'].value\"\r\n [defaultText]=\"'Plan'\"\r\n [isRequired]=\"true\"\r\n (eventSelect)=\"selectAcademicPlan($event)\"\r\n [data]=\"plans\"\r\n [control]=\"codFormStepOne.controls['academic_plan']\"\r\n ></ipt-select>\r\n <ipt-select\r\n [initialValue]=\"codFormStepOne.controls['course_type'].value\"\r\n [selectCode]=\"codFormStepOne.controls['course_type'].value === null? 'Tipo de plan': codFormStepOne.controls['course_type'].value\"\r\n [defaultText]=\"'Tipo de plan'\"\r\n [isRequired]=\"true\"\r\n (eventSelect)=\"selectCoursesTypesByPlan($event)\"\r\n [data]=\"course_type\"\r\n [control]=\"codFormStepOne.controls['course_type']\"\r\n ></ipt-select>\r\n </div>\r\n <div class=\"col\">\r\n <ipt-select\r\n [initialValue]=\"codFormStepOne.controls['agreement_by_category'].value\"\r\n [selectCode]=\"codFormStepOne.controls['agreement_by_category'].value === null? 'Convenio por categoria': codFormStepOne.controls['agreement_by_category'].value\"\r\n [defaultText]=\"'Convenio por categoria'\"\r\n [isRequired]=\"true\"\r\n (eventSelect)=\"selectAgreementByCategory($event)\"\r\n [data]=\"agreements\"\r\n [control]=\"codFormStepOne.controls['agreement_by_category']\"\r\n ></ipt-select>\r\n <ipt-select\r\n [initialValue]=\"codFormStepOne.controls['english_level'].value\"\r\n [selectCode]=\"codFormStepOne.controls['english_level'].value === null? 'Nivel de ingl\u00E9s': codFormStepOne.controls['english_level'].value\"\r\n [defaultText]=\"'Nivel de ingl\u00E9s'\"\r\n [isRequired]=\"true\"\r\n (eventSelect)=\"selectLevel($event)\"\r\n [data]=\"levels\"\r\n [control]=\"codFormStepOne.controls['english_level']\"\r\n ></ipt-select>\r\n </div>\r\n <div class=\"col-12\">\r\n <ipt-select\r\n [initialValue]=\"codFormStepOne.controls['availible_courses'].value\"\r\n [selectCode]=\"codFormStepOne.controls['availible_courses'].value === null? 'Grupos disponibles': codFormStepOne.controls['availible_courses'].value\"\r\n [defaultText]=\"'Grupos disponibles'\"\r\n [isRequired]=\"true\"\r\n (eventSelect)=\"selectAvailibleCourses($event)\"\r\n [data]=\"availibleCourses\"\r\n [control]=\"codFormStepOne.controls['availible_courses']\"\r\n ></ipt-select>\r\n </div>\r\n <span *ngIf=\"!hasAvailableCourse\" class=\"mt-1 pl-2 text-red-500\">Todavia no hay cursos con estas caracter\u00EDsticas.</span>\r\n</form>\r\n\r\n<div class=\"flex mt-2 align-items-center gap-3\">\r\n <span *ngIf=\"codFormStepOne.invalid && codFormStepOne.touched\" class=\"text-red-500 font-bold text-center mt-1 py-2 bg-red-100 w-full border-round-xl\">Faltan campos por llenar.</span>\r\n <button type=\"submit\" class=\"ml-auto p-button-sm\" (click)=\"sendForm()\" pButton label=\"Siguiente\" icon=\"pi pi-arrow-right\"></button>\r\n</div>\r\n", styles: [""], components: [{ type: SelectComponent, selector: "ipt-select", inputs: ["isRequired", "data", "defaultText", "selectCode", "disabledSel", "initialValue", "control"], outputs: ["eventSelect"] }], directives: [{ type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }] });
2549
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CodFormStepOneComponent, decorators: [{
2550
+ type: Component,
2551
+ args: [{ selector: 'app-cod-form-step-one', template: "<form [formGroup]=\"codFormStepOne\" class=\"grid\">\r\n <div class=\"col\">\r\n <ipt-select\r\n [initialValue]=\"codFormStepOne.controls['academic_plan'].value\"\r\n [selectCode]=\"codFormStepOne.controls['academic_plan'].value === null? 'Plan': codFormStepOne.controls['academic_plan'].value\"\r\n [defaultText]=\"'Plan'\"\r\n [isRequired]=\"true\"\r\n (eventSelect)=\"selectAcademicPlan($event)\"\r\n [data]=\"plans\"\r\n [control]=\"codFormStepOne.controls['academic_plan']\"\r\n ></ipt-select>\r\n <ipt-select\r\n [initialValue]=\"codFormStepOne.controls['course_type'].value\"\r\n [selectCode]=\"codFormStepOne.controls['course_type'].value === null? 'Tipo de plan': codFormStepOne.controls['course_type'].value\"\r\n [defaultText]=\"'Tipo de plan'\"\r\n [isRequired]=\"true\"\r\n (eventSelect)=\"selectCoursesTypesByPlan($event)\"\r\n [data]=\"course_type\"\r\n [control]=\"codFormStepOne.controls['course_type']\"\r\n ></ipt-select>\r\n </div>\r\n <div class=\"col\">\r\n <ipt-select\r\n [initialValue]=\"codFormStepOne.controls['agreement_by_category'].value\"\r\n [selectCode]=\"codFormStepOne.controls['agreement_by_category'].value === null? 'Convenio por categoria': codFormStepOne.controls['agreement_by_category'].value\"\r\n [defaultText]=\"'Convenio por categoria'\"\r\n [isRequired]=\"true\"\r\n (eventSelect)=\"selectAgreementByCategory($event)\"\r\n [data]=\"agreements\"\r\n [control]=\"codFormStepOne.controls['agreement_by_category']\"\r\n ></ipt-select>\r\n <ipt-select\r\n [initialValue]=\"codFormStepOne.controls['english_level'].value\"\r\n [selectCode]=\"codFormStepOne.controls['english_level'].value === null? 'Nivel de ingl\u00E9s': codFormStepOne.controls['english_level'].value\"\r\n [defaultText]=\"'Nivel de ingl\u00E9s'\"\r\n [isRequired]=\"true\"\r\n (eventSelect)=\"selectLevel($event)\"\r\n [data]=\"levels\"\r\n [control]=\"codFormStepOne.controls['english_level']\"\r\n ></ipt-select>\r\n </div>\r\n <div class=\"col-12\">\r\n <ipt-select\r\n [initialValue]=\"codFormStepOne.controls['availible_courses'].value\"\r\n [selectCode]=\"codFormStepOne.controls['availible_courses'].value === null? 'Grupos disponibles': codFormStepOne.controls['availible_courses'].value\"\r\n [defaultText]=\"'Grupos disponibles'\"\r\n [isRequired]=\"true\"\r\n (eventSelect)=\"selectAvailibleCourses($event)\"\r\n [data]=\"availibleCourses\"\r\n [control]=\"codFormStepOne.controls['availible_courses']\"\r\n ></ipt-select>\r\n </div>\r\n <span *ngIf=\"!hasAvailableCourse\" class=\"mt-1 pl-2 text-red-500\">Todavia no hay cursos con estas caracter\u00EDsticas.</span>\r\n</form>\r\n\r\n<div class=\"flex mt-2 align-items-center gap-3\">\r\n <span *ngIf=\"codFormStepOne.invalid && codFormStepOne.touched\" class=\"text-red-500 font-bold text-center mt-1 py-2 bg-red-100 w-full border-round-xl\">Faltan campos por llenar.</span>\r\n <button type=\"submit\" class=\"ml-auto p-button-sm\" (click)=\"sendForm()\" pButton label=\"Siguiente\" icon=\"pi pi-arrow-right\"></button>\r\n</div>\r\n", styles: [""] }]
2552
+ }], ctorParameters: function () { return [{ type: i1$1.FormBuilder }, { type: ParameterService }, { type: CopiesService }, { type: BaseService }, { type: CourseService }, { type: CommunicatorService }]; }, propDecorators: { changeStepEvent: [{
2553
+ type: Output
2554
+ }] } });
2555
+
2556
+ class CodFormStepTwoComponent extends CodFormSteps {
2557
+ constructor(fb, parameterService) {
2558
+ super();
2559
+ this.fb = fb;
2560
+ this.parameterService = parameterService;
2561
+ this.changeStepEvent = new EventEmitter();
2562
+ this.errorMessage = 'Faltan campos por llenar.';
2563
+ this.hasErrors = false;
2564
+ this.genders = [];
2565
+ // Controls del formulario
2566
+ this.controls = new CodFormControls().controls[1];
2567
+ }
2568
+ ngOnInit() {
2569
+ this.getParameters();
2570
+ this.initForm();
2571
+ this.startLocalStorageWork();
2572
+ this.validateErrors();
2573
+ if (this.initialData)
2574
+ this.setDataFromPreviusCod();
2575
+ this.selectCountry(this.localStorageCOD.getCodFormData(2, 'country'));
2576
+ }
2577
+ setDataFromPreviusCod() {
2578
+ this.codFormStepTwo.controls['student_name'].setValue(this.initialData.name);
2579
+ this.codFormStepTwo.controls['student_last_name'].setValue(this.initialData.last_name);
2580
+ this.codFormStepTwo.controls['student_id_card_type'].setValue(this.initialData.id_card_type);
2581
+ this.codFormStepTwo.controls['student_id_card'].setValue(this.initialData.id_card);
2582
+ this.codFormStepTwo.controls['student_phone_indicative'].setValue(this.initialData.phone_indicative);
2583
+ this.codFormStepTwo.controls['student_phone_number'].setValue(this.initialData.phone_number);
2584
+ this.codFormStepTwo.controls['birthdate'].setValue(this.initialData.birthdate);
2585
+ }
2586
+ validateErrors() {
2587
+ this.codFormStepTwo.valueChanges.subscribe(changes => {
2588
+ if (this.codFormStepTwo.controls['student_name'].hasError('minlength')) {
2589
+ this.errorMessage = 'Los nombres deben tener mínimo 3 caracteres';
2590
+ }
2591
+ else if (this.codFormStepTwo.controls['student_last_name'].hasError('minlength')) {
2592
+ this.errorMessage = 'Los apellidos deben tener mínimo 5 caracteres';
2593
+ }
2594
+ else if (this.codFormStepTwo.controls['password'].hasError('minlength')) {
2595
+ this.errorMessage = 'La contraseña debe tener mínimo 6 caracteres';
2596
+ }
2597
+ else if (this.codFormStepTwo.controls['password'].value !== this.codFormStepTwo.controls['re_password'].value) {
2598
+ this.errorMessage = 'Las contraseñas no coinciden';
2599
+ }
2600
+ else if (this.codFormStepTwo.controls['age'].errors) {
2601
+ this.errorMessage = 'Fecha de nacimiento no válida';
2602
+ }
2603
+ else {
2604
+ this.errorMessage = 'Faltan campos por llenar';
2605
+ }
2606
+ });
2607
+ }
2608
+ startLocalStorageWork() {
2609
+ this.controls.forEach(control => {
2610
+ let localStorageValue = this.readAndWriteLS(2, control.name);
2611
+ this.codFormStepTwo.controls[control.name].setValue(localStorageValue.value);
2612
+ this.listenFormChanges(2, control.name, this.codFormStepTwo.controls[control.name].valueChanges);
2613
+ });
2614
+ }
2615
+ initForm() {
2616
+ this.codFormStepTwo = this.fb.group({
2617
+ student_address: ['', [Validators.required], []],
2618
+ birthdate: ['', [Validators.required], []],
2619
+ country: ['', [Validators.required], []],
2620
+ state: ['', [Validators.required], []],
2621
+ city: ['', [Validators.required], []],
2622
+ student_id_card_type: ['', [Validators.required], []],
2623
+ student_id_card: ['', [Validators.required, Validators.minLength(5), Validators.maxLength(20)]],
2624
+ student_last_name: ['', [Validators.required, Validators.minLength(5), Validators.maxLength(32)]],
2625
+ student_name: ['', [Validators.required, Validators.minLength(3), Validators.maxLength(32)]],
2626
+ student_email: ['', [Validators.required, Validators.email]],
2627
+ nickname: ['', [Validators.required]],
2628
+ gender: ['', [Validators.required]],
2629
+ age: ['', [Validators.required], []],
2630
+ student_occupation: ['', [Validators.required]],
2631
+ stratum: ['', [Validators.required]],
2632
+ grade: ['', [Validators.required]],
2633
+ civil_status: ['', [Validators.required]],
2634
+ student_phone_indicative: ['', [Validators.required], []],
2635
+ student_phone_number: ['', [Validators.required, Validators.minLength(10), Validators.maxLength(15)]],
2636
+ password: ['', [Validators.required, Validators.minLength(6)]],
2637
+ re_password: ['', [Validators.required, Validators.minLength(6)]],
2638
+ });
2639
+ // Calcular edad y setear valor
2640
+ this.codFormStepTwo.controls['birthdate'].valueChanges.subscribe({
2641
+ next: (change) => {
2642
+ let today = new Date();
2643
+ let birthday = new Date(change);
2644
+ let age = today.getFullYear() - birthday.getFullYear();
2645
+ let month = today.getMonth() - birthday.getMonth();
2646
+ if (month < 0 || (month === 0 && today.getDate() < birthday.getDate())) {
2647
+ age--;
2648
+ }
2649
+ if (age < 3) {
2650
+ this.errorMessage = 'Fecha de nacimiento no válida';
2651
+ this.codFormStepTwo.controls['birthdate'].setErrors({
2652
+ invalidAge: true
2653
+ });
2654
+ }
2655
+ else {
2656
+ this.codFormStepTwo.controls['birthdate'].setErrors(null);
2657
+ }
2658
+ this.codFormStepTwo.controls['age'].setValue(age);
2659
+ }
2660
+ });
2661
+ }
2662
+ getParameters() {
2663
+ this.parameterService.getCardTypes('col').subscribe((response) => {
2664
+ this.idTypes = response.data;
2665
+ });
2666
+ this.parameterService.getIndicatives().subscribe((response) => {
2667
+ this.indicatives = response.data;
2668
+ });
2669
+ this.parameterService.getCountries().subscribe((response) => {
2670
+ this.countries = response.data;
2671
+ });
2672
+ this.parameterService.getStratums().subscribe((response) => {
2673
+ this.stratums = response.data;
2674
+ });
2675
+ this.parameterService.getCivilStatus().subscribe((response) => {
2676
+ this.civilStatus = response.data;
2677
+ });
2678
+ this.parameterService.getGenders().pipe(map((response) => response.data))
2679
+ .subscribe((genders) => {
2680
+ genders.forEach(gender => {
2681
+ let genderItem = {
2682
+ code: gender.code,
2683
+ name: gender.name_spanish
2684
+ };
2685
+ this.genders.push(genderItem);
2686
+ });
2687
+ });
2688
+ }
2689
+ sendForm() {
2690
+ this.codFormStepTwo.markAllAsTouched();
2691
+ if (this.codFormStepTwo.invalid)
2692
+ return;
2693
+ // Movernos al paso 3
2694
+ this.changeStepEvent.emit(2);
2695
+ }
2696
+ getState(state) {
2697
+ this.getCity(state);
2698
+ }
2699
+ getCity(state) {
2700
+ this.parameterService.getCitiesByState(state).subscribe((response) => {
2701
+ this.cities = response.data;
2702
+ this.selectCity(this.localStorageCOD.getCodFormData(2, 'city'));
2703
+ });
2704
+ }
2705
+ // Eventos de los select
2706
+ selectCountry(country) {
2707
+ if (country !== 'País de residencia') {
2708
+ this.codFormStepTwo.controls['country'].setValue(country);
2709
+ let iso = '';
2710
+ if (country === '1')
2711
+ iso = 'null';
2712
+ if (country === '2')
2713
+ iso = 'col';
2714
+ if (country === '3')
2715
+ iso = 'ven';
2716
+ if (country === '4')
2717
+ iso = 'usa';
2718
+ this.parameterService.getStatesByCountry(iso).subscribe((response) => {
2719
+ this.states = response.data;
2720
+ this.selectState(this.localStorageCOD.getCodFormData(2, 'state'));
2721
+ });
2722
+ }
2723
+ else {
2724
+ this.codFormStepTwo.controls['country'].setValue(null);
2725
+ }
2726
+ this.countrySelected = country;
2727
+ }
2728
+ selectState(state) {
2729
+ if (state !== 'Departamento o estado') {
2730
+ this.codFormStepTwo.controls['state'].setValue(state);
2731
+ this.getState(state);
2732
+ }
2733
+ else {
2734
+ this.codFormStepTwo.controls['state'].setValue(null);
2735
+ this.codFormStepTwo.controls['city'].setValue(null);
2736
+ this.cities = [];
2737
+ }
2738
+ }
2739
+ selectCity(city) {
2740
+ if (city !== 'Ciudad de residencia') {
2741
+ this.codFormStepTwo.controls['city'].setValue(city);
2742
+ }
2743
+ else {
2744
+ this.codFormStepTwo.controls['city'].setValue(null);
2745
+ }
2746
+ }
2747
+ selectIdType(idType) {
2748
+ if (idType !== 'Tipo de documento') {
2749
+ this.codFormStepTwo.controls['student_id_card_type'].setValue(idType);
2750
+ }
2751
+ else {
2752
+ this.codFormStepTwo.controls['student_id_card_type'].setValue(null);
2753
+ }
2754
+ }
2755
+ selectIndicatives(indicative) {
2756
+ if (indicative !== 'Indicativo') {
2757
+ this.codFormStepTwo.controls['student_phone_indicative'].setValue(indicative);
2758
+ }
2759
+ else {
2760
+ this.codFormStepTwo.controls['student_phone_indicative'].setValue(null);
2761
+ }
2762
+ }
2763
+ selectGender(gender) {
2764
+ if (gender !== 'Género') {
2765
+ this.codFormStepTwo.controls['gender'].setValue(gender);
2766
+ }
2767
+ else {
2768
+ this.codFormStepTwo.controls['gender'].setValue(null);
2769
+ }
2770
+ }
2771
+ selectStratum(stratum) {
2772
+ if (stratum !== 'Estrato') {
2773
+ this.codFormStepTwo.controls['stratum'].setValue(stratum);
2774
+ }
2775
+ else {
2776
+ this.codFormStepTwo.controls['stratum'].setValue(null);
2777
+ }
2778
+ }
2779
+ selectCivilStatus(civil_status) {
2780
+ if (civil_status !== 'Estado civil') {
2781
+ this.codFormStepTwo.controls['civil_status'].setValue(civil_status);
2782
+ }
2783
+ else {
2784
+ this.codFormStepTwo.controls['civil_status'].setValue(null);
2785
+ }
2786
+ }
2787
+ }
2788
+ CodFormStepTwoComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CodFormStepTwoComponent, deps: [{ token: i1$1.FormBuilder }, { token: ParameterService }], target: i0.ɵɵFactoryTarget.Component });
2789
+ CodFormStepTwoComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: CodFormStepTwoComponent, selector: "app-cod-form-step-two", inputs: { initialData: "initialData" }, outputs: { changeStepEvent: "changeStepEvent" }, usesInheritance: true, ngImport: i0, template: "<form autocomplete=\"off\" [formGroup]=\"codFormStepTwo\" class=\"grid\">\r\n\r\n <div class=\"col\">\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Nombres'\"\r\n [control]=\"codFormStepTwo.controls['student_name']\"\r\n ></ipt-input>\r\n <ipt-select\r\n [initialValue]=\"codFormStepTwo.controls['student_id_card_type'].value\"\r\n [control]=\"codFormStepTwo.controls['student_id_card_type']\"\r\n [selectCode]=\"codFormStepTwo.controls['student_id_card_type'].value === null ? 'Tipo de documento' : codFormStepTwo.controls['student_id_card_type'].value\"\r\n [isRequired]=\"true\"\r\n [data]=\"idTypes\"\r\n (eventSelect)=\"selectIdType($event)\"\r\n [defaultText]=\"'Tipo de documento'\"\r\n ></ipt-select>\r\n <ipt-select\r\n [initialValue]=\"codFormStepTwo.controls['country'].value\"\r\n [control]=\"codFormStepTwo.controls['country']\"\r\n [selectCode]=\"codFormStepTwo.controls['country'].value === null ? 'Pa\u00EDs de residencia' : codFormStepTwo.controls['country'].value\"\r\n (eventSelect)=\"selectCountry($event)\"\r\n [data]=\"countries\"\r\n [defaultText]=\"'Pa\u00EDs de residencia'\"\r\n ></ipt-select>\r\n <ipt-select\r\n [initialValue]=\"codFormStepTwo.controls['city'].value\"\r\n [control]=\"codFormStepTwo.controls['city']\"\r\n [selectCode]=\"codFormStepTwo.controls['city'].value === null ? 'Ciudad de residencia' : codFormStepTwo.controls['city'].value\"\r\n (eventSelect)=\"selectCity($event)\"\r\n [data]=\"cities\"\r\n [defaultText]=\"'Ciudad de residencia'\"\r\n ></ipt-select>\r\n <ipt-input\r\n onfocus=\"(this.type='date')\"\r\n [inputType]=\"'date'\"\r\n [control]=\"codFormStepTwo.controls['birthdate']\"\r\n [placeHolder]=\"'Fecha de nacimiento'\"\r\n ></ipt-input>\r\n <ipt-select\r\n [initialValue]=\"codFormStepTwo.controls['gender'].value\"\r\n [control]=\"codFormStepTwo.controls['gender']\"\r\n [data]=\"genders\"\r\n (eventSelect)=\"selectGender($event)\"\r\n [defaultText]=\"'G\u00E9nero'\"\r\n ></ipt-select>\r\n <ipt-select\r\n [initialValue]=\"codFormStepTwo.controls['stratum'].value\"\r\n [control]=\"codFormStepTwo.controls['stratum']\"\r\n [data]=\"stratums\"\r\n (eventSelect)=\"selectStratum($event)\"\r\n [defaultText]=\"'Estrato'\"\r\n ></ipt-select>\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Grado'\"\r\n [control]=\"codFormStepTwo.controls['grade']\"\r\n ></ipt-input>\r\n <ipt-select\r\n [initialValue]=\"codFormStepTwo.controls['student_phone_indicative'].value\"\r\n [control]=\"codFormStepTwo.controls['student_phone_indicative']\"\r\n [data]=\"indicatives\"\r\n (eventSelect)=\"selectIndicatives($event)\"\r\n [defaultText]=\"'Indicativo'\"\r\n ></ipt-select>\r\n <ipt-input\r\n [inputType]=\"'email'\"\r\n [placeHolder]=\"'Correo electr\u00F3nico'\"\r\n [control]=\"codFormStepTwo.controls['student_email']\"\r\n ></ipt-input>\r\n <ipt-input\r\n [inputType]=\"'password'\"\r\n [placeHolder]=\"'Repetir contrase\u00F1a'\"\r\n [control]=\"codFormStepTwo.controls['re_password']\"\r\n ></ipt-input>\r\n </div>\r\n\r\n <div class=\"col\">\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Apellidos'\"\r\n [control]=\"codFormStepTwo.controls['student_last_name']\"\r\n ></ipt-input>\r\n <ipt-input\r\n [inputType]=\"'number'\"\r\n [placeHolder]=\"'N\u00FAmero de documento'\"\r\n [control]=\"codFormStepTwo.controls['student_id_card']\"\r\n ></ipt-input>\r\n <ipt-select\r\n [initialValue]=\"codFormStepTwo.controls['state'].value\"\r\n [control]=\"codFormStepTwo.controls['state']\"\r\n [selectCode]=\"codFormStepTwo.controls['state'].value === null ? 'Departamento o estado' : codFormStepTwo.controls['state'].value\"\r\n [isRequired]=\"true\"\r\n (eventSelect)=\"selectState($event)\"\r\n [data]=\"states\"\r\n [defaultText]=\"'Departamento o estado'\"\r\n ></ipt-select>\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Direcci\u00F3n'\"\r\n [control]=\"codFormStepTwo.controls['student_address']\"\r\n ></ipt-input>\r\n <ipt-input\r\n [inputType]=\"'number'\"\r\n [placeHolder]=\"'Edad'\"\r\n [control]=\"codFormStepTwo.controls['age']\"\r\n ></ipt-input>\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Nickname'\"\r\n [control]=\"codFormStepTwo.controls['nickname']\"\r\n ></ipt-input>\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Ocupaci\u00F3n'\"\r\n [control]=\"codFormStepTwo.controls['student_occupation']\"\r\n ></ipt-input>\r\n <ipt-select\r\n [initialValue]=\"codFormStepTwo.controls['civil_status'].value\"\r\n [control]=\"codFormStepTwo.controls['civil_status']\"\r\n [data]=\"civilStatus\"\r\n (eventSelect)=\"selectCivilStatus($event)\"\r\n [defaultText]=\"'Estado civil'\"\r\n ></ipt-select>\r\n <ipt-input\r\n [inputType]=\"'number'\"\r\n [placeHolder]=\"'N\u00FAmero de tel\u00E9fono'\"\r\n [control]=\"codFormStepTwo.controls['student_phone_number']\"\r\n ></ipt-input>\r\n <ipt-input\r\n [inputType]=\"'password'\"\r\n [placeHolder]=\"'Contrase\u00F1a'\"\r\n [control]=\"codFormStepTwo.controls['password']\"\r\n ></ipt-input>\r\n </div>\r\n\r\n <div class=\"col-12\"></div>\r\n\r\n</form>\r\n\r\n<div class=\"flex mt-3 align-items-center gap-3\">\r\n <span *ngIf=\"codFormStepTwo.invalid && codFormStepTwo.touched\" class=\"text-red-500 font-bold text-center mt-1 py-2 bg-red-100 w-full border-round-xl\">{{ errorMessage }}</span>\r\n <button type=\"submit\" class=\"ml-auto p-button-sm\" (click)=\"sendForm()\" pButton label=\"Siguiente\" icon=\"pi pi-arrow-right\"></button>\r\n</div>\r\n", styles: [""], components: [{ type: InputComponent, selector: "ipt-input", inputs: ["inputType", "placeHolder", "validateText", "withPipe", "list", "iconUrl", "control", "prefix", "thousands", "decimal"], outputs: ["dateSelected"] }, { type: SelectComponent, selector: "ipt-select", inputs: ["isRequired", "data", "defaultText", "selectCode", "disabledSel", "initialValue", "control"], outputs: ["eventSelect"] }], directives: [{ type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }] });
2790
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CodFormStepTwoComponent, decorators: [{
2791
+ type: Component,
2792
+ args: [{ selector: 'app-cod-form-step-two', template: "<form autocomplete=\"off\" [formGroup]=\"codFormStepTwo\" class=\"grid\">\r\n\r\n <div class=\"col\">\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Nombres'\"\r\n [control]=\"codFormStepTwo.controls['student_name']\"\r\n ></ipt-input>\r\n <ipt-select\r\n [initialValue]=\"codFormStepTwo.controls['student_id_card_type'].value\"\r\n [control]=\"codFormStepTwo.controls['student_id_card_type']\"\r\n [selectCode]=\"codFormStepTwo.controls['student_id_card_type'].value === null ? 'Tipo de documento' : codFormStepTwo.controls['student_id_card_type'].value\"\r\n [isRequired]=\"true\"\r\n [data]=\"idTypes\"\r\n (eventSelect)=\"selectIdType($event)\"\r\n [defaultText]=\"'Tipo de documento'\"\r\n ></ipt-select>\r\n <ipt-select\r\n [initialValue]=\"codFormStepTwo.controls['country'].value\"\r\n [control]=\"codFormStepTwo.controls['country']\"\r\n [selectCode]=\"codFormStepTwo.controls['country'].value === null ? 'Pa\u00EDs de residencia' : codFormStepTwo.controls['country'].value\"\r\n (eventSelect)=\"selectCountry($event)\"\r\n [data]=\"countries\"\r\n [defaultText]=\"'Pa\u00EDs de residencia'\"\r\n ></ipt-select>\r\n <ipt-select\r\n [initialValue]=\"codFormStepTwo.controls['city'].value\"\r\n [control]=\"codFormStepTwo.controls['city']\"\r\n [selectCode]=\"codFormStepTwo.controls['city'].value === null ? 'Ciudad de residencia' : codFormStepTwo.controls['city'].value\"\r\n (eventSelect)=\"selectCity($event)\"\r\n [data]=\"cities\"\r\n [defaultText]=\"'Ciudad de residencia'\"\r\n ></ipt-select>\r\n <ipt-input\r\n onfocus=\"(this.type='date')\"\r\n [inputType]=\"'date'\"\r\n [control]=\"codFormStepTwo.controls['birthdate']\"\r\n [placeHolder]=\"'Fecha de nacimiento'\"\r\n ></ipt-input>\r\n <ipt-select\r\n [initialValue]=\"codFormStepTwo.controls['gender'].value\"\r\n [control]=\"codFormStepTwo.controls['gender']\"\r\n [data]=\"genders\"\r\n (eventSelect)=\"selectGender($event)\"\r\n [defaultText]=\"'G\u00E9nero'\"\r\n ></ipt-select>\r\n <ipt-select\r\n [initialValue]=\"codFormStepTwo.controls['stratum'].value\"\r\n [control]=\"codFormStepTwo.controls['stratum']\"\r\n [data]=\"stratums\"\r\n (eventSelect)=\"selectStratum($event)\"\r\n [defaultText]=\"'Estrato'\"\r\n ></ipt-select>\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Grado'\"\r\n [control]=\"codFormStepTwo.controls['grade']\"\r\n ></ipt-input>\r\n <ipt-select\r\n [initialValue]=\"codFormStepTwo.controls['student_phone_indicative'].value\"\r\n [control]=\"codFormStepTwo.controls['student_phone_indicative']\"\r\n [data]=\"indicatives\"\r\n (eventSelect)=\"selectIndicatives($event)\"\r\n [defaultText]=\"'Indicativo'\"\r\n ></ipt-select>\r\n <ipt-input\r\n [inputType]=\"'email'\"\r\n [placeHolder]=\"'Correo electr\u00F3nico'\"\r\n [control]=\"codFormStepTwo.controls['student_email']\"\r\n ></ipt-input>\r\n <ipt-input\r\n [inputType]=\"'password'\"\r\n [placeHolder]=\"'Repetir contrase\u00F1a'\"\r\n [control]=\"codFormStepTwo.controls['re_password']\"\r\n ></ipt-input>\r\n </div>\r\n\r\n <div class=\"col\">\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Apellidos'\"\r\n [control]=\"codFormStepTwo.controls['student_last_name']\"\r\n ></ipt-input>\r\n <ipt-input\r\n [inputType]=\"'number'\"\r\n [placeHolder]=\"'N\u00FAmero de documento'\"\r\n [control]=\"codFormStepTwo.controls['student_id_card']\"\r\n ></ipt-input>\r\n <ipt-select\r\n [initialValue]=\"codFormStepTwo.controls['state'].value\"\r\n [control]=\"codFormStepTwo.controls['state']\"\r\n [selectCode]=\"codFormStepTwo.controls['state'].value === null ? 'Departamento o estado' : codFormStepTwo.controls['state'].value\"\r\n [isRequired]=\"true\"\r\n (eventSelect)=\"selectState($event)\"\r\n [data]=\"states\"\r\n [defaultText]=\"'Departamento o estado'\"\r\n ></ipt-select>\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Direcci\u00F3n'\"\r\n [control]=\"codFormStepTwo.controls['student_address']\"\r\n ></ipt-input>\r\n <ipt-input\r\n [inputType]=\"'number'\"\r\n [placeHolder]=\"'Edad'\"\r\n [control]=\"codFormStepTwo.controls['age']\"\r\n ></ipt-input>\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Nickname'\"\r\n [control]=\"codFormStepTwo.controls['nickname']\"\r\n ></ipt-input>\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Ocupaci\u00F3n'\"\r\n [control]=\"codFormStepTwo.controls['student_occupation']\"\r\n ></ipt-input>\r\n <ipt-select\r\n [initialValue]=\"codFormStepTwo.controls['civil_status'].value\"\r\n [control]=\"codFormStepTwo.controls['civil_status']\"\r\n [data]=\"civilStatus\"\r\n (eventSelect)=\"selectCivilStatus($event)\"\r\n [defaultText]=\"'Estado civil'\"\r\n ></ipt-select>\r\n <ipt-input\r\n [inputType]=\"'number'\"\r\n [placeHolder]=\"'N\u00FAmero de tel\u00E9fono'\"\r\n [control]=\"codFormStepTwo.controls['student_phone_number']\"\r\n ></ipt-input>\r\n <ipt-input\r\n [inputType]=\"'password'\"\r\n [placeHolder]=\"'Contrase\u00F1a'\"\r\n [control]=\"codFormStepTwo.controls['password']\"\r\n ></ipt-input>\r\n </div>\r\n\r\n <div class=\"col-12\"></div>\r\n\r\n</form>\r\n\r\n<div class=\"flex mt-3 align-items-center gap-3\">\r\n <span *ngIf=\"codFormStepTwo.invalid && codFormStepTwo.touched\" class=\"text-red-500 font-bold text-center mt-1 py-2 bg-red-100 w-full border-round-xl\">{{ errorMessage }}</span>\r\n <button type=\"submit\" class=\"ml-auto p-button-sm\" (click)=\"sendForm()\" pButton label=\"Siguiente\" icon=\"pi pi-arrow-right\"></button>\r\n</div>\r\n", styles: [""] }]
2793
+ }], ctorParameters: function () { return [{ type: i1$1.FormBuilder }, { type: ParameterService }]; }, propDecorators: { initialData: [{
2794
+ type: Input
2795
+ }], changeStepEvent: [{
2796
+ type: Output
2797
+ }] } });
2798
+
2799
+ class CodFormStepThreeComponent extends CodFormSteps {
2800
+ constructor(fb, parameterService, codFormControls) {
2801
+ super();
2802
+ this.fb = fb;
2803
+ this.parameterService = parameterService;
2804
+ this.codFormControls = codFormControls;
2805
+ this.changeStepEvent = new EventEmitter();
2806
+ this.globalControls = new CodFormControls();
2807
+ this.errorMessage = 'Faltan campos por llenar.';
2808
+ this.needAtendants = [
2809
+ { code: '1', name: 'Si requiere acudiente' },
2810
+ { code: '2', name: 'No requiere acudiente' },
2811
+ ];
2812
+ // Controls del formulario
2813
+ this.controls = new CodFormControls().controls[2];
2814
+ }
2815
+ ngOnInit() {
2816
+ this.getParameters();
2817
+ this.initForm();
2818
+ this.startLocalStorageWork();
2819
+ this.validateErrors();
2820
+ }
2821
+ validateErrors() {
2822
+ this.codFormStepThree.valueChanges.subscribe(changes => {
2823
+ if (this.codFormStepThree.controls['parent_name'].hasError('minlength')) {
2824
+ this.errorMessage = 'Los nombres deben tener mínimo 3 caracteres';
2825
+ }
2826
+ else if (this.codFormStepThree.controls['parent_last_name'].hasError('minlength')) {
2827
+ this.errorMessage = 'Los apellidos deben tener mínimo 5 caracteres';
2828
+ }
2829
+ else {
2830
+ this.errorMessage = 'Faltan campos por llenar';
2831
+ }
2832
+ });
2833
+ }
2834
+ startLocalStorageWork() {
2835
+ this.controls.forEach(control => {
2836
+ let localStorageValue = this.readAndWriteLS(3, control.name);
2837
+ this.codFormStepThree.controls[control.name].setValue(localStorageValue.value);
2838
+ this.listenFormChanges(3, control.name, this.codFormStepThree.controls[control.name].valueChanges);
2839
+ });
2840
+ }
2841
+ getParameters() {
2842
+ this.parameterService.getCardTypes('col').subscribe((response) => {
2843
+ this.idTypes = response.data;
2844
+ });
2845
+ this.parameterService.getIndicatives().subscribe((response) => {
2846
+ this.indicatives = response.data;
2847
+ });
2848
+ }
2849
+ initForm() {
2850
+ this.codFormStepThree = this.fb.group({
2851
+ parent_id_card_type: ['', [Validators.required]],
2852
+ parent_id_card: ['', [Validators.required, Validators.minLength(5), Validators.maxLength(20),],],
2853
+ parent_last_name: ['', [Validators.required, Validators.minLength(5), Validators.maxLength(32),],],
2854
+ parent_name: ['', [Validators.required, Validators.minLength(3), Validators.maxLength(32)],],
2855
+ needAtendant: ['', [Validators.required], []],
2856
+ parent_phone_indicative: ['', [Validators.required], []],
2857
+ parent_occupation: ['', [Validators.required], []],
2858
+ parent_address: ['', [Validators.required], []],
2859
+ parent_phone_number: ['', [Validators.required, Validators.minLength(10), Validators.maxLength(15),],],
2860
+ });
2861
+ this.listenNeedAtendantField();
2862
+ }
2863
+ listenNeedAtendantField() {
2864
+ const control = this.codFormStepThree.get('needAtendant');
2865
+ control?.valueChanges.subscribe((change) => {
2866
+ if (change === '1') {
2867
+ // Poner validaciones
2868
+ this.codFormStepThree.controls['parent_id_card_type'].setValidators([Validators.required]);
2869
+ this.codFormStepThree.controls['parent_id_card'].setValidators([Validators.required, Validators.minLength(5), Validators.maxLength(20)]);
2870
+ this.codFormStepThree.controls['parent_last_name'].setValidators([Validators.required, Validators.minLength(5), Validators.maxLength(32)]);
2871
+ this.codFormStepThree.controls['parent_name'].setValidators([Validators.required, Validators.minLength(3), Validators.maxLength(32)]);
2872
+ this.codFormStepThree.controls['parent_phone_indicative'].setValidators([Validators.required]);
2873
+ this.codFormStepThree.controls['parent_occupation'].setValidators([Validators.required]);
2874
+ this.codFormStepThree.controls['parent_address'].setValidators([Validators.required]);
2875
+ this.codFormStepThree.controls['parent_phone_number'].setValidators([Validators.required, Validators.minLength(10), Validators.maxLength(15)]);
2876
+ // Actualizar para que se tomen los cambios
2877
+ this.updateValueAndValidity();
2878
+ // Actualizar los controls globales
2879
+ this.updateGlobalControls(change);
2880
+ }
2881
+ if (change === '2') {
2882
+ // Quitar las validaciones
2883
+ this.codFormStepThree.controls['parent_id_card_type'].clearValidators();
2884
+ this.codFormStepThree.controls['parent_id_card'].clearValidators();
2885
+ this.codFormStepThree.controls['parent_last_name'].clearValidators();
2886
+ this.codFormStepThree.controls['parent_name'].clearValidators();
2887
+ this.codFormStepThree.controls['parent_phone_indicative'].clearValidators();
2888
+ this.codFormStepThree.controls['parent_occupation'].clearValidators();
2889
+ this.codFormStepThree.controls['parent_address'].clearValidators();
2890
+ this.codFormStepThree.controls['parent_phone_number'].clearValidators();
2891
+ // Actualizar para que se tomen los cambios
2892
+ this.updateValueAndValidity();
2893
+ // Actualizar los controls globales
2894
+ this.updateGlobalControls(change);
2895
+ }
2896
+ });
2897
+ }
2898
+ updateGlobalControls(change) {
2899
+ let controls = this.controls.filter(control => control.name !== 'needAtendant');
2900
+ controls.forEach(control => {
2901
+ if (change === '1')
2902
+ this.codFormControls.changeValue(3, control.name, true);
2903
+ if (change === '2')
2904
+ this.codFormControls.changeValue(3, control.name, false);
2905
+ });
2906
+ }
2907
+ updateValueAndValidity() {
2908
+ this.codFormStepThree.controls['parent_id_card_type'].updateValueAndValidity();
2909
+ this.codFormStepThree.controls['parent_id_card'].updateValueAndValidity();
2910
+ this.codFormStepThree.controls['parent_last_name'].updateValueAndValidity();
2911
+ this.codFormStepThree.controls['parent_name'].updateValueAndValidity();
2912
+ this.codFormStepThree.controls['parent_phone_indicative'].updateValueAndValidity();
2913
+ this.codFormStepThree.controls['parent_occupation'].updateValueAndValidity();
2914
+ this.codFormStepThree.controls['parent_address'].updateValueAndValidity();
2915
+ this.codFormStepThree.controls['parent_phone_number'].updateValueAndValidity();
2916
+ }
2917
+ needAtendant() {
2918
+ return this.codFormStepThree.controls['needAtendant'].value == 1;
2919
+ }
2920
+ sendForm() {
2921
+ this.codFormStepThree.markAllAsTouched();
2922
+ if (this.codFormStepThree.controls['needAtendant'].value === '1' && this.codFormStepThree.invalid)
2923
+ return;
2924
+ // Movernos al paso 4
2925
+ this.changeStepEvent.emit(3);
2926
+ }
2927
+ // Eventos de los select
2928
+ selectNeedAtendant(needAtendant) {
2929
+ if (needAtendant !== 'Requiere acudiente') {
2930
+ this.codFormStepThree.controls['needAtendant'].setValue(needAtendant);
2931
+ }
2932
+ else {
2933
+ this.codFormStepThree.controls['needAtendant'].setValue(null);
2934
+ }
2935
+ }
2936
+ selectIdTypeParents(value) {
2937
+ if (value !== 'Tipo de documento') {
2938
+ this.codFormStepThree.controls['parent_id_card_type'].setValue(value);
2939
+ }
2940
+ else {
2941
+ this.codFormStepThree.controls['parent_id_card_type'].setValue(null);
2942
+ }
2943
+ }
2944
+ selectIndicativesParents(value) {
2945
+ if (value !== 'Indicativo') {
2946
+ this.codFormStepThree.controls['parent_phone_indicative'].setValue(value);
2947
+ }
2948
+ else {
2949
+ this.codFormStepThree.controls['parent_phone_indicative'].setValue(null);
2950
+ }
2951
+ }
2952
+ }
2953
+ CodFormStepThreeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CodFormStepThreeComponent, deps: [{ token: i1$1.FormBuilder }, { token: ParameterService }, { token: CodFormControls }], target: i0.ɵɵFactoryTarget.Component });
2954
+ CodFormStepThreeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: CodFormStepThreeComponent, selector: "app-cod-form-step-three", outputs: { changeStepEvent: "changeStepEvent" }, usesInheritance: true, ngImport: i0, template: "<form autocomplete=\"off\" [formGroup]=\"codFormStepThree\"class=\"grid\">\r\n <div class=\"col-12\">\r\n <ipt-select\r\n [initialValue]=\"codFormStepThree.controls['needAtendant'].value\"\r\n [control]=\"codFormStepThree.controls['needAtendant']\"\r\n (eventSelect)=\"selectNeedAtendant($event)\"\r\n [data]=\"needAtendants\"\r\n [defaultText]=\"'Requiere acudiente'\"\r\n ></ipt-select>\r\n </div>\r\n\r\n <div *ngIf=\"needAtendant()\" class=\"grid col-12\">\r\n <div class=\"col-12 md:col-6\">\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Nombres'\"\r\n [control]=\"codFormStepThree.controls['parent_name']\"\r\n ></ipt-input>\r\n <ipt-select\r\n [initialValue]=\"codFormStepThree.controls['parent_id_card_type'].value\"\r\n [data]=\"idTypes\"\r\n (eventSelect)=\"selectIdTypeParents($event)\"\r\n [defaultText]=\"'Tipo de documento'\"\r\n [control]=\"codFormStepThree.controls['parent_id_card_type']\"\r\n ></ipt-select>\r\n <ipt-select\r\n [initialValue]=\"codFormStepThree.controls['parent_phone_indicative'].value\"\r\n [data]=\"indicatives\"\r\n (eventSelect)=\"selectIndicativesParents($event)\"\r\n [defaultText]=\"'Indicativo'\"\r\n [control]=\"codFormStepThree.controls['parent_phone_indicative']\"\r\n ></ipt-select>\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Ocupaci\u00F3n'\"\r\n [control]=\"codFormStepThree.controls['parent_occupation']\"\r\n ></ipt-input>\r\n </div>\r\n <div class=\"col-12 md:col-6\">\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Apellidos'\"\r\n [control]=\"codFormStepThree.controls['parent_last_name']\"\r\n ></ipt-input>\r\n <ipt-input\r\n [inputType]=\"'number'\"\r\n [placeHolder]=\"'N\u00FAmero de documento'\"\r\n [control]=\"codFormStepThree.controls['parent_id_card']\"\r\n ></ipt-input>\r\n <ipt-input\r\n [inputType]=\"'number'\"\r\n [placeHolder]=\"'N\u00FAmero de tel\u00E9fono'\"\r\n [control]=\"codFormStepThree.controls['parent_phone_number']\"\r\n ></ipt-input>\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Direcci\u00F3n - Oficina'\"\r\n [control]=\"codFormStepThree.controls['parent_address']\"\r\n ></ipt-input>\r\n </div>\r\n </div>\r\n</form>\r\n\r\n<div class=\"flex mt-3 align-items-center gap-3\">\r\n <span *ngIf=\"(codFormStepThree.invalid && codFormStepThree.touched) && needAtendant()\" class=\"text-red-500 font-bold text-center mt-1 py-2 bg-red-100 w-full border-round-xl\">{{ errorMessage }}</span>\r\n <button type=\"submit\" class=\"ml-auto p-button-sm\" (click)=\"sendForm()\" pButton label=\"Siguiente\" icon=\"pi pi-arrow-right\"></button>\r\n</div>\r\n", styles: [""], components: [{ type: SelectComponent, selector: "ipt-select", inputs: ["isRequired", "data", "defaultText", "selectCode", "disabledSel", "initialValue", "control"], outputs: ["eventSelect"] }, { type: InputComponent, selector: "ipt-input", inputs: ["inputType", "placeHolder", "validateText", "withPipe", "list", "iconUrl", "control", "prefix", "thousands", "decimal"], outputs: ["dateSelected"] }], directives: [{ type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }] });
2955
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CodFormStepThreeComponent, decorators: [{
2956
+ type: Component,
2957
+ args: [{ selector: 'app-cod-form-step-three', template: "<form autocomplete=\"off\" [formGroup]=\"codFormStepThree\"class=\"grid\">\r\n <div class=\"col-12\">\r\n <ipt-select\r\n [initialValue]=\"codFormStepThree.controls['needAtendant'].value\"\r\n [control]=\"codFormStepThree.controls['needAtendant']\"\r\n (eventSelect)=\"selectNeedAtendant($event)\"\r\n [data]=\"needAtendants\"\r\n [defaultText]=\"'Requiere acudiente'\"\r\n ></ipt-select>\r\n </div>\r\n\r\n <div *ngIf=\"needAtendant()\" class=\"grid col-12\">\r\n <div class=\"col-12 md:col-6\">\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Nombres'\"\r\n [control]=\"codFormStepThree.controls['parent_name']\"\r\n ></ipt-input>\r\n <ipt-select\r\n [initialValue]=\"codFormStepThree.controls['parent_id_card_type'].value\"\r\n [data]=\"idTypes\"\r\n (eventSelect)=\"selectIdTypeParents($event)\"\r\n [defaultText]=\"'Tipo de documento'\"\r\n [control]=\"codFormStepThree.controls['parent_id_card_type']\"\r\n ></ipt-select>\r\n <ipt-select\r\n [initialValue]=\"codFormStepThree.controls['parent_phone_indicative'].value\"\r\n [data]=\"indicatives\"\r\n (eventSelect)=\"selectIndicativesParents($event)\"\r\n [defaultText]=\"'Indicativo'\"\r\n [control]=\"codFormStepThree.controls['parent_phone_indicative']\"\r\n ></ipt-select>\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Ocupaci\u00F3n'\"\r\n [control]=\"codFormStepThree.controls['parent_occupation']\"\r\n ></ipt-input>\r\n </div>\r\n <div class=\"col-12 md:col-6\">\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Apellidos'\"\r\n [control]=\"codFormStepThree.controls['parent_last_name']\"\r\n ></ipt-input>\r\n <ipt-input\r\n [inputType]=\"'number'\"\r\n [placeHolder]=\"'N\u00FAmero de documento'\"\r\n [control]=\"codFormStepThree.controls['parent_id_card']\"\r\n ></ipt-input>\r\n <ipt-input\r\n [inputType]=\"'number'\"\r\n [placeHolder]=\"'N\u00FAmero de tel\u00E9fono'\"\r\n [control]=\"codFormStepThree.controls['parent_phone_number']\"\r\n ></ipt-input>\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Direcci\u00F3n - Oficina'\"\r\n [control]=\"codFormStepThree.controls['parent_address']\"\r\n ></ipt-input>\r\n </div>\r\n </div>\r\n</form>\r\n\r\n<div class=\"flex mt-3 align-items-center gap-3\">\r\n <span *ngIf=\"(codFormStepThree.invalid && codFormStepThree.touched) && needAtendant()\" class=\"text-red-500 font-bold text-center mt-1 py-2 bg-red-100 w-full border-round-xl\">{{ errorMessage }}</span>\r\n <button type=\"submit\" class=\"ml-auto p-button-sm\" (click)=\"sendForm()\" pButton label=\"Siguiente\" icon=\"pi pi-arrow-right\"></button>\r\n</div>\r\n", styles: [""] }]
2958
+ }], ctorParameters: function () { return [{ type: i1$1.FormBuilder }, { type: ParameterService }, { type: CodFormControls }]; }, propDecorators: { changeStepEvent: [{
2959
+ type: Output
2960
+ }] } });
2961
+
2962
+ class CalculateQuotesService {
2963
+ constructor() { }
2964
+ calculateQuotes(params) {
2965
+ let dataFinancing = [];
2966
+ let index = 1; // Indicador de cant. de cuotas
2967
+ let momentJs = moment(params.date).add('1', 'days');
2968
+ if (this.validateSunday(momentJs.toDate())) {
2969
+ Swal.fire({
2970
+ title: 'Fecha inválida',
2971
+ text: 'Debe seleccionar un día de la semana diferente al domingo',
2972
+ icon: 'error'
2973
+ });
2974
+ }
2975
+ else {
2976
+ let quota = [
2977
+ index,
2978
+ Intl.NumberFormat('en-US', {
2979
+ style: 'currency',
2980
+ currency: 'USD',
2981
+ minimumFractionDigits: 0
2982
+ }).format(Math.round(parseFloat(params.quotaValues.toString()))),
2983
+ momentJs.format('dddd') + ', ' + momentJs.format('MMMM DD YYYY')
2984
+ ];
2985
+ dataFinancing.push(quota);
2986
+ while (index < params.quotaTimes) {
2987
+ index = index + 1;
2988
+ const momentJs = moment(params.date).add(index - 1, 'M');
2989
+ if (this.validateSunday(momentJs.toDate())) {
2990
+ momentJs.add(1, 'days');
2991
+ Swal.fire({
2992
+ title: 'Querido asesor',
2993
+ text: 'Hemos ajustado las fechas para que no se asignen en Domingos',
2994
+ icon: 'info'
2995
+ });
2996
+ }
2997
+ let row = [
2998
+ index,
2999
+ Intl.NumberFormat('en-US', {
3000
+ style: 'currency',
3001
+ currency: 'USD',
3002
+ minimumFractionDigits: 0,
3003
+ }).format(Math.round(params.quotaValues)),
3004
+ momentJs.format('dddd') + ', ' + momentJs.format('MMMM DD YYYY'),
3005
+ ];
3006
+ dataFinancing.push(row);
3007
+ }
3008
+ }
3009
+ return dataFinancing;
3010
+ }
3011
+ validateSunday(date) {
3012
+ const momentJs = moment(date);
3013
+ if (momentJs.isoWeekday() === 7) {
3014
+ return true;
3015
+ }
3016
+ else {
3017
+ return false;
3018
+ }
3019
+ }
3020
+ }
3021
+ CalculateQuotesService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CalculateQuotesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3022
+ CalculateQuotesService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CalculateQuotesService, providedIn: 'root' });
3023
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CalculateQuotesService, decorators: [{
3024
+ type: Injectable,
3025
+ args: [{
3026
+ providedIn: 'root'
3027
+ }]
3028
+ }], ctorParameters: function () { return []; } });
3029
+
3030
+ class CodFormStepFourComponent extends CodFormSteps {
3031
+ constructor(fb, calculateQuotesService, communicatorService, parameterService, codFormControls, commercialService) {
3032
+ super();
3033
+ this.fb = fb;
3034
+ this.calculateQuotesService = calculateQuotesService;
3035
+ this.communicatorService = communicatorService;
3036
+ this.parameterService = parameterService;
3037
+ this.codFormControls = codFormControls;
3038
+ this.commercialService = commercialService;
3039
+ this.changeStepEvent = new EventEmitter();
3040
+ this.financingData = new EventEmitter();
3041
+ this.isCalculateQuotesButtonClicked = false;
3042
+ this.errorMessage = 'Faltan campos por llenar.';
3043
+ this.paymentMethods = [
3044
+ { code: '1', name: 'Financiado' },
3045
+ { code: '2', name: 'Contado' },
3046
+ ];
3047
+ this.dataFinancing = [];
3048
+ this.isFinancing = false;
3049
+ this.isSemestral = false;
3050
+ this.codPrices = [];
3051
+ // Controls del formulario
3052
+ this.controls = new CodFormControls().controls[3];
3053
+ }
3054
+ ngOnInit() {
3055
+ this.initForm();
3056
+ this.startLocalStorageWork();
3057
+ this.validateErrors();
3058
+ this.getCodPricesByAgreement();
3059
+ this.getValuesOfStepOneComponent();
3060
+ }
3061
+ getValuesOfStepOneComponent() {
3062
+ // Tipo de curso seleccionado
3063
+ this.communicatorService.getSelectedCourseType().subscribe(value => {
3064
+ this.parameterService.getCoursesTypes().pipe(map((response) => {
3065
+ const courseTypes = response.data;
3066
+ return courseTypes.filter(({ name }) => name.includes('Semestral'));
3067
+ }))
3068
+ .subscribe((courseTypes) => {
3069
+ for (let i = 0; i < courseTypes.length; i++) {
3070
+ if (courseTypes[i].code.toString() === value) {
3071
+ this.isSemestral = true;
3072
+ break;
3073
+ }
3074
+ else {
3075
+ this.isSemestral = false;
3076
+ }
3077
+ }
3078
+ });
3079
+ });
3080
+ // Convenio seleccionado
3081
+ this.communicatorService.getSelectedAgreement().subscribe(value => {
3082
+ this.getCodPricesByAgreement(value);
3083
+ });
3084
+ }
3085
+ getCodPricesByAgreement(agreement) {
3086
+ let agreementSelected;
3087
+ if (agreement) {
3088
+ agreementSelected = agreement;
3089
+ }
3090
+ else {
3091
+ agreementSelected = this.localStorageCOD.getCodFormData(1, 'agreement_by_category');
3092
+ }
3093
+ this.commercialService.getCodPricesByAgreement(Number(agreementSelected)).subscribe({
3094
+ next: (response) => {
3095
+ if (response.data) {
3096
+ const codPrices = response.data;
3097
+ this.codPrices = codPrices;
3098
+ if (this.codFormStepFour.controls['payment_method'].value === '2') {
3099
+ const aux = this.codPrices.filter(codPrice => codPrice.agreement === Number(agreementSelected))[0];
3100
+ this.codFormStepFour.controls['program_price'].setValue(aux.normal_price);
3101
+ }
3102
+ if (this.codFormStepFour.controls['payment_method'].value === '1') {
3103
+ const aux = this.codPrices.filter(codPrice => codPrice.agreement === Number(agreementSelected))[0];
3104
+ this.codFormStepFour.controls['quota_times'].setValue(aux.code);
3105
+ this.codFormStepFour.controls['program_price'].setValue(aux.normal_price);
3106
+ }
3107
+ }
3108
+ },
3109
+ error: (err) => console.log(err)
3110
+ });
3111
+ }
3112
+ validateErrors() {
3113
+ this.codFormStepFour.valueChanges.subscribe(changes => {
3114
+ if (this.codFormStepFour.controls['quota_times'].hasError('min')) {
3115
+ this.errorMessage = 'La cantidad de cuotas mínimas debe ser 1';
3116
+ }
3117
+ else if (this.codFormStepFour.controls['quota_times'].hasError('max')) {
3118
+ this.errorMessage = 'La cantidad de cuotas no debe ser superior a 12';
3119
+ }
3120
+ else {
3121
+ this.errorMessage = 'Faltan campos por llenar';
3122
+ }
3123
+ });
3124
+ }
3125
+ initForm() {
3126
+ this.codFormStepFour = this.fb.group({
3127
+ program_price: [{ value: '', disabled: true }, [Validators.required]],
3128
+ payment_date: ['', [Validators.required]],
3129
+ payment_method: ['', [Validators.required]],
3130
+ quota_times: ['', [Validators.required]],
3131
+ total_price: [{ value: '', disabled: true }, [Validators.required]],
3132
+ });
3133
+ this.listenPaymentMethodField();
3134
+ }
3135
+ listenPaymentMethodField() {
3136
+ const control = this.codFormStepFour.get('payment_method');
3137
+ control?.valueChanges.subscribe((change) => {
3138
+ // Financiado
3139
+ if (change === '1') {
3140
+ // Poner validaciones
3141
+ this.codFormStepFour.controls['program_price'].setValidators([Validators.required]);
3142
+ this.codFormStepFour.controls['payment_date'].setValidators([Validators.required]);
3143
+ this.codFormStepFour.controls['quota_times'].setValidators([Validators.required]);
3144
+ this.codFormStepFour.controls['total_price'].setValidators([Validators.required]);
3145
+ // Actualizar para que se tomen los cambios
3146
+ this.updateValueAndValidity();
3147
+ // Actualizar los controls globales
3148
+ this.updateGlobalControls(change);
3149
+ }
3150
+ // de contado
3151
+ if (change === '2') {
3152
+ // Quitar las validaciones
3153
+ this.codFormStepFour.controls['program_price'].setValidators([Validators.required]);
3154
+ this.codFormStepFour.controls['payment_date'].setValidators([Validators.required]);
3155
+ this.codFormStepFour.controls['quota_times'].clearValidators();
3156
+ this.codFormStepFour.controls['total_price'].setValidators([Validators.required]);
3157
+ // Actualizar para que se tomen los cambios
3158
+ this.updateValueAndValidity();
3159
+ // Actualizar los controls globales
3160
+ this.updateGlobalControls(change);
3161
+ }
3162
+ });
3163
+ }
3164
+ updateGlobalControls(change) {
3165
+ let controls = this.controls.filter(control => control.name !== 'payment_method');
3166
+ controls.forEach(control => {
3167
+ if (change === '1')
3168
+ this.codFormControls.changeValue(4, control.name, true);
3169
+ if (change === '2') {
3170
+ if (control.name === 'quota_times')
3171
+ this.codFormControls.changeValue(4, control.name, false);
3172
+ }
3173
+ });
3174
+ }
3175
+ updateValueAndValidity() {
3176
+ this.codFormStepFour.controls['program_price'].updateValueAndValidity();
3177
+ this.codFormStepFour.controls['payment_date'].updateValueAndValidity();
3178
+ this.codFormStepFour.controls['quota_times'].updateValueAndValidity();
3179
+ this.codFormStepFour.controls['total_price'].updateValueAndValidity();
3180
+ }
3181
+ startLocalStorageWork() {
3182
+ this.controls.forEach(control => {
3183
+ let localStorageValue = this.readAndWriteLS(4, control.name);
3184
+ this.codFormStepFour.controls[control.name].setValue(localStorageValue.value);
3185
+ this.listenFormChanges(4, control.name, this.codFormStepFour.controls[control.name].valueChanges);
3186
+ });
3187
+ }
3188
+ showTable() {
3189
+ this.isCalculateQuotesButtonClicked = true;
3190
+ const total_price = this.codFormStepFour.controls['total_price'].value;
3191
+ if ((total_price === 'null') || this.codFormStepFour.invalid) {
3192
+ Swal.fire({
3193
+ title: 'Error',
3194
+ text: 'Debes ingresar el monto total de la matrícula y la cuota inicial',
3195
+ icon: 'error'
3196
+ });
3197
+ return;
3198
+ }
3199
+ // Calcular cuotas
3200
+ this.dataFinancing = [];
3201
+ const quotaValues = this.codPrices.filter(codPrice => codPrice.code === Number(this.codFormStepFour.controls['quota_times'].value))[0].quota_price;
3202
+ let params = {
3203
+ date: new Date(this.codFormStepFour.controls['payment_date'].value),
3204
+ quotaValues,
3205
+ quotaTimes: this.codPrices.filter(codPrice => codPrice.code === Number(this.codFormStepFour.controls['quota_times'].value))[0].fee_number,
3206
+ totalPrice: this.codFormStepFour.controls['total_price'].value
3207
+ };
3208
+ this.dataFinancing = this.calculateQuotesService.calculateQuotes(params);
3209
+ this.isFinancing = true;
3210
+ this.financingData.emit(this.dataFinancing);
3211
+ }
3212
+ calculateNewQuotes() {
3213
+ this.isCalculateQuotesButtonClicked = false;
3214
+ this.isFinancing = false;
3215
+ this.financingData.emit(null);
3216
+ }
3217
+ sendForm() {
3218
+ this.codFormStepFour.markAllAsTouched();
3219
+ if (this.codFormStepFour.invalid)
3220
+ return;
3221
+ // Movernos al paso 5
3222
+ this.changeStepEvent.emit(4);
3223
+ }
3224
+ isFinanced() {
3225
+ return this.codFormStepFour.controls['payment_method'].value == 1;
3226
+ }
3227
+ // Eventos del select
3228
+ selectPaymentMethod(paymentMethod) {
3229
+ if (paymentMethod !== '') {
3230
+ this.codFormStepFour.controls['payment_method'].setValue(paymentMethod);
3231
+ this.getCodPricesByAgreement();
3232
+ }
3233
+ else {
3234
+ this.codFormStepFour.controls['payment_method'].setValue(null);
3235
+ }
3236
+ }
3237
+ selectQuotas(quotas) {
3238
+ if (quotas !== 'Número de cuotas') {
3239
+ const codPrice = this.codPrices.filter(codPrice => codPrice.code === Number(quotas));
3240
+ this.codFormStepFour.controls['quota_times'].setValue(codPrice[0].code);
3241
+ this.codFormStepFour.controls['total_price'].setValue(codPrice[0].enrollment);
3242
+ this.codFormStepFour.controls['program_price'].setValue(codPrice[0].financed_price);
3243
+ }
3244
+ else {
3245
+ this.codFormStepFour.controls['quota_times'].setValue(null);
3246
+ this.codFormStepFour.controls['total_price'].setValue(null);
3247
+ this.codFormStepFour.controls['program_price'].setValue(null);
3248
+ }
3249
+ }
3250
+ }
3251
+ CodFormStepFourComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CodFormStepFourComponent, deps: [{ token: i1$1.FormBuilder }, { token: CalculateQuotesService }, { token: CommunicatorService }, { token: ParameterService }, { token: CodFormControls }, { token: CommercialService }], target: i0.ɵɵFactoryTarget.Component });
3252
+ CodFormStepFourComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: CodFormStepFourComponent, selector: "app-cod-form-step-four", outputs: { changeStepEvent: "changeStepEvent", financingData: "financingData" }, usesInheritance: true, ngImport: i0, template: "<div *ngIf=\"isSemestral\" class=\"m-1 p-2 border-round-lg bg-blue-500 text-white\">\r\n <strong>Nota: </strong>\r\n El tipo de curso seleccionado fue semestral, por lo tanto el estudiante debe pagar matr\u00EDcula y primera cuota (M&M)\r\n</div>\r\n\r\n<form autocomplete=\"off\" [formGroup]=\"codFormStepFour\" class=\"grid mt-2\">\r\n\r\n <div class=\"col-12\">\r\n <ipt-select\r\n [initialValue]=\"codFormStepFour.controls['payment_method'].value\"\r\n [control]=\"codFormStepFour.controls['payment_method']\"\r\n (eventSelect)=\"selectPaymentMethod($event)\"\r\n [data]=\"paymentMethods\"\r\n [defaultText]=\"'M\u00E9todo de pago'\"\r\n ></ipt-select>\r\n <ipt-select *ngIf=\"isFinanced();\"\r\n [initialValue]=\"codFormStepFour.controls['quota_times'].value\"\r\n [control]=\"codFormStepFour.controls['quota_times']\"\r\n (eventSelect)=\"selectQuotas($event)\"\r\n [defaultText]=\"'N\u00FAmero de cuotas'\"\r\n [data]=\"codPrices\"\r\n [selectCode]=\"codFormStepFour.controls['quota_times'].value === null? 'N\u00FAmero de cuotas': codFormStepFour.controls['quota_times'].value\"\r\n ></ipt-select>\r\n </div>\r\n\r\n <div *ngIf=\"isFinanced();\" class=\"col-12\">\r\n <ipt-input *ngIf=\"isFinanced();\"\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Monto total de la matr\u00EDcula'\"\r\n [control]=\"codFormStepFour.controls['total_price']\"\r\n [withPipe]=\"true\"\r\n ></ipt-input>\r\n </div>\r\n\r\n <div class=\"col-12\">\r\n <ipt-input\r\n [withPipe]=\"true\"\r\n [inputType]=\"'text'\"\r\n [control]=\"codFormStepFour.controls['program_price']\"\r\n [placeHolder]=\"'Valor total del programa'\"\r\n ></ipt-input>\r\n </div>\r\n\r\n <div class=\"col-12\">\r\n <ipt-input\r\n onfocus=\"(this.type='date')\"\r\n [inputType]=\"'date'\"\r\n [control]=\"codFormStepFour.controls['payment_date']\"\r\n [placeHolder]=\"'Fecha de pago'\"\r\n ></ipt-input>\r\n </div>\r\n\r\n <!-- Tabla de financiaci\u00F3n -->\r\n <div class=\"col-12\" *ngIf=\"isFinancing\">\r\n <p-table\r\n [value]=\"dataFinancing\"\r\n [tableStyle]=\"{'min-width': '100%'}\"\r\n [rowHover]=\"true\"\r\n >\r\n <ng-template pTemplate=\"caption\">\r\n <div class=\"flex align-items-center\">\r\n C\u00E1lculo de cuotas\r\n <button pButton class=\"p-button-sm ml-auto\" label=\"Nuevo c\u00E1lculo\" (click)=\"calculateNewQuotes()\" lab icon=\"pi pi-replay\"></button>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"header\">\r\n <tr>\r\n <th>#</th>\r\n <th>Valor</th>\r\n <th>Fecha</th>\r\n </tr>\r\n </ng-template>\r\n <ng-template pTemplate=\"body\" let-data>\r\n <tr>\r\n <td>{{ data[0] }}</td>\r\n <td>{{ data[1] }}</td>\r\n <td>{{ data[2] }}</td>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n </div>\r\n <!-- ---------------------- -->\r\n\r\n</form>\r\n\r\n<div class=\"flex mt-3 align-items-center gap-3\">\r\n <span *ngIf=\"codFormStepFour.invalid && codFormStepFour.touched\" class=\"text-red-500 font-bold text-center mt-1 py-2 bg-red-100 w-full border-round-xl\">{{ errorMessage }}</span>\r\n <div class=\"flex ml-auto gap-2\">\r\n <button *ngIf=\"codFormStepFour.controls['payment_method'].value === '1'\" [disabled]=\"isFinancing || codFormStepFour.controls['payment_method'].value !== '1'\"type=\"submit\" class=\"ml-auto p-button-sm p-button-secondary\" (click)=\"showTable()\" pButton label=\"Calcular cuotas\" icon=\"pi pi-sliders-h\"></button>\r\n <button [disabled]=\"!isFinancing && codFormStepFour.controls['payment_method'].value === '1'\" type=\"submit\" class=\"ml-auto p-button-sm\" (click)=\"sendForm()\" pButton label=\"Siguiente\" icon=\"pi pi-arrow-right\"></button>\r\n </div>\r\n</div>\r\n", styles: [""], components: [{ type: SelectComponent, selector: "ipt-select", inputs: ["isRequired", "data", "defaultText", "selectCode", "disabledSel", "initialValue", "control"], outputs: ["eventSelect"] }, { type: InputComponent, selector: "ipt-input", inputs: ["inputType", "placeHolder", "validateText", "withPipe", "list", "iconUrl", "control", "prefix", "thousands", "decimal"], outputs: ["dateSelected"] }, { type: i9.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollDelay", "virtualRowHeight", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "minBufferPx", "maxBufferPx", "responsiveLayout", "breakpoint", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["selectAllChange", "selectionChange", "contextMenuSelectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i11.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i7.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }] });
3253
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CodFormStepFourComponent, decorators: [{
3254
+ type: Component,
3255
+ args: [{ selector: 'app-cod-form-step-four', template: "<div *ngIf=\"isSemestral\" class=\"m-1 p-2 border-round-lg bg-blue-500 text-white\">\r\n <strong>Nota: </strong>\r\n El tipo de curso seleccionado fue semestral, por lo tanto el estudiante debe pagar matr\u00EDcula y primera cuota (M&M)\r\n</div>\r\n\r\n<form autocomplete=\"off\" [formGroup]=\"codFormStepFour\" class=\"grid mt-2\">\r\n\r\n <div class=\"col-12\">\r\n <ipt-select\r\n [initialValue]=\"codFormStepFour.controls['payment_method'].value\"\r\n [control]=\"codFormStepFour.controls['payment_method']\"\r\n (eventSelect)=\"selectPaymentMethod($event)\"\r\n [data]=\"paymentMethods\"\r\n [defaultText]=\"'M\u00E9todo de pago'\"\r\n ></ipt-select>\r\n <ipt-select *ngIf=\"isFinanced();\"\r\n [initialValue]=\"codFormStepFour.controls['quota_times'].value\"\r\n [control]=\"codFormStepFour.controls['quota_times']\"\r\n (eventSelect)=\"selectQuotas($event)\"\r\n [defaultText]=\"'N\u00FAmero de cuotas'\"\r\n [data]=\"codPrices\"\r\n [selectCode]=\"codFormStepFour.controls['quota_times'].value === null? 'N\u00FAmero de cuotas': codFormStepFour.controls['quota_times'].value\"\r\n ></ipt-select>\r\n </div>\r\n\r\n <div *ngIf=\"isFinanced();\" class=\"col-12\">\r\n <ipt-input *ngIf=\"isFinanced();\"\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Monto total de la matr\u00EDcula'\"\r\n [control]=\"codFormStepFour.controls['total_price']\"\r\n [withPipe]=\"true\"\r\n ></ipt-input>\r\n </div>\r\n\r\n <div class=\"col-12\">\r\n <ipt-input\r\n [withPipe]=\"true\"\r\n [inputType]=\"'text'\"\r\n [control]=\"codFormStepFour.controls['program_price']\"\r\n [placeHolder]=\"'Valor total del programa'\"\r\n ></ipt-input>\r\n </div>\r\n\r\n <div class=\"col-12\">\r\n <ipt-input\r\n onfocus=\"(this.type='date')\"\r\n [inputType]=\"'date'\"\r\n [control]=\"codFormStepFour.controls['payment_date']\"\r\n [placeHolder]=\"'Fecha de pago'\"\r\n ></ipt-input>\r\n </div>\r\n\r\n <!-- Tabla de financiaci\u00F3n -->\r\n <div class=\"col-12\" *ngIf=\"isFinancing\">\r\n <p-table\r\n [value]=\"dataFinancing\"\r\n [tableStyle]=\"{'min-width': '100%'}\"\r\n [rowHover]=\"true\"\r\n >\r\n <ng-template pTemplate=\"caption\">\r\n <div class=\"flex align-items-center\">\r\n C\u00E1lculo de cuotas\r\n <button pButton class=\"p-button-sm ml-auto\" label=\"Nuevo c\u00E1lculo\" (click)=\"calculateNewQuotes()\" lab icon=\"pi pi-replay\"></button>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"header\">\r\n <tr>\r\n <th>#</th>\r\n <th>Valor</th>\r\n <th>Fecha</th>\r\n </tr>\r\n </ng-template>\r\n <ng-template pTemplate=\"body\" let-data>\r\n <tr>\r\n <td>{{ data[0] }}</td>\r\n <td>{{ data[1] }}</td>\r\n <td>{{ data[2] }}</td>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n </div>\r\n <!-- ---------------------- -->\r\n\r\n</form>\r\n\r\n<div class=\"flex mt-3 align-items-center gap-3\">\r\n <span *ngIf=\"codFormStepFour.invalid && codFormStepFour.touched\" class=\"text-red-500 font-bold text-center mt-1 py-2 bg-red-100 w-full border-round-xl\">{{ errorMessage }}</span>\r\n <div class=\"flex ml-auto gap-2\">\r\n <button *ngIf=\"codFormStepFour.controls['payment_method'].value === '1'\" [disabled]=\"isFinancing || codFormStepFour.controls['payment_method'].value !== '1'\"type=\"submit\" class=\"ml-auto p-button-sm p-button-secondary\" (click)=\"showTable()\" pButton label=\"Calcular cuotas\" icon=\"pi pi-sliders-h\"></button>\r\n <button [disabled]=\"!isFinancing && codFormStepFour.controls['payment_method'].value === '1'\" type=\"submit\" class=\"ml-auto p-button-sm\" (click)=\"sendForm()\" pButton label=\"Siguiente\" icon=\"pi pi-arrow-right\"></button>\r\n </div>\r\n</div>\r\n", styles: [""] }]
3256
+ }], ctorParameters: function () { return [{ type: i1$1.FormBuilder }, { type: CalculateQuotesService }, { type: CommunicatorService }, { type: ParameterService }, { type: CodFormControls }, { type: CommercialService }]; }, propDecorators: { changeStepEvent: [{
3257
+ type: Output
3258
+ }], financingData: [{
3259
+ type: Output
3260
+ }] } });
3261
+
3262
+ class CodFormStepFiveComponent extends CodFormSteps {
3263
+ constructor(fb, parameterService) {
3264
+ super();
3265
+ this.fb = fb;
3266
+ this.parameterService = parameterService;
3267
+ this.changeStepEvent = new EventEmitter();
3268
+ this.action = new EventEmitter();
3269
+ this.errorMessage = 'Faltan campos por llenar.';
3270
+ this.termsCheckboxStatus = false;
3271
+ // Controls del formulario
3272
+ this.controls = new CodFormControls().controls[4];
3273
+ }
3274
+ ngOnInit() {
3275
+ this.getParameters();
3276
+ this.initForm();
3277
+ this.startLocalStorageWork();
3278
+ this.codFormStepFive.controls['terms'].valueChanges.subscribe(changes => {
3279
+ this.termsCheckboxStatus = changes;
3280
+ if (!this.termsCheckboxStatus)
3281
+ this.errorMessage = 'Debe marcar la casilla de términos y condiciones.';
3282
+ });
3283
+ if (this.userRole === 30 || this.userRole === 31 || this.userRole === 32)
3284
+ this.sendFormMsg = 'Editar COD'; // Roles Administrativos
3285
+ if (this.userRole === 40 || this.userRole === 41 || this.userRole === 42)
3286
+ this.sendFormMsg = 'Crear COD'; // Roles comerciales
3287
+ }
3288
+ getParameters() {
3289
+ this.parameterService.getMarketingReasons().subscribe((response) => {
3290
+ this.marketingReasons = response.data;
3291
+ });
3292
+ this.parameterService.getStudyReasons().subscribe((response) => {
3293
+ this.studyReasons = response.data;
3294
+ });
3295
+ this.parameterService.getMulticulturalisms().subscribe((response) => {
3296
+ this.multiculturalities = response.data;
3297
+ });
3298
+ }
3299
+ initForm() {
3300
+ this.codFormStepFive = this.fb.group({
3301
+ marketing_reasons: ['', [Validators.required]],
3302
+ observation: [''],
3303
+ study_reasons: ['', [Validators.required]],
3304
+ terms: [false, [Validators.required]],
3305
+ disability: [''],
3306
+ multiculturalism_1: [false, []],
3307
+ multiculturalism_2: [false, []],
3308
+ multiculturalism_3: [false, []],
3309
+ multiculturalism_4: [false, []],
3310
+ multiculturalism_5: [false, []],
3311
+ multiculturalism_6: [false, []],
3312
+ multiculturalism_7: [false, []],
3313
+ health_regimen: ['', [Validators.required]],
3314
+ });
3315
+ this.codFormStepFive.controls['marketing_reasons'].valueChanges.subscribe(change => {
3316
+ if (change === '4') {
3317
+ this.errorMessage = 'Los datos de la persona que refirió al estudiante son requeridos en el campo "Observaciones".';
3318
+ Swal.fire({
3319
+ title: 'Información',
3320
+ text: 'Llene en el campo de observaciones los datos de la persona que lo refirió',
3321
+ icon: 'info'
3322
+ });
3323
+ this.codFormStepFive.controls['observation'].setValidators([Validators.required]);
3324
+ this.codFormStepFive.controls['observation'].updateValueAndValidity();
3325
+ }
3326
+ else {
3327
+ this.codFormStepFive.controls['observation'].clearValidators();
3328
+ this.codFormStepFive.controls['observation'].updateValueAndValidity();
3329
+ }
3330
+ });
3331
+ }
3332
+ startLocalStorageWork() {
3333
+ this.controls.forEach(control => {
3334
+ let localStorageValue = this.readAndWriteLS(5, control.name);
3335
+ // Solución al bug del checkbox
3336
+ if (localStorageValue.control === 'terms') {
3337
+ let nextValue = localStorageValue.value === 'true' ? true : false;
3338
+ this.codFormStepFive.controls['terms'].setValue(nextValue);
3339
+ this.termsCheckboxStatus = nextValue;
3340
+ }
3341
+ // -------------------------- //
3342
+ this.codFormStepFive.controls[control.name].setValue(localStorageValue.value);
3343
+ this.listenFormChanges(5, control.name, this.codFormStepFive.controls[control.name].valueChanges);
3344
+ });
3345
+ this.controls.filter(control => control.description === 'Multiculturalismo').forEach(control => {
3346
+ let localStorageValue = this.readAndWriteLS(5, control.name);
3347
+ let nextValue = localStorageValue.value === 'true' ? true : false;
3348
+ this.codFormStepFive.controls[control.name].setValue(nextValue);
3349
+ });
3350
+ }
3351
+ getCheckboxControl() {
3352
+ return this.codFormStepFive.controls['terms'];
3353
+ }
3354
+ sendForm() {
3355
+ this.codFormStepFive.markAllAsTouched();
3356
+ if (this.codFormStepFive.invalid || this.termsCheckboxStatus === false)
3357
+ return;
3358
+ if (this.userRole === 30 || this.userRole === 31 || this.userRole === 32)
3359
+ this.action.emit('update');
3360
+ if (this.userRole === 40 || this.userRole === 41 || this.userRole === 42)
3361
+ this.action.emit('create');
3362
+ }
3363
+ // Eventos del select
3364
+ selectMarketingReasons(marketingReasons) {
3365
+ if (marketingReasons !== '¿Cómo se enteró del programa?') {
3366
+ this.codFormStepFive.controls['marketing_reasons'].setValue(marketingReasons);
3367
+ }
3368
+ else {
3369
+ this.codFormStepFive.controls['marketing_reasons'].setValue(null);
3370
+ }
3371
+ }
3372
+ selectStudyReasons(studyReasons) {
3373
+ if (studyReasons !== 'Motivo') {
3374
+ this.codFormStepFive.controls['study_reasons'].setValue(studyReasons);
3375
+ }
3376
+ else {
3377
+ this.codFormStepFive.controls['study_reasons'].setValue(null);
3378
+ }
3379
+ }
3380
+ }
3381
+ CodFormStepFiveComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CodFormStepFiveComponent, deps: [{ token: i1$1.FormBuilder }, { token: ParameterService }], target: i0.ɵɵFactoryTarget.Component });
3382
+ CodFormStepFiveComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: CodFormStepFiveComponent, selector: "app-cod-form-step-five", inputs: { userRole: "userRole" }, outputs: { changeStepEvent: "changeStepEvent", action: "action" }, usesInheritance: true, ngImport: i0, template: "<form autocomplete=\"off\" [formGroup]=\"codFormStepFive\" class=\"grid\">\r\n <div class=\"col-12 md:col-6\">\r\n <ipt-select\r\n [control]=\"codFormStepFive.controls['marketing_reasons']\"\r\n [initialValue]=\"codFormStepFive.controls['marketing_reasons'].value\"\r\n (eventSelect)=\"selectMarketingReasons($event)\"\r\n [data]=\"marketingReasons\"\r\n [defaultText]=\"'\u00BFC\u00F3mo se enter\u00F3 del programa?'\"\r\n ></ipt-select>\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Discapacidad'\"\r\n [control]=\"codFormStepFive.controls['disability']\"\r\n ></ipt-input>\r\n </div>\r\n <div class=\"col-12 md:col-6\">\r\n <ipt-select\r\n [control]=\"codFormStepFive.controls['study_reasons']\"\r\n [initialValue]=\"codFormStepFive.controls['study_reasons'].value\"\r\n (eventSelect)=\"selectStudyReasons($event)\"\r\n [data]=\"studyReasons\"\r\n [defaultText]=\"'Motivo'\"\r\n ></ipt-select>\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'R\u00E9gimen de salud'\"\r\n [control]=\"codFormStepFive.controls['health_regimen']\"\r\n ></ipt-input>\r\n </div>\r\n <div class=\"col-12 mt-4\">\r\n <span class=\"p-float-label\">\r\n <textarea\r\n id=\"float-input\"\r\n rows=\"4\"\r\n cols=\"30\"\r\n pInputTextarea\r\n formControlName=\"observation\"\r\n ></textarea>\r\n <label for=\"float-input\">Observaciones</label>\r\n </span>\r\n <div class=\"flex flex-wrap justify-content-between gap-2\">\r\n <div *ngFor=\"let option of multiculturalities; index as i\" class=\"field-checkbox mt-4 flex align-items-center\">\r\n <mat-checkbox [formControlName]=\"'multiculturalism' + '_' + (i+1)\" class=\"example-margin\"></mat-checkbox>\r\n <label [for]=\"option.code\">{{ option.name }}</label>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"col-12 p-4 font-bold\">\r\n <p>\r\n * El estudiante o titular se comprometen a cancelar las cuotas establecidas en este contrato, los\r\n primeros 5 (cinco) d\u00EDas del mes. En caso de querer retirarse, deber\u00E1 informar por escrito 30\r\n (treinta) d\u00EDas antes y cancelar lo correspondiente hasta la fecha definida de retiro, para poder\r\n obtener su paz y salvo.\r\n </p>\r\n <br><br>\r\n <div class=\"flex gap-2\">\r\n <mat-checkbox formControlName=\"terms\" class=\"example-margin\"></mat-checkbox>\r\n <!-- <p-checkbox [formControl]=\"getCheckboxControl()\"></p-checkbox> -->\r\n <!-- <ipt-checkbox [control]=\"codFormStepFive.controls['terms']\" [checkboxOption]=\"termsCheckboxStatus\"></ipt-checkbox> -->\r\n <p>\r\n DECLARO HABER LE\u00CDDO Y ACEPTO LOS T\u00C9RMINOS Y CONDICIONES DE LAS POL\u00CDTICAS ESTABLECIDAS EN LA\r\n INSTITUCI\u00D3N.\r\n </p>\r\n </div>\r\n </div>\r\n</form>\r\n\r\n<div class=\"flex mt-3 align-items-center gap-3\">\r\n <span *ngIf=\"(codFormStepFive.invalid && codFormStepFive.touched) || (!termsCheckboxStatus && codFormStepFive.touched)\" class=\"text-red-500 font-bold text-center mt-1 py-2 bg-red-100 w-full border-round-xl\">{{ errorMessage }}</span>\r\n <button type=\"submit\" class=\"ml-auto p-button-success p-button-sm\" (click)=\"sendForm()\" pButton [label]=\"sendFormMsg\" icon=\"pi pi-check\"></button>\r\n</div>\r\n\r\n", styles: [""], components: [{ type: SelectComponent, selector: "ipt-select", inputs: ["isRequired", "data", "defaultText", "selectCode", "disabledSel", "initialValue", "control"], outputs: ["eventSelect"] }, { type: InputComponent, selector: "ipt-input", inputs: ["inputType", "placeHolder", "validateText", "withPipe", "list", "iconUrl", "control", "prefix", "thousands", "decimal"], outputs: ["dateSelected"] }, { type: i5$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }], directives: [{ type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }] });
3383
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CodFormStepFiveComponent, decorators: [{
3384
+ type: Component,
3385
+ args: [{ selector: 'app-cod-form-step-five', template: "<form autocomplete=\"off\" [formGroup]=\"codFormStepFive\" class=\"grid\">\r\n <div class=\"col-12 md:col-6\">\r\n <ipt-select\r\n [control]=\"codFormStepFive.controls['marketing_reasons']\"\r\n [initialValue]=\"codFormStepFive.controls['marketing_reasons'].value\"\r\n (eventSelect)=\"selectMarketingReasons($event)\"\r\n [data]=\"marketingReasons\"\r\n [defaultText]=\"'\u00BFC\u00F3mo se enter\u00F3 del programa?'\"\r\n ></ipt-select>\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Discapacidad'\"\r\n [control]=\"codFormStepFive.controls['disability']\"\r\n ></ipt-input>\r\n </div>\r\n <div class=\"col-12 md:col-6\">\r\n <ipt-select\r\n [control]=\"codFormStepFive.controls['study_reasons']\"\r\n [initialValue]=\"codFormStepFive.controls['study_reasons'].value\"\r\n (eventSelect)=\"selectStudyReasons($event)\"\r\n [data]=\"studyReasons\"\r\n [defaultText]=\"'Motivo'\"\r\n ></ipt-select>\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'R\u00E9gimen de salud'\"\r\n [control]=\"codFormStepFive.controls['health_regimen']\"\r\n ></ipt-input>\r\n </div>\r\n <div class=\"col-12 mt-4\">\r\n <span class=\"p-float-label\">\r\n <textarea\r\n id=\"float-input\"\r\n rows=\"4\"\r\n cols=\"30\"\r\n pInputTextarea\r\n formControlName=\"observation\"\r\n ></textarea>\r\n <label for=\"float-input\">Observaciones</label>\r\n </span>\r\n <div class=\"flex flex-wrap justify-content-between gap-2\">\r\n <div *ngFor=\"let option of multiculturalities; index as i\" class=\"field-checkbox mt-4 flex align-items-center\">\r\n <mat-checkbox [formControlName]=\"'multiculturalism' + '_' + (i+1)\" class=\"example-margin\"></mat-checkbox>\r\n <label [for]=\"option.code\">{{ option.name }}</label>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"col-12 p-4 font-bold\">\r\n <p>\r\n * El estudiante o titular se comprometen a cancelar las cuotas establecidas en este contrato, los\r\n primeros 5 (cinco) d\u00EDas del mes. En caso de querer retirarse, deber\u00E1 informar por escrito 30\r\n (treinta) d\u00EDas antes y cancelar lo correspondiente hasta la fecha definida de retiro, para poder\r\n obtener su paz y salvo.\r\n </p>\r\n <br><br>\r\n <div class=\"flex gap-2\">\r\n <mat-checkbox formControlName=\"terms\" class=\"example-margin\"></mat-checkbox>\r\n <!-- <p-checkbox [formControl]=\"getCheckboxControl()\"></p-checkbox> -->\r\n <!-- <ipt-checkbox [control]=\"codFormStepFive.controls['terms']\" [checkboxOption]=\"termsCheckboxStatus\"></ipt-checkbox> -->\r\n <p>\r\n DECLARO HABER LE\u00CDDO Y ACEPTO LOS T\u00C9RMINOS Y CONDICIONES DE LAS POL\u00CDTICAS ESTABLECIDAS EN LA\r\n INSTITUCI\u00D3N.\r\n </p>\r\n </div>\r\n </div>\r\n</form>\r\n\r\n<div class=\"flex mt-3 align-items-center gap-3\">\r\n <span *ngIf=\"(codFormStepFive.invalid && codFormStepFive.touched) || (!termsCheckboxStatus && codFormStepFive.touched)\" class=\"text-red-500 font-bold text-center mt-1 py-2 bg-red-100 w-full border-round-xl\">{{ errorMessage }}</span>\r\n <button type=\"submit\" class=\"ml-auto p-button-success p-button-sm\" (click)=\"sendForm()\" pButton [label]=\"sendFormMsg\" icon=\"pi pi-check\"></button>\r\n</div>\r\n\r\n", styles: [""] }]
3386
+ }], ctorParameters: function () { return [{ type: i1$1.FormBuilder }, { type: ParameterService }]; }, propDecorators: { userRole: [{
3387
+ type: Input
3388
+ }], changeStepEvent: [{
3389
+ type: Output
3390
+ }], action: [{
3391
+ type: Output
3392
+ }] } });
3393
+
3394
+ class CodFormComponent {
3395
+ constructor(baseService, localStorageCOD, codFormControls, commercialService) {
3396
+ this.baseService = baseService;
3397
+ this.localStorageCOD = localStorageCOD;
3398
+ this.codFormControls = codFormControls;
3399
+ this.commercialService = commercialService;
3400
+ this.allowedRoles = [
3401
+ 30, 31, 32, 40, 41, 42,
3402
+ ];
3403
+ this.currentStep = 0;
3404
+ this.formTitle = 'Formulario para creación del COD';
3405
+ this.formSteps = 5;
3406
+ this.isLoading = false;
3407
+ this.loaderMessage = '';
3408
+ this.userRole = this.baseService.getUserRole();
3409
+ }
3410
+ ngOnChanges(changes) {
3411
+ if (changes['codCode']) {
3412
+ this.formTitle = 'Formulario para verificar información del COD';
3413
+ this.getCodbyCode();
3414
+ }
3415
+ else {
3416
+ this.formTitle = 'Formulario para creación del COD';
3417
+ }
3418
+ }
3419
+ allowedRole() {
3420
+ return this.allowedRoles.includes(this.userRole);
3421
+ }
3422
+ getCodbyCode() {
3423
+ // TODO: Traer COD por código y pintarlo
3424
+ console.log(this.codCode);
3425
+ }
3426
+ saveFinancingData(data) {
3427
+ if (data) {
3428
+ const dates = [];
3429
+ data.forEach(p => {
3430
+ const date = p[2].split(',')[1];
3431
+ const formattedDate = new Date(date);
3432
+ const momentDate = moment(formattedDate).format().split('T')[0];
3433
+ dates.push(momentDate);
3434
+ });
3435
+ this.financingData = dates;
3436
+ }
3437
+ }
3438
+ getFormAction(action) {
3439
+ if (!this.financingData && this.localStorageCOD.getCodFormData(4, 'payment_method') === '1') {
3440
+ Swal.fire({
3441
+ title: 'Querido asesor',
3442
+ text: 'Debe hacer el cálculo de las cuotas en el paso 4',
3443
+ icon: 'error'
3444
+ });
3445
+ return;
3446
+ }
3447
+ const totalData = [];
3448
+ this.subscription = this.codFormControls.getControlValues().subscribe((controls) => {
3449
+ for (let i = 1; i <= this.formSteps; i++) {
3450
+ let controlsByStep = controls[i - 1];
3451
+ controlsByStep.forEach(control => {
3452
+ let value = this.localStorageCOD.getCodFormData(i, control.name);
3453
+ // Cambiar True/False del multiculturalismo 1/0
3454
+ if (value === 'false' && control.description === 'Multiculturalismo') {
3455
+ totalData.push({
3456
+ control: control.name,
3457
+ isRequired: control.required,
3458
+ value: '0',
3459
+ description: control.description
3460
+ });
3461
+ }
3462
+ else if (value === 'false' && control.description === 'Multiculturalismo') {
3463
+ totalData.push({
3464
+ control: control.name,
3465
+ isRequired: control.required,
3466
+ value: '1',
3467
+ description: control.description
3468
+ });
3469
+ }
3470
+ else {
3471
+ totalData.push({
3472
+ control: control.name,
3473
+ isRequired: control.required,
3474
+ value,
3475
+ description: control.description
3476
+ });
3477
+ }
3478
+ });
3479
+ }
3480
+ // Validar errores
3481
+ for (let i = 0; i < totalData.length; i++) {
3482
+ const element = totalData[i];
3483
+ if (!element.value && element.isRequired) {
3484
+ Swal.fire({
3485
+ title: 'Error',
3486
+ text: `Revisar el campo: "${element.description}"`,
3487
+ icon: 'error'
3488
+ });
3489
+ break;
3490
+ }
3491
+ }
3492
+ if (action === 'create')
3493
+ this.createCOD(totalData);
3494
+ if (action === 'update')
3495
+ this.updateCOD(totalData);
3496
+ });
3497
+ this.subscription.unsubscribe();
3498
+ }
3499
+ updateCOD(totalData) {
3500
+ console.log('actualizando COD...');
3501
+ }
3502
+ createCOD(totalData) {
3503
+ this.isLoading = true;
3504
+ this.loaderMessage = 'Creando COD, espere un momento';
3505
+ let request = this.getCreateCODRq(totalData);
3506
+ this.commercialService.createCOD(request).subscribe({
3507
+ next: (response) => {
3508
+ console.log(response);
3509
+ if (response.message.code === 1) {
3510
+ this.isLoading = false;
3511
+ this.loaderMessage = '';
3512
+ Swal.fire({
3513
+ title: 'Perfecto!',
3514
+ text: 'El COD ha sido creado exitosamente.',
3515
+ icon: 'success'
3516
+ });
3517
+ }
3518
+ },
3519
+ error: (err) => {
3520
+ console.log(err);
3521
+ this.isLoading = false;
3522
+ this.loaderMessage = '';
3523
+ Swal.fire({
3524
+ title: 'Error',
3525
+ text: err.error.text,
3526
+ icon: 'error'
3527
+ });
3528
+ }
3529
+ });
3530
+ }
3531
+ getCreateCODRq(data) {
3532
+ let request = {
3533
+ token: this.baseService.getUserToken(),
3534
+ academic_plan: data.filter(data => data.control === 'academic_plan')[0].value,
3535
+ course_type: data.filter(data => data.control === 'course_type')[0].value,
3536
+ agreement_by_category: data.filter(data => data.control === 'agreement_by_category')[0].value,
3537
+ english_level: data.filter(data => data.control === 'english_level')[0].value,
3538
+ availible_courses: data.filter(data => data.control === 'availible_courses')[0].value,
3539
+ student_address: data.filter(data => data.control === 'student_address')[0].value,
3540
+ birthdate: data.filter(data => data.control === 'birthdate')[0].value,
3541
+ country: data.filter(data => data.control === 'country')[0].value,
3542
+ state: data.filter(data => data.control === 'state')[0].value,
3543
+ city: data.filter(data => data.control === 'city')[0].value,
3544
+ student_id_card_type: data.filter(data => data.control === 'student_id_card_type')[0].value,
3545
+ student_id_card: data.filter(data => data.control === 'student_id_card')[0].value,
3546
+ student_last_name: data.filter(data => data.control === 'student_last_name')[0].value,
3547
+ student_name: data.filter(data => data.control === 'student_name')[0].value,
3548
+ student_email: data.filter(data => data.control === 'student_email')[0].value,
3549
+ nickname: data.filter(data => data.control === 'nickname')[0].value,
3550
+ gender: data.filter(data => data.control === 'gender')[0].value,
3551
+ age: data.filter(data => data.control === 'age')[0].value,
3552
+ student_occupation: data.filter(data => data.control === 'student_occupation')[0].value,
3553
+ stratum: data.filter(data => data.control === 'stratum')[0].value,
3554
+ grade: data.filter(data => data.control === 'grade')[0].value,
3555
+ civil_status: data.filter(data => data.control === 'civil_status')[0].value,
3556
+ student_phone_indicative: data.filter(data => data.control === 'student_phone_indicative')[0].value,
3557
+ student_phone_number: data.filter(data => data.control === 'student_phone_number')[0].value,
3558
+ password: data.filter(data => data.control === 'password')[0].value,
3559
+ re_password: data.filter(data => data.control === 're_password')[0].value,
3560
+ parent_id_card_type: data.filter(data => data.control === 'parent_id_card_type')[0].value,
3561
+ parent_id_card: data.filter(data => data.control === 'parent_id_card')[0].value,
3562
+ parent_last_name: data.filter(data => data.control === 'parent_last_name')[0].value,
3563
+ parent_name: data.filter(data => data.control === 'parent_name')[0].value,
3564
+ needAtendant: data.filter(data => data.control === 'needAtendant')[0].value,
3565
+ parent_phone_indicative: data.filter(data => data.control === 'parent_phone_indicative')[0].value,
3566
+ parent_occupation: data.filter(data => data.control === 'parent_occupation')[0].value,
3567
+ parent_address: data.filter(data => data.control === 'parent_address')[0].value,
3568
+ parent_phone_number: data.filter(data => data.control === 'parent_phone_number')[0].value,
3569
+ payment_date: data.filter(data => data.control === 'payment_date')[0].value,
3570
+ program_price: data.filter(data => data.control === 'program_price')[0].value,
3571
+ payment_method: data.filter(data => data.control === 'payment_method')[0].value,
3572
+ quota_times: data.filter(data => data.control === 'quota_times')[0].value,
3573
+ total_price: data.filter(data => data.control === 'total_price')[0].value,
3574
+ marketing_reasons: data.filter(data => data.control === 'marketing_reasons')[0].value,
3575
+ observation: data.filter(data => data.control === 'observation')[0].value,
3576
+ study_reasons: data.filter(data => data.control === 'study_reasons')[0].value,
3577
+ terms: data.filter(data => data.control === 'terms')[0].value,
3578
+ disability: data.filter(data => data.control === 'disability')[0].value,
3579
+ multiculturalism_1: data.filter(data => data.control === 'multiculturalism_1')[0].value,
3580
+ multiculturalism_2: data.filter(data => data.control === 'multiculturalism_2')[0].value,
3581
+ multiculturalism_3: data.filter(data => data.control === 'multiculturalism_3')[0].value,
3582
+ multiculturalism_4: data.filter(data => data.control === 'multiculturalism_4')[0].value,
3583
+ multiculturalism_5: data.filter(data => data.control === 'multiculturalism_5')[0].value,
3584
+ multiculturalism_6: data.filter(data => data.control === 'multiculturalism_6')[0].value,
3585
+ health_regimen: data.filter(data => data.control === 'health_regimen')[0].value,
3586
+ payment_dates: this.financingData
3587
+ };
3588
+ return request;
3589
+ }
3590
+ changeStep(step) {
3591
+ this.currentStep = step;
3592
+ }
3593
+ }
3594
+ CodFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CodFormComponent, deps: [{ token: BaseService }, { token: LocalStorageCODService }, { token: CodFormControls }, { token: CommercialService }], target: i0.ɵɵFactoryTarget.Component });
3595
+ CodFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: CodFormComponent, selector: "ipt-cod-form", inputs: { dataFromPreviusCodData: "dataFromPreviusCodData", codCode: "codCode" }, usesOnChanges: true, ngImport: i0, template: "<div *ngIf=\"allowedRole() ; else Unauthorized\" class=\"container flex flex-column bg-white border-round-2xl p-3 container animate__animated animate__fadeInUp\">\r\n\r\n <span class=\"bg-primary p-2 border-round mb-2 w-auto text-lg font-semibold\">{{ formTitle }}</span>\r\n\r\n <p-tabView [activeIndex]=\"currentStep\" (activeIndexChange)=\"currentStep = $event\" [scrollable]=\"true\">\r\n <p-tabPanel leftIcon=\"pi pi-star\" header=\"1. Planes y convenios\">\r\n <app-cod-form-step-one (changeStepEvent)=\"changeStep($event)\" class=\"p-1\"></app-cod-form-step-one>\r\n </p-tabPanel>\r\n <p-tabPanel leftIcon=\"pi pi-id-card\" header=\"2. Datos del estudiante\">\r\n <app-cod-form-step-two [initialData]=\"dataFromPreviusCodData\" (changeStepEvent)=\"changeStep($event)\" class=\"p-1\"></app-cod-form-step-two>\r\n </p-tabPanel>\r\n <p-tabPanel leftIcon=\"pi pi-user-edit\" header=\"3. Datos del acudiente\">\r\n <app-cod-form-step-three (changeStepEvent)=\"changeStep($event)\" class=\"p-1\"></app-cod-form-step-three>\r\n </p-tabPanel>\r\n <p-tabPanel leftIcon=\"pi pi-money-bill\" header=\"4. Valores\">\r\n <app-cod-form-step-four (changeStepEvent)=\"changeStep($event)\" (financingData)=\"saveFinancingData($event)\" class=\"p-1\"></app-cod-form-step-four>\r\n </p-tabPanel>\r\n <p-tabPanel leftIcon=\"pi pi-eye\" header=\"5. Observaciones\">\r\n <app-cod-form-step-five [userRole]=\"userRole\" (changeStepEvent)=\"changeStep($event)\" (action)=\"getFormAction($event)\" class=\"p-1\"></app-cod-form-step-five>\r\n </p-tabPanel>\r\n </p-tabView>\r\n\r\n \r\n</div>\r\n\r\n<ng-template #Unauthorized>\r\n <span class=\"flex justify-content-center font-bold p-2 bg-yellow-200 border-round-lg w-full\">\r\n No tienes los permisos para acceder a esta funcionalidad, comun\u00EDcate con el desarrollador.\r\n </span>\r\n</ng-template>\r\n\r\n\r\n<ipt-loader *ngIf=\"isLoading\" [isDialog]=\"true\" [message]=\"loaderMessage\"></ipt-loader>", components: [{ type: i5$2.TabView, selector: "p-tabView", inputs: ["orientation", "style", "styleClass", "controlClose", "scrollable", "activeIndex"], outputs: ["onChange", "onClose", "activeIndexChange"] }, { type: i5$2.TabPanel, selector: "p-tabPanel", inputs: ["closable", "headerStyle", "headerStyleClass", "cache", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "selected", "disabled", "header", "leftIcon", "rightIcon"] }, { type: CodFormStepOneComponent, selector: "app-cod-form-step-one", outputs: ["changeStepEvent"] }, { type: CodFormStepTwoComponent, selector: "app-cod-form-step-two", inputs: ["initialData"], outputs: ["changeStepEvent"] }, { type: CodFormStepThreeComponent, selector: "app-cod-form-step-three", outputs: ["changeStepEvent"] }, { type: CodFormStepFourComponent, selector: "app-cod-form-step-four", outputs: ["changeStepEvent", "financingData"] }, { type: CodFormStepFiveComponent, selector: "app-cod-form-step-five", inputs: ["userRole"], outputs: ["changeStepEvent", "action"] }, { type: LoaderComponent, selector: "ipt-loader", inputs: ["message", "isDialog"] }], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
3596
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CodFormComponent, decorators: [{
3597
+ type: Component,
3598
+ args: [{ selector: 'ipt-cod-form', template: "<div *ngIf=\"allowedRole() ; else Unauthorized\" class=\"container flex flex-column bg-white border-round-2xl p-3 container animate__animated animate__fadeInUp\">\r\n\r\n <span class=\"bg-primary p-2 border-round mb-2 w-auto text-lg font-semibold\">{{ formTitle }}</span>\r\n\r\n <p-tabView [activeIndex]=\"currentStep\" (activeIndexChange)=\"currentStep = $event\" [scrollable]=\"true\">\r\n <p-tabPanel leftIcon=\"pi pi-star\" header=\"1. Planes y convenios\">\r\n <app-cod-form-step-one (changeStepEvent)=\"changeStep($event)\" class=\"p-1\"></app-cod-form-step-one>\r\n </p-tabPanel>\r\n <p-tabPanel leftIcon=\"pi pi-id-card\" header=\"2. Datos del estudiante\">\r\n <app-cod-form-step-two [initialData]=\"dataFromPreviusCodData\" (changeStepEvent)=\"changeStep($event)\" class=\"p-1\"></app-cod-form-step-two>\r\n </p-tabPanel>\r\n <p-tabPanel leftIcon=\"pi pi-user-edit\" header=\"3. Datos del acudiente\">\r\n <app-cod-form-step-three (changeStepEvent)=\"changeStep($event)\" class=\"p-1\"></app-cod-form-step-three>\r\n </p-tabPanel>\r\n <p-tabPanel leftIcon=\"pi pi-money-bill\" header=\"4. Valores\">\r\n <app-cod-form-step-four (changeStepEvent)=\"changeStep($event)\" (financingData)=\"saveFinancingData($event)\" class=\"p-1\"></app-cod-form-step-four>\r\n </p-tabPanel>\r\n <p-tabPanel leftIcon=\"pi pi-eye\" header=\"5. Observaciones\">\r\n <app-cod-form-step-five [userRole]=\"userRole\" (changeStepEvent)=\"changeStep($event)\" (action)=\"getFormAction($event)\" class=\"p-1\"></app-cod-form-step-five>\r\n </p-tabPanel>\r\n </p-tabView>\r\n\r\n \r\n</div>\r\n\r\n<ng-template #Unauthorized>\r\n <span class=\"flex justify-content-center font-bold p-2 bg-yellow-200 border-round-lg w-full\">\r\n No tienes los permisos para acceder a esta funcionalidad, comun\u00EDcate con el desarrollador.\r\n </span>\r\n</ng-template>\r\n\r\n\r\n<ipt-loader *ngIf=\"isLoading\" [isDialog]=\"true\" [message]=\"loaderMessage\"></ipt-loader>", styles: [] }]
3599
+ }], ctorParameters: function () { return [{ type: BaseService }, { type: LocalStorageCODService }, { type: CodFormControls }, { type: CommercialService }]; }, propDecorators: { dataFromPreviusCodData: [{
3600
+ type: Input
3601
+ }], codCode: [{
3602
+ type: Input
3603
+ }] } });
3604
+
3605
+ class CodModule {
3606
+ }
3607
+ CodModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CodModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3608
+ CodModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CodModule, declarations: [CodFormComponent,
3609
+ CodDocumentsSectionComponent,
3610
+ CodFormStepOneComponent,
3611
+ CodFormStepTwoComponent,
3612
+ CodFormStepThreeComponent,
3613
+ CodFormStepFourComponent,
3614
+ CodFormStepFiveComponent], imports: [CommonModule,
3615
+ TabViewModule,
3616
+ ComponentsModule,
3617
+ MatCheckboxModule,
3618
+ ReactiveFormsModule,
3619
+ TableModule,
3620
+ ButtonModule], exports: [CodFormComponent,
3621
+ CodDocumentsSectionComponent,
3622
+ CodFormStepOneComponent,
3623
+ CodFormStepTwoComponent,
3624
+ CodFormStepThreeComponent,
3625
+ CodFormStepFourComponent,
3626
+ CodFormStepFiveComponent] });
3627
+ CodModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CodModule, providers: [
3628
+ MessageService
3629
+ ], imports: [[
3630
+ CommonModule,
3631
+ TabViewModule,
3632
+ ComponentsModule,
3633
+ MatCheckboxModule,
3634
+ ReactiveFormsModule,
3635
+ TableModule,
3636
+ ButtonModule
3637
+ ]] });
3638
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CodModule, decorators: [{
3639
+ type: NgModule,
3640
+ args: [{
3641
+ imports: [
3642
+ CommonModule,
3643
+ TabViewModule,
3644
+ ComponentsModule,
3645
+ MatCheckboxModule,
3646
+ ReactiveFormsModule,
3647
+ TableModule,
3648
+ ButtonModule
3649
+ ],
3650
+ exports: [
3651
+ CodFormComponent,
3652
+ CodDocumentsSectionComponent,
3653
+ CodFormStepOneComponent,
3654
+ CodFormStepTwoComponent,
3655
+ CodFormStepThreeComponent,
3656
+ CodFormStepFourComponent,
3657
+ CodFormStepFiveComponent
3658
+ ],
3659
+ declarations: [
3660
+ CodFormComponent,
3661
+ CodDocumentsSectionComponent,
3662
+ CodFormStepOneComponent,
3663
+ CodFormStepTwoComponent,
3664
+ CodFormStepThreeComponent,
3665
+ CodFormStepFourComponent,
3666
+ CodFormStepFiveComponent
3667
+ ],
3668
+ providers: [
3669
+ MessageService
3670
+ ],
3671
+ }]
3672
+ }] });
3673
+
1895
3674
  class RedirectGuard {
1896
3675
  constructor(router) {
1897
3676
  this.router = router;
@@ -2268,51 +4047,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
2268
4047
  }]
2269
4048
  }], ctorParameters: function () { return [{ type: i1$2.HttpClient }]; } });
2270
4049
 
2271
- class CommercialService extends IPTGeneralService {
2272
- constructor(http) {
2273
- super();
2274
- this.http = http;
2275
- this.SERVICE_URL = 'commercial/api/';
2276
- this.SERVICE_URL = this.baseUrl() + this.SERVICE_URL;
2277
- }
2278
- createCOD(request) {
2279
- let serviceUrl = this.SERVICE_URL + 'post/cod';
2280
- this.generateRequestParams(request);
2281
- return this.http.post(serviceUrl, this.httpOptions);
2282
- }
2283
- getStudentCodHistory(token, student_id_card) {
2284
- let serviceUrl = this.SERVICE_URL + 'post/obtain/cod/history/by/student';
2285
- this.generateRequestParams({ token, student_id_card });
2286
- return this.http.post(serviceUrl, this.httpOptions);
2287
- }
2288
- getCodHistoryAll(userToken) {
2289
- let serviceUrl = this.SERVICE_URL + 'post/obtain/cod/history/all';
2290
- this.generateRequestParams(userToken);
2291
- return this.http.post(serviceUrl, this.httpOptions);
2292
- }
2293
- getCodHistoryByCourse(request) {
2294
- let serviceUrl = this.SERVICE_URL + 'post/obtain/cod/history/by/course';
2295
- this.generateRequestParams(request);
2296
- return this.http.post(serviceUrl, this.httpOptions);
2297
- }
2298
- getDiscountCoupons(params) {
2299
- let serviceUrl = this.SERVICE_URL + 'post/discount/coupon/search';
2300
- this.generateRequestParams(params);
2301
- return this.http.post(serviceUrl, this.httpOptions);
2302
- }
2303
- getCodPricesByAgreement(code) {
2304
- let serviceUrl = this.SERVICE_URL + 'get/cod/prices/by/agreement/' + code;
2305
- this.generateRequestParams(code);
2306
- return this.http.get(serviceUrl, this.httpOptions);
2307
- }
2308
- }
2309
- CommercialService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CommercialService, deps: [{ token: i1$2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
2310
- CommercialService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CommercialService, providedIn: 'root' });
2311
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CommercialService, decorators: [{
2312
- type: Injectable,
2313
- args: [{ providedIn: 'root' }]
2314
- }], ctorParameters: function () { return [{ type: i1$2.HttpClient }]; } });
2315
-
2316
4050
  class AcademicService extends IPTGeneralService {
2317
4051
  constructor(http) {
2318
4052
  super();
@@ -2478,7 +4212,8 @@ CoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13
2478
4212
  AttendanceService,
2479
4213
  CalendarService,
2480
4214
  CertificateService,
2481
- UserEktService
4215
+ UserEktService,
4216
+ CopiesService
2482
4217
  ] });
2483
4218
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CoreModule, decorators: [{
2484
4219
  type: NgModule,
@@ -2501,7 +4236,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
2501
4236
  AttendanceService,
2502
4237
  CalendarService,
2503
4238
  CertificateService,
2504
- UserEktService
4239
+ UserEktService,
4240
+ CopiesService
2505
4241
  ]
2506
4242
  }]
2507
4243
  }] });
@@ -2513,14 +4249,16 @@ DesignSystemModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", vers
2513
4249
  CoreModule,
2514
4250
  CurrencyMaskModule], exports: [ComponentsModule,
2515
4251
  CoreModule,
2516
- CurrencyMaskModule] });
4252
+ CurrencyMaskModule,
4253
+ CodModule] });
2517
4254
  DesignSystemModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: DesignSystemModule, imports: [[
2518
4255
  ComponentsModule,
2519
4256
  CoreModule,
2520
4257
  CurrencyMaskModule
2521
4258
  ], ComponentsModule,
2522
4259
  CoreModule,
2523
- CurrencyMaskModule] });
4260
+ CurrencyMaskModule,
4261
+ CodModule] });
2524
4262
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: DesignSystemModule, decorators: [{
2525
4263
  type: NgModule,
2526
4264
  args: [{
@@ -2532,7 +4270,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
2532
4270
  exports: [
2533
4271
  ComponentsModule,
2534
4272
  CoreModule,
2535
- CurrencyMaskModule
4273
+ CurrencyMaskModule,
4274
+ CodModule
2536
4275
  ],
2537
4276
  }]
2538
4277
  }] });
@@ -2621,5 +4360,5 @@ class UserLoginRs {
2621
4360
  * Generated bundle index. Do not edit.
2622
4361
  */
2623
4362
 
2624
- export { AcademicService, ActivityService, AsideButtonComponent, AttendanceService, BaseService, BudgetService, ButtonComponent, CalendarService, CertificateService, CheckboxComponent, ClassroomService, CommercialService, ComponentsModule, CoreModule, CourseService, CreateUserFormComponent, DatalistComponent, DesignSystemModule, InputComponent, LevelButtonComponent, LevelTextComponent, LoaderComponent, LoginFormComponent, MarketingService, NotesService, ParameterService, RadioComponent, RedirectGuard, SelectComponent, Session, SidenavComponent, StorageService, StudentService, SwitchService, TestService, TextLinkComponent, UserEktService, UserLoginRs, UserRs, UserService, validateCoupunts };
4363
+ export { AcademicService, ActivityService, AsideButtonComponent, AttendanceService, BaseService, BudgetService, ButtonComponent, CalculateQuotesService, CalendarService, CertificateService, CheckboxComponent, ClassroomService, CodDocumentsSectionComponent, CodFormComponent, CodFormControls, CodFormStepFiveComponent, CodFormStepFourComponent, CodFormStepOneComponent, CodFormStepThreeComponent, CodFormStepTwoComponent, CodFormSteps, CodModule, CommercialService, CommunicatorService, ComponentsModule, CopiesService, CoreModule, CourseService, CreateUserFormComponent, DatalistComponent, DesignSystemModule, InputComponent, LevelButtonComponent, LevelTextComponent, LoaderComponent, LocalStorageCODService, LoginFormComponent, MarketingService, NotesService, ParameterService, RadioComponent, RedirectGuard, SelectComponent, Session, SidenavComponent, StorageService, StudentService, SwitchService, TestService, TextLinkComponent, UserEktService, UserLoginRs, UserRs, UserService, validateCoupunts };
2625
4364
  //# sourceMappingURL=iptdevs-design-system.mjs.map