tango-app-api-trax 3.4.1-alpha-7 → 3.4.1-alpha-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-trax",
3
- "version": "3.4.1-alpha-7",
3
+ "version": "3.4.1-alpha-9",
4
4
  "description": "Trax",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -3568,11 +3568,19 @@ export async function updatePlanoStatus( req, res ) {
3568
3568
  if ( !processCheckDetails ) {
3569
3569
  return res.sendError( 'No data found', 204 );
3570
3570
  }
3571
- processCheckDetails.checklistStatus = req.body.status;
3572
- processCheckDetails.save();
3571
+ let storeTimeZone = await storeService.findOne( { storeName: { $regex: processCheckDetails.storeName, $options: 'i' }, clientId: processCheckDetails.client_id }, { 'storeProfile.timeZone': 1 } );
3572
+ let currentDateTime;
3573
+ if ( storeTimeZone?.storeProfile?.timeZone ) {
3574
+ currentDateTime = dayjs().tz( storeTimeZone?.storeProfile?.timeZone );
3575
+ } else {
3576
+ currentDateTime = requestData?.currentTime ? dayjs( requestData.currentTime, 'HH:mm:ss' ) : dayjs();
3577
+ }
3578
+ let submitTimeString = currentDateTime.format( 'hh:mm A, DD MMM YYYY' );
3579
+ await processedchecklist.updateOne( { _id: req.body.id }, { checklistStatus: req.body.status, ...( req.body.status == 'inprogress' ) ? { startTime_string: submitTimeString } : { submitTime_string: submitTimeString } } );
3573
3580
  return res.sendSuccess( 'Status updated Successfully' );
3574
3581
  } catch ( e ) {
3575
3582
  logger.error( { error: e, function: 'updatePlanoStatus' } );
3576
3583
  return res.sendError( e, 500 );
3577
3584
  }
3578
3585
  }
3586
+
@@ -1469,8 +1469,9 @@ export const updateConfigurev1 =async ( req, res ) => {
1469
1469
  return res.sendError( 'no data found', 204 );
1470
1470
  }
1471
1471
 
1472
- let currentDate = dayjs().format( 'HH:mm:ss' );
1473
- currentDate = dayjs.utc( currentDate, 'HH:mm:ss' ).format();
1472
+ let currentDate = dayjs.tz( inputBody.timeZone ).format();
1473
+ console.log( dayjs.tz( 'Asia/Kolkata' ).format() );
1474
+ console.log( currentDate, 'date' );
1474
1475
  let updatedscheduleEndTimeISO = dayjs.utc( inputBody?.checkListDetails?.scheduleEndTime, 'hh:mm A' ).format( 'HH:mm:ss' );
1475
1476
  let newUpdatedDate = dayjs.utc( updatedscheduleEndTimeISO, 'HH:mm:ss' ).format();
1476
1477