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