@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
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,19 @@ 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
|
|
5625
|
+
priceMax
|
|
5513
5626
|
priceUnit
|
|
5514
5627
|
productGroups
|
|
5515
5628
|
updatedAt
|
|
5516
5629
|
}
|
|
5630
|
+
${PRODUCT_COUPON_FIELDS_FRAGMENT}
|
|
5517
5631
|
`;
|
|
5518
5632
|
var VENDOR = gql`
|
|
5519
5633
|
fragment VendorFields on VendorType {
|
|
@@ -7815,79 +7929,6 @@ var ASSIGN_AFFILIATE_BONUS_REWARD_MUTATION = gql`
|
|
|
7815
7929
|
}
|
|
7816
7930
|
${AFFILIATE_FIELDS_FRAGMENT}
|
|
7817
7931
|
`;
|
|
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
7932
|
var CREATE_COUPON_MUTATION = gql`
|
|
7892
7933
|
mutation createCoupon($input: CouponInputType!) {
|
|
7893
7934
|
createCoupon(input: $input) {
|
|
@@ -8587,7 +8628,7 @@ var baseResourceFields = {
|
|
|
8587
8628
|
logo: { required: false, type: ResourceImageTypeSchema },
|
|
8588
8629
|
name: { required: true, type: String },
|
|
8589
8630
|
owner: {
|
|
8590
|
-
required:
|
|
8631
|
+
required: true,
|
|
8591
8632
|
type: OwnerTypeSchema
|
|
8592
8633
|
},
|
|
8593
8634
|
posterUsage: { required: false, type: PosterUsageTypeSchema },
|
|
@@ -8932,6 +8973,11 @@ var schema7 = new MongooseSchema11(
|
|
|
8932
8973
|
required: false,
|
|
8933
8974
|
type: ResourceImageTypeSchema
|
|
8934
8975
|
},
|
|
8976
|
+
coupon: {
|
|
8977
|
+
ref: "Coupon",
|
|
8978
|
+
required: false,
|
|
8979
|
+
type: import_mongoose11.default.Schema.Types.ObjectId
|
|
8980
|
+
},
|
|
8935
8981
|
deletedAt: { default: null, required: false, type: Date },
|
|
8936
8982
|
email: { required: true, type: String },
|
|
8937
8983
|
emailSentFor: {
|
|
@@ -9052,27 +9098,133 @@ var schema8 = new MongooseSchema12(
|
|
|
9052
9098
|
var VerificationTokenModel = import_mongoose12.default.models.VerificationToken || import_mongoose12.default.model("VerificationToken", schema8);
|
|
9053
9099
|
|
|
9054
9100
|
// src/mongoose/vendor/Vendor.ts
|
|
9101
|
+
var import_mongoose14 = __toESM(require("mongoose"));
|
|
9102
|
+
|
|
9103
|
+
// src/mongoose/Coupon.ts
|
|
9055
9104
|
var import_mongoose13 = __toESM(require("mongoose"));
|
|
9056
9105
|
var MongooseSchema13 = import_mongoose13.default.Schema;
|
|
9057
|
-
var
|
|
9106
|
+
var productCouponSchema = new MongooseSchema13(
|
|
9107
|
+
{
|
|
9108
|
+
couponDocumentId: {
|
|
9109
|
+
ref: "Coupon",
|
|
9110
|
+
required: true,
|
|
9111
|
+
type: import_mongoose13.default.Schema.Types.ObjectId
|
|
9112
|
+
},
|
|
9113
|
+
couponId: {
|
|
9114
|
+
required: true,
|
|
9115
|
+
type: import_mongoose13.default.Schema.Types.ObjectId
|
|
9116
|
+
}
|
|
9117
|
+
},
|
|
9118
|
+
{ _id: false }
|
|
9119
|
+
);
|
|
9120
|
+
var couponOptionSchema = new MongooseSchema13(
|
|
9121
|
+
{
|
|
9122
|
+
buy: { required: false, type: Number },
|
|
9123
|
+
get: { required: false, type: Number },
|
|
9124
|
+
type: {
|
|
9125
|
+
enum: Object.values(EnumCouponQualificationType),
|
|
9126
|
+
required: true,
|
|
9127
|
+
type: String
|
|
9128
|
+
},
|
|
9129
|
+
unit: { required: false, type: String },
|
|
9130
|
+
visits: { required: false, type: Number }
|
|
9131
|
+
},
|
|
9132
|
+
{ _id: false }
|
|
9133
|
+
);
|
|
9134
|
+
var couponRewardSchema = new MongooseSchema13(
|
|
9135
|
+
{
|
|
9136
|
+
productId: {
|
|
9137
|
+
required: true,
|
|
9138
|
+
type: import_mongoose13.default.Schema.Types.ObjectId
|
|
9139
|
+
},
|
|
9140
|
+
quantity: { required: true, type: Number },
|
|
9141
|
+
unit: { required: true, type: String },
|
|
9142
|
+
vendorId: {
|
|
9143
|
+
ref: "Vendor",
|
|
9144
|
+
required: true,
|
|
9145
|
+
type: import_mongoose13.default.Schema.Types.ObjectId
|
|
9146
|
+
}
|
|
9147
|
+
},
|
|
9148
|
+
{ _id: false }
|
|
9149
|
+
);
|
|
9150
|
+
var couponCodeSchema = new MongooseSchema13(
|
|
9058
9151
|
{
|
|
9152
|
+
code: { required: true, type: String },
|
|
9153
|
+
qrCode: { required: true, type: ResourceImageTypeSchema }
|
|
9154
|
+
},
|
|
9155
|
+
{ _id: false }
|
|
9156
|
+
);
|
|
9157
|
+
var couponParticipantUserSchema = new MongooseSchema13(
|
|
9158
|
+
{
|
|
9159
|
+
couponCollectedCount: { default: 0, required: true, type: Number },
|
|
9160
|
+
couponRedeemedAt: { default: null, required: false, type: Date },
|
|
9161
|
+
userId: {
|
|
9162
|
+
ref: "User",
|
|
9163
|
+
required: true,
|
|
9164
|
+
type: import_mongoose13.default.Schema.Types.ObjectId
|
|
9165
|
+
}
|
|
9166
|
+
},
|
|
9167
|
+
{ timestamps: true }
|
|
9168
|
+
);
|
|
9169
|
+
var couponDataSchema = new MongooseSchema13(
|
|
9170
|
+
{
|
|
9171
|
+
active: { default: true, required: true, type: Boolean },
|
|
9172
|
+
couponCode: { required: true, type: couponCodeSchema },
|
|
9173
|
+
couponDescription: { required: true, type: String },
|
|
9174
|
+
couponOption: { required: true, type: couponOptionSchema },
|
|
9175
|
+
couponRewards: { required: false, type: [couponRewardSchema] },
|
|
9176
|
+
endDate: { required: true, type: Date },
|
|
9177
|
+
participantUsers: {
|
|
9178
|
+
default: null,
|
|
9179
|
+
required: false,
|
|
9180
|
+
type: [couponParticipantUserSchema]
|
|
9181
|
+
},
|
|
9182
|
+
resourceId: { required: true, type: String },
|
|
9183
|
+
resourceType: {
|
|
9184
|
+
enum: Object.values(EnumResourceType),
|
|
9185
|
+
required: true,
|
|
9186
|
+
type: String
|
|
9187
|
+
},
|
|
9188
|
+
startDate: { required: true, type: Date }
|
|
9189
|
+
},
|
|
9190
|
+
{ timestamps: true }
|
|
9191
|
+
);
|
|
9192
|
+
var schema9 = new MongooseSchema13(
|
|
9193
|
+
{
|
|
9194
|
+
active: { default: true, required: true, type: Boolean },
|
|
9195
|
+
couponData: { default: [], required: false, type: [couponDataSchema] },
|
|
9196
|
+
deletedAt: { default: null, required: false, type: Date },
|
|
9197
|
+
owner: {
|
|
9198
|
+
required: true,
|
|
9199
|
+
type: OwnerTypeSchema
|
|
9200
|
+
}
|
|
9201
|
+
},
|
|
9202
|
+
{ timestamps: true }
|
|
9203
|
+
);
|
|
9204
|
+
var CouponModel = import_mongoose13.default.models.Coupon || import_mongoose13.default.model("Coupon", schema9);
|
|
9205
|
+
|
|
9206
|
+
// src/mongoose/vendor/Vendor.ts
|
|
9207
|
+
var MongooseSchema14 = import_mongoose14.default.Schema;
|
|
9208
|
+
var vendorProductTypeSchema = new MongooseSchema14(
|
|
9209
|
+
{
|
|
9210
|
+
coupon: { required: false, type: productCouponSchema },
|
|
9059
9211
|
description: { required: false, type: String },
|
|
9060
|
-
hasCoupon: { default: false, required: false, type: Boolean },
|
|
9061
9212
|
name: { required: true, type: String },
|
|
9062
9213
|
price: { required: true, type: Number },
|
|
9214
|
+
priceMax: { required: false, type: Number },
|
|
9063
9215
|
priceUnit: { required: true, type: String },
|
|
9064
9216
|
productGroups: { required: false, type: [String] }
|
|
9065
9217
|
},
|
|
9066
9218
|
{ timestamps: true }
|
|
9067
9219
|
);
|
|
9068
|
-
var productWrapperSchema = new
|
|
9220
|
+
var productWrapperSchema = new MongooseSchema14(
|
|
9069
9221
|
{
|
|
9070
9222
|
active: { default: false, required: true, type: Boolean },
|
|
9071
9223
|
productsList: { required: false, type: [vendorProductTypeSchema] }
|
|
9072
9224
|
},
|
|
9073
9225
|
{ _id: false }
|
|
9074
9226
|
);
|
|
9075
|
-
var calendarSchema = new
|
|
9227
|
+
var calendarSchema = new MongooseSchema14(
|
|
9076
9228
|
{
|
|
9077
9229
|
dateTime: {
|
|
9078
9230
|
dateStatus: {
|
|
@@ -9093,14 +9245,14 @@ var calendarSchema = new MongooseSchema13(
|
|
|
9093
9245
|
},
|
|
9094
9246
|
{ _id: false }
|
|
9095
9247
|
);
|
|
9096
|
-
var calendarWrapperSchema = new
|
|
9248
|
+
var calendarWrapperSchema = new MongooseSchema14(
|
|
9097
9249
|
{
|
|
9098
9250
|
active: { default: false, required: true, type: Boolean },
|
|
9099
9251
|
calendarData: { required: false, type: [calendarSchema] }
|
|
9100
9252
|
},
|
|
9101
9253
|
{ _id: false }
|
|
9102
9254
|
);
|
|
9103
|
-
var
|
|
9255
|
+
var schema10 = new MongooseSchema14(
|
|
9104
9256
|
{
|
|
9105
9257
|
...baseResourceFields,
|
|
9106
9258
|
// Importing base resource fields from global.ts
|
|
@@ -9126,12 +9278,12 @@ var schema9 = new MongooseSchema13(
|
|
|
9126
9278
|
unregisteredVendorId: {
|
|
9127
9279
|
ref: "UnregisteredVendor",
|
|
9128
9280
|
required: false,
|
|
9129
|
-
type:
|
|
9281
|
+
type: import_mongoose14.default.Schema.Types.ObjectId
|
|
9130
9282
|
},
|
|
9131
9283
|
vendorInfoId: {
|
|
9132
9284
|
ref: "VendorInfo",
|
|
9133
9285
|
required: false,
|
|
9134
|
-
type:
|
|
9286
|
+
type: import_mongoose14.default.Schema.Types.ObjectId
|
|
9135
9287
|
},
|
|
9136
9288
|
vendorType: {
|
|
9137
9289
|
enum: Object.values(EnumVendorType),
|
|
@@ -9141,24 +9293,24 @@ var schema9 = new MongooseSchema13(
|
|
|
9141
9293
|
},
|
|
9142
9294
|
{ timestamps: true }
|
|
9143
9295
|
);
|
|
9144
|
-
|
|
9145
|
-
|
|
9146
|
-
|
|
9147
|
-
|
|
9148
|
-
|
|
9149
|
-
var VendorModel =
|
|
9296
|
+
schema10.index({ name: 1 });
|
|
9297
|
+
schema10.index({ description: 1 });
|
|
9298
|
+
schema10.index({ region: 1 });
|
|
9299
|
+
schema10.index({ "categories.name": 1 });
|
|
9300
|
+
schema10.index({ slug: 1 });
|
|
9301
|
+
var VendorModel = import_mongoose14.default.models.Vendor || import_mongoose14.default.model("Vendor", schema10);
|
|
9150
9302
|
|
|
9151
9303
|
// src/mongoose/vendor/VendorInfo.ts
|
|
9152
|
-
var
|
|
9153
|
-
var
|
|
9154
|
-
var AttributesSchema = new
|
|
9304
|
+
var import_mongoose15 = __toESM(require("mongoose"));
|
|
9305
|
+
var MongooseSchema15 = import_mongoose15.default.Schema;
|
|
9306
|
+
var AttributesSchema = new MongooseSchema15(
|
|
9155
9307
|
{
|
|
9156
9308
|
details: { required: false, type: String },
|
|
9157
9309
|
isRequired: { default: false, required: true, type: Boolean }
|
|
9158
9310
|
},
|
|
9159
9311
|
{ _id: false }
|
|
9160
9312
|
);
|
|
9161
|
-
var
|
|
9313
|
+
var schema11 = new MongooseSchema15(
|
|
9162
9314
|
{
|
|
9163
9315
|
active: { default: true, type: Boolean },
|
|
9164
9316
|
compliance: {
|
|
@@ -9193,28 +9345,28 @@ var schema10 = new MongooseSchema14(
|
|
|
9193
9345
|
vendorId: {
|
|
9194
9346
|
ref: "Vendor",
|
|
9195
9347
|
required: true,
|
|
9196
|
-
type:
|
|
9348
|
+
type: import_mongoose15.default.Schema.Types.ObjectId
|
|
9197
9349
|
}
|
|
9198
9350
|
},
|
|
9199
9351
|
{ timestamps: true }
|
|
9200
9352
|
);
|
|
9201
|
-
var VendorInfoModel =
|
|
9353
|
+
var VendorInfoModel = import_mongoose15.default.models.VendorInfo || import_mongoose15.default.model("VendorInfo", schema11);
|
|
9202
9354
|
|
|
9203
9355
|
// src/mongoose/vendor/UnregisteredVendor.ts
|
|
9204
|
-
var
|
|
9205
|
-
var
|
|
9206
|
-
var invitationSchema = new
|
|
9356
|
+
var import_mongoose16 = __toESM(require("mongoose"));
|
|
9357
|
+
var MongooseSchema16 = import_mongoose16.default.Schema;
|
|
9358
|
+
var invitationSchema = new MongooseSchema16(
|
|
9207
9359
|
{
|
|
9208
9360
|
dateTime: { required: true, type: [dateTimeSchema2] },
|
|
9209
9361
|
inviterId: {
|
|
9210
9362
|
ref: "Event",
|
|
9211
9363
|
required: true,
|
|
9212
|
-
type:
|
|
9364
|
+
type: import_mongoose16.default.Schema.Types.ObjectId
|
|
9213
9365
|
}
|
|
9214
9366
|
},
|
|
9215
9367
|
{ _id: false }
|
|
9216
9368
|
);
|
|
9217
|
-
var
|
|
9369
|
+
var schema12 = new MongooseSchema16(
|
|
9218
9370
|
{
|
|
9219
9371
|
active: { default: true, required: true, type: Boolean },
|
|
9220
9372
|
categoryIds: { required: true, type: [String] },
|
|
@@ -9223,7 +9375,7 @@ var schema11 = new MongooseSchema15(
|
|
|
9223
9375
|
claimedByUserId: {
|
|
9224
9376
|
ref: "User",
|
|
9225
9377
|
required: false,
|
|
9226
|
-
type:
|
|
9378
|
+
type: import_mongoose16.default.Schema.Types.ObjectId
|
|
9227
9379
|
},
|
|
9228
9380
|
claimInitiatedAt: { default: null, required: false, type: Date },
|
|
9229
9381
|
claimToken: { default: null, required: false, type: String },
|
|
@@ -9236,14 +9388,14 @@ var schema11 = new MongooseSchema15(
|
|
|
9236
9388
|
},
|
|
9237
9389
|
{ timestamps: true }
|
|
9238
9390
|
);
|
|
9239
|
-
|
|
9240
|
-
|
|
9241
|
-
var UnregisteredVendorModel =
|
|
9391
|
+
schema12.index({ name: 1 });
|
|
9392
|
+
schema12.index({ email: 1 });
|
|
9393
|
+
var UnregisteredVendorModel = import_mongoose16.default.models.UnregisteredVendor || import_mongoose16.default.model("UnregisteredVendor", schema12);
|
|
9242
9394
|
|
|
9243
9395
|
// src/mongoose/event/Event.ts
|
|
9244
|
-
var
|
|
9245
|
-
var
|
|
9246
|
-
var
|
|
9396
|
+
var import_mongoose17 = __toESM(require("mongoose"));
|
|
9397
|
+
var MongooseSchema17 = import_mongoose17.default.Schema;
|
|
9398
|
+
var schema13 = new MongooseSchema17(
|
|
9247
9399
|
{
|
|
9248
9400
|
...baseResourceFields,
|
|
9249
9401
|
// Importing base resource fields from global.ts
|
|
@@ -9252,7 +9404,7 @@ var schema12 = new MongooseSchema16(
|
|
|
9252
9404
|
eventInfoId: {
|
|
9253
9405
|
ref: "EventInfo",
|
|
9254
9406
|
required: false,
|
|
9255
|
-
type:
|
|
9407
|
+
type: import_mongoose17.default.Schema.Types.ObjectId
|
|
9256
9408
|
},
|
|
9257
9409
|
eventType: {
|
|
9258
9410
|
enum: Object.values(EnumEventType),
|
|
@@ -9281,20 +9433,20 @@ var schema12 = new MongooseSchema16(
|
|
|
9281
9433
|
},
|
|
9282
9434
|
{ timestamps: true }
|
|
9283
9435
|
);
|
|
9284
|
-
|
|
9285
|
-
|
|
9286
|
-
|
|
9287
|
-
|
|
9288
|
-
|
|
9289
|
-
|
|
9290
|
-
|
|
9291
|
-
|
|
9292
|
-
var EventModel =
|
|
9436
|
+
schema13.index({ name: 1 });
|
|
9437
|
+
schema13.index({ description: 1 });
|
|
9438
|
+
schema13.index({ region: 1 });
|
|
9439
|
+
schema13.index({ "location.geo": "2dsphere" });
|
|
9440
|
+
schema13.index({ tags: 1 });
|
|
9441
|
+
schema13.index({ deletedAt: 1 });
|
|
9442
|
+
schema13.index({ "dateTime.dateStatus": 1 });
|
|
9443
|
+
schema13.index({ slug: 1 });
|
|
9444
|
+
var EventModel = import_mongoose17.default.models.Event || import_mongoose17.default.model("Event", schema13);
|
|
9293
9445
|
|
|
9294
9446
|
// src/mongoose/Partner.ts
|
|
9295
|
-
var
|
|
9296
|
-
var
|
|
9297
|
-
var
|
|
9447
|
+
var import_mongoose18 = __toESM(require("mongoose"));
|
|
9448
|
+
var MongooseSchema18 = import_mongoose18.default.Schema;
|
|
9449
|
+
var schema14 = new MongooseSchema18(
|
|
9298
9450
|
{
|
|
9299
9451
|
...baseResourceFields,
|
|
9300
9452
|
location: {
|
|
@@ -9310,19 +9462,19 @@ var schema13 = new MongooseSchema17(
|
|
|
9310
9462
|
},
|
|
9311
9463
|
{ timestamps: true }
|
|
9312
9464
|
);
|
|
9313
|
-
|
|
9314
|
-
|
|
9315
|
-
|
|
9316
|
-
|
|
9317
|
-
|
|
9318
|
-
var PartnerModel =
|
|
9465
|
+
schema14.index({ name: 1 });
|
|
9466
|
+
schema14.index({ description: 1 });
|
|
9467
|
+
schema14.index({ region: 1 });
|
|
9468
|
+
schema14.index({ "location.geo": "2dsphere" });
|
|
9469
|
+
schema14.index({ slug: 1 });
|
|
9470
|
+
var PartnerModel = import_mongoose18.default.models.Partner || import_mongoose18.default.model("Partner", schema14);
|
|
9319
9471
|
|
|
9320
9472
|
// src/mongoose/Post.ts
|
|
9321
|
-
var
|
|
9322
|
-
var
|
|
9323
|
-
var contentSchema = new
|
|
9473
|
+
var import_mongoose19 = __toESM(require("mongoose"));
|
|
9474
|
+
var MongooseSchema19 = import_mongoose19.default.Schema;
|
|
9475
|
+
var contentSchema = new MongooseSchema19(
|
|
9324
9476
|
{
|
|
9325
|
-
contentData:
|
|
9477
|
+
contentData: import_mongoose19.Schema.Types.Mixed,
|
|
9326
9478
|
contentOrder: { required: true, type: Number },
|
|
9327
9479
|
contentType: {
|
|
9328
9480
|
enum: Object.values(EnumPostContentType),
|
|
@@ -9332,7 +9484,7 @@ var contentSchema = new MongooseSchema18(
|
|
|
9332
9484
|
},
|
|
9333
9485
|
{ _id: false }
|
|
9334
9486
|
);
|
|
9335
|
-
var resourceSchema = new
|
|
9487
|
+
var resourceSchema = new MongooseSchema19(
|
|
9336
9488
|
{
|
|
9337
9489
|
resourceId: { required: true, type: String },
|
|
9338
9490
|
resourceRegion: { required: true, type: String },
|
|
@@ -9345,7 +9497,7 @@ var resourceSchema = new MongooseSchema18(
|
|
|
9345
9497
|
},
|
|
9346
9498
|
{ _id: false }
|
|
9347
9499
|
);
|
|
9348
|
-
var
|
|
9500
|
+
var schema15 = new MongooseSchema19(
|
|
9349
9501
|
{
|
|
9350
9502
|
active: { default: false, required: true, type: Boolean },
|
|
9351
9503
|
approvedAt: { default: null, required: false, type: Date },
|
|
@@ -9376,16 +9528,16 @@ var schema14 = new MongooseSchema18(
|
|
|
9376
9528
|
},
|
|
9377
9529
|
{ timestamps: true }
|
|
9378
9530
|
);
|
|
9379
|
-
|
|
9380
|
-
|
|
9381
|
-
|
|
9382
|
-
var PostModel =
|
|
9531
|
+
schema15.index({ title: 1 });
|
|
9532
|
+
schema15.index({ tags: 1 });
|
|
9533
|
+
schema15.index({ postType: 1, slug: 1 }, { unique: true });
|
|
9534
|
+
var PostModel = import_mongoose19.default.models.Post || import_mongoose19.default.model("Post", schema15);
|
|
9383
9535
|
|
|
9384
9536
|
// src/mongoose/AppSetting.ts
|
|
9385
|
-
var
|
|
9386
|
-
var
|
|
9537
|
+
var import_mongoose20 = __toESM(require("mongoose"));
|
|
9538
|
+
var MongooseSchema20 = import_mongoose20.default.Schema;
|
|
9387
9539
|
var APP_SETTINGS_ID = "APP_SETTINGS_DOCUMENT_ID";
|
|
9388
|
-
var AppSettingSchema = new
|
|
9540
|
+
var AppSettingSchema = new MongooseSchema20(
|
|
9389
9541
|
{
|
|
9390
9542
|
activeSchoolsStudentCountTotal: {
|
|
9391
9543
|
default: 0,
|
|
@@ -9416,18 +9568,18 @@ var AppSettingSchema = new MongooseSchema19(
|
|
|
9416
9568
|
},
|
|
9417
9569
|
{ timestamps: true }
|
|
9418
9570
|
);
|
|
9419
|
-
var AppSettingModel =
|
|
9571
|
+
var AppSettingModel = import_mongoose20.default.models.AppSetting || import_mongoose20.default.model("AppSetting", AppSettingSchema);
|
|
9420
9572
|
|
|
9421
9573
|
// src/mongoose/game/Game.ts
|
|
9422
|
-
var
|
|
9574
|
+
var import_mongoose24 = __toESM(require("mongoose"));
|
|
9423
9575
|
|
|
9424
9576
|
// src/mongoose/game/DailyClue.ts
|
|
9425
|
-
var
|
|
9577
|
+
var import_mongoose22 = __toESM(require("mongoose"));
|
|
9426
9578
|
|
|
9427
9579
|
// src/mongoose/game/utils.ts
|
|
9428
|
-
var
|
|
9429
|
-
var
|
|
9430
|
-
var schemaGameDate = new
|
|
9580
|
+
var import_mongoose21 = __toESM(require("mongoose"));
|
|
9581
|
+
var MongooseSchema21 = import_mongoose21.default.Schema;
|
|
9582
|
+
var schemaGameDate = new MongooseSchema21(
|
|
9431
9583
|
{
|
|
9432
9584
|
endDate: { required: true, type: Date },
|
|
9433
9585
|
startDate: { required: true, type: Date }
|
|
@@ -9436,8 +9588,8 @@ var schemaGameDate = new MongooseSchema20(
|
|
|
9436
9588
|
);
|
|
9437
9589
|
|
|
9438
9590
|
// src/mongoose/game/DailyClue.ts
|
|
9439
|
-
var
|
|
9440
|
-
var schemaLetters = new
|
|
9591
|
+
var MongooseSchema22 = import_mongoose22.default.Schema;
|
|
9592
|
+
var schemaLetters = new MongooseSchema22(
|
|
9441
9593
|
{
|
|
9442
9594
|
collected: { required: false, type: [String] },
|
|
9443
9595
|
solutionShuffled: { required: true, type: [String] }
|
|
@@ -9445,14 +9597,14 @@ var schemaLetters = new MongooseSchema21(
|
|
|
9445
9597
|
},
|
|
9446
9598
|
{ _id: false }
|
|
9447
9599
|
);
|
|
9448
|
-
var schemaDailyClueBaseGame = new
|
|
9600
|
+
var schemaDailyClueBaseGame = new MongooseSchema22(
|
|
9449
9601
|
{
|
|
9450
9602
|
gameDate: { required: true, type: schemaGameDate },
|
|
9451
9603
|
gameSolution: { required: true, type: String }
|
|
9452
9604
|
},
|
|
9453
9605
|
{ _id: false }
|
|
9454
9606
|
);
|
|
9455
|
-
var schemaDailyClueGameData = new
|
|
9607
|
+
var schemaDailyClueGameData = new MongooseSchema22(
|
|
9456
9608
|
{
|
|
9457
9609
|
gameFields: { required: true, type: schemaDailyClueBaseGame },
|
|
9458
9610
|
lastFoundDate: { default: null, required: false, type: Date },
|
|
@@ -9467,9 +9619,9 @@ var schemaDailyClueGameData = new MongooseSchema21(
|
|
|
9467
9619
|
);
|
|
9468
9620
|
|
|
9469
9621
|
// src/mongoose/game/PuzzleGame.ts
|
|
9470
|
-
var
|
|
9471
|
-
var
|
|
9472
|
-
var schemaPuzzleAnswer = new
|
|
9622
|
+
var import_mongoose23 = __toESM(require("mongoose"));
|
|
9623
|
+
var MongooseSchema23 = import_mongoose23.default.Schema;
|
|
9624
|
+
var schemaPuzzleAnswer = new MongooseSchema23(
|
|
9473
9625
|
{
|
|
9474
9626
|
answer: { required: true, type: String },
|
|
9475
9627
|
answerId: { required: true, type: String },
|
|
@@ -9477,7 +9629,7 @@ var schemaPuzzleAnswer = new MongooseSchema22(
|
|
|
9477
9629
|
},
|
|
9478
9630
|
{ _id: false }
|
|
9479
9631
|
);
|
|
9480
|
-
var schemaPuzzleQuestion = new
|
|
9632
|
+
var schemaPuzzleQuestion = new MongooseSchema23(
|
|
9481
9633
|
{
|
|
9482
9634
|
answers: { required: true, type: [schemaPuzzleAnswer] },
|
|
9483
9635
|
question: { required: true, type: String },
|
|
@@ -9485,20 +9637,20 @@ var schemaPuzzleQuestion = new MongooseSchema22(
|
|
|
9485
9637
|
},
|
|
9486
9638
|
{ _id: false }
|
|
9487
9639
|
);
|
|
9488
|
-
var schemaPuzzleBaseGame = new
|
|
9640
|
+
var schemaPuzzleBaseGame = new MongooseSchema23(
|
|
9489
9641
|
{
|
|
9490
9642
|
questions: { required: true, type: [schemaPuzzleQuestion] }
|
|
9491
9643
|
},
|
|
9492
9644
|
{ _id: false }
|
|
9493
9645
|
);
|
|
9494
|
-
var schemaPuzzleAnsweredQuestion = new
|
|
9646
|
+
var schemaPuzzleAnsweredQuestion = new MongooseSchema23(
|
|
9495
9647
|
{
|
|
9496
9648
|
questionId: { required: true, type: String },
|
|
9497
9649
|
selectedAnswerId: { required: true, type: String }
|
|
9498
9650
|
},
|
|
9499
9651
|
{ _id: false }
|
|
9500
9652
|
);
|
|
9501
|
-
var schemaPuzzleGameData = new
|
|
9653
|
+
var schemaPuzzleGameData = new MongooseSchema23(
|
|
9502
9654
|
{
|
|
9503
9655
|
answeredQuestions: {
|
|
9504
9656
|
default: null,
|
|
@@ -9513,7 +9665,7 @@ var schemaPuzzleGameData = new MongooseSchema22(
|
|
|
9513
9665
|
);
|
|
9514
9666
|
|
|
9515
9667
|
// src/mongoose/game/Game.ts
|
|
9516
|
-
var
|
|
9668
|
+
var MongooseSchema24 = import_mongoose24.default.Schema;
|
|
9517
9669
|
var gameDataSchemas = {
|
|
9518
9670
|
[EnumGameType.DAILY_CLUE]: schemaDailyClueGameData,
|
|
9519
9671
|
[EnumGameType.MINI_QUIZ]: schemaPuzzleGameData,
|
|
@@ -9525,7 +9677,7 @@ var gameDataDefinition = Object.fromEntries(
|
|
|
9525
9677
|
{ default: null, required: false, type: schema19 }
|
|
9526
9678
|
])
|
|
9527
9679
|
);
|
|
9528
|
-
var gameHistorySchema = new
|
|
9680
|
+
var gameHistorySchema = new MongooseSchema24(
|
|
9529
9681
|
{
|
|
9530
9682
|
createdAt: { required: true, type: Date },
|
|
9531
9683
|
gameDate: { required: true, type: schemaGameDate },
|
|
@@ -9545,7 +9697,7 @@ var gameHistorySchema = new MongooseSchema23(
|
|
|
9545
9697
|
},
|
|
9546
9698
|
{ _id: false }
|
|
9547
9699
|
);
|
|
9548
|
-
var gameTypeSchema = new
|
|
9700
|
+
var gameTypeSchema = new MongooseSchema24(
|
|
9549
9701
|
{
|
|
9550
9702
|
active: { default: true, required: true, type: Boolean },
|
|
9551
9703
|
gameData: gameDataDefinition,
|
|
@@ -9560,7 +9712,7 @@ var gameTypeSchema = new MongooseSchema23(
|
|
|
9560
9712
|
},
|
|
9561
9713
|
{ timestamps: true }
|
|
9562
9714
|
);
|
|
9563
|
-
var
|
|
9715
|
+
var schema16 = new MongooseSchema24(
|
|
9564
9716
|
{
|
|
9565
9717
|
active: { default: false, required: true, type: Boolean },
|
|
9566
9718
|
deletedAt: { default: null, required: false, type: Date },
|
|
@@ -9573,12 +9725,12 @@ var schema15 = new MongooseSchema23(
|
|
|
9573
9725
|
},
|
|
9574
9726
|
{ timestamps: true }
|
|
9575
9727
|
);
|
|
9576
|
-
var GameModel =
|
|
9728
|
+
var GameModel = import_mongoose24.default.models.Game || import_mongoose24.default.model("Game", schema16);
|
|
9577
9729
|
|
|
9578
9730
|
// src/mongoose/School.ts
|
|
9579
|
-
var
|
|
9580
|
-
var
|
|
9581
|
-
var campaignsSchema = new
|
|
9731
|
+
var import_mongoose25 = __toESM(require("mongoose"));
|
|
9732
|
+
var MongooseSchema25 = import_mongoose25.default.Schema;
|
|
9733
|
+
var campaignsSchema = new MongooseSchema25(
|
|
9582
9734
|
{
|
|
9583
9735
|
endDate: { required: true, type: Date },
|
|
9584
9736
|
name: { required: true, type: String },
|
|
@@ -9586,7 +9738,7 @@ var campaignsSchema = new MongooseSchema24(
|
|
|
9586
9738
|
},
|
|
9587
9739
|
{ _id: false }
|
|
9588
9740
|
);
|
|
9589
|
-
var
|
|
9741
|
+
var schema17 = new MongooseSchema25(
|
|
9590
9742
|
{
|
|
9591
9743
|
// New schools are active by default
|
|
9592
9744
|
active: { default: false, required: true, type: Boolean },
|
|
@@ -9613,19 +9765,19 @@ var schema16 = new MongooseSchema24(
|
|
|
9613
9765
|
},
|
|
9614
9766
|
{ timestamps: true }
|
|
9615
9767
|
);
|
|
9616
|
-
|
|
9768
|
+
schema17.index(
|
|
9617
9769
|
{ schoolCode: 1 },
|
|
9618
9770
|
{
|
|
9619
9771
|
partialFilterExpression: { active: true, deletedAt: null },
|
|
9620
9772
|
unique: true
|
|
9621
9773
|
}
|
|
9622
9774
|
);
|
|
9623
|
-
var SchoolModel =
|
|
9775
|
+
var SchoolModel = import_mongoose25.default.models.School || import_mongoose25.default.model("School", schema17);
|
|
9624
9776
|
|
|
9625
9777
|
// src/mongoose/Affiliate.ts
|
|
9626
|
-
var
|
|
9627
|
-
var
|
|
9628
|
-
var affiliateRewardSchema = new
|
|
9778
|
+
var import_mongoose26 = __toESM(require("mongoose"));
|
|
9779
|
+
var MongooseSchema26 = import_mongoose26.default.Schema;
|
|
9780
|
+
var affiliateRewardSchema = new MongooseSchema26(
|
|
9629
9781
|
{
|
|
9630
9782
|
createdAt: { required: true, type: Date },
|
|
9631
9783
|
redeemedAt: { default: null, required: false, type: Date },
|
|
@@ -9639,13 +9791,13 @@ var affiliateRewardSchema = new MongooseSchema25(
|
|
|
9639
9791
|
},
|
|
9640
9792
|
{ _id: false }
|
|
9641
9793
|
);
|
|
9642
|
-
var affiliateResourceSchema = new
|
|
9794
|
+
var affiliateResourceSchema = new MongooseSchema26(
|
|
9643
9795
|
{
|
|
9644
9796
|
resourceActive: { default: true, required: true, type: Boolean },
|
|
9645
9797
|
resourceDeletedAt: { default: null, required: false, type: Date },
|
|
9646
9798
|
resourceId: {
|
|
9647
9799
|
required: true,
|
|
9648
|
-
type:
|
|
9800
|
+
type: import_mongoose26.default.Schema.Types.ObjectId
|
|
9649
9801
|
},
|
|
9650
9802
|
resourceName: { required: true, type: String },
|
|
9651
9803
|
resourceOwner: {
|
|
@@ -9665,20 +9817,20 @@ var affiliateResourceSchema = new MongooseSchema25(
|
|
|
9665
9817
|
},
|
|
9666
9818
|
{ _id: false }
|
|
9667
9819
|
);
|
|
9668
|
-
var affiliateContactDetailsSchema = new
|
|
9820
|
+
var affiliateContactDetailsSchema = new MongooseSchema26(
|
|
9669
9821
|
{
|
|
9670
9822
|
mobilePhone: { required: true, type: String }
|
|
9671
9823
|
},
|
|
9672
9824
|
{ _id: false }
|
|
9673
9825
|
);
|
|
9674
|
-
var affiliateBankAccountDetailsSchema = new
|
|
9826
|
+
var affiliateBankAccountDetailsSchema = new MongooseSchema26(
|
|
9675
9827
|
{
|
|
9676
9828
|
accountHolderName: { required: true, type: String },
|
|
9677
9829
|
accountNumber: { required: true, type: String }
|
|
9678
9830
|
},
|
|
9679
9831
|
{ _id: false }
|
|
9680
9832
|
);
|
|
9681
|
-
var affiliateDetailsSchema = new
|
|
9833
|
+
var affiliateDetailsSchema = new MongooseSchema26(
|
|
9682
9834
|
{
|
|
9683
9835
|
bankAccountDetails: {
|
|
9684
9836
|
required: true,
|
|
@@ -9700,7 +9852,7 @@ var affiliateDetailsSchema = new MongooseSchema25(
|
|
|
9700
9852
|
},
|
|
9701
9853
|
{ _id: false }
|
|
9702
9854
|
);
|
|
9703
|
-
var redeemHistorySchema = new
|
|
9855
|
+
var redeemHistorySchema = new MongooseSchema26(
|
|
9704
9856
|
{
|
|
9705
9857
|
paidAt: { default: null, required: false, type: Date },
|
|
9706
9858
|
redeemedAt: { required: true, type: Date },
|
|
@@ -9708,7 +9860,7 @@ var redeemHistorySchema = new MongooseSchema25(
|
|
|
9708
9860
|
},
|
|
9709
9861
|
{ _id: false }
|
|
9710
9862
|
);
|
|
9711
|
-
var
|
|
9863
|
+
var schema18 = new MongooseSchema26(
|
|
9712
9864
|
{
|
|
9713
9865
|
active: { default: false, required: true, type: Boolean },
|
|
9714
9866
|
affiliateBonusRewards: {
|
|
@@ -9738,71 +9890,14 @@ var schema17 = new MongooseSchema25(
|
|
|
9738
9890
|
},
|
|
9739
9891
|
{ timestamps: true }
|
|
9740
9892
|
);
|
|
9741
|
-
|
|
9893
|
+
schema18.index(
|
|
9742
9894
|
{ affiliateCode: 1 },
|
|
9743
9895
|
{
|
|
9744
9896
|
partialFilterExpression: { active: true, deletedAt: null },
|
|
9745
9897
|
unique: true
|
|
9746
9898
|
}
|
|
9747
9899
|
);
|
|
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);
|
|
9900
|
+
var AffiliateModel = import_mongoose26.default.models.Affiliate || import_mongoose26.default.model("Affiliate", schema18);
|
|
9806
9901
|
|
|
9807
9902
|
// src/service/promoCode/constants.ts
|
|
9808
9903
|
var ACTIVE_NOT_DELETED_FILTER = {
|
|
@@ -9874,7 +9969,7 @@ var SHARE_RESOURCE_LABEL2 = {
|
|
|
9874
9969
|
school: "School"
|
|
9875
9970
|
};
|
|
9876
9971
|
|
|
9877
|
-
// node_modules/@timardex/cluemart-shared/dist/chunk-
|
|
9972
|
+
// node_modules/@timardex/cluemart-shared/dist/chunk-UV5GH6NI.mjs
|
|
9878
9973
|
var PROMO_CODE_PREFIX2 = "CM-";
|
|
9879
9974
|
var OBJECT_ID_PATH_SEGMENT2 = "[a-f0-9]{24}";
|
|
9880
9975
|
var OBJECT_ID_PATH_SEGMENT_END2 = `${OBJECT_ID_PATH_SEGMENT2}$`;
|
|
@@ -9976,7 +10071,7 @@ var gameScreenIdentifierList2 = [
|
|
|
9976
10071
|
}
|
|
9977
10072
|
];
|
|
9978
10073
|
|
|
9979
|
-
// node_modules/@timardex/cluemart-shared/dist/chunk-
|
|
10074
|
+
// node_modules/@timardex/cluemart-shared/dist/chunk-3UYXNSNB.mjs
|
|
9980
10075
|
var import_dayjs4 = __toESM(require("dayjs"), 1);
|
|
9981
10076
|
var statusOptions2 = [
|
|
9982
10077
|
...Object.values(EnumInviteStatus2).map((status) => ({
|
|
@@ -11787,6 +11882,7 @@ function updateRelationDatesToUnavailable(relationDates, eventDateTime) {
|
|
|
11787
11882
|
normalizeAffiliatePromoCodes,
|
|
11788
11883
|
normalizePromoCode,
|
|
11789
11884
|
notifyUsers,
|
|
11885
|
+
productCouponSchema,
|
|
11790
11886
|
publishNotificationEvents,
|
|
11791
11887
|
refundPolicySchema,
|
|
11792
11888
|
relatedPostSchema,
|