tango-app-api-report 3.5.3 → 3.5.5
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.
- package/package.json +1 -1
- package/src/validations/report.validations.js +188 -253
package/package.json
CHANGED
|
@@ -118,40 +118,57 @@ export async function isAuditCompleted( req, res, next ) {
|
|
|
118
118
|
try {
|
|
119
119
|
const inputData = req.body;
|
|
120
120
|
const openSearch = JSON.parse( process.env.OPENSEARCH );
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
},
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
},
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
},
|
|
137
|
-
],
|
|
138
|
-
},
|
|
121
|
+
|
|
122
|
+
const getStoreAuditQuery = [
|
|
123
|
+
{
|
|
124
|
+
$match: {
|
|
125
|
+
$and: [
|
|
126
|
+
{
|
|
127
|
+
fileDate: { $eq: inputData?.fileDate.split( '-' ).reverse().join( '-' ) },
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
clientId: { $eq: inputData.clientId },
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
status: { $ne: 'completed' },
|
|
134
|
+
},
|
|
135
|
+
],
|
|
139
136
|
},
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
},
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
$group: {
|
|
140
|
+
_id: null,
|
|
141
|
+
storeId: { $addToSet: '$storeId' },
|
|
145
142
|
},
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
$project: {
|
|
146
|
+
storeId: 1,
|
|
150
147
|
},
|
|
151
|
-
|
|
148
|
+
},
|
|
149
|
+
];
|
|
152
150
|
|
|
153
|
-
|
|
154
|
-
|
|
151
|
+
const getStoreAudit = await aggregateStoreAudit( getStoreAuditQuery );
|
|
152
|
+
const logInfo = {
|
|
153
|
+
userName: req.user.userName,
|
|
154
|
+
userId: req.user._id,
|
|
155
|
+
logType: 'reportLog',
|
|
156
|
+
logSubType: 'generateReportLog',
|
|
157
|
+
logData: {
|
|
158
|
+
fileDate: inputData?.fileDate.split( '-' ).reverse().join( '-' ),
|
|
159
|
+
reportName: req?.report?.reportConfigs?.reportName,
|
|
160
|
+
clientId: inputData?.clientId,
|
|
161
|
+
reportType: req?.report?.reportConfigs?.reportType,
|
|
162
|
+
message: 'get-audit-store-count-info',
|
|
163
|
+
storeAuditData: JSON.stringify( getStoreAudit ),
|
|
164
|
+
length: getStoreAudit?.[0]?.storeId?.length || 0,
|
|
165
|
+
infoType: 'info',
|
|
166
|
+
},
|
|
167
|
+
createdAt: Date.now(),
|
|
168
|
+
};
|
|
169
|
+
await insertOpenSearchData( openSearch?.auditLog, logInfo );
|
|
170
|
+
if ( getStoreAudit && getStoreAudit?.[0]?.storeId?.length >0 ) {
|
|
171
|
+
const logErr = {
|
|
155
172
|
userName: req.user.userName,
|
|
156
173
|
userId: req.user._id,
|
|
157
174
|
logType: 'reportLog',
|
|
@@ -161,41 +178,19 @@ export async function isAuditCompleted( req, res, next ) {
|
|
|
161
178
|
reportName: req?.report?.reportConfigs?.reportName,
|
|
162
179
|
clientId: inputData?.clientId,
|
|
163
180
|
reportType: req?.report?.reportConfigs?.reportType,
|
|
164
|
-
message: 'get-audit-
|
|
181
|
+
message: 'get-audit-audit-count-err',
|
|
165
182
|
storeAuditData: JSON.stringify( getStoreAudit ),
|
|
166
183
|
length: getStoreAudit?.[0]?.storeId?.length || 0,
|
|
167
|
-
infoType: '
|
|
184
|
+
infoType: 'error',
|
|
168
185
|
},
|
|
169
186
|
createdAt: Date.now(),
|
|
170
187
|
};
|
|
171
|
-
await insertOpenSearchData( openSearch?.auditLog,
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
logSubType: 'generateReportLog',
|
|
178
|
-
logData: {
|
|
179
|
-
fileDate: inputData?.fileDate.split( '-' ).reverse().join( '-' ),
|
|
180
|
-
reportName: req?.report?.reportConfigs?.reportName,
|
|
181
|
-
clientId: inputData?.clientId,
|
|
182
|
-
reportType: req?.report?.reportConfigs?.reportType,
|
|
183
|
-
message: 'get-audit-audit-count-err',
|
|
184
|
-
storeAuditData: JSON.stringify( getStoreAudit ),
|
|
185
|
-
length: getStoreAudit?.[0]?.storeId?.length || 0,
|
|
186
|
-
infoType: 'error',
|
|
187
|
-
},
|
|
188
|
-
createdAt: Date.now(),
|
|
189
|
-
};
|
|
190
|
-
await insertOpenSearchData( openSearch?.auditLog, logErr );
|
|
191
|
-
logger.info( { logErr } );
|
|
192
|
-
return res.sendError(
|
|
193
|
-
'Some files are not completed in the audit level for the selected date. Please try again later.',
|
|
194
|
-
400,
|
|
195
|
-
);
|
|
196
|
-
} else {
|
|
197
|
-
return next();
|
|
198
|
-
}
|
|
188
|
+
await insertOpenSearchData( openSearch?.auditLog, logErr );
|
|
189
|
+
logger.info( { logErr } );
|
|
190
|
+
return res.sendError(
|
|
191
|
+
'Some files are not completed in the audit level for the selected date. Please try again later.',
|
|
192
|
+
400,
|
|
193
|
+
);
|
|
199
194
|
} else {
|
|
200
195
|
return next();
|
|
201
196
|
}
|
|
@@ -211,73 +206,70 @@ export async function getQueueCount( req, res, next ) {
|
|
|
211
206
|
try {
|
|
212
207
|
const inputData = req.body;
|
|
213
208
|
const openSearch = JSON.parse( process.env.OPENSEARCH );
|
|
214
|
-
if ( req?.report?.reportConfigs?.reportType !== 'manual' ) {
|
|
215
|
-
if ( !req?.report?.auditConfigs ) return next();
|
|
216
209
|
|
|
217
|
-
|
|
210
|
+
if ( !req?.report?.auditConfigs ) return next();
|
|
218
211
|
|
|
219
|
-
|
|
220
|
-
const auditConfig = {
|
|
221
|
-
track: temp.audit,
|
|
222
|
-
traffic: temp.trackAudit,
|
|
223
|
-
};
|
|
212
|
+
const temp = req.report.auditConfigs;
|
|
224
213
|
|
|
214
|
+
// Config flags
|
|
215
|
+
const auditConfig = {
|
|
216
|
+
track: temp.audit,
|
|
217
|
+
traffic: temp.trackAudit,
|
|
218
|
+
};
|
|
225
219
|
|
|
226
|
-
// Mapping of config flags to queue-check functions
|
|
227
|
-
const queueChecks = {
|
|
228
|
-
track: [ () => checkTrackingQueueCount( temp?.trackQueueName ) ],
|
|
229
|
-
traffic: [
|
|
230
|
-
() => checkTrafficQueueCount( temp?.trafficQueueName ),
|
|
231
|
-
() => checkZoneQueueCount( temp?.zoneQueueName ),
|
|
232
|
-
],
|
|
233
|
-
};
|
|
234
220
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
221
|
+
// Mapping of config flags to queue-check functions
|
|
222
|
+
const queueChecks = {
|
|
223
|
+
track: [ () => checkTrackingQueueCount( temp?.trackQueueName ) ],
|
|
224
|
+
traffic: [
|
|
225
|
+
() => checkTrafficQueueCount( temp?.trafficQueueName ),
|
|
226
|
+
() => checkZoneQueueCount( temp?.zoneQueueName ),
|
|
227
|
+
],
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
// Run all enabled checks, stop on first true
|
|
231
|
+
const isProcessing = await runQueueChecks( auditConfig, queueChecks );
|
|
232
|
+
const logInfo = {
|
|
233
|
+
userName: req.user.userName,
|
|
234
|
+
userId: req.user._id,
|
|
235
|
+
logType: 'reportLog',
|
|
236
|
+
logSubType: 'generateReportLog',
|
|
237
|
+
logData: {
|
|
238
|
+
fileDate: inputData?.fileDate?.split( '-' ).reverse().join( '-' ),
|
|
239
|
+
reportName: req?.report?.reportConfigs?.reportName,
|
|
240
|
+
clientId: inputData?.clientId,
|
|
241
|
+
reportType: req?.report?.reportConfigs?.reportType,
|
|
242
|
+
message: 'get-audit-queue-count-info',
|
|
243
|
+
isProcessing: isProcessing,
|
|
244
|
+
infoType: 'info',
|
|
245
|
+
},
|
|
246
|
+
createdAt: Date.now(),
|
|
247
|
+
};
|
|
248
|
+
await insertOpenSearchData( openSearch?.auditLog, logInfo );
|
|
249
|
+
if ( isProcessing ) {
|
|
250
|
+
const logErr = {
|
|
238
251
|
userName: req.user.userName,
|
|
239
252
|
userId: req.user._id,
|
|
240
253
|
logType: 'reportLog',
|
|
241
254
|
logSubType: 'generateReportLog',
|
|
242
255
|
logData: {
|
|
243
|
-
fileDate: inputData?.fileDate
|
|
256
|
+
fileDate: inputData?.fileDate.split( '-' ).reverse().join( '-' ),
|
|
244
257
|
reportName: req?.report?.reportConfigs?.reportName,
|
|
245
258
|
clientId: inputData?.clientId,
|
|
246
259
|
reportType: req?.report?.reportConfigs?.reportType,
|
|
247
|
-
message: 'get-audit-queue-count-
|
|
260
|
+
message: 'get-audit-queue-count-err',
|
|
248
261
|
isProcessing: isProcessing,
|
|
249
|
-
infoType: '
|
|
262
|
+
infoType: 'error',
|
|
250
263
|
},
|
|
251
264
|
createdAt: Date.now(),
|
|
252
265
|
};
|
|
253
|
-
await insertOpenSearchData( openSearch?.auditLog,
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
logData: {
|
|
261
|
-
fileDate: inputData?.fileDate.split( '-' ).reverse().join( '-' ),
|
|
262
|
-
reportName: req?.report?.reportConfigs?.reportName,
|
|
263
|
-
clientId: inputData?.clientId,
|
|
264
|
-
reportType: req?.report?.reportConfigs?.reportType,
|
|
265
|
-
message: 'get-audit-queue-count-err',
|
|
266
|
-
isProcessing: isProcessing,
|
|
267
|
-
infoType: 'error',
|
|
268
|
-
},
|
|
269
|
-
createdAt: Date.now(),
|
|
270
|
-
};
|
|
271
|
-
await insertOpenSearchData( openSearch?.auditLog, logErr );
|
|
272
|
-
return res.sendError(
|
|
273
|
-
'This client is already being processed in the Queue. Please try again later.',
|
|
274
|
-
400,
|
|
275
|
-
);
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
return next();
|
|
279
|
-
} else {
|
|
280
|
-
return next();
|
|
266
|
+
await insertOpenSearchData( openSearch?.auditLog, logErr );
|
|
267
|
+
return res.sendError(
|
|
268
|
+
'This client is already being processed in the Queue. Please try again later.',
|
|
269
|
+
400,
|
|
270
|
+
);
|
|
271
|
+
}else{
|
|
272
|
+
return next();
|
|
281
273
|
}
|
|
282
274
|
} catch ( error ) {
|
|
283
275
|
logger.error( { error, message: req.body, function: 'getQueueCount' } );
|
|
@@ -348,88 +340,72 @@ async function checkZoneQueueCount( queueName ) {
|
|
|
348
340
|
export async function isFeatureRunning( req, res, next ) {
|
|
349
341
|
try {
|
|
350
342
|
const inputData = req.body;
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
logType: 'reportLog',
|
|
418
|
-
logSubType: 'generateReportLog',
|
|
419
|
-
logData: {
|
|
420
|
-
fileDate: inputData?.fileDate.split( '-' ).reverse().join( '-' ),
|
|
421
|
-
reportName: req?.report?.reportConfigs?.reportName,
|
|
422
|
-
clientId: inputData?.clientId,
|
|
423
|
-
reportType: req?.report?.reportConfigs?.reportType,
|
|
424
|
-
message: 'get-feature-count-info',
|
|
425
|
-
isFeatureData: JSON.stringify( isFeature ),
|
|
426
|
-
infoType: 'info',
|
|
427
|
-
},
|
|
428
|
-
createdAt: Date.now(),
|
|
429
|
-
};
|
|
430
|
-
await insertOpenSearchData( openSearch?.auditLog, logInfo );
|
|
431
|
-
const isREID = await callLambdaWithData( data, REIDURL );
|
|
432
|
-
const logReid = {
|
|
343
|
+
|
|
344
|
+
const url = JSON.parse( process.env.URL );
|
|
345
|
+
const openSearch = JSON.parse( process.env.OPENSEARCH );
|
|
346
|
+
const REIDURL = url.REIDStatus;
|
|
347
|
+
const FeatureURL = url.FeatureStatus;
|
|
348
|
+
const downTimeURL = url.ReportDowntimeCheck;
|
|
349
|
+
const data = { 'client_id': inputData.clientId, 'store_date': inputData?.fileDate.split( '-' ).reverse().join( '-' ) };
|
|
350
|
+
const downTimeData = { 'clientId': inputData.clientId, 'date': inputData?.fileDate.split( '-' ).reverse().join( '-' ) };
|
|
351
|
+
const isREID = await callLambdaWithData( data, REIDURL );
|
|
352
|
+
const logReid = {
|
|
353
|
+
userName: req.user.userName,
|
|
354
|
+
userId: req.user._id,
|
|
355
|
+
logType: 'reportLog',
|
|
356
|
+
logSubType: 'generateReportLog',
|
|
357
|
+
logData: {
|
|
358
|
+
fileDate: inputData?.fileDate.split( '-' ).reverse().join( '-' ),
|
|
359
|
+
reportName: req?.report?.reportConfigs?.reportName,
|
|
360
|
+
clientId: inputData?.clientId,
|
|
361
|
+
reportType: req?.report?.reportConfigs?.reportType,
|
|
362
|
+
message: 'get-reid-count-info',
|
|
363
|
+
reidData: JSON.stringify( isREID ),
|
|
364
|
+
infoType: 'info',
|
|
365
|
+
},
|
|
366
|
+
createdAt: Date.now(),
|
|
367
|
+
};
|
|
368
|
+
await insertOpenSearchData( openSearch?.auditLog, logReid );
|
|
369
|
+
const isFeature = await callLambdaWithData( data, FeatureURL );
|
|
370
|
+
const logInfo = {
|
|
371
|
+
userName: req.user.userName,
|
|
372
|
+
userId: req.user._id,
|
|
373
|
+
logType: 'reportLog',
|
|
374
|
+
logSubType: 'generateReportLog',
|
|
375
|
+
logData: {
|
|
376
|
+
fileDate: inputData?.fileDate.split( '-' ).reverse().join( '-' ),
|
|
377
|
+
reportName: req?.report?.reportConfigs?.reportName,
|
|
378
|
+
clientId: inputData?.clientId,
|
|
379
|
+
reportType: req?.report?.reportConfigs?.reportType,
|
|
380
|
+
message: 'get-feature-count-info',
|
|
381
|
+
isFeatureData: JSON.stringify( isFeature ),
|
|
382
|
+
infoType: 'info',
|
|
383
|
+
},
|
|
384
|
+
createdAt: Date.now(),
|
|
385
|
+
};
|
|
386
|
+
await insertOpenSearchData( openSearch?.auditLog, logInfo );
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
const isDownTimeCheck = await callLambdaWithData( downTimeData, downTimeURL );
|
|
390
|
+
const logDownTimeCheck = {
|
|
391
|
+
userName: req.user.userName,
|
|
392
|
+
userId: req.user._id,
|
|
393
|
+
logType: 'reportLog',
|
|
394
|
+
logSubType: 'generateReportLog',
|
|
395
|
+
logData: {
|
|
396
|
+
fileDate: inputData?.fileDate.split( '-' ).reverse().join( '-' ),
|
|
397
|
+
reportName: req?.report?.reportConfigs?.reportName,
|
|
398
|
+
clientId: inputData?.clientId,
|
|
399
|
+
reportType: req?.report?.reportConfigs?.reportType,
|
|
400
|
+
message: 'get-down-time',
|
|
401
|
+
reidData: JSON.stringify( isREID ),
|
|
402
|
+
infoType: 'info',
|
|
403
|
+
},
|
|
404
|
+
createdAt: Date.now(),
|
|
405
|
+
};
|
|
406
|
+
await insertOpenSearchData( openSearch?.auditLog, logDownTimeCheck );
|
|
407
|
+
if ( isFeature?.status_code !== '200' ||isREID?.status_code !== '200' || isDownTimeCheck?.status_code !== '200' ) {
|
|
408
|
+
const logErr = {
|
|
433
409
|
userName: req.user.userName,
|
|
434
410
|
userId: req.user._id,
|
|
435
411
|
logType: 'reportLog',
|
|
@@ -439,17 +415,22 @@ export async function isFeatureRunning( req, res, next ) {
|
|
|
439
415
|
reportName: req?.report?.reportConfigs?.reportName,
|
|
440
416
|
clientId: inputData?.clientId,
|
|
441
417
|
reportType: req?.report?.reportConfigs?.reportType,
|
|
442
|
-
message: 'get-reid-
|
|
418
|
+
message: isDownTimeCheck?.status_code !== '200'? 'get-down-time':'get-feature-reid-code-err',
|
|
419
|
+
featureData: JSON.stringify( isFeature ),
|
|
443
420
|
reidData: JSON.stringify( isREID ),
|
|
444
|
-
|
|
421
|
+
isDownTimeCheck: JSON.stringify( isDownTimeCheck ),
|
|
422
|
+
|
|
423
|
+
infoType: 'error',
|
|
445
424
|
},
|
|
446
425
|
createdAt: Date.now(),
|
|
447
426
|
};
|
|
448
|
-
await insertOpenSearchData( openSearch?.auditLog,
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
427
|
+
await insertOpenSearchData( openSearch?.auditLog, logErr );
|
|
428
|
+
return res.sendError(
|
|
429
|
+
'This client is already being processed in REID/Feature layer for the selected date. Please try again later.',
|
|
430
|
+
400,
|
|
431
|
+
);
|
|
432
|
+
} else if ( isFeature?.data === false || isREID?.data === false || isDownTimeCheck?.data === false ) {
|
|
433
|
+
const logBooErr = {
|
|
453
434
|
userName: req.user.userName,
|
|
454
435
|
userId: req.user._id,
|
|
455
436
|
logType: 'reportLog',
|
|
@@ -459,66 +440,20 @@ export async function isFeatureRunning( req, res, next ) {
|
|
|
459
440
|
reportName: req?.report?.reportConfigs?.reportName,
|
|
460
441
|
clientId: inputData?.clientId,
|
|
461
442
|
reportType: req?.report?.reportConfigs?.reportType,
|
|
462
|
-
message: 'get-down-time',
|
|
443
|
+
message: isDownTimeCheck?.data === false ? 'get-down-time' : 'get-feature-reid-boolean-err',
|
|
444
|
+
|
|
445
|
+
featureData: JSON.stringify( isFeature ),
|
|
463
446
|
reidData: JSON.stringify( isREID ),
|
|
464
|
-
|
|
447
|
+
isDownTimeCheck: JSON.stringify( isDownTimeCheck ),
|
|
448
|
+
infoType: 'error',
|
|
465
449
|
},
|
|
466
450
|
createdAt: Date.now(),
|
|
467
451
|
};
|
|
468
|
-
await insertOpenSearchData( openSearch?.auditLog,
|
|
469
|
-
|
|
470
|
-
const logErr = {
|
|
471
|
-
userName: req.user.userName,
|
|
472
|
-
userId: req.user._id,
|
|
473
|
-
logType: 'reportLog',
|
|
474
|
-
logSubType: 'generateReportLog',
|
|
475
|
-
logData: {
|
|
476
|
-
fileDate: inputData?.fileDate.split( '-' ).reverse().join( '-' ),
|
|
477
|
-
reportName: req?.report?.reportConfigs?.reportName,
|
|
478
|
-
clientId: inputData?.clientId,
|
|
479
|
-
reportType: req?.report?.reportConfigs?.reportType,
|
|
480
|
-
message: isDownTimeCheck?.status_code !== '200'? 'get-down-time':'get-feature-reid-code-err',
|
|
481
|
-
featureData: JSON.stringify( isFeature ),
|
|
482
|
-
reidData: JSON.stringify( isREID ),
|
|
483
|
-
isDownTimeCheck: JSON.stringify( isDownTimeCheck ),
|
|
484
|
-
|
|
485
|
-
infoType: 'error',
|
|
486
|
-
},
|
|
487
|
-
createdAt: Date.now(),
|
|
488
|
-
};
|
|
489
|
-
await insertOpenSearchData( openSearch?.auditLog, logErr );
|
|
490
|
-
return res.sendError(
|
|
491
|
-
'This client is already being processed in REID/Feature layer for the selected date. Please try again later.',
|
|
492
|
-
400,
|
|
493
|
-
);
|
|
494
|
-
} else if ( isFeature?.data === false || isREID?.data === false || isDownTimeCheck?.data === false ) {
|
|
495
|
-
const logBooErr = {
|
|
496
|
-
userName: req.user.userName,
|
|
497
|
-
userId: req.user._id,
|
|
498
|
-
logType: 'reportLog',
|
|
499
|
-
logSubType: 'generateReportLog',
|
|
500
|
-
logData: {
|
|
501
|
-
fileDate: inputData?.fileDate.split( '-' ).reverse().join( '-' ),
|
|
502
|
-
reportName: req?.report?.reportConfigs?.reportName,
|
|
503
|
-
clientId: inputData?.clientId,
|
|
504
|
-
reportType: req?.report?.reportConfigs?.reportType,
|
|
505
|
-
message: isDownTimeCheck?.data === false ? 'get-down-time' : 'get-feature-reid-boolean-err',
|
|
506
|
-
|
|
507
|
-
featureData: JSON.stringify( isFeature ),
|
|
508
|
-
reidData: JSON.stringify( isREID ),
|
|
509
|
-
isDownTimeCheck: JSON.stringify( isDownTimeCheck ),
|
|
510
|
-
infoType: 'error',
|
|
511
|
-
},
|
|
512
|
-
createdAt: Date.now(),
|
|
513
|
-
};
|
|
514
|
-
await insertOpenSearchData( openSearch?.auditLog, logBooErr );
|
|
515
|
-
return res.sendError(
|
|
452
|
+
await insertOpenSearchData( openSearch?.auditLog, logBooErr );
|
|
453
|
+
return res.sendError(
|
|
516
454
|
isDownTimeCheck?.data === false? 'Downtime error, please looking the teams alert for further details':'This client is already being processed in REID/Feature layer for the selected date. Please try again later.',
|
|
517
455
|
400,
|
|
518
|
-
|
|
519
|
-
} else {
|
|
520
|
-
return next();
|
|
521
|
-
}
|
|
456
|
+
);
|
|
522
457
|
} else {
|
|
523
458
|
return next();
|
|
524
459
|
}
|