wip(freight): migration 0017 + model/column-list groundwork for add-freight-templates
This commit is contained in:
+351
-35
@@ -73,7 +73,10 @@ const SHOPS = [
|
||||
region: "New York",
|
||||
address: { en: "88 Hudson Yards, New York", zh: "纽约哈德逊城市广场 88 号" },
|
||||
notice: { en: "Same-day dispatch before 3 PM.", zh: "下午 3 点前下单当天发货。" },
|
||||
after_sale: { en: "Nationwide warranty, support 9:00-21:00.", zh: "全国联保,客服 9:00-21:00。" },
|
||||
after_sale: {
|
||||
en: "Nationwide warranty, support 9:00-21:00.",
|
||||
zh: "全国联保,客服 9:00-21:00。",
|
||||
},
|
||||
score_rating: 4.7,
|
||||
score_agreement: 4.6,
|
||||
score_service: 4.8,
|
||||
@@ -109,7 +112,10 @@ const SHOPS = [
|
||||
region: "Oregon",
|
||||
address: { en: "45 Willamette Loop, Portland", zh: "波特兰威拉米特环路 45 号" },
|
||||
notice: { en: "Cold-chain delivery, next-day slots.", zh: "全程冷链,次日达时段可选。" },
|
||||
after_sale: { en: "Fresh items refunded on delivery issues.", zh: "生鲜配送问题可直接退款。" },
|
||||
after_sale: {
|
||||
en: "Fresh items refunded on delivery issues.",
|
||||
zh: "生鲜配送问题可直接退款。",
|
||||
},
|
||||
score_rating: 4.6,
|
||||
score_agreement: 4.5,
|
||||
score_service: 4.7,
|
||||
@@ -175,8 +181,18 @@ for (const def of SHOPS) {
|
||||
|
||||
// 2b. shop coupons: deterministic, idempotent by localized title.
|
||||
const DEMO_COUPONS = [
|
||||
{ title: { en: "$5 off over $59", zh: "满 59 减 5" }, amount_minor: 500, threshold_minor: 5900, stock: 200 },
|
||||
{ title: { en: "$15 off over $199", zh: "满 199 减 15" }, amount_minor: 1500, threshold_minor: 19900, stock: 100 },
|
||||
{
|
||||
title: { en: "$5 off over $59", zh: "满 59 减 5" },
|
||||
amount_minor: 500,
|
||||
threshold_minor: 5900,
|
||||
stock: 200,
|
||||
},
|
||||
{
|
||||
title: { en: "$15 off over $199", zh: "满 199 减 15" },
|
||||
amount_minor: 1500,
|
||||
threshold_minor: 19900,
|
||||
stock: 100,
|
||||
},
|
||||
];
|
||||
let demoShopId = "";
|
||||
{
|
||||
@@ -214,8 +230,25 @@ await call("POST", "/auth/register", {
|
||||
const existing = (await call("GET", "/addresses", { token: customerToken })).data;
|
||||
if (Array.isArray(existing) && existing.length === 0) {
|
||||
const demoAddresses = [
|
||||
{ recipient: "Demo Customer", phone: "+1 555 0100", country: "US", region: "California", city: "Cupertino", line1: "1 Infinite Loop", postal_code: "95014", is_default: true },
|
||||
{ recipient: "Demo Customer", phone: "+1 555 0100", country: "US", region: "New York", city: "New York", line1: "88 Fifth Ave", postal_code: "10011" },
|
||||
{
|
||||
recipient: "Demo Customer",
|
||||
phone: "+1 555 0100",
|
||||
country: "US",
|
||||
region: "California",
|
||||
city: "Cupertino",
|
||||
line1: "1 Infinite Loop",
|
||||
postal_code: "95014",
|
||||
is_default: true,
|
||||
},
|
||||
{
|
||||
recipient: "Demo Customer",
|
||||
phone: "+1 555 0100",
|
||||
country: "US",
|
||||
region: "New York",
|
||||
city: "New York",
|
||||
line1: "88 Fifth Ave",
|
||||
postal_code: "10011",
|
||||
},
|
||||
];
|
||||
for (const address of demoAddresses) {
|
||||
r = await call("POST", "/addresses", { token: customerToken, body: address });
|
||||
@@ -249,36 +282,294 @@ if (cats.length < 7) {
|
||||
// every home floor is non-empty.
|
||||
const products = [
|
||||
// demo-store
|
||||
{ shop: "demo-store", slug: "wireless-headphones", category: "electronics-audio", price: 7999, stock: 25, name: { en: "Wireless Headphones", zh: "无线耳机" }, description: { en: "Noise-cancelling over-ear headphones with 40h battery.", zh: "降噪头戴式耳机,40 小时续航。" }, img: "headphones" },
|
||||
{ shop: "demo-store", slug: "mechanical-keyboard", category: "computers-keyboards", price: 12900, stock: 40, name: { en: "Mechanical Keyboard", zh: "机械键盘" }, description: { en: "Hot-swappable 75% keyboard, gasket mount.", zh: "热插拔 75% 配列机械键盘,Gasket 结构。" }, img: "keyboard" },
|
||||
{ shop: "demo-store", slug: "linen-shirt", category: "fashion-shirts", price: 4599, stock: 60, name: { en: "Linen Shirt", zh: "亚麻衬衫" }, description: { en: "Breathable 100% linen shirt.", zh: "透气纯亚麻衬衫。" }, img: "shirt" },
|
||||
{ shop: "demo-store", slug: "ceramic-mug", category: "home-cookers", price: 1999, stock: 100, name: { en: "Ceramic Mug", zh: "陶瓷马克杯" }, description: { en: "Hand-glazed 350ml mug.", zh: "手工上釉 350ml 马克杯。" }, img: "mug" },
|
||||
{ shop: "demo-store", slug: "canvas-backpack", category: "fashion-backpacks", price: 3999, stock: 45, name: { en: "Canvas Backpack", zh: "帆布双肩包" }, description: { en: "Water-resistant 22L everyday backpack.", zh: "防泼水 22L 通勤双肩包。" }, img: "backpack" },
|
||||
{ shop: "demo-store", slug: "merino-sweater", category: "fashion-menswear", price: 6900, stock: 30, name: { en: "Merino Sweater", zh: "美利奴羊毛衫" }, description: { en: "Fine-gauge merino crew neck.", zh: "细针美利奴圆领毛衣。" }, img: "sweater" },
|
||||
{
|
||||
shop: "demo-store",
|
||||
slug: "wireless-headphones",
|
||||
category: "electronics-audio",
|
||||
price: 7999,
|
||||
stock: 25,
|
||||
name: { en: "Wireless Headphones", zh: "无线耳机" },
|
||||
description: {
|
||||
en: "Noise-cancelling over-ear headphones with 40h battery.",
|
||||
zh: "降噪头戴式耳机,40 小时续航。",
|
||||
},
|
||||
img: "headphones",
|
||||
},
|
||||
{
|
||||
shop: "demo-store",
|
||||
slug: "mechanical-keyboard",
|
||||
category: "computers-keyboards",
|
||||
price: 12900,
|
||||
stock: 40,
|
||||
name: { en: "Mechanical Keyboard", zh: "机械键盘" },
|
||||
description: {
|
||||
en: "Hot-swappable 75% keyboard, gasket mount.",
|
||||
zh: "热插拔 75% 配列机械键盘,Gasket 结构。",
|
||||
},
|
||||
img: "keyboard",
|
||||
},
|
||||
{
|
||||
shop: "demo-store",
|
||||
slug: "linen-shirt",
|
||||
category: "fashion-shirts",
|
||||
price: 4599,
|
||||
stock: 60,
|
||||
name: { en: "Linen Shirt", zh: "亚麻衬衫" },
|
||||
description: { en: "Breathable 100% linen shirt.", zh: "透气纯亚麻衬衫。" },
|
||||
img: "shirt",
|
||||
},
|
||||
{
|
||||
shop: "demo-store",
|
||||
slug: "ceramic-mug",
|
||||
category: "home-cookers",
|
||||
price: 1999,
|
||||
stock: 100,
|
||||
name: { en: "Ceramic Mug", zh: "陶瓷马克杯" },
|
||||
description: { en: "Hand-glazed 350ml mug.", zh: "手工上釉 350ml 马克杯。" },
|
||||
img: "mug",
|
||||
},
|
||||
{
|
||||
shop: "demo-store",
|
||||
slug: "canvas-backpack",
|
||||
category: "fashion-backpacks",
|
||||
price: 3999,
|
||||
stock: 45,
|
||||
name: { en: "Canvas Backpack", zh: "帆布双肩包" },
|
||||
description: { en: "Water-resistant 22L everyday backpack.", zh: "防泼水 22L 通勤双肩包。" },
|
||||
img: "backpack",
|
||||
},
|
||||
{
|
||||
shop: "demo-store",
|
||||
slug: "merino-sweater",
|
||||
category: "fashion-menswear",
|
||||
price: 6900,
|
||||
stock: 30,
|
||||
name: { en: "Merino Sweater", zh: "美利奴羊毛衫" },
|
||||
description: { en: "Fine-gauge merino crew neck.", zh: "细针美利奴圆领毛衣。" },
|
||||
img: "sweater",
|
||||
},
|
||||
|
||||
// aurora-digital
|
||||
{ shop: "aurora-digital", slug: "aurora-x1-pro", category: "electronics-flagship", price: 99900, stock: 12, name: { en: "Aurora X1 Pro", zh: "Aurora X1 Pro 旗舰手机" }, description: { en: "6.7in flagship with triple camera and 120Hz display.", zh: "6.7 英寸三摄旗舰,120Hz 屏幕。" }, img: "aurora-x1" },
|
||||
{ shop: "aurora-digital", slug: "aurora-a3", category: "electronics-budget", price: 19900, stock: 60, name: { en: "Aurora A3", zh: "Aurora A3 手机" }, description: { en: "Everyday 5G phone with 5000mAh battery.", zh: "日常 5G 手机,5000mAh 电池。" }, img: "aurora-a3" },
|
||||
{ shop: "aurora-digital", slug: "aurora-buds-air", category: "electronics-earbuds", price: 12900, stock: 80, name: { en: "Aurora Buds Air", zh: "Aurora Buds Air 耳机" }, description: { en: "Active noise cancelling true wireless earbuds.", zh: "主动降噪真无线耳机。" }, img: "aurora-buds" },
|
||||
{ shop: "aurora-digital", slug: "aurora-boom-speaker", category: "electronics-speakers", price: 8900, stock: 35, name: { en: "Aurora Boom Speaker", zh: "Aurora Boom 音箱" }, description: { en: "Portable IPX7 speaker with 20h playback.", zh: "IPX7 防水便携音箱,20 小时播放。" }, img: "aurora-boom" },
|
||||
{ shop: "aurora-digital", slug: "aurora-ultrabook-14", category: "computers-ultrabooks", price: 129900, stock: 18, name: { en: "Aurora Ultrabook 14", zh: "Aurora 轻薄本 14" }, description: { en: "1.1kg magnesium chassis with 14in OLED panel.", zh: "1.1kg 镁合金机身,14 英寸 OLED 屏。" }, img: "aurora-ultrabook" },
|
||||
{ shop: "aurora-digital", slug: "aurora-27-monitor", category: "computers-monitors", price: 34900, stock: 22, name: { en: "Aurora 27 Monitor", zh: "Aurora 27 英寸显示器" }, description: { en: "27in 4K USB-C monitor with 90W power delivery.", zh: "27 英寸 4K USB-C 显示器,90W 反向供电。" }, img: "aurora-monitor" },
|
||||
{
|
||||
shop: "aurora-digital",
|
||||
slug: "aurora-x1-pro",
|
||||
category: "electronics-flagship",
|
||||
price: 99900,
|
||||
stock: 12,
|
||||
name: { en: "Aurora X1 Pro", zh: "Aurora X1 Pro 旗舰手机" },
|
||||
description: {
|
||||
en: "6.7in flagship with triple camera and 120Hz display.",
|
||||
zh: "6.7 英寸三摄旗舰,120Hz 屏幕。",
|
||||
},
|
||||
img: "aurora-x1",
|
||||
},
|
||||
{
|
||||
shop: "aurora-digital",
|
||||
slug: "aurora-a3",
|
||||
category: "electronics-budget",
|
||||
price: 19900,
|
||||
stock: 60,
|
||||
name: { en: "Aurora A3", zh: "Aurora A3 手机" },
|
||||
description: {
|
||||
en: "Everyday 5G phone with 5000mAh battery.",
|
||||
zh: "日常 5G 手机,5000mAh 电池。",
|
||||
},
|
||||
img: "aurora-a3",
|
||||
},
|
||||
{
|
||||
shop: "aurora-digital",
|
||||
slug: "aurora-buds-air",
|
||||
category: "electronics-earbuds",
|
||||
price: 12900,
|
||||
stock: 80,
|
||||
name: { en: "Aurora Buds Air", zh: "Aurora Buds Air 耳机" },
|
||||
description: {
|
||||
en: "Active noise cancelling true wireless earbuds.",
|
||||
zh: "主动降噪真无线耳机。",
|
||||
},
|
||||
img: "aurora-buds",
|
||||
},
|
||||
{
|
||||
shop: "aurora-digital",
|
||||
slug: "aurora-boom-speaker",
|
||||
category: "electronics-speakers",
|
||||
price: 8900,
|
||||
stock: 35,
|
||||
name: { en: "Aurora Boom Speaker", zh: "Aurora Boom 音箱" },
|
||||
description: {
|
||||
en: "Portable IPX7 speaker with 20h playback.",
|
||||
zh: "IPX7 防水便携音箱,20 小时播放。",
|
||||
},
|
||||
img: "aurora-boom",
|
||||
},
|
||||
{
|
||||
shop: "aurora-digital",
|
||||
slug: "aurora-ultrabook-14",
|
||||
category: "computers-ultrabooks",
|
||||
price: 129900,
|
||||
stock: 18,
|
||||
name: { en: "Aurora Ultrabook 14", zh: "Aurora 轻薄本 14" },
|
||||
description: {
|
||||
en: "1.1kg magnesium chassis with 14in OLED panel.",
|
||||
zh: "1.1kg 镁合金机身,14 英寸 OLED 屏。",
|
||||
},
|
||||
img: "aurora-ultrabook",
|
||||
},
|
||||
{
|
||||
shop: "aurora-digital",
|
||||
slug: "aurora-27-monitor",
|
||||
category: "computers-monitors",
|
||||
price: 34900,
|
||||
stock: 22,
|
||||
name: { en: "Aurora 27 Monitor", zh: "Aurora 27 英寸显示器" },
|
||||
description: {
|
||||
en: "27in 4K USB-C monitor with 90W power delivery.",
|
||||
zh: "27 英寸 4K USB-C 显示器,90W 反向供电。",
|
||||
},
|
||||
img: "aurora-monitor",
|
||||
},
|
||||
|
||||
// nordwind-home
|
||||
{ shop: "nordwind-home", slug: "nordwind-rice-cooker", category: "home-cookers", price: 8900, stock: 50, name: { en: "Nordwind Rice Cooker", zh: "北风智能电饭煲" }, description: { en: "IH rice cooker with 12 presets.", zh: "IH 电磁加热,12 种预设菜单。" }, img: "nordwind-cooker" },
|
||||
{ shop: "nordwind-home", slug: "nordwind-blender-pro", category: "home-blenders", price: 15900, stock: 28, name: { en: "Nordwind Blender Pro", zh: "北风破壁机 Pro" }, description: { en: "1400W high-speed blender with vacuum jar.", zh: "1400W 高速破壁机,配真空杯。" }, img: "nordwind-blender" },
|
||||
{ shop: "nordwind-home", slug: "nordwind-stick-vacuum", category: "home-vacuums", price: 24900, stock: 24, name: { en: "Nordwind Stick Vacuum", zh: "北风无线吸尘器" }, description: { en: "Cordless vacuum with 60min runtime.", zh: "无线手持吸尘器,续航 60 分钟。" }, img: "nordwind-vacuum" },
|
||||
{ shop: "nordwind-home", slug: "nordwind-air-purifier", category: "home-purifiers", price: 32900, stock: 20, name: { en: "Nordwind Air Purifier", zh: "北风空气净化器" }, description: { en: "HEPA 13 purifier covering 60 square metres.", zh: "HEPA 13 滤网,适用 60 平方米。" }, img: "nordwind-purifier" },
|
||||
{ shop: "nordwind-home", slug: "nordwind-serum-c", category: "beauty-serums", price: 4900, stock: 70, name: { en: "Nordwind Vitamin C Serum", zh: "北风维C精华" }, description: { en: "15% vitamin C brightening serum.", zh: "15% 维C 提亮精华。" }, img: "nordwind-serum" },
|
||||
{ shop: "nordwind-home", slug: "nordwind-shave-9000", category: "beauty-shavers", price: 7900, stock: 40, name: { en: "Nordwind Shaver 9000", zh: "北风剃须刀 9000" }, description: { en: "Wet and dry rotary shaver with travel case.", zh: "干湿两用旋转剃须刀,含旅行盒。" }, img: "nordwind-shaver" },
|
||||
{
|
||||
shop: "nordwind-home",
|
||||
slug: "nordwind-rice-cooker",
|
||||
category: "home-cookers",
|
||||
price: 8900,
|
||||
stock: 50,
|
||||
name: { en: "Nordwind Rice Cooker", zh: "北风智能电饭煲" },
|
||||
description: { en: "IH rice cooker with 12 presets.", zh: "IH 电磁加热,12 种预设菜单。" },
|
||||
img: "nordwind-cooker",
|
||||
},
|
||||
{
|
||||
shop: "nordwind-home",
|
||||
slug: "nordwind-blender-pro",
|
||||
category: "home-blenders",
|
||||
price: 15900,
|
||||
stock: 28,
|
||||
name: { en: "Nordwind Blender Pro", zh: "北风破壁机 Pro" },
|
||||
description: {
|
||||
en: "1400W high-speed blender with vacuum jar.",
|
||||
zh: "1400W 高速破壁机,配真空杯。",
|
||||
},
|
||||
img: "nordwind-blender",
|
||||
},
|
||||
{
|
||||
shop: "nordwind-home",
|
||||
slug: "nordwind-stick-vacuum",
|
||||
category: "home-vacuums",
|
||||
price: 24900,
|
||||
stock: 24,
|
||||
name: { en: "Nordwind Stick Vacuum", zh: "北风无线吸尘器" },
|
||||
description: {
|
||||
en: "Cordless vacuum with 60min runtime.",
|
||||
zh: "无线手持吸尘器,续航 60 分钟。",
|
||||
},
|
||||
img: "nordwind-vacuum",
|
||||
},
|
||||
{
|
||||
shop: "nordwind-home",
|
||||
slug: "nordwind-air-purifier",
|
||||
category: "home-purifiers",
|
||||
price: 32900,
|
||||
stock: 20,
|
||||
name: { en: "Nordwind Air Purifier", zh: "北风空气净化器" },
|
||||
description: {
|
||||
en: "HEPA 13 purifier covering 60 square metres.",
|
||||
zh: "HEPA 13 滤网,适用 60 平方米。",
|
||||
},
|
||||
img: "nordwind-purifier",
|
||||
},
|
||||
{
|
||||
shop: "nordwind-home",
|
||||
slug: "nordwind-serum-c",
|
||||
category: "beauty-serums",
|
||||
price: 4900,
|
||||
stock: 70,
|
||||
name: { en: "Nordwind Vitamin C Serum", zh: "北风维C精华" },
|
||||
description: { en: "15% vitamin C brightening serum.", zh: "15% 维C 提亮精华。" },
|
||||
img: "nordwind-serum",
|
||||
},
|
||||
{
|
||||
shop: "nordwind-home",
|
||||
slug: "nordwind-shave-9000",
|
||||
category: "beauty-shavers",
|
||||
price: 7900,
|
||||
stock: 40,
|
||||
name: { en: "Nordwind Shaver 9000", zh: "北风剃须刀 9000" },
|
||||
description: {
|
||||
en: "Wet and dry rotary shaver with travel case.",
|
||||
zh: "干湿两用旋转剃须刀,含旅行盒。",
|
||||
},
|
||||
img: "nordwind-shaver",
|
||||
},
|
||||
|
||||
// terra-grocery
|
||||
{ shop: "terra-grocery", slug: "terra-mixed-nuts", category: "grocery-nuts", price: 1599, stock: 200, name: { en: "Terra Mixed Nuts", zh: "大地混合坚果" }, description: { en: "Roasted unsalted nut mix, 500g.", zh: "烘烤无盐混合坚果,500g。" }, img: "terra-nuts" },
|
||||
{ shop: "terra-grocery", slug: "terra-dark-chocolate", category: "grocery-chocolate", price: 1299, stock: 180, name: { en: "Terra Dark Chocolate", zh: "大地黑巧克力" }, description: { en: "72% single-origin dark chocolate.", zh: "72% 单一产地黑巧克力。" }, img: "terra-chocolate" },
|
||||
{ shop: "terra-grocery", slug: "terra-orchard-apples", category: "grocery-fruit", price: 899, stock: 300, name: { en: "Terra Orchard Apples", zh: "大地果园苹果" }, description: { en: "Crisp orchard apples, 1kg box.", zh: "脆甜果园苹果,1kg 装。" }, img: "terra-apples" },
|
||||
{ shop: "terra-grocery", slug: "terra-organic-kale", category: "grocery-vegetables", price: 699, stock: 260, name: { en: "Terra Organic Kale", zh: "大地有机羽衣甘蓝" }, description: { en: "Certified organic kale, 400g.", zh: "有机认证羽衣甘蓝,400g。" }, img: "terra-kale" },
|
||||
{ shop: "terra-grocery", slug: "terra-carry-on", category: "fashion-luggage", price: 42900, stock: 16, name: { en: "Terra Carry-On", zh: "大地登机箱" }, description: { en: "Polycarbonate carry-on with TSA lock.", zh: "聚碳酸酯登机箱,TSA 密码锁。" }, img: "terra-carryon" },
|
||||
{ shop: "terra-grocery", slug: "terra-leather-tote", category: "fashion-bags", price: 21900, stock: 26, name: { en: "Terra Leather Tote", zh: "大地真皮托特包" }, description: { en: "Full-grain leather tote with laptop sleeve.", zh: "头层牛皮托特包,含电脑隔层。" }, img: "terra-tote" },
|
||||
{
|
||||
shop: "terra-grocery",
|
||||
slug: "terra-mixed-nuts",
|
||||
category: "grocery-nuts",
|
||||
price: 1599,
|
||||
stock: 200,
|
||||
name: { en: "Terra Mixed Nuts", zh: "大地混合坚果" },
|
||||
description: { en: "Roasted unsalted nut mix, 500g.", zh: "烘烤无盐混合坚果,500g。" },
|
||||
img: "terra-nuts",
|
||||
},
|
||||
{
|
||||
shop: "terra-grocery",
|
||||
slug: "terra-dark-chocolate",
|
||||
category: "grocery-chocolate",
|
||||
price: 1299,
|
||||
stock: 180,
|
||||
name: { en: "Terra Dark Chocolate", zh: "大地黑巧克力" },
|
||||
description: { en: "72% single-origin dark chocolate.", zh: "72% 单一产地黑巧克力。" },
|
||||
img: "terra-chocolate",
|
||||
},
|
||||
{
|
||||
shop: "terra-grocery",
|
||||
slug: "terra-orchard-apples",
|
||||
category: "grocery-fruit",
|
||||
price: 899,
|
||||
stock: 300,
|
||||
name: { en: "Terra Orchard Apples", zh: "大地果园苹果" },
|
||||
description: { en: "Crisp orchard apples, 1kg box.", zh: "脆甜果园苹果,1kg 装。" },
|
||||
img: "terra-apples",
|
||||
},
|
||||
{
|
||||
shop: "terra-grocery",
|
||||
slug: "terra-organic-kale",
|
||||
category: "grocery-vegetables",
|
||||
price: 699,
|
||||
stock: 260,
|
||||
name: { en: "Terra Organic Kale", zh: "大地有机羽衣甘蓝" },
|
||||
description: { en: "Certified organic kale, 400g.", zh: "有机认证羽衣甘蓝,400g。" },
|
||||
img: "terra-kale",
|
||||
},
|
||||
{
|
||||
shop: "terra-grocery",
|
||||
slug: "terra-carry-on",
|
||||
category: "fashion-luggage",
|
||||
price: 42900,
|
||||
stock: 16,
|
||||
name: { en: "Terra Carry-On", zh: "大地登机箱" },
|
||||
description: {
|
||||
en: "Polycarbonate carry-on with TSA lock.",
|
||||
zh: "聚碳酸酯登机箱,TSA 密码锁。",
|
||||
},
|
||||
img: "terra-carryon",
|
||||
},
|
||||
{
|
||||
shop: "terra-grocery",
|
||||
slug: "terra-leather-tote",
|
||||
category: "fashion-bags",
|
||||
price: 21900,
|
||||
stock: 26,
|
||||
name: { en: "Terra Leather Tote", zh: "大地真皮托特包" },
|
||||
description: {
|
||||
en: "Full-grain leather tote with laptop sleeve.",
|
||||
zh: "头层牛皮托特包,含电脑隔层。",
|
||||
},
|
||||
img: "terra-tote",
|
||||
},
|
||||
];
|
||||
|
||||
// 5b. brands (admin-managed reference data), then assign one per product
|
||||
@@ -364,11 +655,36 @@ console.log(`products ready: ${products.length} across ${SHOPS.length} shops`);
|
||||
// 6. points mall products (idempotent by English name). The demo customer's
|
||||
// spendable points are credited by the API through the account ledger.
|
||||
const POINTS_PRODUCTS = [
|
||||
{ name: { en: "Insulated Mug", zh: "保温杯" }, image: "/mock/product-9.svg", points_price: 1200, stock: 300 },
|
||||
{ name: { en: "Canvas Tote", zh: "帆布手提袋" }, image: "/mock/product-15.svg", points_price: 600, stock: 500 },
|
||||
{ name: { en: "Phone Stand", zh: "手机支架" }, image: "/mock/product-7.svg", points_price: 400, stock: 800 },
|
||||
{ name: { en: "Cable Organizer Set", zh: "数据线收纳套装" }, image: "/mock/product-3.svg", points_price: 300, stock: 1000 },
|
||||
{ name: { en: "Notebook A5", zh: "A5 笔记本" }, image: "/mock/product-14.svg", points_price: 250, stock: 1200 },
|
||||
{
|
||||
name: { en: "Insulated Mug", zh: "保温杯" },
|
||||
image: "/mock/product-9.svg",
|
||||
points_price: 1200,
|
||||
stock: 300,
|
||||
},
|
||||
{
|
||||
name: { en: "Canvas Tote", zh: "帆布手提袋" },
|
||||
image: "/mock/product-15.svg",
|
||||
points_price: 600,
|
||||
stock: 500,
|
||||
},
|
||||
{
|
||||
name: { en: "Phone Stand", zh: "手机支架" },
|
||||
image: "/mock/product-7.svg",
|
||||
points_price: 400,
|
||||
stock: 800,
|
||||
},
|
||||
{
|
||||
name: { en: "Cable Organizer Set", zh: "数据线收纳套装" },
|
||||
image: "/mock/product-3.svg",
|
||||
points_price: 300,
|
||||
stock: 1000,
|
||||
},
|
||||
{
|
||||
name: { en: "Notebook A5", zh: "A5 笔记本" },
|
||||
image: "/mock/product-14.svg",
|
||||
points_price: 250,
|
||||
stock: 1200,
|
||||
},
|
||||
];
|
||||
{
|
||||
const listed = await call("GET", "/admin/points/products", { token: admin });
|
||||
|
||||
Reference in New Issue
Block a user