tango-app-api-task 3.4.1-approvecheck-0 → 3.5.0-alpha-0
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
CHANGED
|
@@ -2305,7 +2305,14 @@ export async function approveTask( req, res ) {
|
|
|
2305
2305
|
}
|
|
2306
2306
|
let idList = taskDetails.filter( ( ele ) => ele.checklistStatus == 'submit' ).map( ( item ) => item._id );
|
|
2307
2307
|
if ( idList.length ) {
|
|
2308
|
-
let
|
|
2308
|
+
let approvalUpdateData = {
|
|
2309
|
+
approvalStatus: true,
|
|
2310
|
+
approvalTime: new Date(),
|
|
2311
|
+
approvalTime_string: dayjs().format( 'hh:mm A, DD MMM YYYY' ),
|
|
2312
|
+
approvalByName: req.user.userName,
|
|
2313
|
+
approvalByEmail: req.user.email,
|
|
2314
|
+
};
|
|
2315
|
+
let updateResponse = await taskProcessedService.updateMany( { _id: { $in: idList } }, approvalUpdateData );
|
|
2309
2316
|
if ( updateResponse.modifiedCount || updateResponse.matchedCount ) {
|
|
2310
2317
|
let inputstores = taskDetails.filter( ( data ) => data.checklistStatus == 'submit' );
|
|
2311
2318
|
let storeNames = inputstores.map( ( data ) => data.storeName );
|
|
@@ -2319,10 +2326,10 @@ export async function approveTask( req, res ) {
|
|
|
2319
2326
|
},
|
|
2320
2327
|
'upsert': {
|
|
2321
2328
|
approvalStatus: true,
|
|
2322
|
-
approvalTime:new Date(),
|
|
2323
|
-
approvalTime_string:dayjs.format(
|
|
2324
|
-
approvalByName:req.user.
|
|
2325
|
-
approvalByEmail:req.user.email
|
|
2329
|
+
approvalTime: new Date(),
|
|
2330
|
+
approvalTime_string: dayjs().format( 'hh:mm A, DD MMM YYYY' ),
|
|
2331
|
+
approvalByName: req.user.userName,
|
|
2332
|
+
approvalByEmail: req.user.email,
|
|
2326
2333
|
},
|
|
2327
2334
|
};
|
|
2328
2335
|
const requestOptions = {
|
|
@@ -3834,7 +3841,7 @@ export async function eyeTesttask( req, res ) {
|
|
|
3834
3841
|
checkListName: data.checkListName,
|
|
3835
3842
|
client_id: inputBody.clientId,
|
|
3836
3843
|
userId: userId,
|
|
3837
|
-
assignId:storeDetails?._id
|
|
3844
|
+
assignId: storeDetails?._id,
|
|
3838
3845
|
};
|
|
3839
3846
|
await taskAssignService.create( userDetails );
|
|
3840
3847
|
await insertSingleProcessData( response?._id, true, inputBody );
|
|
@@ -296,6 +296,8 @@ export const taskInfoTableV1 = async ( req, res ) => {
|
|
|
296
296
|
priorityType: { $first: '$priorityType' },
|
|
297
297
|
allowedStoreLocation: { $first: '$allowedStoreLocation' },
|
|
298
298
|
restrictAttendance: { $first: '$restrictAttendance' },
|
|
299
|
+
approvalByEmail: { $first: '$approvalByEmail' },
|
|
300
|
+
approvalTime_string: { $first: '$approvalTime_string' },
|
|
299
301
|
},
|
|
300
302
|
},
|
|
301
303
|
);
|
|
@@ -324,6 +326,8 @@ export const taskInfoTableV1 = async ( req, res ) => {
|
|
|
324
326
|
priorityType: 1,
|
|
325
327
|
allowedStoreLocation: 1,
|
|
326
328
|
restrictAttendance: 1,
|
|
329
|
+
approvalByEmail: 1,
|
|
330
|
+
approvalTime_string: 1,
|
|
327
331
|
},
|
|
328
332
|
} );
|
|
329
333
|
|
|
@@ -368,6 +372,8 @@ export const taskInfoTableV1 = async ( req, res ) => {
|
|
|
368
372
|
priorityType: 1,
|
|
369
373
|
allowedStoreLocation: 1,
|
|
370
374
|
restrictAttendance: 1,
|
|
375
|
+
approvalByEmail: 1,
|
|
376
|
+
approvalTime_string: 1,
|
|
371
377
|
},
|
|
372
378
|
} );
|
|
373
379
|
|
|
@@ -411,9 +417,11 @@ export const taskInfoTableV1 = async ( req, res ) => {
|
|
|
411
417
|
'Store': task?.storeName ||'--',
|
|
412
418
|
'Store SPOC': task?.userEmail ||'--',
|
|
413
419
|
'Due On': dayjs.utc( task?.scheduleEndTime_iso ).format( 'DD MMM, YYYY' ) || '--',
|
|
420
|
+
'status': task?.checklistStatus ||'--',
|
|
414
421
|
'Submitted On': task?.submitTime_string || '--',
|
|
415
422
|
'Assigned To': task?.storeCount ||'--',
|
|
416
|
-
'
|
|
423
|
+
'Approval By': task.approvalByEmail || '--',
|
|
424
|
+
'Approval On': task.approvalTime_string || '--',
|
|
417
425
|
} );
|
|
418
426
|
}
|
|
419
427
|
await download( exportResult, res );
|