tango-app-api-infra 3.0.7 → 3.0.8

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 CHANGED
@@ -3,7 +3,7 @@
3
3
  import { infraRouter } from './src/routes/infra.routes.js';
4
4
  import { internalInfraRouter } from './src/routes/internalInfra.routes.js';
5
5
  import { userInfraRouter } from './src/routes/userinfra.routes.js';
6
-
7
- export { infraRouter, internalInfraRouter, userInfraRouter };
6
+ import { storeInfraRouter } from './src/routes/storeInfra.routes.js';
7
+ export { infraRouter, internalInfraRouter, userInfraRouter, storeInfraRouter };
8
8
 
9
9
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-app-api-infra",
3
- "version": "3.0.7",
3
+ "version": "3.0.8",
4
4
  "description": "infra",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -21,7 +21,7 @@
21
21
  "mongodb": "^6.4.0",
22
22
  "nodemon": "^3.1.0",
23
23
  "tango-api-schema": "^2.0.23",
24
- "tango-app-api-middleware": "^1.0.15",
24
+ "tango-app-api-middleware": "^1.0.18",
25
25
  "winston": "^3.12.0",
26
26
  "winston-daily-rotate-file": "^5.0.0"
27
27
  },
@@ -1,6 +1,6 @@
1
1
 
2
2
 
3
- import { createTangoTicket, updateOneTangoTicket } from '../services/tangoTicket.service.js';
3
+ import { createTangoTicket, findOneTangoTicket, updateOneTangoTicket } from '../services/tangoTicket.service.js';
4
4
  import { createinfraReason, findinfraReason } from '../services/infraReason.service.js';
5
5
  import { logger } from 'tango-app-api-middleware';
6
6
  export async function createTicket( req, res ) {
@@ -29,6 +29,7 @@ export async function updateStatus( req, res ) {
29
29
  try {
30
30
  let infraTicketDetails = {};
31
31
  if ( req.body.status == 'close' ) {
32
+ req.body.issueClosedDate = new Date();
32
33
  req.body.infraActivity.push( {
33
34
  actionType: 'dataRecived',
34
35
  actionBy: 'Tango',
@@ -114,3 +115,15 @@ export async function updateTicketIssue( req, res ) {
114
115
  return res.sendError( error, 500 );
115
116
  }
116
117
  }
118
+
119
+ export async function viewTicket( req, res ) {
120
+ try {
121
+ let ticket = await findOneTangoTicket( { ticketId: req.body.ticketId }, { ticketId: 1, status: 1, infraActivity: 1 } );
122
+ if ( ticket ) {
123
+ res.sendSuccess( ticket );
124
+ }
125
+ } catch ( error ) {
126
+ logger.error( { error: error, function: 'updateTicketIssue' } );
127
+ return res.sendError( error, 500 );
128
+ }
129
+ }
@@ -0,0 +1,627 @@
1
+
2
+ import { logger, getOpenSearchData } from 'tango-app-api-middleware';
3
+ import { aggregateTangoTicket } from '../services/tangoTicket.service.js';
4
+ import { findOneStore } from '../services/store.service.js';
5
+ import dayjs from 'dayjs';
6
+ export async function storeTicketList( req, res ) {
7
+ try {
8
+ let query = [ {
9
+ $match: {
10
+ 'basicDetails.storeId': req.body.storeId,
11
+ },
12
+ },
13
+ {
14
+ $project: {
15
+ storeId: '$basicDetails.storeId',
16
+ status: 1,
17
+ Date: { $dateToString: { format: '%d-%m-%Y', date: '$issueDate' } },
18
+ issueClosedDate: 1,
19
+ ticketId: 1,
20
+ issueStatus: '$infraTicketDetails.issueStatus',
21
+ ticketType: '$infraTicketDetails.ticketType',
22
+ primaryIssue: {
23
+ $filter: {
24
+ input: '$infraActivity',
25
+ as: 'item',
26
+ cond: { $eq: [ '$$item.actionType', 'issueUpdate' ] },
27
+ },
28
+ },
29
+ },
30
+ },
31
+ {
32
+ $unwind: {
33
+ path: '$primaryIssue', preserveNullAndEmptyArrays: true,
34
+ },
35
+ },
36
+ {
37
+ $unwind: {
38
+ path: '$primaryIssue.reasons', preserveNullAndEmptyArrays: true,
39
+ },
40
+ },
41
+ {
42
+ $project: {
43
+ storeId: 1,
44
+ Date: 1,
45
+ issueClosedDate: 1,
46
+ status: 1,
47
+ ticketId: 1,
48
+ issueStatus: 1,
49
+ ticketType: 1,
50
+ primaryIssue: '$primaryIssue.reasons.primaryIssue',
51
+ secondaryIssue: '$primaryIssue.reasons.secondaryIssue',
52
+ },
53
+ },
54
+ ];
55
+ let ticketList = await aggregateTangoTicket( query );
56
+ if ( ticketList.length ) {
57
+ res.sendSuccess( {
58
+ count: ticketList.length,
59
+ data: ticketList,
60
+ } );
61
+ } else {
62
+ return res.sendError( 'NO data', 204 );
63
+ }
64
+ } catch ( error ) {
65
+ logger.error( { error: error, function: 'storeTicketList' } );
66
+ return res.sendError( error, 500 );
67
+ }
68
+ }
69
+ export async function edgeAppLogTable( req, res ) {
70
+ try {
71
+ const store = await findOneStore( { storeId: req.body.storeId } );
72
+ if ( !store ) {
73
+ return res.sendError( 'Stores Not fond', 204 );
74
+ }
75
+ let startHour = store.storeProfile.open.split( ':' )[0];
76
+ let endHour = store.storeProfile.close.split( ':' )[0];
77
+ const interval = 60; // 1 hour in minutes
78
+ const timeSlots = generateTimeSlots( startHour, endHour, interval, req );
79
+ for ( const obj of timeSlots ) {
80
+ let internetSpeedQuery = {
81
+ 'size': 1,
82
+ 'query': {
83
+ 'bool': {
84
+ 'must': [
85
+ {
86
+ 'term': {
87
+ 'log_type.keyword': 'Application',
88
+ },
89
+ },
90
+ {
91
+ 'term': {
92
+ 'store_id.keyword': req.body.storeId,
93
+ },
94
+ },
95
+ {
96
+ 'terms': {
97
+ 'log_subtype.keyword': [ 'Speed_Test' ],
98
+ },
99
+ },
100
+ {
101
+ range: {
102
+ 'timestamp': {
103
+ gte: obj.from,
104
+ lte: obj.to,
105
+ },
106
+ },
107
+ },
108
+ ],
109
+
110
+ },
111
+ },
112
+ 'sort': [
113
+ { 'timestamp': { 'order': 'desc' } },
114
+ ],
115
+ };
116
+ let speedTest = await getOpenSearchData( 'edgeapp_systemlogs', internetSpeedQuery );
117
+
118
+ if ( speedTest.body.hits && speedTest.body.hits.hits.length > 0 && speedTest.body.hits.hits[0]._source ) {
119
+ obj.Internetspeed = speedTest.body.hits.hits[0]._source.data.upload_Speed;
120
+ } else {
121
+ obj.Internetspeed = '';
122
+ }
123
+ let FileCountQuery = {
124
+ 'query': {
125
+ 'bool': {
126
+ 'must': [
127
+
128
+ {
129
+ 'term': {
130
+ 'store_id.keyword': req.body.storeId,
131
+ },
132
+ },
133
+ {
134
+ range: {
135
+ 'timestamp': {
136
+ gte: obj.from,
137
+ lte: obj.to,
138
+ },
139
+ },
140
+ },
141
+ ],
142
+
143
+ },
144
+ },
145
+
146
+ 'sort': [
147
+ { 'timestamp': { 'order': 'desc' } },
148
+ ],
149
+ };
150
+ let newFilesCount = await getOpenSearchData( 'edgeapp_filelogs', FileCountQuery );
151
+
152
+ obj.files_pushed = newFilesCount.body.hits.total.value;
153
+ if ( obj.files_pushed > 0 ) {
154
+ obj.hourStatus = 'live';
155
+ } else {
156
+ obj.hourStatus = 'Not live';
157
+ }
158
+ let downTimeQuery = {
159
+ 'size': 1,
160
+ 'query': {
161
+ 'bool': {
162
+ 'must': [
163
+ {
164
+ 'term': {
165
+ 'doc.date.keyword': dayjs( obj.from ).format( 'DD-MM-YYYY' ),
166
+ },
167
+ },
168
+ {
169
+ 'term': {
170
+ 'doc.store_id.keyword': req.body.storeId,
171
+ },
172
+ },
173
+ {
174
+ 'terms': {
175
+ 'doc.hour.keyword': [ obj.hour ],
176
+ },
177
+ },
178
+ ],
179
+
180
+ },
181
+ },
182
+ };
183
+ const downtime = await getOpenSearchData( 'live_downtime_hourly', downTimeQuery );
184
+ let streamwiseDowntime = downtime.body.hits.hits.length > 0 ? downtime.body.hits.hits[0]._source.doc.streamwise_downtime : [];
185
+ if ( streamwiseDowntime.length > 0 ) {
186
+ const sum = streamwiseDowntime.reduce( ( accumulator, currentValue ) => {
187
+ return accumulator + currentValue.down_time;
188
+ }, 0 );
189
+ // Calculate the average
190
+ const average = sum / streamwiseDowntime.length;
191
+ obj.downtime = Math.round( average );
192
+ } else {
193
+ obj.downtime = 0;
194
+ }
195
+ let AppStatusQuery = {
196
+ 'size': 1,
197
+ 'query': {
198
+ 'bool': {
199
+ 'must': [
200
+ {
201
+ 'term': {
202
+ 'log_type.keyword': 'Application',
203
+ },
204
+ },
205
+ {
206
+ 'term': {
207
+ 'store_id.keyword': req.body.storeId,
208
+ },
209
+ },
210
+ {
211
+ 'terms': {
212
+ 'log_subtype.keyword': [ 'Online_Status' ],
213
+ },
214
+ },
215
+ {
216
+ range: {
217
+ 'timestamp': {
218
+ gte: obj.from,
219
+ lte: obj.to,
220
+ },
221
+ },
222
+ },
223
+ ],
224
+
225
+ },
226
+ },
227
+ 'sort': [
228
+ { 'timestamp': { 'order': 'desc' } },
229
+ ],
230
+ };
231
+ const AppStatus = await getOpenSearchData( 'edgeapp_systemlogs', AppStatusQuery );
232
+ obj.AppStatus = AppStatus.body.hits.hits.length > 0 ? AppStatus.body.hits.hits[0]._source.data.message : '';
233
+ }
234
+ res.sendSuccess( timeSlots );
235
+ } catch ( error ) {
236
+ logger.error( { error: error, function: 'edgeAppLog' } );
237
+ return res.sendError( error, 500 );
238
+ }
239
+ }
240
+ function generateTimeSlots( startHour, endHour, interval, req ) {
241
+ try {
242
+ const timeSlots = [];
243
+ for ( let hour = startHour; hour <= endHour; hour++ ) {
244
+ for ( let minute = 0; minute < 60; minute += interval ) {
245
+ let isoDate = new Date();
246
+
247
+ const inputDate = dayjs( req.body.Date ).format( 'YYYY-MM-DD' );
248
+ isoDate = new Date( inputDate );
249
+
250
+ isoDate.setHours( hour, minute, 0, 0 );
251
+ const timeSlotObj = {
252
+ hour: Number( hour ),
253
+ from: isoDate.toISOString(),
254
+ to: new Date( isoDate.getTime() + interval * 60000 ).toISOString(),
255
+ };
256
+ timeSlots.push( timeSlotObj );
257
+ }
258
+ }
259
+ return timeSlots;
260
+ } catch ( error ) {
261
+ logger.error( { error: error, function: 'generateTimeSlots' } );
262
+ return res.sendError( error, 500 );
263
+ }
264
+ };
265
+
266
+
267
+ export async function viewedgeAppLog( req, res ) {
268
+ try {
269
+ const store = await findOneStore( { storeId: req.body.storeId } );
270
+ if ( !store ) {
271
+ return res.sendError( 'Stores Not fond', 204 );
272
+ }
273
+ const inputDate = dayjs( req.body.Date ).format( 'YYYY-MM-DD' ); // Specify the date you want to add the times to
274
+ const fromTime = req.body.from;
275
+ const toTime = req.body.to;
276
+ let response = {};
277
+ const fromDateTime = dayjs( `${inputDate} ${fromTime}`, 'YYYY-MM-DD hh:mm A' );
278
+ const toDateTime = dayjs( `${inputDate} ${toTime}`, 'YYYY-MM-DD hh:mm A' );
279
+
280
+ const isoFromDateTime = fromDateTime.toISOString();
281
+ const isoToDateTime = toDateTime.toISOString();
282
+ let appStartTimeQuery = {
283
+ 'size': 1,
284
+ 'query': {
285
+ 'bool': {
286
+ 'must': [
287
+ {
288
+ 'term': {
289
+ 'log_type.keyword': 'Application',
290
+ },
291
+ },
292
+ {
293
+ 'term': {
294
+ 'store_id.keyword': req.body.storeId,
295
+ },
296
+ },
297
+ {
298
+ 'terms': {
299
+ 'log_subtype.keyword': [ 'AppStart_Time' ],
300
+ },
301
+ },
302
+ {
303
+ range: {
304
+ 'timestamp': {
305
+ gte: isoFromDateTime,
306
+ lte: isoToDateTime,
307
+ },
308
+ },
309
+ },
310
+ ],
311
+
312
+ },
313
+ },
314
+
315
+ };
316
+ const appStartTime = await getOpenSearchData( 'edgeapp_systemlogs', appStartTimeQuery );
317
+
318
+ let appQuitTimeQuery = {
319
+ 'size': 1,
320
+ 'query': {
321
+ 'bool': {
322
+ 'must': [
323
+ {
324
+ 'term': {
325
+ 'log_type.keyword': 'Application',
326
+ },
327
+ },
328
+ {
329
+ 'term': {
330
+ 'store_id.keyword': req.body.storeId,
331
+ },
332
+ },
333
+ {
334
+ 'terms': {
335
+ 'log_subtype.keyword': [ 'App_Quit' ],
336
+ },
337
+ },
338
+ {
339
+ range: {
340
+ 'timestamp': {
341
+ gte: isoFromDateTime,
342
+ lte: isoToDateTime,
343
+ },
344
+ },
345
+ },
346
+ ],
347
+
348
+ },
349
+ },
350
+ 'sort': [
351
+ { 'timestamp': { 'order': 'desc' } },
352
+ ],
353
+ };
354
+ const appQuitTime = await getOpenSearchData( 'edgeapp_systemlogs', appQuitTimeQuery );
355
+ let appCrashTimeQuery = {
356
+ 'size': 1,
357
+ 'query': {
358
+ 'bool': {
359
+ 'must': [
360
+ {
361
+ 'term': {
362
+ 'log_type.keyword': 'Application',
363
+ },
364
+ },
365
+ {
366
+ 'term': {
367
+ 'store_id.keyword': req.body.storeId,
368
+ },
369
+ },
370
+ {
371
+ 'terms': {
372
+ 'log_subtype.keyword': [ 'App_Crash' ],
373
+ },
374
+ },
375
+ {
376
+ range: {
377
+ 'timestamp': {
378
+ gte: isoFromDateTime,
379
+ lte: isoToDateTime,
380
+ },
381
+ },
382
+ },
383
+ ],
384
+
385
+ },
386
+ },
387
+ 'sort': [
388
+ { 'timestamp': { 'order': 'desc' } },
389
+ ],
390
+ };
391
+ const appCrashTime = await getOpenSearchData( 'edgeapp_systemlogs', appCrashTimeQuery );
392
+ const screenStatus = await getOpenSearchData( 'edgeapp_systemlogs', {
393
+
394
+ 'query': {
395
+ 'bool': {
396
+ 'must': [
397
+ {
398
+ 'term': {
399
+ 'log_type.keyword': 'Application',
400
+ },
401
+ },
402
+ {
403
+ 'term': {
404
+ 'store_id.keyword': req.body.storeId,
405
+ },
406
+ },
407
+ {
408
+ 'terms': {
409
+ 'log_subtype.keyword': [ 'System_Status' ],
410
+ },
411
+ },
412
+ {
413
+ range: {
414
+ 'timestamp': {
415
+ gte: isoFromDateTime,
416
+ lte: isoToDateTime,
417
+ },
418
+ },
419
+ },
420
+ ],
421
+
422
+ },
423
+ },
424
+ 'sort': [
425
+ { 'timestamp': { 'order': 'desc' } },
426
+ ],
427
+
428
+ } );
429
+ const appStatus = await getOpenSearchData( 'edgeapp_systemlogs', {
430
+ 'size': 1,
431
+ 'query': {
432
+ 'bool': {
433
+ 'must': [
434
+ {
435
+ 'term': {
436
+ 'log_type.keyword': 'Application',
437
+ },
438
+ },
439
+ {
440
+ 'term': {
441
+ 'store_id.keyword': req.body.storeId,
442
+ },
443
+ },
444
+ {
445
+ 'terms': {
446
+ 'log_subtype.keyword': [ 'Online_Status' ],
447
+ },
448
+ },
449
+ {
450
+ range: {
451
+ 'timestamp': {
452
+ gte: isoFromDateTime,
453
+ lte: isoToDateTime,
454
+ },
455
+ },
456
+ },
457
+ ],
458
+
459
+ },
460
+ },
461
+ 'sort': [
462
+ { 'timestamp': { 'order': 'desc' } },
463
+ ],
464
+ } );
465
+
466
+ const newFilesCount = await getOpenSearchData( 'edgeapp_filelogs',
467
+ {
468
+ // 'size': 1,
469
+ 'query': {
470
+ 'bool': {
471
+ 'must': [
472
+ {
473
+ 'term': {
474
+ 'store_id.keyword': req.body.storeId,
475
+ },
476
+ },
477
+ {
478
+ range: {
479
+ 'timestamp': {
480
+ gte: isoFromDateTime,
481
+ lte: isoToDateTime,
482
+ },
483
+ },
484
+ },
485
+ ],
486
+
487
+ },
488
+ },
489
+
490
+ 'sort': [
491
+ { 'timestamp': { 'order': 'desc' } },
492
+ ],
493
+ } );
494
+ const speedTest = await getOpenSearchData( 'edgeapp_systemlogs',
495
+ {
496
+ 'size': 1,
497
+ 'query': {
498
+ 'bool': {
499
+ 'must': [
500
+ {
501
+ 'term': {
502
+ 'log_type.keyword': 'Application',
503
+ },
504
+ },
505
+ {
506
+ 'term': {
507
+ 'store_id.keyword': req.body.storeId,
508
+ },
509
+ },
510
+ {
511
+ 'terms': {
512
+ 'log_subtype.keyword': [ 'Speed_Test' ],
513
+ },
514
+ },
515
+ {
516
+ range: {
517
+ 'timestamp': {
518
+ gte: isoFromDateTime,
519
+ lte: isoToDateTime,
520
+ },
521
+ },
522
+ },
523
+ ],
524
+
525
+ },
526
+ },
527
+ 'sort': [
528
+ { 'timestamp': { 'order': 'desc' } },
529
+ ],
530
+ },
531
+ );
532
+
533
+ const antiVirus = await getOpenSearchData( 'edgeapp_systemlogs', {
534
+ 'size': 1,
535
+ 'query': {
536
+ 'bool': {
537
+ 'must': [
538
+ {
539
+ 'term': {
540
+ 'log_type.keyword': 'Application',
541
+ },
542
+ },
543
+ {
544
+ 'term': {
545
+ 'store_id.keyword': req.body.storeId,
546
+ },
547
+ },
548
+ {
549
+ 'terms': {
550
+ 'log_subtype.keyword': [ 'Anti_Virus' ],
551
+ },
552
+ },
553
+ {
554
+ range: {
555
+ 'timestamp': {
556
+ gte: isoFromDateTime,
557
+ lte: isoToDateTime,
558
+ },
559
+ },
560
+ },
561
+ ],
562
+
563
+ },
564
+ },
565
+ 'sort': [
566
+ { 'timestamp': { 'order': 'desc' } },
567
+ ],
568
+ },
569
+ );
570
+ const downTime = await getOpenSearchData( 'live_downtime_hourly',
571
+ {
572
+ 'size': 1,
573
+ 'query': {
574
+ 'bool': {
575
+ 'must': [
576
+ {
577
+ 'term': {
578
+ 'doc.date.keyword': dayjs( req.body.Date ).format( 'DD-MM-YYYY' ),
579
+ },
580
+ },
581
+ {
582
+ 'term': {
583
+ 'doc.store_id.keyword': req.body.storeId,
584
+ },
585
+ },
586
+ {
587
+ 'terms': {
588
+ 'doc.hour.keyword': [ req.body.from.split( ':' )[0] ],
589
+ },
590
+ },
591
+ ],
592
+
593
+ },
594
+ },
595
+
596
+ } );
597
+ let streamwiseDowntime = downTime.body.hits.hits.length > 0 ? downTime.body.hits.hits[0]._source.doc.streamwise_downtime : [];
598
+ if ( streamwiseDowntime.length > 0 ) {
599
+ const sum = streamwiseDowntime.reduce( ( accumulator, currentValue ) => {
600
+ return accumulator + currentValue.down_time;
601
+ }, 0 );
602
+
603
+ // Calculate the average
604
+ const average = sum / streamwiseDowntime.length;
605
+ response.downTime = Math.round( average );
606
+ } else {
607
+ response.downTime = 0;
608
+ }
609
+ response.filesPushed = newFilesCount.body.hits.total.value;
610
+ if ( speedTest.body.hits && speedTest.body.hits.hits.length > 0 && speedTest.body.hits.hits[0]._source ) {
611
+ response.Internetspeed = speedTest.body.hits.hits[0]._source.data.upload_Speed;
612
+ } else {
613
+ response.Internetspeed = '';
614
+ }
615
+
616
+ response.antiVirus = antiVirus.body.hits.hits.length > 0 && antiVirus.body.hits.hits[0]._source.data.message == 'st-launch-1.0.exe is deleted' ? antiVirus.body.hits.hits[0]._source.data.occuringTime : '';
617
+ response.appStartTime = appStartTime.body.hits.hits.length > 0 ? appStartTime.body.hits.hits[0]._source.data.occuringTime : '';
618
+ response.appQuitTime = appQuitTime.body.hits.hits.length > 0 ? appQuitTime.body.hits.hits[0]._source.data.occuringTime : '';
619
+ response.AppCrashtime = appCrashTime.body.hits.hits.length > 0 ? appCrashTime.body.hits.hits[0]._source.data.occuringTime : '';
620
+ response.screenStatus = screenStatus.body.hits.hits.length > 0 ? screenStatus.body.hits.hits[0]._source.data.message : '';
621
+ response.appStatus = appStatus.body.hits.hits.length > 0 ? appStatus.body.hits.hits[0]._source.data.message : '';
622
+ res.sendSuccess( response );
623
+ } catch ( error ) {
624
+ logger.error( { error: error, function: 'viewedgeAppLog' } );
625
+ return res.sendError( error, 500 );
626
+ }
627
+ }
@@ -61,10 +61,14 @@ export async function userTicketList( req, res ) {
61
61
  },
62
62
  } ];
63
63
  let ticketList = await aggregateTangoTicket( query );
64
- res.sendSuccess( {
65
- count: ticketList.length,
66
- data: ticketList,
67
- } );
64
+ if ( ticketList.length ) {
65
+ res.sendSuccess( {
66
+ count: ticketList.length,
67
+ data: ticketList,
68
+ } );
69
+ } else {
70
+ return res.sendError( 'NO data', 204 );
71
+ }
68
72
  } catch ( error ) {
69
73
  logger.error( { error: error, function: 'userTicketList' } );
70
74
  return res.sendError( error, 500 );
@@ -1,7 +1,7 @@
1
1
 
2
2
  import express from 'express';
3
3
  import { validateDetails, validateTicket, ticketExists, infraReasonExists, InfrastepstoResolve } from '../validations/infra.validation.js';
4
- import { createTicket, updateStatus, createReason, PrimaryReasons, secondaryReason, updateTicketIssue } from '../controllers/infra.controllers.js';
4
+ import { createTicket, updateStatus, createReason, PrimaryReasons, secondaryReason, updateTicketIssue, viewTicket } from '../controllers/infra.controllers.js';
5
5
 
6
6
 
7
7
  export const infraRouter = express.Router();
@@ -12,5 +12,6 @@ infraRouter.post( '/createReason', createReason );
12
12
  infraRouter.get( '/PrimaryReasons', PrimaryReasons );
13
13
  infraRouter.post( '/secondaryReason', secondaryReason );
14
14
  infraRouter.post( '/updateTicketIssue', ticketExists, infraReasonExists, InfrastepstoResolve, updateTicketIssue );
15
+ infraRouter.post( '/viewTicket', ticketExists, viewTicket );
15
16
 
16
17
 
@@ -0,0 +1,10 @@
1
+
2
+ import express from 'express';
3
+ import { storeTicketList, edgeAppLogTable, viewedgeAppLog } from '../controllers/storeInfra.controlller.js';
4
+ export const storeInfraRouter = express.Router();
5
+
6
+ storeInfraRouter.post( '/storeTicketList', storeTicketList );
7
+ storeInfraRouter.post( '/edgeAppLogTable', edgeAppLogTable );
8
+ storeInfraRouter.post( '/viewedgeAppLog', viewedgeAppLog );
9
+
10
+
@@ -1,5 +1,5 @@
1
1
  import express from 'express';
2
- import { userTakeTicket, userTicketList, basicDetails } from '../controllers/userinfra.controller.js';
2
+ import { userTakeTicket, userTicketList, basicDetails } from '../controllers/userInfra.controller.js';
3
3
 
4
4
  export const userInfraRouter = express.Router();
5
5
 
@@ -1,11 +1,11 @@
1
1
  import dataModel from 'tango-api-schema';
2
2
 
3
3
  export async function createinfraReason( inputData ) {
4
- return await dataModel.infraReasonsModel.create( inputData );
4
+ return await dataModel.infraReasonModel.create( inputData );
5
5
  }
6
6
  export async function findinfraReason( query, project ) {
7
- return await dataModel.infraReasonsModel.find( query, project );
7
+ return await dataModel.infraReasonModel.find( query, project );
8
8
  }
9
9
  export async function findOneinfraReason( query, project ) {
10
- return await dataModel.infraReasonsModel.findOne( query, project );
10
+ return await dataModel.infraReasonModel.findOne( query, project );
11
11
  }