ng-pli-commons 1.0.126 → 1.0.129

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.
@@ -11056,11 +11056,19 @@ class SendApplicationService {
11056
11056
  let configurationDocument = listConfigurationDocumentVisible[i];
11057
11057
  let document = this.getDocumentByConfigurationId(configurationDocument.id, listDocument, application.id);
11058
11058
  if (validateJustRequired) {
11059
- if ((!document ||
11060
- (document && document.listArchive.length == 0) ||
11061
- this.automaticDocumentsValidated(configurationDocument, listDataForm, document)) &&
11062
- configurationDocument.required) {
11059
+ // Validate the deactivation date
11060
+ const isActive = this.isConfigActiveByDeactivationDate(configurationDocument);
11061
+ const isRequired = !!configurationDocument.required;
11062
+ // "Falta": no existe, no tiene archivos o tu lógica automática lo exige
11063
+ const isMissing = !document ||
11064
+ (document && document.listArchive.length === 0) ||
11065
+ this.automaticDocumentsValidated(configurationDocument, listDataForm, document);
11066
+ console.log('Values isActive', isActive);
11067
+ console.log('Values isRequired', isRequired);
11068
+ console.log('Values isMissing', isMissing);
11069
+ if (isRequired && isMissing && isActive) {
11063
11070
  this.fillListValidateDocumentDefault(listValidatedDocument, application, configurationDocument);
11071
+ console.log('Entro');
11064
11072
  }
11065
11073
  }
11066
11074
  else {
@@ -11078,6 +11086,36 @@ class SendApplicationService {
11078
11086
  }
11079
11087
  return listValidatedDocument;
11080
11088
  }
11089
+ isConfigActiveByDeactivationDate(configurationDocument) {
11090
+ // If there is no date, it is ACTIVE
11091
+ if (!configurationDocument || !configurationDocument.deactivationDate) {
11092
+ return true;
11093
+ }
11094
+ const raw = configurationDocument.deactivationDate;
11095
+ let deact;
11096
+ if (raw instanceof Date) {
11097
+ deact = new Date(raw.getFullYear(), raw.getMonth(), raw.getDate());
11098
+ }
11099
+ else {
11100
+ const s = String(raw).trim();
11101
+ if (/^\d{4}-\d{2}-\d{2}/.test(s)) {
11102
+ deact = new Date(s.includes('T') ? s : `${s}T00:00:00`);
11103
+ }
11104
+ else if (/^\d{2}\/\d{2}\/\d{4}$/.test(s)) {
11105
+ const [dd, mm, yyyy] = s.split('/').map(Number);
11106
+ deact = new Date(yyyy, mm - 1, dd);
11107
+ }
11108
+ else {
11109
+ deact = new Date(s);
11110
+ }
11111
+ }
11112
+ const today = new Date();
11113
+ today.setHours(0, 0, 0, 0);
11114
+ deact.setHours(0, 0, 0, 0);
11115
+ // true => ACTIVE if today is BEFORE or EQUAL to the deactivation date
11116
+ // false => DEFEATED if today is LATER
11117
+ return today.getTime() <= deact.getTime();
11118
+ }
11081
11119
  fillListValidateDocumentDefault(listValidatedDocument, application, configurationDocument) {
11082
11120
  let document = new Document();
11083
11121
  document.applicationId = application.id;
@@ -16665,9 +16703,9 @@ class CustomValidator {
16665
16703
  /* tslint:disable */
16666
16704
  const VERSION = {
16667
16705
  "dirty": true,
16668
- "raw": "v0.0.18-2675-g437f52ee-dirty",
16669
- "hash": "g437f52ee",
16670
- "distance": 2675,
16706
+ "raw": "v0.0.18-2678-gb42d4eee-dirty",
16707
+ "hash": "gb42d4eee",
16708
+ "distance": 2678,
16671
16709
  "tag": "v0.0.18",
16672
16710
  "semver": {
16673
16711
  "options": {
@@ -16683,10 +16721,10 @@ const VERSION = {
16683
16721
  "build": [],
16684
16722
  "version": "0.0.18"
16685
16723
  },
16686
- "suffix": "2675-g437f52ee-dirty",
16687
- "semverString": "0.0.18+2675.g437f52ee",
16688
- "version": "1.0.126",
16689
- "buildTimestamp": "2025-10-21T20:09:20.603Z"
16724
+ "suffix": "2678-gb42d4eee-dirty",
16725
+ "semverString": "0.0.18+2678.gb42d4eee",
16726
+ "version": "1.0.129",
16727
+ "buildTimestamp": "2025-11-13T20:48:58.659Z"
16690
16728
  };
16691
16729
  /* tslint:enable */
16692
16730