ajout plan byok, plus correction d'affichage et navigation
This commit is contained in:
@@ -40,6 +40,10 @@ model User {
|
||||
planId String? @default("free")
|
||||
subscriptionPlan Plan? @relation(fields: [planId], references: [id])
|
||||
|
||||
// Bring Your Own Key
|
||||
customApiProvider String?
|
||||
customApiKey String?
|
||||
|
||||
aiActionsUsed Int @default(0)
|
||||
dailyWordGoal Int @default(500)
|
||||
writingStreak Int @default(0)
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
import { config } from 'dotenv';
|
||||
config({ path: '.env.local' });
|
||||
import getDB from '../src/lib/prisma';
|
||||
config();
|
||||
import { PrismaClient } from '@prisma/client';
|
||||
import { PrismaPg } from '@prisma/adapter-pg';
|
||||
import { Pool } from 'pg';
|
||||
|
||||
const prisma = getDB();
|
||||
const connectionString = process.env.DATABASE_URL;
|
||||
const pool = new Pool({ connectionString });
|
||||
const adapter = new PrismaPg(pool);
|
||||
const prisma = new PrismaClient({ adapter });
|
||||
|
||||
async function main() {
|
||||
console.log('Seeding plans...');
|
||||
@@ -41,6 +46,17 @@ async function main() {
|
||||
features: ['250 actions IA / mois', 'Accès Gemini 3 Pro', 'Bible du monde avancée', 'Outils de révision avancés'],
|
||||
isPopular: false,
|
||||
},
|
||||
{
|
||||
id: 'byok',
|
||||
name: 'byok',
|
||||
displayName: 'Clé Perso (BYOK)',
|
||||
price: 4.99,
|
||||
description: 'Utilisez vos propres clés API (ChatGPT, Claude, Gemini).',
|
||||
maxProjects: -1,
|
||||
maxAiActions: -1,
|
||||
features: ['Tokens illimités via votre clé', 'Mode Bring Your Own Key', 'Choix du modèle IA', 'Projets illimités'],
|
||||
isPopular: false,
|
||||
},
|
||||
];
|
||||
|
||||
for (const plan of plans) {
|
||||
|
||||
Reference in New Issue
Block a user