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.

workflow schema

Kiran K5f9abaaa3e07
diff --git a/apps/web/lib/zod/schemas/workflows.ts b/apps/web/lib/zod/schemas/workflows.ts
index 533a2a4396..95163ecede 100644
--- a/apps/web/lib/zod/schemas/workflows.ts
+++ b/apps/web/lib/zod/schemas/workflows.ts
@@ -1,8 +1,6 @@
import { WorkflowTrigger } from "@dub/prisma/client";
import { z } from "zod";
-// WIP(kiran)
-
export const WORKFLOW_CONDITION_ATTRIBUTES = [
"totalClicks",
"totalLeads",
@@ -13,16 +11,15 @@ export const WORKFLOW_CONDITION_ATTRIBUTES = [
"totalSaleRevenue",
"totalEarnings",
"totalRevenue",
- "programDuration",
] as const;
-export const WORKFLOW_CONDITION_OPERATORS = ["gt", "gte", "eq"] as const;
+export const WORKFLOW_CONDITION_OPERATORS = ["gte"] as const;
export const WORKFLOW_ACTION_TYPES = [
"awardBounty",
- "moveToGroup",
- "sendEmail",
- "triggerWebhook",
+ // "moveToGroup",
+ // "sendEmail",
+ // "triggerWebhook",
] as const;
// Individual condition
@@ -46,20 +43,6 @@ const workflowActionSchema = z.discriminatedUnion("type", [
bountyId: z.string(),
}),
}),
-
- z.object({
- type: z.literal("moveToGroup"),
- data: z.object({
- groupId: z.string(),
- }),
- }),
-
- z.object({
- type: z.literal("sendEmail"),
- data: z.object({
- emailId: z.string(),
- }),
- }),
]);
// Array of actions (Only supports one action for now)
diff --git a/packages/prisma/schema/workflow.prisma b/packages/prisma/schema/workflow.prisma
index c5e81d3597..7ad06b70dd 100644
--- a/packages/prisma/schema/workflow.prisma
+++ b/packages/prisma/schema/workflow.prisma
@@ -1,7 +1,8 @@
enum WorkflowTrigger {
- clicks
- leads
- sales
+ clickRecorded
+ leadRecorded
+ saleRecorded
+ commissionEarned
}
model Workflow {
@@ -19,3 +20,4 @@ model Workflow {
@@index([programId, trigger])
}
+