tango-app-api-infra 3.8.1-beta.21 → 3.8.1-beta.23

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.21",
3
+ "version": "3.8.1-beta.23",
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', 'houseKeepingACCount', 'houseKeepingCount', 'employeeCount', 'employeeACCount', 'duplicateCount', 'duplicateACCount', 'approverRole', 'approverUserName', 'approverEmail' ];
407
+ let source = [ 'storeId', 'dateString', 'ticketName', 'footfallCount', 'employeeCount', 'houseKeepingCount', 'duplicateCount', 'comments', 'employee', 'houseKeeping', 'duplicateImages', 'ticketId', 'clientId', 'storeName', 'createdAt', 'updatedAt', 'userName', 'email', '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', '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' ] : [];
480
+ 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', 'duplicateCoun', 'duplicateACCount', 'approverRole', 'approverUserName', 'approverEmail' ] :
481
+ 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', 'approverRole', 'approverUserName', 'approverEmail' ] :
482
+ 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', 'approverRole', 'approverUserName', 'approverEmail' ] : [];
483
483
  }
484
484
 
485
485
  if ( inputData.action ) {
@@ -581,6 +581,7 @@ export async function getTickets( req, res ) {
581
581
  ticketId: hit?._source?.ticketId,
582
582
  footfallCount: hit?._source?.footfallCount,
583
583
  comments: hit?._source?.comments,
584
+ email: hit?._source?.comments,
584
585
  userName: hit?._source?.userName,
585
586
  role: hit?._source?.role,
586
587
  createdAt: hit?._source?.createdAt,
@@ -923,8 +924,6 @@ export async function getTaggedStores( req, res ) {
923
924
  try {
924
925
  const openSearch = JSON.parse( process.env.OPENSEARCH );
925
926
  const inputData = req.query;
926
- inputData.clientId = inputData?.clientId?.split( ',' );
927
- logger.info( { inputData: inputData.clientId } );
928
927
  let filter = [
929
928
  {
930
929
  terms: { 'clientId.keyword': inputData.clientId },
@@ -1014,7 +1013,6 @@ export async function getTaggedStores( req, res ) {
1014
1013
  },
1015
1014
  },
1016
1015
  };
1017
-
1018
1016
  let temp = [];
1019
1017
 
1020
1018
  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 ) {