tango-app-api-trax 3.5.2-alpha-3 → 3.5.2-alpha-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-trax",
3
- "version": "3.5.2-alpha-3",
3
+ "version": "3.5.2-alpha-6",
4
4
  "description": "Trax",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -701,7 +701,7 @@ export async function getLogs( req, res ) {
701
701
 
702
702
  export async function approvalstatus( req, res ) {
703
703
  try {
704
- let Approver = await ApproverModel.find( { checkListId: req.body.checklistId } );
704
+ let Approver = await ApproverModel.find( { checkListId: req.body.checklistId, isDeleted: false } );
705
705
  if ( Approver.length === 0 ) {
706
706
  return res.sendSuccess( 'suceess' );
707
707
  }
@@ -296,7 +296,7 @@ export async function PCLconfigCreation( req, res ) {
296
296
  },
297
297
  } );
298
298
  let getSections = await CLquestions.aggregate( sectionQuery );
299
- if ( getSections.length || [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo' ].includes( getCLconfig.checkListType ) ) {
299
+ if ( getSections.length || [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo','vehicle_check_in' ].includes( getCLconfig.checkListType ) ) {
300
300
  if ( getSections.length ) {
301
301
  for ( let element3 of getSections ) {
302
302
  let collectQuestions = {};
@@ -591,7 +591,7 @@ export async function PCLconfigCreation( req, res ) {
591
591
  // }
592
592
  }
593
593
  } else {
594
- if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo' ].includes( getCLconfig.checkListType ) ) {
594
+ if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo','vehicle_check_in' ].includes( getCLconfig.checkListType ) ) {
595
595
  let storeNameList = allQuestion.map( ( item ) => item.store_id );
596
596
  let storeDetails = await storeService.find( { clientId: getCLconfig.client_id, status: 'active', ...( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning' ].includes( getCLconfig.checkListType ) ) ? { storeId: { $in: storeNameList } } : {} }, { storeId: 1 } );
597
597
  let storeList = storeDetails.map( ( store ) => store.storeId );
@@ -864,7 +864,7 @@ async function insertData( requestData ) {
864
864
  },
865
865
  } );
866
866
  let getSections = await CLquestions.aggregate( sectionQuery );
867
- if ( getSections.length || [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo' ].includes( getCLconfig.checkListType ) ) {
867
+ if ( getSections.length || [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo','vehicle_check_in' ].includes( getCLconfig.checkListType ) ) {
868
868
  if ( getSections.length ) {
869
869
  for ( let element3 of getSections ) {
870
870
  let collectQuestions = {};
@@ -1158,7 +1158,7 @@ async function insertData( requestData ) {
1158
1158
  // }
1159
1159
  }
1160
1160
  } else {
1161
- if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo' ].includes( getCLconfig.checkListType ) ) {
1161
+ if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo','vehicle_check_in' ].includes( getCLconfig.checkListType ) ) {
1162
1162
  let storeNameList = allQuestion.map( ( item ) => item.store_id );
1163
1163
  let storeDetails = await storeService.find( { clientId: getCLconfig.client_id, status: 'active', ...( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning' ].includes( getCLconfig.checkListType ) ) ? { storeId: { $in: storeNameList } } : {} }, { storeId: 1 } );
1164
1164
  let storeList = storeDetails.map( ( store ) => store.storeId );
@@ -3821,7 +3821,7 @@ async function updateOpenSearch( user, data ) {
3821
3821
  export const aiChecklist = async ( req, res ) => {
3822
3822
  try {
3823
3823
  let storeDetails = await storeService.count( { clientId: req.query.clientId, status: 'active' } );
3824
- let aiList = [ 'mobileusagedetection', 'storeopenandclose', 'uniformdetection', 'staffleftinthemiddle', 'customerunattended', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo' ];
3824
+ let aiList = [ 'mobileusagedetection', 'storeopenandclose', 'uniformdetection', 'staffleftinthemiddle', 'customerunattended', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo','vehicle_check_in' ];
3825
3825
  let checklistDetails = [];
3826
3826
  let publishList = [];
3827
3827
  let unpublishList = [];
@@ -2947,6 +2947,14 @@ export const overallComparisonCardsV1 = async ( req, res ) => {
2947
2947
  processedchecklistService.aggregate( rangeTwoFindQuery ),
2948
2948
  ] );
2949
2949
 
2950
+ console.log( 'rangeOneFromDate =>', rangeOneFromDate );
2951
+ console.log( 'rangeOneToDate =>', rangeOneToDate );
2952
+ console.log( 'rangeOneData =>', rangeOneData );
2953
+
2954
+ console.log( 'rangeTwoFromDate =>', rangeTwoFromDate );
2955
+ console.log( 'rangeTwoToDate =>', rangeTwoToDate );
2956
+ console.log( 'rangeTwoData =>', rangeTwoData );
2957
+
2950
2958
  if ( rangeOneData.length >0 && rangeTwoData.length >0 ) {
2951
2959
  overallComparisonCards.flags.comparisonData = Math.round( ( ( ( rangeOneData[0].flaggedChecklist - rangeTwoData[0].flaggedChecklist )/rangeTwoData[0].flaggedChecklist )*100 ) ); // .toFixed( 2 )
2952
2960
  if ( overallComparisonCards.flags.comparisonData > 0 ) {