@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.
- package/dist/lib/utility.js +14 -9
- package/package.json +1 -1
package/dist/lib/utility.js
CHANGED
|
@@ -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
|
|
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
|
-
|
|
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,
|
|
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('
|
|
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*/,
|
|
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
|
|
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
|
-
|
|
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:
|