@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.mjs CHANGED
@@ -5027,6 +5027,16 @@ var REDEEMED_REWARD_FIELDS_FRAGMENT = gql`
5027
5027
  redeemedAt
5028
5028
  }
5029
5029
  `;
5030
+ var STRIPE_FIELDS_FRAGMENT = gql`
5031
+ fragment StripeSubscriptionFields on StripeSubscriptionType {
5032
+ customerId
5033
+ subscriptionId
5034
+ status
5035
+ currentPlan
5036
+ startDate
5037
+ endDate
5038
+ }
5039
+ `;
5030
5040
  var USER_FIELDS_FRAGMENT = gql`
5031
5041
  fragment UserFields on UserType {
5032
5042
  _id
@@ -5060,6 +5070,9 @@ var USER_FIELDS_FRAGMENT = gql`
5060
5070
  ...RedeemedRewardFields
5061
5071
  }
5062
5072
  school
5073
+ stripe {
5074
+ ...StripeSubscriptionFields
5075
+ }
5063
5076
  termsAgreement {
5064
5077
  ...TermsAgreementFields
5065
5078
  }
@@ -5075,6 +5088,7 @@ var USER_FIELDS_FRAGMENT = gql`
5075
5088
  ${LICENCE_FIELDS_FRAGMENT}
5076
5089
  ${LOCATION_FIELDS_FRAGMENT}
5077
5090
  ${REDEEMED_REWARD_FIELDS_FRAGMENT}
5091
+ ${STRIPE_FIELDS_FRAGMENT}
5078
5092
  `;
5079
5093
  var STALL_TYPE_FIELDS_FRAGMENT = gql`
5080
5094
  fragment StallTypeFields on StallTypeType {
@@ -6989,6 +7003,7 @@ var APP_SETTINGS_FIELDS_FRAGMENT = gql`
6989
7003
  createdAt
6990
7004
  isOfflineMode
6991
7005
  key
7006
+ minimumRedeemableAffiliatePoints
6992
7007
  updatedAt
6993
7008
  }
6994
7009
  `;
@@ -8916,6 +8931,11 @@ var AppSettingSchema = new MongooseSchema19(
8916
8931
  type: String,
8917
8932
  unique: true
8918
8933
  // ✅ allowed here
8934
+ },
8935
+ minimumRedeemableAffiliatePoints: {
8936
+ default: 500,
8937
+ required: true,
8938
+ type: Number
8919
8939
  }
8920
8940
  },
8921
8941
  { timestamps: true }
@@ -9266,7 +9286,7 @@ async function activeAffiliateCodeExists(affiliateCode) {
9266
9286
  return existing !== null;
9267
9287
  }
9268
9288
 
9269
- // node_modules/@timardex/cluemart-shared/dist/chunk-SWWVD4J5.mjs
9289
+ // node_modules/@timardex/cluemart-shared/dist/chunk-SD42WIMV.mjs
9270
9290
  import dayjs3 from "dayjs";
9271
9291
  import customParseFormat2 from "dayjs/plugin/customParseFormat.js";
9272
9292
  import isSameOrAfter2 from "dayjs/plugin/isSameOrAfter.js";
@@ -9321,7 +9341,7 @@ var SHARE_RESOURCE_LABEL2 = {
9321
9341
  school: "School"
9322
9342
  };
9323
9343
 
9324
- // node_modules/@timardex/cluemart-shared/dist/chunk-QMJB5OJ4.mjs
9344
+ // node_modules/@timardex/cluemart-shared/dist/chunk-4VN5M5JO.mjs
9325
9345
  var PROMO_CODE_PREFIX2 = "CM-";
9326
9346
  var OBJECT_ID_PATH_SEGMENT2 = "[a-f0-9]{24}";
9327
9347
  var OBJECT_ID_PATH_SEGMENT_END2 = `${OBJECT_ID_PATH_SEGMENT2}$`;
@@ -9423,7 +9443,7 @@ var gameScreenIdentifierList2 = [
9423
9443
  }
9424
9444
  ];
9425
9445
 
9426
- // node_modules/@timardex/cluemart-shared/dist/chunk-A7IXLYYS.mjs
9446
+ // node_modules/@timardex/cluemart-shared/dist/chunk-TX3TVIQO.mjs
9427
9447
  import dayjs4 from "dayjs";
9428
9448
  var statusOptions2 = [
9429
9449
  ...Object.values(EnumInviteStatus2).map((status) => ({
@@ -10609,7 +10629,7 @@ async function sendPushNotifications({
10609
10629
  // src/service/affiliate/vendorSubscriptionRewards.ts
10610
10630
  function isPayingStripeSubscription(stripe) {
10611
10631
  if (!stripe?.subscriptionId) return false;
10612
- return stripe.status === EnumSubscriptionStatus.ACTIVE || stripe.status === EnumSubscriptionStatus.TRIALING;
10632
+ return (stripe.status === EnumSubscriptionStatus.ACTIVE || stripe.status === EnumSubscriptionStatus.TRIALING) && (stripe.currentPlan === EnumUserLicence.PRO_VENDOR || stripe.currentPlan === EnumUserLicence.PRO_PLUS_VENDOR);
10613
10633
  }
10614
10634
  function mapVendorLicenceToSubscriptionRewardType(licences, now = /* @__PURE__ */ new Date(), stripe) {
10615
10635
  const validTypes = new Set(