2021-08-06 16:23:33 -03:00

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: [],
}
}