-
Notifications
You must be signed in to change notification settings - Fork 109
/
schema.prisma
87 lines (80 loc) · 2.43 KB
/
schema.prisma
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
}
model User {
id Int @id @default(autoincrement())
username String @unique
email String?
hasPaid Boolean @default(false)
isUsingLn Boolean @default(false)
gptModel String @default("gpt-4o-mini")
datePaid DateTime?
stripeId String?
checkoutSessionId String?
subscriptionStatus String?
notifyPaymentExpires Boolean @default(false)
credits Int @default(3)
letters CoverLetter[]
jobs Job[]
lnData LnData?
lnPayments LnPayment[]
}
model LnData {
id String @id @default(uuid())
user User? @relation(fields: [userId], references: [id], onDelete: Cascade)
userId Int? @unique
loginUrl String? @unique
k1Hash String @unique
token String?
createdAt DateTime @default(now())
updatedAt DateTime? @updatedAt
}
// type LightningInvoice = {
// status: string;
// successAction: {
// tag: string;
// message: string;
// };
// verify: string;
// routes: any[]; // You can replace this with a more specific type if needed
// pr: string;
// };
model LnPayment {
pr String @id @unique
status String
settled Boolean @default(false)
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
userId Int
amount Int?
createdAt DateTime @default(now())
updatedAt DateTime? @updatedAt
}
model CoverLetter {
id String @id @default(uuid())
title String
content String
tokenUsage Int
job Job @relation(fields: [jobId], references: [id], onDelete: Cascade)
jobId String
user User? @relation(fields: [userId], references: [id])
userId Int?
createdAt DateTime @default(now())
updatedAt DateTime? @updatedAt
}
model Job {
id String @id @default(uuid())
title String
company String
location String
description String
coverLetter CoverLetter[]
user User? @relation(fields: [userId], references: [id])
userId Int?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
isCompleted Boolean @default(false)
}