@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/service/index.cjs
CHANGED
|
@@ -3679,6 +3679,11 @@ var EnumAffiliateRewardType = /* @__PURE__ */ ((EnumAffiliateRewardType22) => {
|
|
|
3679
3679
|
EnumAffiliateRewardType22["NEW_VENDOR_REGISTRATION"] = "NEW_VENDOR_REGISTRATION";
|
|
3680
3680
|
return EnumAffiliateRewardType22;
|
|
3681
3681
|
})(EnumAffiliateRewardType || {});
|
|
3682
|
+
var EnumCouponQualificationType = /* @__PURE__ */ ((EnumCouponQualificationType2) => {
|
|
3683
|
+
EnumCouponQualificationType2["PURCHASE"] = "PURCHASE";
|
|
3684
|
+
EnumCouponQualificationType2["MARKET_VISIT"] = "MARKET_VISIT";
|
|
3685
|
+
return EnumCouponQualificationType2;
|
|
3686
|
+
})(EnumCouponQualificationType || {});
|
|
3682
3687
|
var statusOptions = [
|
|
3683
3688
|
...Object.values(EnumInviteStatus).map((status) => ({
|
|
3684
3689
|
label: status,
|
|
@@ -5102,6 +5107,7 @@ var USER_FIELDS_FRAGMENT = gql`
|
|
|
5102
5107
|
avatar {
|
|
5103
5108
|
...ResourceImageFields
|
|
5104
5109
|
}
|
|
5110
|
+
coupon
|
|
5105
5111
|
createdAt
|
|
5106
5112
|
deletedAt
|
|
5107
5113
|
email
|
|
@@ -5448,6 +5454,109 @@ var GET_EVENT_INFO = gql`
|
|
|
5448
5454
|
}
|
|
5449
5455
|
${EVENT_INFO}
|
|
5450
5456
|
`;
|
|
5457
|
+
var PRODUCT_COUPON_FIELDS_FRAGMENT = gql`
|
|
5458
|
+
fragment ProductCouponFields on ProductCouponType {
|
|
5459
|
+
couponDocumentId
|
|
5460
|
+
couponId
|
|
5461
|
+
}
|
|
5462
|
+
`;
|
|
5463
|
+
var COUPON_CODE_FIELDS_FRAGMENT = gql`
|
|
5464
|
+
fragment CouponCodeFields on CouponCodeType {
|
|
5465
|
+
code
|
|
5466
|
+
qrCode {
|
|
5467
|
+
...ResourceImageFields
|
|
5468
|
+
}
|
|
5469
|
+
}
|
|
5470
|
+
${RESOURCE_IMAGE_FIELDS_FRAGMENT}
|
|
5471
|
+
`;
|
|
5472
|
+
var COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT = gql`
|
|
5473
|
+
fragment CouponParticipantUserFields on CouponParticipantUserType {
|
|
5474
|
+
couponCollectedCount
|
|
5475
|
+
couponRedeemedAt
|
|
5476
|
+
createdAt
|
|
5477
|
+
updatedAt
|
|
5478
|
+
userId
|
|
5479
|
+
}
|
|
5480
|
+
`;
|
|
5481
|
+
var COUPON_OPTION_FIELDS_FRAGMENT = gql`
|
|
5482
|
+
fragment CouponOptionFields on CouponOptionType {
|
|
5483
|
+
type
|
|
5484
|
+
buy
|
|
5485
|
+
get
|
|
5486
|
+
unit
|
|
5487
|
+
visits
|
|
5488
|
+
}
|
|
5489
|
+
`;
|
|
5490
|
+
var COUPON_REWARD_FIELDS_FRAGMENT = gql`
|
|
5491
|
+
fragment CouponRewardFields on CouponRewardType {
|
|
5492
|
+
vendorId
|
|
5493
|
+
productId
|
|
5494
|
+
quantity
|
|
5495
|
+
unit
|
|
5496
|
+
}
|
|
5497
|
+
`;
|
|
5498
|
+
var COUPON_DATA_FIELDS_FRAGMENT = gql`
|
|
5499
|
+
fragment CouponDataFields on CouponDataType {
|
|
5500
|
+
_id
|
|
5501
|
+
active
|
|
5502
|
+
couponCode {
|
|
5503
|
+
...CouponCodeFields
|
|
5504
|
+
}
|
|
5505
|
+
couponDescription
|
|
5506
|
+
couponOption {
|
|
5507
|
+
...CouponOptionFields
|
|
5508
|
+
}
|
|
5509
|
+
couponRewards {
|
|
5510
|
+
...CouponRewardFields
|
|
5511
|
+
}
|
|
5512
|
+
createdAt
|
|
5513
|
+
endDate
|
|
5514
|
+
participantUsers {
|
|
5515
|
+
...CouponParticipantUserFields
|
|
5516
|
+
}
|
|
5517
|
+
resourceId
|
|
5518
|
+
resourceType
|
|
5519
|
+
startDate
|
|
5520
|
+
updatedAt
|
|
5521
|
+
}
|
|
5522
|
+
${COUPON_CODE_FIELDS_FRAGMENT}
|
|
5523
|
+
${COUPON_OPTION_FIELDS_FRAGMENT}
|
|
5524
|
+
${COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT}
|
|
5525
|
+
${COUPON_REWARD_FIELDS_FRAGMENT}
|
|
5526
|
+
`;
|
|
5527
|
+
var COUPON = gql`
|
|
5528
|
+
fragment CouponFields on CouponType {
|
|
5529
|
+
_id
|
|
5530
|
+
active
|
|
5531
|
+
couponData {
|
|
5532
|
+
...CouponDataFields
|
|
5533
|
+
}
|
|
5534
|
+
createdAt
|
|
5535
|
+
deletedAt
|
|
5536
|
+
owner {
|
|
5537
|
+
...OwnerFields
|
|
5538
|
+
}
|
|
5539
|
+
updatedAt
|
|
5540
|
+
}
|
|
5541
|
+
${OWNER_FIELDS_FRAGMENT}
|
|
5542
|
+
${COUPON_DATA_FIELDS_FRAGMENT}
|
|
5543
|
+
`;
|
|
5544
|
+
var GET_COUPONS = gql`
|
|
5545
|
+
query getCoupons {
|
|
5546
|
+
coupons {
|
|
5547
|
+
...CouponFields
|
|
5548
|
+
}
|
|
5549
|
+
}
|
|
5550
|
+
${COUPON}
|
|
5551
|
+
`;
|
|
5552
|
+
var GET_COUPON = gql`
|
|
5553
|
+
query getCoupon($_id: ID!) {
|
|
5554
|
+
coupon(_id: $_id) {
|
|
5555
|
+
...CouponFields
|
|
5556
|
+
}
|
|
5557
|
+
}
|
|
5558
|
+
${COUPON}
|
|
5559
|
+
`;
|
|
5451
5560
|
var VENDOR_DATETIME_FIELDS_FRAGMENT = gql`
|
|
5452
5561
|
fragment VendorDateTimeFields on VendorDateTimeType {
|
|
5453
5562
|
dateStatus
|
|
@@ -5460,15 +5569,18 @@ var VENDOR_DATETIME_FIELDS_FRAGMENT = gql`
|
|
|
5460
5569
|
var VENDOR_PRODUCT_LIST_FIELDS_FRAGMENT = gql`
|
|
5461
5570
|
fragment VendorProductListFields on VendorProductListType {
|
|
5462
5571
|
_id
|
|
5572
|
+
coupon {
|
|
5573
|
+
...ProductCouponFields
|
|
5574
|
+
}
|
|
5463
5575
|
createdAt
|
|
5464
5576
|
description
|
|
5465
|
-
hasCoupon
|
|
5466
5577
|
name
|
|
5467
5578
|
price
|
|
5468
5579
|
priceUnit
|
|
5469
5580
|
productGroups
|
|
5470
5581
|
updatedAt
|
|
5471
5582
|
}
|
|
5583
|
+
${PRODUCT_COUPON_FIELDS_FRAGMENT}
|
|
5472
5584
|
`;
|
|
5473
5585
|
var VENDOR = gql`
|
|
5474
5586
|
fragment VendorFields on VendorType {
|
|
@@ -7770,79 +7882,6 @@ var ASSIGN_AFFILIATE_BONUS_REWARD_MUTATION = gql`
|
|
|
7770
7882
|
}
|
|
7771
7883
|
${AFFILIATE_FIELDS_FRAGMENT}
|
|
7772
7884
|
`;
|
|
7773
|
-
var COUPON_CODE_FIELDS_FRAGMENT = gql`
|
|
7774
|
-
fragment CouponCodeFields on CouponCodeType {
|
|
7775
|
-
code
|
|
7776
|
-
qrCode {
|
|
7777
|
-
...ResourceImageFields
|
|
7778
|
-
}
|
|
7779
|
-
}
|
|
7780
|
-
${RESOURCE_IMAGE_FIELDS_FRAGMENT}
|
|
7781
|
-
`;
|
|
7782
|
-
var COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT = gql`
|
|
7783
|
-
fragment CouponParticipantUserFields on CouponParticipantUserType {
|
|
7784
|
-
couponCount
|
|
7785
|
-
couponRedeemedAt
|
|
7786
|
-
createdAt
|
|
7787
|
-
updatedAt
|
|
7788
|
-
userId
|
|
7789
|
-
}
|
|
7790
|
-
`;
|
|
7791
|
-
var PRODUCT_COUPON_FIELDS_FRAGMENT = gql`
|
|
7792
|
-
fragment ProductCouponFields on ProductCouponType {
|
|
7793
|
-
_id
|
|
7794
|
-
active
|
|
7795
|
-
couponCode {
|
|
7796
|
-
...CouponCodeFields
|
|
7797
|
-
}
|
|
7798
|
-
couponDescription
|
|
7799
|
-
couponOption
|
|
7800
|
-
createdAt
|
|
7801
|
-
endDate
|
|
7802
|
-
participantProduct {
|
|
7803
|
-
...VendorProductListFields
|
|
7804
|
-
}
|
|
7805
|
-
participantUsers {
|
|
7806
|
-
...CouponParticipantUserFields
|
|
7807
|
-
}
|
|
7808
|
-
startDate
|
|
7809
|
-
updatedAt
|
|
7810
|
-
}
|
|
7811
|
-
${COUPON_CODE_FIELDS_FRAGMENT}
|
|
7812
|
-
${COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT}
|
|
7813
|
-
${VENDOR_PRODUCT_LIST_FIELDS_FRAGMENT}
|
|
7814
|
-
`;
|
|
7815
|
-
var COUPON = gql`
|
|
7816
|
-
fragment CouponFields on CouponType {
|
|
7817
|
-
_id
|
|
7818
|
-
active
|
|
7819
|
-
productCoupons {
|
|
7820
|
-
...ProductCouponFields
|
|
7821
|
-
}
|
|
7822
|
-
createdAt
|
|
7823
|
-
deletedAt
|
|
7824
|
-
updatedAt
|
|
7825
|
-
}
|
|
7826
|
-
${PRODUCT_COUPON_FIELDS_FRAGMENT}
|
|
7827
|
-
${COUPON_CODE_FIELDS_FRAGMENT}
|
|
7828
|
-
${COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT}
|
|
7829
|
-
`;
|
|
7830
|
-
var GET_COUPONS = gql`
|
|
7831
|
-
query getCoupons {
|
|
7832
|
-
coupons {
|
|
7833
|
-
...CouponFields
|
|
7834
|
-
}
|
|
7835
|
-
}
|
|
7836
|
-
${COUPON}
|
|
7837
|
-
`;
|
|
7838
|
-
var GET_COUPON = gql`
|
|
7839
|
-
query getCoupon($_id: ID!) {
|
|
7840
|
-
coupon(_id: $_id) {
|
|
7841
|
-
...CouponFields
|
|
7842
|
-
}
|
|
7843
|
-
}
|
|
7844
|
-
${COUPON}
|
|
7845
|
-
`;
|
|
7846
7885
|
var CREATE_COUPON_MUTATION = gql`
|
|
7847
7886
|
mutation createCoupon($input: CouponInputType!) {
|
|
7848
7887
|
createCoupon(input: $input) {
|
|
@@ -8542,7 +8581,7 @@ var baseResourceFields = {
|
|
|
8542
8581
|
logo: { required: false, type: ResourceImageTypeSchema },
|
|
8543
8582
|
name: { required: true, type: String },
|
|
8544
8583
|
owner: {
|
|
8545
|
-
required:
|
|
8584
|
+
required: true,
|
|
8546
8585
|
type: OwnerTypeSchema
|
|
8547
8586
|
},
|
|
8548
8587
|
posterUsage: { required: false, type: PosterUsageTypeSchema },
|
|
@@ -9007,12 +9046,117 @@ var schema8 = new MongooseSchema12(
|
|
|
9007
9046
|
var VerificationTokenModel = import_mongoose12.default.models.VerificationToken || import_mongoose12.default.model("VerificationToken", schema8);
|
|
9008
9047
|
|
|
9009
9048
|
// src/mongoose/vendor/Vendor.ts
|
|
9049
|
+
var import_mongoose14 = __toESM(require("mongoose"));
|
|
9050
|
+
|
|
9051
|
+
// src/mongoose/Coupon.ts
|
|
9010
9052
|
var import_mongoose13 = __toESM(require("mongoose"));
|
|
9011
9053
|
var MongooseSchema13 = import_mongoose13.default.Schema;
|
|
9012
|
-
var
|
|
9054
|
+
var productCouponSchema = new MongooseSchema13(
|
|
9055
|
+
{
|
|
9056
|
+
couponDocumentId: {
|
|
9057
|
+
ref: "Coupon",
|
|
9058
|
+
required: true,
|
|
9059
|
+
type: import_mongoose13.default.Schema.Types.ObjectId
|
|
9060
|
+
},
|
|
9061
|
+
couponId: {
|
|
9062
|
+
required: true,
|
|
9063
|
+
type: import_mongoose13.default.Schema.Types.ObjectId
|
|
9064
|
+
}
|
|
9065
|
+
},
|
|
9066
|
+
{ _id: false }
|
|
9067
|
+
);
|
|
9068
|
+
var couponOptionSchema = new MongooseSchema13(
|
|
9069
|
+
{
|
|
9070
|
+
buy: { required: false, type: Number },
|
|
9071
|
+
get: { required: false, type: Number },
|
|
9072
|
+
type: {
|
|
9073
|
+
enum: Object.values(EnumCouponQualificationType),
|
|
9074
|
+
required: true,
|
|
9075
|
+
type: String
|
|
9076
|
+
},
|
|
9077
|
+
unit: { required: false, type: String },
|
|
9078
|
+
visits: { required: false, type: Number }
|
|
9079
|
+
},
|
|
9080
|
+
{ _id: false }
|
|
9081
|
+
);
|
|
9082
|
+
var couponRewardSchema = new MongooseSchema13(
|
|
9013
9083
|
{
|
|
9084
|
+
productId: {
|
|
9085
|
+
required: true,
|
|
9086
|
+
type: import_mongoose13.default.Schema.Types.ObjectId
|
|
9087
|
+
},
|
|
9088
|
+
quantity: { required: true, type: Number },
|
|
9089
|
+
unit: { required: true, type: String },
|
|
9090
|
+
vendorId: {
|
|
9091
|
+
ref: "Vendor",
|
|
9092
|
+
required: true,
|
|
9093
|
+
type: import_mongoose13.default.Schema.Types.ObjectId
|
|
9094
|
+
}
|
|
9095
|
+
},
|
|
9096
|
+
{ _id: false }
|
|
9097
|
+
);
|
|
9098
|
+
var couponCodeSchema = new MongooseSchema13(
|
|
9099
|
+
{
|
|
9100
|
+
code: { required: true, type: String },
|
|
9101
|
+
qrCode: { required: true, type: ResourceImageTypeSchema }
|
|
9102
|
+
},
|
|
9103
|
+
{ _id: false }
|
|
9104
|
+
);
|
|
9105
|
+
var couponParticipantUserSchema = new MongooseSchema13(
|
|
9106
|
+
{
|
|
9107
|
+
couponCollectedCount: { default: 0, required: true, type: Number },
|
|
9108
|
+
couponRedeemedAt: { default: null, required: false, type: Date },
|
|
9109
|
+
userId: {
|
|
9110
|
+
ref: "User",
|
|
9111
|
+
required: true,
|
|
9112
|
+
type: import_mongoose13.default.Schema.Types.ObjectId
|
|
9113
|
+
}
|
|
9114
|
+
},
|
|
9115
|
+
{ timestamps: true }
|
|
9116
|
+
);
|
|
9117
|
+
var couponDataSchema = new MongooseSchema13(
|
|
9118
|
+
{
|
|
9119
|
+
active: { default: true, required: true, type: Boolean },
|
|
9120
|
+
couponCode: { required: true, type: couponCodeSchema },
|
|
9121
|
+
couponDescription: { required: true, type: String },
|
|
9122
|
+
couponOption: { required: true, type: couponOptionSchema },
|
|
9123
|
+
couponRewards: { required: false, type: [couponRewardSchema] },
|
|
9124
|
+
endDate: { required: true, type: Date },
|
|
9125
|
+
participantUsers: {
|
|
9126
|
+
default: null,
|
|
9127
|
+
required: false,
|
|
9128
|
+
type: [couponParticipantUserSchema]
|
|
9129
|
+
},
|
|
9130
|
+
resourceId: { required: true, type: String },
|
|
9131
|
+
resourceType: {
|
|
9132
|
+
enum: Object.values(EnumResourceType),
|
|
9133
|
+
required: true,
|
|
9134
|
+
type: String
|
|
9135
|
+
},
|
|
9136
|
+
startDate: { required: true, type: Date }
|
|
9137
|
+
},
|
|
9138
|
+
{ timestamps: true }
|
|
9139
|
+
);
|
|
9140
|
+
var schema9 = new MongooseSchema13(
|
|
9141
|
+
{
|
|
9142
|
+
active: { default: true, required: true, type: Boolean },
|
|
9143
|
+
couponData: { default: [], required: false, type: [couponDataSchema] },
|
|
9144
|
+
deletedAt: { default: null, required: false, type: Date },
|
|
9145
|
+
owner: {
|
|
9146
|
+
required: true,
|
|
9147
|
+
type: OwnerTypeSchema
|
|
9148
|
+
}
|
|
9149
|
+
},
|
|
9150
|
+
{ timestamps: true }
|
|
9151
|
+
);
|
|
9152
|
+
var CouponModel = import_mongoose13.default.models.Coupon || import_mongoose13.default.model("Coupon", schema9);
|
|
9153
|
+
|
|
9154
|
+
// src/mongoose/vendor/Vendor.ts
|
|
9155
|
+
var MongooseSchema14 = import_mongoose14.default.Schema;
|
|
9156
|
+
var vendorProductTypeSchema = new MongooseSchema14(
|
|
9157
|
+
{
|
|
9158
|
+
coupon: { required: false, type: productCouponSchema },
|
|
9014
9159
|
description: { required: false, type: String },
|
|
9015
|
-
hasCoupon: { default: false, required: false, type: Boolean },
|
|
9016
9160
|
name: { required: true, type: String },
|
|
9017
9161
|
price: { required: true, type: Number },
|
|
9018
9162
|
priceUnit: { required: true, type: String },
|
|
@@ -9020,14 +9164,14 @@ var vendorProductTypeSchema = new MongooseSchema13(
|
|
|
9020
9164
|
},
|
|
9021
9165
|
{ timestamps: true }
|
|
9022
9166
|
);
|
|
9023
|
-
var productWrapperSchema = new
|
|
9167
|
+
var productWrapperSchema = new MongooseSchema14(
|
|
9024
9168
|
{
|
|
9025
9169
|
active: { default: false, required: true, type: Boolean },
|
|
9026
9170
|
productsList: { required: false, type: [vendorProductTypeSchema] }
|
|
9027
9171
|
},
|
|
9028
9172
|
{ _id: false }
|
|
9029
9173
|
);
|
|
9030
|
-
var calendarSchema = new
|
|
9174
|
+
var calendarSchema = new MongooseSchema14(
|
|
9031
9175
|
{
|
|
9032
9176
|
dateTime: {
|
|
9033
9177
|
dateStatus: {
|
|
@@ -9048,14 +9192,14 @@ var calendarSchema = new MongooseSchema13(
|
|
|
9048
9192
|
},
|
|
9049
9193
|
{ _id: false }
|
|
9050
9194
|
);
|
|
9051
|
-
var calendarWrapperSchema = new
|
|
9195
|
+
var calendarWrapperSchema = new MongooseSchema14(
|
|
9052
9196
|
{
|
|
9053
9197
|
active: { default: false, required: true, type: Boolean },
|
|
9054
9198
|
calendarData: { required: false, type: [calendarSchema] }
|
|
9055
9199
|
},
|
|
9056
9200
|
{ _id: false }
|
|
9057
9201
|
);
|
|
9058
|
-
var
|
|
9202
|
+
var schema10 = new MongooseSchema14(
|
|
9059
9203
|
{
|
|
9060
9204
|
...baseResourceFields,
|
|
9061
9205
|
// Importing base resource fields from global.ts
|
|
@@ -9081,12 +9225,12 @@ var schema9 = new MongooseSchema13(
|
|
|
9081
9225
|
unregisteredVendorId: {
|
|
9082
9226
|
ref: "UnregisteredVendor",
|
|
9083
9227
|
required: false,
|
|
9084
|
-
type:
|
|
9228
|
+
type: import_mongoose14.default.Schema.Types.ObjectId
|
|
9085
9229
|
},
|
|
9086
9230
|
vendorInfoId: {
|
|
9087
9231
|
ref: "VendorInfo",
|
|
9088
9232
|
required: false,
|
|
9089
|
-
type:
|
|
9233
|
+
type: import_mongoose14.default.Schema.Types.ObjectId
|
|
9090
9234
|
},
|
|
9091
9235
|
vendorType: {
|
|
9092
9236
|
enum: Object.values(EnumVendorType),
|
|
@@ -9096,24 +9240,24 @@ var schema9 = new MongooseSchema13(
|
|
|
9096
9240
|
},
|
|
9097
9241
|
{ timestamps: true }
|
|
9098
9242
|
);
|
|
9099
|
-
|
|
9100
|
-
|
|
9101
|
-
|
|
9102
|
-
|
|
9103
|
-
|
|
9104
|
-
var VendorModel =
|
|
9243
|
+
schema10.index({ name: 1 });
|
|
9244
|
+
schema10.index({ description: 1 });
|
|
9245
|
+
schema10.index({ region: 1 });
|
|
9246
|
+
schema10.index({ "categories.name": 1 });
|
|
9247
|
+
schema10.index({ slug: 1 });
|
|
9248
|
+
var VendorModel = import_mongoose14.default.models.Vendor || import_mongoose14.default.model("Vendor", schema10);
|
|
9105
9249
|
|
|
9106
9250
|
// src/mongoose/vendor/VendorInfo.ts
|
|
9107
|
-
var
|
|
9108
|
-
var
|
|
9109
|
-
var AttributesSchema = new
|
|
9251
|
+
var import_mongoose15 = __toESM(require("mongoose"));
|
|
9252
|
+
var MongooseSchema15 = import_mongoose15.default.Schema;
|
|
9253
|
+
var AttributesSchema = new MongooseSchema15(
|
|
9110
9254
|
{
|
|
9111
9255
|
details: { required: false, type: String },
|
|
9112
9256
|
isRequired: { default: false, required: true, type: Boolean }
|
|
9113
9257
|
},
|
|
9114
9258
|
{ _id: false }
|
|
9115
9259
|
);
|
|
9116
|
-
var
|
|
9260
|
+
var schema11 = new MongooseSchema15(
|
|
9117
9261
|
{
|
|
9118
9262
|
active: { default: true, type: Boolean },
|
|
9119
9263
|
compliance: {
|
|
@@ -9148,28 +9292,28 @@ var schema10 = new MongooseSchema14(
|
|
|
9148
9292
|
vendorId: {
|
|
9149
9293
|
ref: "Vendor",
|
|
9150
9294
|
required: true,
|
|
9151
|
-
type:
|
|
9295
|
+
type: import_mongoose15.default.Schema.Types.ObjectId
|
|
9152
9296
|
}
|
|
9153
9297
|
},
|
|
9154
9298
|
{ timestamps: true }
|
|
9155
9299
|
);
|
|
9156
|
-
var VendorInfoModel =
|
|
9300
|
+
var VendorInfoModel = import_mongoose15.default.models.VendorInfo || import_mongoose15.default.model("VendorInfo", schema11);
|
|
9157
9301
|
|
|
9158
9302
|
// src/mongoose/vendor/UnregisteredVendor.ts
|
|
9159
|
-
var
|
|
9160
|
-
var
|
|
9161
|
-
var invitationSchema = new
|
|
9303
|
+
var import_mongoose16 = __toESM(require("mongoose"));
|
|
9304
|
+
var MongooseSchema16 = import_mongoose16.default.Schema;
|
|
9305
|
+
var invitationSchema = new MongooseSchema16(
|
|
9162
9306
|
{
|
|
9163
9307
|
dateTime: { required: true, type: [dateTimeSchema2] },
|
|
9164
9308
|
inviterId: {
|
|
9165
9309
|
ref: "Event",
|
|
9166
9310
|
required: true,
|
|
9167
|
-
type:
|
|
9311
|
+
type: import_mongoose16.default.Schema.Types.ObjectId
|
|
9168
9312
|
}
|
|
9169
9313
|
},
|
|
9170
9314
|
{ _id: false }
|
|
9171
9315
|
);
|
|
9172
|
-
var
|
|
9316
|
+
var schema12 = new MongooseSchema16(
|
|
9173
9317
|
{
|
|
9174
9318
|
active: { default: true, required: true, type: Boolean },
|
|
9175
9319
|
categoryIds: { required: true, type: [String] },
|
|
@@ -9178,7 +9322,7 @@ var schema11 = new MongooseSchema15(
|
|
|
9178
9322
|
claimedByUserId: {
|
|
9179
9323
|
ref: "User",
|
|
9180
9324
|
required: false,
|
|
9181
|
-
type:
|
|
9325
|
+
type: import_mongoose16.default.Schema.Types.ObjectId
|
|
9182
9326
|
},
|
|
9183
9327
|
claimInitiatedAt: { default: null, required: false, type: Date },
|
|
9184
9328
|
claimToken: { default: null, required: false, type: String },
|
|
@@ -9191,14 +9335,14 @@ var schema11 = new MongooseSchema15(
|
|
|
9191
9335
|
},
|
|
9192
9336
|
{ timestamps: true }
|
|
9193
9337
|
);
|
|
9194
|
-
|
|
9195
|
-
|
|
9196
|
-
var UnregisteredVendorModel =
|
|
9338
|
+
schema12.index({ name: 1 });
|
|
9339
|
+
schema12.index({ email: 1 });
|
|
9340
|
+
var UnregisteredVendorModel = import_mongoose16.default.models.UnregisteredVendor || import_mongoose16.default.model("UnregisteredVendor", schema12);
|
|
9197
9341
|
|
|
9198
9342
|
// src/mongoose/event/Event.ts
|
|
9199
|
-
var
|
|
9200
|
-
var
|
|
9201
|
-
var
|
|
9343
|
+
var import_mongoose17 = __toESM(require("mongoose"));
|
|
9344
|
+
var MongooseSchema17 = import_mongoose17.default.Schema;
|
|
9345
|
+
var schema13 = new MongooseSchema17(
|
|
9202
9346
|
{
|
|
9203
9347
|
...baseResourceFields,
|
|
9204
9348
|
// Importing base resource fields from global.ts
|
|
@@ -9207,7 +9351,7 @@ var schema12 = new MongooseSchema16(
|
|
|
9207
9351
|
eventInfoId: {
|
|
9208
9352
|
ref: "EventInfo",
|
|
9209
9353
|
required: false,
|
|
9210
|
-
type:
|
|
9354
|
+
type: import_mongoose17.default.Schema.Types.ObjectId
|
|
9211
9355
|
},
|
|
9212
9356
|
eventType: {
|
|
9213
9357
|
enum: Object.values(EnumEventType),
|
|
@@ -9236,20 +9380,20 @@ var schema12 = new MongooseSchema16(
|
|
|
9236
9380
|
},
|
|
9237
9381
|
{ timestamps: true }
|
|
9238
9382
|
);
|
|
9239
|
-
|
|
9240
|
-
|
|
9241
|
-
|
|
9242
|
-
|
|
9243
|
-
|
|
9244
|
-
|
|
9245
|
-
|
|
9246
|
-
|
|
9247
|
-
var EventModel =
|
|
9383
|
+
schema13.index({ name: 1 });
|
|
9384
|
+
schema13.index({ description: 1 });
|
|
9385
|
+
schema13.index({ region: 1 });
|
|
9386
|
+
schema13.index({ "location.geo": "2dsphere" });
|
|
9387
|
+
schema13.index({ tags: 1 });
|
|
9388
|
+
schema13.index({ deletedAt: 1 });
|
|
9389
|
+
schema13.index({ "dateTime.dateStatus": 1 });
|
|
9390
|
+
schema13.index({ slug: 1 });
|
|
9391
|
+
var EventModel = import_mongoose17.default.models.Event || import_mongoose17.default.model("Event", schema13);
|
|
9248
9392
|
|
|
9249
9393
|
// src/mongoose/Partner.ts
|
|
9250
|
-
var
|
|
9251
|
-
var
|
|
9252
|
-
var
|
|
9394
|
+
var import_mongoose18 = __toESM(require("mongoose"));
|
|
9395
|
+
var MongooseSchema18 = import_mongoose18.default.Schema;
|
|
9396
|
+
var schema14 = new MongooseSchema18(
|
|
9253
9397
|
{
|
|
9254
9398
|
...baseResourceFields,
|
|
9255
9399
|
location: {
|
|
@@ -9265,19 +9409,19 @@ var schema13 = new MongooseSchema17(
|
|
|
9265
9409
|
},
|
|
9266
9410
|
{ timestamps: true }
|
|
9267
9411
|
);
|
|
9268
|
-
|
|
9269
|
-
|
|
9270
|
-
|
|
9271
|
-
|
|
9272
|
-
|
|
9273
|
-
var PartnerModel =
|
|
9412
|
+
schema14.index({ name: 1 });
|
|
9413
|
+
schema14.index({ description: 1 });
|
|
9414
|
+
schema14.index({ region: 1 });
|
|
9415
|
+
schema14.index({ "location.geo": "2dsphere" });
|
|
9416
|
+
schema14.index({ slug: 1 });
|
|
9417
|
+
var PartnerModel = import_mongoose18.default.models.Partner || import_mongoose18.default.model("Partner", schema14);
|
|
9274
9418
|
|
|
9275
9419
|
// src/mongoose/Post.ts
|
|
9276
|
-
var
|
|
9277
|
-
var
|
|
9278
|
-
var contentSchema = new
|
|
9420
|
+
var import_mongoose19 = __toESM(require("mongoose"));
|
|
9421
|
+
var MongooseSchema19 = import_mongoose19.default.Schema;
|
|
9422
|
+
var contentSchema = new MongooseSchema19(
|
|
9279
9423
|
{
|
|
9280
|
-
contentData:
|
|
9424
|
+
contentData: import_mongoose19.Schema.Types.Mixed,
|
|
9281
9425
|
contentOrder: { required: true, type: Number },
|
|
9282
9426
|
contentType: {
|
|
9283
9427
|
enum: Object.values(EnumPostContentType),
|
|
@@ -9287,7 +9431,7 @@ var contentSchema = new MongooseSchema18(
|
|
|
9287
9431
|
},
|
|
9288
9432
|
{ _id: false }
|
|
9289
9433
|
);
|
|
9290
|
-
var resourceSchema = new
|
|
9434
|
+
var resourceSchema = new MongooseSchema19(
|
|
9291
9435
|
{
|
|
9292
9436
|
resourceId: { required: true, type: String },
|
|
9293
9437
|
resourceRegion: { required: true, type: String },
|
|
@@ -9300,7 +9444,7 @@ var resourceSchema = new MongooseSchema18(
|
|
|
9300
9444
|
},
|
|
9301
9445
|
{ _id: false }
|
|
9302
9446
|
);
|
|
9303
|
-
var
|
|
9447
|
+
var schema15 = new MongooseSchema19(
|
|
9304
9448
|
{
|
|
9305
9449
|
active: { default: false, required: true, type: Boolean },
|
|
9306
9450
|
approvedAt: { default: null, required: false, type: Date },
|
|
@@ -9331,16 +9475,16 @@ var schema14 = new MongooseSchema18(
|
|
|
9331
9475
|
},
|
|
9332
9476
|
{ timestamps: true }
|
|
9333
9477
|
);
|
|
9334
|
-
|
|
9335
|
-
|
|
9336
|
-
|
|
9337
|
-
var PostModel =
|
|
9478
|
+
schema15.index({ title: 1 });
|
|
9479
|
+
schema15.index({ tags: 1 });
|
|
9480
|
+
schema15.index({ postType: 1, slug: 1 }, { unique: true });
|
|
9481
|
+
var PostModel = import_mongoose19.default.models.Post || import_mongoose19.default.model("Post", schema15);
|
|
9338
9482
|
|
|
9339
9483
|
// src/mongoose/AppSetting.ts
|
|
9340
|
-
var
|
|
9341
|
-
var
|
|
9484
|
+
var import_mongoose20 = __toESM(require("mongoose"));
|
|
9485
|
+
var MongooseSchema20 = import_mongoose20.default.Schema;
|
|
9342
9486
|
var APP_SETTINGS_ID = "APP_SETTINGS_DOCUMENT_ID";
|
|
9343
|
-
var AppSettingSchema = new
|
|
9487
|
+
var AppSettingSchema = new MongooseSchema20(
|
|
9344
9488
|
{
|
|
9345
9489
|
activeSchoolsStudentCountTotal: {
|
|
9346
9490
|
default: 0,
|
|
@@ -9371,18 +9515,18 @@ var AppSettingSchema = new MongooseSchema19(
|
|
|
9371
9515
|
},
|
|
9372
9516
|
{ timestamps: true }
|
|
9373
9517
|
);
|
|
9374
|
-
var AppSettingModel =
|
|
9518
|
+
var AppSettingModel = import_mongoose20.default.models.AppSetting || import_mongoose20.default.model("AppSetting", AppSettingSchema);
|
|
9375
9519
|
|
|
9376
9520
|
// src/mongoose/game/Game.ts
|
|
9377
|
-
var
|
|
9521
|
+
var import_mongoose24 = __toESM(require("mongoose"));
|
|
9378
9522
|
|
|
9379
9523
|
// src/mongoose/game/DailyClue.ts
|
|
9380
|
-
var
|
|
9524
|
+
var import_mongoose22 = __toESM(require("mongoose"));
|
|
9381
9525
|
|
|
9382
9526
|
// src/mongoose/game/utils.ts
|
|
9383
|
-
var
|
|
9384
|
-
var
|
|
9385
|
-
var schemaGameDate = new
|
|
9527
|
+
var import_mongoose21 = __toESM(require("mongoose"));
|
|
9528
|
+
var MongooseSchema21 = import_mongoose21.default.Schema;
|
|
9529
|
+
var schemaGameDate = new MongooseSchema21(
|
|
9386
9530
|
{
|
|
9387
9531
|
endDate: { required: true, type: Date },
|
|
9388
9532
|
startDate: { required: true, type: Date }
|
|
@@ -9391,8 +9535,8 @@ var schemaGameDate = new MongooseSchema20(
|
|
|
9391
9535
|
);
|
|
9392
9536
|
|
|
9393
9537
|
// src/mongoose/game/DailyClue.ts
|
|
9394
|
-
var
|
|
9395
|
-
var schemaLetters = new
|
|
9538
|
+
var MongooseSchema22 = import_mongoose22.default.Schema;
|
|
9539
|
+
var schemaLetters = new MongooseSchema22(
|
|
9396
9540
|
{
|
|
9397
9541
|
collected: { required: false, type: [String] },
|
|
9398
9542
|
solutionShuffled: { required: true, type: [String] }
|
|
@@ -9400,14 +9544,14 @@ var schemaLetters = new MongooseSchema21(
|
|
|
9400
9544
|
},
|
|
9401
9545
|
{ _id: false }
|
|
9402
9546
|
);
|
|
9403
|
-
var schemaDailyClueBaseGame = new
|
|
9547
|
+
var schemaDailyClueBaseGame = new MongooseSchema22(
|
|
9404
9548
|
{
|
|
9405
9549
|
gameDate: { required: true, type: schemaGameDate },
|
|
9406
9550
|
gameSolution: { required: true, type: String }
|
|
9407
9551
|
},
|
|
9408
9552
|
{ _id: false }
|
|
9409
9553
|
);
|
|
9410
|
-
var schemaDailyClueGameData = new
|
|
9554
|
+
var schemaDailyClueGameData = new MongooseSchema22(
|
|
9411
9555
|
{
|
|
9412
9556
|
gameFields: { required: true, type: schemaDailyClueBaseGame },
|
|
9413
9557
|
lastFoundDate: { default: null, required: false, type: Date },
|
|
@@ -9422,9 +9566,9 @@ var schemaDailyClueGameData = new MongooseSchema21(
|
|
|
9422
9566
|
);
|
|
9423
9567
|
|
|
9424
9568
|
// src/mongoose/game/PuzzleGame.ts
|
|
9425
|
-
var
|
|
9426
|
-
var
|
|
9427
|
-
var schemaPuzzleAnswer = new
|
|
9569
|
+
var import_mongoose23 = __toESM(require("mongoose"));
|
|
9570
|
+
var MongooseSchema23 = import_mongoose23.default.Schema;
|
|
9571
|
+
var schemaPuzzleAnswer = new MongooseSchema23(
|
|
9428
9572
|
{
|
|
9429
9573
|
answer: { required: true, type: String },
|
|
9430
9574
|
answerId: { required: true, type: String },
|
|
@@ -9432,7 +9576,7 @@ var schemaPuzzleAnswer = new MongooseSchema22(
|
|
|
9432
9576
|
},
|
|
9433
9577
|
{ _id: false }
|
|
9434
9578
|
);
|
|
9435
|
-
var schemaPuzzleQuestion = new
|
|
9579
|
+
var schemaPuzzleQuestion = new MongooseSchema23(
|
|
9436
9580
|
{
|
|
9437
9581
|
answers: { required: true, type: [schemaPuzzleAnswer] },
|
|
9438
9582
|
question: { required: true, type: String },
|
|
@@ -9440,20 +9584,20 @@ var schemaPuzzleQuestion = new MongooseSchema22(
|
|
|
9440
9584
|
},
|
|
9441
9585
|
{ _id: false }
|
|
9442
9586
|
);
|
|
9443
|
-
var schemaPuzzleBaseGame = new
|
|
9587
|
+
var schemaPuzzleBaseGame = new MongooseSchema23(
|
|
9444
9588
|
{
|
|
9445
9589
|
questions: { required: true, type: [schemaPuzzleQuestion] }
|
|
9446
9590
|
},
|
|
9447
9591
|
{ _id: false }
|
|
9448
9592
|
);
|
|
9449
|
-
var schemaPuzzleAnsweredQuestion = new
|
|
9593
|
+
var schemaPuzzleAnsweredQuestion = new MongooseSchema23(
|
|
9450
9594
|
{
|
|
9451
9595
|
questionId: { required: true, type: String },
|
|
9452
9596
|
selectedAnswerId: { required: true, type: String }
|
|
9453
9597
|
},
|
|
9454
9598
|
{ _id: false }
|
|
9455
9599
|
);
|
|
9456
|
-
var schemaPuzzleGameData = new
|
|
9600
|
+
var schemaPuzzleGameData = new MongooseSchema23(
|
|
9457
9601
|
{
|
|
9458
9602
|
answeredQuestions: {
|
|
9459
9603
|
default: null,
|
|
@@ -9468,7 +9612,7 @@ var schemaPuzzleGameData = new MongooseSchema22(
|
|
|
9468
9612
|
);
|
|
9469
9613
|
|
|
9470
9614
|
// src/mongoose/game/Game.ts
|
|
9471
|
-
var
|
|
9615
|
+
var MongooseSchema24 = import_mongoose24.default.Schema;
|
|
9472
9616
|
var gameDataSchemas = {
|
|
9473
9617
|
[EnumGameType.DAILY_CLUE]: schemaDailyClueGameData,
|
|
9474
9618
|
[EnumGameType.MINI_QUIZ]: schemaPuzzleGameData,
|
|
@@ -9480,7 +9624,7 @@ var gameDataDefinition = Object.fromEntries(
|
|
|
9480
9624
|
{ default: null, required: false, type: schema19 }
|
|
9481
9625
|
])
|
|
9482
9626
|
);
|
|
9483
|
-
var gameHistorySchema = new
|
|
9627
|
+
var gameHistorySchema = new MongooseSchema24(
|
|
9484
9628
|
{
|
|
9485
9629
|
createdAt: { required: true, type: Date },
|
|
9486
9630
|
gameDate: { required: true, type: schemaGameDate },
|
|
@@ -9500,7 +9644,7 @@ var gameHistorySchema = new MongooseSchema23(
|
|
|
9500
9644
|
},
|
|
9501
9645
|
{ _id: false }
|
|
9502
9646
|
);
|
|
9503
|
-
var gameTypeSchema = new
|
|
9647
|
+
var gameTypeSchema = new MongooseSchema24(
|
|
9504
9648
|
{
|
|
9505
9649
|
active: { default: true, required: true, type: Boolean },
|
|
9506
9650
|
gameData: gameDataDefinition,
|
|
@@ -9515,7 +9659,7 @@ var gameTypeSchema = new MongooseSchema23(
|
|
|
9515
9659
|
},
|
|
9516
9660
|
{ timestamps: true }
|
|
9517
9661
|
);
|
|
9518
|
-
var
|
|
9662
|
+
var schema16 = new MongooseSchema24(
|
|
9519
9663
|
{
|
|
9520
9664
|
active: { default: false, required: true, type: Boolean },
|
|
9521
9665
|
deletedAt: { default: null, required: false, type: Date },
|
|
@@ -9528,12 +9672,12 @@ var schema15 = new MongooseSchema23(
|
|
|
9528
9672
|
},
|
|
9529
9673
|
{ timestamps: true }
|
|
9530
9674
|
);
|
|
9531
|
-
var GameModel =
|
|
9675
|
+
var GameModel = import_mongoose24.default.models.Game || import_mongoose24.default.model("Game", schema16);
|
|
9532
9676
|
|
|
9533
9677
|
// src/mongoose/School.ts
|
|
9534
|
-
var
|
|
9535
|
-
var
|
|
9536
|
-
var campaignsSchema = new
|
|
9678
|
+
var import_mongoose25 = __toESM(require("mongoose"));
|
|
9679
|
+
var MongooseSchema25 = import_mongoose25.default.Schema;
|
|
9680
|
+
var campaignsSchema = new MongooseSchema25(
|
|
9537
9681
|
{
|
|
9538
9682
|
endDate: { required: true, type: Date },
|
|
9539
9683
|
name: { required: true, type: String },
|
|
@@ -9541,7 +9685,7 @@ var campaignsSchema = new MongooseSchema24(
|
|
|
9541
9685
|
},
|
|
9542
9686
|
{ _id: false }
|
|
9543
9687
|
);
|
|
9544
|
-
var
|
|
9688
|
+
var schema17 = new MongooseSchema25(
|
|
9545
9689
|
{
|
|
9546
9690
|
// New schools are active by default
|
|
9547
9691
|
active: { default: false, required: true, type: Boolean },
|
|
@@ -9568,19 +9712,19 @@ var schema16 = new MongooseSchema24(
|
|
|
9568
9712
|
},
|
|
9569
9713
|
{ timestamps: true }
|
|
9570
9714
|
);
|
|
9571
|
-
|
|
9715
|
+
schema17.index(
|
|
9572
9716
|
{ schoolCode: 1 },
|
|
9573
9717
|
{
|
|
9574
9718
|
partialFilterExpression: { active: true, deletedAt: null },
|
|
9575
9719
|
unique: true
|
|
9576
9720
|
}
|
|
9577
9721
|
);
|
|
9578
|
-
var SchoolModel =
|
|
9722
|
+
var SchoolModel = import_mongoose25.default.models.School || import_mongoose25.default.model("School", schema17);
|
|
9579
9723
|
|
|
9580
9724
|
// src/mongoose/Affiliate.ts
|
|
9581
|
-
var
|
|
9582
|
-
var
|
|
9583
|
-
var affiliateRewardSchema = new
|
|
9725
|
+
var import_mongoose26 = __toESM(require("mongoose"));
|
|
9726
|
+
var MongooseSchema26 = import_mongoose26.default.Schema;
|
|
9727
|
+
var affiliateRewardSchema = new MongooseSchema26(
|
|
9584
9728
|
{
|
|
9585
9729
|
createdAt: { required: true, type: Date },
|
|
9586
9730
|
redeemedAt: { default: null, required: false, type: Date },
|
|
@@ -9594,13 +9738,13 @@ var affiliateRewardSchema = new MongooseSchema25(
|
|
|
9594
9738
|
},
|
|
9595
9739
|
{ _id: false }
|
|
9596
9740
|
);
|
|
9597
|
-
var affiliateResourceSchema = new
|
|
9741
|
+
var affiliateResourceSchema = new MongooseSchema26(
|
|
9598
9742
|
{
|
|
9599
9743
|
resourceActive: { default: true, required: true, type: Boolean },
|
|
9600
9744
|
resourceDeletedAt: { default: null, required: false, type: Date },
|
|
9601
9745
|
resourceId: {
|
|
9602
9746
|
required: true,
|
|
9603
|
-
type:
|
|
9747
|
+
type: import_mongoose26.default.Schema.Types.ObjectId
|
|
9604
9748
|
},
|
|
9605
9749
|
resourceName: { required: true, type: String },
|
|
9606
9750
|
resourceOwner: {
|
|
@@ -9620,20 +9764,20 @@ var affiliateResourceSchema = new MongooseSchema25(
|
|
|
9620
9764
|
},
|
|
9621
9765
|
{ _id: false }
|
|
9622
9766
|
);
|
|
9623
|
-
var affiliateContactDetailsSchema = new
|
|
9767
|
+
var affiliateContactDetailsSchema = new MongooseSchema26(
|
|
9624
9768
|
{
|
|
9625
9769
|
mobilePhone: { required: true, type: String }
|
|
9626
9770
|
},
|
|
9627
9771
|
{ _id: false }
|
|
9628
9772
|
);
|
|
9629
|
-
var affiliateBankAccountDetailsSchema = new
|
|
9773
|
+
var affiliateBankAccountDetailsSchema = new MongooseSchema26(
|
|
9630
9774
|
{
|
|
9631
9775
|
accountHolderName: { required: true, type: String },
|
|
9632
9776
|
accountNumber: { required: true, type: String }
|
|
9633
9777
|
},
|
|
9634
9778
|
{ _id: false }
|
|
9635
9779
|
);
|
|
9636
|
-
var affiliateDetailsSchema = new
|
|
9780
|
+
var affiliateDetailsSchema = new MongooseSchema26(
|
|
9637
9781
|
{
|
|
9638
9782
|
bankAccountDetails: {
|
|
9639
9783
|
required: true,
|
|
@@ -9655,7 +9799,7 @@ var affiliateDetailsSchema = new MongooseSchema25(
|
|
|
9655
9799
|
},
|
|
9656
9800
|
{ _id: false }
|
|
9657
9801
|
);
|
|
9658
|
-
var redeemHistorySchema = new
|
|
9802
|
+
var redeemHistorySchema = new MongooseSchema26(
|
|
9659
9803
|
{
|
|
9660
9804
|
paidAt: { default: null, required: false, type: Date },
|
|
9661
9805
|
redeemedAt: { required: true, type: Date },
|
|
@@ -9663,7 +9807,7 @@ var redeemHistorySchema = new MongooseSchema25(
|
|
|
9663
9807
|
},
|
|
9664
9808
|
{ _id: false }
|
|
9665
9809
|
);
|
|
9666
|
-
var
|
|
9810
|
+
var schema18 = new MongooseSchema26(
|
|
9667
9811
|
{
|
|
9668
9812
|
active: { default: false, required: true, type: Boolean },
|
|
9669
9813
|
affiliateBonusRewards: {
|
|
@@ -9693,71 +9837,14 @@ var schema17 = new MongooseSchema25(
|
|
|
9693
9837
|
},
|
|
9694
9838
|
{ timestamps: true }
|
|
9695
9839
|
);
|
|
9696
|
-
|
|
9840
|
+
schema18.index(
|
|
9697
9841
|
{ affiliateCode: 1 },
|
|
9698
9842
|
{
|
|
9699
9843
|
partialFilterExpression: { active: true, deletedAt: null },
|
|
9700
9844
|
unique: true
|
|
9701
9845
|
}
|
|
9702
9846
|
);
|
|
9703
|
-
var AffiliateModel =
|
|
9704
|
-
|
|
9705
|
-
// src/mongoose/Coupon.ts
|
|
9706
|
-
var import_mongoose26 = __toESM(require("mongoose"));
|
|
9707
|
-
var MongooseSchema26 = import_mongoose26.default.Schema;
|
|
9708
|
-
var couponOptionSchema = new MongooseSchema26(
|
|
9709
|
-
{
|
|
9710
|
-
buy: { required: true, type: Number },
|
|
9711
|
-
get: { required: true, type: Number },
|
|
9712
|
-
unit: { required: true, type: String }
|
|
9713
|
-
},
|
|
9714
|
-
{ _id: false }
|
|
9715
|
-
);
|
|
9716
|
-
var couponCodeSchema = new MongooseSchema26(
|
|
9717
|
-
{
|
|
9718
|
-
code: { required: true, type: String },
|
|
9719
|
-
qrCode: { required: true, type: ResourceImageTypeSchema }
|
|
9720
|
-
},
|
|
9721
|
-
{ _id: false }
|
|
9722
|
-
);
|
|
9723
|
-
var couponParticipantUserSchema = new MongooseSchema26(
|
|
9724
|
-
{
|
|
9725
|
-
couponCount: { default: 0, required: true, type: Number },
|
|
9726
|
-
couponRedeemedAt: { default: null, required: false, type: Date },
|
|
9727
|
-
userId: {
|
|
9728
|
-
ref: "User",
|
|
9729
|
-
required: true,
|
|
9730
|
-
type: import_mongoose26.default.Schema.Types.ObjectId
|
|
9731
|
-
}
|
|
9732
|
-
},
|
|
9733
|
-
{ timestamps: true }
|
|
9734
|
-
);
|
|
9735
|
-
var productCouponSchema = new MongooseSchema26(
|
|
9736
|
-
{
|
|
9737
|
-
active: { default: true, required: true, type: Boolean },
|
|
9738
|
-
couponCode: { required: true, type: couponCodeSchema },
|
|
9739
|
-
couponDescription: { required: true, type: String },
|
|
9740
|
-
couponOption: { required: true, type: couponOptionSchema },
|
|
9741
|
-
endDate: { required: true, type: Date },
|
|
9742
|
-
participantProduct: { required: true, type: vendorProductTypeSchema },
|
|
9743
|
-
participantUsers: {
|
|
9744
|
-
default: null,
|
|
9745
|
-
required: false,
|
|
9746
|
-
type: [couponParticipantUserSchema]
|
|
9747
|
-
},
|
|
9748
|
-
startDate: { required: true, type: Date }
|
|
9749
|
-
},
|
|
9750
|
-
{ timestamps: true }
|
|
9751
|
-
);
|
|
9752
|
-
var schema18 = new MongooseSchema26(
|
|
9753
|
-
{
|
|
9754
|
-
active: { default: true, required: true, type: Boolean },
|
|
9755
|
-
deletedAt: { default: null, required: false, type: Date },
|
|
9756
|
-
productCoupons: { required: false, type: [productCouponSchema] }
|
|
9757
|
-
},
|
|
9758
|
-
{ timestamps: true }
|
|
9759
|
-
);
|
|
9760
|
-
var CouponModel = import_mongoose26.default.models.Coupon || import_mongoose26.default.model("Coupon", schema18);
|
|
9847
|
+
var AffiliateModel = import_mongoose26.default.models.Affiliate || import_mongoose26.default.model("Affiliate", schema18);
|
|
9761
9848
|
|
|
9762
9849
|
// src/service/promoCode/constants.ts
|
|
9763
9850
|
var ACTIVE_NOT_DELETED_FILTER = {
|
|
@@ -9829,7 +9916,7 @@ var SHARE_RESOURCE_LABEL2 = {
|
|
|
9829
9916
|
school: "School"
|
|
9830
9917
|
};
|
|
9831
9918
|
|
|
9832
|
-
// node_modules/@timardex/cluemart-shared/dist/chunk-
|
|
9919
|
+
// node_modules/@timardex/cluemart-shared/dist/chunk-UV5GH6NI.mjs
|
|
9833
9920
|
var PROMO_CODE_PREFIX2 = "CM-";
|
|
9834
9921
|
var OBJECT_ID_PATH_SEGMENT2 = "[a-f0-9]{24}";
|
|
9835
9922
|
var OBJECT_ID_PATH_SEGMENT_END2 = `${OBJECT_ID_PATH_SEGMENT2}$`;
|
|
@@ -9931,7 +10018,7 @@ var gameScreenIdentifierList2 = [
|
|
|
9931
10018
|
}
|
|
9932
10019
|
];
|
|
9933
10020
|
|
|
9934
|
-
// node_modules/@timardex/cluemart-shared/dist/chunk-
|
|
10021
|
+
// node_modules/@timardex/cluemart-shared/dist/chunk-3UYXNSNB.mjs
|
|
9935
10022
|
var import_dayjs4 = __toESM(require("dayjs"), 1);
|
|
9936
10023
|
var statusOptions2 = [
|
|
9937
10024
|
...Object.values(EnumInviteStatus2).map((status) => ({
|