@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/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,6 +5588,9 @@ 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
5596
|
name
|
|
@@ -5486,6 +5599,7 @@ var VENDOR_PRODUCT_LIST_FIELDS_FRAGMENT = gql`
|
|
|
5486
5599
|
productGroups
|
|
5487
5600
|
updatedAt
|
|
5488
5601
|
}
|
|
5602
|
+
${PRODUCT_COUPON_FIELDS_FRAGMENT}
|
|
5489
5603
|
`;
|
|
5490
5604
|
var VENDOR = gql`
|
|
5491
5605
|
fragment VendorFields on VendorType {
|
|
@@ -7787,79 +7901,6 @@ var ASSIGN_AFFILIATE_BONUS_REWARD_MUTATION = gql`
|
|
|
7787
7901
|
}
|
|
7788
7902
|
${AFFILIATE_FIELDS_FRAGMENT}
|
|
7789
7903
|
`;
|
|
7790
|
-
var COUPON_CODE_FIELDS_FRAGMENT = gql`
|
|
7791
|
-
fragment CouponCodeFields on CouponCodeType {
|
|
7792
|
-
code
|
|
7793
|
-
qrCode {
|
|
7794
|
-
...ResourceImageFields
|
|
7795
|
-
}
|
|
7796
|
-
}
|
|
7797
|
-
${RESOURCE_IMAGE_FIELDS_FRAGMENT}
|
|
7798
|
-
`;
|
|
7799
|
-
var COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT = gql`
|
|
7800
|
-
fragment CouponParticipantUserFields on CouponParticipantUserType {
|
|
7801
|
-
couponCount
|
|
7802
|
-
couponRedeemedAt
|
|
7803
|
-
createdAt
|
|
7804
|
-
updatedAt
|
|
7805
|
-
userId
|
|
7806
|
-
}
|
|
7807
|
-
`;
|
|
7808
|
-
var PRODUCT_COUPON_FIELDS_FRAGMENT = gql`
|
|
7809
|
-
fragment ProductCouponFields on ProductCouponType {
|
|
7810
|
-
_id
|
|
7811
|
-
active
|
|
7812
|
-
couponCode {
|
|
7813
|
-
...CouponCodeFields
|
|
7814
|
-
}
|
|
7815
|
-
couponDescription
|
|
7816
|
-
couponOption
|
|
7817
|
-
createdAt
|
|
7818
|
-
endDate
|
|
7819
|
-
participantProduct {
|
|
7820
|
-
...VendorProductListFields
|
|
7821
|
-
}
|
|
7822
|
-
participantUsers {
|
|
7823
|
-
...CouponParticipantUserFields
|
|
7824
|
-
}
|
|
7825
|
-
startDate
|
|
7826
|
-
updatedAt
|
|
7827
|
-
}
|
|
7828
|
-
${COUPON_CODE_FIELDS_FRAGMENT}
|
|
7829
|
-
${COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT}
|
|
7830
|
-
${VENDOR_PRODUCT_LIST_FIELDS_FRAGMENT}
|
|
7831
|
-
`;
|
|
7832
|
-
var COUPON = gql`
|
|
7833
|
-
fragment CouponFields on CouponType {
|
|
7834
|
-
_id
|
|
7835
|
-
active
|
|
7836
|
-
productCoupons {
|
|
7837
|
-
...ProductCouponFields
|
|
7838
|
-
}
|
|
7839
|
-
createdAt
|
|
7840
|
-
deletedAt
|
|
7841
|
-
updatedAt
|
|
7842
|
-
}
|
|
7843
|
-
${PRODUCT_COUPON_FIELDS_FRAGMENT}
|
|
7844
|
-
${COUPON_CODE_FIELDS_FRAGMENT}
|
|
7845
|
-
${COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT}
|
|
7846
|
-
`;
|
|
7847
|
-
var GET_COUPONS = gql`
|
|
7848
|
-
query getCoupons {
|
|
7849
|
-
coupons {
|
|
7850
|
-
...CouponFields
|
|
7851
|
-
}
|
|
7852
|
-
}
|
|
7853
|
-
${COUPON}
|
|
7854
|
-
`;
|
|
7855
|
-
var GET_COUPON = gql`
|
|
7856
|
-
query getCoupon($_id: ID!) {
|
|
7857
|
-
coupon(_id: $_id) {
|
|
7858
|
-
...CouponFields
|
|
7859
|
-
}
|
|
7860
|
-
}
|
|
7861
|
-
${COUPON}
|
|
7862
|
-
`;
|
|
7863
7904
|
var CREATE_COUPON_MUTATION = gql`
|
|
7864
7905
|
mutation createCoupon($input: CouponInputType!) {
|
|
7865
7906
|
createCoupon(input: $input) {
|
|
@@ -8559,7 +8600,7 @@ var baseResourceFields = {
|
|
|
8559
8600
|
logo: { required: false, type: ResourceImageTypeSchema },
|
|
8560
8601
|
name: { required: true, type: String },
|
|
8561
8602
|
owner: {
|
|
8562
|
-
required:
|
|
8603
|
+
required: true,
|
|
8563
8604
|
type: OwnerTypeSchema
|
|
8564
8605
|
},
|
|
8565
8606
|
posterUsage: { required: false, type: PosterUsageTypeSchema },
|
|
@@ -8976,26 +9017,132 @@ var schema8 = new MongooseSchema12(
|
|
|
8976
9017
|
var VerificationTokenModel = import_mongoose12.default.models.VerificationToken || import_mongoose12.default.model("VerificationToken", schema8);
|
|
8977
9018
|
|
|
8978
9019
|
// src/mongoose/vendor/Vendor.ts
|
|
9020
|
+
var import_mongoose14 = __toESM(require("mongoose"));
|
|
9021
|
+
|
|
9022
|
+
// src/mongoose/Coupon.ts
|
|
8979
9023
|
var import_mongoose13 = __toESM(require("mongoose"));
|
|
8980
9024
|
var MongooseSchema13 = import_mongoose13.default.Schema;
|
|
8981
|
-
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(
|
|
8982
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(
|
|
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 },
|
|
8983
9130
|
description: { required: false, type: String },
|
|
8984
|
-
name: { required:
|
|
8985
|
-
price: { required:
|
|
8986
|
-
priceUnit: { required:
|
|
9131
|
+
name: { required: true, type: String },
|
|
9132
|
+
price: { required: true, type: Number },
|
|
9133
|
+
priceUnit: { required: true, type: String },
|
|
8987
9134
|
productGroups: { required: false, type: [String] }
|
|
8988
9135
|
},
|
|
8989
9136
|
{ timestamps: true }
|
|
8990
9137
|
);
|
|
8991
|
-
var productWrapperSchema = new
|
|
9138
|
+
var productWrapperSchema = new MongooseSchema14(
|
|
8992
9139
|
{
|
|
8993
|
-
active: { default: false, type: Boolean },
|
|
9140
|
+
active: { default: false, required: true, type: Boolean },
|
|
8994
9141
|
productsList: { required: false, type: [vendorProductTypeSchema] }
|
|
8995
9142
|
},
|
|
8996
9143
|
{ _id: false }
|
|
8997
9144
|
);
|
|
8998
|
-
var calendarSchema = new
|
|
9145
|
+
var calendarSchema = new MongooseSchema14(
|
|
8999
9146
|
{
|
|
9000
9147
|
dateTime: {
|
|
9001
9148
|
dateStatus: {
|
|
@@ -9016,14 +9163,14 @@ var calendarSchema = new MongooseSchema13(
|
|
|
9016
9163
|
},
|
|
9017
9164
|
{ _id: false }
|
|
9018
9165
|
);
|
|
9019
|
-
var calendarWrapperSchema = new
|
|
9166
|
+
var calendarWrapperSchema = new MongooseSchema14(
|
|
9020
9167
|
{
|
|
9021
|
-
active: { default: false, type: Boolean },
|
|
9168
|
+
active: { default: false, required: true, type: Boolean },
|
|
9022
9169
|
calendarData: { required: false, type: [calendarSchema] }
|
|
9023
9170
|
},
|
|
9024
9171
|
{ _id: false }
|
|
9025
9172
|
);
|
|
9026
|
-
var
|
|
9173
|
+
var schema10 = new MongooseSchema14(
|
|
9027
9174
|
{
|
|
9028
9175
|
...baseResourceFields,
|
|
9029
9176
|
// Importing base resource fields from global.ts
|
|
@@ -9049,12 +9196,12 @@ var schema9 = new MongooseSchema13(
|
|
|
9049
9196
|
unregisteredVendorId: {
|
|
9050
9197
|
ref: "UnregisteredVendor",
|
|
9051
9198
|
required: false,
|
|
9052
|
-
type:
|
|
9199
|
+
type: import_mongoose14.default.Schema.Types.ObjectId
|
|
9053
9200
|
},
|
|
9054
9201
|
vendorInfoId: {
|
|
9055
9202
|
ref: "VendorInfo",
|
|
9056
9203
|
required: false,
|
|
9057
|
-
type:
|
|
9204
|
+
type: import_mongoose14.default.Schema.Types.ObjectId
|
|
9058
9205
|
},
|
|
9059
9206
|
vendorType: {
|
|
9060
9207
|
enum: Object.values(EnumVendorType),
|
|
@@ -9064,24 +9211,24 @@ var schema9 = new MongooseSchema13(
|
|
|
9064
9211
|
},
|
|
9065
9212
|
{ timestamps: true }
|
|
9066
9213
|
);
|
|
9067
|
-
|
|
9068
|
-
|
|
9069
|
-
|
|
9070
|
-
|
|
9071
|
-
|
|
9072
|
-
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);
|
|
9073
9220
|
|
|
9074
9221
|
// src/mongoose/vendor/VendorInfo.ts
|
|
9075
|
-
var
|
|
9076
|
-
var
|
|
9077
|
-
var AttributesSchema = new
|
|
9222
|
+
var import_mongoose15 = __toESM(require("mongoose"));
|
|
9223
|
+
var MongooseSchema15 = import_mongoose15.default.Schema;
|
|
9224
|
+
var AttributesSchema = new MongooseSchema15(
|
|
9078
9225
|
{
|
|
9079
9226
|
details: { required: false, type: String },
|
|
9080
9227
|
isRequired: { default: false, required: true, type: Boolean }
|
|
9081
9228
|
},
|
|
9082
9229
|
{ _id: false }
|
|
9083
9230
|
);
|
|
9084
|
-
var
|
|
9231
|
+
var schema11 = new MongooseSchema15(
|
|
9085
9232
|
{
|
|
9086
9233
|
active: { default: true, type: Boolean },
|
|
9087
9234
|
compliance: {
|
|
@@ -9116,28 +9263,28 @@ var schema10 = new MongooseSchema14(
|
|
|
9116
9263
|
vendorId: {
|
|
9117
9264
|
ref: "Vendor",
|
|
9118
9265
|
required: true,
|
|
9119
|
-
type:
|
|
9266
|
+
type: import_mongoose15.default.Schema.Types.ObjectId
|
|
9120
9267
|
}
|
|
9121
9268
|
},
|
|
9122
9269
|
{ timestamps: true }
|
|
9123
9270
|
);
|
|
9124
|
-
var VendorInfoModel =
|
|
9271
|
+
var VendorInfoModel = import_mongoose15.default.models.VendorInfo || import_mongoose15.default.model("VendorInfo", schema11);
|
|
9125
9272
|
|
|
9126
9273
|
// src/mongoose/vendor/UnregisteredVendor.ts
|
|
9127
|
-
var
|
|
9128
|
-
var
|
|
9129
|
-
var invitationSchema = new
|
|
9274
|
+
var import_mongoose16 = __toESM(require("mongoose"));
|
|
9275
|
+
var MongooseSchema16 = import_mongoose16.default.Schema;
|
|
9276
|
+
var invitationSchema = new MongooseSchema16(
|
|
9130
9277
|
{
|
|
9131
9278
|
dateTime: { required: true, type: [dateTimeSchema2] },
|
|
9132
9279
|
inviterId: {
|
|
9133
9280
|
ref: "Event",
|
|
9134
9281
|
required: true,
|
|
9135
|
-
type:
|
|
9282
|
+
type: import_mongoose16.default.Schema.Types.ObjectId
|
|
9136
9283
|
}
|
|
9137
9284
|
},
|
|
9138
9285
|
{ _id: false }
|
|
9139
9286
|
);
|
|
9140
|
-
var
|
|
9287
|
+
var schema12 = new MongooseSchema16(
|
|
9141
9288
|
{
|
|
9142
9289
|
active: { default: true, required: true, type: Boolean },
|
|
9143
9290
|
categoryIds: { required: true, type: [String] },
|
|
@@ -9146,7 +9293,7 @@ var schema11 = new MongooseSchema15(
|
|
|
9146
9293
|
claimedByUserId: {
|
|
9147
9294
|
ref: "User",
|
|
9148
9295
|
required: false,
|
|
9149
|
-
type:
|
|
9296
|
+
type: import_mongoose16.default.Schema.Types.ObjectId
|
|
9150
9297
|
},
|
|
9151
9298
|
claimInitiatedAt: { default: null, required: false, type: Date },
|
|
9152
9299
|
claimToken: { default: null, required: false, type: String },
|
|
@@ -9159,14 +9306,14 @@ var schema11 = new MongooseSchema15(
|
|
|
9159
9306
|
},
|
|
9160
9307
|
{ timestamps: true }
|
|
9161
9308
|
);
|
|
9162
|
-
|
|
9163
|
-
|
|
9164
|
-
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);
|
|
9165
9312
|
|
|
9166
9313
|
// src/mongoose/event/Event.ts
|
|
9167
|
-
var
|
|
9168
|
-
var
|
|
9169
|
-
var
|
|
9314
|
+
var import_mongoose17 = __toESM(require("mongoose"));
|
|
9315
|
+
var MongooseSchema17 = import_mongoose17.default.Schema;
|
|
9316
|
+
var schema13 = new MongooseSchema17(
|
|
9170
9317
|
{
|
|
9171
9318
|
...baseResourceFields,
|
|
9172
9319
|
// Importing base resource fields from global.ts
|
|
@@ -9175,7 +9322,7 @@ var schema12 = new MongooseSchema16(
|
|
|
9175
9322
|
eventInfoId: {
|
|
9176
9323
|
ref: "EventInfo",
|
|
9177
9324
|
required: false,
|
|
9178
|
-
type:
|
|
9325
|
+
type: import_mongoose17.default.Schema.Types.ObjectId
|
|
9179
9326
|
},
|
|
9180
9327
|
eventType: {
|
|
9181
9328
|
enum: Object.values(EnumEventType),
|
|
@@ -9204,20 +9351,20 @@ var schema12 = new MongooseSchema16(
|
|
|
9204
9351
|
},
|
|
9205
9352
|
{ timestamps: true }
|
|
9206
9353
|
);
|
|
9207
|
-
|
|
9208
|
-
|
|
9209
|
-
|
|
9210
|
-
|
|
9211
|
-
|
|
9212
|
-
|
|
9213
|
-
|
|
9214
|
-
|
|
9215
|
-
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);
|
|
9216
9363
|
|
|
9217
9364
|
// src/mongoose/Partner.ts
|
|
9218
|
-
var
|
|
9219
|
-
var
|
|
9220
|
-
var
|
|
9365
|
+
var import_mongoose18 = __toESM(require("mongoose"));
|
|
9366
|
+
var MongooseSchema18 = import_mongoose18.default.Schema;
|
|
9367
|
+
var schema14 = new MongooseSchema18(
|
|
9221
9368
|
{
|
|
9222
9369
|
...baseResourceFields,
|
|
9223
9370
|
location: {
|
|
@@ -9233,19 +9380,19 @@ var schema13 = new MongooseSchema17(
|
|
|
9233
9380
|
},
|
|
9234
9381
|
{ timestamps: true }
|
|
9235
9382
|
);
|
|
9236
|
-
|
|
9237
|
-
|
|
9238
|
-
|
|
9239
|
-
|
|
9240
|
-
|
|
9241
|
-
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);
|
|
9242
9389
|
|
|
9243
9390
|
// src/mongoose/Post.ts
|
|
9244
|
-
var
|
|
9245
|
-
var
|
|
9246
|
-
var contentSchema = new
|
|
9391
|
+
var import_mongoose19 = __toESM(require("mongoose"));
|
|
9392
|
+
var MongooseSchema19 = import_mongoose19.default.Schema;
|
|
9393
|
+
var contentSchema = new MongooseSchema19(
|
|
9247
9394
|
{
|
|
9248
|
-
contentData:
|
|
9395
|
+
contentData: import_mongoose19.Schema.Types.Mixed,
|
|
9249
9396
|
contentOrder: { required: true, type: Number },
|
|
9250
9397
|
contentType: {
|
|
9251
9398
|
enum: Object.values(EnumPostContentType),
|
|
@@ -9255,7 +9402,7 @@ var contentSchema = new MongooseSchema18(
|
|
|
9255
9402
|
},
|
|
9256
9403
|
{ _id: false }
|
|
9257
9404
|
);
|
|
9258
|
-
var resourceSchema = new
|
|
9405
|
+
var resourceSchema = new MongooseSchema19(
|
|
9259
9406
|
{
|
|
9260
9407
|
resourceId: { required: true, type: String },
|
|
9261
9408
|
resourceRegion: { required: true, type: String },
|
|
@@ -9268,7 +9415,7 @@ var resourceSchema = new MongooseSchema18(
|
|
|
9268
9415
|
},
|
|
9269
9416
|
{ _id: false }
|
|
9270
9417
|
);
|
|
9271
|
-
var
|
|
9418
|
+
var schema15 = new MongooseSchema19(
|
|
9272
9419
|
{
|
|
9273
9420
|
active: { default: false, required: true, type: Boolean },
|
|
9274
9421
|
approvedAt: { default: null, required: false, type: Date },
|
|
@@ -9299,16 +9446,16 @@ var schema14 = new MongooseSchema18(
|
|
|
9299
9446
|
},
|
|
9300
9447
|
{ timestamps: true }
|
|
9301
9448
|
);
|
|
9302
|
-
|
|
9303
|
-
|
|
9304
|
-
|
|
9305
|
-
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);
|
|
9306
9453
|
|
|
9307
9454
|
// src/mongoose/AppSetting.ts
|
|
9308
|
-
var
|
|
9309
|
-
var
|
|
9455
|
+
var import_mongoose20 = __toESM(require("mongoose"));
|
|
9456
|
+
var MongooseSchema20 = import_mongoose20.default.Schema;
|
|
9310
9457
|
var APP_SETTINGS_ID = "APP_SETTINGS_DOCUMENT_ID";
|
|
9311
|
-
var AppSettingSchema = new
|
|
9458
|
+
var AppSettingSchema = new MongooseSchema20(
|
|
9312
9459
|
{
|
|
9313
9460
|
activeSchoolsStudentCountTotal: {
|
|
9314
9461
|
default: 0,
|
|
@@ -9339,18 +9486,18 @@ var AppSettingSchema = new MongooseSchema19(
|
|
|
9339
9486
|
},
|
|
9340
9487
|
{ timestamps: true }
|
|
9341
9488
|
);
|
|
9342
|
-
var AppSettingModel =
|
|
9489
|
+
var AppSettingModel = import_mongoose20.default.models.AppSetting || import_mongoose20.default.model("AppSetting", AppSettingSchema);
|
|
9343
9490
|
|
|
9344
9491
|
// src/mongoose/game/Game.ts
|
|
9345
|
-
var
|
|
9492
|
+
var import_mongoose24 = __toESM(require("mongoose"));
|
|
9346
9493
|
|
|
9347
9494
|
// src/mongoose/game/DailyClue.ts
|
|
9348
|
-
var
|
|
9495
|
+
var import_mongoose22 = __toESM(require("mongoose"));
|
|
9349
9496
|
|
|
9350
9497
|
// src/mongoose/game/utils.ts
|
|
9351
|
-
var
|
|
9352
|
-
var
|
|
9353
|
-
var schemaGameDate = new
|
|
9498
|
+
var import_mongoose21 = __toESM(require("mongoose"));
|
|
9499
|
+
var MongooseSchema21 = import_mongoose21.default.Schema;
|
|
9500
|
+
var schemaGameDate = new MongooseSchema21(
|
|
9354
9501
|
{
|
|
9355
9502
|
endDate: { required: true, type: Date },
|
|
9356
9503
|
startDate: { required: true, type: Date }
|
|
@@ -9359,8 +9506,8 @@ var schemaGameDate = new MongooseSchema20(
|
|
|
9359
9506
|
);
|
|
9360
9507
|
|
|
9361
9508
|
// src/mongoose/game/DailyClue.ts
|
|
9362
|
-
var
|
|
9363
|
-
var schemaLetters = new
|
|
9509
|
+
var MongooseSchema22 = import_mongoose22.default.Schema;
|
|
9510
|
+
var schemaLetters = new MongooseSchema22(
|
|
9364
9511
|
{
|
|
9365
9512
|
collected: { required: false, type: [String] },
|
|
9366
9513
|
solutionShuffled: { required: true, type: [String] }
|
|
@@ -9368,14 +9515,14 @@ var schemaLetters = new MongooseSchema21(
|
|
|
9368
9515
|
},
|
|
9369
9516
|
{ _id: false }
|
|
9370
9517
|
);
|
|
9371
|
-
var schemaDailyClueBaseGame = new
|
|
9518
|
+
var schemaDailyClueBaseGame = new MongooseSchema22(
|
|
9372
9519
|
{
|
|
9373
9520
|
gameDate: { required: true, type: schemaGameDate },
|
|
9374
9521
|
gameSolution: { required: true, type: String }
|
|
9375
9522
|
},
|
|
9376
9523
|
{ _id: false }
|
|
9377
9524
|
);
|
|
9378
|
-
var schemaDailyClueGameData = new
|
|
9525
|
+
var schemaDailyClueGameData = new MongooseSchema22(
|
|
9379
9526
|
{
|
|
9380
9527
|
gameFields: { required: true, type: schemaDailyClueBaseGame },
|
|
9381
9528
|
lastFoundDate: { default: null, required: false, type: Date },
|
|
@@ -9390,9 +9537,9 @@ var schemaDailyClueGameData = new MongooseSchema21(
|
|
|
9390
9537
|
);
|
|
9391
9538
|
|
|
9392
9539
|
// src/mongoose/game/PuzzleGame.ts
|
|
9393
|
-
var
|
|
9394
|
-
var
|
|
9395
|
-
var schemaPuzzleAnswer = new
|
|
9540
|
+
var import_mongoose23 = __toESM(require("mongoose"));
|
|
9541
|
+
var MongooseSchema23 = import_mongoose23.default.Schema;
|
|
9542
|
+
var schemaPuzzleAnswer = new MongooseSchema23(
|
|
9396
9543
|
{
|
|
9397
9544
|
answer: { required: true, type: String },
|
|
9398
9545
|
answerId: { required: true, type: String },
|
|
@@ -9400,7 +9547,7 @@ var schemaPuzzleAnswer = new MongooseSchema22(
|
|
|
9400
9547
|
},
|
|
9401
9548
|
{ _id: false }
|
|
9402
9549
|
);
|
|
9403
|
-
var schemaPuzzleQuestion = new
|
|
9550
|
+
var schemaPuzzleQuestion = new MongooseSchema23(
|
|
9404
9551
|
{
|
|
9405
9552
|
answers: { required: true, type: [schemaPuzzleAnswer] },
|
|
9406
9553
|
question: { required: true, type: String },
|
|
@@ -9408,20 +9555,20 @@ var schemaPuzzleQuestion = new MongooseSchema22(
|
|
|
9408
9555
|
},
|
|
9409
9556
|
{ _id: false }
|
|
9410
9557
|
);
|
|
9411
|
-
var schemaPuzzleBaseGame = new
|
|
9558
|
+
var schemaPuzzleBaseGame = new MongooseSchema23(
|
|
9412
9559
|
{
|
|
9413
9560
|
questions: { required: true, type: [schemaPuzzleQuestion] }
|
|
9414
9561
|
},
|
|
9415
9562
|
{ _id: false }
|
|
9416
9563
|
);
|
|
9417
|
-
var schemaPuzzleAnsweredQuestion = new
|
|
9564
|
+
var schemaPuzzleAnsweredQuestion = new MongooseSchema23(
|
|
9418
9565
|
{
|
|
9419
9566
|
questionId: { required: true, type: String },
|
|
9420
9567
|
selectedAnswerId: { required: true, type: String }
|
|
9421
9568
|
},
|
|
9422
9569
|
{ _id: false }
|
|
9423
9570
|
);
|
|
9424
|
-
var schemaPuzzleGameData = new
|
|
9571
|
+
var schemaPuzzleGameData = new MongooseSchema23(
|
|
9425
9572
|
{
|
|
9426
9573
|
answeredQuestions: {
|
|
9427
9574
|
default: null,
|
|
@@ -9436,7 +9583,7 @@ var schemaPuzzleGameData = new MongooseSchema22(
|
|
|
9436
9583
|
);
|
|
9437
9584
|
|
|
9438
9585
|
// src/mongoose/game/Game.ts
|
|
9439
|
-
var
|
|
9586
|
+
var MongooseSchema24 = import_mongoose24.default.Schema;
|
|
9440
9587
|
var gameDataSchemas = {
|
|
9441
9588
|
[EnumGameType.DAILY_CLUE]: schemaDailyClueGameData,
|
|
9442
9589
|
[EnumGameType.MINI_QUIZ]: schemaPuzzleGameData,
|
|
@@ -9448,7 +9595,7 @@ var gameDataDefinition = Object.fromEntries(
|
|
|
9448
9595
|
{ default: null, required: false, type: schema19 }
|
|
9449
9596
|
])
|
|
9450
9597
|
);
|
|
9451
|
-
var gameHistorySchema = new
|
|
9598
|
+
var gameHistorySchema = new MongooseSchema24(
|
|
9452
9599
|
{
|
|
9453
9600
|
createdAt: { required: true, type: Date },
|
|
9454
9601
|
gameDate: { required: true, type: schemaGameDate },
|
|
@@ -9468,7 +9615,7 @@ var gameHistorySchema = new MongooseSchema23(
|
|
|
9468
9615
|
},
|
|
9469
9616
|
{ _id: false }
|
|
9470
9617
|
);
|
|
9471
|
-
var gameTypeSchema = new
|
|
9618
|
+
var gameTypeSchema = new MongooseSchema24(
|
|
9472
9619
|
{
|
|
9473
9620
|
active: { default: true, required: true, type: Boolean },
|
|
9474
9621
|
gameData: gameDataDefinition,
|
|
@@ -9483,7 +9630,7 @@ var gameTypeSchema = new MongooseSchema23(
|
|
|
9483
9630
|
},
|
|
9484
9631
|
{ timestamps: true }
|
|
9485
9632
|
);
|
|
9486
|
-
var
|
|
9633
|
+
var schema16 = new MongooseSchema24(
|
|
9487
9634
|
{
|
|
9488
9635
|
active: { default: false, required: true, type: Boolean },
|
|
9489
9636
|
deletedAt: { default: null, required: false, type: Date },
|
|
@@ -9496,12 +9643,12 @@ var schema15 = new MongooseSchema23(
|
|
|
9496
9643
|
},
|
|
9497
9644
|
{ timestamps: true }
|
|
9498
9645
|
);
|
|
9499
|
-
var GameModel =
|
|
9646
|
+
var GameModel = import_mongoose24.default.models.Game || import_mongoose24.default.model("Game", schema16);
|
|
9500
9647
|
|
|
9501
9648
|
// src/mongoose/School.ts
|
|
9502
|
-
var
|
|
9503
|
-
var
|
|
9504
|
-
var campaignsSchema = new
|
|
9649
|
+
var import_mongoose25 = __toESM(require("mongoose"));
|
|
9650
|
+
var MongooseSchema25 = import_mongoose25.default.Schema;
|
|
9651
|
+
var campaignsSchema = new MongooseSchema25(
|
|
9505
9652
|
{
|
|
9506
9653
|
endDate: { required: true, type: Date },
|
|
9507
9654
|
name: { required: true, type: String },
|
|
@@ -9509,7 +9656,7 @@ var campaignsSchema = new MongooseSchema24(
|
|
|
9509
9656
|
},
|
|
9510
9657
|
{ _id: false }
|
|
9511
9658
|
);
|
|
9512
|
-
var
|
|
9659
|
+
var schema17 = new MongooseSchema25(
|
|
9513
9660
|
{
|
|
9514
9661
|
// New schools are active by default
|
|
9515
9662
|
active: { default: false, required: true, type: Boolean },
|
|
@@ -9536,19 +9683,19 @@ var schema16 = new MongooseSchema24(
|
|
|
9536
9683
|
},
|
|
9537
9684
|
{ timestamps: true }
|
|
9538
9685
|
);
|
|
9539
|
-
|
|
9686
|
+
schema17.index(
|
|
9540
9687
|
{ schoolCode: 1 },
|
|
9541
9688
|
{
|
|
9542
9689
|
partialFilterExpression: { active: true, deletedAt: null },
|
|
9543
9690
|
unique: true
|
|
9544
9691
|
}
|
|
9545
9692
|
);
|
|
9546
|
-
var SchoolModel =
|
|
9693
|
+
var SchoolModel = import_mongoose25.default.models.School || import_mongoose25.default.model("School", schema17);
|
|
9547
9694
|
|
|
9548
9695
|
// src/mongoose/Affiliate.ts
|
|
9549
|
-
var
|
|
9550
|
-
var
|
|
9551
|
-
var affiliateRewardSchema = new
|
|
9696
|
+
var import_mongoose26 = __toESM(require("mongoose"));
|
|
9697
|
+
var MongooseSchema26 = import_mongoose26.default.Schema;
|
|
9698
|
+
var affiliateRewardSchema = new MongooseSchema26(
|
|
9552
9699
|
{
|
|
9553
9700
|
createdAt: { required: true, type: Date },
|
|
9554
9701
|
redeemedAt: { default: null, required: false, type: Date },
|
|
@@ -9562,13 +9709,13 @@ var affiliateRewardSchema = new MongooseSchema25(
|
|
|
9562
9709
|
},
|
|
9563
9710
|
{ _id: false }
|
|
9564
9711
|
);
|
|
9565
|
-
var affiliateResourceSchema = new
|
|
9712
|
+
var affiliateResourceSchema = new MongooseSchema26(
|
|
9566
9713
|
{
|
|
9567
9714
|
resourceActive: { default: true, required: true, type: Boolean },
|
|
9568
9715
|
resourceDeletedAt: { default: null, required: false, type: Date },
|
|
9569
9716
|
resourceId: {
|
|
9570
9717
|
required: true,
|
|
9571
|
-
type:
|
|
9718
|
+
type: import_mongoose26.default.Schema.Types.ObjectId
|
|
9572
9719
|
},
|
|
9573
9720
|
resourceName: { required: true, type: String },
|
|
9574
9721
|
resourceOwner: {
|
|
@@ -9588,20 +9735,20 @@ var affiliateResourceSchema = new MongooseSchema25(
|
|
|
9588
9735
|
},
|
|
9589
9736
|
{ _id: false }
|
|
9590
9737
|
);
|
|
9591
|
-
var affiliateContactDetailsSchema = new
|
|
9738
|
+
var affiliateContactDetailsSchema = new MongooseSchema26(
|
|
9592
9739
|
{
|
|
9593
9740
|
mobilePhone: { required: true, type: String }
|
|
9594
9741
|
},
|
|
9595
9742
|
{ _id: false }
|
|
9596
9743
|
);
|
|
9597
|
-
var affiliateBankAccountDetailsSchema = new
|
|
9744
|
+
var affiliateBankAccountDetailsSchema = new MongooseSchema26(
|
|
9598
9745
|
{
|
|
9599
9746
|
accountHolderName: { required: true, type: String },
|
|
9600
9747
|
accountNumber: { required: true, type: String }
|
|
9601
9748
|
},
|
|
9602
9749
|
{ _id: false }
|
|
9603
9750
|
);
|
|
9604
|
-
var affiliateDetailsSchema = new
|
|
9751
|
+
var affiliateDetailsSchema = new MongooseSchema26(
|
|
9605
9752
|
{
|
|
9606
9753
|
bankAccountDetails: {
|
|
9607
9754
|
required: true,
|
|
@@ -9623,7 +9770,7 @@ var affiliateDetailsSchema = new MongooseSchema25(
|
|
|
9623
9770
|
},
|
|
9624
9771
|
{ _id: false }
|
|
9625
9772
|
);
|
|
9626
|
-
var redeemHistorySchema = new
|
|
9773
|
+
var redeemHistorySchema = new MongooseSchema26(
|
|
9627
9774
|
{
|
|
9628
9775
|
paidAt: { default: null, required: false, type: Date },
|
|
9629
9776
|
redeemedAt: { required: true, type: Date },
|
|
@@ -9631,7 +9778,7 @@ var redeemHistorySchema = new MongooseSchema25(
|
|
|
9631
9778
|
},
|
|
9632
9779
|
{ _id: false }
|
|
9633
9780
|
);
|
|
9634
|
-
var
|
|
9781
|
+
var schema18 = new MongooseSchema26(
|
|
9635
9782
|
{
|
|
9636
9783
|
active: { default: false, required: true, type: Boolean },
|
|
9637
9784
|
affiliateBonusRewards: {
|
|
@@ -9661,71 +9808,14 @@ var schema17 = new MongooseSchema25(
|
|
|
9661
9808
|
},
|
|
9662
9809
|
{ timestamps: true }
|
|
9663
9810
|
);
|
|
9664
|
-
|
|
9811
|
+
schema18.index(
|
|
9665
9812
|
{ affiliateCode: 1 },
|
|
9666
9813
|
{
|
|
9667
9814
|
partialFilterExpression: { active: true, deletedAt: null },
|
|
9668
9815
|
unique: true
|
|
9669
9816
|
}
|
|
9670
9817
|
);
|
|
9671
|
-
var AffiliateModel =
|
|
9672
|
-
|
|
9673
|
-
// src/mongoose/Coupon.ts
|
|
9674
|
-
var import_mongoose26 = __toESM(require("mongoose"));
|
|
9675
|
-
var MongooseSchema26 = import_mongoose26.default.Schema;
|
|
9676
|
-
var couponOptionSchema = new MongooseSchema26(
|
|
9677
|
-
{
|
|
9678
|
-
buy: { required: true, type: Number },
|
|
9679
|
-
get: { required: true, type: Number },
|
|
9680
|
-
unit: { required: true, type: String }
|
|
9681
|
-
},
|
|
9682
|
-
{ _id: false }
|
|
9683
|
-
);
|
|
9684
|
-
var couponCodeSchema = new MongooseSchema26(
|
|
9685
|
-
{
|
|
9686
|
-
code: { required: true, type: String },
|
|
9687
|
-
qrCode: { required: true, type: ResourceImageTypeSchema }
|
|
9688
|
-
},
|
|
9689
|
-
{ _id: false }
|
|
9690
|
-
);
|
|
9691
|
-
var couponParticipantUserSchema = new MongooseSchema26(
|
|
9692
|
-
{
|
|
9693
|
-
couponCount: { default: 0, required: true, type: Number },
|
|
9694
|
-
couponRedeemedAt: { default: null, required: false, type: Date },
|
|
9695
|
-
userId: {
|
|
9696
|
-
ref: "User",
|
|
9697
|
-
required: true,
|
|
9698
|
-
type: import_mongoose26.default.Schema.Types.ObjectId
|
|
9699
|
-
}
|
|
9700
|
-
},
|
|
9701
|
-
{ timestamps: true }
|
|
9702
|
-
);
|
|
9703
|
-
var productCouponSchema = new MongooseSchema26(
|
|
9704
|
-
{
|
|
9705
|
-
active: { default: true, required: true, type: Boolean },
|
|
9706
|
-
couponCode: { required: true, type: couponCodeSchema },
|
|
9707
|
-
couponDescription: { required: true, type: String },
|
|
9708
|
-
couponOption: { required: true, type: couponOptionSchema },
|
|
9709
|
-
endDate: { required: true, type: Date },
|
|
9710
|
-
participantProduct: { required: true, type: vendorProductTypeSchema },
|
|
9711
|
-
participantUsers: {
|
|
9712
|
-
default: null,
|
|
9713
|
-
required: false,
|
|
9714
|
-
type: [couponParticipantUserSchema]
|
|
9715
|
-
},
|
|
9716
|
-
startDate: { required: true, type: Date }
|
|
9717
|
-
},
|
|
9718
|
-
{ timestamps: true }
|
|
9719
|
-
);
|
|
9720
|
-
var schema18 = new MongooseSchema26(
|
|
9721
|
-
{
|
|
9722
|
-
active: { default: true, required: true, type: Boolean },
|
|
9723
|
-
deletedAt: { default: null, required: false, type: Date },
|
|
9724
|
-
productCoupons: { required: false, type: [productCouponSchema] }
|
|
9725
|
-
},
|
|
9726
|
-
{ timestamps: true }
|
|
9727
|
-
);
|
|
9728
|
-
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);
|
|
9729
9819
|
// Annotate the CommonJS export names for ESM import in node:
|
|
9730
9820
|
0 && (module.exports = {
|
|
9731
9821
|
APP_SETTINGS_ID,
|
|
@@ -9762,6 +9852,7 @@ var CouponModel = import_mongoose26.default.models.Coupon || import_mongoose26.d
|
|
|
9762
9852
|
dateTimeSchema,
|
|
9763
9853
|
locationGeoSchema,
|
|
9764
9854
|
locationsSchema,
|
|
9855
|
+
productCouponSchema,
|
|
9765
9856
|
refundPolicySchema,
|
|
9766
9857
|
relatedPostSchema,
|
|
9767
9858
|
relationDatesSchema,
|