@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/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,19 @@ 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
|
|
5579
|
+
priceMax
|
|
5468
5580
|
priceUnit
|
|
5469
5581
|
productGroups
|
|
5470
5582
|
updatedAt
|
|
5471
5583
|
}
|
|
5584
|
+
${PRODUCT_COUPON_FIELDS_FRAGMENT}
|
|
5472
5585
|
`;
|
|
5473
5586
|
var VENDOR = gql`
|
|
5474
5587
|
fragment VendorFields on VendorType {
|
|
@@ -7770,79 +7883,6 @@ var ASSIGN_AFFILIATE_BONUS_REWARD_MUTATION = gql`
|
|
|
7770
7883
|
}
|
|
7771
7884
|
${AFFILIATE_FIELDS_FRAGMENT}
|
|
7772
7885
|
`;
|
|
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
7886
|
var CREATE_COUPON_MUTATION = gql`
|
|
7847
7887
|
mutation createCoupon($input: CouponInputType!) {
|
|
7848
7888
|
createCoupon(input: $input) {
|
|
@@ -8542,7 +8582,7 @@ var baseResourceFields = {
|
|
|
8542
8582
|
logo: { required: false, type: ResourceImageTypeSchema },
|
|
8543
8583
|
name: { required: true, type: String },
|
|
8544
8584
|
owner: {
|
|
8545
|
-
required:
|
|
8585
|
+
required: true,
|
|
8546
8586
|
type: OwnerTypeSchema
|
|
8547
8587
|
},
|
|
8548
8588
|
posterUsage: { required: false, type: PosterUsageTypeSchema },
|
|
@@ -8887,6 +8927,11 @@ var schema7 = new MongooseSchema11(
|
|
|
8887
8927
|
required: false,
|
|
8888
8928
|
type: ResourceImageTypeSchema
|
|
8889
8929
|
},
|
|
8930
|
+
coupon: {
|
|
8931
|
+
ref: "Coupon",
|
|
8932
|
+
required: false,
|
|
8933
|
+
type: import_mongoose11.default.Schema.Types.ObjectId
|
|
8934
|
+
},
|
|
8890
8935
|
deletedAt: { default: null, required: false, type: Date },
|
|
8891
8936
|
email: { required: true, type: String },
|
|
8892
8937
|
emailSentFor: {
|
|
@@ -9007,27 +9052,133 @@ var schema8 = new MongooseSchema12(
|
|
|
9007
9052
|
var VerificationTokenModel = import_mongoose12.default.models.VerificationToken || import_mongoose12.default.model("VerificationToken", schema8);
|
|
9008
9053
|
|
|
9009
9054
|
// src/mongoose/vendor/Vendor.ts
|
|
9055
|
+
var import_mongoose14 = __toESM(require("mongoose"));
|
|
9056
|
+
|
|
9057
|
+
// src/mongoose/Coupon.ts
|
|
9010
9058
|
var import_mongoose13 = __toESM(require("mongoose"));
|
|
9011
9059
|
var MongooseSchema13 = import_mongoose13.default.Schema;
|
|
9012
|
-
var
|
|
9060
|
+
var productCouponSchema = new MongooseSchema13(
|
|
9061
|
+
{
|
|
9062
|
+
couponDocumentId: {
|
|
9063
|
+
ref: "Coupon",
|
|
9064
|
+
required: true,
|
|
9065
|
+
type: import_mongoose13.default.Schema.Types.ObjectId
|
|
9066
|
+
},
|
|
9067
|
+
couponId: {
|
|
9068
|
+
required: true,
|
|
9069
|
+
type: import_mongoose13.default.Schema.Types.ObjectId
|
|
9070
|
+
}
|
|
9071
|
+
},
|
|
9072
|
+
{ _id: false }
|
|
9073
|
+
);
|
|
9074
|
+
var couponOptionSchema = new MongooseSchema13(
|
|
9075
|
+
{
|
|
9076
|
+
buy: { required: false, type: Number },
|
|
9077
|
+
get: { required: false, type: Number },
|
|
9078
|
+
type: {
|
|
9079
|
+
enum: Object.values(EnumCouponQualificationType),
|
|
9080
|
+
required: true,
|
|
9081
|
+
type: String
|
|
9082
|
+
},
|
|
9083
|
+
unit: { required: false, type: String },
|
|
9084
|
+
visits: { required: false, type: Number }
|
|
9085
|
+
},
|
|
9086
|
+
{ _id: false }
|
|
9087
|
+
);
|
|
9088
|
+
var couponRewardSchema = new MongooseSchema13(
|
|
9089
|
+
{
|
|
9090
|
+
productId: {
|
|
9091
|
+
required: true,
|
|
9092
|
+
type: import_mongoose13.default.Schema.Types.ObjectId
|
|
9093
|
+
},
|
|
9094
|
+
quantity: { required: true, type: Number },
|
|
9095
|
+
unit: { required: true, type: String },
|
|
9096
|
+
vendorId: {
|
|
9097
|
+
ref: "Vendor",
|
|
9098
|
+
required: true,
|
|
9099
|
+
type: import_mongoose13.default.Schema.Types.ObjectId
|
|
9100
|
+
}
|
|
9101
|
+
},
|
|
9102
|
+
{ _id: false }
|
|
9103
|
+
);
|
|
9104
|
+
var couponCodeSchema = new MongooseSchema13(
|
|
9013
9105
|
{
|
|
9106
|
+
code: { required: true, type: String },
|
|
9107
|
+
qrCode: { required: true, type: ResourceImageTypeSchema }
|
|
9108
|
+
},
|
|
9109
|
+
{ _id: false }
|
|
9110
|
+
);
|
|
9111
|
+
var couponParticipantUserSchema = new MongooseSchema13(
|
|
9112
|
+
{
|
|
9113
|
+
couponCollectedCount: { default: 0, required: true, type: Number },
|
|
9114
|
+
couponRedeemedAt: { default: null, required: false, type: Date },
|
|
9115
|
+
userId: {
|
|
9116
|
+
ref: "User",
|
|
9117
|
+
required: true,
|
|
9118
|
+
type: import_mongoose13.default.Schema.Types.ObjectId
|
|
9119
|
+
}
|
|
9120
|
+
},
|
|
9121
|
+
{ timestamps: true }
|
|
9122
|
+
);
|
|
9123
|
+
var couponDataSchema = new MongooseSchema13(
|
|
9124
|
+
{
|
|
9125
|
+
active: { default: true, required: true, type: Boolean },
|
|
9126
|
+
couponCode: { required: true, type: couponCodeSchema },
|
|
9127
|
+
couponDescription: { required: true, type: String },
|
|
9128
|
+
couponOption: { required: true, type: couponOptionSchema },
|
|
9129
|
+
couponRewards: { required: false, type: [couponRewardSchema] },
|
|
9130
|
+
endDate: { required: true, type: Date },
|
|
9131
|
+
participantUsers: {
|
|
9132
|
+
default: null,
|
|
9133
|
+
required: false,
|
|
9134
|
+
type: [couponParticipantUserSchema]
|
|
9135
|
+
},
|
|
9136
|
+
resourceId: { required: true, type: String },
|
|
9137
|
+
resourceType: {
|
|
9138
|
+
enum: Object.values(EnumResourceType),
|
|
9139
|
+
required: true,
|
|
9140
|
+
type: String
|
|
9141
|
+
},
|
|
9142
|
+
startDate: { required: true, type: Date }
|
|
9143
|
+
},
|
|
9144
|
+
{ timestamps: true }
|
|
9145
|
+
);
|
|
9146
|
+
var schema9 = new MongooseSchema13(
|
|
9147
|
+
{
|
|
9148
|
+
active: { default: true, required: true, type: Boolean },
|
|
9149
|
+
couponData: { default: [], required: false, type: [couponDataSchema] },
|
|
9150
|
+
deletedAt: { default: null, required: false, type: Date },
|
|
9151
|
+
owner: {
|
|
9152
|
+
required: true,
|
|
9153
|
+
type: OwnerTypeSchema
|
|
9154
|
+
}
|
|
9155
|
+
},
|
|
9156
|
+
{ timestamps: true }
|
|
9157
|
+
);
|
|
9158
|
+
var CouponModel = import_mongoose13.default.models.Coupon || import_mongoose13.default.model("Coupon", schema9);
|
|
9159
|
+
|
|
9160
|
+
// src/mongoose/vendor/Vendor.ts
|
|
9161
|
+
var MongooseSchema14 = import_mongoose14.default.Schema;
|
|
9162
|
+
var vendorProductTypeSchema = new MongooseSchema14(
|
|
9163
|
+
{
|
|
9164
|
+
coupon: { required: false, type: productCouponSchema },
|
|
9014
9165
|
description: { required: false, type: String },
|
|
9015
|
-
hasCoupon: { default: false, required: false, type: Boolean },
|
|
9016
9166
|
name: { required: true, type: String },
|
|
9017
9167
|
price: { required: true, type: Number },
|
|
9168
|
+
priceMax: { required: false, type: Number },
|
|
9018
9169
|
priceUnit: { required: true, type: String },
|
|
9019
9170
|
productGroups: { required: false, type: [String] }
|
|
9020
9171
|
},
|
|
9021
9172
|
{ timestamps: true }
|
|
9022
9173
|
);
|
|
9023
|
-
var productWrapperSchema = new
|
|
9174
|
+
var productWrapperSchema = new MongooseSchema14(
|
|
9024
9175
|
{
|
|
9025
9176
|
active: { default: false, required: true, type: Boolean },
|
|
9026
9177
|
productsList: { required: false, type: [vendorProductTypeSchema] }
|
|
9027
9178
|
},
|
|
9028
9179
|
{ _id: false }
|
|
9029
9180
|
);
|
|
9030
|
-
var calendarSchema = new
|
|
9181
|
+
var calendarSchema = new MongooseSchema14(
|
|
9031
9182
|
{
|
|
9032
9183
|
dateTime: {
|
|
9033
9184
|
dateStatus: {
|
|
@@ -9048,14 +9199,14 @@ var calendarSchema = new MongooseSchema13(
|
|
|
9048
9199
|
},
|
|
9049
9200
|
{ _id: false }
|
|
9050
9201
|
);
|
|
9051
|
-
var calendarWrapperSchema = new
|
|
9202
|
+
var calendarWrapperSchema = new MongooseSchema14(
|
|
9052
9203
|
{
|
|
9053
9204
|
active: { default: false, required: true, type: Boolean },
|
|
9054
9205
|
calendarData: { required: false, type: [calendarSchema] }
|
|
9055
9206
|
},
|
|
9056
9207
|
{ _id: false }
|
|
9057
9208
|
);
|
|
9058
|
-
var
|
|
9209
|
+
var schema10 = new MongooseSchema14(
|
|
9059
9210
|
{
|
|
9060
9211
|
...baseResourceFields,
|
|
9061
9212
|
// Importing base resource fields from global.ts
|
|
@@ -9081,12 +9232,12 @@ var schema9 = new MongooseSchema13(
|
|
|
9081
9232
|
unregisteredVendorId: {
|
|
9082
9233
|
ref: "UnregisteredVendor",
|
|
9083
9234
|
required: false,
|
|
9084
|
-
type:
|
|
9235
|
+
type: import_mongoose14.default.Schema.Types.ObjectId
|
|
9085
9236
|
},
|
|
9086
9237
|
vendorInfoId: {
|
|
9087
9238
|
ref: "VendorInfo",
|
|
9088
9239
|
required: false,
|
|
9089
|
-
type:
|
|
9240
|
+
type: import_mongoose14.default.Schema.Types.ObjectId
|
|
9090
9241
|
},
|
|
9091
9242
|
vendorType: {
|
|
9092
9243
|
enum: Object.values(EnumVendorType),
|
|
@@ -9096,24 +9247,24 @@ var schema9 = new MongooseSchema13(
|
|
|
9096
9247
|
},
|
|
9097
9248
|
{ timestamps: true }
|
|
9098
9249
|
);
|
|
9099
|
-
|
|
9100
|
-
|
|
9101
|
-
|
|
9102
|
-
|
|
9103
|
-
|
|
9104
|
-
var VendorModel =
|
|
9250
|
+
schema10.index({ name: 1 });
|
|
9251
|
+
schema10.index({ description: 1 });
|
|
9252
|
+
schema10.index({ region: 1 });
|
|
9253
|
+
schema10.index({ "categories.name": 1 });
|
|
9254
|
+
schema10.index({ slug: 1 });
|
|
9255
|
+
var VendorModel = import_mongoose14.default.models.Vendor || import_mongoose14.default.model("Vendor", schema10);
|
|
9105
9256
|
|
|
9106
9257
|
// src/mongoose/vendor/VendorInfo.ts
|
|
9107
|
-
var
|
|
9108
|
-
var
|
|
9109
|
-
var AttributesSchema = new
|
|
9258
|
+
var import_mongoose15 = __toESM(require("mongoose"));
|
|
9259
|
+
var MongooseSchema15 = import_mongoose15.default.Schema;
|
|
9260
|
+
var AttributesSchema = new MongooseSchema15(
|
|
9110
9261
|
{
|
|
9111
9262
|
details: { required: false, type: String },
|
|
9112
9263
|
isRequired: { default: false, required: true, type: Boolean }
|
|
9113
9264
|
},
|
|
9114
9265
|
{ _id: false }
|
|
9115
9266
|
);
|
|
9116
|
-
var
|
|
9267
|
+
var schema11 = new MongooseSchema15(
|
|
9117
9268
|
{
|
|
9118
9269
|
active: { default: true, type: Boolean },
|
|
9119
9270
|
compliance: {
|
|
@@ -9148,28 +9299,28 @@ var schema10 = new MongooseSchema14(
|
|
|
9148
9299
|
vendorId: {
|
|
9149
9300
|
ref: "Vendor",
|
|
9150
9301
|
required: true,
|
|
9151
|
-
type:
|
|
9302
|
+
type: import_mongoose15.default.Schema.Types.ObjectId
|
|
9152
9303
|
}
|
|
9153
9304
|
},
|
|
9154
9305
|
{ timestamps: true }
|
|
9155
9306
|
);
|
|
9156
|
-
var VendorInfoModel =
|
|
9307
|
+
var VendorInfoModel = import_mongoose15.default.models.VendorInfo || import_mongoose15.default.model("VendorInfo", schema11);
|
|
9157
9308
|
|
|
9158
9309
|
// src/mongoose/vendor/UnregisteredVendor.ts
|
|
9159
|
-
var
|
|
9160
|
-
var
|
|
9161
|
-
var invitationSchema = new
|
|
9310
|
+
var import_mongoose16 = __toESM(require("mongoose"));
|
|
9311
|
+
var MongooseSchema16 = import_mongoose16.default.Schema;
|
|
9312
|
+
var invitationSchema = new MongooseSchema16(
|
|
9162
9313
|
{
|
|
9163
9314
|
dateTime: { required: true, type: [dateTimeSchema2] },
|
|
9164
9315
|
inviterId: {
|
|
9165
9316
|
ref: "Event",
|
|
9166
9317
|
required: true,
|
|
9167
|
-
type:
|
|
9318
|
+
type: import_mongoose16.default.Schema.Types.ObjectId
|
|
9168
9319
|
}
|
|
9169
9320
|
},
|
|
9170
9321
|
{ _id: false }
|
|
9171
9322
|
);
|
|
9172
|
-
var
|
|
9323
|
+
var schema12 = new MongooseSchema16(
|
|
9173
9324
|
{
|
|
9174
9325
|
active: { default: true, required: true, type: Boolean },
|
|
9175
9326
|
categoryIds: { required: true, type: [String] },
|
|
@@ -9178,7 +9329,7 @@ var schema11 = new MongooseSchema15(
|
|
|
9178
9329
|
claimedByUserId: {
|
|
9179
9330
|
ref: "User",
|
|
9180
9331
|
required: false,
|
|
9181
|
-
type:
|
|
9332
|
+
type: import_mongoose16.default.Schema.Types.ObjectId
|
|
9182
9333
|
},
|
|
9183
9334
|
claimInitiatedAt: { default: null, required: false, type: Date },
|
|
9184
9335
|
claimToken: { default: null, required: false, type: String },
|
|
@@ -9191,14 +9342,14 @@ var schema11 = new MongooseSchema15(
|
|
|
9191
9342
|
},
|
|
9192
9343
|
{ timestamps: true }
|
|
9193
9344
|
);
|
|
9194
|
-
|
|
9195
|
-
|
|
9196
|
-
var UnregisteredVendorModel =
|
|
9345
|
+
schema12.index({ name: 1 });
|
|
9346
|
+
schema12.index({ email: 1 });
|
|
9347
|
+
var UnregisteredVendorModel = import_mongoose16.default.models.UnregisteredVendor || import_mongoose16.default.model("UnregisteredVendor", schema12);
|
|
9197
9348
|
|
|
9198
9349
|
// src/mongoose/event/Event.ts
|
|
9199
|
-
var
|
|
9200
|
-
var
|
|
9201
|
-
var
|
|
9350
|
+
var import_mongoose17 = __toESM(require("mongoose"));
|
|
9351
|
+
var MongooseSchema17 = import_mongoose17.default.Schema;
|
|
9352
|
+
var schema13 = new MongooseSchema17(
|
|
9202
9353
|
{
|
|
9203
9354
|
...baseResourceFields,
|
|
9204
9355
|
// Importing base resource fields from global.ts
|
|
@@ -9207,7 +9358,7 @@ var schema12 = new MongooseSchema16(
|
|
|
9207
9358
|
eventInfoId: {
|
|
9208
9359
|
ref: "EventInfo",
|
|
9209
9360
|
required: false,
|
|
9210
|
-
type:
|
|
9361
|
+
type: import_mongoose17.default.Schema.Types.ObjectId
|
|
9211
9362
|
},
|
|
9212
9363
|
eventType: {
|
|
9213
9364
|
enum: Object.values(EnumEventType),
|
|
@@ -9236,20 +9387,20 @@ var schema12 = new MongooseSchema16(
|
|
|
9236
9387
|
},
|
|
9237
9388
|
{ timestamps: true }
|
|
9238
9389
|
);
|
|
9239
|
-
|
|
9240
|
-
|
|
9241
|
-
|
|
9242
|
-
|
|
9243
|
-
|
|
9244
|
-
|
|
9245
|
-
|
|
9246
|
-
|
|
9247
|
-
var EventModel =
|
|
9390
|
+
schema13.index({ name: 1 });
|
|
9391
|
+
schema13.index({ description: 1 });
|
|
9392
|
+
schema13.index({ region: 1 });
|
|
9393
|
+
schema13.index({ "location.geo": "2dsphere" });
|
|
9394
|
+
schema13.index({ tags: 1 });
|
|
9395
|
+
schema13.index({ deletedAt: 1 });
|
|
9396
|
+
schema13.index({ "dateTime.dateStatus": 1 });
|
|
9397
|
+
schema13.index({ slug: 1 });
|
|
9398
|
+
var EventModel = import_mongoose17.default.models.Event || import_mongoose17.default.model("Event", schema13);
|
|
9248
9399
|
|
|
9249
9400
|
// src/mongoose/Partner.ts
|
|
9250
|
-
var
|
|
9251
|
-
var
|
|
9252
|
-
var
|
|
9401
|
+
var import_mongoose18 = __toESM(require("mongoose"));
|
|
9402
|
+
var MongooseSchema18 = import_mongoose18.default.Schema;
|
|
9403
|
+
var schema14 = new MongooseSchema18(
|
|
9253
9404
|
{
|
|
9254
9405
|
...baseResourceFields,
|
|
9255
9406
|
location: {
|
|
@@ -9265,19 +9416,19 @@ var schema13 = new MongooseSchema17(
|
|
|
9265
9416
|
},
|
|
9266
9417
|
{ timestamps: true }
|
|
9267
9418
|
);
|
|
9268
|
-
|
|
9269
|
-
|
|
9270
|
-
|
|
9271
|
-
|
|
9272
|
-
|
|
9273
|
-
var PartnerModel =
|
|
9419
|
+
schema14.index({ name: 1 });
|
|
9420
|
+
schema14.index({ description: 1 });
|
|
9421
|
+
schema14.index({ region: 1 });
|
|
9422
|
+
schema14.index({ "location.geo": "2dsphere" });
|
|
9423
|
+
schema14.index({ slug: 1 });
|
|
9424
|
+
var PartnerModel = import_mongoose18.default.models.Partner || import_mongoose18.default.model("Partner", schema14);
|
|
9274
9425
|
|
|
9275
9426
|
// src/mongoose/Post.ts
|
|
9276
|
-
var
|
|
9277
|
-
var
|
|
9278
|
-
var contentSchema = new
|
|
9427
|
+
var import_mongoose19 = __toESM(require("mongoose"));
|
|
9428
|
+
var MongooseSchema19 = import_mongoose19.default.Schema;
|
|
9429
|
+
var contentSchema = new MongooseSchema19(
|
|
9279
9430
|
{
|
|
9280
|
-
contentData:
|
|
9431
|
+
contentData: import_mongoose19.Schema.Types.Mixed,
|
|
9281
9432
|
contentOrder: { required: true, type: Number },
|
|
9282
9433
|
contentType: {
|
|
9283
9434
|
enum: Object.values(EnumPostContentType),
|
|
@@ -9287,7 +9438,7 @@ var contentSchema = new MongooseSchema18(
|
|
|
9287
9438
|
},
|
|
9288
9439
|
{ _id: false }
|
|
9289
9440
|
);
|
|
9290
|
-
var resourceSchema = new
|
|
9441
|
+
var resourceSchema = new MongooseSchema19(
|
|
9291
9442
|
{
|
|
9292
9443
|
resourceId: { required: true, type: String },
|
|
9293
9444
|
resourceRegion: { required: true, type: String },
|
|
@@ -9300,7 +9451,7 @@ var resourceSchema = new MongooseSchema18(
|
|
|
9300
9451
|
},
|
|
9301
9452
|
{ _id: false }
|
|
9302
9453
|
);
|
|
9303
|
-
var
|
|
9454
|
+
var schema15 = new MongooseSchema19(
|
|
9304
9455
|
{
|
|
9305
9456
|
active: { default: false, required: true, type: Boolean },
|
|
9306
9457
|
approvedAt: { default: null, required: false, type: Date },
|
|
@@ -9331,16 +9482,16 @@ var schema14 = new MongooseSchema18(
|
|
|
9331
9482
|
},
|
|
9332
9483
|
{ timestamps: true }
|
|
9333
9484
|
);
|
|
9334
|
-
|
|
9335
|
-
|
|
9336
|
-
|
|
9337
|
-
var PostModel =
|
|
9485
|
+
schema15.index({ title: 1 });
|
|
9486
|
+
schema15.index({ tags: 1 });
|
|
9487
|
+
schema15.index({ postType: 1, slug: 1 }, { unique: true });
|
|
9488
|
+
var PostModel = import_mongoose19.default.models.Post || import_mongoose19.default.model("Post", schema15);
|
|
9338
9489
|
|
|
9339
9490
|
// src/mongoose/AppSetting.ts
|
|
9340
|
-
var
|
|
9341
|
-
var
|
|
9491
|
+
var import_mongoose20 = __toESM(require("mongoose"));
|
|
9492
|
+
var MongooseSchema20 = import_mongoose20.default.Schema;
|
|
9342
9493
|
var APP_SETTINGS_ID = "APP_SETTINGS_DOCUMENT_ID";
|
|
9343
|
-
var AppSettingSchema = new
|
|
9494
|
+
var AppSettingSchema = new MongooseSchema20(
|
|
9344
9495
|
{
|
|
9345
9496
|
activeSchoolsStudentCountTotal: {
|
|
9346
9497
|
default: 0,
|
|
@@ -9371,18 +9522,18 @@ var AppSettingSchema = new MongooseSchema19(
|
|
|
9371
9522
|
},
|
|
9372
9523
|
{ timestamps: true }
|
|
9373
9524
|
);
|
|
9374
|
-
var AppSettingModel =
|
|
9525
|
+
var AppSettingModel = import_mongoose20.default.models.AppSetting || import_mongoose20.default.model("AppSetting", AppSettingSchema);
|
|
9375
9526
|
|
|
9376
9527
|
// src/mongoose/game/Game.ts
|
|
9377
|
-
var
|
|
9528
|
+
var import_mongoose24 = __toESM(require("mongoose"));
|
|
9378
9529
|
|
|
9379
9530
|
// src/mongoose/game/DailyClue.ts
|
|
9380
|
-
var
|
|
9531
|
+
var import_mongoose22 = __toESM(require("mongoose"));
|
|
9381
9532
|
|
|
9382
9533
|
// src/mongoose/game/utils.ts
|
|
9383
|
-
var
|
|
9384
|
-
var
|
|
9385
|
-
var schemaGameDate = new
|
|
9534
|
+
var import_mongoose21 = __toESM(require("mongoose"));
|
|
9535
|
+
var MongooseSchema21 = import_mongoose21.default.Schema;
|
|
9536
|
+
var schemaGameDate = new MongooseSchema21(
|
|
9386
9537
|
{
|
|
9387
9538
|
endDate: { required: true, type: Date },
|
|
9388
9539
|
startDate: { required: true, type: Date }
|
|
@@ -9391,8 +9542,8 @@ var schemaGameDate = new MongooseSchema20(
|
|
|
9391
9542
|
);
|
|
9392
9543
|
|
|
9393
9544
|
// src/mongoose/game/DailyClue.ts
|
|
9394
|
-
var
|
|
9395
|
-
var schemaLetters = new
|
|
9545
|
+
var MongooseSchema22 = import_mongoose22.default.Schema;
|
|
9546
|
+
var schemaLetters = new MongooseSchema22(
|
|
9396
9547
|
{
|
|
9397
9548
|
collected: { required: false, type: [String] },
|
|
9398
9549
|
solutionShuffled: { required: true, type: [String] }
|
|
@@ -9400,14 +9551,14 @@ var schemaLetters = new MongooseSchema21(
|
|
|
9400
9551
|
},
|
|
9401
9552
|
{ _id: false }
|
|
9402
9553
|
);
|
|
9403
|
-
var schemaDailyClueBaseGame = new
|
|
9554
|
+
var schemaDailyClueBaseGame = new MongooseSchema22(
|
|
9404
9555
|
{
|
|
9405
9556
|
gameDate: { required: true, type: schemaGameDate },
|
|
9406
9557
|
gameSolution: { required: true, type: String }
|
|
9407
9558
|
},
|
|
9408
9559
|
{ _id: false }
|
|
9409
9560
|
);
|
|
9410
|
-
var schemaDailyClueGameData = new
|
|
9561
|
+
var schemaDailyClueGameData = new MongooseSchema22(
|
|
9411
9562
|
{
|
|
9412
9563
|
gameFields: { required: true, type: schemaDailyClueBaseGame },
|
|
9413
9564
|
lastFoundDate: { default: null, required: false, type: Date },
|
|
@@ -9422,9 +9573,9 @@ var schemaDailyClueGameData = new MongooseSchema21(
|
|
|
9422
9573
|
);
|
|
9423
9574
|
|
|
9424
9575
|
// src/mongoose/game/PuzzleGame.ts
|
|
9425
|
-
var
|
|
9426
|
-
var
|
|
9427
|
-
var schemaPuzzleAnswer = new
|
|
9576
|
+
var import_mongoose23 = __toESM(require("mongoose"));
|
|
9577
|
+
var MongooseSchema23 = import_mongoose23.default.Schema;
|
|
9578
|
+
var schemaPuzzleAnswer = new MongooseSchema23(
|
|
9428
9579
|
{
|
|
9429
9580
|
answer: { required: true, type: String },
|
|
9430
9581
|
answerId: { required: true, type: String },
|
|
@@ -9432,7 +9583,7 @@ var schemaPuzzleAnswer = new MongooseSchema22(
|
|
|
9432
9583
|
},
|
|
9433
9584
|
{ _id: false }
|
|
9434
9585
|
);
|
|
9435
|
-
var schemaPuzzleQuestion = new
|
|
9586
|
+
var schemaPuzzleQuestion = new MongooseSchema23(
|
|
9436
9587
|
{
|
|
9437
9588
|
answers: { required: true, type: [schemaPuzzleAnswer] },
|
|
9438
9589
|
question: { required: true, type: String },
|
|
@@ -9440,20 +9591,20 @@ var schemaPuzzleQuestion = new MongooseSchema22(
|
|
|
9440
9591
|
},
|
|
9441
9592
|
{ _id: false }
|
|
9442
9593
|
);
|
|
9443
|
-
var schemaPuzzleBaseGame = new
|
|
9594
|
+
var schemaPuzzleBaseGame = new MongooseSchema23(
|
|
9444
9595
|
{
|
|
9445
9596
|
questions: { required: true, type: [schemaPuzzleQuestion] }
|
|
9446
9597
|
},
|
|
9447
9598
|
{ _id: false }
|
|
9448
9599
|
);
|
|
9449
|
-
var schemaPuzzleAnsweredQuestion = new
|
|
9600
|
+
var schemaPuzzleAnsweredQuestion = new MongooseSchema23(
|
|
9450
9601
|
{
|
|
9451
9602
|
questionId: { required: true, type: String },
|
|
9452
9603
|
selectedAnswerId: { required: true, type: String }
|
|
9453
9604
|
},
|
|
9454
9605
|
{ _id: false }
|
|
9455
9606
|
);
|
|
9456
|
-
var schemaPuzzleGameData = new
|
|
9607
|
+
var schemaPuzzleGameData = new MongooseSchema23(
|
|
9457
9608
|
{
|
|
9458
9609
|
answeredQuestions: {
|
|
9459
9610
|
default: null,
|
|
@@ -9468,7 +9619,7 @@ var schemaPuzzleGameData = new MongooseSchema22(
|
|
|
9468
9619
|
);
|
|
9469
9620
|
|
|
9470
9621
|
// src/mongoose/game/Game.ts
|
|
9471
|
-
var
|
|
9622
|
+
var MongooseSchema24 = import_mongoose24.default.Schema;
|
|
9472
9623
|
var gameDataSchemas = {
|
|
9473
9624
|
[EnumGameType.DAILY_CLUE]: schemaDailyClueGameData,
|
|
9474
9625
|
[EnumGameType.MINI_QUIZ]: schemaPuzzleGameData,
|
|
@@ -9480,7 +9631,7 @@ var gameDataDefinition = Object.fromEntries(
|
|
|
9480
9631
|
{ default: null, required: false, type: schema19 }
|
|
9481
9632
|
])
|
|
9482
9633
|
);
|
|
9483
|
-
var gameHistorySchema = new
|
|
9634
|
+
var gameHistorySchema = new MongooseSchema24(
|
|
9484
9635
|
{
|
|
9485
9636
|
createdAt: { required: true, type: Date },
|
|
9486
9637
|
gameDate: { required: true, type: schemaGameDate },
|
|
@@ -9500,7 +9651,7 @@ var gameHistorySchema = new MongooseSchema23(
|
|
|
9500
9651
|
},
|
|
9501
9652
|
{ _id: false }
|
|
9502
9653
|
);
|
|
9503
|
-
var gameTypeSchema = new
|
|
9654
|
+
var gameTypeSchema = new MongooseSchema24(
|
|
9504
9655
|
{
|
|
9505
9656
|
active: { default: true, required: true, type: Boolean },
|
|
9506
9657
|
gameData: gameDataDefinition,
|
|
@@ -9515,7 +9666,7 @@ var gameTypeSchema = new MongooseSchema23(
|
|
|
9515
9666
|
},
|
|
9516
9667
|
{ timestamps: true }
|
|
9517
9668
|
);
|
|
9518
|
-
var
|
|
9669
|
+
var schema16 = new MongooseSchema24(
|
|
9519
9670
|
{
|
|
9520
9671
|
active: { default: false, required: true, type: Boolean },
|
|
9521
9672
|
deletedAt: { default: null, required: false, type: Date },
|
|
@@ -9528,12 +9679,12 @@ var schema15 = new MongooseSchema23(
|
|
|
9528
9679
|
},
|
|
9529
9680
|
{ timestamps: true }
|
|
9530
9681
|
);
|
|
9531
|
-
var GameModel =
|
|
9682
|
+
var GameModel = import_mongoose24.default.models.Game || import_mongoose24.default.model("Game", schema16);
|
|
9532
9683
|
|
|
9533
9684
|
// src/mongoose/School.ts
|
|
9534
|
-
var
|
|
9535
|
-
var
|
|
9536
|
-
var campaignsSchema = new
|
|
9685
|
+
var import_mongoose25 = __toESM(require("mongoose"));
|
|
9686
|
+
var MongooseSchema25 = import_mongoose25.default.Schema;
|
|
9687
|
+
var campaignsSchema = new MongooseSchema25(
|
|
9537
9688
|
{
|
|
9538
9689
|
endDate: { required: true, type: Date },
|
|
9539
9690
|
name: { required: true, type: String },
|
|
@@ -9541,7 +9692,7 @@ var campaignsSchema = new MongooseSchema24(
|
|
|
9541
9692
|
},
|
|
9542
9693
|
{ _id: false }
|
|
9543
9694
|
);
|
|
9544
|
-
var
|
|
9695
|
+
var schema17 = new MongooseSchema25(
|
|
9545
9696
|
{
|
|
9546
9697
|
// New schools are active by default
|
|
9547
9698
|
active: { default: false, required: true, type: Boolean },
|
|
@@ -9568,19 +9719,19 @@ var schema16 = new MongooseSchema24(
|
|
|
9568
9719
|
},
|
|
9569
9720
|
{ timestamps: true }
|
|
9570
9721
|
);
|
|
9571
|
-
|
|
9722
|
+
schema17.index(
|
|
9572
9723
|
{ schoolCode: 1 },
|
|
9573
9724
|
{
|
|
9574
9725
|
partialFilterExpression: { active: true, deletedAt: null },
|
|
9575
9726
|
unique: true
|
|
9576
9727
|
}
|
|
9577
9728
|
);
|
|
9578
|
-
var SchoolModel =
|
|
9729
|
+
var SchoolModel = import_mongoose25.default.models.School || import_mongoose25.default.model("School", schema17);
|
|
9579
9730
|
|
|
9580
9731
|
// src/mongoose/Affiliate.ts
|
|
9581
|
-
var
|
|
9582
|
-
var
|
|
9583
|
-
var affiliateRewardSchema = new
|
|
9732
|
+
var import_mongoose26 = __toESM(require("mongoose"));
|
|
9733
|
+
var MongooseSchema26 = import_mongoose26.default.Schema;
|
|
9734
|
+
var affiliateRewardSchema = new MongooseSchema26(
|
|
9584
9735
|
{
|
|
9585
9736
|
createdAt: { required: true, type: Date },
|
|
9586
9737
|
redeemedAt: { default: null, required: false, type: Date },
|
|
@@ -9594,13 +9745,13 @@ var affiliateRewardSchema = new MongooseSchema25(
|
|
|
9594
9745
|
},
|
|
9595
9746
|
{ _id: false }
|
|
9596
9747
|
);
|
|
9597
|
-
var affiliateResourceSchema = new
|
|
9748
|
+
var affiliateResourceSchema = new MongooseSchema26(
|
|
9598
9749
|
{
|
|
9599
9750
|
resourceActive: { default: true, required: true, type: Boolean },
|
|
9600
9751
|
resourceDeletedAt: { default: null, required: false, type: Date },
|
|
9601
9752
|
resourceId: {
|
|
9602
9753
|
required: true,
|
|
9603
|
-
type:
|
|
9754
|
+
type: import_mongoose26.default.Schema.Types.ObjectId
|
|
9604
9755
|
},
|
|
9605
9756
|
resourceName: { required: true, type: String },
|
|
9606
9757
|
resourceOwner: {
|
|
@@ -9620,20 +9771,20 @@ var affiliateResourceSchema = new MongooseSchema25(
|
|
|
9620
9771
|
},
|
|
9621
9772
|
{ _id: false }
|
|
9622
9773
|
);
|
|
9623
|
-
var affiliateContactDetailsSchema = new
|
|
9774
|
+
var affiliateContactDetailsSchema = new MongooseSchema26(
|
|
9624
9775
|
{
|
|
9625
9776
|
mobilePhone: { required: true, type: String }
|
|
9626
9777
|
},
|
|
9627
9778
|
{ _id: false }
|
|
9628
9779
|
);
|
|
9629
|
-
var affiliateBankAccountDetailsSchema = new
|
|
9780
|
+
var affiliateBankAccountDetailsSchema = new MongooseSchema26(
|
|
9630
9781
|
{
|
|
9631
9782
|
accountHolderName: { required: true, type: String },
|
|
9632
9783
|
accountNumber: { required: true, type: String }
|
|
9633
9784
|
},
|
|
9634
9785
|
{ _id: false }
|
|
9635
9786
|
);
|
|
9636
|
-
var affiliateDetailsSchema = new
|
|
9787
|
+
var affiliateDetailsSchema = new MongooseSchema26(
|
|
9637
9788
|
{
|
|
9638
9789
|
bankAccountDetails: {
|
|
9639
9790
|
required: true,
|
|
@@ -9655,7 +9806,7 @@ var affiliateDetailsSchema = new MongooseSchema25(
|
|
|
9655
9806
|
},
|
|
9656
9807
|
{ _id: false }
|
|
9657
9808
|
);
|
|
9658
|
-
var redeemHistorySchema = new
|
|
9809
|
+
var redeemHistorySchema = new MongooseSchema26(
|
|
9659
9810
|
{
|
|
9660
9811
|
paidAt: { default: null, required: false, type: Date },
|
|
9661
9812
|
redeemedAt: { required: true, type: Date },
|
|
@@ -9663,7 +9814,7 @@ var redeemHistorySchema = new MongooseSchema25(
|
|
|
9663
9814
|
},
|
|
9664
9815
|
{ _id: false }
|
|
9665
9816
|
);
|
|
9666
|
-
var
|
|
9817
|
+
var schema18 = new MongooseSchema26(
|
|
9667
9818
|
{
|
|
9668
9819
|
active: { default: false, required: true, type: Boolean },
|
|
9669
9820
|
affiliateBonusRewards: {
|
|
@@ -9693,71 +9844,14 @@ var schema17 = new MongooseSchema25(
|
|
|
9693
9844
|
},
|
|
9694
9845
|
{ timestamps: true }
|
|
9695
9846
|
);
|
|
9696
|
-
|
|
9847
|
+
schema18.index(
|
|
9697
9848
|
{ affiliateCode: 1 },
|
|
9698
9849
|
{
|
|
9699
9850
|
partialFilterExpression: { active: true, deletedAt: null },
|
|
9700
9851
|
unique: true
|
|
9701
9852
|
}
|
|
9702
9853
|
);
|
|
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);
|
|
9854
|
+
var AffiliateModel = import_mongoose26.default.models.Affiliate || import_mongoose26.default.model("Affiliate", schema18);
|
|
9761
9855
|
|
|
9762
9856
|
// src/service/promoCode/constants.ts
|
|
9763
9857
|
var ACTIVE_NOT_DELETED_FILTER = {
|
|
@@ -9829,7 +9923,7 @@ var SHARE_RESOURCE_LABEL2 = {
|
|
|
9829
9923
|
school: "School"
|
|
9830
9924
|
};
|
|
9831
9925
|
|
|
9832
|
-
// node_modules/@timardex/cluemart-shared/dist/chunk-
|
|
9926
|
+
// node_modules/@timardex/cluemart-shared/dist/chunk-UV5GH6NI.mjs
|
|
9833
9927
|
var PROMO_CODE_PREFIX2 = "CM-";
|
|
9834
9928
|
var OBJECT_ID_PATH_SEGMENT2 = "[a-f0-9]{24}";
|
|
9835
9929
|
var OBJECT_ID_PATH_SEGMENT_END2 = `${OBJECT_ID_PATH_SEGMENT2}$`;
|
|
@@ -9931,7 +10025,7 @@ var gameScreenIdentifierList2 = [
|
|
|
9931
10025
|
}
|
|
9932
10026
|
];
|
|
9933
10027
|
|
|
9934
|
-
// node_modules/@timardex/cluemart-shared/dist/chunk-
|
|
10028
|
+
// node_modules/@timardex/cluemart-shared/dist/chunk-3UYXNSNB.mjs
|
|
9935
10029
|
var import_dayjs4 = __toESM(require("dayjs"), 1);
|
|
9936
10030
|
var statusOptions2 = [
|
|
9937
10031
|
...Object.values(EnumInviteStatus2).map((status) => ({
|