Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

add Payout table

Kiran Kf6eafd0f487f
diff --git a/apps/web/prisma/schema/payout.prisma b/apps/web/prisma/schema/payout.prisma
new file mode 100644
index 0000000000..3336a86d37
--- /dev/null
+++ b/apps/web/prisma/schema/payout.prisma
@@ -0,0 +1,33 @@
+enum PayoutStatus {
+ created
+ pending
+ failed
+ completed
+ reversed
+ canceled
+ flagged
+}
+
+enum PayoutMethod {
+ ach
+ manual
+}
+
+model Payout {
+ id String @id @default(cuid())
+ workspaceId String
+ subtotal Int
+ taxes Int
+ total Int
+ payoutFee Int
+ netTotal Int
+ currency String @default("USD")
+ status PayoutStatus @default(pending)
+ due DateTime
+ createdAt DateTime @default(now())
+ updatedAt DateTime @updatedAt
+
+ workspace Project @relation(fields: [workspaceId], references: [id])
+
+ @@index([workspaceId])
+}
diff --git a/apps/web/prisma/schema/workspace.prisma b/apps/web/prisma/schema/workspace.prisma
index 362b08a0ee..d9c61e8d2d 100644
--- a/apps/web/prisma/schema/workspace.prisma
+++ b/apps/web/prisma/schema/workspace.prisma
@@ -59,6 +59,7 @@ model Project {
registeredDomains RegisteredDomain[]
dashboards Dashboard[]
utmTemplates UtmTemplate[]
+ payouts Payout[]
@@index(usageLastChecked(sort: Asc))
}