tango-app-ui-manage-tickets 3.7.0-beta.7 → 3.7.0-beta.70

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.
Files changed (147) hide show
  1. package/.eslintrc.json +37 -0
  2. package/ng-package.json +7 -0
  3. package/package.json +12 -25
  4. package/src/lib/components/add-csm-modal/add-csm-modal.component.html +32 -0
  5. package/src/lib/components/add-csm-modal/add-csm-modal.component.scss +14 -0
  6. package/src/lib/components/add-csm-modal/add-csm-modal.component.spec.ts +23 -0
  7. package/src/lib/components/add-csm-modal/add-csm-modal.component.ts +94 -0
  8. package/src/lib/components/audit-log/audit-log.component.html +1 -0
  9. package/src/lib/components/audit-log/audit-log.component.scss +0 -0
  10. package/src/lib/components/audit-log/audit-log.component.spec.ts +23 -0
  11. package/src/lib/components/audit-log/audit-log.component.ts +10 -0
  12. package/src/lib/components/audit-mapping-list/audit-mapping-list.component.html +234 -0
  13. package/src/lib/components/audit-mapping-list/audit-mapping-list.component.scss +186 -0
  14. package/src/lib/components/audit-mapping-list/audit-mapping-list.component.spec.ts +23 -0
  15. package/src/lib/components/audit-mapping-list/audit-mapping-list.component.ts +536 -0
  16. package/src/lib/components/audit-metrics/audit-metrics.component.html +345 -0
  17. package/src/lib/components/audit-metrics/audit-metrics.component.scss +34 -0
  18. package/src/lib/components/audit-metrics/audit-metrics.component.spec.ts +23 -0
  19. package/src/lib/components/audit-metrics/audit-metrics.component.ts +292 -0
  20. package/src/lib/components/audit-report-popup/audit-report-popup.component.html +111 -0
  21. package/src/lib/components/audit-report-popup/audit-report-popup.component.scss +101 -0
  22. package/src/lib/components/audit-report-popup/audit-report-popup.component.spec.ts +23 -0
  23. package/src/lib/components/audit-report-popup/audit-report-popup.component.ts +397 -0
  24. package/src/lib/components/audit-retag/audit-retag.component.html +129 -0
  25. package/src/lib/components/audit-retag/audit-retag.component.scss +146 -0
  26. package/src/lib/components/audit-retag/audit-retag.component.spec.ts +23 -0
  27. package/src/lib/components/audit-retag/audit-retag.component.ts +497 -0
  28. package/src/lib/components/comment-model/comment-model.component.html +24 -0
  29. package/src/lib/components/comment-model/comment-model.component.scss +20 -0
  30. package/src/lib/components/comment-model/comment-model.component.spec.ts +23 -0
  31. package/src/lib/components/comment-model/comment-model.component.ts +53 -0
  32. package/src/lib/components/count/count.component.html +54 -0
  33. package/src/lib/components/count/count.component.scss +14 -0
  34. package/src/lib/components/count/count.component.spec.ts +23 -0
  35. package/src/lib/components/count/count.component.ts +82 -0
  36. package/src/lib/components/custom-select/custom-select.component.html +134 -0
  37. package/src/lib/components/custom-select/custom-select.component.scss +204 -0
  38. package/src/lib/components/custom-select/custom-select.component.spec.ts +23 -0
  39. package/src/lib/components/custom-select/custom-select.component.ts +189 -0
  40. package/src/lib/components/filter-options/filter-options.component.html +51 -0
  41. package/src/lib/components/filter-options/filter-options.component.scss +102 -0
  42. package/src/lib/components/filter-options/filter-options.component.spec.ts +23 -0
  43. package/src/lib/components/filter-options/filter-options.component.ts +38 -0
  44. package/src/lib/components/footfall-dic/footfall-dic.component.html +1275 -0
  45. package/src/lib/components/footfall-dic/footfall-dic.component.scss +273 -0
  46. package/src/lib/components/footfall-dic/footfall-dic.component.spec.ts +23 -0
  47. package/src/lib/components/footfall-dic/footfall-dic.component.ts +1206 -0
  48. package/src/lib/components/footfall-dicview/footfall-dicview.component.html +1136 -0
  49. package/src/lib/components/footfall-dicview/footfall-dicview.component.scss +416 -0
  50. package/src/lib/components/footfall-dicview/footfall-dicview.component.spec.ts +23 -0
  51. package/src/lib/components/footfall-dicview/footfall-dicview.component.ts +1168 -0
  52. package/src/lib/components/footfall-popup/footfall-popup.component.html +61 -0
  53. package/src/lib/components/footfall-popup/footfall-popup.component.scss +20 -0
  54. package/src/lib/components/footfall-popup/footfall-popup.component.spec.ts +23 -0
  55. package/src/lib/components/footfall-popup/footfall-popup.component.ts +12 -0
  56. package/src/lib/components/group-select/group-select.component.html +44 -0
  57. package/src/lib/components/group-select/group-select.component.scss +144 -0
  58. package/src/lib/components/group-select/group-select.component.spec.ts +23 -0
  59. package/src/lib/components/group-select/group-select.component.ts +145 -0
  60. package/src/lib/components/re-trigger/re-trigger.component.html +53 -0
  61. package/src/lib/components/re-trigger/re-trigger.component.scss +16 -0
  62. package/src/lib/components/re-trigger/re-trigger.component.spec.ts +23 -0
  63. package/src/lib/components/re-trigger/re-trigger.component.ts +96 -0
  64. package/src/lib/components/reactive-select/reactive-select.component.html +18 -0
  65. package/src/lib/components/reactive-select/reactive-select.component.scss +52 -0
  66. package/src/lib/components/reactive-select/reactive-select.component.spec.ts +23 -0
  67. package/src/lib/components/reactive-select/reactive-select.component.ts +104 -0
  68. package/src/lib/components/remove-audit/remove-audit.component.html +38 -0
  69. package/src/lib/components/remove-audit/remove-audit.component.scss +27 -0
  70. package/src/lib/components/remove-audit/remove-audit.component.spec.ts +23 -0
  71. package/src/lib/components/remove-audit/remove-audit.component.ts +81 -0
  72. package/src/lib/components/start-audit/start-audit.component.html +174 -0
  73. package/src/lib/components/start-audit/start-audit.component.scss +185 -0
  74. package/src/lib/components/start-audit/start-audit.component.spec.ts +23 -0
  75. package/src/lib/components/start-audit/start-audit.component.ts +772 -0
  76. package/src/lib/components/tango-manage-tickets/tango-manage-tickets.component.html +43 -0
  77. package/src/lib/components/tango-manage-tickets/tango-manage-tickets.component.scss +35 -0
  78. package/src/lib/components/tango-manage-tickets/tango-manage-tickets.component.spec.ts +23 -0
  79. package/src/lib/components/tango-manage-tickets/tango-manage-tickets.component.ts +118 -0
  80. package/src/lib/components/ticket-filter-panel/ticket-filter-panel.component.html +386 -0
  81. package/src/lib/components/ticket-filter-panel/ticket-filter-panel.component.scss +87 -0
  82. package/src/lib/components/ticket-filter-panel/ticket-filter-panel.component.spec.ts +23 -0
  83. package/src/lib/components/ticket-filter-panel/ticket-filter-panel.component.ts +493 -0
  84. package/src/lib/components/ticket-footfall-new/ticket-footfall-new.component.html +3751 -0
  85. package/src/lib/components/ticket-footfall-new/ticket-footfall-new.component.scss +1240 -0
  86. package/src/lib/components/ticket-footfall-new/ticket-footfall-new.component.spec.ts +23 -0
  87. package/src/lib/components/ticket-footfall-new/ticket-footfall-new.component.ts +2863 -0
  88. package/src/lib/components/ticketclosepopup/ticketclosepopup.component.html +100 -0
  89. package/src/lib/components/ticketclosepopup/ticketclosepopup.component.scss +34 -0
  90. package/src/lib/components/ticketclosepopup/ticketclosepopup.component.spec.ts +23 -0
  91. package/src/lib/components/ticketclosepopup/ticketclosepopup.component.ts +48 -0
  92. package/src/lib/components/tickets/tickets.component.html +451 -0
  93. package/src/lib/components/tickets/tickets.component.scss +131 -0
  94. package/src/lib/components/tickets/tickets.component.spec.ts +23 -0
  95. package/src/lib/components/tickets/tickets.component.ts +809 -0
  96. package/src/lib/components/viewcategory/viewcategory.component.html +38 -0
  97. package/src/lib/components/viewcategory/viewcategory.component.scss +29 -0
  98. package/src/lib/components/viewcategory/viewcategory.component.spec.ts +23 -0
  99. package/src/lib/components/viewcategory/viewcategory.component.ts +79 -0
  100. package/src/lib/services/audit.service.spec.ts +16 -0
  101. package/src/lib/services/audit.service.ts +98 -0
  102. package/src/lib/services/excel.service.ts +48 -0
  103. package/src/lib/services/ticket.service.spec.ts +16 -0
  104. package/src/lib/services/ticket.service.ts +501 -0
  105. package/src/lib/services/timer.service.spec.ts +16 -0
  106. package/src/lib/services/timer.service.ts +92 -0
  107. package/src/lib/tango-manage-tickets-routing.module.ts +37 -0
  108. package/src/lib/tango-manage-tickets.module.ts +68 -0
  109. package/{public-api.d.ts → src/public-api.ts} +8 -2
  110. package/tsconfig.lib.json +14 -0
  111. package/tsconfig.lib.prod.json +10 -0
  112. package/tsconfig.spec.json +14 -0
  113. package/esm2022/lib/components/add-csm-modal/add-csm-modal.component.mjs +0 -98
  114. package/esm2022/lib/components/audit-log/audit-log.component.mjs +0 -11
  115. package/esm2022/lib/components/audit-metrics/audit-metrics.component.mjs +0 -298
  116. package/esm2022/lib/components/comment-model/comment-model.component.mjs +0 -58
  117. package/esm2022/lib/components/count/count.component.mjs +0 -89
  118. package/esm2022/lib/components/footfall-dic/footfall-dic.component.mjs +0 -894
  119. package/esm2022/lib/components/group-select/group-select.component.mjs +0 -155
  120. package/esm2022/lib/components/re-trigger/re-trigger.component.mjs +0 -96
  121. package/esm2022/lib/components/reactive-select/reactive-select.component.mjs +0 -108
  122. package/esm2022/lib/components/tango-manage-tickets/tango-manage-tickets.component.mjs +0 -127
  123. package/esm2022/lib/components/tickets/tickets.component.mjs +0 -793
  124. package/esm2022/lib/services/excel.service.mjs +0 -45
  125. package/esm2022/lib/services/ticket.service.mjs +0 -158
  126. package/esm2022/lib/tango-manage-tickets-routing.module.mjs +0 -24
  127. package/esm2022/lib/tango-manage-tickets.module.mjs +0 -54
  128. package/esm2022/public-api.mjs +0 -6
  129. package/esm2022/tango-app-ui-manage-tickets.mjs +0 -5
  130. package/fesm2022/tango-app-ui-manage-tickets.mjs +0 -2914
  131. package/fesm2022/tango-app-ui-manage-tickets.mjs.map +0 -1
  132. package/index.d.ts +0 -5
  133. package/lib/components/add-csm-modal/add-csm-modal.component.d.ts +0 -30
  134. package/lib/components/audit-log/audit-log.component.d.ts +0 -5
  135. package/lib/components/audit-metrics/audit-metrics.component.d.ts +0 -59
  136. package/lib/components/comment-model/comment-model.component.d.ts +0 -17
  137. package/lib/components/count/count.component.d.ts +0 -23
  138. package/lib/components/footfall-dic/footfall-dic.component.d.ts +0 -130
  139. package/lib/components/group-select/group-select.component.d.ts +0 -33
  140. package/lib/components/re-trigger/re-trigger.component.d.ts +0 -32
  141. package/lib/components/reactive-select/reactive-select.component.d.ts +0 -32
  142. package/lib/components/tango-manage-tickets/tango-manage-tickets.component.d.ts +0 -27
  143. package/lib/components/tickets/tickets.component.d.ts +0 -84
  144. package/lib/services/excel.service.d.ts +0 -10
  145. package/lib/services/ticket.service.d.ts +0 -49
  146. package/lib/tango-manage-tickets-routing.module.d.ts +0 -7
  147. package/lib/tango-manage-tickets.module.d.ts +0 -21
@@ -0,0 +1,501 @@
1
+ import { HttpClient } from "@angular/common/http";
2
+ import { Injectable, Optional } from "@angular/core";
3
+ import { GlobalStateService } from "tango-app-ui-global";
4
+ import {
5
+ BehaviorSubject,
6
+ Observable,
7
+ catchError,
8
+ map,
9
+ of,
10
+ throwError,
11
+ } from "rxjs";
12
+ import { HttpParams } from "@angular/common/http";
13
+ @Injectable({
14
+ providedIn: "root",
15
+ })
16
+ export class TicketService {
17
+ userApiUrl: any;
18
+ ticketsApiUrl: any;
19
+ auditApiUrl: any;
20
+ auditmetricApiUrl: any;
21
+ zoneauditApiUrl: any;
22
+ footfallDirapiUrl: any;
23
+ footfallCDN: any;
24
+ trafficApiUrl: any;
25
+ revopApiUrl: any;
26
+ clientApiUrl:any;
27
+ vmsAuditUrl:any;
28
+ dropDownTrigger = new BehaviorSubject<any>(null);
29
+ constructor(private http: HttpClient, private gs: GlobalStateService) {
30
+ this.gs.environment.subscribe((env) => {
31
+ if (env) {
32
+ this.userApiUrl = env.userApiUrl;
33
+ this.ticketsApiUrl = env.ticketsApiUrl;
34
+ this.auditmetricApiUrl = env.auditmetricApiUrl;
35
+ this.auditApiUrl = env.auditApiUrl;
36
+ this.zoneauditApiUrl = env.zoneauditApiUrl;
37
+ this.clientApiUrl = env.clientApiUrl;
38
+ this.footfallDirapiUrl = env.footfallDirapiUrl;
39
+ this.footfallCDN = env.footfallCDN;
40
+ this.trafficApiUrl = env.trafficApiUrl;
41
+ this.revopApiUrl = env.revopApiUrl;
42
+ this.vmsAuditUrl = env.vmsAuditUrl;
43
+ }
44
+ });
45
+ }
46
+
47
+ getUserList(params: any): Observable<any> {
48
+ return this.http.post<any>(`${this.userApiUrl}/get-list`, params);
49
+ }
50
+
51
+ exportInstallationList(data: any) {
52
+ return this.http.post(
53
+ `${this.ticketsApiUrl}/infra/installationTable`,
54
+ data,
55
+ { responseType: "arraybuffer" }
56
+ );
57
+ }
58
+
59
+ exportInfraList(data: any) {
60
+ return this.http.post(`${this.ticketsApiUrl}/infra/infraTable`, data, {
61
+ responseType: "arraybuffer",
62
+ });
63
+ }
64
+
65
+ exportMatList(data: any) {
66
+ return this.http.post(`${this.ticketsApiUrl}/infra/matTable`, data, {
67
+ responseType: "arraybuffer",
68
+ });
69
+ }
70
+
71
+ getSotresList(data: any) {
72
+ return this.http.post<any>(`${this.ticketsApiUrl}/infra/storeFilter`, data);
73
+ }
74
+
75
+ getInstallationList(data: any) {
76
+ return this.http.post<any>(
77
+ `${this.ticketsApiUrl}/infra/installationTable`,
78
+ data
79
+ );
80
+ }
81
+
82
+ getInfraList(data: any) {
83
+ return this.http.post<any>(`${this.ticketsApiUrl}/infra/infraTable`, data);
84
+ }
85
+
86
+ getAssignTicket(data: any) {
87
+ return this.http.post<any>(
88
+ `${this.ticketsApiUrl}/infra/assignTicket`,
89
+ data
90
+ );
91
+ }
92
+
93
+ getMatList(data: any) {
94
+ return this.http.post<any>(`${this.ticketsApiUrl}/infra/matTable`, data);
95
+ }
96
+
97
+ updateTicketIssue(data: any) {
98
+ return this.http.post<any>(
99
+ `${this.ticketsApiUrl}/employeeTraning/updatecomment`,
100
+ data
101
+ );
102
+ }
103
+
104
+ getUserActiveList(params: any): Observable<any> {
105
+ return this.http.post<any>(`${this.userApiUrl}/list`, params);
106
+ }
107
+
108
+ getAllCounts(data:any){
109
+ return this.http.post<any>(`${this.ticketsApiUrl}/infra/allCounts`, data)
110
+ }
111
+ getstoreMetrics(data:any){
112
+ return this.http.post(`${this.auditApiUrl}/metrics/store-metrics`,data)
113
+ }
114
+ getstoreMetricsExport(data:any){
115
+ return this.http.post(`${this.auditApiUrl}/metrics/store-metrics`,data,{responseType: 'arraybuffer'})
116
+ }
117
+ getclientList(){
118
+ return this.http.get(`${this.auditApiUrl}/clients`)
119
+ }
120
+ getuserList(){
121
+ return this.http.get(`${this.auditApiUrl}/tango-users`)
122
+ }
123
+ auditretrigger(data:any){
124
+ return this.http.post(`${this.auditApiUrl}/metrics/re-trigger`,data)
125
+ }
126
+ getfootfallcount(data:any){
127
+ return this.http.get(`${this.revopApiUrl}/store-processed-data?storeId=${data.storeId}&fromDate=${data.Date}&toDate=${data.Date}`)
128
+
129
+ }
130
+ getstoreList(data:any){
131
+ return this.http.post(`${this.auditApiUrl}/audit-stores`,data)
132
+ }
133
+ checkTicketExists(data:any){
134
+ return this.http.post(`${this.footfallDirapiUrl}/checkTicketExists`,data)
135
+ }
136
+ mergeticket(data:any){
137
+ return this.http.post(`${this.footfallDirapiUrl}/mergeticket`,data)
138
+ }
139
+ getDataMismathList(data: any) {
140
+ return this.http.post<any>(
141
+ `${this.ticketsApiUrl}/infra/dataMismatchTable`,
142
+ data
143
+ );
144
+ }
145
+ accuracyReasonsupdate(data: any) {
146
+ return this.http.post<any>(
147
+ `${this.footfallDirapiUrl}/tango-review-accuracy-ticket`,
148
+ data
149
+ );
150
+ }
151
+
152
+ exportDataMismatchList(data: any) {
153
+ return this.http.post(
154
+ `${this.ticketsApiUrl}/infra/dataMismatchTable`,
155
+ data,
156
+ { responseType: "arraybuffer" }
157
+ );
158
+ }
159
+
160
+
161
+ getAuditImages(data: any) {
162
+ return this.http.get(
163
+ `${this.auditApiUrl}/audit-images?fileDate=${data?.fileDate}&storeId=${data?.storeId}&imageType=${data?.imageType}&export=${data?.export}&zoneName=${data?.zoneName}&moduleType=${data?.moduleType}`
164
+ );
165
+ }
166
+ ExportAuditImagesasxlsx(data: any) {
167
+ return this.http.get(
168
+ `${this.auditApiUrl}/audit-images?fileDate=${data?.fileDate}&storeId=${data?.storeId}&imageType=${data?.imageType}&export=${data?.export}&zoneName=${data?.zoneName}&moduleType=${data?.moduleType}`,
169
+ { responseType: "arraybuffer" }
170
+ );
171
+ }
172
+
173
+ getTicketSummaryApi(
174
+ client: any,
175
+ fromDate: any,
176
+ toDate: any,
177
+ tangoType:any,
178
+ permissionType?: string | null,
179
+ ): Observable<any> {
180
+ let url =
181
+ `${this.footfallDirapiUrl}/ticket-summary?` +
182
+ `clientId=${client}` +
183
+ `&fromDate=${fromDate}` +
184
+ `&toDate=${toDate}` +
185
+ `&tangoType=${tangoType}`;
186
+ if (permissionType) {
187
+ url += `&permissionType=${permissionType}`;
188
+ }
189
+
190
+ return this.http.get(url);
191
+ }
192
+ accuracyReasons(
193
+ client: any,
194
+ ): Observable<any> {
195
+ return this.http.get(
196
+ `${this.footfallDirapiUrl}/get-accuarcy-issues?clientId=${client}`
197
+ );
198
+ }
199
+
200
+ getTicketListOldApi(
201
+ client: any,
202
+ fromDate: any,
203
+ toDate: any,
204
+ searchvalue: any,
205
+ limit: any,
206
+ offset: any,
207
+ isExport: any,
208
+ sortBy: any,
209
+ sortOrder: any
210
+ ): Observable<any> {
211
+ return this.http.get(
212
+ `${this.footfallDirapiUrl}/ticket-list?clientId=${client}&fromDate=${fromDate}&toDate=${toDate}&searchValue=${searchvalue}&limit=${limit}&offset=${offset}&isExport=${isExport}&sortBy=${sortBy}&sortOrder=${sortOrder}`
213
+ );
214
+ }
215
+
216
+ getTicketListApi(
217
+ client: any,
218
+ fromDate: any,
219
+ toDate: any,
220
+ searchvalue: any,
221
+ limit: any,
222
+ offset: any,
223
+ isExport: any,
224
+ sortBy: any,
225
+ sortOrder: any,
226
+ tangoType: any,
227
+ permissionType?: string | null,
228
+ filters?: {
229
+ filterByStatus: any[];
230
+ filterByReviewer: any | null;
231
+ filterByApprover: any | null;
232
+ filterByTango: any | null;
233
+ filterByReviewedBy: any[];
234
+ fileterByApprovedBy: any[];
235
+ }
236
+ ): Observable<any> {
237
+ let url =
238
+ `${this.footfallDirapiUrl}/ticket-list?` +
239
+ `clientId=${client}` +
240
+ `&fromDate=${fromDate}` +
241
+ `&toDate=${toDate}` +
242
+ `&searchValue=${searchvalue}` +
243
+ `&limit=${limit}` +
244
+ `&offset=${offset}` +
245
+ `&isExport=${isExport}` +
246
+ `&sortBy=${sortBy}` +
247
+ `&sortOrder=${sortOrder}` +
248
+ `&tangoType=${tangoType}`;
249
+
250
+ if (permissionType) {
251
+ url += `&permissionType=${permissionType}`;
252
+ }
253
+
254
+ if (filters) {
255
+ // array params – send as comma-separated
256
+ if (filters.filterByStatus?.length) {
257
+ url += `&filterByStatus=${encodeURIComponent(filters.filterByStatus.join(','))}`;
258
+ }
259
+
260
+ if (filters.filterByReviewedBy?.length) {
261
+ url += `&filterByReviewedBy=${encodeURIComponent(filters.filterByReviewedBy.join(','))}`;
262
+ }
263
+
264
+ if (filters.fileterByApprovedBy?.length) {
265
+ url += `&fileterByApprovedBy=${encodeURIComponent(filters.fileterByApprovedBy.join(','))}`;
266
+ }
267
+
268
+ // string params – JSON stringified accuracy
269
+ if (filters.filterByReviewer) {
270
+ url += `&filterByReviewer=${encodeURIComponent(filters.filterByReviewer)}`;
271
+ }
272
+
273
+ if (filters.filterByApprover) {
274
+ url += `&filterByApprover=${encodeURIComponent(filters.filterByApprover)}`;
275
+ }
276
+
277
+ if (filters.filterByTango) {
278
+ url += `&filterByTango=${encodeURIComponent(filters.filterByTango)}`;
279
+ }
280
+ }
281
+
282
+ return this.http.get(url);
283
+ }
284
+
285
+
286
+ getTicketListExportOldApi(
287
+ client: any,
288
+ fromDate: any,
289
+ toDate: any,
290
+ searchvalue: any,
291
+ limit: any,
292
+ offset: any,
293
+ isExport: any,
294
+ sortBy: any,
295
+ sortOrder: any
296
+ ): Observable<any> {
297
+ return this.http.get(
298
+ `${this.footfallDirapiUrl}/ticket-list?clientId=${client}&fromDate=${fromDate}&toDate=${toDate}&searchValue=${searchvalue}&limit=${limit}&offset=${offset}&isExport=${isExport}&sortBy=${sortBy}&sortOrder=${sortOrder}`,
299
+ { responseType: "arraybuffer" }
300
+ );
301
+ }
302
+
303
+ getTicketListExportApi(
304
+ client: any,
305
+ fromDate: any,
306
+ toDate: any,
307
+ searchvalue: any,
308
+ limit: any,
309
+ offset: any,
310
+ isExport: any,
311
+ sortBy: any,
312
+ sortOrder: any,
313
+ tangoType: any,
314
+ permissionType?: string | null,
315
+ filters?: {
316
+ filterByStatus?: string[];
317
+ filterByReviewer?: string | null;
318
+ filterByApprover?: string | null;
319
+ filterByTango?: string | null;
320
+ filterByReviewedBy?: string[];
321
+ fileterByApprovedBy?: string[];
322
+ }
323
+ ): Observable<any> {
324
+ let url =
325
+ `${this.footfallDirapiUrl}/ticket-list?` +
326
+ `clientId=${client}` +
327
+ `&fromDate=${fromDate}` +
328
+ `&toDate=${toDate}` +
329
+ `&searchValue=${searchvalue}` +
330
+ `&limit=${limit}` +
331
+ `&offset=${offset}` +
332
+ `&isExport=${isExport}` +
333
+ `&sortBy=${sortBy}` +
334
+ `&sortOrder=${sortOrder}` +
335
+ `&tangoType=${tangoType}`;
336
+
337
+ if (permissionType) {
338
+ url += `&permissionType=${permissionType}`;
339
+ }
340
+
341
+ if (filters) {
342
+ if (filters.filterByStatus?.length) {
343
+ url += `&filterByStatus=${encodeURIComponent(filters.filterByStatus.join(','))}`;
344
+ }
345
+
346
+ if (filters.filterByReviewedBy?.length) {
347
+ url += `&filterByReviewedBy=${encodeURIComponent(filters.filterByReviewedBy.join(','))}`;
348
+ }
349
+
350
+ if (filters.fileterByApprovedBy?.length) {
351
+ url += `&fileterByApprovedBy=${encodeURIComponent(filters.fileterByApprovedBy.join(','))}`;
352
+ }
353
+
354
+ if (filters.filterByReviewer) {
355
+ url += `&filterByReviewer=${encodeURIComponent(filters.filterByReviewer)}`;
356
+ }
357
+
358
+ if (filters.filterByApprover) {
359
+ url += `&filterByApprover=${encodeURIComponent(filters.filterByApprover)}`;
360
+ }
361
+
362
+ if (filters.filterByTango) {
363
+ url += `&filterByTango=${encodeURIComponent(filters.filterByTango)}`;
364
+ }
365
+ }
366
+
367
+ const options = isExport
368
+ ? { responseType: 'arraybuffer' as 'json' }
369
+ : {};
370
+
371
+ return this.http.get(url, options);
372
+ }
373
+
374
+
375
+ getTicketsApi(
376
+ store: any,
377
+ fromDate: any,
378
+ toDate: any,
379
+ revopsType: any,
380
+ status: any,
381
+ action: any,
382
+ offset: any,
383
+ limit: any
384
+ ): Observable<any> {
385
+ let params = new HttpParams()
386
+ .set("storeId", store)
387
+ .set("fromDate", fromDate)
388
+ .set("toDate", toDate)
389
+ .set("offset", offset)
390
+ .set("limit", limit);
391
+ if (revopsType) {
392
+ params = params.set("revopsType", revopsType);
393
+ }
394
+ if (status) {
395
+ params = params.set("status", status);
396
+ }
397
+ if (action) {
398
+ params = params.set("action", action);
399
+ }
400
+ return this.http.get(`${this.footfallDirapiUrl}/get-tickets`, { params });
401
+ }
402
+
403
+ getTicketsNewApi(ticketId: any): Observable<any> {
404
+ let params = new HttpParams().set("ticketId", ticketId);
405
+ return this.http.get(`${this.footfallDirapiUrl}/get-tickets`, { params });
406
+ }
407
+
408
+ getTaggedStoresApi(
409
+ client: any,
410
+ fromDate: any,
411
+ toDate: any,
412
+ searchValue: any,
413
+ clusters: any,
414
+ sortOrder: any
415
+ ): Observable<any> {
416
+ let params = new HttpParams()
417
+ .set("clientId", client)
418
+ .set("fromDate", fromDate)
419
+ .set("toDate", toDate); // Add searchValue as an empty string if not provided
420
+ // Only add 'clusters' if it's not null, undefined, or an empty array/string
421
+ if (searchValue) {
422
+ params = params.set("searchValue", searchValue);
423
+ }
424
+
425
+ if (clusters && clusters.length > 0) {
426
+ params = params.set("clusters", clusters);
427
+ }
428
+ if (sortOrder) {
429
+ params = params.set("sortOrder", sortOrder);
430
+ }
431
+ return this.http.get(`${this.footfallDirapiUrl}/get-tagged-stores`, {
432
+ params,
433
+ });
434
+ }
435
+
436
+ getUpdateStatusApi(data: any): Observable<any> {
437
+ const url = `${this.footfallDirapiUrl}/update-status`;
438
+ return this.http.put(url, data);
439
+ }
440
+
441
+ getUpdateTempStatusApi(data: any): Observable<any> {
442
+ return this.http.post(`${this.footfallDirapiUrl}/update-temp-status`, data);
443
+ }
444
+
445
+ getOpenTicketListApi(data: any): Observable<any> {
446
+ return this.http.post(`${this.footfallDirapiUrl}/open-ticket-list`, data);
447
+ }
448
+
449
+ getUpdateTicketStatusApi(data: any): Observable<any> {
450
+ return this.http.post(
451
+ `${this.footfallDirapiUrl}/update-ticket-status`,
452
+ data
453
+ );
454
+ }
455
+
456
+ getCreateTicketListApi(data:any): Observable<any> {
457
+ return this.http.post(`${this.footfallDirapiUrl}/create-ticket`, data);
458
+ }
459
+ CreateinternalTicketApi(data:any): Observable<any> {
460
+ return this.http.post(`${this.footfallDirapiUrl}/create-internalticket`, data);
461
+ }
462
+ getclusters(data: any) {
463
+ return this.http.post(`${this.trafficApiUrl}/headercluster_v2`, data);
464
+ }
465
+
466
+ getReviewerApi(clientId: any,type:any,tangotype:any): Observable<any> {
467
+ let params = new HttpParams().set("clientId", clientId)
468
+ .set("type",type).set("tangotype",tangotype);
469
+ return this.http.get(`${this.footfallDirapiUrl}/reviewer-list`, { params });
470
+ }
471
+
472
+ getTicketAssignApi(data: any): Observable<any> {
473
+ return this.http.post(`${this.footfallDirapiUrl}/assign-ticket`, data);
474
+ }
475
+ reAssignAudit(data: any): Observable<any> {
476
+ return this.http.post(`${this.vmsAuditUrl}/reAssign-audit`, data);
477
+ }
478
+
479
+ getMultiCloseTicketApi(data: any): Observable<any> {
480
+ return this.http.post(
481
+ `${this.footfallDirapiUrl}/multi-close-tickets`,
482
+ data
483
+ );
484
+ }
485
+
486
+ getTypeFunction(clientId: any): Observable<any> {
487
+ let params = new HttpParams().set("clientId", clientId);
488
+ return this.http.get(`${this.clientApiUrl}/get-footfall-directory-config`, { params });
489
+
490
+
491
+ }
492
+ private footfallData: any;
493
+
494
+ setFootfallData(data: any) {
495
+ this.footfallData = data;
496
+ }
497
+
498
+ getFootfallData() {
499
+ return this.footfallData;
500
+ }
501
+ }
@@ -0,0 +1,16 @@
1
+ import { TestBed } from '@angular/core/testing';
2
+
3
+ import { TimerService } from './timer.service';
4
+
5
+ describe('TimerService', () => {
6
+ let service: TimerService;
7
+
8
+ beforeEach(() => {
9
+ TestBed.configureTestingModule({});
10
+ service = TestBed.inject(TimerService);
11
+ });
12
+
13
+ it('should be created', () => {
14
+ expect(service).toBeTruthy();
15
+ });
16
+ });
@@ -0,0 +1,92 @@
1
+ import { Injectable, OnDestroy, OnInit } from '@angular/core';
2
+ import { interval,Observable,BehaviorSubject,Subscription } from 'rxjs';
3
+ import { Router,ActivatedRoute } from '@angular/router';
4
+
5
+ @Injectable({
6
+ providedIn: 'root'
7
+ })
8
+ export class TimerService {
9
+
10
+ private timePassed = new BehaviorSubject<number>(0); // Timer count
11
+ private subscription: Subscription | null = null; // Timer subscription
12
+ private inactivityTimeout: any = null; // Timeout for inactivity
13
+ private INACTIVITY_LIMIT = 5000;
14
+
15
+ constructor(private route:ActivatedRoute) {
16
+
17
+ }
18
+
19
+ startTimer(): void {
20
+ if (!this.subscription) {
21
+ let currentTime = 0;
22
+ let timeSpent: any;
23
+ if ('timeSpent' in sessionStorage) {
24
+ timeSpent = JSON.parse(sessionStorage.getItem('timeSpent') || '{}');
25
+ currentTime = timeSpent || 0; // Retrieve the existing timer value
26
+ }
27
+
28
+ const timer$ = interval(1000); // Emits every 1 second
29
+
30
+ this.subscription = timer$.subscribe(() => {
31
+ currentTime += 1;
32
+ this.timePassed.next(currentTime);
33
+ timeSpent = currentTime;
34
+ sessionStorage.setItem('timeSpent', JSON.stringify(timeSpent)); // Store the updated object
35
+ });
36
+ }
37
+ this.resetInactivityTimeout();
38
+ }
39
+
40
+ stopTimer(): void {
41
+ if (this.subscription) {
42
+ this.subscription.unsubscribe();
43
+ this.subscription = null;
44
+ }
45
+ }
46
+
47
+ stopTimerAfterInactivity(): void {
48
+ this.inactivityTimeout = setTimeout(() => {
49
+ this.stopTimer(); // Stop the timer after inactivity
50
+ }, this.INACTIVITY_LIMIT);
51
+ }
52
+
53
+ resetInactivityTimeout(): void {
54
+ if (this.inactivityTimeout) {
55
+ clearTimeout(this.inactivityTimeout); // Clear the previous inactivity timeout
56
+ }
57
+ this.stopTimerAfterInactivity(); // Set a new inactivity timeout
58
+ }
59
+
60
+ getTimePassed(): BehaviorSubject<number> {
61
+ return this.timePassed;
62
+ }
63
+
64
+ clearTimer(): void {
65
+ if (this.subscription) {
66
+ this.subscription.unsubscribe();
67
+ this.subscription = null;
68
+ }
69
+ // this.timePassed.next(0); // Optionally reset the timePassed
70
+ // sessionStorage.removeItem('totalfiles'); // Optionally clear session storage
71
+ // sessionStorage.removeItem('timeSpent')
72
+ }
73
+
74
+ resetTimer(): void {
75
+ this.timePassed.next(0); // Reset to 0
76
+ // this.resetInactivityTimeout(); // Reset inactivity timeout
77
+ }
78
+
79
+ formatTime(seconds: number): string {
80
+ const hours = Math.floor(seconds / 3600);
81
+ const minutes = Math.floor((seconds % 3600) / 60);
82
+ const secs = seconds % 60;
83
+
84
+ return `${this.padZero(hours)}:${this.padZero(minutes)}:${this.padZero(secs)}`;
85
+ }
86
+
87
+ // Helper method to pad single digit numbers with a leading zero
88
+ private padZero(num: number): string {
89
+ return num < 10 ? '0' + num : '' + num;
90
+ }
91
+
92
+ }
@@ -0,0 +1,37 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { RouterModule, Routes } from '@angular/router';
3
+ import { TangoManageTicketsComponent } from './components/tango-manage-tickets/tango-manage-tickets.component';
4
+ import { FootfallDicviewComponent } from './components/footfall-dicview/footfall-dicview.component';
5
+ import { StartAuditComponent } from './components/start-audit/start-audit.component';
6
+ import { AuditMappingListComponent } from './components/audit-mapping-list/audit-mapping-list.component';
7
+ import { AuditRetagComponent } from './components/audit-retag/audit-retag.component';
8
+
9
+
10
+ const routes: Routes = [
11
+ {
12
+ path:'',
13
+ component:TangoManageTicketsComponent
14
+ },
15
+ {
16
+ path: 'list',
17
+ component: FootfallDicviewComponent
18
+ },
19
+ {
20
+ path:"audit",
21
+ component:StartAuditComponent
22
+ },
23
+ {
24
+ path:"mapping-list",
25
+ component:AuditMappingListComponent
26
+ },
27
+ {
28
+ path:'retag-mapping',
29
+ component:AuditRetagComponent
30
+ },
31
+ ];
32
+
33
+ @NgModule({
34
+ imports: [RouterModule.forChild(routes)],
35
+ exports: [RouterModule]
36
+ })
37
+ export class TangoManageTicketsRoutingModule { }