tango-app-api-trax 3.9.48 → 3.9.50
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
|
@@ -1635,9 +1635,11 @@ export const flagChecklistTableV1 = async ( req, res ) => {
|
|
|
1635
1635
|
'Store Id': element?.storeId,
|
|
1636
1636
|
// 'Store Spoc Email': element?.SpocEmail,
|
|
1637
1637
|
'Detections': element?.detections,
|
|
1638
|
-
'Detection Status': element?.detectionStatus,
|
|
1638
|
+
...( reqestData.ChecklistType != 'activitymonitoring' && { 'Detection Status': element?.detectionStatus } ),
|
|
1639
1639
|
...( element?.detectionType !== undefined && { 'Detection Type': element.detectionType } ),
|
|
1640
1640
|
...( element?.downtime !== undefined && { 'Downtime': element.downtime } ),
|
|
1641
|
+
...( element?.downtime !== undefined && { 'Downtime': element.downtime } ),
|
|
1642
|
+
...( element?.footfall !== undefined && { 'Footfall': element.footfall } ),
|
|
1641
1643
|
} );
|
|
1642
1644
|
} );
|
|
1643
1645
|
}
|
|
@@ -1820,6 +1822,8 @@ export const checklistDropdownV1 = async ( req, res ) => {
|
|
|
1820
1822
|
sourceCheckList_id: 1,
|
|
1821
1823
|
checkListName: 1,
|
|
1822
1824
|
coverage: 1,
|
|
1825
|
+
// aiStoreList is an array of store-id strings; keep it (default []).
|
|
1826
|
+
aiStoreList: { $ifNull: [ '$aiStoreList', [] ] },
|
|
1823
1827
|
},
|
|
1824
1828
|
},
|
|
1825
1829
|
{
|
|
@@ -1827,6 +1831,8 @@ export const checklistDropdownV1 = async ( req, res ) => {
|
|
|
1827
1831
|
_id: '$sourceCheckList_id',
|
|
1828
1832
|
checkListName: { $last: '$checkListName' },
|
|
1829
1833
|
coverage: { $last: '$coverage' },
|
|
1834
|
+
// Collect each document's array; flattened/deduped in the next stage.
|
|
1835
|
+
aiStoreList: { $push: '$aiStoreList' },
|
|
1830
1836
|
},
|
|
1831
1837
|
},
|
|
1832
1838
|
{
|
|
@@ -1835,6 +1841,14 @@ export const checklistDropdownV1 = async ( req, res ) => {
|
|
|
1835
1841
|
sourceCheckList_id: '$_id',
|
|
1836
1842
|
checkListName: 1,
|
|
1837
1843
|
coverage: 1,
|
|
1844
|
+
// Union the per-document arrays into one deduplicated list of store ids.
|
|
1845
|
+
aiStoreList: {
|
|
1846
|
+
$reduce: {
|
|
1847
|
+
input: '$aiStoreList',
|
|
1848
|
+
initialValue: [],
|
|
1849
|
+
in: { $setUnion: [ '$$value', '$$this' ] },
|
|
1850
|
+
},
|
|
1851
|
+
},
|
|
1838
1852
|
},
|
|
1839
1853
|
},
|
|
1840
1854
|
{
|
|
@@ -1882,6 +1896,7 @@ export const checklistDropdownV1 = async ( req, res ) => {
|
|
|
1882
1896
|
scheduleStartTime: '$checklistData.scheduleStartTime',
|
|
1883
1897
|
sourceCheckList_id: '$checklistData._id',
|
|
1884
1898
|
coverage: 1,
|
|
1899
|
+
aiStoreList: 1,
|
|
1885
1900
|
},
|
|
1886
1901
|
},
|
|
1887
1902
|
];
|