@timardex/cluemart-server-shared 4.0.1 → 4.0.3
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/{chunk-J7ZINA3I.mjs → chunk-3ICI65FJ.mjs} +350 -242
- package/dist/chunk-3ICI65FJ.mjs.map +1 -0
- package/dist/index.cjs +540 -432
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +92 -10
- package/dist/index.d.ts +92 -10
- package/dist/index.mjs +356 -248
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs +410 -302
- package/dist/mongoose/index.cjs.map +1 -1
- package/dist/mongoose/index.d.mts +88 -7
- package/dist/mongoose/index.d.ts +88 -7
- package/dist/mongoose/index.mjs +9 -3
- package/dist/service/index.cjs +529 -428
- package/dist/service/index.cjs.map +1 -1
- package/dist/service/index.d.mts +4 -3
- package/dist/service/index.d.ts +4 -3
- package/dist/service/index.mjs +1 -1
- package/dist/service/index.mjs.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-J7ZINA3I.mjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -32,6 +32,7 @@ var index_exports = {};
|
|
|
32
32
|
__export(index_exports, {
|
|
33
33
|
ACTIVE_NOT_DELETED_FILTER: () => ACTIVE_NOT_DELETED_FILTER,
|
|
34
34
|
AD_BILLING_CATALOG_COLLECTION_NAME: () => AD_BILLING_CATALOG_COLLECTION_NAME,
|
|
35
|
+
AI_IMPORT_RUN_LOCK_KEY: () => AI_IMPORT_RUN_LOCK_KEY,
|
|
35
36
|
APP_SETTINGS_ID: () => APP_SETTINGS_ID,
|
|
36
37
|
AdBillingCatalogModel: () => AdBillingCatalogModel,
|
|
37
38
|
AdBookingModel: () => AdBookingModel,
|
|
@@ -39,6 +40,8 @@ __export(index_exports, {
|
|
|
39
40
|
AdModel: () => AdModel,
|
|
40
41
|
AdPurchaseModel: () => AdPurchaseModel,
|
|
41
42
|
AffiliateModel: () => AffiliateModel,
|
|
43
|
+
AiImportRunLockModel: () => AiImportRunLockModel,
|
|
44
|
+
AiImportRunModel: () => AiImportRunModel,
|
|
42
45
|
AiImportedMarketModel: () => AiImportedMarketModel,
|
|
43
46
|
AppSettingModel: () => AppSettingModel,
|
|
44
47
|
AuthHandoffTokenModel: () => AuthHandoffTokenModel,
|
|
@@ -69,7 +72,7 @@ __export(index_exports, {
|
|
|
69
72
|
RelationTypeSchema: () => RelationTypeSchema,
|
|
70
73
|
ResourceActivityModel: () => ResourceActivityModel,
|
|
71
74
|
ResourceImageTypeSchema: () => ResourceImageTypeSchema,
|
|
72
|
-
|
|
75
|
+
SCRAPE_SITES_CONFIG_ID: () => SCRAPE_SITES_CONFIG_ID,
|
|
73
76
|
SUBSCRIPTION_REWARD_TIMEZONE: () => SUBSCRIPTION_REWARD_TIMEZONE,
|
|
74
77
|
SchoolModel: () => SchoolModel,
|
|
75
78
|
ScrapeSiteConfigModel: () => ScrapeSiteConfigModel,
|
|
@@ -127,7 +130,7 @@ __export(index_exports, {
|
|
|
127
130
|
locationGeoSchema: () => locationGeoSchema,
|
|
128
131
|
locationsSchema: () => locationsSchema,
|
|
129
132
|
mapVendorLicenceToSubscriptionRewardType: () => mapVendorLicenceToSubscriptionRewardType,
|
|
130
|
-
mongoose: () =>
|
|
133
|
+
mongoose: () => import_mongoose43.default,
|
|
131
134
|
normalizeAffiliatePromoCodes: () => normalizeAffiliatePromoCodes,
|
|
132
135
|
normalizePromoCode: () => normalizePromoCode,
|
|
133
136
|
notifyUsers: () => notifyUsers,
|
|
@@ -156,7 +159,7 @@ __export(index_exports, {
|
|
|
156
159
|
updateAdStatuses: () => updateAdStatuses,
|
|
157
160
|
updateAllEventDateTimeStatuses: () => updateAllEventDateTimeStatuses,
|
|
158
161
|
updateRelationDatesToCanceled: () => updateRelationDatesToCanceled,
|
|
159
|
-
updateSingleDateTimeStatus: () =>
|
|
162
|
+
updateSingleDateTimeStatus: () => import_cluemart_shared38.updateSingleDateTimeStatus,
|
|
160
163
|
upgradeUserToLicence: () => upgradeUserToLicence,
|
|
161
164
|
userLicenseSchema: () => userLicenseSchema,
|
|
162
165
|
vendorOwnerHasProLicence: () => vendorOwnerHasProLicence,
|
|
@@ -1085,15 +1088,15 @@ function syncSearchNameInUpdate(update) {
|
|
|
1085
1088
|
}
|
|
1086
1089
|
return null;
|
|
1087
1090
|
}
|
|
1088
|
-
function searchNamePlugin(
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1091
|
+
function searchNamePlugin(schema29) {
|
|
1092
|
+
schema29.add({ searchName: { default: "", required: false, type: String } });
|
|
1093
|
+
schema29.index({ searchName: 1 });
|
|
1094
|
+
schema29.pre("save", function syncSearchNameOnSave(next) {
|
|
1092
1095
|
const doc = this;
|
|
1093
1096
|
doc.searchName = deriveSearchName(doc.name);
|
|
1094
1097
|
next();
|
|
1095
1098
|
});
|
|
1096
|
-
|
|
1099
|
+
schema29.pre("insertMany", function syncSearchNameOnInsertMany(next, docs) {
|
|
1097
1100
|
const list = Array.isArray(docs) ? docs : [docs];
|
|
1098
1101
|
for (const doc of list) {
|
|
1099
1102
|
if (doc && typeof doc.name === "string") {
|
|
@@ -1102,7 +1105,7 @@ function searchNamePlugin(schema27) {
|
|
|
1102
1105
|
}
|
|
1103
1106
|
next();
|
|
1104
1107
|
});
|
|
1105
|
-
|
|
1108
|
+
schema29.pre("bulkWrite", function syncSearchNameOnBulkWrite(next, ops) {
|
|
1106
1109
|
for (const op of ops) {
|
|
1107
1110
|
const doc = op.insertOne?.document ?? op.replaceOne?.replacement;
|
|
1108
1111
|
if (doc && typeof doc.name === "string") {
|
|
@@ -1128,7 +1131,7 @@ function searchNamePlugin(schema27) {
|
|
|
1128
1131
|
}
|
|
1129
1132
|
next();
|
|
1130
1133
|
};
|
|
1131
|
-
|
|
1134
|
+
schema29.pre(
|
|
1132
1135
|
["findOneAndUpdate", "updateOne", "updateMany"],
|
|
1133
1136
|
syncSearchNameOnUpdate
|
|
1134
1137
|
);
|
|
@@ -1244,8 +1247,15 @@ var schema8 = new MongooseSchema7(
|
|
|
1244
1247
|
type: ResourceImageTypeSchema
|
|
1245
1248
|
},
|
|
1246
1249
|
dateTime: [dateTimeSchema],
|
|
1250
|
+
deactivatedReason: {
|
|
1251
|
+
enum: Object.values(import_cluemart_shared10.EnumImportedMarketDeactivationReason),
|
|
1252
|
+
required: false,
|
|
1253
|
+
type: String
|
|
1254
|
+
},
|
|
1247
1255
|
deletedAt: { default: null, required: false, type: Date },
|
|
1248
1256
|
description: { required: true, type: String },
|
|
1257
|
+
descriptionSourceHash: { required: false, type: String },
|
|
1258
|
+
duplicateHint: { required: false, type: String },
|
|
1249
1259
|
earliestStartDate: { default: null, required: false, type: Date },
|
|
1250
1260
|
eventId: {
|
|
1251
1261
|
ref: "Event",
|
|
@@ -1258,11 +1268,13 @@ var schema8 = new MongooseSchema7(
|
|
|
1258
1268
|
type: String
|
|
1259
1269
|
},
|
|
1260
1270
|
images: { required: false, type: [ResourceImageTypeSchema] },
|
|
1271
|
+
lastSeenAt: { default: null, required: false, type: Date },
|
|
1261
1272
|
location: {
|
|
1262
1273
|
required: true,
|
|
1263
1274
|
type: locationsSchema
|
|
1264
1275
|
},
|
|
1265
1276
|
logo: { required: false, type: ResourceImageTypeSchema },
|
|
1277
|
+
missedRuns: { default: 0, required: true, type: Number },
|
|
1266
1278
|
name: { required: true, type: String },
|
|
1267
1279
|
openingHours: { required: false, type: [String] },
|
|
1268
1280
|
rainOrShine: { required: true, type: Boolean },
|
|
@@ -1292,6 +1304,7 @@ var schema8 = new MongooseSchema7(
|
|
|
1292
1304
|
},
|
|
1293
1305
|
sourceName: { required: true, type: String },
|
|
1294
1306
|
sourceUrl: { required: true, type: String },
|
|
1307
|
+
tags: { required: false, type: [String] },
|
|
1295
1308
|
website: { required: false, type: String }
|
|
1296
1309
|
},
|
|
1297
1310
|
{ timestamps: true }
|
|
@@ -1302,19 +1315,106 @@ schema8.index({ region: 1 });
|
|
|
1302
1315
|
schema8.index({ deletedAt: 1 });
|
|
1303
1316
|
schema8.index({ "dateTime.dateStatus": 1 });
|
|
1304
1317
|
schema8.index({ earliestStartDate: 1, _id: 1 });
|
|
1318
|
+
schema8.index({ reviewStatus: 1, active: 1, earliestStartDate: 1, _id: 1 });
|
|
1319
|
+
schema8.index({
|
|
1320
|
+
region: 1,
|
|
1321
|
+
reviewStatus: 1,
|
|
1322
|
+
active: 1,
|
|
1323
|
+
earliestStartDate: 1,
|
|
1324
|
+
_id: 1
|
|
1325
|
+
});
|
|
1326
|
+
schema8.index({ region: 1, searchName: 1 });
|
|
1305
1327
|
schema8.index({ slug: 1 });
|
|
1306
1328
|
schema8.index({ reviewStatus: 1 });
|
|
1307
1329
|
schema8.index({ description: "text", name: "text" });
|
|
1308
1330
|
schema8.plugin(searchNamePlugin);
|
|
1309
1331
|
var AiImportedMarketModel = import_mongoose11.default.models.AiImportedMarket || import_mongoose11.default.model("AiImportedMarket", schema8);
|
|
1310
1332
|
|
|
1311
|
-
// src/mongoose/
|
|
1333
|
+
// src/mongoose/AiImportRun.ts
|
|
1334
|
+
var import_cluemart_shared11 = require("@timardex/cluemart-shared");
|
|
1312
1335
|
var import_mongoose12 = __toESM(require("mongoose"));
|
|
1313
|
-
var SCRAPE_SITES_CONFIG_KEY = "scrapeSites";
|
|
1314
1336
|
var MongooseSchema8 = import_mongoose12.default.Schema;
|
|
1315
|
-
var
|
|
1337
|
+
var usageSchema = new MongooseSchema8(
|
|
1338
|
+
{
|
|
1339
|
+
completionTokens: { default: 0, required: true, type: Number },
|
|
1340
|
+
promptTokens: { default: 0, required: true, type: Number },
|
|
1341
|
+
totalTokens: { default: 0, required: true, type: Number }
|
|
1342
|
+
},
|
|
1343
|
+
{ _id: false }
|
|
1344
|
+
);
|
|
1345
|
+
var siteResultSchema = new MongooseSchema8(
|
|
1346
|
+
{
|
|
1347
|
+
errors: { default: 0, required: true, type: Number },
|
|
1348
|
+
found: { default: 0, required: true, type: Number },
|
|
1349
|
+
imported: { default: 0, required: true, type: Number },
|
|
1350
|
+
name: { required: true, type: String },
|
|
1351
|
+
skipped: { default: 0, required: true, type: Number },
|
|
1352
|
+
status: {
|
|
1353
|
+
enum: [import_cluemart_shared11.EnumAiImportRunStatus.SUCCESS, import_cluemart_shared11.EnumAiImportRunStatus.ERROR],
|
|
1354
|
+
required: true,
|
|
1355
|
+
type: String
|
|
1356
|
+
},
|
|
1357
|
+
url: { required: true, type: String },
|
|
1358
|
+
usage: { required: true, type: usageSchema }
|
|
1359
|
+
},
|
|
1360
|
+
{ _id: false, suppressReservedKeysWarning: true }
|
|
1361
|
+
);
|
|
1362
|
+
var resultSchema = new MongooseSchema8(
|
|
1363
|
+
{
|
|
1364
|
+
errors: { default: 0, required: true, type: Number },
|
|
1365
|
+
totalFound: { default: 0, required: true, type: Number },
|
|
1366
|
+
totalImported: { default: 0, required: true, type: Number },
|
|
1367
|
+
totalSkipped: { default: 0, required: true, type: Number }
|
|
1368
|
+
},
|
|
1369
|
+
{ _id: false, suppressReservedKeysWarning: true }
|
|
1370
|
+
);
|
|
1371
|
+
var schema9 = new MongooseSchema8(
|
|
1372
|
+
{
|
|
1373
|
+
error: { required: false, type: String },
|
|
1374
|
+
finishedAt: { required: false, type: Date },
|
|
1375
|
+
result: { required: false, type: resultSchema },
|
|
1376
|
+
siteResults: { default: [], required: true, type: [siteResultSchema] },
|
|
1377
|
+
startedAt: { default: () => /* @__PURE__ */ new Date(), required: true, type: Date },
|
|
1378
|
+
status: {
|
|
1379
|
+
default: import_cluemart_shared11.EnumAiImportRunStatus.PENDING,
|
|
1380
|
+
enum: Object.values(import_cluemart_shared11.EnumAiImportRunStatus),
|
|
1381
|
+
required: true,
|
|
1382
|
+
type: String
|
|
1383
|
+
},
|
|
1384
|
+
triggeredByUserId: {
|
|
1385
|
+
ref: "User",
|
|
1386
|
+
required: false,
|
|
1387
|
+
type: import_mongoose12.default.Schema.Types.ObjectId
|
|
1388
|
+
},
|
|
1389
|
+
usage: { required: false, type: usageSchema }
|
|
1390
|
+
},
|
|
1391
|
+
{ timestamps: true }
|
|
1392
|
+
);
|
|
1393
|
+
schema9.index({ createdAt: -1 });
|
|
1394
|
+
var AiImportRunModel = import_mongoose12.default.models.AiImportRun || import_mongoose12.default.model("AiImportRun", schema9);
|
|
1395
|
+
|
|
1396
|
+
// src/mongoose/AiImportRunLock.ts
|
|
1397
|
+
var import_mongoose13 = __toESM(require("mongoose"));
|
|
1398
|
+
var AI_IMPORT_RUN_LOCK_KEY = "ai-import-run";
|
|
1399
|
+
var MongooseSchema9 = import_mongoose13.default.Schema;
|
|
1400
|
+
var schema10 = new MongooseSchema9(
|
|
1401
|
+
{
|
|
1402
|
+
_id: { required: true, type: String },
|
|
1403
|
+
lockedAt: { required: false, type: Date },
|
|
1404
|
+
token: { required: false, type: String }
|
|
1405
|
+
},
|
|
1406
|
+
{ timestamps: true }
|
|
1407
|
+
);
|
|
1408
|
+
var AiImportRunLockModel = import_mongoose13.default.models.AiImportRunLock || import_mongoose13.default.model("AiImportRunLock", schema10);
|
|
1409
|
+
|
|
1410
|
+
// src/mongoose/ScrapeSite.ts
|
|
1411
|
+
var import_mongoose14 = __toESM(require("mongoose"));
|
|
1412
|
+
var SCRAPE_SITES_CONFIG_ID = "scrapeSites";
|
|
1413
|
+
var MongooseSchema10 = import_mongoose14.default.Schema;
|
|
1414
|
+
var scrapeSiteItemSchema = new MongooseSchema10(
|
|
1316
1415
|
{
|
|
1317
1416
|
enabled: { default: true, required: true, type: Boolean },
|
|
1417
|
+
lastCount: { required: false, type: Number },
|
|
1318
1418
|
lastError: { required: false, type: String },
|
|
1319
1419
|
lastScrapedAt: { required: false, type: Date },
|
|
1320
1420
|
lastScrapeStatus: { required: false, type: String },
|
|
@@ -1324,36 +1424,41 @@ var scrapeSiteItemSchema = new MongooseSchema8(
|
|
|
1324
1424
|
},
|
|
1325
1425
|
{ timestamps: true }
|
|
1326
1426
|
);
|
|
1327
|
-
var configSchema = new
|
|
1427
|
+
var configSchema = new MongooseSchema10(
|
|
1328
1428
|
{
|
|
1329
|
-
|
|
1429
|
+
_id: { required: true, type: String },
|
|
1330
1430
|
sites: {
|
|
1331
1431
|
default: [],
|
|
1332
1432
|
required: true,
|
|
1333
1433
|
type: [scrapeSiteItemSchema]
|
|
1434
|
+
},
|
|
1435
|
+
updatedByUserId: {
|
|
1436
|
+
ref: "User",
|
|
1437
|
+
required: false,
|
|
1438
|
+
type: import_mongoose14.default.Schema.Types.ObjectId
|
|
1334
1439
|
}
|
|
1335
1440
|
},
|
|
1336
1441
|
{ timestamps: true }
|
|
1337
1442
|
);
|
|
1338
|
-
var ScrapeSiteConfigModel =
|
|
1443
|
+
var ScrapeSiteConfigModel = import_mongoose14.default.models.ScrapeSiteConfig || import_mongoose14.default.model("ScrapeSiteConfig", configSchema);
|
|
1339
1444
|
|
|
1340
1445
|
// src/mongoose/Notification.ts
|
|
1341
|
-
var
|
|
1342
|
-
var
|
|
1343
|
-
var
|
|
1344
|
-
var notificationDataSchema = new
|
|
1446
|
+
var import_cluemart_shared12 = require("@timardex/cluemart-shared");
|
|
1447
|
+
var import_mongoose15 = __toESM(require("mongoose"));
|
|
1448
|
+
var MongooseSchema11 = import_mongoose15.default.Schema;
|
|
1449
|
+
var notificationDataSchema = new MongooseSchema11(
|
|
1345
1450
|
{
|
|
1346
1451
|
resourceId: { required: true, type: String },
|
|
1347
1452
|
resourceName: { required: true, type: String },
|
|
1348
1453
|
resourceType: {
|
|
1349
|
-
enum: Object.values(
|
|
1454
|
+
enum: Object.values(import_cluemart_shared12.EnumNotificationResourceType),
|
|
1350
1455
|
required: true,
|
|
1351
1456
|
type: String
|
|
1352
1457
|
}
|
|
1353
1458
|
},
|
|
1354
1459
|
{ _id: false }
|
|
1355
1460
|
);
|
|
1356
|
-
var
|
|
1461
|
+
var schema11 = new MongooseSchema11(
|
|
1357
1462
|
{
|
|
1358
1463
|
data: {
|
|
1359
1464
|
default: null,
|
|
@@ -1364,28 +1469,28 @@ var schema9 = new MongooseSchema9(
|
|
|
1364
1469
|
message: { required: true, type: String },
|
|
1365
1470
|
title: { required: true, type: String },
|
|
1366
1471
|
type: {
|
|
1367
|
-
default:
|
|
1368
|
-
enum: Object.values(
|
|
1472
|
+
default: import_cluemart_shared12.EnumNotificationType.SYSTEM,
|
|
1473
|
+
enum: Object.values(import_cluemart_shared12.EnumNotificationType),
|
|
1369
1474
|
required: true,
|
|
1370
1475
|
type: String
|
|
1371
1476
|
},
|
|
1372
1477
|
userId: {
|
|
1373
1478
|
ref: "User",
|
|
1374
1479
|
required: true,
|
|
1375
|
-
type:
|
|
1480
|
+
type: import_mongoose15.default.Schema.Types.ObjectId
|
|
1376
1481
|
}
|
|
1377
1482
|
},
|
|
1378
1483
|
{ timestamps: true }
|
|
1379
1484
|
);
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
var NotificationModel =
|
|
1485
|
+
schema11.index({ isRead: 1, userId: 1 });
|
|
1486
|
+
schema11.index({ createdAt: -1, userId: 1 });
|
|
1487
|
+
var NotificationModel = import_mongoose15.default.models.Notification || import_mongoose15.default.model("Notification", schema11);
|
|
1383
1488
|
|
|
1384
1489
|
// src/mongoose/PushToken.ts
|
|
1385
1490
|
var import_enums = require("@timardex/cluemart-shared/enums");
|
|
1386
|
-
var
|
|
1387
|
-
var
|
|
1388
|
-
var
|
|
1491
|
+
var import_mongoose16 = __toESM(require("mongoose"));
|
|
1492
|
+
var MongooseSchema12 = import_mongoose16.default.Schema;
|
|
1493
|
+
var schema12 = new MongooseSchema12(
|
|
1389
1494
|
{
|
|
1390
1495
|
platform: {
|
|
1391
1496
|
enum: Object.values(import_enums.EnumOSPlatform),
|
|
@@ -1396,22 +1501,22 @@ var schema10 = new MongooseSchema10(
|
|
|
1396
1501
|
userId: {
|
|
1397
1502
|
ref: "User",
|
|
1398
1503
|
required: true,
|
|
1399
|
-
type:
|
|
1504
|
+
type: import_mongoose16.default.Schema.Types.ObjectId
|
|
1400
1505
|
}
|
|
1401
1506
|
},
|
|
1402
1507
|
{ timestamps: true }
|
|
1403
1508
|
);
|
|
1404
|
-
var PushTokenModel =
|
|
1509
|
+
var PushTokenModel = import_mongoose16.default.models.PushToken || import_mongoose16.default.model("PushToken", schema12);
|
|
1405
1510
|
|
|
1406
1511
|
// src/mongoose/Relation.ts
|
|
1407
|
-
var
|
|
1408
|
-
var
|
|
1512
|
+
var import_cluemart_shared14 = require("@timardex/cluemart-shared");
|
|
1513
|
+
var import_mongoose18 = __toESM(require("mongoose"));
|
|
1409
1514
|
|
|
1410
1515
|
// src/mongoose/event/EventInfo.ts
|
|
1411
|
-
var
|
|
1412
|
-
var
|
|
1413
|
-
var
|
|
1414
|
-
var StallTypeSchema = new
|
|
1516
|
+
var import_cluemart_shared13 = require("@timardex/cluemart-shared");
|
|
1517
|
+
var import_mongoose17 = __toESM(require("mongoose"));
|
|
1518
|
+
var MongooseSchema13 = import_mongoose17.default.Schema;
|
|
1519
|
+
var StallTypeSchema = new MongooseSchema13(
|
|
1415
1520
|
{
|
|
1416
1521
|
label: { required: false, type: String },
|
|
1417
1522
|
price: { required: false, type: Number },
|
|
@@ -1422,10 +1527,10 @@ var StallTypeSchema = new MongooseSchema11(
|
|
|
1422
1527
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
1423
1528
|
}
|
|
1424
1529
|
);
|
|
1425
|
-
var dateTimeSchema2 = new
|
|
1530
|
+
var dateTimeSchema2 = new MongooseSchema13(
|
|
1426
1531
|
{
|
|
1427
1532
|
dateStatus: {
|
|
1428
|
-
enum: Object.values(
|
|
1533
|
+
enum: Object.values(import_cluemart_shared13.EnumEventDateStatus),
|
|
1429
1534
|
required: false,
|
|
1430
1535
|
type: String
|
|
1431
1536
|
},
|
|
@@ -1438,13 +1543,13 @@ var dateTimeSchema2 = new MongooseSchema11(
|
|
|
1438
1543
|
{ _id: false }
|
|
1439
1544
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
1440
1545
|
);
|
|
1441
|
-
var paymentInfoSchema = new
|
|
1546
|
+
var paymentInfoSchema = new MongooseSchema13(
|
|
1442
1547
|
{
|
|
1443
1548
|
accountHolderName: { required: false, type: String },
|
|
1444
1549
|
accountNumber: { required: false, type: String },
|
|
1445
1550
|
link: { required: false, type: String },
|
|
1446
1551
|
paymentMethod: {
|
|
1447
|
-
enum: Object.values(
|
|
1552
|
+
enum: Object.values(import_cluemart_shared13.EnumPaymentMethod),
|
|
1448
1553
|
required: true,
|
|
1449
1554
|
type: String
|
|
1450
1555
|
}
|
|
@@ -1452,7 +1557,7 @@ var paymentInfoSchema = new MongooseSchema11(
|
|
|
1452
1557
|
{ _id: false }
|
|
1453
1558
|
// Prevents Mongoose from creating an additional _id field
|
|
1454
1559
|
);
|
|
1455
|
-
var requirementsSchema = new
|
|
1560
|
+
var requirementsSchema = new MongooseSchema13(
|
|
1456
1561
|
{
|
|
1457
1562
|
category: { required: true, type: String },
|
|
1458
1563
|
label: { required: true, type: String },
|
|
@@ -1463,7 +1568,7 @@ var requirementsSchema = new MongooseSchema11(
|
|
|
1463
1568
|
// Prevents Mongoose from creating an additional _id field for
|
|
1464
1569
|
}
|
|
1465
1570
|
);
|
|
1466
|
-
var refundPolicySchema = new
|
|
1571
|
+
var refundPolicySchema = new MongooseSchema13(
|
|
1467
1572
|
{
|
|
1468
1573
|
category: { required: true, type: String },
|
|
1469
1574
|
label: { required: true, type: String },
|
|
@@ -1471,7 +1576,7 @@ var refundPolicySchema = new MongooseSchema11(
|
|
|
1471
1576
|
},
|
|
1472
1577
|
{ _id: false }
|
|
1473
1578
|
);
|
|
1474
|
-
var
|
|
1579
|
+
var schema13 = new MongooseSchema13(
|
|
1475
1580
|
{
|
|
1476
1581
|
active: { default: true, type: Boolean },
|
|
1477
1582
|
applicationDeadlineHours: { required: true, type: Number },
|
|
@@ -1479,7 +1584,7 @@ var schema11 = new MongooseSchema11(
|
|
|
1479
1584
|
eventId: {
|
|
1480
1585
|
ref: "Event",
|
|
1481
1586
|
required: true,
|
|
1482
|
-
type:
|
|
1587
|
+
type: import_mongoose17.default.Schema.Types.ObjectId
|
|
1483
1588
|
},
|
|
1484
1589
|
packInTime: { required: true, type: Number },
|
|
1485
1590
|
paymentDueHours: { required: true, type: Number },
|
|
@@ -1489,15 +1594,15 @@ var schema11 = new MongooseSchema11(
|
|
|
1489
1594
|
},
|
|
1490
1595
|
{ timestamps: true }
|
|
1491
1596
|
);
|
|
1492
|
-
|
|
1493
|
-
var EventInfoModel =
|
|
1597
|
+
schema13.index({ eventId: 1 });
|
|
1598
|
+
var EventInfoModel = import_mongoose17.default.models.EventInfo || import_mongoose17.default.model("EventInfo", schema13);
|
|
1494
1599
|
|
|
1495
1600
|
// src/mongoose/Relation.ts
|
|
1496
|
-
var
|
|
1497
|
-
var relationDateTimeSchema = new
|
|
1601
|
+
var MongooseSchema14 = import_mongoose18.default.Schema;
|
|
1602
|
+
var relationDateTimeSchema = new MongooseSchema14(
|
|
1498
1603
|
{
|
|
1499
1604
|
dateStatus: {
|
|
1500
|
-
enum: Object.values(
|
|
1605
|
+
enum: Object.values(import_cluemart_shared14.EnumEventDateStatus),
|
|
1501
1606
|
required: true,
|
|
1502
1607
|
type: String
|
|
1503
1608
|
},
|
|
@@ -1509,7 +1614,7 @@ var relationDateTimeSchema = new MongooseSchema12(
|
|
|
1509
1614
|
},
|
|
1510
1615
|
{ _id: false }
|
|
1511
1616
|
);
|
|
1512
|
-
var relationDatesSchema = new
|
|
1617
|
+
var relationDatesSchema = new MongooseSchema14(
|
|
1513
1618
|
{
|
|
1514
1619
|
dateTime: {
|
|
1515
1620
|
required: true,
|
|
@@ -1521,42 +1626,42 @@ var relationDatesSchema = new MongooseSchema12(
|
|
|
1521
1626
|
},
|
|
1522
1627
|
paymentReference: { required: false, type: String },
|
|
1523
1628
|
status: {
|
|
1524
|
-
enum: Object.values(
|
|
1629
|
+
enum: Object.values(import_cluemart_shared14.EnumInviteStatus),
|
|
1525
1630
|
required: false,
|
|
1526
1631
|
type: String
|
|
1527
1632
|
}
|
|
1528
1633
|
},
|
|
1529
1634
|
{ _id: false }
|
|
1530
1635
|
);
|
|
1531
|
-
var RelationTypeSchema = new
|
|
1636
|
+
var RelationTypeSchema = new MongooseSchema14(
|
|
1532
1637
|
{
|
|
1533
1638
|
active: { default: true, required: true, type: Boolean },
|
|
1534
1639
|
chatId: {
|
|
1535
1640
|
ref: "Chat",
|
|
1536
1641
|
required: true,
|
|
1537
|
-
type:
|
|
1642
|
+
type: import_mongoose18.default.Schema.Types.ObjectId
|
|
1538
1643
|
},
|
|
1539
1644
|
deletedAt: { default: null, required: false, type: Date },
|
|
1540
1645
|
eventId: {
|
|
1541
1646
|
ref: "Event",
|
|
1542
1647
|
required: true,
|
|
1543
|
-
type:
|
|
1648
|
+
type: import_mongoose18.default.Schema.Types.ObjectId
|
|
1544
1649
|
},
|
|
1545
1650
|
lastUpdateBy: {
|
|
1546
|
-
enum: Object.values(
|
|
1651
|
+
enum: Object.values(import_cluemart_shared14.EnumResourceType),
|
|
1547
1652
|
required: true,
|
|
1548
1653
|
type: String
|
|
1549
1654
|
},
|
|
1550
1655
|
relationDates: [relationDatesSchema],
|
|
1551
1656
|
relationType: {
|
|
1552
|
-
enum: Object.values(
|
|
1657
|
+
enum: Object.values(import_cluemart_shared14.EnumRelationResource),
|
|
1553
1658
|
required: true,
|
|
1554
1659
|
type: String
|
|
1555
1660
|
},
|
|
1556
1661
|
vendorId: {
|
|
1557
1662
|
ref: "Vendor",
|
|
1558
1663
|
required: true,
|
|
1559
|
-
type:
|
|
1664
|
+
type: import_mongoose18.default.Schema.Types.ObjectId
|
|
1560
1665
|
}
|
|
1561
1666
|
},
|
|
1562
1667
|
{ timestamps: true }
|
|
@@ -1568,21 +1673,21 @@ RelationTypeSchema.index({
|
|
|
1568
1673
|
"relationDates.status": 1,
|
|
1569
1674
|
vendorId: 1
|
|
1570
1675
|
});
|
|
1571
|
-
var RelationModel =
|
|
1676
|
+
var RelationModel = import_mongoose18.default.models.Relation || import_mongoose18.default.model("Relation", RelationTypeSchema);
|
|
1572
1677
|
|
|
1573
1678
|
// src/mongoose/ResourceActivity.ts
|
|
1574
|
-
var
|
|
1575
|
-
var
|
|
1576
|
-
var
|
|
1577
|
-
var ActivitySchema = new
|
|
1679
|
+
var import_cluemart_shared15 = require("@timardex/cluemart-shared");
|
|
1680
|
+
var import_mongoose19 = __toESM(require("mongoose"));
|
|
1681
|
+
var MongooseSchema15 = import_mongoose19.default.Schema;
|
|
1682
|
+
var ActivitySchema = new MongooseSchema15(
|
|
1578
1683
|
{
|
|
1579
1684
|
activityType: {
|
|
1580
|
-
enum: Object.values(
|
|
1685
|
+
enum: Object.values(import_cluemart_shared15.EnumActivity),
|
|
1581
1686
|
required: true,
|
|
1582
1687
|
type: String
|
|
1583
1688
|
},
|
|
1584
1689
|
dateStatus: {
|
|
1585
|
-
enum: Object.values(
|
|
1690
|
+
enum: Object.values(import_cluemart_shared15.EnumEventDateStatus),
|
|
1586
1691
|
required: false,
|
|
1587
1692
|
type: String
|
|
1588
1693
|
},
|
|
@@ -1594,7 +1699,7 @@ var ActivitySchema = new MongooseSchema13(
|
|
|
1594
1699
|
startTime: { required: false, type: String },
|
|
1595
1700
|
timestamp: { default: Date.now, type: Date },
|
|
1596
1701
|
userAgent: {
|
|
1597
|
-
enum: Object.values(
|
|
1702
|
+
enum: Object.values(import_cluemart_shared15.EnumOSPlatform),
|
|
1598
1703
|
required: true,
|
|
1599
1704
|
type: String
|
|
1600
1705
|
},
|
|
@@ -1602,61 +1707,61 @@ var ActivitySchema = new MongooseSchema13(
|
|
|
1602
1707
|
},
|
|
1603
1708
|
{ _id: false }
|
|
1604
1709
|
);
|
|
1605
|
-
var
|
|
1710
|
+
var schema14 = new MongooseSchema15(
|
|
1606
1711
|
{
|
|
1607
1712
|
activity: { default: [], type: [ActivitySchema] },
|
|
1608
1713
|
resourceId: { required: true, type: String },
|
|
1609
1714
|
resourceType: {
|
|
1610
|
-
enum: Object.values(
|
|
1715
|
+
enum: Object.values(import_cluemart_shared15.EnumResourceType),
|
|
1611
1716
|
required: true,
|
|
1612
1717
|
type: String
|
|
1613
1718
|
}
|
|
1614
1719
|
},
|
|
1615
1720
|
{ timestamps: true }
|
|
1616
1721
|
);
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
var ResourceActivityModel =
|
|
1722
|
+
schema14.index({ resourceId: 1, resourceType: 1 }, { unique: true });
|
|
1723
|
+
schema14.index({ "views.location": "2dsphere" });
|
|
1724
|
+
var ResourceActivityModel = import_mongoose19.default.models.ResourceActivity || import_mongoose19.default.model("ResourceActivity", schema14);
|
|
1620
1725
|
|
|
1621
1726
|
// src/mongoose/User.ts
|
|
1622
|
-
var
|
|
1623
|
-
var
|
|
1624
|
-
var
|
|
1625
|
-
var userActivityEventSchema = new
|
|
1727
|
+
var import_cluemart_shared16 = require("@timardex/cluemart-shared");
|
|
1728
|
+
var import_mongoose20 = __toESM(require("mongoose"));
|
|
1729
|
+
var MongooseSchema16 = import_mongoose20.default.Schema;
|
|
1730
|
+
var userActivityEventSchema = new MongooseSchema16(
|
|
1626
1731
|
{
|
|
1627
1732
|
dateTime: dateTimeSchema,
|
|
1628
1733
|
resourceId: {
|
|
1629
1734
|
ref: "Event",
|
|
1630
1735
|
required: false,
|
|
1631
|
-
type:
|
|
1736
|
+
type: import_mongoose20.default.Schema.Types.ObjectId
|
|
1632
1737
|
}
|
|
1633
1738
|
},
|
|
1634
1739
|
{ _id: false }
|
|
1635
1740
|
);
|
|
1636
|
-
var userActivityFavouritesSchema = new
|
|
1741
|
+
var userActivityFavouritesSchema = new MongooseSchema16(
|
|
1637
1742
|
{
|
|
1638
1743
|
events: {
|
|
1639
1744
|
ref: "Event",
|
|
1640
1745
|
required: false,
|
|
1641
|
-
type: [
|
|
1746
|
+
type: [import_mongoose20.default.Schema.Types.ObjectId]
|
|
1642
1747
|
},
|
|
1643
1748
|
partners: {
|
|
1644
1749
|
ref: "Partner",
|
|
1645
1750
|
required: false,
|
|
1646
|
-
type: [
|
|
1751
|
+
type: [import_mongoose20.default.Schema.Types.ObjectId]
|
|
1647
1752
|
},
|
|
1648
1753
|
vendors: {
|
|
1649
1754
|
ref: "Vendor",
|
|
1650
1755
|
required: false,
|
|
1651
|
-
type: [
|
|
1756
|
+
type: [import_mongoose20.default.Schema.Types.ObjectId]
|
|
1652
1757
|
}
|
|
1653
1758
|
},
|
|
1654
1759
|
{ _id: false }
|
|
1655
1760
|
);
|
|
1656
|
-
var stripeSchema = new
|
|
1761
|
+
var stripeSchema = new MongooseSchema16(
|
|
1657
1762
|
{
|
|
1658
1763
|
billingPeriod: {
|
|
1659
|
-
enum: Object.values(
|
|
1764
|
+
enum: Object.values(import_cluemart_shared16.EnumBillingPeriod),
|
|
1660
1765
|
required: false,
|
|
1661
1766
|
type: String
|
|
1662
1767
|
},
|
|
@@ -1665,7 +1770,7 @@ var stripeSchema = new MongooseSchema14(
|
|
|
1665
1770
|
type: Boolean
|
|
1666
1771
|
},
|
|
1667
1772
|
currentPlan: {
|
|
1668
|
-
enum: Object.values(
|
|
1773
|
+
enum: Object.values(import_cluemart_shared16.EnumUserLicence),
|
|
1669
1774
|
required: false,
|
|
1670
1775
|
type: String
|
|
1671
1776
|
},
|
|
@@ -1690,7 +1795,7 @@ var stripeSchema = new MongooseSchema14(
|
|
|
1690
1795
|
type: String
|
|
1691
1796
|
},
|
|
1692
1797
|
pendingBillingPeriod: {
|
|
1693
|
-
enum: Object.values(
|
|
1798
|
+
enum: Object.values(import_cluemart_shared16.EnumBillingPeriod),
|
|
1694
1799
|
required: false,
|
|
1695
1800
|
type: String
|
|
1696
1801
|
},
|
|
@@ -1699,7 +1804,7 @@ var stripeSchema = new MongooseSchema14(
|
|
|
1699
1804
|
type: Date
|
|
1700
1805
|
},
|
|
1701
1806
|
pendingPlan: {
|
|
1702
|
-
enum: Object.values(
|
|
1807
|
+
enum: Object.values(import_cluemart_shared16.EnumUserLicence),
|
|
1703
1808
|
required: false,
|
|
1704
1809
|
type: String
|
|
1705
1810
|
},
|
|
@@ -1716,7 +1821,7 @@ var stripeSchema = new MongooseSchema14(
|
|
|
1716
1821
|
type: Date
|
|
1717
1822
|
},
|
|
1718
1823
|
status: {
|
|
1719
|
-
enum: Object.values(
|
|
1824
|
+
enum: Object.values(import_cluemart_shared16.EnumSubscriptionStatus),
|
|
1720
1825
|
required: false,
|
|
1721
1826
|
type: String
|
|
1722
1827
|
},
|
|
@@ -1735,10 +1840,10 @@ var stripeSchema = new MongooseSchema14(
|
|
|
1735
1840
|
},
|
|
1736
1841
|
{ _id: false }
|
|
1737
1842
|
);
|
|
1738
|
-
var redeemedRewardSchema = new
|
|
1843
|
+
var redeemedRewardSchema = new MongooseSchema16(
|
|
1739
1844
|
{
|
|
1740
1845
|
name: {
|
|
1741
|
-
enum: Object.values(
|
|
1846
|
+
enum: Object.values(import_cluemart_shared16.EnumReward),
|
|
1742
1847
|
required: true,
|
|
1743
1848
|
type: String
|
|
1744
1849
|
},
|
|
@@ -1747,12 +1852,12 @@ var redeemedRewardSchema = new MongooseSchema14(
|
|
|
1747
1852
|
},
|
|
1748
1853
|
{ _id: false }
|
|
1749
1854
|
);
|
|
1750
|
-
var userOverallPointsSchema = new
|
|
1855
|
+
var userOverallPointsSchema = new MongooseSchema16(
|
|
1751
1856
|
{
|
|
1752
1857
|
createdAt: { required: true, type: Date },
|
|
1753
1858
|
points: { default: 0, required: true, type: Number },
|
|
1754
1859
|
pointType: {
|
|
1755
|
-
enum: Object.values(
|
|
1860
|
+
enum: Object.values(import_cluemart_shared16.EnumPointType),
|
|
1756
1861
|
required: true,
|
|
1757
1862
|
type: String
|
|
1758
1863
|
},
|
|
@@ -1760,13 +1865,13 @@ var userOverallPointsSchema = new MongooseSchema14(
|
|
|
1760
1865
|
},
|
|
1761
1866
|
{ _id: false }
|
|
1762
1867
|
);
|
|
1763
|
-
var
|
|
1868
|
+
var schema15 = new MongooseSchema16(
|
|
1764
1869
|
{
|
|
1765
1870
|
active: { default: false, required: true, type: Boolean },
|
|
1766
1871
|
affiliate: {
|
|
1767
1872
|
ref: "Affiliate",
|
|
1768
1873
|
required: false,
|
|
1769
|
-
type:
|
|
1874
|
+
type: import_mongoose20.default.Schema.Types.ObjectId
|
|
1770
1875
|
},
|
|
1771
1876
|
avatar: {
|
|
1772
1877
|
required: false,
|
|
@@ -1775,28 +1880,28 @@ var schema13 = new MongooseSchema14(
|
|
|
1775
1880
|
coupon: {
|
|
1776
1881
|
ref: "Coupon",
|
|
1777
1882
|
required: false,
|
|
1778
|
-
type:
|
|
1883
|
+
type: import_mongoose20.default.Schema.Types.ObjectId
|
|
1779
1884
|
},
|
|
1780
1885
|
deletedAt: { default: null, required: false, type: Date },
|
|
1781
1886
|
email: { required: true, type: String },
|
|
1782
1887
|
emailSentFor: {
|
|
1783
|
-
enum: Object.values(
|
|
1888
|
+
enum: Object.values(import_cluemart_shared16.EnumNotificationResourceType),
|
|
1784
1889
|
required: false,
|
|
1785
1890
|
type: [String]
|
|
1786
1891
|
},
|
|
1787
1892
|
events: {
|
|
1788
1893
|
ref: "Event",
|
|
1789
1894
|
required: false,
|
|
1790
|
-
type: [
|
|
1895
|
+
type: [import_mongoose20.default.Schema.Types.ObjectId]
|
|
1791
1896
|
},
|
|
1792
1897
|
firstName: { required: true, type: String },
|
|
1793
1898
|
game: {
|
|
1794
1899
|
ref: "Game",
|
|
1795
1900
|
required: false,
|
|
1796
|
-
type:
|
|
1901
|
+
type: import_mongoose20.default.Schema.Types.ObjectId
|
|
1797
1902
|
},
|
|
1798
1903
|
interests: {
|
|
1799
|
-
enum: Object.values(
|
|
1904
|
+
enum: Object.values(import_cluemart_shared16.EnumResourceType),
|
|
1800
1905
|
required: false,
|
|
1801
1906
|
type: [String]
|
|
1802
1907
|
},
|
|
@@ -1819,11 +1924,11 @@ var schema13 = new MongooseSchema14(
|
|
|
1819
1924
|
partner: {
|
|
1820
1925
|
ref: "Partner",
|
|
1821
1926
|
required: false,
|
|
1822
|
-
type:
|
|
1927
|
+
type: import_mongoose20.default.Schema.Types.ObjectId
|
|
1823
1928
|
},
|
|
1824
1929
|
password: { required: true, type: String },
|
|
1825
1930
|
platform: {
|
|
1826
|
-
enum: Object.values(
|
|
1931
|
+
enum: Object.values(import_cluemart_shared16.EnumOSPlatform),
|
|
1827
1932
|
required: false,
|
|
1828
1933
|
type: String
|
|
1829
1934
|
},
|
|
@@ -1852,15 +1957,15 @@ var schema13 = new MongooseSchema14(
|
|
|
1852
1957
|
type: String
|
|
1853
1958
|
},
|
|
1854
1959
|
roles: {
|
|
1855
|
-
default: [
|
|
1856
|
-
enum: Object.values(
|
|
1960
|
+
default: [import_cluemart_shared16.EnumUserRole.CUSTOMER],
|
|
1961
|
+
enum: Object.values(import_cluemart_shared16.EnumUserRole),
|
|
1857
1962
|
required: true,
|
|
1858
1963
|
type: [String]
|
|
1859
1964
|
},
|
|
1860
1965
|
school: {
|
|
1861
1966
|
ref: "School",
|
|
1862
1967
|
required: false,
|
|
1863
|
-
type:
|
|
1968
|
+
type: import_mongoose20.default.Schema.Types.ObjectId
|
|
1864
1969
|
},
|
|
1865
1970
|
stripe: {
|
|
1866
1971
|
required: false,
|
|
@@ -1885,21 +1990,21 @@ var schema13 = new MongooseSchema14(
|
|
|
1885
1990
|
vendor: {
|
|
1886
1991
|
ref: "Vendor",
|
|
1887
1992
|
required: false,
|
|
1888
|
-
type:
|
|
1993
|
+
type: import_mongoose20.default.Schema.Types.ObjectId
|
|
1889
1994
|
}
|
|
1890
1995
|
},
|
|
1891
1996
|
{ strict: false, timestamps: true }
|
|
1892
1997
|
);
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
var UserModel =
|
|
1998
|
+
schema15.index({ "licences.expiryDate": 1 });
|
|
1999
|
+
schema15.index({ "licences.licenceType": 1 });
|
|
2000
|
+
schema15.index({ promoCodes: 1, active: 1, deletedAt: 1 });
|
|
2001
|
+
schema15.index({ email: "text", firstName: "text", lastName: "text" });
|
|
2002
|
+
var UserModel = import_mongoose20.default.models.User || import_mongoose20.default.model("User", schema15);
|
|
1898
2003
|
|
|
1899
2004
|
// src/mongoose/VerificationToken.ts
|
|
1900
|
-
var
|
|
1901
|
-
var
|
|
1902
|
-
var
|
|
2005
|
+
var import_mongoose21 = __toESM(require("mongoose"));
|
|
2006
|
+
var MongooseSchema17 = import_mongoose21.default.Schema;
|
|
2007
|
+
var schema16 = new MongooseSchema17(
|
|
1903
2008
|
{
|
|
1904
2009
|
createdAt: {
|
|
1905
2010
|
default: Date.now,
|
|
@@ -1914,13 +2019,13 @@ var schema14 = new MongooseSchema15(
|
|
|
1914
2019
|
},
|
|
1915
2020
|
{ timestamps: true }
|
|
1916
2021
|
);
|
|
1917
|
-
var VerificationTokenModel =
|
|
2022
|
+
var VerificationTokenModel = import_mongoose21.default.models.VerificationToken || import_mongoose21.default.model("VerificationToken", schema16);
|
|
1918
2023
|
|
|
1919
2024
|
// src/mongoose/vendor/Vendor.ts
|
|
1920
|
-
var
|
|
1921
|
-
var
|
|
1922
|
-
var
|
|
1923
|
-
var vendorProductTypeSchema = new
|
|
2025
|
+
var import_cluemart_shared17 = require("@timardex/cluemart-shared");
|
|
2026
|
+
var import_mongoose22 = __toESM(require("mongoose"));
|
|
2027
|
+
var MongooseSchema18 = import_mongoose22.default.Schema;
|
|
2028
|
+
var vendorProductTypeSchema = new MongooseSchema18(
|
|
1924
2029
|
{
|
|
1925
2030
|
description: { required: false, type: String },
|
|
1926
2031
|
name: { required: true, type: String },
|
|
@@ -1931,18 +2036,18 @@ var vendorProductTypeSchema = new MongooseSchema16(
|
|
|
1931
2036
|
},
|
|
1932
2037
|
{ timestamps: true }
|
|
1933
2038
|
);
|
|
1934
|
-
var productWrapperSchema = new
|
|
2039
|
+
var productWrapperSchema = new MongooseSchema18(
|
|
1935
2040
|
{
|
|
1936
2041
|
active: { default: false, required: false, type: Boolean },
|
|
1937
2042
|
productsList: { required: false, type: [vendorProductTypeSchema] }
|
|
1938
2043
|
},
|
|
1939
2044
|
{ _id: false }
|
|
1940
2045
|
);
|
|
1941
|
-
var calendarSchema = new
|
|
2046
|
+
var calendarSchema = new MongooseSchema18(
|
|
1942
2047
|
{
|
|
1943
2048
|
dateTime: {
|
|
1944
2049
|
dateStatus: {
|
|
1945
|
-
enum: Object.values(
|
|
2050
|
+
enum: Object.values(import_cluemart_shared17.EnumEventDateStatus),
|
|
1946
2051
|
required: false,
|
|
1947
2052
|
type: String
|
|
1948
2053
|
},
|
|
@@ -1959,14 +2064,14 @@ var calendarSchema = new MongooseSchema16(
|
|
|
1959
2064
|
},
|
|
1960
2065
|
{ _id: false }
|
|
1961
2066
|
);
|
|
1962
|
-
var calendarWrapperSchema = new
|
|
2067
|
+
var calendarWrapperSchema = new MongooseSchema18(
|
|
1963
2068
|
{
|
|
1964
2069
|
active: { default: false, required: true, type: Boolean },
|
|
1965
2070
|
calendarData: { required: false, type: [calendarSchema] }
|
|
1966
2071
|
},
|
|
1967
2072
|
{ _id: false }
|
|
1968
2073
|
);
|
|
1969
|
-
var vendorAvailabilitySchema = new
|
|
2074
|
+
var vendorAvailabilitySchema = new MongooseSchema18(
|
|
1970
2075
|
{
|
|
1971
2076
|
corporate: { default: false, required: false, type: Boolean },
|
|
1972
2077
|
private: { default: false, required: false, type: Boolean },
|
|
@@ -1974,7 +2079,7 @@ var vendorAvailabilitySchema = new MongooseSchema16(
|
|
|
1974
2079
|
},
|
|
1975
2080
|
{ _id: false }
|
|
1976
2081
|
);
|
|
1977
|
-
var downgradeSnapshotSchema = new
|
|
2082
|
+
var downgradeSnapshotSchema = new MongooseSchema18(
|
|
1978
2083
|
{
|
|
1979
2084
|
availability: { required: false, type: vendorAvailabilitySchema },
|
|
1980
2085
|
calendarActive: { required: false, type: Boolean },
|
|
@@ -1982,7 +2087,7 @@ var downgradeSnapshotSchema = new MongooseSchema16(
|
|
|
1982
2087
|
},
|
|
1983
2088
|
{ _id: false }
|
|
1984
2089
|
);
|
|
1985
|
-
var
|
|
2090
|
+
var schema17 = new MongooseSchema18(
|
|
1986
2091
|
{
|
|
1987
2092
|
...baseResourceFields,
|
|
1988
2093
|
// Importing base resource fields from global.ts
|
|
@@ -2001,47 +2106,47 @@ var schema15 = new MongooseSchema16(
|
|
|
2001
2106
|
unregisteredVendorId: {
|
|
2002
2107
|
ref: "UnregisteredVendor",
|
|
2003
2108
|
required: false,
|
|
2004
|
-
type:
|
|
2109
|
+
type: import_mongoose22.default.Schema.Types.ObjectId
|
|
2005
2110
|
},
|
|
2006
2111
|
vendorInfoId: {
|
|
2007
2112
|
ref: "VendorInfo",
|
|
2008
2113
|
required: false,
|
|
2009
|
-
type:
|
|
2114
|
+
type: import_mongoose22.default.Schema.Types.ObjectId
|
|
2010
2115
|
},
|
|
2011
2116
|
vendorType: {
|
|
2012
|
-
enum: Object.values(
|
|
2117
|
+
enum: Object.values(import_cluemart_shared17.EnumVendorType),
|
|
2013
2118
|
required: true,
|
|
2014
2119
|
type: String
|
|
2015
2120
|
}
|
|
2016
2121
|
},
|
|
2017
2122
|
{ timestamps: true }
|
|
2018
2123
|
);
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2124
|
+
schema17.index({ name: 1 });
|
|
2125
|
+
schema17.index({ description: 1 });
|
|
2126
|
+
schema17.index({ region: 1 });
|
|
2127
|
+
schema17.index({ "categories.name": 1 });
|
|
2128
|
+
schema17.index({ slug: 1 });
|
|
2129
|
+
schema17.index({
|
|
2025
2130
|
categoriesNames: "text",
|
|
2026
2131
|
description: "text",
|
|
2027
2132
|
name: "text"
|
|
2028
2133
|
});
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
var VendorModel =
|
|
2134
|
+
schema17.index({ deletedAt: 1, "owner.userId": 1 });
|
|
2135
|
+
schema17.plugin(searchNamePlugin);
|
|
2136
|
+
var VendorModel = import_mongoose22.default.models.Vendor || import_mongoose22.default.model("Vendor", schema17);
|
|
2032
2137
|
|
|
2033
2138
|
// src/mongoose/vendor/VendorInfo.ts
|
|
2034
|
-
var
|
|
2035
|
-
var
|
|
2036
|
-
var
|
|
2037
|
-
var AttributesSchema = new
|
|
2139
|
+
var import_cluemart_shared18 = require("@timardex/cluemart-shared");
|
|
2140
|
+
var import_mongoose23 = __toESM(require("mongoose"));
|
|
2141
|
+
var MongooseSchema19 = import_mongoose23.default.Schema;
|
|
2142
|
+
var AttributesSchema = new MongooseSchema19(
|
|
2038
2143
|
{
|
|
2039
2144
|
details: { required: false, type: String },
|
|
2040
2145
|
isRequired: { default: false, required: true, type: Boolean }
|
|
2041
2146
|
},
|
|
2042
2147
|
{ _id: false }
|
|
2043
2148
|
);
|
|
2044
|
-
var
|
|
2149
|
+
var schema18 = new MongooseSchema19(
|
|
2045
2150
|
{
|
|
2046
2151
|
active: { default: true, type: Boolean },
|
|
2047
2152
|
compliance: {
|
|
@@ -2051,7 +2156,7 @@ var schema16 = new MongooseSchema17(
|
|
|
2051
2156
|
documents: [ResourceImageTypeSchema],
|
|
2052
2157
|
product: {
|
|
2053
2158
|
foodFlavors: {
|
|
2054
|
-
enum: Object.values(
|
|
2159
|
+
enum: Object.values(import_cluemart_shared18.EnumFoodFlavor),
|
|
2055
2160
|
required: true,
|
|
2056
2161
|
type: [String]
|
|
2057
2162
|
},
|
|
@@ -2076,29 +2181,29 @@ var schema16 = new MongooseSchema17(
|
|
|
2076
2181
|
vendorId: {
|
|
2077
2182
|
ref: "Vendor",
|
|
2078
2183
|
required: true,
|
|
2079
|
-
type:
|
|
2184
|
+
type: import_mongoose23.default.Schema.Types.ObjectId
|
|
2080
2185
|
}
|
|
2081
2186
|
},
|
|
2082
2187
|
{ timestamps: true }
|
|
2083
2188
|
);
|
|
2084
|
-
|
|
2085
|
-
var VendorInfoModel =
|
|
2189
|
+
schema18.index({ vendorId: 1 });
|
|
2190
|
+
var VendorInfoModel = import_mongoose23.default.models.VendorInfo || import_mongoose23.default.model("VendorInfo", schema18);
|
|
2086
2191
|
|
|
2087
2192
|
// src/mongoose/vendor/UnregisteredVendor.ts
|
|
2088
|
-
var
|
|
2089
|
-
var
|
|
2090
|
-
var invitationSchema = new
|
|
2193
|
+
var import_mongoose24 = __toESM(require("mongoose"));
|
|
2194
|
+
var MongooseSchema20 = import_mongoose24.default.Schema;
|
|
2195
|
+
var invitationSchema = new MongooseSchema20(
|
|
2091
2196
|
{
|
|
2092
2197
|
dateTime: { required: true, type: [dateTimeSchema] },
|
|
2093
2198
|
inviterId: {
|
|
2094
2199
|
ref: "Event",
|
|
2095
2200
|
required: true,
|
|
2096
|
-
type:
|
|
2201
|
+
type: import_mongoose24.default.Schema.Types.ObjectId
|
|
2097
2202
|
}
|
|
2098
2203
|
},
|
|
2099
2204
|
{ _id: false }
|
|
2100
2205
|
);
|
|
2101
|
-
var
|
|
2206
|
+
var schema19 = new MongooseSchema20(
|
|
2102
2207
|
{
|
|
2103
2208
|
active: { default: true, required: true, type: Boolean },
|
|
2104
2209
|
categoryIds: { required: true, type: [String] },
|
|
@@ -2107,7 +2212,7 @@ var schema17 = new MongooseSchema18(
|
|
|
2107
2212
|
claimedByUserId: {
|
|
2108
2213
|
ref: "User",
|
|
2109
2214
|
required: false,
|
|
2110
|
-
type:
|
|
2215
|
+
type: import_mongoose24.default.Schema.Types.ObjectId
|
|
2111
2216
|
},
|
|
2112
2217
|
claimInitiatedAt: { default: null, required: false, type: Date },
|
|
2113
2218
|
claimToken: { default: null, required: false, type: String },
|
|
@@ -2120,15 +2225,15 @@ var schema17 = new MongooseSchema18(
|
|
|
2120
2225
|
},
|
|
2121
2226
|
{ timestamps: true }
|
|
2122
2227
|
);
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
var UnregisteredVendorModel =
|
|
2228
|
+
schema19.index({ name: 1 });
|
|
2229
|
+
schema19.index({ email: 1 });
|
|
2230
|
+
var UnregisteredVendorModel = import_mongoose24.default.models.UnregisteredVendor || import_mongoose24.default.model("UnregisteredVendor", schema19);
|
|
2126
2231
|
|
|
2127
2232
|
// src/mongoose/event/Event.ts
|
|
2128
|
-
var
|
|
2129
|
-
var
|
|
2130
|
-
var
|
|
2131
|
-
var
|
|
2233
|
+
var import_cluemart_shared19 = require("@timardex/cluemart-shared");
|
|
2234
|
+
var import_mongoose25 = __toESM(require("mongoose"));
|
|
2235
|
+
var MongooseSchema21 = import_mongoose25.default.Schema;
|
|
2236
|
+
var schema20 = new MongooseSchema21(
|
|
2132
2237
|
{
|
|
2133
2238
|
...baseResourceFields,
|
|
2134
2239
|
// Importing base resource fields from global.ts
|
|
@@ -2137,10 +2242,10 @@ var schema18 = new MongooseSchema19(
|
|
|
2137
2242
|
eventInfoId: {
|
|
2138
2243
|
ref: "EventInfo",
|
|
2139
2244
|
required: false,
|
|
2140
|
-
type:
|
|
2245
|
+
type: import_mongoose25.default.Schema.Types.ObjectId
|
|
2141
2246
|
},
|
|
2142
2247
|
eventType: {
|
|
2143
|
-
enum: Object.values(
|
|
2248
|
+
enum: Object.values(import_cluemart_shared19.EnumEventType),
|
|
2144
2249
|
required: true,
|
|
2145
2250
|
type: String
|
|
2146
2251
|
},
|
|
@@ -2161,40 +2266,40 @@ var schema18 = new MongooseSchema19(
|
|
|
2161
2266
|
},
|
|
2162
2267
|
{ timestamps: true }
|
|
2163
2268
|
);
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
var EventModel =
|
|
2269
|
+
schema20.index({ name: 1 });
|
|
2270
|
+
schema20.index({ description: 1 });
|
|
2271
|
+
schema20.index({ region: 1 });
|
|
2272
|
+
schema20.index({ "location.geo": "2dsphere" });
|
|
2273
|
+
schema20.index({ tags: 1 });
|
|
2274
|
+
schema20.index({ deletedAt: 1 });
|
|
2275
|
+
schema20.index({ "dateTime.dateStatus": 1 });
|
|
2276
|
+
schema20.index({ slug: 1 });
|
|
2277
|
+
schema20.index({ description: "text", name: "text", tags: "text" });
|
|
2278
|
+
schema20.index({ deletedAt: 1, "owner.userId": 1 });
|
|
2279
|
+
schema20.plugin(searchNamePlugin);
|
|
2280
|
+
var EventModel = import_mongoose25.default.models.Event || import_mongoose25.default.model("Event", schema20);
|
|
2176
2281
|
|
|
2177
2282
|
// src/mongoose/event/EventDateArchive.ts
|
|
2178
|
-
var
|
|
2179
|
-
var
|
|
2283
|
+
var import_mongoose26 = __toESM(require("mongoose"));
|
|
2284
|
+
var schema21 = new import_mongoose26.default.Schema(
|
|
2180
2285
|
{
|
|
2181
2286
|
dateTime: { required: true, type: [dateTimeSchema] },
|
|
2182
2287
|
eventId: {
|
|
2183
2288
|
ref: "Event",
|
|
2184
2289
|
required: true,
|
|
2185
|
-
type:
|
|
2290
|
+
type: import_mongoose26.default.Schema.Types.ObjectId
|
|
2186
2291
|
}
|
|
2187
2292
|
},
|
|
2188
2293
|
{ timestamps: true }
|
|
2189
2294
|
);
|
|
2190
|
-
|
|
2191
|
-
var EventDateArchiveModel =
|
|
2295
|
+
schema21.index({ eventId: 1 }, { unique: true });
|
|
2296
|
+
var EventDateArchiveModel = import_mongoose26.default.models.EventDateArchive || import_mongoose26.default.model("EventDateArchive", schema21);
|
|
2192
2297
|
|
|
2193
2298
|
// src/mongoose/Partner.ts
|
|
2194
|
-
var
|
|
2195
|
-
var
|
|
2196
|
-
var
|
|
2197
|
-
var
|
|
2299
|
+
var import_cluemart_shared20 = require("@timardex/cluemart-shared");
|
|
2300
|
+
var import_mongoose27 = __toESM(require("mongoose"));
|
|
2301
|
+
var MongooseSchema22 = import_mongoose27.default.Schema;
|
|
2302
|
+
var schema22 = new MongooseSchema22(
|
|
2198
2303
|
{
|
|
2199
2304
|
...baseResourceFields,
|
|
2200
2305
|
location: {
|
|
@@ -2203,53 +2308,53 @@ var schema20 = new MongooseSchema20(
|
|
|
2203
2308
|
},
|
|
2204
2309
|
nzbn: { required: true, type: String },
|
|
2205
2310
|
partnerType: {
|
|
2206
|
-
enum: Object.values(
|
|
2311
|
+
enum: Object.values(import_cluemart_shared20.EnumPartnerType),
|
|
2207
2312
|
required: true,
|
|
2208
2313
|
type: String
|
|
2209
2314
|
}
|
|
2210
2315
|
},
|
|
2211
2316
|
{ timestamps: true }
|
|
2212
2317
|
);
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
var PartnerModel =
|
|
2318
|
+
schema22.index({ name: 1 });
|
|
2319
|
+
schema22.index({ description: 1 });
|
|
2320
|
+
schema22.index({ region: 1 });
|
|
2321
|
+
schema22.index({ "location.geo": "2dsphere" });
|
|
2322
|
+
schema22.index({ slug: 1 });
|
|
2323
|
+
schema22.index({ name: "text", description: "text" });
|
|
2324
|
+
schema22.index({ "owner.userId": 1, deletedAt: 1 });
|
|
2325
|
+
schema22.plugin(searchNamePlugin);
|
|
2326
|
+
var PartnerModel = import_mongoose27.default.models.Partner || import_mongoose27.default.model("Partner", schema22);
|
|
2222
2327
|
|
|
2223
2328
|
// src/mongoose/Post.ts
|
|
2224
|
-
var
|
|
2225
|
-
var
|
|
2226
|
-
var
|
|
2227
|
-
var contentSchema = new
|
|
2329
|
+
var import_cluemart_shared21 = require("@timardex/cluemart-shared");
|
|
2330
|
+
var import_mongoose28 = __toESM(require("mongoose"));
|
|
2331
|
+
var MongooseSchema23 = import_mongoose28.default.Schema;
|
|
2332
|
+
var contentSchema = new MongooseSchema23(
|
|
2228
2333
|
{
|
|
2229
|
-
contentData:
|
|
2334
|
+
contentData: import_mongoose28.Schema.Types.Mixed,
|
|
2230
2335
|
contentOrder: { required: true, type: Number },
|
|
2231
2336
|
contentType: {
|
|
2232
|
-
enum: Object.values(
|
|
2337
|
+
enum: Object.values(import_cluemart_shared21.EnumPostContentType),
|
|
2233
2338
|
required: true,
|
|
2234
2339
|
type: String
|
|
2235
2340
|
}
|
|
2236
2341
|
},
|
|
2237
2342
|
{ _id: false }
|
|
2238
2343
|
);
|
|
2239
|
-
var resourceSchema = new
|
|
2344
|
+
var resourceSchema = new MongooseSchema23(
|
|
2240
2345
|
{
|
|
2241
2346
|
resourceId: { required: true, type: String },
|
|
2242
2347
|
resourceRegion: { required: true, type: String },
|
|
2243
2348
|
resourceSlug: { required: true, type: String },
|
|
2244
2349
|
resourceType: {
|
|
2245
|
-
enum: Object.values(
|
|
2350
|
+
enum: Object.values(import_cluemart_shared21.EnumResourceType),
|
|
2246
2351
|
required: true,
|
|
2247
2352
|
type: String
|
|
2248
2353
|
}
|
|
2249
2354
|
},
|
|
2250
2355
|
{ _id: false }
|
|
2251
2356
|
);
|
|
2252
|
-
var
|
|
2357
|
+
var schema23 = new MongooseSchema23(
|
|
2253
2358
|
{
|
|
2254
2359
|
active: { default: false, required: true, type: Boolean },
|
|
2255
2360
|
approvedAt: { default: null, required: false, type: Date },
|
|
@@ -2265,7 +2370,7 @@ var schema21 = new MongooseSchema21(
|
|
|
2265
2370
|
},
|
|
2266
2371
|
deletedAt: { default: null, required: false, type: Date },
|
|
2267
2372
|
postType: {
|
|
2268
|
-
enum: Object.values(
|
|
2373
|
+
enum: Object.values(import_cluemart_shared21.EnumPostType),
|
|
2269
2374
|
required: true,
|
|
2270
2375
|
type: String
|
|
2271
2376
|
},
|
|
@@ -2280,16 +2385,16 @@ var schema21 = new MongooseSchema21(
|
|
|
2280
2385
|
},
|
|
2281
2386
|
{ timestamps: true }
|
|
2282
2387
|
);
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
var PostModel =
|
|
2388
|
+
schema23.index({ title: 1 });
|
|
2389
|
+
schema23.index({ tags: 1 });
|
|
2390
|
+
schema23.index({ postType: 1, slug: 1 }, { unique: true });
|
|
2391
|
+
var PostModel = import_mongoose28.default.models.Post || import_mongoose28.default.model("Post", schema23);
|
|
2287
2392
|
|
|
2288
2393
|
// src/mongoose/AppSetting.ts
|
|
2289
|
-
var
|
|
2290
|
-
var
|
|
2394
|
+
var import_mongoose29 = __toESM(require("mongoose"));
|
|
2395
|
+
var MongooseSchema24 = import_mongoose29.default.Schema;
|
|
2291
2396
|
var APP_SETTINGS_ID = "APP_SETTINGS_DOCUMENT_ID";
|
|
2292
|
-
var AppSettingSchema = new
|
|
2397
|
+
var AppSettingSchema = new MongooseSchema24(
|
|
2293
2398
|
{
|
|
2294
2399
|
activeSchoolsStudentCountTotal: {
|
|
2295
2400
|
default: 0,
|
|
@@ -2311,8 +2416,8 @@ var AppSettingSchema = new MongooseSchema22(
|
|
|
2311
2416
|
validate: Number.isInteger
|
|
2312
2417
|
},
|
|
2313
2418
|
mobileDisplayEnabled: { default: false, required: true, type: Boolean },
|
|
2314
|
-
purchasePricing: { type:
|
|
2315
|
-
regionPricing: { type:
|
|
2419
|
+
purchasePricing: { type: MongooseSchema24.Types.Mixed },
|
|
2420
|
+
regionPricing: { type: MongooseSchema24.Types.Mixed },
|
|
2316
2421
|
paidSlotsPerPlacement: { enum: [30], type: Number },
|
|
2317
2422
|
reservedSlotsPerPlacement: { enum: [7], type: Number },
|
|
2318
2423
|
rotationSeconds: { enum: [8], type: Number },
|
|
@@ -2337,12 +2442,12 @@ var AppSettingSchema = new MongooseSchema22(
|
|
|
2337
2442
|
},
|
|
2338
2443
|
{ timestamps: true }
|
|
2339
2444
|
);
|
|
2340
|
-
var AppSettingModel =
|
|
2445
|
+
var AppSettingModel = import_mongoose29.default.models.AppSetting || import_mongoose29.default.model("AppSetting", AppSettingSchema);
|
|
2341
2446
|
|
|
2342
2447
|
// src/mongoose/AuthHandoffToken.ts
|
|
2343
|
-
var
|
|
2344
|
-
var
|
|
2345
|
-
var
|
|
2448
|
+
var import_mongoose30 = __toESM(require("mongoose"));
|
|
2449
|
+
var MongooseSchema25 = import_mongoose30.default.Schema;
|
|
2450
|
+
var schema24 = new MongooseSchema25(
|
|
2346
2451
|
{
|
|
2347
2452
|
expiresAt: { required: true, type: Date },
|
|
2348
2453
|
jti: { index: true, required: true, type: String, unique: true },
|
|
@@ -2351,25 +2456,25 @@ var schema22 = new MongooseSchema23(
|
|
|
2351
2456
|
index: true,
|
|
2352
2457
|
ref: "User",
|
|
2353
2458
|
required: true,
|
|
2354
|
-
type:
|
|
2459
|
+
type: import_mongoose30.default.Schema.Types.ObjectId
|
|
2355
2460
|
}
|
|
2356
2461
|
},
|
|
2357
2462
|
{ timestamps: true }
|
|
2358
2463
|
);
|
|
2359
|
-
|
|
2360
|
-
var AuthHandoffTokenModel =
|
|
2464
|
+
schema24.index({ expiresAt: 1 }, { expireAfterSeconds: 0 });
|
|
2465
|
+
var AuthHandoffTokenModel = import_mongoose30.default.models.AuthHandoffToken || import_mongoose30.default.model("AuthHandoffToken", schema24);
|
|
2361
2466
|
|
|
2362
2467
|
// src/mongoose/game/Game.ts
|
|
2363
|
-
var
|
|
2364
|
-
var
|
|
2468
|
+
var import_cluemart_shared22 = require("@timardex/cluemart-shared");
|
|
2469
|
+
var import_mongoose34 = __toESM(require("mongoose"));
|
|
2365
2470
|
|
|
2366
2471
|
// src/mongoose/game/DailyClue.ts
|
|
2367
|
-
var
|
|
2472
|
+
var import_mongoose32 = __toESM(require("mongoose"));
|
|
2368
2473
|
|
|
2369
2474
|
// src/mongoose/game/utils.ts
|
|
2370
|
-
var
|
|
2371
|
-
var
|
|
2372
|
-
var schemaGameDate = new
|
|
2475
|
+
var import_mongoose31 = __toESM(require("mongoose"));
|
|
2476
|
+
var MongooseSchema26 = import_mongoose31.default.Schema;
|
|
2477
|
+
var schemaGameDate = new MongooseSchema26(
|
|
2373
2478
|
{
|
|
2374
2479
|
endDate: { required: true, type: Date },
|
|
2375
2480
|
startDate: { required: true, type: Date }
|
|
@@ -2378,8 +2483,8 @@ var schemaGameDate = new MongooseSchema24(
|
|
|
2378
2483
|
);
|
|
2379
2484
|
|
|
2380
2485
|
// src/mongoose/game/DailyClue.ts
|
|
2381
|
-
var
|
|
2382
|
-
var schemaLetters = new
|
|
2486
|
+
var MongooseSchema27 = import_mongoose32.default.Schema;
|
|
2487
|
+
var schemaLetters = new MongooseSchema27(
|
|
2383
2488
|
{
|
|
2384
2489
|
collected: { required: false, type: [String] },
|
|
2385
2490
|
solutionShuffled: { required: true, type: [String] }
|
|
@@ -2387,14 +2492,14 @@ var schemaLetters = new MongooseSchema25(
|
|
|
2387
2492
|
},
|
|
2388
2493
|
{ _id: false }
|
|
2389
2494
|
);
|
|
2390
|
-
var schemaDailyClueBaseGame = new
|
|
2495
|
+
var schemaDailyClueBaseGame = new MongooseSchema27(
|
|
2391
2496
|
{
|
|
2392
2497
|
gameDate: { required: true, type: schemaGameDate },
|
|
2393
2498
|
gameSolution: { required: true, type: String }
|
|
2394
2499
|
},
|
|
2395
2500
|
{ _id: false }
|
|
2396
2501
|
);
|
|
2397
|
-
var schemaDailyClueGameData = new
|
|
2502
|
+
var schemaDailyClueGameData = new MongooseSchema27(
|
|
2398
2503
|
{
|
|
2399
2504
|
gameFields: { required: true, type: schemaDailyClueBaseGame },
|
|
2400
2505
|
lastFoundDate: { default: null, required: false, type: Date },
|
|
@@ -2409,9 +2514,9 @@ var schemaDailyClueGameData = new MongooseSchema25(
|
|
|
2409
2514
|
);
|
|
2410
2515
|
|
|
2411
2516
|
// src/mongoose/game/PuzzleGame.ts
|
|
2412
|
-
var
|
|
2413
|
-
var
|
|
2414
|
-
var schemaPuzzleAnswer = new
|
|
2517
|
+
var import_mongoose33 = __toESM(require("mongoose"));
|
|
2518
|
+
var MongooseSchema28 = import_mongoose33.default.Schema;
|
|
2519
|
+
var schemaPuzzleAnswer = new MongooseSchema28(
|
|
2415
2520
|
{
|
|
2416
2521
|
answer: { required: true, type: String },
|
|
2417
2522
|
answerId: { required: true, type: String },
|
|
@@ -2419,7 +2524,7 @@ var schemaPuzzleAnswer = new MongooseSchema26(
|
|
|
2419
2524
|
},
|
|
2420
2525
|
{ _id: false }
|
|
2421
2526
|
);
|
|
2422
|
-
var schemaPuzzleQuestion = new
|
|
2527
|
+
var schemaPuzzleQuestion = new MongooseSchema28(
|
|
2423
2528
|
{
|
|
2424
2529
|
answers: { required: true, type: [schemaPuzzleAnswer] },
|
|
2425
2530
|
question: { required: true, type: String },
|
|
@@ -2427,20 +2532,20 @@ var schemaPuzzleQuestion = new MongooseSchema26(
|
|
|
2427
2532
|
},
|
|
2428
2533
|
{ _id: false }
|
|
2429
2534
|
);
|
|
2430
|
-
var schemaPuzzleBaseGame = new
|
|
2535
|
+
var schemaPuzzleBaseGame = new MongooseSchema28(
|
|
2431
2536
|
{
|
|
2432
2537
|
questions: { required: true, type: [schemaPuzzleQuestion] }
|
|
2433
2538
|
},
|
|
2434
2539
|
{ _id: false }
|
|
2435
2540
|
);
|
|
2436
|
-
var schemaPuzzleAnsweredQuestion = new
|
|
2541
|
+
var schemaPuzzleAnsweredQuestion = new MongooseSchema28(
|
|
2437
2542
|
{
|
|
2438
2543
|
questionId: { required: true, type: String },
|
|
2439
2544
|
selectedAnswerId: { required: true, type: String }
|
|
2440
2545
|
},
|
|
2441
2546
|
{ _id: false }
|
|
2442
2547
|
);
|
|
2443
|
-
var schemaPuzzleGameData = new
|
|
2548
|
+
var schemaPuzzleGameData = new MongooseSchema28(
|
|
2444
2549
|
{
|
|
2445
2550
|
answeredQuestions: {
|
|
2446
2551
|
default: null,
|
|
@@ -2455,30 +2560,30 @@ var schemaPuzzleGameData = new MongooseSchema26(
|
|
|
2455
2560
|
);
|
|
2456
2561
|
|
|
2457
2562
|
// src/mongoose/game/Game.ts
|
|
2458
|
-
var
|
|
2563
|
+
var MongooseSchema29 = import_mongoose34.default.Schema;
|
|
2459
2564
|
var gameDataSchemas = {
|
|
2460
|
-
[
|
|
2461
|
-
[
|
|
2462
|
-
[
|
|
2565
|
+
[import_cluemart_shared22.EnumGameType.DAILY_CLUE]: schemaDailyClueGameData,
|
|
2566
|
+
[import_cluemart_shared22.EnumGameType.MINI_QUIZ]: schemaPuzzleGameData,
|
|
2567
|
+
[import_cluemart_shared22.EnumGameType.ODD_ONE_OUT]: schemaPuzzleGameData
|
|
2463
2568
|
};
|
|
2464
2569
|
var gameDataDefinition = Object.fromEntries(
|
|
2465
|
-
Object.entries(gameDataSchemas).map(([key,
|
|
2570
|
+
Object.entries(gameDataSchemas).map(([key, schema29]) => [
|
|
2466
2571
|
key,
|
|
2467
|
-
{ default: null, required: false, type:
|
|
2572
|
+
{ default: null, required: false, type: schema29 }
|
|
2468
2573
|
])
|
|
2469
2574
|
);
|
|
2470
|
-
var gameHistorySchema = new
|
|
2575
|
+
var gameHistorySchema = new MongooseSchema29(
|
|
2471
2576
|
{
|
|
2472
2577
|
createdAt: { required: true, type: Date },
|
|
2473
2578
|
gameDate: { required: true, type: schemaGameDate },
|
|
2474
2579
|
gameStatus: {
|
|
2475
|
-
enum: Object.values(
|
|
2580
|
+
enum: Object.values(import_cluemart_shared22.EnumGameStatus),
|
|
2476
2581
|
required: true,
|
|
2477
2582
|
type: String
|
|
2478
2583
|
},
|
|
2479
2584
|
gameTitle: { required: true, type: String },
|
|
2480
2585
|
gameType: {
|
|
2481
|
-
enum: Object.values(
|
|
2586
|
+
enum: Object.values(import_cluemart_shared22.EnumGameType),
|
|
2482
2587
|
required: true,
|
|
2483
2588
|
type: String
|
|
2484
2589
|
},
|
|
@@ -2487,14 +2592,14 @@ var gameHistorySchema = new MongooseSchema27(
|
|
|
2487
2592
|
},
|
|
2488
2593
|
{ _id: false }
|
|
2489
2594
|
);
|
|
2490
|
-
var gameTypeSchema = new
|
|
2595
|
+
var gameTypeSchema = new MongooseSchema29(
|
|
2491
2596
|
{
|
|
2492
2597
|
active: { default: true, required: true, type: Boolean },
|
|
2493
2598
|
gameData: gameDataDefinition,
|
|
2494
2599
|
gameHistory: { default: [], required: true, type: [gameHistorySchema] },
|
|
2495
2600
|
gameTitle: { required: true, type: String },
|
|
2496
2601
|
gameType: {
|
|
2497
|
-
enum: Object.values(
|
|
2602
|
+
enum: Object.values(import_cluemart_shared22.EnumGameType),
|
|
2498
2603
|
required: true,
|
|
2499
2604
|
type: String
|
|
2500
2605
|
},
|
|
@@ -2505,7 +2610,7 @@ var gameTypeSchema = new MongooseSchema27(
|
|
|
2505
2610
|
},
|
|
2506
2611
|
{ timestamps: true }
|
|
2507
2612
|
);
|
|
2508
|
-
var
|
|
2613
|
+
var schema25 = new MongooseSchema29(
|
|
2509
2614
|
{
|
|
2510
2615
|
active: { default: false, required: true, type: Boolean },
|
|
2511
2616
|
deletedAt: { default: null, required: false, type: Date },
|
|
@@ -2518,12 +2623,12 @@ var schema23 = new MongooseSchema27(
|
|
|
2518
2623
|
},
|
|
2519
2624
|
{ timestamps: true }
|
|
2520
2625
|
);
|
|
2521
|
-
var GameModel =
|
|
2626
|
+
var GameModel = import_mongoose34.default.models.Game || import_mongoose34.default.model("Game", schema25);
|
|
2522
2627
|
|
|
2523
2628
|
// src/mongoose/School.ts
|
|
2524
|
-
var
|
|
2525
|
-
var
|
|
2526
|
-
var campaignsSchema = new
|
|
2629
|
+
var import_mongoose35 = __toESM(require("mongoose"));
|
|
2630
|
+
var MongooseSchema30 = import_mongoose35.default.Schema;
|
|
2631
|
+
var campaignsSchema = new MongooseSchema30(
|
|
2527
2632
|
{
|
|
2528
2633
|
endDate: { required: true, type: Date },
|
|
2529
2634
|
name: { required: true, type: String },
|
|
@@ -2531,7 +2636,7 @@ var campaignsSchema = new MongooseSchema28(
|
|
|
2531
2636
|
},
|
|
2532
2637
|
{ _id: false }
|
|
2533
2638
|
);
|
|
2534
|
-
var
|
|
2639
|
+
var schema26 = new MongooseSchema30(
|
|
2535
2640
|
{
|
|
2536
2641
|
// New schools are active by default
|
|
2537
2642
|
active: { default: false, required: true, type: Boolean },
|
|
@@ -2558,26 +2663,26 @@ var schema24 = new MongooseSchema28(
|
|
|
2558
2663
|
},
|
|
2559
2664
|
{ timestamps: true }
|
|
2560
2665
|
);
|
|
2561
|
-
|
|
2666
|
+
schema26.index(
|
|
2562
2667
|
{ schoolCode: 1 },
|
|
2563
2668
|
{
|
|
2564
2669
|
partialFilterExpression: { active: true, deletedAt: null },
|
|
2565
2670
|
unique: true
|
|
2566
2671
|
}
|
|
2567
2672
|
);
|
|
2568
|
-
var SchoolModel =
|
|
2673
|
+
var SchoolModel = import_mongoose35.default.models.School || import_mongoose35.default.model("School", schema26);
|
|
2569
2674
|
|
|
2570
2675
|
// src/mongoose/Affiliate.ts
|
|
2571
|
-
var
|
|
2572
|
-
var
|
|
2573
|
-
var
|
|
2574
|
-
var affiliateRewardSchema = new
|
|
2676
|
+
var import_cluemart_shared23 = require("@timardex/cluemart-shared");
|
|
2677
|
+
var import_mongoose36 = __toESM(require("mongoose"));
|
|
2678
|
+
var MongooseSchema31 = import_mongoose36.default.Schema;
|
|
2679
|
+
var affiliateRewardSchema = new MongooseSchema31(
|
|
2575
2680
|
{
|
|
2576
2681
|
createdAt: { required: true, type: Date },
|
|
2577
2682
|
redeemedAt: { default: null, required: false, type: Date },
|
|
2578
2683
|
rewardDescription: { required: true, type: String },
|
|
2579
2684
|
rewardType: {
|
|
2580
|
-
enum: Object.values(
|
|
2685
|
+
enum: Object.values(import_cluemart_shared23.EnumAffiliateRewardType),
|
|
2581
2686
|
required: true,
|
|
2582
2687
|
type: String
|
|
2583
2688
|
},
|
|
@@ -2585,13 +2690,13 @@ var affiliateRewardSchema = new MongooseSchema29(
|
|
|
2585
2690
|
},
|
|
2586
2691
|
{ _id: false }
|
|
2587
2692
|
);
|
|
2588
|
-
var affiliateResourceSchema = new
|
|
2693
|
+
var affiliateResourceSchema = new MongooseSchema31(
|
|
2589
2694
|
{
|
|
2590
2695
|
resourceActive: { default: true, required: true, type: Boolean },
|
|
2591
2696
|
resourceDeletedAt: { default: null, required: false, type: Date },
|
|
2592
2697
|
resourceId: {
|
|
2593
2698
|
required: true,
|
|
2594
|
-
type:
|
|
2699
|
+
type: import_mongoose36.default.Schema.Types.ObjectId
|
|
2595
2700
|
},
|
|
2596
2701
|
resourceName: { required: true, type: String },
|
|
2597
2702
|
resourceOwner: {
|
|
@@ -2599,7 +2704,7 @@ var affiliateResourceSchema = new MongooseSchema29(
|
|
|
2599
2704
|
type: OwnerTypeSchema
|
|
2600
2705
|
},
|
|
2601
2706
|
resourceType: {
|
|
2602
|
-
enum: Object.values(
|
|
2707
|
+
enum: Object.values(import_cluemart_shared23.EnumResourceType),
|
|
2603
2708
|
required: true,
|
|
2604
2709
|
type: String
|
|
2605
2710
|
},
|
|
@@ -2611,20 +2716,20 @@ var affiliateResourceSchema = new MongooseSchema29(
|
|
|
2611
2716
|
},
|
|
2612
2717
|
{ _id: false }
|
|
2613
2718
|
);
|
|
2614
|
-
var affiliateContactDetailsSchema = new
|
|
2719
|
+
var affiliateContactDetailsSchema = new MongooseSchema31(
|
|
2615
2720
|
{
|
|
2616
2721
|
mobilePhone: { required: true, type: String }
|
|
2617
2722
|
},
|
|
2618
2723
|
{ _id: false }
|
|
2619
2724
|
);
|
|
2620
|
-
var affiliateBankAccountDetailsSchema = new
|
|
2725
|
+
var affiliateBankAccountDetailsSchema = new MongooseSchema31(
|
|
2621
2726
|
{
|
|
2622
2727
|
accountHolderName: { required: true, type: String },
|
|
2623
2728
|
accountNumber: { required: true, type: String }
|
|
2624
2729
|
},
|
|
2625
2730
|
{ _id: false }
|
|
2626
2731
|
);
|
|
2627
|
-
var affiliateDetailsSchema = new
|
|
2732
|
+
var affiliateDetailsSchema = new MongooseSchema31(
|
|
2628
2733
|
{
|
|
2629
2734
|
bankAccountDetails: {
|
|
2630
2735
|
required: true,
|
|
@@ -2637,7 +2742,7 @@ var affiliateDetailsSchema = new MongooseSchema29(
|
|
|
2637
2742
|
lastName: { required: true, type: String },
|
|
2638
2743
|
location: { required: true, type: locationsSchema },
|
|
2639
2744
|
participantType: {
|
|
2640
|
-
enum: Object.values(
|
|
2745
|
+
enum: Object.values(import_cluemart_shared23.EnumAffiliateParticipantType),
|
|
2641
2746
|
required: true,
|
|
2642
2747
|
type: String
|
|
2643
2748
|
},
|
|
@@ -2646,7 +2751,7 @@ var affiliateDetailsSchema = new MongooseSchema29(
|
|
|
2646
2751
|
},
|
|
2647
2752
|
{ _id: false }
|
|
2648
2753
|
);
|
|
2649
|
-
var redeemHistorySchema = new
|
|
2754
|
+
var redeemHistorySchema = new MongooseSchema31(
|
|
2650
2755
|
{
|
|
2651
2756
|
paidAt: { default: null, required: false, type: Date },
|
|
2652
2757
|
redeemedAt: { required: true, type: Date },
|
|
@@ -2654,7 +2759,7 @@ var redeemHistorySchema = new MongooseSchema29(
|
|
|
2654
2759
|
},
|
|
2655
2760
|
{ _id: false }
|
|
2656
2761
|
);
|
|
2657
|
-
var
|
|
2762
|
+
var schema27 = new MongooseSchema31(
|
|
2658
2763
|
{
|
|
2659
2764
|
active: { default: false, required: true, type: Boolean },
|
|
2660
2765
|
affiliateBonusRewards: {
|
|
@@ -2684,26 +2789,26 @@ var schema25 = new MongooseSchema29(
|
|
|
2684
2789
|
},
|
|
2685
2790
|
{ timestamps: true }
|
|
2686
2791
|
);
|
|
2687
|
-
|
|
2792
|
+
schema27.index(
|
|
2688
2793
|
{ affiliateCode: 1 },
|
|
2689
2794
|
{
|
|
2690
2795
|
partialFilterExpression: { active: true, deletedAt: null },
|
|
2691
2796
|
unique: true
|
|
2692
2797
|
}
|
|
2693
2798
|
);
|
|
2694
|
-
var AffiliateModel =
|
|
2799
|
+
var AffiliateModel = import_mongoose36.default.models.Affiliate || import_mongoose36.default.model("Affiliate", schema27);
|
|
2695
2800
|
|
|
2696
2801
|
// src/mongoose/Coupon.ts
|
|
2697
|
-
var
|
|
2698
|
-
var
|
|
2699
|
-
var
|
|
2700
|
-
var couponOptionSchema = new
|
|
2802
|
+
var import_cluemart_shared24 = require("@timardex/cluemart-shared");
|
|
2803
|
+
var import_mongoose37 = __toESM(require("mongoose"));
|
|
2804
|
+
var MongooseSchema32 = import_mongoose37.default.Schema;
|
|
2805
|
+
var couponOptionSchema = new MongooseSchema32(
|
|
2701
2806
|
{
|
|
2702
2807
|
buy: { required: false, type: Number },
|
|
2703
2808
|
get: { required: false, type: Number },
|
|
2704
2809
|
maxRewardCount: { required: false, type: Number },
|
|
2705
2810
|
type: {
|
|
2706
|
-
enum: Object.values(
|
|
2811
|
+
enum: Object.values(import_cluemart_shared24.EnumCouponQualificationType),
|
|
2707
2812
|
required: true,
|
|
2708
2813
|
type: String
|
|
2709
2814
|
},
|
|
@@ -2712,29 +2817,29 @@ var couponOptionSchema = new MongooseSchema30(
|
|
|
2712
2817
|
},
|
|
2713
2818
|
{ _id: false }
|
|
2714
2819
|
);
|
|
2715
|
-
var couponVendorProductSchema = new
|
|
2820
|
+
var couponVendorProductSchema = new MongooseSchema32(
|
|
2716
2821
|
{
|
|
2717
2822
|
couponId: {
|
|
2718
2823
|
required: true,
|
|
2719
|
-
type:
|
|
2824
|
+
type: import_mongoose37.default.Schema.Types.ObjectId
|
|
2720
2825
|
},
|
|
2721
2826
|
productId: {
|
|
2722
2827
|
required: true,
|
|
2723
|
-
type:
|
|
2828
|
+
type: import_mongoose37.default.Schema.Types.ObjectId
|
|
2724
2829
|
},
|
|
2725
2830
|
vendorCouponId: {
|
|
2726
2831
|
required: false,
|
|
2727
|
-
type:
|
|
2832
|
+
type: import_mongoose37.default.Schema.Types.ObjectId
|
|
2728
2833
|
},
|
|
2729
2834
|
vendorId: {
|
|
2730
2835
|
ref: "Vendor",
|
|
2731
2836
|
required: true,
|
|
2732
|
-
type:
|
|
2837
|
+
type: import_mongoose37.default.Schema.Types.ObjectId
|
|
2733
2838
|
}
|
|
2734
2839
|
},
|
|
2735
2840
|
{ _id: false }
|
|
2736
2841
|
);
|
|
2737
|
-
var couponCodeSchema = new
|
|
2842
|
+
var couponCodeSchema = new MongooseSchema32(
|
|
2738
2843
|
{
|
|
2739
2844
|
code: { required: true, type: String },
|
|
2740
2845
|
qrCode: { required: true, type: ResourceImageTypeSchema },
|
|
@@ -2742,7 +2847,7 @@ var couponCodeSchema = new MongooseSchema30(
|
|
|
2742
2847
|
},
|
|
2743
2848
|
{ _id: false }
|
|
2744
2849
|
);
|
|
2745
|
-
var couponParticipantUserSchema = new
|
|
2850
|
+
var couponParticipantUserSchema = new MongooseSchema32(
|
|
2746
2851
|
{
|
|
2747
2852
|
couponCollectedCount: { default: 0, required: true, type: Number },
|
|
2748
2853
|
couponCycleRedeemed: { default: false, required: true, type: Boolean },
|
|
@@ -2751,12 +2856,12 @@ var couponParticipantUserSchema = new MongooseSchema30(
|
|
|
2751
2856
|
userId: {
|
|
2752
2857
|
ref: "User",
|
|
2753
2858
|
required: true,
|
|
2754
|
-
type:
|
|
2859
|
+
type: import_mongoose37.default.Schema.Types.ObjectId
|
|
2755
2860
|
}
|
|
2756
2861
|
},
|
|
2757
2862
|
{ timestamps: true }
|
|
2758
2863
|
);
|
|
2759
|
-
var couponDataSchema = new
|
|
2864
|
+
var couponDataSchema = new MongooseSchema32(
|
|
2760
2865
|
{
|
|
2761
2866
|
active: { default: true, required: true, type: Boolean },
|
|
2762
2867
|
couponCode: { required: false, type: couponCodeSchema },
|
|
@@ -2775,7 +2880,7 @@ var couponDataSchema = new MongooseSchema30(
|
|
|
2775
2880
|
},
|
|
2776
2881
|
resourceId: { required: true, type: String },
|
|
2777
2882
|
resourceType: {
|
|
2778
|
-
enum: Object.values(
|
|
2883
|
+
enum: Object.values(import_cluemart_shared24.EnumResourceType),
|
|
2779
2884
|
required: true,
|
|
2780
2885
|
type: String
|
|
2781
2886
|
},
|
|
@@ -2783,7 +2888,7 @@ var couponDataSchema = new MongooseSchema30(
|
|
|
2783
2888
|
},
|
|
2784
2889
|
{ timestamps: true }
|
|
2785
2890
|
);
|
|
2786
|
-
var
|
|
2891
|
+
var schema28 = new MongooseSchema32(
|
|
2787
2892
|
{
|
|
2788
2893
|
active: { default: true, required: true, type: Boolean },
|
|
2789
2894
|
couponData: { default: [], required: false, type: [couponDataSchema] },
|
|
@@ -2795,62 +2900,62 @@ var schema26 = new MongooseSchema30(
|
|
|
2795
2900
|
},
|
|
2796
2901
|
{ timestamps: true }
|
|
2797
2902
|
);
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
var CouponModel =
|
|
2903
|
+
schema28.index({ active: 1, deletedAt: 1, "owner.userId": 1 });
|
|
2904
|
+
schema28.index({ "couponData.participantUsers.userId": 1 });
|
|
2905
|
+
var CouponModel = import_mongoose37.default.models.Coupon || import_mongoose37.default.model("Coupon", schema28);
|
|
2801
2906
|
|
|
2802
2907
|
// src/mongoose/Impersonation.ts
|
|
2803
|
-
var
|
|
2804
|
-
var
|
|
2805
|
-
var
|
|
2806
|
-
var impersonationSessionSchema = new
|
|
2908
|
+
var import_cluemart_shared25 = require("@timardex/cluemart-shared");
|
|
2909
|
+
var import_mongoose38 = __toESM(require("mongoose"));
|
|
2910
|
+
var MongooseSchema33 = import_mongoose38.default.Schema;
|
|
2911
|
+
var impersonationSessionSchema = new MongooseSchema33(
|
|
2807
2912
|
{
|
|
2808
2913
|
expiresAt: { expires: 0, required: true, type: Date },
|
|
2809
2914
|
impersonatedUserId: {
|
|
2810
2915
|
index: true,
|
|
2811
2916
|
ref: "User",
|
|
2812
2917
|
required: true,
|
|
2813
|
-
type:
|
|
2918
|
+
type: import_mongoose38.default.Schema.Types.ObjectId
|
|
2814
2919
|
},
|
|
2815
2920
|
impersonatorUserId: {
|
|
2816
2921
|
index: true,
|
|
2817
2922
|
ref: "User",
|
|
2818
2923
|
required: true,
|
|
2819
|
-
type:
|
|
2924
|
+
type: import_mongoose38.default.Schema.Types.ObjectId
|
|
2820
2925
|
},
|
|
2821
2926
|
refreshToken: { required: true, type: String }
|
|
2822
2927
|
},
|
|
2823
2928
|
{ timestamps: true }
|
|
2824
2929
|
);
|
|
2825
|
-
var ImpersonationSessionModel =
|
|
2930
|
+
var ImpersonationSessionModel = import_mongoose38.default.models.ImpersonationSession || import_mongoose38.default.model(
|
|
2826
2931
|
"ImpersonationSession",
|
|
2827
2932
|
impersonationSessionSchema
|
|
2828
2933
|
);
|
|
2829
|
-
var impersonationAuditSchema = new
|
|
2934
|
+
var impersonationAuditSchema = new MongooseSchema33(
|
|
2830
2935
|
{
|
|
2831
2936
|
action: { enum: ["start", "end"], required: true, type: String },
|
|
2832
2937
|
endReason: { type: String },
|
|
2833
2938
|
impersonatedUserId: {
|
|
2834
2939
|
ref: "User",
|
|
2835
2940
|
required: true,
|
|
2836
|
-
type:
|
|
2941
|
+
type: import_mongoose38.default.Schema.Types.ObjectId
|
|
2837
2942
|
},
|
|
2838
2943
|
impersonatorUserId: {
|
|
2839
2944
|
ref: "User",
|
|
2840
2945
|
required: true,
|
|
2841
|
-
type:
|
|
2946
|
+
type: import_mongoose38.default.Schema.Types.ObjectId
|
|
2842
2947
|
},
|
|
2843
|
-
resourceId: { type:
|
|
2844
|
-
resourceType: { enum: Object.values(
|
|
2948
|
+
resourceId: { type: import_mongoose38.default.Schema.Types.ObjectId },
|
|
2949
|
+
resourceType: { enum: Object.values(import_cluemart_shared25.EnumResourceType), type: String },
|
|
2845
2950
|
sessionId: {
|
|
2846
2951
|
ref: "ImpersonationSession",
|
|
2847
2952
|
required: true,
|
|
2848
|
-
type:
|
|
2953
|
+
type: import_mongoose38.default.Schema.Types.ObjectId
|
|
2849
2954
|
}
|
|
2850
2955
|
},
|
|
2851
2956
|
{ timestamps: true }
|
|
2852
2957
|
);
|
|
2853
|
-
var ImpersonationAuditModel =
|
|
2958
|
+
var ImpersonationAuditModel = import_mongoose38.default.models.ImpersonationAudit || import_mongoose38.default.model(
|
|
2854
2959
|
"ImpersonationAudit",
|
|
2855
2960
|
impersonationAuditSchema
|
|
2856
2961
|
);
|
|
@@ -2871,7 +2976,7 @@ async function activeAffiliateCodeExists(affiliateCode) {
|
|
|
2871
2976
|
}
|
|
2872
2977
|
|
|
2873
2978
|
// src/service/affiliate/awardAffiliateVendorSubscriptionRewards.ts
|
|
2874
|
-
var
|
|
2979
|
+
var import_cluemart_shared27 = require("@timardex/cluemart-shared");
|
|
2875
2980
|
var import_utils3 = require("@timardex/cluemart-shared/utils");
|
|
2876
2981
|
|
|
2877
2982
|
// src/service/saveNotificationsInDb.ts
|
|
@@ -3006,7 +3111,7 @@ async function sendPushNotifications({
|
|
|
3006
3111
|
}
|
|
3007
3112
|
|
|
3008
3113
|
// src/service/affiliate/vendorSubscriptionRewards.ts
|
|
3009
|
-
var
|
|
3114
|
+
var import_cluemart_shared26 = require("@timardex/cluemart-shared");
|
|
3010
3115
|
var import_dayjs = __toESM(require("dayjs"));
|
|
3011
3116
|
var import_timezone = __toESM(require("dayjs/plugin/timezone"));
|
|
3012
3117
|
var import_utc = __toESM(require("dayjs/plugin/utc"));
|
|
@@ -3064,17 +3169,17 @@ async function getPayingEventStripeSubscriptionPlan(userId, now = /* @__PURE__ *
|
|
|
3064
3169
|
// src/service/affiliate/vendorSubscriptionRewards.ts
|
|
3065
3170
|
import_dayjs.default.extend(import_utc.default);
|
|
3066
3171
|
import_dayjs.default.extend(import_timezone.default);
|
|
3067
|
-
var SUBSCRIPTION_REWARD_TIMEZONE =
|
|
3172
|
+
var SUBSCRIPTION_REWARD_TIMEZONE = import_cluemart_shared26.NZ_TZ;
|
|
3068
3173
|
async function mapVendorLicenceToSubscriptionRewardType(userId, now = /* @__PURE__ */ new Date()) {
|
|
3069
3174
|
const { hasSubscription, validTypes } = await getVendorStripeSubscriptionPlanForRewards(userId, now);
|
|
3070
|
-
if (validTypes.has(
|
|
3175
|
+
if (validTypes.has(import_cluemart_shared26.EnumUserLicence.PRO_VENDOR) || validTypes.has(import_cluemart_shared26.EnumUserLicence.PRO_PLUS_VENDOR)) {
|
|
3071
3176
|
if (hasSubscription) {
|
|
3072
|
-
return
|
|
3177
|
+
return import_cluemart_shared26.EnumAffiliateRewardType.ACTIVE_VENDOR_PRO_SUBSCRIPTION;
|
|
3073
3178
|
}
|
|
3074
|
-
return
|
|
3179
|
+
return import_cluemart_shared26.EnumAffiliateRewardType.ACTIVE_VENDOR_STANDARD_SUBSCRIPTION;
|
|
3075
3180
|
}
|
|
3076
|
-
if (validTypes.has(
|
|
3077
|
-
return
|
|
3181
|
+
if (validTypes.has(import_cluemart_shared26.EnumUserLicence.STANDARD_VENDOR)) {
|
|
3182
|
+
return import_cluemart_shared26.EnumAffiliateRewardType.ACTIVE_VENDOR_STANDARD_SUBSCRIPTION;
|
|
3078
3183
|
}
|
|
3079
3184
|
return null;
|
|
3080
3185
|
}
|
|
@@ -3086,7 +3191,7 @@ function getSubscriptionRewardPeriodBounds(now = /* @__PURE__ */ new Date()) {
|
|
|
3086
3191
|
|
|
3087
3192
|
// src/service/affiliate/awardAffiliateVendorSubscriptionRewards.ts
|
|
3088
3193
|
function isEligibleVendorResource(resource) {
|
|
3089
|
-
return resource.resourceType ===
|
|
3194
|
+
return resource.resourceType === import_cluemart_shared27.EnumResourceType.VENDOR && resource.resourceActive === true && resource.resourceDeletedAt == null;
|
|
3090
3195
|
}
|
|
3091
3196
|
async function findAffiliatesWithActiveVendorReferrals() {
|
|
3092
3197
|
return await AffiliateModel.find({
|
|
@@ -3095,7 +3200,7 @@ async function findAffiliatesWithActiveVendorReferrals() {
|
|
|
3095
3200
|
$elemMatch: {
|
|
3096
3201
|
resourceActive: true,
|
|
3097
3202
|
resourceDeletedAt: null,
|
|
3098
|
-
resourceType:
|
|
3203
|
+
resourceType: import_cluemart_shared27.EnumResourceType.VENDOR
|
|
3099
3204
|
}
|
|
3100
3205
|
},
|
|
3101
3206
|
deletedAt: null
|
|
@@ -3129,11 +3234,11 @@ async function notifyAffiliateOwnerOfSubscriptionReward({
|
|
|
3129
3234
|
data: {
|
|
3130
3235
|
resourceId: String(affiliateId),
|
|
3131
3236
|
resourceName: resourceNames.join(", "),
|
|
3132
|
-
resourceType:
|
|
3237
|
+
resourceType: import_cluemart_shared27.EnumNotificationResourceType.AFFILIATE_REWARD_RECEIVED
|
|
3133
3238
|
},
|
|
3134
3239
|
message,
|
|
3135
3240
|
title: "Affiliate points earned",
|
|
3136
|
-
type:
|
|
3241
|
+
type: import_cluemart_shared27.EnumNotificationType.SYSTEM,
|
|
3137
3242
|
userIds: [affiliateOwnerUserId]
|
|
3138
3243
|
};
|
|
3139
3244
|
try {
|
|
@@ -3162,7 +3267,7 @@ async function tryAwardSubscriptionReward({
|
|
|
3162
3267
|
resourceActive: true,
|
|
3163
3268
|
resourceDeletedAt: null,
|
|
3164
3269
|
resourceId: resource.resourceId,
|
|
3165
|
-
resourceType:
|
|
3270
|
+
resourceType: import_cluemart_shared27.EnumResourceType.VENDOR,
|
|
3166
3271
|
rewards: {
|
|
3167
3272
|
$not: {
|
|
3168
3273
|
$elemMatch: {
|
|
@@ -3283,7 +3388,7 @@ function normalizeAffiliatePromoCodes(promoCodes) {
|
|
|
3283
3388
|
}
|
|
3284
3389
|
|
|
3285
3390
|
// src/service/database.ts
|
|
3286
|
-
var
|
|
3391
|
+
var import_mongoose42 = __toESM(require("mongoose"));
|
|
3287
3392
|
var connectToDatabase = async ({
|
|
3288
3393
|
appName,
|
|
3289
3394
|
dbName,
|
|
@@ -3296,7 +3401,7 @@ var connectToDatabase = async ({
|
|
|
3296
3401
|
// Fallback to MongoDB Atlas connection string
|
|
3297
3402
|
`mongodb+srv://${dbUser}:${dbPassword}@${dbName}.mongodb.net/?retryWrites=true&w=majority&appName=${appName}`
|
|
3298
3403
|
);
|
|
3299
|
-
await
|
|
3404
|
+
await import_mongoose42.default.connect(mongoUri);
|
|
3300
3405
|
const connectionType = mongodbUri ? "Local MongoDB" : "MongoDB Atlas";
|
|
3301
3406
|
console.log(
|
|
3302
3407
|
`${connectionType} connected from server/src/service/database.ts`
|
|
@@ -3309,7 +3414,7 @@ var connectToDatabase = async ({
|
|
|
3309
3414
|
|
|
3310
3415
|
// src/types/index.ts
|
|
3311
3416
|
var import_express = __toESM(require("express"));
|
|
3312
|
-
var
|
|
3417
|
+
var import_mongoose43 = __toESM(require("mongoose"));
|
|
3313
3418
|
var EnumPubSubEvents = /* @__PURE__ */ ((EnumPubSubEvents2) => {
|
|
3314
3419
|
EnumPubSubEvents2["GET_CHAT_MESSAGE"] = "GET_CHAT_MESSAGE";
|
|
3315
3420
|
EnumPubSubEvents2["GET_NOTIFICATIONS"] = "GET_NOTIFICATIONS";
|
|
@@ -3364,9 +3469,9 @@ async function notifyUsers({
|
|
|
3364
3469
|
}
|
|
3365
3470
|
|
|
3366
3471
|
// src/service/updateAdStatus.ts
|
|
3367
|
-
var
|
|
3472
|
+
var import_cluemart_shared28 = require("@timardex/cluemart-shared");
|
|
3368
3473
|
async function updateAdStatuses() {
|
|
3369
|
-
const now = (0,
|
|
3474
|
+
const now = (0, import_cluemart_shared28.nzDayKey)();
|
|
3370
3475
|
const invalidResult = await AdModel.updateMany(
|
|
3371
3476
|
{
|
|
3372
3477
|
$or: [
|
|
@@ -3374,50 +3479,50 @@ async function updateAdStatuses() {
|
|
|
3374
3479
|
{ end: { $exists: false } },
|
|
3375
3480
|
{ $expr: { $gt: ["$start", "$end"] } }
|
|
3376
3481
|
],
|
|
3377
|
-
status: { $ne:
|
|
3482
|
+
status: { $ne: import_cluemart_shared28.EnumAdStatus.PAUSED }
|
|
3378
3483
|
},
|
|
3379
|
-
{ $set: { status:
|
|
3484
|
+
{ $set: { status: import_cluemart_shared28.EnumAdStatus.PAUSED } }
|
|
3380
3485
|
);
|
|
3381
3486
|
const expiredResult = await AdModel.updateMany(
|
|
3382
|
-
{ end: { $lte: now }, status: { $ne:
|
|
3383
|
-
{ $set: { status:
|
|
3487
|
+
{ end: { $lte: now }, status: { $ne: import_cluemart_shared28.EnumAdStatus.EXPIRED } },
|
|
3488
|
+
{ $set: { status: import_cluemart_shared28.EnumAdStatus.EXPIRED } }
|
|
3384
3489
|
);
|
|
3385
3490
|
const eligibleBooking = {
|
|
3386
3491
|
$or: [
|
|
3387
3492
|
{ bookingKind: { $exists: false } },
|
|
3388
3493
|
{ bookingKind: null },
|
|
3389
3494
|
{
|
|
3390
|
-
approvalStatus:
|
|
3391
|
-
bookingKind:
|
|
3495
|
+
approvalStatus: import_cluemart_shared28.EnumAdApprovalStatus.APPROVED,
|
|
3496
|
+
bookingKind: import_cluemart_shared28.EnumAdBookingSlotKind.RESERVED
|
|
3392
3497
|
},
|
|
3393
3498
|
{
|
|
3394
|
-
approvalStatus:
|
|
3395
|
-
bookingKind:
|
|
3396
|
-
paymentStatus:
|
|
3499
|
+
approvalStatus: import_cluemart_shared28.EnumAdApprovalStatus.APPROVED,
|
|
3500
|
+
bookingKind: import_cluemart_shared28.EnumAdBookingSlotKind.PAID,
|
|
3501
|
+
paymentStatus: import_cluemart_shared28.EnumAdPaymentStatus.PAID
|
|
3397
3502
|
}
|
|
3398
3503
|
]
|
|
3399
3504
|
};
|
|
3400
3505
|
const awaitingApprovalResult = await AdModel.updateMany(
|
|
3401
3506
|
{
|
|
3402
3507
|
$nor: eligibleBooking.$or,
|
|
3403
|
-
bookingKind: { $in: Object.values(
|
|
3508
|
+
bookingKind: { $in: Object.values(import_cluemart_shared28.EnumAdBookingSlotKind) },
|
|
3404
3509
|
end: { $gt: now },
|
|
3405
|
-
status:
|
|
3510
|
+
status: import_cluemart_shared28.EnumAdStatus.ACTIVE
|
|
3406
3511
|
},
|
|
3407
|
-
{ $set: { status:
|
|
3512
|
+
{ $set: { status: import_cluemart_shared28.EnumAdStatus.PAUSED } }
|
|
3408
3513
|
);
|
|
3409
3514
|
const activeResult = await AdModel.updateMany(
|
|
3410
3515
|
{
|
|
3411
3516
|
end: { $gt: now },
|
|
3412
3517
|
start: { $lte: now },
|
|
3413
|
-
status: { $ne:
|
|
3518
|
+
status: { $ne: import_cluemart_shared28.EnumAdStatus.ACTIVE },
|
|
3414
3519
|
...eligibleBooking
|
|
3415
3520
|
},
|
|
3416
|
-
{ $set: { status:
|
|
3521
|
+
{ $set: { status: import_cluemart_shared28.EnumAdStatus.ACTIVE } }
|
|
3417
3522
|
);
|
|
3418
3523
|
const pausedResult = await AdModel.updateMany(
|
|
3419
|
-
{ start: { $gt: now }, status: { $ne:
|
|
3420
|
-
{ $set: { status:
|
|
3524
|
+
{ start: { $gt: now }, status: { $ne: import_cluemart_shared28.EnumAdStatus.PAUSED } },
|
|
3525
|
+
{ $set: { status: import_cluemart_shared28.EnumAdStatus.PAUSED } }
|
|
3421
3526
|
);
|
|
3422
3527
|
console.log(
|
|
3423
3528
|
`\u2705 Ad statuses updated: invalid=${invalidResult.modifiedCount}, expired=${expiredResult.modifiedCount}, awaitingApproval=${awaitingApprovalResult.modifiedCount}, active=${activeResult.modifiedCount}, paused=${pausedResult.modifiedCount}`
|
|
@@ -3425,15 +3530,15 @@ async function updateAdStatuses() {
|
|
|
3425
3530
|
}
|
|
3426
3531
|
|
|
3427
3532
|
// src/service/objectIdToString.ts
|
|
3428
|
-
var
|
|
3533
|
+
var import_mongoose45 = __toESM(require("mongoose"));
|
|
3429
3534
|
function isValidObjectId(value) {
|
|
3430
|
-
return
|
|
3535
|
+
return import_mongoose45.default.Types.ObjectId.isValid(value);
|
|
3431
3536
|
}
|
|
3432
3537
|
function convertObjectIdsToStrings(obj) {
|
|
3433
3538
|
if (obj === null || obj === void 0) {
|
|
3434
3539
|
return obj;
|
|
3435
3540
|
}
|
|
3436
|
-
if (obj instanceof
|
|
3541
|
+
if (obj instanceof import_mongoose45.default.Types.ObjectId) {
|
|
3437
3542
|
return obj.toString();
|
|
3438
3543
|
}
|
|
3439
3544
|
if (obj instanceof Date) {
|
|
@@ -3627,19 +3732,19 @@ function buildUserPointEntryRemovalPipeline(pointType, sourceId) {
|
|
|
3627
3732
|
}
|
|
3628
3733
|
|
|
3629
3734
|
// src/service/event/updateAllEventDateTimeStatuses.ts
|
|
3630
|
-
var
|
|
3735
|
+
var import_cluemart_shared30 = require("@timardex/cluemart-shared");
|
|
3631
3736
|
var import_dayjs4 = __toESM(require("dayjs"));
|
|
3632
3737
|
|
|
3633
3738
|
// src/service/event/archiveEndedEventDates.ts
|
|
3634
|
-
var
|
|
3739
|
+
var import_cluemart_shared29 = require("@timardex/cluemart-shared");
|
|
3635
3740
|
var import_dayjs3 = __toESM(require("dayjs"));
|
|
3636
3741
|
var import_customParseFormat = __toESM(require("dayjs/plugin/customParseFormat"));
|
|
3637
3742
|
import_dayjs3.default.extend(import_customParseFormat.default);
|
|
3638
3743
|
var ARCHIVED_STATUSES = /* @__PURE__ */ new Set([
|
|
3639
|
-
|
|
3744
|
+
import_cluemart_shared29.EnumEventDateStatus.ENDED
|
|
3640
3745
|
]);
|
|
3641
3746
|
var DISCARDED_STATUSES = /* @__PURE__ */ new Set([
|
|
3642
|
-
|
|
3747
|
+
import_cluemart_shared29.EnumEventDateStatus.INVALID
|
|
3643
3748
|
]);
|
|
3644
3749
|
function splitEventDatesForArchive(dateTime) {
|
|
3645
3750
|
return {
|
|
@@ -3662,12 +3767,12 @@ function dedupeArchivedSlotsByStartDateTime(slots) {
|
|
|
3662
3767
|
});
|
|
3663
3768
|
}
|
|
3664
3769
|
function isPastCanceledEventDate(slot, now) {
|
|
3665
|
-
if (slot.dateStatus !==
|
|
3770
|
+
if (slot.dateStatus !== import_cluemart_shared29.EnumEventDateStatus.CANCELED) {
|
|
3666
3771
|
return false;
|
|
3667
3772
|
}
|
|
3668
3773
|
const endDateTime = (0, import_dayjs3.default)(
|
|
3669
3774
|
`${slot.endDate} ${slot.endTime}`,
|
|
3670
|
-
`${
|
|
3775
|
+
`${import_cluemart_shared29.dateFormat} ${import_cluemart_shared29.timeFormat}`,
|
|
3671
3776
|
true
|
|
3672
3777
|
);
|
|
3673
3778
|
return endDateTime.isValid() && endDateTime.isBefore(now);
|
|
@@ -3713,7 +3818,7 @@ async function updateModelDateTimeStatuses(model, now) {
|
|
|
3713
3818
|
try {
|
|
3714
3819
|
for await (const doc of cursor) {
|
|
3715
3820
|
const dateTime = doc.dateTime.map(
|
|
3716
|
-
(slot) => (0,
|
|
3821
|
+
(slot) => (0, import_cluemart_shared30.updateSingleDateTimeStatus)(slot, now)
|
|
3717
3822
|
);
|
|
3718
3823
|
if (!hasDateTimeStatusChanges(doc.dateTime, dateTime)) {
|
|
3719
3824
|
continue;
|
|
@@ -3737,9 +3842,9 @@ async function updateModelDateTimeStatuses(model, now) {
|
|
|
3737
3842
|
var ARCHIVABLE_EVENT_FILTER = {
|
|
3738
3843
|
"dateTime.dateStatus": {
|
|
3739
3844
|
$in: [
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3845
|
+
import_cluemart_shared30.EnumEventDateStatus.ENDED,
|
|
3846
|
+
import_cluemart_shared30.EnumEventDateStatus.INVALID,
|
|
3847
|
+
import_cluemart_shared30.EnumEventDateStatus.CANCELED
|
|
3743
3848
|
]
|
|
3744
3849
|
},
|
|
3745
3850
|
deletedAt: null
|
|
@@ -3764,7 +3869,7 @@ async function archiveEndedAndDiscardInvalidEventDates(now) {
|
|
|
3764
3869
|
try {
|
|
3765
3870
|
for await (const doc of cursor) {
|
|
3766
3871
|
const updated = doc.dateTime.map(
|
|
3767
|
-
(slot) => (0,
|
|
3872
|
+
(slot) => (0, import_cluemart_shared30.updateSingleDateTimeStatus)(slot, now)
|
|
3768
3873
|
);
|
|
3769
3874
|
const { archive, discard } = splitEventDatesForArchive(updated);
|
|
3770
3875
|
const pastCanceled = updated.filter(
|
|
@@ -3788,13 +3893,13 @@ async function archiveEndedAndDiscardInvalidEventDates(now) {
|
|
|
3788
3893
|
if (archive.length > 0 || discard.length > 0) {
|
|
3789
3894
|
pullConditions.push({
|
|
3790
3895
|
dateStatus: {
|
|
3791
|
-
$in: [
|
|
3896
|
+
$in: [import_cluemart_shared30.EnumEventDateStatus.ENDED, import_cluemart_shared30.EnumEventDateStatus.INVALID]
|
|
3792
3897
|
}
|
|
3793
3898
|
});
|
|
3794
3899
|
}
|
|
3795
3900
|
for (const slot of pastCanceled) {
|
|
3796
3901
|
pullConditions.push({
|
|
3797
|
-
dateStatus:
|
|
3902
|
+
dateStatus: import_cluemart_shared30.EnumEventDateStatus.CANCELED,
|
|
3798
3903
|
startDate: slot.startDate,
|
|
3799
3904
|
startTime: slot.startTime
|
|
3800
3905
|
});
|
|
@@ -3836,9 +3941,9 @@ async function cleanEventInfoDates(now) {
|
|
|
3836
3941
|
try {
|
|
3837
3942
|
for await (const doc of cursor) {
|
|
3838
3943
|
const updated = doc.dateTime.map(
|
|
3839
|
-
(slot) => (0,
|
|
3944
|
+
(slot) => (0, import_cluemart_shared30.updateSingleDateTimeStatus)(slot, now)
|
|
3840
3945
|
);
|
|
3841
|
-
const kept = (0,
|
|
3946
|
+
const kept = (0, import_cluemart_shared30.filterDatesByFutureStatus)(updated);
|
|
3842
3947
|
if (kept.length === updated.length) {
|
|
3843
3948
|
continue;
|
|
3844
3949
|
}
|
|
@@ -3888,7 +3993,7 @@ async function updateAllEventDateTimeStatuses() {
|
|
|
3888
3993
|
}
|
|
3889
3994
|
|
|
3890
3995
|
// src/service/index.ts
|
|
3891
|
-
var
|
|
3996
|
+
var import_cluemart_shared38 = require("@timardex/cluemart-shared");
|
|
3892
3997
|
|
|
3893
3998
|
// src/service/event/findEventOrImportedMarketById.ts
|
|
3894
3999
|
async function findEventOrImportedMarketById(resourceId) {
|
|
@@ -3905,7 +4010,7 @@ async function findEventOrImportedMarketById(resourceId) {
|
|
|
3905
4010
|
}
|
|
3906
4011
|
|
|
3907
4012
|
// src/service/relations.ts
|
|
3908
|
-
var
|
|
4013
|
+
var import_cluemart_shared31 = require("@timardex/cluemart-shared");
|
|
3909
4014
|
function didRemoveAnyEventDates(previousDateTime, nextDateTime) {
|
|
3910
4015
|
if (!previousDateTime?.length) {
|
|
3911
4016
|
return false;
|
|
@@ -3921,8 +4026,8 @@ function didRemoveAnyStartedDates(previousDateTime, nextDateTime) {
|
|
|
3921
4026
|
return false;
|
|
3922
4027
|
}
|
|
3923
4028
|
return previousDateTime.some(
|
|
3924
|
-
(prev) => prev.dateStatus ===
|
|
3925
|
-
(next) => next.startDate === prev.startDate && next.startTime === prev.startTime && next.dateStatus ===
|
|
4029
|
+
(prev) => prev.dateStatus === import_cluemart_shared31.EnumEventDateStatus.STARTED && !nextDateTime?.some(
|
|
4030
|
+
(next) => next.startDate === prev.startDate && next.startTime === prev.startTime && next.dateStatus === import_cluemart_shared31.EnumEventDateStatus.STARTED
|
|
3926
4031
|
)
|
|
3927
4032
|
);
|
|
3928
4033
|
}
|
|
@@ -3933,7 +4038,7 @@ function updateRelationDatesToCanceled(relationDates, eventDateTime) {
|
|
|
3933
4038
|
) ?? false;
|
|
3934
4039
|
return {
|
|
3935
4040
|
...relationDate,
|
|
3936
|
-
status: existsInEvent ? relationDate.status :
|
|
4041
|
+
status: existsInEvent ? relationDate.status : import_cluemart_shared31.EnumInviteStatus.CANCELED
|
|
3937
4042
|
};
|
|
3938
4043
|
});
|
|
3939
4044
|
}
|
|
@@ -3942,15 +4047,15 @@ function updateRelationDatesToCanceled(relationDates, eventDateTime) {
|
|
|
3942
4047
|
var import_dayjs8 = __toESM(require("dayjs"));
|
|
3943
4048
|
|
|
3944
4049
|
// src/service/license/compliance/utils.ts
|
|
3945
|
-
var
|
|
4050
|
+
var import_cluemart_shared36 = require("@timardex/cluemart-shared");
|
|
3946
4051
|
var import_dayjs7 = __toESM(require("dayjs"));
|
|
3947
4052
|
|
|
3948
4053
|
// src/service/license/compliance/event.ts
|
|
3949
|
-
var
|
|
4054
|
+
var import_cluemart_shared32 = require("@timardex/cluemart-shared");
|
|
3950
4055
|
var eventLicences = [
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
4056
|
+
import_cluemart_shared32.EnumUserLicence.STANDARD_EVENT,
|
|
4057
|
+
import_cluemart_shared32.EnumUserLicence.PRO_EVENT,
|
|
4058
|
+
import_cluemart_shared32.EnumUserLicence.PRO_PLUS_EVENT
|
|
3954
4059
|
];
|
|
3955
4060
|
async function handleEventLicenceCompliance(user, now) {
|
|
3956
4061
|
if (!user.licences || !user.events?.length) {
|
|
@@ -4162,9 +4267,9 @@ function buildLicenceExpiryPipeline(params) {
|
|
|
4162
4267
|
}
|
|
4163
4268
|
|
|
4164
4269
|
// src/service/license/compliance/partner.ts
|
|
4165
|
-
var
|
|
4270
|
+
var import_cluemart_shared33 = require("@timardex/cluemart-shared");
|
|
4166
4271
|
var partnerLicences = [
|
|
4167
|
-
|
|
4272
|
+
import_cluemart_shared33.EnumUserLicence.STANDARD_PARTNER
|
|
4168
4273
|
];
|
|
4169
4274
|
async function handlePartnerLicenceCompliance(user, now) {
|
|
4170
4275
|
if (!user.licences || !user.partner) {
|
|
@@ -4174,11 +4279,11 @@ async function handlePartnerLicenceCompliance(user, now) {
|
|
|
4174
4279
|
}
|
|
4175
4280
|
|
|
4176
4281
|
// src/service/license/compliance/vendor.ts
|
|
4177
|
-
var
|
|
4282
|
+
var import_cluemart_shared35 = require("@timardex/cluemart-shared");
|
|
4178
4283
|
var import_dayjs6 = __toESM(require("dayjs"));
|
|
4179
4284
|
|
|
4180
4285
|
// src/service/license/models.ts
|
|
4181
|
-
var
|
|
4286
|
+
var import_cluemart_shared34 = require("@timardex/cluemart-shared");
|
|
4182
4287
|
var import_dayjs5 = __toESM(require("dayjs"));
|
|
4183
4288
|
var import_graphql = require("graphql");
|
|
4184
4289
|
var LicenceCategory = /* @__PURE__ */ ((LicenceCategory2) => {
|
|
@@ -4190,31 +4295,31 @@ var LicenceCategory = /* @__PURE__ */ ((LicenceCategory2) => {
|
|
|
4190
4295
|
return LicenceCategory2;
|
|
4191
4296
|
})(LicenceCategory || {});
|
|
4192
4297
|
var licenceCategoryMapping = {
|
|
4193
|
-
[
|
|
4194
|
-
[
|
|
4195
|
-
[
|
|
4196
|
-
[
|
|
4197
|
-
[
|
|
4198
|
-
[
|
|
4199
|
-
[
|
|
4200
|
-
[
|
|
4201
|
-
[
|
|
4298
|
+
[import_cluemart_shared34.EnumUserLicence.PRO_EVENT]: "event" /* EVENT */,
|
|
4299
|
+
[import_cluemart_shared34.EnumUserLicence.PRO_PLUS_EVENT]: "event" /* EVENT */,
|
|
4300
|
+
[import_cluemart_shared34.EnumUserLicence.PRO_PLUS_VENDOR]: "vendor" /* VENDOR */,
|
|
4301
|
+
[import_cluemart_shared34.EnumUserLicence.PRO_VENDOR]: "vendor" /* VENDOR */,
|
|
4302
|
+
[import_cluemart_shared34.EnumUserLicence.STANDARD_EVENT]: "event" /* EVENT */,
|
|
4303
|
+
[import_cluemart_shared34.EnumUserLicence.STANDARD_PARTNER]: "partner" /* PARTNER */,
|
|
4304
|
+
[import_cluemart_shared34.EnumUserLicence.STANDARD_VENDOR]: "vendor" /* VENDOR */,
|
|
4305
|
+
[import_cluemart_shared34.EnumUserLicence.STANDARD_AFFILIATE]: "affiliate" /* AFFILIATE */,
|
|
4306
|
+
[import_cluemart_shared34.EnumUserLicence.STANDARD_SCHOOL]: "school" /* SCHOOL */
|
|
4202
4307
|
};
|
|
4203
4308
|
var licencePriority = {
|
|
4204
|
-
[
|
|
4205
|
-
[
|
|
4206
|
-
[
|
|
4207
|
-
[
|
|
4208
|
-
[
|
|
4209
|
-
[
|
|
4210
|
-
[
|
|
4211
|
-
[
|
|
4212
|
-
[
|
|
4309
|
+
[import_cluemart_shared34.EnumUserLicence.PRO_PLUS_EVENT]: 3,
|
|
4310
|
+
[import_cluemart_shared34.EnumUserLicence.PRO_EVENT]: 2,
|
|
4311
|
+
[import_cluemart_shared34.EnumUserLicence.STANDARD_EVENT]: 1,
|
|
4312
|
+
[import_cluemart_shared34.EnumUserLicence.PRO_PLUS_VENDOR]: 3,
|
|
4313
|
+
[import_cluemart_shared34.EnumUserLicence.PRO_VENDOR]: 2,
|
|
4314
|
+
[import_cluemart_shared34.EnumUserLicence.STANDARD_VENDOR]: 1,
|
|
4315
|
+
[import_cluemart_shared34.EnumUserLicence.STANDARD_PARTNER]: 1,
|
|
4316
|
+
[import_cluemart_shared34.EnumUserLicence.STANDARD_AFFILIATE]: 1,
|
|
4317
|
+
[import_cluemart_shared34.EnumUserLicence.STANDARD_SCHOOL]: 1
|
|
4213
4318
|
};
|
|
4214
4319
|
var standardLicences = [
|
|
4215
|
-
|
|
4216
|
-
|
|
4217
|
-
|
|
4320
|
+
import_cluemart_shared34.EnumUserLicence.STANDARD_VENDOR,
|
|
4321
|
+
import_cluemart_shared34.EnumUserLicence.STANDARD_EVENT,
|
|
4322
|
+
import_cluemart_shared34.EnumUserLicence.STANDARD_PARTNER
|
|
4218
4323
|
];
|
|
4219
4324
|
var standardLicenceSet = new Set(standardLicences);
|
|
4220
4325
|
function isStandardLicence(licence) {
|
|
@@ -4228,11 +4333,11 @@ var categoryRegexMapping = {
|
|
|
4228
4333
|
["school" /* SCHOOL */]: /_school$/
|
|
4229
4334
|
};
|
|
4230
4335
|
var categoryFallbackLicence = {
|
|
4231
|
-
["event" /* EVENT */]:
|
|
4232
|
-
["partner" /* PARTNER */]:
|
|
4233
|
-
["vendor" /* VENDOR */]:
|
|
4234
|
-
["affiliate" /* AFFILIATE */]:
|
|
4235
|
-
["school" /* SCHOOL */]:
|
|
4336
|
+
["event" /* EVENT */]: import_cluemart_shared34.EnumUserLicence.STANDARD_EVENT,
|
|
4337
|
+
["partner" /* PARTNER */]: import_cluemart_shared34.EnumUserLicence.STANDARD_PARTNER,
|
|
4338
|
+
["vendor" /* VENDOR */]: import_cluemart_shared34.EnumUserLicence.STANDARD_VENDOR,
|
|
4339
|
+
["affiliate" /* AFFILIATE */]: import_cluemart_shared34.EnumUserLicence.STANDARD_AFFILIATE,
|
|
4340
|
+
["school" /* SCHOOL */]: import_cluemart_shared34.EnumUserLicence.STANDARD_SCHOOL
|
|
4236
4341
|
};
|
|
4237
4342
|
var LicenceFilterInput = {
|
|
4238
4343
|
INPUT_USER_LICENCES: "$licences"
|
|
@@ -4262,11 +4367,11 @@ function getHighestLicenceForCategory(licences, category) {
|
|
|
4262
4367
|
function createLicenceObject(expiryDate, licenceType) {
|
|
4263
4368
|
const today = (0, import_dayjs5.default)();
|
|
4264
4369
|
const expiryDateMapping = {
|
|
4265
|
-
[
|
|
4266
|
-
[
|
|
4267
|
-
[
|
|
4268
|
-
[
|
|
4269
|
-
[
|
|
4370
|
+
[import_cluemart_shared34.LicenceExpiryDate.ONE_YEAR]: today.add(1, "year").endOf("day").toDate(),
|
|
4371
|
+
[import_cluemart_shared34.LicenceExpiryDate.ONE_MONTH]: today.add(1, "month").endOf("day").toDate(),
|
|
4372
|
+
[import_cluemart_shared34.LicenceExpiryDate.TWO_MONTHS]: today.add(2, "month").endOf("day").toDate(),
|
|
4373
|
+
[import_cluemart_shared34.LicenceExpiryDate.THREE_MONTHS]: today.add(3, "month").endOf("day").toDate(),
|
|
4374
|
+
[import_cluemart_shared34.LicenceExpiryDate.SIX_MONTHS]: today.add(6, "month").endOf("day").toDate()
|
|
4270
4375
|
};
|
|
4271
4376
|
const licenceObject = {
|
|
4272
4377
|
expiryDate: expiryDateMapping[expiryDate],
|
|
@@ -4370,13 +4475,13 @@ async function checkOwnerHasLicence({
|
|
|
4370
4475
|
const owner = await UserModel.findById(userId);
|
|
4371
4476
|
if (!owner) throw new import_graphql.GraphQLError("Owner not found");
|
|
4372
4477
|
const categoryByResource = {
|
|
4373
|
-
[
|
|
4374
|
-
[
|
|
4375
|
-
[
|
|
4376
|
-
[
|
|
4377
|
-
[
|
|
4478
|
+
[import_cluemart_shared34.EnumResourceType.EVENT]: "event" /* EVENT */,
|
|
4479
|
+
[import_cluemart_shared34.EnumResourceType.PARTNER]: "partner" /* PARTNER */,
|
|
4480
|
+
[import_cluemart_shared34.EnumResourceType.VENDOR]: "vendor" /* VENDOR */,
|
|
4481
|
+
[import_cluemart_shared34.EnumResourceType.AFFILIATE]: "affiliate" /* AFFILIATE */,
|
|
4482
|
+
[import_cluemart_shared34.EnumResourceType.SCHOOL]: "school" /* SCHOOL */
|
|
4378
4483
|
};
|
|
4379
|
-
if (!(0,
|
|
4484
|
+
if (!(0, import_cluemart_shared34.isNonVisitorResourceType)(resourceType)) {
|
|
4380
4485
|
throw new import_graphql.GraphQLError(`Invalid resource type: ${resourceType}.`);
|
|
4381
4486
|
}
|
|
4382
4487
|
const requiredCategory = categoryByResource[resourceType];
|
|
@@ -4456,7 +4561,7 @@ async function applyVendorDowngrade(vendor, ownerUserId) {
|
|
|
4456
4561
|
return (result?.matchedCount ?? 0) > 0;
|
|
4457
4562
|
}
|
|
4458
4563
|
async function downgradeVendorProFeatures(userId, licenceType) {
|
|
4459
|
-
const isStandardVendor = licenceType ===
|
|
4564
|
+
const isStandardVendor = licenceType === import_cluemart_shared35.EnumUserLicence.STANDARD_VENDOR;
|
|
4460
4565
|
if (!isStandardVendor) {
|
|
4461
4566
|
return;
|
|
4462
4567
|
}
|
|
@@ -4503,7 +4608,7 @@ async function applyVendorRestore(vendor, ownerUserId) {
|
|
|
4503
4608
|
return (result?.matchedCount ?? 0) > 0;
|
|
4504
4609
|
}
|
|
4505
4610
|
async function restoreVendorProFeatures(userId, licenceType) {
|
|
4506
|
-
const isProVendor = licenceType ===
|
|
4611
|
+
const isProVendor = licenceType === import_cluemart_shared35.EnumUserLicence.PRO_VENDOR || licenceType === import_cluemart_shared35.EnumUserLicence.PRO_PLUS_VENDOR;
|
|
4507
4612
|
if (!isProVendor) {
|
|
4508
4613
|
return;
|
|
4509
4614
|
}
|
|
@@ -4524,14 +4629,14 @@ function isProtectedByCurrentStripeSubscription(user, licenceType, now) {
|
|
|
4524
4629
|
return false;
|
|
4525
4630
|
}
|
|
4526
4631
|
const gracePeriodEndsAt = stripe.paymentGracePeriodEndsAt ? (0, import_dayjs6.default)(stripe.paymentGracePeriodEndsAt) : null;
|
|
4527
|
-
const hasActivePaymentGracePeriod = (stripe.status ===
|
|
4632
|
+
const hasActivePaymentGracePeriod = (stripe.status === import_cluemart_shared35.EnumSubscriptionStatus.PAST_DUE || stripe.status === import_cluemart_shared35.EnumSubscriptionStatus.INACTIVE) && Boolean(stripe.paymentGraceSubscriptionId) && (!stripe.subscriptionId || stripe.subscriptionId === stripe.paymentGraceSubscriptionId) && gracePeriodEndsAt !== null && gracePeriodEndsAt.isValid() && gracePeriodEndsAt.isAfter(now);
|
|
4528
4633
|
if (hasActivePaymentGracePeriod) {
|
|
4529
4634
|
return true;
|
|
4530
4635
|
}
|
|
4531
4636
|
if (!stripe.subscriptionId) {
|
|
4532
4637
|
return false;
|
|
4533
4638
|
}
|
|
4534
|
-
if (stripe.status !==
|
|
4639
|
+
if (stripe.status !== import_cluemart_shared35.EnumSubscriptionStatus.ACTIVE) {
|
|
4535
4640
|
return false;
|
|
4536
4641
|
}
|
|
4537
4642
|
if (!stripe.endDate) {
|
|
@@ -4551,7 +4656,7 @@ async function handleVendorLicenceCompliance(user, now) {
|
|
|
4551
4656
|
return;
|
|
4552
4657
|
}
|
|
4553
4658
|
const proLicences = vendorLicencesOfUser.filter(
|
|
4554
|
-
(licence) => licence.licenceType !==
|
|
4659
|
+
(licence) => licence.licenceType !== import_cluemart_shared35.EnumUserLicence.STANDARD_VENDOR
|
|
4555
4660
|
);
|
|
4556
4661
|
const expiredProLicences = proLicences.filter(
|
|
4557
4662
|
(licence) => !(0, import_dayjs6.default)(licence.expiryDate).isAfter(now)
|
|
@@ -4564,7 +4669,7 @@ async function handleVendorLicenceCompliance(user, now) {
|
|
|
4564
4669
|
const expiredProLicence = expiredProLicences.some(
|
|
4565
4670
|
(licence) => !stripeProtectedLicenceTypes.has(licence.licenceType)
|
|
4566
4671
|
);
|
|
4567
|
-
const hasValidProLicence = stripeProtectedLicenceTypes.size > 0 || hasValidLicence(proLicences,
|
|
4672
|
+
const hasValidProLicence = stripeProtectedLicenceTypes.size > 0 || hasValidLicence(proLicences, import_cluemart_shared35.vendorLicences, now);
|
|
4568
4673
|
const hasExpiredVendorLicence = vendorLicencesOfUser.some(
|
|
4569
4674
|
(licence) => !(0, import_dayjs6.default)(licence.expiryDate).isAfter(now) && !stripeProtectedLicenceTypes.has(licence.licenceType)
|
|
4570
4675
|
);
|
|
@@ -4580,7 +4685,7 @@ async function handleVendorLicenceCompliance(user, now) {
|
|
|
4580
4685
|
"owner.userId": user._id
|
|
4581
4686
|
}).lean().exec();
|
|
4582
4687
|
}
|
|
4583
|
-
const licencesToSync =
|
|
4688
|
+
const licencesToSync = import_cluemart_shared35.vendorLicences.filter(
|
|
4584
4689
|
(licenceType) => !stripeProtectedLicenceTypes.has(licenceType)
|
|
4585
4690
|
);
|
|
4586
4691
|
await syncUserLicencesAfterExpiry(user._id, licencesToSync, now, "downgrade");
|
|
@@ -4595,11 +4700,11 @@ async function handleVendorLicenceCompliance(user, now) {
|
|
|
4595
4700
|
data: {
|
|
4596
4701
|
resourceId: String(vendor._id),
|
|
4597
4702
|
resourceName: vendor.name,
|
|
4598
|
-
resourceType:
|
|
4703
|
+
resourceType: import_cluemart_shared35.EnumNotificationResourceType.DOWNGRADED_VENDOR
|
|
4599
4704
|
},
|
|
4600
4705
|
message: `Your Vendor licence has been downgraded due to licence expiration.`,
|
|
4601
4706
|
title: `Vendor Licence Downgraded`,
|
|
4602
|
-
type:
|
|
4707
|
+
type: import_cluemart_shared35.EnumNotificationType.SYSTEM,
|
|
4603
4708
|
userIds: [user._id]
|
|
4604
4709
|
};
|
|
4605
4710
|
await sendDeactivationNotification(payload, user._id, vendor.name, "vendor");
|
|
@@ -4632,7 +4737,7 @@ async function vendorOwnerHasProLicence(vendorId) {
|
|
|
4632
4737
|
effectiveVendorLicences,
|
|
4633
4738
|
"vendor" /* VENDOR */
|
|
4634
4739
|
);
|
|
4635
|
-
return highestVendorLicence !== null && licencePriority[highestVendorLicence] >= licencePriority[
|
|
4740
|
+
return highestVendorLicence !== null && licencePriority[highestVendorLicence] >= licencePriority[import_cluemart_shared35.EnumUserLicence.PRO_VENDOR];
|
|
4636
4741
|
}
|
|
4637
4742
|
|
|
4638
4743
|
// src/service/license/compliance/utils.ts
|
|
@@ -4642,12 +4747,12 @@ async function syncUserLicencesAfterExpiry(userId, licenceTypes, now, mode = "do
|
|
|
4642
4747
|
const pipeline = buildLicenceExpiryPipeline({
|
|
4643
4748
|
downgradeBranches: [
|
|
4644
4749
|
{
|
|
4645
|
-
case:
|
|
4646
|
-
then:
|
|
4750
|
+
case: import_cluemart_shared36.EnumUserLicence.PRO_PLUS_VENDOR,
|
|
4751
|
+
then: import_cluemart_shared36.EnumUserLicence.STANDARD_VENDOR
|
|
4647
4752
|
},
|
|
4648
4753
|
{
|
|
4649
|
-
case:
|
|
4650
|
-
then:
|
|
4754
|
+
case: import_cluemart_shared36.EnumUserLicence.PRO_VENDOR,
|
|
4755
|
+
then: import_cluemart_shared36.EnumUserLicence.STANDARD_VENDOR
|
|
4651
4756
|
}
|
|
4652
4757
|
],
|
|
4653
4758
|
licenceTypes,
|
|
@@ -4776,7 +4881,7 @@ var REMINDER_WINDOW_MIN_HOURS = 6.5 * 24;
|
|
|
4776
4881
|
var REMINDER_WINDOW_MAX_HOURS = 7.5 * 24;
|
|
4777
4882
|
|
|
4778
4883
|
// src/service/license/reminder/utils.ts
|
|
4779
|
-
var
|
|
4884
|
+
var import_cluemart_shared37 = require("@timardex/cluemart-shared");
|
|
4780
4885
|
var import_utils8 = require("@timardex/cluemart-shared/utils");
|
|
4781
4886
|
var import_dayjs9 = __toESM(require("dayjs"));
|
|
4782
4887
|
|
|
@@ -4842,28 +4947,28 @@ function isLicenseExpiringIn7Days(expiryDate, now) {
|
|
|
4842
4947
|
return hoursUntilExpiry >= REMINDER_WINDOW_MIN_HOURS && hoursUntilExpiry <= REMINDER_WINDOW_MAX_HOURS;
|
|
4843
4948
|
}
|
|
4844
4949
|
function getLicenseName(licenceType) {
|
|
4845
|
-
return
|
|
4950
|
+
return import_cluemart_shared37.licenseNiceNames[licenceType] || licenceType;
|
|
4846
4951
|
}
|
|
4847
4952
|
function getNotificationTypes(isVendorLicense, isPartnerLicense) {
|
|
4848
4953
|
if (isVendorLicense) {
|
|
4849
4954
|
return {
|
|
4850
|
-
notificationType:
|
|
4851
|
-
resourceType:
|
|
4955
|
+
notificationType: import_cluemart_shared37.EnumNotificationType.SYSTEM,
|
|
4956
|
+
resourceType: import_cluemart_shared37.EnumNotificationResourceType.EXPIRATION_REMINDER_VENDOR
|
|
4852
4957
|
};
|
|
4853
4958
|
}
|
|
4854
4959
|
if (isPartnerLicense) {
|
|
4855
4960
|
return {
|
|
4856
|
-
notificationType:
|
|
4857
|
-
resourceType:
|
|
4961
|
+
notificationType: import_cluemart_shared37.EnumNotificationType.SYSTEM,
|
|
4962
|
+
resourceType: import_cluemart_shared37.EnumNotificationResourceType.EXPIRATION_REMINDER_PARTNER
|
|
4858
4963
|
};
|
|
4859
4964
|
}
|
|
4860
4965
|
return {
|
|
4861
|
-
notificationType:
|
|
4862
|
-
resourceType:
|
|
4966
|
+
notificationType: import_cluemart_shared37.EnumNotificationType.SYSTEM,
|
|
4967
|
+
resourceType: import_cluemart_shared37.EnumNotificationResourceType.EXPIRATION_REMINDER_EVENT
|
|
4863
4968
|
};
|
|
4864
4969
|
}
|
|
4865
4970
|
async function getLicenseResourceInfo(user, licence) {
|
|
4866
|
-
const isVendorLicense =
|
|
4971
|
+
const isVendorLicense = import_cluemart_shared37.vendorLicences.includes(licence.licenceType);
|
|
4867
4972
|
const isPartnerLicense = partnerLicences.includes(licence.licenceType);
|
|
4868
4973
|
const licenceName = getLicenseName(licence.licenceType);
|
|
4869
4974
|
const { notificationType, resourceType } = getNotificationTypes(
|
|
@@ -4911,11 +5016,11 @@ async function getLicenseResourceInfo(user, licence) {
|
|
|
4911
5016
|
};
|
|
4912
5017
|
}
|
|
4913
5018
|
function getLicenceExpiryMode(licenceType) {
|
|
4914
|
-
return licenceType ===
|
|
5019
|
+
return licenceType === import_cluemart_shared37.EnumUserLicence.PRO_VENDOR || licenceType === import_cluemart_shared37.EnumUserLicence.PRO_PLUS_VENDOR ? "downgrade" : "extend";
|
|
4915
5020
|
}
|
|
4916
5021
|
async function sendLicenseReminder(user, licence) {
|
|
4917
5022
|
const licenceName = getLicenseName(licence.licenceType);
|
|
4918
|
-
const expiryDate = (0, import_dayjs9.default)(licence.expiryDate).format(
|
|
5023
|
+
const expiryDate = (0, import_dayjs9.default)(licence.expiryDate).format(import_cluemart_shared37.dateFormat);
|
|
4919
5024
|
const userId = String(user._id);
|
|
4920
5025
|
const resourceInfo = await getLicenseResourceInfo(user, licence);
|
|
4921
5026
|
if (!resourceInfo) {
|
|
@@ -5042,6 +5147,7 @@ async function remindUsersAboutLicenseExpiration() {
|
|
|
5042
5147
|
0 && (module.exports = {
|
|
5043
5148
|
ACTIVE_NOT_DELETED_FILTER,
|
|
5044
5149
|
AD_BILLING_CATALOG_COLLECTION_NAME,
|
|
5150
|
+
AI_IMPORT_RUN_LOCK_KEY,
|
|
5045
5151
|
APP_SETTINGS_ID,
|
|
5046
5152
|
AdBillingCatalogModel,
|
|
5047
5153
|
AdBookingModel,
|
|
@@ -5049,6 +5155,8 @@ async function remindUsersAboutLicenseExpiration() {
|
|
|
5049
5155
|
AdModel,
|
|
5050
5156
|
AdPurchaseModel,
|
|
5051
5157
|
AffiliateModel,
|
|
5158
|
+
AiImportRunLockModel,
|
|
5159
|
+
AiImportRunModel,
|
|
5052
5160
|
AiImportedMarketModel,
|
|
5053
5161
|
AppSettingModel,
|
|
5054
5162
|
AuthHandoffTokenModel,
|
|
@@ -5079,7 +5187,7 @@ async function remindUsersAboutLicenseExpiration() {
|
|
|
5079
5187
|
RelationTypeSchema,
|
|
5080
5188
|
ResourceActivityModel,
|
|
5081
5189
|
ResourceImageTypeSchema,
|
|
5082
|
-
|
|
5190
|
+
SCRAPE_SITES_CONFIG_ID,
|
|
5083
5191
|
SUBSCRIPTION_REWARD_TIMEZONE,
|
|
5084
5192
|
SchoolModel,
|
|
5085
5193
|
ScrapeSiteConfigModel,
|