tango-app-api-trax 3.2.1-hotfix-6 → 3.2.1-hotfix-8

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.2.1-hotfix-6",
3
+ "version": "3.2.1-hotfix-8",
4
4
  "description": "Trax",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -26,7 +26,7 @@
26
26
  "mongodb": "^6.8.0",
27
27
  "nodemon": "^3.1.4",
28
28
  "path": "^0.12.7",
29
- "tango-api-schema": "^2.2.67",
29
+ "tango-api-schema": "^2.2.68",
30
30
  "tango-app-api-middleware": "^3.1.50",
31
31
  "url": "^0.11.4",
32
32
  "winston": "^3.13.1",
@@ -301,7 +301,7 @@ async function insertData( requestData ) {
301
301
  },
302
302
  } );
303
303
  let getSections = await CLquestions.aggregate( sectionQuery );
304
- if ( getSections.length || [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring' ].includes( getCLconfig.checkListType ) ) {
304
+ if ( getSections.length || [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring','queuealert' ].includes( getCLconfig.checkListType ) ) {
305
305
  if ( getSections.length ) {
306
306
  for ( let element3 of getSections ) {
307
307
  let collectQuestions = {};
@@ -444,7 +444,7 @@ async function insertData( requestData ) {
444
444
  // }
445
445
  }
446
446
  } else {
447
- if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring' ].includes( getCLconfig.checkListType ) ) {
447
+ if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring','queuealert' ].includes( getCLconfig.checkListType ) ) {
448
448
  let storeDetails = await storeService.find( { clientId: getCLconfig.client_id, status: 'active' }, { storeId: 1 } );
449
449
  let data = {
450
450
  checkListId: updatedchecklist._id,
@@ -470,7 +470,8 @@ async function insertData( requestData ) {
470
470
  client_id: getCLconfig.client_id,
471
471
  aiStoreList: storeDetails ? storeDetails.map( ( store ) => store.storeId ) : [],
472
472
  };
473
- await processedchecklist.create( data );
473
+ // await processedchecklist.create( data );
474
+ await processedchecklist.updateOne( { date_string: currentdate, checkListId: updatedchecklist._id, sourceCheckList_id: getCLconfig._id, checkListType: getCLconfig.checkListType }, data );
474
475
  }
475
476
  }
476
477
  }
@@ -951,6 +951,7 @@ export const flagTablesV1 = async ( req, res ) => {
951
951
  // },
952
952
  },
953
953
  aiStoreList: { $max: '$aiStoreList' },
954
+ aiStoreListNew: { $sum: { $size: '$aiStoreList' } },
954
955
  submittedQuestionCount: {
955
956
  $sum: {
956
957
  $cond: [
@@ -966,7 +967,7 @@ export const flagTablesV1 = async ( req, res ) => {
966
967
  findQuery.push( {
967
968
  $project: {
968
969
  assignedStores: '$storeCount',
969
- assignedStoresAi: '$storeCountAi',
970
+ assignedStoresAi: '$aiStoreListNew',
970
971
  checkListName: 1,
971
972
  checkListChar: 1,
972
973
  sourceCheckList_id: 1,
@@ -2360,7 +2360,7 @@ async function updateOpenSearch( user, data ) {
2360
2360
  export const aiChecklist = async ( req, res ) => {
2361
2361
  try {
2362
2362
  let storeDetails = await storeService.count( { clientId: req.query.clientId, status: 'active' } );
2363
- let aiList = [ 'mobileusagedetection', 'storeopenandclose', 'uniformdetection', 'staffleftinthemiddle', 'customerunattended', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring' ];
2363
+ let aiList = [ 'mobileusagedetection', 'storeopenandclose', 'uniformdetection', 'staffleftinthemiddle', 'customerunattended', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring','queuealert' ];
2364
2364
  let checklistDetails = [];
2365
2365
  let publishList = [];
2366
2366
  let unpublishList = [];