@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.
@@ -39,7 +39,7 @@ import {
39
39
  socialShareResourceSchema,
40
40
  termsAgreementSchema,
41
41
  userLicenseSchema
42
- } from "../chunk-MTFOFVHB.mjs";
42
+ } from "../chunk-U5ER6XDO.mjs";
43
43
  export {
44
44
  APP_SETTINGS_ID,
45
45
  AdModel,
@@ -5084,6 +5084,16 @@ var REDEEMED_REWARD_FIELDS_FRAGMENT = gql`
5084
5084
  redeemedAt
5085
5085
  }
5086
5086
  `;
5087
+ var STRIPE_FIELDS_FRAGMENT = gql`
5088
+ fragment StripeSubscriptionFields on StripeSubscriptionType {
5089
+ customerId
5090
+ subscriptionId
5091
+ status
5092
+ currentPlan
5093
+ startDate
5094
+ endDate
5095
+ }
5096
+ `;
5087
5097
  var USER_FIELDS_FRAGMENT = gql`
5088
5098
  fragment UserFields on UserType {
5089
5099
  _id
@@ -5117,6 +5127,9 @@ var USER_FIELDS_FRAGMENT = gql`
5117
5127
  ...RedeemedRewardFields
5118
5128
  }
5119
5129
  school
5130
+ stripe {
5131
+ ...StripeSubscriptionFields
5132
+ }
5120
5133
  termsAgreement {
5121
5134
  ...TermsAgreementFields
5122
5135
  }
@@ -5132,6 +5145,7 @@ var USER_FIELDS_FRAGMENT = gql`
5132
5145
  ${LICENCE_FIELDS_FRAGMENT}
5133
5146
  ${LOCATION_FIELDS_FRAGMENT}
5134
5147
  ${REDEEMED_REWARD_FIELDS_FRAGMENT}
5148
+ ${STRIPE_FIELDS_FRAGMENT}
5135
5149
  `;
5136
5150
  var STALL_TYPE_FIELDS_FRAGMENT = gql`
5137
5151
  fragment StallTypeFields on StallTypeType {
@@ -7046,6 +7060,7 @@ var APP_SETTINGS_FIELDS_FRAGMENT = gql`
7046
7060
  createdAt
7047
7061
  isOfflineMode
7048
7062
  key
7063
+ minimumRedeemableAffiliatePoints
7049
7064
  updatedAt
7050
7065
  }
7051
7066
  `;
@@ -8973,6 +8988,11 @@ var AppSettingSchema = new MongooseSchema19(
8973
8988
  type: String,
8974
8989
  unique: true
8975
8990
  // ✅ allowed here
8991
+ },
8992
+ minimumRedeemableAffiliatePoints: {
8993
+ default: 500,
8994
+ required: true,
8995
+ type: Number
8976
8996
  }
8977
8997
  },
8978
8998
  { timestamps: true }
@@ -9323,7 +9343,7 @@ async function activeAffiliateCodeExists(affiliateCode) {
9323
9343
  return existing !== null;
9324
9344
  }
9325
9345
 
9326
- // node_modules/@timardex/cluemart-shared/dist/chunk-SWWVD4J5.mjs
9346
+ // node_modules/@timardex/cluemart-shared/dist/chunk-SD42WIMV.mjs
9327
9347
  var import_dayjs3 = __toESM(require("dayjs"), 1);
9328
9348
  var import_customParseFormat2 = __toESM(require("dayjs/plugin/customParseFormat.js"), 1);
9329
9349
  var import_isSameOrAfter2 = __toESM(require("dayjs/plugin/isSameOrAfter.js"), 1);
@@ -9378,7 +9398,7 @@ var SHARE_RESOURCE_LABEL2 = {
9378
9398
  school: "School"
9379
9399
  };
9380
9400
 
9381
- // node_modules/@timardex/cluemart-shared/dist/chunk-QMJB5OJ4.mjs
9401
+ // node_modules/@timardex/cluemart-shared/dist/chunk-4VN5M5JO.mjs
9382
9402
  var PROMO_CODE_PREFIX2 = "CM-";
9383
9403
  var OBJECT_ID_PATH_SEGMENT2 = "[a-f0-9]{24}";
9384
9404
  var OBJECT_ID_PATH_SEGMENT_END2 = `${OBJECT_ID_PATH_SEGMENT2}$`;
@@ -9480,7 +9500,7 @@ var gameScreenIdentifierList2 = [
9480
9500
  }
9481
9501
  ];
9482
9502
 
9483
- // node_modules/@timardex/cluemart-shared/dist/chunk-A7IXLYYS.mjs
9503
+ // node_modules/@timardex/cluemart-shared/dist/chunk-TX3TVIQO.mjs
9484
9504
  var import_dayjs4 = __toESM(require("dayjs"), 1);
9485
9505
  var statusOptions2 = [
9486
9506
  ...Object.values(EnumInviteStatus2).map((status) => ({
@@ -10666,7 +10686,7 @@ async function sendPushNotifications({
10666
10686
  // src/service/affiliate/vendorSubscriptionRewards.ts
10667
10687
  function isPayingStripeSubscription(stripe) {
10668
10688
  if (!stripe?.subscriptionId) return false;
10669
- return stripe.status === EnumSubscriptionStatus.ACTIVE || stripe.status === EnumSubscriptionStatus.TRIALING;
10689
+ return (stripe.status === EnumSubscriptionStatus.ACTIVE || stripe.status === EnumSubscriptionStatus.TRIALING) && (stripe.currentPlan === EnumUserLicence.PRO_VENDOR || stripe.currentPlan === EnumUserLicence.PRO_PLUS_VENDOR);
10670
10690
  }
10671
10691
  function mapVendorLicenceToSubscriptionRewardType(licences, now = /* @__PURE__ */ new Date(), stripe) {
10672
10692
  const validTypes = new Set(