generator client {
  provider = "prisma-client-js"
}

datasource db {
  provider = "sqlite"
  url      = env("DATABASE_URL")
}

model User {
  id              String    @id @default(uuid())
  email           String    @unique
  password        String?   // Optionnel pour les utilisateurs Google
  name            String
  googleId        String?   @unique // ID Google pour SSO
  stripeId        String    @unique
  subscription    String?
  resetToken      String?   // Token pour la réinitialisation du mot de passe
  resetTokenExpiry DateTime? // Date d'expiration du token
  createdAt       DateTime  @default(now())
  updatedAt       DateTime  @updatedAt
  recipes         Recipe[]
}

model Recipe {
  id              String   @id @default(uuid())
  title           String
  ingredients     String
  userPrompt      String
  generatedRecipe String
  audioUrl        String?
  imageUrl        String?
  preparationTime Int?
  cookingTime     Int?
  servings        Int?
  difficulty      String?
  steps           String?
  tips            String?
  userId          String
  user            User     @relation(fields: [userId], references: [id])
  createdAt       DateTime @default(now())
  updatedAt       DateTime @updatedAt
}