tango-app-api-audit 3.3.0-alpha.2 → 3.3.0-alpha.21
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 +3 -3
- package/src/controllers/audit.controllers.js +487 -88
- package/src/docs/audit.docs.js +64 -46
- package/src/dtos/audit.dtos.js +28 -4
- package/src/routes/audit.routes.js +8 -8
- package/src/service/auditStoreData.service.js +1 -1
- package/src/validation/audit.validation.js +9 -8
- package/src/controllers/auditMetrics.controllers.js +0 -71
- package/src/controllers/zoneAudit.controller.js +0 -1827
- package/src/docs/auditMetrics.docs.js +0 -70
- package/src/docs/zoneAudit.docs.js +0 -268
- package/src/dtos/auditMetrics.dtos.js +0 -39
- package/src/dtos/zoneAudit.dtos.js +0 -171
- package/src/routes/auditMetrics.routes.js +0 -14
- package/src/routes/zone.routes.js +0 -24
- package/src/validation/zoneAudit.validation.js +0 -167
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import j2s from 'joi-to-swagger';
|
|
2
|
-
import { auditImageValidSchema, getAuditImagesSchema } from '../dtos/auditMetrics.dtos.js';
|
|
3
|
-
|
|
4
|
-
export const auditMetricsDocs = {
|
|
5
|
-
|
|
6
|
-
'/v3/audit-metrics/get-audit-images': {
|
|
7
|
-
post: {
|
|
8
|
-
tags: [ 'Audit Metrics' ],
|
|
9
|
-
description: `Get list of client with date range`,
|
|
10
|
-
operationId: 'client-list-table',
|
|
11
|
-
parameters: {},
|
|
12
|
-
requestBody: {
|
|
13
|
-
content: {
|
|
14
|
-
'application/json': {
|
|
15
|
-
schema: j2s( getAuditImagesSchema ).swagger,
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
responses: {
|
|
20
|
-
200: { description: 'Get user permission successfully' },
|
|
21
|
-
401: { description: 'Unauthorized User' },
|
|
22
|
-
422: { description: 'Field Error' },
|
|
23
|
-
500: { description: 'Server Error' },
|
|
24
|
-
204: { description: 'Not Found' },
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
'/v3/audit-metrics/audit-images': {
|
|
31
|
-
get: {
|
|
32
|
-
tags: [ 'Audit Metrics' ],
|
|
33
|
-
description: `View and Download audit images`,
|
|
34
|
-
operationId: 'audit-images',
|
|
35
|
-
parameters: [
|
|
36
|
-
{
|
|
37
|
-
in: 'query',
|
|
38
|
-
name: 'fileDate',
|
|
39
|
-
scema: j2s( auditImageValidSchema ).swagger,
|
|
40
|
-
require: true,
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
in: 'query',
|
|
44
|
-
name: 'storeId',
|
|
45
|
-
scema: j2s( auditImageValidSchema ).swagger,
|
|
46
|
-
require: true,
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
in: 'query',
|
|
50
|
-
name: 'imageType',
|
|
51
|
-
scema: j2s( auditImageValidSchema ).swagger,
|
|
52
|
-
require: true,
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
in: 'query',
|
|
56
|
-
name: 'export',
|
|
57
|
-
scema: j2s( auditImageValidSchema ).swagger,
|
|
58
|
-
require: true,
|
|
59
|
-
},
|
|
60
|
-
],
|
|
61
|
-
responses: {
|
|
62
|
-
200: { description: 'Successful' },
|
|
63
|
-
401: { description: 'Unauthorized User' },
|
|
64
|
-
422: { description: 'Field Error' },
|
|
65
|
-
500: { description: 'Server Error' },
|
|
66
|
-
204: { description: 'Not Found' },
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
};
|
|
@@ -1,268 +0,0 @@
|
|
|
1
|
-
import j2s from 'joi-to-swagger';
|
|
2
|
-
import { clientMetricsSchema, getDraftedDataSchema, getFileSchema, saveDraftSchema, saveSchema, storeMetricsSchema, workSpaceSchema, zoneAuditImageValidSchema, reTriggerValidSchema } from '../dtos/zoneAudit.dtos.js';
|
|
3
|
-
|
|
4
|
-
export const zoneAuditDocs = {
|
|
5
|
-
'/v3/zone-audit/get-file': {
|
|
6
|
-
get: {
|
|
7
|
-
tags: [ 'Zone Audit' ],
|
|
8
|
-
description: 'Get a file via queue message',
|
|
9
|
-
operationId: 'get-file',
|
|
10
|
-
parameters: [
|
|
11
|
-
{
|
|
12
|
-
in: 'query',
|
|
13
|
-
name: 'queueName',
|
|
14
|
-
scema: j2s( getFileSchema ).swagger,
|
|
15
|
-
require: true,
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
in: 'query',
|
|
19
|
-
name: 'nextId',
|
|
20
|
-
scema: j2s( getFileSchema ).swagger,
|
|
21
|
-
require: false,
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
in: 'query',
|
|
25
|
-
name: 'limit',
|
|
26
|
-
scema: j2s( getFileSchema ).swagger,
|
|
27
|
-
require: false,
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
responses: {
|
|
31
|
-
200: { description: 'Successful' },
|
|
32
|
-
401: { description: 'Unauthorized User' },
|
|
33
|
-
422: { description: 'Field Error' },
|
|
34
|
-
500: { description: 'Server Error' },
|
|
35
|
-
204: { description: 'Not Found' },
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
'/v3/zone-audit/save-draft': {
|
|
40
|
-
post: {
|
|
41
|
-
tags: [ 'Zone Audit' ],
|
|
42
|
-
description: `saved zone audited file. which is save in the mongo db`,
|
|
43
|
-
operationId: 'save-draft',
|
|
44
|
-
parameters: {},
|
|
45
|
-
requestBody: {
|
|
46
|
-
content: {
|
|
47
|
-
'application/json': {
|
|
48
|
-
schema: j2s( saveDraftSchema ).swagger,
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
responses: {
|
|
53
|
-
200: { description: 'Successful' },
|
|
54
|
-
401: { description: 'Unauthorized User' },
|
|
55
|
-
422: { description: 'Field Error' },
|
|
56
|
-
500: { description: 'Server Error' },
|
|
57
|
-
204: { description: 'Not Found' },
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
'/v3/zone-audit/get-drafted-data': {
|
|
62
|
-
get: {
|
|
63
|
-
tags: [ 'Zone Audit' ],
|
|
64
|
-
description: 'Get a saved file via DB',
|
|
65
|
-
operationId: 'get-drafted-data',
|
|
66
|
-
parameters: [
|
|
67
|
-
{
|
|
68
|
-
in: 'query',
|
|
69
|
-
name: 'fileDate',
|
|
70
|
-
scema: j2s( getDraftedDataSchema ).swagger,
|
|
71
|
-
require: true,
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
in: 'query',
|
|
75
|
-
name: 'storeId',
|
|
76
|
-
scema: j2s( getDraftedDataSchema ).swagger,
|
|
77
|
-
require: true,
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
in: 'query',
|
|
81
|
-
name: 'zoneName',
|
|
82
|
-
scema: j2s( getDraftedDataSchema ).swagger,
|
|
83
|
-
require: true,
|
|
84
|
-
},
|
|
85
|
-
],
|
|
86
|
-
responses: {
|
|
87
|
-
200: { description: 'Successful' },
|
|
88
|
-
401: { description: 'Unauthorized User' },
|
|
89
|
-
422: { description: 'Field Error' },
|
|
90
|
-
500: { description: 'Server Error' },
|
|
91
|
-
204: { description: 'Not Found' },
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
'/v3/zone-audit/save': {
|
|
96
|
-
post: {
|
|
97
|
-
tags: [ 'Zone Audit' ],
|
|
98
|
-
description: `submit the audit file. which is store in the bucket in the json format`,
|
|
99
|
-
operationId: 'save',
|
|
100
|
-
parameters: {},
|
|
101
|
-
requestBody: {
|
|
102
|
-
content: {
|
|
103
|
-
'application/json': {
|
|
104
|
-
schema: j2s( saveSchema ).swagger,
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
responses: {
|
|
109
|
-
200: { description: 'The Audited file has been submited successfully ' },
|
|
110
|
-
401: { description: 'Unauthorized User' },
|
|
111
|
-
422: { description: 'Field Error' },
|
|
112
|
-
500: { description: 'Server Error' },
|
|
113
|
-
204: { description: 'Not Found' },
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
|
-
},
|
|
117
|
-
'/v3/zone-audit/work-space': {
|
|
118
|
-
get: {
|
|
119
|
-
tags: [ 'Zone Audit' ],
|
|
120
|
-
description: 'queue wise info of audit files ',
|
|
121
|
-
operationId: 'work-space',
|
|
122
|
-
parameters: [
|
|
123
|
-
{
|
|
124
|
-
in: 'query',
|
|
125
|
-
name: 'searchValue',
|
|
126
|
-
scema: j2s( workSpaceSchema ).swagger,
|
|
127
|
-
require: false,
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
in: 'query',
|
|
131
|
-
name: 'offset',
|
|
132
|
-
scema: j2s( workSpaceSchema ).swagger,
|
|
133
|
-
require: false,
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
in: 'query',
|
|
137
|
-
name: 'limit',
|
|
138
|
-
scema: j2s( workSpaceSchema ).swagger,
|
|
139
|
-
require: false,
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
in: 'query',
|
|
143
|
-
name: 'isExport',
|
|
144
|
-
scema: j2s( workSpaceSchema ).swagger,
|
|
145
|
-
require: false,
|
|
146
|
-
},
|
|
147
|
-
],
|
|
148
|
-
responses: {
|
|
149
|
-
200: { description: 'Successful' },
|
|
150
|
-
401: { description: 'Unauthorized User' },
|
|
151
|
-
422: { description: 'Field Error' },
|
|
152
|
-
500: { description: 'Server Error' },
|
|
153
|
-
204: { description: 'Not Found' },
|
|
154
|
-
},
|
|
155
|
-
},
|
|
156
|
-
},
|
|
157
|
-
|
|
158
|
-
// metrics
|
|
159
|
-
'/v3/zone-audit/metrics/store-metrics': {
|
|
160
|
-
post: {
|
|
161
|
-
tags: [ 'Zone Audit Metrics' ],
|
|
162
|
-
description: `Get store level zone metrics`,
|
|
163
|
-
operationId: 'save',
|
|
164
|
-
parameters: {},
|
|
165
|
-
requestBody: {
|
|
166
|
-
content: {
|
|
167
|
-
'application/json': {
|
|
168
|
-
schema: j2s( storeMetricsSchema ).swagger,
|
|
169
|
-
},
|
|
170
|
-
},
|
|
171
|
-
},
|
|
172
|
-
responses: {
|
|
173
|
-
200: { description: 'Successful' },
|
|
174
|
-
401: { description: 'Unauthorized User' },
|
|
175
|
-
422: { description: 'Field Error' },
|
|
176
|
-
500: { description: 'Server Error' },
|
|
177
|
-
204: { description: 'Not Found' },
|
|
178
|
-
},
|
|
179
|
-
},
|
|
180
|
-
},
|
|
181
|
-
|
|
182
|
-
'/v3/zone-audit/metrics/audit-images': {
|
|
183
|
-
get: {
|
|
184
|
-
'tags': [ 'Zone Audit Metrics' ],
|
|
185
|
-
'description': `View and Download audit images`,
|
|
186
|
-
'operationId': 'zone audit-images',
|
|
187
|
-
'parameters': [
|
|
188
|
-
{
|
|
189
|
-
in: 'query',
|
|
190
|
-
name: 'fileDate',
|
|
191
|
-
scema: j2s( zoneAuditImageValidSchema ).swagger,
|
|
192
|
-
require: true,
|
|
193
|
-
},
|
|
194
|
-
{
|
|
195
|
-
in: 'query',
|
|
196
|
-
name: 'storeId',
|
|
197
|
-
scema: j2s( zoneAuditImageValidSchema ).swagger,
|
|
198
|
-
require: true,
|
|
199
|
-
},
|
|
200
|
-
{
|
|
201
|
-
in: 'query',
|
|
202
|
-
name: 'imageType',
|
|
203
|
-
scema: j2s( zoneAuditImageValidSchema ).swagger,
|
|
204
|
-
require: true,
|
|
205
|
-
},
|
|
206
|
-
{
|
|
207
|
-
in: 'query',
|
|
208
|
-
name: 'export',
|
|
209
|
-
scema: j2s( zoneAuditImageValidSchema ).swagger,
|
|
210
|
-
require: true,
|
|
211
|
-
},
|
|
212
|
-
{
|
|
213
|
-
in: 'query',
|
|
214
|
-
name: 'zoneName',
|
|
215
|
-
scema: j2s( zoneAuditImageValidSchema ).swagger,
|
|
216
|
-
require: true,
|
|
217
|
-
},
|
|
218
|
-
],
|
|
219
|
-
|
|
220
|
-
'/v3/zone-audit/metrics/client-metrics': {
|
|
221
|
-
post: {
|
|
222
|
-
tags: [ 'Zone Audit Metrics' ],
|
|
223
|
-
description: `Get list of client wise details with date range`,
|
|
224
|
-
operationId: 'metrics/client-metrics',
|
|
225
|
-
parameters: {},
|
|
226
|
-
requestBody: {
|
|
227
|
-
content: {
|
|
228
|
-
'application/json': {
|
|
229
|
-
schema: j2s( clientMetricsSchema ).swagger,
|
|
230
|
-
},
|
|
231
|
-
},
|
|
232
|
-
},
|
|
233
|
-
responses: {
|
|
234
|
-
200: { description: 'Successful' },
|
|
235
|
-
401: { description: 'Unauthorized User' },
|
|
236
|
-
422: { description: 'Field Error' },
|
|
237
|
-
500: { description: 'Server Error' },
|
|
238
|
-
204: { description: 'Not Found' },
|
|
239
|
-
},
|
|
240
|
-
},
|
|
241
|
-
},
|
|
242
|
-
},
|
|
243
|
-
},
|
|
244
|
-
|
|
245
|
-
'/v3/zone-audit/metrics/re-trigger': {
|
|
246
|
-
post: {
|
|
247
|
-
tags: [ 'Zone Audit Metrics' ],
|
|
248
|
-
description: `Manual re trigger a file`,
|
|
249
|
-
operationId: 'metrics/re-trigger',
|
|
250
|
-
parameters: {},
|
|
251
|
-
requestBody: {
|
|
252
|
-
content: {
|
|
253
|
-
'application/json': {
|
|
254
|
-
schema: j2s( reTriggerValidSchema ).swagger,
|
|
255
|
-
},
|
|
256
|
-
},
|
|
257
|
-
},
|
|
258
|
-
responses: {
|
|
259
|
-
200: { description: 'Successful' },
|
|
260
|
-
401: { description: 'Unauthorized User' },
|
|
261
|
-
422: { description: 'Field Error' },
|
|
262
|
-
500: { description: 'Server Error' },
|
|
263
|
-
204: { description: 'Not Found' },
|
|
264
|
-
},
|
|
265
|
-
},
|
|
266
|
-
},
|
|
267
|
-
|
|
268
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import joi from 'joi';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export const getAuditImagesSchema = joi.object(
|
|
5
|
-
{
|
|
6
|
-
fileDate: joi.string().required(),
|
|
7
|
-
fileType: joi.string().required(),
|
|
8
|
-
storeId: joi.string().required(),
|
|
9
|
-
},
|
|
10
|
-
);
|
|
11
|
-
|
|
12
|
-
export const getAuditImagesValid = {
|
|
13
|
-
body: getAuditImagesSchema,
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export const auditImageValidSchema = joi.object(
|
|
18
|
-
{
|
|
19
|
-
fileDate: joi.string().required(),
|
|
20
|
-
storeId: joi.string().required(),
|
|
21
|
-
imageType: joi.string().required(),
|
|
22
|
-
export: joi.boolean().required(),
|
|
23
|
-
},
|
|
24
|
-
);
|
|
25
|
-
|
|
26
|
-
export const auditImageValid = {
|
|
27
|
-
query: auditImageValidSchema,
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export const viewLogSchema = joi.object(
|
|
31
|
-
{
|
|
32
|
-
fileDate: joi.string().required(),
|
|
33
|
-
storeId: joi.string().required(),
|
|
34
|
-
},
|
|
35
|
-
);
|
|
36
|
-
|
|
37
|
-
export const viewLogValid = {
|
|
38
|
-
query: viewLogSchema,
|
|
39
|
-
};
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
import joi from 'joi';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export const getFileSchema = joi.object(
|
|
5
|
-
{
|
|
6
|
-
queueName: joi.string().required(),
|
|
7
|
-
nextId: joi.string().optional().allow( '' ),
|
|
8
|
-
limit: joi.number().optional(),
|
|
9
|
-
},
|
|
10
|
-
);
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export const getFileValid = {
|
|
14
|
-
query: getFileSchema,
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export const saveDraftSchema = joi.object(
|
|
18
|
-
{
|
|
19
|
-
userCommands: joi.string().optional().allow( '' ),
|
|
20
|
-
storeId: joi.string().required(),
|
|
21
|
-
auditId: joi.string().required(),
|
|
22
|
-
zoneName: joi.string().required(),
|
|
23
|
-
auditType: joi.string().required(),
|
|
24
|
-
fileDate: joi.string().required(),
|
|
25
|
-
queueName: joi.string().required(),
|
|
26
|
-
totalCount: joi.number().required(),
|
|
27
|
-
junkCount: joi.number().optional(),
|
|
28
|
-
junk: joi.array().optional(),
|
|
29
|
-
employeeCount: joi.number().optional(),
|
|
30
|
-
employee: joi.array().optional(),
|
|
31
|
-
customerCount: joi.number().optional(),
|
|
32
|
-
customer: joi.array().optional(),
|
|
33
|
-
retagCount: joi.number().optional(),
|
|
34
|
-
retagImage: joi.array().optional(),
|
|
35
|
-
},
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
export const saveDraftValid = {
|
|
39
|
-
body: saveDraftSchema,
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
export const saveSchema = joi.object(
|
|
44
|
-
{
|
|
45
|
-
auditId: joi.string().required(),
|
|
46
|
-
storeId: joi.string().required(),
|
|
47
|
-
zoneName: joi.string().required(),
|
|
48
|
-
fileDate: joi.string().required(),
|
|
49
|
-
auditType: joi.string().required(),
|
|
50
|
-
beforeCount: joi.number().required(),
|
|
51
|
-
junkCount: joi.number().required(),
|
|
52
|
-
junk: joi.array().required(),
|
|
53
|
-
employeeCount: joi.number().required(),
|
|
54
|
-
employee: joi.array().required(),
|
|
55
|
-
customerCount: joi.number().required(),
|
|
56
|
-
customer: joi.array().required(),
|
|
57
|
-
},
|
|
58
|
-
);
|
|
59
|
-
|
|
60
|
-
export const saveValid = {
|
|
61
|
-
body: saveSchema,
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
export const getDraftedDataSchema = joi.object(
|
|
65
|
-
{
|
|
66
|
-
storeId: joi.string().required(),
|
|
67
|
-
zoneName: joi.string().required(),
|
|
68
|
-
fileDate: joi.string().required(),
|
|
69
|
-
userId: joi.string().optional(),
|
|
70
|
-
},
|
|
71
|
-
);
|
|
72
|
-
|
|
73
|
-
export const getDraftedDataValid = {
|
|
74
|
-
query: getDraftedDataSchema,
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
export const workSpaceSchema = joi.object(
|
|
78
|
-
{
|
|
79
|
-
searchValue: joi.string().optional().allow( '' ),
|
|
80
|
-
offset: joi.string().optional(),
|
|
81
|
-
limit: joi.number().optional(),
|
|
82
|
-
isExport: joi.boolean().optional(),
|
|
83
|
-
},
|
|
84
|
-
);
|
|
85
|
-
|
|
86
|
-
export const workSpaceValid = {
|
|
87
|
-
query: workSpaceSchema,
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
export const storeMetricsSchema = joi.object(
|
|
91
|
-
{
|
|
92
|
-
fromDate: joi.string().required(),
|
|
93
|
-
toDate: joi.string().required(),
|
|
94
|
-
searchValue: joi.string().optional().allow( '' ),
|
|
95
|
-
filterByClientId: joi.array().required(),
|
|
96
|
-
filterByStoreId: joi.array().optional(),
|
|
97
|
-
filterByStatus: joi.array().optional(),
|
|
98
|
-
filterByType: joi.array().optional(),
|
|
99
|
-
sortColumnName: joi.string().optional(),
|
|
100
|
-
sortBy: joi.number().optional(),
|
|
101
|
-
limit: joi.number().optional(),
|
|
102
|
-
offset: joi.number().optional(),
|
|
103
|
-
isExport: joi.boolean().optional(),
|
|
104
|
-
},
|
|
105
|
-
);
|
|
106
|
-
|
|
107
|
-
export const storeMetricsValid = {
|
|
108
|
-
body: storeMetricsSchema,
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
export const zoneAuditImageValidSchema = joi.object(
|
|
112
|
-
{
|
|
113
|
-
fileDate: joi.string().required(),
|
|
114
|
-
storeId: joi.string().required(),
|
|
115
|
-
imageType: joi.string().required(),
|
|
116
|
-
export: joi.boolean().required(),
|
|
117
|
-
zoneName: joi.string().required(),
|
|
118
|
-
},
|
|
119
|
-
);
|
|
120
|
-
|
|
121
|
-
export const zoneAuditImageValid = {
|
|
122
|
-
query: zoneAuditImageValidSchema,
|
|
123
|
-
};
|
|
124
|
-
export const clientMetricsSchema = joi.object(
|
|
125
|
-
{
|
|
126
|
-
fromDate: joi.string().required(),
|
|
127
|
-
toDate: joi.string().required(),
|
|
128
|
-
searchValue: joi.string().optional().allow( '' ),
|
|
129
|
-
filterByClient: joi.array().required(),
|
|
130
|
-
filterByStatus: joi.array().optional(),
|
|
131
|
-
sortColumnName: joi.string().optional(),
|
|
132
|
-
sortBy: joi.number().optional(),
|
|
133
|
-
limit: joi.number().optional(),
|
|
134
|
-
offset: joi.number().optional(),
|
|
135
|
-
isExport: joi.boolean().optional(),
|
|
136
|
-
},
|
|
137
|
-
);
|
|
138
|
-
|
|
139
|
-
export const clientMetricsValid = {
|
|
140
|
-
body: clientMetricsSchema,
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
export const reTriggerValidSchema = joi.object(
|
|
144
|
-
{
|
|
145
|
-
fileDate: joi.string().required(),
|
|
146
|
-
storeId: joi.string().required(),
|
|
147
|
-
zoneName: joi.string().required(),
|
|
148
|
-
type: joi.string().optional(),
|
|
149
|
-
triggerType: joi.string().optional(),
|
|
150
|
-
totalCount: joi.number().required(),
|
|
151
|
-
userId: joi.string().optional(),
|
|
152
|
-
comments: joi.string().optional().allow( '' ),
|
|
153
|
-
},
|
|
154
|
-
);
|
|
155
|
-
|
|
156
|
-
export const reTriggerValid = {
|
|
157
|
-
body: reTriggerValidSchema,
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
export const viewLogSchema = joi.object(
|
|
161
|
-
{
|
|
162
|
-
fileDate: joi.string().required(),
|
|
163
|
-
storeId: joi.string().required(),
|
|
164
|
-
zoneName: joi.string().required(),
|
|
165
|
-
},
|
|
166
|
-
);
|
|
167
|
-
|
|
168
|
-
export const viewLogValid = {
|
|
169
|
-
body: viewLogSchema,
|
|
170
|
-
};
|
|
171
|
-
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import express from 'express';
|
|
3
|
-
import { isAllowedSessionHandler, validate } from 'tango-app-api-middleware';
|
|
4
|
-
import { auditImages } from '../controllers/auditMetrics.controllers.js';
|
|
5
|
-
import { auditImageValid, viewLogValid } from '../dtos/auditMetrics.dtos.js';
|
|
6
|
-
import { isAuditInputFolderExist } from '../validation/audit.validation.js';
|
|
7
|
-
|
|
8
|
-
export const auditMetricsRouter = express.Router();
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
auditMetricsRouter.get( '/audit-images', isAllowedSessionHandler, validate( auditImageValid ), isAuditInputFolderExist, auditImages );
|
|
12
|
-
auditMetricsRouter.post( '/view-log', isAllowedSessionHandler, validate( viewLogValid ), isAuditInputFolderExist, auditImages );
|
|
13
|
-
|
|
14
|
-
export default auditMetricsRouter;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Router } from 'express';
|
|
2
|
-
import { clientMetricsValid, getDraftedDataValid, getFileValid, reTriggerValid, saveDraftValid, saveValid, viewLogValid, workSpaceValid, zoneAuditImageValid } from '../dtos/zoneAudit.dtos.js';
|
|
3
|
-
import { isExistsQueue, validateUserAudit } from '../validation/audit.validation.js';
|
|
4
|
-
import { isAllowedSessionHandler, validate } from 'tango-app-api-middleware';
|
|
5
|
-
import { clientMetrics, getDraftedData, getZoneAuditFile, reTrigger, save, saveDraft, storeMetrics, viewLog, workSpace, zoneAuditImages } from '../controllers/zoneAudit.controller.js';
|
|
6
|
-
import { storeMetricsValid } from '../dtos/auditMetrics.dtos.js';
|
|
7
|
-
import { isZoneAuditInputFolderExist, isAuditInputFolderExist, isAuditDocumentExist } from '../validation/zoneAudit.validation.js';
|
|
8
|
-
|
|
9
|
-
export const zoneAuditRouter=Router();
|
|
10
|
-
|
|
11
|
-
// zone Audit
|
|
12
|
-
zoneAuditRouter.get( '/get-file', isAllowedSessionHandler, validate( getFileValid ), isExistsQueue, getZoneAuditFile );
|
|
13
|
-
zoneAuditRouter.post( '/save-draft', isAllowedSessionHandler, validate( saveDraftValid ), saveDraft );
|
|
14
|
-
zoneAuditRouter.get( '/get-drafted-data', isAllowedSessionHandler, validate( getDraftedDataValid ), getDraftedData );
|
|
15
|
-
zoneAuditRouter.post( '/save', isAllowedSessionHandler, validate( saveValid ), validateUserAudit, save );
|
|
16
|
-
zoneAuditRouter.get( '/work-space', isAllowedSessionHandler, validate( workSpaceValid ), workSpace );
|
|
17
|
-
|
|
18
|
-
// metrics
|
|
19
|
-
|
|
20
|
-
zoneAuditRouter.post( '/metrics/store-metrics', isAllowedSessionHandler, validate( storeMetricsValid ), storeMetrics );
|
|
21
|
-
zoneAuditRouter.get( '/metrics/audit-images', isAllowedSessionHandler, validate( zoneAuditImageValid ), isZoneAuditInputFolderExist, zoneAuditImages );
|
|
22
|
-
zoneAuditRouter.post( '/metrics/client-metrics', isAllowedSessionHandler, validate( clientMetricsValid ), clientMetrics );
|
|
23
|
-
zoneAuditRouter.post( '/metrics/re-trigger', isAllowedSessionHandler, validate( reTriggerValid ), isAuditDocumentExist, isAuditInputFolderExist, reTrigger );
|
|
24
|
-
zoneAuditRouter.post( '/view-log', isAllowedSessionHandler, validate( viewLogValid ), viewLog );
|