mirror of
https://github.com/vercel/commerce.git
synced 2025-07-07 21:31:22 +00:00
18 lines
445 B
TypeScript
18 lines
445 B
TypeScript
import type { RawProductWithPrice } from '@framework/types/product'
|
|
import type { Product } from '@commerce/types/product'
|
|
|
|
export function normalize(product: RawProductWithPrice): Product {
|
|
return {
|
|
id: product.ID,
|
|
name: product.Name,
|
|
description: product.Description,
|
|
images: [],
|
|
variants: [],
|
|
price: {
|
|
value: product.priceSchedule.PriceBreaks[0].Price,
|
|
currencyCode: 'USD',
|
|
},
|
|
options: [],
|
|
}
|
|
}
|