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.

add partnerTenantId and customerExternalId

Steven Teyb68bfbd3378b
diff --git a/apps/web/app/(ee)/api/commissions/export/route.ts b/apps/web/app/(ee)/api/commissions/export/route.ts
index b71a52eaf7..97263474cc 100644
--- a/apps/web/app/(ee)/api/commissions/export/route.ts
+++ b/apps/web/app/(ee)/api/commissions/export/route.ts
@@ -105,12 +105,21 @@ export const GET = withWorkspace(async ({ searchParams, workspace }) => {
select: {
name: true,
email: true,
+ externalId: true,
},
},
partner: {
select: {
name: true,
email: true,
+ programs: {
+ select: {
+ tenantId: true,
+ },
+ where: {
+ programId,
+ },
+ },
},
},
},
@@ -125,8 +134,10 @@ export const GET = withWorkspace(async ({ searchParams, workspace }) => {
...commission,
customerName: commission.customer?.name || "",
customerEmail: commission.customer?.email || "",
+ customerExternalId: commission.customer?.externalId || "",
partnerName: commission.partner?.name || "",
partnerEmail: commission.partner?.email || "",
+ partnerTenantId: commission.partner?.programs[0]?.tenantId || "",
}));
// Sort columns by their order
@@ -154,7 +165,7 @@ export const GET = withWorkspace(async ({ searchParams, workspace }) => {
const csvData = convertToCSV(data);
// Sanitize timestamp for filesystem compatibility (replace colons with hyphens)
- const sanitizedTimestamp = new Date().toISOString().replace(/:/g, '-');
+ const sanitizedTimestamp = new Date().toISOString().replace(/:/g, "-");
return new Response(csvData, {
headers: {
diff --git a/apps/web/lib/zod/schemas/commissions.ts b/apps/web/lib/zod/schemas/commissions.ts
index 3eaa148ef1..f4d713c9c4 100644
--- a/apps/web/lib/zod/schemas/commissions.ts
+++ b/apps/web/lib/zod/schemas/commissions.ts
@@ -229,6 +229,12 @@ export const COMMISSION_EXPORT_COLUMNS = [
type: "string",
default: false,
},
+ {
+ id: "partnerTenantId",
+ label: "Partner tenant ID",
+ type: "string",
+ default: false,
+ },
{ id: "customerId", label: "Customer ID", type: "string", default: false },
{
id: "customerName",
@@ -242,6 +248,12 @@ export const COMMISSION_EXPORT_COLUMNS = [
type: "string",
default: false,
},
+ {
+ id: "customerExternalId",
+ label: "Customer external ID",
+ type: "string",
+ default: false,
+ },
] as const;
type CommissionExportColumnId =
diff --git a/apps/web/ui/modals/export-commissions-modal.tsx b/apps/web/ui/modals/export-commissions-modal.tsx
index dca40dbbd1..5cc713a176 100644
--- a/apps/web/ui/modals/export-commissions-modal.tsx
+++ b/apps/web/ui/modals/export-commissions-modal.tsx
@@ -104,6 +104,7 @@ function ExportCommissionsModal({
<Modal
showModal={showExportCommissionsModal}
setShowModal={setShowExportCommissionsModal}
+ className="max-w-lg"
>
<div className="flex flex-col items-center justify-center space-y-3 border-b border-neutral-200 px-4 py-4 pt-8 sm:px-16">
<Logo />