ng-pli-commons 1.0.133 → 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
|
-
|
|
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;
|
|
@@ -11242,9 +11277,12 @@ class SendApplicationService {
|
|
|
11242
11277
|
const allComponents = FormioUtil.getComponents(form.components);
|
|
11243
11278
|
for (const component of allComponents) {
|
|
11244
11279
|
// Verifica si el componente es de tipo 'day', es requerido y no tiene un valor válido.
|
|
11280
|
+
// La validación de 'required' en un campo 'day' es a nivel de sus sub-campos (day, month, year).
|
|
11245
11281
|
if (component.type === 'day' &&
|
|
11246
|
-
component.
|
|
11247
|
-
component.
|
|
11282
|
+
component.fields &&
|
|
11283
|
+
((component.fields.day && component.fields.day.required) ||
|
|
11284
|
+
(component.fields.month && component.fields.month.required) ||
|
|
11285
|
+
(component.fields.year && component.fields.year.required))) {
|
|
11248
11286
|
const dayValue = data ? data[component.key] : null;
|
|
11249
11287
|
// Un campo 'day' vacío puede ser null, '', o '00/00/0000'.
|
|
11250
11288
|
if (!dayValue || dayValue === '00/00/0000') {
|
|
@@ -16684,9 +16722,9 @@ class CustomValidator {
|
|
|
16684
16722
|
/* tslint:disable */
|
|
16685
16723
|
const VERSION = {
|
|
16686
16724
|
"dirty": true,
|
|
16687
|
-
"raw": "v0.0.18-
|
|
16688
|
-
"hash": "
|
|
16689
|
-
"distance":
|
|
16725
|
+
"raw": "v0.0.18-2683-g0b91e54f-dirty",
|
|
16726
|
+
"hash": "g0b91e54f",
|
|
16727
|
+
"distance": 2683,
|
|
16690
16728
|
"tag": "v0.0.18",
|
|
16691
16729
|
"semver": {
|
|
16692
16730
|
"options": {
|
|
@@ -16702,10 +16740,10 @@ const VERSION = {
|
|
|
16702
16740
|
"build": [],
|
|
16703
16741
|
"version": "0.0.18"
|
|
16704
16742
|
},
|
|
16705
|
-
"suffix": "
|
|
16706
|
-
"semverString": "0.0.18+
|
|
16707
|
-
"version": "1.0.
|
|
16708
|
-
"buildTimestamp": "2025-11-
|
|
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"
|
|
16709
16747
|
};
|
|
16710
16748
|
/* tslint:enable */
|
|
16711
16749
|
|