The price list item to validate
Type predicate indicating if the data is a valid AmbeedProductListResponsePriceList
const priceItem = product.priceList[0];
if (isAmbeedProductListResponsePriceList(priceItem)) {
console.log("Price (USD):", priceItem.pr_usd);
console.log("Size:", priceItem.pr_size);
console.log("Discount:", priceItem.discount_usd);
}
export function isAmbeedProductListResponsePriceList(
data: unknown,
): data is AmbeedProductListResponsePriceList {
return ambeedProductListResponsePriceListSchema.safeParse(data).success;
}
Type guard to validate if data matches the Ambeed price list item structure. Checks for required pricing fields including amount, USD price, discount, size, VIP price, and rate.