ng-pli-commons 1.0.134 → 1.0.135

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,10 +11056,15 @@ 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 isActiveByDesactivacionDate = this.isConfigActiveByDeactivationDate(configurationDocument);
11061
+ const isRequired = !!configurationDocument.required;
11062
+ // The document is missing.
11063
+ const isMissing = !document ||
11064
+ (document && document.listArchive.length === 0) ||
11065
+ this.automaticDocumentsValidated(configurationDocument, listDataForm, document);
11066
+ // Validation for required document and active or deactivation date depending on the case
11067
+ if (isRequired && isMissing && isActiveByDesactivacionDate) {
11063
11068
  this.fillListValidateDocumentDefault(listValidatedDocument, application, configurationDocument);
11064
11069
  }
11065
11070
  }
@@ -11078,6 +11083,36 @@ class SendApplicationService {
11078
11083
  }
11079
11084
  return listValidatedDocument;
11080
11085
  }
11086
+ isConfigActiveByDeactivationDate(configurationDocument) {
11087
+ // If there is no date, it is ACTIVE
11088
+ if (!configurationDocument || !configurationDocument.deactivationDate) {
11089
+ return true;
11090
+ }
11091
+ const raw = configurationDocument.deactivationDate;
11092
+ let deact;
11093
+ if (raw instanceof Date) {
11094
+ deact = new Date(raw.getFullYear(), raw.getMonth(), raw.getDate());
11095
+ }
11096
+ else {
11097
+ const s = String(raw).trim();
11098
+ if (/^\d{4}-\d{2}-\d{2}/.test(s)) {
11099
+ deact = new Date(s.includes('T') ? s : `${s}T00:00:00`);
11100
+ }
11101
+ else if (/^\d{2}\/\d{2}\/\d{4}$/.test(s)) {
11102
+ const [dd, mm, yyyy] = s.split('/').map(Number);
11103
+ deact = new Date(yyyy, mm - 1, dd);
11104
+ }
11105
+ else {
11106
+ deact = new Date(s);
11107
+ }
11108
+ }
11109
+ const today = new Date();
11110
+ today.setHours(0, 0, 0, 0);
11111
+ deact.setHours(0, 0, 0, 0);
11112
+ // true => ACTIVE if today is BEFORE or EQUAL to the deactivation date
11113
+ // false => DEFEATED if today is LATER
11114
+ return today.getTime() <= deact.getTime();
11115
+ }
11081
11116
  fillListValidateDocumentDefault(listValidatedDocument, application, configurationDocument) {
11082
11117
  let document = new Document();
11083
11118
  document.applicationId = application.id;
@@ -16687,9 +16722,9 @@ class CustomValidator {
16687
16722
  /* tslint:disable */
16688
16723
  const VERSION = {
16689
16724
  "dirty": true,
16690
- "raw": "v0.0.18-2682-g421eb182-dirty",
16691
- "hash": "g421eb182",
16692
- "distance": 2682,
16725
+ "raw": "v0.0.18-2683-g0b91e54f-dirty",
16726
+ "hash": "g0b91e54f",
16727
+ "distance": 2683,
16693
16728
  "tag": "v0.0.18",
16694
16729
  "semver": {
16695
16730
  "options": {
@@ -16705,10 +16740,10 @@ const VERSION = {
16705
16740
  "build": [],
16706
16741
  "version": "0.0.18"
16707
16742
  },
16708
- "suffix": "2682-g421eb182-dirty",
16709
- "semverString": "0.0.18+2682.g421eb182",
16710
- "version": "1.0.134",
16711
- "buildTimestamp": "2025-11-26T22:49:52.226Z"
16743
+ "suffix": "2683-g0b91e54f-dirty",
16744
+ "semverString": "0.0.18+2683.g0b91e54f",
16745
+ "version": "1.0.135",
16746
+ "buildTimestamp": "2025-11-27T14:07:11.013Z"
16712
16747
  };
16713
16748
  /* tslint:enable */
16714
16749