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.

Add "Advanced" plan

Steven Teyb226dd6d591a
diff --git a/apps/web/app/api/customers/[id]/route.ts b/apps/web/app/api/customers/[id]/route.ts
index 4ceabbb735..ef98e0c4ef 100644
--- a/apps/web/app/api/customers/[id]/route.ts
+++ b/apps/web/app/api/customers/[id]/route.ts
@@ -72,6 +72,7 @@ export const GET = withWorkspace(
"business plus",
"business extra",
"business max",
+ "advanced",
"enterprise",
],
},
@@ -166,6 +167,7 @@ export const PATCH = withWorkspace(
"business plus",
"business extra",
"business max",
+ "advanced",
"enterprise",
],
},
@@ -197,6 +199,7 @@ export const DELETE = withWorkspace(
"business plus",
"business extra",
"business max",
+ "advanced",
"enterprise",
],
},
diff --git a/apps/web/app/api/customers/route.ts b/apps/web/app/api/customers/route.ts
index bcaf897993..557d925f72 100644
--- a/apps/web/app/api/customers/route.ts
+++ b/apps/web/app/api/customers/route.ts
@@ -141,6 +141,7 @@ export const GET = withWorkspace(
"business plus",
"business extra",
"business max",
+ "advanced",
"enterprise",
],
},
@@ -193,6 +194,7 @@ export const POST = withWorkspace(
"business plus",
"business extra",
"business max",
+ "advanced",
"enterprise",
],
},
diff --git a/apps/web/app/api/events/export/route.ts b/apps/web/app/api/events/export/route.ts
index 9893bc62ee..88e4fa77d1 100644
--- a/apps/web/app/api/events/export/route.ts
+++ b/apps/web/app/api/events/export/route.ts
@@ -120,6 +120,7 @@ export const GET = withWorkspace(
"business plus",
"business extra",
"business max",
+ "advanced",
"enterprise",
],
requiredPermissions: ["analytics.read"],
diff --git a/apps/web/app/api/events/route.ts b/apps/web/app/api/events/route.ts
index 2dad9b1c65..efcb8bfa09 100644
--- a/apps/web/app/api/events/route.ts
+++ b/apps/web/app/api/events/route.ts
@@ -90,6 +90,7 @@ export const GET = withWorkspace(
"business plus",
"business extra",
"business max",
+ "advanced",
"enterprise",
],
requiredPermissions: ["analytics.read"],
diff --git a/apps/web/app/api/folders/[folderId]/route.ts b/apps/web/app/api/folders/[folderId]/route.ts
index db3aebc462..e8a21b577a 100644
--- a/apps/web/app/api/folders/[folderId]/route.ts
+++ b/apps/web/app/api/folders/[folderId]/route.ts
@@ -31,6 +31,7 @@ export const GET = withWorkspace(
"business plus",
"business extra",
"business max",
+ "advanced",
"enterprise",
],
featureFlag: "linkFolders",
@@ -100,6 +101,7 @@ export const PATCH = withWorkspace(
"business plus",
"business extra",
"business max",
+ "advanced",
"enterprise",
],
featureFlag: "linkFolders",
@@ -170,6 +172,7 @@ export const DELETE = withWorkspace(
"business plus",
"business extra",
"business max",
+ "advanced",
"enterprise",
],
featureFlag: "linkFolders",
diff --git a/apps/web/app/api/folders/[folderId]/users/route.ts b/apps/web/app/api/folders/[folderId]/users/route.ts
index c499559ed4..bcc42a9abe 100644
--- a/apps/web/app/api/folders/[folderId]/users/route.ts
+++ b/apps/web/app/api/folders/[folderId]/users/route.ts
@@ -79,6 +79,7 @@ export const GET = withWorkspace(
"business plus",
"business extra",
"business max",
+ "advanced",
"enterprise",
],
featureFlag: "linkFolders",
diff --git a/apps/web/app/api/folders/access-requests/route.ts b/apps/web/app/api/folders/access-requests/route.ts
index 041cec065a..2f112be7ba 100644
--- a/apps/web/app/api/folders/access-requests/route.ts
+++ b/apps/web/app/api/folders/access-requests/route.ts
@@ -25,6 +25,7 @@ export const GET = withWorkspace(
"business plus",
"business extra",
"business max",
+ "advanced",
"enterprise",
],
featureFlag: "linkFolders",
diff --git a/apps/web/app/api/folders/permissions/route.ts b/apps/web/app/api/folders/permissions/route.ts
index 9c0f90192f..6edc71d688 100644
--- a/apps/web/app/api/folders/permissions/route.ts
+++ b/apps/web/app/api/folders/permissions/route.ts
@@ -53,6 +53,7 @@ export const GET = withWorkspace(
"business plus",
"business extra",
"business max",
+ "advanced",
"enterprise",
],
featureFlag: "linkFolders",
diff --git a/apps/web/app/api/folders/route.ts b/apps/web/app/api/folders/route.ts
index 1026ef5a49..68150d8678 100644
--- a/apps/web/app/api/folders/route.ts
+++ b/apps/web/app/api/folders/route.ts
@@ -40,6 +40,7 @@ export const GET = withWorkspace(
"business plus",
"business extra",
"business max",
+ "advanced",
"enterprise",
],
featureFlag: "linkFolders",
@@ -120,6 +121,7 @@ export const POST = withWorkspace(
"business plus",
"business extra",
"business max",
+ "advanced",
"enterprise",
],
featureFlag: "linkFolders",
diff --git a/apps/web/app/api/partners/count/route.ts b/apps/web/app/api/partners/count/route.ts
index 44761fd6b5..fbcf13de81 100644
--- a/apps/web/app/api/partners/count/route.ts
+++ b/apps/web/app/api/partners/count/route.ts
@@ -187,6 +187,7 @@ export const GET = withWorkspace(
"business extra",
"business max",
"business plus",
+ "advanced",
"enterprise",
],
},
diff --git a/apps/web/app/api/partners/export/route.ts b/apps/web/app/api/partners/export/route.ts
index dc34d921d8..d5bd01aaa7 100644
--- a/apps/web/app/api/partners/export/route.ts
+++ b/apps/web/app/api/partners/export/route.ts
@@ -82,6 +82,7 @@ export const GET = withWorkspace(
"business extra",
"business max",
"business plus",
+ "advanced",
"enterprise",
],
},
diff --git a/apps/web/app/api/partners/links/route.ts b/apps/web/app/api/partners/links/route.ts
index 4b417bd799..ef035f9513 100644
--- a/apps/web/app/api/partners/links/route.ts
+++ b/apps/web/app/api/partners/links/route.ts
@@ -99,6 +99,7 @@ export const POST = withWorkspace(
"business extra",
"business max",
"business plus",
+ "advanced",
"enterprise",
],
},
diff --git a/apps/web/app/api/partners/route.ts b/apps/web/app/api/partners/route.ts
index 26a3e77768..91c9ac296a 100644
--- a/apps/web/app/api/partners/route.ts
+++ b/apps/web/app/api/partners/route.ts
@@ -49,6 +49,7 @@ export const GET = withWorkspace(
"business extra",
"business max",
"business plus",
+ "advanced",
"enterprise",
],
},
@@ -111,6 +112,7 @@ export const POST = withWorkspace(
"business extra",
"business max",
"business plus",
+ "advanced",
"enterprise",
],
},
diff --git a/apps/web/app/api/partners/sales/route.ts b/apps/web/app/api/partners/sales/route.ts
index 831f3f5468..f1a3a472a0 100644
--- a/apps/web/app/api/partners/sales/route.ts
+++ b/apps/web/app/api/partners/sales/route.ts
@@ -144,6 +144,7 @@ export const PATCH = withWorkspace(
"business extra",
"business max",
"business plus",
+ "advanced",
"enterprise",
],
},
diff --git a/apps/web/app/api/shopify/integration/callback/route.ts b/apps/web/app/api/shopify/integration/callback/route.ts
index 8015512048..900d364e4d 100644
--- a/apps/web/app/api/shopify/integration/callback/route.ts
+++ b/apps/web/app/api/shopify/integration/callback/route.ts
@@ -91,6 +91,7 @@ export const PATCH = withWorkspace(
"business plus",
"business extra",
"business max",
+ "advanced",
"enterprise",
],
},
diff --git a/apps/web/app/api/stripe/integration/route.ts b/apps/web/app/api/stripe/integration/route.ts
index 40a09ad381..94c5ac24e6 100644
--- a/apps/web/app/api/stripe/integration/route.ts
+++ b/apps/web/app/api/stripe/integration/route.ts
@@ -99,6 +99,7 @@ export const PATCH = withWorkspace(
"business plus",
"business extra",
"business max",
+ "advanced",
"enterprise",
],
},
diff --git a/apps/web/app/api/tokens/embed/referrals/route.ts b/apps/web/app/api/tokens/embed/referrals/route.ts
index 57afed1088..b349a08d11 100644
--- a/apps/web/app/api/tokens/embed/referrals/route.ts
+++ b/apps/web/app/api/tokens/embed/referrals/route.ts
@@ -124,12 +124,6 @@ export const POST = withWorkspace(
},
{
requiredPermissions: ["links.write"],
- requiredPlan: [
- "business",
- "business plus",
- "business extra",
- "business max",
- "enterprise",
- ],
+ requiredPlan: ["advanced", "enterprise"],
},
);
diff --git a/apps/web/app/api/track/lead/route.ts b/apps/web/app/api/track/lead/route.ts
index 3ba6abd90b..26e143c81e 100644
--- a/apps/web/app/api/track/lead/route.ts
+++ b/apps/web/app/api/track/lead/route.ts
@@ -276,6 +276,7 @@ export const POST = withWorkspace(
"business plus",
"business extra",
"business max",
+ "advanced",
"enterprise",
],
},
diff --git a/apps/web/app/api/track/sale/route.ts b/apps/web/app/api/track/sale/route.ts
index c592e3e6e0..ee04604f70 100644
--- a/apps/web/app/api/track/sale/route.ts
+++ b/apps/web/app/api/track/sale/route.ts
@@ -295,6 +295,7 @@ export const POST = withWorkspace(
"business plus",
"business extra",
"business max",
+ "advanced",
"enterprise",
],
},
diff --git a/apps/web/app/api/webhooks/[webhookId]/events/route.ts b/apps/web/app/api/webhooks/[webhookId]/events/route.ts
index 7c7c289c1f..e4d8272f2c 100644
--- a/apps/web/app/api/webhooks/[webhookId]/events/route.ts
+++ b/apps/web/app/api/webhooks/[webhookId]/events/route.ts
@@ -33,6 +33,7 @@ export const GET = withWorkspace(
"business plus",
"business extra",
"business max",
+ "advanced",
"enterprise",
],
},
diff --git a/apps/web/app/api/webhooks/[webhookId]/route.ts b/apps/web/app/api/webhooks/[webhookId]/route.ts
index 128dd7362d..9e79b951bf 100644
--- a/apps/web/app/api/webhooks/[webhookId]/route.ts
+++ b/apps/web/app/api/webhooks/[webhookId]/route.ts
@@ -43,6 +43,7 @@ export const GET = withWorkspace(
"business plus",
"business extra",
"business max",
+ "advanced",
"enterprise",
],
},
@@ -242,6 +243,7 @@ export const PATCH = withWorkspace(
"business plus",
"business extra",
"business max",
+ "advanced",
"enterprise",
],
},
@@ -321,6 +323,7 @@ export const DELETE = withWorkspace(
"business plus",
"business extra",
"business max",
+ "advanced",
"enterprise",
],
},
diff --git a/apps/web/app/api/webhooks/route.ts b/apps/web/app/api/webhooks/route.ts
index dffb2aee0e..d836b67e06 100644
--- a/apps/web/app/api/webhooks/route.ts
+++ b/apps/web/app/api/webhooks/route.ts
@@ -52,6 +52,7 @@ export const GET = withWorkspace(
"business plus",
"business extra",
"business max",
+ "advanced",
"enterprise",
],
},
@@ -193,6 +194,7 @@ export const POST = withWorkspace(
"business plus",
"business extra",
"business max",
+ "advanced",
"enterprise",
],
},
diff --git a/apps/web/lib/auth/workspace.ts b/apps/web/lib/auth/workspace.ts
index bf95d94530..703d653223 100644
--- a/apps/web/lib/auth/workspace.ts
+++ b/apps/web/lib/auth/workspace.ts
@@ -45,6 +45,7 @@ export const withWorkspace = (
"business plus",
"business max",
"business extra",
+ "advanced",
"enterprise",
], // if the action needs a specific plan
featureFlag, // if the action needs a specific feature flag
diff --git a/apps/web/lib/partners/constants.ts b/apps/web/lib/partners/constants.ts
index 5d985b0004..ee91786c42 100644
--- a/apps/web/lib/partners/constants.ts
+++ b/apps/web/lib/partners/constants.ts
@@ -3,6 +3,10 @@ export const SALES_PAGE_SIZE = 8;
export const PAYOUT_FEES = {
business: {
+ ach: 0.07,
+ card: 0.1,
+ },
+ advanced: {
ach: 0.05,
card: 0.08,
},
diff --git a/apps/web/lib/types.ts b/apps/web/lib/types.ts
index 263e9b3b0a..bd025b04b8 100644
--- a/apps/web/lib/types.ts
+++ b/apps/web/lib/types.ts
@@ -252,6 +252,7 @@ export const plans = [
"business plus",
"business extra",
"business max",
+ "advanced",
"enterprise",
] as const;
diff --git a/apps/web/ui/layout/sidebar/workspace-dropdown.tsx b/apps/web/ui/layout/sidebar/workspace-dropdown.tsx
index 88196d1bed..043e8a5661 100644
--- a/apps/web/ui/layout/sidebar/workspace-dropdown.tsx
+++ b/apps/web/ui/layout/sidebar/workspace-dropdown.tsx
@@ -295,8 +295,10 @@ function WorkspaceList({
const getPlanColor = (plan: string) =>
plan === "enterprise"
? "text-purple-700"
- : plan.startsWith("business")
- ? "text-blue-900"
- : plan === "pro"
- ? "text-cyan-900"
- : "text-neutral-500";
+ : plan === "advanced"
+ ? "text-orange-900"
+ : plan.startsWith("business")
+ ? "text-blue-900"
+ : plan === "pro"
+ ? "text-cyan-900"
+ : "text-neutral-500";