Files
cfw-autumn/shared/utils/cusEntUtils/classifyCusEnt/cusEntsHaveUnlimited.ts
2026-04-13 10:24:58 +01:00

19 lines
605 B
TypeScript

import type { FullCusEntWithFullCusProduct } from "../../../models/cusProductModels/cusEntModels/cusEntWithProduct.js";
import { AllowanceType } from "../../../models/productModels/entModels/entModels.js";
export const cusEntsHaveUnlimited = ({
cusEnts,
internalFeatureId,
}: {
cusEnts: FullCusEntWithFullCusProduct[];
internalFeatureId: string;
}) => {
return cusEnts.some(
(customerEntitlement) =>
customerEntitlement.internal_feature_id === internalFeatureId &&
(customerEntitlement.entitlement.allowance_type ===
AllowanceType.Unlimited ||
customerEntitlement.unlimited),
);
};