@timardex/cluemart-server-shared 1.1.11 → 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.
@@ -5402,11 +5402,14 @@ var VENDOR_DATETIME_FIELDS_FRAGMENT = gql`
5402
5402
  `;
5403
5403
  var VENDOR_PRODUCT_LIST_FIELDS_FRAGMENT = gql`
5404
5404
  fragment VendorProductListFields on VendorProductListType {
5405
+ _id
5406
+ createdAt
5405
5407
  description
5406
5408
  name
5407
5409
  price
5408
5410
  priceUnit
5409
5411
  productGroups
5412
+ updatedAt
5410
5413
  }
5411
5414
  `;
5412
5415
  var VENDOR = gql`
@@ -7709,6 +7712,109 @@ var ASSIGN_AFFILIATE_BONUS_REWARD_MUTATION = gql`
7709
7712
  }
7710
7713
  ${AFFILIATE_FIELDS_FRAGMENT}
7711
7714
  `;
7715
+ var COUPON_CODE_FIELDS_FRAGMENT = gql`
7716
+ fragment CouponCodeFields on CouponCodeType {
7717
+ code
7718
+ qrCode {
7719
+ ...ResourceImageFields
7720
+ }
7721
+ }
7722
+ ${RESOURCE_IMAGE_FIELDS_FRAGMENT}
7723
+ `;
7724
+ var COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT = gql`
7725
+ fragment CouponParticipantUserFields on CouponParticipantUserType {
7726
+ couponCount
7727
+ couponRedeemedAt
7728
+ createdAt
7729
+ updatedAt
7730
+ userId
7731
+ }
7732
+ `;
7733
+ var PRODUCT_COUPON_FIELDS_FRAGMENT = gql`
7734
+ fragment ProductCouponFields on ProductCouponType {
7735
+ _id
7736
+ active
7737
+ couponCode {
7738
+ ...CouponCodeFields
7739
+ }
7740
+ couponDescription
7741
+ couponOption
7742
+ createdAt
7743
+ endDate
7744
+ participantProduct {
7745
+ ...VendorProductListFields
7746
+ }
7747
+ participantUsers {
7748
+ ...CouponParticipantUserFields
7749
+ }
7750
+ startDate
7751
+ updatedAt
7752
+ }
7753
+ ${COUPON_CODE_FIELDS_FRAGMENT}
7754
+ ${COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT}
7755
+ ${VENDOR_PRODUCT_LIST_FIELDS_FRAGMENT}
7756
+ `;
7757
+ var COUPON = gql`
7758
+ fragment CouponFields on CouponType {
7759
+ _id
7760
+ active
7761
+ productCoupons {
7762
+ ...ProductCouponFields
7763
+ }
7764
+ createdAt
7765
+ deletedAt
7766
+ updatedAt
7767
+ }
7768
+ ${PRODUCT_COUPON_FIELDS_FRAGMENT}
7769
+ ${COUPON_CODE_FIELDS_FRAGMENT}
7770
+ ${COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT}
7771
+ `;
7772
+ var GET_COUPONS = gql`
7773
+ query getCoupons {
7774
+ coupons {
7775
+ ...CouponFields
7776
+ }
7777
+ }
7778
+ ${COUPON}
7779
+ `;
7780
+ var GET_COUPON = gql`
7781
+ query getCoupon($_id: ID!) {
7782
+ coupon(_id: $_id) {
7783
+ ...CouponFields
7784
+ }
7785
+ }
7786
+ ${COUPON}
7787
+ `;
7788
+ var CREATE_COUPON_MUTATION = gql`
7789
+ mutation createCoupon($input: CouponInputType!) {
7790
+ createCoupon(input: $input) {
7791
+ data {
7792
+ ...CouponFields
7793
+ }
7794
+ message
7795
+ }
7796
+ }
7797
+ ${COUPON}
7798
+ `;
7799
+ var UPDATE_COUPON_MUTATION = gql`
7800
+ mutation updateCoupon($_id: ID!, $input: CouponInputType!) {
7801
+ updateCoupon(_id: $_id, input: $input) {
7802
+ data {
7803
+ ...CouponFields
7804
+ }
7805
+ message
7806
+ }
7807
+ }
7808
+ ${COUPON}
7809
+ `;
7810
+ var DELETE_COUPON_MUTATION = gql`
7811
+ mutation deleteCoupon($_id: ID!) {
7812
+ deleteCoupon(_id: $_id) {
7813
+ data
7814
+ message
7815
+ }
7816
+ }
7817
+ `;
7712
7818
  var PKG = "@timardex/cluemart-shared";
7713
7819
  var IMAGE_EXTENSION = ".webp";
7714
7820
  var posterIds = [
@@ -8845,7 +8951,7 @@ var VerificationTokenModel = mongoose12.models.VerificationToken || mongoose12.m
8845
8951
  // src/mongoose/vendor/Vendor.ts
8846
8952
  import mongoose13 from "mongoose";
8847
8953
  var MongooseSchema13 = mongoose13.Schema;
8848
- var productTypeSchema = new MongooseSchema13(
8954
+ var vendorProductTypeSchema = new MongooseSchema13(
8849
8955
  {
8850
8956
  description: { required: false, type: String },
8851
8957
  name: { required: false, type: String },
@@ -8853,12 +8959,12 @@ var productTypeSchema = new MongooseSchema13(
8853
8959
  priceUnit: { required: false, type: String },
8854
8960
  productGroups: { required: false, type: [String] }
8855
8961
  },
8856
- { _id: false }
8962
+ { timestamps: true }
8857
8963
  );
8858
8964
  var productWrapperSchema = new MongooseSchema13(
8859
8965
  {
8860
8966
  active: { default: false, type: Boolean },
8861
- productsList: { required: false, type: [productTypeSchema] }
8967
+ productsList: { required: false, type: [vendorProductTypeSchema] }
8862
8968
  },
8863
8969
  { _id: false }
8864
8970
  );
@@ -9019,7 +9125,7 @@ var schema11 = new MongooseSchema15(
9019
9125
  claimToken: { default: null, required: false, type: String },
9020
9126
  claimTokenExpiresAt: { default: null, required: false, type: Date },
9021
9127
  deletedAt: { default: null, required: false, type: Date },
9022
- email: { required: false, type: String },
9128
+ email: { required: true, type: String },
9023
9129
  invitations: { required: true, type: [invitationSchema] },
9024
9130
  name: { required: true, type: String },
9025
9131
  region: { required: true, type: String }
@@ -9310,9 +9416,9 @@ var gameDataSchemas = {
9310
9416
  [EnumGameType.ODD_ONE_OUT]: schemaPuzzleGameData
9311
9417
  };
9312
9418
  var gameDataDefinition = Object.fromEntries(
9313
- Object.entries(gameDataSchemas).map(([key, schema18]) => [
9419
+ Object.entries(gameDataSchemas).map(([key, schema19]) => [
9314
9420
  key,
9315
- { default: null, required: false, type: schema18 }
9421
+ { default: null, required: false, type: schema19 }
9316
9422
  ])
9317
9423
  );
9318
9424
  var gameHistorySchema = new MongooseSchema23(
@@ -9537,6 +9643,63 @@ schema17.index(
9537
9643
  );
9538
9644
  var AffiliateModel = mongoose25.models.Affiliate || mongoose25.model("Affiliate", schema17);
9539
9645
 
9646
+ // src/mongoose/Coupon.ts
9647
+ import mongoose26 from "mongoose";
9648
+ var MongooseSchema26 = mongoose26.Schema;
9649
+ var couponOptionSchema = new MongooseSchema26(
9650
+ {
9651
+ buy: { required: true, type: Number },
9652
+ get: { required: true, type: Number },
9653
+ unit: { required: true, type: String }
9654
+ },
9655
+ { _id: false }
9656
+ );
9657
+ var couponCodeSchema = new MongooseSchema26(
9658
+ {
9659
+ code: { required: true, type: String },
9660
+ qrCode: { required: true, type: ResourceImageTypeSchema }
9661
+ },
9662
+ { _id: false }
9663
+ );
9664
+ var couponParticipantUserSchema = new MongooseSchema26(
9665
+ {
9666
+ couponCount: { default: 0, required: true, type: Number },
9667
+ couponRedeemedAt: { default: null, required: false, type: Date },
9668
+ userId: {
9669
+ ref: "User",
9670
+ required: true,
9671
+ type: mongoose26.Schema.Types.ObjectId
9672
+ }
9673
+ },
9674
+ { timestamps: true }
9675
+ );
9676
+ var productCouponSchema = new MongooseSchema26(
9677
+ {
9678
+ active: { default: true, required: true, type: Boolean },
9679
+ couponCode: { required: true, type: couponCodeSchema },
9680
+ couponDescription: { required: true, type: String },
9681
+ couponOption: { required: true, type: couponOptionSchema },
9682
+ endDate: { required: true, type: Date },
9683
+ participantProduct: { required: true, type: vendorProductTypeSchema },
9684
+ participantUsers: {
9685
+ default: null,
9686
+ required: false,
9687
+ type: [couponParticipantUserSchema]
9688
+ },
9689
+ startDate: { required: true, type: Date }
9690
+ },
9691
+ { timestamps: true }
9692
+ );
9693
+ var schema18 = new MongooseSchema26(
9694
+ {
9695
+ active: { default: true, required: true, type: Boolean },
9696
+ deletedAt: { default: null, required: false, type: Date },
9697
+ productCoupons: { required: false, type: [productCouponSchema] }
9698
+ },
9699
+ { timestamps: true }
9700
+ );
9701
+ var CouponModel = mongoose26.models.Coupon || mongoose26.model("Coupon", schema18);
9702
+
9540
9703
  export {
9541
9704
  EnumInviteStatus,
9542
9705
  EnumResourceType,
@@ -9582,6 +9745,7 @@ export {
9582
9745
  ResourceActivityModel,
9583
9746
  UserModel,
9584
9747
  VerificationTokenModel,
9748
+ vendorProductTypeSchema,
9585
9749
  VendorModel,
9586
9750
  VendorInfoModel,
9587
9751
  UnregisteredVendorModel,
@@ -9592,6 +9756,7 @@ export {
9592
9756
  AppSettingModel,
9593
9757
  GameModel,
9594
9758
  SchoolModel,
9595
- AffiliateModel
9759
+ AffiliateModel,
9760
+ CouponModel
9596
9761
  };
9597
- //# sourceMappingURL=chunk-3J26U4GN.mjs.map
9762
+ //# sourceMappingURL=chunk-VS3WIV6D.mjs.map