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 import-commissions.ts

Steven Teye590b5f88848
diff --git a/apps/web/lib/firstpromoter/import-commissions.ts b/apps/web/lib/firstpromoter/import-commissions.ts
index 239ce3dab1..baeb9c5c1c 100644
--- a/apps/web/lib/firstpromoter/import-commissions.ts
+++ b/apps/web/lib/firstpromoter/import-commissions.ts
@@ -188,7 +188,6 @@ async function createCommission({
});
if (commissionFound) {
- console.log(`Commission ${commission.id} already exists, skipping...`);
return;
}
@@ -231,12 +230,12 @@ async function createCommission({
const chargedAt = new Date(commission.created_at);
const trackedCommission = await prisma.commission.findFirst({
where: {
+ customerId: customer.id,
programId: program.id,
createdAt: {
gte: new Date(chargedAt.getTime() - 60 * 60 * 1000), // 1 hour before
lte: new Date(chargedAt.getTime() + 60 * 60 * 1000), // 1 hour after
},
- customerId: customer.id,
type: "sale",
amount: saleAmount,
},