@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/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,6 +5569,9 @@ 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
5577
|
name
|
|
@@ -5468,6 +5580,7 @@ var VENDOR_PRODUCT_LIST_FIELDS_FRAGMENT = gql`
|
|
|
5468
5580
|
productGroups
|
|
5469
5581
|
updatedAt
|
|
5470
5582
|
}
|
|
5583
|
+
${PRODUCT_COUPON_FIELDS_FRAGMENT}
|
|
5471
5584
|
`;
|
|
5472
5585
|
var VENDOR = gql`
|
|
5473
5586
|
fragment VendorFields on VendorType {
|
|
@@ -7769,79 +7882,6 @@ var ASSIGN_AFFILIATE_BONUS_REWARD_MUTATION = gql`
|
|
|
7769
7882
|
}
|
|
7770
7883
|
${AFFILIATE_FIELDS_FRAGMENT}
|
|
7771
7884
|
`;
|
|
7772
|
-
var COUPON_CODE_FIELDS_FRAGMENT = gql`
|
|
7773
|
-
fragment CouponCodeFields on CouponCodeType {
|
|
7774
|
-
code
|
|
7775
|
-
qrCode {
|
|
7776
|
-
...ResourceImageFields
|
|
7777
|
-
}
|
|
7778
|
-
}
|
|
7779
|
-
${RESOURCE_IMAGE_FIELDS_FRAGMENT}
|
|
7780
|
-
`;
|
|
7781
|
-
var COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT = gql`
|
|
7782
|
-
fragment CouponParticipantUserFields on CouponParticipantUserType {
|
|
7783
|
-
couponCount
|
|
7784
|
-
couponRedeemedAt
|
|
7785
|
-
createdAt
|
|
7786
|
-
updatedAt
|
|
7787
|
-
userId
|
|
7788
|
-
}
|
|
7789
|
-
`;
|
|
7790
|
-
var PRODUCT_COUPON_FIELDS_FRAGMENT = gql`
|
|
7791
|
-
fragment ProductCouponFields on ProductCouponType {
|
|
7792
|
-
_id
|
|
7793
|
-
active
|
|
7794
|
-
couponCode {
|
|
7795
|
-
...CouponCodeFields
|
|
7796
|
-
}
|
|
7797
|
-
couponDescription
|
|
7798
|
-
couponOption
|
|
7799
|
-
createdAt
|
|
7800
|
-
endDate
|
|
7801
|
-
participantProduct {
|
|
7802
|
-
...VendorProductListFields
|
|
7803
|
-
}
|
|
7804
|
-
participantUsers {
|
|
7805
|
-
...CouponParticipantUserFields
|
|
7806
|
-
}
|
|
7807
|
-
startDate
|
|
7808
|
-
updatedAt
|
|
7809
|
-
}
|
|
7810
|
-
${COUPON_CODE_FIELDS_FRAGMENT}
|
|
7811
|
-
${COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT}
|
|
7812
|
-
${VENDOR_PRODUCT_LIST_FIELDS_FRAGMENT}
|
|
7813
|
-
`;
|
|
7814
|
-
var COUPON = gql`
|
|
7815
|
-
fragment CouponFields on CouponType {
|
|
7816
|
-
_id
|
|
7817
|
-
active
|
|
7818
|
-
productCoupons {
|
|
7819
|
-
...ProductCouponFields
|
|
7820
|
-
}
|
|
7821
|
-
createdAt
|
|
7822
|
-
deletedAt
|
|
7823
|
-
updatedAt
|
|
7824
|
-
}
|
|
7825
|
-
${PRODUCT_COUPON_FIELDS_FRAGMENT}
|
|
7826
|
-
${COUPON_CODE_FIELDS_FRAGMENT}
|
|
7827
|
-
${COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT}
|
|
7828
|
-
`;
|
|
7829
|
-
var GET_COUPONS = gql`
|
|
7830
|
-
query getCoupons {
|
|
7831
|
-
coupons {
|
|
7832
|
-
...CouponFields
|
|
7833
|
-
}
|
|
7834
|
-
}
|
|
7835
|
-
${COUPON}
|
|
7836
|
-
`;
|
|
7837
|
-
var GET_COUPON = gql`
|
|
7838
|
-
query getCoupon($_id: ID!) {
|
|
7839
|
-
coupon(_id: $_id) {
|
|
7840
|
-
...CouponFields
|
|
7841
|
-
}
|
|
7842
|
-
}
|
|
7843
|
-
${COUPON}
|
|
7844
|
-
`;
|
|
7845
7885
|
var CREATE_COUPON_MUTATION = gql`
|
|
7846
7886
|
mutation createCoupon($input: CouponInputType!) {
|
|
7847
7887
|
createCoupon(input: $input) {
|
|
@@ -8541,7 +8581,7 @@ var baseResourceFields = {
|
|
|
8541
8581
|
logo: { required: false, type: ResourceImageTypeSchema },
|
|
8542
8582
|
name: { required: true, type: String },
|
|
8543
8583
|
owner: {
|
|
8544
|
-
required:
|
|
8584
|
+
required: true,
|
|
8545
8585
|
type: OwnerTypeSchema
|
|
8546
8586
|
},
|
|
8547
8587
|
posterUsage: { required: false, type: PosterUsageTypeSchema },
|
|
@@ -9006,26 +9046,132 @@ var schema8 = new MongooseSchema12(
|
|
|
9006
9046
|
var VerificationTokenModel = import_mongoose12.default.models.VerificationToken || import_mongoose12.default.model("VerificationToken", schema8);
|
|
9007
9047
|
|
|
9008
9048
|
// src/mongoose/vendor/Vendor.ts
|
|
9049
|
+
var import_mongoose14 = __toESM(require("mongoose"));
|
|
9050
|
+
|
|
9051
|
+
// src/mongoose/Coupon.ts
|
|
9009
9052
|
var import_mongoose13 = __toESM(require("mongoose"));
|
|
9010
9053
|
var MongooseSchema13 = import_mongoose13.default.Schema;
|
|
9011
|
-
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(
|
|
9012
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(
|
|
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 },
|
|
9013
9159
|
description: { required: false, type: String },
|
|
9014
|
-
name: { required:
|
|
9015
|
-
price: { required:
|
|
9016
|
-
priceUnit: { required:
|
|
9160
|
+
name: { required: true, type: String },
|
|
9161
|
+
price: { required: true, type: Number },
|
|
9162
|
+
priceUnit: { required: true, type: String },
|
|
9017
9163
|
productGroups: { required: false, type: [String] }
|
|
9018
9164
|
},
|
|
9019
9165
|
{ timestamps: true }
|
|
9020
9166
|
);
|
|
9021
|
-
var productWrapperSchema = new
|
|
9167
|
+
var productWrapperSchema = new MongooseSchema14(
|
|
9022
9168
|
{
|
|
9023
|
-
active: { default: false, type: Boolean },
|
|
9169
|
+
active: { default: false, required: true, type: Boolean },
|
|
9024
9170
|
productsList: { required: false, type: [vendorProductTypeSchema] }
|
|
9025
9171
|
},
|
|
9026
9172
|
{ _id: false }
|
|
9027
9173
|
);
|
|
9028
|
-
var calendarSchema = new
|
|
9174
|
+
var calendarSchema = new MongooseSchema14(
|
|
9029
9175
|
{
|
|
9030
9176
|
dateTime: {
|
|
9031
9177
|
dateStatus: {
|
|
@@ -9046,14 +9192,14 @@ var calendarSchema = new MongooseSchema13(
|
|
|
9046
9192
|
},
|
|
9047
9193
|
{ _id: false }
|
|
9048
9194
|
);
|
|
9049
|
-
var calendarWrapperSchema = new
|
|
9195
|
+
var calendarWrapperSchema = new MongooseSchema14(
|
|
9050
9196
|
{
|
|
9051
|
-
active: { default: false, type: Boolean },
|
|
9197
|
+
active: { default: false, required: true, type: Boolean },
|
|
9052
9198
|
calendarData: { required: false, type: [calendarSchema] }
|
|
9053
9199
|
},
|
|
9054
9200
|
{ _id: false }
|
|
9055
9201
|
);
|
|
9056
|
-
var
|
|
9202
|
+
var schema10 = new MongooseSchema14(
|
|
9057
9203
|
{
|
|
9058
9204
|
...baseResourceFields,
|
|
9059
9205
|
// Importing base resource fields from global.ts
|
|
@@ -9079,12 +9225,12 @@ var schema9 = new MongooseSchema13(
|
|
|
9079
9225
|
unregisteredVendorId: {
|
|
9080
9226
|
ref: "UnregisteredVendor",
|
|
9081
9227
|
required: false,
|
|
9082
|
-
type:
|
|
9228
|
+
type: import_mongoose14.default.Schema.Types.ObjectId
|
|
9083
9229
|
},
|
|
9084
9230
|
vendorInfoId: {
|
|
9085
9231
|
ref: "VendorInfo",
|
|
9086
9232
|
required: false,
|
|
9087
|
-
type:
|
|
9233
|
+
type: import_mongoose14.default.Schema.Types.ObjectId
|
|
9088
9234
|
},
|
|
9089
9235
|
vendorType: {
|
|
9090
9236
|
enum: Object.values(EnumVendorType),
|
|
@@ -9094,24 +9240,24 @@ var schema9 = new MongooseSchema13(
|
|
|
9094
9240
|
},
|
|
9095
9241
|
{ timestamps: true }
|
|
9096
9242
|
);
|
|
9097
|
-
|
|
9098
|
-
|
|
9099
|
-
|
|
9100
|
-
|
|
9101
|
-
|
|
9102
|
-
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);
|
|
9103
9249
|
|
|
9104
9250
|
// src/mongoose/vendor/VendorInfo.ts
|
|
9105
|
-
var
|
|
9106
|
-
var
|
|
9107
|
-
var AttributesSchema = new
|
|
9251
|
+
var import_mongoose15 = __toESM(require("mongoose"));
|
|
9252
|
+
var MongooseSchema15 = import_mongoose15.default.Schema;
|
|
9253
|
+
var AttributesSchema = new MongooseSchema15(
|
|
9108
9254
|
{
|
|
9109
9255
|
details: { required: false, type: String },
|
|
9110
9256
|
isRequired: { default: false, required: true, type: Boolean }
|
|
9111
9257
|
},
|
|
9112
9258
|
{ _id: false }
|
|
9113
9259
|
);
|
|
9114
|
-
var
|
|
9260
|
+
var schema11 = new MongooseSchema15(
|
|
9115
9261
|
{
|
|
9116
9262
|
active: { default: true, type: Boolean },
|
|
9117
9263
|
compliance: {
|
|
@@ -9146,28 +9292,28 @@ var schema10 = new MongooseSchema14(
|
|
|
9146
9292
|
vendorId: {
|
|
9147
9293
|
ref: "Vendor",
|
|
9148
9294
|
required: true,
|
|
9149
|
-
type:
|
|
9295
|
+
type: import_mongoose15.default.Schema.Types.ObjectId
|
|
9150
9296
|
}
|
|
9151
9297
|
},
|
|
9152
9298
|
{ timestamps: true }
|
|
9153
9299
|
);
|
|
9154
|
-
var VendorInfoModel =
|
|
9300
|
+
var VendorInfoModel = import_mongoose15.default.models.VendorInfo || import_mongoose15.default.model("VendorInfo", schema11);
|
|
9155
9301
|
|
|
9156
9302
|
// src/mongoose/vendor/UnregisteredVendor.ts
|
|
9157
|
-
var
|
|
9158
|
-
var
|
|
9159
|
-
var invitationSchema = new
|
|
9303
|
+
var import_mongoose16 = __toESM(require("mongoose"));
|
|
9304
|
+
var MongooseSchema16 = import_mongoose16.default.Schema;
|
|
9305
|
+
var invitationSchema = new MongooseSchema16(
|
|
9160
9306
|
{
|
|
9161
9307
|
dateTime: { required: true, type: [dateTimeSchema2] },
|
|
9162
9308
|
inviterId: {
|
|
9163
9309
|
ref: "Event",
|
|
9164
9310
|
required: true,
|
|
9165
|
-
type:
|
|
9311
|
+
type: import_mongoose16.default.Schema.Types.ObjectId
|
|
9166
9312
|
}
|
|
9167
9313
|
},
|
|
9168
9314
|
{ _id: false }
|
|
9169
9315
|
);
|
|
9170
|
-
var
|
|
9316
|
+
var schema12 = new MongooseSchema16(
|
|
9171
9317
|
{
|
|
9172
9318
|
active: { default: true, required: true, type: Boolean },
|
|
9173
9319
|
categoryIds: { required: true, type: [String] },
|
|
@@ -9176,7 +9322,7 @@ var schema11 = new MongooseSchema15(
|
|
|
9176
9322
|
claimedByUserId: {
|
|
9177
9323
|
ref: "User",
|
|
9178
9324
|
required: false,
|
|
9179
|
-
type:
|
|
9325
|
+
type: import_mongoose16.default.Schema.Types.ObjectId
|
|
9180
9326
|
},
|
|
9181
9327
|
claimInitiatedAt: { default: null, required: false, type: Date },
|
|
9182
9328
|
claimToken: { default: null, required: false, type: String },
|
|
@@ -9189,14 +9335,14 @@ var schema11 = new MongooseSchema15(
|
|
|
9189
9335
|
},
|
|
9190
9336
|
{ timestamps: true }
|
|
9191
9337
|
);
|
|
9192
|
-
|
|
9193
|
-
|
|
9194
|
-
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);
|
|
9195
9341
|
|
|
9196
9342
|
// src/mongoose/event/Event.ts
|
|
9197
|
-
var
|
|
9198
|
-
var
|
|
9199
|
-
var
|
|
9343
|
+
var import_mongoose17 = __toESM(require("mongoose"));
|
|
9344
|
+
var MongooseSchema17 = import_mongoose17.default.Schema;
|
|
9345
|
+
var schema13 = new MongooseSchema17(
|
|
9200
9346
|
{
|
|
9201
9347
|
...baseResourceFields,
|
|
9202
9348
|
// Importing base resource fields from global.ts
|
|
@@ -9205,7 +9351,7 @@ var schema12 = new MongooseSchema16(
|
|
|
9205
9351
|
eventInfoId: {
|
|
9206
9352
|
ref: "EventInfo",
|
|
9207
9353
|
required: false,
|
|
9208
|
-
type:
|
|
9354
|
+
type: import_mongoose17.default.Schema.Types.ObjectId
|
|
9209
9355
|
},
|
|
9210
9356
|
eventType: {
|
|
9211
9357
|
enum: Object.values(EnumEventType),
|
|
@@ -9234,20 +9380,20 @@ var schema12 = new MongooseSchema16(
|
|
|
9234
9380
|
},
|
|
9235
9381
|
{ timestamps: true }
|
|
9236
9382
|
);
|
|
9237
|
-
|
|
9238
|
-
|
|
9239
|
-
|
|
9240
|
-
|
|
9241
|
-
|
|
9242
|
-
|
|
9243
|
-
|
|
9244
|
-
|
|
9245
|
-
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);
|
|
9246
9392
|
|
|
9247
9393
|
// src/mongoose/Partner.ts
|
|
9248
|
-
var
|
|
9249
|
-
var
|
|
9250
|
-
var
|
|
9394
|
+
var import_mongoose18 = __toESM(require("mongoose"));
|
|
9395
|
+
var MongooseSchema18 = import_mongoose18.default.Schema;
|
|
9396
|
+
var schema14 = new MongooseSchema18(
|
|
9251
9397
|
{
|
|
9252
9398
|
...baseResourceFields,
|
|
9253
9399
|
location: {
|
|
@@ -9263,19 +9409,19 @@ var schema13 = new MongooseSchema17(
|
|
|
9263
9409
|
},
|
|
9264
9410
|
{ timestamps: true }
|
|
9265
9411
|
);
|
|
9266
|
-
|
|
9267
|
-
|
|
9268
|
-
|
|
9269
|
-
|
|
9270
|
-
|
|
9271
|
-
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);
|
|
9272
9418
|
|
|
9273
9419
|
// src/mongoose/Post.ts
|
|
9274
|
-
var
|
|
9275
|
-
var
|
|
9276
|
-
var contentSchema = new
|
|
9420
|
+
var import_mongoose19 = __toESM(require("mongoose"));
|
|
9421
|
+
var MongooseSchema19 = import_mongoose19.default.Schema;
|
|
9422
|
+
var contentSchema = new MongooseSchema19(
|
|
9277
9423
|
{
|
|
9278
|
-
contentData:
|
|
9424
|
+
contentData: import_mongoose19.Schema.Types.Mixed,
|
|
9279
9425
|
contentOrder: { required: true, type: Number },
|
|
9280
9426
|
contentType: {
|
|
9281
9427
|
enum: Object.values(EnumPostContentType),
|
|
@@ -9285,7 +9431,7 @@ var contentSchema = new MongooseSchema18(
|
|
|
9285
9431
|
},
|
|
9286
9432
|
{ _id: false }
|
|
9287
9433
|
);
|
|
9288
|
-
var resourceSchema = new
|
|
9434
|
+
var resourceSchema = new MongooseSchema19(
|
|
9289
9435
|
{
|
|
9290
9436
|
resourceId: { required: true, type: String },
|
|
9291
9437
|
resourceRegion: { required: true, type: String },
|
|
@@ -9298,7 +9444,7 @@ var resourceSchema = new MongooseSchema18(
|
|
|
9298
9444
|
},
|
|
9299
9445
|
{ _id: false }
|
|
9300
9446
|
);
|
|
9301
|
-
var
|
|
9447
|
+
var schema15 = new MongooseSchema19(
|
|
9302
9448
|
{
|
|
9303
9449
|
active: { default: false, required: true, type: Boolean },
|
|
9304
9450
|
approvedAt: { default: null, required: false, type: Date },
|
|
@@ -9329,16 +9475,16 @@ var schema14 = new MongooseSchema18(
|
|
|
9329
9475
|
},
|
|
9330
9476
|
{ timestamps: true }
|
|
9331
9477
|
);
|
|
9332
|
-
|
|
9333
|
-
|
|
9334
|
-
|
|
9335
|
-
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);
|
|
9336
9482
|
|
|
9337
9483
|
// src/mongoose/AppSetting.ts
|
|
9338
|
-
var
|
|
9339
|
-
var
|
|
9484
|
+
var import_mongoose20 = __toESM(require("mongoose"));
|
|
9485
|
+
var MongooseSchema20 = import_mongoose20.default.Schema;
|
|
9340
9486
|
var APP_SETTINGS_ID = "APP_SETTINGS_DOCUMENT_ID";
|
|
9341
|
-
var AppSettingSchema = new
|
|
9487
|
+
var AppSettingSchema = new MongooseSchema20(
|
|
9342
9488
|
{
|
|
9343
9489
|
activeSchoolsStudentCountTotal: {
|
|
9344
9490
|
default: 0,
|
|
@@ -9369,18 +9515,18 @@ var AppSettingSchema = new MongooseSchema19(
|
|
|
9369
9515
|
},
|
|
9370
9516
|
{ timestamps: true }
|
|
9371
9517
|
);
|
|
9372
|
-
var AppSettingModel =
|
|
9518
|
+
var AppSettingModel = import_mongoose20.default.models.AppSetting || import_mongoose20.default.model("AppSetting", AppSettingSchema);
|
|
9373
9519
|
|
|
9374
9520
|
// src/mongoose/game/Game.ts
|
|
9375
|
-
var
|
|
9521
|
+
var import_mongoose24 = __toESM(require("mongoose"));
|
|
9376
9522
|
|
|
9377
9523
|
// src/mongoose/game/DailyClue.ts
|
|
9378
|
-
var
|
|
9524
|
+
var import_mongoose22 = __toESM(require("mongoose"));
|
|
9379
9525
|
|
|
9380
9526
|
// src/mongoose/game/utils.ts
|
|
9381
|
-
var
|
|
9382
|
-
var
|
|
9383
|
-
var schemaGameDate = new
|
|
9527
|
+
var import_mongoose21 = __toESM(require("mongoose"));
|
|
9528
|
+
var MongooseSchema21 = import_mongoose21.default.Schema;
|
|
9529
|
+
var schemaGameDate = new MongooseSchema21(
|
|
9384
9530
|
{
|
|
9385
9531
|
endDate: { required: true, type: Date },
|
|
9386
9532
|
startDate: { required: true, type: Date }
|
|
@@ -9389,8 +9535,8 @@ var schemaGameDate = new MongooseSchema20(
|
|
|
9389
9535
|
);
|
|
9390
9536
|
|
|
9391
9537
|
// src/mongoose/game/DailyClue.ts
|
|
9392
|
-
var
|
|
9393
|
-
var schemaLetters = new
|
|
9538
|
+
var MongooseSchema22 = import_mongoose22.default.Schema;
|
|
9539
|
+
var schemaLetters = new MongooseSchema22(
|
|
9394
9540
|
{
|
|
9395
9541
|
collected: { required: false, type: [String] },
|
|
9396
9542
|
solutionShuffled: { required: true, type: [String] }
|
|
@@ -9398,14 +9544,14 @@ var schemaLetters = new MongooseSchema21(
|
|
|
9398
9544
|
},
|
|
9399
9545
|
{ _id: false }
|
|
9400
9546
|
);
|
|
9401
|
-
var schemaDailyClueBaseGame = new
|
|
9547
|
+
var schemaDailyClueBaseGame = new MongooseSchema22(
|
|
9402
9548
|
{
|
|
9403
9549
|
gameDate: { required: true, type: schemaGameDate },
|
|
9404
9550
|
gameSolution: { required: true, type: String }
|
|
9405
9551
|
},
|
|
9406
9552
|
{ _id: false }
|
|
9407
9553
|
);
|
|
9408
|
-
var schemaDailyClueGameData = new
|
|
9554
|
+
var schemaDailyClueGameData = new MongooseSchema22(
|
|
9409
9555
|
{
|
|
9410
9556
|
gameFields: { required: true, type: schemaDailyClueBaseGame },
|
|
9411
9557
|
lastFoundDate: { default: null, required: false, type: Date },
|
|
@@ -9420,9 +9566,9 @@ var schemaDailyClueGameData = new MongooseSchema21(
|
|
|
9420
9566
|
);
|
|
9421
9567
|
|
|
9422
9568
|
// src/mongoose/game/PuzzleGame.ts
|
|
9423
|
-
var
|
|
9424
|
-
var
|
|
9425
|
-
var schemaPuzzleAnswer = new
|
|
9569
|
+
var import_mongoose23 = __toESM(require("mongoose"));
|
|
9570
|
+
var MongooseSchema23 = import_mongoose23.default.Schema;
|
|
9571
|
+
var schemaPuzzleAnswer = new MongooseSchema23(
|
|
9426
9572
|
{
|
|
9427
9573
|
answer: { required: true, type: String },
|
|
9428
9574
|
answerId: { required: true, type: String },
|
|
@@ -9430,7 +9576,7 @@ var schemaPuzzleAnswer = new MongooseSchema22(
|
|
|
9430
9576
|
},
|
|
9431
9577
|
{ _id: false }
|
|
9432
9578
|
);
|
|
9433
|
-
var schemaPuzzleQuestion = new
|
|
9579
|
+
var schemaPuzzleQuestion = new MongooseSchema23(
|
|
9434
9580
|
{
|
|
9435
9581
|
answers: { required: true, type: [schemaPuzzleAnswer] },
|
|
9436
9582
|
question: { required: true, type: String },
|
|
@@ -9438,20 +9584,20 @@ var schemaPuzzleQuestion = new MongooseSchema22(
|
|
|
9438
9584
|
},
|
|
9439
9585
|
{ _id: false }
|
|
9440
9586
|
);
|
|
9441
|
-
var schemaPuzzleBaseGame = new
|
|
9587
|
+
var schemaPuzzleBaseGame = new MongooseSchema23(
|
|
9442
9588
|
{
|
|
9443
9589
|
questions: { required: true, type: [schemaPuzzleQuestion] }
|
|
9444
9590
|
},
|
|
9445
9591
|
{ _id: false }
|
|
9446
9592
|
);
|
|
9447
|
-
var schemaPuzzleAnsweredQuestion = new
|
|
9593
|
+
var schemaPuzzleAnsweredQuestion = new MongooseSchema23(
|
|
9448
9594
|
{
|
|
9449
9595
|
questionId: { required: true, type: String },
|
|
9450
9596
|
selectedAnswerId: { required: true, type: String }
|
|
9451
9597
|
},
|
|
9452
9598
|
{ _id: false }
|
|
9453
9599
|
);
|
|
9454
|
-
var schemaPuzzleGameData = new
|
|
9600
|
+
var schemaPuzzleGameData = new MongooseSchema23(
|
|
9455
9601
|
{
|
|
9456
9602
|
answeredQuestions: {
|
|
9457
9603
|
default: null,
|
|
@@ -9466,7 +9612,7 @@ var schemaPuzzleGameData = new MongooseSchema22(
|
|
|
9466
9612
|
);
|
|
9467
9613
|
|
|
9468
9614
|
// src/mongoose/game/Game.ts
|
|
9469
|
-
var
|
|
9615
|
+
var MongooseSchema24 = import_mongoose24.default.Schema;
|
|
9470
9616
|
var gameDataSchemas = {
|
|
9471
9617
|
[EnumGameType.DAILY_CLUE]: schemaDailyClueGameData,
|
|
9472
9618
|
[EnumGameType.MINI_QUIZ]: schemaPuzzleGameData,
|
|
@@ -9478,7 +9624,7 @@ var gameDataDefinition = Object.fromEntries(
|
|
|
9478
9624
|
{ default: null, required: false, type: schema19 }
|
|
9479
9625
|
])
|
|
9480
9626
|
);
|
|
9481
|
-
var gameHistorySchema = new
|
|
9627
|
+
var gameHistorySchema = new MongooseSchema24(
|
|
9482
9628
|
{
|
|
9483
9629
|
createdAt: { required: true, type: Date },
|
|
9484
9630
|
gameDate: { required: true, type: schemaGameDate },
|
|
@@ -9498,7 +9644,7 @@ var gameHistorySchema = new MongooseSchema23(
|
|
|
9498
9644
|
},
|
|
9499
9645
|
{ _id: false }
|
|
9500
9646
|
);
|
|
9501
|
-
var gameTypeSchema = new
|
|
9647
|
+
var gameTypeSchema = new MongooseSchema24(
|
|
9502
9648
|
{
|
|
9503
9649
|
active: { default: true, required: true, type: Boolean },
|
|
9504
9650
|
gameData: gameDataDefinition,
|
|
@@ -9513,7 +9659,7 @@ var gameTypeSchema = new MongooseSchema23(
|
|
|
9513
9659
|
},
|
|
9514
9660
|
{ timestamps: true }
|
|
9515
9661
|
);
|
|
9516
|
-
var
|
|
9662
|
+
var schema16 = new MongooseSchema24(
|
|
9517
9663
|
{
|
|
9518
9664
|
active: { default: false, required: true, type: Boolean },
|
|
9519
9665
|
deletedAt: { default: null, required: false, type: Date },
|
|
@@ -9526,12 +9672,12 @@ var schema15 = new MongooseSchema23(
|
|
|
9526
9672
|
},
|
|
9527
9673
|
{ timestamps: true }
|
|
9528
9674
|
);
|
|
9529
|
-
var GameModel =
|
|
9675
|
+
var GameModel = import_mongoose24.default.models.Game || import_mongoose24.default.model("Game", schema16);
|
|
9530
9676
|
|
|
9531
9677
|
// src/mongoose/School.ts
|
|
9532
|
-
var
|
|
9533
|
-
var
|
|
9534
|
-
var campaignsSchema = new
|
|
9678
|
+
var import_mongoose25 = __toESM(require("mongoose"));
|
|
9679
|
+
var MongooseSchema25 = import_mongoose25.default.Schema;
|
|
9680
|
+
var campaignsSchema = new MongooseSchema25(
|
|
9535
9681
|
{
|
|
9536
9682
|
endDate: { required: true, type: Date },
|
|
9537
9683
|
name: { required: true, type: String },
|
|
@@ -9539,7 +9685,7 @@ var campaignsSchema = new MongooseSchema24(
|
|
|
9539
9685
|
},
|
|
9540
9686
|
{ _id: false }
|
|
9541
9687
|
);
|
|
9542
|
-
var
|
|
9688
|
+
var schema17 = new MongooseSchema25(
|
|
9543
9689
|
{
|
|
9544
9690
|
// New schools are active by default
|
|
9545
9691
|
active: { default: false, required: true, type: Boolean },
|
|
@@ -9566,19 +9712,19 @@ var schema16 = new MongooseSchema24(
|
|
|
9566
9712
|
},
|
|
9567
9713
|
{ timestamps: true }
|
|
9568
9714
|
);
|
|
9569
|
-
|
|
9715
|
+
schema17.index(
|
|
9570
9716
|
{ schoolCode: 1 },
|
|
9571
9717
|
{
|
|
9572
9718
|
partialFilterExpression: { active: true, deletedAt: null },
|
|
9573
9719
|
unique: true
|
|
9574
9720
|
}
|
|
9575
9721
|
);
|
|
9576
|
-
var SchoolModel =
|
|
9722
|
+
var SchoolModel = import_mongoose25.default.models.School || import_mongoose25.default.model("School", schema17);
|
|
9577
9723
|
|
|
9578
9724
|
// src/mongoose/Affiliate.ts
|
|
9579
|
-
var
|
|
9580
|
-
var
|
|
9581
|
-
var affiliateRewardSchema = new
|
|
9725
|
+
var import_mongoose26 = __toESM(require("mongoose"));
|
|
9726
|
+
var MongooseSchema26 = import_mongoose26.default.Schema;
|
|
9727
|
+
var affiliateRewardSchema = new MongooseSchema26(
|
|
9582
9728
|
{
|
|
9583
9729
|
createdAt: { required: true, type: Date },
|
|
9584
9730
|
redeemedAt: { default: null, required: false, type: Date },
|
|
@@ -9592,13 +9738,13 @@ var affiliateRewardSchema = new MongooseSchema25(
|
|
|
9592
9738
|
},
|
|
9593
9739
|
{ _id: false }
|
|
9594
9740
|
);
|
|
9595
|
-
var affiliateResourceSchema = new
|
|
9741
|
+
var affiliateResourceSchema = new MongooseSchema26(
|
|
9596
9742
|
{
|
|
9597
9743
|
resourceActive: { default: true, required: true, type: Boolean },
|
|
9598
9744
|
resourceDeletedAt: { default: null, required: false, type: Date },
|
|
9599
9745
|
resourceId: {
|
|
9600
9746
|
required: true,
|
|
9601
|
-
type:
|
|
9747
|
+
type: import_mongoose26.default.Schema.Types.ObjectId
|
|
9602
9748
|
},
|
|
9603
9749
|
resourceName: { required: true, type: String },
|
|
9604
9750
|
resourceOwner: {
|
|
@@ -9618,20 +9764,20 @@ var affiliateResourceSchema = new MongooseSchema25(
|
|
|
9618
9764
|
},
|
|
9619
9765
|
{ _id: false }
|
|
9620
9766
|
);
|
|
9621
|
-
var affiliateContactDetailsSchema = new
|
|
9767
|
+
var affiliateContactDetailsSchema = new MongooseSchema26(
|
|
9622
9768
|
{
|
|
9623
9769
|
mobilePhone: { required: true, type: String }
|
|
9624
9770
|
},
|
|
9625
9771
|
{ _id: false }
|
|
9626
9772
|
);
|
|
9627
|
-
var affiliateBankAccountDetailsSchema = new
|
|
9773
|
+
var affiliateBankAccountDetailsSchema = new MongooseSchema26(
|
|
9628
9774
|
{
|
|
9629
9775
|
accountHolderName: { required: true, type: String },
|
|
9630
9776
|
accountNumber: { required: true, type: String }
|
|
9631
9777
|
},
|
|
9632
9778
|
{ _id: false }
|
|
9633
9779
|
);
|
|
9634
|
-
var affiliateDetailsSchema = new
|
|
9780
|
+
var affiliateDetailsSchema = new MongooseSchema26(
|
|
9635
9781
|
{
|
|
9636
9782
|
bankAccountDetails: {
|
|
9637
9783
|
required: true,
|
|
@@ -9653,7 +9799,7 @@ var affiliateDetailsSchema = new MongooseSchema25(
|
|
|
9653
9799
|
},
|
|
9654
9800
|
{ _id: false }
|
|
9655
9801
|
);
|
|
9656
|
-
var redeemHistorySchema = new
|
|
9802
|
+
var redeemHistorySchema = new MongooseSchema26(
|
|
9657
9803
|
{
|
|
9658
9804
|
paidAt: { default: null, required: false, type: Date },
|
|
9659
9805
|
redeemedAt: { required: true, type: Date },
|
|
@@ -9661,7 +9807,7 @@ var redeemHistorySchema = new MongooseSchema25(
|
|
|
9661
9807
|
},
|
|
9662
9808
|
{ _id: false }
|
|
9663
9809
|
);
|
|
9664
|
-
var
|
|
9810
|
+
var schema18 = new MongooseSchema26(
|
|
9665
9811
|
{
|
|
9666
9812
|
active: { default: false, required: true, type: Boolean },
|
|
9667
9813
|
affiliateBonusRewards: {
|
|
@@ -9691,71 +9837,14 @@ var schema17 = new MongooseSchema25(
|
|
|
9691
9837
|
},
|
|
9692
9838
|
{ timestamps: true }
|
|
9693
9839
|
);
|
|
9694
|
-
|
|
9840
|
+
schema18.index(
|
|
9695
9841
|
{ affiliateCode: 1 },
|
|
9696
9842
|
{
|
|
9697
9843
|
partialFilterExpression: { active: true, deletedAt: null },
|
|
9698
9844
|
unique: true
|
|
9699
9845
|
}
|
|
9700
9846
|
);
|
|
9701
|
-
var AffiliateModel =
|
|
9702
|
-
|
|
9703
|
-
// src/mongoose/Coupon.ts
|
|
9704
|
-
var import_mongoose26 = __toESM(require("mongoose"));
|
|
9705
|
-
var MongooseSchema26 = import_mongoose26.default.Schema;
|
|
9706
|
-
var couponOptionSchema = new MongooseSchema26(
|
|
9707
|
-
{
|
|
9708
|
-
buy: { required: true, type: Number },
|
|
9709
|
-
get: { required: true, type: Number },
|
|
9710
|
-
unit: { required: true, type: String }
|
|
9711
|
-
},
|
|
9712
|
-
{ _id: false }
|
|
9713
|
-
);
|
|
9714
|
-
var couponCodeSchema = new MongooseSchema26(
|
|
9715
|
-
{
|
|
9716
|
-
code: { required: true, type: String },
|
|
9717
|
-
qrCode: { required: true, type: ResourceImageTypeSchema }
|
|
9718
|
-
},
|
|
9719
|
-
{ _id: false }
|
|
9720
|
-
);
|
|
9721
|
-
var couponParticipantUserSchema = new MongooseSchema26(
|
|
9722
|
-
{
|
|
9723
|
-
couponCount: { default: 0, required: true, type: Number },
|
|
9724
|
-
couponRedeemedAt: { default: null, required: false, type: Date },
|
|
9725
|
-
userId: {
|
|
9726
|
-
ref: "User",
|
|
9727
|
-
required: true,
|
|
9728
|
-
type: import_mongoose26.default.Schema.Types.ObjectId
|
|
9729
|
-
}
|
|
9730
|
-
},
|
|
9731
|
-
{ timestamps: true }
|
|
9732
|
-
);
|
|
9733
|
-
var productCouponSchema = new MongooseSchema26(
|
|
9734
|
-
{
|
|
9735
|
-
active: { default: true, required: true, type: Boolean },
|
|
9736
|
-
couponCode: { required: true, type: couponCodeSchema },
|
|
9737
|
-
couponDescription: { required: true, type: String },
|
|
9738
|
-
couponOption: { required: true, type: couponOptionSchema },
|
|
9739
|
-
endDate: { required: true, type: Date },
|
|
9740
|
-
participantProduct: { required: true, type: vendorProductTypeSchema },
|
|
9741
|
-
participantUsers: {
|
|
9742
|
-
default: null,
|
|
9743
|
-
required: false,
|
|
9744
|
-
type: [couponParticipantUserSchema]
|
|
9745
|
-
},
|
|
9746
|
-
startDate: { required: true, type: Date }
|
|
9747
|
-
},
|
|
9748
|
-
{ timestamps: true }
|
|
9749
|
-
);
|
|
9750
|
-
var schema18 = new MongooseSchema26(
|
|
9751
|
-
{
|
|
9752
|
-
active: { default: true, required: true, type: Boolean },
|
|
9753
|
-
deletedAt: { default: null, required: false, type: Date },
|
|
9754
|
-
productCoupons: { required: false, type: [productCouponSchema] }
|
|
9755
|
-
},
|
|
9756
|
-
{ timestamps: true }
|
|
9757
|
-
);
|
|
9758
|
-
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);
|
|
9759
9848
|
|
|
9760
9849
|
// src/service/promoCode/constants.ts
|
|
9761
9850
|
var ACTIVE_NOT_DELETED_FILTER = {
|
|
@@ -9827,7 +9916,7 @@ var SHARE_RESOURCE_LABEL2 = {
|
|
|
9827
9916
|
school: "School"
|
|
9828
9917
|
};
|
|
9829
9918
|
|
|
9830
|
-
// node_modules/@timardex/cluemart-shared/dist/chunk-
|
|
9919
|
+
// node_modules/@timardex/cluemart-shared/dist/chunk-UV5GH6NI.mjs
|
|
9831
9920
|
var PROMO_CODE_PREFIX2 = "CM-";
|
|
9832
9921
|
var OBJECT_ID_PATH_SEGMENT2 = "[a-f0-9]{24}";
|
|
9833
9922
|
var OBJECT_ID_PATH_SEGMENT_END2 = `${OBJECT_ID_PATH_SEGMENT2}$`;
|
|
@@ -9929,7 +10018,7 @@ var gameScreenIdentifierList2 = [
|
|
|
9929
10018
|
}
|
|
9930
10019
|
];
|
|
9931
10020
|
|
|
9932
|
-
// node_modules/@timardex/cluemart-shared/dist/chunk-
|
|
10021
|
+
// node_modules/@timardex/cluemart-shared/dist/chunk-3UYXNSNB.mjs
|
|
9933
10022
|
var import_dayjs4 = __toESM(require("dayjs"), 1);
|
|
9934
10023
|
var statusOptions2 = [
|
|
9935
10024
|
...Object.values(EnumInviteStatus2).map((status) => ({
|