tango-app-api-task 3.2.0-beta.4 → 3.2.0-beta.6

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": "3.2.0-beta.4",
3
+ "version": "3.2.0-beta.6",
4
4
  "description": "Task",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -722,7 +722,7 @@ export async function taskConfig( req, res ) {
722
722
  if ( inputBody.removedUsers.length ) {
723
723
  await taskAssignService.updateMany( { _id: { $in: inputBody.removedUsers } }, { checkFlag: false } );
724
724
  }
725
- let storeConfigDetails = await taskAssignService.find( { checkListId: inputBody._id, checkFlag: true }, { _id: 0, store_id: 1, userEmail: 1 } );
725
+ let storeConfigDetails = await taskAssignService.find( { checkListId: inputBody._id, checkFlag: true }, { _id: 0, store_id: 1, userEmail: 1, storeName: 1 } );
726
726
  let storeList = storeConfigDetails.map( ( store ) => store.store_id );
727
727
 
728
728
  storeCount = storeList.length;
@@ -1468,6 +1468,13 @@ export async function redoTask( req, res ) {
1468
1468
 
1469
1469
  let response = await taskProcessedService.updateOne( { _id: req.body.payload._id }, updateData );
1470
1470
  if ( response.modifiedCount || response.matchedCount ) {
1471
+ let storeTimeZone = await storeService.findOne( { storeName: taskDetails.storeName }, { 'storeProfile.timeZone': 1 } );
1472
+ let currentDateTime;
1473
+ if ( storeTimeZone?.storeProfile?.timeZone ) {
1474
+ currentDateTime = dayjs().tz( storeTimeZone?.storeProfile?.timeZone );
1475
+ } else {
1476
+ currentDateTime = dayjs();
1477
+ }
1471
1478
  data = {
1472
1479
  checklistId: taskDetails.sourceCheckList_id,
1473
1480
  checkListName: taskDetails.checkListName,
@@ -1483,7 +1490,7 @@ export async function redoTask( req, res ) {
1483
1490
  type: taskDetails.checkListType,
1484
1491
  userAnswer: userAnswer,
1485
1492
  initiatedBy: req.user.userName,
1486
- initiatedTime: dayjs().format(),
1493
+ initiatedTime: dayjs.utc( currentDateTime.format( 'hh:mm:ss A, DD MMM YYYY' ), 'hh:mm:ss A, DD MMM YYYY' ).format(),
1487
1494
  answerType: question[sectionIndex].questions[req.body.payload.qno - 1].answerType,
1488
1495
  submitedBy: taskDetails.userName,
1489
1496
  submitTime: taskDetails.submitTime,
@@ -15354,13 +15361,10 @@ export async function teamMigrations( req, res ) {
15354
15361
  },
15355
15362
  ],
15356
15363
  };
15357
- console.log( payload );
15358
15364
  const teams = await createTeamsModel( payload );
15359
- console.log( teams );
15360
15365
  } else {
15361
15366
  let userIn = teamsExist.users.filter( ( data ) => data.email === userexits.userName );
15362
15367
  if ( userIn.length==0 ) {
15363
- console.log( '---------------------------', teamsExist.users.length );
15364
15368
  let update = {
15365
15369
  'userName': userexits.userName,
15366
15370
  'email': userexits.email,
@@ -222,7 +222,6 @@ export const approvalTableV1 = async ( req, res ) => {
222
222
  },
223
223
  ...groupQuery,
224
224
  ];
225
- promises.push( processedChecklist.aggregate( query ) );
226
225
  if ( req.body?.searchValue.trim() && req.body?.searchValue.trim().length ) {
227
226
  query.push( {
228
227
  $match: {
@@ -230,6 +229,7 @@ export const approvalTableV1 = async ( req, res ) => {
230
229
  },
231
230
  } );
232
231
  }
232
+ promises.push( processedChecklist.aggregate( query ) );
233
233
  } else {
234
234
  promises.push( Promise.resolve( null ) );
235
235
  }