tango-app-api-trax 3.9.38 → 3.9.39

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 (55) hide show
  1. package/index.js +1 -2
  2. package/package.json +2 -2
  3. package/src/controllers/internalTrax.controller.js +99 -221
  4. package/src/controllers/mobileTrax.controller.js +29 -69
  5. package/src/controllers/teaxFlag.controller.js +953 -15
  6. package/src/controllers/trax.controller.js +2 -3
  7. package/src/controllers/traxDashboard.controllers.js +55 -69
  8. package/src/hbs/flag.hbs +1 -1
  9. package/src/hbs/login-otp.hbs +943 -943
  10. package/src/hbs/template.hbs +0 -7
  11. package/src/hbs/visit-checklist.hbs +91 -71
  12. package/src/routes/internalTraxApi.router.js +0 -1
  13. package/src/routes/trax.routes.js +3 -0
  14. package/src/routes/traxFlag.router.js +24 -0
  15. package/src/services/app.service.js +9 -15
  16. package/src/services/approver.service.js +15 -23
  17. package/src/services/authentication.service.js +3 -9
  18. package/src/services/camera.service.js +13 -19
  19. package/src/services/checklist.service.js +27 -35
  20. package/src/services/checklistAssign.service.js +38 -43
  21. package/src/services/checklistQuestion.service.js +34 -39
  22. package/src/services/checklistlog.service.js +34 -39
  23. package/src/services/clientRequest.service.js +2 -9
  24. package/src/services/clients.services.js +18 -23
  25. package/src/services/cluster.service.js +23 -31
  26. package/src/services/domain.service.js +18 -23
  27. package/src/services/download.services.js +25 -35
  28. package/src/services/group.service.js +17 -23
  29. package/src/services/lenskartEmployeeMapping.service.js +10 -15
  30. package/src/services/locus.service.js +28 -35
  31. package/src/services/notification.service.js +26 -35
  32. package/src/services/otp.service.js +13 -20
  33. package/src/services/planogram.service.js +2 -9
  34. package/src/services/processedTaskConfig.service.js +27 -35
  35. package/src/services/processedTaskList.service.js +26 -32
  36. package/src/services/processedchecklist.services.js +47 -55
  37. package/src/services/processedchecklistconfig.services.js +34 -39
  38. package/src/services/recurringFlagTracker.service.js +32 -39
  39. package/src/services/runAIFeatures.services.js +27 -32
  40. package/src/services/runAIRequest.services.js +38 -43
  41. package/src/services/store.service.js +27 -32
  42. package/src/services/tagging.service.js +2 -9
  43. package/src/services/taskConfig.service.js +27 -35
  44. package/src/services/teams.service.js +24 -35
  45. package/src/services/ticket.service.js +10 -15
  46. package/src/services/user.service.js +20 -27
  47. package/src/services/userAssignedstores.service.js +5 -12
  48. package/src/utils/visitChecklistPdf.utils.js +21 -449
  49. package/src/logging/activityLogFlusher.js +0 -59
  50. package/src/logging/activityLogMiddleware.js +0 -45
  51. package/src/logging/activityLogStore.js +0 -91
  52. package/src/logging/compressBatches.js +0 -83
  53. package/src/logging/config.js +0 -24
  54. package/src/logging/createLoggableService.js +0 -46
  55. package/src/logging/logExternalCall.js +0 -37
@@ -267,13 +267,6 @@
267
267
  <img src="{{this}}" alt="test" width="200" height="180">
268
268
  {{/each}}
269
269
  </div>
270
- {{#if validationVideo.length}}
271
- <div class="Reference"><span>Uploaded Video</span><br>
272
- {{#each validationVideo}}
273
- <a href="{{this}}" target="_blank" style="text-decoration: underline;color:#0085D2">{{this}}</a><br>
274
- {{/each}}
275
- </div>
276
- {{/if}}
277
270
  {{/eq}}
278
271
  </td>
279
272
  </tr>
@@ -56,16 +56,14 @@
56
56
  .dp-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px;padding-bottom:12px;border-bottom:2px solid #00AEEF}
57
57
  .dp-header h2{font-size:18px;font-weight:700;color:#1a1a2e}
58
58
  .dp-score{font-size:15px;font-weight:700;color:#000000}
59
- .q-row{position:relative;margin-bottom:14px;padding:12px 12px 12px 40px;border-radius:8px;background:transparent}
60
- .q-num{position:absolute;left:12px;top:12px;font-size:12px;font-weight:700;color:#000}
59
+ .q-row{display:flex;gap:12px;margin-bottom:14px;padding:12px;border-radius:8px;background:transparent}
60
+ .q-num{font-size:12px;font-weight:700;color:#000;min-width:22px}
61
+ .q-body{flex:1}
61
62
  .q-text{font-size:13px;color:#444;margin-bottom:4px}
62
63
  .q-ans{display:inline-flex;align-items:center;gap:4px;font-size:12px;font-weight:600;padding:2px 8px;border-radius:12px}
63
64
  .ans-yes{background:#e1f5ee;color:#0f6e56}
64
65
  .ans-no{background:#fcebeb;color:#a32d2d}
65
66
  .flag-badge{background:#faeeda;color:#854f0b;font-size:10px;font-weight:600;padding:1px 6px;border-radius:8px;margin-left:6px}
66
- .det-badge{display:inline-block;font-size:10px;font-weight:600;padding:2px 8px;border-radius:10px;white-space:nowrap}
67
- .det-matched{background:#e1f5ee;color:#0f6e56}
68
- .det-notmatched{background:#fcebeb;color:#a32d2d}
69
67
  .q-answer-list{margin-top:6px}
70
68
  .q-answer-item{margin-top:6px;padding:0;background:transparent;border:none;border-radius:0}
71
69
  .q-answer-text{font-size:12px;color:#1a1a1a;line-height:1.5}
@@ -74,21 +72,9 @@
74
72
  .q-answer-media img,.q-answer-media video,.q-answer-item td img{display:block;width:200px;height:180px;object-fit:cover;border-radius:6px;margin-bottom:6px}
75
73
  .img-grid{display:flex;flex-wrap:wrap;gap:8px}
76
74
  .img-grid img{margin-bottom:0}
77
- .answer-media-grid{margin-top:8px;font-size:0}
78
- .answer-media-cell{display:inline-block;width:calc(50% - 6px);vertical-align:top;margin-bottom:12px;break-inside:avoid}
79
- .answer-media-cell:nth-child(2n+1){margin-right:12px}
80
- .answer-media-cell .q-answer-caption{margin-bottom:4px}
81
- .answer-media-cell img{display:block;width:100%;height:200px;object-fit:fill;border-radius:6px;margin-bottom:0}
82
75
  .q-answer-link{font-size:12px;color:#0085D2;text-decoration:underline;word-break:break-all}
83
76
  .q-answer-caption{font-size:11px;color:#666;margin-bottom:4px}
84
77
  .q-answer-remarks{font-size:11px;color:#666;margin-top:6px;white-space:pre-line}
85
- /* User verification (Submitted By) */
86
- .user-verify{margin-top:28px;padding-top:18px;border-top:1px solid #d9d9d9;break-inside:avoid}
87
- .user-verify-title{font-size:15px;font-weight:700;color:#1a1a1a;margin-bottom:14px}
88
- .user-verify-photo{display:block;width:200px;height:240px;object-fit:cover;border-radius:8px;margin-bottom:10px}
89
- .user-verify-name{font-size:14px;color:#1a1a1a;font-weight:600}
90
- .user-verify-sign-label{font-size:12px;color:#666;margin-top:16px;margin-bottom:6px;font-weight:600}
91
- .user-verify-signature{display:block;width:220px;height:auto;max-height:110px;object-fit:contain;border:1px solid #eee;border-radius:6px;padding:6px;background:#fff}
92
78
  /* Footer */
93
79
  .page-footer{position:absolute;bottom:20px;left:40px;right:40px;display:flex;justify-content:space-between;align-items:center;font-size:11px;color:#999;border-top:1px solid #d9d9d9;padding-top:10px}
94
80
  .footer-brand{display:flex;align-items:center;gap:8px;font-weight:600;color:#0066CC;font-size:11px}
@@ -189,10 +175,10 @@
189
175
  <div class="q-row">
190
176
  <span class="q-num">{{this.qno}}</span>
191
177
  <div class="q-body">
192
- <div class="q-text" style="display:flex;justify-content:space-between;align-items:center;gap:8px">
178
+ <div class="q-text" style="display:flex;justify-content:space-between">
193
179
  <div>{{this.qname}}</div>
194
180
  {{#if this.compliance}}
195
- <div style="flex-shrink:0">Score:{{this.score}}</div>
181
+ <div>Score:{{this.score}}</div>
196
182
  {{/if}}
197
183
  </div>
198
184
  {{#if this.questionReferenceImage}}
@@ -218,7 +204,7 @@
218
204
  <div class="q-answer-item">
219
205
  {{#eq this.answerType 'text'}}
220
206
  {{#if this.answer}}
221
- <div class="q-answer-text {{#if this.sopFlag}}flagged{{/if}}">{{this.answer}}{{#if this.showDetectionStatus}} <span class="det-badge {{#eq this.detectionStatus 'Matched'}}det-matched{{else}}det-notmatched{{/eq}}">{{this.detectionStatus}}</span>{{/if}}</div>
207
+ <div class="q-answer-text {{#if this.sopFlag}}flagged{{/if}}">{{this.answer}}</div>
222
208
  {{/if}}
223
209
  {{/eq}}
224
210
  {{#eq this.answerType 'video'}}
@@ -229,20 +215,6 @@
229
215
  </div>
230
216
  {{/if}}
231
217
  {{/eq}}
232
- {{!-- This answer's own images (reference / uploaded / validation), grouped with its label, two per row --}}
233
- {{#if this.answerMedia.length}}
234
- <div class="answer-media-grid">
235
- {{#each this.answerMedia}}
236
- <div class="answer-media-cell">
237
- <div class="q-answer-caption" style="display:flex;justify-content:space-between;align-items:center;gap:6px">
238
- <span>{{this.label}}</span>
239
- {{#if this.detectionStatus}}<span class="det-badge {{#eq this.detectionStatus 'Matched'}}det-matched{{else}}det-notmatched{{/eq}}">{{this.detectionStatus}}</span>{{/if}}
240
- </div>
241
- <img src="{{this.url}}" alt="{{this.label}}" />
242
- </div>
243
- {{/each}}
244
- </div>
245
- {{/if}}
246
218
  {{#eq this.validationDisplayType 'text'}}
247
219
  {{#if this.validationAnswer}}
248
220
  <div class="q-answer-text {{#if this.sopFlag}}flagged{{/if}}">validation Answer: {{this.validationAnswer}}</div>
@@ -255,36 +227,95 @@
255
227
  {{/if}}
256
228
  {{/eq}}
257
229
 
258
- {{!-- Validation videos captured with multi-image validation (shown as links) --}}
259
- {{#eq this.validationDisplayType 'multiImage'}}
260
- {{#if this.validationVideo.length}}
261
- <div class="q-answer-media">
262
- <div class="q-answer-caption">Validation Video</div>
263
- {{#each this.validationVideo}}
264
- <a class="q-answer-link" href="{{this}}" target="_blank">{{this}}</a>
265
- {{/each}}
266
- </div>
267
- {{/if}}
268
- {{/eq}}
269
-
230
+ <table style="width:100%;margin-top:8px;table-layout:fixed"><tr>
231
+ <td style="width:50%;vertical-align:top;padding-right:8px">
232
+ {{#neq ../answerType 'image/video'}}
233
+ {{#neq ../answerType 'multipleImage'}}
234
+ {{#if this.multiReferenceImage.length}}
235
+ <div class="q-answer-media">
236
+ <div class="q-answer-caption">Reference Images</div>
237
+ {{#each this.multiReferenceImage}}
238
+ <img src="{{this}}" alt="Reference Image" />
239
+ {{/each}}
240
+ </div>
241
+ {{else}}
242
+ {{#if this.referenceImage}}
243
+ <div class="q-answer-media">
244
+ <div class="q-answer-caption">Reference Image</div>
245
+ <img src="{{this.referenceImage}}" alt="Reference Image" />
246
+ </div>
247
+ {{else}}
248
+ {{#eq this.answerType 'image'}}
249
+ {{#if this.answer}}
250
+ <div class="q-answer-media">
251
+ <div class="q-answer-caption">Uploaded Image</div>
252
+ <img src="{{this.answer}}" alt="Uploaded Image" />
253
+ </div>
254
+ {{/if}}
255
+ {{/eq}}
256
+ {{/if}}
257
+ {{/if}}
258
+ {{else}}
259
+ {{#eq this.answerType 'image'}}
260
+ {{#if this.answer}}
261
+ <div class="q-answer-media">
262
+ <div class="q-answer-caption">Uploaded Image</div>
263
+ <img src="{{this.answer}}" alt="Uploaded Image" />
264
+ </div>
265
+ {{/if}}
266
+ {{/eq}}
267
+ {{/neq}}
268
+ {{else}}
269
+ {{#eq this.answerType 'image'}}
270
+ {{#if this.answer}}
271
+ <div class="q-answer-media">
272
+ <div class="q-answer-caption">Uploaded Image</div>
273
+ <img src="{{this.answer}}" alt="Uploaded Image" />
274
+ </div>
275
+ {{/if}}
276
+ {{/eq}}
277
+ {{/neq}}
278
+ </td>
279
+ <td style="width:50%;vertical-align:top;padding-left:8px">
280
+ {{#eq this.answerType 'image'}}
281
+ {{#if this.answer}}
282
+ {{#neq ../answerType 'image/video'}}
283
+ {{#neq ../answerType 'multipleImage'}}
284
+ {{#if this.multiReferenceImage.length}}
285
+ <div class="q-answer-caption">Uploaded Image</div>
286
+ <img src="{{this.answer}}" alt="Uploaded Image" />
287
+ {{else}}
288
+ {{#if this.referenceImage}}
289
+ <div class="q-answer-caption">Uploaded Image</div>
290
+ <img src="{{this.answer}}" alt="Uploaded Image" />
291
+ {{/if}}
292
+ {{/if}}
293
+ {{/neq}}
294
+ {{/neq}}
295
+ {{/if}}
296
+ {{/eq}}
297
+ {{#if this.validation}}
298
+ {{#eq this.validationDisplayType 'image'}}
299
+ {{#if this.validationAnswer}}
300
+ <div class="q-answer-caption">Validation Image</div>
301
+ <img src="{{this.validationAnswer}}" alt="Validation Image" />
302
+ {{/if}}
303
+ {{/eq}}
304
+ {{#eq this.validationDisplayType 'multiImage'}}
305
+ {{#if this.validationImage.length}}
306
+ <div class="q-answer-caption">Validation Image</div>
307
+ {{#each this.validationImage}}
308
+ <img src="{{this}}" alt="Validation Image" />
309
+ {{/each}}
310
+ {{/if}}
311
+ {{/eq}}
312
+ {{/if}}
313
+ </td>
314
+ </tr></table>
270
315
  </div>
271
316
  {{/each}}
272
317
  </div>
273
318
  {{/if}}
274
- {{!-- All images for this question (reference / uploaded / validation), two per row --}}
275
- {{#if this.mediaItems.length}}
276
- <div class="answer-media-grid">
277
- {{#each this.mediaItems}}
278
- <div class="answer-media-cell">
279
- <div class="q-answer-caption" style="display:flex;justify-content:space-between;align-items:center;gap:6px">
280
- <span>{{this.label}}</span>
281
- {{#if this.detectionStatus}}<span class="det-badge {{#eq this.detectionStatus 'Matched'}}det-matched{{else}}det-notmatched{{/eq}}">{{this.detectionStatus}}</span>{{/if}}
282
- </div>
283
- <img src="{{this.url}}" alt="{{this.label}}" />
284
- </div>
285
- {{/each}}
286
- </div>
287
- {{/if}}
288
319
  {{#if this.remarks}}
289
320
  <div class="q-answer-remarks">Remarks: {{this.remarks}}</div>
290
321
  {{/if}}
@@ -293,17 +324,6 @@
293
324
  {{/each}}
294
325
  </div>
295
326
  {{/each}}
296
- {{#if showUserVerification}}
297
- <div class="user-verify">
298
- <div class="user-verify-title">Submitted By</div>
299
- {{#if userImage}}
300
- <img class="user-verify-photo" src="{{userImage}}" alt="Submitted by photo" />
301
- {{/if}}
302
- {{#if submittedBy}}
303
- <div class="user-verify-name">{{userSignature}}</div>
304
- {{/if}}
305
- </div>
306
- {{/if}}
307
327
  </div>
308
328
 
309
329
  </body>
@@ -13,7 +13,6 @@ internalTraxRouter
13
13
  .get( '/list', isAllowedInternalAPIHandler, internalController.list )
14
14
  .post( '/updateAomDetails', isAllowedInternalAPIHandler, internalController.aomupdateCollection )
15
15
  .post( '/updateSaleManagerDetails', isAllowedInternalAPIHandler, internalController.saleUpdateCollection )
16
- .post( '/updateValidationType', isAllowedInternalAPIHandler, internalController.updateMultipleChoiceSingleValidationType )
17
16
  .get( '/profile', isAllowedMobileSessionHandler, internalController.getUserStoreList )
18
17
  .post( '/pushNotification', isAllowedInternalAPIHandler, internalController.pushNotification )
19
18
  .post( '/taskPushNotification', isAllowedInternalAPIHandler, internalController.taskPushNotification )
@@ -27,6 +27,7 @@ traxRouter
27
27
  .get( '/predefinedChecklist', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ ] } ] } ), validate( aichecklistValidation ), traxController.preDefinedChecklist )
28
28
  .post( '/selectAssign', validate( selectAssign ), traxController.selectAssign )
29
29
  .post( '/assign', isAllowedSessionHandler, traxController.checklistAssign )
30
+ // .post( '/assignUpload', isAllowedSessionHandler, traxController.assignChecklistUser )
30
31
  .post( '/updateAssign', isAllowedSessionHandler, traxController.updateAssign )
31
32
  .post( '/updateAiConfigure', isAllowedSessionHandler, traxController.updateAiConfigure )
32
33
  .get( '/getAiDetails', isAllowedSessionHandler, traxController.getAiDetails )
@@ -38,3 +39,5 @@ traxRouter
38
39
  .post( '/exportQuestions', isAllowedSessionHandler, traxController.downloadQuestionTemplate )
39
40
  .get( '/getTeamList', isAllowedSessionHandler, traxController.getTeamList )
40
41
  ;
42
+
43
+ // isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ ] } ] } ),
@@ -4,10 +4,16 @@ export const traxFlagRouter = express.Router();
4
4
 
5
5
  import {
6
6
  checklistFlagsTable,
7
+ flagChecklistCards,
7
8
  flagChecklistCardsV1,
9
+ flagChecklistComparisonCards,
8
10
  flagChecklistComparisonCardsV1,
9
11
  flagChecklistTableV1,
10
12
  overallFlagMetrics,
13
+ flagCards,
14
+ flagComparisonCards,
15
+ flagTables,
16
+ checklistDropdown,
11
17
  flagCardsV1,
12
18
  flagComparisonCardsV1,
13
19
  flagTablesV1,
@@ -27,15 +33,33 @@ traxFlagRouter
27
33
  .post( '/checklist-flags-table', isAllowedSessionHandler,
28
34
  accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [] } ] } ),
29
35
  checklistFlagsTable )
36
+ .post( '/flagChecklistCards', isAllowedSessionHandler,
37
+ accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [] } ] } ),
38
+ flagChecklistCards )
30
39
  .post( '/flagChecklistCardsV1', isAllowedSessionHandler,
31
40
  accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [] } ] } ),
32
41
  flagChecklistCardsV1 )
42
+ .post( '/flagChecklistComparisonCards', isAllowedSessionHandler,
43
+ accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [] } ] } ),
44
+ flagChecklistComparisonCards )
33
45
  .post( '/flagChecklistComparisonCardsV1', isAllowedSessionHandler,
34
46
  accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [] } ] } ),
35
47
  flagChecklistComparisonCardsV1 )
36
48
  .post( '/flagChecklistTableV1', isAllowedSessionHandler,
37
49
  accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [] } ] } ),
38
50
  flagChecklistTableV1 )
51
+ .post( '/flagCards', isAllowedSessionHandler,
52
+ accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [] } ] } ),
53
+ flagCards )
54
+ .post( '/flagComparisonCards', isAllowedSessionHandler,
55
+ accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [] } ] } ),
56
+ flagComparisonCards )
57
+ .post( '/flagTables', isAllowedSessionHandler,
58
+ accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [] } ] } ),
59
+ flagTables )
60
+ .post( '/flagChecklistDropDown', isAllowedSessionHandler,
61
+ accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [] } ] } ),
62
+ checklistDropdown )
39
63
  .post( '/flagChecklistDropDownV1', isAllowedSessionHandler,
40
64
  accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [] } ] } ),
41
65
  checklistDropdownV1 )
@@ -1,20 +1,14 @@
1
1
  import model from 'tango-api-schema';
2
- import { createLoggableService } from '../logging/createLoggableService.js';
3
2
 
4
- const _methods = {
5
- async aggregate( query ={} ) {
6
- return model.appVersionModel.aggregate( query );
7
- },
8
- async updateOne( query, record ) {
9
- return model.appVersionModel.updateOne( query, { $set: record }, { upsert: true } );
10
- },
11
- async findOne( query ={}, field={} ) {
12
- return model.appVersionModel.findOne( query, field );
13
- },
3
+ export const aggregate = async ( query ={} ) => {
4
+ return model.appVersionModel.aggregate( query );
14
5
  };
15
6
 
16
- const _svc = createLoggableService( _methods, 'appversions' );
7
+ export const updateOne = async ( query, record ) => {
8
+ return model.appVersionModel.updateOne( query, { $set: record }, { upsert: true } );
9
+ };
10
+
11
+ export const findOne = async ( query ={}, field={} ) => {
12
+ return model.appVersionModel.findOne( query, field );
13
+ };
17
14
 
18
- export const aggregate = ( ...args ) => _svc.aggregate( ...args );
19
- export const updateOne = ( ...args ) => _svc.updateOne( ...args );
20
- export const findOne = ( ...args ) => _svc.findOne( ...args );
@@ -1,28 +1,20 @@
1
1
  import model from 'tango-api-schema';
2
- import { createLoggableService } from '../logging/createLoggableService.js';
3
2
 
4
- const _methods = {
5
- async create( data ) {
6
- return model.traxApproverModel.create( data );
7
- },
8
- async updateMany( query={}, record={} ) {
9
- return model.traxApproverModel.updateMany( query, { $set: record } );
10
- },
11
- async insertMany( data = [] ) {
12
- return model.traxApproverModel.insertMany( data );
13
- },
14
- async find( query ={}, field={} ) {
15
- return model.traxApproverModel.find( query, field );
16
- },
17
- async findOne( query ={}, field={} ) {
18
- return model.traxApproverModel.findOne( query, field );
19
- },
3
+ export const create = async ( data ) => {
4
+ return model.traxApproverModel.create( data );
20
5
  };
21
6
 
22
- const _svc = createLoggableService( _methods, 'approvers' );
7
+ export const updateMany = async ( query={}, record={} ) => {
8
+ return model.traxApproverModel.updateMany( query, { $set: record } );
9
+ };
10
+
11
+ export const insertMany = async ( data = [] ) => {
12
+ return model.traxApproverModel.insertMany( data );
13
+ };
23
14
 
24
- export const create = ( ...args ) => _svc.create( ...args );
25
- export const updateMany = ( ...args ) => _svc.updateMany( ...args );
26
- export const insertMany = ( ...args ) => _svc.insertMany( ...args );
27
- export const find = ( ...args ) => _svc.find( ...args );
28
- export const findOne = ( ...args ) => _svc.findOne( ...args );
15
+ export const find = async ( query ={}, field={} ) => {
16
+ return model.traxApproverModel.find( query, field );
17
+ };
18
+ export const findOne = async ( query ={}, field={} ) => {
19
+ return model.traxApproverModel.findOne( query, field );
20
+ };
@@ -1,12 +1,6 @@
1
1
  import authenticationModel from 'tango-api-schema/schema/authentication.model.js';
2
- import { createLoggableService } from '../logging/createLoggableService.js';
3
2
 
4
- const _methods = {
5
- async create( data ) {
6
- return authenticationModel.create( data );
7
- },
8
- };
3
+ export async function create( data ) {
4
+ return authenticationModel.create( data );
5
+ }
9
6
 
10
- const _svc = createLoggableService( _methods, 'authentications' );
11
-
12
- export const create = ( ...args ) => _svc.create( ...args );
@@ -1,24 +1,18 @@
1
1
  import model from 'tango-api-schema';
2
- import { createLoggableService } from '../logging/createLoggableService.js';
3
2
 
4
- const _methods = {
5
- async aggregate( query ={} ) {
6
- return model.cameraModel.aggregate( query );
7
- },
8
- async updateOne( query, record ) {
9
- return model.cameraModel.updateOne( query, { $set: record }, { upsert: true } );
10
- },
11
- async findOne( query ={}, field={} ) {
12
- return model.cameraModel.findOne( query, field );
13
- },
14
- async find( query ={}, field={} ) {
15
- return model.cameraModel.find( query, field );
16
- },
3
+ export const aggregate = async ( query ={} ) => {
4
+ return model.cameraModel.aggregate( query );
17
5
  };
18
6
 
19
- const _svc = createLoggableService( _methods, 'cameras' );
7
+ export const updateOne = async ( query, record ) => {
8
+ return model.cameraModel.updateOne( query, { $set: record }, { upsert: true } );
9
+ };
10
+
11
+ export const findOne = async ( query ={}, field={} ) => {
12
+ return model.cameraModel.findOne( query, field );
13
+ };
14
+
15
+ export const find = async ( query ={}, field={} ) => {
16
+ return model.cameraModel.find( query, field );
17
+ };
20
18
 
21
- export const aggregate = ( ...args ) => _svc.aggregate( ...args );
22
- export const updateOne = ( ...args ) => _svc.updateOne( ...args );
23
- export const findOne = ( ...args ) => _svc.findOne( ...args );
24
- export const find = ( ...args ) => _svc.find( ...args );
@@ -1,39 +1,31 @@
1
1
  import model from 'tango-api-schema';
2
- import { createLoggableService } from '../logging/createLoggableService.js';
3
-
4
- const _methods = {
5
- async findOne( query={}, field={} ) {
6
- return model.checklistconfigModel.findOne( query, field );
7
- },
8
- async find( query={}, field={} ) {
9
- return model.checklistconfigModel.find( query, field );
10
- },
11
- async create( document = {} ) {
12
- return model.checklistconfigModel.create( document );
13
- },
14
- async deleteOne( query = {} ) {
15
- return model.checklistconfigModel.deleteOne( query );
16
- },
17
- async updateOne( query = {}, record={} ) {
18
- return model.checklistconfigModel.updateOne( query, { $set: record }, { upsert: true } );
19
- },
20
- async updateMany( query = {}, record={} ) {
21
- return model.checklistconfigModel.updateMany( query, { $set: record } );
22
- },
23
- async aggregate( query = {} ) {
24
- return model.checklistconfigModel.aggregate( query ).collation( {
25
- locale: 'en_US',
26
- numericOrdering: true,
27
- } ); ;
28
- },
2
+
3
+ export const findOne = async ( query={}, field={} ) => {
4
+ return model.checklistconfigModel.findOne( query, field );
5
+ };
6
+
7
+ export const find = async ( query={}, field={} ) => {
8
+ return model.checklistconfigModel.find( query, field );
9
+ };
10
+
11
+ export const create = async ( document = {} ) => {
12
+ return model.checklistconfigModel.create( document );
13
+ };
14
+
15
+ export const deleteOne = async ( query = {} ) => {
16
+ return model.checklistconfigModel.deleteOne( query );
17
+ };
18
+
19
+ export const updateOne = async ( query = {}, record={} ) => {
20
+ return model.checklistconfigModel.updateOne( query, { $set: record }, { upsert: true } );
21
+ };
22
+
23
+ export const updateMany = async ( query = {}, record={} ) => {
24
+ return model.checklistconfigModel.updateMany( query, { $set: record } );
25
+ };
26
+
27
+ export const aggregate = async ( query = {} ) => {
28
+ return model.checklistconfigModel.aggregate( query );
29
29
  };
30
30
 
31
- const _svc = createLoggableService( _methods, 'checklists' );
32
31
 
33
- export const findOne = ( ...args ) => _svc.findOne( ...args );
34
- export const find = ( ...args ) => _svc.find( ...args );
35
- export const create = ( ...args ) => _svc.create( ...args );
36
- export const deleteOne = ( ...args ) => _svc.deleteOne( ...args );
37
- export const updateOne = ( ...args ) => _svc.updateOne( ...args );
38
- export const updateMany = ( ...args ) => _svc.updateMany( ...args );
39
- export const aggregate = ( ...args ) => _svc.aggregate( ...args );
@@ -1,44 +1,39 @@
1
1
  import model from 'tango-api-schema';
2
- import { createLoggableService } from '../logging/createLoggableService.js';
3
-
4
- const _methods = {
5
- async find( query={}, field={} ) {
6
- return model.checklistassignconfigModel.find( query, field );
7
- },
8
- async findOne( query={}, field={} ) {
9
- return model.checklistassignconfigModel.findOne( query, field );
10
- },
11
- async create( document = {} ) {
12
- return model.checklistassignconfigModel.create( document );
13
- },
14
- async insertMany( document = {} ) {
15
- return model.checklistassignconfigModel.insertMany( document );
16
- },
17
- async deleteMany( document = {} ) {
18
- return model.checklistassignconfigModel.deleteMany( document );
19
- },
20
- async updateMany( query = {}, record={} ) {
21
- return model.checklistassignconfigModel.updateMany( query, { $set: record } );
22
- },
23
- async updateOne( query = {}, record={} ) {
24
- return model.checklistassignconfigModel.updateOne( query, { $set: record }, { upsert: true } );
25
- },
26
- async aggregate( query = {} ) {
27
- return model.checklistassignconfigModel.aggregate( query );
28
- },
29
- async count( query = {} ) {
30
- return model.checklistassignconfigModel.countDocuments( query );
31
- },
32
- };
33
-
34
- const _svc = createLoggableService( _methods, 'checklistassigns' );
35
-
36
- export const find = ( ...args ) => _svc.find( ...args );
37
- export const findOne = ( ...args ) => _svc.findOne( ...args );
38
- export const create = ( ...args ) => _svc.create( ...args );
39
- export const insertMany = ( ...args ) => _svc.insertMany( ...args );
40
- export const deleteMany = ( ...args ) => _svc.deleteMany( ...args );
41
- export const updateMany = ( ...args ) => _svc.updateMany( ...args );
42
- export const updateOne = ( ...args ) => _svc.updateOne( ...args );
43
- export const aggregate = ( ...args ) => _svc.aggregate( ...args );
44
- export const count = ( ...args ) => _svc.count( ...args );
2
+
3
+ export const find = async ( query={}, field={} ) => {
4
+ return model.checklistassignconfigModel.find( query, field );
5
+ };
6
+
7
+ export const findOne = async ( query={}, field={} ) => {
8
+ return model.checklistassignconfigModel.findOne( query, field );
9
+ };
10
+
11
+ export const create = async ( document = {} ) => {
12
+ return model.checklistassignconfigModel.create( document );
13
+ };
14
+
15
+ export const insertMany = async ( document = {} ) => {
16
+ return model.checklistassignconfigModel.insertMany( document );
17
+ };
18
+
19
+ export const deleteMany = async ( document = {} ) => {
20
+ return model.checklistassignconfigModel.deleteMany( document );
21
+ };
22
+
23
+ export const updateMany = async ( query = {}, record={} ) => {
24
+ return model.checklistassignconfigModel.updateMany( query, { $set: record } );
25
+ };
26
+
27
+ export const updateOne = async ( query = {}, record={} ) => {
28
+ return model.checklistassignconfigModel.updateOne( query, { $set: record }, { upsert: true } );
29
+ };
30
+
31
+ export const aggregate = async ( query = {} ) => {
32
+ return model.checklistassignconfigModel.aggregate( query );
33
+ };
34
+
35
+ export const count = async ( query = {} ) => {
36
+ return model.checklistassignconfigModel.countDocuments( query );
37
+ };
38
+
39
+