tango-app-api-trax 3.3.1-hotfix-17 → 3.3.1-hotfix-19
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.3.1-hotfix-
|
|
3
|
+
"version": "3.3.1-hotfix-19",
|
|
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.
|
|
29
|
+
"tango-api-schema": "^2.2.90",
|
|
30
30
|
"tango-app-api-middleware": "^3.1.70",
|
|
31
31
|
"url": "^0.11.4",
|
|
32
32
|
"winston": "^3.13.1",
|
|
@@ -304,7 +304,7 @@ async function insertData( requestData ) {
|
|
|
304
304
|
},
|
|
305
305
|
} );
|
|
306
306
|
let getSections = await CLquestions.aggregate( sectionQuery );
|
|
307
|
-
if ( getSections.length || [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum' ].includes( getCLconfig.checkListType ) ) {
|
|
307
|
+
if ( getSections.length || [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert' ].includes( getCLconfig.checkListType ) ) {
|
|
308
308
|
if ( getSections.length ) {
|
|
309
309
|
for ( let element3 of getSections ) {
|
|
310
310
|
let collectQuestions = {};
|
|
@@ -597,7 +597,7 @@ async function insertData( requestData ) {
|
|
|
597
597
|
// }
|
|
598
598
|
}
|
|
599
599
|
} else {
|
|
600
|
-
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum' ].includes( getCLconfig.checkListType ) ) {
|
|
600
|
+
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert' ].includes( getCLconfig.checkListType ) ) {
|
|
601
601
|
let storeDetails = await storeService.find( { clientId: getCLconfig.client_id, status: 'active' }, { storeId: 1 } );
|
|
602
602
|
let data = {
|
|
603
603
|
checkListId: updatedchecklist._id,
|
|
@@ -1648,9 +1648,9 @@ async function getUserToken( clientId, userEmail ) {
|
|
|
1648
1648
|
export async function internalAISendPushNotification( req, res ) {
|
|
1649
1649
|
try {
|
|
1650
1650
|
let requestData = req.body;
|
|
1651
|
-
if ( !requestData.clientId ) {
|
|
1652
|
-
|
|
1653
|
-
}
|
|
1651
|
+
// if ( !requestData.clientId ) {
|
|
1652
|
+
// return res.sendError( 'clientId is Required', 400 );
|
|
1653
|
+
// }
|
|
1654
1654
|
if ( !( requestData?.email || requestData?.storeId ) ) {
|
|
1655
1655
|
return res.sendError( 'Email or StoreId is Required', 400 );
|
|
1656
1656
|
}
|
|
@@ -1666,12 +1666,15 @@ export async function internalAISendPushNotification( req, res ) {
|
|
|
1666
1666
|
let userData;
|
|
1667
1667
|
if ( requestData.email && requestData.email !='' ) {
|
|
1668
1668
|
// fcmToken = await getUserToken( requestData.clientId, requestData.email );
|
|
1669
|
-
userData = await userService.findOne( { clientId: requestData.clientId, email: requestData.email }, { fcmToken: 1, loginFrom: 1 } );
|
|
1669
|
+
// userData = await userService.findOne( { clientId: requestData.clientId, email: requestData.email }, { fcmToken: 1, loginFrom: 1 } );
|
|
1670
|
+
userData = await userService.findOne( { email: requestData.email }, { fcmToken: 1, loginFrom: 1 } );
|
|
1670
1671
|
} else {
|
|
1671
|
-
let storeData = await storeService.findOne( { clientId: requestData.clientId, storeId: requestData.storeId }, { spocDetails: 1 } );
|
|
1672
|
+
// let storeData = await storeService.findOne( { clientId: requestData.clientId, storeId: requestData.storeId }, { spocDetails: 1 } );
|
|
1673
|
+
let storeData = await storeService.findOne( { storeId: requestData.storeId }, { spocDetails: 1 } );
|
|
1672
1674
|
if ( storeData && storeData.spocDetails.length > 0 && storeData.spocDetails[0].email ) {
|
|
1673
1675
|
// fcmToken = await getUserToken( storeData.spocDetails[0].email );
|
|
1674
|
-
userData = await userService.findOne( { clientId: requestData.clientId, email: requestData.email }, { fcmToken: 1, loginFrom: 1 } );
|
|
1676
|
+
// userData = await userService.findOne( { clientId: requestData.clientId, email: requestData.email }, { fcmToken: 1, loginFrom: 1 } );
|
|
1677
|
+
userData = await userService.findOne( { email: requestData.email }, { fcmToken: 1, loginFrom: 1 } );
|
|
1675
1678
|
}
|
|
1676
1679
|
}
|
|
1677
1680
|
if ( !userData ) {
|
|
@@ -3397,8 +3397,8 @@ export async function clientConfig( req, res ) {
|
|
|
3397
3397
|
try {
|
|
3398
3398
|
let requestData = req.body;
|
|
3399
3399
|
if ( requestData.clientId && requestData.clientId !='' ) {
|
|
3400
|
-
let getClientData = await clientService.findOne( { clientId: requestData.clientId }, { traxRAWImageUpload: 1, clientId: 1, clientName: 1 } );
|
|
3401
|
-
console.log( ' getClientData=>', getClientData );
|
|
3400
|
+
let getClientData = await clientService.findOne( { clientId: requestData.clientId }, { traxRAWImageUpload: 1, clientId: 1, clientName: 1, traxBlockMobileTimeUpdate: 1 } );
|
|
3401
|
+
// console.log( ' getClientData=>', getClientData );
|
|
3402
3402
|
if ( getClientData ) {
|
|
3403
3403
|
return res.sendSuccess( getClientData );
|
|
3404
3404
|
} else {
|
|
@@ -3426,7 +3426,7 @@ async function updateOpenSearch( user, data ) {
|
|
|
3426
3426
|
export const aiChecklist = async ( req, res ) => {
|
|
3427
3427
|
try {
|
|
3428
3428
|
let storeDetails = await storeService.count( { clientId: req.query.clientId, status: 'active' } );
|
|
3429
|
-
let aiList = [ 'mobileusagedetection', 'storeopenandclose', 'uniformdetection', 'staffleftinthemiddle', 'customerunattended', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum' ];
|
|
3429
|
+
let aiList = [ 'mobileusagedetection', 'storeopenandclose', 'uniformdetection', 'staffleftinthemiddle', 'customerunattended', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert' ];
|
|
3430
3430
|
let checklistDetails = [];
|
|
3431
3431
|
let publishList = [];
|
|
3432
3432
|
let unpublishList = [];
|