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.

rearrange deprecated fields

Steven Teye8c9060fee88
diff --git a/apps/web/lib/zod/schemas/leads.ts b/apps/web/lib/zod/schemas/leads.ts
index 26dd958c35..8375e53cc6 100644
--- a/apps/web/lib/zod/schemas/leads.ts
+++ b/apps/web/lib/zod/schemas/leads.ts
@@ -109,6 +109,10 @@ export const leadEventResponseSchema = z
timestamp: z.coerce.string(),
eventId: z.string(),
eventName: z.string(),
+ // nested objects
+ click: clickEventSchema,
+ link: linkEventSchema,
+ customer: customerSchema,
customer_name: z
.string()
.describe("Deprecated. Use `customer.name` instead.")
@@ -121,10 +125,6 @@ export const leadEventResponseSchema = z
.string()
.describe("Deprecated. Use `customer.avatar` instead.")
.openapi({ deprecated: true }),
- // nested objects
- click: clickEventSchema,
- link: linkEventSchema,
- customer: customerSchema,
})
.merge(commonDeprecatedEventFields)
.openapi({ ref: "LeadEvent" });
diff --git a/apps/web/lib/zod/schemas/sales.ts b/apps/web/lib/zod/schemas/sales.ts
index 319e85f715..8d829f995b 100644
--- a/apps/web/lib/zod/schemas/sales.ts
+++ b/apps/web/lib/zod/schemas/sales.ts
@@ -115,6 +115,15 @@ export const saleEventResponseSchema = z
timestamp: z.coerce.string(),
eventId: z.string(),
eventName: z.string(),
+ // nested objects
+ link: linkEventSchema,
+ click: clickEventSchema,
+ customer: customerSchema,
+ sale: trackSaleRequestSchema.pick({
+ amount: true,
+ invoiceId: true,
+ paymentProcessor: true,
+ }),
customer_name: z
.string()
.describe("Deprecated. Use `customer.name` instead.")
@@ -138,15 +147,6 @@ export const saleEventResponseSchema = z
payment_processor: z
.string()
.describe("Deprecated. Use `sale.paymentProcessor` instead."),
- // nested objects
- link: linkEventSchema,
- click: clickEventSchema,
- customer: customerSchema,
- sale: trackSaleRequestSchema.pick({
- amount: true,
- invoiceId: true,
- paymentProcessor: true,
- }),
})
.merge(commonDeprecatedEventFields)
.openapi({ ref: "SaleEvent" });