2022-03-25 12:22:27 +01:00
|
|
|
const subscriptionTypes = ["standard", "business"];
|
2022-03-25 12:18:54 +01:00
|
|
|
|
|
|
|
function subscriptionTypeSufficient(subscriptionType, requiredType) {
|
2022-03-25 12:22:27 +01:00
|
|
|
if (requiredType && !subscriptionType) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
if (requiredType === "none" || requiredType === null) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (
|
|
|
|
requiredType === "standard" &&
|
|
|
|
subscriptionTypes.includes(subscriptionType)
|
|
|
|
) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (requiredType === "business" && subscriptionType === "business") {
|
|
|
|
return true;
|
|
|
|
}
|
2022-03-25 12:18:54 +01:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2022-03-25 12:22:27 +01:00
|
|
|
export { subscriptionTypeSufficient, subscriptionTypes };
|