@timardex/cluemart-server-shared 1.1.15 → 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.
- package/dist/{chunk-VS3WIV6D.mjs → chunk-K4C5YKZE.mjs} +331 -241
- package/dist/chunk-K4C5YKZE.mjs.map +1 -0
- package/dist/index.cjs +332 -241
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +28 -7
- package/dist/index.d.ts +28 -7
- package/dist/index.mjs +330 -240
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs +330 -239
- package/dist/mongoose/index.cjs.map +1 -1
- package/dist/mongoose/index.d.mts +28 -7
- package/dist/mongoose/index.d.ts +28 -7
- package/dist/mongoose/index.mjs +3 -1
- package/dist/service/index.cjs +330 -241
- package/dist/service/index.cjs.map +1 -1
- package/dist/service/index.mjs +3 -3
- package/dist/service/index.mjs.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-VS3WIV6D.mjs.map +0 -1
|
@@ -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,6 +5512,9 @@ 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
5520
|
name
|
|
@@ -5411,6 +5523,7 @@ var VENDOR_PRODUCT_LIST_FIELDS_FRAGMENT = gql`
|
|
|
5411
5523
|
productGroups
|
|
5412
5524
|
updatedAt
|
|
5413
5525
|
}
|
|
5526
|
+
${PRODUCT_COUPON_FIELDS_FRAGMENT}
|
|
5414
5527
|
`;
|
|
5415
5528
|
var VENDOR = gql`
|
|
5416
5529
|
fragment VendorFields on VendorType {
|
|
@@ -7712,79 +7825,6 @@ var ASSIGN_AFFILIATE_BONUS_REWARD_MUTATION = gql`
|
|
|
7712
7825
|
}
|
|
7713
7826
|
${AFFILIATE_FIELDS_FRAGMENT}
|
|
7714
7827
|
`;
|
|
7715
|
-
var COUPON_CODE_FIELDS_FRAGMENT = gql`
|
|
7716
|
-
fragment CouponCodeFields on CouponCodeType {
|
|
7717
|
-
code
|
|
7718
|
-
qrCode {
|
|
7719
|
-
...ResourceImageFields
|
|
7720
|
-
}
|
|
7721
|
-
}
|
|
7722
|
-
${RESOURCE_IMAGE_FIELDS_FRAGMENT}
|
|
7723
|
-
`;
|
|
7724
|
-
var COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT = gql`
|
|
7725
|
-
fragment CouponParticipantUserFields on CouponParticipantUserType {
|
|
7726
|
-
couponCount
|
|
7727
|
-
couponRedeemedAt
|
|
7728
|
-
createdAt
|
|
7729
|
-
updatedAt
|
|
7730
|
-
userId
|
|
7731
|
-
}
|
|
7732
|
-
`;
|
|
7733
|
-
var PRODUCT_COUPON_FIELDS_FRAGMENT = gql`
|
|
7734
|
-
fragment ProductCouponFields on ProductCouponType {
|
|
7735
|
-
_id
|
|
7736
|
-
active
|
|
7737
|
-
couponCode {
|
|
7738
|
-
...CouponCodeFields
|
|
7739
|
-
}
|
|
7740
|
-
couponDescription
|
|
7741
|
-
couponOption
|
|
7742
|
-
createdAt
|
|
7743
|
-
endDate
|
|
7744
|
-
participantProduct {
|
|
7745
|
-
...VendorProductListFields
|
|
7746
|
-
}
|
|
7747
|
-
participantUsers {
|
|
7748
|
-
...CouponParticipantUserFields
|
|
7749
|
-
}
|
|
7750
|
-
startDate
|
|
7751
|
-
updatedAt
|
|
7752
|
-
}
|
|
7753
|
-
${COUPON_CODE_FIELDS_FRAGMENT}
|
|
7754
|
-
${COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT}
|
|
7755
|
-
${VENDOR_PRODUCT_LIST_FIELDS_FRAGMENT}
|
|
7756
|
-
`;
|
|
7757
|
-
var COUPON = gql`
|
|
7758
|
-
fragment CouponFields on CouponType {
|
|
7759
|
-
_id
|
|
7760
|
-
active
|
|
7761
|
-
productCoupons {
|
|
7762
|
-
...ProductCouponFields
|
|
7763
|
-
}
|
|
7764
|
-
createdAt
|
|
7765
|
-
deletedAt
|
|
7766
|
-
updatedAt
|
|
7767
|
-
}
|
|
7768
|
-
${PRODUCT_COUPON_FIELDS_FRAGMENT}
|
|
7769
|
-
${COUPON_CODE_FIELDS_FRAGMENT}
|
|
7770
|
-
${COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT}
|
|
7771
|
-
`;
|
|
7772
|
-
var GET_COUPONS = gql`
|
|
7773
|
-
query getCoupons {
|
|
7774
|
-
coupons {
|
|
7775
|
-
...CouponFields
|
|
7776
|
-
}
|
|
7777
|
-
}
|
|
7778
|
-
${COUPON}
|
|
7779
|
-
`;
|
|
7780
|
-
var GET_COUPON = gql`
|
|
7781
|
-
query getCoupon($_id: ID!) {
|
|
7782
|
-
coupon(_id: $_id) {
|
|
7783
|
-
...CouponFields
|
|
7784
|
-
}
|
|
7785
|
-
}
|
|
7786
|
-
${COUPON}
|
|
7787
|
-
`;
|
|
7788
7828
|
var CREATE_COUPON_MUTATION = gql`
|
|
7789
7829
|
mutation createCoupon($input: CouponInputType!) {
|
|
7790
7830
|
createCoupon(input: $input) {
|
|
@@ -8484,7 +8524,7 @@ var baseResourceFields = {
|
|
|
8484
8524
|
logo: { required: false, type: ResourceImageTypeSchema },
|
|
8485
8525
|
name: { required: true, type: String },
|
|
8486
8526
|
owner: {
|
|
8487
|
-
required:
|
|
8527
|
+
required: true,
|
|
8488
8528
|
type: OwnerTypeSchema
|
|
8489
8529
|
},
|
|
8490
8530
|
posterUsage: { required: false, type: PosterUsageTypeSchema },
|
|
@@ -8949,26 +8989,132 @@ var schema8 = new MongooseSchema12(
|
|
|
8949
8989
|
var VerificationTokenModel = mongoose12.models.VerificationToken || mongoose12.model("VerificationToken", schema8);
|
|
8950
8990
|
|
|
8951
8991
|
// src/mongoose/vendor/Vendor.ts
|
|
8992
|
+
import mongoose14 from "mongoose";
|
|
8993
|
+
|
|
8994
|
+
// src/mongoose/Coupon.ts
|
|
8952
8995
|
import mongoose13 from "mongoose";
|
|
8953
8996
|
var MongooseSchema13 = mongoose13.Schema;
|
|
8954
|
-
var
|
|
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(
|
|
8955
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(
|
|
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 },
|
|
8956
9102
|
description: { required: false, type: String },
|
|
8957
|
-
name: { required:
|
|
8958
|
-
price: { required:
|
|
8959
|
-
priceUnit: { required:
|
|
9103
|
+
name: { required: true, type: String },
|
|
9104
|
+
price: { required: true, type: Number },
|
|
9105
|
+
priceUnit: { required: true, type: String },
|
|
8960
9106
|
productGroups: { required: false, type: [String] }
|
|
8961
9107
|
},
|
|
8962
9108
|
{ timestamps: true }
|
|
8963
9109
|
);
|
|
8964
|
-
var productWrapperSchema = new
|
|
9110
|
+
var productWrapperSchema = new MongooseSchema14(
|
|
8965
9111
|
{
|
|
8966
|
-
active: { default: false, type: Boolean },
|
|
9112
|
+
active: { default: false, required: true, type: Boolean },
|
|
8967
9113
|
productsList: { required: false, type: [vendorProductTypeSchema] }
|
|
8968
9114
|
},
|
|
8969
9115
|
{ _id: false }
|
|
8970
9116
|
);
|
|
8971
|
-
var calendarSchema = new
|
|
9117
|
+
var calendarSchema = new MongooseSchema14(
|
|
8972
9118
|
{
|
|
8973
9119
|
dateTime: {
|
|
8974
9120
|
dateStatus: {
|
|
@@ -8989,14 +9135,14 @@ var calendarSchema = new MongooseSchema13(
|
|
|
8989
9135
|
},
|
|
8990
9136
|
{ _id: false }
|
|
8991
9137
|
);
|
|
8992
|
-
var calendarWrapperSchema = new
|
|
9138
|
+
var calendarWrapperSchema = new MongooseSchema14(
|
|
8993
9139
|
{
|
|
8994
|
-
active: { default: false, type: Boolean },
|
|
9140
|
+
active: { default: false, required: true, type: Boolean },
|
|
8995
9141
|
calendarData: { required: false, type: [calendarSchema] }
|
|
8996
9142
|
},
|
|
8997
9143
|
{ _id: false }
|
|
8998
9144
|
);
|
|
8999
|
-
var
|
|
9145
|
+
var schema10 = new MongooseSchema14(
|
|
9000
9146
|
{
|
|
9001
9147
|
...baseResourceFields,
|
|
9002
9148
|
// Importing base resource fields from global.ts
|
|
@@ -9022,12 +9168,12 @@ var schema9 = new MongooseSchema13(
|
|
|
9022
9168
|
unregisteredVendorId: {
|
|
9023
9169
|
ref: "UnregisteredVendor",
|
|
9024
9170
|
required: false,
|
|
9025
|
-
type:
|
|
9171
|
+
type: mongoose14.Schema.Types.ObjectId
|
|
9026
9172
|
},
|
|
9027
9173
|
vendorInfoId: {
|
|
9028
9174
|
ref: "VendorInfo",
|
|
9029
9175
|
required: false,
|
|
9030
|
-
type:
|
|
9176
|
+
type: mongoose14.Schema.Types.ObjectId
|
|
9031
9177
|
},
|
|
9032
9178
|
vendorType: {
|
|
9033
9179
|
enum: Object.values(EnumVendorType),
|
|
@@ -9037,24 +9183,24 @@ var schema9 = new MongooseSchema13(
|
|
|
9037
9183
|
},
|
|
9038
9184
|
{ timestamps: true }
|
|
9039
9185
|
);
|
|
9040
|
-
|
|
9041
|
-
|
|
9042
|
-
|
|
9043
|
-
|
|
9044
|
-
|
|
9045
|
-
var VendorModel =
|
|
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);
|
|
9046
9192
|
|
|
9047
9193
|
// src/mongoose/vendor/VendorInfo.ts
|
|
9048
|
-
import
|
|
9049
|
-
var
|
|
9050
|
-
var AttributesSchema = new
|
|
9194
|
+
import mongoose15 from "mongoose";
|
|
9195
|
+
var MongooseSchema15 = mongoose15.Schema;
|
|
9196
|
+
var AttributesSchema = new MongooseSchema15(
|
|
9051
9197
|
{
|
|
9052
9198
|
details: { required: false, type: String },
|
|
9053
9199
|
isRequired: { default: false, required: true, type: Boolean }
|
|
9054
9200
|
},
|
|
9055
9201
|
{ _id: false }
|
|
9056
9202
|
);
|
|
9057
|
-
var
|
|
9203
|
+
var schema11 = new MongooseSchema15(
|
|
9058
9204
|
{
|
|
9059
9205
|
active: { default: true, type: Boolean },
|
|
9060
9206
|
compliance: {
|
|
@@ -9089,28 +9235,28 @@ var schema10 = new MongooseSchema14(
|
|
|
9089
9235
|
vendorId: {
|
|
9090
9236
|
ref: "Vendor",
|
|
9091
9237
|
required: true,
|
|
9092
|
-
type:
|
|
9238
|
+
type: mongoose15.Schema.Types.ObjectId
|
|
9093
9239
|
}
|
|
9094
9240
|
},
|
|
9095
9241
|
{ timestamps: true }
|
|
9096
9242
|
);
|
|
9097
|
-
var VendorInfoModel =
|
|
9243
|
+
var VendorInfoModel = mongoose15.models.VendorInfo || mongoose15.model("VendorInfo", schema11);
|
|
9098
9244
|
|
|
9099
9245
|
// src/mongoose/vendor/UnregisteredVendor.ts
|
|
9100
|
-
import
|
|
9101
|
-
var
|
|
9102
|
-
var invitationSchema = new
|
|
9246
|
+
import mongoose16 from "mongoose";
|
|
9247
|
+
var MongooseSchema16 = mongoose16.Schema;
|
|
9248
|
+
var invitationSchema = new MongooseSchema16(
|
|
9103
9249
|
{
|
|
9104
9250
|
dateTime: { required: true, type: [dateTimeSchema2] },
|
|
9105
9251
|
inviterId: {
|
|
9106
9252
|
ref: "Event",
|
|
9107
9253
|
required: true,
|
|
9108
|
-
type:
|
|
9254
|
+
type: mongoose16.Schema.Types.ObjectId
|
|
9109
9255
|
}
|
|
9110
9256
|
},
|
|
9111
9257
|
{ _id: false }
|
|
9112
9258
|
);
|
|
9113
|
-
var
|
|
9259
|
+
var schema12 = new MongooseSchema16(
|
|
9114
9260
|
{
|
|
9115
9261
|
active: { default: true, required: true, type: Boolean },
|
|
9116
9262
|
categoryIds: { required: true, type: [String] },
|
|
@@ -9119,7 +9265,7 @@ var schema11 = new MongooseSchema15(
|
|
|
9119
9265
|
claimedByUserId: {
|
|
9120
9266
|
ref: "User",
|
|
9121
9267
|
required: false,
|
|
9122
|
-
type:
|
|
9268
|
+
type: mongoose16.Schema.Types.ObjectId
|
|
9123
9269
|
},
|
|
9124
9270
|
claimInitiatedAt: { default: null, required: false, type: Date },
|
|
9125
9271
|
claimToken: { default: null, required: false, type: String },
|
|
@@ -9132,14 +9278,14 @@ var schema11 = new MongooseSchema15(
|
|
|
9132
9278
|
},
|
|
9133
9279
|
{ timestamps: true }
|
|
9134
9280
|
);
|
|
9135
|
-
|
|
9136
|
-
|
|
9137
|
-
var UnregisteredVendorModel =
|
|
9281
|
+
schema12.index({ name: 1 });
|
|
9282
|
+
schema12.index({ email: 1 });
|
|
9283
|
+
var UnregisteredVendorModel = mongoose16.models.UnregisteredVendor || mongoose16.model("UnregisteredVendor", schema12);
|
|
9138
9284
|
|
|
9139
9285
|
// src/mongoose/event/Event.ts
|
|
9140
|
-
import
|
|
9141
|
-
var
|
|
9142
|
-
var
|
|
9286
|
+
import mongoose17 from "mongoose";
|
|
9287
|
+
var MongooseSchema17 = mongoose17.Schema;
|
|
9288
|
+
var schema13 = new MongooseSchema17(
|
|
9143
9289
|
{
|
|
9144
9290
|
...baseResourceFields,
|
|
9145
9291
|
// Importing base resource fields from global.ts
|
|
@@ -9148,7 +9294,7 @@ var schema12 = new MongooseSchema16(
|
|
|
9148
9294
|
eventInfoId: {
|
|
9149
9295
|
ref: "EventInfo",
|
|
9150
9296
|
required: false,
|
|
9151
|
-
type:
|
|
9297
|
+
type: mongoose17.Schema.Types.ObjectId
|
|
9152
9298
|
},
|
|
9153
9299
|
eventType: {
|
|
9154
9300
|
enum: Object.values(EnumEventType),
|
|
@@ -9177,20 +9323,20 @@ var schema12 = new MongooseSchema16(
|
|
|
9177
9323
|
},
|
|
9178
9324
|
{ timestamps: true }
|
|
9179
9325
|
);
|
|
9180
|
-
|
|
9181
|
-
|
|
9182
|
-
|
|
9183
|
-
|
|
9184
|
-
|
|
9185
|
-
|
|
9186
|
-
|
|
9187
|
-
|
|
9188
|
-
var EventModel =
|
|
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);
|
|
9189
9335
|
|
|
9190
9336
|
// src/mongoose/Partner.ts
|
|
9191
|
-
import
|
|
9192
|
-
var
|
|
9193
|
-
var
|
|
9337
|
+
import mongoose18 from "mongoose";
|
|
9338
|
+
var MongooseSchema18 = mongoose18.Schema;
|
|
9339
|
+
var schema14 = new MongooseSchema18(
|
|
9194
9340
|
{
|
|
9195
9341
|
...baseResourceFields,
|
|
9196
9342
|
location: {
|
|
@@ -9206,17 +9352,17 @@ var schema13 = new MongooseSchema17(
|
|
|
9206
9352
|
},
|
|
9207
9353
|
{ timestamps: true }
|
|
9208
9354
|
);
|
|
9209
|
-
|
|
9210
|
-
|
|
9211
|
-
|
|
9212
|
-
|
|
9213
|
-
|
|
9214
|
-
var PartnerModel =
|
|
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);
|
|
9215
9361
|
|
|
9216
9362
|
// src/mongoose/Post.ts
|
|
9217
|
-
import
|
|
9218
|
-
var
|
|
9219
|
-
var contentSchema = new
|
|
9363
|
+
import mongoose19, { Schema } from "mongoose";
|
|
9364
|
+
var MongooseSchema19 = mongoose19.Schema;
|
|
9365
|
+
var contentSchema = new MongooseSchema19(
|
|
9220
9366
|
{
|
|
9221
9367
|
contentData: Schema.Types.Mixed,
|
|
9222
9368
|
contentOrder: { required: true, type: Number },
|
|
@@ -9228,7 +9374,7 @@ var contentSchema = new MongooseSchema18(
|
|
|
9228
9374
|
},
|
|
9229
9375
|
{ _id: false }
|
|
9230
9376
|
);
|
|
9231
|
-
var resourceSchema = new
|
|
9377
|
+
var resourceSchema = new MongooseSchema19(
|
|
9232
9378
|
{
|
|
9233
9379
|
resourceId: { required: true, type: String },
|
|
9234
9380
|
resourceRegion: { required: true, type: String },
|
|
@@ -9241,7 +9387,7 @@ var resourceSchema = new MongooseSchema18(
|
|
|
9241
9387
|
},
|
|
9242
9388
|
{ _id: false }
|
|
9243
9389
|
);
|
|
9244
|
-
var
|
|
9390
|
+
var schema15 = new MongooseSchema19(
|
|
9245
9391
|
{
|
|
9246
9392
|
active: { default: false, required: true, type: Boolean },
|
|
9247
9393
|
approvedAt: { default: null, required: false, type: Date },
|
|
@@ -9272,16 +9418,16 @@ var schema14 = new MongooseSchema18(
|
|
|
9272
9418
|
},
|
|
9273
9419
|
{ timestamps: true }
|
|
9274
9420
|
);
|
|
9275
|
-
|
|
9276
|
-
|
|
9277
|
-
|
|
9278
|
-
var PostModel =
|
|
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);
|
|
9279
9425
|
|
|
9280
9426
|
// src/mongoose/AppSetting.ts
|
|
9281
|
-
import
|
|
9282
|
-
var
|
|
9427
|
+
import mongoose20 from "mongoose";
|
|
9428
|
+
var MongooseSchema20 = mongoose20.Schema;
|
|
9283
9429
|
var APP_SETTINGS_ID = "APP_SETTINGS_DOCUMENT_ID";
|
|
9284
|
-
var AppSettingSchema = new
|
|
9430
|
+
var AppSettingSchema = new MongooseSchema20(
|
|
9285
9431
|
{
|
|
9286
9432
|
activeSchoolsStudentCountTotal: {
|
|
9287
9433
|
default: 0,
|
|
@@ -9312,18 +9458,18 @@ var AppSettingSchema = new MongooseSchema19(
|
|
|
9312
9458
|
},
|
|
9313
9459
|
{ timestamps: true }
|
|
9314
9460
|
);
|
|
9315
|
-
var AppSettingModel =
|
|
9461
|
+
var AppSettingModel = mongoose20.models.AppSetting || mongoose20.model("AppSetting", AppSettingSchema);
|
|
9316
9462
|
|
|
9317
9463
|
// src/mongoose/game/Game.ts
|
|
9318
|
-
import
|
|
9464
|
+
import mongoose24 from "mongoose";
|
|
9319
9465
|
|
|
9320
9466
|
// src/mongoose/game/DailyClue.ts
|
|
9321
|
-
import
|
|
9467
|
+
import mongoose22 from "mongoose";
|
|
9322
9468
|
|
|
9323
9469
|
// src/mongoose/game/utils.ts
|
|
9324
|
-
import
|
|
9325
|
-
var
|
|
9326
|
-
var schemaGameDate = new
|
|
9470
|
+
import mongoose21 from "mongoose";
|
|
9471
|
+
var MongooseSchema21 = mongoose21.Schema;
|
|
9472
|
+
var schemaGameDate = new MongooseSchema21(
|
|
9327
9473
|
{
|
|
9328
9474
|
endDate: { required: true, type: Date },
|
|
9329
9475
|
startDate: { required: true, type: Date }
|
|
@@ -9332,8 +9478,8 @@ var schemaGameDate = new MongooseSchema20(
|
|
|
9332
9478
|
);
|
|
9333
9479
|
|
|
9334
9480
|
// src/mongoose/game/DailyClue.ts
|
|
9335
|
-
var
|
|
9336
|
-
var schemaLetters = new
|
|
9481
|
+
var MongooseSchema22 = mongoose22.Schema;
|
|
9482
|
+
var schemaLetters = new MongooseSchema22(
|
|
9337
9483
|
{
|
|
9338
9484
|
collected: { required: false, type: [String] },
|
|
9339
9485
|
solutionShuffled: { required: true, type: [String] }
|
|
@@ -9341,14 +9487,14 @@ var schemaLetters = new MongooseSchema21(
|
|
|
9341
9487
|
},
|
|
9342
9488
|
{ _id: false }
|
|
9343
9489
|
);
|
|
9344
|
-
var schemaDailyClueBaseGame = new
|
|
9490
|
+
var schemaDailyClueBaseGame = new MongooseSchema22(
|
|
9345
9491
|
{
|
|
9346
9492
|
gameDate: { required: true, type: schemaGameDate },
|
|
9347
9493
|
gameSolution: { required: true, type: String }
|
|
9348
9494
|
},
|
|
9349
9495
|
{ _id: false }
|
|
9350
9496
|
);
|
|
9351
|
-
var schemaDailyClueGameData = new
|
|
9497
|
+
var schemaDailyClueGameData = new MongooseSchema22(
|
|
9352
9498
|
{
|
|
9353
9499
|
gameFields: { required: true, type: schemaDailyClueBaseGame },
|
|
9354
9500
|
lastFoundDate: { default: null, required: false, type: Date },
|
|
@@ -9363,9 +9509,9 @@ var schemaDailyClueGameData = new MongooseSchema21(
|
|
|
9363
9509
|
);
|
|
9364
9510
|
|
|
9365
9511
|
// src/mongoose/game/PuzzleGame.ts
|
|
9366
|
-
import
|
|
9367
|
-
var
|
|
9368
|
-
var schemaPuzzleAnswer = new
|
|
9512
|
+
import mongoose23 from "mongoose";
|
|
9513
|
+
var MongooseSchema23 = mongoose23.Schema;
|
|
9514
|
+
var schemaPuzzleAnswer = new MongooseSchema23(
|
|
9369
9515
|
{
|
|
9370
9516
|
answer: { required: true, type: String },
|
|
9371
9517
|
answerId: { required: true, type: String },
|
|
@@ -9373,7 +9519,7 @@ var schemaPuzzleAnswer = new MongooseSchema22(
|
|
|
9373
9519
|
},
|
|
9374
9520
|
{ _id: false }
|
|
9375
9521
|
);
|
|
9376
|
-
var schemaPuzzleQuestion = new
|
|
9522
|
+
var schemaPuzzleQuestion = new MongooseSchema23(
|
|
9377
9523
|
{
|
|
9378
9524
|
answers: { required: true, type: [schemaPuzzleAnswer] },
|
|
9379
9525
|
question: { required: true, type: String },
|
|
@@ -9381,20 +9527,20 @@ var schemaPuzzleQuestion = new MongooseSchema22(
|
|
|
9381
9527
|
},
|
|
9382
9528
|
{ _id: false }
|
|
9383
9529
|
);
|
|
9384
|
-
var schemaPuzzleBaseGame = new
|
|
9530
|
+
var schemaPuzzleBaseGame = new MongooseSchema23(
|
|
9385
9531
|
{
|
|
9386
9532
|
questions: { required: true, type: [schemaPuzzleQuestion] }
|
|
9387
9533
|
},
|
|
9388
9534
|
{ _id: false }
|
|
9389
9535
|
);
|
|
9390
|
-
var schemaPuzzleAnsweredQuestion = new
|
|
9536
|
+
var schemaPuzzleAnsweredQuestion = new MongooseSchema23(
|
|
9391
9537
|
{
|
|
9392
9538
|
questionId: { required: true, type: String },
|
|
9393
9539
|
selectedAnswerId: { required: true, type: String }
|
|
9394
9540
|
},
|
|
9395
9541
|
{ _id: false }
|
|
9396
9542
|
);
|
|
9397
|
-
var schemaPuzzleGameData = new
|
|
9543
|
+
var schemaPuzzleGameData = new MongooseSchema23(
|
|
9398
9544
|
{
|
|
9399
9545
|
answeredQuestions: {
|
|
9400
9546
|
default: null,
|
|
@@ -9409,7 +9555,7 @@ var schemaPuzzleGameData = new MongooseSchema22(
|
|
|
9409
9555
|
);
|
|
9410
9556
|
|
|
9411
9557
|
// src/mongoose/game/Game.ts
|
|
9412
|
-
var
|
|
9558
|
+
var MongooseSchema24 = mongoose24.Schema;
|
|
9413
9559
|
var gameDataSchemas = {
|
|
9414
9560
|
[EnumGameType.DAILY_CLUE]: schemaDailyClueGameData,
|
|
9415
9561
|
[EnumGameType.MINI_QUIZ]: schemaPuzzleGameData,
|
|
@@ -9421,7 +9567,7 @@ var gameDataDefinition = Object.fromEntries(
|
|
|
9421
9567
|
{ default: null, required: false, type: schema19 }
|
|
9422
9568
|
])
|
|
9423
9569
|
);
|
|
9424
|
-
var gameHistorySchema = new
|
|
9570
|
+
var gameHistorySchema = new MongooseSchema24(
|
|
9425
9571
|
{
|
|
9426
9572
|
createdAt: { required: true, type: Date },
|
|
9427
9573
|
gameDate: { required: true, type: schemaGameDate },
|
|
@@ -9441,7 +9587,7 @@ var gameHistorySchema = new MongooseSchema23(
|
|
|
9441
9587
|
},
|
|
9442
9588
|
{ _id: false }
|
|
9443
9589
|
);
|
|
9444
|
-
var gameTypeSchema = new
|
|
9590
|
+
var gameTypeSchema = new MongooseSchema24(
|
|
9445
9591
|
{
|
|
9446
9592
|
active: { default: true, required: true, type: Boolean },
|
|
9447
9593
|
gameData: gameDataDefinition,
|
|
@@ -9456,7 +9602,7 @@ var gameTypeSchema = new MongooseSchema23(
|
|
|
9456
9602
|
},
|
|
9457
9603
|
{ timestamps: true }
|
|
9458
9604
|
);
|
|
9459
|
-
var
|
|
9605
|
+
var schema16 = new MongooseSchema24(
|
|
9460
9606
|
{
|
|
9461
9607
|
active: { default: false, required: true, type: Boolean },
|
|
9462
9608
|
deletedAt: { default: null, required: false, type: Date },
|
|
@@ -9469,12 +9615,12 @@ var schema15 = new MongooseSchema23(
|
|
|
9469
9615
|
},
|
|
9470
9616
|
{ timestamps: true }
|
|
9471
9617
|
);
|
|
9472
|
-
var GameModel =
|
|
9618
|
+
var GameModel = mongoose24.models.Game || mongoose24.model("Game", schema16);
|
|
9473
9619
|
|
|
9474
9620
|
// src/mongoose/School.ts
|
|
9475
|
-
import
|
|
9476
|
-
var
|
|
9477
|
-
var campaignsSchema = new
|
|
9621
|
+
import mongoose25 from "mongoose";
|
|
9622
|
+
var MongooseSchema25 = mongoose25.Schema;
|
|
9623
|
+
var campaignsSchema = new MongooseSchema25(
|
|
9478
9624
|
{
|
|
9479
9625
|
endDate: { required: true, type: Date },
|
|
9480
9626
|
name: { required: true, type: String },
|
|
@@ -9482,7 +9628,7 @@ var campaignsSchema = new MongooseSchema24(
|
|
|
9482
9628
|
},
|
|
9483
9629
|
{ _id: false }
|
|
9484
9630
|
);
|
|
9485
|
-
var
|
|
9631
|
+
var schema17 = new MongooseSchema25(
|
|
9486
9632
|
{
|
|
9487
9633
|
// New schools are active by default
|
|
9488
9634
|
active: { default: false, required: true, type: Boolean },
|
|
@@ -9509,19 +9655,19 @@ var schema16 = new MongooseSchema24(
|
|
|
9509
9655
|
},
|
|
9510
9656
|
{ timestamps: true }
|
|
9511
9657
|
);
|
|
9512
|
-
|
|
9658
|
+
schema17.index(
|
|
9513
9659
|
{ schoolCode: 1 },
|
|
9514
9660
|
{
|
|
9515
9661
|
partialFilterExpression: { active: true, deletedAt: null },
|
|
9516
9662
|
unique: true
|
|
9517
9663
|
}
|
|
9518
9664
|
);
|
|
9519
|
-
var SchoolModel =
|
|
9665
|
+
var SchoolModel = mongoose25.models.School || mongoose25.model("School", schema17);
|
|
9520
9666
|
|
|
9521
9667
|
// src/mongoose/Affiliate.ts
|
|
9522
|
-
import
|
|
9523
|
-
var
|
|
9524
|
-
var affiliateRewardSchema = new
|
|
9668
|
+
import mongoose26 from "mongoose";
|
|
9669
|
+
var MongooseSchema26 = mongoose26.Schema;
|
|
9670
|
+
var affiliateRewardSchema = new MongooseSchema26(
|
|
9525
9671
|
{
|
|
9526
9672
|
createdAt: { required: true, type: Date },
|
|
9527
9673
|
redeemedAt: { default: null, required: false, type: Date },
|
|
@@ -9535,13 +9681,13 @@ var affiliateRewardSchema = new MongooseSchema25(
|
|
|
9535
9681
|
},
|
|
9536
9682
|
{ _id: false }
|
|
9537
9683
|
);
|
|
9538
|
-
var affiliateResourceSchema = new
|
|
9684
|
+
var affiliateResourceSchema = new MongooseSchema26(
|
|
9539
9685
|
{
|
|
9540
9686
|
resourceActive: { default: true, required: true, type: Boolean },
|
|
9541
9687
|
resourceDeletedAt: { default: null, required: false, type: Date },
|
|
9542
9688
|
resourceId: {
|
|
9543
9689
|
required: true,
|
|
9544
|
-
type:
|
|
9690
|
+
type: mongoose26.Schema.Types.ObjectId
|
|
9545
9691
|
},
|
|
9546
9692
|
resourceName: { required: true, type: String },
|
|
9547
9693
|
resourceOwner: {
|
|
@@ -9561,20 +9707,20 @@ var affiliateResourceSchema = new MongooseSchema25(
|
|
|
9561
9707
|
},
|
|
9562
9708
|
{ _id: false }
|
|
9563
9709
|
);
|
|
9564
|
-
var affiliateContactDetailsSchema = new
|
|
9710
|
+
var affiliateContactDetailsSchema = new MongooseSchema26(
|
|
9565
9711
|
{
|
|
9566
9712
|
mobilePhone: { required: true, type: String }
|
|
9567
9713
|
},
|
|
9568
9714
|
{ _id: false }
|
|
9569
9715
|
);
|
|
9570
|
-
var affiliateBankAccountDetailsSchema = new
|
|
9716
|
+
var affiliateBankAccountDetailsSchema = new MongooseSchema26(
|
|
9571
9717
|
{
|
|
9572
9718
|
accountHolderName: { required: true, type: String },
|
|
9573
9719
|
accountNumber: { required: true, type: String }
|
|
9574
9720
|
},
|
|
9575
9721
|
{ _id: false }
|
|
9576
9722
|
);
|
|
9577
|
-
var affiliateDetailsSchema = new
|
|
9723
|
+
var affiliateDetailsSchema = new MongooseSchema26(
|
|
9578
9724
|
{
|
|
9579
9725
|
bankAccountDetails: {
|
|
9580
9726
|
required: true,
|
|
@@ -9596,7 +9742,7 @@ var affiliateDetailsSchema = new MongooseSchema25(
|
|
|
9596
9742
|
},
|
|
9597
9743
|
{ _id: false }
|
|
9598
9744
|
);
|
|
9599
|
-
var redeemHistorySchema = new
|
|
9745
|
+
var redeemHistorySchema = new MongooseSchema26(
|
|
9600
9746
|
{
|
|
9601
9747
|
paidAt: { default: null, required: false, type: Date },
|
|
9602
9748
|
redeemedAt: { required: true, type: Date },
|
|
@@ -9604,7 +9750,7 @@ var redeemHistorySchema = new MongooseSchema25(
|
|
|
9604
9750
|
},
|
|
9605
9751
|
{ _id: false }
|
|
9606
9752
|
);
|
|
9607
|
-
var
|
|
9753
|
+
var schema18 = new MongooseSchema26(
|
|
9608
9754
|
{
|
|
9609
9755
|
active: { default: false, required: true, type: Boolean },
|
|
9610
9756
|
affiliateBonusRewards: {
|
|
@@ -9634,71 +9780,14 @@ var schema17 = new MongooseSchema25(
|
|
|
9634
9780
|
},
|
|
9635
9781
|
{ timestamps: true }
|
|
9636
9782
|
);
|
|
9637
|
-
|
|
9783
|
+
schema18.index(
|
|
9638
9784
|
{ affiliateCode: 1 },
|
|
9639
9785
|
{
|
|
9640
9786
|
partialFilterExpression: { active: true, deletedAt: null },
|
|
9641
9787
|
unique: true
|
|
9642
9788
|
}
|
|
9643
9789
|
);
|
|
9644
|
-
var AffiliateModel =
|
|
9645
|
-
|
|
9646
|
-
// src/mongoose/Coupon.ts
|
|
9647
|
-
import mongoose26 from "mongoose";
|
|
9648
|
-
var MongooseSchema26 = mongoose26.Schema;
|
|
9649
|
-
var couponOptionSchema = new MongooseSchema26(
|
|
9650
|
-
{
|
|
9651
|
-
buy: { required: true, type: Number },
|
|
9652
|
-
get: { required: true, type: Number },
|
|
9653
|
-
unit: { required: true, type: String }
|
|
9654
|
-
},
|
|
9655
|
-
{ _id: false }
|
|
9656
|
-
);
|
|
9657
|
-
var couponCodeSchema = new MongooseSchema26(
|
|
9658
|
-
{
|
|
9659
|
-
code: { required: true, type: String },
|
|
9660
|
-
qrCode: { required: true, type: ResourceImageTypeSchema }
|
|
9661
|
-
},
|
|
9662
|
-
{ _id: false }
|
|
9663
|
-
);
|
|
9664
|
-
var couponParticipantUserSchema = new MongooseSchema26(
|
|
9665
|
-
{
|
|
9666
|
-
couponCount: { default: 0, required: true, type: Number },
|
|
9667
|
-
couponRedeemedAt: { default: null, required: false, type: Date },
|
|
9668
|
-
userId: {
|
|
9669
|
-
ref: "User",
|
|
9670
|
-
required: true,
|
|
9671
|
-
type: mongoose26.Schema.Types.ObjectId
|
|
9672
|
-
}
|
|
9673
|
-
},
|
|
9674
|
-
{ timestamps: true }
|
|
9675
|
-
);
|
|
9676
|
-
var productCouponSchema = new MongooseSchema26(
|
|
9677
|
-
{
|
|
9678
|
-
active: { default: true, required: true, type: Boolean },
|
|
9679
|
-
couponCode: { required: true, type: couponCodeSchema },
|
|
9680
|
-
couponDescription: { required: true, type: String },
|
|
9681
|
-
couponOption: { required: true, type: couponOptionSchema },
|
|
9682
|
-
endDate: { required: true, type: Date },
|
|
9683
|
-
participantProduct: { required: true, type: vendorProductTypeSchema },
|
|
9684
|
-
participantUsers: {
|
|
9685
|
-
default: null,
|
|
9686
|
-
required: false,
|
|
9687
|
-
type: [couponParticipantUserSchema]
|
|
9688
|
-
},
|
|
9689
|
-
startDate: { required: true, type: Date }
|
|
9690
|
-
},
|
|
9691
|
-
{ timestamps: true }
|
|
9692
|
-
);
|
|
9693
|
-
var schema18 = new MongooseSchema26(
|
|
9694
|
-
{
|
|
9695
|
-
active: { default: true, required: true, type: Boolean },
|
|
9696
|
-
deletedAt: { default: null, required: false, type: Date },
|
|
9697
|
-
productCoupons: { required: false, type: [productCouponSchema] }
|
|
9698
|
-
},
|
|
9699
|
-
{ timestamps: true }
|
|
9700
|
-
);
|
|
9701
|
-
var CouponModel = mongoose26.models.Coupon || mongoose26.model("Coupon", schema18);
|
|
9790
|
+
var AffiliateModel = mongoose26.models.Affiliate || mongoose26.model("Affiliate", schema18);
|
|
9702
9791
|
|
|
9703
9792
|
export {
|
|
9704
9793
|
EnumInviteStatus,
|
|
@@ -9745,6 +9834,8 @@ export {
|
|
|
9745
9834
|
ResourceActivityModel,
|
|
9746
9835
|
UserModel,
|
|
9747
9836
|
VerificationTokenModel,
|
|
9837
|
+
productCouponSchema,
|
|
9838
|
+
CouponModel,
|
|
9748
9839
|
vendorProductTypeSchema,
|
|
9749
9840
|
VendorModel,
|
|
9750
9841
|
VendorInfoModel,
|
|
@@ -9756,7 +9847,6 @@ export {
|
|
|
9756
9847
|
AppSettingModel,
|
|
9757
9848
|
GameModel,
|
|
9758
9849
|
SchoolModel,
|
|
9759
|
-
AffiliateModel
|
|
9760
|
-
CouponModel
|
|
9850
|
+
AffiliateModel
|
|
9761
9851
|
};
|
|
9762
|
-
//# sourceMappingURL=chunk-
|
|
9852
|
+
//# sourceMappingURL=chunk-K4C5YKZE.mjs.map
|