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 setup

Steven Tey69a79a45283a
diff --git a/apps/web/lib/zod/schemas/sales.ts b/apps/web/lib/zod/schemas/sales.ts
index 4e56b4d413..5729809531 100644
--- a/apps/web/lib/zod/schemas/sales.ts
+++ b/apps/web/lib/zod/schemas/sales.ts
@@ -25,11 +25,11 @@ export const trackSaleRequestSchema = z.object({
.string()
.max(50)
.optional()
- .default("Purchased")
+ .default("Purchase completed")
.describe(
- "The name of the sale event. It can be used to track different types of event for example 'Purchase', 'Subscription', 'Upgrade', etc.",
+ "The name of the sale event. It can be used to track different types of event for example 'Purchase completed', 'Subscription created', etc.",
)
- .openapi({ example: "Purchased" }),
+ .openapi({ example: "Purchase completed" }),
invoiceId: z
.string()
.nullish()
@@ -47,13 +47,13 @@ export const trackSaleRequestSchema = z.object({
});
export const trackSaleResponseSchema = z.object({
+ eventName: z.string(),
customerId: z.string(),
amount: z.number(),
paymentProcessor: z.string(),
invoiceId: z.string().nullable(),
currency: z.string(),
metadata: z.record(z.unknown()).nullable(),
- eventName: z.string(),
});
export const saleEventSchemaTB = clickEventSchemaTB
@@ -62,8 +62,8 @@ export const saleEventSchemaTB = clickEventSchemaTB
z.object({
timestamp: z.string().optional(), //autogenerated by Tinybird
event_id: z.string(),
+ event_name: z.string().default("Purchase completed"),
customer_id: z.string(),
- event_name: z.string().default("Purchased"),
payment_processor: z.string(),
amount: z.number(),
invoice_id: z.string().default(""),
diff --git a/packages/tinybird/datasources/dub_lead_events.datasource b/packages/tinybird/datasources/dub_lead_events.datasource
index c5e6d91222..0f46d81e3a 100644
--- a/packages/tinybird/datasources/dub_lead_events.datasource
+++ b/packages/tinybird/datasources/dub_lead_events.datasource
@@ -1,7 +1,7 @@
SCHEMA >
`timestamp` DateTime64(3) `json:$.timestamp` DEFAULT now(),
`event_id` String `json:$.event_id`,
- `event_name` LowCardinality(String) `json:$.event_name`,
+ `event_name` String `json:$.event_name`,
`metadata` String `json:$.metadata`,
`customer_id` String `json:$.customer_id`,
`click_id` String `json:$.click_id`,
diff --git a/packages/tinybird/datasources/dub_sale_events.datasource b/packages/tinybird/datasources/dub_sale_events.datasource
index f83ae638d6..d40fc37071 100644
--- a/packages/tinybird/datasources/dub_sale_events.datasource
+++ b/packages/tinybird/datasources/dub_sale_events.datasource
@@ -1,6 +1,7 @@
SCHEMA >
`timestamp` DateTime64(3) `json:$.timestamp` DEFAULT now(),
`event_id` String `json:$.event_id`,
+ `event_name` String `json:$.event_name`,
`customer_id` String `json:$.customer_id`,
`payment_processor` LowCardinality(String) `json:$.payment_processor`,
`invoice_id` String `json:$.invoice_id`,
diff --git a/packages/tinybird/datasources/dub_sale_events_mv.datasource b/packages/tinybird/datasources/dub_sale_events_mv.datasource
index 7f20855046..999450e94a 100644
--- a/packages/tinybird/datasources/dub_sale_events_mv.datasource
+++ b/packages/tinybird/datasources/dub_sale_events_mv.datasource
@@ -1,6 +1,7 @@
SCHEMA >
`timestamp` DateTime64(3),
`event_id` String,
+ `event_name` String,
`click_id` String,
`link_id` String,
`customer_id` String,
diff --git a/packages/tinybird/pipes/dub_sale_events_pipe.pipe b/packages/tinybird/pipes/dub_sale_events_pipe.pipe
index 69c409e5ce..841343fb38 100644
--- a/packages/tinybird/pipes/dub_sale_events_pipe.pipe
+++ b/packages/tinybird/pipes/dub_sale_events_pipe.pipe
@@ -4,6 +4,7 @@ SQL >
SELECT
timestamp,
event_id,
+ event_name,
click_id,
link_id,
customer_id,