diff --git a/apps/web/modules/ee/billing/actions.test.ts b/apps/web/modules/ee/billing/actions.test.ts index aa4bc8f91d..35b98bce5e 100644 --- a/apps/web/modules/ee/billing/actions.test.ts +++ b/apps/web/modules/ee/billing/actions.test.ts @@ -1,5 +1,5 @@ import { beforeEach, describe, expect, test, vi } from "vitest"; -import { startScaleTrialAction, stayOnHobbyAction } from "./actions"; +import { startHobbyAction, startScaleTrialAction } from "./actions"; const mocks = vi.hoisted(() => ({ checkAuthorizationUpdated: vi.fn(), @@ -83,8 +83,8 @@ describe("billing actions", () => { mocks.syncOrganizationBillingFromStripe.mockResolvedValue(undefined); }); - test("stayOnHobbyAction ensures a customer, reconciles hobby, and syncs billing", async () => { - const result = await stayOnHobbyAction({ + test("startHobbyAction ensures a customer, reconciles hobby, and syncs billing", async () => { + const result = await startHobbyAction({ ctx: { user: { id: "user_1" } }, parsedInput: { organizationId: "org_1" }, } as any); @@ -103,7 +103,7 @@ describe("billing actions", () => { expect(mocks.ensureStripeCustomerForOrganization).toHaveBeenCalledWith("org_1"); expect(mocks.reconcileCloudStripeSubscriptionsForOrganization).toHaveBeenCalledWith( "org_1", - "stay-on-hobby" + "start-hobby" ); expect(mocks.syncOrganizationBillingFromStripe).toHaveBeenCalledWith("org_1"); expect(result).toEqual({ success: true }); diff --git a/apps/web/modules/ee/billing/actions.ts b/apps/web/modules/ee/billing/actions.ts index 4f1114ab2c..ebb89c657e 100644 --- a/apps/web/modules/ee/billing/actions.ts +++ b/apps/web/modules/ee/billing/actions.ts @@ -150,7 +150,7 @@ const ZStartScaleTrialAction = z.object({ organizationId: ZId, }); -export const stayOnHobbyAction = authenticatedActionClient +export const startHobbyAction = authenticatedActionClient .inputSchema(ZStartScaleTrialAction) .action(async ({ ctx, parsedInput }) => { await checkAuthorizationUpdated({ @@ -174,7 +174,7 @@ export const stayOnHobbyAction = authenticatedActionClient throw new ResourceNotFoundError("OrganizationBilling", parsedInput.organizationId); } - await reconcileCloudStripeSubscriptionsForOrganization(parsedInput.organizationId, "stay-on-hobby"); + await reconcileCloudStripeSubscriptionsForOrganization(parsedInput.organizationId, "start-hobby"); await syncOrganizationBillingFromStripe(parsedInput.organizationId); return { success: true }; }); diff --git a/apps/web/modules/ee/billing/components/select-plan-card.tsx b/apps/web/modules/ee/billing/components/select-plan-card.tsx index 7ba093d6c5..7f5adc4624 100644 --- a/apps/web/modules/ee/billing/components/select-plan-card.tsx +++ b/apps/web/modules/ee/billing/components/select-plan-card.tsx @@ -11,7 +11,7 @@ import ethereumLogo from "@/images/customer-logos/ethereum-logo.png"; import flixbusLogo from "@/images/customer-logos/flixbus-white.svg"; import githubLogo from "@/images/customer-logos/github-logo.png"; import siemensLogo from "@/images/customer-logos/siemens.png"; -import { startScaleTrialAction, stayOnHobbyAction } from "@/modules/ee/billing/actions"; +import { startHobbyAction, startScaleTrialAction } from "@/modules/ee/billing/actions"; import { Button } from "@/modules/ui/components/button"; interface SelectPlanCardProps { @@ -64,7 +64,7 @@ export const SelectPlanCard = ({ nextUrl, organizationId }: SelectPlanCardProps) const handleContinueFree = async () => { setIsStayingOnHobby(true); try { - const result = await stayOnHobbyAction({ organizationId }); + const result = await startHobbyAction({ organizationId }); if (result?.data) { router.push(nextUrl); } else {