Files
cfw-autumn/server/tests/utils/compareV2.ts
2025-04-14 10:06:22 +01:00

24 lines
615 B
TypeScript

import { Autumn } from "@/external/autumn/autumnCli.js";
import { CusProductStatus, FeatureOptions } from "@autumn/shared";
export const compareProductV2 = async ({
autumn,
sent,
customerId,
optionsList = [],
}: {
autumn: Autumn;
sent: any;
customerId: string;
optionsList?: FeatureOptions[];
}) => {
let cusRes = await autumn.customers.get(customerId);
let { products, entitlements } = cusRes;
let product = products.find((p: any) => p.id === sent.id);
let entitlement = entitlements.find((e: any) => e.id === sent.id);
console.log("Product", product);
console.log("Sent", sent);
};