tango-app-api-trax 3.3.1-hotfix-9 → 3.3.1-hotfix-11

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-trax",
3
- "version": "3.3.1-hotfix-9",
3
+ "version": "3.3.1-hotfix-11",
4
4
  "description": "Trax",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -2462,7 +2462,7 @@ export async function checklistv1( req, res ) {
2462
2462
  ...projectExtraConditions,
2463
2463
  client_id: { $ifNull: [ '$client_id', '' ] },
2464
2464
  coverage: { $ifNull: [ '$coverage', '' ] },
2465
- taskType: { $ifNull: [ '$type', '' ] },
2465
+ taskType: { $ifNull: [ '$planoType', '' ] },
2466
2466
  },
2467
2467
  },
2468
2468
  ];
@@ -3426,11 +3426,19 @@ export async function updatePlanoStatus( req, res ) {
3426
3426
  if ( !processCheckDetails ) {
3427
3427
  return res.sendError( 'No data found', 204 );
3428
3428
  }
3429
- processCheckDetails.checklistStatus = req.body.status;
3430
- processCheckDetails.save();
3429
+ let storeTimeZone = await storeService.findOne( { storeName: { $regex: processCheckDetails.storeName, $options: 'i' }, clientId: processCheckDetails.client_id }, { 'storeProfile.timeZone': 1 } );
3430
+ let currentDateTime;
3431
+ if ( storeTimeZone?.storeProfile?.timeZone ) {
3432
+ currentDateTime = dayjs().tz( storeTimeZone?.storeProfile?.timeZone );
3433
+ } else {
3434
+ currentDateTime = requestData?.currentTime ? dayjs( requestData.currentTime, 'HH:mm:ss' ) : dayjs();
3435
+ }
3436
+ let submitTimeString = currentDateTime.format( 'hh:mm A, DD MMM YYYY' );
3437
+ await processedchecklist.updateOne( { _id: req.body.id }, { checklistStatus: req.body.status, ...( req.body.status == 'inprogress' ) ? { startTime_string: submitTimeString } : { submitTime_string: submitTimeString } } );
3431
3438
  return res.sendSuccess( 'Status updated Successfully' );
3432
3439
  } catch ( e ) {
3433
3440
  logger.error( { error: e, function: 'updatePlanoStatus' } );
3434
3441
  return res.sendError( e, 500 );
3435
3442
  }
3436
3443
  }
3444
+