Skip to content

[service-utils] Remove starter_legacy plan type #7276

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/many-hounds-wave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@thirdweb-dev/service-utils": patch
---

remove:
- `starter_legacy` plan type
- `billingPlanVersion` field
- `growthTrialEligible` field
1 change: 0 additions & 1 deletion apps/dashboard/src/@/components/blocks/pricing-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ const billingPlanToSkuMap: Record<Team["billingPlan"], ProductSKU | undefined> =
accelerate: undefined,
free: undefined,
growth_legacy: undefined,
starter_legacy: undefined,
};

type FeatureItemProps = {
Expand Down
6 changes: 2 additions & 4 deletions apps/dashboard/src/app/(app)/components/TeamPlanBadge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const teamPlanToBadgeVariant: Record<
free: "secondary",
// yellow
starter: "warning",
starter_legacy: "warning",

growth_legacy: "warning",
// green
accelerate: "success",
Expand All @@ -28,9 +28,7 @@ export function getTeamPlanBadgeLabel(plan: Team["billingPlan"]) {
if (plan === "growth_legacy") {
return "Growth - Legacy";
}
if (plan === "starter_legacy") {
return "Starter - Legacy";
}

return plan;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ export const Free: Story = {
},
};

export const StarterLegacy: Story = {
args: {
plan: "starter_legacy",
},
};

export const Starter: Story = {
args: {
plan: "starter",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,7 @@ export function PlanInfoCardUI(props: {
<div className="flex flex-col items-start gap-0.5">
<div className="flex items-center gap-2">
<h3 className="font-semibold text-2xl capitalize tracking-tight">
{validPlan === "growth_legacy"
? "Growth"
: validPlan === "starter_legacy"
? "Starter"
: validPlan}{" "}
Plan
{validPlan === "growth_legacy" ? "Growth" : validPlan} Plan
</h3>
{validPlan.includes("legacy") && (
<Badge variant="warning">Legacy</Badge>
Expand Down
37 changes: 0 additions & 37 deletions apps/dashboard/src/app/(app)/team/[team_slug]/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { getTeamBySlug } from "@/api/team";
import { Button } from "@/components/ui/button";
import { TrackedLinkTW } from "@/components/ui/tracked-link";
import { PosthogIdentifierServer } from "components/wallets/PosthogIdentifierServer";
import { ArrowRightIcon } from "lucide-react";
import { redirect } from "next/navigation";
import { Suspense } from "react";
import { getAuthToken } from "../../api/lib/getAuthToken";
Expand Down Expand Up @@ -50,10 +47,6 @@ export default async function RootTeamLayout(props: {
return <PastDueBanner teamSlug={team_slug} />;
}

if (team.billingPlan === "starter_legacy") {
return <StarterLegacyDiscontinuedBanner teamSlug={team_slug} />;
}

return null;
})()}

Expand All @@ -71,33 +64,3 @@ export default async function RootTeamLayout(props: {
</div>
);
}

function StarterLegacyDiscontinuedBanner(props: {
teamSlug: string;
}) {
return (
<div className="border-red-600 border-b bg-red-50 px-4 py-6 text-red-800 dark:border-red-700 dark:bg-red-950 dark:text-red-100">
<div className="text-center">
<p>Starter legacy plans are being discontinued on May 31, 2025</p>
<p>
To prevent service interruptions and losing access to your current
features select a new plan
</p>
<Button
asChild
size="sm"
className="mt-3 gap-2 border border-red-600 bg-red-100 text-red-800 hover:bg-red-200 dark:border-red-700 dark:bg-red-900 dark:text-red-100 dark:hover:bg-red-800"
>
<TrackedLinkTW
href={`/team/${props.teamSlug}/~/settings/billing?showPlans=true`}
category="billingBanner"
label="starterLegacy_selectPlan"
>
Select a new plan
<ArrowRightIcon className="size-4" />
</TrackedLinkTW>
</Button>
</div>
</div>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ function Variants(props: {
(t) => t.team.billingPlan === "starter",
);

const starterLegacyTeam = teamsAndProjectsStub.find(
(t) => t.team.billingPlan === "starter_legacy",
);

const growthTeam = teamsAndProjectsStub.find(
(t) => t.team.billingPlan === "growth",
);
Expand Down Expand Up @@ -80,8 +76,7 @@ function Variants(props: {
!growthLegacyTeam ||
!accelerateTeam ||
!scaleTeam ||
!proTeam ||
!starterLegacyTeam
!proTeam
) {
return <div> invalid storybook stubs </div>;
}
Expand All @@ -97,10 +92,6 @@ function Variants(props: {
<Variant team={starterTeam.team} type={props.type} />
</BadgeContainer>

<BadgeContainer label="Legacy Starter Plan">
<Variant team={starterLegacyTeam.team} type={props.type} />
</BadgeContainer>

<BadgeContainer label="Growth Plan">
<Variant team={growthTeam.team} type={props.type} />
</BadgeContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,7 @@ export const PlanToCreditsRecord: Record<Team["billingPlan"], CreditsRecord> = {
plan: "starter",
...tier1Credits,
},
starter_legacy: {
plan: "starter_legacy",
...tier1Credits,
},

growth: {
plan: "growth",
...tier1Credits,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ function Variants() {

const plans: Team["billingPlan"][] = [
"free",
"starter_legacy",
"starter",
"growth_legacy",
"growth",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { PRO_CONTACT_US_URL } from "../../../../constants/pro";
// this is used to determine whether to show "Upgrade" or "Downgrade" label based on tier level
const planToTierRecord: Record<Team["billingPlan"], number> = {
free: 0,
starter_legacy: 1,
starter: 2,
growth_legacy: 3,
growth: 4,
Expand Down Expand Up @@ -71,11 +70,7 @@ export const BillingPricing: React.FC<BillingPricingProps> = ({
validTeamPlan === "starter" ||
validTeamPlan === "growth_legacy"));

const highlightStarterPlan =
highlightPlan === "starter" ||
(!highlightPlan &&
!isCurrentPlanScheduledToCancel &&
validTeamPlan === "starter_legacy");
const highlightStarterPlan = highlightPlan === "starter";
const highlightScalePlan =
highlightPlan === "scale" ||
(!highlightPlan &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import type { Team } from "@/api/team";
export const planToTierRecordForGating: Record<Team["billingPlan"], number> = {
free: 0,
starter: 1,
starter_legacy: 2,
growth: 3,
accelerate: 4,
growth_legacy: 5,
Expand Down
6 changes: 0 additions & 6 deletions apps/dashboard/src/stories/stubs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ export function teamStub(id: string, billingPlan: Team["billingPlan"]): Team {
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
billingEmail: "foo@example.com",
growthTrialEligible: false,
billingPlanVersion: 1,
canCreatePublicChains: null,
image: null,
isOnboarded: true,
Expand Down Expand Up @@ -132,10 +130,6 @@ export const teamsAndProjectsStub: Array<{ team: Team; projects: Project[] }> =
team: teamStub("2", "starter"),
projects: [projectStub("t2p1", "team-2"), projectStub("t2p2", "team-2")],
},
{
team: teamStub("3", "starter_legacy"),
projects: [projectStub("t3p1", "team-3"), projectStub("t2p2", "team-2")],
},
{
team: teamStub("3", "growth"),
projects: [projectStub("t3p1", "team-3"), projectStub("t2p2", "team-2")],
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/src/utils/pricing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { Team } from "@/api/team";
type SelectivePlans = Exclude<
Team["billingPlan"],
// we will never show cards for these plans - so exclude it
"accelerate" | "growth_legacy" | "free" | "starter_legacy"
"accelerate" | "growth_legacy" | "free"
>;

export const TEAM_PLANS: Record<
Expand Down
3 changes: 0 additions & 3 deletions packages/service-utils/src/core/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ type TeamCapabilities = {
type TeamPlan =
| "free"
| "starter"
| "starter_legacy"
| "growth_legacy"
| "growth"
| "accelerate"
Expand All @@ -119,7 +118,6 @@ export type TeamResponse = {
image: string | null;
billingPlan: TeamPlan;
supportPlan: TeamPlan;
billingPlanVersion: number;
createdAt: string;
updatedAt: string | null;
billingEmail: string | null;
Expand All @@ -133,7 +131,6 @@ export type TeamResponse = {
| "invalidPayment"
| "pastDue"
| null;
growthTrialEligible: false;
canCreatePublicChains: boolean | null;
enabledScopes: ServiceName[];
isOnboarded: boolean;
Expand Down
2 changes: 0 additions & 2 deletions packages/service-utils/src/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,8 @@ export const validTeamResponse: TeamResponse = {
updatedAt: new Date("2024-06-01").toISOString(),
billingPlan: "free",
supportPlan: "free",
billingPlanVersion: 1,
billingEmail: "test@example.com",
billingStatus: "noPayment",
growthTrialEligible: false,
canCreatePublicChains: false,
enabledScopes: ["storage", "rpc", "bundler"],
isOnboarded: true,
Expand Down
Loading