@timardex/cluemart-server-shared 1.1.12 → 1.1.15
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-ICAMGPFE.mjs → chunk-VS3WIV6D.mjs} +172 -7
- package/dist/chunk-VS3WIV6D.mjs.map +1 -0
- package/dist/index.cjs +183 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +28 -2
- package/dist/index.d.ts +28 -2
- package/dist/index.mjs +180 -15
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs +174 -7
- package/dist/mongoose/index.cjs.map +1 -1
- package/dist/mongoose/index.d.mts +28 -2
- package/dist/mongoose/index.d.ts +28 -2
- package/dist/mongoose/index.mjs +7 -3
- package/dist/service/index.cjs +176 -13
- 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-ICAMGPFE.mjs.map +0 -1
package/dist/mongoose/index.cjs
CHANGED
|
@@ -38,6 +38,7 @@ __export(mongoose_exports, {
|
|
|
38
38
|
ChatModel: () => ChatModel,
|
|
39
39
|
ChatReportModel: () => ChatReportModel,
|
|
40
40
|
ContactDetailsSchema: () => ContactDetailsSchema,
|
|
41
|
+
CouponModel: () => CouponModel,
|
|
41
42
|
EventInfoModel: () => EventInfoModel,
|
|
42
43
|
EventModel: () => EventModel,
|
|
43
44
|
GameModel: () => GameModel,
|
|
@@ -69,7 +70,8 @@ __export(mongoose_exports, {
|
|
|
69
70
|
resourceRelationsSchema: () => resourceRelationsSchema,
|
|
70
71
|
socialShareResourceSchema: () => socialShareResourceSchema,
|
|
71
72
|
termsAgreementSchema: () => termsAgreementSchema,
|
|
72
|
-
userLicenseSchema: () => userLicenseSchema
|
|
73
|
+
userLicenseSchema: () => userLicenseSchema,
|
|
74
|
+
vendorProductTypeSchema: () => vendorProductTypeSchema
|
|
73
75
|
});
|
|
74
76
|
module.exports = __toCommonJS(mongoose_exports);
|
|
75
77
|
|
|
@@ -5475,11 +5477,14 @@ var VENDOR_DATETIME_FIELDS_FRAGMENT = gql`
|
|
|
5475
5477
|
`;
|
|
5476
5478
|
var VENDOR_PRODUCT_LIST_FIELDS_FRAGMENT = gql`
|
|
5477
5479
|
fragment VendorProductListFields on VendorProductListType {
|
|
5480
|
+
_id
|
|
5481
|
+
createdAt
|
|
5478
5482
|
description
|
|
5479
5483
|
name
|
|
5480
5484
|
price
|
|
5481
5485
|
priceUnit
|
|
5482
5486
|
productGroups
|
|
5487
|
+
updatedAt
|
|
5483
5488
|
}
|
|
5484
5489
|
`;
|
|
5485
5490
|
var VENDOR = gql`
|
|
@@ -7782,6 +7787,109 @@ var ASSIGN_AFFILIATE_BONUS_REWARD_MUTATION = gql`
|
|
|
7782
7787
|
}
|
|
7783
7788
|
${AFFILIATE_FIELDS_FRAGMENT}
|
|
7784
7789
|
`;
|
|
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
|
+
var CREATE_COUPON_MUTATION = gql`
|
|
7864
|
+
mutation createCoupon($input: CouponInputType!) {
|
|
7865
|
+
createCoupon(input: $input) {
|
|
7866
|
+
data {
|
|
7867
|
+
...CouponFields
|
|
7868
|
+
}
|
|
7869
|
+
message
|
|
7870
|
+
}
|
|
7871
|
+
}
|
|
7872
|
+
${COUPON}
|
|
7873
|
+
`;
|
|
7874
|
+
var UPDATE_COUPON_MUTATION = gql`
|
|
7875
|
+
mutation updateCoupon($_id: ID!, $input: CouponInputType!) {
|
|
7876
|
+
updateCoupon(_id: $_id, input: $input) {
|
|
7877
|
+
data {
|
|
7878
|
+
...CouponFields
|
|
7879
|
+
}
|
|
7880
|
+
message
|
|
7881
|
+
}
|
|
7882
|
+
}
|
|
7883
|
+
${COUPON}
|
|
7884
|
+
`;
|
|
7885
|
+
var DELETE_COUPON_MUTATION = gql`
|
|
7886
|
+
mutation deleteCoupon($_id: ID!) {
|
|
7887
|
+
deleteCoupon(_id: $_id) {
|
|
7888
|
+
data
|
|
7889
|
+
message
|
|
7890
|
+
}
|
|
7891
|
+
}
|
|
7892
|
+
`;
|
|
7785
7893
|
var PKG = "@timardex/cluemart-shared";
|
|
7786
7894
|
var IMAGE_EXTENSION = ".webp";
|
|
7787
7895
|
var posterIds = [
|
|
@@ -8870,7 +8978,7 @@ var VerificationTokenModel = import_mongoose12.default.models.VerificationToken
|
|
|
8870
8978
|
// src/mongoose/vendor/Vendor.ts
|
|
8871
8979
|
var import_mongoose13 = __toESM(require("mongoose"));
|
|
8872
8980
|
var MongooseSchema13 = import_mongoose13.default.Schema;
|
|
8873
|
-
var
|
|
8981
|
+
var vendorProductTypeSchema = new MongooseSchema13(
|
|
8874
8982
|
{
|
|
8875
8983
|
description: { required: false, type: String },
|
|
8876
8984
|
name: { required: false, type: String },
|
|
@@ -8878,12 +8986,12 @@ var productTypeSchema = new MongooseSchema13(
|
|
|
8878
8986
|
priceUnit: { required: false, type: String },
|
|
8879
8987
|
productGroups: { required: false, type: [String] }
|
|
8880
8988
|
},
|
|
8881
|
-
{
|
|
8989
|
+
{ timestamps: true }
|
|
8882
8990
|
);
|
|
8883
8991
|
var productWrapperSchema = new MongooseSchema13(
|
|
8884
8992
|
{
|
|
8885
8993
|
active: { default: false, type: Boolean },
|
|
8886
|
-
productsList: { required: false, type: [
|
|
8994
|
+
productsList: { required: false, type: [vendorProductTypeSchema] }
|
|
8887
8995
|
},
|
|
8888
8996
|
{ _id: false }
|
|
8889
8997
|
);
|
|
@@ -9335,9 +9443,9 @@ var gameDataSchemas = {
|
|
|
9335
9443
|
[EnumGameType.ODD_ONE_OUT]: schemaPuzzleGameData
|
|
9336
9444
|
};
|
|
9337
9445
|
var gameDataDefinition = Object.fromEntries(
|
|
9338
|
-
Object.entries(gameDataSchemas).map(([key,
|
|
9446
|
+
Object.entries(gameDataSchemas).map(([key, schema19]) => [
|
|
9339
9447
|
key,
|
|
9340
|
-
{ default: null, required: false, type:
|
|
9448
|
+
{ default: null, required: false, type: schema19 }
|
|
9341
9449
|
])
|
|
9342
9450
|
);
|
|
9343
9451
|
var gameHistorySchema = new MongooseSchema23(
|
|
@@ -9561,6 +9669,63 @@ schema17.index(
|
|
|
9561
9669
|
}
|
|
9562
9670
|
);
|
|
9563
9671
|
var AffiliateModel = import_mongoose25.default.models.Affiliate || import_mongoose25.default.model("Affiliate", schema17);
|
|
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);
|
|
9564
9729
|
// Annotate the CommonJS export names for ESM import in node:
|
|
9565
9730
|
0 && (module.exports = {
|
|
9566
9731
|
APP_SETTINGS_ID,
|
|
@@ -9571,6 +9736,7 @@ var AffiliateModel = import_mongoose25.default.models.Affiliate || import_mongoo
|
|
|
9571
9736
|
ChatModel,
|
|
9572
9737
|
ChatReportModel,
|
|
9573
9738
|
ContactDetailsSchema,
|
|
9739
|
+
CouponModel,
|
|
9574
9740
|
EventInfoModel,
|
|
9575
9741
|
EventModel,
|
|
9576
9742
|
GameModel,
|
|
@@ -9602,6 +9768,7 @@ var AffiliateModel = import_mongoose25.default.models.Affiliate || import_mongoo
|
|
|
9602
9768
|
resourceRelationsSchema,
|
|
9603
9769
|
socialShareResourceSchema,
|
|
9604
9770
|
termsAgreementSchema,
|
|
9605
|
-
userLicenseSchema
|
|
9771
|
+
userLicenseSchema,
|
|
9772
|
+
vendorProductTypeSchema
|
|
9606
9773
|
});
|
|
9607
9774
|
//# sourceMappingURL=index.cjs.map
|