@optimiser/common 1.0.354 → 1.0.356

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.
@@ -2866,6 +2866,8 @@ function SyncUserDetailsWithMasterDB(userData, callback, dbMaster) {
2866
2866
  updateQuery.FirstName = userData.FirstName;
2867
2867
  updateQuery.LastName = userData.LastName;
2868
2868
  updateQuery.Email = userData.Email;
2869
+ //QPC-7971: to sync username in master db
2870
+ updateQuery.UserName = userData.UserName;
2869
2871
  updateQuery.UserStatus = userData.UserStatus;
2870
2872
  updateQuery.UserProfileID = userData.UserProfileID;
2871
2873
  updateQuery.Timezone = userData.Timezone;
@@ -3328,11 +3330,12 @@ function SendResetPasswordMail(db, userDetails, type) {
3328
3330
  mailObj.to = Email;
3329
3331
  if (type == "forgotPass") {
3330
3332
  mailObj.subject = constants_1.default.ProjectName + " password reset request";
3331
- mailObj.html = MailTemplateStructure("<p style=\"margin-top: 1em;\">Hello " + FirstName + ",</p>\n <p>We have received a request to reset your Optimiser password. Please click on the link below to reset your password.</p>\n <br>\n <p style=\"word-break: break-all;\">\n <a href='" + constants_1.default.ProjectDomain + "/user/noauth/setpassword/" + hash + "'>" + constants_1.default.ProjectDomain + "/user/noauth/setpassword/" + hash + "</a>\n </p>\n <br>\n <p>If you do not wish to reset your password, please ignore this email.</p>");
3333
+ mailObj.html = MailTemplateStructure("<p style=\"margin-top: 1em;\">Hello " + FirstName + ",</p>\n <p>We have received a request to reset your Optimiser password. Please click on the link below to reset your password.</p>\n <br>\n <p style=\"word-break: break-all;\">\n <a href='" + constants_1.default.ProjectDomain + "?page=SetPassword&uid=" + hash + "'>" + constants_1.default.ProjectDomain + "?page=SetPassword&uid=" + hash + "</a>\n </p>\n <br>\n <p>If you do not wish to reset your password, please ignore this email.</p>");
3332
3334
  }
3333
3335
  else {
3334
3336
  mailObj.subject = "Welcome to " + constants_1.default.ProjectName + ": Please activate your account";
3335
- mailObj.html = "<br/><body style='background-color: #eee;'>\n <table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" style=\"background:#eee;\">\n <tr>\n <td align=\"center\" valign=\"top\">\n <table width=\"650\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" style=\"background:#fff;\">\n <tr>\n <td align=\"left\" valign=\"top\" bgcolor=\"#ffffff\" style=\"padding-top:16px; padding-bottom:12px; padding-left: 20px; padding-right: 20px; background-color: #fff; border-bottom: 1px solid #dee2e6;\">\n <img src=\"" + constants_1.default.ProjectDomain + "/images/MainLogo.png\" alt=\"Optimiser\"/>\n </td>\n </tr>\n <tr>\n <td align=\"center\" valign=\"top\" bgcolor=\"#fff\" style=\"background-color: #fff; text-align: left; padding-right: 20px; padding-left: 20px; font-size:16px; font-family:Arial, Helvetica, sans-serif; color:#000000;\">\n <p style=\"margin-top: 1em;\">Hello " + FirstName + ",</p>\n <p>Congratulations! We are pleased to advise that your user profile has been created and is ready to use. Just click on the link below to set up your password then you\u2019ll be ready to go.</p>\n <br>\n <p style=\"word-break: break-all;\">\n <a href='" + constants_1.default.ProjectDomain + "/user/noauth/setpassword/" + hash + "'>" + constants_1.default.ProjectDomain + "/user/noauth/setpassword/" + hash + "</a>\n </p>\n <br>\n <p>We hope that you enjoy your Optimiser platform; if you ever require assistance, our Support Team will be happy to help.</p>\n <p>Email : <a href=\"mailto:support@optimiser.com\">support@optimiser.com</a>, Phone : +44 (0)203 972 1666</p>\n <br>\n <p style=\"margin-bottom: 1em;\">\n Kind regards,<br>\n " + constants_1.default.ProjectName + " team\n </p>\n </td>\n </tr>\n <tr>\n <td align=\"center\" valign=\"top\" bgcolor=\"#075DA8\" style=\" border-top: 1px solid #dee2e6; background-color: #075DA8 ;\">\n <p style=\"font-size:13px; font-family:Arial, Helvetica, sans-serif; color:#fff; margin:1.8em; font-weight:normal;\">\n <a href=\"https://www.optimiser.com/\" style=\"color:#fff; text-decoration:underline; \">www.optimiser.com</a> | <a href=\"mailto:support@optimiser.com\" style=\"color:#fff; text-decoration:underline; \">support@optimiser.com</a> | \n +44 (0)203 972 1666\n </p>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n </table>\n </body>";
3337
+ //QPC-7971: called MailTemplateStructure for email body. and updated the link
3338
+ mailObj.html = MailTemplateStructure("<p style=\"margin-top: 1em;\">Hello " + FirstName + ",</p>\n <p>Congratulations! We are pleased to advise that your user profile has been created and is ready to use. Just click on the link below to set up your password then you\u2019ll be ready to go.</p>\n <br>\n <p style=\"word-break: break-all;\">\n <a href='" + constants_1.default.ProjectDomain + "?page=SetPassword&uid=" + hash + "'>" + constants_1.default.ProjectDomain + "?page=SetPassword&uid=" + hash + "</a>\n </p>\n <br>\n <p>We hope that you enjoy your Optimiser platform; if you ever require assistance, our Support Team will be happy to help.</p>\n <p>Email : <a href=\"mailto:support@optimiser.com\">support@optimiser.com</a>, Phone : +44 (0)203 972 1666</p>\n <br>");
3336
3339
  }
3337
3340
  return [2 /*return*/, new Promise(function (resolve, reject) {
3338
3341
  mail_1.SendMail(mailObj).then(function (status) {
@@ -5521,26 +5524,28 @@ exports.GetFileFolderDetailsInFolderForDriveSharing = GetFileFolderDetailsInFold
5521
5524
  */
5522
5525
  function SyncTotalSlotRemaining(registrationID, db) {
5523
5526
  return __awaiter(this, void 0, void 0, function () {
5524
- var registrationData, totalDelegates, maximumRegistration, eventSchema, regDelegates_1, includeGuestInRegCount, registeredDelegates, remainingSlots;
5527
+ var eventSchema, registrationData, totalDelegates, maximumRegistration, regDelegates_1, includeGuestInRegCount, registeredDelegates, remainingSlots;
5525
5528
  return __generator(this, function (_a) {
5526
5529
  switch (_a.label) {
5527
5530
  case 0:
5528
5531
  if (!registrationID) return [3 /*break*/, 7];
5529
- return [4 /*yield*/, db.collection('EventRegistration').findOne({ '_id': registrationID, 'IsActive': true })];
5532
+ return [4 /*yield*/, db.collection('ObjectSchema').findOne({ Name: "EventRegistration" })];
5530
5533
  case 1:
5534
+ eventSchema = _a.sent();
5535
+ if (!(eventSchema.TotalSlotSyncingIn != 'Custom')) return [3 /*break*/, 7];
5536
+ return [4 /*yield*/, db.collection('EventRegistration').findOne({ '_id': registrationID, 'IsActive': true })];
5537
+ case 2:
5531
5538
  registrationData = _a.sent();
5532
5539
  if (!registrationData) return [3 /*break*/, 7];
5533
5540
  totalDelegates = 0;
5534
5541
  maximumRegistration = registrationData.MaximumRegistration;
5535
- if (!(maximumRegistration == undefined)) return [3 /*break*/, 3];
5542
+ if (!(maximumRegistration == undefined)) return [3 /*break*/, 4];
5536
5543
  return [4 /*yield*/, db.collection('EventRegistration').updateOne({ '_id': registrationID, 'IsActive': true }, { $set: { 'TotalSlotRemaining': null } })];
5537
- case 2:
5544
+ case 3:
5538
5545
  _a.sent();
5539
5546
  return [3 /*break*/, 7];
5540
- case 3: return [4 /*yield*/, db.collection('ObjectSchema').findOne({ Name: "EventRegistration" })];
5541
5547
  case 4:
5542
- eventSchema = _a.sent();
5543
- regDelegates_1 = (eventSchema === null || eventSchema === void 0 ? void 0 : eventSchema.RegisteredDelegates) || [];
5548
+ regDelegates_1 = eventSchema.RegisteredDelegates || [];
5544
5549
  includeGuestInRegCount = registrationData.IncludeGuestInRegCount;
5545
5550
  return [4 /*yield*/, db.collection('EventDelegate').find({ 'EventID': registrationData.EventID, 'RegistrationType': registrationID, 'IsActive': true }).toArray()];
5546
5551
  case 5:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optimiser/common",
3
- "version": "1.0.354",
3
+ "version": "1.0.356",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {