Skip to content

Commit

Permalink
add workspaceId to Invoice table
Browse files Browse the repository at this point in the history
  • Loading branch information
steven-tey committed Dec 24, 2024
1 parent dfe0b19 commit e48f785
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions apps/web/lib/actions/partners/confirm-payouts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export const confirmPayoutsAction = authActionClient
data: {
id: createId({ prefix: "inv_" }),
programId,
workspaceId: workspace.id,
amount,
fee,
total,
Expand Down
6 changes: 5 additions & 1 deletion packages/prisma/schema/invoice.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,19 @@ enum InvoiceStatus {
model Invoice {
id String @id @default(cuid())
programId String
workspaceId String?
status InvoiceStatus @default(processing)
amount Int @default(0)
fee Int @default(0)
total Int @default(0)
receiptUrl String? @db.LongText
createdAt DateTime @default(now())
program Program @relation(fields: [programId], references: [id])
payouts Payout[]
program Program @relation(fields: [programId], references: [id])
workspace Project? @relation(fields: [workspaceId], references: [id])
@@index([programId])
@@index([workspaceId])
}
1 change: 1 addition & 0 deletions packages/prisma/schema/workspace.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ model Project {
domains Domain[]
tags Tag[]
programs Program[]
invoices Invoice[]
customers Customer[]
defaultDomains DefaultDomains[]
restrictedTokens RestrictedToken[]
Expand Down

0 comments on commit e48f785

Please sign in to comment.