This commit is contained in:
Your Name committed 2026-06-28 07:58:15 -04:00
1 parent e405af357c
commit e1cf9e62e7
51 files changed
+2598 -168

No files matched your search

+91
View File
@@ -699,6 +699,97 @@ async function main() {
});
console.log("✅ Seeded default Category, Product Detail, FAQ, Wishlist, Search, Coupons, Contact, Order Success, and Track Order layouts successfully!");
// 14. Create Checkout Page Layout
const checkoutPage = await prisma.page.upsert({
where: { slug: "checkout-layout" },
update: {},
create: {
slug: "checkout-layout",
title: "Checkout Page Layout",
isPublished: true,
}
});
console.log(`✅ Created page: ${checkoutPage.title} (slug: ${checkoutPage.slug})`);
await prisma.pageSection.deleteMany({ where: { pageId: checkoutPage.id } });
await prisma.pageSection.create({
data: {
pageId: checkoutPage.id,
type: "ANNOUNCEMENT_BAR",
order: 1,
isActive: true,
payload: {
slides: ["Secure checkout powered by HomAroma — all payments are encrypted and protected", "Free shipping on orders over ฿1,500"],
backgroundColor: "#1F3D2D",
textColor: "#FDFDF9",
speed: 4000
}
}
});
await prisma.pageSection.create({
data: {
pageId: checkoutPage.id,
type: "EDITORIAL_TILE",
order: 2,
isActive: true,
payload: {
title: "Crafted for Your [Sanctuary]",
description: "Every HomAroma order is hand-packed with care using eco-conscious materials, so your botanicals arrive in perfect condition.",
imageUrl: "/images/oil_ozone.png",
imagePosition: "right",
buttonText: "Our Sustainability Promise",
buttonLink: "/about",
backgroundColor: "#FDFDF9",
textColor: "#1F3D2D"
}
}
});
// 15. Create Profile Page Layout
const profilePage = await prisma.page.upsert({
where: { slug: "profile-layout" },
update: {},
create: {
slug: "profile-layout",
title: "Profile Page Layout",
isPublished: true,
}
});
console.log(`✅ Created page: ${profilePage.title} (slug: ${profilePage.slug})`);
await prisma.pageSection.deleteMany({ where: { pageId: profilePage.id } });
await prisma.pageSection.create({
data: {
pageId: profilePage.id,
type: "ANNOUNCEMENT_BAR",
order: 1,
isActive: true,
payload: {
slides: ["Welcome back to HomAroma — manage your orders and wishlist from your profile", "Earn points with every purchase"],
backgroundColor: "#1F3D2D",
textColor: "#FDFDF9",
speed: 4000
}
}
});
await prisma.pageSection.create({
data: {
pageId: profilePage.id,
type: "NEWSLETTER",
order: 2,
isActive: true,
payload: {
title: "Exclusive Member Benefits",
description: "Subscribe to receive early access to new collections, member-only discounts, and scent guides curated just for you.",
buttonText: "Subscribe",
placeholderText: "Enter your email address",
showPrivacyCheckbox: true,
privacyText: "I agree to the privacy policy."
}
}
});
console.log("✅ Seeded checkout-layout and profile-layout successfully!");
console.log("🌱 All 15 required pages seeded successfully!");
}
main()