tango-app-api-trax 3.8.13 → 3.8.14-nike
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 +2 -2
- package/src/controllers/download.controller.js +19 -19
- package/src/controllers/gallery.controller.js +1 -0
- package/src/controllers/handlebar-helper.js +1 -0
- package/src/controllers/internalTrax.controller.js +1021 -15
- package/src/controllers/mobileTrax.controller.js +146 -55
- package/src/controllers/teaxFlag.controller.js +5 -5
- package/src/controllers/trax.controller.js +2 -2
- package/src/hbs/flag.hbs +248 -248
- package/src/hbs/login-otp.hbs +943 -943
- package/src/hbs/recurringFlag.hbs +250 -0
- package/src/hbs/template.hbs +76 -29
- package/src/hbs/visit-checklist.hbs +90 -42
- package/src/hbs/weeklyWrap.hbs +218 -0
- package/src/routes/internalTraxApi.router.js +4 -0
- package/src/services/recurringFlagTracker.service.js +33 -0
- package/src/utils/visitChecklistPdf.utils.js +82 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tango-app-api-trax",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.14-nike",
|
|
4
4
|
"description": "Trax",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"nodemon": "^3.1.4",
|
|
30
30
|
"path": "^0.12.7",
|
|
31
31
|
"puppeteer": "^24.39.1",
|
|
32
|
-
"tango-api-schema": "^2.5.
|
|
32
|
+
"tango-api-schema": "^2.5.91",
|
|
33
33
|
"tango-app-api-middleware": "^3.5.2",
|
|
34
34
|
"url": "^0.11.4",
|
|
35
35
|
"winston": "^3.13.1",
|
|
@@ -53,31 +53,31 @@ async function getBrandInfo( clientId ) {
|
|
|
53
53
|
return brandInfo;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
async function streamChecklistZip( res, checklistList, brandInfo, zipBaseName ) {
|
|
57
|
-
|
|
56
|
+
// async function streamChecklistZip( res, checklistList, brandInfo, zipBaseName ) {
|
|
57
|
+
// const zipName = `${sanitizeFilenamePart( zipBaseName, 'visit-checklists' )}_${dayjs().format( 'YYYY-MM-DD_HH-mm' )}.zip`;
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
// res.status( 200 );
|
|
60
|
+
// res.setHeader( 'Content-Type', 'application/zip' );
|
|
61
|
+
// res.setHeader( 'Content-Disposition', `attachment; filename="${zipName.replace( /"/g, '\\"' )}"` );
|
|
62
|
+
// res.setHeader( 'Cache-Control', 'private, no-cache' );
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
// const archive = archiver( 'zip', { zlib: { level: 9 } } );
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
// archive.on( 'error', ( err ) => {
|
|
67
|
+
// throw err;
|
|
68
|
+
// } );
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
// archive.pipe( res );
|
|
71
71
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
72
|
+
// for ( const checklistDetails of checklistList ) {
|
|
73
|
+
// const templateData = buildVisitChecklistTemplateData( checklistDetails, brandInfo );
|
|
74
|
+
// const pdfBuffer = await generateVisitChecklistPDF( templateData );
|
|
75
|
+
// const pdfName = `${sanitizeFilenamePart( checklistDetails.storeName || checklistDetails.store_id || checklistDetails._id, 'store' )}_${sanitizeFilenamePart( checklistDetails.checkListName || 'Visit Checklist' )}.pdf`;
|
|
76
|
+
// archive.append( Buffer.isBuffer( pdfBuffer ) ? pdfBuffer : Buffer.from( pdfBuffer ), { name: pdfName } );
|
|
77
|
+
// }
|
|
78
78
|
|
|
79
|
-
|
|
80
|
-
}
|
|
79
|
+
// await archive.finalize();
|
|
80
|
+
// }
|
|
81
81
|
|
|
82
82
|
async function createChecklistZipBuffer( checklistList, brandInfo ) {
|
|
83
83
|
const output = new PassThrough();
|
|
@@ -139,6 +139,7 @@ export async function getcustomerunattendedlist( req, res ) {
|
|
|
139
139
|
}
|
|
140
140
|
let url = JSON.parse( process.env.LAMBDAURL );
|
|
141
141
|
let resultData = await LamdaServiceCall( url.customerUnattended, req.body );
|
|
142
|
+
console.log( '🚀 ~ getcustomerunattendedlist ~ url.customerUnattended:', url.customerUnattended );
|
|
142
143
|
if ( resultData ) {
|
|
143
144
|
if ( resultData.status_code == '200' ) {
|
|
144
145
|
return res.sendSuccess( resultData );
|