import { config } from 'dotenv'; config({ path: '.env.local' }); import getDB from '../src/lib/prisma'; const prisma = getDB(); async function main() { console.log('Seeding plans...'); const plans = [ { id: 'free', name: 'free', displayName: 'Gratuit', price: 0, description: 'Idéal pour découvrir PlumeIA.', maxProjects: 1, maxAiActions: 10, features: ['10 actions IA / mois', '1 projet actif', 'Bible du monde simple'], isPopular: false, }, { id: 'pro', name: 'pro', displayName: 'Auteur Pro', price: 12, description: 'Pour les écrivains sérieux.', maxProjects: -1, // -1 means unlimited maxAiActions: 500, features: ['500 actions IA / mois', 'Projets illimités', 'Export Word & EPUB', 'Support prioritaire'], isPopular: true, }, { id: 'master', name: 'master', displayName: 'Maître Plume', price: 29, description: 'Le summum de l\'écriture IA.', maxProjects: -1, maxAiActions: -1, // -1 means unlimited features: ['Actions IA illimitées', 'Accès Gemini 3 Pro', 'Bible du monde avancée', 'Outils de révision avancés'], isPopular: false, }, ]; for (const plan of plans) { await prisma.plan.upsert({ where: { id: plan.id }, update: plan, create: plan, }); } console.log('Plans seeded successfully.'); } main() .catch((e) => { console.error(e); process.exit(1); }) .finally(async () => { await prisma.$disconnect(); });