Treat both-null entitlements as same scope in stripe-reuse matcher

This commit is contained in:
Owen Greenhalgh
2026-05-12 17:01:46 +01:00
committed by John Yeo
parent b56239b3bb
commit 9f346dca06
2 changed files with 38 additions and 0 deletions

View File

@@ -77,6 +77,8 @@ export const getPriceStripeReuseLevel = ({
entitlements: candidateEntitlements,
});
// Both null = same (null) entity scope; both have ents = compare them.
if (!newEnt && !candidateEnt) return "full";
if (!newEnt || !candidateEnt) return "none";
if (entsAreSame(candidateEnt, newEnt)) return "full";
}
@@ -98,6 +100,7 @@ export const getPriceStripeReuseLevel = ({
entitlements: candidateEntitlements,
});
if (!newEnt && !candidateEnt) return "stripeProductOnly";
if (!newEnt || !candidateEnt) return "none";
if (newEnt.entity_feature_id !== candidateEnt.entity_feature_id) {
return "none";