tango-app-api-analysis-zone 3.0.0-alpha.32 → 3.0.0-alpha.34
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/analysisZoneV1.controllers.js +1 -0
- package/src/controllers/analysisZoneV2.controllers.js +1 -0
- package/src/controllers/mobileAnalysisZoneV2.controllers.js +1 -0
- package/src/routes/analysisZone.js +17 -17
- package/src/routes/analysisZoneV2.js +25 -25
- package/src/services/userAssignedStore.service.js +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tango-app-api-analysis-zone",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.34",
|
|
4
4
|
"description": "zone Analysis",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"mongodb": "^6.8.0",
|
|
22
22
|
"nodemon": "^3.1.4",
|
|
23
23
|
"tango-api-schema": "^2.0.131",
|
|
24
|
-
"tango-app-api-middleware": "^3.1.
|
|
24
|
+
"tango-app-api-middleware": "^3.1.45",
|
|
25
25
|
"winston": "^3.13.1",
|
|
26
26
|
"winston-daily-rotate-file": "^5.0.0"
|
|
27
27
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
|
-
import { validate, isAllowedSessionHandler,
|
|
2
|
+
import { validate, isAllowedSessionHandler, accessVerification } from 'tango-app-api-middleware';
|
|
3
3
|
import * as validationDtos from '../dtos/validation.dtos.js';
|
|
4
4
|
|
|
5
5
|
export const analysisZoneRouter = express.Router();
|
|
@@ -36,44 +36,44 @@ analysisZoneRouter
|
|
|
36
36
|
.post( '/zoneConcentrationSummaryTable', zoneConcentrationSummaryTable )
|
|
37
37
|
.post( '/zoneHeatmapAvailableDates', zoneHeatmapAvailableDates )
|
|
38
38
|
.post( '/zoneHeatmapDatas', zoneHeatmapDatas )
|
|
39
|
-
.post( '/cardsAgeAnalysis_v1', isAllowedSessionHandler, isAllowedClient,
|
|
39
|
+
.post( '/cardsAgeAnalysis_v1', isAllowedSessionHandler, isAllowedClient, accessVerification( {
|
|
40
40
|
userType: [ 'tango', 'client' ], access: [
|
|
41
|
-
{ featureName: '
|
|
41
|
+
{ featureName: 'TangoEye', name: 'ZoneTag', permissions: [] },
|
|
42
42
|
],
|
|
43
43
|
} ), validate( validationDtos.validateCardsAgeAnalysisParams ), cardsAgeAnalysisV1 )
|
|
44
|
-
.post( '/topPerformingZones_v1', isAllowedSessionHandler, isAllowedClient,
|
|
44
|
+
.post( '/topPerformingZones_v1', isAllowedSessionHandler, isAllowedClient, accessVerification( {
|
|
45
45
|
userType: [ 'tango', 'client' ], access: [
|
|
46
|
-
{ featureName: '
|
|
46
|
+
{ featureName: 'TangoEye', name: 'ZoneTag', permissions: [] },
|
|
47
47
|
],
|
|
48
48
|
} ), validate( validationDtos.validateTopPerformingZonesParams ), topPerformingZonesV1 )
|
|
49
|
-
.post( '/topPerformingStores_v1', isAllowedSessionHandler, isAllowedClient,
|
|
49
|
+
.post( '/topPerformingStores_v1', isAllowedSessionHandler, isAllowedClient, accessVerification( {
|
|
50
50
|
userType: [ 'tango', 'client' ], access: [
|
|
51
|
-
{ featureName: '
|
|
51
|
+
{ featureName: 'TangoEye', name: 'ZoneTag', permissions: [] },
|
|
52
52
|
],
|
|
53
53
|
} ), validate( validationDtos.validateTopPerformingStoresParams ), topPerformingStoresV1 )
|
|
54
|
-
.post( '/zoneSummaryTable_v1', isAllowedSessionHandler, isAllowedClient,
|
|
54
|
+
.post( '/zoneSummaryTable_v1', isAllowedSessionHandler, isAllowedClient, accessVerification( {
|
|
55
55
|
userType: [ 'tango', 'client' ], access: [
|
|
56
|
-
{ featureName: '
|
|
56
|
+
{ featureName: 'TangoEye', name: 'ZoneTag', permissions: [] },
|
|
57
57
|
],
|
|
58
58
|
} ), validate( validationDtos.validateZoneSummaryTableParams ), zoneSummaryTableV1 )
|
|
59
|
-
.post( '/zoneConcentrationSummaryTable_v1', isAllowedSessionHandler, isAllowedClient,
|
|
59
|
+
.post( '/zoneConcentrationSummaryTable_v1', isAllowedSessionHandler, isAllowedClient, accessVerification( {
|
|
60
60
|
userType: [ 'tango', 'client' ], access: [
|
|
61
|
-
{ featureName: '
|
|
61
|
+
{ featureName: 'TangoEye', name: 'ZoneTag', permissions: [] },
|
|
62
62
|
],
|
|
63
63
|
} ), validate( validationDtos.validateZoneConcentrationSummaryTableParams ), zoneConcentrationSummaryTableV1 )
|
|
64
|
-
.post( '/zoneHeatmapAvailableDates_v1', isAllowedSessionHandler, isAllowedClient,
|
|
64
|
+
.post( '/zoneHeatmapAvailableDates_v1', isAllowedSessionHandler, isAllowedClient, accessVerification( {
|
|
65
65
|
userType: [ 'tango', 'client' ], access: [
|
|
66
|
-
{ featureName: '
|
|
66
|
+
{ featureName: 'TangoEye', name: 'ZoneTag', permissions: [] },
|
|
67
67
|
],
|
|
68
68
|
} ), validate( validationDtos.validateZoneHeatmapAvailableDatesParams ), zoneHeatmapAvailableDatesV1 )
|
|
69
|
-
.post( '/zoneHeatmapDatas_v1', isAllowedSessionHandler, isAllowedClient,
|
|
69
|
+
.post( '/zoneHeatmapDatas_v1', isAllowedSessionHandler, isAllowedClient, accessVerification( {
|
|
70
70
|
userType: [ 'tango', 'client' ], access: [
|
|
71
|
-
{ featureName: '
|
|
71
|
+
{ featureName: 'TangoEye', name: 'ZoneTag', permissions: [] },
|
|
72
72
|
],
|
|
73
73
|
} ), validate( validationDtos.validateZoneHeatmapDatasParams ), zoneHeatmapDatasV1 )
|
|
74
|
-
.post( '/zoneSegmentation_v1', isAllowedSessionHandler, isAllowedClient,
|
|
74
|
+
.post( '/zoneSegmentation_v1', isAllowedSessionHandler, isAllowedClient, accessVerification( {
|
|
75
75
|
userType: [ 'tango', 'client' ], access: [
|
|
76
|
-
{ featureName: '
|
|
76
|
+
{ featureName: 'TangoEye', name: 'ZoneTag', permissions: [] },
|
|
77
77
|
],
|
|
78
78
|
} ), validate( validationDtos.validateZoneSegmentationParams ), zoneSegmentationV1 );
|
|
79
79
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
|
-
import { validate, isAllowedSessionHandler,
|
|
2
|
+
import { validate, isAllowedSessionHandler, accessVerification, isAllowedClient } from 'tango-app-api-middleware';
|
|
3
3
|
import * as validationDtos from '../dtos/validation.dtos.js';
|
|
4
4
|
|
|
5
5
|
export const analysisZoneV2Router = express.Router();
|
|
@@ -44,64 +44,64 @@ analysisZoneV2Router
|
|
|
44
44
|
.post( '/trajectoryAnalysis', trajectoryAnalysis )
|
|
45
45
|
.post( '/customerJourney', customerJourney )
|
|
46
46
|
.post( '/customerJourneyTable', customerJourneyTable )
|
|
47
|
-
.post( '/zonecards_V2', isAllowedSessionHandler, isAllowedClient,
|
|
47
|
+
.post( '/zonecards_V2', isAllowedSessionHandler, isAllowedClient, accessVerification( {
|
|
48
48
|
userType: [ 'tango', 'client' ], access: [
|
|
49
|
-
{ featureName: '
|
|
49
|
+
{ featureName: 'TangoEye', name: 'ZoneTag', permissions: [] },
|
|
50
50
|
],
|
|
51
51
|
} ), validate( validationDtos.validateZoneCardsV2Params ), zonecardsV2 )
|
|
52
|
-
.post( '/topPerformingZones_v2', isAllowedSessionHandler, isAllowedClient,
|
|
52
|
+
.post( '/topPerformingZones_v2', isAllowedSessionHandler, isAllowedClient, accessVerification( {
|
|
53
53
|
userType: [ 'tango', 'client' ], access: [
|
|
54
|
-
{ featureName: '
|
|
54
|
+
{ featureName: 'TangoEye', name: 'ZoneTag', permissions: [] },
|
|
55
55
|
],
|
|
56
56
|
} ), validate( validationDtos.validateTopPerformingZonesV2Params ), topPerformingZonesV2 )
|
|
57
|
-
.post( '/topPerformingStores_v2', isAllowedSessionHandler, isAllowedClient,
|
|
57
|
+
.post( '/topPerformingStores_v2', isAllowedSessionHandler, isAllowedClient, accessVerification( {
|
|
58
58
|
userType: [ 'tango', 'client' ], access: [
|
|
59
|
-
{ featureName: '
|
|
59
|
+
{ featureName: 'TangoEye', name: 'ZoneTag', permissions: [] },
|
|
60
60
|
],
|
|
61
61
|
} ), validate( validationDtos.validateTopPerformingStoresV2Params ), topPerformingStoresV2 )
|
|
62
|
-
.post( '/zoneSummaryTable_v2', isAllowedSessionHandler, isAllowedClient,
|
|
62
|
+
.post( '/zoneSummaryTable_v2', isAllowedSessionHandler, isAllowedClient, accessVerification( {
|
|
63
63
|
userType: [ 'tango', 'client' ], access: [
|
|
64
|
-
{ featureName: '
|
|
64
|
+
{ featureName: 'TangoEye', name: 'ZoneTag', permissions: [] },
|
|
65
65
|
],
|
|
66
66
|
} ), validate( validationDtos.validateZoneSummaryTableV2Params ), zoneSummaryTableV2 )
|
|
67
|
-
.post( '/availableZoneNames_v2', isAllowedSessionHandler, isAllowedClient,
|
|
67
|
+
.post( '/availableZoneNames_v2', isAllowedSessionHandler, isAllowedClient, accessVerification( {
|
|
68
68
|
userType: [ 'tango', 'client' ], access: [
|
|
69
|
-
{ featureName: '
|
|
69
|
+
{ featureName: 'TangoEye', name: 'ZoneTag', permissions: [] },
|
|
70
70
|
],
|
|
71
71
|
} ), validate( validationDtos.validateAvailableZoneNamesV2Params ), availableZoneNamesV2 )
|
|
72
|
-
.post( '/zoneConcentrationSummary_v2', isAllowedSessionHandler, isAllowedClient,
|
|
72
|
+
.post( '/zoneConcentrationSummary_v2', isAllowedSessionHandler, isAllowedClient, accessVerification( {
|
|
73
73
|
userType: [ 'tango', 'client' ], access: [
|
|
74
|
-
{ featureName: '
|
|
74
|
+
{ featureName: 'TangoEye', name: 'ZoneTag', permissions: [] },
|
|
75
75
|
],
|
|
76
76
|
} ), validate( validationDtos.validateZoneConcentrationSummaryV2Params ), zoneConcentrationSummaryV2 )
|
|
77
|
-
.post( '/overallStoreConcentrationDates_v2', isAllowedSessionHandler, isAllowedClient,
|
|
77
|
+
.post( '/overallStoreConcentrationDates_v2', isAllowedSessionHandler, isAllowedClient, accessVerification( {
|
|
78
78
|
userType: [ 'tango', 'client' ], access: [
|
|
79
|
-
{ featureName: '
|
|
79
|
+
{ featureName: 'TangoEye', name: 'ZoneTag', permissions: [] },
|
|
80
80
|
],
|
|
81
81
|
} ), validate( validationDtos.validateOverallStoreConcentrationDatesV2Params ), overallStoreConcentrationDatesV2 )
|
|
82
|
-
.post( '/overallStoreConcentrationHeatmap_v2', isAllowedSessionHandler, isAllowedClient,
|
|
82
|
+
.post( '/overallStoreConcentrationHeatmap_v2', isAllowedSessionHandler, isAllowedClient, accessVerification( {
|
|
83
83
|
userType: [ 'tango', 'client' ], access: [
|
|
84
|
-
{ featureName: '
|
|
84
|
+
{ featureName: 'TangoEye', name: 'ZoneTag', permissions: [] },
|
|
85
85
|
],
|
|
86
86
|
} ), validate( validationDtos.validateOverallStoreConcentrationHeatmapV2Params ), overallStoreConcentrationHeatmapV2 )
|
|
87
|
-
.post( '/trajectoryAnalysis_v2', isAllowedSessionHandler, isAllowedClient,
|
|
87
|
+
.post( '/trajectoryAnalysis_v2', isAllowedSessionHandler, isAllowedClient, accessVerification( {
|
|
88
88
|
userType: [ 'tango', 'client' ], access: [
|
|
89
|
-
{ featureName: '
|
|
89
|
+
{ featureName: 'TangoEye', name: 'ZoneTag', permissions: [] },
|
|
90
90
|
],
|
|
91
91
|
} ), validate( validationDtos.validateTrajectoryAnalysisV2Params ), trajectoryAnalysisV2 )
|
|
92
|
-
.post( '/trajectoryAnalysisRate_v2', isAllowedSessionHandler, isAllowedClient,
|
|
92
|
+
.post( '/trajectoryAnalysisRate_v2', isAllowedSessionHandler, isAllowedClient, accessVerification( {
|
|
93
93
|
userType: [ 'tango', 'client' ], access: [
|
|
94
|
-
{ featureName: '
|
|
94
|
+
{ featureName: 'TangoEye', name: 'ZoneTag', permissions: [] },
|
|
95
95
|
],
|
|
96
96
|
} ), validate( validationDtos.validateTrajectoryAnalysisRateV2Params ), trajectoryAnalysisRateV2 )
|
|
97
|
-
.post( '/customerJourney_v2', isAllowedSessionHandler, isAllowedClient,
|
|
97
|
+
.post( '/customerJourney_v2', isAllowedSessionHandler, isAllowedClient, accessVerification( {
|
|
98
98
|
userType: [ 'tango', 'client' ], access: [
|
|
99
|
-
{ featureName: '
|
|
99
|
+
{ featureName: 'TangoEye', name: 'ZoneTag', permissions: [] },
|
|
100
100
|
],
|
|
101
101
|
} ), validate( validationDtos.validateCustomerJourneyV2Params ), customerJourneyV2 )
|
|
102
|
-
.post( '/customerJourneyTable_v2', isAllowedSessionHandler, isAllowedClient,
|
|
102
|
+
.post( '/customerJourneyTable_v2', isAllowedSessionHandler, isAllowedClient, accessVerification( {
|
|
103
103
|
userType: [ 'tango', 'client' ], access: [
|
|
104
|
-
{ featureName: '
|
|
104
|
+
{ featureName: 'TangoEye', name: 'ZoneTag', permissions: [] },
|
|
105
105
|
],
|
|
106
106
|
} ), validate( validationDtos.validateCustomerJourneyTableV2Params ), customerJourneyTableV2 );
|
|
107
107
|
export default analysisZoneV2Router;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import userAssignedStoreModel from 'tango-api-schema/schema/userAssignedStore.model.js';
|
|
2
|
+
|
|
3
|
+
export async function aggregateUserAssignedStore( query ) {
|
|
4
|
+
return await userAssignedStoreModel.aggregate( query );
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export async function findOneUserAssignedStore( query, record ) {
|
|
8
|
+
return await userAssignedStoreModel.findOne( query, record );
|
|
9
|
+
};
|