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 workflows.ts

Kiran K079c5abd1de8
diff --git a/apps/web/lib/zod/schemas/workflows.ts b/apps/web/lib/zod/schemas/workflows.ts
index 654a7b152e..533a2a4396 100644
--- a/apps/web/lib/zod/schemas/workflows.ts
+++ b/apps/web/lib/zod/schemas/workflows.ts
@@ -4,15 +4,16 @@ import { z } from "zod";
// WIP(kiran)
export const WORKFLOW_CONDITION_ATTRIBUTES = [
- "clicks",
- "leads",
- "sales",
- "clickEarnings",
- "leadEarnings",
- "saleEarnings",
- "saleRevenue",
- "earnings",
- "revenue",
+ "totalClicks",
+ "totalLeads",
+ "totalSales",
+ "totalClickEarnings",
+ "totalLeadEarnings",
+ "totalSaleEarnings",
+ "totalSaleRevenue",
+ "totalEarnings",
+ "totalRevenue",
+ "programDuration",
] as const;
export const WORKFLOW_CONDITION_OPERATORS = ["gt", "gte", "eq"] as const;
@@ -20,8 +21,8 @@ export const WORKFLOW_CONDITION_OPERATORS = ["gt", "gte", "eq"] as const;
export const WORKFLOW_ACTION_TYPES = [
"awardBounty",
"moveToGroup",
- // "sendEmail",
- // "triggerWebhook",
+ "sendEmail",
+ "triggerWebhook",
] as const;
// Individual condition
@@ -49,7 +50,14 @@ const workflowActionSchema = z.discriminatedUnion("type", [
z.object({
type: z.literal("moveToGroup"),
data: z.object({
- newGroupId: z.string(),
+ groupId: z.string(),
+ }),
+ }),
+
+ z.object({
+ type: z.literal("sendEmail"),
+ data: z.object({
+ emailId: z.string(),
}),
}),
]);