2026-01-20 17:20:13 +01:00
|
|
|
// This is your Prisma schema file,
|
|
|
|
|
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
|
|
|
|
|
|
|
|
|
generator client {
|
|
|
|
|
provider = "prisma-client-js"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
datasource db {
|
|
|
|
|
provider = "sqlite"
|
|
|
|
|
url = env("DATABASE_URL")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
model User {
|
|
|
|
|
id String @id @default(cuid())
|
|
|
|
|
email String @unique
|
|
|
|
|
password String
|
|
|
|
|
name String?
|
|
|
|
|
createdAt DateTime @default(now())
|
|
|
|
|
updatedAt DateTime @updatedAt
|
|
|
|
|
}
|
2026-01-20 18:08:06 +01:00
|
|
|
|
|
|
|
|
model Chauffeur {
|
|
|
|
|
id String @id @default(cuid())
|
|
|
|
|
nom String
|
|
|
|
|
prenom String
|
|
|
|
|
dateNaissance DateTime
|
|
|
|
|
telephone String
|
|
|
|
|
email String
|
|
|
|
|
adresse String
|
|
|
|
|
heuresContrat Int @default(35) // Nombre d'heures dans le contrat (ex: 35h)
|
|
|
|
|
dateDebutContrat DateTime // Date de début du contrat
|
|
|
|
|
dateFinContrat DateTime? // Date de fin du contrat (modifiable à tout moment, peut être null)
|
|
|
|
|
heuresRestantes Int @default(35) // Heures restantes (calculé/géré séparément)
|
|
|
|
|
status String @default("Disponible") // Disponible, Vacances, Arrêt Maladie
|
|
|
|
|
createdAt DateTime @default(now())
|
|
|
|
|
updatedAt DateTime @updatedAt
|
2026-01-21 17:34:48 +01:00
|
|
|
trajets Trajet[] // Relation avec les trajets
|
2026-01-20 18:08:06 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
model UniversPro {
|
|
|
|
|
id String @id @default(cuid())
|
|
|
|
|
nom String
|
|
|
|
|
prenom String
|
|
|
|
|
telephone String
|
|
|
|
|
email String
|
|
|
|
|
adresse String // Adresse de résidence
|
|
|
|
|
nomEntreprise String
|
|
|
|
|
createdAt DateTime @default(now())
|
|
|
|
|
updatedAt DateTime @updatedAt
|
|
|
|
|
}
|
2026-01-20 19:02:49 +01:00
|
|
|
|
|
|
|
|
model Adherent {
|
|
|
|
|
id String @id @default(cuid())
|
|
|
|
|
nom String
|
|
|
|
|
prenom String
|
|
|
|
|
dateNaissance DateTime
|
|
|
|
|
adresse String // Adresse de résidence
|
|
|
|
|
email String
|
|
|
|
|
telephone String
|
|
|
|
|
// Informations complémentaires
|
|
|
|
|
situation String? // Sélecteur à option
|
|
|
|
|
prescripteur String? // Sélecteur à option
|
|
|
|
|
facturation String? // Sélecteur à option
|
|
|
|
|
commentaire String? // Texte libre
|
|
|
|
|
telephoneSecondaire String? // Téléphone secondaire
|
|
|
|
|
instructions String? // Instructions
|
|
|
|
|
createdAt DateTime @default(now())
|
|
|
|
|
updatedAt DateTime @updatedAt
|
2026-01-21 17:34:48 +01:00
|
|
|
trajets Trajet[] // Relation avec les trajets
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
model Trajet {
|
|
|
|
|
id String @id @default(cuid())
|
|
|
|
|
date DateTime // Date et heure du trajet
|
|
|
|
|
adresseDepart String // Adresse de départ
|
|
|
|
|
adresseArrivee String // Adresse d'arrivée
|
|
|
|
|
commentaire String? // Commentaire optionnel
|
|
|
|
|
statut String @default("Planifié") // Planifié, En cours, Terminé, Annulé
|
|
|
|
|
adherentId String // Référence à l'adhérent
|
|
|
|
|
adherent Adherent @relation(fields: [adherentId], references: [id])
|
|
|
|
|
chauffeurId String? // Référence au chauffeur (optionnel)
|
|
|
|
|
chauffeur Chauffeur? @relation(fields: [chauffeurId], references: [id])
|
|
|
|
|
createdAt DateTime @default(now())
|
|
|
|
|
updatedAt DateTime @updatedAt
|
2026-01-20 19:02:49 +01:00
|
|
|
}
|