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.

Update create-payout.ts

Tim Wilson445652168db8
diff --git a/apps/web/app/(ee)/api/cron/payouts/create-payout.ts b/apps/web/app/(ee)/api/cron/payouts/create-payout.ts
index fd640b9937..61e8f4f85f 100644
--- a/apps/web/app/(ee)/api/cron/payouts/create-payout.ts
+++ b/apps/web/app/(ee)/api/cron/payouts/create-payout.ts
@@ -62,7 +62,7 @@ export const createPayout = async ({
const [commissions, clawbacks] = await Promise.all([
// Find all pending commissions
- // We only process commissions that are custom or were created before the holding period
+ // We only process commissions that were created before the holding period
prisma.commission.findMany({
where: {
earnings: {
@@ -70,18 +70,9 @@ export const createPayout = async ({
},
...commonWhere,
...(holdingPeriodDays > 0 && {
- OR: [
- {
- createdAt: {
- lt: new Date(
- Date.now() - holdingPeriodDays * 24 * 60 * 60 * 1000,
- ),
- },
- },
- {
- type: "custom", // Custom commissions skip the holding period
- },
- ],
+ createdAt: {
+ lt: new Date(Date.now() - holdingPeriodDays * 24 * 60 * 60 * 1000),
+ },
}),
},
select: {