ng-pli-commons 0.0.1314 → 0.0.1315

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.
@@ -551,280 +551,6 @@
551
551
  return TasaCambioService;
552
552
  }());
553
553
 
554
- var CommonService = /** @class */ (function () {
555
- function CommonService(environment, httpClient, tasaCambioService) {
556
- this.environment = environment;
557
- this.httpClient = httpClient;
558
- this.tasaCambioService = tasaCambioService;
559
- this.headerJson = { headers: new i1$1.HttpHeaders({ 'Content-Type': 'application/json' }) };
560
- /** Notify when the currencies info change */
561
- this.currencyChanged = new rxjs.BehaviorSubject(undefined);
562
- /** Notify when the categories info change */
563
- this.categoryChanged = new rxjs.BehaviorSubject(undefined);
564
- /** Notify when the exchange rate info change */
565
- this.exchangeRateChanged = new rxjs.BehaviorSubject(undefined);
566
- /** Notify when the idioma has changed */
567
- this.languageChanged = new rxjs.BehaviorSubject(undefined);
568
- /** Notify when the process info change */
569
- this.processChanged = new rxjs.BehaviorSubject(undefined);
570
- this.initValues();
571
- }
572
- /** It has an observable to notify if the language is changed */
573
- CommonService.prototype.onLanguageChanged = function () {
574
- return this.languageChanged.asObservable();
575
- };
576
- /** It has an observable to notify if the cateogry is changed */
577
- CommonService.prototype.onCurrencyChanged = function () {
578
- return this.currencyChanged.asObservable();
579
- };
580
- /** It has an observable to notify if the category is changed */
581
- CommonService.prototype.onCategoryChanged = function () {
582
- return this.categoryChanged.asObservable();
583
- };
584
- /** It has an observable to notify if the exchange rate is changed */
585
- CommonService.prototype.onExchangeRateChanged = function () {
586
- return this.exchangeRateChanged.asObservable();
587
- };
588
- /** It has an observable to notify if the list of process is changed */
589
- CommonService.prototype.onProcessChanged = function () {
590
- return this.processChanged.asObservable();
591
- };
592
- /**
593
- * Search the info of the variables, first try to search in the local storage,
594
- * if not find info, get the info from the services
595
- */
596
- CommonService.prototype.initValues = function () {
597
- this.searchLCurrency();
598
- this.searchLCategory();
599
- this.searchLExchangeRate();
600
- this.searchLLanguage();
601
- this.searchLProcess();
602
- };
603
- /**
604
- * Remove all variables of the local storage
605
- */
606
- CommonService.prototype.reloadValues = function () {
607
- localStorage.removeItem('lCurrency');
608
- localStorage.removeItem('lCategory');
609
- localStorage.removeItem('lExchangeRate');
610
- localStorage.removeItem('lLanguage');
611
- localStorage.removeItem('lProcess');
612
- };
613
- /** Search list of currencies */
614
- CommonService.prototype.getLanguages = function () {
615
- var _this = this;
616
- this.httpClient
617
- .get(this.environment.host.backend.plis + 'idioma/getAll')
618
- .subscribe(function (lLanguage) {
619
- _this.setLLanguage(lLanguage);
620
- }, function (error) {
621
- console.error('Error - getListCurrencies -El sistema no responde', error);
622
- });
623
- };
624
- /** Search list of currencies */
625
- CommonService.prototype.getCurrencies = function () {
626
- var _this = this;
627
- this.httpClient
628
- .get(this.environment.host.backend.plis + 'moneda/getAll')
629
- .subscribe(function (lCurrency) {
630
- _this.setLCurrencies(lCurrency);
631
- }, function (error) {
632
- console.error('Error - getListCurrencies -El sistema no responde', error);
633
- });
634
- };
635
- /** Search list of categories */
636
- CommonService.prototype.getCategories = function () {
637
- var _this = this;
638
- this.httpClient
639
- .get(this.environment.host.backend.plis + 'rubro/getAll', {
640
- params: new i1$1.HttpParams().set('cargarListas', 'true')
641
- })
642
- .subscribe(function (lCategory) {
643
- _this.setLCategory(lCategory);
644
- }, function (error) {
645
- console.error('Error - getCategories -El sistema no responde', error);
646
- });
647
- };
648
- /** Search list of exchange rates */
649
- CommonService.prototype.getExchangeRate = function (date) {
650
- var _this = this;
651
- this.tasaCambioService.getAllTasaCambioLightInDate(date).subscribe(function (lExchangeRate) {
652
- _this.setLExchangeRate(lExchangeRate);
653
- }, function (error) {
654
- console.error('Error - getExchangeRate -El sistema no responde', error);
655
- });
656
- };
657
- /** Search list of exchange rates */
658
- CommonService.prototype.getProcess = function () {
659
- var _this = this;
660
- this.httpClient
661
- .get(this.environment.host.backend.plis + 'common/getAllProcesos')
662
- .subscribe(function (lProcess) {
663
- _this.setLProcess(lProcess);
664
- }, function (error) {
665
- console.error('Error - getProcess -El sistema no responde', error);
666
- });
667
- };
668
- CommonService.prototype.setLCurrencies = function (lCurrency) {
669
- for (var key in lCurrency) {
670
- var currency = Object.assign(new ngPliUtil.Moneda(), lCurrency[key]);
671
- lCurrency[key] = currency;
672
- }
673
- this.lCurrency = lCurrency;
674
- var lCurrencySlice = this.lCurrency.slice();
675
- localStorage.setItem('lCurrency', JSON.stringify(lCurrencySlice));
676
- this.currencyChanged.next(lCurrencySlice);
677
- };
678
- CommonService.prototype.setLCategory = function (lCategory) {
679
- for (var key in lCategory) {
680
- var category = Object.assign(new ngPliUtil.Rubro(), lCategory[key]);
681
- lCategory[key] = category;
682
- }
683
- this.lCategory = lCategory;
684
- var lCategorySlice = this.lCategory.slice();
685
- localStorage.setItem('lCategory', JSON.stringify(lCategorySlice));
686
- this.categoryChanged.next(lCategorySlice);
687
- };
688
- CommonService.prototype.setLLanguage = function (lLanguage) {
689
- this.lLanguage = lLanguage;
690
- var lLanguageSlice = this.lLanguage ? this.lLanguage.slice() : this.lLanguage;
691
- localStorage.setItem('lLanguage', JSON.stringify(lLanguageSlice));
692
- this.languageChanged.next(lLanguageSlice);
693
- };
694
- CommonService.prototype.setLExchangeRate = function (lExchangeRate) {
695
- for (var key in lExchangeRate) {
696
- var exchangeRate = Object.assign(new ngPliUtil.TasaCambio(), lExchangeRate[key]);
697
- lExchangeRate[key] = exchangeRate;
698
- }
699
- this.lExchangeRate = lExchangeRate;
700
- var lExchangeRateSlice = this.lExchangeRate
701
- ? this.lExchangeRate.slice()
702
- : this.lExchangeRate;
703
- localStorage.setItem('lExchangeRate', JSON.stringify(lExchangeRateSlice));
704
- this.exchangeRateChanged.next(lExchangeRateSlice);
705
- };
706
- CommonService.prototype.setLProcess = function (lProcess) {
707
- for (var key in lProcess) {
708
- var process = Object.assign(new ngPliUtil.Proceso(), lProcess[key]);
709
- lProcess[key] = process;
710
- }
711
- this.lProcess = lProcess;
712
- var lProcessSlice = this.lProcess ? this.lProcess.slice() : this.lProcess;
713
- localStorage.setItem('lProcess', JSON.stringify(lProcessSlice));
714
- this.processChanged.next(lProcessSlice);
715
- };
716
- CommonService.prototype.searchLCurrency = function () {
717
- var lCurrency = localStorage.getItem('lCurrency');
718
- if (!lCurrency || lCurrency === 'undefined') {
719
- this.getCurrencies();
720
- }
721
- else {
722
- this.setLCurrencies(JSON.parse(lCurrency));
723
- }
724
- };
725
- CommonService.prototype.searchLLanguage = function () {
726
- var lLanguage = localStorage.getItem('lLanguage');
727
- if (!lLanguage || lLanguage === 'undefined') {
728
- this.getLanguages();
729
- }
730
- else {
731
- this.setLLanguage(JSON.parse(lLanguage));
732
- }
733
- };
734
- CommonService.prototype.searchLCategory = function () {
735
- var lCategory = localStorage.getItem('lCategory');
736
- if (!lCategory || lCategory === 'undefined') {
737
- this.getCategories();
738
- }
739
- else {
740
- this.setLCategory(JSON.parse(lCategory));
741
- }
742
- };
743
- CommonService.prototype.searchLExchangeRate = function () {
744
- var searchER = false;
745
- var searchDate = ngPliUtil.DateUtil.getMomentTimeZone();
746
- // let searchDay = searchDate.date();
747
- var lExchangeRateString = localStorage.getItem('lExchangeRate');
748
- var lExchangeRate = [];
749
- if (lExchangeRateString &&
750
- lExchangeRateString != 'undefined' &&
751
- lExchangeRateString.length > 0) {
752
- lExchangeRate = JSON.parse(lExchangeRateString);
753
- if (lExchangeRate && lExchangeRate.length > 0) {
754
- var dayER = ngPliUtil.DateUtil.getFormatDateTimeZone(lExchangeRate[0].tcamFecha);
755
- if (!ngPliUtil.DateUtil.isDayEqualString(searchDate.format(), dayER)) {
756
- searchER = true;
757
- }
758
- }
759
- }
760
- else {
761
- searchER = true;
762
- }
763
- if (searchER || !lExchangeRate || lExchangeRate.length == 0) {
764
- this.getExchangeRate(searchDate.format('YYYY-MM-DD') + ' 00:00:00');
765
- }
766
- else {
767
- this.setLExchangeRate(lExchangeRate);
768
- }
769
- };
770
- CommonService.prototype.searchLProcess = function () {
771
- var lProcess = localStorage.getItem('lProcess');
772
- if (!lProcess || lProcess === 'undefined') {
773
- this.getProcess();
774
- }
775
- else {
776
- this.setLProcess(JSON.parse(lProcess));
777
- }
778
- };
779
- /**
780
- * It returns
781
- * @param html
782
- */
783
- CommonService.prototype.getBase64Pdf = function (requestPdf) {
784
- return this.httpClient.post(this.environment.host.backend.backoffice + 'pdf/getBase64Pdf', requestPdf, this.headerJson);
785
- };
786
- /**
787
- * It returns a pdf
788
- * @param lPdfRequest
789
- */
790
- CommonService.prototype.getBase64PdfList = function (lPdfRequest) {
791
- return this.httpClient.post(this.environment.host.backend.backoffice + 'pdf/getBase64PdfList', lPdfRequest, this.headerJson);
792
- };
793
- /**
794
- * It returns
795
- * @param html
796
- */
797
- CommonService.prototype.getBase64PdfByUrl = function (urlFile) {
798
- return this.httpClient.post(this.environment.host.backend.backoffice + 'pdf/getBase64PdfByUrl', urlFile, this.headerJson);
799
- };
800
- /**
801
- * It returns
802
- * @param urlFile
803
- */
804
- CommonService.prototype.getBase64ImageByUrl = function (urlFile) {
805
- return this.httpClient.post(this.environment.host.backend.backoffice + 'pdf/getBase64ImageByUrl', urlFile, this.headerJson);
806
- };
807
- /** Get the actual date */
808
- CommonService.prototype.getActualDate = function () {
809
- return this.httpClient.get(this.environment.host.backend.configuration + 'configuration/getActualDate');
810
- };
811
- CommonService.decorators = [
812
- { type: i0.Injectable, args: [{
813
- providedIn: 'root'
814
- },] }
815
- ];
816
- /** @nocollapse */
817
- CommonService.ctorParameters = function () {
818
- return [
819
- { type: undefined, decorators: [{ type: i0.Inject, args: ['environment',] }] },
820
- { type: i1$1.HttpClient },
821
- { type: TasaCambioService }
822
- ];
823
- };
824
- CommonService.ngInjectableDef = i0.defineInjectable({ factory: function CommonService_Factory() { return new CommonService(i0.inject("environment"), i0.inject(i1$1.HttpClient), i0.inject(TasaCambioService)); }, token: CommonService, providedIn: "root" });
825
- return CommonService;
826
- }());
827
-
828
554
  var HashService = /** @class */ (function () {
829
555
  function HashService(environment, httpClient) {
830
556
  this.environment = environment;
@@ -938,56 +664,204 @@
938
664
  }, function (error) { return reject(errorMessage); });
939
665
  });
940
666
  };
941
- AuthenticationService.prototype.getLink = function (patCodigo) {
942
- return __awaiter(this, void 0, void 0, function () {
943
- var logoutUrl, loginUrl, idPatrocinador, idPlataforma, hash, error_1;
944
- return __generator(this, function (_a) {
945
- switch (_a.label) {
946
- case 0:
947
- logoutUrl = '';
948
- loginUrl = new URL(this.environment.host.frontend.login);
949
- idPatrocinador = loginUrl.searchParams.get('idPatrocinador');
950
- idPlataforma = loginUrl.searchParams.get('idPlataforma');
951
- loginUrl.searchParams.append('idPatrocinadorPLIC', patCodigo);
952
- _a.label = 1;
953
- case 1:
954
- _a.trys.push([1, 3, , 4]);
955
- return [4 /*yield*/, this.getHash(idPatrocinador, idPlataforma, patCodigo)];
956
- case 2:
957
- hash = _a.sent();
958
- loginUrl.searchParams.set('hash', hash);
959
- logoutUrl = loginUrl.href;
960
- return [3 /*break*/, 4];
961
- case 3:
962
- error_1 = _a.sent();
963
- return [3 /*break*/, 4];
964
- case 4: return [2 /*return*/, logoutUrl];
965
- }
966
- });
667
+ AuthenticationService.prototype.getLink = function (patCodigo) {
668
+ return __awaiter(this, void 0, void 0, function () {
669
+ var logoutUrl, loginUrl, idPatrocinador, idPlataforma, hash, error_1;
670
+ return __generator(this, function (_a) {
671
+ switch (_a.label) {
672
+ case 0:
673
+ logoutUrl = '';
674
+ loginUrl = new URL(this.environment.host.frontend.login);
675
+ idPatrocinador = loginUrl.searchParams.get('idPatrocinador');
676
+ idPlataforma = loginUrl.searchParams.get('idPlataforma');
677
+ loginUrl.searchParams.append('idPatrocinadorPLIC', patCodigo);
678
+ _a.label = 1;
679
+ case 1:
680
+ _a.trys.push([1, 3, , 4]);
681
+ return [4 /*yield*/, this.getHash(idPatrocinador, idPlataforma, patCodigo)];
682
+ case 2:
683
+ hash = _a.sent();
684
+ loginUrl.searchParams.set('hash', hash);
685
+ logoutUrl = loginUrl.href;
686
+ return [3 /*break*/, 4];
687
+ case 3:
688
+ error_1 = _a.sent();
689
+ return [3 /*break*/, 4];
690
+ case 4: return [2 /*return*/, logoutUrl];
691
+ }
692
+ });
693
+ });
694
+ };
695
+ AuthenticationService.decorators = [
696
+ { type: i0.Injectable, args: [{
697
+ providedIn: 'root'
698
+ },] }
699
+ ];
700
+ /** @nocollapse */
701
+ AuthenticationService.ctorParameters = function () {
702
+ return [
703
+ { type: undefined, decorators: [{ type: i0.Inject, args: ['environment',] }] },
704
+ { type: i1$1.HttpClient },
705
+ { type: HashService }
706
+ ];
707
+ };
708
+ AuthenticationService.ngInjectableDef = i0.defineInjectable({ factory: function AuthenticationService_Factory() { return new AuthenticationService(i0.inject("environment"), i0.inject(i1$1.HttpClient), i0.inject(HashService)); }, token: AuthenticationService, providedIn: "root" });
709
+ return AuthenticationService;
710
+ }());
711
+
712
+ var StatusService = /** @class */ (function () {
713
+ function StatusService(environment, httpClient, authService) {
714
+ this.environment = environment;
715
+ this.httpClient = httpClient;
716
+ this.authService = authService;
717
+ this.headerJson = { headers: new i1$1.HttpHeaders({ 'Content-Type': 'application/json' }) };
718
+ }
719
+ /** It returns all list of status by prom code */
720
+ StatusService.prototype.getById = function (statusId) {
721
+ return this.httpClient.get(this.environment.host.backend.configuration + 'pliCnfStatus/getById', { params: new i1$1.HttpParams().set('statusId', statusId.toString()) });
722
+ };
723
+ /** It returns all list of status by prom code */
724
+ StatusService.prototype.getAllByPromCode = function (promCode) {
725
+ return this.httpClient.get(this.environment.host.backend.configuration + 'pliCnfStatus/getAllByPromCode', { params: new i1$1.HttpParams().set('promCodigo', promCode.toString()) });
726
+ };
727
+ /** It returns all list of status by prom code */
728
+ StatusService.prototype.getAllByPromCodeAndName = function (promCode, name) {
729
+ return this.httpClient.get(this.environment.host.backend.configuration + 'pliCnfStatus/getAllByPromCodeAndName', { params: new i1$1.HttpParams().set('promCodigo', promCode.toString()).set('name', name) });
730
+ };
731
+ StatusService.prototype.getFinalStatusByStaticInteraction = function (promCode, staticInteractionId) {
732
+ return this.httpClient.get(this.environment.host.backend.configuration +
733
+ 'pliCnfStatus/getFinalStatusByStaticInteraction', {
734
+ params: new i1$1.HttpParams()
735
+ .set('promCodigo', promCode.toString())
736
+ .set('staticInteractionId', staticInteractionId.toString())
737
+ });
738
+ };
739
+ /** It returns all list of status by prom code */
740
+ StatusService.prototype.getInitialStatusByPromCode = function (promCode) {
741
+ return this.httpClient.get(this.environment.host.backend.configuration + 'pliCnfStatus/getInitialStatusByPromCode', { params: new i1$1.HttpParams().set('promCodigo', promCode.toString()) });
742
+ };
743
+ StatusService.prototype.save = function (cnfStatus) {
744
+ return this.httpClient.post(this.environment.host.backend.configuration + 'pliCnfStatus/save', cnfStatus, ngPliUtil.HEADER_JSON);
745
+ };
746
+ StatusService.prototype.getStatusByPromcodigoAndPageSection = function (promCodigo, pageId) {
747
+ return this.httpClient.get(this.environment.host.backend.configuration +
748
+ 'pliCnfStatus/getStatusByPromcodigoAndPageSection', {
749
+ params: new i1$1.HttpParams()
750
+ .set('promCodigo', promCodigo.toString())
751
+ .set('pageId', pageId.toString())
752
+ });
753
+ };
754
+ StatusService.prototype.getStatusByPromCodigoAndCategoryId = function (promCodigo, categoryId) {
755
+ return this.httpClient.get(this.environment.host.backend.configuration +
756
+ 'pliCnfStatus/getStatusByPromCodigoAndCategoryId', {
757
+ params: new i1$1.HttpParams()
758
+ .set('promCodigo', promCodigo.toString())
759
+ .set('categoryId', categoryId.toString())
760
+ });
761
+ };
762
+ StatusService.prototype.getByInitialStatusAndPromCodigoAndCategoryId = function (initialStatus, promCodigo, categoryId) {
763
+ return this.httpClient.get(this.environment.host.backend.configuration +
764
+ 'pliCnfStatus/getByInitialStatusAndPromCodigoAndCategoryId', {
765
+ params: new i1$1.HttpParams()
766
+ .set('initialStatus', initialStatus.toString())
767
+ .set('promCodigo', promCodigo.toString())
768
+ .set('categoryId', categoryId.toString())
769
+ });
770
+ };
771
+ StatusService.prototype.getByPromCodigoAndFinalStatus = function (promCodigo, finalStatus) {
772
+ return this.httpClient.get(this.environment.host.backend.configuration +
773
+ 'pliCnfStatus/getByPromCodigoAndFinalStatus', {
774
+ params: new i1$1.HttpParams()
775
+ .set('promCodigo', promCodigo.toString())
776
+ .set('finalStatus', finalStatus.toString())
777
+ });
778
+ };
779
+ StatusService.prototype.getInitialStatusByStaticInteraction = function (promCodigo, staticInteractionId) {
780
+ return this.httpClient.get(this.environment.host.backend.configuration +
781
+ 'pliCnfStatus/getInitialStatusByStaticInteraction', {
782
+ params: new i1$1.HttpParams()
783
+ .set('promCodigo', promCodigo)
784
+ .set('staticInteractionId', staticInteractionId)
785
+ });
786
+ };
787
+ StatusService.prototype.getConfigCloningStatusMap = function (lStatus) {
788
+ return this.httpClient.post(this.environment.host.backend.configuration + 'pliCnfStatus/getConfigCloningStatusMap', lStatus);
789
+ };
790
+ StatusService.decorators = [
791
+ { type: i0.Injectable, args: [{
792
+ providedIn: 'root'
793
+ },] }
794
+ ];
795
+ /** @nocollapse */
796
+ StatusService.ctorParameters = function () {
797
+ return [
798
+ { type: undefined, decorators: [{ type: i0.Inject, args: ['environment',] }] },
799
+ { type: i1$1.HttpClient },
800
+ { type: AuthenticationService }
801
+ ];
802
+ };
803
+ StatusService.ngInjectableDef = i0.defineInjectable({ factory: function StatusService_Factory() { return new StatusService(i0.inject("environment"), i0.inject(i1$1.HttpClient), i0.inject(AuthenticationService)); }, token: StatusService, providedIn: "root" });
804
+ return StatusService;
805
+ }());
806
+
807
+ var ConfigurationService = /** @class */ (function () {
808
+ function ConfigurationService(environment, httpClient) {
809
+ this.environment = environment;
810
+ this.httpClient = httpClient;
811
+ }
812
+ /** Get the actual date */
813
+ ConfigurationService.prototype.getActualDate = function () {
814
+ return this.httpClient.get(this.environment.host.backend.configuration + 'configuration/getActualDate');
815
+ };
816
+ /** Get the actual date */
817
+ ConfigurationService.prototype.getDate = function (date) {
818
+ if (date === void 0) {
819
+ date = undefined;
820
+ }
821
+ date = date === undefined ? null : date;
822
+ // if (date !== undefined) {
823
+ return this.httpClient.post(this.environment.host.backend.configuration + 'configuration/getDate', date, ngPliUtil.HEADER_JSON);
824
+ // } else {
825
+ // return this.httpClient.post(
826
+ // this.environment.host.backend.configuration + 'configuration/getDate',
827
+ // null,
828
+ // HEADER_JSON
829
+ // );
830
+ // }
831
+ // return this.httpClient.get(
832
+ // this.environment.host.backend.configuration + 'configuration/getActualDate'
833
+ // );
834
+ };
835
+ ConfigurationService.prototype.getFileByUrl = function (url, name) {
836
+ var headers = new i1$1.HttpHeaders();
837
+ headers.set('Accept', 'application/pdf');
838
+ headers.set('Authorization', 'Bearer ' + ngPliUtil.AuthenticationUtil.getToken());
839
+ return this.httpClient.get(this.environment.host.backend.configuration + 'configuration/getFileByUrl', {
840
+ params: new i1$1.HttpParams().set('url', url).set('name', name),
841
+ headers: headers,
842
+ responseType: 'blob'
967
843
  });
968
844
  };
969
- AuthenticationService.decorators = [
845
+ ConfigurationService.decorators = [
970
846
  { type: i0.Injectable, args: [{
971
847
  providedIn: 'root'
972
848
  },] }
973
849
  ];
974
850
  /** @nocollapse */
975
- AuthenticationService.ctorParameters = function () {
851
+ ConfigurationService.ctorParameters = function () {
976
852
  return [
977
853
  { type: undefined, decorators: [{ type: i0.Inject, args: ['environment',] }] },
978
- { type: i1$1.HttpClient },
979
- { type: HashService }
854
+ { type: i1$1.HttpClient }
980
855
  ];
981
856
  };
982
- AuthenticationService.ngInjectableDef = i0.defineInjectable({ factory: function AuthenticationService_Factory() { return new AuthenticationService(i0.inject("environment"), i0.inject(i1$1.HttpClient), i0.inject(HashService)); }, token: AuthenticationService, providedIn: "root" });
983
- return AuthenticationService;
857
+ ConfigurationService.ngInjectableDef = i0.defineInjectable({ factory: function ConfigurationService_Factory() { return new ConfigurationService(i0.inject("environment"), i0.inject(i1$1.HttpClient)); }, token: ConfigurationService, providedIn: "root" });
858
+ return ConfigurationService;
984
859
  }());
985
860
 
986
861
  var PppService = /** @class */ (function () {
987
- function PppService(environment, httpClient, authService) {
862
+ function PppService(environment, httpClient) {
988
863
  this.environment = environment;
989
864
  this.httpClient = httpClient;
990
- this.authService = authService;
991
865
  this.headerJson = { headers: new i1$1.HttpHeaders({ 'Content-Type': 'application/json' }) };
992
866
  /** This observable allows to verify if ppp is created */
993
867
  this.subjectPpp = new rxjs.BehaviorSubject(undefined);
@@ -1583,25 +1457,317 @@
1583
1457
  }
1584
1458
  }
1585
1459
  }
1586
- return lPliPatrocinador;
1460
+ return lPliPatrocinador;
1461
+ };
1462
+ /** It contains the key of the json web token */
1463
+ PppService.TOKEN_PPP = 'tokenPpp';
1464
+ PppService.decorators = [
1465
+ { type: i0.Injectable, args: [{
1466
+ providedIn: 'root'
1467
+ },] }
1468
+ ];
1469
+ /** @nocollapse */
1470
+ PppService.ctorParameters = function () {
1471
+ return [
1472
+ { type: undefined, decorators: [{ type: i0.Inject, args: ['environment',] }] },
1473
+ { type: i1$1.HttpClient }
1474
+ ];
1475
+ };
1476
+ PppService.ngInjectableDef = i0.defineInjectable({ factory: function PppService_Factory() { return new PppService(i0.inject("environment"), i0.inject(i1$1.HttpClient)); }, token: PppService, providedIn: "root" });
1477
+ return PppService;
1478
+ }());
1479
+
1480
+ var CommonService = /** @class */ (function () {
1481
+ function CommonService(environment, httpClient, tasaCambioService, pppService, statusService, configurationService) {
1482
+ this.environment = environment;
1483
+ this.httpClient = httpClient;
1484
+ this.tasaCambioService = tasaCambioService;
1485
+ this.pppService = pppService;
1486
+ this.statusService = statusService;
1487
+ this.configurationService = configurationService;
1488
+ this.headerJson = { headers: new i1$1.HttpHeaders({ 'Content-Type': 'application/json' }) };
1489
+ /** Notify when the currencies info change */
1490
+ this.currencyChanged = new rxjs.BehaviorSubject(undefined);
1491
+ /** Notify when the categories info change */
1492
+ this.categoryChanged = new rxjs.BehaviorSubject(undefined);
1493
+ /** Notify when the exchange rate info change */
1494
+ this.exchangeRateChanged = new rxjs.BehaviorSubject(undefined);
1495
+ /** Notify when the idioma has changed */
1496
+ this.languageChanged = new rxjs.BehaviorSubject(undefined);
1497
+ /** Notify when the process info change */
1498
+ this.processChanged = new rxjs.BehaviorSubject(undefined);
1499
+ this.initValues();
1500
+ }
1501
+ /** It has an observable to notify if the language is changed */
1502
+ CommonService.prototype.onLanguageChanged = function () {
1503
+ return this.languageChanged.asObservable();
1504
+ };
1505
+ /** It has an observable to notify if the cateogry is changed */
1506
+ CommonService.prototype.onCurrencyChanged = function () {
1507
+ return this.currencyChanged.asObservable();
1508
+ };
1509
+ /** It has an observable to notify if the category is changed */
1510
+ CommonService.prototype.onCategoryChanged = function () {
1511
+ return this.categoryChanged.asObservable();
1512
+ };
1513
+ /** It has an observable to notify if the exchange rate is changed */
1514
+ CommonService.prototype.onExchangeRateChanged = function () {
1515
+ return this.exchangeRateChanged.asObservable();
1516
+ };
1517
+ /** It has an observable to notify if the list of process is changed */
1518
+ CommonService.prototype.onProcessChanged = function () {
1519
+ return this.processChanged.asObservable();
1520
+ };
1521
+ /**
1522
+ * Search the info of the variables, first try to search in the local storage,
1523
+ * if not find info, get the info from the services
1524
+ */
1525
+ CommonService.prototype.initValues = function () {
1526
+ this.searchLCurrency();
1527
+ this.searchLCategory();
1528
+ this.searchLExchangeRate();
1529
+ this.searchLLanguage();
1530
+ this.searchLProcess();
1531
+ };
1532
+ /**
1533
+ * Remove all variables of the local storage
1534
+ */
1535
+ CommonService.prototype.reloadValues = function () {
1536
+ localStorage.removeItem('lCurrency');
1537
+ localStorage.removeItem('lCategory');
1538
+ localStorage.removeItem('lExchangeRate');
1539
+ localStorage.removeItem('lLanguage');
1540
+ localStorage.removeItem('lProcess');
1541
+ };
1542
+ /** Search list of currencies */
1543
+ CommonService.prototype.getLanguages = function () {
1544
+ var _this = this;
1545
+ this.httpClient
1546
+ .get(this.environment.host.backend.plis + 'idioma/getAll')
1547
+ .subscribe(function (lLanguage) {
1548
+ _this.setLLanguage(lLanguage);
1549
+ }, function (error) {
1550
+ console.error('Error - getListCurrencies -El sistema no responde', error);
1551
+ });
1552
+ };
1553
+ /** Search list of currencies */
1554
+ CommonService.prototype.getCurrencies = function () {
1555
+ var _this = this;
1556
+ this.httpClient
1557
+ .get(this.environment.host.backend.plis + 'moneda/getAll')
1558
+ .subscribe(function (lCurrency) {
1559
+ _this.setLCurrencies(lCurrency);
1560
+ }, function (error) {
1561
+ console.error('Error - getListCurrencies -El sistema no responde', error);
1562
+ });
1563
+ };
1564
+ /** Search list of categories */
1565
+ CommonService.prototype.getCategories = function () {
1566
+ var _this = this;
1567
+ this.httpClient
1568
+ .get(this.environment.host.backend.plis + 'rubro/getAll', {
1569
+ params: new i1$1.HttpParams().set('cargarListas', 'true')
1570
+ })
1571
+ .subscribe(function (lCategory) {
1572
+ _this.setLCategory(lCategory);
1573
+ }, function (error) {
1574
+ console.error('Error - getCategories -El sistema no responde', error);
1575
+ });
1576
+ };
1577
+ /** Search list of exchange rates */
1578
+ CommonService.prototype.getExchangeRate = function (date) {
1579
+ var _this = this;
1580
+ this.tasaCambioService.getAllTasaCambioLightInDate(date).subscribe(function (lExchangeRate) {
1581
+ _this.setLExchangeRate(lExchangeRate);
1582
+ }, function (error) {
1583
+ console.error('Error - getExchangeRate -El sistema no responde', error);
1584
+ });
1585
+ };
1586
+ /** Search list of exchange rates */
1587
+ CommonService.prototype.getProcess = function () {
1588
+ var _this = this;
1589
+ this.httpClient
1590
+ .get(this.environment.host.backend.plis + 'common/getAllProcesos')
1591
+ .subscribe(function (lProcess) {
1592
+ _this.setLProcess(lProcess);
1593
+ }, function (error) {
1594
+ console.error('Error - getProcess -El sistema no responde', error);
1595
+ });
1596
+ };
1597
+ CommonService.prototype.setLCurrencies = function (lCurrency) {
1598
+ for (var key in lCurrency) {
1599
+ var currency = Object.assign(new ngPliUtil.Moneda(), lCurrency[key]);
1600
+ lCurrency[key] = currency;
1601
+ }
1602
+ this.lCurrency = lCurrency;
1603
+ var lCurrencySlice = this.lCurrency.slice();
1604
+ localStorage.setItem('lCurrency', JSON.stringify(lCurrencySlice));
1605
+ this.currencyChanged.next(lCurrencySlice);
1606
+ };
1607
+ CommonService.prototype.setLCategory = function (lCategory) {
1608
+ for (var key in lCategory) {
1609
+ var category = Object.assign(new ngPliUtil.Rubro(), lCategory[key]);
1610
+ lCategory[key] = category;
1611
+ }
1612
+ this.lCategory = lCategory;
1613
+ var lCategorySlice = this.lCategory.slice();
1614
+ localStorage.setItem('lCategory', JSON.stringify(lCategorySlice));
1615
+ this.categoryChanged.next(lCategorySlice);
1616
+ };
1617
+ CommonService.prototype.setLLanguage = function (lLanguage) {
1618
+ this.lLanguage = lLanguage;
1619
+ var lLanguageSlice = this.lLanguage ? this.lLanguage.slice() : this.lLanguage;
1620
+ localStorage.setItem('lLanguage', JSON.stringify(lLanguageSlice));
1621
+ this.languageChanged.next(lLanguageSlice);
1622
+ };
1623
+ CommonService.prototype.setLExchangeRate = function (lExchangeRate) {
1624
+ for (var key in lExchangeRate) {
1625
+ var exchangeRate = Object.assign(new ngPliUtil.TasaCambio(), lExchangeRate[key]);
1626
+ lExchangeRate[key] = exchangeRate;
1627
+ }
1628
+ this.lExchangeRate = lExchangeRate;
1629
+ var lExchangeRateSlice = this.lExchangeRate
1630
+ ? this.lExchangeRate.slice()
1631
+ : this.lExchangeRate;
1632
+ localStorage.setItem('lExchangeRate', JSON.stringify(lExchangeRateSlice));
1633
+ this.exchangeRateChanged.next(lExchangeRateSlice);
1634
+ };
1635
+ CommonService.prototype.setLProcess = function (lProcess) {
1636
+ for (var key in lProcess) {
1637
+ var process = Object.assign(new ngPliUtil.Proceso(), lProcess[key]);
1638
+ lProcess[key] = process;
1639
+ }
1640
+ this.lProcess = lProcess;
1641
+ var lProcessSlice = this.lProcess ? this.lProcess.slice() : this.lProcess;
1642
+ localStorage.setItem('lProcess', JSON.stringify(lProcessSlice));
1643
+ this.processChanged.next(lProcessSlice);
1644
+ };
1645
+ CommonService.prototype.searchLCurrency = function () {
1646
+ var lCurrency = localStorage.getItem('lCurrency');
1647
+ if (!lCurrency || lCurrency === 'undefined') {
1648
+ this.getCurrencies();
1649
+ }
1650
+ else {
1651
+ this.setLCurrencies(JSON.parse(lCurrency));
1652
+ }
1653
+ };
1654
+ CommonService.prototype.searchLLanguage = function () {
1655
+ var lLanguage = localStorage.getItem('lLanguage');
1656
+ if (!lLanguage || lLanguage === 'undefined') {
1657
+ this.getLanguages();
1658
+ }
1659
+ else {
1660
+ this.setLLanguage(JSON.parse(lLanguage));
1661
+ }
1662
+ };
1663
+ CommonService.prototype.searchLCategory = function () {
1664
+ var lCategory = localStorage.getItem('lCategory');
1665
+ if (!lCategory || lCategory === 'undefined') {
1666
+ this.getCategories();
1667
+ }
1668
+ else {
1669
+ this.setLCategory(JSON.parse(lCategory));
1670
+ }
1671
+ };
1672
+ CommonService.prototype.searchLExchangeRate = function () {
1673
+ var searchER = false;
1674
+ var searchDate = ngPliUtil.DateUtil.getMomentTimeZone();
1675
+ // let searchDay = searchDate.date();
1676
+ var lExchangeRateString = localStorage.getItem('lExchangeRate');
1677
+ var lExchangeRate = [];
1678
+ if (lExchangeRateString &&
1679
+ lExchangeRateString != 'undefined' &&
1680
+ lExchangeRateString.length > 0) {
1681
+ lExchangeRate = JSON.parse(lExchangeRateString);
1682
+ if (lExchangeRate && lExchangeRate.length > 0) {
1683
+ var dayER = ngPliUtil.DateUtil.getFormatDateTimeZone(lExchangeRate[0].tcamFecha);
1684
+ if (!ngPliUtil.DateUtil.isDayEqualString(searchDate.format(), dayER)) {
1685
+ searchER = true;
1686
+ }
1687
+ }
1688
+ }
1689
+ else {
1690
+ searchER = true;
1691
+ }
1692
+ if (searchER || !lExchangeRate || lExchangeRate.length == 0) {
1693
+ this.getExchangeRate(searchDate.format('YYYY-MM-DD') + ' 00:00:00');
1694
+ }
1695
+ else {
1696
+ this.setLExchangeRate(lExchangeRate);
1697
+ }
1587
1698
  };
1588
- /** It contains the key of the json web token */
1589
- PppService.TOKEN_PPP = 'tokenPpp';
1590
- PppService.decorators = [
1699
+ CommonService.prototype.searchLProcess = function () {
1700
+ var lProcess = localStorage.getItem('lProcess');
1701
+ if (!lProcess || lProcess === 'undefined') {
1702
+ this.getProcess();
1703
+ }
1704
+ else {
1705
+ this.setLProcess(JSON.parse(lProcess));
1706
+ }
1707
+ };
1708
+ /**
1709
+ * It returns
1710
+ * @param html
1711
+ */
1712
+ CommonService.prototype.getBase64Pdf = function (requestPdf) {
1713
+ return this.httpClient.post(this.environment.host.backend.backoffice + 'pdf/getBase64Pdf', requestPdf, this.headerJson);
1714
+ };
1715
+ /**
1716
+ * It returns a pdf
1717
+ * @param lPdfRequest
1718
+ */
1719
+ CommonService.prototype.getBase64PdfList = function (lPdfRequest) {
1720
+ return this.httpClient.post(this.environment.host.backend.backoffice + 'pdf/getBase64PdfList', lPdfRequest, this.headerJson);
1721
+ };
1722
+ /**
1723
+ * It returns
1724
+ * @param html
1725
+ */
1726
+ CommonService.prototype.getBase64PdfByUrl = function (urlFile) {
1727
+ return this.httpClient.post(this.environment.host.backend.backoffice + 'pdf/getBase64PdfByUrl', urlFile, this.headerJson);
1728
+ };
1729
+ /**
1730
+ * It returns
1731
+ * @param urlFile
1732
+ */
1733
+ CommonService.prototype.getBase64ImageByUrl = function (urlFile) {
1734
+ return this.httpClient.post(this.environment.host.backend.backoffice + 'pdf/getBase64ImageByUrl', urlFile, this.headerJson);
1735
+ };
1736
+ /** Get the actual date */
1737
+ CommonService.prototype.getActualDate = function () {
1738
+ return this.httpClient.get(this.environment.host.backend.configuration + 'configuration/getActualDate');
1739
+ };
1740
+ /** Get the actual date */
1741
+ CommonService.prototype.validateCloseApplicationProcess = function (promCodigo, appStateId, cnfIniStateId) {
1742
+ var params = new i1$1.HttpParams()
1743
+ .set('promCodigo', promCodigo.toString())
1744
+ .set('appStateId', appStateId.toString());
1745
+ if (cnfIniStateId != undefined) {
1746
+ params.set('cnfIniStateId', cnfIniStateId.toString());
1747
+ }
1748
+ return this.httpClient.get(this.environment.host.backend.configuration +
1749
+ 'configuration/validateCloseApplicationProcess', {
1750
+ params: params
1751
+ });
1752
+ };
1753
+ CommonService.decorators = [
1591
1754
  { type: i0.Injectable, args: [{
1592
1755
  providedIn: 'root'
1593
1756
  },] }
1594
1757
  ];
1595
1758
  /** @nocollapse */
1596
- PppService.ctorParameters = function () {
1759
+ CommonService.ctorParameters = function () {
1597
1760
  return [
1598
1761
  { type: undefined, decorators: [{ type: i0.Inject, args: ['environment',] }] },
1599
1762
  { type: i1$1.HttpClient },
1600
- { type: AuthenticationService }
1763
+ { type: TasaCambioService },
1764
+ { type: PppService },
1765
+ { type: StatusService },
1766
+ { type: ConfigurationService }
1601
1767
  ];
1602
1768
  };
1603
- PppService.ngInjectableDef = i0.defineInjectable({ factory: function PppService_Factory() { return new PppService(i0.inject("environment"), i0.inject(i1$1.HttpClient), i0.inject(AuthenticationService)); }, token: PppService, providedIn: "root" });
1604
- return PppService;
1769
+ CommonService.ngInjectableDef = i0.defineInjectable({ factory: function CommonService_Factory() { return new CommonService(i0.inject("environment"), i0.inject(i1$1.HttpClient), i0.inject(TasaCambioService), i0.inject(PppService), i0.inject(StatusService), i0.inject(ConfigurationService)); }, token: CommonService, providedIn: "root" });
1770
+ return CommonService;
1605
1771
  }());
1606
1772
 
1607
1773
  var BudgetService = /** @class */ (function () {
@@ -12403,101 +12569,6 @@
12403
12569
  return SponsorshipLetterService;
12404
12570
  }());
12405
12571
 
12406
- var StatusService = /** @class */ (function () {
12407
- function StatusService(environment, httpClient, authService) {
12408
- this.environment = environment;
12409
- this.httpClient = httpClient;
12410
- this.authService = authService;
12411
- this.headerJson = { headers: new i1$1.HttpHeaders({ 'Content-Type': 'application/json' }) };
12412
- }
12413
- /** It returns all list of status by prom code */
12414
- StatusService.prototype.getById = function (statusId) {
12415
- return this.httpClient.get(this.environment.host.backend.configuration + 'pliCnfStatus/getById', { params: new i1$1.HttpParams().set('statusId', statusId.toString()) });
12416
- };
12417
- /** It returns all list of status by prom code */
12418
- StatusService.prototype.getAllByPromCode = function (promCode) {
12419
- return this.httpClient.get(this.environment.host.backend.configuration + 'pliCnfStatus/getAllByPromCode', { params: new i1$1.HttpParams().set('promCodigo', promCode.toString()) });
12420
- };
12421
- /** It returns all list of status by prom code */
12422
- StatusService.prototype.getAllByPromCodeAndName = function (promCode, name) {
12423
- return this.httpClient.get(this.environment.host.backend.configuration + 'pliCnfStatus/getAllByPromCodeAndName', { params: new i1$1.HttpParams().set('promCodigo', promCode.toString()).set('name', name) });
12424
- };
12425
- StatusService.prototype.getFinalStatusByStaticInteraction = function (promCode, staticInteractionId) {
12426
- return this.httpClient.get(this.environment.host.backend.configuration +
12427
- 'pliCnfStatus/getFinalStatusByStaticInteraction', {
12428
- params: new i1$1.HttpParams()
12429
- .set('promCodigo', promCode.toString())
12430
- .set('staticInteractionId', staticInteractionId.toString())
12431
- });
12432
- };
12433
- /** It returns all list of status by prom code */
12434
- StatusService.prototype.getInitialStatusByPromCode = function (promCode) {
12435
- return this.httpClient.get(this.environment.host.backend.configuration + 'pliCnfStatus/getInitialStatusByPromCode', { params: new i1$1.HttpParams().set('promCodigo', promCode.toString()) });
12436
- };
12437
- StatusService.prototype.save = function (cnfStatus) {
12438
- return this.httpClient.post(this.environment.host.backend.configuration + 'pliCnfStatus/save', cnfStatus, ngPliUtil.HEADER_JSON);
12439
- };
12440
- StatusService.prototype.getStatusByPromcodigoAndPageSection = function (promCodigo, pageId) {
12441
- return this.httpClient.get(this.environment.host.backend.configuration +
12442
- 'pliCnfStatus/getStatusByPromcodigoAndPageSection', {
12443
- params: new i1$1.HttpParams()
12444
- .set('promCodigo', promCodigo.toString())
12445
- .set('pageId', pageId.toString())
12446
- });
12447
- };
12448
- StatusService.prototype.getStatusByPromCodigoAndCategoryId = function (promCodigo, categoryId) {
12449
- return this.httpClient.get(this.environment.host.backend.configuration +
12450
- 'pliCnfStatus/getStatusByPromCodigoAndCategoryId', {
12451
- params: new i1$1.HttpParams()
12452
- .set('promCodigo', promCodigo.toString())
12453
- .set('categoryId', categoryId.toString())
12454
- });
12455
- };
12456
- StatusService.prototype.getByInitialStatusAndPromCodigoAndCategoryId = function (initialStatus, promCodigo, categoryId) {
12457
- return this.httpClient.get(this.environment.host.backend.configuration +
12458
- 'pliCnfStatus/getByInitialStatusAndPromCodigoAndCategoryId', {
12459
- params: new i1$1.HttpParams()
12460
- .set('initialStatus', initialStatus.toString())
12461
- .set('promCodigo', promCodigo.toString())
12462
- .set('categoryId', categoryId.toString())
12463
- });
12464
- };
12465
- StatusService.prototype.getByPromCodigoAndFinalStatus = function (promCodigo, finalStatus) {
12466
- return this.httpClient.get(this.environment.host.backend.configuration +
12467
- 'pliCnfStatus/getByPromCodigoAndFinalStatus', {
12468
- params: new i1$1.HttpParams()
12469
- .set('promCodigo', promCodigo.toString())
12470
- .set('finalStatus', finalStatus.toString())
12471
- });
12472
- };
12473
- StatusService.prototype.getInitialStatusByStaticInteraction = function (promCodigo, staticInteractionId) {
12474
- return this.httpClient.get(this.environment.host.backend.configuration +
12475
- 'pliCnfStatus/getInitialStatusByStaticInteraction', {
12476
- params: new i1$1.HttpParams()
12477
- .set('promCodigo', promCodigo)
12478
- .set('staticInteractionId', staticInteractionId)
12479
- });
12480
- };
12481
- StatusService.prototype.getConfigCloningStatusMap = function (lStatus) {
12482
- return this.httpClient.post(this.environment.host.backend.configuration + 'pliCnfStatus/getConfigCloningStatusMap', lStatus);
12483
- };
12484
- StatusService.decorators = [
12485
- { type: i0.Injectable, args: [{
12486
- providedIn: 'root'
12487
- },] }
12488
- ];
12489
- /** @nocollapse */
12490
- StatusService.ctorParameters = function () {
12491
- return [
12492
- { type: undefined, decorators: [{ type: i0.Inject, args: ['environment',] }] },
12493
- { type: i1$1.HttpClient },
12494
- { type: AuthenticationService }
12495
- ];
12496
- };
12497
- StatusService.ngInjectableDef = i0.defineInjectable({ factory: function StatusService_Factory() { return new StatusService(i0.inject("environment"), i0.inject(i1$1.HttpClient), i0.inject(AuthenticationService)); }, token: StatusService, providedIn: "root" });
12498
- return StatusService;
12499
- }());
12500
-
12501
12572
  var UserService = /** @class */ (function () {
12502
12573
  function UserService(environment, httpClient) {
12503
12574
  this.environment = environment;
@@ -12555,60 +12626,6 @@
12555
12626
  return PliCnfBudgetService;
12556
12627
  }());
12557
12628
 
12558
- var ConfigurationService = /** @class */ (function () {
12559
- function ConfigurationService(environment, httpClient) {
12560
- this.environment = environment;
12561
- this.httpClient = httpClient;
12562
- }
12563
- /** Get the actual date */
12564
- ConfigurationService.prototype.getActualDate = function () {
12565
- return this.httpClient.get(this.environment.host.backend.configuration + 'configuration/getActualDate');
12566
- };
12567
- /** Get the actual date */
12568
- ConfigurationService.prototype.getDate = function (date) {
12569
- if (date === void 0) {
12570
- date = undefined;
12571
- }
12572
- date = date === undefined ? null : date;
12573
- // if (date !== undefined) {
12574
- return this.httpClient.post(this.environment.host.backend.configuration + 'configuration/getDate', date, ngPliUtil.HEADER_JSON);
12575
- // } else {
12576
- // return this.httpClient.post(
12577
- // this.environment.host.backend.configuration + 'configuration/getDate',
12578
- // null,
12579
- // HEADER_JSON
12580
- // );
12581
- // }
12582
- // return this.httpClient.get(
12583
- // this.environment.host.backend.configuration + 'configuration/getActualDate'
12584
- // );
12585
- };
12586
- ConfigurationService.prototype.getFileByUrl = function (url, name) {
12587
- var headers = new i1$1.HttpHeaders();
12588
- headers.set('Accept', 'application/pdf');
12589
- headers.set('Authorization', 'Bearer ' + ngPliUtil.AuthenticationUtil.getToken());
12590
- return this.httpClient.get(this.environment.host.backend.configuration + 'configuration/getFileByUrl', {
12591
- params: new i1$1.HttpParams().set('url', url).set('name', name),
12592
- headers: headers,
12593
- responseType: 'blob'
12594
- });
12595
- };
12596
- ConfigurationService.decorators = [
12597
- { type: i0.Injectable, args: [{
12598
- providedIn: 'root'
12599
- },] }
12600
- ];
12601
- /** @nocollapse */
12602
- ConfigurationService.ctorParameters = function () {
12603
- return [
12604
- { type: undefined, decorators: [{ type: i0.Inject, args: ['environment',] }] },
12605
- { type: i1$1.HttpClient }
12606
- ];
12607
- };
12608
- ConfigurationService.ngInjectableDef = i0.defineInjectable({ factory: function ConfigurationService_Factory() { return new ConfigurationService(i0.inject("environment"), i0.inject(i1$1.HttpClient)); }, token: ConfigurationService, providedIn: "root" });
12609
- return ConfigurationService;
12610
- }());
12611
-
12612
12629
  var SnapshotTokenComponent = /** @class */ (function (_super) {
12613
12630
  __extends(SnapshotTokenComponent, _super);
12614
12631
  function SnapshotTokenComponent(cdRef, commonService, toastrService, tokenService) {
@@ -15083,6 +15100,27 @@
15083
15100
  budget: budget
15084
15101
  };
15085
15102
  };
15103
+ /**
15104
+ * Call the validataion service
15105
+ * @param cnfIniStateId Initial config status id, if not exist, get the config status id from the service
15106
+ * @returns True if actual date is before than end application date and the stateAppId is equals of the cnfIniStateId
15107
+ */
15108
+ FrontofficeCommonsComponent.prototype.validateCloseApplicationProcess = function (cnfIniStateId) {
15109
+ return __awaiter(this, void 0, void 0, function () {
15110
+ var response;
15111
+ return __generator(this, function (_a) {
15112
+ switch (_a.label) {
15113
+ case 0: return [4 /*yield*/, this.commonService.validateCloseApplicationProcess(this.promCodigo, this.stateId, cnfIniStateId).toPromise()];
15114
+ case 1:
15115
+ response = _a.sent();
15116
+ this.dateClose = response.closeApplicationDate;
15117
+ return [2 /*return*/, new Promise(function (resolve) {
15118
+ resolve(response.userAllowSave);
15119
+ })];
15120
+ }
15121
+ });
15122
+ });
15123
+ };
15086
15124
  return FrontofficeCommonsComponent;
15087
15125
  }(CommonListsComponent));
15088
15126
 
@@ -17265,9 +17303,9 @@
17265
17303
  /* tslint:disable */
17266
17304
  var VERSION = {
17267
17305
  "dirty": true,
17268
- "raw": "v0.0.18-1844-g11e08774-dirty",
17269
- "hash": "g11e08774",
17270
- "distance": 1844,
17306
+ "raw": "v0.0.18-1845-g9e6dcaeb-dirty",
17307
+ "hash": "g9e6dcaeb",
17308
+ "distance": 1845,
17271
17309
  "tag": "v0.0.18",
17272
17310
  "semver": {
17273
17311
  "options": {
@@ -17283,10 +17321,10 @@
17283
17321
  "build": [],
17284
17322
  "version": "0.0.18"
17285
17323
  },
17286
- "suffix": "1844-g11e08774-dirty",
17287
- "semverString": "0.0.18+1844.g11e08774",
17288
- "version": "0.0.1314",
17289
- "buildTimestamp": "2022-02-02T21:35:59.575Z"
17324
+ "suffix": "1845-g9e6dcaeb-dirty",
17325
+ "semverString": "0.0.18+1845.g9e6dcaeb",
17326
+ "version": "0.0.1315",
17327
+ "buildTimestamp": "2022-02-03T16:07:05.003Z"
17290
17328
  };
17291
17329
  /* tslint:enable */
17292
17330