tango-app-api-task 1.0.0-beta.7 → 1.0.0-beta.9

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-app-api-task",
3
- "version": "1.0.0-beta.7",
3
+ "version": "1.0.0-beta.9",
4
4
  "description": "Task",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -1394,6 +1394,7 @@ export async function redoTask( req, res ) {
1394
1394
  let data = { ...question[sectionIndex].questions[req.body.payload.qno - 1], redo: true, redoComment: req.body.payload?.checklistDescription || '' };
1395
1395
  let userAnswer = data.userAnswer;
1396
1396
  question[sectionIndex].questions[req.body.payload.qno - 1] = data;
1397
+ question[sectionIndex].questions[req.body.payload.qno - 1].remarks = '';
1397
1398
  question[sectionIndex].questions[req.body.payload.qno - 1].userAnswer = [];
1398
1399
  taskDetails.questionAnswers = question;
1399
1400
  let updateData = {
@@ -1443,7 +1444,7 @@ export async function redoTask( req, res ) {
1443
1444
  return res.sendError( 'Something went wrong', 500 );
1444
1445
  }
1445
1446
  } catch ( e ) {
1446
- logger.error( { function: 'redoChecklist', error: e, message: req.body } );
1447
+ logger.error( { function: 'redoTask', error: e, message: req.body } );
1447
1448
  return res.sendError( e, 500 );
1448
1449
  }
1449
1450
  }
@@ -1608,15 +1609,23 @@ export const taskDropdown = async ( req, res ) => {
1608
1609
  };
1609
1610
  export async function approvalstatus( req, res ) {
1610
1611
  try {
1611
- if ( ( req?.user?.userType == 'client' && req.user.role == 'superadmin' ) ) {
1612
- return res.sendError( 'No Content', 204 );
1613
- }
1614
1612
  let Approver = await ApproverModel.find( { checkListId: req.body.checklistId } );
1615
1613
  if ( Approver.length === 0 ) {
1616
1614
  return res.sendSuccess( 'suceess' );
1617
1615
  }
1618
1616
  let filterApprover = Approver.filter( ( data ) => data.userEmail=== req.user.email );
1619
1617
  if ( filterApprover.length === 0 ) {
1618
+ if ( ( req?.user?.userType == 'client' && req.user.role == 'superadmin' ) ) {
1619
+ let url = JSON.parse( process.env.LAMBDAURL );
1620
+ let resultData = await LamdaServiceCall( url.approvalstatus, req.body );
1621
+ if ( resultData ) {
1622
+ console.log( resultData.status_code );
1623
+ if ( resultData.status_code == '200' ) {
1624
+ return res.sendSuccess( resultData );
1625
+ }
1626
+ }
1627
+ return res.sendError( 'No Content', 204 );
1628
+ }
1620
1629
  return res.sendSuccess( 'suceess' );
1621
1630
  }
1622
1631
 
@@ -263,7 +263,7 @@ export const taskInfoTableV1 = async ( req, res ) => {
263
263
  findQuery.push(
264
264
  {
265
265
  $group: {
266
- _id: { userEmail: '$userEmail', storeId: '$store_id' },
266
+ _id: { userEmail: '$userEmail', storeId: '$store_id', checklistStatus: '$checklistStatus' },
267
267
  checkListName: { $first: '$checkListName' },
268
268
  createdByName: { $first: '$createdByName' },
269
269
  userName: { $first: '$userName' },
@@ -281,6 +281,7 @@ export const taskInfoTableV1 = async ( req, res ) => {
281
281
  reinitiateStatus: { $first: '$reinitiateStatus' },
282
282
  scheduleEndTime_iso: { $first: '$scheduleEndTime_iso' },
283
283
  processedchecklistId: { $first: '$_id' },
284
+ redoStatus: { $first: '$redoStatus' },
284
285
  },
285
286
  },
286
287
  );
@@ -305,6 +306,7 @@ export const taskInfoTableV1 = async ( req, res ) => {
305
306
  reinitiateStatus: 1,
306
307
  scheduleEndTime_iso: 1,
307
308
  processedchecklistId: 1,
309
+ redoStatus: 1,
308
310
  },
309
311
  } );
310
312
 
@@ -345,6 +347,7 @@ export const taskInfoTableV1 = async ( req, res ) => {
345
347
  sourceCheckList_id: 1,
346
348
  scheduleEndTime_iso: 1,
347
349
  processedchecklistId: 1,
350
+ redoStatus: 1,
348
351
  },
349
352
  } );
350
353