-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema.prisma
More file actions
51 lines (47 loc) · 1.56 KB
/
Copy pathschema.prisma
File metadata and controls
51 lines (47 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "sqlite"
url = env("DATABASE_URL")
}
model User {
id String @id @default(uuid())
username String @unique
role String // "REQUESTER" or "APPROVER"
requestsCreated HttpRequest[] @relation("Requester")
requestsApproved HttpRequest[] @relation("Approver")
collections RequestCollection[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model HttpRequest {
id String @id @default(uuid())
requester User @relation("Requester", fields: [requesterId], references: [id])
requesterId String
approver User? @relation("Approver", fields: [approverId], references: [id])
approverId String?
method String
url String
headers String? // JSON string
body String? // Text/JSON body
status String @default("PENDING") // PENDING, APPROVED, REJECTED, EXECUTED
response String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
approvedAt DateTime?
rejectedAt DateTime?
executedAt DateTime?
}
model RequestCollection {
id String @id @default(uuid())
name String // e.g. "Stripe Webhook Sync"
creator User @relation(fields: [creatorId], references: [id])
creatorId String
method String
url String
headers String? // JSON string format
body String? // Text/JSON body
isGlobal Boolean @default(false)
createdAt DateTime @default(now())
}