@timardex/cluemart-server-shared 1.1.16 → 1.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-7GXZS3LI.mjs → chunk-TDAUQKK7.mjs} +333 -238
- package/dist/chunk-TDAUQKK7.mjs.map +1 -0
- package/dist/index.cjs +334 -238
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +32 -9
- package/dist/index.d.ts +32 -9
- package/dist/index.mjs +332 -237
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs +332 -236
- package/dist/mongoose/index.cjs.map +1 -1
- package/dist/mongoose/index.d.mts +32 -9
- package/dist/mongoose/index.d.ts +32 -9
- package/dist/mongoose/index.mjs +3 -1
- package/dist/service/index.cjs +332 -238
- package/dist/service/index.cjs.map +1 -1
- package/dist/service/index.mjs +3 -3
- package/dist/service/index.mjs.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-7GXZS3LI.mjs.map +0 -1
package/dist/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,19 @@ 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
|
|
5598
|
+
priceMax
|
|
5486
5599
|
priceUnit
|
|
5487
5600
|
productGroups
|
|
5488
5601
|
updatedAt
|
|
5489
5602
|
}
|
|
5603
|
+
${PRODUCT_COUPON_FIELDS_FRAGMENT}
|
|
5490
5604
|
`;
|
|
5491
5605
|
var VENDOR = gql`
|
|
5492
5606
|
fragment VendorFields on VendorType {
|
|
@@ -7788,79 +7902,6 @@ var ASSIGN_AFFILIATE_BONUS_REWARD_MUTATION = gql`
|
|
|
7788
7902
|
}
|
|
7789
7903
|
${AFFILIATE_FIELDS_FRAGMENT}
|
|
7790
7904
|
`;
|
|
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
7905
|
var CREATE_COUPON_MUTATION = gql`
|
|
7865
7906
|
mutation createCoupon($input: CouponInputType!) {
|
|
7866
7907
|
createCoupon(input: $input) {
|
|
@@ -8560,7 +8601,7 @@ var baseResourceFields = {
|
|
|
8560
8601
|
logo: { required: false, type: ResourceImageTypeSchema },
|
|
8561
8602
|
name: { required: true, type: String },
|
|
8562
8603
|
owner: {
|
|
8563
|
-
required:
|
|
8604
|
+
required: true,
|
|
8564
8605
|
type: OwnerTypeSchema
|
|
8565
8606
|
},
|
|
8566
8607
|
posterUsage: { required: false, type: PosterUsageTypeSchema },
|
|
@@ -8857,6 +8898,11 @@ var schema7 = new MongooseSchema11(
|
|
|
8857
8898
|
required: false,
|
|
8858
8899
|
type: ResourceImageTypeSchema
|
|
8859
8900
|
},
|
|
8901
|
+
coupon: {
|
|
8902
|
+
ref: "Coupon",
|
|
8903
|
+
required: false,
|
|
8904
|
+
type: import_mongoose11.default.Schema.Types.ObjectId
|
|
8905
|
+
},
|
|
8860
8906
|
deletedAt: { default: null, required: false, type: Date },
|
|
8861
8907
|
email: { required: true, type: String },
|
|
8862
8908
|
emailSentFor: {
|
|
@@ -8977,27 +9023,133 @@ var schema8 = new MongooseSchema12(
|
|
|
8977
9023
|
var VerificationTokenModel = import_mongoose12.default.models.VerificationToken || import_mongoose12.default.model("VerificationToken", schema8);
|
|
8978
9024
|
|
|
8979
9025
|
// src/mongoose/vendor/Vendor.ts
|
|
9026
|
+
var import_mongoose14 = __toESM(require("mongoose"));
|
|
9027
|
+
|
|
9028
|
+
// src/mongoose/Coupon.ts
|
|
8980
9029
|
var import_mongoose13 = __toESM(require("mongoose"));
|
|
8981
9030
|
var MongooseSchema13 = import_mongoose13.default.Schema;
|
|
8982
|
-
var
|
|
9031
|
+
var productCouponSchema = new MongooseSchema13(
|
|
9032
|
+
{
|
|
9033
|
+
couponDocumentId: {
|
|
9034
|
+
ref: "Coupon",
|
|
9035
|
+
required: true,
|
|
9036
|
+
type: import_mongoose13.default.Schema.Types.ObjectId
|
|
9037
|
+
},
|
|
9038
|
+
couponId: {
|
|
9039
|
+
required: true,
|
|
9040
|
+
type: import_mongoose13.default.Schema.Types.ObjectId
|
|
9041
|
+
}
|
|
9042
|
+
},
|
|
9043
|
+
{ _id: false }
|
|
9044
|
+
);
|
|
9045
|
+
var couponOptionSchema = new MongooseSchema13(
|
|
9046
|
+
{
|
|
9047
|
+
buy: { required: false, type: Number },
|
|
9048
|
+
get: { required: false, type: Number },
|
|
9049
|
+
type: {
|
|
9050
|
+
enum: Object.values(EnumCouponQualificationType),
|
|
9051
|
+
required: true,
|
|
9052
|
+
type: String
|
|
9053
|
+
},
|
|
9054
|
+
unit: { required: false, type: String },
|
|
9055
|
+
visits: { required: false, type: Number }
|
|
9056
|
+
},
|
|
9057
|
+
{ _id: false }
|
|
9058
|
+
);
|
|
9059
|
+
var couponRewardSchema = new MongooseSchema13(
|
|
9060
|
+
{
|
|
9061
|
+
productId: {
|
|
9062
|
+
required: true,
|
|
9063
|
+
type: import_mongoose13.default.Schema.Types.ObjectId
|
|
9064
|
+
},
|
|
9065
|
+
quantity: { required: true, type: Number },
|
|
9066
|
+
unit: { required: true, type: String },
|
|
9067
|
+
vendorId: {
|
|
9068
|
+
ref: "Vendor",
|
|
9069
|
+
required: true,
|
|
9070
|
+
type: import_mongoose13.default.Schema.Types.ObjectId
|
|
9071
|
+
}
|
|
9072
|
+
},
|
|
9073
|
+
{ _id: false }
|
|
9074
|
+
);
|
|
9075
|
+
var couponCodeSchema = new MongooseSchema13(
|
|
8983
9076
|
{
|
|
9077
|
+
code: { required: true, type: String },
|
|
9078
|
+
qrCode: { required: true, type: ResourceImageTypeSchema }
|
|
9079
|
+
},
|
|
9080
|
+
{ _id: false }
|
|
9081
|
+
);
|
|
9082
|
+
var couponParticipantUserSchema = new MongooseSchema13(
|
|
9083
|
+
{
|
|
9084
|
+
couponCollectedCount: { default: 0, required: true, type: Number },
|
|
9085
|
+
couponRedeemedAt: { default: null, required: false, type: Date },
|
|
9086
|
+
userId: {
|
|
9087
|
+
ref: "User",
|
|
9088
|
+
required: true,
|
|
9089
|
+
type: import_mongoose13.default.Schema.Types.ObjectId
|
|
9090
|
+
}
|
|
9091
|
+
},
|
|
9092
|
+
{ timestamps: true }
|
|
9093
|
+
);
|
|
9094
|
+
var couponDataSchema = new MongooseSchema13(
|
|
9095
|
+
{
|
|
9096
|
+
active: { default: true, required: true, type: Boolean },
|
|
9097
|
+
couponCode: { required: true, type: couponCodeSchema },
|
|
9098
|
+
couponDescription: { required: true, type: String },
|
|
9099
|
+
couponOption: { required: true, type: couponOptionSchema },
|
|
9100
|
+
couponRewards: { required: false, type: [couponRewardSchema] },
|
|
9101
|
+
endDate: { required: true, type: Date },
|
|
9102
|
+
participantUsers: {
|
|
9103
|
+
default: null,
|
|
9104
|
+
required: false,
|
|
9105
|
+
type: [couponParticipantUserSchema]
|
|
9106
|
+
},
|
|
9107
|
+
resourceId: { required: true, type: String },
|
|
9108
|
+
resourceType: {
|
|
9109
|
+
enum: Object.values(EnumResourceType),
|
|
9110
|
+
required: true,
|
|
9111
|
+
type: String
|
|
9112
|
+
},
|
|
9113
|
+
startDate: { required: true, type: Date }
|
|
9114
|
+
},
|
|
9115
|
+
{ timestamps: true }
|
|
9116
|
+
);
|
|
9117
|
+
var schema9 = new MongooseSchema13(
|
|
9118
|
+
{
|
|
9119
|
+
active: { default: true, required: true, type: Boolean },
|
|
9120
|
+
couponData: { default: [], required: false, type: [couponDataSchema] },
|
|
9121
|
+
deletedAt: { default: null, required: false, type: Date },
|
|
9122
|
+
owner: {
|
|
9123
|
+
required: true,
|
|
9124
|
+
type: OwnerTypeSchema
|
|
9125
|
+
}
|
|
9126
|
+
},
|
|
9127
|
+
{ timestamps: true }
|
|
9128
|
+
);
|
|
9129
|
+
var CouponModel = import_mongoose13.default.models.Coupon || import_mongoose13.default.model("Coupon", schema9);
|
|
9130
|
+
|
|
9131
|
+
// src/mongoose/vendor/Vendor.ts
|
|
9132
|
+
var MongooseSchema14 = import_mongoose14.default.Schema;
|
|
9133
|
+
var vendorProductTypeSchema = new MongooseSchema14(
|
|
9134
|
+
{
|
|
9135
|
+
coupon: { required: false, type: productCouponSchema },
|
|
8984
9136
|
description: { required: false, type: String },
|
|
8985
|
-
hasCoupon: { default: false, required: false, type: Boolean },
|
|
8986
9137
|
name: { required: true, type: String },
|
|
8987
9138
|
price: { required: true, type: Number },
|
|
9139
|
+
priceMax: { required: false, type: Number },
|
|
8988
9140
|
priceUnit: { required: true, type: String },
|
|
8989
9141
|
productGroups: { required: false, type: [String] }
|
|
8990
9142
|
},
|
|
8991
9143
|
{ timestamps: true }
|
|
8992
9144
|
);
|
|
8993
|
-
var productWrapperSchema = new
|
|
9145
|
+
var productWrapperSchema = new MongooseSchema14(
|
|
8994
9146
|
{
|
|
8995
9147
|
active: { default: false, required: true, type: Boolean },
|
|
8996
9148
|
productsList: { required: false, type: [vendorProductTypeSchema] }
|
|
8997
9149
|
},
|
|
8998
9150
|
{ _id: false }
|
|
8999
9151
|
);
|
|
9000
|
-
var calendarSchema = new
|
|
9152
|
+
var calendarSchema = new MongooseSchema14(
|
|
9001
9153
|
{
|
|
9002
9154
|
dateTime: {
|
|
9003
9155
|
dateStatus: {
|
|
@@ -9018,14 +9170,14 @@ var calendarSchema = new MongooseSchema13(
|
|
|
9018
9170
|
},
|
|
9019
9171
|
{ _id: false }
|
|
9020
9172
|
);
|
|
9021
|
-
var calendarWrapperSchema = new
|
|
9173
|
+
var calendarWrapperSchema = new MongooseSchema14(
|
|
9022
9174
|
{
|
|
9023
9175
|
active: { default: false, required: true, type: Boolean },
|
|
9024
9176
|
calendarData: { required: false, type: [calendarSchema] }
|
|
9025
9177
|
},
|
|
9026
9178
|
{ _id: false }
|
|
9027
9179
|
);
|
|
9028
|
-
var
|
|
9180
|
+
var schema10 = new MongooseSchema14(
|
|
9029
9181
|
{
|
|
9030
9182
|
...baseResourceFields,
|
|
9031
9183
|
// Importing base resource fields from global.ts
|
|
@@ -9051,12 +9203,12 @@ var schema9 = new MongooseSchema13(
|
|
|
9051
9203
|
unregisteredVendorId: {
|
|
9052
9204
|
ref: "UnregisteredVendor",
|
|
9053
9205
|
required: false,
|
|
9054
|
-
type:
|
|
9206
|
+
type: import_mongoose14.default.Schema.Types.ObjectId
|
|
9055
9207
|
},
|
|
9056
9208
|
vendorInfoId: {
|
|
9057
9209
|
ref: "VendorInfo",
|
|
9058
9210
|
required: false,
|
|
9059
|
-
type:
|
|
9211
|
+
type: import_mongoose14.default.Schema.Types.ObjectId
|
|
9060
9212
|
},
|
|
9061
9213
|
vendorType: {
|
|
9062
9214
|
enum: Object.values(EnumVendorType),
|
|
@@ -9066,24 +9218,24 @@ var schema9 = new MongooseSchema13(
|
|
|
9066
9218
|
},
|
|
9067
9219
|
{ timestamps: true }
|
|
9068
9220
|
);
|
|
9069
|
-
|
|
9070
|
-
|
|
9071
|
-
|
|
9072
|
-
|
|
9073
|
-
|
|
9074
|
-
var VendorModel =
|
|
9221
|
+
schema10.index({ name: 1 });
|
|
9222
|
+
schema10.index({ description: 1 });
|
|
9223
|
+
schema10.index({ region: 1 });
|
|
9224
|
+
schema10.index({ "categories.name": 1 });
|
|
9225
|
+
schema10.index({ slug: 1 });
|
|
9226
|
+
var VendorModel = import_mongoose14.default.models.Vendor || import_mongoose14.default.model("Vendor", schema10);
|
|
9075
9227
|
|
|
9076
9228
|
// src/mongoose/vendor/VendorInfo.ts
|
|
9077
|
-
var
|
|
9078
|
-
var
|
|
9079
|
-
var AttributesSchema = new
|
|
9229
|
+
var import_mongoose15 = __toESM(require("mongoose"));
|
|
9230
|
+
var MongooseSchema15 = import_mongoose15.default.Schema;
|
|
9231
|
+
var AttributesSchema = new MongooseSchema15(
|
|
9080
9232
|
{
|
|
9081
9233
|
details: { required: false, type: String },
|
|
9082
9234
|
isRequired: { default: false, required: true, type: Boolean }
|
|
9083
9235
|
},
|
|
9084
9236
|
{ _id: false }
|
|
9085
9237
|
);
|
|
9086
|
-
var
|
|
9238
|
+
var schema11 = new MongooseSchema15(
|
|
9087
9239
|
{
|
|
9088
9240
|
active: { default: true, type: Boolean },
|
|
9089
9241
|
compliance: {
|
|
@@ -9118,28 +9270,28 @@ var schema10 = new MongooseSchema14(
|
|
|
9118
9270
|
vendorId: {
|
|
9119
9271
|
ref: "Vendor",
|
|
9120
9272
|
required: true,
|
|
9121
|
-
type:
|
|
9273
|
+
type: import_mongoose15.default.Schema.Types.ObjectId
|
|
9122
9274
|
}
|
|
9123
9275
|
},
|
|
9124
9276
|
{ timestamps: true }
|
|
9125
9277
|
);
|
|
9126
|
-
var VendorInfoModel =
|
|
9278
|
+
var VendorInfoModel = import_mongoose15.default.models.VendorInfo || import_mongoose15.default.model("VendorInfo", schema11);
|
|
9127
9279
|
|
|
9128
9280
|
// src/mongoose/vendor/UnregisteredVendor.ts
|
|
9129
|
-
var
|
|
9130
|
-
var
|
|
9131
|
-
var invitationSchema = new
|
|
9281
|
+
var import_mongoose16 = __toESM(require("mongoose"));
|
|
9282
|
+
var MongooseSchema16 = import_mongoose16.default.Schema;
|
|
9283
|
+
var invitationSchema = new MongooseSchema16(
|
|
9132
9284
|
{
|
|
9133
9285
|
dateTime: { required: true, type: [dateTimeSchema2] },
|
|
9134
9286
|
inviterId: {
|
|
9135
9287
|
ref: "Event",
|
|
9136
9288
|
required: true,
|
|
9137
|
-
type:
|
|
9289
|
+
type: import_mongoose16.default.Schema.Types.ObjectId
|
|
9138
9290
|
}
|
|
9139
9291
|
},
|
|
9140
9292
|
{ _id: false }
|
|
9141
9293
|
);
|
|
9142
|
-
var
|
|
9294
|
+
var schema12 = new MongooseSchema16(
|
|
9143
9295
|
{
|
|
9144
9296
|
active: { default: true, required: true, type: Boolean },
|
|
9145
9297
|
categoryIds: { required: true, type: [String] },
|
|
@@ -9148,7 +9300,7 @@ var schema11 = new MongooseSchema15(
|
|
|
9148
9300
|
claimedByUserId: {
|
|
9149
9301
|
ref: "User",
|
|
9150
9302
|
required: false,
|
|
9151
|
-
type:
|
|
9303
|
+
type: import_mongoose16.default.Schema.Types.ObjectId
|
|
9152
9304
|
},
|
|
9153
9305
|
claimInitiatedAt: { default: null, required: false, type: Date },
|
|
9154
9306
|
claimToken: { default: null, required: false, type: String },
|
|
@@ -9161,14 +9313,14 @@ var schema11 = new MongooseSchema15(
|
|
|
9161
9313
|
},
|
|
9162
9314
|
{ timestamps: true }
|
|
9163
9315
|
);
|
|
9164
|
-
|
|
9165
|
-
|
|
9166
|
-
var UnregisteredVendorModel =
|
|
9316
|
+
schema12.index({ name: 1 });
|
|
9317
|
+
schema12.index({ email: 1 });
|
|
9318
|
+
var UnregisteredVendorModel = import_mongoose16.default.models.UnregisteredVendor || import_mongoose16.default.model("UnregisteredVendor", schema12);
|
|
9167
9319
|
|
|
9168
9320
|
// src/mongoose/event/Event.ts
|
|
9169
|
-
var
|
|
9170
|
-
var
|
|
9171
|
-
var
|
|
9321
|
+
var import_mongoose17 = __toESM(require("mongoose"));
|
|
9322
|
+
var MongooseSchema17 = import_mongoose17.default.Schema;
|
|
9323
|
+
var schema13 = new MongooseSchema17(
|
|
9172
9324
|
{
|
|
9173
9325
|
...baseResourceFields,
|
|
9174
9326
|
// Importing base resource fields from global.ts
|
|
@@ -9177,7 +9329,7 @@ var schema12 = new MongooseSchema16(
|
|
|
9177
9329
|
eventInfoId: {
|
|
9178
9330
|
ref: "EventInfo",
|
|
9179
9331
|
required: false,
|
|
9180
|
-
type:
|
|
9332
|
+
type: import_mongoose17.default.Schema.Types.ObjectId
|
|
9181
9333
|
},
|
|
9182
9334
|
eventType: {
|
|
9183
9335
|
enum: Object.values(EnumEventType),
|
|
@@ -9206,20 +9358,20 @@ var schema12 = new MongooseSchema16(
|
|
|
9206
9358
|
},
|
|
9207
9359
|
{ timestamps: true }
|
|
9208
9360
|
);
|
|
9209
|
-
|
|
9210
|
-
|
|
9211
|
-
|
|
9212
|
-
|
|
9213
|
-
|
|
9214
|
-
|
|
9215
|
-
|
|
9216
|
-
|
|
9217
|
-
var EventModel =
|
|
9361
|
+
schema13.index({ name: 1 });
|
|
9362
|
+
schema13.index({ description: 1 });
|
|
9363
|
+
schema13.index({ region: 1 });
|
|
9364
|
+
schema13.index({ "location.geo": "2dsphere" });
|
|
9365
|
+
schema13.index({ tags: 1 });
|
|
9366
|
+
schema13.index({ deletedAt: 1 });
|
|
9367
|
+
schema13.index({ "dateTime.dateStatus": 1 });
|
|
9368
|
+
schema13.index({ slug: 1 });
|
|
9369
|
+
var EventModel = import_mongoose17.default.models.Event || import_mongoose17.default.model("Event", schema13);
|
|
9218
9370
|
|
|
9219
9371
|
// src/mongoose/Partner.ts
|
|
9220
|
-
var
|
|
9221
|
-
var
|
|
9222
|
-
var
|
|
9372
|
+
var import_mongoose18 = __toESM(require("mongoose"));
|
|
9373
|
+
var MongooseSchema18 = import_mongoose18.default.Schema;
|
|
9374
|
+
var schema14 = new MongooseSchema18(
|
|
9223
9375
|
{
|
|
9224
9376
|
...baseResourceFields,
|
|
9225
9377
|
location: {
|
|
@@ -9235,19 +9387,19 @@ var schema13 = new MongooseSchema17(
|
|
|
9235
9387
|
},
|
|
9236
9388
|
{ timestamps: true }
|
|
9237
9389
|
);
|
|
9238
|
-
|
|
9239
|
-
|
|
9240
|
-
|
|
9241
|
-
|
|
9242
|
-
|
|
9243
|
-
var PartnerModel =
|
|
9390
|
+
schema14.index({ name: 1 });
|
|
9391
|
+
schema14.index({ description: 1 });
|
|
9392
|
+
schema14.index({ region: 1 });
|
|
9393
|
+
schema14.index({ "location.geo": "2dsphere" });
|
|
9394
|
+
schema14.index({ slug: 1 });
|
|
9395
|
+
var PartnerModel = import_mongoose18.default.models.Partner || import_mongoose18.default.model("Partner", schema14);
|
|
9244
9396
|
|
|
9245
9397
|
// src/mongoose/Post.ts
|
|
9246
|
-
var
|
|
9247
|
-
var
|
|
9248
|
-
var contentSchema = new
|
|
9398
|
+
var import_mongoose19 = __toESM(require("mongoose"));
|
|
9399
|
+
var MongooseSchema19 = import_mongoose19.default.Schema;
|
|
9400
|
+
var contentSchema = new MongooseSchema19(
|
|
9249
9401
|
{
|
|
9250
|
-
contentData:
|
|
9402
|
+
contentData: import_mongoose19.Schema.Types.Mixed,
|
|
9251
9403
|
contentOrder: { required: true, type: Number },
|
|
9252
9404
|
contentType: {
|
|
9253
9405
|
enum: Object.values(EnumPostContentType),
|
|
@@ -9257,7 +9409,7 @@ var contentSchema = new MongooseSchema18(
|
|
|
9257
9409
|
},
|
|
9258
9410
|
{ _id: false }
|
|
9259
9411
|
);
|
|
9260
|
-
var resourceSchema = new
|
|
9412
|
+
var resourceSchema = new MongooseSchema19(
|
|
9261
9413
|
{
|
|
9262
9414
|
resourceId: { required: true, type: String },
|
|
9263
9415
|
resourceRegion: { required: true, type: String },
|
|
@@ -9270,7 +9422,7 @@ var resourceSchema = new MongooseSchema18(
|
|
|
9270
9422
|
},
|
|
9271
9423
|
{ _id: false }
|
|
9272
9424
|
);
|
|
9273
|
-
var
|
|
9425
|
+
var schema15 = new MongooseSchema19(
|
|
9274
9426
|
{
|
|
9275
9427
|
active: { default: false, required: true, type: Boolean },
|
|
9276
9428
|
approvedAt: { default: null, required: false, type: Date },
|
|
@@ -9301,16 +9453,16 @@ var schema14 = new MongooseSchema18(
|
|
|
9301
9453
|
},
|
|
9302
9454
|
{ timestamps: true }
|
|
9303
9455
|
);
|
|
9304
|
-
|
|
9305
|
-
|
|
9306
|
-
|
|
9307
|
-
var PostModel =
|
|
9456
|
+
schema15.index({ title: 1 });
|
|
9457
|
+
schema15.index({ tags: 1 });
|
|
9458
|
+
schema15.index({ postType: 1, slug: 1 }, { unique: true });
|
|
9459
|
+
var PostModel = import_mongoose19.default.models.Post || import_mongoose19.default.model("Post", schema15);
|
|
9308
9460
|
|
|
9309
9461
|
// src/mongoose/AppSetting.ts
|
|
9310
|
-
var
|
|
9311
|
-
var
|
|
9462
|
+
var import_mongoose20 = __toESM(require("mongoose"));
|
|
9463
|
+
var MongooseSchema20 = import_mongoose20.default.Schema;
|
|
9312
9464
|
var APP_SETTINGS_ID = "APP_SETTINGS_DOCUMENT_ID";
|
|
9313
|
-
var AppSettingSchema = new
|
|
9465
|
+
var AppSettingSchema = new MongooseSchema20(
|
|
9314
9466
|
{
|
|
9315
9467
|
activeSchoolsStudentCountTotal: {
|
|
9316
9468
|
default: 0,
|
|
@@ -9341,18 +9493,18 @@ var AppSettingSchema = new MongooseSchema19(
|
|
|
9341
9493
|
},
|
|
9342
9494
|
{ timestamps: true }
|
|
9343
9495
|
);
|
|
9344
|
-
var AppSettingModel =
|
|
9496
|
+
var AppSettingModel = import_mongoose20.default.models.AppSetting || import_mongoose20.default.model("AppSetting", AppSettingSchema);
|
|
9345
9497
|
|
|
9346
9498
|
// src/mongoose/game/Game.ts
|
|
9347
|
-
var
|
|
9499
|
+
var import_mongoose24 = __toESM(require("mongoose"));
|
|
9348
9500
|
|
|
9349
9501
|
// src/mongoose/game/DailyClue.ts
|
|
9350
|
-
var
|
|
9502
|
+
var import_mongoose22 = __toESM(require("mongoose"));
|
|
9351
9503
|
|
|
9352
9504
|
// src/mongoose/game/utils.ts
|
|
9353
|
-
var
|
|
9354
|
-
var
|
|
9355
|
-
var schemaGameDate = new
|
|
9505
|
+
var import_mongoose21 = __toESM(require("mongoose"));
|
|
9506
|
+
var MongooseSchema21 = import_mongoose21.default.Schema;
|
|
9507
|
+
var schemaGameDate = new MongooseSchema21(
|
|
9356
9508
|
{
|
|
9357
9509
|
endDate: { required: true, type: Date },
|
|
9358
9510
|
startDate: { required: true, type: Date }
|
|
@@ -9361,8 +9513,8 @@ var schemaGameDate = new MongooseSchema20(
|
|
|
9361
9513
|
);
|
|
9362
9514
|
|
|
9363
9515
|
// src/mongoose/game/DailyClue.ts
|
|
9364
|
-
var
|
|
9365
|
-
var schemaLetters = new
|
|
9516
|
+
var MongooseSchema22 = import_mongoose22.default.Schema;
|
|
9517
|
+
var schemaLetters = new MongooseSchema22(
|
|
9366
9518
|
{
|
|
9367
9519
|
collected: { required: false, type: [String] },
|
|
9368
9520
|
solutionShuffled: { required: true, type: [String] }
|
|
@@ -9370,14 +9522,14 @@ var schemaLetters = new MongooseSchema21(
|
|
|
9370
9522
|
},
|
|
9371
9523
|
{ _id: false }
|
|
9372
9524
|
);
|
|
9373
|
-
var schemaDailyClueBaseGame = new
|
|
9525
|
+
var schemaDailyClueBaseGame = new MongooseSchema22(
|
|
9374
9526
|
{
|
|
9375
9527
|
gameDate: { required: true, type: schemaGameDate },
|
|
9376
9528
|
gameSolution: { required: true, type: String }
|
|
9377
9529
|
},
|
|
9378
9530
|
{ _id: false }
|
|
9379
9531
|
);
|
|
9380
|
-
var schemaDailyClueGameData = new
|
|
9532
|
+
var schemaDailyClueGameData = new MongooseSchema22(
|
|
9381
9533
|
{
|
|
9382
9534
|
gameFields: { required: true, type: schemaDailyClueBaseGame },
|
|
9383
9535
|
lastFoundDate: { default: null, required: false, type: Date },
|
|
@@ -9392,9 +9544,9 @@ var schemaDailyClueGameData = new MongooseSchema21(
|
|
|
9392
9544
|
);
|
|
9393
9545
|
|
|
9394
9546
|
// src/mongoose/game/PuzzleGame.ts
|
|
9395
|
-
var
|
|
9396
|
-
var
|
|
9397
|
-
var schemaPuzzleAnswer = new
|
|
9547
|
+
var import_mongoose23 = __toESM(require("mongoose"));
|
|
9548
|
+
var MongooseSchema23 = import_mongoose23.default.Schema;
|
|
9549
|
+
var schemaPuzzleAnswer = new MongooseSchema23(
|
|
9398
9550
|
{
|
|
9399
9551
|
answer: { required: true, type: String },
|
|
9400
9552
|
answerId: { required: true, type: String },
|
|
@@ -9402,7 +9554,7 @@ var schemaPuzzleAnswer = new MongooseSchema22(
|
|
|
9402
9554
|
},
|
|
9403
9555
|
{ _id: false }
|
|
9404
9556
|
);
|
|
9405
|
-
var schemaPuzzleQuestion = new
|
|
9557
|
+
var schemaPuzzleQuestion = new MongooseSchema23(
|
|
9406
9558
|
{
|
|
9407
9559
|
answers: { required: true, type: [schemaPuzzleAnswer] },
|
|
9408
9560
|
question: { required: true, type: String },
|
|
@@ -9410,20 +9562,20 @@ var schemaPuzzleQuestion = new MongooseSchema22(
|
|
|
9410
9562
|
},
|
|
9411
9563
|
{ _id: false }
|
|
9412
9564
|
);
|
|
9413
|
-
var schemaPuzzleBaseGame = new
|
|
9565
|
+
var schemaPuzzleBaseGame = new MongooseSchema23(
|
|
9414
9566
|
{
|
|
9415
9567
|
questions: { required: true, type: [schemaPuzzleQuestion] }
|
|
9416
9568
|
},
|
|
9417
9569
|
{ _id: false }
|
|
9418
9570
|
);
|
|
9419
|
-
var schemaPuzzleAnsweredQuestion = new
|
|
9571
|
+
var schemaPuzzleAnsweredQuestion = new MongooseSchema23(
|
|
9420
9572
|
{
|
|
9421
9573
|
questionId: { required: true, type: String },
|
|
9422
9574
|
selectedAnswerId: { required: true, type: String }
|
|
9423
9575
|
},
|
|
9424
9576
|
{ _id: false }
|
|
9425
9577
|
);
|
|
9426
|
-
var schemaPuzzleGameData = new
|
|
9578
|
+
var schemaPuzzleGameData = new MongooseSchema23(
|
|
9427
9579
|
{
|
|
9428
9580
|
answeredQuestions: {
|
|
9429
9581
|
default: null,
|
|
@@ -9438,7 +9590,7 @@ var schemaPuzzleGameData = new MongooseSchema22(
|
|
|
9438
9590
|
);
|
|
9439
9591
|
|
|
9440
9592
|
// src/mongoose/game/Game.ts
|
|
9441
|
-
var
|
|
9593
|
+
var MongooseSchema24 = import_mongoose24.default.Schema;
|
|
9442
9594
|
var gameDataSchemas = {
|
|
9443
9595
|
[EnumGameType.DAILY_CLUE]: schemaDailyClueGameData,
|
|
9444
9596
|
[EnumGameType.MINI_QUIZ]: schemaPuzzleGameData,
|
|
@@ -9450,7 +9602,7 @@ var gameDataDefinition = Object.fromEntries(
|
|
|
9450
9602
|
{ default: null, required: false, type: schema19 }
|
|
9451
9603
|
])
|
|
9452
9604
|
);
|
|
9453
|
-
var gameHistorySchema = new
|
|
9605
|
+
var gameHistorySchema = new MongooseSchema24(
|
|
9454
9606
|
{
|
|
9455
9607
|
createdAt: { required: true, type: Date },
|
|
9456
9608
|
gameDate: { required: true, type: schemaGameDate },
|
|
@@ -9470,7 +9622,7 @@ var gameHistorySchema = new MongooseSchema23(
|
|
|
9470
9622
|
},
|
|
9471
9623
|
{ _id: false }
|
|
9472
9624
|
);
|
|
9473
|
-
var gameTypeSchema = new
|
|
9625
|
+
var gameTypeSchema = new MongooseSchema24(
|
|
9474
9626
|
{
|
|
9475
9627
|
active: { default: true, required: true, type: Boolean },
|
|
9476
9628
|
gameData: gameDataDefinition,
|
|
@@ -9485,7 +9637,7 @@ var gameTypeSchema = new MongooseSchema23(
|
|
|
9485
9637
|
},
|
|
9486
9638
|
{ timestamps: true }
|
|
9487
9639
|
);
|
|
9488
|
-
var
|
|
9640
|
+
var schema16 = new MongooseSchema24(
|
|
9489
9641
|
{
|
|
9490
9642
|
active: { default: false, required: true, type: Boolean },
|
|
9491
9643
|
deletedAt: { default: null, required: false, type: Date },
|
|
@@ -9498,12 +9650,12 @@ var schema15 = new MongooseSchema23(
|
|
|
9498
9650
|
},
|
|
9499
9651
|
{ timestamps: true }
|
|
9500
9652
|
);
|
|
9501
|
-
var GameModel =
|
|
9653
|
+
var GameModel = import_mongoose24.default.models.Game || import_mongoose24.default.model("Game", schema16);
|
|
9502
9654
|
|
|
9503
9655
|
// src/mongoose/School.ts
|
|
9504
|
-
var
|
|
9505
|
-
var
|
|
9506
|
-
var campaignsSchema = new
|
|
9656
|
+
var import_mongoose25 = __toESM(require("mongoose"));
|
|
9657
|
+
var MongooseSchema25 = import_mongoose25.default.Schema;
|
|
9658
|
+
var campaignsSchema = new MongooseSchema25(
|
|
9507
9659
|
{
|
|
9508
9660
|
endDate: { required: true, type: Date },
|
|
9509
9661
|
name: { required: true, type: String },
|
|
@@ -9511,7 +9663,7 @@ var campaignsSchema = new MongooseSchema24(
|
|
|
9511
9663
|
},
|
|
9512
9664
|
{ _id: false }
|
|
9513
9665
|
);
|
|
9514
|
-
var
|
|
9666
|
+
var schema17 = new MongooseSchema25(
|
|
9515
9667
|
{
|
|
9516
9668
|
// New schools are active by default
|
|
9517
9669
|
active: { default: false, required: true, type: Boolean },
|
|
@@ -9538,19 +9690,19 @@ var schema16 = new MongooseSchema24(
|
|
|
9538
9690
|
},
|
|
9539
9691
|
{ timestamps: true }
|
|
9540
9692
|
);
|
|
9541
|
-
|
|
9693
|
+
schema17.index(
|
|
9542
9694
|
{ schoolCode: 1 },
|
|
9543
9695
|
{
|
|
9544
9696
|
partialFilterExpression: { active: true, deletedAt: null },
|
|
9545
9697
|
unique: true
|
|
9546
9698
|
}
|
|
9547
9699
|
);
|
|
9548
|
-
var SchoolModel =
|
|
9700
|
+
var SchoolModel = import_mongoose25.default.models.School || import_mongoose25.default.model("School", schema17);
|
|
9549
9701
|
|
|
9550
9702
|
// src/mongoose/Affiliate.ts
|
|
9551
|
-
var
|
|
9552
|
-
var
|
|
9553
|
-
var affiliateRewardSchema = new
|
|
9703
|
+
var import_mongoose26 = __toESM(require("mongoose"));
|
|
9704
|
+
var MongooseSchema26 = import_mongoose26.default.Schema;
|
|
9705
|
+
var affiliateRewardSchema = new MongooseSchema26(
|
|
9554
9706
|
{
|
|
9555
9707
|
createdAt: { required: true, type: Date },
|
|
9556
9708
|
redeemedAt: { default: null, required: false, type: Date },
|
|
@@ -9564,13 +9716,13 @@ var affiliateRewardSchema = new MongooseSchema25(
|
|
|
9564
9716
|
},
|
|
9565
9717
|
{ _id: false }
|
|
9566
9718
|
);
|
|
9567
|
-
var affiliateResourceSchema = new
|
|
9719
|
+
var affiliateResourceSchema = new MongooseSchema26(
|
|
9568
9720
|
{
|
|
9569
9721
|
resourceActive: { default: true, required: true, type: Boolean },
|
|
9570
9722
|
resourceDeletedAt: { default: null, required: false, type: Date },
|
|
9571
9723
|
resourceId: {
|
|
9572
9724
|
required: true,
|
|
9573
|
-
type:
|
|
9725
|
+
type: import_mongoose26.default.Schema.Types.ObjectId
|
|
9574
9726
|
},
|
|
9575
9727
|
resourceName: { required: true, type: String },
|
|
9576
9728
|
resourceOwner: {
|
|
@@ -9590,20 +9742,20 @@ var affiliateResourceSchema = new MongooseSchema25(
|
|
|
9590
9742
|
},
|
|
9591
9743
|
{ _id: false }
|
|
9592
9744
|
);
|
|
9593
|
-
var affiliateContactDetailsSchema = new
|
|
9745
|
+
var affiliateContactDetailsSchema = new MongooseSchema26(
|
|
9594
9746
|
{
|
|
9595
9747
|
mobilePhone: { required: true, type: String }
|
|
9596
9748
|
},
|
|
9597
9749
|
{ _id: false }
|
|
9598
9750
|
);
|
|
9599
|
-
var affiliateBankAccountDetailsSchema = new
|
|
9751
|
+
var affiliateBankAccountDetailsSchema = new MongooseSchema26(
|
|
9600
9752
|
{
|
|
9601
9753
|
accountHolderName: { required: true, type: String },
|
|
9602
9754
|
accountNumber: { required: true, type: String }
|
|
9603
9755
|
},
|
|
9604
9756
|
{ _id: false }
|
|
9605
9757
|
);
|
|
9606
|
-
var affiliateDetailsSchema = new
|
|
9758
|
+
var affiliateDetailsSchema = new MongooseSchema26(
|
|
9607
9759
|
{
|
|
9608
9760
|
bankAccountDetails: {
|
|
9609
9761
|
required: true,
|
|
@@ -9625,7 +9777,7 @@ var affiliateDetailsSchema = new MongooseSchema25(
|
|
|
9625
9777
|
},
|
|
9626
9778
|
{ _id: false }
|
|
9627
9779
|
);
|
|
9628
|
-
var redeemHistorySchema = new
|
|
9780
|
+
var redeemHistorySchema = new MongooseSchema26(
|
|
9629
9781
|
{
|
|
9630
9782
|
paidAt: { default: null, required: false, type: Date },
|
|
9631
9783
|
redeemedAt: { required: true, type: Date },
|
|
@@ -9633,7 +9785,7 @@ var redeemHistorySchema = new MongooseSchema25(
|
|
|
9633
9785
|
},
|
|
9634
9786
|
{ _id: false }
|
|
9635
9787
|
);
|
|
9636
|
-
var
|
|
9788
|
+
var schema18 = new MongooseSchema26(
|
|
9637
9789
|
{
|
|
9638
9790
|
active: { default: false, required: true, type: Boolean },
|
|
9639
9791
|
affiliateBonusRewards: {
|
|
@@ -9663,71 +9815,14 @@ var schema17 = new MongooseSchema25(
|
|
|
9663
9815
|
},
|
|
9664
9816
|
{ timestamps: true }
|
|
9665
9817
|
);
|
|
9666
|
-
|
|
9818
|
+
schema18.index(
|
|
9667
9819
|
{ affiliateCode: 1 },
|
|
9668
9820
|
{
|
|
9669
9821
|
partialFilterExpression: { active: true, deletedAt: null },
|
|
9670
9822
|
unique: true
|
|
9671
9823
|
}
|
|
9672
9824
|
);
|
|
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);
|
|
9825
|
+
var AffiliateModel = import_mongoose26.default.models.Affiliate || import_mongoose26.default.model("Affiliate", schema18);
|
|
9731
9826
|
// Annotate the CommonJS export names for ESM import in node:
|
|
9732
9827
|
0 && (module.exports = {
|
|
9733
9828
|
APP_SETTINGS_ID,
|
|
@@ -9764,6 +9859,7 @@ var CouponModel = import_mongoose26.default.models.Coupon || import_mongoose26.d
|
|
|
9764
9859
|
dateTimeSchema,
|
|
9765
9860
|
locationGeoSchema,
|
|
9766
9861
|
locationsSchema,
|
|
9862
|
+
productCouponSchema,
|
|
9767
9863
|
refundPolicySchema,
|
|
9768
9864
|
relatedPostSchema,
|
|
9769
9865
|
relationDatesSchema,
|