Skip to content

Commit e29f749

Browse files
committed
Add support for starter, accelerate, and scale tiers (#6735)
fixes: CORE-826 # Add support for new pricing tiers in ticket creation This PR adds support for the new pricing tiers (starter, accelerate, scale) in the ticket creation system. It updates the `planToCustomerId` mapping to include these new tiers and improves the fallback logic to use the free tier when a customer's plan doesn't have a corresponding Unthread customer ID.
1 parent 2a7df33 commit e29f749

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

apps/dashboard/src/app/(dashboard)/support/create-ticket/components/create-ticket.action.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ const UNTHREAD_API_KEY = process.env.UNTHREAD_API_KEY || "";
1515

1616
const planToCustomerId = {
1717
free: process.env.UNTHREAD_FREE_TIER_ID as string,
18+
// treat starter as free
19+
starter: process.env.UNTHREAD_FREE_TIER_ID as string,
1820
growth: process.env.UNTHREAD_GROWTH_TIER_ID as string,
21+
accelerate: process.env.UNTHREAD_ACCELERATE_TIER_ID as string,
22+
scale: process.env.UNTHREAD_SCALE_TIER_ID as string,
1923
pro: process.env.UNTHREAD_PRO_TIER_ID as string,
2024
} as const;
2125

@@ -99,7 +103,8 @@ export async function createTicketAction(
99103
}
100104

101105
const customerId = isValidPlan(team.supportPlan)
102-
? planToCustomerId[team.supportPlan]
106+
? // fall back to "free" tier
107+
planToCustomerId[team.supportPlan] || planToCustomerId.free
103108
: // fallback to "free" tier
104109
planToCustomerId.free;
105110

0 commit comments

Comments
 (0)