@timardex/cluemart-server-shared 1.1.37 → 1.1.39
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/{Affiliate-xCVhO2Cy.d.mts → Affiliate-BLh0EcNI.d.mts} +18 -5
- package/dist/{Affiliate-CZKOOaz_.d.ts → Affiliate-CBp0M850.d.ts} +18 -5
- package/dist/{chunk-DBGVZNUX.mjs → chunk-6RUQHYTK.mjs} +644 -287
- package/dist/chunk-6RUQHYTK.mjs.map +1 -0
- package/dist/{Chat-Wn7yfc3v.d.mts → index-zC8a3adw.d.mts} +34 -34
- package/dist/{Chat-Wn7yfc3v.d.ts → index-zC8a3adw.d.ts} +34 -34
- package/dist/index.cjs +704 -309
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +113 -58
- package/dist/index.d.ts +113 -58
- package/dist/index.mjs +698 -308
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs +646 -286
- package/dist/mongoose/index.cjs.map +1 -1
- package/dist/mongoose/index.d.mts +46 -6
- package/dist/mongoose/index.d.ts +46 -6
- package/dist/mongoose/index.mjs +9 -1
- package/dist/service/index.cjs +637 -308
- package/dist/service/index.cjs.map +1 -1
- package/dist/service/index.d.mts +14 -12
- package/dist/service/index.d.ts +14 -12
- package/dist/service/index.mjs +53 -18
- package/dist/service/index.mjs.map +1 -1
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -2
- package/dist/chunk-DBGVZNUX.mjs.map +0 -1
package/dist/service/index.cjs
CHANGED
|
@@ -45,6 +45,7 @@ __export(service_exports, {
|
|
|
45
45
|
createLicenceObject: () => createLicenceObject,
|
|
46
46
|
didRemoveAnyEventDates: () => didRemoveAnyEventDates,
|
|
47
47
|
ensureUserLicenseCompliance: () => ensureUserLicenseCompliance,
|
|
48
|
+
ensureUserLicenseComplianceForUser: () => ensureUserLicenseComplianceForUser,
|
|
48
49
|
eventLicences: () => eventLicences,
|
|
49
50
|
findAffiliateByPromoCode: () => findAffiliateByPromoCode,
|
|
50
51
|
findEventOrImportedMarketById: () => findEventOrImportedMarketById,
|
|
@@ -388,8 +389,8 @@ var EnumRelationResource = /* @__PURE__ */ ((EnumRelationResource22) => {
|
|
|
388
389
|
return EnumRelationResource22;
|
|
389
390
|
})(EnumRelationResource || {});
|
|
390
391
|
var EnumNotificationResourceType = /* @__PURE__ */ ((EnumNotificationResourceType22) => {
|
|
391
|
-
EnumNotificationResourceType22["APPROVED_AFFILIATE"] = "approved_affiliate";
|
|
392
392
|
EnumNotificationResourceType22["AFFILIATE_REWARD_RECEIVED"] = "affiliate_reward_received";
|
|
393
|
+
EnumNotificationResourceType22["APPROVED_AFFILIATE"] = "approved_affiliate";
|
|
393
394
|
EnumNotificationResourceType22["APPROVED_EVENT"] = "approved_event";
|
|
394
395
|
EnumNotificationResourceType22["APPROVED_PARTNER"] = "approved_partner";
|
|
395
396
|
EnumNotificationResourceType22["APPROVED_SCHOOL"] = "approved_school";
|
|
@@ -417,6 +418,7 @@ var EnumNotificationResourceType = /* @__PURE__ */ ((EnumNotificationResourceTyp
|
|
|
417
418
|
EnumNotificationResourceType22["NEW_POST_CREATED"] = "new_post_created";
|
|
418
419
|
EnumNotificationResourceType22["REGISTERED_USER_BY_SCHOOL_CODE"] = "registered_user_by_school_code";
|
|
419
420
|
EnumNotificationResourceType22["SYSTEM_ALERT"] = "system_alert";
|
|
421
|
+
EnumNotificationResourceType22["USER_COUPON_REDEEMED"] = "user_coupon_redeemed";
|
|
420
422
|
EnumNotificationResourceType22["VENDOR_APPLICATION_TO_EVENT"] = "vendor_application_to_event";
|
|
421
423
|
EnumNotificationResourceType22["VENDOR_UPDATE_RELATION_TO_EVENT"] = "vendor_update_relation_to_event";
|
|
422
424
|
return EnumNotificationResourceType22;
|
|
@@ -491,6 +493,11 @@ var EnumSubscriptionStatus = /* @__PURE__ */ ((EnumSubscriptionStatus22) => {
|
|
|
491
493
|
EnumSubscriptionStatus22["TRIALING"] = "trialing";
|
|
492
494
|
return EnumSubscriptionStatus22;
|
|
493
495
|
})(EnumSubscriptionStatus || {});
|
|
496
|
+
var EnumBillingPeriod = /* @__PURE__ */ ((EnumBillingPeriod22) => {
|
|
497
|
+
EnumBillingPeriod22["MONTHLY_CANCEL_ANYTIME"] = "monthly_cancel_anytime";
|
|
498
|
+
EnumBillingPeriod22["YEARLY_ANNUAL_BILLED"] = "yearly_annual_billed";
|
|
499
|
+
return EnumBillingPeriod22;
|
|
500
|
+
})(EnumBillingPeriod || {});
|
|
494
501
|
var EnumReward = /* @__PURE__ */ ((EnumReward22) => {
|
|
495
502
|
EnumReward22["MYSTERY_JOY_BOX"] = "mystery_joy_box";
|
|
496
503
|
EnumReward22["MYSTERY_SQUEEZE_BOX"] = "mystery_squeeze_box";
|
|
@@ -1773,6 +1780,42 @@ var availableCategories = assignColorToCategories([
|
|
|
1773
1780
|
...petProductsAndAnimalGoods,
|
|
1774
1781
|
...serviceAndExperience
|
|
1775
1782
|
]);
|
|
1783
|
+
var BILLING_CATALOG_KEYS = [
|
|
1784
|
+
"pro_vendor_monthly",
|
|
1785
|
+
"pro_vendor_yearly",
|
|
1786
|
+
"pro_plus_vendor_monthly",
|
|
1787
|
+
"pro_plus_vendor_yearly"
|
|
1788
|
+
];
|
|
1789
|
+
var BILLING_CATALOG_CURRENCY = "nzd";
|
|
1790
|
+
var BILLING_CATALOG_DEFINITIONS = {
|
|
1791
|
+
pro_plus_vendor_monthly: {
|
|
1792
|
+
billingPeriod: "monthly_cancel_anytime",
|
|
1793
|
+
licenceType: "pro_plus_vendor"
|
|
1794
|
+
/* PRO_PLUS_VENDOR */
|
|
1795
|
+
},
|
|
1796
|
+
pro_plus_vendor_yearly: {
|
|
1797
|
+
billingPeriod: "yearly_annual_billed",
|
|
1798
|
+
licenceType: "pro_plus_vendor"
|
|
1799
|
+
/* PRO_PLUS_VENDOR */
|
|
1800
|
+
},
|
|
1801
|
+
pro_vendor_monthly: {
|
|
1802
|
+
billingPeriod: "monthly_cancel_anytime",
|
|
1803
|
+
licenceType: "pro_vendor"
|
|
1804
|
+
/* PRO_VENDOR */
|
|
1805
|
+
},
|
|
1806
|
+
pro_vendor_yearly: {
|
|
1807
|
+
billingPeriod: "yearly_annual_billed",
|
|
1808
|
+
licenceType: "pro_vendor"
|
|
1809
|
+
/* PRO_VENDOR */
|
|
1810
|
+
}
|
|
1811
|
+
};
|
|
1812
|
+
function billingCatalogDefinitionMatches(entry) {
|
|
1813
|
+
const definition = BILLING_CATALOG_DEFINITIONS[entry.key];
|
|
1814
|
+
if (!definition) {
|
|
1815
|
+
return false;
|
|
1816
|
+
}
|
|
1817
|
+
return definition.billingPeriod === entry.billingPeriod && definition.licenceType === entry.licenceType;
|
|
1818
|
+
}
|
|
1776
1819
|
var packagingTypes = [
|
|
1777
1820
|
"Biodegradable",
|
|
1778
1821
|
"Compostable",
|
|
@@ -2217,12 +2260,19 @@ var REDEEMED_REWARD_FIELDS_FRAGMENT = gql`
|
|
|
2217
2260
|
`;
|
|
2218
2261
|
var STRIPE_FIELDS_FRAGMENT = gql`
|
|
2219
2262
|
fragment StripeSubscriptionFields on StripeSubscriptionType {
|
|
2263
|
+
billingPeriod
|
|
2264
|
+
cancelAtPeriodEnd
|
|
2220
2265
|
customerId
|
|
2221
2266
|
subscriptionId
|
|
2222
2267
|
status
|
|
2223
2268
|
currentPlan
|
|
2224
2269
|
startDate
|
|
2225
2270
|
endDate
|
|
2271
|
+
pendingPlan
|
|
2272
|
+
pendingBillingPeriod
|
|
2273
|
+
pendingChangeEffectiveAt
|
|
2274
|
+
priceId
|
|
2275
|
+
scheduleId
|
|
2226
2276
|
}
|
|
2227
2277
|
`;
|
|
2228
2278
|
var USER_FIELDS_FRAGMENT = gql`
|
|
@@ -2514,6 +2564,14 @@ var GET_EVENT = gql`
|
|
|
2514
2564
|
}
|
|
2515
2565
|
${EVENT}
|
|
2516
2566
|
`;
|
|
2567
|
+
var GET_OWNED_EVENT = gql`
|
|
2568
|
+
query getOwnedEvent($_id: ID!) {
|
|
2569
|
+
ownedEvent(_id: $_id) {
|
|
2570
|
+
...EventFields
|
|
2571
|
+
}
|
|
2572
|
+
}
|
|
2573
|
+
${EVENT}
|
|
2574
|
+
`;
|
|
2517
2575
|
var GET_EVENT_BY_PLACE_ID = gql`
|
|
2518
2576
|
query getEventByPlaceId($googlePlaceId: String!) {
|
|
2519
2577
|
eventByPlaceId(googlePlaceId: $googlePlaceId) {
|
|
@@ -4248,11 +4306,8 @@ var GET_RESOURCE_ACTIVITY = gql`
|
|
|
4248
4306
|
${RESOURCE_ACTIVITY_FIELDS_FRAGMENT}
|
|
4249
4307
|
`;
|
|
4250
4308
|
var CREATE_CHECKOUT_SESSION_MUTATION = gql`
|
|
4251
|
-
mutation createCheckoutSession(
|
|
4252
|
-
|
|
4253
|
-
$billingPeriod: BillingPeriodEnumType
|
|
4254
|
-
) {
|
|
4255
|
-
createCheckoutSession(planId: $planId, billingPeriod: $billingPeriod) {
|
|
4309
|
+
mutation createCheckoutSession($input: CreateCheckoutSessionInputType!) {
|
|
4310
|
+
createCheckoutSession(input: $input) {
|
|
4256
4311
|
data {
|
|
4257
4312
|
sessionId
|
|
4258
4313
|
checkoutUrl
|
|
@@ -4264,25 +4319,38 @@ var CREATE_CHECKOUT_SESSION_MUTATION = gql`
|
|
|
4264
4319
|
var CANCEL_SUBSCRIPTION_MUTATION = gql`
|
|
4265
4320
|
mutation cancelSubscription {
|
|
4266
4321
|
cancelSubscription {
|
|
4267
|
-
data
|
|
4322
|
+
data {
|
|
4323
|
+
billingPeriod
|
|
4324
|
+
cancelAtPeriodEnd
|
|
4325
|
+
currentPlan
|
|
4326
|
+
endDate
|
|
4327
|
+
pendingBillingPeriod
|
|
4328
|
+
pendingChangeEffectiveAt
|
|
4329
|
+
pendingPlan
|
|
4330
|
+
priceId
|
|
4331
|
+
scheduleId
|
|
4332
|
+
status
|
|
4333
|
+
subscriptionId
|
|
4334
|
+
}
|
|
4268
4335
|
message
|
|
4269
4336
|
}
|
|
4270
4337
|
}
|
|
4271
4338
|
`;
|
|
4272
4339
|
var UPDATE_SUBSCRIPTION_PLAN_MUTATION = gql`
|
|
4273
|
-
mutation updateSubscriptionPlan(
|
|
4274
|
-
|
|
4275
|
-
$billingPeriod: BillingPeriodEnumType
|
|
4276
|
-
) {
|
|
4277
|
-
updateSubscriptionPlan(
|
|
4278
|
-
newPlanId: $newPlanId
|
|
4279
|
-
billingPeriod: $billingPeriod
|
|
4280
|
-
) {
|
|
4340
|
+
mutation updateSubscriptionPlan($input: UpdateSubscriptionPlanInputType!) {
|
|
4341
|
+
updateSubscriptionPlan(input: $input) {
|
|
4281
4342
|
data {
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
priceId
|
|
4343
|
+
billingPeriod
|
|
4344
|
+
cancelAtPeriodEnd
|
|
4285
4345
|
currentPlan
|
|
4346
|
+
endDate
|
|
4347
|
+
pendingBillingPeriod
|
|
4348
|
+
pendingChangeEffectiveAt
|
|
4349
|
+
pendingPlan
|
|
4350
|
+
priceId
|
|
4351
|
+
scheduleId
|
|
4352
|
+
status
|
|
4353
|
+
subscriptionId
|
|
4286
4354
|
}
|
|
4287
4355
|
message
|
|
4288
4356
|
}
|
|
@@ -4298,36 +4366,20 @@ var CREATE_CUSTOMER_PORTAL = gql`
|
|
|
4298
4366
|
}
|
|
4299
4367
|
}
|
|
4300
4368
|
`;
|
|
4301
|
-
var SELECT_PACKAGE_MUTATION = gql`
|
|
4302
|
-
mutation selectPackage(
|
|
4303
|
-
$billingPeriod: BillingPeriodEnumType
|
|
4304
|
-
$selectedLicence: LicencesEnumType!
|
|
4305
|
-
$useStripe: Boolean
|
|
4306
|
-
) {
|
|
4307
|
-
selectPackage(
|
|
4308
|
-
billingPeriod: $billingPeriod
|
|
4309
|
-
selectedLicence: $selectedLicence
|
|
4310
|
-
useStripe: $useStripe
|
|
4311
|
-
) {
|
|
4312
|
-
data {
|
|
4313
|
-
checkoutUrl
|
|
4314
|
-
licences {
|
|
4315
|
-
...LicenceFields
|
|
4316
|
-
}
|
|
4317
|
-
userId
|
|
4318
|
-
}
|
|
4319
|
-
message
|
|
4320
|
-
}
|
|
4321
|
-
}
|
|
4322
|
-
${LICENCE_FIELDS_FRAGMENT}
|
|
4323
|
-
`;
|
|
4324
4369
|
var GET_SUBSCRIPTION_STATUS = gql`
|
|
4325
4370
|
query getSubscriptionStatus {
|
|
4326
4371
|
getSubscriptionStatus {
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
priceId
|
|
4372
|
+
billingPeriod
|
|
4373
|
+
cancelAtPeriodEnd
|
|
4330
4374
|
currentPlan
|
|
4375
|
+
endDate
|
|
4376
|
+
pendingBillingPeriod
|
|
4377
|
+
pendingChangeEffectiveAt
|
|
4378
|
+
pendingPlan
|
|
4379
|
+
priceId
|
|
4380
|
+
scheduleId
|
|
4381
|
+
status
|
|
4382
|
+
subscriptionId
|
|
4331
4383
|
}
|
|
4332
4384
|
}
|
|
4333
4385
|
`;
|
|
@@ -4354,7 +4406,6 @@ var GET_SUBSCRIPTION_PLANS = gql`
|
|
|
4354
4406
|
}
|
|
4355
4407
|
}
|
|
4356
4408
|
isNewUser
|
|
4357
|
-
isTester
|
|
4358
4409
|
appliedDiscountType
|
|
4359
4410
|
}
|
|
4360
4411
|
}
|
|
@@ -4462,6 +4513,57 @@ var GET_APP_SETTINGS = gql`
|
|
|
4462
4513
|
}
|
|
4463
4514
|
${APP_SETTINGS_FIELDS_FRAGMENT}
|
|
4464
4515
|
`;
|
|
4516
|
+
var BILLING_CATALOG_FIELDS_FRAGMENT = gql`
|
|
4517
|
+
fragment BillingCatalogFields on BillingCatalogEntryType {
|
|
4518
|
+
_id
|
|
4519
|
+
active
|
|
4520
|
+
billingPeriod
|
|
4521
|
+
createdAt
|
|
4522
|
+
currency
|
|
4523
|
+
effectiveFrom
|
|
4524
|
+
key
|
|
4525
|
+
licenceType
|
|
4526
|
+
revision
|
|
4527
|
+
stripePriceId
|
|
4528
|
+
stripeProductId
|
|
4529
|
+
taxInclusive
|
|
4530
|
+
unitAmount
|
|
4531
|
+
updatedAt
|
|
4532
|
+
updatedBy
|
|
4533
|
+
}
|
|
4534
|
+
`;
|
|
4535
|
+
var GET_BILLING_CATALOG = gql`
|
|
4536
|
+
query getBillingCatalog {
|
|
4537
|
+
billingCatalog {
|
|
4538
|
+
...BillingCatalogFields
|
|
4539
|
+
}
|
|
4540
|
+
}
|
|
4541
|
+
${BILLING_CATALOG_FIELDS_FRAGMENT}
|
|
4542
|
+
`;
|
|
4543
|
+
var UPDATE_BILLING_CATALOG_PRICE_MUTATION = gql`
|
|
4544
|
+
mutation updateBillingCatalogPrice(
|
|
4545
|
+
$input: UpdateBillingCatalogPriceInputType!
|
|
4546
|
+
) {
|
|
4547
|
+
updateBillingCatalogPrice(input: $input) {
|
|
4548
|
+
data {
|
|
4549
|
+
...BillingCatalogFields
|
|
4550
|
+
}
|
|
4551
|
+
message
|
|
4552
|
+
}
|
|
4553
|
+
}
|
|
4554
|
+
${BILLING_CATALOG_FIELDS_FRAGMENT}
|
|
4555
|
+
`;
|
|
4556
|
+
var SYNC_BILLING_CATALOG_PRICE_MUTATION = gql`
|
|
4557
|
+
mutation syncBillingCatalogPrice($input: SyncBillingCatalogPriceInputType!) {
|
|
4558
|
+
syncBillingCatalogPrice(input: $input) {
|
|
4559
|
+
data {
|
|
4560
|
+
...BillingCatalogFields
|
|
4561
|
+
}
|
|
4562
|
+
message
|
|
4563
|
+
}
|
|
4564
|
+
}
|
|
4565
|
+
${BILLING_CATALOG_FIELDS_FRAGMENT}
|
|
4566
|
+
`;
|
|
4465
4567
|
var GAME_HISTORY_FIELDS_FRAGMENT = gql`
|
|
4466
4568
|
fragment GameHistoryFields on GameHistoryType {
|
|
4467
4569
|
createdAt
|
|
@@ -5300,46 +5402,200 @@ schema.index({
|
|
|
5300
5402
|
start: 1,
|
|
5301
5403
|
status: 1
|
|
5302
5404
|
});
|
|
5405
|
+
schema.index({
|
|
5406
|
+
status: 1,
|
|
5407
|
+
targetRegion: 1,
|
|
5408
|
+
// eslint-disable-next-line sort-keys
|
|
5409
|
+
start: -1
|
|
5410
|
+
});
|
|
5303
5411
|
var AdModel = import_mongoose.default.models.Ad || import_mongoose.default.model("Ad", schema);
|
|
5304
5412
|
|
|
5305
|
-
// src/mongoose/
|
|
5413
|
+
// src/mongoose/BillingCatalog.ts
|
|
5306
5414
|
var import_mongoose2 = __toESM(require("mongoose"));
|
|
5307
5415
|
var MongooseSchema2 = import_mongoose2.default.Schema;
|
|
5308
|
-
var
|
|
5416
|
+
var BILLING_CATALOG_COLLECTION_NAME = "billingCatalog";
|
|
5417
|
+
var paidVendorLicences = [
|
|
5418
|
+
EnumUserLicence.PRO_VENDOR,
|
|
5419
|
+
EnumUserLicence.PRO_PLUS_VENDOR
|
|
5420
|
+
];
|
|
5421
|
+
var supportedBillingPeriods = [
|
|
5422
|
+
EnumBillingPeriod.MONTHLY_CANCEL_ANYTIME,
|
|
5423
|
+
EnumBillingPeriod.YEARLY_ANNUAL_BILLED
|
|
5424
|
+
];
|
|
5425
|
+
var unitAmountField = {
|
|
5426
|
+
min: 1,
|
|
5427
|
+
required: true,
|
|
5428
|
+
type: Number,
|
|
5429
|
+
validate: {
|
|
5430
|
+
message: "Billing catalogue price must be a positive integer.",
|
|
5431
|
+
validator: Number.isInteger
|
|
5432
|
+
}
|
|
5433
|
+
};
|
|
5434
|
+
var currencyField = {
|
|
5435
|
+
default: BILLING_CATALOG_CURRENCY,
|
|
5436
|
+
enum: [BILLING_CATALOG_CURRENCY],
|
|
5437
|
+
immutable: true,
|
|
5438
|
+
lowercase: true,
|
|
5439
|
+
required: true,
|
|
5440
|
+
trim: true,
|
|
5441
|
+
type: String
|
|
5442
|
+
};
|
|
5443
|
+
var stripePriceIdField = {
|
|
5444
|
+
default: null,
|
|
5445
|
+
required: false,
|
|
5446
|
+
trim: true,
|
|
5447
|
+
type: String
|
|
5448
|
+
};
|
|
5449
|
+
var stripeProductIdField = {
|
|
5450
|
+
default: null,
|
|
5451
|
+
required: false,
|
|
5452
|
+
trim: true,
|
|
5453
|
+
type: String
|
|
5454
|
+
};
|
|
5455
|
+
var priceHistorySchema = new MongooseSchema2(
|
|
5456
|
+
{
|
|
5457
|
+
changedAt: { required: true, type: Date },
|
|
5458
|
+
changedBy: {
|
|
5459
|
+
default: null,
|
|
5460
|
+
ref: "User",
|
|
5461
|
+
required: false,
|
|
5462
|
+
type: import_mongoose2.default.Schema.Types.ObjectId
|
|
5463
|
+
},
|
|
5464
|
+
currency: currencyField,
|
|
5465
|
+
effectiveFrom: { required: true, type: Date },
|
|
5466
|
+
effectiveTo: { required: true, type: Date },
|
|
5467
|
+
stripePriceId: stripePriceIdField,
|
|
5468
|
+
stripeProductId: stripeProductIdField,
|
|
5469
|
+
unitAmount: unitAmountField
|
|
5470
|
+
},
|
|
5471
|
+
{ _id: false }
|
|
5472
|
+
);
|
|
5473
|
+
var schema2 = new MongooseSchema2(
|
|
5474
|
+
{
|
|
5475
|
+
active: { default: true, required: true, type: Boolean },
|
|
5476
|
+
billingPeriod: {
|
|
5477
|
+
enum: supportedBillingPeriods,
|
|
5478
|
+
immutable: true,
|
|
5479
|
+
required: true,
|
|
5480
|
+
type: String
|
|
5481
|
+
},
|
|
5482
|
+
currency: currencyField,
|
|
5483
|
+
effectiveFrom: { default: Date.now, required: true, type: Date },
|
|
5484
|
+
key: {
|
|
5485
|
+
enum: BILLING_CATALOG_KEYS,
|
|
5486
|
+
immutable: true,
|
|
5487
|
+
required: true,
|
|
5488
|
+
type: String,
|
|
5489
|
+
unique: true
|
|
5490
|
+
},
|
|
5491
|
+
licenceType: {
|
|
5492
|
+
enum: paidVendorLicences,
|
|
5493
|
+
immutable: true,
|
|
5494
|
+
required: true,
|
|
5495
|
+
type: String
|
|
5496
|
+
},
|
|
5497
|
+
priceHistory: {
|
|
5498
|
+
default: [],
|
|
5499
|
+
required: true,
|
|
5500
|
+
type: [priceHistorySchema]
|
|
5501
|
+
},
|
|
5502
|
+
revision: {
|
|
5503
|
+
default: 1,
|
|
5504
|
+
min: 1,
|
|
5505
|
+
required: true,
|
|
5506
|
+
type: Number,
|
|
5507
|
+
validate: {
|
|
5508
|
+
message: "Billing catalogue revision must be a positive integer.",
|
|
5509
|
+
validator: Number.isInteger
|
|
5510
|
+
}
|
|
5511
|
+
},
|
|
5512
|
+
stripePriceId: stripePriceIdField,
|
|
5513
|
+
stripeProductId: stripeProductIdField,
|
|
5514
|
+
taxInclusive: {
|
|
5515
|
+
default: true,
|
|
5516
|
+
immutable: true,
|
|
5517
|
+
required: true,
|
|
5518
|
+
type: Boolean,
|
|
5519
|
+
validate: {
|
|
5520
|
+
message: "Billing catalogue prices must include GST.",
|
|
5521
|
+
validator: (value) => value === true
|
|
5522
|
+
}
|
|
5523
|
+
},
|
|
5524
|
+
unitAmount: unitAmountField,
|
|
5525
|
+
updatedBy: {
|
|
5526
|
+
default: null,
|
|
5527
|
+
ref: "User",
|
|
5528
|
+
required: false,
|
|
5529
|
+
type: import_mongoose2.default.Schema.Types.ObjectId
|
|
5530
|
+
}
|
|
5531
|
+
},
|
|
5532
|
+
{
|
|
5533
|
+
collection: BILLING_CATALOG_COLLECTION_NAME,
|
|
5534
|
+
strict: true,
|
|
5535
|
+
timestamps: true
|
|
5536
|
+
}
|
|
5537
|
+
);
|
|
5538
|
+
schema2.pre("validate", function validateDefinition() {
|
|
5539
|
+
if (!billingCatalogDefinitionMatches(this)) {
|
|
5540
|
+
this.invalidate(
|
|
5541
|
+
"key",
|
|
5542
|
+
"Billing catalogue key does not match its licence and billing period."
|
|
5543
|
+
);
|
|
5544
|
+
}
|
|
5545
|
+
});
|
|
5546
|
+
schema2.index({ billingPeriod: 1, licenceType: 1 }, { unique: true });
|
|
5547
|
+
schema2.index({ active: 1, licenceType: 1 });
|
|
5548
|
+
schema2.index(
|
|
5549
|
+
{ stripePriceId: 1 },
|
|
5550
|
+
{
|
|
5551
|
+
partialFilterExpression: { stripePriceId: { $type: "string" } },
|
|
5552
|
+
unique: true
|
|
5553
|
+
}
|
|
5554
|
+
);
|
|
5555
|
+
var BillingCatalogModel = import_mongoose2.default.models.BillingCatalogEntry || import_mongoose2.default.model(
|
|
5556
|
+
"BillingCatalogEntry",
|
|
5557
|
+
schema2,
|
|
5558
|
+
BILLING_CATALOG_COLLECTION_NAME
|
|
5559
|
+
);
|
|
5560
|
+
|
|
5561
|
+
// src/mongoose/chat/Chat.ts
|
|
5562
|
+
var import_mongoose3 = __toESM(require("mongoose"));
|
|
5563
|
+
var MongooseSchema3 = import_mongoose3.default.Schema;
|
|
5564
|
+
var MessageReplyPreviewSchema = new MongooseSchema3(
|
|
5309
5565
|
{
|
|
5310
5566
|
contentPreview: { required: true, type: String },
|
|
5311
5567
|
senderId: {
|
|
5312
5568
|
ref: "User",
|
|
5313
5569
|
required: true,
|
|
5314
|
-
type:
|
|
5570
|
+
type: import_mongoose3.default.Schema.Types.ObjectId
|
|
5315
5571
|
},
|
|
5316
5572
|
senderName: { required: true, type: String }
|
|
5317
5573
|
},
|
|
5318
5574
|
{ _id: false }
|
|
5319
5575
|
);
|
|
5320
|
-
var MessageReactionSchema = new
|
|
5576
|
+
var MessageReactionSchema = new MongooseSchema3(
|
|
5321
5577
|
{
|
|
5322
5578
|
createdAt: { required: true, type: Date },
|
|
5323
5579
|
userId: {
|
|
5324
5580
|
ref: "User",
|
|
5325
5581
|
required: true,
|
|
5326
|
-
type:
|
|
5582
|
+
type: import_mongoose3.default.Schema.Types.ObjectId
|
|
5327
5583
|
}
|
|
5328
5584
|
},
|
|
5329
5585
|
{ _id: false }
|
|
5330
5586
|
);
|
|
5331
|
-
var MessageSeenSchema = new
|
|
5587
|
+
var MessageSeenSchema = new MongooseSchema3(
|
|
5332
5588
|
{
|
|
5333
5589
|
seenAt: { required: true, type: Date },
|
|
5334
5590
|
userId: {
|
|
5335
5591
|
ref: "User",
|
|
5336
5592
|
required: true,
|
|
5337
|
-
type:
|
|
5593
|
+
type: import_mongoose3.default.Schema.Types.ObjectId
|
|
5338
5594
|
}
|
|
5339
5595
|
},
|
|
5340
5596
|
{ _id: false }
|
|
5341
5597
|
);
|
|
5342
|
-
var MessageSchema = new
|
|
5598
|
+
var MessageSchema = new MongooseSchema3(
|
|
5343
5599
|
{
|
|
5344
5600
|
content: { required: true, type: String },
|
|
5345
5601
|
likedBy: { default: [], required: false, type: [MessageReactionSchema] },
|
|
@@ -5350,18 +5606,18 @@ var MessageSchema = new MongooseSchema2(
|
|
|
5350
5606
|
replyToMessageId: {
|
|
5351
5607
|
ref: "Chat.messages",
|
|
5352
5608
|
required: false,
|
|
5353
|
-
type:
|
|
5609
|
+
type: import_mongoose3.default.Schema.Types.ObjectId
|
|
5354
5610
|
},
|
|
5355
5611
|
seenBy: { default: [], required: false, type: [MessageSeenSchema] },
|
|
5356
5612
|
senderId: {
|
|
5357
5613
|
ref: "User",
|
|
5358
5614
|
required: true,
|
|
5359
|
-
type:
|
|
5615
|
+
type: import_mongoose3.default.Schema.Types.ObjectId
|
|
5360
5616
|
}
|
|
5361
5617
|
},
|
|
5362
5618
|
{ timestamps: true }
|
|
5363
5619
|
);
|
|
5364
|
-
var ParticipantSchema = new
|
|
5620
|
+
var ParticipantSchema = new MongooseSchema3(
|
|
5365
5621
|
{
|
|
5366
5622
|
active: { default: true, required: true, type: Boolean },
|
|
5367
5623
|
userAvatar: { required: false, type: String },
|
|
@@ -5369,14 +5625,14 @@ var ParticipantSchema = new MongooseSchema2(
|
|
|
5369
5625
|
userId: {
|
|
5370
5626
|
ref: "User",
|
|
5371
5627
|
required: true,
|
|
5372
|
-
type:
|
|
5628
|
+
type: import_mongoose3.default.Schema.Types.ObjectId
|
|
5373
5629
|
},
|
|
5374
5630
|
userName: { required: true, type: String }
|
|
5375
5631
|
},
|
|
5376
5632
|
{ _id: false }
|
|
5377
5633
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
5378
5634
|
);
|
|
5379
|
-
var ChatSchema = new
|
|
5635
|
+
var ChatSchema = new MongooseSchema3(
|
|
5380
5636
|
{
|
|
5381
5637
|
active: { default: true, required: true, type: Boolean },
|
|
5382
5638
|
chatDescription: { required: false, type: String },
|
|
@@ -5400,12 +5656,12 @@ ChatSchema.index({
|
|
|
5400
5656
|
"participants.userId": 1,
|
|
5401
5657
|
updatedAt: -1
|
|
5402
5658
|
});
|
|
5403
|
-
var ChatModel =
|
|
5659
|
+
var ChatModel = import_mongoose3.default.models.Chat || import_mongoose3.default.model("Chat", ChatSchema);
|
|
5404
5660
|
|
|
5405
5661
|
// src/mongoose/chat/ChatReport.ts
|
|
5406
|
-
var
|
|
5407
|
-
var
|
|
5408
|
-
var ReasonSchema = new
|
|
5662
|
+
var import_mongoose4 = __toESM(require("mongoose"));
|
|
5663
|
+
var MongooseSchema4 = import_mongoose4.default.Schema;
|
|
5664
|
+
var ReasonSchema = new MongooseSchema4(
|
|
5409
5665
|
{
|
|
5410
5666
|
details: { default: null, required: false, type: String },
|
|
5411
5667
|
reasonType: {
|
|
@@ -5416,23 +5672,23 @@ var ReasonSchema = new MongooseSchema3(
|
|
|
5416
5672
|
},
|
|
5417
5673
|
{ _id: false }
|
|
5418
5674
|
);
|
|
5419
|
-
var ChatReportSchema = new
|
|
5675
|
+
var ChatReportSchema = new MongooseSchema4(
|
|
5420
5676
|
{
|
|
5421
5677
|
chatId: {
|
|
5422
5678
|
ref: "Chat",
|
|
5423
5679
|
required: true,
|
|
5424
|
-
type:
|
|
5680
|
+
type: import_mongoose4.default.Schema.Types.ObjectId
|
|
5425
5681
|
},
|
|
5426
5682
|
reason: { required: true, type: ReasonSchema },
|
|
5427
5683
|
reportedUserId: {
|
|
5428
5684
|
ref: "User",
|
|
5429
5685
|
required: true,
|
|
5430
|
-
type:
|
|
5686
|
+
type: import_mongoose4.default.Schema.Types.ObjectId
|
|
5431
5687
|
},
|
|
5432
5688
|
reporterUserId: {
|
|
5433
5689
|
ref: "User",
|
|
5434
5690
|
required: true,
|
|
5435
|
-
type:
|
|
5691
|
+
type: import_mongoose4.default.Schema.Types.ObjectId
|
|
5436
5692
|
},
|
|
5437
5693
|
resolved: { default: false, required: true, type: Boolean }
|
|
5438
5694
|
},
|
|
@@ -5440,18 +5696,18 @@ var ChatReportSchema = new MongooseSchema3(
|
|
|
5440
5696
|
);
|
|
5441
5697
|
ChatReportSchema.index({ chatId: 1, reportedUserId: 1 });
|
|
5442
5698
|
ChatReportSchema.index({ createdAt: -1, reporterUserId: 1 });
|
|
5443
|
-
var ChatReportModel =
|
|
5699
|
+
var ChatReportModel = import_mongoose4.default.models.ChatReport || import_mongoose4.default.model("ChatReport", ChatReportSchema);
|
|
5444
5700
|
|
|
5445
5701
|
// src/mongoose/global.ts
|
|
5446
|
-
var
|
|
5702
|
+
var import_mongoose7 = __toESM(require("mongoose"));
|
|
5447
5703
|
|
|
5448
5704
|
// src/mongoose/Relation.ts
|
|
5449
|
-
var
|
|
5705
|
+
var import_mongoose6 = __toESM(require("mongoose"));
|
|
5450
5706
|
|
|
5451
5707
|
// src/mongoose/event/EventInfo.ts
|
|
5452
|
-
var
|
|
5453
|
-
var
|
|
5454
|
-
var StallTypeSchema = new
|
|
5708
|
+
var import_mongoose5 = __toESM(require("mongoose"));
|
|
5709
|
+
var MongooseSchema5 = import_mongoose5.default.Schema;
|
|
5710
|
+
var StallTypeSchema = new MongooseSchema5(
|
|
5455
5711
|
{
|
|
5456
5712
|
label: { required: false, type: String },
|
|
5457
5713
|
price: { required: false, type: Number },
|
|
@@ -5462,7 +5718,7 @@ var StallTypeSchema = new MongooseSchema4(
|
|
|
5462
5718
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
5463
5719
|
}
|
|
5464
5720
|
);
|
|
5465
|
-
var dateTimeSchema = new
|
|
5721
|
+
var dateTimeSchema = new MongooseSchema5(
|
|
5466
5722
|
{
|
|
5467
5723
|
dateStatus: {
|
|
5468
5724
|
enum: Object.values(EnumEventDateStatus),
|
|
@@ -5478,7 +5734,7 @@ var dateTimeSchema = new MongooseSchema4(
|
|
|
5478
5734
|
{ _id: false }
|
|
5479
5735
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
5480
5736
|
);
|
|
5481
|
-
var paymentInfoSchema = new
|
|
5737
|
+
var paymentInfoSchema = new MongooseSchema5(
|
|
5482
5738
|
{
|
|
5483
5739
|
accountHolderName: { required: false, type: String },
|
|
5484
5740
|
accountNumber: { required: false, type: String },
|
|
@@ -5492,7 +5748,7 @@ var paymentInfoSchema = new MongooseSchema4(
|
|
|
5492
5748
|
{ _id: false }
|
|
5493
5749
|
// Prevents Mongoose from creating an additional _id field
|
|
5494
5750
|
);
|
|
5495
|
-
var requirementsSchema = new
|
|
5751
|
+
var requirementsSchema = new MongooseSchema5(
|
|
5496
5752
|
{
|
|
5497
5753
|
category: { required: true, type: String },
|
|
5498
5754
|
label: { required: true, type: String },
|
|
@@ -5503,7 +5759,7 @@ var requirementsSchema = new MongooseSchema4(
|
|
|
5503
5759
|
// Prevents Mongoose from creating an additional _id field for
|
|
5504
5760
|
}
|
|
5505
5761
|
);
|
|
5506
|
-
var refundPolicySchema = new
|
|
5762
|
+
var refundPolicySchema = new MongooseSchema5(
|
|
5507
5763
|
{
|
|
5508
5764
|
category: { required: true, type: String },
|
|
5509
5765
|
label: { required: true, type: String },
|
|
@@ -5511,7 +5767,7 @@ var refundPolicySchema = new MongooseSchema4(
|
|
|
5511
5767
|
},
|
|
5512
5768
|
{ _id: false }
|
|
5513
5769
|
);
|
|
5514
|
-
var
|
|
5770
|
+
var schema3 = new MongooseSchema5(
|
|
5515
5771
|
{
|
|
5516
5772
|
active: { default: true, type: Boolean },
|
|
5517
5773
|
applicationDeadlineHours: { required: true, type: Number },
|
|
@@ -5519,7 +5775,7 @@ var schema2 = new MongooseSchema4(
|
|
|
5519
5775
|
eventId: {
|
|
5520
5776
|
ref: "Event",
|
|
5521
5777
|
required: true,
|
|
5522
|
-
type:
|
|
5778
|
+
type: import_mongoose5.default.Schema.Types.ObjectId
|
|
5523
5779
|
},
|
|
5524
5780
|
packInTime: { required: true, type: Number },
|
|
5525
5781
|
paymentDueHours: { required: true, type: Number },
|
|
@@ -5529,11 +5785,11 @@ var schema2 = new MongooseSchema4(
|
|
|
5529
5785
|
},
|
|
5530
5786
|
{ timestamps: true }
|
|
5531
5787
|
);
|
|
5532
|
-
var EventInfoModel =
|
|
5788
|
+
var EventInfoModel = import_mongoose5.default.models.EventInfo || import_mongoose5.default.model("EventInfo", schema3);
|
|
5533
5789
|
|
|
5534
5790
|
// src/mongoose/Relation.ts
|
|
5535
|
-
var
|
|
5536
|
-
var relationDateTimeSchema = new
|
|
5791
|
+
var MongooseSchema6 = import_mongoose6.default.Schema;
|
|
5792
|
+
var relationDateTimeSchema = new MongooseSchema6(
|
|
5537
5793
|
{
|
|
5538
5794
|
dateStatus: {
|
|
5539
5795
|
enum: Object.values(EnumEventDateStatus),
|
|
@@ -5548,7 +5804,7 @@ var relationDateTimeSchema = new MongooseSchema5(
|
|
|
5548
5804
|
},
|
|
5549
5805
|
{ _id: false }
|
|
5550
5806
|
);
|
|
5551
|
-
var relationDatesSchema = new
|
|
5807
|
+
var relationDatesSchema = new MongooseSchema6(
|
|
5552
5808
|
{
|
|
5553
5809
|
dateTime: {
|
|
5554
5810
|
required: true,
|
|
@@ -5567,19 +5823,19 @@ var relationDatesSchema = new MongooseSchema5(
|
|
|
5567
5823
|
},
|
|
5568
5824
|
{ _id: false }
|
|
5569
5825
|
);
|
|
5570
|
-
var RelationTypeSchema = new
|
|
5826
|
+
var RelationTypeSchema = new MongooseSchema6(
|
|
5571
5827
|
{
|
|
5572
5828
|
active: { default: true, required: true, type: Boolean },
|
|
5573
5829
|
chatId: {
|
|
5574
5830
|
ref: "Chat",
|
|
5575
5831
|
required: true,
|
|
5576
|
-
type:
|
|
5832
|
+
type: import_mongoose6.default.Schema.Types.ObjectId
|
|
5577
5833
|
},
|
|
5578
5834
|
deletedAt: { default: null, required: false, type: Date },
|
|
5579
5835
|
eventId: {
|
|
5580
5836
|
ref: "Event",
|
|
5581
5837
|
required: true,
|
|
5582
|
-
type:
|
|
5838
|
+
type: import_mongoose6.default.Schema.Types.ObjectId
|
|
5583
5839
|
},
|
|
5584
5840
|
lastUpdateBy: {
|
|
5585
5841
|
enum: Object.values(EnumResourceType),
|
|
@@ -5595,7 +5851,7 @@ var RelationTypeSchema = new MongooseSchema5(
|
|
|
5595
5851
|
vendorId: {
|
|
5596
5852
|
ref: "Vendor",
|
|
5597
5853
|
required: true,
|
|
5598
|
-
type:
|
|
5854
|
+
type: import_mongoose6.default.Schema.Types.ObjectId
|
|
5599
5855
|
}
|
|
5600
5856
|
},
|
|
5601
5857
|
{ timestamps: true }
|
|
@@ -5607,23 +5863,23 @@ RelationTypeSchema.index({
|
|
|
5607
5863
|
"relationDates.status": 1,
|
|
5608
5864
|
vendorId: 1
|
|
5609
5865
|
});
|
|
5610
|
-
var RelationModel =
|
|
5866
|
+
var RelationModel = import_mongoose6.default.models.Relation || import_mongoose6.default.model("Relation", RelationTypeSchema);
|
|
5611
5867
|
|
|
5612
5868
|
// src/mongoose/global.ts
|
|
5613
|
-
var
|
|
5614
|
-
var OwnerTypeSchema = new
|
|
5869
|
+
var MongooseSchema7 = import_mongoose7.default.Schema;
|
|
5870
|
+
var OwnerTypeSchema = new MongooseSchema7(
|
|
5615
5871
|
{
|
|
5616
5872
|
email: { required: true, type: String },
|
|
5617
5873
|
userId: {
|
|
5618
5874
|
ref: "User",
|
|
5619
5875
|
required: true,
|
|
5620
|
-
type:
|
|
5876
|
+
type: import_mongoose7.default.Schema.Types.ObjectId
|
|
5621
5877
|
}
|
|
5622
5878
|
},
|
|
5623
5879
|
{ _id: false }
|
|
5624
5880
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
5625
5881
|
);
|
|
5626
|
-
var SocialMediaTypeSchema = new
|
|
5882
|
+
var SocialMediaTypeSchema = new MongooseSchema7(
|
|
5627
5883
|
{
|
|
5628
5884
|
link: { required: true, type: String },
|
|
5629
5885
|
name: { required: true, type: String }
|
|
@@ -5631,7 +5887,7 @@ var SocialMediaTypeSchema = new MongooseSchema6(
|
|
|
5631
5887
|
{ _id: false }
|
|
5632
5888
|
// Prevents Mongoose from creating an additional _id field
|
|
5633
5889
|
);
|
|
5634
|
-
var ResourceImageTypeSchema = new
|
|
5890
|
+
var ResourceImageTypeSchema = new MongooseSchema7(
|
|
5635
5891
|
{
|
|
5636
5892
|
active: { default: true, required: true, type: Boolean },
|
|
5637
5893
|
source: { required: false, type: String },
|
|
@@ -5640,7 +5896,7 @@ var ResourceImageTypeSchema = new MongooseSchema6(
|
|
|
5640
5896
|
{ _id: false }
|
|
5641
5897
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
5642
5898
|
);
|
|
5643
|
-
var SubCategorySchema = new
|
|
5899
|
+
var SubCategorySchema = new MongooseSchema7(
|
|
5644
5900
|
{
|
|
5645
5901
|
id: { required: false, type: String },
|
|
5646
5902
|
items: [
|
|
@@ -5654,7 +5910,7 @@ var SubCategorySchema = new MongooseSchema6(
|
|
|
5654
5910
|
{ _id: false }
|
|
5655
5911
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
5656
5912
|
);
|
|
5657
|
-
var CategorySchema = new
|
|
5913
|
+
var CategorySchema = new MongooseSchema7(
|
|
5658
5914
|
{
|
|
5659
5915
|
id: { required: true, type: String },
|
|
5660
5916
|
name: { required: true, type: String },
|
|
@@ -5663,7 +5919,7 @@ var CategorySchema = new MongooseSchema6(
|
|
|
5663
5919
|
{ _id: false }
|
|
5664
5920
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
5665
5921
|
);
|
|
5666
|
-
var PosterUsageTypeSchema = new
|
|
5922
|
+
var PosterUsageTypeSchema = new MongooseSchema7(
|
|
5667
5923
|
{
|
|
5668
5924
|
count: { default: 0, required: false, type: Number },
|
|
5669
5925
|
month: { required: false, type: String }
|
|
@@ -5671,7 +5927,7 @@ var PosterUsageTypeSchema = new MongooseSchema6(
|
|
|
5671
5927
|
{ _id: false }
|
|
5672
5928
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
5673
5929
|
);
|
|
5674
|
-
var userLicenseSchema = new
|
|
5930
|
+
var userLicenseSchema = new MongooseSchema7(
|
|
5675
5931
|
{
|
|
5676
5932
|
expiryDate: { required: true, type: Date },
|
|
5677
5933
|
issuedDate: { required: true, type: Date },
|
|
@@ -5688,7 +5944,7 @@ var userLicenseSchema = new MongooseSchema6(
|
|
|
5688
5944
|
},
|
|
5689
5945
|
{ _id: false, timestamps: false }
|
|
5690
5946
|
);
|
|
5691
|
-
var ContactDetailsSchema = new
|
|
5947
|
+
var ContactDetailsSchema = new MongooseSchema7(
|
|
5692
5948
|
{
|
|
5693
5949
|
email: { required: false, type: String },
|
|
5694
5950
|
landlinePhone: { required: false, type: String },
|
|
@@ -5697,7 +5953,7 @@ var ContactDetailsSchema = new MongooseSchema6(
|
|
|
5697
5953
|
{ _id: false }
|
|
5698
5954
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
5699
5955
|
);
|
|
5700
|
-
var termsAgreementSchema = new
|
|
5956
|
+
var termsAgreementSchema = new MongooseSchema7(
|
|
5701
5957
|
{
|
|
5702
5958
|
appBuildNumber: { required: true, type: String },
|
|
5703
5959
|
appId: { required: true, type: String },
|
|
@@ -5714,7 +5970,7 @@ var termsAgreementSchema = new MongooseSchema6(
|
|
|
5714
5970
|
},
|
|
5715
5971
|
{ _id: false }
|
|
5716
5972
|
);
|
|
5717
|
-
var resourceRelationsSchema = new
|
|
5973
|
+
var resourceRelationsSchema = new MongooseSchema7(
|
|
5718
5974
|
{
|
|
5719
5975
|
relationDates: {
|
|
5720
5976
|
default: [],
|
|
@@ -5724,12 +5980,12 @@ var resourceRelationsSchema = new MongooseSchema6(
|
|
|
5724
5980
|
relationId: {
|
|
5725
5981
|
ref: "Relation",
|
|
5726
5982
|
required: false,
|
|
5727
|
-
type:
|
|
5983
|
+
type: import_mongoose7.default.Schema.Types.ObjectId
|
|
5728
5984
|
}
|
|
5729
5985
|
},
|
|
5730
5986
|
{ _id: false }
|
|
5731
5987
|
);
|
|
5732
|
-
var dateTimeSchema2 = new
|
|
5988
|
+
var dateTimeSchema2 = new MongooseSchema7(
|
|
5733
5989
|
{
|
|
5734
5990
|
dateStatus: {
|
|
5735
5991
|
enum: Object.values(EnumEventDateStatus),
|
|
@@ -5744,7 +6000,7 @@ var dateTimeSchema2 = new MongooseSchema6(
|
|
|
5744
6000
|
{ _id: false }
|
|
5745
6001
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
5746
6002
|
);
|
|
5747
|
-
var locationGeoSchema = new
|
|
6003
|
+
var locationGeoSchema = new MongooseSchema7(
|
|
5748
6004
|
{
|
|
5749
6005
|
coordinates: { required: true, type: [Number] },
|
|
5750
6006
|
// [longitude, latitude]
|
|
@@ -5753,7 +6009,7 @@ var locationGeoSchema = new MongooseSchema6(
|
|
|
5753
6009
|
{ _id: false }
|
|
5754
6010
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
5755
6011
|
);
|
|
5756
|
-
var locationsSchema = new
|
|
6012
|
+
var locationsSchema = new MongooseSchema7(
|
|
5757
6013
|
{
|
|
5758
6014
|
city: { required: true, type: String },
|
|
5759
6015
|
country: { required: true, type: String },
|
|
@@ -5769,13 +6025,13 @@ var locationsSchema = new MongooseSchema6(
|
|
|
5769
6025
|
{ _id: false }
|
|
5770
6026
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
5771
6027
|
);
|
|
5772
|
-
var relatedPostSchema = new
|
|
6028
|
+
var relatedPostSchema = new MongooseSchema7(
|
|
5773
6029
|
{
|
|
5774
6030
|
postActive: { default: true, required: true, type: Boolean },
|
|
5775
6031
|
postId: {
|
|
5776
6032
|
ref: "Post",
|
|
5777
6033
|
required: true,
|
|
5778
|
-
type:
|
|
6034
|
+
type: import_mongoose7.default.Schema.Types.ObjectId
|
|
5779
6035
|
},
|
|
5780
6036
|
postSlug: { required: true, type: String },
|
|
5781
6037
|
postType: {
|
|
@@ -5787,7 +6043,7 @@ var relatedPostSchema = new MongooseSchema6(
|
|
|
5787
6043
|
{ _id: false }
|
|
5788
6044
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
5789
6045
|
);
|
|
5790
|
-
var socialShareResourceSchema = new
|
|
6046
|
+
var socialShareResourceSchema = new MongooseSchema7(
|
|
5791
6047
|
{
|
|
5792
6048
|
qrCode: { required: true, type: ResourceImageTypeSchema },
|
|
5793
6049
|
socialImage: { required: true, type: ResourceImageTypeSchema }
|
|
@@ -5800,7 +6056,7 @@ var baseResourceFields = {
|
|
|
5800
6056
|
adIds: {
|
|
5801
6057
|
ref: "Ad",
|
|
5802
6058
|
required: false,
|
|
5803
|
-
type: [
|
|
6059
|
+
type: [import_mongoose7.default.Schema.Types.ObjectId]
|
|
5804
6060
|
},
|
|
5805
6061
|
approvedAt: { default: null, required: false, type: Date },
|
|
5806
6062
|
contactDetails: { required: false, type: ContactDetailsSchema },
|
|
@@ -5830,9 +6086,9 @@ var baseResourceFields = {
|
|
|
5830
6086
|
};
|
|
5831
6087
|
|
|
5832
6088
|
// src/mongoose/GoogleImportedMarket.ts
|
|
5833
|
-
var
|
|
5834
|
-
var
|
|
5835
|
-
var addressComponentSchema = new
|
|
6089
|
+
var import_mongoose8 = __toESM(require("mongoose"));
|
|
6090
|
+
var MongooseSchema8 = import_mongoose8.default.Schema;
|
|
6091
|
+
var addressComponentSchema = new MongooseSchema8(
|
|
5836
6092
|
{
|
|
5837
6093
|
longName: { required: false, type: String },
|
|
5838
6094
|
shortName: { required: false, type: String },
|
|
@@ -5840,7 +6096,7 @@ var addressComponentSchema = new MongooseSchema7(
|
|
|
5840
6096
|
},
|
|
5841
6097
|
{ _id: false }
|
|
5842
6098
|
);
|
|
5843
|
-
var
|
|
6099
|
+
var schema4 = new MongooseSchema8(
|
|
5844
6100
|
{
|
|
5845
6101
|
active: { default: false, required: true, type: Boolean },
|
|
5846
6102
|
address: { required: true, type: String },
|
|
@@ -5852,7 +6108,7 @@ var schema3 = new MongooseSchema7(
|
|
|
5852
6108
|
claimedByUserId: {
|
|
5853
6109
|
ref: "User",
|
|
5854
6110
|
required: false,
|
|
5855
|
-
type:
|
|
6111
|
+
type: import_mongoose8.default.Schema.Types.ObjectId
|
|
5856
6112
|
},
|
|
5857
6113
|
cover: {
|
|
5858
6114
|
required: false,
|
|
@@ -5864,7 +6120,7 @@ var schema3 = new MongooseSchema7(
|
|
|
5864
6120
|
eventId: {
|
|
5865
6121
|
ref: "Event",
|
|
5866
6122
|
required: false,
|
|
5867
|
-
type:
|
|
6123
|
+
type: import_mongoose8.default.Schema.Types.ObjectId
|
|
5868
6124
|
},
|
|
5869
6125
|
eventType: {
|
|
5870
6126
|
enum: Object.values(EnumEventType),
|
|
@@ -5903,18 +6159,18 @@ var schema3 = new MongooseSchema7(
|
|
|
5903
6159
|
},
|
|
5904
6160
|
{ timestamps: true }
|
|
5905
6161
|
);
|
|
5906
|
-
|
|
5907
|
-
|
|
5908
|
-
|
|
5909
|
-
|
|
5910
|
-
|
|
5911
|
-
|
|
5912
|
-
var GoogleImportedMarketModel =
|
|
6162
|
+
schema4.index({ "location.geo": "2dsphere" });
|
|
6163
|
+
schema4.index({ name: 1 });
|
|
6164
|
+
schema4.index({ region: 1 });
|
|
6165
|
+
schema4.index({ deletedAt: 1 });
|
|
6166
|
+
schema4.index({ "dateTime.dateStatus": 1 });
|
|
6167
|
+
schema4.index({ slug: 1 });
|
|
6168
|
+
var GoogleImportedMarketModel = import_mongoose8.default.models.GoogleImportedMarket || import_mongoose8.default.model("GoogleImportedMarket", schema4);
|
|
5913
6169
|
|
|
5914
6170
|
// src/mongoose/Notification.ts
|
|
5915
|
-
var
|
|
5916
|
-
var
|
|
5917
|
-
var
|
|
6171
|
+
var import_mongoose9 = __toESM(require("mongoose"));
|
|
6172
|
+
var MongooseSchema9 = import_mongoose9.default.Schema;
|
|
6173
|
+
var schema5 = new MongooseSchema9(
|
|
5918
6174
|
{
|
|
5919
6175
|
data: {
|
|
5920
6176
|
resourceId: { required: true, type: String },
|
|
@@ -5937,16 +6193,16 @@ var schema4 = new MongooseSchema8(
|
|
|
5937
6193
|
userId: {
|
|
5938
6194
|
ref: "User",
|
|
5939
6195
|
required: true,
|
|
5940
|
-
type:
|
|
6196
|
+
type: import_mongoose9.default.Schema.Types.ObjectId
|
|
5941
6197
|
}
|
|
5942
6198
|
},
|
|
5943
6199
|
{ timestamps: true }
|
|
5944
6200
|
);
|
|
5945
|
-
|
|
5946
|
-
|
|
5947
|
-
var NotificationModel =
|
|
6201
|
+
schema5.index({ isRead: 1, userId: 1 });
|
|
6202
|
+
schema5.index({ createdAt: -1, userId: 1 });
|
|
6203
|
+
var NotificationModel = import_mongoose9.default.models.Notification || import_mongoose9.default.model("Notification", schema5);
|
|
5948
6204
|
|
|
5949
|
-
// node_modules/@timardex/cluemart-shared/dist/chunk-
|
|
6205
|
+
// node_modules/@timardex/cluemart-shared/dist/chunk-P4NLBWEJ.mjs
|
|
5950
6206
|
var EnumInviteStatus2 = /* @__PURE__ */ ((EnumInviteStatus22) => {
|
|
5951
6207
|
EnumInviteStatus22["ACCEPTED"] = "Accepted";
|
|
5952
6208
|
EnumInviteStatus22["COMPLETED"] = "Completed";
|
|
@@ -6024,9 +6280,9 @@ var EnumSubscriptionStatus2 = /* @__PURE__ */ ((EnumSubscriptionStatus22) => {
|
|
|
6024
6280
|
})(EnumSubscriptionStatus2 || {});
|
|
6025
6281
|
|
|
6026
6282
|
// src/mongoose/PushToken.ts
|
|
6027
|
-
var
|
|
6028
|
-
var
|
|
6029
|
-
var
|
|
6283
|
+
var import_mongoose10 = __toESM(require("mongoose"));
|
|
6284
|
+
var MongooseSchema10 = import_mongoose10.default.Schema;
|
|
6285
|
+
var schema6 = new MongooseSchema10(
|
|
6030
6286
|
{
|
|
6031
6287
|
platform: {
|
|
6032
6288
|
enum: Object.values(EnumOSPlatform2),
|
|
@@ -6037,17 +6293,17 @@ var schema5 = new MongooseSchema9(
|
|
|
6037
6293
|
userId: {
|
|
6038
6294
|
ref: "User",
|
|
6039
6295
|
required: true,
|
|
6040
|
-
type:
|
|
6296
|
+
type: import_mongoose10.default.Schema.Types.ObjectId
|
|
6041
6297
|
}
|
|
6042
6298
|
},
|
|
6043
6299
|
{ timestamps: true }
|
|
6044
6300
|
);
|
|
6045
|
-
var PushTokenModel =
|
|
6301
|
+
var PushTokenModel = import_mongoose10.default.models.PushToken || import_mongoose10.default.model("PushToken", schema6);
|
|
6046
6302
|
|
|
6047
6303
|
// src/mongoose/ResourceActivity.ts
|
|
6048
|
-
var
|
|
6049
|
-
var
|
|
6050
|
-
var ActivitySchema = new
|
|
6304
|
+
var import_mongoose11 = __toESM(require("mongoose"));
|
|
6305
|
+
var MongooseSchema11 = import_mongoose11.default.Schema;
|
|
6306
|
+
var ActivitySchema = new MongooseSchema11(
|
|
6051
6307
|
{
|
|
6052
6308
|
activityType: {
|
|
6053
6309
|
enum: Object.values(EnumActivity),
|
|
@@ -6075,7 +6331,7 @@ var ActivitySchema = new MongooseSchema10(
|
|
|
6075
6331
|
},
|
|
6076
6332
|
{ _id: false }
|
|
6077
6333
|
);
|
|
6078
|
-
var
|
|
6334
|
+
var schema7 = new MongooseSchema11(
|
|
6079
6335
|
{
|
|
6080
6336
|
activity: { default: [], type: [ActivitySchema] },
|
|
6081
6337
|
resourceId: { required: true, type: String },
|
|
@@ -6087,46 +6343,55 @@ var schema6 = new MongooseSchema10(
|
|
|
6087
6343
|
},
|
|
6088
6344
|
{ timestamps: true }
|
|
6089
6345
|
);
|
|
6090
|
-
|
|
6091
|
-
|
|
6092
|
-
var ResourceActivityModel =
|
|
6346
|
+
schema7.index({ resourceId: 1, resourceType: 1 }, { unique: true });
|
|
6347
|
+
schema7.index({ "views.location": "2dsphere" });
|
|
6348
|
+
var ResourceActivityModel = import_mongoose11.default.models.ResourceActivity || import_mongoose11.default.model("ResourceActivity", schema7);
|
|
6093
6349
|
|
|
6094
6350
|
// src/mongoose/User.ts
|
|
6095
|
-
var
|
|
6096
|
-
var
|
|
6097
|
-
var userActivityEventSchema = new
|
|
6351
|
+
var import_mongoose12 = __toESM(require("mongoose"));
|
|
6352
|
+
var MongooseSchema12 = import_mongoose12.default.Schema;
|
|
6353
|
+
var userActivityEventSchema = new MongooseSchema12(
|
|
6098
6354
|
{
|
|
6099
6355
|
dateTime: dateTimeSchema2,
|
|
6100
6356
|
resourceId: {
|
|
6101
6357
|
ref: "Event",
|
|
6102
6358
|
required: false,
|
|
6103
|
-
type:
|
|
6359
|
+
type: import_mongoose12.default.Schema.Types.ObjectId
|
|
6104
6360
|
}
|
|
6105
6361
|
},
|
|
6106
6362
|
{ _id: false }
|
|
6107
6363
|
);
|
|
6108
|
-
var userActivityFavouritesSchema = new
|
|
6364
|
+
var userActivityFavouritesSchema = new MongooseSchema12(
|
|
6109
6365
|
{
|
|
6110
6366
|
events: {
|
|
6111
6367
|
ref: "Event",
|
|
6112
6368
|
required: false,
|
|
6113
|
-
type: [
|
|
6369
|
+
type: [import_mongoose12.default.Schema.Types.ObjectId]
|
|
6114
6370
|
},
|
|
6115
6371
|
partners: {
|
|
6116
6372
|
ref: "Partner",
|
|
6117
6373
|
required: false,
|
|
6118
|
-
type: [
|
|
6374
|
+
type: [import_mongoose12.default.Schema.Types.ObjectId]
|
|
6119
6375
|
},
|
|
6120
6376
|
vendors: {
|
|
6121
6377
|
ref: "Vendor",
|
|
6122
6378
|
required: false,
|
|
6123
|
-
type: [
|
|
6379
|
+
type: [import_mongoose12.default.Schema.Types.ObjectId]
|
|
6124
6380
|
}
|
|
6125
6381
|
},
|
|
6126
6382
|
{ _id: false }
|
|
6127
6383
|
);
|
|
6128
|
-
var stripeSchema = new
|
|
6384
|
+
var stripeSchema = new MongooseSchema12(
|
|
6129
6385
|
{
|
|
6386
|
+
billingPeriod: {
|
|
6387
|
+
enum: Object.values(EnumBillingPeriod),
|
|
6388
|
+
required: false,
|
|
6389
|
+
type: String
|
|
6390
|
+
},
|
|
6391
|
+
cancelAtPeriodEnd: {
|
|
6392
|
+
required: false,
|
|
6393
|
+
type: Boolean
|
|
6394
|
+
},
|
|
6130
6395
|
currentPlan: {
|
|
6131
6396
|
enum: Object.values(EnumUserLicence),
|
|
6132
6397
|
required: false,
|
|
@@ -6140,6 +6405,28 @@ var stripeSchema = new MongooseSchema11(
|
|
|
6140
6405
|
required: false,
|
|
6141
6406
|
type: Date
|
|
6142
6407
|
},
|
|
6408
|
+
pendingBillingPeriod: {
|
|
6409
|
+
enum: Object.values(EnumBillingPeriod),
|
|
6410
|
+
required: false,
|
|
6411
|
+
type: String
|
|
6412
|
+
},
|
|
6413
|
+
pendingChangeEffectiveAt: {
|
|
6414
|
+
required: false,
|
|
6415
|
+
type: Date
|
|
6416
|
+
},
|
|
6417
|
+
pendingPlan: {
|
|
6418
|
+
enum: Object.values(EnumUserLicence),
|
|
6419
|
+
required: false,
|
|
6420
|
+
type: String
|
|
6421
|
+
},
|
|
6422
|
+
priceId: {
|
|
6423
|
+
required: false,
|
|
6424
|
+
type: String
|
|
6425
|
+
},
|
|
6426
|
+
scheduleId: {
|
|
6427
|
+
required: false,
|
|
6428
|
+
type: String
|
|
6429
|
+
},
|
|
6143
6430
|
startDate: {
|
|
6144
6431
|
required: false,
|
|
6145
6432
|
type: Date
|
|
@@ -6152,11 +6439,19 @@ var stripeSchema = new MongooseSchema11(
|
|
|
6152
6439
|
subscriptionId: {
|
|
6153
6440
|
required: false,
|
|
6154
6441
|
type: String
|
|
6442
|
+
},
|
|
6443
|
+
subscriptionMutationLockExpiresAt: {
|
|
6444
|
+
required: false,
|
|
6445
|
+
type: Date
|
|
6446
|
+
},
|
|
6447
|
+
subscriptionMutationLockId: {
|
|
6448
|
+
required: false,
|
|
6449
|
+
type: String
|
|
6155
6450
|
}
|
|
6156
6451
|
},
|
|
6157
6452
|
{ _id: false }
|
|
6158
6453
|
);
|
|
6159
|
-
var redeemedRewardSchema = new
|
|
6454
|
+
var redeemedRewardSchema = new MongooseSchema12(
|
|
6160
6455
|
{
|
|
6161
6456
|
name: {
|
|
6162
6457
|
enum: Object.values(EnumReward),
|
|
@@ -6168,13 +6463,13 @@ var redeemedRewardSchema = new MongooseSchema11(
|
|
|
6168
6463
|
},
|
|
6169
6464
|
{ _id: false }
|
|
6170
6465
|
);
|
|
6171
|
-
var
|
|
6466
|
+
var schema8 = new MongooseSchema12(
|
|
6172
6467
|
{
|
|
6173
6468
|
active: { default: false, required: true, type: Boolean },
|
|
6174
6469
|
affiliate: {
|
|
6175
6470
|
ref: "Affiliate",
|
|
6176
6471
|
required: false,
|
|
6177
|
-
type:
|
|
6472
|
+
type: import_mongoose12.default.Schema.Types.ObjectId
|
|
6178
6473
|
},
|
|
6179
6474
|
avatar: {
|
|
6180
6475
|
required: false,
|
|
@@ -6183,7 +6478,7 @@ var schema7 = new MongooseSchema11(
|
|
|
6183
6478
|
coupon: {
|
|
6184
6479
|
ref: "Coupon",
|
|
6185
6480
|
required: false,
|
|
6186
|
-
type:
|
|
6481
|
+
type: import_mongoose12.default.Schema.Types.ObjectId
|
|
6187
6482
|
},
|
|
6188
6483
|
deletedAt: { default: null, required: false, type: Date },
|
|
6189
6484
|
email: { required: true, type: String },
|
|
@@ -6195,13 +6490,13 @@ var schema7 = new MongooseSchema11(
|
|
|
6195
6490
|
events: {
|
|
6196
6491
|
ref: "Event",
|
|
6197
6492
|
required: false,
|
|
6198
|
-
type: [
|
|
6493
|
+
type: [import_mongoose12.default.Schema.Types.ObjectId]
|
|
6199
6494
|
},
|
|
6200
6495
|
firstName: { required: true, type: String },
|
|
6201
6496
|
game: {
|
|
6202
6497
|
ref: "Game",
|
|
6203
6498
|
required: false,
|
|
6204
|
-
type:
|
|
6499
|
+
type: import_mongoose12.default.Schema.Types.ObjectId
|
|
6205
6500
|
},
|
|
6206
6501
|
interests: {
|
|
6207
6502
|
enum: Object.values(EnumResourceType),
|
|
@@ -6223,7 +6518,7 @@ var schema7 = new MongooseSchema11(
|
|
|
6223
6518
|
partner: {
|
|
6224
6519
|
ref: "Partner",
|
|
6225
6520
|
required: false,
|
|
6226
|
-
type:
|
|
6521
|
+
type: import_mongoose12.default.Schema.Types.ObjectId
|
|
6227
6522
|
},
|
|
6228
6523
|
password: { required: true, type: String },
|
|
6229
6524
|
platform: {
|
|
@@ -6256,7 +6551,7 @@ var schema7 = new MongooseSchema11(
|
|
|
6256
6551
|
school: {
|
|
6257
6552
|
ref: "School",
|
|
6258
6553
|
required: false,
|
|
6259
|
-
type:
|
|
6554
|
+
type: import_mongoose12.default.Schema.Types.ObjectId
|
|
6260
6555
|
},
|
|
6261
6556
|
stripe: {
|
|
6262
6557
|
required: false,
|
|
@@ -6281,19 +6576,19 @@ var schema7 = new MongooseSchema11(
|
|
|
6281
6576
|
vendor: {
|
|
6282
6577
|
ref: "Vendor",
|
|
6283
6578
|
required: false,
|
|
6284
|
-
type:
|
|
6579
|
+
type: import_mongoose12.default.Schema.Types.ObjectId
|
|
6285
6580
|
}
|
|
6286
6581
|
},
|
|
6287
6582
|
{ strict: false, timestamps: true }
|
|
6288
6583
|
);
|
|
6289
|
-
|
|
6290
|
-
|
|
6291
|
-
var UserModel =
|
|
6584
|
+
schema8.index({ "licences.expiryDate": 1 });
|
|
6585
|
+
schema8.index({ "licences.licenceType": 1 });
|
|
6586
|
+
var UserModel = import_mongoose12.default.models.User || import_mongoose12.default.model("User", schema8);
|
|
6292
6587
|
|
|
6293
6588
|
// src/mongoose/VerificationToken.ts
|
|
6294
|
-
var
|
|
6295
|
-
var
|
|
6296
|
-
var
|
|
6589
|
+
var import_mongoose13 = __toESM(require("mongoose"));
|
|
6590
|
+
var MongooseSchema13 = import_mongoose13.default.Schema;
|
|
6591
|
+
var schema9 = new MongooseSchema13(
|
|
6297
6592
|
{
|
|
6298
6593
|
createdAt: {
|
|
6299
6594
|
default: Date.now,
|
|
@@ -6308,12 +6603,12 @@ var schema8 = new MongooseSchema12(
|
|
|
6308
6603
|
},
|
|
6309
6604
|
{ timestamps: true }
|
|
6310
6605
|
);
|
|
6311
|
-
var VerificationTokenModel =
|
|
6606
|
+
var VerificationTokenModel = import_mongoose13.default.models.VerificationToken || import_mongoose13.default.model("VerificationToken", schema9);
|
|
6312
6607
|
|
|
6313
6608
|
// src/mongoose/vendor/Vendor.ts
|
|
6314
|
-
var
|
|
6315
|
-
var
|
|
6316
|
-
var vendorProductTypeSchema = new
|
|
6609
|
+
var import_mongoose14 = __toESM(require("mongoose"));
|
|
6610
|
+
var MongooseSchema14 = import_mongoose14.default.Schema;
|
|
6611
|
+
var vendorProductTypeSchema = new MongooseSchema14(
|
|
6317
6612
|
{
|
|
6318
6613
|
description: { required: false, type: String },
|
|
6319
6614
|
name: { required: true, type: String },
|
|
@@ -6324,14 +6619,14 @@ var vendorProductTypeSchema = new MongooseSchema13(
|
|
|
6324
6619
|
},
|
|
6325
6620
|
{ timestamps: true }
|
|
6326
6621
|
);
|
|
6327
|
-
var productWrapperSchema = new
|
|
6622
|
+
var productWrapperSchema = new MongooseSchema14(
|
|
6328
6623
|
{
|
|
6329
6624
|
active: { default: false, required: false, type: Boolean },
|
|
6330
6625
|
productsList: { required: false, type: [vendorProductTypeSchema] }
|
|
6331
6626
|
},
|
|
6332
6627
|
{ _id: false }
|
|
6333
6628
|
);
|
|
6334
|
-
var calendarSchema = new
|
|
6629
|
+
var calendarSchema = new MongooseSchema14(
|
|
6335
6630
|
{
|
|
6336
6631
|
dateTime: {
|
|
6337
6632
|
dateStatus: {
|
|
@@ -6352,14 +6647,14 @@ var calendarSchema = new MongooseSchema13(
|
|
|
6352
6647
|
},
|
|
6353
6648
|
{ _id: false }
|
|
6354
6649
|
);
|
|
6355
|
-
var calendarWrapperSchema = new
|
|
6650
|
+
var calendarWrapperSchema = new MongooseSchema14(
|
|
6356
6651
|
{
|
|
6357
6652
|
active: { default: false, required: true, type: Boolean },
|
|
6358
6653
|
calendarData: { required: false, type: [calendarSchema] }
|
|
6359
6654
|
},
|
|
6360
6655
|
{ _id: false }
|
|
6361
6656
|
);
|
|
6362
|
-
var
|
|
6657
|
+
var schema10 = new MongooseSchema14(
|
|
6363
6658
|
{
|
|
6364
6659
|
...baseResourceFields,
|
|
6365
6660
|
// Importing base resource fields from global.ts
|
|
@@ -6385,12 +6680,12 @@ var schema9 = new MongooseSchema13(
|
|
|
6385
6680
|
unregisteredVendorId: {
|
|
6386
6681
|
ref: "UnregisteredVendor",
|
|
6387
6682
|
required: false,
|
|
6388
|
-
type:
|
|
6683
|
+
type: import_mongoose14.default.Schema.Types.ObjectId
|
|
6389
6684
|
},
|
|
6390
6685
|
vendorInfoId: {
|
|
6391
6686
|
ref: "VendorInfo",
|
|
6392
6687
|
required: false,
|
|
6393
|
-
type:
|
|
6688
|
+
type: import_mongoose14.default.Schema.Types.ObjectId
|
|
6394
6689
|
},
|
|
6395
6690
|
vendorType: {
|
|
6396
6691
|
enum: Object.values(EnumVendorType),
|
|
@@ -6400,24 +6695,24 @@ var schema9 = new MongooseSchema13(
|
|
|
6400
6695
|
},
|
|
6401
6696
|
{ timestamps: true }
|
|
6402
6697
|
);
|
|
6403
|
-
|
|
6404
|
-
|
|
6405
|
-
|
|
6406
|
-
|
|
6407
|
-
|
|
6408
|
-
var VendorModel =
|
|
6698
|
+
schema10.index({ name: 1 });
|
|
6699
|
+
schema10.index({ description: 1 });
|
|
6700
|
+
schema10.index({ region: 1 });
|
|
6701
|
+
schema10.index({ "categories.name": 1 });
|
|
6702
|
+
schema10.index({ slug: 1 });
|
|
6703
|
+
var VendorModel = import_mongoose14.default.models.Vendor || import_mongoose14.default.model("Vendor", schema10);
|
|
6409
6704
|
|
|
6410
6705
|
// src/mongoose/vendor/VendorInfo.ts
|
|
6411
|
-
var
|
|
6412
|
-
var
|
|
6413
|
-
var AttributesSchema = new
|
|
6706
|
+
var import_mongoose15 = __toESM(require("mongoose"));
|
|
6707
|
+
var MongooseSchema15 = import_mongoose15.default.Schema;
|
|
6708
|
+
var AttributesSchema = new MongooseSchema15(
|
|
6414
6709
|
{
|
|
6415
6710
|
details: { required: false, type: String },
|
|
6416
6711
|
isRequired: { default: false, required: true, type: Boolean }
|
|
6417
6712
|
},
|
|
6418
6713
|
{ _id: false }
|
|
6419
6714
|
);
|
|
6420
|
-
var
|
|
6715
|
+
var schema11 = new MongooseSchema15(
|
|
6421
6716
|
{
|
|
6422
6717
|
active: { default: true, type: Boolean },
|
|
6423
6718
|
compliance: {
|
|
@@ -6452,28 +6747,28 @@ var schema10 = new MongooseSchema14(
|
|
|
6452
6747
|
vendorId: {
|
|
6453
6748
|
ref: "Vendor",
|
|
6454
6749
|
required: true,
|
|
6455
|
-
type:
|
|
6750
|
+
type: import_mongoose15.default.Schema.Types.ObjectId
|
|
6456
6751
|
}
|
|
6457
6752
|
},
|
|
6458
6753
|
{ timestamps: true }
|
|
6459
6754
|
);
|
|
6460
|
-
var VendorInfoModel =
|
|
6755
|
+
var VendorInfoModel = import_mongoose15.default.models.VendorInfo || import_mongoose15.default.model("VendorInfo", schema11);
|
|
6461
6756
|
|
|
6462
6757
|
// src/mongoose/vendor/UnregisteredVendor.ts
|
|
6463
|
-
var
|
|
6464
|
-
var
|
|
6465
|
-
var invitationSchema = new
|
|
6758
|
+
var import_mongoose16 = __toESM(require("mongoose"));
|
|
6759
|
+
var MongooseSchema16 = import_mongoose16.default.Schema;
|
|
6760
|
+
var invitationSchema = new MongooseSchema16(
|
|
6466
6761
|
{
|
|
6467
6762
|
dateTime: { required: true, type: [dateTimeSchema2] },
|
|
6468
6763
|
inviterId: {
|
|
6469
6764
|
ref: "Event",
|
|
6470
6765
|
required: true,
|
|
6471
|
-
type:
|
|
6766
|
+
type: import_mongoose16.default.Schema.Types.ObjectId
|
|
6472
6767
|
}
|
|
6473
6768
|
},
|
|
6474
6769
|
{ _id: false }
|
|
6475
6770
|
);
|
|
6476
|
-
var
|
|
6771
|
+
var schema12 = new MongooseSchema16(
|
|
6477
6772
|
{
|
|
6478
6773
|
active: { default: true, required: true, type: Boolean },
|
|
6479
6774
|
categoryIds: { required: true, type: [String] },
|
|
@@ -6482,7 +6777,7 @@ var schema11 = new MongooseSchema15(
|
|
|
6482
6777
|
claimedByUserId: {
|
|
6483
6778
|
ref: "User",
|
|
6484
6779
|
required: false,
|
|
6485
|
-
type:
|
|
6780
|
+
type: import_mongoose16.default.Schema.Types.ObjectId
|
|
6486
6781
|
},
|
|
6487
6782
|
claimInitiatedAt: { default: null, required: false, type: Date },
|
|
6488
6783
|
claimToken: { default: null, required: false, type: String },
|
|
@@ -6495,14 +6790,14 @@ var schema11 = new MongooseSchema15(
|
|
|
6495
6790
|
},
|
|
6496
6791
|
{ timestamps: true }
|
|
6497
6792
|
);
|
|
6498
|
-
|
|
6499
|
-
|
|
6500
|
-
var UnregisteredVendorModel =
|
|
6793
|
+
schema12.index({ name: 1 });
|
|
6794
|
+
schema12.index({ email: 1 });
|
|
6795
|
+
var UnregisteredVendorModel = import_mongoose16.default.models.UnregisteredVendor || import_mongoose16.default.model("UnregisteredVendor", schema12);
|
|
6501
6796
|
|
|
6502
6797
|
// src/mongoose/event/Event.ts
|
|
6503
|
-
var
|
|
6504
|
-
var
|
|
6505
|
-
var
|
|
6798
|
+
var import_mongoose17 = __toESM(require("mongoose"));
|
|
6799
|
+
var MongooseSchema17 = import_mongoose17.default.Schema;
|
|
6800
|
+
var schema13 = new MongooseSchema17(
|
|
6506
6801
|
{
|
|
6507
6802
|
...baseResourceFields,
|
|
6508
6803
|
// Importing base resource fields from global.ts
|
|
@@ -6511,7 +6806,7 @@ var schema12 = new MongooseSchema16(
|
|
|
6511
6806
|
eventInfoId: {
|
|
6512
6807
|
ref: "EventInfo",
|
|
6513
6808
|
required: false,
|
|
6514
|
-
type:
|
|
6809
|
+
type: import_mongoose17.default.Schema.Types.ObjectId
|
|
6515
6810
|
},
|
|
6516
6811
|
eventType: {
|
|
6517
6812
|
enum: Object.values(EnumEventType),
|
|
@@ -6540,20 +6835,20 @@ var schema12 = new MongooseSchema16(
|
|
|
6540
6835
|
},
|
|
6541
6836
|
{ timestamps: true }
|
|
6542
6837
|
);
|
|
6543
|
-
|
|
6544
|
-
|
|
6545
|
-
|
|
6546
|
-
|
|
6547
|
-
|
|
6548
|
-
|
|
6549
|
-
|
|
6550
|
-
|
|
6551
|
-
var EventModel =
|
|
6838
|
+
schema13.index({ name: 1 });
|
|
6839
|
+
schema13.index({ description: 1 });
|
|
6840
|
+
schema13.index({ region: 1 });
|
|
6841
|
+
schema13.index({ "location.geo": "2dsphere" });
|
|
6842
|
+
schema13.index({ tags: 1 });
|
|
6843
|
+
schema13.index({ deletedAt: 1 });
|
|
6844
|
+
schema13.index({ "dateTime.dateStatus": 1 });
|
|
6845
|
+
schema13.index({ slug: 1 });
|
|
6846
|
+
var EventModel = import_mongoose17.default.models.Event || import_mongoose17.default.model("Event", schema13);
|
|
6552
6847
|
|
|
6553
6848
|
// src/mongoose/Partner.ts
|
|
6554
|
-
var
|
|
6555
|
-
var
|
|
6556
|
-
var
|
|
6849
|
+
var import_mongoose18 = __toESM(require("mongoose"));
|
|
6850
|
+
var MongooseSchema18 = import_mongoose18.default.Schema;
|
|
6851
|
+
var schema14 = new MongooseSchema18(
|
|
6557
6852
|
{
|
|
6558
6853
|
...baseResourceFields,
|
|
6559
6854
|
location: {
|
|
@@ -6569,19 +6864,19 @@ var schema13 = new MongooseSchema17(
|
|
|
6569
6864
|
},
|
|
6570
6865
|
{ timestamps: true }
|
|
6571
6866
|
);
|
|
6572
|
-
|
|
6573
|
-
|
|
6574
|
-
|
|
6575
|
-
|
|
6576
|
-
|
|
6577
|
-
var PartnerModel =
|
|
6867
|
+
schema14.index({ name: 1 });
|
|
6868
|
+
schema14.index({ description: 1 });
|
|
6869
|
+
schema14.index({ region: 1 });
|
|
6870
|
+
schema14.index({ "location.geo": "2dsphere" });
|
|
6871
|
+
schema14.index({ slug: 1 });
|
|
6872
|
+
var PartnerModel = import_mongoose18.default.models.Partner || import_mongoose18.default.model("Partner", schema14);
|
|
6578
6873
|
|
|
6579
6874
|
// src/mongoose/Post.ts
|
|
6580
|
-
var
|
|
6581
|
-
var
|
|
6582
|
-
var contentSchema = new
|
|
6875
|
+
var import_mongoose19 = __toESM(require("mongoose"));
|
|
6876
|
+
var MongooseSchema19 = import_mongoose19.default.Schema;
|
|
6877
|
+
var contentSchema = new MongooseSchema19(
|
|
6583
6878
|
{
|
|
6584
|
-
contentData:
|
|
6879
|
+
contentData: import_mongoose19.Schema.Types.Mixed,
|
|
6585
6880
|
contentOrder: { required: true, type: Number },
|
|
6586
6881
|
contentType: {
|
|
6587
6882
|
enum: Object.values(EnumPostContentType),
|
|
@@ -6591,7 +6886,7 @@ var contentSchema = new MongooseSchema18(
|
|
|
6591
6886
|
},
|
|
6592
6887
|
{ _id: false }
|
|
6593
6888
|
);
|
|
6594
|
-
var resourceSchema = new
|
|
6889
|
+
var resourceSchema = new MongooseSchema19(
|
|
6595
6890
|
{
|
|
6596
6891
|
resourceId: { required: true, type: String },
|
|
6597
6892
|
resourceRegion: { required: true, type: String },
|
|
@@ -6604,7 +6899,7 @@ var resourceSchema = new MongooseSchema18(
|
|
|
6604
6899
|
},
|
|
6605
6900
|
{ _id: false }
|
|
6606
6901
|
);
|
|
6607
|
-
var
|
|
6902
|
+
var schema15 = new MongooseSchema19(
|
|
6608
6903
|
{
|
|
6609
6904
|
active: { default: false, required: true, type: Boolean },
|
|
6610
6905
|
approvedAt: { default: null, required: false, type: Date },
|
|
@@ -6635,16 +6930,16 @@ var schema14 = new MongooseSchema18(
|
|
|
6635
6930
|
},
|
|
6636
6931
|
{ timestamps: true }
|
|
6637
6932
|
);
|
|
6638
|
-
|
|
6639
|
-
|
|
6640
|
-
|
|
6641
|
-
var PostModel =
|
|
6933
|
+
schema15.index({ title: 1 });
|
|
6934
|
+
schema15.index({ tags: 1 });
|
|
6935
|
+
schema15.index({ postType: 1, slug: 1 }, { unique: true });
|
|
6936
|
+
var PostModel = import_mongoose19.default.models.Post || import_mongoose19.default.model("Post", schema15);
|
|
6642
6937
|
|
|
6643
6938
|
// src/mongoose/AppSetting.ts
|
|
6644
|
-
var
|
|
6645
|
-
var
|
|
6939
|
+
var import_mongoose20 = __toESM(require("mongoose"));
|
|
6940
|
+
var MongooseSchema20 = import_mongoose20.default.Schema;
|
|
6646
6941
|
var APP_SETTINGS_ID = "APP_SETTINGS_DOCUMENT_ID";
|
|
6647
|
-
var AppSettingSchema = new
|
|
6942
|
+
var AppSettingSchema = new MongooseSchema20(
|
|
6648
6943
|
{
|
|
6649
6944
|
activeSchoolsStudentCountTotal: {
|
|
6650
6945
|
default: 0,
|
|
@@ -6675,18 +6970,18 @@ var AppSettingSchema = new MongooseSchema19(
|
|
|
6675
6970
|
},
|
|
6676
6971
|
{ timestamps: true }
|
|
6677
6972
|
);
|
|
6678
|
-
var AppSettingModel =
|
|
6973
|
+
var AppSettingModel = import_mongoose20.default.models.AppSetting || import_mongoose20.default.model("AppSetting", AppSettingSchema);
|
|
6679
6974
|
|
|
6680
6975
|
// src/mongoose/game/Game.ts
|
|
6681
|
-
var
|
|
6976
|
+
var import_mongoose24 = __toESM(require("mongoose"));
|
|
6682
6977
|
|
|
6683
6978
|
// src/mongoose/game/DailyClue.ts
|
|
6684
|
-
var
|
|
6979
|
+
var import_mongoose22 = __toESM(require("mongoose"));
|
|
6685
6980
|
|
|
6686
6981
|
// src/mongoose/game/utils.ts
|
|
6687
|
-
var
|
|
6688
|
-
var
|
|
6689
|
-
var schemaGameDate = new
|
|
6982
|
+
var import_mongoose21 = __toESM(require("mongoose"));
|
|
6983
|
+
var MongooseSchema21 = import_mongoose21.default.Schema;
|
|
6984
|
+
var schemaGameDate = new MongooseSchema21(
|
|
6690
6985
|
{
|
|
6691
6986
|
endDate: { required: true, type: Date },
|
|
6692
6987
|
startDate: { required: true, type: Date }
|
|
@@ -6695,8 +6990,8 @@ var schemaGameDate = new MongooseSchema20(
|
|
|
6695
6990
|
);
|
|
6696
6991
|
|
|
6697
6992
|
// src/mongoose/game/DailyClue.ts
|
|
6698
|
-
var
|
|
6699
|
-
var schemaLetters = new
|
|
6993
|
+
var MongooseSchema22 = import_mongoose22.default.Schema;
|
|
6994
|
+
var schemaLetters = new MongooseSchema22(
|
|
6700
6995
|
{
|
|
6701
6996
|
collected: { required: false, type: [String] },
|
|
6702
6997
|
solutionShuffled: { required: true, type: [String] }
|
|
@@ -6704,14 +6999,14 @@ var schemaLetters = new MongooseSchema21(
|
|
|
6704
6999
|
},
|
|
6705
7000
|
{ _id: false }
|
|
6706
7001
|
);
|
|
6707
|
-
var schemaDailyClueBaseGame = new
|
|
7002
|
+
var schemaDailyClueBaseGame = new MongooseSchema22(
|
|
6708
7003
|
{
|
|
6709
7004
|
gameDate: { required: true, type: schemaGameDate },
|
|
6710
7005
|
gameSolution: { required: true, type: String }
|
|
6711
7006
|
},
|
|
6712
7007
|
{ _id: false }
|
|
6713
7008
|
);
|
|
6714
|
-
var schemaDailyClueGameData = new
|
|
7009
|
+
var schemaDailyClueGameData = new MongooseSchema22(
|
|
6715
7010
|
{
|
|
6716
7011
|
gameFields: { required: true, type: schemaDailyClueBaseGame },
|
|
6717
7012
|
lastFoundDate: { default: null, required: false, type: Date },
|
|
@@ -6726,9 +7021,9 @@ var schemaDailyClueGameData = new MongooseSchema21(
|
|
|
6726
7021
|
);
|
|
6727
7022
|
|
|
6728
7023
|
// src/mongoose/game/PuzzleGame.ts
|
|
6729
|
-
var
|
|
6730
|
-
var
|
|
6731
|
-
var schemaPuzzleAnswer = new
|
|
7024
|
+
var import_mongoose23 = __toESM(require("mongoose"));
|
|
7025
|
+
var MongooseSchema23 = import_mongoose23.default.Schema;
|
|
7026
|
+
var schemaPuzzleAnswer = new MongooseSchema23(
|
|
6732
7027
|
{
|
|
6733
7028
|
answer: { required: true, type: String },
|
|
6734
7029
|
answerId: { required: true, type: String },
|
|
@@ -6736,7 +7031,7 @@ var schemaPuzzleAnswer = new MongooseSchema22(
|
|
|
6736
7031
|
},
|
|
6737
7032
|
{ _id: false }
|
|
6738
7033
|
);
|
|
6739
|
-
var schemaPuzzleQuestion = new
|
|
7034
|
+
var schemaPuzzleQuestion = new MongooseSchema23(
|
|
6740
7035
|
{
|
|
6741
7036
|
answers: { required: true, type: [schemaPuzzleAnswer] },
|
|
6742
7037
|
question: { required: true, type: String },
|
|
@@ -6744,20 +7039,20 @@ var schemaPuzzleQuestion = new MongooseSchema22(
|
|
|
6744
7039
|
},
|
|
6745
7040
|
{ _id: false }
|
|
6746
7041
|
);
|
|
6747
|
-
var schemaPuzzleBaseGame = new
|
|
7042
|
+
var schemaPuzzleBaseGame = new MongooseSchema23(
|
|
6748
7043
|
{
|
|
6749
7044
|
questions: { required: true, type: [schemaPuzzleQuestion] }
|
|
6750
7045
|
},
|
|
6751
7046
|
{ _id: false }
|
|
6752
7047
|
);
|
|
6753
|
-
var schemaPuzzleAnsweredQuestion = new
|
|
7048
|
+
var schemaPuzzleAnsweredQuestion = new MongooseSchema23(
|
|
6754
7049
|
{
|
|
6755
7050
|
questionId: { required: true, type: String },
|
|
6756
7051
|
selectedAnswerId: { required: true, type: String }
|
|
6757
7052
|
},
|
|
6758
7053
|
{ _id: false }
|
|
6759
7054
|
);
|
|
6760
|
-
var schemaPuzzleGameData = new
|
|
7055
|
+
var schemaPuzzleGameData = new MongooseSchema23(
|
|
6761
7056
|
{
|
|
6762
7057
|
answeredQuestions: {
|
|
6763
7058
|
default: null,
|
|
@@ -6772,19 +7067,19 @@ var schemaPuzzleGameData = new MongooseSchema22(
|
|
|
6772
7067
|
);
|
|
6773
7068
|
|
|
6774
7069
|
// src/mongoose/game/Game.ts
|
|
6775
|
-
var
|
|
7070
|
+
var MongooseSchema24 = import_mongoose24.default.Schema;
|
|
6776
7071
|
var gameDataSchemas = {
|
|
6777
7072
|
[EnumGameType.DAILY_CLUE]: schemaDailyClueGameData,
|
|
6778
7073
|
[EnumGameType.MINI_QUIZ]: schemaPuzzleGameData,
|
|
6779
7074
|
[EnumGameType.ODD_ONE_OUT]: schemaPuzzleGameData
|
|
6780
7075
|
};
|
|
6781
7076
|
var gameDataDefinition = Object.fromEntries(
|
|
6782
|
-
Object.entries(gameDataSchemas).map(([key,
|
|
7077
|
+
Object.entries(gameDataSchemas).map(([key, schema20]) => [
|
|
6783
7078
|
key,
|
|
6784
|
-
{ default: null, required: false, type:
|
|
7079
|
+
{ default: null, required: false, type: schema20 }
|
|
6785
7080
|
])
|
|
6786
7081
|
);
|
|
6787
|
-
var gameHistorySchema = new
|
|
7082
|
+
var gameHistorySchema = new MongooseSchema24(
|
|
6788
7083
|
{
|
|
6789
7084
|
createdAt: { required: true, type: Date },
|
|
6790
7085
|
gameDate: { required: true, type: schemaGameDate },
|
|
@@ -6804,7 +7099,7 @@ var gameHistorySchema = new MongooseSchema23(
|
|
|
6804
7099
|
},
|
|
6805
7100
|
{ _id: false }
|
|
6806
7101
|
);
|
|
6807
|
-
var gameTypeSchema = new
|
|
7102
|
+
var gameTypeSchema = new MongooseSchema24(
|
|
6808
7103
|
{
|
|
6809
7104
|
active: { default: true, required: true, type: Boolean },
|
|
6810
7105
|
gameData: gameDataDefinition,
|
|
@@ -6819,7 +7114,7 @@ var gameTypeSchema = new MongooseSchema23(
|
|
|
6819
7114
|
},
|
|
6820
7115
|
{ timestamps: true }
|
|
6821
7116
|
);
|
|
6822
|
-
var
|
|
7117
|
+
var schema16 = new MongooseSchema24(
|
|
6823
7118
|
{
|
|
6824
7119
|
active: { default: false, required: true, type: Boolean },
|
|
6825
7120
|
deletedAt: { default: null, required: false, type: Date },
|
|
@@ -6832,12 +7127,12 @@ var schema15 = new MongooseSchema23(
|
|
|
6832
7127
|
},
|
|
6833
7128
|
{ timestamps: true }
|
|
6834
7129
|
);
|
|
6835
|
-
var GameModel =
|
|
7130
|
+
var GameModel = import_mongoose24.default.models.Game || import_mongoose24.default.model("Game", schema16);
|
|
6836
7131
|
|
|
6837
7132
|
// src/mongoose/School.ts
|
|
6838
|
-
var
|
|
6839
|
-
var
|
|
6840
|
-
var campaignsSchema = new
|
|
7133
|
+
var import_mongoose25 = __toESM(require("mongoose"));
|
|
7134
|
+
var MongooseSchema25 = import_mongoose25.default.Schema;
|
|
7135
|
+
var campaignsSchema = new MongooseSchema25(
|
|
6841
7136
|
{
|
|
6842
7137
|
endDate: { required: true, type: Date },
|
|
6843
7138
|
name: { required: true, type: String },
|
|
@@ -6845,7 +7140,7 @@ var campaignsSchema = new MongooseSchema24(
|
|
|
6845
7140
|
},
|
|
6846
7141
|
{ _id: false }
|
|
6847
7142
|
);
|
|
6848
|
-
var
|
|
7143
|
+
var schema17 = new MongooseSchema25(
|
|
6849
7144
|
{
|
|
6850
7145
|
// New schools are active by default
|
|
6851
7146
|
active: { default: false, required: true, type: Boolean },
|
|
@@ -6872,19 +7167,19 @@ var schema16 = new MongooseSchema24(
|
|
|
6872
7167
|
},
|
|
6873
7168
|
{ timestamps: true }
|
|
6874
7169
|
);
|
|
6875
|
-
|
|
7170
|
+
schema17.index(
|
|
6876
7171
|
{ schoolCode: 1 },
|
|
6877
7172
|
{
|
|
6878
7173
|
partialFilterExpression: { active: true, deletedAt: null },
|
|
6879
7174
|
unique: true
|
|
6880
7175
|
}
|
|
6881
7176
|
);
|
|
6882
|
-
var SchoolModel =
|
|
7177
|
+
var SchoolModel = import_mongoose25.default.models.School || import_mongoose25.default.model("School", schema17);
|
|
6883
7178
|
|
|
6884
7179
|
// src/mongoose/Affiliate.ts
|
|
6885
|
-
var
|
|
6886
|
-
var
|
|
6887
|
-
var affiliateRewardSchema = new
|
|
7180
|
+
var import_mongoose26 = __toESM(require("mongoose"));
|
|
7181
|
+
var MongooseSchema26 = import_mongoose26.default.Schema;
|
|
7182
|
+
var affiliateRewardSchema = new MongooseSchema26(
|
|
6888
7183
|
{
|
|
6889
7184
|
createdAt: { required: true, type: Date },
|
|
6890
7185
|
redeemedAt: { default: null, required: false, type: Date },
|
|
@@ -6898,13 +7193,13 @@ var affiliateRewardSchema = new MongooseSchema25(
|
|
|
6898
7193
|
},
|
|
6899
7194
|
{ _id: false }
|
|
6900
7195
|
);
|
|
6901
|
-
var affiliateResourceSchema = new
|
|
7196
|
+
var affiliateResourceSchema = new MongooseSchema26(
|
|
6902
7197
|
{
|
|
6903
7198
|
resourceActive: { default: true, required: true, type: Boolean },
|
|
6904
7199
|
resourceDeletedAt: { default: null, required: false, type: Date },
|
|
6905
7200
|
resourceId: {
|
|
6906
7201
|
required: true,
|
|
6907
|
-
type:
|
|
7202
|
+
type: import_mongoose26.default.Schema.Types.ObjectId
|
|
6908
7203
|
},
|
|
6909
7204
|
resourceName: { required: true, type: String },
|
|
6910
7205
|
resourceOwner: {
|
|
@@ -6924,20 +7219,20 @@ var affiliateResourceSchema = new MongooseSchema25(
|
|
|
6924
7219
|
},
|
|
6925
7220
|
{ _id: false }
|
|
6926
7221
|
);
|
|
6927
|
-
var affiliateContactDetailsSchema = new
|
|
7222
|
+
var affiliateContactDetailsSchema = new MongooseSchema26(
|
|
6928
7223
|
{
|
|
6929
7224
|
mobilePhone: { required: true, type: String }
|
|
6930
7225
|
},
|
|
6931
7226
|
{ _id: false }
|
|
6932
7227
|
);
|
|
6933
|
-
var affiliateBankAccountDetailsSchema = new
|
|
7228
|
+
var affiliateBankAccountDetailsSchema = new MongooseSchema26(
|
|
6934
7229
|
{
|
|
6935
7230
|
accountHolderName: { required: true, type: String },
|
|
6936
7231
|
accountNumber: { required: true, type: String }
|
|
6937
7232
|
},
|
|
6938
7233
|
{ _id: false }
|
|
6939
7234
|
);
|
|
6940
|
-
var affiliateDetailsSchema = new
|
|
7235
|
+
var affiliateDetailsSchema = new MongooseSchema26(
|
|
6941
7236
|
{
|
|
6942
7237
|
bankAccountDetails: {
|
|
6943
7238
|
required: true,
|
|
@@ -6959,7 +7254,7 @@ var affiliateDetailsSchema = new MongooseSchema25(
|
|
|
6959
7254
|
},
|
|
6960
7255
|
{ _id: false }
|
|
6961
7256
|
);
|
|
6962
|
-
var redeemHistorySchema = new
|
|
7257
|
+
var redeemHistorySchema = new MongooseSchema26(
|
|
6963
7258
|
{
|
|
6964
7259
|
paidAt: { default: null, required: false, type: Date },
|
|
6965
7260
|
redeemedAt: { required: true, type: Date },
|
|
@@ -6967,7 +7262,7 @@ var redeemHistorySchema = new MongooseSchema25(
|
|
|
6967
7262
|
},
|
|
6968
7263
|
{ _id: false }
|
|
6969
7264
|
);
|
|
6970
|
-
var
|
|
7265
|
+
var schema18 = new MongooseSchema26(
|
|
6971
7266
|
{
|
|
6972
7267
|
active: { default: false, required: true, type: Boolean },
|
|
6973
7268
|
affiliateBonusRewards: {
|
|
@@ -6997,19 +7292,19 @@ var schema17 = new MongooseSchema25(
|
|
|
6997
7292
|
},
|
|
6998
7293
|
{ timestamps: true }
|
|
6999
7294
|
);
|
|
7000
|
-
|
|
7295
|
+
schema18.index(
|
|
7001
7296
|
{ affiliateCode: 1 },
|
|
7002
7297
|
{
|
|
7003
7298
|
partialFilterExpression: { active: true, deletedAt: null },
|
|
7004
7299
|
unique: true
|
|
7005
7300
|
}
|
|
7006
7301
|
);
|
|
7007
|
-
var AffiliateModel =
|
|
7302
|
+
var AffiliateModel = import_mongoose26.default.models.Affiliate || import_mongoose26.default.model("Affiliate", schema18);
|
|
7008
7303
|
|
|
7009
7304
|
// src/mongoose/Coupon.ts
|
|
7010
|
-
var
|
|
7011
|
-
var
|
|
7012
|
-
var couponOptionSchema = new
|
|
7305
|
+
var import_mongoose27 = __toESM(require("mongoose"));
|
|
7306
|
+
var MongooseSchema27 = import_mongoose27.default.Schema;
|
|
7307
|
+
var couponOptionSchema = new MongooseSchema27(
|
|
7013
7308
|
{
|
|
7014
7309
|
buy: { required: false, type: Number },
|
|
7015
7310
|
get: { required: false, type: Number },
|
|
@@ -7024,29 +7319,29 @@ var couponOptionSchema = new MongooseSchema26(
|
|
|
7024
7319
|
},
|
|
7025
7320
|
{ _id: false }
|
|
7026
7321
|
);
|
|
7027
|
-
var couponVendorProductSchema = new
|
|
7322
|
+
var couponVendorProductSchema = new MongooseSchema27(
|
|
7028
7323
|
{
|
|
7029
7324
|
couponId: {
|
|
7030
7325
|
required: true,
|
|
7031
|
-
type:
|
|
7326
|
+
type: import_mongoose27.default.Schema.Types.ObjectId
|
|
7032
7327
|
},
|
|
7033
7328
|
productId: {
|
|
7034
7329
|
required: true,
|
|
7035
|
-
type:
|
|
7330
|
+
type: import_mongoose27.default.Schema.Types.ObjectId
|
|
7036
7331
|
},
|
|
7037
7332
|
vendorCouponId: {
|
|
7038
7333
|
required: false,
|
|
7039
|
-
type:
|
|
7334
|
+
type: import_mongoose27.default.Schema.Types.ObjectId
|
|
7040
7335
|
},
|
|
7041
7336
|
vendorId: {
|
|
7042
7337
|
ref: "Vendor",
|
|
7043
7338
|
required: true,
|
|
7044
|
-
type:
|
|
7339
|
+
type: import_mongoose27.default.Schema.Types.ObjectId
|
|
7045
7340
|
}
|
|
7046
7341
|
},
|
|
7047
7342
|
{ _id: false }
|
|
7048
7343
|
);
|
|
7049
|
-
var couponCodeSchema = new
|
|
7344
|
+
var couponCodeSchema = new MongooseSchema27(
|
|
7050
7345
|
{
|
|
7051
7346
|
code: { required: true, type: String },
|
|
7052
7347
|
qrCode: { required: true, type: ResourceImageTypeSchema },
|
|
@@ -7054,7 +7349,7 @@ var couponCodeSchema = new MongooseSchema26(
|
|
|
7054
7349
|
},
|
|
7055
7350
|
{ _id: false }
|
|
7056
7351
|
);
|
|
7057
|
-
var couponParticipantUserSchema = new
|
|
7352
|
+
var couponParticipantUserSchema = new MongooseSchema27(
|
|
7058
7353
|
{
|
|
7059
7354
|
couponCollectedCount: { default: 0, required: true, type: Number },
|
|
7060
7355
|
couponCycleRedeemed: { default: false, required: true, type: Boolean },
|
|
@@ -7063,12 +7358,12 @@ var couponParticipantUserSchema = new MongooseSchema26(
|
|
|
7063
7358
|
userId: {
|
|
7064
7359
|
ref: "User",
|
|
7065
7360
|
required: true,
|
|
7066
|
-
type:
|
|
7361
|
+
type: import_mongoose27.default.Schema.Types.ObjectId
|
|
7067
7362
|
}
|
|
7068
7363
|
},
|
|
7069
7364
|
{ timestamps: true }
|
|
7070
7365
|
);
|
|
7071
|
-
var couponDataSchema = new
|
|
7366
|
+
var couponDataSchema = new MongooseSchema27(
|
|
7072
7367
|
{
|
|
7073
7368
|
active: { default: true, required: true, type: Boolean },
|
|
7074
7369
|
couponCode: { required: false, type: couponCodeSchema },
|
|
@@ -7095,7 +7390,7 @@ var couponDataSchema = new MongooseSchema26(
|
|
|
7095
7390
|
},
|
|
7096
7391
|
{ timestamps: true }
|
|
7097
7392
|
);
|
|
7098
|
-
var
|
|
7393
|
+
var schema19 = new MongooseSchema27(
|
|
7099
7394
|
{
|
|
7100
7395
|
active: { default: true, required: true, type: Boolean },
|
|
7101
7396
|
couponData: { default: [], required: false, type: [couponDataSchema] },
|
|
@@ -7107,7 +7402,7 @@ var schema18 = new MongooseSchema26(
|
|
|
7107
7402
|
},
|
|
7108
7403
|
{ timestamps: true }
|
|
7109
7404
|
);
|
|
7110
|
-
var CouponModel =
|
|
7405
|
+
var CouponModel = import_mongoose27.default.models.Coupon || import_mongoose27.default.model("Coupon", schema19);
|
|
7111
7406
|
|
|
7112
7407
|
// src/service/promoCode/constants.ts
|
|
7113
7408
|
var ACTIVE_NOT_DELETED_FILTER = {
|
|
@@ -7124,7 +7419,7 @@ async function activeAffiliateCodeExists(affiliateCode) {
|
|
|
7124
7419
|
return existing !== null;
|
|
7125
7420
|
}
|
|
7126
7421
|
|
|
7127
|
-
// node_modules/@timardex/cluemart-shared/dist/chunk-
|
|
7422
|
+
// node_modules/@timardex/cluemart-shared/dist/chunk-YRO6KEZG.mjs
|
|
7128
7423
|
var import_dayjs3 = __toESM(require("dayjs"), 1);
|
|
7129
7424
|
var import_customParseFormat2 = __toESM(require("dayjs/plugin/customParseFormat.js"), 1);
|
|
7130
7425
|
var import_isSameOrAfter2 = __toESM(require("dayjs/plugin/isSameOrAfter.js"), 1);
|
|
@@ -7197,7 +7492,7 @@ var SHARE_RESOURCE_LABEL2 = {
|
|
|
7197
7492
|
school: "School"
|
|
7198
7493
|
};
|
|
7199
7494
|
|
|
7200
|
-
// node_modules/@timardex/cluemart-shared/dist/chunk-
|
|
7495
|
+
// node_modules/@timardex/cluemart-shared/dist/chunk-STNE7PMX.mjs
|
|
7201
7496
|
var PROMO_CODE_PREFIX2 = "CM-";
|
|
7202
7497
|
var OBJECT_ID_PATH_SEGMENT2 = "[a-f0-9]{24}";
|
|
7203
7498
|
var OBJECT_ID_PATH_SEGMENT_END2 = `${OBJECT_ID_PATH_SEGMENT2}$`;
|
|
@@ -7309,7 +7604,7 @@ var gameScreenIdentifierList2 = [
|
|
|
7309
7604
|
}
|
|
7310
7605
|
];
|
|
7311
7606
|
|
|
7312
|
-
// node_modules/@timardex/cluemart-shared/dist/chunk-
|
|
7607
|
+
// node_modules/@timardex/cluemart-shared/dist/chunk-3ZPHXVUT.mjs
|
|
7313
7608
|
var import_dayjs4 = __toESM(require("dayjs"), 1);
|
|
7314
7609
|
var statusOptions2 = [
|
|
7315
7610
|
...Object.values(EnumInviteStatus2).map((status) => ({
|
|
@@ -8746,7 +9041,7 @@ function normalizeAffiliatePromoCodes(promoCodes) {
|
|
|
8746
9041
|
}
|
|
8747
9042
|
|
|
8748
9043
|
// src/service/database.ts
|
|
8749
|
-
var
|
|
9044
|
+
var import_mongoose31 = __toESM(require("mongoose"));
|
|
8750
9045
|
var connectToDatabase = async ({
|
|
8751
9046
|
appName,
|
|
8752
9047
|
dbName,
|
|
@@ -8759,7 +9054,7 @@ var connectToDatabase = async ({
|
|
|
8759
9054
|
// Fallback to MongoDB Atlas connection string
|
|
8760
9055
|
`mongodb+srv://${dbUser}:${dbPassword}@${dbName}.mongodb.net/?retryWrites=true&w=majority&appName=${appName}`
|
|
8761
9056
|
);
|
|
8762
|
-
await
|
|
9057
|
+
await import_mongoose31.default.connect(mongoUri);
|
|
8763
9058
|
const connectionType = mongodbUri ? "Local MongoDB" : "MongoDB Atlas";
|
|
8764
9059
|
console.log(
|
|
8765
9060
|
`${connectionType} connected from server/src/service/database.ts`
|
|
@@ -8772,7 +9067,7 @@ var connectToDatabase = async ({
|
|
|
8772
9067
|
|
|
8773
9068
|
// src/types/index.ts
|
|
8774
9069
|
var import_express = __toESM(require("express"));
|
|
8775
|
-
var
|
|
9070
|
+
var import_mongoose32 = __toESM(require("mongoose"));
|
|
8776
9071
|
|
|
8777
9072
|
// src/service/notifyUsers.ts
|
|
8778
9073
|
async function publishNotificationEvents(userId, pubsub) {
|
|
@@ -8855,15 +9150,15 @@ async function updateAdStatuses() {
|
|
|
8855
9150
|
}
|
|
8856
9151
|
|
|
8857
9152
|
// src/service/objectIdToString.ts
|
|
8858
|
-
var
|
|
9153
|
+
var import_mongoose34 = __toESM(require("mongoose"));
|
|
8859
9154
|
function isValidObjectId(value) {
|
|
8860
|
-
return
|
|
9155
|
+
return import_mongoose34.default.Types.ObjectId.isValid(value);
|
|
8861
9156
|
}
|
|
8862
9157
|
function convertObjectIdsToStrings(obj) {
|
|
8863
9158
|
if (obj === null || obj === void 0) {
|
|
8864
9159
|
return obj;
|
|
8865
9160
|
}
|
|
8866
|
-
if (obj instanceof
|
|
9161
|
+
if (obj instanceof import_mongoose34.default.Types.ObjectId) {
|
|
8867
9162
|
return obj.toString();
|
|
8868
9163
|
}
|
|
8869
9164
|
if (obj instanceof Date) {
|
|
@@ -9016,8 +9311,8 @@ async function findEventOrImportedMarketById(resourceId) {
|
|
|
9016
9311
|
}
|
|
9017
9312
|
const normalizedId = convertObjectIdsToStrings(resourceId);
|
|
9018
9313
|
const [eventDoc, googleImportedDoc] = await Promise.all([
|
|
9019
|
-
EventModel.findById(normalizedId).select("_id name").lean().exec(),
|
|
9020
|
-
GoogleImportedMarketModel.findById(normalizedId).select("_id name").lean().exec()
|
|
9314
|
+
EventModel.findById(normalizedId).select("_id name dateTime").lean().exec(),
|
|
9315
|
+
GoogleImportedMarketModel.findById(normalizedId).select("_id name dateTime").lean().exec()
|
|
9021
9316
|
]);
|
|
9022
9317
|
return eventDoc ?? googleImportedDoc;
|
|
9023
9318
|
}
|
|
@@ -9418,20 +9713,24 @@ var buildLicenceReplacePipeline = ({
|
|
|
9418
9713
|
async function replaceUserLicenceWithObject({
|
|
9419
9714
|
userId,
|
|
9420
9715
|
licenceObject,
|
|
9421
|
-
protectHigherLicence = true
|
|
9716
|
+
protectHigherLicence = true,
|
|
9717
|
+
refreshExistingLicence = false
|
|
9422
9718
|
}) {
|
|
9423
9719
|
const user = await UserModel.findById(userId, { licences: 1 }).lean();
|
|
9424
9720
|
if (!user) throw new import_graphql3.GraphQLError("User not found");
|
|
9425
|
-
|
|
9721
|
+
const existingLicence = user.licences?.find(
|
|
9722
|
+
(licence) => licence.licenceType === licenceObject.licenceType
|
|
9723
|
+
);
|
|
9724
|
+
if (existingLicence && !refreshExistingLicence) {
|
|
9426
9725
|
return;
|
|
9427
9726
|
}
|
|
9727
|
+
const category = getLicenceCategory(licenceObject.licenceType);
|
|
9428
9728
|
const updatedLicenceObject = {
|
|
9429
9729
|
...licenceObject,
|
|
9430
|
-
prevLicenceType: user.licences?.find(
|
|
9431
|
-
(
|
|
9730
|
+
prevLicenceType: existingLicence && refreshExistingLicence ? existingLicence.prevLicenceType : user.licences?.find(
|
|
9731
|
+
(licence) => licence.licenceType && getLicenceCategory(licence.licenceType) === category
|
|
9432
9732
|
)?.licenceType
|
|
9433
9733
|
};
|
|
9434
|
-
const category = getLicenceCategory(updatedLicenceObject.licenceType);
|
|
9435
9734
|
if (protectHigherLicence) {
|
|
9436
9735
|
const highestLicence = getHighestLicenceForCategory(
|
|
9437
9736
|
user.licences,
|
|
@@ -9545,6 +9844,17 @@ var vendorLicences = [
|
|
|
9545
9844
|
EnumUserLicence.PRO_VENDOR,
|
|
9546
9845
|
EnumUserLicence.PRO_PLUS_VENDOR
|
|
9547
9846
|
];
|
|
9847
|
+
function isProtectedByCurrentStripeSubscription(user, licenceType, now) {
|
|
9848
|
+
const stripe = user.stripe;
|
|
9849
|
+
if (!stripe?.subscriptionId || stripe.currentPlan !== licenceType || stripe.status !== EnumSubscriptionStatus.ACTIVE && stripe.status !== EnumSubscriptionStatus.TRIALING) {
|
|
9850
|
+
return false;
|
|
9851
|
+
}
|
|
9852
|
+
if (stripe.cancelAtPeriodEnd !== true || !stripe.endDate) {
|
|
9853
|
+
return true;
|
|
9854
|
+
}
|
|
9855
|
+
const paidThrough = (0, import_dayjs8.default)(stripe.endDate);
|
|
9856
|
+
return !paidThrough.isValid() || paidThrough.isAfter(now);
|
|
9857
|
+
}
|
|
9548
9858
|
async function handleVendorLicenceCompliance(user, now) {
|
|
9549
9859
|
if (!user.licences || !user.vendor) {
|
|
9550
9860
|
return;
|
|
@@ -9558,12 +9868,20 @@ async function handleVendorLicenceCompliance(user, now) {
|
|
|
9558
9868
|
const proLicences = vendorLicencesOfUser.filter(
|
|
9559
9869
|
(licence) => licence.licenceType !== EnumUserLicence.STANDARD_VENDOR
|
|
9560
9870
|
);
|
|
9561
|
-
const
|
|
9871
|
+
const expiredProLicences = proLicences.filter(
|
|
9562
9872
|
(licence) => !(0, import_dayjs8.default)(licence.expiryDate).isAfter(now)
|
|
9563
9873
|
);
|
|
9564
|
-
const
|
|
9874
|
+
const stripeProtectedLicenceTypes = new Set(
|
|
9875
|
+
expiredProLicences.filter(
|
|
9876
|
+
(licence) => isProtectedByCurrentStripeSubscription(user, licence.licenceType, now)
|
|
9877
|
+
).map((licence) => licence.licenceType)
|
|
9878
|
+
);
|
|
9879
|
+
const expiredProLicence = expiredProLicences.some(
|
|
9880
|
+
(licence) => !stripeProtectedLicenceTypes.has(licence.licenceType)
|
|
9881
|
+
);
|
|
9882
|
+
const hasValidProLicence = stripeProtectedLicenceTypes.size > 0 || hasValidLicence(proLicences, vendorLicences, now);
|
|
9565
9883
|
const hasExpiredVendorLicence = vendorLicencesOfUser.some(
|
|
9566
|
-
(licence) => !(0, import_dayjs8.default)(licence.expiryDate).isAfter(now)
|
|
9884
|
+
(licence) => !(0, import_dayjs8.default)(licence.expiryDate).isAfter(now) && !stripeProtectedLicenceTypes.has(licence.licenceType)
|
|
9567
9885
|
);
|
|
9568
9886
|
if (!hasExpiredVendorLicence) {
|
|
9569
9887
|
return;
|
|
@@ -9577,7 +9895,10 @@ async function handleVendorLicenceCompliance(user, now) {
|
|
|
9577
9895
|
"owner.userId": user._id
|
|
9578
9896
|
}).lean().exec();
|
|
9579
9897
|
}
|
|
9580
|
-
|
|
9898
|
+
const licencesToSync = vendorLicences.filter(
|
|
9899
|
+
(licenceType) => !stripeProtectedLicenceTypes.has(licenceType)
|
|
9900
|
+
);
|
|
9901
|
+
await syncUserLicencesAfterExpiry(user._id, licencesToSync, now, "downgrade");
|
|
9581
9902
|
if (!expiredProLicence || !vendor || hasValidProLicence) {
|
|
9582
9903
|
return;
|
|
9583
9904
|
}
|
|
@@ -9666,6 +9987,13 @@ async function processUserCompliance(user, now) {
|
|
|
9666
9987
|
}
|
|
9667
9988
|
|
|
9668
9989
|
// src/service/license/compliance/ensureUserLicenseCompliance.ts
|
|
9990
|
+
async function ensureUserLicenseComplianceForUser(userId, now = (0, import_dayjs10.default)()) {
|
|
9991
|
+
const user = await UserModel.findById(userId);
|
|
9992
|
+
if (!user) {
|
|
9993
|
+
return;
|
|
9994
|
+
}
|
|
9995
|
+
await processUserCompliance(user, now);
|
|
9996
|
+
}
|
|
9669
9997
|
async function ensureUserLicenseCompliance() {
|
|
9670
9998
|
const now = (0, import_dayjs10.default)();
|
|
9671
9999
|
console.log(`\u{1F50D} Checking license compliance at ${now.format()}`);
|
|
@@ -9917,7 +10245,7 @@ async function sendLicenseReminder(user, licence) {
|
|
|
9917
10245
|
await sendPushNotifications(payload);
|
|
9918
10246
|
console.log(`\u2705 Sent 7-day reminder to user ${userId} for ${licenceName}`);
|
|
9919
10247
|
}
|
|
9920
|
-
async function processLicenseReminder(
|
|
10248
|
+
async function processLicenseReminder(licence, now) {
|
|
9921
10249
|
if ((0, import_dayjs11.default)(licence.expiryDate).isBefore(now)) {
|
|
9922
10250
|
return false;
|
|
9923
10251
|
}
|
|
@@ -9949,7 +10277,7 @@ async function processUserLicenseReminders(user, now) {
|
|
|
9949
10277
|
const licenceChecks = await Promise.all(
|
|
9950
10278
|
validLicences.map(async (licence) => {
|
|
9951
10279
|
try {
|
|
9952
|
-
const shouldSend = await processLicenseReminder(
|
|
10280
|
+
const shouldSend = await processLicenseReminder(licence, now);
|
|
9953
10281
|
return { licence, shouldSend };
|
|
9954
10282
|
} catch (err) {
|
|
9955
10283
|
console.error(
|
|
@@ -10026,6 +10354,7 @@ async function remindUsersAboutLicenseExpiration() {
|
|
|
10026
10354
|
createLicenceObject,
|
|
10027
10355
|
didRemoveAnyEventDates,
|
|
10028
10356
|
ensureUserLicenseCompliance,
|
|
10357
|
+
ensureUserLicenseComplianceForUser,
|
|
10029
10358
|
eventLicences,
|
|
10030
10359
|
findAffiliateByPromoCode,
|
|
10031
10360
|
findEventOrImportedMarketById,
|