@timardex/cluemart-server-shared 1.1.38 → 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.
@@ -292,8 +292,8 @@ var EnumRelationResource = /* @__PURE__ */ ((EnumRelationResource22) => {
292
292
  return EnumRelationResource22;
293
293
  })(EnumRelationResource || {});
294
294
  var EnumNotificationResourceType = /* @__PURE__ */ ((EnumNotificationResourceType22) => {
295
- EnumNotificationResourceType22["APPROVED_AFFILIATE"] = "approved_affiliate";
296
295
  EnumNotificationResourceType22["AFFILIATE_REWARD_RECEIVED"] = "affiliate_reward_received";
296
+ EnumNotificationResourceType22["APPROVED_AFFILIATE"] = "approved_affiliate";
297
297
  EnumNotificationResourceType22["APPROVED_EVENT"] = "approved_event";
298
298
  EnumNotificationResourceType22["APPROVED_PARTNER"] = "approved_partner";
299
299
  EnumNotificationResourceType22["APPROVED_SCHOOL"] = "approved_school";
@@ -321,6 +321,7 @@ var EnumNotificationResourceType = /* @__PURE__ */ ((EnumNotificationResourceTyp
321
321
  EnumNotificationResourceType22["NEW_POST_CREATED"] = "new_post_created";
322
322
  EnumNotificationResourceType22["REGISTERED_USER_BY_SCHOOL_CODE"] = "registered_user_by_school_code";
323
323
  EnumNotificationResourceType22["SYSTEM_ALERT"] = "system_alert";
324
+ EnumNotificationResourceType22["USER_COUPON_REDEEMED"] = "user_coupon_redeemed";
324
325
  EnumNotificationResourceType22["VENDOR_APPLICATION_TO_EVENT"] = "vendor_application_to_event";
325
326
  EnumNotificationResourceType22["VENDOR_UPDATE_RELATION_TO_EVENT"] = "vendor_update_relation_to_event";
326
327
  return EnumNotificationResourceType22;
@@ -395,6 +396,11 @@ var EnumSubscriptionStatus = /* @__PURE__ */ ((EnumSubscriptionStatus22) => {
395
396
  EnumSubscriptionStatus22["TRIALING"] = "trialing";
396
397
  return EnumSubscriptionStatus22;
397
398
  })(EnumSubscriptionStatus || {});
399
+ var EnumBillingPeriod = /* @__PURE__ */ ((EnumBillingPeriod22) => {
400
+ EnumBillingPeriod22["MONTHLY_CANCEL_ANYTIME"] = "monthly_cancel_anytime";
401
+ EnumBillingPeriod22["YEARLY_ANNUAL_BILLED"] = "yearly_annual_billed";
402
+ return EnumBillingPeriod22;
403
+ })(EnumBillingPeriod || {});
398
404
  var EnumReward = /* @__PURE__ */ ((EnumReward22) => {
399
405
  EnumReward22["MYSTERY_JOY_BOX"] = "mystery_joy_box";
400
406
  EnumReward22["MYSTERY_SQUEEZE_BOX"] = "mystery_squeeze_box";
@@ -1677,6 +1683,80 @@ var availableCategories = assignColorToCategories([
1677
1683
  ...petProductsAndAnimalGoods,
1678
1684
  ...serviceAndExperience
1679
1685
  ]);
1686
+ var BILLING_CATALOG_KEYS = [
1687
+ "pro_vendor_monthly",
1688
+ "pro_vendor_yearly",
1689
+ "pro_plus_vendor_monthly",
1690
+ "pro_plus_vendor_yearly"
1691
+ ];
1692
+ var BILLING_CATALOG_CURRENCY = "nzd";
1693
+ var BILLING_CATALOG_DEFINITIONS = {
1694
+ pro_plus_vendor_monthly: {
1695
+ billingPeriod: "monthly_cancel_anytime",
1696
+ licenceType: "pro_plus_vendor"
1697
+ /* PRO_PLUS_VENDOR */
1698
+ },
1699
+ pro_plus_vendor_yearly: {
1700
+ billingPeriod: "yearly_annual_billed",
1701
+ licenceType: "pro_plus_vendor"
1702
+ /* PRO_PLUS_VENDOR */
1703
+ },
1704
+ pro_vendor_monthly: {
1705
+ billingPeriod: "monthly_cancel_anytime",
1706
+ licenceType: "pro_vendor"
1707
+ /* PRO_VENDOR */
1708
+ },
1709
+ pro_vendor_yearly: {
1710
+ billingPeriod: "yearly_annual_billed",
1711
+ licenceType: "pro_vendor"
1712
+ /* PRO_VENDOR */
1713
+ }
1714
+ };
1715
+ var INITIAL_BILLING_CATALOG = [
1716
+ {
1717
+ active: true,
1718
+ billingPeriod: "monthly_cancel_anytime",
1719
+ currency: BILLING_CATALOG_CURRENCY,
1720
+ key: "pro_vendor_monthly",
1721
+ licenceType: "pro_vendor",
1722
+ taxInclusive: true,
1723
+ unitAmount: 3999
1724
+ },
1725
+ {
1726
+ active: true,
1727
+ billingPeriod: "yearly_annual_billed",
1728
+ currency: BILLING_CATALOG_CURRENCY,
1729
+ key: "pro_vendor_yearly",
1730
+ licenceType: "pro_vendor",
1731
+ taxInclusive: true,
1732
+ unitAmount: 40788
1733
+ },
1734
+ {
1735
+ active: true,
1736
+ billingPeriod: "monthly_cancel_anytime",
1737
+ currency: BILLING_CATALOG_CURRENCY,
1738
+ key: "pro_plus_vendor_monthly",
1739
+ licenceType: "pro_plus_vendor",
1740
+ taxInclusive: true,
1741
+ unitAmount: 6499
1742
+ },
1743
+ {
1744
+ active: true,
1745
+ billingPeriod: "yearly_annual_billed",
1746
+ currency: BILLING_CATALOG_CURRENCY,
1747
+ key: "pro_plus_vendor_yearly",
1748
+ licenceType: "pro_plus_vendor",
1749
+ taxInclusive: true,
1750
+ unitAmount: 62388
1751
+ }
1752
+ ];
1753
+ function billingCatalogDefinitionMatches(entry) {
1754
+ const definition = BILLING_CATALOG_DEFINITIONS[entry.key];
1755
+ if (!definition) {
1756
+ return false;
1757
+ }
1758
+ return definition.billingPeriod === entry.billingPeriod && definition.licenceType === entry.licenceType;
1759
+ }
1680
1760
  var packagingTypes = [
1681
1761
  "Biodegradable",
1682
1762
  "Compostable",
@@ -2121,12 +2201,19 @@ var REDEEMED_REWARD_FIELDS_FRAGMENT = gql`
2121
2201
  `;
2122
2202
  var STRIPE_FIELDS_FRAGMENT = gql`
2123
2203
  fragment StripeSubscriptionFields on StripeSubscriptionType {
2204
+ billingPeriod
2205
+ cancelAtPeriodEnd
2124
2206
  customerId
2125
2207
  subscriptionId
2126
2208
  status
2127
2209
  currentPlan
2128
2210
  startDate
2129
2211
  endDate
2212
+ pendingPlan
2213
+ pendingBillingPeriod
2214
+ pendingChangeEffectiveAt
2215
+ priceId
2216
+ scheduleId
2130
2217
  }
2131
2218
  `;
2132
2219
  var USER_FIELDS_FRAGMENT = gql`
@@ -4160,11 +4247,8 @@ var GET_RESOURCE_ACTIVITY = gql`
4160
4247
  ${RESOURCE_ACTIVITY_FIELDS_FRAGMENT}
4161
4248
  `;
4162
4249
  var CREATE_CHECKOUT_SESSION_MUTATION = gql`
4163
- mutation createCheckoutSession(
4164
- $planId: LicencesEnumType!
4165
- $billingPeriod: BillingPeriodEnumType
4166
- ) {
4167
- createCheckoutSession(planId: $planId, billingPeriod: $billingPeriod) {
4250
+ mutation createCheckoutSession($input: CreateCheckoutSessionInputType!) {
4251
+ createCheckoutSession(input: $input) {
4168
4252
  data {
4169
4253
  sessionId
4170
4254
  checkoutUrl
@@ -4176,25 +4260,38 @@ var CREATE_CHECKOUT_SESSION_MUTATION = gql`
4176
4260
  var CANCEL_SUBSCRIPTION_MUTATION = gql`
4177
4261
  mutation cancelSubscription {
4178
4262
  cancelSubscription {
4179
- data
4263
+ data {
4264
+ billingPeriod
4265
+ cancelAtPeriodEnd
4266
+ currentPlan
4267
+ endDate
4268
+ pendingBillingPeriod
4269
+ pendingChangeEffectiveAt
4270
+ pendingPlan
4271
+ priceId
4272
+ scheduleId
4273
+ status
4274
+ subscriptionId
4275
+ }
4180
4276
  message
4181
4277
  }
4182
4278
  }
4183
4279
  `;
4184
4280
  var UPDATE_SUBSCRIPTION_PLAN_MUTATION = gql`
4185
- mutation updateSubscriptionPlan(
4186
- $newPlanId: LicencesEnumType!
4187
- $billingPeriod: BillingPeriodEnumType
4188
- ) {
4189
- updateSubscriptionPlan(
4190
- newPlanId: $newPlanId
4191
- billingPeriod: $billingPeriod
4192
- ) {
4281
+ mutation updateSubscriptionPlan($input: UpdateSubscriptionPlanInputType!) {
4282
+ updateSubscriptionPlan(input: $input) {
4193
4283
  data {
4194
- subscriptionId
4195
- status
4196
- priceId
4284
+ billingPeriod
4285
+ cancelAtPeriodEnd
4197
4286
  currentPlan
4287
+ endDate
4288
+ pendingBillingPeriod
4289
+ pendingChangeEffectiveAt
4290
+ pendingPlan
4291
+ priceId
4292
+ scheduleId
4293
+ status
4294
+ subscriptionId
4198
4295
  }
4199
4296
  message
4200
4297
  }
@@ -4210,36 +4307,20 @@ var CREATE_CUSTOMER_PORTAL = gql`
4210
4307
  }
4211
4308
  }
4212
4309
  `;
4213
- var SELECT_PACKAGE_MUTATION = gql`
4214
- mutation selectPackage(
4215
- $billingPeriod: BillingPeriodEnumType
4216
- $selectedLicence: LicencesEnumType!
4217
- $useStripe: Boolean
4218
- ) {
4219
- selectPackage(
4220
- billingPeriod: $billingPeriod
4221
- selectedLicence: $selectedLicence
4222
- useStripe: $useStripe
4223
- ) {
4224
- data {
4225
- checkoutUrl
4226
- licences {
4227
- ...LicenceFields
4228
- }
4229
- userId
4230
- }
4231
- message
4232
- }
4233
- }
4234
- ${LICENCE_FIELDS_FRAGMENT}
4235
- `;
4236
4310
  var GET_SUBSCRIPTION_STATUS = gql`
4237
4311
  query getSubscriptionStatus {
4238
4312
  getSubscriptionStatus {
4239
- subscriptionId
4240
- status
4241
- priceId
4313
+ billingPeriod
4314
+ cancelAtPeriodEnd
4242
4315
  currentPlan
4316
+ endDate
4317
+ pendingBillingPeriod
4318
+ pendingChangeEffectiveAt
4319
+ pendingPlan
4320
+ priceId
4321
+ scheduleId
4322
+ status
4323
+ subscriptionId
4243
4324
  }
4244
4325
  }
4245
4326
  `;
@@ -4266,7 +4347,6 @@ var GET_SUBSCRIPTION_PLANS = gql`
4266
4347
  }
4267
4348
  }
4268
4349
  isNewUser
4269
- isTester
4270
4350
  appliedDiscountType
4271
4351
  }
4272
4352
  }
@@ -4374,6 +4454,57 @@ var GET_APP_SETTINGS = gql`
4374
4454
  }
4375
4455
  ${APP_SETTINGS_FIELDS_FRAGMENT}
4376
4456
  `;
4457
+ var BILLING_CATALOG_FIELDS_FRAGMENT = gql`
4458
+ fragment BillingCatalogFields on BillingCatalogEntryType {
4459
+ _id
4460
+ active
4461
+ billingPeriod
4462
+ createdAt
4463
+ currency
4464
+ effectiveFrom
4465
+ key
4466
+ licenceType
4467
+ revision
4468
+ stripePriceId
4469
+ stripeProductId
4470
+ taxInclusive
4471
+ unitAmount
4472
+ updatedAt
4473
+ updatedBy
4474
+ }
4475
+ `;
4476
+ var GET_BILLING_CATALOG = gql`
4477
+ query getBillingCatalog {
4478
+ billingCatalog {
4479
+ ...BillingCatalogFields
4480
+ }
4481
+ }
4482
+ ${BILLING_CATALOG_FIELDS_FRAGMENT}
4483
+ `;
4484
+ var UPDATE_BILLING_CATALOG_PRICE_MUTATION = gql`
4485
+ mutation updateBillingCatalogPrice(
4486
+ $input: UpdateBillingCatalogPriceInputType!
4487
+ ) {
4488
+ updateBillingCatalogPrice(input: $input) {
4489
+ data {
4490
+ ...BillingCatalogFields
4491
+ }
4492
+ message
4493
+ }
4494
+ }
4495
+ ${BILLING_CATALOG_FIELDS_FRAGMENT}
4496
+ `;
4497
+ var SYNC_BILLING_CATALOG_PRICE_MUTATION = gql`
4498
+ mutation syncBillingCatalogPrice($input: SyncBillingCatalogPriceInputType!) {
4499
+ syncBillingCatalogPrice(input: $input) {
4500
+ data {
4501
+ ...BillingCatalogFields
4502
+ }
4503
+ message
4504
+ }
4505
+ }
4506
+ ${BILLING_CATALOG_FIELDS_FRAGMENT}
4507
+ `;
4377
4508
  var GAME_HISTORY_FIELDS_FRAGMENT = gql`
4378
4509
  fragment GameHistoryFields on GameHistoryType {
4379
4510
  createdAt
@@ -5212,46 +5343,220 @@ schema.index({
5212
5343
  start: 1,
5213
5344
  status: 1
5214
5345
  });
5346
+ schema.index({
5347
+ status: 1,
5348
+ targetRegion: 1,
5349
+ // eslint-disable-next-line sort-keys
5350
+ start: -1
5351
+ });
5215
5352
  var AdModel = mongoose.models.Ad || mongoose.model("Ad", schema);
5216
5353
 
5217
- // src/mongoose/chat/Chat.ts
5354
+ // src/mongoose/BillingCatalog.ts
5218
5355
  import mongoose2 from "mongoose";
5219
5356
  var MongooseSchema2 = mongoose2.Schema;
5220
- var MessageReplyPreviewSchema = new MongooseSchema2(
5357
+ var BILLING_CATALOG_COLLECTION_NAME = "billingCatalog";
5358
+ var paidVendorLicences = [
5359
+ EnumUserLicence.PRO_VENDOR,
5360
+ EnumUserLicence.PRO_PLUS_VENDOR
5361
+ ];
5362
+ var supportedBillingPeriods = [
5363
+ EnumBillingPeriod.MONTHLY_CANCEL_ANYTIME,
5364
+ EnumBillingPeriod.YEARLY_ANNUAL_BILLED
5365
+ ];
5366
+ var unitAmountField = {
5367
+ min: 1,
5368
+ required: true,
5369
+ type: Number,
5370
+ validate: {
5371
+ message: "Billing catalogue price must be a positive integer.",
5372
+ validator: Number.isInteger
5373
+ }
5374
+ };
5375
+ var currencyField = {
5376
+ default: BILLING_CATALOG_CURRENCY,
5377
+ enum: [BILLING_CATALOG_CURRENCY],
5378
+ immutable: true,
5379
+ lowercase: true,
5380
+ required: true,
5381
+ trim: true,
5382
+ type: String
5383
+ };
5384
+ var stripePriceIdField = {
5385
+ default: null,
5386
+ required: false,
5387
+ trim: true,
5388
+ type: String
5389
+ };
5390
+ var stripeProductIdField = {
5391
+ default: null,
5392
+ required: false,
5393
+ trim: true,
5394
+ type: String
5395
+ };
5396
+ var priceHistorySchema = new MongooseSchema2(
5397
+ {
5398
+ changedAt: { required: true, type: Date },
5399
+ changedBy: {
5400
+ default: null,
5401
+ ref: "User",
5402
+ required: false,
5403
+ type: mongoose2.Schema.Types.ObjectId
5404
+ },
5405
+ currency: currencyField,
5406
+ effectiveFrom: { required: true, type: Date },
5407
+ effectiveTo: { required: true, type: Date },
5408
+ stripePriceId: stripePriceIdField,
5409
+ stripeProductId: stripeProductIdField,
5410
+ unitAmount: unitAmountField
5411
+ },
5412
+ { _id: false }
5413
+ );
5414
+ var schema2 = new MongooseSchema2(
5415
+ {
5416
+ active: { default: true, required: true, type: Boolean },
5417
+ billingPeriod: {
5418
+ enum: supportedBillingPeriods,
5419
+ immutable: true,
5420
+ required: true,
5421
+ type: String
5422
+ },
5423
+ currency: currencyField,
5424
+ effectiveFrom: { default: Date.now, required: true, type: Date },
5425
+ key: {
5426
+ enum: BILLING_CATALOG_KEYS,
5427
+ immutable: true,
5428
+ required: true,
5429
+ type: String,
5430
+ unique: true
5431
+ },
5432
+ licenceType: {
5433
+ enum: paidVendorLicences,
5434
+ immutable: true,
5435
+ required: true,
5436
+ type: String
5437
+ },
5438
+ priceHistory: {
5439
+ default: [],
5440
+ required: true,
5441
+ type: [priceHistorySchema]
5442
+ },
5443
+ revision: {
5444
+ default: 1,
5445
+ min: 1,
5446
+ required: true,
5447
+ type: Number,
5448
+ validate: {
5449
+ message: "Billing catalogue revision must be a positive integer.",
5450
+ validator: Number.isInteger
5451
+ }
5452
+ },
5453
+ stripePriceId: stripePriceIdField,
5454
+ stripeProductId: stripeProductIdField,
5455
+ taxInclusive: {
5456
+ default: true,
5457
+ immutable: true,
5458
+ required: true,
5459
+ type: Boolean,
5460
+ validate: {
5461
+ message: "Billing catalogue prices must include GST.",
5462
+ validator: (value) => value === true
5463
+ }
5464
+ },
5465
+ unitAmount: unitAmountField,
5466
+ updatedBy: {
5467
+ default: null,
5468
+ ref: "User",
5469
+ required: false,
5470
+ type: mongoose2.Schema.Types.ObjectId
5471
+ }
5472
+ },
5473
+ {
5474
+ collection: BILLING_CATALOG_COLLECTION_NAME,
5475
+ strict: true,
5476
+ timestamps: true
5477
+ }
5478
+ );
5479
+ schema2.pre("validate", function validateDefinition() {
5480
+ if (!billingCatalogDefinitionMatches(this)) {
5481
+ this.invalidate(
5482
+ "key",
5483
+ "Billing catalogue key does not match its licence and billing period."
5484
+ );
5485
+ }
5486
+ });
5487
+ schema2.index({ billingPeriod: 1, licenceType: 1 }, { unique: true });
5488
+ schema2.index({ active: 1, licenceType: 1 });
5489
+ schema2.index(
5490
+ { stripePriceId: 1 },
5491
+ {
5492
+ partialFilterExpression: { stripePriceId: { $type: "string" } },
5493
+ unique: true
5494
+ }
5495
+ );
5496
+ var BillingCatalogModel = mongoose2.models.BillingCatalogEntry || mongoose2.model(
5497
+ "BillingCatalogEntry",
5498
+ schema2,
5499
+ BILLING_CATALOG_COLLECTION_NAME
5500
+ );
5501
+ function buildInitialBillingCatalogEntries(now = /* @__PURE__ */ new Date()) {
5502
+ return INITIAL_BILLING_CATALOG.map((entry) => ({
5503
+ active: entry.active,
5504
+ billingPeriod: entry.billingPeriod,
5505
+ currency: entry.currency,
5506
+ effectiveFrom: new Date(now.getTime()),
5507
+ key: entry.key,
5508
+ licenceType: entry.licenceType,
5509
+ priceHistory: [],
5510
+ revision: 1,
5511
+ stripePriceId: null,
5512
+ stripeProductId: null,
5513
+ taxInclusive: entry.taxInclusive,
5514
+ unitAmount: entry.unitAmount,
5515
+ updatedBy: null
5516
+ }));
5517
+ }
5518
+ function getBillingCatalogDefinition(key) {
5519
+ return BILLING_CATALOG_DEFINITIONS[key];
5520
+ }
5521
+
5522
+ // src/mongoose/chat/Chat.ts
5523
+ import mongoose3 from "mongoose";
5524
+ var MongooseSchema3 = mongoose3.Schema;
5525
+ var MessageReplyPreviewSchema = new MongooseSchema3(
5221
5526
  {
5222
5527
  contentPreview: { required: true, type: String },
5223
5528
  senderId: {
5224
5529
  ref: "User",
5225
5530
  required: true,
5226
- type: mongoose2.Schema.Types.ObjectId
5531
+ type: mongoose3.Schema.Types.ObjectId
5227
5532
  },
5228
5533
  senderName: { required: true, type: String }
5229
5534
  },
5230
5535
  { _id: false }
5231
5536
  );
5232
- var MessageReactionSchema = new MongooseSchema2(
5537
+ var MessageReactionSchema = new MongooseSchema3(
5233
5538
  {
5234
5539
  createdAt: { required: true, type: Date },
5235
5540
  userId: {
5236
5541
  ref: "User",
5237
5542
  required: true,
5238
- type: mongoose2.Schema.Types.ObjectId
5543
+ type: mongoose3.Schema.Types.ObjectId
5239
5544
  }
5240
5545
  },
5241
5546
  { _id: false }
5242
5547
  );
5243
- var MessageSeenSchema = new MongooseSchema2(
5548
+ var MessageSeenSchema = new MongooseSchema3(
5244
5549
  {
5245
5550
  seenAt: { required: true, type: Date },
5246
5551
  userId: {
5247
5552
  ref: "User",
5248
5553
  required: true,
5249
- type: mongoose2.Schema.Types.ObjectId
5554
+ type: mongoose3.Schema.Types.ObjectId
5250
5555
  }
5251
5556
  },
5252
5557
  { _id: false }
5253
5558
  );
5254
- var MessageSchema = new MongooseSchema2(
5559
+ var MessageSchema = new MongooseSchema3(
5255
5560
  {
5256
5561
  content: { required: true, type: String },
5257
5562
  likedBy: { default: [], required: false, type: [MessageReactionSchema] },
@@ -5262,18 +5567,18 @@ var MessageSchema = new MongooseSchema2(
5262
5567
  replyToMessageId: {
5263
5568
  ref: "Chat.messages",
5264
5569
  required: false,
5265
- type: mongoose2.Schema.Types.ObjectId
5570
+ type: mongoose3.Schema.Types.ObjectId
5266
5571
  },
5267
5572
  seenBy: { default: [], required: false, type: [MessageSeenSchema] },
5268
5573
  senderId: {
5269
5574
  ref: "User",
5270
5575
  required: true,
5271
- type: mongoose2.Schema.Types.ObjectId
5576
+ type: mongoose3.Schema.Types.ObjectId
5272
5577
  }
5273
5578
  },
5274
5579
  { timestamps: true }
5275
5580
  );
5276
- var ParticipantSchema = new MongooseSchema2(
5581
+ var ParticipantSchema = new MongooseSchema3(
5277
5582
  {
5278
5583
  active: { default: true, required: true, type: Boolean },
5279
5584
  userAvatar: { required: false, type: String },
@@ -5281,14 +5586,14 @@ var ParticipantSchema = new MongooseSchema2(
5281
5586
  userId: {
5282
5587
  ref: "User",
5283
5588
  required: true,
5284
- type: mongoose2.Schema.Types.ObjectId
5589
+ type: mongoose3.Schema.Types.ObjectId
5285
5590
  },
5286
5591
  userName: { required: true, type: String }
5287
5592
  },
5288
5593
  { _id: false }
5289
5594
  // Prevents Mongoose from creating an additional _id field for subdocuments
5290
5595
  );
5291
- var ChatSchema = new MongooseSchema2(
5596
+ var ChatSchema = new MongooseSchema3(
5292
5597
  {
5293
5598
  active: { default: true, required: true, type: Boolean },
5294
5599
  chatDescription: { required: false, type: String },
@@ -5312,12 +5617,12 @@ ChatSchema.index({
5312
5617
  "participants.userId": 1,
5313
5618
  updatedAt: -1
5314
5619
  });
5315
- var ChatModel = mongoose2.models.Chat || mongoose2.model("Chat", ChatSchema);
5620
+ var ChatModel = mongoose3.models.Chat || mongoose3.model("Chat", ChatSchema);
5316
5621
 
5317
5622
  // src/mongoose/chat/ChatReport.ts
5318
- import mongoose3 from "mongoose";
5319
- var MongooseSchema3 = mongoose3.Schema;
5320
- var ReasonSchema = new MongooseSchema3(
5623
+ import mongoose4 from "mongoose";
5624
+ var MongooseSchema4 = mongoose4.Schema;
5625
+ var ReasonSchema = new MongooseSchema4(
5321
5626
  {
5322
5627
  details: { default: null, required: false, type: String },
5323
5628
  reasonType: {
@@ -5328,23 +5633,23 @@ var ReasonSchema = new MongooseSchema3(
5328
5633
  },
5329
5634
  { _id: false }
5330
5635
  );
5331
- var ChatReportSchema = new MongooseSchema3(
5636
+ var ChatReportSchema = new MongooseSchema4(
5332
5637
  {
5333
5638
  chatId: {
5334
5639
  ref: "Chat",
5335
5640
  required: true,
5336
- type: mongoose3.Schema.Types.ObjectId
5641
+ type: mongoose4.Schema.Types.ObjectId
5337
5642
  },
5338
5643
  reason: { required: true, type: ReasonSchema },
5339
5644
  reportedUserId: {
5340
5645
  ref: "User",
5341
5646
  required: true,
5342
- type: mongoose3.Schema.Types.ObjectId
5647
+ type: mongoose4.Schema.Types.ObjectId
5343
5648
  },
5344
5649
  reporterUserId: {
5345
5650
  ref: "User",
5346
5651
  required: true,
5347
- type: mongoose3.Schema.Types.ObjectId
5652
+ type: mongoose4.Schema.Types.ObjectId
5348
5653
  },
5349
5654
  resolved: { default: false, required: true, type: Boolean }
5350
5655
  },
@@ -5352,18 +5657,18 @@ var ChatReportSchema = new MongooseSchema3(
5352
5657
  );
5353
5658
  ChatReportSchema.index({ chatId: 1, reportedUserId: 1 });
5354
5659
  ChatReportSchema.index({ createdAt: -1, reporterUserId: 1 });
5355
- var ChatReportModel = mongoose3.models.ChatReport || mongoose3.model("ChatReport", ChatReportSchema);
5660
+ var ChatReportModel = mongoose4.models.ChatReport || mongoose4.model("ChatReport", ChatReportSchema);
5356
5661
 
5357
5662
  // src/mongoose/global.ts
5358
- import mongoose6 from "mongoose";
5663
+ import mongoose7 from "mongoose";
5359
5664
 
5360
5665
  // src/mongoose/Relation.ts
5361
- import mongoose5 from "mongoose";
5666
+ import mongoose6 from "mongoose";
5362
5667
 
5363
5668
  // src/mongoose/event/EventInfo.ts
5364
- import mongoose4 from "mongoose";
5365
- var MongooseSchema4 = mongoose4.Schema;
5366
- var StallTypeSchema = new MongooseSchema4(
5669
+ import mongoose5 from "mongoose";
5670
+ var MongooseSchema5 = mongoose5.Schema;
5671
+ var StallTypeSchema = new MongooseSchema5(
5367
5672
  {
5368
5673
  label: { required: false, type: String },
5369
5674
  price: { required: false, type: Number },
@@ -5374,7 +5679,7 @@ var StallTypeSchema = new MongooseSchema4(
5374
5679
  // Prevents Mongoose from creating an additional _id field for subdocuments
5375
5680
  }
5376
5681
  );
5377
- var dateTimeSchema = new MongooseSchema4(
5682
+ var dateTimeSchema = new MongooseSchema5(
5378
5683
  {
5379
5684
  dateStatus: {
5380
5685
  enum: Object.values(EnumEventDateStatus),
@@ -5390,7 +5695,7 @@ var dateTimeSchema = new MongooseSchema4(
5390
5695
  { _id: false }
5391
5696
  // Prevents Mongoose from creating an additional _id field for subdocuments
5392
5697
  );
5393
- var paymentInfoSchema = new MongooseSchema4(
5698
+ var paymentInfoSchema = new MongooseSchema5(
5394
5699
  {
5395
5700
  accountHolderName: { required: false, type: String },
5396
5701
  accountNumber: { required: false, type: String },
@@ -5404,7 +5709,7 @@ var paymentInfoSchema = new MongooseSchema4(
5404
5709
  { _id: false }
5405
5710
  // Prevents Mongoose from creating an additional _id field
5406
5711
  );
5407
- var requirementsSchema = new MongooseSchema4(
5712
+ var requirementsSchema = new MongooseSchema5(
5408
5713
  {
5409
5714
  category: { required: true, type: String },
5410
5715
  label: { required: true, type: String },
@@ -5415,7 +5720,7 @@ var requirementsSchema = new MongooseSchema4(
5415
5720
  // Prevents Mongoose from creating an additional _id field for
5416
5721
  }
5417
5722
  );
5418
- var refundPolicySchema = new MongooseSchema4(
5723
+ var refundPolicySchema = new MongooseSchema5(
5419
5724
  {
5420
5725
  category: { required: true, type: String },
5421
5726
  label: { required: true, type: String },
@@ -5423,7 +5728,7 @@ var refundPolicySchema = new MongooseSchema4(
5423
5728
  },
5424
5729
  { _id: false }
5425
5730
  );
5426
- var schema2 = new MongooseSchema4(
5731
+ var schema3 = new MongooseSchema5(
5427
5732
  {
5428
5733
  active: { default: true, type: Boolean },
5429
5734
  applicationDeadlineHours: { required: true, type: Number },
@@ -5431,7 +5736,7 @@ var schema2 = new MongooseSchema4(
5431
5736
  eventId: {
5432
5737
  ref: "Event",
5433
5738
  required: true,
5434
- type: mongoose4.Schema.Types.ObjectId
5739
+ type: mongoose5.Schema.Types.ObjectId
5435
5740
  },
5436
5741
  packInTime: { required: true, type: Number },
5437
5742
  paymentDueHours: { required: true, type: Number },
@@ -5441,11 +5746,11 @@ var schema2 = new MongooseSchema4(
5441
5746
  },
5442
5747
  { timestamps: true }
5443
5748
  );
5444
- var EventInfoModel = mongoose4.models.EventInfo || mongoose4.model("EventInfo", schema2);
5749
+ var EventInfoModel = mongoose5.models.EventInfo || mongoose5.model("EventInfo", schema3);
5445
5750
 
5446
5751
  // src/mongoose/Relation.ts
5447
- var MongooseSchema5 = mongoose5.Schema;
5448
- var relationDateTimeSchema = new MongooseSchema5(
5752
+ var MongooseSchema6 = mongoose6.Schema;
5753
+ var relationDateTimeSchema = new MongooseSchema6(
5449
5754
  {
5450
5755
  dateStatus: {
5451
5756
  enum: Object.values(EnumEventDateStatus),
@@ -5460,7 +5765,7 @@ var relationDateTimeSchema = new MongooseSchema5(
5460
5765
  },
5461
5766
  { _id: false }
5462
5767
  );
5463
- var relationDatesSchema = new MongooseSchema5(
5768
+ var relationDatesSchema = new MongooseSchema6(
5464
5769
  {
5465
5770
  dateTime: {
5466
5771
  required: true,
@@ -5479,19 +5784,19 @@ var relationDatesSchema = new MongooseSchema5(
5479
5784
  },
5480
5785
  { _id: false }
5481
5786
  );
5482
- var RelationTypeSchema = new MongooseSchema5(
5787
+ var RelationTypeSchema = new MongooseSchema6(
5483
5788
  {
5484
5789
  active: { default: true, required: true, type: Boolean },
5485
5790
  chatId: {
5486
5791
  ref: "Chat",
5487
5792
  required: true,
5488
- type: mongoose5.Schema.Types.ObjectId
5793
+ type: mongoose6.Schema.Types.ObjectId
5489
5794
  },
5490
5795
  deletedAt: { default: null, required: false, type: Date },
5491
5796
  eventId: {
5492
5797
  ref: "Event",
5493
5798
  required: true,
5494
- type: mongoose5.Schema.Types.ObjectId
5799
+ type: mongoose6.Schema.Types.ObjectId
5495
5800
  },
5496
5801
  lastUpdateBy: {
5497
5802
  enum: Object.values(EnumResourceType),
@@ -5507,7 +5812,7 @@ var RelationTypeSchema = new MongooseSchema5(
5507
5812
  vendorId: {
5508
5813
  ref: "Vendor",
5509
5814
  required: true,
5510
- type: mongoose5.Schema.Types.ObjectId
5815
+ type: mongoose6.Schema.Types.ObjectId
5511
5816
  }
5512
5817
  },
5513
5818
  { timestamps: true }
@@ -5519,23 +5824,23 @@ RelationTypeSchema.index({
5519
5824
  "relationDates.status": 1,
5520
5825
  vendorId: 1
5521
5826
  });
5522
- var RelationModel = mongoose5.models.Relation || mongoose5.model("Relation", RelationTypeSchema);
5827
+ var RelationModel = mongoose6.models.Relation || mongoose6.model("Relation", RelationTypeSchema);
5523
5828
 
5524
5829
  // src/mongoose/global.ts
5525
- var MongooseSchema6 = mongoose6.Schema;
5526
- var OwnerTypeSchema = new MongooseSchema6(
5830
+ var MongooseSchema7 = mongoose7.Schema;
5831
+ var OwnerTypeSchema = new MongooseSchema7(
5527
5832
  {
5528
5833
  email: { required: true, type: String },
5529
5834
  userId: {
5530
5835
  ref: "User",
5531
5836
  required: true,
5532
- type: mongoose6.Schema.Types.ObjectId
5837
+ type: mongoose7.Schema.Types.ObjectId
5533
5838
  }
5534
5839
  },
5535
5840
  { _id: false }
5536
5841
  // Prevents Mongoose from creating an additional _id field for subdocuments
5537
5842
  );
5538
- var SocialMediaTypeSchema = new MongooseSchema6(
5843
+ var SocialMediaTypeSchema = new MongooseSchema7(
5539
5844
  {
5540
5845
  link: { required: true, type: String },
5541
5846
  name: { required: true, type: String }
@@ -5543,7 +5848,7 @@ var SocialMediaTypeSchema = new MongooseSchema6(
5543
5848
  { _id: false }
5544
5849
  // Prevents Mongoose from creating an additional _id field
5545
5850
  );
5546
- var ResourceImageTypeSchema = new MongooseSchema6(
5851
+ var ResourceImageTypeSchema = new MongooseSchema7(
5547
5852
  {
5548
5853
  active: { default: true, required: true, type: Boolean },
5549
5854
  source: { required: false, type: String },
@@ -5552,7 +5857,7 @@ var ResourceImageTypeSchema = new MongooseSchema6(
5552
5857
  { _id: false }
5553
5858
  // Prevents Mongoose from creating an additional _id field for subdocuments
5554
5859
  );
5555
- var SubCategorySchema = new MongooseSchema6(
5860
+ var SubCategorySchema = new MongooseSchema7(
5556
5861
  {
5557
5862
  id: { required: false, type: String },
5558
5863
  items: [
@@ -5566,7 +5871,7 @@ var SubCategorySchema = new MongooseSchema6(
5566
5871
  { _id: false }
5567
5872
  // Prevents Mongoose from creating an additional _id field for subdocuments
5568
5873
  );
5569
- var CategorySchema = new MongooseSchema6(
5874
+ var CategorySchema = new MongooseSchema7(
5570
5875
  {
5571
5876
  id: { required: true, type: String },
5572
5877
  name: { required: true, type: String },
@@ -5575,7 +5880,7 @@ var CategorySchema = new MongooseSchema6(
5575
5880
  { _id: false }
5576
5881
  // Prevents Mongoose from creating an additional _id field for subdocuments
5577
5882
  );
5578
- var PosterUsageTypeSchema = new MongooseSchema6(
5883
+ var PosterUsageTypeSchema = new MongooseSchema7(
5579
5884
  {
5580
5885
  count: { default: 0, required: false, type: Number },
5581
5886
  month: { required: false, type: String }
@@ -5583,7 +5888,7 @@ var PosterUsageTypeSchema = new MongooseSchema6(
5583
5888
  { _id: false }
5584
5889
  // Prevents Mongoose from creating an additional _id field for subdocuments
5585
5890
  );
5586
- var userLicenseSchema = new MongooseSchema6(
5891
+ var userLicenseSchema = new MongooseSchema7(
5587
5892
  {
5588
5893
  expiryDate: { required: true, type: Date },
5589
5894
  issuedDate: { required: true, type: Date },
@@ -5600,7 +5905,7 @@ var userLicenseSchema = new MongooseSchema6(
5600
5905
  },
5601
5906
  { _id: false, timestamps: false }
5602
5907
  );
5603
- var ContactDetailsSchema = new MongooseSchema6(
5908
+ var ContactDetailsSchema = new MongooseSchema7(
5604
5909
  {
5605
5910
  email: { required: false, type: String },
5606
5911
  landlinePhone: { required: false, type: String },
@@ -5609,7 +5914,7 @@ var ContactDetailsSchema = new MongooseSchema6(
5609
5914
  { _id: false }
5610
5915
  // Prevents Mongoose from creating an additional _id field for subdocuments
5611
5916
  );
5612
- var termsAgreementSchema = new MongooseSchema6(
5917
+ var termsAgreementSchema = new MongooseSchema7(
5613
5918
  {
5614
5919
  appBuildNumber: { required: true, type: String },
5615
5920
  appId: { required: true, type: String },
@@ -5626,7 +5931,7 @@ var termsAgreementSchema = new MongooseSchema6(
5626
5931
  },
5627
5932
  { _id: false }
5628
5933
  );
5629
- var resourceRelationsSchema = new MongooseSchema6(
5934
+ var resourceRelationsSchema = new MongooseSchema7(
5630
5935
  {
5631
5936
  relationDates: {
5632
5937
  default: [],
@@ -5636,12 +5941,12 @@ var resourceRelationsSchema = new MongooseSchema6(
5636
5941
  relationId: {
5637
5942
  ref: "Relation",
5638
5943
  required: false,
5639
- type: mongoose6.Schema.Types.ObjectId
5944
+ type: mongoose7.Schema.Types.ObjectId
5640
5945
  }
5641
5946
  },
5642
5947
  { _id: false }
5643
5948
  );
5644
- var dateTimeSchema2 = new MongooseSchema6(
5949
+ var dateTimeSchema2 = new MongooseSchema7(
5645
5950
  {
5646
5951
  dateStatus: {
5647
5952
  enum: Object.values(EnumEventDateStatus),
@@ -5656,7 +5961,7 @@ var dateTimeSchema2 = new MongooseSchema6(
5656
5961
  { _id: false }
5657
5962
  // Prevents Mongoose from creating an additional _id field for subdocuments
5658
5963
  );
5659
- var locationGeoSchema = new MongooseSchema6(
5964
+ var locationGeoSchema = new MongooseSchema7(
5660
5965
  {
5661
5966
  coordinates: { required: true, type: [Number] },
5662
5967
  // [longitude, latitude]
@@ -5665,7 +5970,7 @@ var locationGeoSchema = new MongooseSchema6(
5665
5970
  { _id: false }
5666
5971
  // Prevents Mongoose from creating an additional _id field for subdocuments
5667
5972
  );
5668
- var locationsSchema = new MongooseSchema6(
5973
+ var locationsSchema = new MongooseSchema7(
5669
5974
  {
5670
5975
  city: { required: true, type: String },
5671
5976
  country: { required: true, type: String },
@@ -5681,13 +5986,13 @@ var locationsSchema = new MongooseSchema6(
5681
5986
  { _id: false }
5682
5987
  // Prevents Mongoose from creating an additional _id field for subdocuments
5683
5988
  );
5684
- var relatedPostSchema = new MongooseSchema6(
5989
+ var relatedPostSchema = new MongooseSchema7(
5685
5990
  {
5686
5991
  postActive: { default: true, required: true, type: Boolean },
5687
5992
  postId: {
5688
5993
  ref: "Post",
5689
5994
  required: true,
5690
- type: mongoose6.Schema.Types.ObjectId
5995
+ type: mongoose7.Schema.Types.ObjectId
5691
5996
  },
5692
5997
  postSlug: { required: true, type: String },
5693
5998
  postType: {
@@ -5699,7 +6004,7 @@ var relatedPostSchema = new MongooseSchema6(
5699
6004
  { _id: false }
5700
6005
  // Prevents Mongoose from creating an additional _id field for subdocuments
5701
6006
  );
5702
- var socialShareResourceSchema = new MongooseSchema6(
6007
+ var socialShareResourceSchema = new MongooseSchema7(
5703
6008
  {
5704
6009
  qrCode: { required: true, type: ResourceImageTypeSchema },
5705
6010
  socialImage: { required: true, type: ResourceImageTypeSchema }
@@ -5712,7 +6017,7 @@ var baseResourceFields = {
5712
6017
  adIds: {
5713
6018
  ref: "Ad",
5714
6019
  required: false,
5715
- type: [mongoose6.Schema.Types.ObjectId]
6020
+ type: [mongoose7.Schema.Types.ObjectId]
5716
6021
  },
5717
6022
  approvedAt: { default: null, required: false, type: Date },
5718
6023
  contactDetails: { required: false, type: ContactDetailsSchema },
@@ -5742,9 +6047,9 @@ var baseResourceFields = {
5742
6047
  };
5743
6048
 
5744
6049
  // src/mongoose/GoogleImportedMarket.ts
5745
- import mongoose7 from "mongoose";
5746
- var MongooseSchema7 = mongoose7.Schema;
5747
- var addressComponentSchema = new MongooseSchema7(
6050
+ import mongoose8 from "mongoose";
6051
+ var MongooseSchema8 = mongoose8.Schema;
6052
+ var addressComponentSchema = new MongooseSchema8(
5748
6053
  {
5749
6054
  longName: { required: false, type: String },
5750
6055
  shortName: { required: false, type: String },
@@ -5752,7 +6057,7 @@ var addressComponentSchema = new MongooseSchema7(
5752
6057
  },
5753
6058
  { _id: false }
5754
6059
  );
5755
- var schema3 = new MongooseSchema7(
6060
+ var schema4 = new MongooseSchema8(
5756
6061
  {
5757
6062
  active: { default: false, required: true, type: Boolean },
5758
6063
  address: { required: true, type: String },
@@ -5764,7 +6069,7 @@ var schema3 = new MongooseSchema7(
5764
6069
  claimedByUserId: {
5765
6070
  ref: "User",
5766
6071
  required: false,
5767
- type: mongoose7.Schema.Types.ObjectId
6072
+ type: mongoose8.Schema.Types.ObjectId
5768
6073
  },
5769
6074
  cover: {
5770
6075
  required: false,
@@ -5776,7 +6081,7 @@ var schema3 = new MongooseSchema7(
5776
6081
  eventId: {
5777
6082
  ref: "Event",
5778
6083
  required: false,
5779
- type: mongoose7.Schema.Types.ObjectId
6084
+ type: mongoose8.Schema.Types.ObjectId
5780
6085
  },
5781
6086
  eventType: {
5782
6087
  enum: Object.values(EnumEventType),
@@ -5815,18 +6120,18 @@ var schema3 = new MongooseSchema7(
5815
6120
  },
5816
6121
  { timestamps: true }
5817
6122
  );
5818
- schema3.index({ "location.geo": "2dsphere" });
5819
- schema3.index({ name: 1 });
5820
- schema3.index({ region: 1 });
5821
- schema3.index({ deletedAt: 1 });
5822
- schema3.index({ "dateTime.dateStatus": 1 });
5823
- schema3.index({ slug: 1 });
5824
- var GoogleImportedMarketModel = mongoose7.models.GoogleImportedMarket || mongoose7.model("GoogleImportedMarket", schema3);
6123
+ schema4.index({ "location.geo": "2dsphere" });
6124
+ schema4.index({ name: 1 });
6125
+ schema4.index({ region: 1 });
6126
+ schema4.index({ deletedAt: 1 });
6127
+ schema4.index({ "dateTime.dateStatus": 1 });
6128
+ schema4.index({ slug: 1 });
6129
+ var GoogleImportedMarketModel = mongoose8.models.GoogleImportedMarket || mongoose8.model("GoogleImportedMarket", schema4);
5825
6130
 
5826
6131
  // src/mongoose/Notification.ts
5827
- import mongoose8 from "mongoose";
5828
- var MongooseSchema8 = mongoose8.Schema;
5829
- var schema4 = new MongooseSchema8(
6132
+ import mongoose9 from "mongoose";
6133
+ var MongooseSchema9 = mongoose9.Schema;
6134
+ var schema5 = new MongooseSchema9(
5830
6135
  {
5831
6136
  data: {
5832
6137
  resourceId: { required: true, type: String },
@@ -5849,16 +6154,16 @@ var schema4 = new MongooseSchema8(
5849
6154
  userId: {
5850
6155
  ref: "User",
5851
6156
  required: true,
5852
- type: mongoose8.Schema.Types.ObjectId
6157
+ type: mongoose9.Schema.Types.ObjectId
5853
6158
  }
5854
6159
  },
5855
6160
  { timestamps: true }
5856
6161
  );
5857
- schema4.index({ isRead: 1, userId: 1 });
5858
- schema4.index({ createdAt: -1, userId: 1 });
5859
- var NotificationModel = mongoose8.models.Notification || mongoose8.model("Notification", schema4);
6162
+ schema5.index({ isRead: 1, userId: 1 });
6163
+ schema5.index({ createdAt: -1, userId: 1 });
6164
+ var NotificationModel = mongoose9.models.Notification || mongoose9.model("Notification", schema5);
5860
6165
 
5861
- // node_modules/@timardex/cluemart-shared/dist/chunk-7IB7QPVH.mjs
6166
+ // node_modules/@timardex/cluemart-shared/dist/chunk-P4NLBWEJ.mjs
5862
6167
  var EnumInviteStatus2 = /* @__PURE__ */ ((EnumInviteStatus22) => {
5863
6168
  EnumInviteStatus22["ACCEPTED"] = "Accepted";
5864
6169
  EnumInviteStatus22["COMPLETED"] = "Completed";
@@ -5936,9 +6241,9 @@ var EnumSubscriptionStatus2 = /* @__PURE__ */ ((EnumSubscriptionStatus22) => {
5936
6241
  })(EnumSubscriptionStatus2 || {});
5937
6242
 
5938
6243
  // src/mongoose/PushToken.ts
5939
- import mongoose9 from "mongoose";
5940
- var MongooseSchema9 = mongoose9.Schema;
5941
- var schema5 = new MongooseSchema9(
6244
+ import mongoose10 from "mongoose";
6245
+ var MongooseSchema10 = mongoose10.Schema;
6246
+ var schema6 = new MongooseSchema10(
5942
6247
  {
5943
6248
  platform: {
5944
6249
  enum: Object.values(EnumOSPlatform2),
@@ -5949,17 +6254,17 @@ var schema5 = new MongooseSchema9(
5949
6254
  userId: {
5950
6255
  ref: "User",
5951
6256
  required: true,
5952
- type: mongoose9.Schema.Types.ObjectId
6257
+ type: mongoose10.Schema.Types.ObjectId
5953
6258
  }
5954
6259
  },
5955
6260
  { timestamps: true }
5956
6261
  );
5957
- var PushTokenModel = mongoose9.models.PushToken || mongoose9.model("PushToken", schema5);
6262
+ var PushTokenModel = mongoose10.models.PushToken || mongoose10.model("PushToken", schema6);
5958
6263
 
5959
6264
  // src/mongoose/ResourceActivity.ts
5960
- import mongoose10 from "mongoose";
5961
- var MongooseSchema10 = mongoose10.Schema;
5962
- var ActivitySchema = new MongooseSchema10(
6265
+ import mongoose11 from "mongoose";
6266
+ var MongooseSchema11 = mongoose11.Schema;
6267
+ var ActivitySchema = new MongooseSchema11(
5963
6268
  {
5964
6269
  activityType: {
5965
6270
  enum: Object.values(EnumActivity),
@@ -5987,7 +6292,7 @@ var ActivitySchema = new MongooseSchema10(
5987
6292
  },
5988
6293
  { _id: false }
5989
6294
  );
5990
- var schema6 = new MongooseSchema10(
6295
+ var schema7 = new MongooseSchema11(
5991
6296
  {
5992
6297
  activity: { default: [], type: [ActivitySchema] },
5993
6298
  resourceId: { required: true, type: String },
@@ -5999,46 +6304,55 @@ var schema6 = new MongooseSchema10(
5999
6304
  },
6000
6305
  { timestamps: true }
6001
6306
  );
6002
- schema6.index({ resourceId: 1, resourceType: 1 }, { unique: true });
6003
- schema6.index({ "views.location": "2dsphere" });
6004
- var ResourceActivityModel = mongoose10.models.ResourceActivity || mongoose10.model("ResourceActivity", schema6);
6307
+ schema7.index({ resourceId: 1, resourceType: 1 }, { unique: true });
6308
+ schema7.index({ "views.location": "2dsphere" });
6309
+ var ResourceActivityModel = mongoose11.models.ResourceActivity || mongoose11.model("ResourceActivity", schema7);
6005
6310
 
6006
6311
  // src/mongoose/User.ts
6007
- import mongoose11 from "mongoose";
6008
- var MongooseSchema11 = mongoose11.Schema;
6009
- var userActivityEventSchema = new MongooseSchema11(
6312
+ import mongoose12 from "mongoose";
6313
+ var MongooseSchema12 = mongoose12.Schema;
6314
+ var userActivityEventSchema = new MongooseSchema12(
6010
6315
  {
6011
6316
  dateTime: dateTimeSchema2,
6012
6317
  resourceId: {
6013
6318
  ref: "Event",
6014
6319
  required: false,
6015
- type: mongoose11.Schema.Types.ObjectId
6320
+ type: mongoose12.Schema.Types.ObjectId
6016
6321
  }
6017
6322
  },
6018
6323
  { _id: false }
6019
6324
  );
6020
- var userActivityFavouritesSchema = new MongooseSchema11(
6325
+ var userActivityFavouritesSchema = new MongooseSchema12(
6021
6326
  {
6022
6327
  events: {
6023
6328
  ref: "Event",
6024
6329
  required: false,
6025
- type: [mongoose11.Schema.Types.ObjectId]
6330
+ type: [mongoose12.Schema.Types.ObjectId]
6026
6331
  },
6027
6332
  partners: {
6028
6333
  ref: "Partner",
6029
6334
  required: false,
6030
- type: [mongoose11.Schema.Types.ObjectId]
6335
+ type: [mongoose12.Schema.Types.ObjectId]
6031
6336
  },
6032
6337
  vendors: {
6033
6338
  ref: "Vendor",
6034
6339
  required: false,
6035
- type: [mongoose11.Schema.Types.ObjectId]
6340
+ type: [mongoose12.Schema.Types.ObjectId]
6036
6341
  }
6037
6342
  },
6038
6343
  { _id: false }
6039
6344
  );
6040
- var stripeSchema = new MongooseSchema11(
6345
+ var stripeSchema = new MongooseSchema12(
6041
6346
  {
6347
+ billingPeriod: {
6348
+ enum: Object.values(EnumBillingPeriod),
6349
+ required: false,
6350
+ type: String
6351
+ },
6352
+ cancelAtPeriodEnd: {
6353
+ required: false,
6354
+ type: Boolean
6355
+ },
6042
6356
  currentPlan: {
6043
6357
  enum: Object.values(EnumUserLicence),
6044
6358
  required: false,
@@ -6052,6 +6366,28 @@ var stripeSchema = new MongooseSchema11(
6052
6366
  required: false,
6053
6367
  type: Date
6054
6368
  },
6369
+ pendingBillingPeriod: {
6370
+ enum: Object.values(EnumBillingPeriod),
6371
+ required: false,
6372
+ type: String
6373
+ },
6374
+ pendingChangeEffectiveAt: {
6375
+ required: false,
6376
+ type: Date
6377
+ },
6378
+ pendingPlan: {
6379
+ enum: Object.values(EnumUserLicence),
6380
+ required: false,
6381
+ type: String
6382
+ },
6383
+ priceId: {
6384
+ required: false,
6385
+ type: String
6386
+ },
6387
+ scheduleId: {
6388
+ required: false,
6389
+ type: String
6390
+ },
6055
6391
  startDate: {
6056
6392
  required: false,
6057
6393
  type: Date
@@ -6064,11 +6400,19 @@ var stripeSchema = new MongooseSchema11(
6064
6400
  subscriptionId: {
6065
6401
  required: false,
6066
6402
  type: String
6403
+ },
6404
+ subscriptionMutationLockExpiresAt: {
6405
+ required: false,
6406
+ type: Date
6407
+ },
6408
+ subscriptionMutationLockId: {
6409
+ required: false,
6410
+ type: String
6067
6411
  }
6068
6412
  },
6069
6413
  { _id: false }
6070
6414
  );
6071
- var redeemedRewardSchema = new MongooseSchema11(
6415
+ var redeemedRewardSchema = new MongooseSchema12(
6072
6416
  {
6073
6417
  name: {
6074
6418
  enum: Object.values(EnumReward),
@@ -6080,13 +6424,13 @@ var redeemedRewardSchema = new MongooseSchema11(
6080
6424
  },
6081
6425
  { _id: false }
6082
6426
  );
6083
- var schema7 = new MongooseSchema11(
6427
+ var schema8 = new MongooseSchema12(
6084
6428
  {
6085
6429
  active: { default: false, required: true, type: Boolean },
6086
6430
  affiliate: {
6087
6431
  ref: "Affiliate",
6088
6432
  required: false,
6089
- type: mongoose11.Schema.Types.ObjectId
6433
+ type: mongoose12.Schema.Types.ObjectId
6090
6434
  },
6091
6435
  avatar: {
6092
6436
  required: false,
@@ -6095,7 +6439,7 @@ var schema7 = new MongooseSchema11(
6095
6439
  coupon: {
6096
6440
  ref: "Coupon",
6097
6441
  required: false,
6098
- type: mongoose11.Schema.Types.ObjectId
6442
+ type: mongoose12.Schema.Types.ObjectId
6099
6443
  },
6100
6444
  deletedAt: { default: null, required: false, type: Date },
6101
6445
  email: { required: true, type: String },
@@ -6107,13 +6451,13 @@ var schema7 = new MongooseSchema11(
6107
6451
  events: {
6108
6452
  ref: "Event",
6109
6453
  required: false,
6110
- type: [mongoose11.Schema.Types.ObjectId]
6454
+ type: [mongoose12.Schema.Types.ObjectId]
6111
6455
  },
6112
6456
  firstName: { required: true, type: String },
6113
6457
  game: {
6114
6458
  ref: "Game",
6115
6459
  required: false,
6116
- type: mongoose11.Schema.Types.ObjectId
6460
+ type: mongoose12.Schema.Types.ObjectId
6117
6461
  },
6118
6462
  interests: {
6119
6463
  enum: Object.values(EnumResourceType),
@@ -6135,7 +6479,7 @@ var schema7 = new MongooseSchema11(
6135
6479
  partner: {
6136
6480
  ref: "Partner",
6137
6481
  required: false,
6138
- type: mongoose11.Schema.Types.ObjectId
6482
+ type: mongoose12.Schema.Types.ObjectId
6139
6483
  },
6140
6484
  password: { required: true, type: String },
6141
6485
  platform: {
@@ -6168,7 +6512,7 @@ var schema7 = new MongooseSchema11(
6168
6512
  school: {
6169
6513
  ref: "School",
6170
6514
  required: false,
6171
- type: mongoose11.Schema.Types.ObjectId
6515
+ type: mongoose12.Schema.Types.ObjectId
6172
6516
  },
6173
6517
  stripe: {
6174
6518
  required: false,
@@ -6193,19 +6537,19 @@ var schema7 = new MongooseSchema11(
6193
6537
  vendor: {
6194
6538
  ref: "Vendor",
6195
6539
  required: false,
6196
- type: mongoose11.Schema.Types.ObjectId
6540
+ type: mongoose12.Schema.Types.ObjectId
6197
6541
  }
6198
6542
  },
6199
6543
  { strict: false, timestamps: true }
6200
6544
  );
6201
- schema7.index({ "licences.expiryDate": 1 });
6202
- schema7.index({ "licences.licenceType": 1 });
6203
- var UserModel = mongoose11.models.User || mongoose11.model("User", schema7);
6545
+ schema8.index({ "licences.expiryDate": 1 });
6546
+ schema8.index({ "licences.licenceType": 1 });
6547
+ var UserModel = mongoose12.models.User || mongoose12.model("User", schema8);
6204
6548
 
6205
6549
  // src/mongoose/VerificationToken.ts
6206
- import mongoose12 from "mongoose";
6207
- var MongooseSchema12 = mongoose12.Schema;
6208
- var schema8 = new MongooseSchema12(
6550
+ import mongoose13 from "mongoose";
6551
+ var MongooseSchema13 = mongoose13.Schema;
6552
+ var schema9 = new MongooseSchema13(
6209
6553
  {
6210
6554
  createdAt: {
6211
6555
  default: Date.now,
@@ -6220,12 +6564,12 @@ var schema8 = new MongooseSchema12(
6220
6564
  },
6221
6565
  { timestamps: true }
6222
6566
  );
6223
- var VerificationTokenModel = mongoose12.models.VerificationToken || mongoose12.model("VerificationToken", schema8);
6567
+ var VerificationTokenModel = mongoose13.models.VerificationToken || mongoose13.model("VerificationToken", schema9);
6224
6568
 
6225
6569
  // src/mongoose/vendor/Vendor.ts
6226
- import mongoose13 from "mongoose";
6227
- var MongooseSchema13 = mongoose13.Schema;
6228
- var vendorProductTypeSchema = new MongooseSchema13(
6570
+ import mongoose14 from "mongoose";
6571
+ var MongooseSchema14 = mongoose14.Schema;
6572
+ var vendorProductTypeSchema = new MongooseSchema14(
6229
6573
  {
6230
6574
  description: { required: false, type: String },
6231
6575
  name: { required: true, type: String },
@@ -6236,14 +6580,14 @@ var vendorProductTypeSchema = new MongooseSchema13(
6236
6580
  },
6237
6581
  { timestamps: true }
6238
6582
  );
6239
- var productWrapperSchema = new MongooseSchema13(
6583
+ var productWrapperSchema = new MongooseSchema14(
6240
6584
  {
6241
6585
  active: { default: false, required: false, type: Boolean },
6242
6586
  productsList: { required: false, type: [vendorProductTypeSchema] }
6243
6587
  },
6244
6588
  { _id: false }
6245
6589
  );
6246
- var calendarSchema = new MongooseSchema13(
6590
+ var calendarSchema = new MongooseSchema14(
6247
6591
  {
6248
6592
  dateTime: {
6249
6593
  dateStatus: {
@@ -6264,14 +6608,14 @@ var calendarSchema = new MongooseSchema13(
6264
6608
  },
6265
6609
  { _id: false }
6266
6610
  );
6267
- var calendarWrapperSchema = new MongooseSchema13(
6611
+ var calendarWrapperSchema = new MongooseSchema14(
6268
6612
  {
6269
6613
  active: { default: false, required: true, type: Boolean },
6270
6614
  calendarData: { required: false, type: [calendarSchema] }
6271
6615
  },
6272
6616
  { _id: false }
6273
6617
  );
6274
- var schema9 = new MongooseSchema13(
6618
+ var schema10 = new MongooseSchema14(
6275
6619
  {
6276
6620
  ...baseResourceFields,
6277
6621
  // Importing base resource fields from global.ts
@@ -6297,12 +6641,12 @@ var schema9 = new MongooseSchema13(
6297
6641
  unregisteredVendorId: {
6298
6642
  ref: "UnregisteredVendor",
6299
6643
  required: false,
6300
- type: mongoose13.Schema.Types.ObjectId
6644
+ type: mongoose14.Schema.Types.ObjectId
6301
6645
  },
6302
6646
  vendorInfoId: {
6303
6647
  ref: "VendorInfo",
6304
6648
  required: false,
6305
- type: mongoose13.Schema.Types.ObjectId
6649
+ type: mongoose14.Schema.Types.ObjectId
6306
6650
  },
6307
6651
  vendorType: {
6308
6652
  enum: Object.values(EnumVendorType),
@@ -6312,24 +6656,24 @@ var schema9 = new MongooseSchema13(
6312
6656
  },
6313
6657
  { timestamps: true }
6314
6658
  );
6315
- schema9.index({ name: 1 });
6316
- schema9.index({ description: 1 });
6317
- schema9.index({ region: 1 });
6318
- schema9.index({ "categories.name": 1 });
6319
- schema9.index({ slug: 1 });
6320
- var VendorModel = mongoose13.models.Vendor || mongoose13.model("Vendor", schema9);
6659
+ schema10.index({ name: 1 });
6660
+ schema10.index({ description: 1 });
6661
+ schema10.index({ region: 1 });
6662
+ schema10.index({ "categories.name": 1 });
6663
+ schema10.index({ slug: 1 });
6664
+ var VendorModel = mongoose14.models.Vendor || mongoose14.model("Vendor", schema10);
6321
6665
 
6322
6666
  // src/mongoose/vendor/VendorInfo.ts
6323
- import mongoose14 from "mongoose";
6324
- var MongooseSchema14 = mongoose14.Schema;
6325
- var AttributesSchema = new MongooseSchema14(
6667
+ import mongoose15 from "mongoose";
6668
+ var MongooseSchema15 = mongoose15.Schema;
6669
+ var AttributesSchema = new MongooseSchema15(
6326
6670
  {
6327
6671
  details: { required: false, type: String },
6328
6672
  isRequired: { default: false, required: true, type: Boolean }
6329
6673
  },
6330
6674
  { _id: false }
6331
6675
  );
6332
- var schema10 = new MongooseSchema14(
6676
+ var schema11 = new MongooseSchema15(
6333
6677
  {
6334
6678
  active: { default: true, type: Boolean },
6335
6679
  compliance: {
@@ -6364,28 +6708,28 @@ var schema10 = new MongooseSchema14(
6364
6708
  vendorId: {
6365
6709
  ref: "Vendor",
6366
6710
  required: true,
6367
- type: mongoose14.Schema.Types.ObjectId
6711
+ type: mongoose15.Schema.Types.ObjectId
6368
6712
  }
6369
6713
  },
6370
6714
  { timestamps: true }
6371
6715
  );
6372
- var VendorInfoModel = mongoose14.models.VendorInfo || mongoose14.model("VendorInfo", schema10);
6716
+ var VendorInfoModel = mongoose15.models.VendorInfo || mongoose15.model("VendorInfo", schema11);
6373
6717
 
6374
6718
  // src/mongoose/vendor/UnregisteredVendor.ts
6375
- import mongoose15 from "mongoose";
6376
- var MongooseSchema15 = mongoose15.Schema;
6377
- var invitationSchema = new MongooseSchema15(
6719
+ import mongoose16 from "mongoose";
6720
+ var MongooseSchema16 = mongoose16.Schema;
6721
+ var invitationSchema = new MongooseSchema16(
6378
6722
  {
6379
6723
  dateTime: { required: true, type: [dateTimeSchema2] },
6380
6724
  inviterId: {
6381
6725
  ref: "Event",
6382
6726
  required: true,
6383
- type: mongoose15.Schema.Types.ObjectId
6727
+ type: mongoose16.Schema.Types.ObjectId
6384
6728
  }
6385
6729
  },
6386
6730
  { _id: false }
6387
6731
  );
6388
- var schema11 = new MongooseSchema15(
6732
+ var schema12 = new MongooseSchema16(
6389
6733
  {
6390
6734
  active: { default: true, required: true, type: Boolean },
6391
6735
  categoryIds: { required: true, type: [String] },
@@ -6394,7 +6738,7 @@ var schema11 = new MongooseSchema15(
6394
6738
  claimedByUserId: {
6395
6739
  ref: "User",
6396
6740
  required: false,
6397
- type: mongoose15.Schema.Types.ObjectId
6741
+ type: mongoose16.Schema.Types.ObjectId
6398
6742
  },
6399
6743
  claimInitiatedAt: { default: null, required: false, type: Date },
6400
6744
  claimToken: { default: null, required: false, type: String },
@@ -6407,14 +6751,14 @@ var schema11 = new MongooseSchema15(
6407
6751
  },
6408
6752
  { timestamps: true }
6409
6753
  );
6410
- schema11.index({ name: 1 });
6411
- schema11.index({ email: 1 });
6412
- var UnregisteredVendorModel = mongoose15.models.UnregisteredVendor || mongoose15.model("UnregisteredVendor", schema11);
6754
+ schema12.index({ name: 1 });
6755
+ schema12.index({ email: 1 });
6756
+ var UnregisteredVendorModel = mongoose16.models.UnregisteredVendor || mongoose16.model("UnregisteredVendor", schema12);
6413
6757
 
6414
6758
  // src/mongoose/event/Event.ts
6415
- import mongoose16 from "mongoose";
6416
- var MongooseSchema16 = mongoose16.Schema;
6417
- var schema12 = new MongooseSchema16(
6759
+ import mongoose17 from "mongoose";
6760
+ var MongooseSchema17 = mongoose17.Schema;
6761
+ var schema13 = new MongooseSchema17(
6418
6762
  {
6419
6763
  ...baseResourceFields,
6420
6764
  // Importing base resource fields from global.ts
@@ -6423,7 +6767,7 @@ var schema12 = new MongooseSchema16(
6423
6767
  eventInfoId: {
6424
6768
  ref: "EventInfo",
6425
6769
  required: false,
6426
- type: mongoose16.Schema.Types.ObjectId
6770
+ type: mongoose17.Schema.Types.ObjectId
6427
6771
  },
6428
6772
  eventType: {
6429
6773
  enum: Object.values(EnumEventType),
@@ -6452,20 +6796,20 @@ var schema12 = new MongooseSchema16(
6452
6796
  },
6453
6797
  { timestamps: true }
6454
6798
  );
6455
- schema12.index({ name: 1 });
6456
- schema12.index({ description: 1 });
6457
- schema12.index({ region: 1 });
6458
- schema12.index({ "location.geo": "2dsphere" });
6459
- schema12.index({ tags: 1 });
6460
- schema12.index({ deletedAt: 1 });
6461
- schema12.index({ "dateTime.dateStatus": 1 });
6462
- schema12.index({ slug: 1 });
6463
- var EventModel = mongoose16.models.Event || mongoose16.model("Event", schema12);
6799
+ schema13.index({ name: 1 });
6800
+ schema13.index({ description: 1 });
6801
+ schema13.index({ region: 1 });
6802
+ schema13.index({ "location.geo": "2dsphere" });
6803
+ schema13.index({ tags: 1 });
6804
+ schema13.index({ deletedAt: 1 });
6805
+ schema13.index({ "dateTime.dateStatus": 1 });
6806
+ schema13.index({ slug: 1 });
6807
+ var EventModel = mongoose17.models.Event || mongoose17.model("Event", schema13);
6464
6808
 
6465
6809
  // src/mongoose/Partner.ts
6466
- import mongoose17 from "mongoose";
6467
- var MongooseSchema17 = mongoose17.Schema;
6468
- var schema13 = new MongooseSchema17(
6810
+ import mongoose18 from "mongoose";
6811
+ var MongooseSchema18 = mongoose18.Schema;
6812
+ var schema14 = new MongooseSchema18(
6469
6813
  {
6470
6814
  ...baseResourceFields,
6471
6815
  location: {
@@ -6481,17 +6825,17 @@ var schema13 = new MongooseSchema17(
6481
6825
  },
6482
6826
  { timestamps: true }
6483
6827
  );
6484
- schema13.index({ name: 1 });
6485
- schema13.index({ description: 1 });
6486
- schema13.index({ region: 1 });
6487
- schema13.index({ "location.geo": "2dsphere" });
6488
- schema13.index({ slug: 1 });
6489
- var PartnerModel = mongoose17.models.Partner || mongoose17.model("Partner", schema13);
6828
+ schema14.index({ name: 1 });
6829
+ schema14.index({ description: 1 });
6830
+ schema14.index({ region: 1 });
6831
+ schema14.index({ "location.geo": "2dsphere" });
6832
+ schema14.index({ slug: 1 });
6833
+ var PartnerModel = mongoose18.models.Partner || mongoose18.model("Partner", schema14);
6490
6834
 
6491
6835
  // src/mongoose/Post.ts
6492
- import mongoose18, { Schema } from "mongoose";
6493
- var MongooseSchema18 = mongoose18.Schema;
6494
- var contentSchema = new MongooseSchema18(
6836
+ import mongoose19, { Schema } from "mongoose";
6837
+ var MongooseSchema19 = mongoose19.Schema;
6838
+ var contentSchema = new MongooseSchema19(
6495
6839
  {
6496
6840
  contentData: Schema.Types.Mixed,
6497
6841
  contentOrder: { required: true, type: Number },
@@ -6503,7 +6847,7 @@ var contentSchema = new MongooseSchema18(
6503
6847
  },
6504
6848
  { _id: false }
6505
6849
  );
6506
- var resourceSchema = new MongooseSchema18(
6850
+ var resourceSchema = new MongooseSchema19(
6507
6851
  {
6508
6852
  resourceId: { required: true, type: String },
6509
6853
  resourceRegion: { required: true, type: String },
@@ -6516,7 +6860,7 @@ var resourceSchema = new MongooseSchema18(
6516
6860
  },
6517
6861
  { _id: false }
6518
6862
  );
6519
- var schema14 = new MongooseSchema18(
6863
+ var schema15 = new MongooseSchema19(
6520
6864
  {
6521
6865
  active: { default: false, required: true, type: Boolean },
6522
6866
  approvedAt: { default: null, required: false, type: Date },
@@ -6547,16 +6891,16 @@ var schema14 = new MongooseSchema18(
6547
6891
  },
6548
6892
  { timestamps: true }
6549
6893
  );
6550
- schema14.index({ title: 1 });
6551
- schema14.index({ tags: 1 });
6552
- schema14.index({ postType: 1, slug: 1 }, { unique: true });
6553
- var PostModel = mongoose18.models.Post || mongoose18.model("Post", schema14);
6894
+ schema15.index({ title: 1 });
6895
+ schema15.index({ tags: 1 });
6896
+ schema15.index({ postType: 1, slug: 1 }, { unique: true });
6897
+ var PostModel = mongoose19.models.Post || mongoose19.model("Post", schema15);
6554
6898
 
6555
6899
  // src/mongoose/AppSetting.ts
6556
- import mongoose19 from "mongoose";
6557
- var MongooseSchema19 = mongoose19.Schema;
6900
+ import mongoose20 from "mongoose";
6901
+ var MongooseSchema20 = mongoose20.Schema;
6558
6902
  var APP_SETTINGS_ID = "APP_SETTINGS_DOCUMENT_ID";
6559
- var AppSettingSchema = new MongooseSchema19(
6903
+ var AppSettingSchema = new MongooseSchema20(
6560
6904
  {
6561
6905
  activeSchoolsStudentCountTotal: {
6562
6906
  default: 0,
@@ -6587,18 +6931,18 @@ var AppSettingSchema = new MongooseSchema19(
6587
6931
  },
6588
6932
  { timestamps: true }
6589
6933
  );
6590
- var AppSettingModel = mongoose19.models.AppSetting || mongoose19.model("AppSetting", AppSettingSchema);
6934
+ var AppSettingModel = mongoose20.models.AppSetting || mongoose20.model("AppSetting", AppSettingSchema);
6591
6935
 
6592
6936
  // src/mongoose/game/Game.ts
6593
- import mongoose23 from "mongoose";
6937
+ import mongoose24 from "mongoose";
6594
6938
 
6595
6939
  // src/mongoose/game/DailyClue.ts
6596
- import mongoose21 from "mongoose";
6940
+ import mongoose22 from "mongoose";
6597
6941
 
6598
6942
  // src/mongoose/game/utils.ts
6599
- import mongoose20 from "mongoose";
6600
- var MongooseSchema20 = mongoose20.Schema;
6601
- var schemaGameDate = new MongooseSchema20(
6943
+ import mongoose21 from "mongoose";
6944
+ var MongooseSchema21 = mongoose21.Schema;
6945
+ var schemaGameDate = new MongooseSchema21(
6602
6946
  {
6603
6947
  endDate: { required: true, type: Date },
6604
6948
  startDate: { required: true, type: Date }
@@ -6607,8 +6951,8 @@ var schemaGameDate = new MongooseSchema20(
6607
6951
  );
6608
6952
 
6609
6953
  // src/mongoose/game/DailyClue.ts
6610
- var MongooseSchema21 = mongoose21.Schema;
6611
- var schemaLetters = new MongooseSchema21(
6954
+ var MongooseSchema22 = mongoose22.Schema;
6955
+ var schemaLetters = new MongooseSchema22(
6612
6956
  {
6613
6957
  collected: { required: false, type: [String] },
6614
6958
  solutionShuffled: { required: true, type: [String] }
@@ -6616,14 +6960,14 @@ var schemaLetters = new MongooseSchema21(
6616
6960
  },
6617
6961
  { _id: false }
6618
6962
  );
6619
- var schemaDailyClueBaseGame = new MongooseSchema21(
6963
+ var schemaDailyClueBaseGame = new MongooseSchema22(
6620
6964
  {
6621
6965
  gameDate: { required: true, type: schemaGameDate },
6622
6966
  gameSolution: { required: true, type: String }
6623
6967
  },
6624
6968
  { _id: false }
6625
6969
  );
6626
- var schemaDailyClueGameData = new MongooseSchema21(
6970
+ var schemaDailyClueGameData = new MongooseSchema22(
6627
6971
  {
6628
6972
  gameFields: { required: true, type: schemaDailyClueBaseGame },
6629
6973
  lastFoundDate: { default: null, required: false, type: Date },
@@ -6638,9 +6982,9 @@ var schemaDailyClueGameData = new MongooseSchema21(
6638
6982
  );
6639
6983
 
6640
6984
  // src/mongoose/game/PuzzleGame.ts
6641
- import mongoose22 from "mongoose";
6642
- var MongooseSchema22 = mongoose22.Schema;
6643
- var schemaPuzzleAnswer = new MongooseSchema22(
6985
+ import mongoose23 from "mongoose";
6986
+ var MongooseSchema23 = mongoose23.Schema;
6987
+ var schemaPuzzleAnswer = new MongooseSchema23(
6644
6988
  {
6645
6989
  answer: { required: true, type: String },
6646
6990
  answerId: { required: true, type: String },
@@ -6648,7 +6992,7 @@ var schemaPuzzleAnswer = new MongooseSchema22(
6648
6992
  },
6649
6993
  { _id: false }
6650
6994
  );
6651
- var schemaPuzzleQuestion = new MongooseSchema22(
6995
+ var schemaPuzzleQuestion = new MongooseSchema23(
6652
6996
  {
6653
6997
  answers: { required: true, type: [schemaPuzzleAnswer] },
6654
6998
  question: { required: true, type: String },
@@ -6656,20 +7000,20 @@ var schemaPuzzleQuestion = new MongooseSchema22(
6656
7000
  },
6657
7001
  { _id: false }
6658
7002
  );
6659
- var schemaPuzzleBaseGame = new MongooseSchema22(
7003
+ var schemaPuzzleBaseGame = new MongooseSchema23(
6660
7004
  {
6661
7005
  questions: { required: true, type: [schemaPuzzleQuestion] }
6662
7006
  },
6663
7007
  { _id: false }
6664
7008
  );
6665
- var schemaPuzzleAnsweredQuestion = new MongooseSchema22(
7009
+ var schemaPuzzleAnsweredQuestion = new MongooseSchema23(
6666
7010
  {
6667
7011
  questionId: { required: true, type: String },
6668
7012
  selectedAnswerId: { required: true, type: String }
6669
7013
  },
6670
7014
  { _id: false }
6671
7015
  );
6672
- var schemaPuzzleGameData = new MongooseSchema22(
7016
+ var schemaPuzzleGameData = new MongooseSchema23(
6673
7017
  {
6674
7018
  answeredQuestions: {
6675
7019
  default: null,
@@ -6684,19 +7028,19 @@ var schemaPuzzleGameData = new MongooseSchema22(
6684
7028
  );
6685
7029
 
6686
7030
  // src/mongoose/game/Game.ts
6687
- var MongooseSchema23 = mongoose23.Schema;
7031
+ var MongooseSchema24 = mongoose24.Schema;
6688
7032
  var gameDataSchemas = {
6689
7033
  [EnumGameType.DAILY_CLUE]: schemaDailyClueGameData,
6690
7034
  [EnumGameType.MINI_QUIZ]: schemaPuzzleGameData,
6691
7035
  [EnumGameType.ODD_ONE_OUT]: schemaPuzzleGameData
6692
7036
  };
6693
7037
  var gameDataDefinition = Object.fromEntries(
6694
- Object.entries(gameDataSchemas).map(([key, schema19]) => [
7038
+ Object.entries(gameDataSchemas).map(([key, schema20]) => [
6695
7039
  key,
6696
- { default: null, required: false, type: schema19 }
7040
+ { default: null, required: false, type: schema20 }
6697
7041
  ])
6698
7042
  );
6699
- var gameHistorySchema = new MongooseSchema23(
7043
+ var gameHistorySchema = new MongooseSchema24(
6700
7044
  {
6701
7045
  createdAt: { required: true, type: Date },
6702
7046
  gameDate: { required: true, type: schemaGameDate },
@@ -6716,7 +7060,7 @@ var gameHistorySchema = new MongooseSchema23(
6716
7060
  },
6717
7061
  { _id: false }
6718
7062
  );
6719
- var gameTypeSchema = new MongooseSchema23(
7063
+ var gameTypeSchema = new MongooseSchema24(
6720
7064
  {
6721
7065
  active: { default: true, required: true, type: Boolean },
6722
7066
  gameData: gameDataDefinition,
@@ -6731,7 +7075,7 @@ var gameTypeSchema = new MongooseSchema23(
6731
7075
  },
6732
7076
  { timestamps: true }
6733
7077
  );
6734
- var schema15 = new MongooseSchema23(
7078
+ var schema16 = new MongooseSchema24(
6735
7079
  {
6736
7080
  active: { default: false, required: true, type: Boolean },
6737
7081
  deletedAt: { default: null, required: false, type: Date },
@@ -6744,12 +7088,12 @@ var schema15 = new MongooseSchema23(
6744
7088
  },
6745
7089
  { timestamps: true }
6746
7090
  );
6747
- var GameModel = mongoose23.models.Game || mongoose23.model("Game", schema15);
7091
+ var GameModel = mongoose24.models.Game || mongoose24.model("Game", schema16);
6748
7092
 
6749
7093
  // src/mongoose/School.ts
6750
- import mongoose24 from "mongoose";
6751
- var MongooseSchema24 = mongoose24.Schema;
6752
- var campaignsSchema = new MongooseSchema24(
7094
+ import mongoose25 from "mongoose";
7095
+ var MongooseSchema25 = mongoose25.Schema;
7096
+ var campaignsSchema = new MongooseSchema25(
6753
7097
  {
6754
7098
  endDate: { required: true, type: Date },
6755
7099
  name: { required: true, type: String },
@@ -6757,7 +7101,7 @@ var campaignsSchema = new MongooseSchema24(
6757
7101
  },
6758
7102
  { _id: false }
6759
7103
  );
6760
- var schema16 = new MongooseSchema24(
7104
+ var schema17 = new MongooseSchema25(
6761
7105
  {
6762
7106
  // New schools are active by default
6763
7107
  active: { default: false, required: true, type: Boolean },
@@ -6784,19 +7128,19 @@ var schema16 = new MongooseSchema24(
6784
7128
  },
6785
7129
  { timestamps: true }
6786
7130
  );
6787
- schema16.index(
7131
+ schema17.index(
6788
7132
  { schoolCode: 1 },
6789
7133
  {
6790
7134
  partialFilterExpression: { active: true, deletedAt: null },
6791
7135
  unique: true
6792
7136
  }
6793
7137
  );
6794
- var SchoolModel = mongoose24.models.School || mongoose24.model("School", schema16);
7138
+ var SchoolModel = mongoose25.models.School || mongoose25.model("School", schema17);
6795
7139
 
6796
7140
  // src/mongoose/Affiliate.ts
6797
- import mongoose25 from "mongoose";
6798
- var MongooseSchema25 = mongoose25.Schema;
6799
- var affiliateRewardSchema = new MongooseSchema25(
7141
+ import mongoose26 from "mongoose";
7142
+ var MongooseSchema26 = mongoose26.Schema;
7143
+ var affiliateRewardSchema = new MongooseSchema26(
6800
7144
  {
6801
7145
  createdAt: { required: true, type: Date },
6802
7146
  redeemedAt: { default: null, required: false, type: Date },
@@ -6810,13 +7154,13 @@ var affiliateRewardSchema = new MongooseSchema25(
6810
7154
  },
6811
7155
  { _id: false }
6812
7156
  );
6813
- var affiliateResourceSchema = new MongooseSchema25(
7157
+ var affiliateResourceSchema = new MongooseSchema26(
6814
7158
  {
6815
7159
  resourceActive: { default: true, required: true, type: Boolean },
6816
7160
  resourceDeletedAt: { default: null, required: false, type: Date },
6817
7161
  resourceId: {
6818
7162
  required: true,
6819
- type: mongoose25.Schema.Types.ObjectId
7163
+ type: mongoose26.Schema.Types.ObjectId
6820
7164
  },
6821
7165
  resourceName: { required: true, type: String },
6822
7166
  resourceOwner: {
@@ -6836,20 +7180,20 @@ var affiliateResourceSchema = new MongooseSchema25(
6836
7180
  },
6837
7181
  { _id: false }
6838
7182
  );
6839
- var affiliateContactDetailsSchema = new MongooseSchema25(
7183
+ var affiliateContactDetailsSchema = new MongooseSchema26(
6840
7184
  {
6841
7185
  mobilePhone: { required: true, type: String }
6842
7186
  },
6843
7187
  { _id: false }
6844
7188
  );
6845
- var affiliateBankAccountDetailsSchema = new MongooseSchema25(
7189
+ var affiliateBankAccountDetailsSchema = new MongooseSchema26(
6846
7190
  {
6847
7191
  accountHolderName: { required: true, type: String },
6848
7192
  accountNumber: { required: true, type: String }
6849
7193
  },
6850
7194
  { _id: false }
6851
7195
  );
6852
- var affiliateDetailsSchema = new MongooseSchema25(
7196
+ var affiliateDetailsSchema = new MongooseSchema26(
6853
7197
  {
6854
7198
  bankAccountDetails: {
6855
7199
  required: true,
@@ -6871,7 +7215,7 @@ var affiliateDetailsSchema = new MongooseSchema25(
6871
7215
  },
6872
7216
  { _id: false }
6873
7217
  );
6874
- var redeemHistorySchema = new MongooseSchema25(
7218
+ var redeemHistorySchema = new MongooseSchema26(
6875
7219
  {
6876
7220
  paidAt: { default: null, required: false, type: Date },
6877
7221
  redeemedAt: { required: true, type: Date },
@@ -6879,7 +7223,7 @@ var redeemHistorySchema = new MongooseSchema25(
6879
7223
  },
6880
7224
  { _id: false }
6881
7225
  );
6882
- var schema17 = new MongooseSchema25(
7226
+ var schema18 = new MongooseSchema26(
6883
7227
  {
6884
7228
  active: { default: false, required: true, type: Boolean },
6885
7229
  affiliateBonusRewards: {
@@ -6909,19 +7253,19 @@ var schema17 = new MongooseSchema25(
6909
7253
  },
6910
7254
  { timestamps: true }
6911
7255
  );
6912
- schema17.index(
7256
+ schema18.index(
6913
7257
  { affiliateCode: 1 },
6914
7258
  {
6915
7259
  partialFilterExpression: { active: true, deletedAt: null },
6916
7260
  unique: true
6917
7261
  }
6918
7262
  );
6919
- var AffiliateModel = mongoose25.models.Affiliate || mongoose25.model("Affiliate", schema17);
7263
+ var AffiliateModel = mongoose26.models.Affiliate || mongoose26.model("Affiliate", schema18);
6920
7264
 
6921
7265
  // src/mongoose/Coupon.ts
6922
- import mongoose26 from "mongoose";
6923
- var MongooseSchema26 = mongoose26.Schema;
6924
- var couponOptionSchema = new MongooseSchema26(
7266
+ import mongoose27 from "mongoose";
7267
+ var MongooseSchema27 = mongoose27.Schema;
7268
+ var couponOptionSchema = new MongooseSchema27(
6925
7269
  {
6926
7270
  buy: { required: false, type: Number },
6927
7271
  get: { required: false, type: Number },
@@ -6936,29 +7280,29 @@ var couponOptionSchema = new MongooseSchema26(
6936
7280
  },
6937
7281
  { _id: false }
6938
7282
  );
6939
- var couponVendorProductSchema = new MongooseSchema26(
7283
+ var couponVendorProductSchema = new MongooseSchema27(
6940
7284
  {
6941
7285
  couponId: {
6942
7286
  required: true,
6943
- type: mongoose26.Schema.Types.ObjectId
7287
+ type: mongoose27.Schema.Types.ObjectId
6944
7288
  },
6945
7289
  productId: {
6946
7290
  required: true,
6947
- type: mongoose26.Schema.Types.ObjectId
7291
+ type: mongoose27.Schema.Types.ObjectId
6948
7292
  },
6949
7293
  vendorCouponId: {
6950
7294
  required: false,
6951
- type: mongoose26.Schema.Types.ObjectId
7295
+ type: mongoose27.Schema.Types.ObjectId
6952
7296
  },
6953
7297
  vendorId: {
6954
7298
  ref: "Vendor",
6955
7299
  required: true,
6956
- type: mongoose26.Schema.Types.ObjectId
7300
+ type: mongoose27.Schema.Types.ObjectId
6957
7301
  }
6958
7302
  },
6959
7303
  { _id: false }
6960
7304
  );
6961
- var couponCodeSchema = new MongooseSchema26(
7305
+ var couponCodeSchema = new MongooseSchema27(
6962
7306
  {
6963
7307
  code: { required: true, type: String },
6964
7308
  qrCode: { required: true, type: ResourceImageTypeSchema },
@@ -6966,7 +7310,7 @@ var couponCodeSchema = new MongooseSchema26(
6966
7310
  },
6967
7311
  { _id: false }
6968
7312
  );
6969
- var couponParticipantUserSchema = new MongooseSchema26(
7313
+ var couponParticipantUserSchema = new MongooseSchema27(
6970
7314
  {
6971
7315
  couponCollectedCount: { default: 0, required: true, type: Number },
6972
7316
  couponCycleRedeemed: { default: false, required: true, type: Boolean },
@@ -6975,12 +7319,12 @@ var couponParticipantUserSchema = new MongooseSchema26(
6975
7319
  userId: {
6976
7320
  ref: "User",
6977
7321
  required: true,
6978
- type: mongoose26.Schema.Types.ObjectId
7322
+ type: mongoose27.Schema.Types.ObjectId
6979
7323
  }
6980
7324
  },
6981
7325
  { timestamps: true }
6982
7326
  );
6983
- var couponDataSchema = new MongooseSchema26(
7327
+ var couponDataSchema = new MongooseSchema27(
6984
7328
  {
6985
7329
  active: { default: true, required: true, type: Boolean },
6986
7330
  couponCode: { required: false, type: couponCodeSchema },
@@ -7007,7 +7351,7 @@ var couponDataSchema = new MongooseSchema26(
7007
7351
  },
7008
7352
  { timestamps: true }
7009
7353
  );
7010
- var schema18 = new MongooseSchema26(
7354
+ var schema19 = new MongooseSchema27(
7011
7355
  {
7012
7356
  active: { default: true, required: true, type: Boolean },
7013
7357
  couponData: { default: [], required: false, type: [couponDataSchema] },
@@ -7019,7 +7363,7 @@ var schema18 = new MongooseSchema26(
7019
7363
  },
7020
7364
  { timestamps: true }
7021
7365
  );
7022
- var CouponModel = mongoose26.models.Coupon || mongoose26.model("Coupon", schema18);
7366
+ var CouponModel = mongoose27.models.Coupon || mongoose27.model("Coupon", schema19);
7023
7367
 
7024
7368
  export {
7025
7369
  EnumInviteStatus,
@@ -7029,12 +7373,17 @@ export {
7029
7373
  EnumNotificationType,
7030
7374
  EnumUserLicence,
7031
7375
  EnumEventDateStatus,
7376
+ EnumSubscriptionStatus,
7032
7377
  dateFormat,
7033
7378
  timeFormat,
7034
7379
  EnumAdStatus,
7035
7380
  EnumAffiliateRewardType,
7036
7381
  licenseNiceNames,
7037
7382
  AdModel,
7383
+ BILLING_CATALOG_COLLECTION_NAME,
7384
+ BillingCatalogModel,
7385
+ buildInitialBillingCatalogEntries,
7386
+ getBillingCatalogDefinition,
7038
7387
  ChatModel,
7039
7388
  ChatReportModel,
7040
7389
  StallTypeSchema,
@@ -7064,7 +7413,7 @@ export {
7064
7413
  EnumRegions2 as EnumRegions,
7065
7414
  EnumUserLicence2,
7066
7415
  EnumEventDateStatus2,
7067
- EnumSubscriptionStatus2 as EnumSubscriptionStatus,
7416
+ EnumSubscriptionStatus2,
7068
7417
  PushTokenModel,
7069
7418
  ResourceActivityModel,
7070
7419
  UserModel,
@@ -7083,4 +7432,4 @@ export {
7083
7432
  AffiliateModel,
7084
7433
  CouponModel
7085
7434
  };
7086
- //# sourceMappingURL=chunk-DJHOLZ3J.mjs.map
7435
+ //# sourceMappingURL=chunk-6RUQHYTK.mjs.map