優惠定義範例
示範具體優惠與其資料定義方式
商品資料
假設商品資料為:
ts
import { Commodity } from '@inner-products/bgm-promotion-module'
const commodities: Commodity[] = [
{
key: '1',
name: 'A-30ml',
price: 6000
},
{
key: '2',
name: 'A-50ml',
price: 9000
},
{
key: '3',
name: 'B-30ml',
price: 6000
},
{
key: '4',
name: 'B-50ml',
price: 9000
}
]