tango-app-api-trax 3.4.0-flag-1 → 3.4.0-flag-3

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.4.0-flag-1",
3
+ "version": "3.4.0-flag-3",
4
4
  "description": "Trax",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -2665,7 +2665,7 @@ export const checklistDropdownV1 = async ( req, res ) => {
2665
2665
  $or: [
2666
2666
  { questionFlag: { $gte: 1 } },
2667
2667
  { timeFlag: { $gte: 1 } },
2668
- { checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum' ] } },
2668
+ { checkListType: { $in: [ 'custom', 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum' ] } },
2669
2669
  ],
2670
2670
  },
2671
2671
  ] } },
@@ -3123,20 +3123,26 @@ export const flagTablesV2 = async ( req, res ) => {
3123
3123
  'Checklist Name': element.checkListName,
3124
3124
  'Question Flags': element?.customQuestionFlagCount,
3125
3125
  'Not Submitted Flags': element?.customTimeFlagCount,
3126
- 'Flagged Count': element?.flagCount,
3126
+ 'Detection Flags': element?.flagCount,
3127
3127
  'Coverage': element?.coverage,
3128
- 'Assigned Stores': element?.assignedStores,
3128
+ 'Assigned Stores': element?.checkListType === 'custom' ? element?.assignedStores : element?.assignedStoresAi,
3129
3129
  'Flagged Stores': element?.flaggedStores,
3130
3130
  'Compliance': element?.complianceRate,
3131
3131
  // 'Flag Type': element?.checkListType === 'custom' ? 'Question' : 'Detection',
3132
3132
  };
3133
3133
  if ( requestData?.filter === 'question' ) {
3134
+ data['Flags'] = data['Question Flags'];
3135
+ delete data['Question Flags'];
3134
3136
  delete data['Flagged Count'];
3135
3137
  delete data['Not Submitted Flags'];
3136
3138
  } else if ( requestData?.filter === 'time' ) {
3139
+ data['Flags'] = data['Not Submitted Flags'];
3140
+ delete data['Not Submitted Flags'];
3137
3141
  delete data['Flagged Count'];
3138
3142
  delete data['Question Flags'];
3139
3143
  } else if ( requestData?.filter === 'detection' ) {
3144
+ data['Flags'] = data['Detection Flags'];
3145
+ delete data['Detection Flags'];
3140
3146
  delete data['Not Submitted Flags'];
3141
3147
  delete data['Question Flags'];
3142
3148
  }