@optimiser/common 1.0.258 → 1.0.261

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.
@@ -106,7 +106,8 @@ var SyncContactWithOperaOnEmailUnsubscribe = function (db, email) {
106
106
  OperaErrorHandler(db, err);
107
107
  }
108
108
  else if (result && result.Setting && result.Setting.AppsSubscribed && result.Setting.AppsSubscribed.indexOf(constants_1.default.STORE_APP_NAMES.OPERA_PMS) >= 0) {
109
- db.collection("Contact").findOne({ Email: new RegExp("^" + email + "$", "i"), "IsActive": true }, { projection: { "_id": 1, "OperaProfileId": 1 } }, function (errContact, resultContact) {
109
+ /*Update By Suraj on 11Mar2022, $or condition added for searching Contact by Secondary Email as well */
110
+ db.collection("Contact").findOne({ $or: [{ Email: new RegExp("^" + email + "$", "i") }, { SecondaryEmail: new RegExp("^" + email + "$", "i") }], "IsActive": true }, { projection: { "_id": 1, "OperaProfileId": 1 } }, function (errContact, resultContact) {
110
111
  if (errContact) {
111
112
  if (errContact.name)
112
113
  errContact.name += " - while fetching contact to update contact opera sync flag";
@@ -116,7 +117,8 @@ var SyncContactWithOperaOnEmailUnsubscribe = function (db, email) {
116
117
  GetIntegrationSettings(db, "all").then(function (oiSettings) {
117
118
  if (oiSettings && oiSettings.Status == constants_1.default.CompanyAppStatus.ENABLE && oiSettings.HotelList && oiSettings.HotelList.length > 0) {
118
119
  if (oiSettings.HotelList.filter(function (x) { return x.Modules && x.Modules.length > 0 && x.Modules.find(function (y) { return y.ModuleName && y.ModuleName == "contact"; }); }).length > 0)
119
- db.collection("Contact").updateOne({ "_id": resultContact._id, "IsActive": true }, { $set: { "OperaStatus": constants_1.default.OperaSyncStatus.READY } });
120
+ // db.collection("Contact").updateOne({ "_id": resultContact._id, "IsActive": true }, { $set: { "OperaStatus": constants.OperaSyncStatus.READY } });
121
+ db.collection("Contact").updateOne({ "_id": resultContact._id, "IsActive": true }, { $set: { "EmailSubscriptionFromOptimiserToOpera": (new Date()).getMilliseconds() } });
120
122
  }
121
123
  }, function (erroOiSettings) {
122
124
  if (erroOiSettings.name)
@@ -257,8 +257,8 @@ function GetPageFieldData(pageName, db, mdb, msp_d, next, callback) {
257
257
  ExtraLookupFields: [
258
258
  "UserStatus",
259
259
  "IsAppUser"
260
- ],
261
- OnLinkRender: "if(lookupRecord.IsAppUser==true){isHyperlink=false;}"
260
+ ]
261
+ /*,OnLinkRender: "if(lookupRecord.IsAppUser==true){isHyperlink=false;}"*/
262
262
  }
263
263
  };
264
264
  createdDateObj = {
@@ -296,8 +296,8 @@ function GetPageFieldData(pageName, db, mdb, msp_d, next, callback) {
296
296
  ExtraLookupFields: [
297
297
  "UserStatus",
298
298
  "IsAppUser"
299
- ],
300
- OnLinkRender: "if(lookupRecord.IsAppUser==true){isHyperlink=false;}"
299
+ ]
300
+ /*,OnLinkRender: "if(lookupRecord.IsAppUser==true){isHyperlink=false;}"*/
301
301
  }
302
302
  };
303
303
  modDateObj = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optimiser/common",
3
- "version": "1.0.258",
3
+ "version": "1.0.261",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {