tango-app-api-trax 3.4.1-alpha-17 → 3.4.1-alpha-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.4.1-alpha-
|
|
3
|
+
"version": "3.4.1-alpha-19",
|
|
4
4
|
"description": "Trax",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"nodemon": "^3.1.4",
|
|
28
28
|
"path": "^0.12.7",
|
|
29
29
|
"tango-api-schema": "^2.2.73",
|
|
30
|
-
"tango-app-api-middleware": "^3.1.
|
|
30
|
+
"tango-app-api-middleware": "^3.1.66",
|
|
31
31
|
"url": "^0.11.4",
|
|
32
32
|
"winston": "^3.13.1",
|
|
33
33
|
"winston-daily-rotate-file": "^5.0.0"
|
|
@@ -1127,7 +1127,7 @@ export async function pushNotification( req, res ) {
|
|
|
1127
1127
|
const description = `The ${data.checklistName} checklist is due. Complete it within ${data.time} minutes to avoid compliance.`;
|
|
1128
1128
|
const fcmToken = item.token;
|
|
1129
1129
|
try {
|
|
1130
|
-
await sendPushNotification( title, description,
|
|
1130
|
+
await sendPushNotification( title, description, fcmToken );
|
|
1131
1131
|
} catch ( e ) {
|
|
1132
1132
|
logger.error( {
|
|
1133
1133
|
message: 'push notification',
|
|
@@ -1543,7 +1543,7 @@ export async function taskPushNotification( req, res ) {
|
|
|
1543
1543
|
|
|
1544
1544
|
const fcmToken = item.token;
|
|
1545
1545
|
try {
|
|
1546
|
-
await sendPushNotification( title, description,
|
|
1546
|
+
await sendPushNotification( title, description, fcmToken );
|
|
1547
1547
|
} catch ( e ) {
|
|
1548
1548
|
logger.error( {
|
|
1549
1549
|
message: 'push notification',
|
|
@@ -1612,7 +1612,7 @@ export async function internalSendPushNotification( req, res ) {
|
|
|
1612
1612
|
// return res.sendError( 'Token not found', 400 );
|
|
1613
1613
|
return res.sendSuccess( 'Notification Send Successfully' );
|
|
1614
1614
|
}
|
|
1615
|
-
let responseData = await sendPushNotification( requestData.title, requestData.description,
|
|
1615
|
+
let responseData = await sendPushNotification( requestData.title, requestData.description, fcmToken );
|
|
1616
1616
|
// console.log( 'responseData =>', responseData );
|
|
1617
1617
|
if ( responseData ) {
|
|
1618
1618
|
return res.sendSuccess( 'Notification Send Successfully' );
|
|
@@ -1342,9 +1342,7 @@ export async function sopMobilechecklistMultiSectionFormatterv2( req, res, next
|
|
|
1342
1342
|
structure.parentanswer = requestSection[i].parentanswer;
|
|
1343
1343
|
structure.questionReferenceImage = qaAnswers[j].questionReferenceImage;
|
|
1344
1344
|
structure.descriptivetype = qaAnswers[j].descriptivetype;
|
|
1345
|
-
structure.uniqueNo = requestSection[i].uniqueNo;
|
|
1346
|
-
// qaAnswers[j].nestedQuestion = requestSection[i]?.nestedlinkedQuestion;
|
|
1347
|
-
// structure.parentQuestion = requestSection[i]?.parentQuestion || qaAnswers[j].qno;
|
|
1345
|
+
structure.uniqueNo = parseInt( requestSection[i].uniqueNo );
|
|
1348
1346
|
structure.oldQname = qaAnswers[j]?.oldQname || qaAnswers[j].qname;
|
|
1349
1347
|
if ( qaAnswers[j]?.taskId ) {
|
|
1350
1348
|
structure.taskId = qaAnswers[j]?.taskId;
|
|
@@ -1402,10 +1400,7 @@ export async function sopMobilechecklistMultiSectionFormatterv2( req, res, next
|
|
|
1402
1400
|
structure.parentanswer = requestSection[i].parentanswer;
|
|
1403
1401
|
structure.questionReferenceImage = qaAnswers[j].questionReferenceImage;
|
|
1404
1402
|
structure.descriptivetype = qaAnswers[j].descriptivetype;
|
|
1405
|
-
structure.uniqueNo = requestSection[i].uniqueNo;
|
|
1406
|
-
// structure.uniqueqno = parseInt( requestSection[i]?.uniqueqno );
|
|
1407
|
-
// structure.nestedlinkedQuestion = requestSection[i]?.nestedlinkedQuestion;
|
|
1408
|
-
// structure.parentQuestion = requestSection[i]?.parentQuestion || qaAnswers[j].qno;
|
|
1403
|
+
structure.uniqueNo = parseInt( requestSection[i].uniqueNo );
|
|
1409
1404
|
structure.oldQname = qaAnswers[j]?.oldQname || qaAnswers[j].qname;
|
|
1410
1405
|
if ( qaAnswers[j]?.taskId ) {
|
|
1411
1406
|
structure.taskId = qaAnswers[j]?.taskId;
|
|
@@ -1462,11 +1457,8 @@ export async function sopMobilechecklistMultiSectionFormatterv2( req, res, next
|
|
|
1462
1457
|
structure.parentanswer = requestSection[i].parentanswer;
|
|
1463
1458
|
structure.questionReferenceImage = qaAnswers[j].questionReferenceImage;
|
|
1464
1459
|
structure.descriptivetype = qaAnswers[j].descriptivetype;
|
|
1465
|
-
structure.uniqueNo = requestSection[i].uniqueNo;
|
|
1466
|
-
// structure.parentQuestion = requestSection[i]?.parentQuestion || qaAnswers[j].qno;
|
|
1460
|
+
structure.uniqueNo = parseInt( requestSection[i].uniqueNo );
|
|
1467
1461
|
structure.oldQname = qaAnswers[j]?.oldQname || qaAnswers[j].qname;
|
|
1468
|
-
// structure.uniqueqno = parseInt( requestSection[i]?.uniqueqno );
|
|
1469
|
-
// structure.nestedlinkedQuestion = requestSection[i]?.nestedlinkedQuestion;
|
|
1470
1462
|
if ( qaAnswers[j]?.taskId ) {
|
|
1471
1463
|
structure.taskId = qaAnswers[j]?.taskId;
|
|
1472
1464
|
structure.task = true;
|
|
@@ -1527,10 +1519,7 @@ export async function sopMobilechecklistMultiSectionFormatterv2( req, res, next
|
|
|
1527
1519
|
structure.parentanswer = requestSection[i].parentanswer;
|
|
1528
1520
|
structure.questionReferenceImage = qaAnswers[j].questionReferenceImage;
|
|
1529
1521
|
structure.descriptivetype = qaAnswers[j].descriptivetype;
|
|
1530
|
-
structure.uniqueNo = requestSection[i].uniqueNo;
|
|
1531
|
-
// structure.uniqueqno = parseInt( requestSection[i]?.uniqueqno );
|
|
1532
|
-
// structure.nestedlinkedQuestion = requestSection[i]?.nestedlinkedQuestion;
|
|
1533
|
-
// structure.parentQuestion = requestSection[i]?.parentQuestion || qaAnswers[j].qno;
|
|
1522
|
+
structure.uniqueNo = parseInt( requestSection[i].uniqueNo );
|
|
1534
1523
|
structure.oldQname = qaAnswers[j]?.oldQname || qaAnswers[j].qname;
|
|
1535
1524
|
if ( qaAnswers[j]?.taskId ) {
|
|
1536
1525
|
structure.taskId = qaAnswers[j]?.taskId;
|
|
@@ -1590,10 +1579,7 @@ export async function sopMobilechecklistMultiSectionFormatterv2( req, res, next
|
|
|
1590
1579
|
structure.parentanswer = requestSection[i].parentanswer;
|
|
1591
1580
|
structure.questionReferenceImage = qaAnswers[j].questionReferenceImage;
|
|
1592
1581
|
structure.descriptivetype = qaAnswers[j].descriptivetype;
|
|
1593
|
-
structure.uniqueNo = requestSection[i].uniqueNo;
|
|
1594
|
-
// structure.uniqueqno = parseInt( requestSection[i]?.uniqueqno );
|
|
1595
|
-
// structure.nestedlinkedQuestion = requestSection[i]?.nestedlinkedQuestion;
|
|
1596
|
-
// structure.parentQuestion = requestSection[i]?.parentQuestion || qaAnswers[j].qno;
|
|
1582
|
+
structure.uniqueNo = parseInt( requestSection[i].uniqueNo );
|
|
1597
1583
|
structure.oldQname = qaAnswers[j]?.oldQname || qaAnswers[j].qname;
|
|
1598
1584
|
if ( qaAnswers[j]?.taskId ) {
|
|
1599
1585
|
structure.taskId = qaAnswers[j]?.taskId;
|
|
@@ -3459,14 +3459,14 @@ async function insertPCBulkV4( getCLconfig, checklistId, currentdate, updatedche
|
|
|
3459
3459
|
const title = `${getCLconfig.checkListName}`;
|
|
3460
3460
|
const description = `Checklist has been updated and re-published!`;
|
|
3461
3461
|
const fcmToken = item;
|
|
3462
|
-
sendPushNotification( title, description,
|
|
3462
|
+
sendPushNotification( title, description, fcmToken );
|
|
3463
3463
|
} );
|
|
3464
3464
|
|
|
3465
3465
|
notifyUserList.forEach( ( item ) => {
|
|
3466
3466
|
const title = `New Checklist Assigned ${item.storeName}`;
|
|
3467
3467
|
const description = `The ${getCLconfig.checkListName} checklist has been assigned to ${item.storeName} for the first time.complete to avoid compliance.`;
|
|
3468
3468
|
const fcmToken = item.token;
|
|
3469
|
-
sendPushNotification( title, description,
|
|
3469
|
+
sendPushNotification( title, description, fcmToken );
|
|
3470
3470
|
} );
|
|
3471
3471
|
|
|
3472
3472
|
let updateUserList = notifyUserList.map( ( ele ) => ele.id );
|