@timardex/cluemart-server-shared 1.1.15 → 1.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-VS3WIV6D.mjs → chunk-K4C5YKZE.mjs} +331 -241
- package/dist/chunk-K4C5YKZE.mjs.map +1 -0
- package/dist/index.cjs +332 -241
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +28 -7
- package/dist/index.d.ts +28 -7
- package/dist/index.mjs +330 -240
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs +330 -239
- package/dist/mongoose/index.cjs.map +1 -1
- package/dist/mongoose/index.d.mts +28 -7
- package/dist/mongoose/index.d.ts +28 -7
- package/dist/mongoose/index.mjs +3 -1
- package/dist/service/index.cjs +330 -241
- package/dist/service/index.cjs.map +1 -1
- package/dist/service/index.mjs +3 -3
- package/dist/service/index.mjs.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-VS3WIV6D.mjs.map +0 -1
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,6 +5615,9 @@ 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
5623
|
name
|
|
@@ -5513,6 +5626,7 @@ var VENDOR_PRODUCT_LIST_FIELDS_FRAGMENT = gql`
|
|
|
5513
5626
|
productGroups
|
|
5514
5627
|
updatedAt
|
|
5515
5628
|
}
|
|
5629
|
+
${PRODUCT_COUPON_FIELDS_FRAGMENT}
|
|
5516
5630
|
`;
|
|
5517
5631
|
var VENDOR = gql`
|
|
5518
5632
|
fragment VendorFields on VendorType {
|
|
@@ -7814,79 +7928,6 @@ var ASSIGN_AFFILIATE_BONUS_REWARD_MUTATION = gql`
|
|
|
7814
7928
|
}
|
|
7815
7929
|
${AFFILIATE_FIELDS_FRAGMENT}
|
|
7816
7930
|
`;
|
|
7817
|
-
var COUPON_CODE_FIELDS_FRAGMENT = gql`
|
|
7818
|
-
fragment CouponCodeFields on CouponCodeType {
|
|
7819
|
-
code
|
|
7820
|
-
qrCode {
|
|
7821
|
-
...ResourceImageFields
|
|
7822
|
-
}
|
|
7823
|
-
}
|
|
7824
|
-
${RESOURCE_IMAGE_FIELDS_FRAGMENT}
|
|
7825
|
-
`;
|
|
7826
|
-
var COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT = gql`
|
|
7827
|
-
fragment CouponParticipantUserFields on CouponParticipantUserType {
|
|
7828
|
-
couponCount
|
|
7829
|
-
couponRedeemedAt
|
|
7830
|
-
createdAt
|
|
7831
|
-
updatedAt
|
|
7832
|
-
userId
|
|
7833
|
-
}
|
|
7834
|
-
`;
|
|
7835
|
-
var PRODUCT_COUPON_FIELDS_FRAGMENT = gql`
|
|
7836
|
-
fragment ProductCouponFields on ProductCouponType {
|
|
7837
|
-
_id
|
|
7838
|
-
active
|
|
7839
|
-
couponCode {
|
|
7840
|
-
...CouponCodeFields
|
|
7841
|
-
}
|
|
7842
|
-
couponDescription
|
|
7843
|
-
couponOption
|
|
7844
|
-
createdAt
|
|
7845
|
-
endDate
|
|
7846
|
-
participantProduct {
|
|
7847
|
-
...VendorProductListFields
|
|
7848
|
-
}
|
|
7849
|
-
participantUsers {
|
|
7850
|
-
...CouponParticipantUserFields
|
|
7851
|
-
}
|
|
7852
|
-
startDate
|
|
7853
|
-
updatedAt
|
|
7854
|
-
}
|
|
7855
|
-
${COUPON_CODE_FIELDS_FRAGMENT}
|
|
7856
|
-
${COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT}
|
|
7857
|
-
${VENDOR_PRODUCT_LIST_FIELDS_FRAGMENT}
|
|
7858
|
-
`;
|
|
7859
|
-
var COUPON = gql`
|
|
7860
|
-
fragment CouponFields on CouponType {
|
|
7861
|
-
_id
|
|
7862
|
-
active
|
|
7863
|
-
productCoupons {
|
|
7864
|
-
...ProductCouponFields
|
|
7865
|
-
}
|
|
7866
|
-
createdAt
|
|
7867
|
-
deletedAt
|
|
7868
|
-
updatedAt
|
|
7869
|
-
}
|
|
7870
|
-
${PRODUCT_COUPON_FIELDS_FRAGMENT}
|
|
7871
|
-
${COUPON_CODE_FIELDS_FRAGMENT}
|
|
7872
|
-
${COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT}
|
|
7873
|
-
`;
|
|
7874
|
-
var GET_COUPONS = gql`
|
|
7875
|
-
query getCoupons {
|
|
7876
|
-
coupons {
|
|
7877
|
-
...CouponFields
|
|
7878
|
-
}
|
|
7879
|
-
}
|
|
7880
|
-
${COUPON}
|
|
7881
|
-
`;
|
|
7882
|
-
var GET_COUPON = gql`
|
|
7883
|
-
query getCoupon($_id: ID!) {
|
|
7884
|
-
coupon(_id: $_id) {
|
|
7885
|
-
...CouponFields
|
|
7886
|
-
}
|
|
7887
|
-
}
|
|
7888
|
-
${COUPON}
|
|
7889
|
-
`;
|
|
7890
7931
|
var CREATE_COUPON_MUTATION = gql`
|
|
7891
7932
|
mutation createCoupon($input: CouponInputType!) {
|
|
7892
7933
|
createCoupon(input: $input) {
|
|
@@ -8586,7 +8627,7 @@ var baseResourceFields = {
|
|
|
8586
8627
|
logo: { required: false, type: ResourceImageTypeSchema },
|
|
8587
8628
|
name: { required: true, type: String },
|
|
8588
8629
|
owner: {
|
|
8589
|
-
required:
|
|
8630
|
+
required: true,
|
|
8590
8631
|
type: OwnerTypeSchema
|
|
8591
8632
|
},
|
|
8592
8633
|
posterUsage: { required: false, type: PosterUsageTypeSchema },
|
|
@@ -9051,26 +9092,132 @@ var schema8 = new MongooseSchema12(
|
|
|
9051
9092
|
var VerificationTokenModel = import_mongoose12.default.models.VerificationToken || import_mongoose12.default.model("VerificationToken", schema8);
|
|
9052
9093
|
|
|
9053
9094
|
// src/mongoose/vendor/Vendor.ts
|
|
9095
|
+
var import_mongoose14 = __toESM(require("mongoose"));
|
|
9096
|
+
|
|
9097
|
+
// src/mongoose/Coupon.ts
|
|
9054
9098
|
var import_mongoose13 = __toESM(require("mongoose"));
|
|
9055
9099
|
var MongooseSchema13 = import_mongoose13.default.Schema;
|
|
9056
|
-
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(
|
|
9057
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(
|
|
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 },
|
|
9058
9205
|
description: { required: false, type: String },
|
|
9059
|
-
name: { required:
|
|
9060
|
-
price: { required:
|
|
9061
|
-
priceUnit: { required:
|
|
9206
|
+
name: { required: true, type: String },
|
|
9207
|
+
price: { required: true, type: Number },
|
|
9208
|
+
priceUnit: { required: true, type: String },
|
|
9062
9209
|
productGroups: { required: false, type: [String] }
|
|
9063
9210
|
},
|
|
9064
9211
|
{ timestamps: true }
|
|
9065
9212
|
);
|
|
9066
|
-
var productWrapperSchema = new
|
|
9213
|
+
var productWrapperSchema = new MongooseSchema14(
|
|
9067
9214
|
{
|
|
9068
|
-
active: { default: false, type: Boolean },
|
|
9215
|
+
active: { default: false, required: true, type: Boolean },
|
|
9069
9216
|
productsList: { required: false, type: [vendorProductTypeSchema] }
|
|
9070
9217
|
},
|
|
9071
9218
|
{ _id: false }
|
|
9072
9219
|
);
|
|
9073
|
-
var calendarSchema = new
|
|
9220
|
+
var calendarSchema = new MongooseSchema14(
|
|
9074
9221
|
{
|
|
9075
9222
|
dateTime: {
|
|
9076
9223
|
dateStatus: {
|
|
@@ -9091,14 +9238,14 @@ var calendarSchema = new MongooseSchema13(
|
|
|
9091
9238
|
},
|
|
9092
9239
|
{ _id: false }
|
|
9093
9240
|
);
|
|
9094
|
-
var calendarWrapperSchema = new
|
|
9241
|
+
var calendarWrapperSchema = new MongooseSchema14(
|
|
9095
9242
|
{
|
|
9096
|
-
active: { default: false, type: Boolean },
|
|
9243
|
+
active: { default: false, required: true, type: Boolean },
|
|
9097
9244
|
calendarData: { required: false, type: [calendarSchema] }
|
|
9098
9245
|
},
|
|
9099
9246
|
{ _id: false }
|
|
9100
9247
|
);
|
|
9101
|
-
var
|
|
9248
|
+
var schema10 = new MongooseSchema14(
|
|
9102
9249
|
{
|
|
9103
9250
|
...baseResourceFields,
|
|
9104
9251
|
// Importing base resource fields from global.ts
|
|
@@ -9124,12 +9271,12 @@ var schema9 = new MongooseSchema13(
|
|
|
9124
9271
|
unregisteredVendorId: {
|
|
9125
9272
|
ref: "UnregisteredVendor",
|
|
9126
9273
|
required: false,
|
|
9127
|
-
type:
|
|
9274
|
+
type: import_mongoose14.default.Schema.Types.ObjectId
|
|
9128
9275
|
},
|
|
9129
9276
|
vendorInfoId: {
|
|
9130
9277
|
ref: "VendorInfo",
|
|
9131
9278
|
required: false,
|
|
9132
|
-
type:
|
|
9279
|
+
type: import_mongoose14.default.Schema.Types.ObjectId
|
|
9133
9280
|
},
|
|
9134
9281
|
vendorType: {
|
|
9135
9282
|
enum: Object.values(EnumVendorType),
|
|
@@ -9139,24 +9286,24 @@ var schema9 = new MongooseSchema13(
|
|
|
9139
9286
|
},
|
|
9140
9287
|
{ timestamps: true }
|
|
9141
9288
|
);
|
|
9142
|
-
|
|
9143
|
-
|
|
9144
|
-
|
|
9145
|
-
|
|
9146
|
-
|
|
9147
|
-
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);
|
|
9148
9295
|
|
|
9149
9296
|
// src/mongoose/vendor/VendorInfo.ts
|
|
9150
|
-
var
|
|
9151
|
-
var
|
|
9152
|
-
var AttributesSchema = new
|
|
9297
|
+
var import_mongoose15 = __toESM(require("mongoose"));
|
|
9298
|
+
var MongooseSchema15 = import_mongoose15.default.Schema;
|
|
9299
|
+
var AttributesSchema = new MongooseSchema15(
|
|
9153
9300
|
{
|
|
9154
9301
|
details: { required: false, type: String },
|
|
9155
9302
|
isRequired: { default: false, required: true, type: Boolean }
|
|
9156
9303
|
},
|
|
9157
9304
|
{ _id: false }
|
|
9158
9305
|
);
|
|
9159
|
-
var
|
|
9306
|
+
var schema11 = new MongooseSchema15(
|
|
9160
9307
|
{
|
|
9161
9308
|
active: { default: true, type: Boolean },
|
|
9162
9309
|
compliance: {
|
|
@@ -9191,28 +9338,28 @@ var schema10 = new MongooseSchema14(
|
|
|
9191
9338
|
vendorId: {
|
|
9192
9339
|
ref: "Vendor",
|
|
9193
9340
|
required: true,
|
|
9194
|
-
type:
|
|
9341
|
+
type: import_mongoose15.default.Schema.Types.ObjectId
|
|
9195
9342
|
}
|
|
9196
9343
|
},
|
|
9197
9344
|
{ timestamps: true }
|
|
9198
9345
|
);
|
|
9199
|
-
var VendorInfoModel =
|
|
9346
|
+
var VendorInfoModel = import_mongoose15.default.models.VendorInfo || import_mongoose15.default.model("VendorInfo", schema11);
|
|
9200
9347
|
|
|
9201
9348
|
// src/mongoose/vendor/UnregisteredVendor.ts
|
|
9202
|
-
var
|
|
9203
|
-
var
|
|
9204
|
-
var invitationSchema = new
|
|
9349
|
+
var import_mongoose16 = __toESM(require("mongoose"));
|
|
9350
|
+
var MongooseSchema16 = import_mongoose16.default.Schema;
|
|
9351
|
+
var invitationSchema = new MongooseSchema16(
|
|
9205
9352
|
{
|
|
9206
9353
|
dateTime: { required: true, type: [dateTimeSchema2] },
|
|
9207
9354
|
inviterId: {
|
|
9208
9355
|
ref: "Event",
|
|
9209
9356
|
required: true,
|
|
9210
|
-
type:
|
|
9357
|
+
type: import_mongoose16.default.Schema.Types.ObjectId
|
|
9211
9358
|
}
|
|
9212
9359
|
},
|
|
9213
9360
|
{ _id: false }
|
|
9214
9361
|
);
|
|
9215
|
-
var
|
|
9362
|
+
var schema12 = new MongooseSchema16(
|
|
9216
9363
|
{
|
|
9217
9364
|
active: { default: true, required: true, type: Boolean },
|
|
9218
9365
|
categoryIds: { required: true, type: [String] },
|
|
@@ -9221,7 +9368,7 @@ var schema11 = new MongooseSchema15(
|
|
|
9221
9368
|
claimedByUserId: {
|
|
9222
9369
|
ref: "User",
|
|
9223
9370
|
required: false,
|
|
9224
|
-
type:
|
|
9371
|
+
type: import_mongoose16.default.Schema.Types.ObjectId
|
|
9225
9372
|
},
|
|
9226
9373
|
claimInitiatedAt: { default: null, required: false, type: Date },
|
|
9227
9374
|
claimToken: { default: null, required: false, type: String },
|
|
@@ -9234,14 +9381,14 @@ var schema11 = new MongooseSchema15(
|
|
|
9234
9381
|
},
|
|
9235
9382
|
{ timestamps: true }
|
|
9236
9383
|
);
|
|
9237
|
-
|
|
9238
|
-
|
|
9239
|
-
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);
|
|
9240
9387
|
|
|
9241
9388
|
// src/mongoose/event/Event.ts
|
|
9242
|
-
var
|
|
9243
|
-
var
|
|
9244
|
-
var
|
|
9389
|
+
var import_mongoose17 = __toESM(require("mongoose"));
|
|
9390
|
+
var MongooseSchema17 = import_mongoose17.default.Schema;
|
|
9391
|
+
var schema13 = new MongooseSchema17(
|
|
9245
9392
|
{
|
|
9246
9393
|
...baseResourceFields,
|
|
9247
9394
|
// Importing base resource fields from global.ts
|
|
@@ -9250,7 +9397,7 @@ var schema12 = new MongooseSchema16(
|
|
|
9250
9397
|
eventInfoId: {
|
|
9251
9398
|
ref: "EventInfo",
|
|
9252
9399
|
required: false,
|
|
9253
|
-
type:
|
|
9400
|
+
type: import_mongoose17.default.Schema.Types.ObjectId
|
|
9254
9401
|
},
|
|
9255
9402
|
eventType: {
|
|
9256
9403
|
enum: Object.values(EnumEventType),
|
|
@@ -9279,20 +9426,20 @@ var schema12 = new MongooseSchema16(
|
|
|
9279
9426
|
},
|
|
9280
9427
|
{ timestamps: true }
|
|
9281
9428
|
);
|
|
9282
|
-
|
|
9283
|
-
|
|
9284
|
-
|
|
9285
|
-
|
|
9286
|
-
|
|
9287
|
-
|
|
9288
|
-
|
|
9289
|
-
|
|
9290
|
-
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);
|
|
9291
9438
|
|
|
9292
9439
|
// src/mongoose/Partner.ts
|
|
9293
|
-
var
|
|
9294
|
-
var
|
|
9295
|
-
var
|
|
9440
|
+
var import_mongoose18 = __toESM(require("mongoose"));
|
|
9441
|
+
var MongooseSchema18 = import_mongoose18.default.Schema;
|
|
9442
|
+
var schema14 = new MongooseSchema18(
|
|
9296
9443
|
{
|
|
9297
9444
|
...baseResourceFields,
|
|
9298
9445
|
location: {
|
|
@@ -9308,19 +9455,19 @@ var schema13 = new MongooseSchema17(
|
|
|
9308
9455
|
},
|
|
9309
9456
|
{ timestamps: true }
|
|
9310
9457
|
);
|
|
9311
|
-
|
|
9312
|
-
|
|
9313
|
-
|
|
9314
|
-
|
|
9315
|
-
|
|
9316
|
-
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);
|
|
9317
9464
|
|
|
9318
9465
|
// src/mongoose/Post.ts
|
|
9319
|
-
var
|
|
9320
|
-
var
|
|
9321
|
-
var contentSchema = new
|
|
9466
|
+
var import_mongoose19 = __toESM(require("mongoose"));
|
|
9467
|
+
var MongooseSchema19 = import_mongoose19.default.Schema;
|
|
9468
|
+
var contentSchema = new MongooseSchema19(
|
|
9322
9469
|
{
|
|
9323
|
-
contentData:
|
|
9470
|
+
contentData: import_mongoose19.Schema.Types.Mixed,
|
|
9324
9471
|
contentOrder: { required: true, type: Number },
|
|
9325
9472
|
contentType: {
|
|
9326
9473
|
enum: Object.values(EnumPostContentType),
|
|
@@ -9330,7 +9477,7 @@ var contentSchema = new MongooseSchema18(
|
|
|
9330
9477
|
},
|
|
9331
9478
|
{ _id: false }
|
|
9332
9479
|
);
|
|
9333
|
-
var resourceSchema = new
|
|
9480
|
+
var resourceSchema = new MongooseSchema19(
|
|
9334
9481
|
{
|
|
9335
9482
|
resourceId: { required: true, type: String },
|
|
9336
9483
|
resourceRegion: { required: true, type: String },
|
|
@@ -9343,7 +9490,7 @@ var resourceSchema = new MongooseSchema18(
|
|
|
9343
9490
|
},
|
|
9344
9491
|
{ _id: false }
|
|
9345
9492
|
);
|
|
9346
|
-
var
|
|
9493
|
+
var schema15 = new MongooseSchema19(
|
|
9347
9494
|
{
|
|
9348
9495
|
active: { default: false, required: true, type: Boolean },
|
|
9349
9496
|
approvedAt: { default: null, required: false, type: Date },
|
|
@@ -9374,16 +9521,16 @@ var schema14 = new MongooseSchema18(
|
|
|
9374
9521
|
},
|
|
9375
9522
|
{ timestamps: true }
|
|
9376
9523
|
);
|
|
9377
|
-
|
|
9378
|
-
|
|
9379
|
-
|
|
9380
|
-
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);
|
|
9381
9528
|
|
|
9382
9529
|
// src/mongoose/AppSetting.ts
|
|
9383
|
-
var
|
|
9384
|
-
var
|
|
9530
|
+
var import_mongoose20 = __toESM(require("mongoose"));
|
|
9531
|
+
var MongooseSchema20 = import_mongoose20.default.Schema;
|
|
9385
9532
|
var APP_SETTINGS_ID = "APP_SETTINGS_DOCUMENT_ID";
|
|
9386
|
-
var AppSettingSchema = new
|
|
9533
|
+
var AppSettingSchema = new MongooseSchema20(
|
|
9387
9534
|
{
|
|
9388
9535
|
activeSchoolsStudentCountTotal: {
|
|
9389
9536
|
default: 0,
|
|
@@ -9414,18 +9561,18 @@ var AppSettingSchema = new MongooseSchema19(
|
|
|
9414
9561
|
},
|
|
9415
9562
|
{ timestamps: true }
|
|
9416
9563
|
);
|
|
9417
|
-
var AppSettingModel =
|
|
9564
|
+
var AppSettingModel = import_mongoose20.default.models.AppSetting || import_mongoose20.default.model("AppSetting", AppSettingSchema);
|
|
9418
9565
|
|
|
9419
9566
|
// src/mongoose/game/Game.ts
|
|
9420
|
-
var
|
|
9567
|
+
var import_mongoose24 = __toESM(require("mongoose"));
|
|
9421
9568
|
|
|
9422
9569
|
// src/mongoose/game/DailyClue.ts
|
|
9423
|
-
var
|
|
9570
|
+
var import_mongoose22 = __toESM(require("mongoose"));
|
|
9424
9571
|
|
|
9425
9572
|
// src/mongoose/game/utils.ts
|
|
9426
|
-
var
|
|
9427
|
-
var
|
|
9428
|
-
var schemaGameDate = new
|
|
9573
|
+
var import_mongoose21 = __toESM(require("mongoose"));
|
|
9574
|
+
var MongooseSchema21 = import_mongoose21.default.Schema;
|
|
9575
|
+
var schemaGameDate = new MongooseSchema21(
|
|
9429
9576
|
{
|
|
9430
9577
|
endDate: { required: true, type: Date },
|
|
9431
9578
|
startDate: { required: true, type: Date }
|
|
@@ -9434,8 +9581,8 @@ var schemaGameDate = new MongooseSchema20(
|
|
|
9434
9581
|
);
|
|
9435
9582
|
|
|
9436
9583
|
// src/mongoose/game/DailyClue.ts
|
|
9437
|
-
var
|
|
9438
|
-
var schemaLetters = new
|
|
9584
|
+
var MongooseSchema22 = import_mongoose22.default.Schema;
|
|
9585
|
+
var schemaLetters = new MongooseSchema22(
|
|
9439
9586
|
{
|
|
9440
9587
|
collected: { required: false, type: [String] },
|
|
9441
9588
|
solutionShuffled: { required: true, type: [String] }
|
|
@@ -9443,14 +9590,14 @@ var schemaLetters = new MongooseSchema21(
|
|
|
9443
9590
|
},
|
|
9444
9591
|
{ _id: false }
|
|
9445
9592
|
);
|
|
9446
|
-
var schemaDailyClueBaseGame = new
|
|
9593
|
+
var schemaDailyClueBaseGame = new MongooseSchema22(
|
|
9447
9594
|
{
|
|
9448
9595
|
gameDate: { required: true, type: schemaGameDate },
|
|
9449
9596
|
gameSolution: { required: true, type: String }
|
|
9450
9597
|
},
|
|
9451
9598
|
{ _id: false }
|
|
9452
9599
|
);
|
|
9453
|
-
var schemaDailyClueGameData = new
|
|
9600
|
+
var schemaDailyClueGameData = new MongooseSchema22(
|
|
9454
9601
|
{
|
|
9455
9602
|
gameFields: { required: true, type: schemaDailyClueBaseGame },
|
|
9456
9603
|
lastFoundDate: { default: null, required: false, type: Date },
|
|
@@ -9465,9 +9612,9 @@ var schemaDailyClueGameData = new MongooseSchema21(
|
|
|
9465
9612
|
);
|
|
9466
9613
|
|
|
9467
9614
|
// src/mongoose/game/PuzzleGame.ts
|
|
9468
|
-
var
|
|
9469
|
-
var
|
|
9470
|
-
var schemaPuzzleAnswer = new
|
|
9615
|
+
var import_mongoose23 = __toESM(require("mongoose"));
|
|
9616
|
+
var MongooseSchema23 = import_mongoose23.default.Schema;
|
|
9617
|
+
var schemaPuzzleAnswer = new MongooseSchema23(
|
|
9471
9618
|
{
|
|
9472
9619
|
answer: { required: true, type: String },
|
|
9473
9620
|
answerId: { required: true, type: String },
|
|
@@ -9475,7 +9622,7 @@ var schemaPuzzleAnswer = new MongooseSchema22(
|
|
|
9475
9622
|
},
|
|
9476
9623
|
{ _id: false }
|
|
9477
9624
|
);
|
|
9478
|
-
var schemaPuzzleQuestion = new
|
|
9625
|
+
var schemaPuzzleQuestion = new MongooseSchema23(
|
|
9479
9626
|
{
|
|
9480
9627
|
answers: { required: true, type: [schemaPuzzleAnswer] },
|
|
9481
9628
|
question: { required: true, type: String },
|
|
@@ -9483,20 +9630,20 @@ var schemaPuzzleQuestion = new MongooseSchema22(
|
|
|
9483
9630
|
},
|
|
9484
9631
|
{ _id: false }
|
|
9485
9632
|
);
|
|
9486
|
-
var schemaPuzzleBaseGame = new
|
|
9633
|
+
var schemaPuzzleBaseGame = new MongooseSchema23(
|
|
9487
9634
|
{
|
|
9488
9635
|
questions: { required: true, type: [schemaPuzzleQuestion] }
|
|
9489
9636
|
},
|
|
9490
9637
|
{ _id: false }
|
|
9491
9638
|
);
|
|
9492
|
-
var schemaPuzzleAnsweredQuestion = new
|
|
9639
|
+
var schemaPuzzleAnsweredQuestion = new MongooseSchema23(
|
|
9493
9640
|
{
|
|
9494
9641
|
questionId: { required: true, type: String },
|
|
9495
9642
|
selectedAnswerId: { required: true, type: String }
|
|
9496
9643
|
},
|
|
9497
9644
|
{ _id: false }
|
|
9498
9645
|
);
|
|
9499
|
-
var schemaPuzzleGameData = new
|
|
9646
|
+
var schemaPuzzleGameData = new MongooseSchema23(
|
|
9500
9647
|
{
|
|
9501
9648
|
answeredQuestions: {
|
|
9502
9649
|
default: null,
|
|
@@ -9511,7 +9658,7 @@ var schemaPuzzleGameData = new MongooseSchema22(
|
|
|
9511
9658
|
);
|
|
9512
9659
|
|
|
9513
9660
|
// src/mongoose/game/Game.ts
|
|
9514
|
-
var
|
|
9661
|
+
var MongooseSchema24 = import_mongoose24.default.Schema;
|
|
9515
9662
|
var gameDataSchemas = {
|
|
9516
9663
|
[EnumGameType.DAILY_CLUE]: schemaDailyClueGameData,
|
|
9517
9664
|
[EnumGameType.MINI_QUIZ]: schemaPuzzleGameData,
|
|
@@ -9523,7 +9670,7 @@ var gameDataDefinition = Object.fromEntries(
|
|
|
9523
9670
|
{ default: null, required: false, type: schema19 }
|
|
9524
9671
|
])
|
|
9525
9672
|
);
|
|
9526
|
-
var gameHistorySchema = new
|
|
9673
|
+
var gameHistorySchema = new MongooseSchema24(
|
|
9527
9674
|
{
|
|
9528
9675
|
createdAt: { required: true, type: Date },
|
|
9529
9676
|
gameDate: { required: true, type: schemaGameDate },
|
|
@@ -9543,7 +9690,7 @@ var gameHistorySchema = new MongooseSchema23(
|
|
|
9543
9690
|
},
|
|
9544
9691
|
{ _id: false }
|
|
9545
9692
|
);
|
|
9546
|
-
var gameTypeSchema = new
|
|
9693
|
+
var gameTypeSchema = new MongooseSchema24(
|
|
9547
9694
|
{
|
|
9548
9695
|
active: { default: true, required: true, type: Boolean },
|
|
9549
9696
|
gameData: gameDataDefinition,
|
|
@@ -9558,7 +9705,7 @@ var gameTypeSchema = new MongooseSchema23(
|
|
|
9558
9705
|
},
|
|
9559
9706
|
{ timestamps: true }
|
|
9560
9707
|
);
|
|
9561
|
-
var
|
|
9708
|
+
var schema16 = new MongooseSchema24(
|
|
9562
9709
|
{
|
|
9563
9710
|
active: { default: false, required: true, type: Boolean },
|
|
9564
9711
|
deletedAt: { default: null, required: false, type: Date },
|
|
@@ -9571,12 +9718,12 @@ var schema15 = new MongooseSchema23(
|
|
|
9571
9718
|
},
|
|
9572
9719
|
{ timestamps: true }
|
|
9573
9720
|
);
|
|
9574
|
-
var GameModel =
|
|
9721
|
+
var GameModel = import_mongoose24.default.models.Game || import_mongoose24.default.model("Game", schema16);
|
|
9575
9722
|
|
|
9576
9723
|
// src/mongoose/School.ts
|
|
9577
|
-
var
|
|
9578
|
-
var
|
|
9579
|
-
var campaignsSchema = new
|
|
9724
|
+
var import_mongoose25 = __toESM(require("mongoose"));
|
|
9725
|
+
var MongooseSchema25 = import_mongoose25.default.Schema;
|
|
9726
|
+
var campaignsSchema = new MongooseSchema25(
|
|
9580
9727
|
{
|
|
9581
9728
|
endDate: { required: true, type: Date },
|
|
9582
9729
|
name: { required: true, type: String },
|
|
@@ -9584,7 +9731,7 @@ var campaignsSchema = new MongooseSchema24(
|
|
|
9584
9731
|
},
|
|
9585
9732
|
{ _id: false }
|
|
9586
9733
|
);
|
|
9587
|
-
var
|
|
9734
|
+
var schema17 = new MongooseSchema25(
|
|
9588
9735
|
{
|
|
9589
9736
|
// New schools are active by default
|
|
9590
9737
|
active: { default: false, required: true, type: Boolean },
|
|
@@ -9611,19 +9758,19 @@ var schema16 = new MongooseSchema24(
|
|
|
9611
9758
|
},
|
|
9612
9759
|
{ timestamps: true }
|
|
9613
9760
|
);
|
|
9614
|
-
|
|
9761
|
+
schema17.index(
|
|
9615
9762
|
{ schoolCode: 1 },
|
|
9616
9763
|
{
|
|
9617
9764
|
partialFilterExpression: { active: true, deletedAt: null },
|
|
9618
9765
|
unique: true
|
|
9619
9766
|
}
|
|
9620
9767
|
);
|
|
9621
|
-
var SchoolModel =
|
|
9768
|
+
var SchoolModel = import_mongoose25.default.models.School || import_mongoose25.default.model("School", schema17);
|
|
9622
9769
|
|
|
9623
9770
|
// src/mongoose/Affiliate.ts
|
|
9624
|
-
var
|
|
9625
|
-
var
|
|
9626
|
-
var affiliateRewardSchema = new
|
|
9771
|
+
var import_mongoose26 = __toESM(require("mongoose"));
|
|
9772
|
+
var MongooseSchema26 = import_mongoose26.default.Schema;
|
|
9773
|
+
var affiliateRewardSchema = new MongooseSchema26(
|
|
9627
9774
|
{
|
|
9628
9775
|
createdAt: { required: true, type: Date },
|
|
9629
9776
|
redeemedAt: { default: null, required: false, type: Date },
|
|
@@ -9637,13 +9784,13 @@ var affiliateRewardSchema = new MongooseSchema25(
|
|
|
9637
9784
|
},
|
|
9638
9785
|
{ _id: false }
|
|
9639
9786
|
);
|
|
9640
|
-
var affiliateResourceSchema = new
|
|
9787
|
+
var affiliateResourceSchema = new MongooseSchema26(
|
|
9641
9788
|
{
|
|
9642
9789
|
resourceActive: { default: true, required: true, type: Boolean },
|
|
9643
9790
|
resourceDeletedAt: { default: null, required: false, type: Date },
|
|
9644
9791
|
resourceId: {
|
|
9645
9792
|
required: true,
|
|
9646
|
-
type:
|
|
9793
|
+
type: import_mongoose26.default.Schema.Types.ObjectId
|
|
9647
9794
|
},
|
|
9648
9795
|
resourceName: { required: true, type: String },
|
|
9649
9796
|
resourceOwner: {
|
|
@@ -9663,20 +9810,20 @@ var affiliateResourceSchema = new MongooseSchema25(
|
|
|
9663
9810
|
},
|
|
9664
9811
|
{ _id: false }
|
|
9665
9812
|
);
|
|
9666
|
-
var affiliateContactDetailsSchema = new
|
|
9813
|
+
var affiliateContactDetailsSchema = new MongooseSchema26(
|
|
9667
9814
|
{
|
|
9668
9815
|
mobilePhone: { required: true, type: String }
|
|
9669
9816
|
},
|
|
9670
9817
|
{ _id: false }
|
|
9671
9818
|
);
|
|
9672
|
-
var affiliateBankAccountDetailsSchema = new
|
|
9819
|
+
var affiliateBankAccountDetailsSchema = new MongooseSchema26(
|
|
9673
9820
|
{
|
|
9674
9821
|
accountHolderName: { required: true, type: String },
|
|
9675
9822
|
accountNumber: { required: true, type: String }
|
|
9676
9823
|
},
|
|
9677
9824
|
{ _id: false }
|
|
9678
9825
|
);
|
|
9679
|
-
var affiliateDetailsSchema = new
|
|
9826
|
+
var affiliateDetailsSchema = new MongooseSchema26(
|
|
9680
9827
|
{
|
|
9681
9828
|
bankAccountDetails: {
|
|
9682
9829
|
required: true,
|
|
@@ -9698,7 +9845,7 @@ var affiliateDetailsSchema = new MongooseSchema25(
|
|
|
9698
9845
|
},
|
|
9699
9846
|
{ _id: false }
|
|
9700
9847
|
);
|
|
9701
|
-
var redeemHistorySchema = new
|
|
9848
|
+
var redeemHistorySchema = new MongooseSchema26(
|
|
9702
9849
|
{
|
|
9703
9850
|
paidAt: { default: null, required: false, type: Date },
|
|
9704
9851
|
redeemedAt: { required: true, type: Date },
|
|
@@ -9706,7 +9853,7 @@ var redeemHistorySchema = new MongooseSchema25(
|
|
|
9706
9853
|
},
|
|
9707
9854
|
{ _id: false }
|
|
9708
9855
|
);
|
|
9709
|
-
var
|
|
9856
|
+
var schema18 = new MongooseSchema26(
|
|
9710
9857
|
{
|
|
9711
9858
|
active: { default: false, required: true, type: Boolean },
|
|
9712
9859
|
affiliateBonusRewards: {
|
|
@@ -9736,71 +9883,14 @@ var schema17 = new MongooseSchema25(
|
|
|
9736
9883
|
},
|
|
9737
9884
|
{ timestamps: true }
|
|
9738
9885
|
);
|
|
9739
|
-
|
|
9886
|
+
schema18.index(
|
|
9740
9887
|
{ affiliateCode: 1 },
|
|
9741
9888
|
{
|
|
9742
9889
|
partialFilterExpression: { active: true, deletedAt: null },
|
|
9743
9890
|
unique: true
|
|
9744
9891
|
}
|
|
9745
9892
|
);
|
|
9746
|
-
var AffiliateModel =
|
|
9747
|
-
|
|
9748
|
-
// src/mongoose/Coupon.ts
|
|
9749
|
-
var import_mongoose26 = __toESM(require("mongoose"));
|
|
9750
|
-
var MongooseSchema26 = import_mongoose26.default.Schema;
|
|
9751
|
-
var couponOptionSchema = new MongooseSchema26(
|
|
9752
|
-
{
|
|
9753
|
-
buy: { required: true, type: Number },
|
|
9754
|
-
get: { required: true, type: Number },
|
|
9755
|
-
unit: { required: true, type: String }
|
|
9756
|
-
},
|
|
9757
|
-
{ _id: false }
|
|
9758
|
-
);
|
|
9759
|
-
var couponCodeSchema = new MongooseSchema26(
|
|
9760
|
-
{
|
|
9761
|
-
code: { required: true, type: String },
|
|
9762
|
-
qrCode: { required: true, type: ResourceImageTypeSchema }
|
|
9763
|
-
},
|
|
9764
|
-
{ _id: false }
|
|
9765
|
-
);
|
|
9766
|
-
var couponParticipantUserSchema = new MongooseSchema26(
|
|
9767
|
-
{
|
|
9768
|
-
couponCount: { default: 0, required: true, type: Number },
|
|
9769
|
-
couponRedeemedAt: { default: null, required: false, type: Date },
|
|
9770
|
-
userId: {
|
|
9771
|
-
ref: "User",
|
|
9772
|
-
required: true,
|
|
9773
|
-
type: import_mongoose26.default.Schema.Types.ObjectId
|
|
9774
|
-
}
|
|
9775
|
-
},
|
|
9776
|
-
{ timestamps: true }
|
|
9777
|
-
);
|
|
9778
|
-
var productCouponSchema = new MongooseSchema26(
|
|
9779
|
-
{
|
|
9780
|
-
active: { default: true, required: true, type: Boolean },
|
|
9781
|
-
couponCode: { required: true, type: couponCodeSchema },
|
|
9782
|
-
couponDescription: { required: true, type: String },
|
|
9783
|
-
couponOption: { required: true, type: couponOptionSchema },
|
|
9784
|
-
endDate: { required: true, type: Date },
|
|
9785
|
-
participantProduct: { required: true, type: vendorProductTypeSchema },
|
|
9786
|
-
participantUsers: {
|
|
9787
|
-
default: null,
|
|
9788
|
-
required: false,
|
|
9789
|
-
type: [couponParticipantUserSchema]
|
|
9790
|
-
},
|
|
9791
|
-
startDate: { required: true, type: Date }
|
|
9792
|
-
},
|
|
9793
|
-
{ timestamps: true }
|
|
9794
|
-
);
|
|
9795
|
-
var schema18 = new MongooseSchema26(
|
|
9796
|
-
{
|
|
9797
|
-
active: { default: true, required: true, type: Boolean },
|
|
9798
|
-
deletedAt: { default: null, required: false, type: Date },
|
|
9799
|
-
productCoupons: { required: false, type: [productCouponSchema] }
|
|
9800
|
-
},
|
|
9801
|
-
{ timestamps: true }
|
|
9802
|
-
);
|
|
9803
|
-
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);
|
|
9804
9894
|
|
|
9805
9895
|
// src/service/promoCode/constants.ts
|
|
9806
9896
|
var ACTIVE_NOT_DELETED_FILTER = {
|
|
@@ -9872,7 +9962,7 @@ var SHARE_RESOURCE_LABEL2 = {
|
|
|
9872
9962
|
school: "School"
|
|
9873
9963
|
};
|
|
9874
9964
|
|
|
9875
|
-
// node_modules/@timardex/cluemart-shared/dist/chunk-
|
|
9965
|
+
// node_modules/@timardex/cluemart-shared/dist/chunk-UV5GH6NI.mjs
|
|
9876
9966
|
var PROMO_CODE_PREFIX2 = "CM-";
|
|
9877
9967
|
var OBJECT_ID_PATH_SEGMENT2 = "[a-f0-9]{24}";
|
|
9878
9968
|
var OBJECT_ID_PATH_SEGMENT_END2 = `${OBJECT_ID_PATH_SEGMENT2}$`;
|
|
@@ -9974,7 +10064,7 @@ var gameScreenIdentifierList2 = [
|
|
|
9974
10064
|
}
|
|
9975
10065
|
];
|
|
9976
10066
|
|
|
9977
|
-
// node_modules/@timardex/cluemart-shared/dist/chunk-
|
|
10067
|
+
// node_modules/@timardex/cluemart-shared/dist/chunk-3UYXNSNB.mjs
|
|
9978
10068
|
var import_dayjs4 = __toESM(require("dayjs"), 1);
|
|
9979
10069
|
var statusOptions2 = [
|
|
9980
10070
|
...Object.values(EnumInviteStatus2).map((status) => ({
|
|
@@ -11785,6 +11875,7 @@ function updateRelationDatesToUnavailable(relationDates, eventDateTime) {
|
|
|
11785
11875
|
normalizeAffiliatePromoCodes,
|
|
11786
11876
|
normalizePromoCode,
|
|
11787
11877
|
notifyUsers,
|
|
11878
|
+
productCouponSchema,
|
|
11788
11879
|
publishNotificationEvents,
|
|
11789
11880
|
refundPolicySchema,
|
|
11790
11881
|
relatedPostSchema,
|