forked from ZyntariHQ/Invoisio
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema.prisma
More file actions
68 lines (62 loc) · 1.84 KB
/
Copy pathschema.prisma
File metadata and controls
68 lines (62 loc) · 1.84 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// 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 = "postgresql"
url = env("DATABASE_URL")
}
model User {
id String @id @default(uuid())
walletAddress String @unique
nonce String?
nonceExpiresAt DateTime?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
invoices Invoice[]
payments Payment[]
notifications Notification[]
}
model Invoice {
id String @id @default(uuid())
userId String
user User @relation(fields: [userId], references: [id])
invoiceNumber String @unique
clientName String
clientEmail String?
currency String?
status String @default("draft")
items Json
subtotal Decimal
tax Decimal
total Decimal
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
payments Payment[]
}
model Payment {
id String @id @default(uuid())
invoiceId String
invoice Invoice @relation(fields: [invoiceId], references: [id])
userId String
user User @relation(fields: [userId], references: [id])
merchantAddress String?
token String
amount String
transactionHash String?
status String @default("pending")
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Notification {
id String @id @default(uuid())
userId String
user User @relation(fields: [userId], references: [id])
title String
description String?
type String?
read Boolean @default(false)
metadata Json?
createdAt DateTime @default(now())
}