@optimiser/common 1.0.282 → 1.0.285

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,6 +1,7 @@
1
1
  declare const _default: {
2
2
  LookupAlias: string;
3
3
  LookupTypeFields: string[];
4
+ SearchValueAlias: string;
4
5
  USER_STATUS: {
5
6
  ACTIVE: string;
6
7
  SUSPEND: string;
package/dist/constants.js CHANGED
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = {
4
4
  LookupAlias: '_LookupData',
5
5
  LookupTypeFields: ["lookup", "multilookup", "dropdown", "multiselect", "file", "image"],
6
+ SearchValueAlias: '_SearchValue',
6
7
  USER_STATUS: {
7
8
  ACTIVE: 'Active',
8
9
  SUSPEND: 'Suspend',
@@ -28,6 +28,9 @@ declare function SyncFieldInSameCollection(objectName: string, objectIDs: Object
28
28
  declare function SyncFieldInSameCollectionByObjectID(objectName: string, objectID: ObjectId, db: Db): void;
29
29
  declare function SyncFieldInSameCollectionByObjectIDWithPromise(objectName: string, objectID: ObjectId, db: Db): Promise<any>;
30
30
  declare function SyncFieldInOtherCollection(syncFields: AnyObjectInterface[], db: Db): Promise<any>;
31
+ /** Special Note: Need to create seachValue for it in QPC-6169.
32
+ I've not done yet, cause it was not calling from anywhere.
33
+ */
31
34
  declare function SyncUserInOtherCollection(options: AnyObjectInterface, db: Db, callback: callBackInterface, next: NextFunction): void;
32
35
  declare function BuildLookupDataField(fieldSchema: AnyObjectInterface, updateObj: AnyObjectInterface, db: Db): Promise<void>;
33
36
  declare function CheckDataBeforeAdd(updateObj: AnyObjectInterface, objectSchema: AnyObjectInterface, db: Db): Promise<void>;
@@ -224,7 +227,8 @@ declare function GetMailFromString(fromUser: string): string;
224
227
  /**
225
228
  * TODO: Return On behalf String in Calendar Invitation mails
226
229
  * @param fromUser From User Name
230
+ * @param fromEmail From User Email
227
231
  * @returns string
228
232
  */
229
- declare function InvitationMailReplyContent(fromUser: string): string;
233
+ declare function InvitationMailReplyContent(fromUser: string, fromEmail: string): string;
230
234
  export { CheckForWhiteListedDomain, ReturnJsonResponse, ConvertFileByteSize, GetObjectByKeyValueFromList, IsEqualArrays, IsEqualValue, CheckUserProfileField, GetPageFieldData, GetPageObjectSchema, GetFieldDetail, UpdateRecentViewObject, UpdateRecentViewFields, SyncChildObjectData, SyncParentObjectData, DeleteFieldInOtherCollection, SyncFieldInSameCollection, SyncFieldInSameCollectionByObjectID, SyncFieldInSameCollectionByObjectIDWithPromise, SyncFieldInOtherCollection, SyncUserInOtherCollection, BuildLookupDataField, CheckDataBeforeAdd, CheckDataBeforeUpdate, BuildGridFieldProjection, BuildFieldProjection, BuildLookupFieldProjection, FilterConditions, GirdHeaderFilters, FieldsGridHeaderFilters, AddLog, CheckFilterFieldsProjection, VerifyEmailPassword, GetMyTeamUsers, ExtractChildUsersTree, GetMaxKeyValueListSchema, VerifyAWSEmailConfig, GenerateId, SyncUserDetailsWithMasterDB, SignoutUserFromAllDevices, SignoutUsersWithPromise, SignoutMultipleUsersFromAllDevices, UserLicenseConsumeCalculate, sendMailWithUserAccount, GetEmailClientConfigs, GetCompanyEncryptionKey, ExecuteDynamicDMLQuery, ExecuteDynamicDQLQuery, GetUserProfilePermissions, MakeUserPasswordInvalid, ConvertJsonToXLXS, SendResetPasswordMail, SendMailToSupport, MailTemplateStructure, SendMailToCustomer, parseMSPCookie, GetIPDetailsFromReq, isEmptyObj, SyncListSchemaFieldInOtherCollection, UpdateTagCountAfterDelete, SyncTagCountAfterUpdate, ReactivateFieldInOtherCollection, SyncUserLicenceConsumedCount, BroadCastEventToAllCompanyUsers, CheckDataPermission, SyncCompanyLicenceInMasterCompanyAfterAdd, NextServiceDateForDashboard, CheckDateNotInPast, GetWeekDayByDayAndOccurance, GetInterValFromOccurance, GetWeekDayInfoInMonth, GetDayIndex, RemoveFieldsFromFilters, GetUserProfile, CheckPageAuthentication, ErrorHandlerForServices, CheckCaptcha, ValidateSanitizeUserInput, CreateBanquetingVATSettingsData, CheckReportFolderAccess, GetMailFromString, InvitationMailReplyContent };
@@ -1020,7 +1020,7 @@ function SyncFieldInSameCollection(objectName, objectIDs, db) {
1020
1020
  }
1021
1021
  db.collection(objectName).find(findObj).forEach(function (objectData) {
1022
1022
  return __awaiter(this, void 0, void 0, function () {
1023
- var updateObj, i, fieldSchema, lookupData, ex_1;
1023
+ var updateObj, i, fieldSchema, lookupData, searchValue, ex_1;
1024
1024
  return __generator(this, function (_a) {
1025
1025
  switch (_a.label) {
1026
1026
  case 0:
@@ -1038,8 +1038,13 @@ function SyncFieldInSameCollection(objectName, objectIDs, db) {
1038
1038
  case 3:
1039
1039
  _a.sent();
1040
1040
  lookupData = objectData[fieldSchema.Name + constants_1.default.LookupAlias];
1041
- if (lookupData !== undefined)
1041
+ if (lookupData !== undefined) {
1042
1042
  updateObj[fieldSchema.Name + constants_1.default.LookupAlias] = lookupData;
1043
+ }
1044
+ searchValue = objectData[fieldSchema.Name + constants_1.default.SearchValueAlias];
1045
+ if (searchValue !== undefined) {
1046
+ updateObj[fieldSchema.Name + constants_1.default.SearchValueAlias] = searchValue;
1047
+ }
1043
1048
  _a.label = 4;
1044
1049
  case 4:
1045
1050
  i++;
@@ -1095,7 +1100,7 @@ function SyncFieldInSameCollectionByObjectID(objectName, objectID, db) {
1095
1100
  if (fieldArr_2) {
1096
1101
  db.collection(objectName).findOne({ '_id': objectID }, function (err, objectData) {
1097
1102
  return __awaiter(this, void 0, void 0, function () {
1098
- var updateObj, i, fieldSchema, lookupData;
1103
+ var updateObj, i, fieldSchema, lookupData, searchValue;
1099
1104
  return __generator(this, function (_a) {
1100
1105
  switch (_a.label) {
1101
1106
  case 0:
@@ -1110,8 +1115,13 @@ function SyncFieldInSameCollectionByObjectID(objectName, objectID, db) {
1110
1115
  case 2:
1111
1116
  _a.sent();
1112
1117
  lookupData = objectData[fieldSchema.Name + constants_1.default.LookupAlias];
1113
- if (lookupData !== undefined)
1118
+ if (lookupData !== undefined) {
1114
1119
  updateObj[fieldSchema.Name + constants_1.default.LookupAlias] = lookupData;
1120
+ }
1121
+ searchValue = objectData[fieldSchema.Name + constants_1.default.SearchValueAlias];
1122
+ if (searchValue !== undefined) {
1123
+ updateObj[fieldSchema.Name + constants_1.default.SearchValueAlias] = searchValue;
1124
+ }
1115
1125
  _a.label = 3;
1116
1126
  case 3:
1117
1127
  i++;
@@ -1140,7 +1150,7 @@ function SyncFieldInSameCollectionByObjectIDWithPromise(objectName, objectID, db
1140
1150
  if (fieldArr_3) {
1141
1151
  db.collection(objectName).findOne({ '_id': objectID }, function (err, objectData) {
1142
1152
  return __awaiter(this, void 0, void 0, function () {
1143
- var updateObj, i, fieldSchema, lookupData;
1153
+ var updateObj, i, fieldSchema, lookupData, searchValue;
1144
1154
  return __generator(this, function (_a) {
1145
1155
  switch (_a.label) {
1146
1156
  case 0:
@@ -1155,8 +1165,13 @@ function SyncFieldInSameCollectionByObjectIDWithPromise(objectName, objectID, db
1155
1165
  case 2:
1156
1166
  _a.sent();
1157
1167
  lookupData = objectData[fieldSchema.Name + constants_1.default.LookupAlias];
1158
- if (lookupData !== undefined)
1168
+ if (lookupData !== undefined) {
1159
1169
  updateObj[fieldSchema.Name + constants_1.default.LookupAlias] = lookupData;
1170
+ }
1171
+ searchValue = objectData[fieldSchema.Name + constants_1.default.SearchValueAlias];
1172
+ if (searchValue !== undefined) {
1173
+ updateObj[fieldSchema.Name + constants_1.default.SearchValueAlias] = searchValue;
1174
+ }
1160
1175
  _a.label = 3;
1161
1176
  case 3:
1162
1177
  i++;
@@ -1188,6 +1203,7 @@ function SyncFieldInSameCollectionByObjectIDWithPromise(objectName, objectID, db
1188
1203
  });
1189
1204
  }
1190
1205
  exports.SyncFieldInSameCollectionByObjectIDWithPromise = SyncFieldInSameCollectionByObjectIDWithPromise;
1206
+ //** SyncFieldInOtherCollection function is moved in fieldlistener service by Satyam */
1191
1207
  //Sync field in other collection after update
1192
1208
  function SyncFieldInOtherCollection(syncFields, db) {
1193
1209
  var _this = this;
@@ -1306,6 +1322,9 @@ exports.SyncFieldInOtherCollection = SyncFieldInOtherCollection;
1306
1322
  /*Sync user in other collection after replace user
1307
1323
  *this function is used in /replaceuser api
1308
1324
  */
1325
+ /** Special Note: Need to create seachValue for it in QPC-6169.
1326
+ I've not done yet, cause it was not calling from anywhere.
1327
+ */
1309
1328
  function SyncUserInOtherCollection(options, db, callback, next) {
1310
1329
  var userData = options.userData;
1311
1330
  var msp_d = options.msp_d;
@@ -1454,6 +1473,7 @@ function BuildLookupDataField(fieldSchema, updateObj, db) {
1454
1473
  var fldName = fieldSchema.Name;
1455
1474
  var fldValue_1 = updateObj[fldName];
1456
1475
  var alias_1 = fldName + constants_1.default.LookupAlias;
1476
+ var searchAlias_1 = fldName + constants_1.default.SearchValueAlias;
1457
1477
  var fldLookupData_1 = null;
1458
1478
  if (fldValue_1) {
1459
1479
  var aggregateArry = [];
@@ -1495,6 +1515,22 @@ function BuildLookupDataField(fieldSchema, updateObj, db) {
1495
1515
  else if (data && data.length > 0) {
1496
1516
  fldLookupData_1 = data[0];
1497
1517
  updateObj[alias_1] = fldLookupData_1;
1518
+ //** Below code is added by Shahzaib on 05/09/2022 to create SearchValue */
1519
+ var result = '';
1520
+ if (fieldSchema.LookupFields != undefined) {
1521
+ var _loop_10 = function (j) {
1522
+ if (fieldSchema.ExcludeLookupFieldsOnSearch && fieldSchema.ExcludeLookupFieldsOnSearch.filter(function (x) { return x == fieldSchema.LookupFields[j]; }).length != 0) {
1523
+ return "continue";
1524
+ }
1525
+ if (fldLookupData_1[fieldSchema.LookupFields[j]] != undefined)
1526
+ result += fldLookupData_1[fieldSchema.LookupFields[j]].toString() + ' ';
1527
+ };
1528
+ for (var j = 0; j < fieldSchema.LookupFields.length; j++) {
1529
+ _loop_10(j);
1530
+ }
1531
+ }
1532
+ updateObj[searchAlias_1] = result === null || result === void 0 ? void 0 : result.trim();
1533
+ //** Ends here */
1498
1534
  }
1499
1535
  resolve();
1500
1536
  });
@@ -1524,6 +1560,19 @@ function BuildLookupDataField(fieldSchema, updateObj, db) {
1524
1560
  else if (data && data.length > 0) {
1525
1561
  fldLookupData_1 = data;
1526
1562
  updateObj[alias_1] = fldLookupData_1;
1563
+ //** Below code is added by Shahzaib on 05/09/2022 to create SearchValue */
1564
+ var result = '';
1565
+ for (var i = 0; i < data.length; i++) {
1566
+ var lookupRecord = data[i];
1567
+ if (fieldSchema.LookupFields != undefined) {
1568
+ for (var j = 0; j < fieldSchema.LookupFields.length; j++) {
1569
+ if (lookupRecord[fieldSchema.LookupFields[j]] != undefined)
1570
+ result += lookupRecord[fieldSchema.LookupFields[j]].toString() + ' ';
1571
+ }
1572
+ }
1573
+ }
1574
+ updateObj[searchAlias_1] = result === null || result === void 0 ? void 0 : result.trim();
1575
+ //** Ends here */
1527
1576
  }
1528
1577
  resolve();
1529
1578
  });
@@ -1625,6 +1674,10 @@ function BuildLookupDataField(fieldSchema, updateObj, db) {
1625
1674
  }
1626
1675
  else {
1627
1676
  updateObj[alias_1] = fldLookupData_1;
1677
+ // Below if cond was added by Shahzaib on 05/09/2022
1678
+ if (fieldSchema.UIDataType == 'lookup' || fieldSchema.UIDataType == 'multilookup') {
1679
+ updateObj[searchAlias_1] = fldLookupData_1;
1680
+ }
1628
1681
  resolve();
1629
1682
  }
1630
1683
  }
@@ -1637,11 +1690,11 @@ exports.BuildLookupDataField = BuildLookupDataField;
1637
1690
  //CheckDataBeforeAdd it sync object before add
1638
1691
  function CheckDataBeforeAdd(updateObj, objectSchema, db) {
1639
1692
  return __awaiter(this, void 0, void 0, function () {
1640
- var _loop_10, _i, _a, fldName;
1693
+ var _loop_11, _i, _a, fldName;
1641
1694
  return __generator(this, function (_b) {
1642
1695
  switch (_b.label) {
1643
1696
  case 0:
1644
- _loop_10 = function (fldName) {
1697
+ _loop_11 = function (fldName) {
1645
1698
  var fieldSchema, sequenceDocument, val, j, item, num;
1646
1699
  return __generator(this, function (_a) {
1647
1700
  switch (_a.label) {
@@ -1687,7 +1740,7 @@ function CheckDataBeforeAdd(updateObj, objectSchema, db) {
1687
1740
  case 1:
1688
1741
  if (!(_i < _a.length)) return [3 /*break*/, 4];
1689
1742
  fldName = _a[_i];
1690
- return [5 /*yield**/, _loop_10(fldName)];
1743
+ return [5 /*yield**/, _loop_11(fldName)];
1691
1744
  case 2:
1692
1745
  _b.sent();
1693
1746
  _b.label = 3;
@@ -1703,11 +1756,11 @@ exports.CheckDataBeforeAdd = CheckDataBeforeAdd;
1703
1756
  //CheckDataBeforeAdd it sync object before update
1704
1757
  function CheckDataBeforeUpdate(updateObj, objectData, objectSchema, db) {
1705
1758
  return __awaiter(this, void 0, void 0, function () {
1706
- var _loop_11, _i, _a, fldName;
1759
+ var _loop_12, _i, _a, fldName;
1707
1760
  return __generator(this, function (_b) {
1708
1761
  switch (_b.label) {
1709
1762
  case 0:
1710
- _loop_11 = function (fldName) {
1763
+ _loop_12 = function (fldName) {
1711
1764
  var fieldSchema, oldValue, newValue, isSame;
1712
1765
  return __generator(this, function (_a) {
1713
1766
  switch (_a.label) {
@@ -1750,7 +1803,7 @@ function CheckDataBeforeUpdate(updateObj, objectData, objectSchema, db) {
1750
1803
  case 1:
1751
1804
  if (!(_i < _a.length)) return [3 /*break*/, 4];
1752
1805
  fldName = _a[_i];
1753
- return [5 /*yield**/, _loop_11(fldName)];
1806
+ return [5 /*yield**/, _loop_12(fldName)];
1754
1807
  case 2:
1755
1808
  _b.sent();
1756
1809
  _b.label = 3;
@@ -1769,50 +1822,55 @@ function BuildGridFieldProjection(project, field, group) {
1769
1822
  if (group && group.IsRealLookup)
1770
1823
  fldName = group.Name + '.' + fldName;
1771
1824
  var alias;
1825
+ var searchAlias = fldName + constants_1.default.SearchValueAlias;
1772
1826
  var searchConcatArry = [];
1773
1827
  switch (field.Schema.UIDataType) {
1828
+ // below code was added by Shahzaib on 05/09/2022
1774
1829
  case "lookup":
1775
- alias = fldName + constants_1.default.LookupAlias;
1776
- project[fldName] = 1;
1777
- project[alias] = 1;
1778
- var _loop_12 = function (i) {
1779
- if (field.Schema.ExcludeLookupFieldsOnSearch && field.Schema.ExcludeLookupFieldsOnSearch.filter(function (x) { return x == field.Schema.LookupFields[i]; }).length != 0) {
1780
- return "continue";
1781
- }
1782
- // searchConcatArry.push({ "$ifNull": ['$' + alias + '.' + field.Schema.LookupFields[i], ""] });
1783
- // added by Shahzaib, make int to string and concat
1784
- searchConcatArry.push({ "$ifNull": [{ $toString: '$' + alias + '.' + field.Schema.LookupFields[i] }, ""] });
1785
- if (i < field.Schema.LookupFields.length - 1) {
1786
- searchConcatArry.push(" ");
1787
- }
1788
- };
1789
- for (var i = 0; i < field.Schema.LookupFields.length; i++) {
1790
- _loop_12(i);
1791
- }
1792
- ;
1793
- project[fldName + '_SearchValue'] = { $concat: searchConcatArry };
1794
- break;
1795
1830
  case "multilookup":
1796
1831
  alias = fldName + constants_1.default.LookupAlias;
1797
1832
  project[fldName] = 1;
1798
1833
  project[alias] = 1;
1799
- for (var i = 0; i < field.Schema.LookupFields.length; i++) {
1800
- searchConcatArry.push({ "$ifNull": ['$' + alias + '.' + field.Schema.LookupFields[i], [" "]] });
1801
- if (i < field.Schema.LookupFields.length - 1) {
1802
- searchConcatArry.push([" "]);
1803
- }
1804
- }
1805
- ;
1806
- //project[fldName + '_SearchValue'] = { $concatArrays: searchConcatArry };
1807
- project[fldName + '_SearchValue'] = {
1808
- $reduce: {
1809
- input: { $concatArrays: searchConcatArry },
1810
- initialValue: "",
1811
- //in: { $concat: ["$$value", "$$this"] } // Commented by and below line was added by Shahzaib, make int to string
1812
- in: { $concat: ["$$value", { $toString: "$$this" }] }
1813
- }
1814
- };
1834
+ project[searchAlias] = 1;
1815
1835
  break;
1836
+ // Below code was commented by Shahzaib on 05/09/2022, searchAlias was added instead of it.
1837
+ // case "lookup":
1838
+ // alias = fldName + constants.LookupAlias;
1839
+ // project[fldName] = 1;
1840
+ // project[alias] = 1;
1841
+ // for (let i = 0; i < field.Schema.LookupFields.length; i++) {
1842
+ // if (field.Schema.ExcludeLookupFieldsOnSearch && field.Schema.ExcludeLookupFieldsOnSearch.filter((x: AnyObjectInterface) => x == field.Schema.LookupFields[i]).length != 0) {
1843
+ // continue;
1844
+ // }
1845
+ // // searchConcatArry.push({ "$ifNull": ['$' + alias + '.' + field.Schema.LookupFields[i], ""] });
1846
+ // // added by Shahzaib, make int to string and concat
1847
+ // searchConcatArry.push({ "$ifNull": [{$toString : '$' + alias + '.' + field.Schema.LookupFields[i]}, ""] });
1848
+ // if (i < field.Schema.LookupFields.length - 1) {
1849
+ // searchConcatArry.push(" ");
1850
+ // }
1851
+ // };
1852
+ // project[fldName + '_SearchValue'] = { $concat: searchConcatArry };
1853
+ // break;
1854
+ // case "multilookup":
1855
+ // alias = fldName + constants.LookupAlias;
1856
+ // project[fldName] = 1;
1857
+ // project[alias] = 1;
1858
+ // for (let i = 0; i < field.Schema.LookupFields.length; i++) {
1859
+ // searchConcatArry.push({ "$ifNull": ['$' + alias + '.' + field.Schema.LookupFields[i], [" "]] });
1860
+ // if (i < field.Schema.LookupFields.length - 1) {
1861
+ // searchConcatArry.push([" "]);
1862
+ // }
1863
+ // };
1864
+ // //project[fldName + '_SearchValue'] = { $concatArrays: searchConcatArry };
1865
+ // project[fldName + '_SearchValue'] = {
1866
+ // $reduce: {
1867
+ // input: { $concatArrays: searchConcatArry },
1868
+ // initialValue: "",
1869
+ // //in: { $concat: ["$$value", "$$this"] } // Commented by and below line was added by Shahzaib, make int to string
1870
+ // in: { $concat: ["$$value", { $toString : "$$this" }] }
1871
+ // }
1872
+ // };
1873
+ // break;
1816
1874
  case "dropdown":
1817
1875
  alias = fldName + constants_1.default.LookupAlias;
1818
1876
  project[fldName] = 1;
@@ -3991,12 +4049,12 @@ exports.GetDayIndex = GetDayIndex;
3991
4049
  function GetUserProfile(msp_d, db, mdb, next) {
3992
4050
  var _a;
3993
4051
  return __awaiter(this, void 0, void 0, function () {
3994
- var userData, userProfile_1, error_3, objectIDs_1, modules_1, licenceDetail, moduleList, _loop_17, i, error_4;
4052
+ var userData, userProfile_1, error_3, objectIDs_1, modules_1, licenceDetail, companylicenceDetail, receptionLicense, moduleList, _loop_17, i, error_4;
3995
4053
  return __generator(this, function (_b) {
3996
4054
  switch (_b.label) {
3997
4055
  case 0:
3998
- _b.trys.push([0, 10, , 11]);
3999
- return [4 /*yield*/, db.collection("User").findOne({ '_id': new mongodb_1.ObjectId(msp_d.ui), IsActive: true }, { projection: { 'LicenceDetail': 1 } })];
4056
+ _b.trys.push([0, 12, , 13]);
4057
+ return [4 /*yield*/, db.collection("User").findOne({ '_id': new mongodb_1.ObjectId(msp_d.ui), IsActive: true }, { projection: { 'LicenceDetail': 1, 'CompanyID': 1 } })];
4000
4058
  case 1:
4001
4059
  userData = _b.sent();
4002
4060
  if (!userData) {
@@ -4035,7 +4093,7 @@ function GetUserProfile(msp_d, db, mdb, next) {
4035
4093
  if (!(!userProfile_1 || userProfile_1.length <= 0)) return [3 /*break*/, 6];
4036
4094
  return [2 /*return*/, { statusCode: 500, message: "User's profile data not found.", data: {} }];
4037
4095
  case 6:
4038
- if (!(userData.LicenceDetail && userData.LicenceDetail.length > 0)) return [3 /*break*/, 8];
4096
+ if (!(userData.LicenceDetail && userData.LicenceDetail.length > 0)) return [3 /*break*/, 10];
4039
4097
  objectIDs_1 = [];
4040
4098
  userData.LicenceDetail.forEach(function (licenceDetail) {
4041
4099
  if (licenceDetail.Status == "active")
@@ -4045,6 +4103,22 @@ function GetUserProfile(msp_d, db, mdb, next) {
4045
4103
  return [4 /*yield*/, mdb.collection("Licences").find({ '_id': { $in: objectIDs_1 }, 'Status': 'active', 'IsActive': true }).toArray()];
4046
4104
  case 7:
4047
4105
  licenceDetail = _b.sent();
4106
+ if (!(userData && userData.CompanyID)) return [3 /*break*/, 9];
4107
+ return [4 /*yield*/, mdb.collection("CompanyLicence").find({ 'CompanyID': userData.CompanyID, 'Status': 'active', 'IsActive': true }).toArray()];
4108
+ case 8:
4109
+ companylicenceDetail = _b.sent();
4110
+ if (companylicenceDetail && companylicenceDetail.length > 0) {
4111
+ receptionLicense = companylicenceDetail.find(function (licence) { return licence.LicenceName === "Reception" && licence.LicenceType === "App"; });
4112
+ if (receptionLicense) {
4113
+ licenceDetail.push({
4114
+ "Modules": [
4115
+ "reception"
4116
+ ]
4117
+ });
4118
+ }
4119
+ }
4120
+ _b.label = 9;
4121
+ case 9:
4048
4122
  if (licenceDetail && licenceDetail.length > 0) {
4049
4123
  licenceDetail.forEach(function (licence) {
4050
4124
  modules_1 = modules_1.concat(licence.Modules);
@@ -4073,15 +4147,15 @@ function GetUserProfile(msp_d, db, mdb, next) {
4073
4147
  else {
4074
4148
  return [2 /*return*/, { statusCode: 200, message: "Licence data is not found in Master database.", data: {} }];
4075
4149
  }
4076
- return [3 /*break*/, 9];
4077
- case 8: return [2 /*return*/, { statusCode: 200, message: "There is no licence assigned to this user, please contact your administrator.", data: {} }];
4078
- case 9: return [3 /*break*/, 11];
4079
- case 10:
4150
+ return [3 /*break*/, 11];
4151
+ case 10: return [2 /*return*/, { statusCode: 200, message: "There is no licence assigned to this user, please contact your administrator.", data: {} }];
4152
+ case 11: return [3 /*break*/, 13];
4153
+ case 12:
4080
4154
  error_4 = _b.sent();
4081
4155
  console.error("Internal Error in GetUserProfile Utility function : " + error_4);
4082
4156
  next(error_4);
4083
- return [3 /*break*/, 11];
4084
- case 11: return [2 /*return*/];
4157
+ return [3 /*break*/, 13];
4158
+ case 13: return [2 /*return*/];
4085
4159
  }
4086
4160
  });
4087
4161
  });
@@ -4419,9 +4493,10 @@ exports.GetMailFromString = GetMailFromString;
4419
4493
  /**
4420
4494
  * TODO: Return On behalf String in Calendar Invitation mails
4421
4495
  * @param fromUser From User Name
4496
+ * @param fromEmail From User Email
4422
4497
  * @returns string
4423
4498
  */
4424
- function InvitationMailReplyContent(fromUser) {
4425
- return "Please do not 'reply' to this email as it is an automated message and replies are routed to an unmonitored mailbox. If you wish to propose an alternative time, or send a message, please contact " + fromUser + " directly.";
4499
+ function InvitationMailReplyContent(fromUser, fromEmail) {
4500
+ return "Please do not 'reply' to this email as it is an automated message and replies are routed to an unmonitored mailbox. If you wish to propose an alternative time, or send a message, please contact " + fromUser + " at " + fromEmail + " directly.";
4426
4501
  }
4427
4502
  exports.InvitationMailReplyContent = InvitationMailReplyContent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optimiser/common",
3
- "version": "1.0.282",
3
+ "version": "1.0.285",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {