@timardex/cluemart-server-shared 1.1.16 → 1.1.18
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-7GXZS3LI.mjs → chunk-TDAUQKK7.mjs} +333 -238
- package/dist/chunk-TDAUQKK7.mjs.map +1 -0
- package/dist/index.cjs +334 -238
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +32 -9
- package/dist/index.d.ts +32 -9
- package/dist/index.mjs +332 -237
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs +332 -236
- package/dist/mongoose/index.cjs.map +1 -1
- package/dist/mongoose/index.d.mts +32 -9
- package/dist/mongoose/index.d.ts +32 -9
- package/dist/mongoose/index.mjs +3 -1
- package/dist/service/index.cjs +332 -238
- 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-7GXZS3LI.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,15 +5512,19 @@ 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
|
|
5522
|
+
priceMax
|
|
5411
5523
|
priceUnit
|
|
5412
5524
|
productGroups
|
|
5413
5525
|
updatedAt
|
|
5414
5526
|
}
|
|
5527
|
+
${PRODUCT_COUPON_FIELDS_FRAGMENT}
|
|
5415
5528
|
`;
|
|
5416
5529
|
var VENDOR = gql`
|
|
5417
5530
|
fragment VendorFields on VendorType {
|
|
@@ -7713,79 +7826,6 @@ var ASSIGN_AFFILIATE_BONUS_REWARD_MUTATION = gql`
|
|
|
7713
7826
|
}
|
|
7714
7827
|
${AFFILIATE_FIELDS_FRAGMENT}
|
|
7715
7828
|
`;
|
|
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
7829
|
var CREATE_COUPON_MUTATION = gql`
|
|
7790
7830
|
mutation createCoupon($input: CouponInputType!) {
|
|
7791
7831
|
createCoupon(input: $input) {
|
|
@@ -8485,7 +8525,7 @@ var baseResourceFields = {
|
|
|
8485
8525
|
logo: { required: false, type: ResourceImageTypeSchema },
|
|
8486
8526
|
name: { required: true, type: String },
|
|
8487
8527
|
owner: {
|
|
8488
|
-
required:
|
|
8528
|
+
required: true,
|
|
8489
8529
|
type: OwnerTypeSchema
|
|
8490
8530
|
},
|
|
8491
8531
|
posterUsage: { required: false, type: PosterUsageTypeSchema },
|
|
@@ -8830,6 +8870,11 @@ var schema7 = new MongooseSchema11(
|
|
|
8830
8870
|
required: false,
|
|
8831
8871
|
type: ResourceImageTypeSchema
|
|
8832
8872
|
},
|
|
8873
|
+
coupon: {
|
|
8874
|
+
ref: "Coupon",
|
|
8875
|
+
required: false,
|
|
8876
|
+
type: mongoose11.Schema.Types.ObjectId
|
|
8877
|
+
},
|
|
8833
8878
|
deletedAt: { default: null, required: false, type: Date },
|
|
8834
8879
|
email: { required: true, type: String },
|
|
8835
8880
|
emailSentFor: {
|
|
@@ -8950,27 +8995,133 @@ var schema8 = new MongooseSchema12(
|
|
|
8950
8995
|
var VerificationTokenModel = mongoose12.models.VerificationToken || mongoose12.model("VerificationToken", schema8);
|
|
8951
8996
|
|
|
8952
8997
|
// src/mongoose/vendor/Vendor.ts
|
|
8998
|
+
import mongoose14 from "mongoose";
|
|
8999
|
+
|
|
9000
|
+
// src/mongoose/Coupon.ts
|
|
8953
9001
|
import mongoose13 from "mongoose";
|
|
8954
9002
|
var MongooseSchema13 = mongoose13.Schema;
|
|
8955
|
-
var
|
|
9003
|
+
var productCouponSchema = new MongooseSchema13(
|
|
9004
|
+
{
|
|
9005
|
+
couponDocumentId: {
|
|
9006
|
+
ref: "Coupon",
|
|
9007
|
+
required: true,
|
|
9008
|
+
type: mongoose13.Schema.Types.ObjectId
|
|
9009
|
+
},
|
|
9010
|
+
couponId: {
|
|
9011
|
+
required: true,
|
|
9012
|
+
type: mongoose13.Schema.Types.ObjectId
|
|
9013
|
+
}
|
|
9014
|
+
},
|
|
9015
|
+
{ _id: false }
|
|
9016
|
+
);
|
|
9017
|
+
var couponOptionSchema = new MongooseSchema13(
|
|
9018
|
+
{
|
|
9019
|
+
buy: { required: false, type: Number },
|
|
9020
|
+
get: { required: false, type: Number },
|
|
9021
|
+
type: {
|
|
9022
|
+
enum: Object.values(EnumCouponQualificationType),
|
|
9023
|
+
required: true,
|
|
9024
|
+
type: String
|
|
9025
|
+
},
|
|
9026
|
+
unit: { required: false, type: String },
|
|
9027
|
+
visits: { required: false, type: Number }
|
|
9028
|
+
},
|
|
9029
|
+
{ _id: false }
|
|
9030
|
+
);
|
|
9031
|
+
var couponRewardSchema = new MongooseSchema13(
|
|
9032
|
+
{
|
|
9033
|
+
productId: {
|
|
9034
|
+
required: true,
|
|
9035
|
+
type: mongoose13.Schema.Types.ObjectId
|
|
9036
|
+
},
|
|
9037
|
+
quantity: { required: true, type: Number },
|
|
9038
|
+
unit: { required: true, type: String },
|
|
9039
|
+
vendorId: {
|
|
9040
|
+
ref: "Vendor",
|
|
9041
|
+
required: true,
|
|
9042
|
+
type: mongoose13.Schema.Types.ObjectId
|
|
9043
|
+
}
|
|
9044
|
+
},
|
|
9045
|
+
{ _id: false }
|
|
9046
|
+
);
|
|
9047
|
+
var couponCodeSchema = new MongooseSchema13(
|
|
9048
|
+
{
|
|
9049
|
+
code: { required: true, type: String },
|
|
9050
|
+
qrCode: { required: true, type: ResourceImageTypeSchema }
|
|
9051
|
+
},
|
|
9052
|
+
{ _id: false }
|
|
9053
|
+
);
|
|
9054
|
+
var couponParticipantUserSchema = new MongooseSchema13(
|
|
9055
|
+
{
|
|
9056
|
+
couponCollectedCount: { default: 0, required: true, type: Number },
|
|
9057
|
+
couponRedeemedAt: { default: null, required: false, type: Date },
|
|
9058
|
+
userId: {
|
|
9059
|
+
ref: "User",
|
|
9060
|
+
required: true,
|
|
9061
|
+
type: mongoose13.Schema.Types.ObjectId
|
|
9062
|
+
}
|
|
9063
|
+
},
|
|
9064
|
+
{ timestamps: true }
|
|
9065
|
+
);
|
|
9066
|
+
var couponDataSchema = new MongooseSchema13(
|
|
8956
9067
|
{
|
|
9068
|
+
active: { default: true, required: true, type: Boolean },
|
|
9069
|
+
couponCode: { required: true, type: couponCodeSchema },
|
|
9070
|
+
couponDescription: { required: true, type: String },
|
|
9071
|
+
couponOption: { required: true, type: couponOptionSchema },
|
|
9072
|
+
couponRewards: { required: false, type: [couponRewardSchema] },
|
|
9073
|
+
endDate: { required: true, type: Date },
|
|
9074
|
+
participantUsers: {
|
|
9075
|
+
default: null,
|
|
9076
|
+
required: false,
|
|
9077
|
+
type: [couponParticipantUserSchema]
|
|
9078
|
+
},
|
|
9079
|
+
resourceId: { required: true, type: String },
|
|
9080
|
+
resourceType: {
|
|
9081
|
+
enum: Object.values(EnumResourceType),
|
|
9082
|
+
required: true,
|
|
9083
|
+
type: String
|
|
9084
|
+
},
|
|
9085
|
+
startDate: { required: true, type: Date }
|
|
9086
|
+
},
|
|
9087
|
+
{ timestamps: true }
|
|
9088
|
+
);
|
|
9089
|
+
var schema9 = new MongooseSchema13(
|
|
9090
|
+
{
|
|
9091
|
+
active: { default: true, required: true, type: Boolean },
|
|
9092
|
+
couponData: { default: [], required: false, type: [couponDataSchema] },
|
|
9093
|
+
deletedAt: { default: null, required: false, type: Date },
|
|
9094
|
+
owner: {
|
|
9095
|
+
required: true,
|
|
9096
|
+
type: OwnerTypeSchema
|
|
9097
|
+
}
|
|
9098
|
+
},
|
|
9099
|
+
{ timestamps: true }
|
|
9100
|
+
);
|
|
9101
|
+
var CouponModel = mongoose13.models.Coupon || mongoose13.model("Coupon", schema9);
|
|
9102
|
+
|
|
9103
|
+
// src/mongoose/vendor/Vendor.ts
|
|
9104
|
+
var MongooseSchema14 = mongoose14.Schema;
|
|
9105
|
+
var vendorProductTypeSchema = new MongooseSchema14(
|
|
9106
|
+
{
|
|
9107
|
+
coupon: { required: false, type: productCouponSchema },
|
|
8957
9108
|
description: { required: false, type: String },
|
|
8958
|
-
hasCoupon: { default: false, required: false, type: Boolean },
|
|
8959
9109
|
name: { required: true, type: String },
|
|
8960
9110
|
price: { required: true, type: Number },
|
|
9111
|
+
priceMax: { required: false, type: Number },
|
|
8961
9112
|
priceUnit: { required: true, type: String },
|
|
8962
9113
|
productGroups: { required: false, type: [String] }
|
|
8963
9114
|
},
|
|
8964
9115
|
{ timestamps: true }
|
|
8965
9116
|
);
|
|
8966
|
-
var productWrapperSchema = new
|
|
9117
|
+
var productWrapperSchema = new MongooseSchema14(
|
|
8967
9118
|
{
|
|
8968
9119
|
active: { default: false, required: true, type: Boolean },
|
|
8969
9120
|
productsList: { required: false, type: [vendorProductTypeSchema] }
|
|
8970
9121
|
},
|
|
8971
9122
|
{ _id: false }
|
|
8972
9123
|
);
|
|
8973
|
-
var calendarSchema = new
|
|
9124
|
+
var calendarSchema = new MongooseSchema14(
|
|
8974
9125
|
{
|
|
8975
9126
|
dateTime: {
|
|
8976
9127
|
dateStatus: {
|
|
@@ -8991,14 +9142,14 @@ var calendarSchema = new MongooseSchema13(
|
|
|
8991
9142
|
},
|
|
8992
9143
|
{ _id: false }
|
|
8993
9144
|
);
|
|
8994
|
-
var calendarWrapperSchema = new
|
|
9145
|
+
var calendarWrapperSchema = new MongooseSchema14(
|
|
8995
9146
|
{
|
|
8996
9147
|
active: { default: false, required: true, type: Boolean },
|
|
8997
9148
|
calendarData: { required: false, type: [calendarSchema] }
|
|
8998
9149
|
},
|
|
8999
9150
|
{ _id: false }
|
|
9000
9151
|
);
|
|
9001
|
-
var
|
|
9152
|
+
var schema10 = new MongooseSchema14(
|
|
9002
9153
|
{
|
|
9003
9154
|
...baseResourceFields,
|
|
9004
9155
|
// Importing base resource fields from global.ts
|
|
@@ -9024,12 +9175,12 @@ var schema9 = new MongooseSchema13(
|
|
|
9024
9175
|
unregisteredVendorId: {
|
|
9025
9176
|
ref: "UnregisteredVendor",
|
|
9026
9177
|
required: false,
|
|
9027
|
-
type:
|
|
9178
|
+
type: mongoose14.Schema.Types.ObjectId
|
|
9028
9179
|
},
|
|
9029
9180
|
vendorInfoId: {
|
|
9030
9181
|
ref: "VendorInfo",
|
|
9031
9182
|
required: false,
|
|
9032
|
-
type:
|
|
9183
|
+
type: mongoose14.Schema.Types.ObjectId
|
|
9033
9184
|
},
|
|
9034
9185
|
vendorType: {
|
|
9035
9186
|
enum: Object.values(EnumVendorType),
|
|
@@ -9039,24 +9190,24 @@ var schema9 = new MongooseSchema13(
|
|
|
9039
9190
|
},
|
|
9040
9191
|
{ timestamps: true }
|
|
9041
9192
|
);
|
|
9042
|
-
|
|
9043
|
-
|
|
9044
|
-
|
|
9045
|
-
|
|
9046
|
-
|
|
9047
|
-
var VendorModel =
|
|
9193
|
+
schema10.index({ name: 1 });
|
|
9194
|
+
schema10.index({ description: 1 });
|
|
9195
|
+
schema10.index({ region: 1 });
|
|
9196
|
+
schema10.index({ "categories.name": 1 });
|
|
9197
|
+
schema10.index({ slug: 1 });
|
|
9198
|
+
var VendorModel = mongoose14.models.Vendor || mongoose14.model("Vendor", schema10);
|
|
9048
9199
|
|
|
9049
9200
|
// src/mongoose/vendor/VendorInfo.ts
|
|
9050
|
-
import
|
|
9051
|
-
var
|
|
9052
|
-
var AttributesSchema = new
|
|
9201
|
+
import mongoose15 from "mongoose";
|
|
9202
|
+
var MongooseSchema15 = mongoose15.Schema;
|
|
9203
|
+
var AttributesSchema = new MongooseSchema15(
|
|
9053
9204
|
{
|
|
9054
9205
|
details: { required: false, type: String },
|
|
9055
9206
|
isRequired: { default: false, required: true, type: Boolean }
|
|
9056
9207
|
},
|
|
9057
9208
|
{ _id: false }
|
|
9058
9209
|
);
|
|
9059
|
-
var
|
|
9210
|
+
var schema11 = new MongooseSchema15(
|
|
9060
9211
|
{
|
|
9061
9212
|
active: { default: true, type: Boolean },
|
|
9062
9213
|
compliance: {
|
|
@@ -9091,28 +9242,28 @@ var schema10 = new MongooseSchema14(
|
|
|
9091
9242
|
vendorId: {
|
|
9092
9243
|
ref: "Vendor",
|
|
9093
9244
|
required: true,
|
|
9094
|
-
type:
|
|
9245
|
+
type: mongoose15.Schema.Types.ObjectId
|
|
9095
9246
|
}
|
|
9096
9247
|
},
|
|
9097
9248
|
{ timestamps: true }
|
|
9098
9249
|
);
|
|
9099
|
-
var VendorInfoModel =
|
|
9250
|
+
var VendorInfoModel = mongoose15.models.VendorInfo || mongoose15.model("VendorInfo", schema11);
|
|
9100
9251
|
|
|
9101
9252
|
// src/mongoose/vendor/UnregisteredVendor.ts
|
|
9102
|
-
import
|
|
9103
|
-
var
|
|
9104
|
-
var invitationSchema = new
|
|
9253
|
+
import mongoose16 from "mongoose";
|
|
9254
|
+
var MongooseSchema16 = mongoose16.Schema;
|
|
9255
|
+
var invitationSchema = new MongooseSchema16(
|
|
9105
9256
|
{
|
|
9106
9257
|
dateTime: { required: true, type: [dateTimeSchema2] },
|
|
9107
9258
|
inviterId: {
|
|
9108
9259
|
ref: "Event",
|
|
9109
9260
|
required: true,
|
|
9110
|
-
type:
|
|
9261
|
+
type: mongoose16.Schema.Types.ObjectId
|
|
9111
9262
|
}
|
|
9112
9263
|
},
|
|
9113
9264
|
{ _id: false }
|
|
9114
9265
|
);
|
|
9115
|
-
var
|
|
9266
|
+
var schema12 = new MongooseSchema16(
|
|
9116
9267
|
{
|
|
9117
9268
|
active: { default: true, required: true, type: Boolean },
|
|
9118
9269
|
categoryIds: { required: true, type: [String] },
|
|
@@ -9121,7 +9272,7 @@ var schema11 = new MongooseSchema15(
|
|
|
9121
9272
|
claimedByUserId: {
|
|
9122
9273
|
ref: "User",
|
|
9123
9274
|
required: false,
|
|
9124
|
-
type:
|
|
9275
|
+
type: mongoose16.Schema.Types.ObjectId
|
|
9125
9276
|
},
|
|
9126
9277
|
claimInitiatedAt: { default: null, required: false, type: Date },
|
|
9127
9278
|
claimToken: { default: null, required: false, type: String },
|
|
@@ -9134,14 +9285,14 @@ var schema11 = new MongooseSchema15(
|
|
|
9134
9285
|
},
|
|
9135
9286
|
{ timestamps: true }
|
|
9136
9287
|
);
|
|
9137
|
-
|
|
9138
|
-
|
|
9139
|
-
var UnregisteredVendorModel =
|
|
9288
|
+
schema12.index({ name: 1 });
|
|
9289
|
+
schema12.index({ email: 1 });
|
|
9290
|
+
var UnregisteredVendorModel = mongoose16.models.UnregisteredVendor || mongoose16.model("UnregisteredVendor", schema12);
|
|
9140
9291
|
|
|
9141
9292
|
// src/mongoose/event/Event.ts
|
|
9142
|
-
import
|
|
9143
|
-
var
|
|
9144
|
-
var
|
|
9293
|
+
import mongoose17 from "mongoose";
|
|
9294
|
+
var MongooseSchema17 = mongoose17.Schema;
|
|
9295
|
+
var schema13 = new MongooseSchema17(
|
|
9145
9296
|
{
|
|
9146
9297
|
...baseResourceFields,
|
|
9147
9298
|
// Importing base resource fields from global.ts
|
|
@@ -9150,7 +9301,7 @@ var schema12 = new MongooseSchema16(
|
|
|
9150
9301
|
eventInfoId: {
|
|
9151
9302
|
ref: "EventInfo",
|
|
9152
9303
|
required: false,
|
|
9153
|
-
type:
|
|
9304
|
+
type: mongoose17.Schema.Types.ObjectId
|
|
9154
9305
|
},
|
|
9155
9306
|
eventType: {
|
|
9156
9307
|
enum: Object.values(EnumEventType),
|
|
@@ -9179,20 +9330,20 @@ var schema12 = new MongooseSchema16(
|
|
|
9179
9330
|
},
|
|
9180
9331
|
{ timestamps: true }
|
|
9181
9332
|
);
|
|
9182
|
-
|
|
9183
|
-
|
|
9184
|
-
|
|
9185
|
-
|
|
9186
|
-
|
|
9187
|
-
|
|
9188
|
-
|
|
9189
|
-
|
|
9190
|
-
var EventModel =
|
|
9333
|
+
schema13.index({ name: 1 });
|
|
9334
|
+
schema13.index({ description: 1 });
|
|
9335
|
+
schema13.index({ region: 1 });
|
|
9336
|
+
schema13.index({ "location.geo": "2dsphere" });
|
|
9337
|
+
schema13.index({ tags: 1 });
|
|
9338
|
+
schema13.index({ deletedAt: 1 });
|
|
9339
|
+
schema13.index({ "dateTime.dateStatus": 1 });
|
|
9340
|
+
schema13.index({ slug: 1 });
|
|
9341
|
+
var EventModel = mongoose17.models.Event || mongoose17.model("Event", schema13);
|
|
9191
9342
|
|
|
9192
9343
|
// src/mongoose/Partner.ts
|
|
9193
|
-
import
|
|
9194
|
-
var
|
|
9195
|
-
var
|
|
9344
|
+
import mongoose18 from "mongoose";
|
|
9345
|
+
var MongooseSchema18 = mongoose18.Schema;
|
|
9346
|
+
var schema14 = new MongooseSchema18(
|
|
9196
9347
|
{
|
|
9197
9348
|
...baseResourceFields,
|
|
9198
9349
|
location: {
|
|
@@ -9208,17 +9359,17 @@ var schema13 = new MongooseSchema17(
|
|
|
9208
9359
|
},
|
|
9209
9360
|
{ timestamps: true }
|
|
9210
9361
|
);
|
|
9211
|
-
|
|
9212
|
-
|
|
9213
|
-
|
|
9214
|
-
|
|
9215
|
-
|
|
9216
|
-
var PartnerModel =
|
|
9362
|
+
schema14.index({ name: 1 });
|
|
9363
|
+
schema14.index({ description: 1 });
|
|
9364
|
+
schema14.index({ region: 1 });
|
|
9365
|
+
schema14.index({ "location.geo": "2dsphere" });
|
|
9366
|
+
schema14.index({ slug: 1 });
|
|
9367
|
+
var PartnerModel = mongoose18.models.Partner || mongoose18.model("Partner", schema14);
|
|
9217
9368
|
|
|
9218
9369
|
// src/mongoose/Post.ts
|
|
9219
|
-
import
|
|
9220
|
-
var
|
|
9221
|
-
var contentSchema = new
|
|
9370
|
+
import mongoose19, { Schema } from "mongoose";
|
|
9371
|
+
var MongooseSchema19 = mongoose19.Schema;
|
|
9372
|
+
var contentSchema = new MongooseSchema19(
|
|
9222
9373
|
{
|
|
9223
9374
|
contentData: Schema.Types.Mixed,
|
|
9224
9375
|
contentOrder: { required: true, type: Number },
|
|
@@ -9230,7 +9381,7 @@ var contentSchema = new MongooseSchema18(
|
|
|
9230
9381
|
},
|
|
9231
9382
|
{ _id: false }
|
|
9232
9383
|
);
|
|
9233
|
-
var resourceSchema = new
|
|
9384
|
+
var resourceSchema = new MongooseSchema19(
|
|
9234
9385
|
{
|
|
9235
9386
|
resourceId: { required: true, type: String },
|
|
9236
9387
|
resourceRegion: { required: true, type: String },
|
|
@@ -9243,7 +9394,7 @@ var resourceSchema = new MongooseSchema18(
|
|
|
9243
9394
|
},
|
|
9244
9395
|
{ _id: false }
|
|
9245
9396
|
);
|
|
9246
|
-
var
|
|
9397
|
+
var schema15 = new MongooseSchema19(
|
|
9247
9398
|
{
|
|
9248
9399
|
active: { default: false, required: true, type: Boolean },
|
|
9249
9400
|
approvedAt: { default: null, required: false, type: Date },
|
|
@@ -9274,16 +9425,16 @@ var schema14 = new MongooseSchema18(
|
|
|
9274
9425
|
},
|
|
9275
9426
|
{ timestamps: true }
|
|
9276
9427
|
);
|
|
9277
|
-
|
|
9278
|
-
|
|
9279
|
-
|
|
9280
|
-
var PostModel =
|
|
9428
|
+
schema15.index({ title: 1 });
|
|
9429
|
+
schema15.index({ tags: 1 });
|
|
9430
|
+
schema15.index({ postType: 1, slug: 1 }, { unique: true });
|
|
9431
|
+
var PostModel = mongoose19.models.Post || mongoose19.model("Post", schema15);
|
|
9281
9432
|
|
|
9282
9433
|
// src/mongoose/AppSetting.ts
|
|
9283
|
-
import
|
|
9284
|
-
var
|
|
9434
|
+
import mongoose20 from "mongoose";
|
|
9435
|
+
var MongooseSchema20 = mongoose20.Schema;
|
|
9285
9436
|
var APP_SETTINGS_ID = "APP_SETTINGS_DOCUMENT_ID";
|
|
9286
|
-
var AppSettingSchema = new
|
|
9437
|
+
var AppSettingSchema = new MongooseSchema20(
|
|
9287
9438
|
{
|
|
9288
9439
|
activeSchoolsStudentCountTotal: {
|
|
9289
9440
|
default: 0,
|
|
@@ -9314,18 +9465,18 @@ var AppSettingSchema = new MongooseSchema19(
|
|
|
9314
9465
|
},
|
|
9315
9466
|
{ timestamps: true }
|
|
9316
9467
|
);
|
|
9317
|
-
var AppSettingModel =
|
|
9468
|
+
var AppSettingModel = mongoose20.models.AppSetting || mongoose20.model("AppSetting", AppSettingSchema);
|
|
9318
9469
|
|
|
9319
9470
|
// src/mongoose/game/Game.ts
|
|
9320
|
-
import
|
|
9471
|
+
import mongoose24 from "mongoose";
|
|
9321
9472
|
|
|
9322
9473
|
// src/mongoose/game/DailyClue.ts
|
|
9323
|
-
import
|
|
9474
|
+
import mongoose22 from "mongoose";
|
|
9324
9475
|
|
|
9325
9476
|
// src/mongoose/game/utils.ts
|
|
9326
|
-
import
|
|
9327
|
-
var
|
|
9328
|
-
var schemaGameDate = new
|
|
9477
|
+
import mongoose21 from "mongoose";
|
|
9478
|
+
var MongooseSchema21 = mongoose21.Schema;
|
|
9479
|
+
var schemaGameDate = new MongooseSchema21(
|
|
9329
9480
|
{
|
|
9330
9481
|
endDate: { required: true, type: Date },
|
|
9331
9482
|
startDate: { required: true, type: Date }
|
|
@@ -9334,8 +9485,8 @@ var schemaGameDate = new MongooseSchema20(
|
|
|
9334
9485
|
);
|
|
9335
9486
|
|
|
9336
9487
|
// src/mongoose/game/DailyClue.ts
|
|
9337
|
-
var
|
|
9338
|
-
var schemaLetters = new
|
|
9488
|
+
var MongooseSchema22 = mongoose22.Schema;
|
|
9489
|
+
var schemaLetters = new MongooseSchema22(
|
|
9339
9490
|
{
|
|
9340
9491
|
collected: { required: false, type: [String] },
|
|
9341
9492
|
solutionShuffled: { required: true, type: [String] }
|
|
@@ -9343,14 +9494,14 @@ var schemaLetters = new MongooseSchema21(
|
|
|
9343
9494
|
},
|
|
9344
9495
|
{ _id: false }
|
|
9345
9496
|
);
|
|
9346
|
-
var schemaDailyClueBaseGame = new
|
|
9497
|
+
var schemaDailyClueBaseGame = new MongooseSchema22(
|
|
9347
9498
|
{
|
|
9348
9499
|
gameDate: { required: true, type: schemaGameDate },
|
|
9349
9500
|
gameSolution: { required: true, type: String }
|
|
9350
9501
|
},
|
|
9351
9502
|
{ _id: false }
|
|
9352
9503
|
);
|
|
9353
|
-
var schemaDailyClueGameData = new
|
|
9504
|
+
var schemaDailyClueGameData = new MongooseSchema22(
|
|
9354
9505
|
{
|
|
9355
9506
|
gameFields: { required: true, type: schemaDailyClueBaseGame },
|
|
9356
9507
|
lastFoundDate: { default: null, required: false, type: Date },
|
|
@@ -9365,9 +9516,9 @@ var schemaDailyClueGameData = new MongooseSchema21(
|
|
|
9365
9516
|
);
|
|
9366
9517
|
|
|
9367
9518
|
// src/mongoose/game/PuzzleGame.ts
|
|
9368
|
-
import
|
|
9369
|
-
var
|
|
9370
|
-
var schemaPuzzleAnswer = new
|
|
9519
|
+
import mongoose23 from "mongoose";
|
|
9520
|
+
var MongooseSchema23 = mongoose23.Schema;
|
|
9521
|
+
var schemaPuzzleAnswer = new MongooseSchema23(
|
|
9371
9522
|
{
|
|
9372
9523
|
answer: { required: true, type: String },
|
|
9373
9524
|
answerId: { required: true, type: String },
|
|
@@ -9375,7 +9526,7 @@ var schemaPuzzleAnswer = new MongooseSchema22(
|
|
|
9375
9526
|
},
|
|
9376
9527
|
{ _id: false }
|
|
9377
9528
|
);
|
|
9378
|
-
var schemaPuzzleQuestion = new
|
|
9529
|
+
var schemaPuzzleQuestion = new MongooseSchema23(
|
|
9379
9530
|
{
|
|
9380
9531
|
answers: { required: true, type: [schemaPuzzleAnswer] },
|
|
9381
9532
|
question: { required: true, type: String },
|
|
@@ -9383,20 +9534,20 @@ var schemaPuzzleQuestion = new MongooseSchema22(
|
|
|
9383
9534
|
},
|
|
9384
9535
|
{ _id: false }
|
|
9385
9536
|
);
|
|
9386
|
-
var schemaPuzzleBaseGame = new
|
|
9537
|
+
var schemaPuzzleBaseGame = new MongooseSchema23(
|
|
9387
9538
|
{
|
|
9388
9539
|
questions: { required: true, type: [schemaPuzzleQuestion] }
|
|
9389
9540
|
},
|
|
9390
9541
|
{ _id: false }
|
|
9391
9542
|
);
|
|
9392
|
-
var schemaPuzzleAnsweredQuestion = new
|
|
9543
|
+
var schemaPuzzleAnsweredQuestion = new MongooseSchema23(
|
|
9393
9544
|
{
|
|
9394
9545
|
questionId: { required: true, type: String },
|
|
9395
9546
|
selectedAnswerId: { required: true, type: String }
|
|
9396
9547
|
},
|
|
9397
9548
|
{ _id: false }
|
|
9398
9549
|
);
|
|
9399
|
-
var schemaPuzzleGameData = new
|
|
9550
|
+
var schemaPuzzleGameData = new MongooseSchema23(
|
|
9400
9551
|
{
|
|
9401
9552
|
answeredQuestions: {
|
|
9402
9553
|
default: null,
|
|
@@ -9411,7 +9562,7 @@ var schemaPuzzleGameData = new MongooseSchema22(
|
|
|
9411
9562
|
);
|
|
9412
9563
|
|
|
9413
9564
|
// src/mongoose/game/Game.ts
|
|
9414
|
-
var
|
|
9565
|
+
var MongooseSchema24 = mongoose24.Schema;
|
|
9415
9566
|
var gameDataSchemas = {
|
|
9416
9567
|
[EnumGameType.DAILY_CLUE]: schemaDailyClueGameData,
|
|
9417
9568
|
[EnumGameType.MINI_QUIZ]: schemaPuzzleGameData,
|
|
@@ -9423,7 +9574,7 @@ var gameDataDefinition = Object.fromEntries(
|
|
|
9423
9574
|
{ default: null, required: false, type: schema19 }
|
|
9424
9575
|
])
|
|
9425
9576
|
);
|
|
9426
|
-
var gameHistorySchema = new
|
|
9577
|
+
var gameHistorySchema = new MongooseSchema24(
|
|
9427
9578
|
{
|
|
9428
9579
|
createdAt: { required: true, type: Date },
|
|
9429
9580
|
gameDate: { required: true, type: schemaGameDate },
|
|
@@ -9443,7 +9594,7 @@ var gameHistorySchema = new MongooseSchema23(
|
|
|
9443
9594
|
},
|
|
9444
9595
|
{ _id: false }
|
|
9445
9596
|
);
|
|
9446
|
-
var gameTypeSchema = new
|
|
9597
|
+
var gameTypeSchema = new MongooseSchema24(
|
|
9447
9598
|
{
|
|
9448
9599
|
active: { default: true, required: true, type: Boolean },
|
|
9449
9600
|
gameData: gameDataDefinition,
|
|
@@ -9458,7 +9609,7 @@ var gameTypeSchema = new MongooseSchema23(
|
|
|
9458
9609
|
},
|
|
9459
9610
|
{ timestamps: true }
|
|
9460
9611
|
);
|
|
9461
|
-
var
|
|
9612
|
+
var schema16 = new MongooseSchema24(
|
|
9462
9613
|
{
|
|
9463
9614
|
active: { default: false, required: true, type: Boolean },
|
|
9464
9615
|
deletedAt: { default: null, required: false, type: Date },
|
|
@@ -9471,12 +9622,12 @@ var schema15 = new MongooseSchema23(
|
|
|
9471
9622
|
},
|
|
9472
9623
|
{ timestamps: true }
|
|
9473
9624
|
);
|
|
9474
|
-
var GameModel =
|
|
9625
|
+
var GameModel = mongoose24.models.Game || mongoose24.model("Game", schema16);
|
|
9475
9626
|
|
|
9476
9627
|
// src/mongoose/School.ts
|
|
9477
|
-
import
|
|
9478
|
-
var
|
|
9479
|
-
var campaignsSchema = new
|
|
9628
|
+
import mongoose25 from "mongoose";
|
|
9629
|
+
var MongooseSchema25 = mongoose25.Schema;
|
|
9630
|
+
var campaignsSchema = new MongooseSchema25(
|
|
9480
9631
|
{
|
|
9481
9632
|
endDate: { required: true, type: Date },
|
|
9482
9633
|
name: { required: true, type: String },
|
|
@@ -9484,7 +9635,7 @@ var campaignsSchema = new MongooseSchema24(
|
|
|
9484
9635
|
},
|
|
9485
9636
|
{ _id: false }
|
|
9486
9637
|
);
|
|
9487
|
-
var
|
|
9638
|
+
var schema17 = new MongooseSchema25(
|
|
9488
9639
|
{
|
|
9489
9640
|
// New schools are active by default
|
|
9490
9641
|
active: { default: false, required: true, type: Boolean },
|
|
@@ -9511,19 +9662,19 @@ var schema16 = new MongooseSchema24(
|
|
|
9511
9662
|
},
|
|
9512
9663
|
{ timestamps: true }
|
|
9513
9664
|
);
|
|
9514
|
-
|
|
9665
|
+
schema17.index(
|
|
9515
9666
|
{ schoolCode: 1 },
|
|
9516
9667
|
{
|
|
9517
9668
|
partialFilterExpression: { active: true, deletedAt: null },
|
|
9518
9669
|
unique: true
|
|
9519
9670
|
}
|
|
9520
9671
|
);
|
|
9521
|
-
var SchoolModel =
|
|
9672
|
+
var SchoolModel = mongoose25.models.School || mongoose25.model("School", schema17);
|
|
9522
9673
|
|
|
9523
9674
|
// src/mongoose/Affiliate.ts
|
|
9524
|
-
import
|
|
9525
|
-
var
|
|
9526
|
-
var affiliateRewardSchema = new
|
|
9675
|
+
import mongoose26 from "mongoose";
|
|
9676
|
+
var MongooseSchema26 = mongoose26.Schema;
|
|
9677
|
+
var affiliateRewardSchema = new MongooseSchema26(
|
|
9527
9678
|
{
|
|
9528
9679
|
createdAt: { required: true, type: Date },
|
|
9529
9680
|
redeemedAt: { default: null, required: false, type: Date },
|
|
@@ -9537,13 +9688,13 @@ var affiliateRewardSchema = new MongooseSchema25(
|
|
|
9537
9688
|
},
|
|
9538
9689
|
{ _id: false }
|
|
9539
9690
|
);
|
|
9540
|
-
var affiliateResourceSchema = new
|
|
9691
|
+
var affiliateResourceSchema = new MongooseSchema26(
|
|
9541
9692
|
{
|
|
9542
9693
|
resourceActive: { default: true, required: true, type: Boolean },
|
|
9543
9694
|
resourceDeletedAt: { default: null, required: false, type: Date },
|
|
9544
9695
|
resourceId: {
|
|
9545
9696
|
required: true,
|
|
9546
|
-
type:
|
|
9697
|
+
type: mongoose26.Schema.Types.ObjectId
|
|
9547
9698
|
},
|
|
9548
9699
|
resourceName: { required: true, type: String },
|
|
9549
9700
|
resourceOwner: {
|
|
@@ -9563,20 +9714,20 @@ var affiliateResourceSchema = new MongooseSchema25(
|
|
|
9563
9714
|
},
|
|
9564
9715
|
{ _id: false }
|
|
9565
9716
|
);
|
|
9566
|
-
var affiliateContactDetailsSchema = new
|
|
9717
|
+
var affiliateContactDetailsSchema = new MongooseSchema26(
|
|
9567
9718
|
{
|
|
9568
9719
|
mobilePhone: { required: true, type: String }
|
|
9569
9720
|
},
|
|
9570
9721
|
{ _id: false }
|
|
9571
9722
|
);
|
|
9572
|
-
var affiliateBankAccountDetailsSchema = new
|
|
9723
|
+
var affiliateBankAccountDetailsSchema = new MongooseSchema26(
|
|
9573
9724
|
{
|
|
9574
9725
|
accountHolderName: { required: true, type: String },
|
|
9575
9726
|
accountNumber: { required: true, type: String }
|
|
9576
9727
|
},
|
|
9577
9728
|
{ _id: false }
|
|
9578
9729
|
);
|
|
9579
|
-
var affiliateDetailsSchema = new
|
|
9730
|
+
var affiliateDetailsSchema = new MongooseSchema26(
|
|
9580
9731
|
{
|
|
9581
9732
|
bankAccountDetails: {
|
|
9582
9733
|
required: true,
|
|
@@ -9598,7 +9749,7 @@ var affiliateDetailsSchema = new MongooseSchema25(
|
|
|
9598
9749
|
},
|
|
9599
9750
|
{ _id: false }
|
|
9600
9751
|
);
|
|
9601
|
-
var redeemHistorySchema = new
|
|
9752
|
+
var redeemHistorySchema = new MongooseSchema26(
|
|
9602
9753
|
{
|
|
9603
9754
|
paidAt: { default: null, required: false, type: Date },
|
|
9604
9755
|
redeemedAt: { required: true, type: Date },
|
|
@@ -9606,7 +9757,7 @@ var redeemHistorySchema = new MongooseSchema25(
|
|
|
9606
9757
|
},
|
|
9607
9758
|
{ _id: false }
|
|
9608
9759
|
);
|
|
9609
|
-
var
|
|
9760
|
+
var schema18 = new MongooseSchema26(
|
|
9610
9761
|
{
|
|
9611
9762
|
active: { default: false, required: true, type: Boolean },
|
|
9612
9763
|
affiliateBonusRewards: {
|
|
@@ -9636,71 +9787,14 @@ var schema17 = new MongooseSchema25(
|
|
|
9636
9787
|
},
|
|
9637
9788
|
{ timestamps: true }
|
|
9638
9789
|
);
|
|
9639
|
-
|
|
9790
|
+
schema18.index(
|
|
9640
9791
|
{ affiliateCode: 1 },
|
|
9641
9792
|
{
|
|
9642
9793
|
partialFilterExpression: { active: true, deletedAt: null },
|
|
9643
9794
|
unique: true
|
|
9644
9795
|
}
|
|
9645
9796
|
);
|
|
9646
|
-
var AffiliateModel =
|
|
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);
|
|
9797
|
+
var AffiliateModel = mongoose26.models.Affiliate || mongoose26.model("Affiliate", schema18);
|
|
9704
9798
|
|
|
9705
9799
|
export {
|
|
9706
9800
|
EnumInviteStatus,
|
|
@@ -9747,6 +9841,8 @@ export {
|
|
|
9747
9841
|
ResourceActivityModel,
|
|
9748
9842
|
UserModel,
|
|
9749
9843
|
VerificationTokenModel,
|
|
9844
|
+
productCouponSchema,
|
|
9845
|
+
CouponModel,
|
|
9750
9846
|
vendorProductTypeSchema,
|
|
9751
9847
|
VendorModel,
|
|
9752
9848
|
VendorInfoModel,
|
|
@@ -9758,7 +9854,6 @@ export {
|
|
|
9758
9854
|
AppSettingModel,
|
|
9759
9855
|
GameModel,
|
|
9760
9856
|
SchoolModel,
|
|
9761
|
-
AffiliateModel
|
|
9762
|
-
CouponModel
|
|
9857
|
+
AffiliateModel
|
|
9763
9858
|
};
|
|
9764
|
-
//# sourceMappingURL=chunk-
|
|
9859
|
+
//# sourceMappingURL=chunk-TDAUQKK7.mjs.map
|