tango-app-api-infra 3.8.1-beta.20 → 3.8.1-beta.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-app-api-infra",
3
- "version": "3.8.1-beta.20",
3
+ "version": "3.8.1-beta.22",
4
4
  "description": "infra",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -404,7 +404,7 @@ export async function getTickets( req, res ) {
404
404
  const skip = inputData.offset == 0 ? 0 : ( inputData.offset - 1 ) * limit || 0;
405
405
  inputData.storeId = inputData.storeId.split( ',' ); // convert strig to array
406
406
  logger.info( { inputData: inputData, limit: limit, skip: skip } );
407
- let source = [ 'storeId', 'dateString', 'ticketName', 'footfallCount', 'employeeCount', 'houseKeepingCount', 'duplicateCount', 'comments', 'employee', 'houseKeeping', 'duplicateImages', 'ticketId', 'clientId', 'storeName', 'createdAt', 'updatedAt', 'userName', 'role', 'status', 'employeeStatus', 'houseKeepingStatus', 'duplicateStatus' ];
407
+ let source = [ 'storeId', 'dateString', 'ticketName', 'footfallCount', 'employeeCount', 'houseKeepingCount', 'duplicateCount', 'comments', 'employee', 'houseKeeping', 'duplicateImages', 'ticketId', 'clientId', 'storeName', 'createdAt', 'updatedAt', 'userName', 'role', 'status', 'employeeStatus', 'houseKeepingStatus', 'duplicateStatus', 'houseKeepingACCount', 'houseKeepingCount', 'employeeCount', 'employeeACCount', 'duplicateCount', 'duplicateACCount', 'approverRole', 'approverUserName', 'approverEmail' ];
408
408
  let filter = [
409
409
 
410
410
  {
@@ -477,9 +477,9 @@ export async function getTickets( req, res ) {
477
477
  },
478
478
  },
479
479
  } );
480
- source = inputData.revopsType == 'employee' ? [ 'storeId', 'dateString', 'ticketName', 'footfallCount', 'employeeCount', 'comments', 'employee', 'ticketId', 'clientId', 'storeName', 'createdAt', 'updatedAt', 'userName', 'role', 'status', 'employeeStatus', 'houseKeepingStatus', 'duplicateStatus' ] :
481
- inputData.revopsType == 'houseKeeping' ? [ 'storeId', 'dateString', 'ticketName', 'footfallCount', 'houseKeepingCount', 'comments', 'houseKeeping', 'ticketId', 'clientId', 'storeName', 'createdAt', 'updatedAt', 'userName', 'role', 'status', 'employeeStatus', 'houseKeepingStatus', 'duplicateStatus' ] :
482
- inputData.revopsType == 'duplicateImages' ? [ 'storeId', 'dateString', 'ticketName', 'footfallCount', 'duplicateCount', 'comments', 'duplicateImages', 'ticketId', 'clientId', 'storeName', 'createdAt', 'updatedAt', 'userName', 'role', 'status', 'employeeStatus', 'houseKeepingStatus', 'duplicateStatus' ] : [];
480
+ source = inputData.revopsType == 'employee' ? [ 'storeId', 'dateString', 'ticketName', 'footfallCount', 'employeeCount', 'comments', 'employee', 'ticketId', 'clientId', 'storeName', 'createdAt', 'updatedAt', 'userName', 'role', 'status', 'employeeStatus', 'houseKeepingStatus', 'duplicateStatus', 'houseKeepingACCount', 'houseKeepingCount', 'employeeCount', 'employeeACCount', 'duplicateCoun', 'duplicateACCount', 'approverRole', 'approverUserName', 'approverEmail' ] :
481
+ inputData.revopsType == 'houseKeeping' ? [ 'storeId', 'dateString', 'ticketName', 'footfallCount', 'houseKeepingCount', 'comments', 'houseKeeping', 'ticketId', 'clientId', 'storeName', 'createdAt', 'updatedAt', 'userName', 'role', 'status', 'employeeStatus', 'houseKeepingStatus', 'duplicateStatus', 'houseKeepingACCount', 'houseKeepingCount', 'employeeCount', 'employeeACCount', 'duplicateCount', 'duplicateACCount', 'approverRole', 'approverUserName', 'approverEmail' ] :
482
+ inputData.revopsType == 'duplicateImages' ? [ 'storeId', 'dateString', 'ticketName', 'footfallCount', 'duplicateCount', 'comments', 'duplicateImages', 'ticketId', 'clientId', 'storeName', 'createdAt', 'updatedAt', 'userName', 'role', 'status', 'employeeStatus', 'houseKeepingStatus', 'duplicateStatus', 'houseKeepingACCount', 'houseKeepingCount', 'employeeCount', 'employeeACCount', 'duplicateCount', 'duplicateACCount', 'approverRole', 'approverUserName', 'approverEmail' ] : [];
483
483
  }
484
484
 
485
485
  if ( inputData.action ) {
@@ -586,6 +586,17 @@ export async function getTickets( req, res ) {
586
586
  createdAt: hit?._source?.createdAt,
587
587
  updatedAt: hit?._source?.updatedAt,
588
588
  tempId: hit?._source?.tempId,
589
+ houseKeepingCount: hit?._source?.houseKeepingCount,
590
+ employeeCount: hit?._source?.employeeCount,
591
+ duplicateCount: hit?._source?.duplicateCount,
592
+ houseKeepingACCount: hit?._source?.houseKeepingACCount,
593
+ employeeACCount: hit?._source?.employeeACCount,
594
+ duplicateACCount: hit?._source?.duplicateACCount,
595
+ approverUserName: hit?._source?.approverUserName,
596
+ approverEmail: hit?._source?.approverEmail,
597
+ approverRole: hit?._source?.approverRole,
598
+
599
+
589
600
  };
590
601
  let result;
591
602
 
@@ -912,10 +923,9 @@ export async function getTaggedStores( req, res ) {
912
923
  try {
913
924
  const openSearch = JSON.parse( process.env.OPENSEARCH );
914
925
  const inputData = req.query;
915
- logger.info( { inputData: inputData } );
916
926
  let filter = [
917
927
  {
918
- term: { 'clientId.keyword': inputData.clientId },
928
+ terms: { 'clientId.keyword': inputData.clientId },
919
929
  },
920
930
  {
921
931
  range: {
@@ -1002,7 +1012,6 @@ export async function getTaggedStores( req, res ) {
1002
1012
  },
1003
1013
  },
1004
1014
  };
1005
-
1006
1015
  let temp = [];
1007
1016
 
1008
1017
  const geteDataCount = await getOpenSearchData( openSearch.footfallDirectory, getCount );
@@ -44,11 +44,12 @@ export async function getClusters( req, res, next ) {
44
44
  try {
45
45
  const inputData=req.query;
46
46
  // const assignedStores = req.body.assignedStores;
47
+ inputData.clientId = inputData?.clientId?.split( ',' );
47
48
  const clusters = inputData?.clusters?.split( ',' ); // convert strig to array
48
49
  // logger.info( { assignedStores, clusters } );
49
50
  let filter =[
50
51
  {
51
- clientId: inputData.clientId,
52
+ clientId: { $in: inputData.clientId },
52
53
  },
53
54
  ];
54
55
  if ( inputData?.clusters ) {