@timardex/cluemart-server-shared 1.0.308 → 1.0.309

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/index.cjs CHANGED
@@ -5127,6 +5127,16 @@ var REDEEMED_REWARD_FIELDS_FRAGMENT = gql`
5127
5127
  redeemedAt
5128
5128
  }
5129
5129
  `;
5130
+ var STRIPE_FIELDS_FRAGMENT = gql`
5131
+ fragment StripeSubscriptionFields on StripeSubscriptionType {
5132
+ customerId
5133
+ subscriptionId
5134
+ status
5135
+ currentPlan
5136
+ startDate
5137
+ endDate
5138
+ }
5139
+ `;
5130
5140
  var USER_FIELDS_FRAGMENT = gql`
5131
5141
  fragment UserFields on UserType {
5132
5142
  _id
@@ -5160,6 +5170,9 @@ var USER_FIELDS_FRAGMENT = gql`
5160
5170
  ...RedeemedRewardFields
5161
5171
  }
5162
5172
  school
5173
+ stripe {
5174
+ ...StripeSubscriptionFields
5175
+ }
5163
5176
  termsAgreement {
5164
5177
  ...TermsAgreementFields
5165
5178
  }
@@ -5175,6 +5188,7 @@ var USER_FIELDS_FRAGMENT = gql`
5175
5188
  ${LICENCE_FIELDS_FRAGMENT}
5176
5189
  ${LOCATION_FIELDS_FRAGMENT}
5177
5190
  ${REDEEMED_REWARD_FIELDS_FRAGMENT}
5191
+ ${STRIPE_FIELDS_FRAGMENT}
5178
5192
  `;
5179
5193
  var STALL_TYPE_FIELDS_FRAGMENT = gql`
5180
5194
  fragment StallTypeFields on StallTypeType {
@@ -9421,7 +9435,7 @@ var SHARE_RESOURCE_LABEL2 = {
9421
9435
  school: "School"
9422
9436
  };
9423
9437
 
9424
- // node_modules/@timardex/cluemart-shared/dist/chunk-QMJB5OJ4.mjs
9438
+ // node_modules/@timardex/cluemart-shared/dist/chunk-2V7QKRQE.mjs
9425
9439
  var PROMO_CODE_PREFIX2 = "CM-";
9426
9440
  var OBJECT_ID_PATH_SEGMENT2 = "[a-f0-9]{24}";
9427
9441
  var OBJECT_ID_PATH_SEGMENT_END2 = `${OBJECT_ID_PATH_SEGMENT2}$`;
@@ -9523,7 +9537,7 @@ var gameScreenIdentifierList2 = [
9523
9537
  }
9524
9538
  ];
9525
9539
 
9526
- // node_modules/@timardex/cluemart-shared/dist/chunk-A7IXLYYS.mjs
9540
+ // node_modules/@timardex/cluemart-shared/dist/chunk-THXLJFLL.mjs
9527
9541
  var import_dayjs4 = __toESM(require("dayjs"), 1);
9528
9542
  var statusOptions2 = [
9529
9543
  ...Object.values(EnumInviteStatus2).map((status) => ({
@@ -10709,7 +10723,7 @@ async function sendPushNotifications({
10709
10723
  // src/service/affiliate/vendorSubscriptionRewards.ts
10710
10724
  function isPayingStripeSubscription(stripe) {
10711
10725
  if (!stripe?.subscriptionId) return false;
10712
- return stripe.status === EnumSubscriptionStatus.ACTIVE || stripe.status === EnumSubscriptionStatus.TRIALING;
10726
+ return (stripe.status === EnumSubscriptionStatus.ACTIVE || stripe.status === EnumSubscriptionStatus.TRIALING) && (stripe.currentPlan === EnumUserLicence.PRO_VENDOR || stripe.currentPlan === EnumUserLicence.PRO_PLUS_VENDOR);
10713
10727
  }
10714
10728
  function mapVendorLicenceToSubscriptionRewardType(licences, now = /* @__PURE__ */ new Date(), stripe) {
10715
10729
  const validTypes = new Set(