@timardex/cluemart-server-shared 1.0.308 → 1.0.310

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 {
@@ -7089,6 +7103,7 @@ var APP_SETTINGS_FIELDS_FRAGMENT = gql`
7089
7103
  createdAt
7090
7104
  isOfflineMode
7091
7105
  key
7106
+ minimumRedeemableAffiliatePoints
7092
7107
  updatedAt
7093
7108
  }
7094
7109
  `;
@@ -9016,6 +9031,11 @@ var AppSettingSchema = new MongooseSchema19(
9016
9031
  type: String,
9017
9032
  unique: true
9018
9033
  // ✅ allowed here
9034
+ },
9035
+ minimumRedeemableAffiliatePoints: {
9036
+ default: 500,
9037
+ required: true,
9038
+ type: Number
9019
9039
  }
9020
9040
  },
9021
9041
  { timestamps: true }
@@ -9366,7 +9386,7 @@ async function activeAffiliateCodeExists(affiliateCode) {
9366
9386
  return existing !== null;
9367
9387
  }
9368
9388
 
9369
- // node_modules/@timardex/cluemart-shared/dist/chunk-SWWVD4J5.mjs
9389
+ // node_modules/@timardex/cluemart-shared/dist/chunk-SD42WIMV.mjs
9370
9390
  var import_dayjs3 = __toESM(require("dayjs"), 1);
9371
9391
  var import_customParseFormat2 = __toESM(require("dayjs/plugin/customParseFormat.js"), 1);
9372
9392
  var import_isSameOrAfter2 = __toESM(require("dayjs/plugin/isSameOrAfter.js"), 1);
@@ -9421,7 +9441,7 @@ var SHARE_RESOURCE_LABEL2 = {
9421
9441
  school: "School"
9422
9442
  };
9423
9443
 
9424
- // node_modules/@timardex/cluemart-shared/dist/chunk-QMJB5OJ4.mjs
9444
+ // node_modules/@timardex/cluemart-shared/dist/chunk-4VN5M5JO.mjs
9425
9445
  var PROMO_CODE_PREFIX2 = "CM-";
9426
9446
  var OBJECT_ID_PATH_SEGMENT2 = "[a-f0-9]{24}";
9427
9447
  var OBJECT_ID_PATH_SEGMENT_END2 = `${OBJECT_ID_PATH_SEGMENT2}$`;
@@ -9523,7 +9543,7 @@ var gameScreenIdentifierList2 = [
9523
9543
  }
9524
9544
  ];
9525
9545
 
9526
- // node_modules/@timardex/cluemart-shared/dist/chunk-A7IXLYYS.mjs
9546
+ // node_modules/@timardex/cluemart-shared/dist/chunk-TX3TVIQO.mjs
9527
9547
  var import_dayjs4 = __toESM(require("dayjs"), 1);
9528
9548
  var statusOptions2 = [
9529
9549
  ...Object.values(EnumInviteStatus2).map((status) => ({
@@ -10709,7 +10729,7 @@ async function sendPushNotifications({
10709
10729
  // src/service/affiliate/vendorSubscriptionRewards.ts
10710
10730
  function isPayingStripeSubscription(stripe) {
10711
10731
  if (!stripe?.subscriptionId) return false;
10712
- return stripe.status === EnumSubscriptionStatus.ACTIVE || stripe.status === EnumSubscriptionStatus.TRIALING;
10732
+ return (stripe.status === EnumSubscriptionStatus.ACTIVE || stripe.status === EnumSubscriptionStatus.TRIALING) && (stripe.currentPlan === EnumUserLicence.PRO_VENDOR || stripe.currentPlan === EnumUserLicence.PRO_PLUS_VENDOR);
10713
10733
  }
10714
10734
  function mapVendorLicenceToSubscriptionRewardType(licences, now = /* @__PURE__ */ new Date(), stripe) {
10715
10735
  const validTypes = new Set(