tango-app-api-infra 3.9.5-vms.8 → 3.9.6

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.
@@ -1,12 +1,11 @@
1
1
  import { chunkArray, download, logger, sendMessageToFIFOQueue, sendMessageToQueue } from 'tango-app-api-middleware';
2
- import { bulkUpdate, getOpenSearchById, getOpenSearchCount, getOpenSearchData, insertWithId, updateOpenSearchData, upsertOpenSearchData } from 'tango-app-api-middleware/src/utils/openSearch.js';
2
+ import { bulkUpdate, getOpenSearchById, getOpenSearchCount, getOpenSearchData, insertWithId, updateOpenSearchData } from 'tango-app-api-middleware/src/utils/openSearch.js';
3
3
  import { findOneStore } from '../services/store.service.js';
4
4
  import { countDocumnetsCamera } from '../services/camera.service.js';
5
5
  import { findOneRevopDownload, upsertRevopDownload } from '../services/revopDownload.service.js';
6
6
  import dayjs from 'dayjs';
7
7
  import utc from 'dayjs/plugin/utc.js';
8
8
  import timezone from 'dayjs/plugin/timezone.js';
9
- import { findUser } from '../services/user.service.js';
10
9
 
11
10
  dayjs.extend( utc );
12
11
  dayjs.extend( timezone );
@@ -134,7 +133,7 @@ async function bulkUpdateStatusToPending( indexName, inputData ) {
134
133
  }
135
134
  }
136
135
 
137
- export async function ticketSummary1( req, res ) {
136
+ export async function ticketSummary( req, res ) {
138
137
  try {
139
138
  const openSearch = JSON.parse( process.env.OPENSEARCH );
140
139
  const inputData = req.query;
@@ -216,59 +215,7 @@ export async function ticketSummary1( req, res ) {
216
215
  }
217
216
  }
218
217
 
219
- export async function ticketSummary( req, res ) {
220
- try {
221
- let result = '';
222
- const userInfo = req.user;
223
- const ticketsFeature = userInfo?.rolespermission?.some( ( f ) => f.featureName === 'FootfallDirectory' && ( f.modules.find( ( m ) => m.name =='reviewer' && ( m.isAdd==true || m.isEdit==true ) ) ) );
224
-
225
- if ( req.user.userType =='tango' ) {
226
- result ={
227
- totalTickets: 0,
228
- averageAccuracyOverAll: 0,
229
- openTickets: 0,
230
- openInfraIssues: 0,
231
- inprogress: 0,
232
- closedTickets: 0,
233
- ticketAccuracyAbove: '0%',
234
- ticketAccuracyBelow: '0%',
235
- };
236
- } else {
237
- result = req.user.role === 'superadmin'?
238
- {
239
- totalTickets: 0,
240
- openTickets: 0,
241
- inprogress: 0,
242
- closedTickets: 0,
243
- dueToday: 0,
244
- Expired: 0,
245
- underTangoReview: 0,
246
- avgTicket: '0%',
247
- avgAccuracy: '0%',
248
- } :
249
- req.user.role === 'user'? 'NA':
250
- ticketsFeature?
251
- {
252
- totalTickets: 0,
253
- openTickets: 0,
254
- inprogress: 0,
255
- closedTickets: 0,
256
- dueToday: 0,
257
- Expired: 0,
258
- avgTicket: '0%',
259
- avgAccuracy: '0%',
260
- }: 'NA';
261
- }
262
-
263
- return res.sendSuccess( { result: result } );
264
- } catch ( error ) {
265
- const err = error.message || 'Internal Server Error';
266
- logger.error( { error: error, messgage: req.query } );
267
- return res.sendSuccess( err, 500 );
268
- }
269
- }
270
-
271
- export async function ticketList1( req, res ) {
218
+ export async function ticketList( req, res ) {
272
219
  try {
273
220
  const openSearch = JSON.parse( process.env.OPENSEARCH );
274
221
  const inputData = req.query;
@@ -489,680 +436,6 @@ export async function ticketList1( req, res ) {
489
436
  }
490
437
  }
491
438
 
492
- export async function ticketList( req, res ) {
493
- try {
494
- let result = '';
495
- const inputData= req.query;
496
- const userInfo = req.user;
497
- const ticketsFeature = userInfo?.rolespermission?.some( ( f ) => f.featureName === 'FootfallDirectory' && ( f.modules.find( ( m ) => m.name =='reviewer' && ( m.isAdd==true || m.isEdit==true ) ) ) );
498
-
499
- if ( req.user.userType =='tango' ) {
500
- result =inputData.tangotype == 'store'?
501
-
502
-
503
- [
504
- {
505
- ticketId: 'TE_FDT_1763539990306',
506
- storeId: '11-1716',
507
- storeName: 'LKST1916',
508
- ticketRaised: '2025-11-16',
509
- issueDate: '2025-11-16',
510
- dueDate: '2025-11-18',
511
- footfall: 1200,
512
- storeRevisedAccuracy: '98%',
513
- reviewerRevisedAccuracy: '97%',
514
- approverRevisedAccuracy: '98%',
515
- tangoRevisedAccuracy: '98%',
516
- status: 'Closed',
517
- },
518
- {
519
- ticketId: 'TE_FDT_1763860421803',
520
- storeId: '11-1716',
521
- storeName: 'LKST1916',
522
- ticketRaised: '2025-11-21',
523
- issueDate: '2025-11-20',
524
- dueDate: '2025-11-26',
525
- footfall: 94,
526
- storeRevisedAccuracy: '90%',
527
- reviewerRevisedAccuracy: '--',
528
- approverRevisedAccuracy: '--',
529
- tangoRevisedAccuracy: '--',
530
- status: 'Open',
531
- },
532
- {
533
- ticketId: 'TE_FDT_1763711403163',
534
- storeId: '11-1716',
535
- storeName: 'LKST1916',
536
- ticketRaised: '2025-11-20',
537
- issueDate: '2025-11-19',
538
- dueDate: 'Due Today',
539
- footfall: 94,
540
- storeRevisedAccuracy: '95%',
541
- reviewerRevisedAccuracy: '--',
542
- approverRevisedAccuracy: '--',
543
- tangoRevisedAccuracy: '--',
544
- status: 'Open',
545
- },
546
- {
547
- ticketId: 'TE_FDT_1763539990309',
548
- storeId: '11-2000',
549
- storeName: 'LKST2368',
550
- ticketRaised: '2025-11-13',
551
- issueDate: '2025-11-13',
552
- dueDate: '2025-11-15',
553
- footfall: 1280,
554
- storeRevisedAccuracy: '98%',
555
- reviewerRevisedAccuracy: '98%',
556
- approverRevisedAccuracy: '97%',
557
- tangoRevisedAccuracy: '97%',
558
- status: 'Closed',
559
- },
560
- {
561
- ticketId: 'TE_FDT_1763539990310',
562
- storeId: '11-2000',
563
- storeName: 'LKST2368',
564
- ticketRaised: '2025-11-14',
565
- issueDate: '2025-11-14',
566
- dueDate: '2025-11-16',
567
- footfall: 1300,
568
- storeRevisedAccuracy: '96%',
569
- reviewerRevisedAccuracy: '95%',
570
- approverRevisedAccuracy: '96%',
571
- tangoRevisedAccuracy: '95%',
572
- status: 'Open',
573
- },
574
- {
575
- ticketId: 'TE_FDT_1763539990311',
576
- storeId: '11-2000',
577
- storeName: 'LKST2368',
578
- ticketRaised: '2025-11-15',
579
- issueDate: '2025-11-15',
580
- dueDate: '2025-11-17',
581
- footfall: 1350,
582
- storeRevisedAccuracy: '99%',
583
- reviewerRevisedAccuracy: '98%',
584
- approverRevisedAccuracy: '98%',
585
- tangoRevisedAccuracy: '99%',
586
- status: 'Closed',
587
- },
588
- {
589
- ticketId: 'TE_FDT_1763539990312',
590
- storeId: '11-2000',
591
- storeName: 'LKST2368',
592
- ticketRaised: '2025-11-16',
593
- issueDate: '2025-11-16',
594
- dueDate: '2025-11-18',
595
- footfall: 1400,
596
- storeRevisedAccuracy: '97%',
597
- reviewerRevisedAccuracy: '96%',
598
- approverRevisedAccuracy: '97%',
599
- tangoRevisedAccuracy: '96%',
600
- status: 'Closed',
601
- },
602
- {
603
- ticketId: 'TE_FDT_1763539990313',
604
- storeId: '11-10',
605
- storeName: 'LKST80',
606
- ticketRaised: '2023-11-14',
607
- issueDate: '2023-11-14',
608
- dueDate: '2023-11-16',
609
- footfall: 900,
610
- storeRevisedAccuracy: '95%',
611
- reviewerRevisedAccuracy: '94%',
612
- approverRevisedAccuracy: '95%',
613
- tangoRevisedAccuracy: '95%',
614
- status: 'Inprogress',
615
- },
616
- {
617
- ticketId: 'TE_FDT_1763539990314',
618
- storeId: '11-10',
619
- storeName: 'LKST80',
620
- ticketRaised: '2023-11-15',
621
- issueDate: '2023-11-15',
622
- dueDate: '2023-11-17',
623
- footfall: 1000,
624
- storeRevisedAccuracy: '98%',
625
- reviewerRevisedAccuracy: '97%',
626
- approverRevisedAccuracy: '97%',
627
- tangoRevisedAccuracy: '98%',
628
- status: 'Closed',
629
- },
630
- {
631
- ticketId: 'TE_FDT_1763539990315',
632
- storeId: '11-10',
633
- storeName: 'LKST80',
634
- ticketRaised: '2023-11-16',
635
- issueDate: '2023-11-16',
636
- dueDate: '2023-11-18',
637
- footfall: 1050,
638
- storeRevisedAccuracy: '96%',
639
- reviewerRevisedAccuracy: '96%',
640
- approverRevisedAccuracy: '96%',
641
- tangoRevisedAccuracy: '97%',
642
- status: 'Open',
643
- },
644
- {
645
- ticketId: 'TE_FDT_1763539990316',
646
- storeId: '11-10',
647
- storeName: 'LKST80',
648
- ticketRaised: '2023-11-17',
649
- issueDate: '2023-11-17',
650
- dueDate: '2023-11-19',
651
- footfall: 1100,
652
- storeRevisedAccuracy: '97%',
653
- reviewerRevisedAccuracy: '97%',
654
- approverRevisedAccuracy: '97%',
655
- tangoRevisedAccuracy: '97%',
656
- status: 'Closed',
657
- },
658
- {
659
- ticketId: 'TE_FDT_1763539990317',
660
- storeId: '12-1111',
661
- storeName: 'LKST3030',
662
- ticketRaised: '2025-10-12',
663
- issueDate: '2025-10-12',
664
- dueDate: '2025-10-14',
665
- footfall: 1200,
666
- storeRevisedAccuracy: '97%',
667
- reviewerRevisedAccuracy: '97%',
668
- approverRevisedAccuracy: '97%',
669
- tangoRevisedAccuracy: '96%',
670
- status: 'Open',
671
- },
672
- {
673
- ticketId: 'TE_FDT_176353999018',
674
- storeId: '12-1111',
675
- storeName: 'LKST3030',
676
- ticketRaised: '2025-10-13',
677
- issueDate: '2025-10-13',
678
- dueDate: '2025-10-15',
679
- footfall: 1095,
680
- storeRevisedAccuracy: '95%',
681
- reviewerRevisedAccuracy: '96%',
682
- approverRevisedAccuracy: '97%',
683
- tangoRevisedAccuracy: '95%',
684
- status: 'Open-Accuracy Issue',
685
- },
686
- {
687
- ticketId: 'TE_FDT_1763539990319',
688
- storeId: '12-1111',
689
- storeName: 'LKST3030',
690
- ticketRaised: '2025-10-14',
691
- issueDate: '2025-10-14',
692
- dueDate: '2025-10-16',
693
- footfall: 987,
694
- storeRevisedAccuracy: '98%',
695
- reviewerRevisedAccuracy: '99%',
696
- approverRevisedAccuracy: '99%',
697
- tangoRevisedAccuracy: '99%',
698
- status: 'closed-Accuracy Issue',
699
- },
700
- {
701
- ticketId: 'TE_FDT_1763539990320',
702
- storeId: '14-8002',
703
- storeName: 'LKST4590',
704
- ticketRaised: '2025-09-12',
705
- issueDate: '2025-09-12',
706
- dueDate: '2025-09-14',
707
- footfall: 1080,
708
- storeRevisedAccuracy: '98%',
709
- reviewerRevisedAccuracy: '97%',
710
- approverRevisedAccuracy: '99%',
711
- tangoRevisedAccuracy: '99%',
712
- status: 'Closed',
713
- },
714
-
715
- ] :
716
- [
717
-
718
- {
719
- ticketId: 'TE_FDT_1763860421803',
720
- storeId: '11-1716',
721
- storeName: 'LKST1916',
722
- ticketRaised: '2025-11-21',
723
- issueDate: '2025-11-20',
724
- footfall: 94,
725
- type: 'store',
726
- storeRevisedAccuracy: '95%',
727
- reviewerRevisedAccuracy: '--',
728
- approverRevisedAccuracy: '--',
729
- tangoRevisedAccuracy: '--',
730
- status: 'Open',
731
- tangoStatus: 'Open',
732
- },
733
- {
734
- ticketId: 'TE_FDT_1763539990307',
735
- storeId: '11-1716',
736
- storeName: 'LKST1916',
737
- ticketRaised: '2025-11-13',
738
- issueDate: '2025-11-13',
739
- footfall: 1150,
740
- type: 'store',
741
- storeRevisedAccuracy: '99%',
742
- reviewerRevisedAccuracy: '99%',
743
- approverRevisedAccuracy: '98%',
744
- tangoRevisedAccuracy: '97%',
745
- status: 'Closed',
746
- tangoStatus: 'open',
747
- },
748
- {
749
- ticketId: 'TE_FDT_1763539990308',
750
- storeId: '11-1716',
751
- storeName: 'LKST1916',
752
- ticketRaised: '2025-11-14',
753
- issueDate: '2025-11-14',
754
- footfall: 1100,
755
- type: 'store',
756
- storeRevisedAccuracy: '97%',
757
- reviewerRevisedAccuracy: '96%',
758
- approverRevisedAccuracy: '97%',
759
- status: 'Closed',
760
- tangoStatus: 'In-Progress',
761
- },
762
- {
763
- ticketId: 'TE_FDT_1763539990309',
764
- storeId: '11-2000',
765
- storeName: 'LKST2368',
766
- ticketRaised: '2025-11-13',
767
- issueDate: '2025-11-13',
768
- footfall: 1280,
769
- type: 'internal',
770
- storeRevisedAccuracy: '98%',
771
- reviewerRevisedAccuracy: '98%',
772
- approverRevisedAccuracy: '97%',
773
- tangoRevisedAccuracy: '97%',
774
- status: 'Closed-Accuracy Issue',
775
- tangoStatus: 'Open',
776
- },
777
- {
778
- ticketId: 'TE_FDT_1763539990310',
779
- storeId: '11-2000',
780
- storeName: 'LKST2368',
781
- ticketRaised: '2025-11-14',
782
- issueDate: '2025-11-14',
783
- footfall: 300,
784
- type: 'store',
785
- storeRevisedAccuracy: '96%',
786
- reviewerRevisedAccuracy: '95%',
787
- approverRevisedAccuracy: '96%',
788
- tangoRevisedAccuracy: '95%',
789
- status: 'Closed',
790
- tangoStatus: 'In-Progress',
791
- },
792
- {
793
- ticketId: 'TE_FDT_1763539990311',
794
- storeId: '11-2000',
795
- storeName: 'LKST2368',
796
- ticketRaised: '2025-11-15',
797
- issueDate: '2025-11-15',
798
- footfall: 350,
799
- type: 'internal',
800
- storeRevisedAccuracy: '99%',
801
- reviewerRevisedAccuracy: '98%',
802
- approverRevisedAccuracy: '98%',
803
- tangoRevisedAccuracy: '99%',
804
- status: 'Closed',
805
- tangoStatus: 'In-Progress',
806
- },
807
- {
808
- ticketId: 'TE_FDT_1763539990312',
809
- storeId: '11-2000',
810
- storeName: 'LKST2368',
811
- ticketRaised: '2025-11-16',
812
- issueDate: '2025-11-16',
813
- footfall: 400,
814
- type: 'internal',
815
- storeRevisedAccuracy: '97%',
816
- reviewerRevisedAccuracy: '96%',
817
- approverRevisedAccuracy: '97%',
818
- tangoRevisedAccuracy: '96%',
819
- status: 'Open-Accuracy Issue',
820
- tangoStatus: 'Open',
821
- },
822
- {
823
- ticketId: 'TE_FDT_1763539990313',
824
- storeId: '11-10',
825
- storeName: 'LKST80',
826
- ticketRaised: '2023-11-14',
827
- issueDate: '2023-11-14',
828
- footfall: 900,
829
- type: 'internal',
830
- storeRevisedAccuracy: '95%',
831
- reviewerRevisedAccuracy: '94%',
832
- approverRevisedAccuracy: '95%',
833
- tangoRevisedAccuracy: '95%',
834
- status: 'Closed',
835
- tangoStatus: 'Closed',
836
- },
837
- {
838
- ticketId: 'TE_FDT_1763539990314',
839
- storeId: '11-10',
840
- storeName: 'LKST80',
841
- ticketRaised: '2023-11-15',
842
- issueDate: '2023-11-15',
843
- type: 'store',
844
- footfall: 100,
845
- storeRevisedAccuracy: '98%',
846
- reviewerRevisedAccuracy: '97%',
847
- approverRevisedAccuracy: '97%',
848
- tangoRevisedAccuracy: '98%',
849
- status: 'closed-Accuracy Issue',
850
- tangoStatus: 'Closed',
851
- },
852
- {
853
- ticketId: 'TE_FDT_1763539990320',
854
- storeId: '14-8002',
855
- storeName: 'LKST4590',
856
- ticketRaised: '2025-09-12',
857
- issueDate: '2025-09-12',
858
- type: 'internal',
859
- footfall: 80,
860
- storeRevisedAccuracy: '98%',
861
- reviewerRevisedAccuracy: '97%',
862
- approverRevisedAccuracy: '99%',
863
- tangoRevisedAccuracy: '99%',
864
- status: 'Closed-Accuracy Issue',
865
- tangoStatus: 'Closed',
866
- },
867
- ];
868
- } else {
869
- result = req.user.role === 'superadmin'?
870
- [
871
- {
872
- ticketId: 'TE_FDT_1763539990320',
873
- storeId: '11-1716',
874
- storeName: 'LKST1916',
875
- ticketRaised: '2025-11-13',
876
- issueDate: '2025-11-12',
877
- dueDate: '2025-11-14',
878
- footfall: 60,
879
- storeRevisedAccuracy: '45%',
880
- reviewerRevisedAccuracy: '67%',
881
- approverRevisedAccuracy: '87%',
882
- tangoRevisedAccuracy: '93%',
883
- status: 'Open',
884
- approvedBy: '',
885
- },
886
- {
887
- ticketId: 'TE_FDT_1763539990321',
888
- storeId: '11-1716',
889
- storeName: 'LKST1916',
890
- ticketRaised: '2025-11-11',
891
- issueDate: '2025-11-10',
892
- dueDate: '2025-11-12',
893
- footfall: 69,
894
- storeRevisedAccuracy: '79%',
895
- reviewerRevisedAccuracy: '80%',
896
- approverRevisedAccuracy: '90%',
897
- tangoRevisedAccuracy: '90%',
898
- status: 'In-Progress',
899
- approvedBy: 'mu_mu@yopmail.com',
900
- },
901
- {
902
- ticketId: 'TE_FDT_1763860421803',
903
- storeId: '11-1716',
904
- storeName: 'LKST1916',
905
- ticketRaised: '2025-11-21',
906
- issueDate: '2025-11-20',
907
- dueDate: '2025-11-26',
908
- footfall: 94,
909
- storeRevisedAccuracy: '90%',
910
- reviewerRevisedAccuracy: '90%',
911
- approverRevisedAccuracy: '90%',
912
- tangoRevisedAccuracy: '90%',
913
- status: 'Closed',
914
- approvedBy: 'mu_mu@yopmail.com',
915
- },
916
- {
917
- ticketId: 'TE_FDT_1763711403163',
918
- storeId: '11-1716',
919
- storeName: 'LKST1916',
920
- ticketRaised: '2025-11-20',
921
- issueDate: '2025-11-19',
922
- dueDate: 'Due Today',
923
- footfall: 94,
924
- storeRevisedAccuracy: '95%',
925
- reviewerRevisedAccuracy: '--',
926
- approverRevisedAccuracy: '--',
927
- tangoRevisedAccuracy: '--',
928
- status: 'In-Progress',
929
- approvedBy: 'mu_mu@yopmail.com',
930
- },
931
- {
932
- ticketId: 'TE_FDT_1763539990320',
933
- storeId: '11-1716',
934
- storeName: 'LKST1916',
935
- ticketRaised: '2025-11-15',
936
- issueDate: '2025-11-14',
937
- dueDate: '2025-11-17',
938
- footfall: 110,
939
- storeRevisedAccuracy: '90%',
940
- reviewerRevisedAccuracy: '--',
941
- approverRevisedAccuracy: '--',
942
- tangoRevisedAccuracy: '--',
943
- status: 'Open',
944
- approvedBy: '',
945
- },
946
- {
947
- ticketId: 'TE_FDT_1763539990323',
948
- storeId: '11-10',
949
- storeName: 'LKST80',
950
- ticketRaised: '2025-11-13',
951
- issueDate: '2025-11-12',
952
- dueDate: '2025-11-14',
953
- footfall: 170,
954
- storeRevisedAccuracy: '90%',
955
- reviewerRevisedAccuracy: '90%',
956
- approverRevisedAccuracy: '--',
957
- tangoRevisedAccuracy: '--',
958
- status: 'Open',
959
- approvedBy: '',
960
- },
961
- {
962
- ticketId: 'TE_FDT_1763539990328',
963
- storeId: '11-10',
964
- storeName: 'LKST80',
965
- ticketRaised: '2025-11-12',
966
- issueDate: '2025-11-11',
967
- dueDate: '2025-11-14',
968
- footfall: 170,
969
- storeRevisedAccuracy: '90%',
970
- reviewerRevisedAccuracy: '90%',
971
- approverRevisedAccuracy: '90%',
972
- tangoRevisedAccuracy: '--',
973
- status: 'Expired',
974
- approvedBy: 'mu_mu@yopmail.com',
975
- },
976
- {
977
- ticketId: 'TE_FDT_1763539990330',
978
- storeId: '11-10',
979
- storeName: 'LKST80',
980
- ticketRaised: '2025-11-18',
981
- issueDate: '2025-11-15',
982
- dueDate: 'Due Today',
983
- footfall: 230,
984
- storeRevisedAccuracy: '90%',
985
- reviewerRevisedAccuracy: '90%',
986
- approverRevisedAccuracy: '90%',
987
- tangoRevisedAccuracy: '90%',
988
- status: 'Closed',
989
- approvedBy: 'mu_mu@yopmail.com',
990
- },
991
- {
992
- ticketId: 'TE_FDT_1763539990332',
993
- storeId: '11-10',
994
- storeName: 'LKST80',
995
- ticketRaised: '2025-11-17',
996
- issueDate: '2025-11-16',
997
- dueDate: '2025-11-20',
998
- footfall: 812,
999
- storeRevisedAccuracy: '80%',
1000
- reviewerRevisedAccuracy: '80%',
1001
- approverRevisedAccuracy: '80%',
1002
- tangoRevisedAccuracy: '--',
1003
- status: 'Open',
1004
- approvedBy: 'mu_mu@yopmail.com',
1005
- },
1006
- {
1007
- ticketId: 'TE_FDT_176353999034',
1008
- storeId: '11-2000',
1009
- storeName: 'LKST2368',
1010
- ticketRaised: '2025-11-15',
1011
- issueDate: '2025-11-14',
1012
- dueDate: '2025-11-19',
1013
- footfall: '',
1014
- storeRevisedAccuracy: '--',
1015
- reviewerRevisedAccuracy: '--',
1016
- approverRevisedAccuracy: '--',
1017
- tangoRevisedAccuracy: '--',
1018
- status: 'Open',
1019
- approvedBy: '',
1020
- },
1021
- ] :
1022
- req.user.role === 'user'? 'NA':
1023
- ticketsFeature?
1024
- [
1025
- {
1026
- ticketId: 'TE_FDT_1763860421803',
1027
- storeId: '11-1716',
1028
- storeName: 'LKST1916',
1029
- ticketRaised: '2025-11-21',
1030
- issueDate: '2025-11-20',
1031
- dueDate: 'Due Today',
1032
- footfall: 90,
1033
- storeRevisedAccuracy: '90%',
1034
- reviewerRevisedAccuracy: '0%',
1035
- status: 'Open',
1036
- ReviewedBy: '',
1037
- },
1038
- {
1039
- ticketId: 'TE_FDT_1763539990346',
1040
- storeId: '11-2000',
1041
- storeName: 'LKST2368',
1042
- ticketRaised: '2025-11-21',
1043
- issueDate: '2025-11-20',
1044
- dueDate: '2025-11-26',
1045
- footfall: 90,
1046
- storeRevisedAccuracy: '90%',
1047
- reviewerRevisedAccuracy: '--',
1048
- status: 'In-Progress',
1049
- ReviewedBy: 'mu_mu@yopmail.com',
1050
- },
1051
- {
1052
- ticketId: 'TE_FDT_176353999048',
1053
- storeId: '11-2000',
1054
- storeName: 'LKST2368',
1055
- ticketRaised: '2025-11-16',
1056
- issueDate: '2025-11-15',
1057
- dueDate: '2025-11-19',
1058
- footfall: 100,
1059
- storeRevisedAccuracy: '90%',
1060
- reviewerRevisedAccuracy: '90%',
1061
- status: 'Closed',
1062
- ReviewedBy: 'ayyanar@yopmail.com',
1063
- },
1064
- {
1065
- ticketId: 'TE_FDT_176353999048',
1066
- storeId: '11-10',
1067
- storeName: 'LKST80',
1068
- ticketRaised: '2025-11-08',
1069
- issueDate: '2025-11-06',
1070
- dueDate: '2025-11-09',
1071
- footfall: 120,
1072
- storeRevisedAccuracy: '90%',
1073
- reviewerRevisedAccuracy: '0%',
1074
- status: 'Expired',
1075
- ReviewedBy: '',
1076
- },
1077
- {
1078
- ticketId: 'TE_FDT_1763539990341',
1079
- storeId: '11-2000',
1080
- storeName: 'LKST2368',
1081
- ticketRaised: '2025-11-6',
1082
- issueDate: '2025-11-15',
1083
- dueDate: 'Due Today',
1084
- footfall: 510,
1085
- storeRevisedAccuracy: '90%',
1086
- reviewerRevisedAccuracy: '--',
1087
- status: 'Open',
1088
- ReviewedBy: '',
1089
- },
1090
- {
1091
- ticketId: 'TE_FDT_1763539990340',
1092
- storeId: '11-10',
1093
- storeName: 'LKST80',
1094
- ticketRaised: '2025-11-14',
1095
- issueDate: '2025-11-12',
1096
- dueDate: '2025-11-15',
1097
- footfall: 100,
1098
- storeRevisedAccuracy: '0%',
1099
- reviewerRevisedAccuracy: '0%',
1100
- status: 'Expired',
1101
- ReviewedBy: '',
1102
- },
1103
- {
1104
- ticketId: 'TE_FDT_1763539990339',
1105
- storeId: '11-2000',
1106
- storeName: 'LKST2368',
1107
- ticketRaised: '2025-11-16',
1108
- issueDate: '2025-11-15',
1109
- dueDate: '2025-11-17',
1110
- footfall: 140,
1111
- storeRevisedAccuracy: '90%',
1112
- reviewerRevisedAccuracy: '90%',
1113
- status: 'Closed',
1114
- ReviewedBy: 'sornanithya@yopmail.com',
1115
- },
1116
- {
1117
- ticketId: 'TE_FDT_1763539990337',
1118
- storeId: '11-10',
1119
- storeName: 'LKST80',
1120
- ticketRaised: '2025-11-16',
1121
- issueDate: '2025-11-15',
1122
- dueDate: '2025-11-18',
1123
- footfall: '',
1124
- storeRevisedAccuracy: '90%',
1125
- reviewerRevisedAccuracy: '--',
1126
- status: 'Expired',
1127
- ReviewedBy: '',
1128
- },
1129
- {
1130
- ticketId: 'TE_FDT_1763539990338',
1131
- storeId: '11-2000',
1132
- storeName: 'LKST2368',
1133
- ticketRaised: '2025-11-17',
1134
- issueDate: '2025-11-16',
1135
- dueDate: 'Due today',
1136
- footfall: 110,
1137
- storeRevisedAccuracy: '90%',
1138
- reviewerRevisedAccuracy: '--',
1139
- status: 'In-Progress',
1140
- ReviewedBy: 'vinoth@yopmail.com',
1141
- },
1142
- {
1143
- ticketId: 'TE_FDT_1763539990335',
1144
- storeId: '11-2000',
1145
- storeName: 'LKST2368',
1146
- ticketRaised: '2025-11-17',
1147
- issueDate: '2025-11-16',
1148
- dueDate: 'Due today',
1149
- footfall: 100,
1150
- storeRevisedAccuracy: '90%',
1151
- reviewerRevisedAccuracy: '0%',
1152
- status: 'In-Progress',
1153
- ReviewedBy: 'sornanithya@yopmail.com',
1154
- },
1155
- ]: 'NA';
1156
- }
1157
-
1158
- return res.sendSuccess( { result: result } );
1159
- } catch ( error ) {
1160
- const err = error.message || 'Internal Server Error';
1161
- logger.error( { error: error, messgage: req.query } );
1162
- return res.sendSuccess( err, 500 );
1163
- }
1164
- }
1165
-
1166
439
  export async function getTickets( req, res ) {
1167
440
  try {
1168
441
  const openSearch = JSON.parse( process.env.OPENSEARCH );
@@ -1171,7 +444,7 @@ export async function getTickets( req, res ) {
1171
444
  const skip = inputData.offset == 0 ? 0 : ( inputData.offset - 1 ) * limit || 0;
1172
445
  inputData.storeId = inputData.storeId.split( ',' ); // convert strig to array
1173
446
  logger.info( { inputData: inputData, limit: limit, skip: skip } );
1174
- let source = [ 'storeId', 'dateString', 'ticketName', 'revicedFootfall', 'revicedPerc', 'mappingInfo', 'footfallCount', 'employeeCount', 'houseKeepingCount', 'duplicateCount', 'junkCount', 'junkACCount', 'comments', 'employee', 'houseKeeping', 'junk', 'duplicateImages', 'ticketId', 'clientId', 'storeName', 'createdAt', 'updatedAt', 'userName', 'email', 'role', 'status', 'employeeStatus', 'houseKeepingStatus', 'duplicateStatus', 'junkStatus', 'houseKeepingACCount', 'houseKeepingCount', 'employeeCount', 'employeeACCount', 'duplicateCount', 'duplicateACCount', 'approverRole', 'approverUserName', 'approverEmail' ];
447
+ let source = [ 'storeId', 'dateString', 'ticketName', 'footfallCount', 'employeeCount', 'houseKeepingCount', 'duplicateCount', 'junkCount', 'junkACCount', 'comments', 'employee', 'houseKeeping', 'junk', 'duplicateImages', 'ticketId', 'clientId', 'storeName', 'createdAt', 'updatedAt', 'userName', 'email', 'role', 'status', 'employeeStatus', 'houseKeepingStatus', 'duplicateStatus', 'junkStatus', 'houseKeepingACCount', 'houseKeepingCount', 'employeeCount', 'employeeACCount', 'duplicateCount', 'duplicateACCount', 'approverRole', 'approverUserName', 'approverEmail' ];
1175
448
  let filter = [
1176
449
 
1177
450
  {
@@ -1247,10 +520,10 @@ export async function getTickets( req, res ) {
1247
520
  },
1248
521
  },
1249
522
  } );
1250
- source = inputData.revopsType == 'employee' ? [ 'storeId', 'dateString', 'ticketName', 'revicedFootfall', 'revicedPerc', 'mappingInfo', 'footfallCount', 'employeeCount', 'comments', 'employee', 'ticketId', 'clientId', 'storeName', 'createdAt', 'updatedAt', 'email', 'userName', 'role', 'status', 'employeeStatus', 'houseKeepingStatus', 'duplicateStatus', 'houseKeepingACCount', 'houseKeepingCount', 'employeeCount', 'employeeACCount', 'duplicateCount', 'duplicateACCount', 'junkCount', 'junkStatus', 'junkACCount', 'approverRole', 'approverUserName', 'approverEmail' ] :
1251
- inputData.revopsType == 'houseKeeping' ? [ 'storeId', 'dateString', 'ticketName', 'revicedFootfall', 'revicedPerc', 'mappingInfo', 'footfallCount', 'houseKeepingCount', 'comments', 'houseKeeping', 'ticketId', 'clientId', 'storeName', 'createdAt', 'updatedAt', 'userName', 'email', 'role', 'status', 'employeeStatus', 'houseKeepingStatus', 'duplicateStatus', 'houseKeepingACCount', 'houseKeepingCount', 'employeeCount', 'employeeACCount', 'duplicateCount', 'duplicateACCount', 'junkCount', 'junkStatus', 'junkACCount', 'approverRole', 'approverUserName', 'approverEmail' ] :
1252
- inputData.revopsType == 'duplicateImages' ? [ 'storeId', 'dateString', 'ticketName', 'revicedFootfall', 'revicedPerc', 'mappingInfo', 'footfallCount', 'duplicateCount', 'comments', 'duplicateImages', 'ticketId', 'clientId', 'storeName', 'createdAt', 'updatedAt', 'userName', 'email', 'role', 'status', 'employeeStatus', 'houseKeepingStatus', 'duplicateStatus', 'houseKeepingACCount', 'houseKeepingCount', 'employeeCount', 'employeeACCount', 'duplicateCount', 'duplicateACCount', 'junkCount', 'junkStatus', 'junkACCount', 'approverRole', 'approverUserName', 'approverEmail' ] :
1253
- inputData.revopsType == 'junk' ? [ 'storeId', 'dateString', 'ticketName', 'revicedFootfall', 'revicedPerc', 'mappingInfo', 'footfallCount', 'duplicateCount', 'comments', 'junk', 'ticketId', 'clientId', 'storeName', 'createdAt', 'updatedAt', 'userName', 'email', 'role', 'status', 'employeeStatus', 'houseKeepingStatus', 'duplicateStatus', 'houseKeepingACCount', 'houseKeepingCount', 'employeeCount', 'employeeACCount', 'duplicateCount', 'duplicateACCount', 'junkCount', 'junkACCount', 'junkStatus', 'approverRole', 'approverUserName', 'approverEmail' ] : [];
523
+ source = inputData.revopsType == 'employee' ? [ 'storeId', 'dateString', 'ticketName', 'footfallCount', 'employeeCount', 'comments', 'employee', 'ticketId', 'clientId', 'storeName', 'createdAt', 'updatedAt', 'email', 'userName', 'role', 'status', 'employeeStatus', 'houseKeepingStatus', 'duplicateStatus', 'houseKeepingACCount', 'houseKeepingCount', 'employeeCount', 'employeeACCount', 'duplicateCount', 'duplicateACCount', 'junkCount', 'junkStatus', 'junkACCount', 'approverRole', 'approverUserName', 'approverEmail' ] :
524
+ inputData.revopsType == 'houseKeeping' ? [ 'storeId', 'dateString', 'ticketName', 'footfallCount', 'houseKeepingCount', 'comments', 'houseKeeping', 'ticketId', 'clientId', 'storeName', 'createdAt', 'updatedAt', 'userName', 'email', 'role', 'status', 'employeeStatus', 'houseKeepingStatus', 'duplicateStatus', 'houseKeepingACCount', 'houseKeepingCount', 'employeeCount', 'employeeACCount', 'duplicateCount', 'duplicateACCount', 'junkCount', 'junkStatus', 'junkACCount', 'approverRole', 'approverUserName', 'approverEmail' ] :
525
+ inputData.revopsType == 'duplicateImages' ? [ 'storeId', 'dateString', 'ticketName', 'footfallCount', 'duplicateCount', 'comments', 'duplicateImages', 'ticketId', 'clientId', 'storeName', 'createdAt', 'updatedAt', 'userName', 'email', 'role', 'status', 'employeeStatus', 'houseKeepingStatus', 'duplicateStatus', 'houseKeepingACCount', 'houseKeepingCount', 'employeeCount', 'employeeACCount', 'duplicateCount', 'duplicateACCount', 'junkCount', 'junkStatus', 'junkACCount', 'approverRole', 'approverUserName', 'approverEmail' ] :
526
+ inputData.revopsType == 'junk' ? [ 'storeId', 'dateString', 'ticketName', 'footfallCount', 'duplicateCount', 'comments', 'junk', 'ticketId', 'clientId', 'storeName', 'createdAt', 'updatedAt', 'userName', 'email', 'role', 'status', 'employeeStatus', 'houseKeepingStatus', 'duplicateStatus', 'houseKeepingACCount', 'houseKeepingCount', 'employeeCount', 'employeeACCount', 'duplicateCount', 'duplicateACCount', 'junkCount', 'junkACCount', 'junkStatus', 'approverRole', 'approverUserName', 'approverEmail' ] : [];
1254
527
  }
1255
528
 
1256
529
  if ( inputData.action ) {
@@ -1359,10 +632,7 @@ export async function getTickets( req, res ) {
1359
632
  storeId: hit._source.storeId,
1360
633
  dateString: hit?._source?.dateString,
1361
634
  ticketName: hit?._source?.ticketName,
1362
- status: hit?._source?.status?.revicedFootfall,
1363
- revicedPerc: hit?._source?.revicedPerc,
1364
- revicedFootfall: hit?._source?.revicedFootfall,
1365
- mappingInfo: hit?._source?.mappingInfo,
635
+ status: hit?._source?.status,
1366
636
  employeeStatus: hit?._source?.employeeStatus,
1367
637
  houseKeepingStatus: hit?._source?.houseKeepingStatus,
1368
638
  duplicateStatus: hit?._source?.duplicateStatus,
@@ -2234,305 +1504,3 @@ async function extractTempIds( document ) {
2234
1504
  return result;
2235
1505
  }
2236
1506
 
2237
- export async function reviewerList( req, res ) {
2238
- try {
2239
- const inputData = req.query;
2240
- // Build the query for users who have rolespermission with featureName "FootfallDirectory",
2241
- // and a module "Reviewer" where isAdd or isEdit is true.
2242
- const reviewerRoleQuery = {
2243
- 'clientId': inputData.clientId,
2244
- 'rolespermission': {
2245
- $elemMatch: {
2246
- featureName: 'FootfallDirectory',
2247
- modules: {
2248
- $elemMatch: {
2249
- name: 'Reviewer',
2250
- $or: [ { isAdd: true }, { isEdit: true } ],
2251
- },
2252
- },
2253
- },
2254
- },
2255
- };
2256
-
2257
- const getUserlist = await findUser( reviewerRoleQuery, { userName: 1, email: 1, role: 1 } );
2258
- return res.sendSuccess( getUserlist|| [] );
2259
- } catch ( error ) {
2260
- const err = error.message || 'Internal Server Error';
2261
- return res.sendError( err, 500 );
2262
- }
2263
- }
2264
-
2265
- export async function openTicketList( req, res ) {
2266
- try {
2267
- const inputData = req.body;
2268
- const openSearch = JSON.parse( process.env.OPENSEARCH );
2269
-
2270
- // INSERT_YOUR_CODE
2271
- // Build the query to match storeId(s) and dateString range [fromDate, toDate], format: 'yyyy-mm-dd'
2272
- const { clientId, fromDate, toDate } = inputData;
2273
-
2274
- const filter = [
2275
- {
2276
- terms: {
2277
- clientId: Array.isArray( clientId ) ? clientId : [ clientId ],
2278
- },
2279
- },
2280
- {
2281
- range: {
2282
- dateString: {
2283
- gte: fromDate,
2284
- lte: toDate,
2285
- format: 'yyyy-MM-dd',
2286
- },
2287
- },
2288
- },
2289
- ];
2290
-
2291
- const openSearchQuery = {
2292
- size: 10000,
2293
- query: {
2294
- bool: {
2295
- filter: filter,
2296
- },
2297
- },
2298
- _source: [ 'ticketId', 'storeName', 'revicedFootfall', 'footfallCount', 'revicedPerc' ],
2299
- };
2300
-
2301
-
2302
- // Assuming getOpenSearchData and openSearch.footfallDirectoryTagging are available
2303
- const result = await getOpenSearchData( openSearch.footfallDirectory, openSearchQuery );
2304
- const getUserlist = result?.body?.hits?.hits?.map( ( hit ) => hit._source ) || [];
2305
- return res.sendSuccess( getUserlist|| [] );
2306
- } catch ( error ) {
2307
- const err = error.message || 'Internal Server Error';
2308
- logger.error( { error: error, function: 'openTicketList' } );
2309
- return res.sendError( err, 500 );
2310
- }
2311
- }
2312
-
2313
- export async function assignTicket( req, res ) {
2314
- try {
2315
- const inputData = req.body;
2316
- const openSearch = JSON.parse( process.env.OPENSEARCH );
2317
-
2318
- // INSERT_YOUR_CODE
2319
- // Build the query to match storeId(s) and dateString range [fromDate, toDate], format: 'yyyy-mm-dd'
2320
- const { email, userName, role, actionType } = inputData;
2321
-
2322
- // INSERT_YOUR_CODE
2323
-
2324
- // Find and update mappingInfo fields for the provided ticketId and actionType
2325
- // Requires ticketId in inputData
2326
- const { ticketId } = inputData;
2327
- if ( !ticketId ) {
2328
- return res.sendError( 'ticketId is required', 400 );
2329
- }
2330
-
2331
- // Build the OpenSearch update-by-query body
2332
- const updateBody = {
2333
- script: {
2334
- source: `
2335
- if (ctx._source.mappingInfo != null) {
2336
- for (int i = 0; i < ctx._source.mappingInfo.length; i++) {
2337
- if (ctx._source.mappingInfo[i].type == params.actionType) {
2338
- ctx._source.mappingInfo[i].createdByEmail = params.email;
2339
- ctx._source.mappingInfo[i].createdByUserName = params.userName;
2340
- ctx._source.mappingInfo[i].createdByRole = params.role;
2341
- }
2342
- }
2343
- }
2344
- `,
2345
- lang: 'painless',
2346
- params: {
2347
- email,
2348
- userName,
2349
- role,
2350
- actionType,
2351
- },
2352
- },
2353
- query: {
2354
- bool: {
2355
- must: [
2356
- { term: { 'ticketId.keyword': ticketId } },
2357
- {
2358
- nested: {
2359
- path: 'mappingInfo',
2360
- query: {
2361
- bool: {
2362
- must: [
2363
- { match: { 'mappingInfo.type': actionType } },
2364
- ],
2365
- },
2366
- },
2367
- },
2368
- },
2369
- ],
2370
- },
2371
- },
2372
- };
2373
-
2374
- // Call OpenSearch _update_by_query to update doc(s) where ticketId and mappingInfo[i].type == actionType
2375
- const response = await upsertOpenSearchData(
2376
- openSearch.footfallDirectory,
2377
- '11-1716_2025-11-20_footfall-directory-tagging',
2378
- updateBody, // custom arg to indicate passthrough for update-by-query, depends on helper implementation
2379
- );
2380
-
2381
-
2382
- logger.info( { response } );
2383
-
2384
- return res.sendSuccess( { updated: response?.body?.updated ?? 0 } );
2385
- } catch ( error ) {
2386
- const err = error.message || 'Internal Server Error';
2387
- logger.error( { error: error, function: 'assignTicket' } );
2388
- return res.sendError( err, 500 );
2389
- }
2390
- }
2391
-
2392
- export async function updateTempStatus( req, res ) {
2393
- try {
2394
- const openSearch = JSON.parse( process.env.OPENSEARCH );
2395
- const { id, status } = req.body;
2396
-
2397
- // Use bulk update API via bucketing (batch update) -- fetch docs, then bulk-update
2398
- // 1. Search for all documents matching the ticket IDs
2399
- const searchBody = {
2400
- query: {
2401
- bool: {
2402
- must: [
2403
- {
2404
- terms: {
2405
- 'id.keyword': id,
2406
- },
2407
- },
2408
- ],
2409
- },
2410
- },
2411
- _source: [ '_id' ], // Only bring _id for efficiency
2412
- };
2413
-
2414
- const searchResp = await getOpenSearchData(
2415
- openSearch.revop,
2416
- searchBody,
2417
- );
2418
- logger.info( { searchResp: searchResp } );
2419
- // Extract bulk IDs to update
2420
- const hits = searchResp?.body?.hits?.hits ?? [];
2421
- logger.info( { hits: hits } );
2422
- if ( !hits.length ) {
2423
- return res.sendError( 'no data', 204 );
2424
- }
2425
-
2426
- // 2. Build bulk update commands
2427
- // Each doc: { update: { _id: ..., _index: ... } }, { doc: { status: status } }
2428
-
2429
- // 1. Get all IDs from hits
2430
- const docIdToIndex = {};
2431
- hits.forEach( ( doc ) => {
2432
- docIdToIndex[doc._id] = doc._index;
2433
- } );
2434
- const docIds = hits.map( ( doc ) => doc._id );
2435
- logger.info( { docIds } );
2436
- // 2. Fetch all docs by ID to get 'actions' (in chunks if large)
2437
- const getBody = [];
2438
- for ( const doc of hits ) {
2439
- getBody.push( { _index: doc._index, _id: doc._id } );
2440
- }
2441
-
2442
- let mgetResp;
2443
- try {
2444
- mgetResp = await getOpenSearchData(
2445
- openSearch.revop,
2446
- {
2447
- query: {
2448
- ids: {
2449
- values: docIds,
2450
- },
2451
- },
2452
- _source: true,
2453
- },
2454
- );
2455
- } catch ( err ) {
2456
- logger.error( { error: err } );
2457
- mgetResp = undefined;
2458
- }
2459
- logger.info( { mgetResp } );
2460
- // (If you have a utility for multi-get, you may want to use that. Else, you might need to fetch each by ID.)
2461
- // For fallback, fetch all source fields via another search
2462
- let fullDocs = [];
2463
- if ( mgetResp && mgetResp.body && mgetResp.body.docs && Array.isArray( mgetResp.body.docs ) ) {
2464
- fullDocs = mgetResp.body.docs;
2465
- } else if ( searchResp.body && searchResp.body.hits && searchResp.body.hits.hits ) {
2466
- // fallback: use searchResp docs (request _source above)
2467
- fullDocs = searchResp.body.hits.hits;
2468
- }
2469
-
2470
- // 3. Prepare the new actions array for each doc, and set up bulk update payloads
2471
- const reviewActions = [ 'approved', 'rejected' ];
2472
- const docsToUpdate = [];
2473
- logger.info( { fullDocs: fullDocs } );
2474
- for ( const doc of fullDocs ) {
2475
- const source = doc._source || doc.fields || {}; // support mget and search hits
2476
- let actions = Array.isArray( source.actions ) ? [ ...source.actions ] : [];
2477
- if ( reviewActions.includes( status ) ) {
2478
- // for review: update or push 'review'
2479
- let found = false;
2480
- actions = actions.map( ( item ) => {
2481
- if ( item.actionType === 'review' ) {
2482
- found = true;
2483
- return { ...item, action: status };
2484
- }
2485
- return item;
2486
- } );
2487
- if ( !found ) {
2488
- actions.push( { actionType: 'review', action: status } );
2489
- }
2490
- } else {
2491
- // tagging: update or push 'tagging'
2492
- let found = false;
2493
- actions = actions.map( ( item ) => {
2494
- if ( item.actionType === 'tagging' ) {
2495
- found = true;
2496
- return { ...item, action: 'submitted' };
2497
- }
2498
- return item;
2499
- } );
2500
- if ( !found ) {
2501
- actions.push( { actionType: 'tagging', action: 'submitted' } );
2502
- }
2503
- }
2504
- docsToUpdate.push( {
2505
- _index: doc._index || docIdToIndex[doc._id],
2506
- _id: doc._id,
2507
- actions,
2508
- } );
2509
- }
2510
- const bulkPayload = [];
2511
- // 4. Build bulk update payload
2512
- for ( const doc of docsToUpdate ) {
2513
- bulkPayload.push( {
2514
- update: { _index: doc._index, _id: doc._id },
2515
- } );
2516
- bulkPayload.push( {
2517
- doc: { actions: doc.actions },
2518
- } );
2519
- }
2520
- logger.info( { bulkPayload: bulkPayload } );
2521
-
2522
-
2523
- // 3. Execute bulk update
2524
- const bulkResp = await bulkUpdate( bulkPayload );
2525
-
2526
- // Count successes
2527
- const updatedCount = bulkResp?.body?.items?.filter( ( item ) => item?.update?.result === 'updated' || item?.update?.result === 'noop' ).length ?? 0;
2528
-
2529
- logger.info( { updated: updatedCount, by: 'updateTempStatus', ids: id } );
2530
-
2531
- return res.sendSuccess( { updated: updatedCount } );
2532
- } catch ( error ) {
2533
- const err = error.message;
2534
- logger.info( { error: err, function: 'updateTempStatus' } );
2535
- return res.sendError( err, 500 );
2536
- }
2537
- }
2538
-