mirror of
https://github.com/BreizhHardware/Site-comptage-heure.git
synced 2026-01-18 16:17:28 +01:00
55 lines
1.2 KiB
Plaintext
55 lines
1.2 KiB
Plaintext
// 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 = "file:./data/dev.db"
|
|
}
|
|
|
|
|
|
model User {
|
|
id String @id
|
|
email String @unique
|
|
password String
|
|
role Role @default(MEMBER)
|
|
hours Hour[] @relation("UserHours")
|
|
validatedHours Hour[] @relation("ValidatedHours")
|
|
firstName String?
|
|
lastName String?
|
|
passwordResetRequired Boolean @default(false)
|
|
}
|
|
|
|
model Hour {
|
|
id String @id
|
|
date DateTime
|
|
duration Int // en minutes
|
|
reason String
|
|
status Status @default(PENDING)
|
|
validatedBy User? @relation("ValidatedHours", fields: [validatedById], references: [id])
|
|
validatedById String?
|
|
user User @relation("UserHours", fields: [userId], references: [id])
|
|
userId String
|
|
}
|
|
|
|
model ClubSettings {
|
|
id String @id @default("settings")
|
|
name String
|
|
logo String // Chemin vers l'image dans /public
|
|
}
|
|
|
|
enum Role {
|
|
MEMBER
|
|
ADMIN
|
|
SUPER_ADMIN // Rôle spécial pour le premier compte
|
|
}
|
|
|
|
enum Status {
|
|
PENDING
|
|
VALIDATED
|
|
REJECTED
|
|
}
|