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 backfill-sales.ts

Kiran K45876b6d3740
diff --git a/apps/web/scripts/backfill-sales.ts b/apps/web/scripts/backfill-sales.ts
index 5de3b3c965..3faf2363f2 100644
--- a/apps/web/scripts/backfill-sales.ts
+++ b/apps/web/scripts/backfill-sales.ts
@@ -47,16 +47,23 @@ async function main() {
const data = saleEvents.map((e: SaleEvent) => ({
...createSaleData({
- customerId: e.customer.id,
- linkId: e.link.id,
- clickId: e.click.id,
- invoiceId: e.invoice_id,
- eventId: e.eventId,
- paymentProcessor: e.payment_processor,
- amount: e.sale.amount,
- currency: "usd",
- partnerId,
program,
+ partner: {
+ id: partnerId,
+ commissionAmount: 0,
+ },
+ customer: {
+ id: e.customer.id,
+ linkId: e.link.id,
+ clickId: e.click.id,
+ },
+ sale: {
+ invoiceId: e.invoice_id,
+ eventId: e.eventId,
+ paymentProcessor: e.payment_processor,
+ amount: e.sale.amount,
+ currency: "usd",
+ },
metadata: e.click,
}),
createdAt: new Date(e.timestamp),