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.

Merge branch 'main' into bounties

Kiran Ka533831a0b74
diff --cc packages/prisma/schema/commission.prisma
index 651faa866f,41533debfc..3b54573c40
--- a/packages/prisma/schema/commission.prisma
+++ b/packages/prisma/schema/commission.prisma
@@@ -16,32 -16,32 +16,34 @@@ enum CommissionType
}
model Commission {
- id String @id @default(cuid())
- programId String
- partnerId String
- rewardId String?
- linkId String?
- payoutId String?
- invoiceId String? // only for sales (idempotency key, each sale event is associated with a unique invoice)
- customerId String? // only for leads and sales
- eventId String? @unique // only for leads and sales
- description String?
- type CommissionType
- amount Int // only for sales (amount of the sale event)
- quantity Int // only for clicks/leads (quantity of the event)
- earnings Int @default(0) // amount earned by the partner
- currency String @default("usd")
- status CommissionStatus @default(pending)
- userId String? // user who created the manual commission
- createdAt DateTime @default(now())
- updatedAt DateTime @updatedAt
+ id String @id @default(cuid())
+ programId String
+ partnerId String
++ rewardId String?
+ linkId String?
+ payoutId String?
+ invoiceId String? // only for sales (idempotency key, each sale event is associated with a unique invoice)
+ customerId String? // only for leads and sales
+ eventId String? @unique // only for leads and sales
+ bountySubmissionId String? @unique
+ description String?
+ type CommissionType
+ amount Int // only for sales (amount of the sale event)
+ quantity Int // only for clicks/leads (quantity of the event)
+ earnings Int @default(0) // amount earned by the partner
+ currency String @default("usd")
+ status CommissionStatus @default(pending)
+ userId String? // user who created the manual commission
+ createdAt DateTime @default(now())
+ updatedAt DateTime @updatedAt
- program Program @relation(fields: [programId], references: [id])
- partner Partner @relation(fields: [partnerId], references: [id])
- payout Payout? @relation(fields: [payoutId], references: [id])
- link Link? @relation(fields: [linkId], references: [id])
- customer Customer? @relation(fields: [customerId], references: [id])
- reward Reward? @relation(fields: [rewardId], references: [id])
+ program Program @relation(fields: [programId], references: [id])
+ partner Partner @relation(fields: [partnerId], references: [id])
+ payout Payout? @relation(fields: [payoutId], references: [id])
+ link Link? @relation(fields: [linkId], references: [id])
+ customer Customer? @relation(fields: [customerId], references: [id])
- bountySubmission BountySubmission?
++ reward Reward? @relation(fields: [rewardId], references: [id])
++ BountySubmission BountySubmission?
@@unique([invoiceId, programId])
@@index([earnings, programId, partnerId, status])