@optimiser/common 1.0.355 → 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 +9 -7
- package/package.json +1 -1
package/dist/lib/utility.js
CHANGED
|
@@ -5524,26 +5524,28 @@ exports.GetFileFolderDetailsInFolderForDriveSharing = GetFileFolderDetailsInFold
|
|
|
5524
5524
|
*/
|
|
5525
5525
|
function SyncTotalSlotRemaining(registrationID, db) {
|
|
5526
5526
|
return __awaiter(this, void 0, void 0, function () {
|
|
5527
|
-
var registrationData, totalDelegates, maximumRegistration,
|
|
5527
|
+
var eventSchema, registrationData, totalDelegates, maximumRegistration, regDelegates_1, includeGuestInRegCount, registeredDelegates, remainingSlots;
|
|
5528
5528
|
return __generator(this, function (_a) {
|
|
5529
5529
|
switch (_a.label) {
|
|
5530
5530
|
case 0:
|
|
5531
5531
|
if (!registrationID) return [3 /*break*/, 7];
|
|
5532
|
-
return [4 /*yield*/, db.collection('
|
|
5532
|
+
return [4 /*yield*/, db.collection('ObjectSchema').findOne({ Name: "EventRegistration" })];
|
|
5533
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:
|
|
5534
5538
|
registrationData = _a.sent();
|
|
5535
5539
|
if (!registrationData) return [3 /*break*/, 7];
|
|
5536
5540
|
totalDelegates = 0;
|
|
5537
5541
|
maximumRegistration = registrationData.MaximumRegistration;
|
|
5538
|
-
if (!(maximumRegistration == undefined)) return [3 /*break*/,
|
|
5542
|
+
if (!(maximumRegistration == undefined)) return [3 /*break*/, 4];
|
|
5539
5543
|
return [4 /*yield*/, db.collection('EventRegistration').updateOne({ '_id': registrationID, 'IsActive': true }, { $set: { 'TotalSlotRemaining': null } })];
|
|
5540
|
-
case
|
|
5544
|
+
case 3:
|
|
5541
5545
|
_a.sent();
|
|
5542
5546
|
return [3 /*break*/, 7];
|
|
5543
|
-
case 3: return [4 /*yield*/, db.collection('ObjectSchema').findOne({ Name: "EventRegistration" })];
|
|
5544
5547
|
case 4:
|
|
5545
|
-
|
|
5546
|
-
regDelegates_1 = (eventSchema === null || eventSchema === void 0 ? void 0 : eventSchema.RegisteredDelegates) || [];
|
|
5548
|
+
regDelegates_1 = eventSchema.RegisteredDelegates || [];
|
|
5547
5549
|
includeGuestInRegCount = registrationData.IncludeGuestInRegCount;
|
|
5548
5550
|
return [4 /*yield*/, db.collection('EventDelegate').find({ 'EventID': registrationData.EventID, 'RegistrationType': registrationID, 'IsActive': true }).toArray()];
|
|
5549
5551
|
case 5:
|