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 schema definitions

Steven Tey73a9550f03f3
diff --git a/apps/web/lib/zod/schemas/partners.ts b/apps/web/lib/zod/schemas/partners.ts
index 5b3bf47074..d75a1aadc9 100644
--- a/apps/web/lib/zod/schemas/partners.ts
+++ b/apps/web/lib/zod/schemas/partners.ts
@@ -384,9 +384,7 @@ export const EnrolledPartnerSchema = PartnerSchema.pick({
totalSaleAmount: z
.number()
.default(0)
- .describe(
- "The total amount of sales (in cents) generated by the partner's links",
- ),
+ .describe("Total revenue generated by the partner's links"),
totalCommissions: z
.number()
.default(0)
@@ -396,33 +394,43 @@ export const EnrolledPartnerSchema = PartnerSchema.pick({
netRevenue: z
.number()
.default(0)
- .describe("The total net revenue generated by the partner"),
+ .describe(
+ "Net revenue after commissions (`Total Revenue - Total Commissions`)",
+ ),
earningsPerClick: z
.number()
.nullish()
- .describe("Earnings per click (totalSaleAmount / totalClicks) in cents"),
+ .describe("Earnings Per Click (EPC) (`Total Revenue ÷ Total Clicks`)"),
averageLifetimeValue: z
.number()
.nullish()
.describe(
- "Average lifetime value (totalSaleAmount / totalConversions) in cents",
+ "Average lifetime value for each paying customer (`Total Revenue ÷ Total Conversions`)",
),
clickToLeadRate: z
.number()
.nullish()
- .describe("Click to lead rate (totalLeads / totalClicks)"),
+ .describe(
+ "Percentage of clicks that become leads (`Total Leads ÷ Total Clicks`)",
+ ),
clickToConversionRate: z
.number()
.nullish()
- .describe("Click to conversion rate (totalConversions / totalClicks)"),
+ .describe(
+ "Percentage of clicks that convert to paying customers (`Total Conversions ÷ Total Clicks`)",
+ ),
leadToConversionRate: z
.number()
.nullish()
- .describe("Lead to conversion rate (totalConversions / totalLeads)"),
+ .describe(
+ "Percentage of leads that convert to paying customers (`Total Conversions ÷ Total Leads`)",
+ ),
returnOnAdSpend: z
.number()
.nullish()
- .describe("Return on ad spend (totalSaleAmount / totalCommissions)"),
+ .describe(
+ "Return On Ad Spend (ROAS) (`Total Revenue ÷ Total Commissions`)",
+ ),
})
.merge(
PartnerOnlinePresenceSchema.pick({