@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/{chunk-MTFOFVHB.mjs → chunk-U5ER6XDO.mjs} +21 -1
- package/dist/chunk-U5ER6XDO.mjs.map +1 -0
- package/dist/index.cjs +24 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +24 -4
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs +20 -0
- package/dist/mongoose/index.cjs.map +1 -1
- package/dist/mongoose/index.mjs +1 -1
- package/dist/service/index.cjs +24 -4
- package/dist/service/index.cjs.map +1 -1
- package/dist/service/index.mjs +5 -5
- package/dist/service/index.mjs.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-MTFOFVHB.mjs.map +0 -1
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-
|
|
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-
|
|
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-
|
|
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(
|