tango-app-api-infra 3.1.12 → 3.1.14

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
@@ -6,9 +6,10 @@ import { userInfraRouter } from './src/routes/userInfra.routes.js';
6
6
  import { storeInfraRouter } from './src/routes/storeInfra.routes.js';
7
7
  import { clientInfraRouter } from './src/routes/clientInfra.routes.js';
8
8
  import { employeeTrainigRouter } from './src/routes/employeetrainig.routes.js';
9
- import { dataMismatchRouter } from './src/routes/dataMismatch.routes.js';
9
+ import { dataMismatchTicketRouter } from './src/routes/dataMismatch.routes.js';
10
+ import { infraDocs } from './src/docs/infra.docs.js';
10
11
 
11
12
 
12
- export { infraRouter, internalInfraRouter, userInfraRouter, storeInfraRouter, dataMismatchRouter, clientInfraRouter, employeeTrainigRouter };
13
+ export { infraRouter, internalInfraRouter, userInfraRouter, storeInfraRouter, dataMismatchTicketRouter, clientInfraRouter, employeeTrainigRouter, infraDocs };
13
14
 
14
15
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-app-api-infra",
3
- "version": "3.1.12",
3
+ "version": "3.1.14",
4
4
  "description": "infra",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -22,10 +22,12 @@
22
22
  "express-fileupload": "^1.5.0",
23
23
  "handlebars": "^4.7.8",
24
24
  "html-pdf-node": "^1.0.8",
25
+ "joi-to-swagger": "^6.2.0",
25
26
  "mongodb": "^6.4.0",
26
27
  "nodemon": "^3.1.0",
27
- "tango-api-schema": "^2.0.94",
28
- "tango-app-api-middleware": "^3.1.7",
28
+ "swagger-ui-express": "^5.0.0",
29
+ "tango-api-schema": "^2.0.104",
30
+ "tango-app-api-middleware": "^3.1.11",
29
31
  "winston": "^3.12.0",
30
32
  "winston-daily-rotate-file": "^5.0.0"
31
33
  },
@@ -1,16 +1,16 @@
1
1
 
2
- import { aggregateStore, countDocumentsStore } from '../services/store.service.js';
2
+ import { countDocumentsStore } from '../services/store.service.js';
3
3
  import { logger, download, getUTC } from 'tango-app-api-middleware';
4
4
  import { aggregateTangoTicket } from '../services/tangoTicket.service.js';
5
5
  import { findinfraReason } from '../services/infraReason.service.js';
6
- import { aggregateClient } from '../services/client.service.js';
6
+ import { aggregateClient, findClient } from '../services/client.service.js';
7
7
  import dayjs from 'dayjs';
8
8
  import { getOpenSearchData } from 'tango-app-api-middleware';
9
9
 
10
10
  export async function infraCard( req, res ) {
11
11
  try {
12
12
  let date = await getUTC( new Date( req.body.fromDate ), new Date( req.body.toDate ) );
13
- let storeCount = await countDocumentsStore( { 'clientId': { $in: req.body.clientId }, 'edge.firstFile': true, 'status': 'active' } );
13
+ let storeCount = await countDocumentsStore( { 'clientId': { $in: req.body.clientId }, 'createdAt': { $lte: date.end }, 'edge.firstFile': true, 'status': 'active' } );
14
14
  let infraStoreCount = await aggregateTangoTicket( [
15
15
  {
16
16
  $match: {
@@ -18,7 +18,7 @@ export async function infraCard( req, res ) {
18
18
  { issueType: 'infra' },
19
19
  { status: { $ne: 'closed' } },
20
20
  { 'basicDetails.clientId': { $in: req.body.clientId } },
21
- { createdAt: { $gte: date.start } },
21
+ // { createdAt: { $gte: date.start } },
22
22
  { createdAt: { $lte: date.end } },
23
23
  ],
24
24
  },
@@ -54,7 +54,7 @@ export async function infraCard( req, res ) {
54
54
  { status: { $ne: 'closed' } },
55
55
  { 'ticketDetails.issueStatus': 'identified' },
56
56
  { 'basicDetails.clientId': { $in: req.body.clientId } },
57
- { createdAt: { $gte: date.start } },
57
+ // { createdAt: { $gte: date.start } },
58
58
  { createdAt: { $lte: date.end } },
59
59
  ],
60
60
  },
@@ -134,6 +134,14 @@ export async function infraCard( req, res ) {
134
134
  count: 0,
135
135
  } ) );
136
136
  }
137
+ response.unshift( {
138
+ name: 'All Issues',
139
+ count: infraStoreCount.length > 0 ? infraStoreCount[0].identifiedcount : 0,
140
+ } );
141
+ response.push( {
142
+ name: 'Issues Not Identified',
143
+ count: infraStoreCount.length > 0 ? infraStoreCount[0].infraCount - infraStoreCount[0].identifiedcount : 0,
144
+ } );
137
145
  res.sendSuccess( {
138
146
  total: storeCount,
139
147
  liveStoreCount: infraStoreCount.length > 0 ? storeCount - infraStoreCount[0].infraCount : 0,
@@ -149,15 +157,21 @@ export async function infraCard( req, res ) {
149
157
  }
150
158
  export async function installationCard( req, res ) {
151
159
  try {
160
+ let date = await getUTC( new Date( req.body.fromDate ), new Date( req.body.toDate ) );
152
161
  let onboardedCount = await countDocumentsStore( {
153
162
  '$and': [
154
163
  { 'clientId': { $in: req.body.clientId } },
164
+ { 'createdAt': { $lte: date.end } },
155
165
  ],
156
166
  } );
157
- let installedCount = await countDocumentsStore( { 'clientId': { $in: req.body.clientId },
158
- 'edge.firstFile': true, 'status': 'active' } );
159
- let deactiveCount = await countDocumentsStore( { 'clientId': { $in: req.body.clientId },
160
- 'status': 'deactive' } );
167
+ let installedCount = await countDocumentsStore( {
168
+ 'clientId': { $in: req.body.clientId },
169
+ 'edge.firstFile': true, 'status': 'active', 'createdAt': { $lte: date.end },
170
+ } );
171
+ let deactiveCount = await countDocumentsStore( {
172
+ 'clientId': { $in: req.body.clientId },
173
+ 'status': 'deactive',
174
+ } );
161
175
  let yettoInstallCount = await aggregateTangoTicket( [
162
176
  {
163
177
  $match: {
@@ -166,7 +180,7 @@ export async function installationCard( req, res ) {
166
180
  { 'status': { $ne: 'closed' } },
167
181
  { 'ticketDetails.issueStatus': 'notidentified' },
168
182
  { 'basicDetails.clientId': { $in: req.body.clientId } },
169
- { createdAt: { $gte: new Date( req.body.fromDate ) } },
183
+ { createdAt: { $lte: new Date( req.body.toDate ) } },
170
184
  ],
171
185
  },
172
186
  },
@@ -178,7 +192,7 @@ export async function installationCard( req, res ) {
178
192
  { 'status': { $ne: 'closed' } },
179
193
  { 'basicDetails.clientId': { $in: req.body.clientId } },
180
194
  { 'ticketDetails.issueStatus': 'identified' },
181
- { createdAt: { $gte: new Date( req.body.fromDate ) } },
195
+ { createdAt: { $lte: new Date( req.body.toDate ) } },
182
196
  ],
183
197
  },
184
198
  },
@@ -265,14 +279,18 @@ export async function installationCard( req, res ) {
265
279
  export async function infraIssuesTable( req, res ) {
266
280
  try {
267
281
  let date = await getUTC( new Date( req.body.fromDate ), new Date( req.body.toDate ) );
282
+ let issueStatus = 'identified';
283
+ if ( req.body.filterIssue == 'Issues Not Identified' ) {
284
+ issueStatus = 'notidentified';
285
+ };
268
286
  let query = [ {
269
287
  $match: {
270
288
  $and: [
271
289
  { issueType: 'infra' },
272
290
  { status: { $ne: 'closed' } },
273
291
  { 'basicDetails.clientId': { $in: req.body.clientId } },
274
- { 'ticketDetails.issueStatus': 'identified' },
275
- { createdAt: { $gte: date.start } },
292
+ { 'ticketDetails.issueStatus': issueStatus },
293
+ // { createdAt: { $gte: date.start } },
276
294
  { createdAt: { $lte: date.end } },
277
295
  ],
278
296
  },
@@ -343,7 +361,7 @@ export async function infraIssuesTable( req, res ) {
343
361
  },
344
362
  },
345
363
  ];
346
- if ( req.body.filterIssue && req.body.filterIssue != '' ) {
364
+ if ( req.body.filterIssue && req.body.filterIssue != '' && req.body.filterIssue != 'All Issues' && req.body.filterIssue != 'Issues Not Identified' ) {
347
365
  query.push( {
348
366
  $match: {
349
367
  primaryIssue: req.body.filterIssue,
@@ -418,9 +436,10 @@ export async function InstallationIssuesTable( req, res ) {
418
436
  $match: {
419
437
  $and: [
420
438
  { issueType: 'installation' },
439
+ { 'status': { $ne: 'closed' } },
421
440
  { 'basicDetails.clientId': { $in: req.body.clientId } },
422
- { createdAt: { $gte: new Date( req.body.fromDate ) } },
423
- // { createdAt: { $lte: new Date( req.body.toDate ) } },
441
+ // { createdAt: { $gte: new Date( req.body.fromDate ) } },
442
+ { createdAt: { $lte: new Date( req.body.toDate ) } },
424
443
  ],
425
444
  },
426
445
  },
@@ -537,11 +556,15 @@ export async function InstallationIssuesTable( req, res ) {
537
556
  export async function hourWiseDownClients( req, res ) {
538
557
  try {
539
558
  let inputData = req.body;
540
-
559
+ let clientList = await findClient( { clientId: { $in: req.body.clientId }, status: 'active' } );
560
+ let activeClient = [];
561
+ for ( let client of clientList ) {
562
+ activeClient.push( client.clientId );
563
+ }
541
564
  let query = [
542
565
  {
543
566
  $match: {
544
- clientId: { $in: req.body.clientId },
567
+ clientId: { $in: activeClient },
545
568
  },
546
569
  },
547
570
  {
@@ -685,22 +708,55 @@ function generateTimeSlots( startHour, endHour, interval, time ) {
685
708
  export async function hourWiseDownstores( req, res ) {
686
709
  try {
687
710
  let inputData = req.body;
688
- inputData.Date = dayjs().format( 'YYYY-MM-DD' );
711
+ inputData.Date = dayjs( req.body.toDate ).format( 'YYYY-MM-DD' );
689
712
 
690
713
  let query = [ {
691
714
  $match: {
692
- clientId: req.body.clientId,
693
- status: 'active',
715
+ $and: [
716
+ { 'basicDetails.clientId': req.body.clientId },
717
+ { 'status': { $ne: 'closed' } },
718
+ { 'issueDate': { $lte: new Date( req.body.toDate ) } },
719
+ ],
720
+ },
721
+ },
722
+ {
723
+ $project: {
724
+ storeId: '$basicDetails.storeId',
725
+ storeName: '$basicDetails.storeName',
726
+ primaryIssue: {
727
+ $filter: {
728
+ input: '$ticketActivity',
729
+ as: 'item',
730
+ cond: { $eq: [ '$$item.actionType', 'issueUpdate' ] },
731
+ },
732
+ },
733
+ },
734
+ },
735
+ {
736
+ $unwind: {
737
+ path: '$primaryIssue', preserveNullAndEmptyArrays: true,
738
+ },
739
+ },
740
+ {
741
+ $unwind: {
742
+ path: '$primaryIssue.reasons', preserveNullAndEmptyArrays: true,
694
743
  },
695
744
  },
696
745
  {
697
746
  $project: {
698
747
  storeId: 1,
699
748
  storeName: 1,
700
- storeProfile: 1,
749
+ primaryIssue: { $ifNull: [ '$primaryIssue.reasons.primaryIssue', 'NotIdentified' ] },
750
+ },
751
+ },
752
+ {
753
+ $group: {
754
+ _id: '$storeId',
755
+ storeId: { $first: '$storeId' },
756
+ storeName: { $first: '$storeName' },
757
+ primaryIssue: { $last: '$primaryIssue' },
701
758
  },
702
759
  },
703
-
704
760
  ];
705
761
  if ( req.body.searchValue && req.body.searchValue !== '' ) {
706
762
  query.push( {
@@ -717,14 +773,21 @@ export async function hourWiseDownstores( req, res ) {
717
773
  $sort: { [req.body.sortColumName]: req.body.sortBy },
718
774
  } );
719
775
  }
720
- let count = await aggregateStore( query );
776
+ if ( req.body.filterIssue && req.body.filterIssue != '' && req.body.filterIssue != 'All Issues' && req.body.filterIssue != 'Issues Not Identified' ) {
777
+ query.push( {
778
+ $match: {
779
+ primaryIssue: req.body.filterIssue,
780
+ },
781
+ } );
782
+ }
783
+ let count = await aggregateTangoTicket( query );
721
784
  if ( req.body.limit && req.body.offset && !req.body.export ) {
722
785
  query.push(
723
786
  { $skip: ( req.body.offset - 1 ) * req.body.limit },
724
787
  { $limit: Number( req.body.limit ) },
725
788
  );
726
789
  }
727
- let storeslist = await aggregateStore( query );
790
+ let storeslist = await aggregateTangoTicket( query );
728
791
  if ( storeslist.length == 0 ) {
729
792
  return res.sendError( 'no data', 204 );
730
793
  }
@@ -733,6 +796,7 @@ export async function hourWiseDownstores( req, res ) {
733
796
  for ( const store of storeslist ) {
734
797
  data.storeId = store.storeId;
735
798
  data.storeName = store.storeName;
799
+ data.primaryIssue = store.primaryIssue;
736
800
  let storedata = await downStoresCheck( data, inputData );
737
801
  result.push( storedata[0] );
738
802
  }
@@ -801,7 +865,7 @@ function downStoresCheck( data, inputData ) {
801
865
  const mergedData = {
802
866
  storeName: data.storeName,
803
867
  storeId: data.storeId,
804
-
868
+ PrimaryIssue: data.primaryIssue,
805
869
  };
806
870
  timewise.forEach( ( obj ) => {
807
871
  for ( const key in obj ) {
@@ -1,6 +1,8 @@
1
1
 
2
- import { findOneTangoTicket, createTangoTicket } from '../services/tangoTicket.service.js';
3
- import { logger } from 'tango-app-api-middleware';
2
+ import { findOneTangoTicket, createTangoTicket, updateOneTangoTicket, aggregateTangoTicket, countDocumentsTangoTicket } from '../services/tangoTicket.service.js';
3
+ import { logger, getUTC, appConfig, fileUpload, signedUrl, sendMessageToQueue } from 'tango-app-api-middleware';
4
+ import dayjs from 'dayjs';
5
+
4
6
  export async function createTicket( req, res ) {
5
7
  try {
6
8
  let ticketExist = await findOneTangoTicket( { 'issueType': req.body.issueType, 'issueDate': ( new Date( req.body.Date ) ), 'basicDetails.storeId': req.body.storeId } );
@@ -8,11 +10,58 @@ export async function createTicket( req, res ) {
8
10
  if ( ticketExist ) {
9
11
  return res.sendSuccess( 'MAT Ticket Already Exists for the store' );
10
12
  }
13
+ let actionBy = '';
14
+ if ( req.user.userType == 'tango' ) {
15
+ actionBy = 'Tango';
16
+ } else if ( req.user.userType == 'client' ) {
17
+ actionBy = 'User';
18
+ }
11
19
  req.body.ticketDetails = {};
12
- req.body.ticketDetails.dataMismatch = req.body.dataMismatch;
20
+ req.body.dataMismatch ={
21
+ actualCount: req.body.actualCount,
22
+ expectedCount: req.body.expectedCount,
23
+ contactEmail: req.body.contactEmail,
24
+ };
13
25
  req.body.issueDate = new Date( req.body.Date );
14
26
  req.body.ticketId = 'TE_DM_' + new Date().valueOf();
15
27
  let create = await createTangoTicket( req.body );
28
+ let getObject = {};
29
+ if ( req.files ) {
30
+ let params = {
31
+ Bucket: appConfig.cloud.aws.bucket.ticket,
32
+ Key: create.ticketId + '/',
33
+ ContentType: 'multipart/form-data',
34
+ body: req.files.img.data,
35
+ fileName: req.files.img.name,
36
+ };
37
+ let upload = await fileUpload( params );
38
+ if ( upload ) {
39
+ getObject = {
40
+ fileName: req.files.img.name,
41
+ filePath: create.ticketId + '/' + req.files.img.name,
42
+ };
43
+ }
44
+ }
45
+ req.body.ticketActivity = [ {
46
+ actionType: 'Created',
47
+ timeStamp: new Date(),
48
+ actionBy: actionBy,
49
+ IdentifiedBy: req.user.userName,
50
+ description: req.body.description,
51
+ attachments: [ getObject ],
52
+ } ];
53
+ await updateOneTangoTicket( { ticketId: create.ticketId }, { ticketActivity: req.body.ticketActivity } );
54
+
55
+ const ticket = await findOneTangoTicket( { ticketId: req.body.ticketId }, { 'issueDate': 1, 'basicDetails': 1, 'issueType': 1, 'dataMismatch.contactEmail': 1, '_id': 0 } );
56
+
57
+ const obj = {
58
+ storeId: ticket.basicDetails.storeId,
59
+ issueDate: dayjs( ticket.issueDate ).format( 'DD-MM-YYYY' ),
60
+ };
61
+
62
+ if ( req.body.issueType === 'highcount' ) {
63
+ await sendMessageToQueue( `${appConfig.cloud.aws.sqs.url}${appConfig.cloud.aws.sqs.highcountTopic}`, JSON.stringify( obj ) );
64
+ }
16
65
  if ( create ) {
17
66
  res.sendSuccess( 'Ticket Created Successfully' );
18
67
  }
@@ -21,3 +70,165 @@ export async function createTicket( req, res ) {
21
70
  return res.sendError( error, 500 );
22
71
  }
23
72
  }
73
+
74
+ export async function updateMat( req, res ) {
75
+ try {
76
+ let updateValue = {};
77
+ if ( req.body.actionType && req.body.actionType != '' ) {
78
+ let actionBy = '';
79
+ if ( req.user.userType == 'tango' ) {
80
+ actionBy = 'Tango';
81
+ } else if ( req.user.userType == 'client' ) {
82
+ actionBy = 'User';
83
+ }
84
+ req.body.ticketActivity.push( {
85
+ actionType: req.body.actionType,
86
+ actionBy: actionBy,
87
+ timeStamp: new Date(),
88
+ IdentifiedBy: req.user.userName,
89
+ description: req.body.description,
90
+ attachments: req.body.attachments,
91
+ } );
92
+ updateValue = { ticketActivity: req.body.ticketActivity };
93
+ }
94
+
95
+ let updateTicket = await updateOneTangoTicket( { ticketId: req.body.ticketId }, updateValue );
96
+ if ( updateTicket ) {
97
+ res.sendSuccess( 'Ticket Updated Successfully' );
98
+ }
99
+ } catch ( error ) {
100
+ logger.error( { error: error, function: 'updateMat' } );
101
+ return res.sendError( error, 500 );
102
+ }
103
+ }
104
+
105
+
106
+ export async function activityList( req, res ) {
107
+ try {
108
+ let date = await getUTC( new Date( req.body.fromDate ), new Date( req.body.toDate ) );
109
+ let query = [ {
110
+ $match: {
111
+ $and: [
112
+ { 'basicDetails.storeId': req.body.storeId },
113
+ { issueType: { $in: [ 'lowcount', 'highcount' ] } },
114
+ { createdAt: { $gte: date.start } },
115
+ { createdAt: { $lte: date.end } },
116
+ ],
117
+ },
118
+ },
119
+ {
120
+ $project: {
121
+ storeId: '$basicDetails.storeId',
122
+ status: 1,
123
+ issueDate: '$issueDate',
124
+ Date: { $dateToString: { format: '%d-%m-%Y', date: '$createdAt' } },
125
+ issueClosedDate: 1,
126
+ ticketId: 1,
127
+ issueType: 1,
128
+ ticketActivity: 1,
129
+ comments: { $size: '$ticketActivity' },
130
+ },
131
+ },
132
+ {
133
+ $unwind: {
134
+ path: '$ticketActivity', preserveNullAndEmptyArrays: true,
135
+ },
136
+ },
137
+ {
138
+ $group: {
139
+ _id: '$ticketId',
140
+ storeId: { $first: '$storeId' },
141
+ Date: { $first: '$Date' },
142
+ issueClosedDate: { $first: '$issueClosedDate' },
143
+ status: { $first: '$status' },
144
+ issueDate: { $first: '$issueDate' },
145
+ ticketId: { $first: '$ticketId' },
146
+ issueType: { $first: '$issueType' },
147
+ comments: { $first: '$comments' },
148
+ description: { $last: '$ticketActivity.description' },
149
+ },
150
+ },
151
+ {
152
+ $sort: {
153
+ issueDate: -1,
154
+ },
155
+ },
156
+ ];
157
+
158
+ if ( req.body.filter && req.body.filter !== '' ) {
159
+ query.push( {
160
+ $match: {
161
+ issueType: req.body.filter,
162
+ },
163
+ } );
164
+ }
165
+ let ticketList = await aggregateTangoTicket( query );
166
+ if ( req.body.export && ticketList.length > 0 ) {
167
+ const exportdata = [];
168
+ ticketList.forEach( ( element ) => {
169
+ exportdata.push( {
170
+ 'STORE ID': element.storeId,
171
+ 'TICKET ID': element.ticketId,
172
+ 'DATE': element.Date,
173
+ 'ISSUE CLOSED DATE': element.issueClosedDate,
174
+ 'STATUS': element.status,
175
+ 'COMMENT': element.description,
176
+ } );
177
+ } );
178
+ await download( exportdata, res );
179
+ return;
180
+ }
181
+ if ( ticketList.length ) {
182
+ let highCount = await countDocumentsTangoTicket( {
183
+ $and: [
184
+ { 'basicDetails.storeId': req.body.storeId },
185
+ { issueType: 'highcount' },
186
+ { createdAt: { $gte: date.start } },
187
+ { createdAt: { $lte: date.end } },
188
+ ],
189
+ } );
190
+ let lowCount = await countDocumentsTangoTicket( {
191
+ $and: [
192
+ { 'basicDetails.storeId': req.body.storeId },
193
+ { issueType: 'lowcount' },
194
+ { createdAt: { $gte: date.start } },
195
+ { createdAt: { $lte: date.end } },
196
+ ],
197
+ } );
198
+
199
+ res.sendSuccess( {
200
+ count: ticketList.length,
201
+ data: ticketList,
202
+ highCount: highCount,
203
+ lowCount: lowCount,
204
+ } );
205
+ } else {
206
+ return res.sendError( 'NO data', 204 );
207
+ }
208
+ } catch ( error ) {
209
+ logger.error( { error: error, function: 'activityList' } );
210
+ return res.sendError( error, 500 );
211
+ }
212
+ }
213
+
214
+
215
+ export async function showActivity( req, res ) {
216
+ try {
217
+ for ( let activity of req.body.ticketActivity ) {
218
+ if ( activity.attachments&&activity.attachments.length>0 ) {
219
+ for ( let attchment of activity.attachments ) {
220
+ let params = {
221
+ Bucket: appConfig.cloud.aws.bucket.ticket,
222
+ file_path: attchment.filePath,
223
+ };
224
+ let attachments = await signedUrl( params );
225
+ attchment.signedUrl = attachments;
226
+ }
227
+ }
228
+ }
229
+ res.sendSuccess( req.body );
230
+ } catch ( error ) {
231
+ logger.error( { error: error, function: 'showActivity' } );
232
+ return res.sendError( error, 500 );
233
+ }
234
+ }
@@ -5,7 +5,7 @@ export async function createTicket( req, res ) {
5
5
  try {
6
6
  let ticketExist = await findOneTangoTicket( { 'issueType': req.body.issueType, 'basicDetails.storeId': req.body.storeId } );
7
7
  if ( ticketExist ) {
8
- return res.sendSuccess( 'MAT Ticket Already Exists for the store' );
8
+ return res.status( 409 ).send( 'DataMismatch Ticket Already Exists for the store' );
9
9
  }
10
10
 
11
11
  req.body.issueDate = new Date( req.body.Date );
@@ -48,3 +48,16 @@ export async function activityLog( req, res ) {
48
48
  return res.sendError( error, 500 );
49
49
  }
50
50
  }
51
+
52
+
53
+ export async function updateMatStatus( req, res ) {
54
+ try {
55
+ let update = await updateOneTangoTicket( { ticketId: req.body.ticketId }, { 'ticketDetails.matStatus': req.body.matStatus } );
56
+ if ( update ) {
57
+ res.sendSuccess( 'Updated Successfully' );
58
+ }
59
+ } catch ( error ) {
60
+ logger.error( { error: error, function: 'updateMatStatus' } );
61
+ return res.sendError( error, 500 );
62
+ }
63
+ }