tango-app-api-analysis-traffic 3.1.0-alpha.8 → 3.3.1-alpha.1
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/index.js +1 -2
- package/package.json +2 -5
- package/src/controllers/tangoTrafficV1.controllers.js +19 -1
- package/src/dtos/validation.dtos.js +0 -20
- package/src/routes/traffic.routes.js +3 -1
- package/src/controllers/emailers.controllers.js +0 -1728
- package/src/controllers/handlebars.js +0 -23
- package/src/hbs/dailyMailerMultiple.hbs +0 -1104
- package/src/hbs/dailyMailerSingle.hbs +0 -1026
- package/src/hbs/weeklyMailerMultiple.hbs +0 -1018
- package/src/hbs/weeklyMailerSingle.hbs +0 -871
- package/src/routes/emailers.js +0 -20
- package/src/services/user.service.js +0 -67
package/index.js
CHANGED
|
@@ -4,7 +4,6 @@ import { analysisTrafficRouter } from './src/routes/traffic.routes.js';
|
|
|
4
4
|
import { mobileTrafficAnalysisRouter } from './src/routes/mobileTraffic.routes.js';
|
|
5
5
|
import { nobDocs } from './src/docs/nob.docs.js';
|
|
6
6
|
import nobRouter from './src/routes/nob.routes.js';
|
|
7
|
-
import emailersRouter from './src/routes/emailers.js';
|
|
8
7
|
|
|
9
|
-
export { analysisTrafficRouter, mobileTrafficAnalysisRouter, nobDocs, nobRouter
|
|
8
|
+
export { analysisTrafficRouter, mobileTrafficAnalysisRouter, nobDocs, nobRouter };
|
|
10
9
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tango-app-api-analysis-traffic",
|
|
3
|
-
"version": "3.1
|
|
3
|
+
"version": "3.3.1-alpha.1",
|
|
4
4
|
"description": "Traffic Analysis",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -18,16 +18,13 @@
|
|
|
18
18
|
"dotenv": "^16.4.5",
|
|
19
19
|
"express": "^4.19.2",
|
|
20
20
|
"handlebars": "^4.7.8",
|
|
21
|
-
"html-pdf": "^3.0.1",
|
|
22
|
-
"html-pdf-node": "^1.0.8",
|
|
23
21
|
"joi-to-swagger": "^6.2.0",
|
|
24
22
|
"lodash": "^4.17.21",
|
|
25
23
|
"mongodb": "^6.8.0",
|
|
26
24
|
"nodemon": "^3.1.4",
|
|
27
|
-
"puppeteer": "^23.11.1",
|
|
28
25
|
"swagger-ui-express": "^5.0.1",
|
|
29
26
|
"tango-api-schema": "^2.2.7",
|
|
30
|
-
"tango-app-api-middleware": "^3.1.
|
|
27
|
+
"tango-app-api-middleware": "^3.1.55",
|
|
31
28
|
"winston": "^3.13.1",
|
|
32
29
|
"winston-daily-rotate-file": "^5.0.0"
|
|
33
30
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { logger, download, signedUrl } from 'tango-app-api-middleware';
|
|
1
|
+
import { logger, download, signedUrl, getChecklistUsers } from 'tango-app-api-middleware';
|
|
2
2
|
import * as clientService from '../services/clients.services.js';
|
|
3
3
|
import {
|
|
4
4
|
aggregateStore,
|
|
@@ -1928,3 +1928,21 @@ export const getStoreMapData = async ( req, res ) => {
|
|
|
1928
1928
|
// }
|
|
1929
1929
|
// let getGEO = await getGeocodedAddress( 12.900260100404893, 80.23384232089138 );
|
|
1930
1930
|
// console.log( 'getGEO =>', getGEO );
|
|
1931
|
+
|
|
1932
|
+
export async function getUserEmails( req, res ) {
|
|
1933
|
+
try {
|
|
1934
|
+
let requestData = req.body;
|
|
1935
|
+
// Get User Based Checklist //
|
|
1936
|
+
let loginUser = { clientId: requestData.clientId, role: req.user.role, userType: req.user.userType, userEmail: req.user.email };
|
|
1937
|
+
let getUserEmails = await getChecklistUsers( loginUser );
|
|
1938
|
+
// End: Get User Based Checklist////
|
|
1939
|
+
if ( !getUserEmails.length ) {
|
|
1940
|
+
return res.sendError( { error: 'No Users Found' }, 204 );
|
|
1941
|
+
} else {
|
|
1942
|
+
return res.sendSuccess( { userEmailData: getUserEmails } );
|
|
1943
|
+
}
|
|
1944
|
+
} catch ( e ) {
|
|
1945
|
+
logger.error( { function: 'getUserEmails', error: e, message: req.body } );
|
|
1946
|
+
return res.sendError( e, 500 );
|
|
1947
|
+
}
|
|
1948
|
+
}
|
|
@@ -233,23 +233,3 @@ export const getStoreCameraImageSchema = joi.object( {
|
|
|
233
233
|
export const getStoreCameraImageParams = {
|
|
234
234
|
body: getStoreCameraImageSchema,
|
|
235
235
|
};
|
|
236
|
-
|
|
237
|
-
export const createEmailersSchema = joi.object( {
|
|
238
|
-
clientId: joi.string().required(),
|
|
239
|
-
fromDate: joi.string().required(),
|
|
240
|
-
toDate: joi.string().required(),
|
|
241
|
-
templateType: joi.string().required(),
|
|
242
|
-
} );
|
|
243
|
-
|
|
244
|
-
export const createEmailersParams = {
|
|
245
|
-
body: createEmailersSchema,
|
|
246
|
-
};
|
|
247
|
-
|
|
248
|
-
export const sendEmailersSchema = joi.object( {
|
|
249
|
-
_id: joi.string().required(),
|
|
250
|
-
} );
|
|
251
|
-
|
|
252
|
-
export const sendEmailersParams = {
|
|
253
|
-
body: sendEmailersSchema,
|
|
254
|
-
};
|
|
255
|
-
|
|
@@ -57,6 +57,7 @@ import {
|
|
|
57
57
|
headerStoresV2,
|
|
58
58
|
headerClustersV2,
|
|
59
59
|
headerLocationsV2,
|
|
60
|
+
getUserEmails,
|
|
60
61
|
} from '../controllers/tangoTrafficV1.controllers.js';
|
|
61
62
|
|
|
62
63
|
import {
|
|
@@ -165,6 +166,7 @@ analysisTrafficRouter
|
|
|
165
166
|
.post( '/storeOperation_v3', isAllowedSessionHandler, isAllowedClient, validate( validationDtos.validateStoreOperationParams ), storeOperationV3 )
|
|
166
167
|
.post( '/performanceMatrix_v3', isAllowedSessionHandler, isAllowedClient, validate( validationDtos.validateperformanceMatrixParams ), performanceMatrixV3 )
|
|
167
168
|
.post( '/zoneDwellTimeSplit_v3', isAllowedSessionHandler, isAllowedClient, validate( validationDtos.validateStoreOperationParams ), zoneDwellTimeSplitV3 )
|
|
168
|
-
.post( '/storesMap_v1', isAllowedSessionHandler, isAllowedClient, validate( validationDtos.validateStoresMapParams ), storesMapV1 )
|
|
169
|
+
.post( '/storesMap_v1', isAllowedSessionHandler, isAllowedClient, validate( validationDtos.validateStoresMapParams ), storesMapV1 )
|
|
170
|
+
.post( '/headerUserEmails_v2', isAllowedSessionHandler, getUserEmails );
|
|
169
171
|
|
|
170
172
|
export default analysisTrafficRouter;
|