ng-pli-commons 1.0.128 → 1.0.130
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
|
-
|
|
11060
|
-
|
|
11061
|
-
|
|
11062
|
-
|
|
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;
|
|
@@ -16665,9 +16700,9 @@ class CustomValidator {
|
|
|
16665
16700
|
/* tslint:disable */
|
|
16666
16701
|
const VERSION = {
|
|
16667
16702
|
"dirty": true,
|
|
16668
|
-
"raw": "v0.0.18-
|
|
16669
|
-
"hash": "
|
|
16670
|
-
"distance":
|
|
16703
|
+
"raw": "v0.0.18-2678-gb42d4eee-dirty",
|
|
16704
|
+
"hash": "gb42d4eee",
|
|
16705
|
+
"distance": 2678,
|
|
16671
16706
|
"tag": "v0.0.18",
|
|
16672
16707
|
"semver": {
|
|
16673
16708
|
"options": {
|
|
@@ -16683,10 +16718,10 @@ const VERSION = {
|
|
|
16683
16718
|
"build": [],
|
|
16684
16719
|
"version": "0.0.18"
|
|
16685
16720
|
},
|
|
16686
|
-
"suffix": "
|
|
16687
|
-
"semverString": "0.0.18+
|
|
16688
|
-
"version": "1.0.
|
|
16689
|
-
"buildTimestamp": "2025-11-
|
|
16721
|
+
"suffix": "2678-gb42d4eee-dirty",
|
|
16722
|
+
"semverString": "0.0.18+2678.gb42d4eee",
|
|
16723
|
+
"version": "1.0.130",
|
|
16724
|
+
"buildTimestamp": "2025-11-14T20:21:33.520Z"
|
|
16690
16725
|
};
|
|
16691
16726
|
/* tslint:enable */
|
|
16692
16727
|
|