90 lines
2.1 KiB
Plaintext
90 lines
2.1 KiB
Plaintext
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model GruppoScout {
|
|
orgId String @id @map("org_id")
|
|
nome String
|
|
regione String?
|
|
dataCreazione DateTime @default(now()) @map("data_creazione")
|
|
|
|
inviti Invito[]
|
|
richiesteIngresso RichiestaIngresso[]
|
|
linkIngresso LinkIngresso[]
|
|
|
|
@@map("gruppo_scout")
|
|
}
|
|
|
|
model Invito {
|
|
id String @id @default(uuid())
|
|
token String @unique
|
|
email String
|
|
orgId String @map("org_id")
|
|
ruolo String
|
|
scadenza DateTime
|
|
stato String
|
|
|
|
gruppoScout GruppoScout @relation(fields: [orgId], references: [orgId])
|
|
|
|
@@map("invito")
|
|
}
|
|
|
|
enum StatoRichiesta {
|
|
PENDING
|
|
APPROVATA
|
|
RIFIUTATA
|
|
}
|
|
|
|
enum OrigineRichiesta {
|
|
LINK
|
|
PROFILO
|
|
}
|
|
|
|
model RichiestaIngresso {
|
|
id String @id @default(uuid())
|
|
userId String @map("user_id")
|
|
email String
|
|
orgId String @map("org_id")
|
|
stato StatoRichiesta @default(PENDING)
|
|
origine OrigineRichiesta
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
|
|
gruppoScout GruppoScout @relation(fields: [orgId], references: [orgId])
|
|
|
|
@@index([email])
|
|
@@map("richiesta_ingresso")
|
|
}
|
|
|
|
model LinkIngresso {
|
|
id String @id @default(uuid())
|
|
token String @unique
|
|
orgId String @map("org_id")
|
|
attivo Boolean @default(true)
|
|
creatoDa String @map("creato_da")
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
|
|
gruppoScout GruppoScout @relation(fields: [orgId], references: [orgId])
|
|
|
|
@@map("link_ingresso")
|
|
}
|
|
|
|
model RichiestaCreazioneGruppo {
|
|
id String @id @default(uuid())
|
|
userId String @map("user_id")
|
|
email String
|
|
nomeProposto String @map("nome_proposto")
|
|
regione String?
|
|
stato StatoRichiesta @default(PENDING)
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
|
|
@@index([email])
|
|
@@map("richiesta_creazione_gruppo")
|
|
}
|