tango-app-api-task 3.6.0-task-3 → 3.6.0-task-5

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-3",
3
+ "version": "3.6.0-task-5",
4
4
  "description": "Task",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -25,7 +25,7 @@
25
25
  "mongodb": "^6.10.0",
26
26
  "nodemon": "^3.1.7",
27
27
  "npm": "^10.9.2",
28
- "tango-api-schema": "^2.2.147",
28
+ "tango-api-schema": "^2.2.193",
29
29
  "tango-app-api-middleware": "^3.1.77",
30
30
  "winston": "^3.17.0",
31
31
  "winston-daily-rotate-file": "^5.0.0"
@@ -1276,6 +1276,7 @@ export async function insertSingleProcessData( checklistId, answerTypechange, in
1276
1276
  insertdata.restrictAttendance = getCLconfig?.restrictAttendance;
1277
1277
  insertdata.coverage = getCLconfig?.coverage;
1278
1278
  insertdata.checkListFrom = getCLconfig?.checkListFrom;
1279
+ insertdata.zoneName = getCLconfig?.zoneName || '';
1279
1280
  let collectSections = [];
1280
1281
  let sectionQuery = [];
1281
1282
  sectionQuery.push( {
@@ -1523,6 +1524,7 @@ async function insertPCBulkV3( getCLconfig, checklistId, updatedchecklist, date,
1523
1524
  element4.restrictAttendance = getCLconfig?.restrictAttendance;
1524
1525
  element4.coverage = getCLconfig?.coverage;
1525
1526
  element4.checkListFrom = getCLconfig?.checkListFrom;
1527
+ element4.zoneName = getCLconfig?.zoneName || '';
1526
1528
  if ( inputBody && inputBody?.streamId ) {
1527
1529
  element4.streamId = inputBody?.streamId;
1528
1530
  }
@@ -5474,6 +5476,8 @@ export async function StoreHygienetask( req, res ) {
5474
5476
  ...( inputBody?.checkListId ) ? { referenceCheckListId: inputBody?.checkListId } : {},
5475
5477
  coverage: 'store',
5476
5478
  checkListFrom: 'api',
5479
+ zoneName: inputBody.zoneName || '',
5480
+ checkListType: 'task',
5477
5481
  };
5478
5482
  data['approver'] = userAdmin;
5479
5483
 
@@ -5893,6 +5897,8 @@ async function insertStoreHygienetaskSingleProcessedTask( checkTask, inputBody,
5893
5897
  newData.createdAt = new Date();
5894
5898
  newData.updatedAt = new Date();
5895
5899
  newData.questionAnswers = [ questions ];
5900
+ newData.zoneName = inputBody.zoneName || '';
5901
+ newData.checkListType = 'task' || '';
5896
5902
  let insertprocessdata = await taskProcessedService.insert( newData );
5897
5903
  if ( insertprocessdata ) {
5898
5904
  return true;
@@ -336,6 +336,8 @@ export const taskInfoTableV1 = async ( req, res ) => {
336
336
  restrictAttendance: 1,
337
337
  approvalByEmail: 1,
338
338
  approvalTime_string: 1,
339
+ zoneName: 1,
340
+ checkListFrom: 1,
339
341
  },
340
342
  } );
341
343
 
@@ -388,6 +390,8 @@ export const taskInfoTableV1 = async ( req, res ) => {
388
390
  restrictAttendance: 1,
389
391
  approvalByEmail: 1,
390
392
  approvalTime_string: 1,
393
+ zoneName: 1,
394
+ checkListFrom: 1,
391
395
  },
392
396
  } );
393
397
 
@@ -408,7 +412,7 @@ export const taskInfoTableV1 = async ( req, res ) => {
408
412
  } );
409
413
 
410
414
  let taskInfoData = await processedTaskService.aggregate( findQuery );
411
- console.log( 'taskInfoData =>', taskInfoData.length );
415
+ // console.log( 'taskInfoData =>', taskInfoData );
412
416
 
413
417
  if ( !taskInfoData[0].data.length ) {
414
418
  return res.sendError( 'no data found', 204 );
@@ -425,11 +429,12 @@ export const taskInfoTableV1 = async ( req, res ) => {
425
429
  for ( let task of result.taskInfo ) {
426
430
  exportResult.push( {
427
431
  'Store': task?.storeName ||'--',
428
- 'Store SPOC': task?.userEmail ||'--',
432
+ 'user Name': task?.userEmail ||'--',
433
+ 'User Email': task?.userEmail ||'--',
434
+ ...( task?.checkListFrom === 'api' && { 'Type': task?.zoneName || '--' } ),
429
435
  'Due On': dayjs.utc( task?.scheduleEndTime_iso ).format( 'DD MMM, YYYY' ) || '--',
430
436
  'status': task?.checklistStatus ||'--',
431
437
  'Submitted On': task?.submitTime_string || '--',
432
- 'Assigned To': task?.storeCount ||'--',
433
438
  'Approval By': task.approvalByEmail || '--',
434
439
  'Approval On': task.approvalTime_string || '--',
435
440
  } );
@@ -774,7 +779,7 @@ export const taskDropdownListV1 = async ( req, res ) => {
774
779
  );
775
780
  findQuery.push( { $match: { $and: findAndQuery } }, { $sort: { date_iso: -1 } } );
776
781
 
777
- // findQuery.push( { $match: { $or: [ { checkListName: 'Store Hygiene Check' }, { checkListName: 'EyeTest QR Verification' } ] } } );
782
+ // findQuery.push( { $match: { $or: [ { checkListName: 'Store Hygiene Check' }, { checkListName: 'Store Hygiene Check new' } ] } } );
778
783
 
779
784
  findQuery.push(
780
785
  {