@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/mongoose/index.cjs
CHANGED
|
@@ -64,6 +64,7 @@ __export(mongoose_exports, {
|
|
|
64
64
|
dateTimeSchema: () => dateTimeSchema2,
|
|
65
65
|
locationGeoSchema: () => locationGeoSchema,
|
|
66
66
|
locationsSchema: () => locationsSchema,
|
|
67
|
+
productCouponSchema: () => productCouponSchema,
|
|
67
68
|
refundPolicySchema: () => refundPolicySchema,
|
|
68
69
|
relatedPostSchema: () => relatedPostSchema,
|
|
69
70
|
relationDatesSchema: () => relationDatesSchema,
|
|
@@ -3697,6 +3698,11 @@ var EnumAffiliateRewardType = /* @__PURE__ */ ((EnumAffiliateRewardType2) => {
|
|
|
3697
3698
|
EnumAffiliateRewardType2["NEW_VENDOR_REGISTRATION"] = "NEW_VENDOR_REGISTRATION";
|
|
3698
3699
|
return EnumAffiliateRewardType2;
|
|
3699
3700
|
})(EnumAffiliateRewardType || {});
|
|
3701
|
+
var EnumCouponQualificationType = /* @__PURE__ */ ((EnumCouponQualificationType2) => {
|
|
3702
|
+
EnumCouponQualificationType2["PURCHASE"] = "PURCHASE";
|
|
3703
|
+
EnumCouponQualificationType2["MARKET_VISIT"] = "MARKET_VISIT";
|
|
3704
|
+
return EnumCouponQualificationType2;
|
|
3705
|
+
})(EnumCouponQualificationType || {});
|
|
3700
3706
|
var statusOptions = [
|
|
3701
3707
|
...Object.values(EnumInviteStatus).map((status) => ({
|
|
3702
3708
|
label: status,
|
|
@@ -5120,6 +5126,7 @@ var USER_FIELDS_FRAGMENT = gql`
|
|
|
5120
5126
|
avatar {
|
|
5121
5127
|
...ResourceImageFields
|
|
5122
5128
|
}
|
|
5129
|
+
coupon
|
|
5123
5130
|
createdAt
|
|
5124
5131
|
deletedAt
|
|
5125
5132
|
email
|
|
@@ -5466,6 +5473,109 @@ var GET_EVENT_INFO = gql`
|
|
|
5466
5473
|
}
|
|
5467
5474
|
${EVENT_INFO}
|
|
5468
5475
|
`;
|
|
5476
|
+
var PRODUCT_COUPON_FIELDS_FRAGMENT = gql`
|
|
5477
|
+
fragment ProductCouponFields on ProductCouponType {
|
|
5478
|
+
couponDocumentId
|
|
5479
|
+
couponId
|
|
5480
|
+
}
|
|
5481
|
+
`;
|
|
5482
|
+
var COUPON_CODE_FIELDS_FRAGMENT = gql`
|
|
5483
|
+
fragment CouponCodeFields on CouponCodeType {
|
|
5484
|
+
code
|
|
5485
|
+
qrCode {
|
|
5486
|
+
...ResourceImageFields
|
|
5487
|
+
}
|
|
5488
|
+
}
|
|
5489
|
+
${RESOURCE_IMAGE_FIELDS_FRAGMENT}
|
|
5490
|
+
`;
|
|
5491
|
+
var COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT = gql`
|
|
5492
|
+
fragment CouponParticipantUserFields on CouponParticipantUserType {
|
|
5493
|
+
couponCollectedCount
|
|
5494
|
+
couponRedeemedAt
|
|
5495
|
+
createdAt
|
|
5496
|
+
updatedAt
|
|
5497
|
+
userId
|
|
5498
|
+
}
|
|
5499
|
+
`;
|
|
5500
|
+
var COUPON_OPTION_FIELDS_FRAGMENT = gql`
|
|
5501
|
+
fragment CouponOptionFields on CouponOptionType {
|
|
5502
|
+
type
|
|
5503
|
+
buy
|
|
5504
|
+
get
|
|
5505
|
+
unit
|
|
5506
|
+
visits
|
|
5507
|
+
}
|
|
5508
|
+
`;
|
|
5509
|
+
var COUPON_REWARD_FIELDS_FRAGMENT = gql`
|
|
5510
|
+
fragment CouponRewardFields on CouponRewardType {
|
|
5511
|
+
vendorId
|
|
5512
|
+
productId
|
|
5513
|
+
quantity
|
|
5514
|
+
unit
|
|
5515
|
+
}
|
|
5516
|
+
`;
|
|
5517
|
+
var COUPON_DATA_FIELDS_FRAGMENT = gql`
|
|
5518
|
+
fragment CouponDataFields on CouponDataType {
|
|
5519
|
+
_id
|
|
5520
|
+
active
|
|
5521
|
+
couponCode {
|
|
5522
|
+
...CouponCodeFields
|
|
5523
|
+
}
|
|
5524
|
+
couponDescription
|
|
5525
|
+
couponOption {
|
|
5526
|
+
...CouponOptionFields
|
|
5527
|
+
}
|
|
5528
|
+
couponRewards {
|
|
5529
|
+
...CouponRewardFields
|
|
5530
|
+
}
|
|
5531
|
+
createdAt
|
|
5532
|
+
endDate
|
|
5533
|
+
participantUsers {
|
|
5534
|
+
...CouponParticipantUserFields
|
|
5535
|
+
}
|
|
5536
|
+
resourceId
|
|
5537
|
+
resourceType
|
|
5538
|
+
startDate
|
|
5539
|
+
updatedAt
|
|
5540
|
+
}
|
|
5541
|
+
${COUPON_CODE_FIELDS_FRAGMENT}
|
|
5542
|
+
${COUPON_OPTION_FIELDS_FRAGMENT}
|
|
5543
|
+
${COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT}
|
|
5544
|
+
${COUPON_REWARD_FIELDS_FRAGMENT}
|
|
5545
|
+
`;
|
|
5546
|
+
var COUPON = gql`
|
|
5547
|
+
fragment CouponFields on CouponType {
|
|
5548
|
+
_id
|
|
5549
|
+
active
|
|
5550
|
+
couponData {
|
|
5551
|
+
...CouponDataFields
|
|
5552
|
+
}
|
|
5553
|
+
createdAt
|
|
5554
|
+
deletedAt
|
|
5555
|
+
owner {
|
|
5556
|
+
...OwnerFields
|
|
5557
|
+
}
|
|
5558
|
+
updatedAt
|
|
5559
|
+
}
|
|
5560
|
+
${OWNER_FIELDS_FRAGMENT}
|
|
5561
|
+
${COUPON_DATA_FIELDS_FRAGMENT}
|
|
5562
|
+
`;
|
|
5563
|
+
var GET_COUPONS = gql`
|
|
5564
|
+
query getCoupons {
|
|
5565
|
+
coupons {
|
|
5566
|
+
...CouponFields
|
|
5567
|
+
}
|
|
5568
|
+
}
|
|
5569
|
+
${COUPON}
|
|
5570
|
+
`;
|
|
5571
|
+
var GET_COUPON = gql`
|
|
5572
|
+
query getCoupon($_id: ID!) {
|
|
5573
|
+
coupon(_id: $_id) {
|
|
5574
|
+
...CouponFields
|
|
5575
|
+
}
|
|
5576
|
+
}
|
|
5577
|
+
${COUPON}
|
|
5578
|
+
`;
|
|
5469
5579
|
var VENDOR_DATETIME_FIELDS_FRAGMENT = gql`
|
|
5470
5580
|
fragment VendorDateTimeFields on VendorDateTimeType {
|
|
5471
5581
|
dateStatus
|
|
@@ -5478,15 +5588,18 @@ var VENDOR_DATETIME_FIELDS_FRAGMENT = gql`
|
|
|
5478
5588
|
var VENDOR_PRODUCT_LIST_FIELDS_FRAGMENT = gql`
|
|
5479
5589
|
fragment VendorProductListFields on VendorProductListType {
|
|
5480
5590
|
_id
|
|
5591
|
+
coupon {
|
|
5592
|
+
...ProductCouponFields
|
|
5593
|
+
}
|
|
5481
5594
|
createdAt
|
|
5482
5595
|
description
|
|
5483
|
-
hasCoupon
|
|
5484
5596
|
name
|
|
5485
5597
|
price
|
|
5486
5598
|
priceUnit
|
|
5487
5599
|
productGroups
|
|
5488
5600
|
updatedAt
|
|
5489
5601
|
}
|
|
5602
|
+
${PRODUCT_COUPON_FIELDS_FRAGMENT}
|
|
5490
5603
|
`;
|
|
5491
5604
|
var VENDOR = gql`
|
|
5492
5605
|
fragment VendorFields on VendorType {
|
|
@@ -7788,79 +7901,6 @@ var ASSIGN_AFFILIATE_BONUS_REWARD_MUTATION = gql`
|
|
|
7788
7901
|
}
|
|
7789
7902
|
${AFFILIATE_FIELDS_FRAGMENT}
|
|
7790
7903
|
`;
|
|
7791
|
-
var COUPON_CODE_FIELDS_FRAGMENT = gql`
|
|
7792
|
-
fragment CouponCodeFields on CouponCodeType {
|
|
7793
|
-
code
|
|
7794
|
-
qrCode {
|
|
7795
|
-
...ResourceImageFields
|
|
7796
|
-
}
|
|
7797
|
-
}
|
|
7798
|
-
${RESOURCE_IMAGE_FIELDS_FRAGMENT}
|
|
7799
|
-
`;
|
|
7800
|
-
var COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT = gql`
|
|
7801
|
-
fragment CouponParticipantUserFields on CouponParticipantUserType {
|
|
7802
|
-
couponCount
|
|
7803
|
-
couponRedeemedAt
|
|
7804
|
-
createdAt
|
|
7805
|
-
updatedAt
|
|
7806
|
-
userId
|
|
7807
|
-
}
|
|
7808
|
-
`;
|
|
7809
|
-
var PRODUCT_COUPON_FIELDS_FRAGMENT = gql`
|
|
7810
|
-
fragment ProductCouponFields on ProductCouponType {
|
|
7811
|
-
_id
|
|
7812
|
-
active
|
|
7813
|
-
couponCode {
|
|
7814
|
-
...CouponCodeFields
|
|
7815
|
-
}
|
|
7816
|
-
couponDescription
|
|
7817
|
-
couponOption
|
|
7818
|
-
createdAt
|
|
7819
|
-
endDate
|
|
7820
|
-
participantProduct {
|
|
7821
|
-
...VendorProductListFields
|
|
7822
|
-
}
|
|
7823
|
-
participantUsers {
|
|
7824
|
-
...CouponParticipantUserFields
|
|
7825
|
-
}
|
|
7826
|
-
startDate
|
|
7827
|
-
updatedAt
|
|
7828
|
-
}
|
|
7829
|
-
${COUPON_CODE_FIELDS_FRAGMENT}
|
|
7830
|
-
${COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT}
|
|
7831
|
-
${VENDOR_PRODUCT_LIST_FIELDS_FRAGMENT}
|
|
7832
|
-
`;
|
|
7833
|
-
var COUPON = gql`
|
|
7834
|
-
fragment CouponFields on CouponType {
|
|
7835
|
-
_id
|
|
7836
|
-
active
|
|
7837
|
-
productCoupons {
|
|
7838
|
-
...ProductCouponFields
|
|
7839
|
-
}
|
|
7840
|
-
createdAt
|
|
7841
|
-
deletedAt
|
|
7842
|
-
updatedAt
|
|
7843
|
-
}
|
|
7844
|
-
${PRODUCT_COUPON_FIELDS_FRAGMENT}
|
|
7845
|
-
${COUPON_CODE_FIELDS_FRAGMENT}
|
|
7846
|
-
${COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT}
|
|
7847
|
-
`;
|
|
7848
|
-
var GET_COUPONS = gql`
|
|
7849
|
-
query getCoupons {
|
|
7850
|
-
coupons {
|
|
7851
|
-
...CouponFields
|
|
7852
|
-
}
|
|
7853
|
-
}
|
|
7854
|
-
${COUPON}
|
|
7855
|
-
`;
|
|
7856
|
-
var GET_COUPON = gql`
|
|
7857
|
-
query getCoupon($_id: ID!) {
|
|
7858
|
-
coupon(_id: $_id) {
|
|
7859
|
-
...CouponFields
|
|
7860
|
-
}
|
|
7861
|
-
}
|
|
7862
|
-
${COUPON}
|
|
7863
|
-
`;
|
|
7864
7904
|
var CREATE_COUPON_MUTATION = gql`
|
|
7865
7905
|
mutation createCoupon($input: CouponInputType!) {
|
|
7866
7906
|
createCoupon(input: $input) {
|
|
@@ -8560,7 +8600,7 @@ var baseResourceFields = {
|
|
|
8560
8600
|
logo: { required: false, type: ResourceImageTypeSchema },
|
|
8561
8601
|
name: { required: true, type: String },
|
|
8562
8602
|
owner: {
|
|
8563
|
-
required:
|
|
8603
|
+
required: true,
|
|
8564
8604
|
type: OwnerTypeSchema
|
|
8565
8605
|
},
|
|
8566
8606
|
posterUsage: { required: false, type: PosterUsageTypeSchema },
|
|
@@ -8977,12 +9017,117 @@ var schema8 = new MongooseSchema12(
|
|
|
8977
9017
|
var VerificationTokenModel = import_mongoose12.default.models.VerificationToken || import_mongoose12.default.model("VerificationToken", schema8);
|
|
8978
9018
|
|
|
8979
9019
|
// src/mongoose/vendor/Vendor.ts
|
|
9020
|
+
var import_mongoose14 = __toESM(require("mongoose"));
|
|
9021
|
+
|
|
9022
|
+
// src/mongoose/Coupon.ts
|
|
8980
9023
|
var import_mongoose13 = __toESM(require("mongoose"));
|
|
8981
9024
|
var MongooseSchema13 = import_mongoose13.default.Schema;
|
|
8982
|
-
var
|
|
9025
|
+
var productCouponSchema = new MongooseSchema13(
|
|
9026
|
+
{
|
|
9027
|
+
couponDocumentId: {
|
|
9028
|
+
ref: "Coupon",
|
|
9029
|
+
required: true,
|
|
9030
|
+
type: import_mongoose13.default.Schema.Types.ObjectId
|
|
9031
|
+
},
|
|
9032
|
+
couponId: {
|
|
9033
|
+
required: true,
|
|
9034
|
+
type: import_mongoose13.default.Schema.Types.ObjectId
|
|
9035
|
+
}
|
|
9036
|
+
},
|
|
9037
|
+
{ _id: false }
|
|
9038
|
+
);
|
|
9039
|
+
var couponOptionSchema = new MongooseSchema13(
|
|
9040
|
+
{
|
|
9041
|
+
buy: { required: false, type: Number },
|
|
9042
|
+
get: { required: false, type: Number },
|
|
9043
|
+
type: {
|
|
9044
|
+
enum: Object.values(EnumCouponQualificationType),
|
|
9045
|
+
required: true,
|
|
9046
|
+
type: String
|
|
9047
|
+
},
|
|
9048
|
+
unit: { required: false, type: String },
|
|
9049
|
+
visits: { required: false, type: Number }
|
|
9050
|
+
},
|
|
9051
|
+
{ _id: false }
|
|
9052
|
+
);
|
|
9053
|
+
var couponRewardSchema = new MongooseSchema13(
|
|
8983
9054
|
{
|
|
9055
|
+
productId: {
|
|
9056
|
+
required: true,
|
|
9057
|
+
type: import_mongoose13.default.Schema.Types.ObjectId
|
|
9058
|
+
},
|
|
9059
|
+
quantity: { required: true, type: Number },
|
|
9060
|
+
unit: { required: true, type: String },
|
|
9061
|
+
vendorId: {
|
|
9062
|
+
ref: "Vendor",
|
|
9063
|
+
required: true,
|
|
9064
|
+
type: import_mongoose13.default.Schema.Types.ObjectId
|
|
9065
|
+
}
|
|
9066
|
+
},
|
|
9067
|
+
{ _id: false }
|
|
9068
|
+
);
|
|
9069
|
+
var couponCodeSchema = new MongooseSchema13(
|
|
9070
|
+
{
|
|
9071
|
+
code: { required: true, type: String },
|
|
9072
|
+
qrCode: { required: true, type: ResourceImageTypeSchema }
|
|
9073
|
+
},
|
|
9074
|
+
{ _id: false }
|
|
9075
|
+
);
|
|
9076
|
+
var couponParticipantUserSchema = new MongooseSchema13(
|
|
9077
|
+
{
|
|
9078
|
+
couponCollectedCount: { default: 0, required: true, type: Number },
|
|
9079
|
+
couponRedeemedAt: { default: null, required: false, type: Date },
|
|
9080
|
+
userId: {
|
|
9081
|
+
ref: "User",
|
|
9082
|
+
required: true,
|
|
9083
|
+
type: import_mongoose13.default.Schema.Types.ObjectId
|
|
9084
|
+
}
|
|
9085
|
+
},
|
|
9086
|
+
{ timestamps: true }
|
|
9087
|
+
);
|
|
9088
|
+
var couponDataSchema = new MongooseSchema13(
|
|
9089
|
+
{
|
|
9090
|
+
active: { default: true, required: true, type: Boolean },
|
|
9091
|
+
couponCode: { required: true, type: couponCodeSchema },
|
|
9092
|
+
couponDescription: { required: true, type: String },
|
|
9093
|
+
couponOption: { required: true, type: couponOptionSchema },
|
|
9094
|
+
couponRewards: { required: false, type: [couponRewardSchema] },
|
|
9095
|
+
endDate: { required: true, type: Date },
|
|
9096
|
+
participantUsers: {
|
|
9097
|
+
default: null,
|
|
9098
|
+
required: false,
|
|
9099
|
+
type: [couponParticipantUserSchema]
|
|
9100
|
+
},
|
|
9101
|
+
resourceId: { required: true, type: String },
|
|
9102
|
+
resourceType: {
|
|
9103
|
+
enum: Object.values(EnumResourceType),
|
|
9104
|
+
required: true,
|
|
9105
|
+
type: String
|
|
9106
|
+
},
|
|
9107
|
+
startDate: { required: true, type: Date }
|
|
9108
|
+
},
|
|
9109
|
+
{ timestamps: true }
|
|
9110
|
+
);
|
|
9111
|
+
var schema9 = new MongooseSchema13(
|
|
9112
|
+
{
|
|
9113
|
+
active: { default: true, required: true, type: Boolean },
|
|
9114
|
+
couponData: { default: [], required: false, type: [couponDataSchema] },
|
|
9115
|
+
deletedAt: { default: null, required: false, type: Date },
|
|
9116
|
+
owner: {
|
|
9117
|
+
required: true,
|
|
9118
|
+
type: OwnerTypeSchema
|
|
9119
|
+
}
|
|
9120
|
+
},
|
|
9121
|
+
{ timestamps: true }
|
|
9122
|
+
);
|
|
9123
|
+
var CouponModel = import_mongoose13.default.models.Coupon || import_mongoose13.default.model("Coupon", schema9);
|
|
9124
|
+
|
|
9125
|
+
// src/mongoose/vendor/Vendor.ts
|
|
9126
|
+
var MongooseSchema14 = import_mongoose14.default.Schema;
|
|
9127
|
+
var vendorProductTypeSchema = new MongooseSchema14(
|
|
9128
|
+
{
|
|
9129
|
+
coupon: { required: false, type: productCouponSchema },
|
|
8984
9130
|
description: { required: false, type: String },
|
|
8985
|
-
hasCoupon: { default: false, required: false, type: Boolean },
|
|
8986
9131
|
name: { required: true, type: String },
|
|
8987
9132
|
price: { required: true, type: Number },
|
|
8988
9133
|
priceUnit: { required: true, type: String },
|
|
@@ -8990,14 +9135,14 @@ var vendorProductTypeSchema = new MongooseSchema13(
|
|
|
8990
9135
|
},
|
|
8991
9136
|
{ timestamps: true }
|
|
8992
9137
|
);
|
|
8993
|
-
var productWrapperSchema = new
|
|
9138
|
+
var productWrapperSchema = new MongooseSchema14(
|
|
8994
9139
|
{
|
|
8995
9140
|
active: { default: false, required: true, type: Boolean },
|
|
8996
9141
|
productsList: { required: false, type: [vendorProductTypeSchema] }
|
|
8997
9142
|
},
|
|
8998
9143
|
{ _id: false }
|
|
8999
9144
|
);
|
|
9000
|
-
var calendarSchema = new
|
|
9145
|
+
var calendarSchema = new MongooseSchema14(
|
|
9001
9146
|
{
|
|
9002
9147
|
dateTime: {
|
|
9003
9148
|
dateStatus: {
|
|
@@ -9018,14 +9163,14 @@ var calendarSchema = new MongooseSchema13(
|
|
|
9018
9163
|
},
|
|
9019
9164
|
{ _id: false }
|
|
9020
9165
|
);
|
|
9021
|
-
var calendarWrapperSchema = new
|
|
9166
|
+
var calendarWrapperSchema = new MongooseSchema14(
|
|
9022
9167
|
{
|
|
9023
9168
|
active: { default: false, required: true, type: Boolean },
|
|
9024
9169
|
calendarData: { required: false, type: [calendarSchema] }
|
|
9025
9170
|
},
|
|
9026
9171
|
{ _id: false }
|
|
9027
9172
|
);
|
|
9028
|
-
var
|
|
9173
|
+
var schema10 = new MongooseSchema14(
|
|
9029
9174
|
{
|
|
9030
9175
|
...baseResourceFields,
|
|
9031
9176
|
// Importing base resource fields from global.ts
|
|
@@ -9051,12 +9196,12 @@ var schema9 = new MongooseSchema13(
|
|
|
9051
9196
|
unregisteredVendorId: {
|
|
9052
9197
|
ref: "UnregisteredVendor",
|
|
9053
9198
|
required: false,
|
|
9054
|
-
type:
|
|
9199
|
+
type: import_mongoose14.default.Schema.Types.ObjectId
|
|
9055
9200
|
},
|
|
9056
9201
|
vendorInfoId: {
|
|
9057
9202
|
ref: "VendorInfo",
|
|
9058
9203
|
required: false,
|
|
9059
|
-
type:
|
|
9204
|
+
type: import_mongoose14.default.Schema.Types.ObjectId
|
|
9060
9205
|
},
|
|
9061
9206
|
vendorType: {
|
|
9062
9207
|
enum: Object.values(EnumVendorType),
|
|
@@ -9066,24 +9211,24 @@ var schema9 = new MongooseSchema13(
|
|
|
9066
9211
|
},
|
|
9067
9212
|
{ timestamps: true }
|
|
9068
9213
|
);
|
|
9069
|
-
|
|
9070
|
-
|
|
9071
|
-
|
|
9072
|
-
|
|
9073
|
-
|
|
9074
|
-
var VendorModel =
|
|
9214
|
+
schema10.index({ name: 1 });
|
|
9215
|
+
schema10.index({ description: 1 });
|
|
9216
|
+
schema10.index({ region: 1 });
|
|
9217
|
+
schema10.index({ "categories.name": 1 });
|
|
9218
|
+
schema10.index({ slug: 1 });
|
|
9219
|
+
var VendorModel = import_mongoose14.default.models.Vendor || import_mongoose14.default.model("Vendor", schema10);
|
|
9075
9220
|
|
|
9076
9221
|
// src/mongoose/vendor/VendorInfo.ts
|
|
9077
|
-
var
|
|
9078
|
-
var
|
|
9079
|
-
var AttributesSchema = new
|
|
9222
|
+
var import_mongoose15 = __toESM(require("mongoose"));
|
|
9223
|
+
var MongooseSchema15 = import_mongoose15.default.Schema;
|
|
9224
|
+
var AttributesSchema = new MongooseSchema15(
|
|
9080
9225
|
{
|
|
9081
9226
|
details: { required: false, type: String },
|
|
9082
9227
|
isRequired: { default: false, required: true, type: Boolean }
|
|
9083
9228
|
},
|
|
9084
9229
|
{ _id: false }
|
|
9085
9230
|
);
|
|
9086
|
-
var
|
|
9231
|
+
var schema11 = new MongooseSchema15(
|
|
9087
9232
|
{
|
|
9088
9233
|
active: { default: true, type: Boolean },
|
|
9089
9234
|
compliance: {
|
|
@@ -9118,28 +9263,28 @@ var schema10 = new MongooseSchema14(
|
|
|
9118
9263
|
vendorId: {
|
|
9119
9264
|
ref: "Vendor",
|
|
9120
9265
|
required: true,
|
|
9121
|
-
type:
|
|
9266
|
+
type: import_mongoose15.default.Schema.Types.ObjectId
|
|
9122
9267
|
}
|
|
9123
9268
|
},
|
|
9124
9269
|
{ timestamps: true }
|
|
9125
9270
|
);
|
|
9126
|
-
var VendorInfoModel =
|
|
9271
|
+
var VendorInfoModel = import_mongoose15.default.models.VendorInfo || import_mongoose15.default.model("VendorInfo", schema11);
|
|
9127
9272
|
|
|
9128
9273
|
// src/mongoose/vendor/UnregisteredVendor.ts
|
|
9129
|
-
var
|
|
9130
|
-
var
|
|
9131
|
-
var invitationSchema = new
|
|
9274
|
+
var import_mongoose16 = __toESM(require("mongoose"));
|
|
9275
|
+
var MongooseSchema16 = import_mongoose16.default.Schema;
|
|
9276
|
+
var invitationSchema = new MongooseSchema16(
|
|
9132
9277
|
{
|
|
9133
9278
|
dateTime: { required: true, type: [dateTimeSchema2] },
|
|
9134
9279
|
inviterId: {
|
|
9135
9280
|
ref: "Event",
|
|
9136
9281
|
required: true,
|
|
9137
|
-
type:
|
|
9282
|
+
type: import_mongoose16.default.Schema.Types.ObjectId
|
|
9138
9283
|
}
|
|
9139
9284
|
},
|
|
9140
9285
|
{ _id: false }
|
|
9141
9286
|
);
|
|
9142
|
-
var
|
|
9287
|
+
var schema12 = new MongooseSchema16(
|
|
9143
9288
|
{
|
|
9144
9289
|
active: { default: true, required: true, type: Boolean },
|
|
9145
9290
|
categoryIds: { required: true, type: [String] },
|
|
@@ -9148,7 +9293,7 @@ var schema11 = new MongooseSchema15(
|
|
|
9148
9293
|
claimedByUserId: {
|
|
9149
9294
|
ref: "User",
|
|
9150
9295
|
required: false,
|
|
9151
|
-
type:
|
|
9296
|
+
type: import_mongoose16.default.Schema.Types.ObjectId
|
|
9152
9297
|
},
|
|
9153
9298
|
claimInitiatedAt: { default: null, required: false, type: Date },
|
|
9154
9299
|
claimToken: { default: null, required: false, type: String },
|
|
@@ -9161,14 +9306,14 @@ var schema11 = new MongooseSchema15(
|
|
|
9161
9306
|
},
|
|
9162
9307
|
{ timestamps: true }
|
|
9163
9308
|
);
|
|
9164
|
-
|
|
9165
|
-
|
|
9166
|
-
var UnregisteredVendorModel =
|
|
9309
|
+
schema12.index({ name: 1 });
|
|
9310
|
+
schema12.index({ email: 1 });
|
|
9311
|
+
var UnregisteredVendorModel = import_mongoose16.default.models.UnregisteredVendor || import_mongoose16.default.model("UnregisteredVendor", schema12);
|
|
9167
9312
|
|
|
9168
9313
|
// src/mongoose/event/Event.ts
|
|
9169
|
-
var
|
|
9170
|
-
var
|
|
9171
|
-
var
|
|
9314
|
+
var import_mongoose17 = __toESM(require("mongoose"));
|
|
9315
|
+
var MongooseSchema17 = import_mongoose17.default.Schema;
|
|
9316
|
+
var schema13 = new MongooseSchema17(
|
|
9172
9317
|
{
|
|
9173
9318
|
...baseResourceFields,
|
|
9174
9319
|
// Importing base resource fields from global.ts
|
|
@@ -9177,7 +9322,7 @@ var schema12 = new MongooseSchema16(
|
|
|
9177
9322
|
eventInfoId: {
|
|
9178
9323
|
ref: "EventInfo",
|
|
9179
9324
|
required: false,
|
|
9180
|
-
type:
|
|
9325
|
+
type: import_mongoose17.default.Schema.Types.ObjectId
|
|
9181
9326
|
},
|
|
9182
9327
|
eventType: {
|
|
9183
9328
|
enum: Object.values(EnumEventType),
|
|
@@ -9206,20 +9351,20 @@ var schema12 = new MongooseSchema16(
|
|
|
9206
9351
|
},
|
|
9207
9352
|
{ timestamps: true }
|
|
9208
9353
|
);
|
|
9209
|
-
|
|
9210
|
-
|
|
9211
|
-
|
|
9212
|
-
|
|
9213
|
-
|
|
9214
|
-
|
|
9215
|
-
|
|
9216
|
-
|
|
9217
|
-
var EventModel =
|
|
9354
|
+
schema13.index({ name: 1 });
|
|
9355
|
+
schema13.index({ description: 1 });
|
|
9356
|
+
schema13.index({ region: 1 });
|
|
9357
|
+
schema13.index({ "location.geo": "2dsphere" });
|
|
9358
|
+
schema13.index({ tags: 1 });
|
|
9359
|
+
schema13.index({ deletedAt: 1 });
|
|
9360
|
+
schema13.index({ "dateTime.dateStatus": 1 });
|
|
9361
|
+
schema13.index({ slug: 1 });
|
|
9362
|
+
var EventModel = import_mongoose17.default.models.Event || import_mongoose17.default.model("Event", schema13);
|
|
9218
9363
|
|
|
9219
9364
|
// src/mongoose/Partner.ts
|
|
9220
|
-
var
|
|
9221
|
-
var
|
|
9222
|
-
var
|
|
9365
|
+
var import_mongoose18 = __toESM(require("mongoose"));
|
|
9366
|
+
var MongooseSchema18 = import_mongoose18.default.Schema;
|
|
9367
|
+
var schema14 = new MongooseSchema18(
|
|
9223
9368
|
{
|
|
9224
9369
|
...baseResourceFields,
|
|
9225
9370
|
location: {
|
|
@@ -9235,19 +9380,19 @@ var schema13 = new MongooseSchema17(
|
|
|
9235
9380
|
},
|
|
9236
9381
|
{ timestamps: true }
|
|
9237
9382
|
);
|
|
9238
|
-
|
|
9239
|
-
|
|
9240
|
-
|
|
9241
|
-
|
|
9242
|
-
|
|
9243
|
-
var PartnerModel =
|
|
9383
|
+
schema14.index({ name: 1 });
|
|
9384
|
+
schema14.index({ description: 1 });
|
|
9385
|
+
schema14.index({ region: 1 });
|
|
9386
|
+
schema14.index({ "location.geo": "2dsphere" });
|
|
9387
|
+
schema14.index({ slug: 1 });
|
|
9388
|
+
var PartnerModel = import_mongoose18.default.models.Partner || import_mongoose18.default.model("Partner", schema14);
|
|
9244
9389
|
|
|
9245
9390
|
// src/mongoose/Post.ts
|
|
9246
|
-
var
|
|
9247
|
-
var
|
|
9248
|
-
var contentSchema = new
|
|
9391
|
+
var import_mongoose19 = __toESM(require("mongoose"));
|
|
9392
|
+
var MongooseSchema19 = import_mongoose19.default.Schema;
|
|
9393
|
+
var contentSchema = new MongooseSchema19(
|
|
9249
9394
|
{
|
|
9250
|
-
contentData:
|
|
9395
|
+
contentData: import_mongoose19.Schema.Types.Mixed,
|
|
9251
9396
|
contentOrder: { required: true, type: Number },
|
|
9252
9397
|
contentType: {
|
|
9253
9398
|
enum: Object.values(EnumPostContentType),
|
|
@@ -9257,7 +9402,7 @@ var contentSchema = new MongooseSchema18(
|
|
|
9257
9402
|
},
|
|
9258
9403
|
{ _id: false }
|
|
9259
9404
|
);
|
|
9260
|
-
var resourceSchema = new
|
|
9405
|
+
var resourceSchema = new MongooseSchema19(
|
|
9261
9406
|
{
|
|
9262
9407
|
resourceId: { required: true, type: String },
|
|
9263
9408
|
resourceRegion: { required: true, type: String },
|
|
@@ -9270,7 +9415,7 @@ var resourceSchema = new MongooseSchema18(
|
|
|
9270
9415
|
},
|
|
9271
9416
|
{ _id: false }
|
|
9272
9417
|
);
|
|
9273
|
-
var
|
|
9418
|
+
var schema15 = new MongooseSchema19(
|
|
9274
9419
|
{
|
|
9275
9420
|
active: { default: false, required: true, type: Boolean },
|
|
9276
9421
|
approvedAt: { default: null, required: false, type: Date },
|
|
@@ -9301,16 +9446,16 @@ var schema14 = new MongooseSchema18(
|
|
|
9301
9446
|
},
|
|
9302
9447
|
{ timestamps: true }
|
|
9303
9448
|
);
|
|
9304
|
-
|
|
9305
|
-
|
|
9306
|
-
|
|
9307
|
-
var PostModel =
|
|
9449
|
+
schema15.index({ title: 1 });
|
|
9450
|
+
schema15.index({ tags: 1 });
|
|
9451
|
+
schema15.index({ postType: 1, slug: 1 }, { unique: true });
|
|
9452
|
+
var PostModel = import_mongoose19.default.models.Post || import_mongoose19.default.model("Post", schema15);
|
|
9308
9453
|
|
|
9309
9454
|
// src/mongoose/AppSetting.ts
|
|
9310
|
-
var
|
|
9311
|
-
var
|
|
9455
|
+
var import_mongoose20 = __toESM(require("mongoose"));
|
|
9456
|
+
var MongooseSchema20 = import_mongoose20.default.Schema;
|
|
9312
9457
|
var APP_SETTINGS_ID = "APP_SETTINGS_DOCUMENT_ID";
|
|
9313
|
-
var AppSettingSchema = new
|
|
9458
|
+
var AppSettingSchema = new MongooseSchema20(
|
|
9314
9459
|
{
|
|
9315
9460
|
activeSchoolsStudentCountTotal: {
|
|
9316
9461
|
default: 0,
|
|
@@ -9341,18 +9486,18 @@ var AppSettingSchema = new MongooseSchema19(
|
|
|
9341
9486
|
},
|
|
9342
9487
|
{ timestamps: true }
|
|
9343
9488
|
);
|
|
9344
|
-
var AppSettingModel =
|
|
9489
|
+
var AppSettingModel = import_mongoose20.default.models.AppSetting || import_mongoose20.default.model("AppSetting", AppSettingSchema);
|
|
9345
9490
|
|
|
9346
9491
|
// src/mongoose/game/Game.ts
|
|
9347
|
-
var
|
|
9492
|
+
var import_mongoose24 = __toESM(require("mongoose"));
|
|
9348
9493
|
|
|
9349
9494
|
// src/mongoose/game/DailyClue.ts
|
|
9350
|
-
var
|
|
9495
|
+
var import_mongoose22 = __toESM(require("mongoose"));
|
|
9351
9496
|
|
|
9352
9497
|
// src/mongoose/game/utils.ts
|
|
9353
|
-
var
|
|
9354
|
-
var
|
|
9355
|
-
var schemaGameDate = new
|
|
9498
|
+
var import_mongoose21 = __toESM(require("mongoose"));
|
|
9499
|
+
var MongooseSchema21 = import_mongoose21.default.Schema;
|
|
9500
|
+
var schemaGameDate = new MongooseSchema21(
|
|
9356
9501
|
{
|
|
9357
9502
|
endDate: { required: true, type: Date },
|
|
9358
9503
|
startDate: { required: true, type: Date }
|
|
@@ -9361,8 +9506,8 @@ var schemaGameDate = new MongooseSchema20(
|
|
|
9361
9506
|
);
|
|
9362
9507
|
|
|
9363
9508
|
// src/mongoose/game/DailyClue.ts
|
|
9364
|
-
var
|
|
9365
|
-
var schemaLetters = new
|
|
9509
|
+
var MongooseSchema22 = import_mongoose22.default.Schema;
|
|
9510
|
+
var schemaLetters = new MongooseSchema22(
|
|
9366
9511
|
{
|
|
9367
9512
|
collected: { required: false, type: [String] },
|
|
9368
9513
|
solutionShuffled: { required: true, type: [String] }
|
|
@@ -9370,14 +9515,14 @@ var schemaLetters = new MongooseSchema21(
|
|
|
9370
9515
|
},
|
|
9371
9516
|
{ _id: false }
|
|
9372
9517
|
);
|
|
9373
|
-
var schemaDailyClueBaseGame = new
|
|
9518
|
+
var schemaDailyClueBaseGame = new MongooseSchema22(
|
|
9374
9519
|
{
|
|
9375
9520
|
gameDate: { required: true, type: schemaGameDate },
|
|
9376
9521
|
gameSolution: { required: true, type: String }
|
|
9377
9522
|
},
|
|
9378
9523
|
{ _id: false }
|
|
9379
9524
|
);
|
|
9380
|
-
var schemaDailyClueGameData = new
|
|
9525
|
+
var schemaDailyClueGameData = new MongooseSchema22(
|
|
9381
9526
|
{
|
|
9382
9527
|
gameFields: { required: true, type: schemaDailyClueBaseGame },
|
|
9383
9528
|
lastFoundDate: { default: null, required: false, type: Date },
|
|
@@ -9392,9 +9537,9 @@ var schemaDailyClueGameData = new MongooseSchema21(
|
|
|
9392
9537
|
);
|
|
9393
9538
|
|
|
9394
9539
|
// src/mongoose/game/PuzzleGame.ts
|
|
9395
|
-
var
|
|
9396
|
-
var
|
|
9397
|
-
var schemaPuzzleAnswer = new
|
|
9540
|
+
var import_mongoose23 = __toESM(require("mongoose"));
|
|
9541
|
+
var MongooseSchema23 = import_mongoose23.default.Schema;
|
|
9542
|
+
var schemaPuzzleAnswer = new MongooseSchema23(
|
|
9398
9543
|
{
|
|
9399
9544
|
answer: { required: true, type: String },
|
|
9400
9545
|
answerId: { required: true, type: String },
|
|
@@ -9402,7 +9547,7 @@ var schemaPuzzleAnswer = new MongooseSchema22(
|
|
|
9402
9547
|
},
|
|
9403
9548
|
{ _id: false }
|
|
9404
9549
|
);
|
|
9405
|
-
var schemaPuzzleQuestion = new
|
|
9550
|
+
var schemaPuzzleQuestion = new MongooseSchema23(
|
|
9406
9551
|
{
|
|
9407
9552
|
answers: { required: true, type: [schemaPuzzleAnswer] },
|
|
9408
9553
|
question: { required: true, type: String },
|
|
@@ -9410,20 +9555,20 @@ var schemaPuzzleQuestion = new MongooseSchema22(
|
|
|
9410
9555
|
},
|
|
9411
9556
|
{ _id: false }
|
|
9412
9557
|
);
|
|
9413
|
-
var schemaPuzzleBaseGame = new
|
|
9558
|
+
var schemaPuzzleBaseGame = new MongooseSchema23(
|
|
9414
9559
|
{
|
|
9415
9560
|
questions: { required: true, type: [schemaPuzzleQuestion] }
|
|
9416
9561
|
},
|
|
9417
9562
|
{ _id: false }
|
|
9418
9563
|
);
|
|
9419
|
-
var schemaPuzzleAnsweredQuestion = new
|
|
9564
|
+
var schemaPuzzleAnsweredQuestion = new MongooseSchema23(
|
|
9420
9565
|
{
|
|
9421
9566
|
questionId: { required: true, type: String },
|
|
9422
9567
|
selectedAnswerId: { required: true, type: String }
|
|
9423
9568
|
},
|
|
9424
9569
|
{ _id: false }
|
|
9425
9570
|
);
|
|
9426
|
-
var schemaPuzzleGameData = new
|
|
9571
|
+
var schemaPuzzleGameData = new MongooseSchema23(
|
|
9427
9572
|
{
|
|
9428
9573
|
answeredQuestions: {
|
|
9429
9574
|
default: null,
|
|
@@ -9438,7 +9583,7 @@ var schemaPuzzleGameData = new MongooseSchema22(
|
|
|
9438
9583
|
);
|
|
9439
9584
|
|
|
9440
9585
|
// src/mongoose/game/Game.ts
|
|
9441
|
-
var
|
|
9586
|
+
var MongooseSchema24 = import_mongoose24.default.Schema;
|
|
9442
9587
|
var gameDataSchemas = {
|
|
9443
9588
|
[EnumGameType.DAILY_CLUE]: schemaDailyClueGameData,
|
|
9444
9589
|
[EnumGameType.MINI_QUIZ]: schemaPuzzleGameData,
|
|
@@ -9450,7 +9595,7 @@ var gameDataDefinition = Object.fromEntries(
|
|
|
9450
9595
|
{ default: null, required: false, type: schema19 }
|
|
9451
9596
|
])
|
|
9452
9597
|
);
|
|
9453
|
-
var gameHistorySchema = new
|
|
9598
|
+
var gameHistorySchema = new MongooseSchema24(
|
|
9454
9599
|
{
|
|
9455
9600
|
createdAt: { required: true, type: Date },
|
|
9456
9601
|
gameDate: { required: true, type: schemaGameDate },
|
|
@@ -9470,7 +9615,7 @@ var gameHistorySchema = new MongooseSchema23(
|
|
|
9470
9615
|
},
|
|
9471
9616
|
{ _id: false }
|
|
9472
9617
|
);
|
|
9473
|
-
var gameTypeSchema = new
|
|
9618
|
+
var gameTypeSchema = new MongooseSchema24(
|
|
9474
9619
|
{
|
|
9475
9620
|
active: { default: true, required: true, type: Boolean },
|
|
9476
9621
|
gameData: gameDataDefinition,
|
|
@@ -9485,7 +9630,7 @@ var gameTypeSchema = new MongooseSchema23(
|
|
|
9485
9630
|
},
|
|
9486
9631
|
{ timestamps: true }
|
|
9487
9632
|
);
|
|
9488
|
-
var
|
|
9633
|
+
var schema16 = new MongooseSchema24(
|
|
9489
9634
|
{
|
|
9490
9635
|
active: { default: false, required: true, type: Boolean },
|
|
9491
9636
|
deletedAt: { default: null, required: false, type: Date },
|
|
@@ -9498,12 +9643,12 @@ var schema15 = new MongooseSchema23(
|
|
|
9498
9643
|
},
|
|
9499
9644
|
{ timestamps: true }
|
|
9500
9645
|
);
|
|
9501
|
-
var GameModel =
|
|
9646
|
+
var GameModel = import_mongoose24.default.models.Game || import_mongoose24.default.model("Game", schema16);
|
|
9502
9647
|
|
|
9503
9648
|
// src/mongoose/School.ts
|
|
9504
|
-
var
|
|
9505
|
-
var
|
|
9506
|
-
var campaignsSchema = new
|
|
9649
|
+
var import_mongoose25 = __toESM(require("mongoose"));
|
|
9650
|
+
var MongooseSchema25 = import_mongoose25.default.Schema;
|
|
9651
|
+
var campaignsSchema = new MongooseSchema25(
|
|
9507
9652
|
{
|
|
9508
9653
|
endDate: { required: true, type: Date },
|
|
9509
9654
|
name: { required: true, type: String },
|
|
@@ -9511,7 +9656,7 @@ var campaignsSchema = new MongooseSchema24(
|
|
|
9511
9656
|
},
|
|
9512
9657
|
{ _id: false }
|
|
9513
9658
|
);
|
|
9514
|
-
var
|
|
9659
|
+
var schema17 = new MongooseSchema25(
|
|
9515
9660
|
{
|
|
9516
9661
|
// New schools are active by default
|
|
9517
9662
|
active: { default: false, required: true, type: Boolean },
|
|
@@ -9538,19 +9683,19 @@ var schema16 = new MongooseSchema24(
|
|
|
9538
9683
|
},
|
|
9539
9684
|
{ timestamps: true }
|
|
9540
9685
|
);
|
|
9541
|
-
|
|
9686
|
+
schema17.index(
|
|
9542
9687
|
{ schoolCode: 1 },
|
|
9543
9688
|
{
|
|
9544
9689
|
partialFilterExpression: { active: true, deletedAt: null },
|
|
9545
9690
|
unique: true
|
|
9546
9691
|
}
|
|
9547
9692
|
);
|
|
9548
|
-
var SchoolModel =
|
|
9693
|
+
var SchoolModel = import_mongoose25.default.models.School || import_mongoose25.default.model("School", schema17);
|
|
9549
9694
|
|
|
9550
9695
|
// src/mongoose/Affiliate.ts
|
|
9551
|
-
var
|
|
9552
|
-
var
|
|
9553
|
-
var affiliateRewardSchema = new
|
|
9696
|
+
var import_mongoose26 = __toESM(require("mongoose"));
|
|
9697
|
+
var MongooseSchema26 = import_mongoose26.default.Schema;
|
|
9698
|
+
var affiliateRewardSchema = new MongooseSchema26(
|
|
9554
9699
|
{
|
|
9555
9700
|
createdAt: { required: true, type: Date },
|
|
9556
9701
|
redeemedAt: { default: null, required: false, type: Date },
|
|
@@ -9564,13 +9709,13 @@ var affiliateRewardSchema = new MongooseSchema25(
|
|
|
9564
9709
|
},
|
|
9565
9710
|
{ _id: false }
|
|
9566
9711
|
);
|
|
9567
|
-
var affiliateResourceSchema = new
|
|
9712
|
+
var affiliateResourceSchema = new MongooseSchema26(
|
|
9568
9713
|
{
|
|
9569
9714
|
resourceActive: { default: true, required: true, type: Boolean },
|
|
9570
9715
|
resourceDeletedAt: { default: null, required: false, type: Date },
|
|
9571
9716
|
resourceId: {
|
|
9572
9717
|
required: true,
|
|
9573
|
-
type:
|
|
9718
|
+
type: import_mongoose26.default.Schema.Types.ObjectId
|
|
9574
9719
|
},
|
|
9575
9720
|
resourceName: { required: true, type: String },
|
|
9576
9721
|
resourceOwner: {
|
|
@@ -9590,20 +9735,20 @@ var affiliateResourceSchema = new MongooseSchema25(
|
|
|
9590
9735
|
},
|
|
9591
9736
|
{ _id: false }
|
|
9592
9737
|
);
|
|
9593
|
-
var affiliateContactDetailsSchema = new
|
|
9738
|
+
var affiliateContactDetailsSchema = new MongooseSchema26(
|
|
9594
9739
|
{
|
|
9595
9740
|
mobilePhone: { required: true, type: String }
|
|
9596
9741
|
},
|
|
9597
9742
|
{ _id: false }
|
|
9598
9743
|
);
|
|
9599
|
-
var affiliateBankAccountDetailsSchema = new
|
|
9744
|
+
var affiliateBankAccountDetailsSchema = new MongooseSchema26(
|
|
9600
9745
|
{
|
|
9601
9746
|
accountHolderName: { required: true, type: String },
|
|
9602
9747
|
accountNumber: { required: true, type: String }
|
|
9603
9748
|
},
|
|
9604
9749
|
{ _id: false }
|
|
9605
9750
|
);
|
|
9606
|
-
var affiliateDetailsSchema = new
|
|
9751
|
+
var affiliateDetailsSchema = new MongooseSchema26(
|
|
9607
9752
|
{
|
|
9608
9753
|
bankAccountDetails: {
|
|
9609
9754
|
required: true,
|
|
@@ -9625,7 +9770,7 @@ var affiliateDetailsSchema = new MongooseSchema25(
|
|
|
9625
9770
|
},
|
|
9626
9771
|
{ _id: false }
|
|
9627
9772
|
);
|
|
9628
|
-
var redeemHistorySchema = new
|
|
9773
|
+
var redeemHistorySchema = new MongooseSchema26(
|
|
9629
9774
|
{
|
|
9630
9775
|
paidAt: { default: null, required: false, type: Date },
|
|
9631
9776
|
redeemedAt: { required: true, type: Date },
|
|
@@ -9633,7 +9778,7 @@ var redeemHistorySchema = new MongooseSchema25(
|
|
|
9633
9778
|
},
|
|
9634
9779
|
{ _id: false }
|
|
9635
9780
|
);
|
|
9636
|
-
var
|
|
9781
|
+
var schema18 = new MongooseSchema26(
|
|
9637
9782
|
{
|
|
9638
9783
|
active: { default: false, required: true, type: Boolean },
|
|
9639
9784
|
affiliateBonusRewards: {
|
|
@@ -9663,71 +9808,14 @@ var schema17 = new MongooseSchema25(
|
|
|
9663
9808
|
},
|
|
9664
9809
|
{ timestamps: true }
|
|
9665
9810
|
);
|
|
9666
|
-
|
|
9811
|
+
schema18.index(
|
|
9667
9812
|
{ affiliateCode: 1 },
|
|
9668
9813
|
{
|
|
9669
9814
|
partialFilterExpression: { active: true, deletedAt: null },
|
|
9670
9815
|
unique: true
|
|
9671
9816
|
}
|
|
9672
9817
|
);
|
|
9673
|
-
var AffiliateModel =
|
|
9674
|
-
|
|
9675
|
-
// src/mongoose/Coupon.ts
|
|
9676
|
-
var import_mongoose26 = __toESM(require("mongoose"));
|
|
9677
|
-
var MongooseSchema26 = import_mongoose26.default.Schema;
|
|
9678
|
-
var couponOptionSchema = new MongooseSchema26(
|
|
9679
|
-
{
|
|
9680
|
-
buy: { required: true, type: Number },
|
|
9681
|
-
get: { required: true, type: Number },
|
|
9682
|
-
unit: { required: true, type: String }
|
|
9683
|
-
},
|
|
9684
|
-
{ _id: false }
|
|
9685
|
-
);
|
|
9686
|
-
var couponCodeSchema = new MongooseSchema26(
|
|
9687
|
-
{
|
|
9688
|
-
code: { required: true, type: String },
|
|
9689
|
-
qrCode: { required: true, type: ResourceImageTypeSchema }
|
|
9690
|
-
},
|
|
9691
|
-
{ _id: false }
|
|
9692
|
-
);
|
|
9693
|
-
var couponParticipantUserSchema = new MongooseSchema26(
|
|
9694
|
-
{
|
|
9695
|
-
couponCount: { default: 0, required: true, type: Number },
|
|
9696
|
-
couponRedeemedAt: { default: null, required: false, type: Date },
|
|
9697
|
-
userId: {
|
|
9698
|
-
ref: "User",
|
|
9699
|
-
required: true,
|
|
9700
|
-
type: import_mongoose26.default.Schema.Types.ObjectId
|
|
9701
|
-
}
|
|
9702
|
-
},
|
|
9703
|
-
{ timestamps: true }
|
|
9704
|
-
);
|
|
9705
|
-
var productCouponSchema = new MongooseSchema26(
|
|
9706
|
-
{
|
|
9707
|
-
active: { default: true, required: true, type: Boolean },
|
|
9708
|
-
couponCode: { required: true, type: couponCodeSchema },
|
|
9709
|
-
couponDescription: { required: true, type: String },
|
|
9710
|
-
couponOption: { required: true, type: couponOptionSchema },
|
|
9711
|
-
endDate: { required: true, type: Date },
|
|
9712
|
-
participantProduct: { required: true, type: vendorProductTypeSchema },
|
|
9713
|
-
participantUsers: {
|
|
9714
|
-
default: null,
|
|
9715
|
-
required: false,
|
|
9716
|
-
type: [couponParticipantUserSchema]
|
|
9717
|
-
},
|
|
9718
|
-
startDate: { required: true, type: Date }
|
|
9719
|
-
},
|
|
9720
|
-
{ timestamps: true }
|
|
9721
|
-
);
|
|
9722
|
-
var schema18 = new MongooseSchema26(
|
|
9723
|
-
{
|
|
9724
|
-
active: { default: true, required: true, type: Boolean },
|
|
9725
|
-
deletedAt: { default: null, required: false, type: Date },
|
|
9726
|
-
productCoupons: { required: false, type: [productCouponSchema] }
|
|
9727
|
-
},
|
|
9728
|
-
{ timestamps: true }
|
|
9729
|
-
);
|
|
9730
|
-
var CouponModel = import_mongoose26.default.models.Coupon || import_mongoose26.default.model("Coupon", schema18);
|
|
9818
|
+
var AffiliateModel = import_mongoose26.default.models.Affiliate || import_mongoose26.default.model("Affiliate", schema18);
|
|
9731
9819
|
// Annotate the CommonJS export names for ESM import in node:
|
|
9732
9820
|
0 && (module.exports = {
|
|
9733
9821
|
APP_SETTINGS_ID,
|
|
@@ -9764,6 +9852,7 @@ var CouponModel = import_mongoose26.default.models.Coupon || import_mongoose26.d
|
|
|
9764
9852
|
dateTimeSchema,
|
|
9765
9853
|
locationGeoSchema,
|
|
9766
9854
|
locationsSchema,
|
|
9855
|
+
productCouponSchema,
|
|
9767
9856
|
refundPolicySchema,
|
|
9768
9857
|
relatedPostSchema,
|
|
9769
9858
|
relationDatesSchema,
|