@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.
- package/dist/{chunk-7GXZS3LI.mjs → chunk-K4C5YKZE.mjs} +326 -238
- package/dist/chunk-K4C5YKZE.mjs.map +1 -0
- package/dist/index.cjs +327 -238
- 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 +325 -237
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs +325 -236
- 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 +325 -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
package/dist/index.cjs
CHANGED
|
@@ -81,6 +81,7 @@ __export(index_exports, {
|
|
|
81
81
|
normalizeAffiliatePromoCodes: () => normalizeAffiliatePromoCodes,
|
|
82
82
|
normalizePromoCode: () => normalizePromoCode,
|
|
83
83
|
notifyUsers: () => notifyUsers,
|
|
84
|
+
productCouponSchema: () => productCouponSchema,
|
|
84
85
|
publishNotificationEvents: () => publishNotificationEvents,
|
|
85
86
|
refundPolicySchema: () => refundPolicySchema,
|
|
86
87
|
relatedPostSchema: () => relatedPostSchema,
|
|
@@ -3724,6 +3725,11 @@ var EnumAffiliateRewardType = /* @__PURE__ */ ((EnumAffiliateRewardType22) => {
|
|
|
3724
3725
|
EnumAffiliateRewardType22["NEW_VENDOR_REGISTRATION"] = "NEW_VENDOR_REGISTRATION";
|
|
3725
3726
|
return EnumAffiliateRewardType22;
|
|
3726
3727
|
})(EnumAffiliateRewardType || {});
|
|
3728
|
+
var EnumCouponQualificationType = /* @__PURE__ */ ((EnumCouponQualificationType2) => {
|
|
3729
|
+
EnumCouponQualificationType2["PURCHASE"] = "PURCHASE";
|
|
3730
|
+
EnumCouponQualificationType2["MARKET_VISIT"] = "MARKET_VISIT";
|
|
3731
|
+
return EnumCouponQualificationType2;
|
|
3732
|
+
})(EnumCouponQualificationType || {});
|
|
3727
3733
|
var statusOptions = [
|
|
3728
3734
|
...Object.values(EnumInviteStatus).map((status) => ({
|
|
3729
3735
|
label: status,
|
|
@@ -5147,6 +5153,7 @@ var USER_FIELDS_FRAGMENT = gql`
|
|
|
5147
5153
|
avatar {
|
|
5148
5154
|
...ResourceImageFields
|
|
5149
5155
|
}
|
|
5156
|
+
coupon
|
|
5150
5157
|
createdAt
|
|
5151
5158
|
deletedAt
|
|
5152
5159
|
email
|
|
@@ -5493,6 +5500,109 @@ var GET_EVENT_INFO = gql`
|
|
|
5493
5500
|
}
|
|
5494
5501
|
${EVENT_INFO}
|
|
5495
5502
|
`;
|
|
5503
|
+
var PRODUCT_COUPON_FIELDS_FRAGMENT = gql`
|
|
5504
|
+
fragment ProductCouponFields on ProductCouponType {
|
|
5505
|
+
couponDocumentId
|
|
5506
|
+
couponId
|
|
5507
|
+
}
|
|
5508
|
+
`;
|
|
5509
|
+
var COUPON_CODE_FIELDS_FRAGMENT = gql`
|
|
5510
|
+
fragment CouponCodeFields on CouponCodeType {
|
|
5511
|
+
code
|
|
5512
|
+
qrCode {
|
|
5513
|
+
...ResourceImageFields
|
|
5514
|
+
}
|
|
5515
|
+
}
|
|
5516
|
+
${RESOURCE_IMAGE_FIELDS_FRAGMENT}
|
|
5517
|
+
`;
|
|
5518
|
+
var COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT = gql`
|
|
5519
|
+
fragment CouponParticipantUserFields on CouponParticipantUserType {
|
|
5520
|
+
couponCollectedCount
|
|
5521
|
+
couponRedeemedAt
|
|
5522
|
+
createdAt
|
|
5523
|
+
updatedAt
|
|
5524
|
+
userId
|
|
5525
|
+
}
|
|
5526
|
+
`;
|
|
5527
|
+
var COUPON_OPTION_FIELDS_FRAGMENT = gql`
|
|
5528
|
+
fragment CouponOptionFields on CouponOptionType {
|
|
5529
|
+
type
|
|
5530
|
+
buy
|
|
5531
|
+
get
|
|
5532
|
+
unit
|
|
5533
|
+
visits
|
|
5534
|
+
}
|
|
5535
|
+
`;
|
|
5536
|
+
var COUPON_REWARD_FIELDS_FRAGMENT = gql`
|
|
5537
|
+
fragment CouponRewardFields on CouponRewardType {
|
|
5538
|
+
vendorId
|
|
5539
|
+
productId
|
|
5540
|
+
quantity
|
|
5541
|
+
unit
|
|
5542
|
+
}
|
|
5543
|
+
`;
|
|
5544
|
+
var COUPON_DATA_FIELDS_FRAGMENT = gql`
|
|
5545
|
+
fragment CouponDataFields on CouponDataType {
|
|
5546
|
+
_id
|
|
5547
|
+
active
|
|
5548
|
+
couponCode {
|
|
5549
|
+
...CouponCodeFields
|
|
5550
|
+
}
|
|
5551
|
+
couponDescription
|
|
5552
|
+
couponOption {
|
|
5553
|
+
...CouponOptionFields
|
|
5554
|
+
}
|
|
5555
|
+
couponRewards {
|
|
5556
|
+
...CouponRewardFields
|
|
5557
|
+
}
|
|
5558
|
+
createdAt
|
|
5559
|
+
endDate
|
|
5560
|
+
participantUsers {
|
|
5561
|
+
...CouponParticipantUserFields
|
|
5562
|
+
}
|
|
5563
|
+
resourceId
|
|
5564
|
+
resourceType
|
|
5565
|
+
startDate
|
|
5566
|
+
updatedAt
|
|
5567
|
+
}
|
|
5568
|
+
${COUPON_CODE_FIELDS_FRAGMENT}
|
|
5569
|
+
${COUPON_OPTION_FIELDS_FRAGMENT}
|
|
5570
|
+
${COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT}
|
|
5571
|
+
${COUPON_REWARD_FIELDS_FRAGMENT}
|
|
5572
|
+
`;
|
|
5573
|
+
var COUPON = gql`
|
|
5574
|
+
fragment CouponFields on CouponType {
|
|
5575
|
+
_id
|
|
5576
|
+
active
|
|
5577
|
+
couponData {
|
|
5578
|
+
...CouponDataFields
|
|
5579
|
+
}
|
|
5580
|
+
createdAt
|
|
5581
|
+
deletedAt
|
|
5582
|
+
owner {
|
|
5583
|
+
...OwnerFields
|
|
5584
|
+
}
|
|
5585
|
+
updatedAt
|
|
5586
|
+
}
|
|
5587
|
+
${OWNER_FIELDS_FRAGMENT}
|
|
5588
|
+
${COUPON_DATA_FIELDS_FRAGMENT}
|
|
5589
|
+
`;
|
|
5590
|
+
var GET_COUPONS = gql`
|
|
5591
|
+
query getCoupons {
|
|
5592
|
+
coupons {
|
|
5593
|
+
...CouponFields
|
|
5594
|
+
}
|
|
5595
|
+
}
|
|
5596
|
+
${COUPON}
|
|
5597
|
+
`;
|
|
5598
|
+
var GET_COUPON = gql`
|
|
5599
|
+
query getCoupon($_id: ID!) {
|
|
5600
|
+
coupon(_id: $_id) {
|
|
5601
|
+
...CouponFields
|
|
5602
|
+
}
|
|
5603
|
+
}
|
|
5604
|
+
${COUPON}
|
|
5605
|
+
`;
|
|
5496
5606
|
var VENDOR_DATETIME_FIELDS_FRAGMENT = gql`
|
|
5497
5607
|
fragment VendorDateTimeFields on VendorDateTimeType {
|
|
5498
5608
|
dateStatus
|
|
@@ -5505,15 +5615,18 @@ var VENDOR_DATETIME_FIELDS_FRAGMENT = gql`
|
|
|
5505
5615
|
var VENDOR_PRODUCT_LIST_FIELDS_FRAGMENT = gql`
|
|
5506
5616
|
fragment VendorProductListFields on VendorProductListType {
|
|
5507
5617
|
_id
|
|
5618
|
+
coupon {
|
|
5619
|
+
...ProductCouponFields
|
|
5620
|
+
}
|
|
5508
5621
|
createdAt
|
|
5509
5622
|
description
|
|
5510
|
-
hasCoupon
|
|
5511
5623
|
name
|
|
5512
5624
|
price
|
|
5513
5625
|
priceUnit
|
|
5514
5626
|
productGroups
|
|
5515
5627
|
updatedAt
|
|
5516
5628
|
}
|
|
5629
|
+
${PRODUCT_COUPON_FIELDS_FRAGMENT}
|
|
5517
5630
|
`;
|
|
5518
5631
|
var VENDOR = gql`
|
|
5519
5632
|
fragment VendorFields on VendorType {
|
|
@@ -7815,79 +7928,6 @@ var ASSIGN_AFFILIATE_BONUS_REWARD_MUTATION = gql`
|
|
|
7815
7928
|
}
|
|
7816
7929
|
${AFFILIATE_FIELDS_FRAGMENT}
|
|
7817
7930
|
`;
|
|
7818
|
-
var COUPON_CODE_FIELDS_FRAGMENT = gql`
|
|
7819
|
-
fragment CouponCodeFields on CouponCodeType {
|
|
7820
|
-
code
|
|
7821
|
-
qrCode {
|
|
7822
|
-
...ResourceImageFields
|
|
7823
|
-
}
|
|
7824
|
-
}
|
|
7825
|
-
${RESOURCE_IMAGE_FIELDS_FRAGMENT}
|
|
7826
|
-
`;
|
|
7827
|
-
var COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT = gql`
|
|
7828
|
-
fragment CouponParticipantUserFields on CouponParticipantUserType {
|
|
7829
|
-
couponCount
|
|
7830
|
-
couponRedeemedAt
|
|
7831
|
-
createdAt
|
|
7832
|
-
updatedAt
|
|
7833
|
-
userId
|
|
7834
|
-
}
|
|
7835
|
-
`;
|
|
7836
|
-
var PRODUCT_COUPON_FIELDS_FRAGMENT = gql`
|
|
7837
|
-
fragment ProductCouponFields on ProductCouponType {
|
|
7838
|
-
_id
|
|
7839
|
-
active
|
|
7840
|
-
couponCode {
|
|
7841
|
-
...CouponCodeFields
|
|
7842
|
-
}
|
|
7843
|
-
couponDescription
|
|
7844
|
-
couponOption
|
|
7845
|
-
createdAt
|
|
7846
|
-
endDate
|
|
7847
|
-
participantProduct {
|
|
7848
|
-
...VendorProductListFields
|
|
7849
|
-
}
|
|
7850
|
-
participantUsers {
|
|
7851
|
-
...CouponParticipantUserFields
|
|
7852
|
-
}
|
|
7853
|
-
startDate
|
|
7854
|
-
updatedAt
|
|
7855
|
-
}
|
|
7856
|
-
${COUPON_CODE_FIELDS_FRAGMENT}
|
|
7857
|
-
${COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT}
|
|
7858
|
-
${VENDOR_PRODUCT_LIST_FIELDS_FRAGMENT}
|
|
7859
|
-
`;
|
|
7860
|
-
var COUPON = gql`
|
|
7861
|
-
fragment CouponFields on CouponType {
|
|
7862
|
-
_id
|
|
7863
|
-
active
|
|
7864
|
-
productCoupons {
|
|
7865
|
-
...ProductCouponFields
|
|
7866
|
-
}
|
|
7867
|
-
createdAt
|
|
7868
|
-
deletedAt
|
|
7869
|
-
updatedAt
|
|
7870
|
-
}
|
|
7871
|
-
${PRODUCT_COUPON_FIELDS_FRAGMENT}
|
|
7872
|
-
${COUPON_CODE_FIELDS_FRAGMENT}
|
|
7873
|
-
${COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT}
|
|
7874
|
-
`;
|
|
7875
|
-
var GET_COUPONS = gql`
|
|
7876
|
-
query getCoupons {
|
|
7877
|
-
coupons {
|
|
7878
|
-
...CouponFields
|
|
7879
|
-
}
|
|
7880
|
-
}
|
|
7881
|
-
${COUPON}
|
|
7882
|
-
`;
|
|
7883
|
-
var GET_COUPON = gql`
|
|
7884
|
-
query getCoupon($_id: ID!) {
|
|
7885
|
-
coupon(_id: $_id) {
|
|
7886
|
-
...CouponFields
|
|
7887
|
-
}
|
|
7888
|
-
}
|
|
7889
|
-
${COUPON}
|
|
7890
|
-
`;
|
|
7891
7931
|
var CREATE_COUPON_MUTATION = gql`
|
|
7892
7932
|
mutation createCoupon($input: CouponInputType!) {
|
|
7893
7933
|
createCoupon(input: $input) {
|
|
@@ -8587,7 +8627,7 @@ var baseResourceFields = {
|
|
|
8587
8627
|
logo: { required: false, type: ResourceImageTypeSchema },
|
|
8588
8628
|
name: { required: true, type: String },
|
|
8589
8629
|
owner: {
|
|
8590
|
-
required:
|
|
8630
|
+
required: true,
|
|
8591
8631
|
type: OwnerTypeSchema
|
|
8592
8632
|
},
|
|
8593
8633
|
posterUsage: { required: false, type: PosterUsageTypeSchema },
|
|
@@ -9052,12 +9092,117 @@ var schema8 = new MongooseSchema12(
|
|
|
9052
9092
|
var VerificationTokenModel = import_mongoose12.default.models.VerificationToken || import_mongoose12.default.model("VerificationToken", schema8);
|
|
9053
9093
|
|
|
9054
9094
|
// src/mongoose/vendor/Vendor.ts
|
|
9095
|
+
var import_mongoose14 = __toESM(require("mongoose"));
|
|
9096
|
+
|
|
9097
|
+
// src/mongoose/Coupon.ts
|
|
9055
9098
|
var import_mongoose13 = __toESM(require("mongoose"));
|
|
9056
9099
|
var MongooseSchema13 = import_mongoose13.default.Schema;
|
|
9057
|
-
var
|
|
9100
|
+
var productCouponSchema = new MongooseSchema13(
|
|
9101
|
+
{
|
|
9102
|
+
couponDocumentId: {
|
|
9103
|
+
ref: "Coupon",
|
|
9104
|
+
required: true,
|
|
9105
|
+
type: import_mongoose13.default.Schema.Types.ObjectId
|
|
9106
|
+
},
|
|
9107
|
+
couponId: {
|
|
9108
|
+
required: true,
|
|
9109
|
+
type: import_mongoose13.default.Schema.Types.ObjectId
|
|
9110
|
+
}
|
|
9111
|
+
},
|
|
9112
|
+
{ _id: false }
|
|
9113
|
+
);
|
|
9114
|
+
var couponOptionSchema = new MongooseSchema13(
|
|
9115
|
+
{
|
|
9116
|
+
buy: { required: false, type: Number },
|
|
9117
|
+
get: { required: false, type: Number },
|
|
9118
|
+
type: {
|
|
9119
|
+
enum: Object.values(EnumCouponQualificationType),
|
|
9120
|
+
required: true,
|
|
9121
|
+
type: String
|
|
9122
|
+
},
|
|
9123
|
+
unit: { required: false, type: String },
|
|
9124
|
+
visits: { required: false, type: Number }
|
|
9125
|
+
},
|
|
9126
|
+
{ _id: false }
|
|
9127
|
+
);
|
|
9128
|
+
var couponRewardSchema = new MongooseSchema13(
|
|
9058
9129
|
{
|
|
9130
|
+
productId: {
|
|
9131
|
+
required: true,
|
|
9132
|
+
type: import_mongoose13.default.Schema.Types.ObjectId
|
|
9133
|
+
},
|
|
9134
|
+
quantity: { required: true, type: Number },
|
|
9135
|
+
unit: { required: true, type: String },
|
|
9136
|
+
vendorId: {
|
|
9137
|
+
ref: "Vendor",
|
|
9138
|
+
required: true,
|
|
9139
|
+
type: import_mongoose13.default.Schema.Types.ObjectId
|
|
9140
|
+
}
|
|
9141
|
+
},
|
|
9142
|
+
{ _id: false }
|
|
9143
|
+
);
|
|
9144
|
+
var couponCodeSchema = new MongooseSchema13(
|
|
9145
|
+
{
|
|
9146
|
+
code: { required: true, type: String },
|
|
9147
|
+
qrCode: { required: true, type: ResourceImageTypeSchema }
|
|
9148
|
+
},
|
|
9149
|
+
{ _id: false }
|
|
9150
|
+
);
|
|
9151
|
+
var couponParticipantUserSchema = new MongooseSchema13(
|
|
9152
|
+
{
|
|
9153
|
+
couponCollectedCount: { default: 0, required: true, type: Number },
|
|
9154
|
+
couponRedeemedAt: { default: null, required: false, type: Date },
|
|
9155
|
+
userId: {
|
|
9156
|
+
ref: "User",
|
|
9157
|
+
required: true,
|
|
9158
|
+
type: import_mongoose13.default.Schema.Types.ObjectId
|
|
9159
|
+
}
|
|
9160
|
+
},
|
|
9161
|
+
{ timestamps: true }
|
|
9162
|
+
);
|
|
9163
|
+
var couponDataSchema = new MongooseSchema13(
|
|
9164
|
+
{
|
|
9165
|
+
active: { default: true, required: true, type: Boolean },
|
|
9166
|
+
couponCode: { required: true, type: couponCodeSchema },
|
|
9167
|
+
couponDescription: { required: true, type: String },
|
|
9168
|
+
couponOption: { required: true, type: couponOptionSchema },
|
|
9169
|
+
couponRewards: { required: false, type: [couponRewardSchema] },
|
|
9170
|
+
endDate: { required: true, type: Date },
|
|
9171
|
+
participantUsers: {
|
|
9172
|
+
default: null,
|
|
9173
|
+
required: false,
|
|
9174
|
+
type: [couponParticipantUserSchema]
|
|
9175
|
+
},
|
|
9176
|
+
resourceId: { required: true, type: String },
|
|
9177
|
+
resourceType: {
|
|
9178
|
+
enum: Object.values(EnumResourceType),
|
|
9179
|
+
required: true,
|
|
9180
|
+
type: String
|
|
9181
|
+
},
|
|
9182
|
+
startDate: { required: true, type: Date }
|
|
9183
|
+
},
|
|
9184
|
+
{ timestamps: true }
|
|
9185
|
+
);
|
|
9186
|
+
var schema9 = new MongooseSchema13(
|
|
9187
|
+
{
|
|
9188
|
+
active: { default: true, required: true, type: Boolean },
|
|
9189
|
+
couponData: { default: [], required: false, type: [couponDataSchema] },
|
|
9190
|
+
deletedAt: { default: null, required: false, type: Date },
|
|
9191
|
+
owner: {
|
|
9192
|
+
required: true,
|
|
9193
|
+
type: OwnerTypeSchema
|
|
9194
|
+
}
|
|
9195
|
+
},
|
|
9196
|
+
{ timestamps: true }
|
|
9197
|
+
);
|
|
9198
|
+
var CouponModel = import_mongoose13.default.models.Coupon || import_mongoose13.default.model("Coupon", schema9);
|
|
9199
|
+
|
|
9200
|
+
// src/mongoose/vendor/Vendor.ts
|
|
9201
|
+
var MongooseSchema14 = import_mongoose14.default.Schema;
|
|
9202
|
+
var vendorProductTypeSchema = new MongooseSchema14(
|
|
9203
|
+
{
|
|
9204
|
+
coupon: { required: false, type: productCouponSchema },
|
|
9059
9205
|
description: { required: false, type: String },
|
|
9060
|
-
hasCoupon: { default: false, required: false, type: Boolean },
|
|
9061
9206
|
name: { required: true, type: String },
|
|
9062
9207
|
price: { required: true, type: Number },
|
|
9063
9208
|
priceUnit: { required: true, type: String },
|
|
@@ -9065,14 +9210,14 @@ var vendorProductTypeSchema = new MongooseSchema13(
|
|
|
9065
9210
|
},
|
|
9066
9211
|
{ timestamps: true }
|
|
9067
9212
|
);
|
|
9068
|
-
var productWrapperSchema = new
|
|
9213
|
+
var productWrapperSchema = new MongooseSchema14(
|
|
9069
9214
|
{
|
|
9070
9215
|
active: { default: false, required: true, type: Boolean },
|
|
9071
9216
|
productsList: { required: false, type: [vendorProductTypeSchema] }
|
|
9072
9217
|
},
|
|
9073
9218
|
{ _id: false }
|
|
9074
9219
|
);
|
|
9075
|
-
var calendarSchema = new
|
|
9220
|
+
var calendarSchema = new MongooseSchema14(
|
|
9076
9221
|
{
|
|
9077
9222
|
dateTime: {
|
|
9078
9223
|
dateStatus: {
|
|
@@ -9093,14 +9238,14 @@ var calendarSchema = new MongooseSchema13(
|
|
|
9093
9238
|
},
|
|
9094
9239
|
{ _id: false }
|
|
9095
9240
|
);
|
|
9096
|
-
var calendarWrapperSchema = new
|
|
9241
|
+
var calendarWrapperSchema = new MongooseSchema14(
|
|
9097
9242
|
{
|
|
9098
9243
|
active: { default: false, required: true, type: Boolean },
|
|
9099
9244
|
calendarData: { required: false, type: [calendarSchema] }
|
|
9100
9245
|
},
|
|
9101
9246
|
{ _id: false }
|
|
9102
9247
|
);
|
|
9103
|
-
var
|
|
9248
|
+
var schema10 = new MongooseSchema14(
|
|
9104
9249
|
{
|
|
9105
9250
|
...baseResourceFields,
|
|
9106
9251
|
// Importing base resource fields from global.ts
|
|
@@ -9126,12 +9271,12 @@ var schema9 = new MongooseSchema13(
|
|
|
9126
9271
|
unregisteredVendorId: {
|
|
9127
9272
|
ref: "UnregisteredVendor",
|
|
9128
9273
|
required: false,
|
|
9129
|
-
type:
|
|
9274
|
+
type: import_mongoose14.default.Schema.Types.ObjectId
|
|
9130
9275
|
},
|
|
9131
9276
|
vendorInfoId: {
|
|
9132
9277
|
ref: "VendorInfo",
|
|
9133
9278
|
required: false,
|
|
9134
|
-
type:
|
|
9279
|
+
type: import_mongoose14.default.Schema.Types.ObjectId
|
|
9135
9280
|
},
|
|
9136
9281
|
vendorType: {
|
|
9137
9282
|
enum: Object.values(EnumVendorType),
|
|
@@ -9141,24 +9286,24 @@ var schema9 = new MongooseSchema13(
|
|
|
9141
9286
|
},
|
|
9142
9287
|
{ timestamps: true }
|
|
9143
9288
|
);
|
|
9144
|
-
|
|
9145
|
-
|
|
9146
|
-
|
|
9147
|
-
|
|
9148
|
-
|
|
9149
|
-
var VendorModel =
|
|
9289
|
+
schema10.index({ name: 1 });
|
|
9290
|
+
schema10.index({ description: 1 });
|
|
9291
|
+
schema10.index({ region: 1 });
|
|
9292
|
+
schema10.index({ "categories.name": 1 });
|
|
9293
|
+
schema10.index({ slug: 1 });
|
|
9294
|
+
var VendorModel = import_mongoose14.default.models.Vendor || import_mongoose14.default.model("Vendor", schema10);
|
|
9150
9295
|
|
|
9151
9296
|
// src/mongoose/vendor/VendorInfo.ts
|
|
9152
|
-
var
|
|
9153
|
-
var
|
|
9154
|
-
var AttributesSchema = new
|
|
9297
|
+
var import_mongoose15 = __toESM(require("mongoose"));
|
|
9298
|
+
var MongooseSchema15 = import_mongoose15.default.Schema;
|
|
9299
|
+
var AttributesSchema = new MongooseSchema15(
|
|
9155
9300
|
{
|
|
9156
9301
|
details: { required: false, type: String },
|
|
9157
9302
|
isRequired: { default: false, required: true, type: Boolean }
|
|
9158
9303
|
},
|
|
9159
9304
|
{ _id: false }
|
|
9160
9305
|
);
|
|
9161
|
-
var
|
|
9306
|
+
var schema11 = new MongooseSchema15(
|
|
9162
9307
|
{
|
|
9163
9308
|
active: { default: true, type: Boolean },
|
|
9164
9309
|
compliance: {
|
|
@@ -9193,28 +9338,28 @@ var schema10 = new MongooseSchema14(
|
|
|
9193
9338
|
vendorId: {
|
|
9194
9339
|
ref: "Vendor",
|
|
9195
9340
|
required: true,
|
|
9196
|
-
type:
|
|
9341
|
+
type: import_mongoose15.default.Schema.Types.ObjectId
|
|
9197
9342
|
}
|
|
9198
9343
|
},
|
|
9199
9344
|
{ timestamps: true }
|
|
9200
9345
|
);
|
|
9201
|
-
var VendorInfoModel =
|
|
9346
|
+
var VendorInfoModel = import_mongoose15.default.models.VendorInfo || import_mongoose15.default.model("VendorInfo", schema11);
|
|
9202
9347
|
|
|
9203
9348
|
// src/mongoose/vendor/UnregisteredVendor.ts
|
|
9204
|
-
var
|
|
9205
|
-
var
|
|
9206
|
-
var invitationSchema = new
|
|
9349
|
+
var import_mongoose16 = __toESM(require("mongoose"));
|
|
9350
|
+
var MongooseSchema16 = import_mongoose16.default.Schema;
|
|
9351
|
+
var invitationSchema = new MongooseSchema16(
|
|
9207
9352
|
{
|
|
9208
9353
|
dateTime: { required: true, type: [dateTimeSchema2] },
|
|
9209
9354
|
inviterId: {
|
|
9210
9355
|
ref: "Event",
|
|
9211
9356
|
required: true,
|
|
9212
|
-
type:
|
|
9357
|
+
type: import_mongoose16.default.Schema.Types.ObjectId
|
|
9213
9358
|
}
|
|
9214
9359
|
},
|
|
9215
9360
|
{ _id: false }
|
|
9216
9361
|
);
|
|
9217
|
-
var
|
|
9362
|
+
var schema12 = new MongooseSchema16(
|
|
9218
9363
|
{
|
|
9219
9364
|
active: { default: true, required: true, type: Boolean },
|
|
9220
9365
|
categoryIds: { required: true, type: [String] },
|
|
@@ -9223,7 +9368,7 @@ var schema11 = new MongooseSchema15(
|
|
|
9223
9368
|
claimedByUserId: {
|
|
9224
9369
|
ref: "User",
|
|
9225
9370
|
required: false,
|
|
9226
|
-
type:
|
|
9371
|
+
type: import_mongoose16.default.Schema.Types.ObjectId
|
|
9227
9372
|
},
|
|
9228
9373
|
claimInitiatedAt: { default: null, required: false, type: Date },
|
|
9229
9374
|
claimToken: { default: null, required: false, type: String },
|
|
@@ -9236,14 +9381,14 @@ var schema11 = new MongooseSchema15(
|
|
|
9236
9381
|
},
|
|
9237
9382
|
{ timestamps: true }
|
|
9238
9383
|
);
|
|
9239
|
-
|
|
9240
|
-
|
|
9241
|
-
var UnregisteredVendorModel =
|
|
9384
|
+
schema12.index({ name: 1 });
|
|
9385
|
+
schema12.index({ email: 1 });
|
|
9386
|
+
var UnregisteredVendorModel = import_mongoose16.default.models.UnregisteredVendor || import_mongoose16.default.model("UnregisteredVendor", schema12);
|
|
9242
9387
|
|
|
9243
9388
|
// src/mongoose/event/Event.ts
|
|
9244
|
-
var
|
|
9245
|
-
var
|
|
9246
|
-
var
|
|
9389
|
+
var import_mongoose17 = __toESM(require("mongoose"));
|
|
9390
|
+
var MongooseSchema17 = import_mongoose17.default.Schema;
|
|
9391
|
+
var schema13 = new MongooseSchema17(
|
|
9247
9392
|
{
|
|
9248
9393
|
...baseResourceFields,
|
|
9249
9394
|
// Importing base resource fields from global.ts
|
|
@@ -9252,7 +9397,7 @@ var schema12 = new MongooseSchema16(
|
|
|
9252
9397
|
eventInfoId: {
|
|
9253
9398
|
ref: "EventInfo",
|
|
9254
9399
|
required: false,
|
|
9255
|
-
type:
|
|
9400
|
+
type: import_mongoose17.default.Schema.Types.ObjectId
|
|
9256
9401
|
},
|
|
9257
9402
|
eventType: {
|
|
9258
9403
|
enum: Object.values(EnumEventType),
|
|
@@ -9281,20 +9426,20 @@ var schema12 = new MongooseSchema16(
|
|
|
9281
9426
|
},
|
|
9282
9427
|
{ timestamps: true }
|
|
9283
9428
|
);
|
|
9284
|
-
|
|
9285
|
-
|
|
9286
|
-
|
|
9287
|
-
|
|
9288
|
-
|
|
9289
|
-
|
|
9290
|
-
|
|
9291
|
-
|
|
9292
|
-
var EventModel =
|
|
9429
|
+
schema13.index({ name: 1 });
|
|
9430
|
+
schema13.index({ description: 1 });
|
|
9431
|
+
schema13.index({ region: 1 });
|
|
9432
|
+
schema13.index({ "location.geo": "2dsphere" });
|
|
9433
|
+
schema13.index({ tags: 1 });
|
|
9434
|
+
schema13.index({ deletedAt: 1 });
|
|
9435
|
+
schema13.index({ "dateTime.dateStatus": 1 });
|
|
9436
|
+
schema13.index({ slug: 1 });
|
|
9437
|
+
var EventModel = import_mongoose17.default.models.Event || import_mongoose17.default.model("Event", schema13);
|
|
9293
9438
|
|
|
9294
9439
|
// src/mongoose/Partner.ts
|
|
9295
|
-
var
|
|
9296
|
-
var
|
|
9297
|
-
var
|
|
9440
|
+
var import_mongoose18 = __toESM(require("mongoose"));
|
|
9441
|
+
var MongooseSchema18 = import_mongoose18.default.Schema;
|
|
9442
|
+
var schema14 = new MongooseSchema18(
|
|
9298
9443
|
{
|
|
9299
9444
|
...baseResourceFields,
|
|
9300
9445
|
location: {
|
|
@@ -9310,19 +9455,19 @@ var schema13 = new MongooseSchema17(
|
|
|
9310
9455
|
},
|
|
9311
9456
|
{ timestamps: true }
|
|
9312
9457
|
);
|
|
9313
|
-
|
|
9314
|
-
|
|
9315
|
-
|
|
9316
|
-
|
|
9317
|
-
|
|
9318
|
-
var PartnerModel =
|
|
9458
|
+
schema14.index({ name: 1 });
|
|
9459
|
+
schema14.index({ description: 1 });
|
|
9460
|
+
schema14.index({ region: 1 });
|
|
9461
|
+
schema14.index({ "location.geo": "2dsphere" });
|
|
9462
|
+
schema14.index({ slug: 1 });
|
|
9463
|
+
var PartnerModel = import_mongoose18.default.models.Partner || import_mongoose18.default.model("Partner", schema14);
|
|
9319
9464
|
|
|
9320
9465
|
// src/mongoose/Post.ts
|
|
9321
|
-
var
|
|
9322
|
-
var
|
|
9323
|
-
var contentSchema = new
|
|
9466
|
+
var import_mongoose19 = __toESM(require("mongoose"));
|
|
9467
|
+
var MongooseSchema19 = import_mongoose19.default.Schema;
|
|
9468
|
+
var contentSchema = new MongooseSchema19(
|
|
9324
9469
|
{
|
|
9325
|
-
contentData:
|
|
9470
|
+
contentData: import_mongoose19.Schema.Types.Mixed,
|
|
9326
9471
|
contentOrder: { required: true, type: Number },
|
|
9327
9472
|
contentType: {
|
|
9328
9473
|
enum: Object.values(EnumPostContentType),
|
|
@@ -9332,7 +9477,7 @@ var contentSchema = new MongooseSchema18(
|
|
|
9332
9477
|
},
|
|
9333
9478
|
{ _id: false }
|
|
9334
9479
|
);
|
|
9335
|
-
var resourceSchema = new
|
|
9480
|
+
var resourceSchema = new MongooseSchema19(
|
|
9336
9481
|
{
|
|
9337
9482
|
resourceId: { required: true, type: String },
|
|
9338
9483
|
resourceRegion: { required: true, type: String },
|
|
@@ -9345,7 +9490,7 @@ var resourceSchema = new MongooseSchema18(
|
|
|
9345
9490
|
},
|
|
9346
9491
|
{ _id: false }
|
|
9347
9492
|
);
|
|
9348
|
-
var
|
|
9493
|
+
var schema15 = new MongooseSchema19(
|
|
9349
9494
|
{
|
|
9350
9495
|
active: { default: false, required: true, type: Boolean },
|
|
9351
9496
|
approvedAt: { default: null, required: false, type: Date },
|
|
@@ -9376,16 +9521,16 @@ var schema14 = new MongooseSchema18(
|
|
|
9376
9521
|
},
|
|
9377
9522
|
{ timestamps: true }
|
|
9378
9523
|
);
|
|
9379
|
-
|
|
9380
|
-
|
|
9381
|
-
|
|
9382
|
-
var PostModel =
|
|
9524
|
+
schema15.index({ title: 1 });
|
|
9525
|
+
schema15.index({ tags: 1 });
|
|
9526
|
+
schema15.index({ postType: 1, slug: 1 }, { unique: true });
|
|
9527
|
+
var PostModel = import_mongoose19.default.models.Post || import_mongoose19.default.model("Post", schema15);
|
|
9383
9528
|
|
|
9384
9529
|
// src/mongoose/AppSetting.ts
|
|
9385
|
-
var
|
|
9386
|
-
var
|
|
9530
|
+
var import_mongoose20 = __toESM(require("mongoose"));
|
|
9531
|
+
var MongooseSchema20 = import_mongoose20.default.Schema;
|
|
9387
9532
|
var APP_SETTINGS_ID = "APP_SETTINGS_DOCUMENT_ID";
|
|
9388
|
-
var AppSettingSchema = new
|
|
9533
|
+
var AppSettingSchema = new MongooseSchema20(
|
|
9389
9534
|
{
|
|
9390
9535
|
activeSchoolsStudentCountTotal: {
|
|
9391
9536
|
default: 0,
|
|
@@ -9416,18 +9561,18 @@ var AppSettingSchema = new MongooseSchema19(
|
|
|
9416
9561
|
},
|
|
9417
9562
|
{ timestamps: true }
|
|
9418
9563
|
);
|
|
9419
|
-
var AppSettingModel =
|
|
9564
|
+
var AppSettingModel = import_mongoose20.default.models.AppSetting || import_mongoose20.default.model("AppSetting", AppSettingSchema);
|
|
9420
9565
|
|
|
9421
9566
|
// src/mongoose/game/Game.ts
|
|
9422
|
-
var
|
|
9567
|
+
var import_mongoose24 = __toESM(require("mongoose"));
|
|
9423
9568
|
|
|
9424
9569
|
// src/mongoose/game/DailyClue.ts
|
|
9425
|
-
var
|
|
9570
|
+
var import_mongoose22 = __toESM(require("mongoose"));
|
|
9426
9571
|
|
|
9427
9572
|
// src/mongoose/game/utils.ts
|
|
9428
|
-
var
|
|
9429
|
-
var
|
|
9430
|
-
var schemaGameDate = new
|
|
9573
|
+
var import_mongoose21 = __toESM(require("mongoose"));
|
|
9574
|
+
var MongooseSchema21 = import_mongoose21.default.Schema;
|
|
9575
|
+
var schemaGameDate = new MongooseSchema21(
|
|
9431
9576
|
{
|
|
9432
9577
|
endDate: { required: true, type: Date },
|
|
9433
9578
|
startDate: { required: true, type: Date }
|
|
@@ -9436,8 +9581,8 @@ var schemaGameDate = new MongooseSchema20(
|
|
|
9436
9581
|
);
|
|
9437
9582
|
|
|
9438
9583
|
// src/mongoose/game/DailyClue.ts
|
|
9439
|
-
var
|
|
9440
|
-
var schemaLetters = new
|
|
9584
|
+
var MongooseSchema22 = import_mongoose22.default.Schema;
|
|
9585
|
+
var schemaLetters = new MongooseSchema22(
|
|
9441
9586
|
{
|
|
9442
9587
|
collected: { required: false, type: [String] },
|
|
9443
9588
|
solutionShuffled: { required: true, type: [String] }
|
|
@@ -9445,14 +9590,14 @@ var schemaLetters = new MongooseSchema21(
|
|
|
9445
9590
|
},
|
|
9446
9591
|
{ _id: false }
|
|
9447
9592
|
);
|
|
9448
|
-
var schemaDailyClueBaseGame = new
|
|
9593
|
+
var schemaDailyClueBaseGame = new MongooseSchema22(
|
|
9449
9594
|
{
|
|
9450
9595
|
gameDate: { required: true, type: schemaGameDate },
|
|
9451
9596
|
gameSolution: { required: true, type: String }
|
|
9452
9597
|
},
|
|
9453
9598
|
{ _id: false }
|
|
9454
9599
|
);
|
|
9455
|
-
var schemaDailyClueGameData = new
|
|
9600
|
+
var schemaDailyClueGameData = new MongooseSchema22(
|
|
9456
9601
|
{
|
|
9457
9602
|
gameFields: { required: true, type: schemaDailyClueBaseGame },
|
|
9458
9603
|
lastFoundDate: { default: null, required: false, type: Date },
|
|
@@ -9467,9 +9612,9 @@ var schemaDailyClueGameData = new MongooseSchema21(
|
|
|
9467
9612
|
);
|
|
9468
9613
|
|
|
9469
9614
|
// src/mongoose/game/PuzzleGame.ts
|
|
9470
|
-
var
|
|
9471
|
-
var
|
|
9472
|
-
var schemaPuzzleAnswer = new
|
|
9615
|
+
var import_mongoose23 = __toESM(require("mongoose"));
|
|
9616
|
+
var MongooseSchema23 = import_mongoose23.default.Schema;
|
|
9617
|
+
var schemaPuzzleAnswer = new MongooseSchema23(
|
|
9473
9618
|
{
|
|
9474
9619
|
answer: { required: true, type: String },
|
|
9475
9620
|
answerId: { required: true, type: String },
|
|
@@ -9477,7 +9622,7 @@ var schemaPuzzleAnswer = new MongooseSchema22(
|
|
|
9477
9622
|
},
|
|
9478
9623
|
{ _id: false }
|
|
9479
9624
|
);
|
|
9480
|
-
var schemaPuzzleQuestion = new
|
|
9625
|
+
var schemaPuzzleQuestion = new MongooseSchema23(
|
|
9481
9626
|
{
|
|
9482
9627
|
answers: { required: true, type: [schemaPuzzleAnswer] },
|
|
9483
9628
|
question: { required: true, type: String },
|
|
@@ -9485,20 +9630,20 @@ var schemaPuzzleQuestion = new MongooseSchema22(
|
|
|
9485
9630
|
},
|
|
9486
9631
|
{ _id: false }
|
|
9487
9632
|
);
|
|
9488
|
-
var schemaPuzzleBaseGame = new
|
|
9633
|
+
var schemaPuzzleBaseGame = new MongooseSchema23(
|
|
9489
9634
|
{
|
|
9490
9635
|
questions: { required: true, type: [schemaPuzzleQuestion] }
|
|
9491
9636
|
},
|
|
9492
9637
|
{ _id: false }
|
|
9493
9638
|
);
|
|
9494
|
-
var schemaPuzzleAnsweredQuestion = new
|
|
9639
|
+
var schemaPuzzleAnsweredQuestion = new MongooseSchema23(
|
|
9495
9640
|
{
|
|
9496
9641
|
questionId: { required: true, type: String },
|
|
9497
9642
|
selectedAnswerId: { required: true, type: String }
|
|
9498
9643
|
},
|
|
9499
9644
|
{ _id: false }
|
|
9500
9645
|
);
|
|
9501
|
-
var schemaPuzzleGameData = new
|
|
9646
|
+
var schemaPuzzleGameData = new MongooseSchema23(
|
|
9502
9647
|
{
|
|
9503
9648
|
answeredQuestions: {
|
|
9504
9649
|
default: null,
|
|
@@ -9513,7 +9658,7 @@ var schemaPuzzleGameData = new MongooseSchema22(
|
|
|
9513
9658
|
);
|
|
9514
9659
|
|
|
9515
9660
|
// src/mongoose/game/Game.ts
|
|
9516
|
-
var
|
|
9661
|
+
var MongooseSchema24 = import_mongoose24.default.Schema;
|
|
9517
9662
|
var gameDataSchemas = {
|
|
9518
9663
|
[EnumGameType.DAILY_CLUE]: schemaDailyClueGameData,
|
|
9519
9664
|
[EnumGameType.MINI_QUIZ]: schemaPuzzleGameData,
|
|
@@ -9525,7 +9670,7 @@ var gameDataDefinition = Object.fromEntries(
|
|
|
9525
9670
|
{ default: null, required: false, type: schema19 }
|
|
9526
9671
|
])
|
|
9527
9672
|
);
|
|
9528
|
-
var gameHistorySchema = new
|
|
9673
|
+
var gameHistorySchema = new MongooseSchema24(
|
|
9529
9674
|
{
|
|
9530
9675
|
createdAt: { required: true, type: Date },
|
|
9531
9676
|
gameDate: { required: true, type: schemaGameDate },
|
|
@@ -9545,7 +9690,7 @@ var gameHistorySchema = new MongooseSchema23(
|
|
|
9545
9690
|
},
|
|
9546
9691
|
{ _id: false }
|
|
9547
9692
|
);
|
|
9548
|
-
var gameTypeSchema = new
|
|
9693
|
+
var gameTypeSchema = new MongooseSchema24(
|
|
9549
9694
|
{
|
|
9550
9695
|
active: { default: true, required: true, type: Boolean },
|
|
9551
9696
|
gameData: gameDataDefinition,
|
|
@@ -9560,7 +9705,7 @@ var gameTypeSchema = new MongooseSchema23(
|
|
|
9560
9705
|
},
|
|
9561
9706
|
{ timestamps: true }
|
|
9562
9707
|
);
|
|
9563
|
-
var
|
|
9708
|
+
var schema16 = new MongooseSchema24(
|
|
9564
9709
|
{
|
|
9565
9710
|
active: { default: false, required: true, type: Boolean },
|
|
9566
9711
|
deletedAt: { default: null, required: false, type: Date },
|
|
@@ -9573,12 +9718,12 @@ var schema15 = new MongooseSchema23(
|
|
|
9573
9718
|
},
|
|
9574
9719
|
{ timestamps: true }
|
|
9575
9720
|
);
|
|
9576
|
-
var GameModel =
|
|
9721
|
+
var GameModel = import_mongoose24.default.models.Game || import_mongoose24.default.model("Game", schema16);
|
|
9577
9722
|
|
|
9578
9723
|
// src/mongoose/School.ts
|
|
9579
|
-
var
|
|
9580
|
-
var
|
|
9581
|
-
var campaignsSchema = new
|
|
9724
|
+
var import_mongoose25 = __toESM(require("mongoose"));
|
|
9725
|
+
var MongooseSchema25 = import_mongoose25.default.Schema;
|
|
9726
|
+
var campaignsSchema = new MongooseSchema25(
|
|
9582
9727
|
{
|
|
9583
9728
|
endDate: { required: true, type: Date },
|
|
9584
9729
|
name: { required: true, type: String },
|
|
@@ -9586,7 +9731,7 @@ var campaignsSchema = new MongooseSchema24(
|
|
|
9586
9731
|
},
|
|
9587
9732
|
{ _id: false }
|
|
9588
9733
|
);
|
|
9589
|
-
var
|
|
9734
|
+
var schema17 = new MongooseSchema25(
|
|
9590
9735
|
{
|
|
9591
9736
|
// New schools are active by default
|
|
9592
9737
|
active: { default: false, required: true, type: Boolean },
|
|
@@ -9613,19 +9758,19 @@ var schema16 = new MongooseSchema24(
|
|
|
9613
9758
|
},
|
|
9614
9759
|
{ timestamps: true }
|
|
9615
9760
|
);
|
|
9616
|
-
|
|
9761
|
+
schema17.index(
|
|
9617
9762
|
{ schoolCode: 1 },
|
|
9618
9763
|
{
|
|
9619
9764
|
partialFilterExpression: { active: true, deletedAt: null },
|
|
9620
9765
|
unique: true
|
|
9621
9766
|
}
|
|
9622
9767
|
);
|
|
9623
|
-
var SchoolModel =
|
|
9768
|
+
var SchoolModel = import_mongoose25.default.models.School || import_mongoose25.default.model("School", schema17);
|
|
9624
9769
|
|
|
9625
9770
|
// src/mongoose/Affiliate.ts
|
|
9626
|
-
var
|
|
9627
|
-
var
|
|
9628
|
-
var affiliateRewardSchema = new
|
|
9771
|
+
var import_mongoose26 = __toESM(require("mongoose"));
|
|
9772
|
+
var MongooseSchema26 = import_mongoose26.default.Schema;
|
|
9773
|
+
var affiliateRewardSchema = new MongooseSchema26(
|
|
9629
9774
|
{
|
|
9630
9775
|
createdAt: { required: true, type: Date },
|
|
9631
9776
|
redeemedAt: { default: null, required: false, type: Date },
|
|
@@ -9639,13 +9784,13 @@ var affiliateRewardSchema = new MongooseSchema25(
|
|
|
9639
9784
|
},
|
|
9640
9785
|
{ _id: false }
|
|
9641
9786
|
);
|
|
9642
|
-
var affiliateResourceSchema = new
|
|
9787
|
+
var affiliateResourceSchema = new MongooseSchema26(
|
|
9643
9788
|
{
|
|
9644
9789
|
resourceActive: { default: true, required: true, type: Boolean },
|
|
9645
9790
|
resourceDeletedAt: { default: null, required: false, type: Date },
|
|
9646
9791
|
resourceId: {
|
|
9647
9792
|
required: true,
|
|
9648
|
-
type:
|
|
9793
|
+
type: import_mongoose26.default.Schema.Types.ObjectId
|
|
9649
9794
|
},
|
|
9650
9795
|
resourceName: { required: true, type: String },
|
|
9651
9796
|
resourceOwner: {
|
|
@@ -9665,20 +9810,20 @@ var affiliateResourceSchema = new MongooseSchema25(
|
|
|
9665
9810
|
},
|
|
9666
9811
|
{ _id: false }
|
|
9667
9812
|
);
|
|
9668
|
-
var affiliateContactDetailsSchema = new
|
|
9813
|
+
var affiliateContactDetailsSchema = new MongooseSchema26(
|
|
9669
9814
|
{
|
|
9670
9815
|
mobilePhone: { required: true, type: String }
|
|
9671
9816
|
},
|
|
9672
9817
|
{ _id: false }
|
|
9673
9818
|
);
|
|
9674
|
-
var affiliateBankAccountDetailsSchema = new
|
|
9819
|
+
var affiliateBankAccountDetailsSchema = new MongooseSchema26(
|
|
9675
9820
|
{
|
|
9676
9821
|
accountHolderName: { required: true, type: String },
|
|
9677
9822
|
accountNumber: { required: true, type: String }
|
|
9678
9823
|
},
|
|
9679
9824
|
{ _id: false }
|
|
9680
9825
|
);
|
|
9681
|
-
var affiliateDetailsSchema = new
|
|
9826
|
+
var affiliateDetailsSchema = new MongooseSchema26(
|
|
9682
9827
|
{
|
|
9683
9828
|
bankAccountDetails: {
|
|
9684
9829
|
required: true,
|
|
@@ -9700,7 +9845,7 @@ var affiliateDetailsSchema = new MongooseSchema25(
|
|
|
9700
9845
|
},
|
|
9701
9846
|
{ _id: false }
|
|
9702
9847
|
);
|
|
9703
|
-
var redeemHistorySchema = new
|
|
9848
|
+
var redeemHistorySchema = new MongooseSchema26(
|
|
9704
9849
|
{
|
|
9705
9850
|
paidAt: { default: null, required: false, type: Date },
|
|
9706
9851
|
redeemedAt: { required: true, type: Date },
|
|
@@ -9708,7 +9853,7 @@ var redeemHistorySchema = new MongooseSchema25(
|
|
|
9708
9853
|
},
|
|
9709
9854
|
{ _id: false }
|
|
9710
9855
|
);
|
|
9711
|
-
var
|
|
9856
|
+
var schema18 = new MongooseSchema26(
|
|
9712
9857
|
{
|
|
9713
9858
|
active: { default: false, required: true, type: Boolean },
|
|
9714
9859
|
affiliateBonusRewards: {
|
|
@@ -9738,71 +9883,14 @@ var schema17 = new MongooseSchema25(
|
|
|
9738
9883
|
},
|
|
9739
9884
|
{ timestamps: true }
|
|
9740
9885
|
);
|
|
9741
|
-
|
|
9886
|
+
schema18.index(
|
|
9742
9887
|
{ affiliateCode: 1 },
|
|
9743
9888
|
{
|
|
9744
9889
|
partialFilterExpression: { active: true, deletedAt: null },
|
|
9745
9890
|
unique: true
|
|
9746
9891
|
}
|
|
9747
9892
|
);
|
|
9748
|
-
var AffiliateModel =
|
|
9749
|
-
|
|
9750
|
-
// src/mongoose/Coupon.ts
|
|
9751
|
-
var import_mongoose26 = __toESM(require("mongoose"));
|
|
9752
|
-
var MongooseSchema26 = import_mongoose26.default.Schema;
|
|
9753
|
-
var couponOptionSchema = new MongooseSchema26(
|
|
9754
|
-
{
|
|
9755
|
-
buy: { required: true, type: Number },
|
|
9756
|
-
get: { required: true, type: Number },
|
|
9757
|
-
unit: { required: true, type: String }
|
|
9758
|
-
},
|
|
9759
|
-
{ _id: false }
|
|
9760
|
-
);
|
|
9761
|
-
var couponCodeSchema = new MongooseSchema26(
|
|
9762
|
-
{
|
|
9763
|
-
code: { required: true, type: String },
|
|
9764
|
-
qrCode: { required: true, type: ResourceImageTypeSchema }
|
|
9765
|
-
},
|
|
9766
|
-
{ _id: false }
|
|
9767
|
-
);
|
|
9768
|
-
var couponParticipantUserSchema = new MongooseSchema26(
|
|
9769
|
-
{
|
|
9770
|
-
couponCount: { default: 0, required: true, type: Number },
|
|
9771
|
-
couponRedeemedAt: { default: null, required: false, type: Date },
|
|
9772
|
-
userId: {
|
|
9773
|
-
ref: "User",
|
|
9774
|
-
required: true,
|
|
9775
|
-
type: import_mongoose26.default.Schema.Types.ObjectId
|
|
9776
|
-
}
|
|
9777
|
-
},
|
|
9778
|
-
{ timestamps: true }
|
|
9779
|
-
);
|
|
9780
|
-
var productCouponSchema = new MongooseSchema26(
|
|
9781
|
-
{
|
|
9782
|
-
active: { default: true, required: true, type: Boolean },
|
|
9783
|
-
couponCode: { required: true, type: couponCodeSchema },
|
|
9784
|
-
couponDescription: { required: true, type: String },
|
|
9785
|
-
couponOption: { required: true, type: couponOptionSchema },
|
|
9786
|
-
endDate: { required: true, type: Date },
|
|
9787
|
-
participantProduct: { required: true, type: vendorProductTypeSchema },
|
|
9788
|
-
participantUsers: {
|
|
9789
|
-
default: null,
|
|
9790
|
-
required: false,
|
|
9791
|
-
type: [couponParticipantUserSchema]
|
|
9792
|
-
},
|
|
9793
|
-
startDate: { required: true, type: Date }
|
|
9794
|
-
},
|
|
9795
|
-
{ timestamps: true }
|
|
9796
|
-
);
|
|
9797
|
-
var schema18 = new MongooseSchema26(
|
|
9798
|
-
{
|
|
9799
|
-
active: { default: true, required: true, type: Boolean },
|
|
9800
|
-
deletedAt: { default: null, required: false, type: Date },
|
|
9801
|
-
productCoupons: { required: false, type: [productCouponSchema] }
|
|
9802
|
-
},
|
|
9803
|
-
{ timestamps: true }
|
|
9804
|
-
);
|
|
9805
|
-
var CouponModel = import_mongoose26.default.models.Coupon || import_mongoose26.default.model("Coupon", schema18);
|
|
9893
|
+
var AffiliateModel = import_mongoose26.default.models.Affiliate || import_mongoose26.default.model("Affiliate", schema18);
|
|
9806
9894
|
|
|
9807
9895
|
// src/service/promoCode/constants.ts
|
|
9808
9896
|
var ACTIVE_NOT_DELETED_FILTER = {
|
|
@@ -9874,7 +9962,7 @@ var SHARE_RESOURCE_LABEL2 = {
|
|
|
9874
9962
|
school: "School"
|
|
9875
9963
|
};
|
|
9876
9964
|
|
|
9877
|
-
// node_modules/@timardex/cluemart-shared/dist/chunk-
|
|
9965
|
+
// node_modules/@timardex/cluemart-shared/dist/chunk-UV5GH6NI.mjs
|
|
9878
9966
|
var PROMO_CODE_PREFIX2 = "CM-";
|
|
9879
9967
|
var OBJECT_ID_PATH_SEGMENT2 = "[a-f0-9]{24}";
|
|
9880
9968
|
var OBJECT_ID_PATH_SEGMENT_END2 = `${OBJECT_ID_PATH_SEGMENT2}$`;
|
|
@@ -9976,7 +10064,7 @@ var gameScreenIdentifierList2 = [
|
|
|
9976
10064
|
}
|
|
9977
10065
|
];
|
|
9978
10066
|
|
|
9979
|
-
// node_modules/@timardex/cluemart-shared/dist/chunk-
|
|
10067
|
+
// node_modules/@timardex/cluemart-shared/dist/chunk-3UYXNSNB.mjs
|
|
9980
10068
|
var import_dayjs4 = __toESM(require("dayjs"), 1);
|
|
9981
10069
|
var statusOptions2 = [
|
|
9982
10070
|
...Object.values(EnumInviteStatus2).map((status) => ({
|
|
@@ -11787,6 +11875,7 @@ function updateRelationDatesToUnavailable(relationDates, eventDateTime) {
|
|
|
11787
11875
|
normalizeAffiliatePromoCodes,
|
|
11788
11876
|
normalizePromoCode,
|
|
11789
11877
|
notifyUsers,
|
|
11878
|
+
productCouponSchema,
|
|
11790
11879
|
publishNotificationEvents,
|
|
11791
11880
|
refundPolicySchema,
|
|
11792
11881
|
relatedPostSchema,
|