Files
cfw-autumn/server/tests/balances/utils/getCustomerEntitlements.ts
2026-02-23 12:28:33 +00:00

26 lines
572 B
TypeScript

import { fullCustomerToCustomerEntitlements } from "@autumn/shared";
import type { TestContext } from "@tests/utils/testInitUtils/createTestContext.js";
import { CusService } from "@/internal/customers/CusService.js";
export const getCustomerEntitlement = async ({
ctx,
customerId,
featureId,
}: {
ctx: TestContext;
customerId: string;
featureId?: string;
}) => {
const fullCustomer = await CusService.getFull({
ctx,
idOrInternalId: customerId,
});
const cusEnts = fullCustomerToCustomerEntitlements({
fullCustomer,
featureId,
});
return cusEnts;
};