fix: 固定默认品牌解析避免多品牌串线

This commit is contained in:
que01 committed 2026-09-23 12:05:33 +08:00
1 parent 045472035b
commit cbe9d26288
4 files changed
+58 -2

No files matched your search

+48
View File
@@ -74,6 +74,54 @@ async function main(): Promise<void> {
update: { isEnabled: true, role: "owner" },
create: { adminUserId: admin.id, brandId: brand.id, role: "owner" },
});
const doorsBrand = await prisma.brandProfile.upsert({
where: { id: "00000000-0000-0000-0000-000000000002" },
update: {},
create: {
id: "00000000-0000-0000-0000-000000000002",
slug: "linjing-doors",
name: "林境门作",
templateKey: "doors",
tagline: "为别墅空间定制有秩序感的门系统",
description: "从入户大门到室内户内门,提供完整的门系统设计与落地服务。",
hours: "周一至周六 09:00-18:00",
address: "城市设计中心 3F",
contactPhone: "13800000000",
contactWechat: "linjing-doors",
},
});
for (const offering of [
{
name: "别墅入户大门",
description: "结合建筑立面与入户动线定制门体、五金和安装方案。",
priceText: "预约沟通",
sortOrder: 1,
},
{
name: "院门与围合系统",
description: "院门、围墙和庭院动线的一体化设计与施工配合。",
priceText: "预约沟通",
sortOrder: 2,
},
{
name: "室内户内门系统",
description: "根据空间风格定制户内门、隐形门和装饰门。",
priceText: "预约沟通",
sortOrder: 3,
},
]) {
await prisma.offering.upsert({
where: { brandId_name: { brandId: doorsBrand.id, name: offering.name } },
update: offering,
create: { ...offering, brandId: doorsBrand.id, kind: "service" },
});
}
await prisma.brandMembership.upsert({
where: { adminUserId_brandId: { adminUserId: admin.id, brandId: doorsBrand.id } },
update: { isEnabled: true, role: "owner" },
create: { adminUserId: admin.id, brandId: doorsBrand.id, role: "owner" },
});
}
main().finally(() => prisma.$disconnect());