tango-app-api-task 3.6.0-task-4 → 3.6.0-task-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.6.0-task-4",
3
+ "version": "3.6.0-task-6",
4
4
  "description": "Task",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -40,7 +40,7 @@ export const overallCardsV1 = async ( req, res ) => {
40
40
  toDate = new Date( toDate.getTime() - userTimezoneOffset );
41
41
  toDate.setUTCHours( 23, 59, 59, 59 );
42
42
 
43
- let taskToDate = new Date( requestData.toDate );
43
+ let taskToDate = new Date( req.body.toDate );
44
44
  taskToDate.setDate( taskToDate.getDate() + 1 );
45
45
 
46
46
  let groupQuery = {
@@ -61,7 +61,7 @@ export const overallCardsV1 = async ( req, res ) => {
61
61
  $match: {
62
62
  // date_iso: { $gte: new Date( req.body.fromDate ), $lte: toDate },
63
63
  scheduleStartTime_iso: { $lt: taskToDate },
64
- scheduleEndTime_iso: { $gte: fromDate },
64
+ scheduleEndTime_iso: { $gte: new Date( req.body.fromDate ) },
65
65
  sourceCheckList_id: { $in: taskIdList },
66
66
  checklistStatus: 'submit',
67
67
  approvalStatus: false,
@@ -136,7 +136,7 @@ export const approvalTableV1 = async ( req, res ) => {
136
136
  toDate = new Date( toDate.getTime() - userTimezoneOffset );
137
137
  toDate.setUTCHours( 23, 59, 59, 59 );
138
138
 
139
- let taskToDate = new Date( requestData.toDate );
139
+ let taskToDate = new Date( req.body.toDate );
140
140
  taskToDate.setDate( taskToDate.getDate() + 1 );
141
141
 
142
142
  let groupQuery = [ {
@@ -213,7 +213,7 @@ export const approvalTableV1 = async ( req, res ) => {
213
213
  $match: {
214
214
  // date_iso: { $gte: new Date( req.body.fromDate ), $lte: toDate },
215
215
  scheduleStartTime_iso: { $lt: taskToDate },
216
- scheduleEndTime_iso: { $gte: fromDate },
216
+ scheduleEndTime_iso: { $gte: new Date( req.body.fromDate ) },
217
217
  sourceCheckList_id: { $in: taskIdList },
218
218
  // ...( req.body?.storeId?.length ) ? { store_id: { $in: req.body.storeId } } :{},
219
219
  $or: [ { store_id: { $in: requestData.storeId } }, { store_id: { $eq: '' }, userEmail: { $in: requestData.userEmailes || [] } } ],
@@ -429,9 +429,9 @@ export const taskInfoTableV1 = async ( req, res ) => {
429
429
  for ( let task of result.taskInfo ) {
430
430
  exportResult.push( {
431
431
  'Store': task?.storeName ||'--',
432
- 'user Name': task?.userEmail ||'--',
432
+ 'User Name': task?.userName ||'--',
433
433
  'User Email': task?.userEmail ||'--',
434
- ...( task?.checkListFrom === 'api' && { 'Zone Name': task?.zoneName || '--' } ),
434
+ ...( task?.checkListFrom === 'api' && { 'Type': task?.zoneName || '--' } ),
435
435
  'Due On': dayjs.utc( task?.scheduleEndTime_iso ).format( 'DD MMM, YYYY' ) || '--',
436
436
  'status': task?.checklistStatus ||'--',
437
437
  'Submitted On': task?.submitTime_string || '--',