@timardex/cluemart-server-shared 1.1.16 → 1.1.17

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.
@@ -3622,6 +3622,11 @@ var EnumAffiliateRewardType = /* @__PURE__ */ ((EnumAffiliateRewardType2) => {
3622
3622
  EnumAffiliateRewardType2["NEW_VENDOR_REGISTRATION"] = "NEW_VENDOR_REGISTRATION";
3623
3623
  return EnumAffiliateRewardType2;
3624
3624
  })(EnumAffiliateRewardType || {});
3625
+ var EnumCouponQualificationType = /* @__PURE__ */ ((EnumCouponQualificationType2) => {
3626
+ EnumCouponQualificationType2["PURCHASE"] = "PURCHASE";
3627
+ EnumCouponQualificationType2["MARKET_VISIT"] = "MARKET_VISIT";
3628
+ return EnumCouponQualificationType2;
3629
+ })(EnumCouponQualificationType || {});
3625
3630
  var statusOptions = [
3626
3631
  ...Object.values(EnumInviteStatus).map((status) => ({
3627
3632
  label: status,
@@ -5045,6 +5050,7 @@ var USER_FIELDS_FRAGMENT = gql`
5045
5050
  avatar {
5046
5051
  ...ResourceImageFields
5047
5052
  }
5053
+ coupon
5048
5054
  createdAt
5049
5055
  deletedAt
5050
5056
  email
@@ -5391,6 +5397,109 @@ var GET_EVENT_INFO = gql`
5391
5397
  }
5392
5398
  ${EVENT_INFO}
5393
5399
  `;
5400
+ var PRODUCT_COUPON_FIELDS_FRAGMENT = gql`
5401
+ fragment ProductCouponFields on ProductCouponType {
5402
+ couponDocumentId
5403
+ couponId
5404
+ }
5405
+ `;
5406
+ var COUPON_CODE_FIELDS_FRAGMENT = gql`
5407
+ fragment CouponCodeFields on CouponCodeType {
5408
+ code
5409
+ qrCode {
5410
+ ...ResourceImageFields
5411
+ }
5412
+ }
5413
+ ${RESOURCE_IMAGE_FIELDS_FRAGMENT}
5414
+ `;
5415
+ var COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT = gql`
5416
+ fragment CouponParticipantUserFields on CouponParticipantUserType {
5417
+ couponCollectedCount
5418
+ couponRedeemedAt
5419
+ createdAt
5420
+ updatedAt
5421
+ userId
5422
+ }
5423
+ `;
5424
+ var COUPON_OPTION_FIELDS_FRAGMENT = gql`
5425
+ fragment CouponOptionFields on CouponOptionType {
5426
+ type
5427
+ buy
5428
+ get
5429
+ unit
5430
+ visits
5431
+ }
5432
+ `;
5433
+ var COUPON_REWARD_FIELDS_FRAGMENT = gql`
5434
+ fragment CouponRewardFields on CouponRewardType {
5435
+ vendorId
5436
+ productId
5437
+ quantity
5438
+ unit
5439
+ }
5440
+ `;
5441
+ var COUPON_DATA_FIELDS_FRAGMENT = gql`
5442
+ fragment CouponDataFields on CouponDataType {
5443
+ _id
5444
+ active
5445
+ couponCode {
5446
+ ...CouponCodeFields
5447
+ }
5448
+ couponDescription
5449
+ couponOption {
5450
+ ...CouponOptionFields
5451
+ }
5452
+ couponRewards {
5453
+ ...CouponRewardFields
5454
+ }
5455
+ createdAt
5456
+ endDate
5457
+ participantUsers {
5458
+ ...CouponParticipantUserFields
5459
+ }
5460
+ resourceId
5461
+ resourceType
5462
+ startDate
5463
+ updatedAt
5464
+ }
5465
+ ${COUPON_CODE_FIELDS_FRAGMENT}
5466
+ ${COUPON_OPTION_FIELDS_FRAGMENT}
5467
+ ${COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT}
5468
+ ${COUPON_REWARD_FIELDS_FRAGMENT}
5469
+ `;
5470
+ var COUPON = gql`
5471
+ fragment CouponFields on CouponType {
5472
+ _id
5473
+ active
5474
+ couponData {
5475
+ ...CouponDataFields
5476
+ }
5477
+ createdAt
5478
+ deletedAt
5479
+ owner {
5480
+ ...OwnerFields
5481
+ }
5482
+ updatedAt
5483
+ }
5484
+ ${OWNER_FIELDS_FRAGMENT}
5485
+ ${COUPON_DATA_FIELDS_FRAGMENT}
5486
+ `;
5487
+ var GET_COUPONS = gql`
5488
+ query getCoupons {
5489
+ coupons {
5490
+ ...CouponFields
5491
+ }
5492
+ }
5493
+ ${COUPON}
5494
+ `;
5495
+ var GET_COUPON = gql`
5496
+ query getCoupon($_id: ID!) {
5497
+ coupon(_id: $_id) {
5498
+ ...CouponFields
5499
+ }
5500
+ }
5501
+ ${COUPON}
5502
+ `;
5394
5503
  var VENDOR_DATETIME_FIELDS_FRAGMENT = gql`
5395
5504
  fragment VendorDateTimeFields on VendorDateTimeType {
5396
5505
  dateStatus
@@ -5403,15 +5512,18 @@ var VENDOR_DATETIME_FIELDS_FRAGMENT = gql`
5403
5512
  var VENDOR_PRODUCT_LIST_FIELDS_FRAGMENT = gql`
5404
5513
  fragment VendorProductListFields on VendorProductListType {
5405
5514
  _id
5515
+ coupon {
5516
+ ...ProductCouponFields
5517
+ }
5406
5518
  createdAt
5407
5519
  description
5408
- hasCoupon
5409
5520
  name
5410
5521
  price
5411
5522
  priceUnit
5412
5523
  productGroups
5413
5524
  updatedAt
5414
5525
  }
5526
+ ${PRODUCT_COUPON_FIELDS_FRAGMENT}
5415
5527
  `;
5416
5528
  var VENDOR = gql`
5417
5529
  fragment VendorFields on VendorType {
@@ -7713,79 +7825,6 @@ var ASSIGN_AFFILIATE_BONUS_REWARD_MUTATION = gql`
7713
7825
  }
7714
7826
  ${AFFILIATE_FIELDS_FRAGMENT}
7715
7827
  `;
7716
- var COUPON_CODE_FIELDS_FRAGMENT = gql`
7717
- fragment CouponCodeFields on CouponCodeType {
7718
- code
7719
- qrCode {
7720
- ...ResourceImageFields
7721
- }
7722
- }
7723
- ${RESOURCE_IMAGE_FIELDS_FRAGMENT}
7724
- `;
7725
- var COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT = gql`
7726
- fragment CouponParticipantUserFields on CouponParticipantUserType {
7727
- couponCount
7728
- couponRedeemedAt
7729
- createdAt
7730
- updatedAt
7731
- userId
7732
- }
7733
- `;
7734
- var PRODUCT_COUPON_FIELDS_FRAGMENT = gql`
7735
- fragment ProductCouponFields on ProductCouponType {
7736
- _id
7737
- active
7738
- couponCode {
7739
- ...CouponCodeFields
7740
- }
7741
- couponDescription
7742
- couponOption
7743
- createdAt
7744
- endDate
7745
- participantProduct {
7746
- ...VendorProductListFields
7747
- }
7748
- participantUsers {
7749
- ...CouponParticipantUserFields
7750
- }
7751
- startDate
7752
- updatedAt
7753
- }
7754
- ${COUPON_CODE_FIELDS_FRAGMENT}
7755
- ${COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT}
7756
- ${VENDOR_PRODUCT_LIST_FIELDS_FRAGMENT}
7757
- `;
7758
- var COUPON = gql`
7759
- fragment CouponFields on CouponType {
7760
- _id
7761
- active
7762
- productCoupons {
7763
- ...ProductCouponFields
7764
- }
7765
- createdAt
7766
- deletedAt
7767
- updatedAt
7768
- }
7769
- ${PRODUCT_COUPON_FIELDS_FRAGMENT}
7770
- ${COUPON_CODE_FIELDS_FRAGMENT}
7771
- ${COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT}
7772
- `;
7773
- var GET_COUPONS = gql`
7774
- query getCoupons {
7775
- coupons {
7776
- ...CouponFields
7777
- }
7778
- }
7779
- ${COUPON}
7780
- `;
7781
- var GET_COUPON = gql`
7782
- query getCoupon($_id: ID!) {
7783
- coupon(_id: $_id) {
7784
- ...CouponFields
7785
- }
7786
- }
7787
- ${COUPON}
7788
- `;
7789
7828
  var CREATE_COUPON_MUTATION = gql`
7790
7829
  mutation createCoupon($input: CouponInputType!) {
7791
7830
  createCoupon(input: $input) {
@@ -8485,7 +8524,7 @@ var baseResourceFields = {
8485
8524
  logo: { required: false, type: ResourceImageTypeSchema },
8486
8525
  name: { required: true, type: String },
8487
8526
  owner: {
8488
- required: false,
8527
+ required: true,
8489
8528
  type: OwnerTypeSchema
8490
8529
  },
8491
8530
  posterUsage: { required: false, type: PosterUsageTypeSchema },
@@ -8950,12 +8989,117 @@ var schema8 = new MongooseSchema12(
8950
8989
  var VerificationTokenModel = mongoose12.models.VerificationToken || mongoose12.model("VerificationToken", schema8);
8951
8990
 
8952
8991
  // src/mongoose/vendor/Vendor.ts
8992
+ import mongoose14 from "mongoose";
8993
+
8994
+ // src/mongoose/Coupon.ts
8953
8995
  import mongoose13 from "mongoose";
8954
8996
  var MongooseSchema13 = mongoose13.Schema;
8955
- var vendorProductTypeSchema = new MongooseSchema13(
8997
+ var productCouponSchema = new MongooseSchema13(
8998
+ {
8999
+ couponDocumentId: {
9000
+ ref: "Coupon",
9001
+ required: true,
9002
+ type: mongoose13.Schema.Types.ObjectId
9003
+ },
9004
+ couponId: {
9005
+ required: true,
9006
+ type: mongoose13.Schema.Types.ObjectId
9007
+ }
9008
+ },
9009
+ { _id: false }
9010
+ );
9011
+ var couponOptionSchema = new MongooseSchema13(
9012
+ {
9013
+ buy: { required: false, type: Number },
9014
+ get: { required: false, type: Number },
9015
+ type: {
9016
+ enum: Object.values(EnumCouponQualificationType),
9017
+ required: true,
9018
+ type: String
9019
+ },
9020
+ unit: { required: false, type: String },
9021
+ visits: { required: false, type: Number }
9022
+ },
9023
+ { _id: false }
9024
+ );
9025
+ var couponRewardSchema = new MongooseSchema13(
9026
+ {
9027
+ productId: {
9028
+ required: true,
9029
+ type: mongoose13.Schema.Types.ObjectId
9030
+ },
9031
+ quantity: { required: true, type: Number },
9032
+ unit: { required: true, type: String },
9033
+ vendorId: {
9034
+ ref: "Vendor",
9035
+ required: true,
9036
+ type: mongoose13.Schema.Types.ObjectId
9037
+ }
9038
+ },
9039
+ { _id: false }
9040
+ );
9041
+ var couponCodeSchema = new MongooseSchema13(
8956
9042
  {
9043
+ code: { required: true, type: String },
9044
+ qrCode: { required: true, type: ResourceImageTypeSchema }
9045
+ },
9046
+ { _id: false }
9047
+ );
9048
+ var couponParticipantUserSchema = new MongooseSchema13(
9049
+ {
9050
+ couponCollectedCount: { default: 0, required: true, type: Number },
9051
+ couponRedeemedAt: { default: null, required: false, type: Date },
9052
+ userId: {
9053
+ ref: "User",
9054
+ required: true,
9055
+ type: mongoose13.Schema.Types.ObjectId
9056
+ }
9057
+ },
9058
+ { timestamps: true }
9059
+ );
9060
+ var couponDataSchema = new MongooseSchema13(
9061
+ {
9062
+ active: { default: true, required: true, type: Boolean },
9063
+ couponCode: { required: true, type: couponCodeSchema },
9064
+ couponDescription: { required: true, type: String },
9065
+ couponOption: { required: true, type: couponOptionSchema },
9066
+ couponRewards: { required: false, type: [couponRewardSchema] },
9067
+ endDate: { required: true, type: Date },
9068
+ participantUsers: {
9069
+ default: null,
9070
+ required: false,
9071
+ type: [couponParticipantUserSchema]
9072
+ },
9073
+ resourceId: { required: true, type: String },
9074
+ resourceType: {
9075
+ enum: Object.values(EnumResourceType),
9076
+ required: true,
9077
+ type: String
9078
+ },
9079
+ startDate: { required: true, type: Date }
9080
+ },
9081
+ { timestamps: true }
9082
+ );
9083
+ var schema9 = new MongooseSchema13(
9084
+ {
9085
+ active: { default: true, required: true, type: Boolean },
9086
+ couponData: { default: [], required: false, type: [couponDataSchema] },
9087
+ deletedAt: { default: null, required: false, type: Date },
9088
+ owner: {
9089
+ required: true,
9090
+ type: OwnerTypeSchema
9091
+ }
9092
+ },
9093
+ { timestamps: true }
9094
+ );
9095
+ var CouponModel = mongoose13.models.Coupon || mongoose13.model("Coupon", schema9);
9096
+
9097
+ // src/mongoose/vendor/Vendor.ts
9098
+ var MongooseSchema14 = mongoose14.Schema;
9099
+ var vendorProductTypeSchema = new MongooseSchema14(
9100
+ {
9101
+ coupon: { required: false, type: productCouponSchema },
8957
9102
  description: { required: false, type: String },
8958
- hasCoupon: { default: false, required: false, type: Boolean },
8959
9103
  name: { required: true, type: String },
8960
9104
  price: { required: true, type: Number },
8961
9105
  priceUnit: { required: true, type: String },
@@ -8963,14 +9107,14 @@ var vendorProductTypeSchema = new MongooseSchema13(
8963
9107
  },
8964
9108
  { timestamps: true }
8965
9109
  );
8966
- var productWrapperSchema = new MongooseSchema13(
9110
+ var productWrapperSchema = new MongooseSchema14(
8967
9111
  {
8968
9112
  active: { default: false, required: true, type: Boolean },
8969
9113
  productsList: { required: false, type: [vendorProductTypeSchema] }
8970
9114
  },
8971
9115
  { _id: false }
8972
9116
  );
8973
- var calendarSchema = new MongooseSchema13(
9117
+ var calendarSchema = new MongooseSchema14(
8974
9118
  {
8975
9119
  dateTime: {
8976
9120
  dateStatus: {
@@ -8991,14 +9135,14 @@ var calendarSchema = new MongooseSchema13(
8991
9135
  },
8992
9136
  { _id: false }
8993
9137
  );
8994
- var calendarWrapperSchema = new MongooseSchema13(
9138
+ var calendarWrapperSchema = new MongooseSchema14(
8995
9139
  {
8996
9140
  active: { default: false, required: true, type: Boolean },
8997
9141
  calendarData: { required: false, type: [calendarSchema] }
8998
9142
  },
8999
9143
  { _id: false }
9000
9144
  );
9001
- var schema9 = new MongooseSchema13(
9145
+ var schema10 = new MongooseSchema14(
9002
9146
  {
9003
9147
  ...baseResourceFields,
9004
9148
  // Importing base resource fields from global.ts
@@ -9024,12 +9168,12 @@ var schema9 = new MongooseSchema13(
9024
9168
  unregisteredVendorId: {
9025
9169
  ref: "UnregisteredVendor",
9026
9170
  required: false,
9027
- type: mongoose13.Schema.Types.ObjectId
9171
+ type: mongoose14.Schema.Types.ObjectId
9028
9172
  },
9029
9173
  vendorInfoId: {
9030
9174
  ref: "VendorInfo",
9031
9175
  required: false,
9032
- type: mongoose13.Schema.Types.ObjectId
9176
+ type: mongoose14.Schema.Types.ObjectId
9033
9177
  },
9034
9178
  vendorType: {
9035
9179
  enum: Object.values(EnumVendorType),
@@ -9039,24 +9183,24 @@ var schema9 = new MongooseSchema13(
9039
9183
  },
9040
9184
  { timestamps: true }
9041
9185
  );
9042
- schema9.index({ name: 1 });
9043
- schema9.index({ description: 1 });
9044
- schema9.index({ region: 1 });
9045
- schema9.index({ "categories.name": 1 });
9046
- schema9.index({ slug: 1 });
9047
- var VendorModel = mongoose13.models.Vendor || mongoose13.model("Vendor", schema9);
9186
+ schema10.index({ name: 1 });
9187
+ schema10.index({ description: 1 });
9188
+ schema10.index({ region: 1 });
9189
+ schema10.index({ "categories.name": 1 });
9190
+ schema10.index({ slug: 1 });
9191
+ var VendorModel = mongoose14.models.Vendor || mongoose14.model("Vendor", schema10);
9048
9192
 
9049
9193
  // src/mongoose/vendor/VendorInfo.ts
9050
- import mongoose14 from "mongoose";
9051
- var MongooseSchema14 = mongoose14.Schema;
9052
- var AttributesSchema = new MongooseSchema14(
9194
+ import mongoose15 from "mongoose";
9195
+ var MongooseSchema15 = mongoose15.Schema;
9196
+ var AttributesSchema = new MongooseSchema15(
9053
9197
  {
9054
9198
  details: { required: false, type: String },
9055
9199
  isRequired: { default: false, required: true, type: Boolean }
9056
9200
  },
9057
9201
  { _id: false }
9058
9202
  );
9059
- var schema10 = new MongooseSchema14(
9203
+ var schema11 = new MongooseSchema15(
9060
9204
  {
9061
9205
  active: { default: true, type: Boolean },
9062
9206
  compliance: {
@@ -9091,28 +9235,28 @@ var schema10 = new MongooseSchema14(
9091
9235
  vendorId: {
9092
9236
  ref: "Vendor",
9093
9237
  required: true,
9094
- type: mongoose14.Schema.Types.ObjectId
9238
+ type: mongoose15.Schema.Types.ObjectId
9095
9239
  }
9096
9240
  },
9097
9241
  { timestamps: true }
9098
9242
  );
9099
- var VendorInfoModel = mongoose14.models.VendorInfo || mongoose14.model("VendorInfo", schema10);
9243
+ var VendorInfoModel = mongoose15.models.VendorInfo || mongoose15.model("VendorInfo", schema11);
9100
9244
 
9101
9245
  // src/mongoose/vendor/UnregisteredVendor.ts
9102
- import mongoose15 from "mongoose";
9103
- var MongooseSchema15 = mongoose15.Schema;
9104
- var invitationSchema = new MongooseSchema15(
9246
+ import mongoose16 from "mongoose";
9247
+ var MongooseSchema16 = mongoose16.Schema;
9248
+ var invitationSchema = new MongooseSchema16(
9105
9249
  {
9106
9250
  dateTime: { required: true, type: [dateTimeSchema2] },
9107
9251
  inviterId: {
9108
9252
  ref: "Event",
9109
9253
  required: true,
9110
- type: mongoose15.Schema.Types.ObjectId
9254
+ type: mongoose16.Schema.Types.ObjectId
9111
9255
  }
9112
9256
  },
9113
9257
  { _id: false }
9114
9258
  );
9115
- var schema11 = new MongooseSchema15(
9259
+ var schema12 = new MongooseSchema16(
9116
9260
  {
9117
9261
  active: { default: true, required: true, type: Boolean },
9118
9262
  categoryIds: { required: true, type: [String] },
@@ -9121,7 +9265,7 @@ var schema11 = new MongooseSchema15(
9121
9265
  claimedByUserId: {
9122
9266
  ref: "User",
9123
9267
  required: false,
9124
- type: mongoose15.Schema.Types.ObjectId
9268
+ type: mongoose16.Schema.Types.ObjectId
9125
9269
  },
9126
9270
  claimInitiatedAt: { default: null, required: false, type: Date },
9127
9271
  claimToken: { default: null, required: false, type: String },
@@ -9134,14 +9278,14 @@ var schema11 = new MongooseSchema15(
9134
9278
  },
9135
9279
  { timestamps: true }
9136
9280
  );
9137
- schema11.index({ name: 1 });
9138
- schema11.index({ email: 1 });
9139
- var UnregisteredVendorModel = mongoose15.models.UnregisteredVendor || mongoose15.model("UnregisteredVendor", schema11);
9281
+ schema12.index({ name: 1 });
9282
+ schema12.index({ email: 1 });
9283
+ var UnregisteredVendorModel = mongoose16.models.UnregisteredVendor || mongoose16.model("UnregisteredVendor", schema12);
9140
9284
 
9141
9285
  // src/mongoose/event/Event.ts
9142
- import mongoose16 from "mongoose";
9143
- var MongooseSchema16 = mongoose16.Schema;
9144
- var schema12 = new MongooseSchema16(
9286
+ import mongoose17 from "mongoose";
9287
+ var MongooseSchema17 = mongoose17.Schema;
9288
+ var schema13 = new MongooseSchema17(
9145
9289
  {
9146
9290
  ...baseResourceFields,
9147
9291
  // Importing base resource fields from global.ts
@@ -9150,7 +9294,7 @@ var schema12 = new MongooseSchema16(
9150
9294
  eventInfoId: {
9151
9295
  ref: "EventInfo",
9152
9296
  required: false,
9153
- type: mongoose16.Schema.Types.ObjectId
9297
+ type: mongoose17.Schema.Types.ObjectId
9154
9298
  },
9155
9299
  eventType: {
9156
9300
  enum: Object.values(EnumEventType),
@@ -9179,20 +9323,20 @@ var schema12 = new MongooseSchema16(
9179
9323
  },
9180
9324
  { timestamps: true }
9181
9325
  );
9182
- schema12.index({ name: 1 });
9183
- schema12.index({ description: 1 });
9184
- schema12.index({ region: 1 });
9185
- schema12.index({ "location.geo": "2dsphere" });
9186
- schema12.index({ tags: 1 });
9187
- schema12.index({ deletedAt: 1 });
9188
- schema12.index({ "dateTime.dateStatus": 1 });
9189
- schema12.index({ slug: 1 });
9190
- var EventModel = mongoose16.models.Event || mongoose16.model("Event", schema12);
9326
+ schema13.index({ name: 1 });
9327
+ schema13.index({ description: 1 });
9328
+ schema13.index({ region: 1 });
9329
+ schema13.index({ "location.geo": "2dsphere" });
9330
+ schema13.index({ tags: 1 });
9331
+ schema13.index({ deletedAt: 1 });
9332
+ schema13.index({ "dateTime.dateStatus": 1 });
9333
+ schema13.index({ slug: 1 });
9334
+ var EventModel = mongoose17.models.Event || mongoose17.model("Event", schema13);
9191
9335
 
9192
9336
  // src/mongoose/Partner.ts
9193
- import mongoose17 from "mongoose";
9194
- var MongooseSchema17 = mongoose17.Schema;
9195
- var schema13 = new MongooseSchema17(
9337
+ import mongoose18 from "mongoose";
9338
+ var MongooseSchema18 = mongoose18.Schema;
9339
+ var schema14 = new MongooseSchema18(
9196
9340
  {
9197
9341
  ...baseResourceFields,
9198
9342
  location: {
@@ -9208,17 +9352,17 @@ var schema13 = new MongooseSchema17(
9208
9352
  },
9209
9353
  { timestamps: true }
9210
9354
  );
9211
- schema13.index({ name: 1 });
9212
- schema13.index({ description: 1 });
9213
- schema13.index({ region: 1 });
9214
- schema13.index({ "location.geo": "2dsphere" });
9215
- schema13.index({ slug: 1 });
9216
- var PartnerModel = mongoose17.models.Partner || mongoose17.model("Partner", schema13);
9355
+ schema14.index({ name: 1 });
9356
+ schema14.index({ description: 1 });
9357
+ schema14.index({ region: 1 });
9358
+ schema14.index({ "location.geo": "2dsphere" });
9359
+ schema14.index({ slug: 1 });
9360
+ var PartnerModel = mongoose18.models.Partner || mongoose18.model("Partner", schema14);
9217
9361
 
9218
9362
  // src/mongoose/Post.ts
9219
- import mongoose18, { Schema } from "mongoose";
9220
- var MongooseSchema18 = mongoose18.Schema;
9221
- var contentSchema = new MongooseSchema18(
9363
+ import mongoose19, { Schema } from "mongoose";
9364
+ var MongooseSchema19 = mongoose19.Schema;
9365
+ var contentSchema = new MongooseSchema19(
9222
9366
  {
9223
9367
  contentData: Schema.Types.Mixed,
9224
9368
  contentOrder: { required: true, type: Number },
@@ -9230,7 +9374,7 @@ var contentSchema = new MongooseSchema18(
9230
9374
  },
9231
9375
  { _id: false }
9232
9376
  );
9233
- var resourceSchema = new MongooseSchema18(
9377
+ var resourceSchema = new MongooseSchema19(
9234
9378
  {
9235
9379
  resourceId: { required: true, type: String },
9236
9380
  resourceRegion: { required: true, type: String },
@@ -9243,7 +9387,7 @@ var resourceSchema = new MongooseSchema18(
9243
9387
  },
9244
9388
  { _id: false }
9245
9389
  );
9246
- var schema14 = new MongooseSchema18(
9390
+ var schema15 = new MongooseSchema19(
9247
9391
  {
9248
9392
  active: { default: false, required: true, type: Boolean },
9249
9393
  approvedAt: { default: null, required: false, type: Date },
@@ -9274,16 +9418,16 @@ var schema14 = new MongooseSchema18(
9274
9418
  },
9275
9419
  { timestamps: true }
9276
9420
  );
9277
- schema14.index({ title: 1 });
9278
- schema14.index({ tags: 1 });
9279
- schema14.index({ postType: 1, slug: 1 }, { unique: true });
9280
- var PostModel = mongoose18.models.Post || mongoose18.model("Post", schema14);
9421
+ schema15.index({ title: 1 });
9422
+ schema15.index({ tags: 1 });
9423
+ schema15.index({ postType: 1, slug: 1 }, { unique: true });
9424
+ var PostModel = mongoose19.models.Post || mongoose19.model("Post", schema15);
9281
9425
 
9282
9426
  // src/mongoose/AppSetting.ts
9283
- import mongoose19 from "mongoose";
9284
- var MongooseSchema19 = mongoose19.Schema;
9427
+ import mongoose20 from "mongoose";
9428
+ var MongooseSchema20 = mongoose20.Schema;
9285
9429
  var APP_SETTINGS_ID = "APP_SETTINGS_DOCUMENT_ID";
9286
- var AppSettingSchema = new MongooseSchema19(
9430
+ var AppSettingSchema = new MongooseSchema20(
9287
9431
  {
9288
9432
  activeSchoolsStudentCountTotal: {
9289
9433
  default: 0,
@@ -9314,18 +9458,18 @@ var AppSettingSchema = new MongooseSchema19(
9314
9458
  },
9315
9459
  { timestamps: true }
9316
9460
  );
9317
- var AppSettingModel = mongoose19.models.AppSetting || mongoose19.model("AppSetting", AppSettingSchema);
9461
+ var AppSettingModel = mongoose20.models.AppSetting || mongoose20.model("AppSetting", AppSettingSchema);
9318
9462
 
9319
9463
  // src/mongoose/game/Game.ts
9320
- import mongoose23 from "mongoose";
9464
+ import mongoose24 from "mongoose";
9321
9465
 
9322
9466
  // src/mongoose/game/DailyClue.ts
9323
- import mongoose21 from "mongoose";
9467
+ import mongoose22 from "mongoose";
9324
9468
 
9325
9469
  // src/mongoose/game/utils.ts
9326
- import mongoose20 from "mongoose";
9327
- var MongooseSchema20 = mongoose20.Schema;
9328
- var schemaGameDate = new MongooseSchema20(
9470
+ import mongoose21 from "mongoose";
9471
+ var MongooseSchema21 = mongoose21.Schema;
9472
+ var schemaGameDate = new MongooseSchema21(
9329
9473
  {
9330
9474
  endDate: { required: true, type: Date },
9331
9475
  startDate: { required: true, type: Date }
@@ -9334,8 +9478,8 @@ var schemaGameDate = new MongooseSchema20(
9334
9478
  );
9335
9479
 
9336
9480
  // src/mongoose/game/DailyClue.ts
9337
- var MongooseSchema21 = mongoose21.Schema;
9338
- var schemaLetters = new MongooseSchema21(
9481
+ var MongooseSchema22 = mongoose22.Schema;
9482
+ var schemaLetters = new MongooseSchema22(
9339
9483
  {
9340
9484
  collected: { required: false, type: [String] },
9341
9485
  solutionShuffled: { required: true, type: [String] }
@@ -9343,14 +9487,14 @@ var schemaLetters = new MongooseSchema21(
9343
9487
  },
9344
9488
  { _id: false }
9345
9489
  );
9346
- var schemaDailyClueBaseGame = new MongooseSchema21(
9490
+ var schemaDailyClueBaseGame = new MongooseSchema22(
9347
9491
  {
9348
9492
  gameDate: { required: true, type: schemaGameDate },
9349
9493
  gameSolution: { required: true, type: String }
9350
9494
  },
9351
9495
  { _id: false }
9352
9496
  );
9353
- var schemaDailyClueGameData = new MongooseSchema21(
9497
+ var schemaDailyClueGameData = new MongooseSchema22(
9354
9498
  {
9355
9499
  gameFields: { required: true, type: schemaDailyClueBaseGame },
9356
9500
  lastFoundDate: { default: null, required: false, type: Date },
@@ -9365,9 +9509,9 @@ var schemaDailyClueGameData = new MongooseSchema21(
9365
9509
  );
9366
9510
 
9367
9511
  // src/mongoose/game/PuzzleGame.ts
9368
- import mongoose22 from "mongoose";
9369
- var MongooseSchema22 = mongoose22.Schema;
9370
- var schemaPuzzleAnswer = new MongooseSchema22(
9512
+ import mongoose23 from "mongoose";
9513
+ var MongooseSchema23 = mongoose23.Schema;
9514
+ var schemaPuzzleAnswer = new MongooseSchema23(
9371
9515
  {
9372
9516
  answer: { required: true, type: String },
9373
9517
  answerId: { required: true, type: String },
@@ -9375,7 +9519,7 @@ var schemaPuzzleAnswer = new MongooseSchema22(
9375
9519
  },
9376
9520
  { _id: false }
9377
9521
  );
9378
- var schemaPuzzleQuestion = new MongooseSchema22(
9522
+ var schemaPuzzleQuestion = new MongooseSchema23(
9379
9523
  {
9380
9524
  answers: { required: true, type: [schemaPuzzleAnswer] },
9381
9525
  question: { required: true, type: String },
@@ -9383,20 +9527,20 @@ var schemaPuzzleQuestion = new MongooseSchema22(
9383
9527
  },
9384
9528
  { _id: false }
9385
9529
  );
9386
- var schemaPuzzleBaseGame = new MongooseSchema22(
9530
+ var schemaPuzzleBaseGame = new MongooseSchema23(
9387
9531
  {
9388
9532
  questions: { required: true, type: [schemaPuzzleQuestion] }
9389
9533
  },
9390
9534
  { _id: false }
9391
9535
  );
9392
- var schemaPuzzleAnsweredQuestion = new MongooseSchema22(
9536
+ var schemaPuzzleAnsweredQuestion = new MongooseSchema23(
9393
9537
  {
9394
9538
  questionId: { required: true, type: String },
9395
9539
  selectedAnswerId: { required: true, type: String }
9396
9540
  },
9397
9541
  { _id: false }
9398
9542
  );
9399
- var schemaPuzzleGameData = new MongooseSchema22(
9543
+ var schemaPuzzleGameData = new MongooseSchema23(
9400
9544
  {
9401
9545
  answeredQuestions: {
9402
9546
  default: null,
@@ -9411,7 +9555,7 @@ var schemaPuzzleGameData = new MongooseSchema22(
9411
9555
  );
9412
9556
 
9413
9557
  // src/mongoose/game/Game.ts
9414
- var MongooseSchema23 = mongoose23.Schema;
9558
+ var MongooseSchema24 = mongoose24.Schema;
9415
9559
  var gameDataSchemas = {
9416
9560
  [EnumGameType.DAILY_CLUE]: schemaDailyClueGameData,
9417
9561
  [EnumGameType.MINI_QUIZ]: schemaPuzzleGameData,
@@ -9423,7 +9567,7 @@ var gameDataDefinition = Object.fromEntries(
9423
9567
  { default: null, required: false, type: schema19 }
9424
9568
  ])
9425
9569
  );
9426
- var gameHistorySchema = new MongooseSchema23(
9570
+ var gameHistorySchema = new MongooseSchema24(
9427
9571
  {
9428
9572
  createdAt: { required: true, type: Date },
9429
9573
  gameDate: { required: true, type: schemaGameDate },
@@ -9443,7 +9587,7 @@ var gameHistorySchema = new MongooseSchema23(
9443
9587
  },
9444
9588
  { _id: false }
9445
9589
  );
9446
- var gameTypeSchema = new MongooseSchema23(
9590
+ var gameTypeSchema = new MongooseSchema24(
9447
9591
  {
9448
9592
  active: { default: true, required: true, type: Boolean },
9449
9593
  gameData: gameDataDefinition,
@@ -9458,7 +9602,7 @@ var gameTypeSchema = new MongooseSchema23(
9458
9602
  },
9459
9603
  { timestamps: true }
9460
9604
  );
9461
- var schema15 = new MongooseSchema23(
9605
+ var schema16 = new MongooseSchema24(
9462
9606
  {
9463
9607
  active: { default: false, required: true, type: Boolean },
9464
9608
  deletedAt: { default: null, required: false, type: Date },
@@ -9471,12 +9615,12 @@ var schema15 = new MongooseSchema23(
9471
9615
  },
9472
9616
  { timestamps: true }
9473
9617
  );
9474
- var GameModel = mongoose23.models.Game || mongoose23.model("Game", schema15);
9618
+ var GameModel = mongoose24.models.Game || mongoose24.model("Game", schema16);
9475
9619
 
9476
9620
  // src/mongoose/School.ts
9477
- import mongoose24 from "mongoose";
9478
- var MongooseSchema24 = mongoose24.Schema;
9479
- var campaignsSchema = new MongooseSchema24(
9621
+ import mongoose25 from "mongoose";
9622
+ var MongooseSchema25 = mongoose25.Schema;
9623
+ var campaignsSchema = new MongooseSchema25(
9480
9624
  {
9481
9625
  endDate: { required: true, type: Date },
9482
9626
  name: { required: true, type: String },
@@ -9484,7 +9628,7 @@ var campaignsSchema = new MongooseSchema24(
9484
9628
  },
9485
9629
  { _id: false }
9486
9630
  );
9487
- var schema16 = new MongooseSchema24(
9631
+ var schema17 = new MongooseSchema25(
9488
9632
  {
9489
9633
  // New schools are active by default
9490
9634
  active: { default: false, required: true, type: Boolean },
@@ -9511,19 +9655,19 @@ var schema16 = new MongooseSchema24(
9511
9655
  },
9512
9656
  { timestamps: true }
9513
9657
  );
9514
- schema16.index(
9658
+ schema17.index(
9515
9659
  { schoolCode: 1 },
9516
9660
  {
9517
9661
  partialFilterExpression: { active: true, deletedAt: null },
9518
9662
  unique: true
9519
9663
  }
9520
9664
  );
9521
- var SchoolModel = mongoose24.models.School || mongoose24.model("School", schema16);
9665
+ var SchoolModel = mongoose25.models.School || mongoose25.model("School", schema17);
9522
9666
 
9523
9667
  // src/mongoose/Affiliate.ts
9524
- import mongoose25 from "mongoose";
9525
- var MongooseSchema25 = mongoose25.Schema;
9526
- var affiliateRewardSchema = new MongooseSchema25(
9668
+ import mongoose26 from "mongoose";
9669
+ var MongooseSchema26 = mongoose26.Schema;
9670
+ var affiliateRewardSchema = new MongooseSchema26(
9527
9671
  {
9528
9672
  createdAt: { required: true, type: Date },
9529
9673
  redeemedAt: { default: null, required: false, type: Date },
@@ -9537,13 +9681,13 @@ var affiliateRewardSchema = new MongooseSchema25(
9537
9681
  },
9538
9682
  { _id: false }
9539
9683
  );
9540
- var affiliateResourceSchema = new MongooseSchema25(
9684
+ var affiliateResourceSchema = new MongooseSchema26(
9541
9685
  {
9542
9686
  resourceActive: { default: true, required: true, type: Boolean },
9543
9687
  resourceDeletedAt: { default: null, required: false, type: Date },
9544
9688
  resourceId: {
9545
9689
  required: true,
9546
- type: mongoose25.Schema.Types.ObjectId
9690
+ type: mongoose26.Schema.Types.ObjectId
9547
9691
  },
9548
9692
  resourceName: { required: true, type: String },
9549
9693
  resourceOwner: {
@@ -9563,20 +9707,20 @@ var affiliateResourceSchema = new MongooseSchema25(
9563
9707
  },
9564
9708
  { _id: false }
9565
9709
  );
9566
- var affiliateContactDetailsSchema = new MongooseSchema25(
9710
+ var affiliateContactDetailsSchema = new MongooseSchema26(
9567
9711
  {
9568
9712
  mobilePhone: { required: true, type: String }
9569
9713
  },
9570
9714
  { _id: false }
9571
9715
  );
9572
- var affiliateBankAccountDetailsSchema = new MongooseSchema25(
9716
+ var affiliateBankAccountDetailsSchema = new MongooseSchema26(
9573
9717
  {
9574
9718
  accountHolderName: { required: true, type: String },
9575
9719
  accountNumber: { required: true, type: String }
9576
9720
  },
9577
9721
  { _id: false }
9578
9722
  );
9579
- var affiliateDetailsSchema = new MongooseSchema25(
9723
+ var affiliateDetailsSchema = new MongooseSchema26(
9580
9724
  {
9581
9725
  bankAccountDetails: {
9582
9726
  required: true,
@@ -9598,7 +9742,7 @@ var affiliateDetailsSchema = new MongooseSchema25(
9598
9742
  },
9599
9743
  { _id: false }
9600
9744
  );
9601
- var redeemHistorySchema = new MongooseSchema25(
9745
+ var redeemHistorySchema = new MongooseSchema26(
9602
9746
  {
9603
9747
  paidAt: { default: null, required: false, type: Date },
9604
9748
  redeemedAt: { required: true, type: Date },
@@ -9606,7 +9750,7 @@ var redeemHistorySchema = new MongooseSchema25(
9606
9750
  },
9607
9751
  { _id: false }
9608
9752
  );
9609
- var schema17 = new MongooseSchema25(
9753
+ var schema18 = new MongooseSchema26(
9610
9754
  {
9611
9755
  active: { default: false, required: true, type: Boolean },
9612
9756
  affiliateBonusRewards: {
@@ -9636,71 +9780,14 @@ var schema17 = new MongooseSchema25(
9636
9780
  },
9637
9781
  { timestamps: true }
9638
9782
  );
9639
- schema17.index(
9783
+ schema18.index(
9640
9784
  { affiliateCode: 1 },
9641
9785
  {
9642
9786
  partialFilterExpression: { active: true, deletedAt: null },
9643
9787
  unique: true
9644
9788
  }
9645
9789
  );
9646
- var AffiliateModel = mongoose25.models.Affiliate || mongoose25.model("Affiliate", schema17);
9647
-
9648
- // src/mongoose/Coupon.ts
9649
- import mongoose26 from "mongoose";
9650
- var MongooseSchema26 = mongoose26.Schema;
9651
- var couponOptionSchema = new MongooseSchema26(
9652
- {
9653
- buy: { required: true, type: Number },
9654
- get: { required: true, type: Number },
9655
- unit: { required: true, type: String }
9656
- },
9657
- { _id: false }
9658
- );
9659
- var couponCodeSchema = new MongooseSchema26(
9660
- {
9661
- code: { required: true, type: String },
9662
- qrCode: { required: true, type: ResourceImageTypeSchema }
9663
- },
9664
- { _id: false }
9665
- );
9666
- var couponParticipantUserSchema = new MongooseSchema26(
9667
- {
9668
- couponCount: { default: 0, required: true, type: Number },
9669
- couponRedeemedAt: { default: null, required: false, type: Date },
9670
- userId: {
9671
- ref: "User",
9672
- required: true,
9673
- type: mongoose26.Schema.Types.ObjectId
9674
- }
9675
- },
9676
- { timestamps: true }
9677
- );
9678
- var productCouponSchema = new MongooseSchema26(
9679
- {
9680
- active: { default: true, required: true, type: Boolean },
9681
- couponCode: { required: true, type: couponCodeSchema },
9682
- couponDescription: { required: true, type: String },
9683
- couponOption: { required: true, type: couponOptionSchema },
9684
- endDate: { required: true, type: Date },
9685
- participantProduct: { required: true, type: vendorProductTypeSchema },
9686
- participantUsers: {
9687
- default: null,
9688
- required: false,
9689
- type: [couponParticipantUserSchema]
9690
- },
9691
- startDate: { required: true, type: Date }
9692
- },
9693
- { timestamps: true }
9694
- );
9695
- var schema18 = new MongooseSchema26(
9696
- {
9697
- active: { default: true, required: true, type: Boolean },
9698
- deletedAt: { default: null, required: false, type: Date },
9699
- productCoupons: { required: false, type: [productCouponSchema] }
9700
- },
9701
- { timestamps: true }
9702
- );
9703
- var CouponModel = mongoose26.models.Coupon || mongoose26.model("Coupon", schema18);
9790
+ var AffiliateModel = mongoose26.models.Affiliate || mongoose26.model("Affiliate", schema18);
9704
9791
 
9705
9792
  export {
9706
9793
  EnumInviteStatus,
@@ -9747,6 +9834,8 @@ export {
9747
9834
  ResourceActivityModel,
9748
9835
  UserModel,
9749
9836
  VerificationTokenModel,
9837
+ productCouponSchema,
9838
+ CouponModel,
9750
9839
  vendorProductTypeSchema,
9751
9840
  VendorModel,
9752
9841
  VendorInfoModel,
@@ -9758,7 +9847,6 @@ export {
9758
9847
  AppSettingModel,
9759
9848
  GameModel,
9760
9849
  SchoolModel,
9761
- AffiliateModel,
9762
- CouponModel
9850
+ AffiliateModel
9763
9851
  };
9764
- //# sourceMappingURL=chunk-7GXZS3LI.mjs.map
9852
+ //# sourceMappingURL=chunk-K4C5YKZE.mjs.map