@timardex/cluemart-server-shared 1.1.18 → 1.1.20

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.
@@ -5000,6 +5000,12 @@ var OWNER_FIELDS_FRAGMENT = gql`
5000
5000
  userId
5001
5001
  }
5002
5002
  `;
5003
+ var PRODUCT_COUPON_FIELDS_FRAGMENT = gql`
5004
+ fragment ProductCouponFields on ProductCouponType {
5005
+ couponDocumentId
5006
+ couponId
5007
+ }
5008
+ `;
5003
5009
  var CATEGORY_FIELDS_FRAGMENT = gql`
5004
5010
  fragment CategoryFields on CategoryType {
5005
5011
  id
@@ -5473,109 +5479,6 @@ var GET_EVENT_INFO = gql`
5473
5479
  }
5474
5480
  ${EVENT_INFO}
5475
5481
  `;
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
- `;
5579
5482
  var VENDOR_DATETIME_FIELDS_FRAGMENT = gql`
5580
5483
  fragment VendorDateTimeFields on VendorDateTimeType {
5581
5484
  dateStatus
@@ -5602,6 +5505,15 @@ var VENDOR_PRODUCT_LIST_FIELDS_FRAGMENT = gql`
5602
5505
  }
5603
5506
  ${PRODUCT_COUPON_FIELDS_FRAGMENT}
5604
5507
  `;
5508
+ var VENDOR_PRODUCTS_FIELDS_FRAGMENT = gql`
5509
+ fragment VendorProductsFields on VendorProductsType {
5510
+ active
5511
+ productsList {
5512
+ ...VendorProductListFields
5513
+ }
5514
+ }
5515
+ ${VENDOR_PRODUCT_LIST_FIELDS_FRAGMENT}
5516
+ `;
5605
5517
  var VENDOR = gql`
5606
5518
  fragment VendorFields on VendorType {
5607
5519
  _id
@@ -5651,10 +5563,7 @@ var VENDOR = gql`
5651
5563
  ...OwnerFields
5652
5564
  }
5653
5565
  products {
5654
- active
5655
- productsList {
5656
- ...VendorProductListFields
5657
- }
5566
+ ...VendorProductsFields
5658
5567
  }
5659
5568
  promoCodes
5660
5569
  posterUsage {
@@ -5696,7 +5605,7 @@ var VENDOR = gql`
5696
5605
  ${RESOURCE_IMAGE_FIELDS_FRAGMENT}
5697
5606
  ${SOCIAL_MEDIA_FIELDS_FRAGMENT}
5698
5607
  ${POSTER_USAGE_FIELDS_FRAGMENT}
5699
- ${VENDOR_PRODUCT_LIST_FIELDS_FRAGMENT}
5608
+ ${VENDOR_PRODUCTS_FIELDS_FRAGMENT}
5700
5609
  ${CONTACT_DETAILS_FIELDS_FRAGMENT}
5701
5610
  ${TERMS_AGREEMENT_FIELDS_FRAGMENT}
5702
5611
  ${RELATION_DATES_FRAGMENT}
@@ -7902,6 +7811,146 @@ var ASSIGN_AFFILIATE_BONUS_REWARD_MUTATION = gql`
7902
7811
  }
7903
7812
  ${AFFILIATE_FIELDS_FRAGMENT}
7904
7813
  `;
7814
+ var COUPON_CODE_FIELDS_FRAGMENT = gql`
7815
+ fragment CouponCodeFields on CouponCodeType {
7816
+ code
7817
+ qrCode {
7818
+ ...ResourceImageFields
7819
+ }
7820
+ }
7821
+ ${RESOURCE_IMAGE_FIELDS_FRAGMENT}
7822
+ `;
7823
+ var COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT = gql`
7824
+ fragment CouponParticipantUserFields on CouponParticipantUserType {
7825
+ couponCollectedCount
7826
+ couponRedeemedAt
7827
+ createdAt
7828
+ updatedAt
7829
+ userId
7830
+ }
7831
+ `;
7832
+ var COUPON_OPTION_FIELDS_FRAGMENT = gql`
7833
+ fragment CouponOptionFields on CouponOptionType {
7834
+ type
7835
+ buy
7836
+ get
7837
+ unit
7838
+ visits
7839
+ }
7840
+ `;
7841
+ var COUPON_REWARD_FIELDS_FRAGMENT = gql`
7842
+ fragment CouponRewardFields on CouponRewardType {
7843
+ vendorId
7844
+ productId
7845
+ quantity
7846
+ unit
7847
+ }
7848
+ `;
7849
+ var COUPON_DATA_PRODUCTS_FIELDS_FRAGMENT = gql`
7850
+ fragment CouponDataProductsFields on CouponDataProductsType {
7851
+ active
7852
+ productsList {
7853
+ ...VendorProductListFields
7854
+ }
7855
+ vendorLogo {
7856
+ ...ResourceImageFields
7857
+ }
7858
+ vendorName
7859
+ }
7860
+ ${VENDOR_PRODUCT_LIST_FIELDS_FRAGMENT}
7861
+ ${RESOURCE_IMAGE_FIELDS_FRAGMENT}
7862
+ `;
7863
+ var COUPON_DATA_FIELDS_FRAGMENT = gql`
7864
+ fragment CouponDataFields on CouponDataType {
7865
+ _id
7866
+ active
7867
+ couponCode {
7868
+ ...CouponCodeFields
7869
+ }
7870
+ couponDescription
7871
+ couponOption {
7872
+ ...CouponOptionFields
7873
+ }
7874
+ couponRewards {
7875
+ ...CouponRewardFields
7876
+ }
7877
+ createdAt
7878
+ endDate
7879
+ participantUsers {
7880
+ ...CouponParticipantUserFields
7881
+ }
7882
+ products {
7883
+ ...CouponDataProductsFields
7884
+ }
7885
+ resourceId
7886
+ resourceType
7887
+ startDate
7888
+ updatedAt
7889
+ }
7890
+ ${COUPON_CODE_FIELDS_FRAGMENT}
7891
+ ${COUPON_OPTION_FIELDS_FRAGMENT}
7892
+ ${COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT}
7893
+ ${COUPON_REWARD_FIELDS_FRAGMENT}
7894
+ ${COUPON_DATA_PRODUCTS_FIELDS_FRAGMENT}
7895
+ `;
7896
+ var COUPON = gql`
7897
+ fragment CouponFields on CouponType {
7898
+ _id
7899
+ active
7900
+ couponData {
7901
+ ...CouponDataFields
7902
+ }
7903
+ createdAt
7904
+ deletedAt
7905
+ owner {
7906
+ ...OwnerFields
7907
+ }
7908
+ updatedAt
7909
+ }
7910
+ ${OWNER_FIELDS_FRAGMENT}
7911
+ ${COUPON_DATA_FIELDS_FRAGMENT}
7912
+ `;
7913
+ var GET_COUPONS = gql`
7914
+ query getCoupons {
7915
+ coupons {
7916
+ active {
7917
+ listName
7918
+ data {
7919
+ ...CouponFields
7920
+ }
7921
+ }
7922
+ owned {
7923
+ listName
7924
+ data {
7925
+ ...CouponFields
7926
+ }
7927
+ }
7928
+ scanned {
7929
+ listName
7930
+ data {
7931
+ ...CouponFields
7932
+ }
7933
+ }
7934
+ }
7935
+ }
7936
+ ${COUPON}
7937
+ `;
7938
+ var GET_COUPON = gql`
7939
+ query getCoupon($_id: ID!) {
7940
+ coupon(_id: $_id) {
7941
+ ...CouponFields
7942
+ }
7943
+ }
7944
+ ${COUPON}
7945
+ `;
7946
+ var GET_RESOURCE_COUPONS = gql`
7947
+ query getResourceCoupons($resourceId: ID!, $resourceType: ResourceTypeEnum!) {
7948
+ resourceCoupons(resourceId: $resourceId, resourceType: $resourceType) {
7949
+ ...CouponFields
7950
+ }
7951
+ }
7952
+ ${COUPON}
7953
+ `;
7905
7954
  var CREATE_COUPON_MUTATION = gql`
7906
7955
  mutation createCoupon($input: CouponInputType!) {
7907
7956
  createCoupon(input: $input) {
@@ -7914,8 +7963,16 @@ var CREATE_COUPON_MUTATION = gql`
7914
7963
  ${COUPON}
7915
7964
  `;
7916
7965
  var UPDATE_COUPON_MUTATION = gql`
7917
- mutation updateCoupon($_id: ID!, $input: CouponInputType!) {
7918
- updateCoupon(_id: $_id, input: $input) {
7966
+ mutation updateCoupon(
7967
+ $couponDocumentId: ID!
7968
+ $couponId: ID!
7969
+ $input: CouponInputType!
7970
+ ) {
7971
+ updateCoupon(
7972
+ couponDocumentId: $couponDocumentId
7973
+ couponId: $couponId
7974
+ input: $input
7975
+ ) {
7919
7976
  data {
7920
7977
  ...CouponFields
7921
7978
  }
@@ -7925,8 +7982,8 @@ var UPDATE_COUPON_MUTATION = gql`
7925
7982
  ${COUPON}
7926
7983
  `;
7927
7984
  var DELETE_COUPON_MUTATION = gql`
7928
- mutation deleteCoupon($_id: ID!) {
7929
- deleteCoupon(_id: $_id) {
7985
+ mutation deleteCoupon($couponDocumentId: ID!, $couponId: ID!) {
7986
+ deleteCoupon(couponDocumentId: $couponDocumentId, couponId: $couponId) {
7930
7987
  data
7931
7988
  message
7932
7989
  }
@@ -9144,7 +9201,7 @@ var vendorProductTypeSchema = new MongooseSchema14(
9144
9201
  );
9145
9202
  var productWrapperSchema = new MongooseSchema14(
9146
9203
  {
9147
- active: { default: false, required: true, type: Boolean },
9204
+ active: { default: false, required: false, type: Boolean },
9148
9205
  productsList: { required: false, type: [vendorProductTypeSchema] }
9149
9206
  },
9150
9207
  { _id: false }