From 47225405a9be29191488bc552ec4336e17033050 Mon Sep 17 00:00:00 2001
From: naaiyy
{t("current.memberCount", { - count: entitlement.billableSeatCount, + count: entitlement.workspaceMemberCount, })} - {isPlus - ? ` · ${t("current.paidSeatCount", { - count: entitlement.paidSeatCapacity, - })}` - : null}
{effectiveThrough ? (@@ -252,21 +245,11 @@ export function BillingOverview({
{t("current.memberCount", { - count: entitlement.billableSeatCount, + count: entitlement.workspaceMemberCount, })} - {isPlus - ? ` · ${t("current.paidSeatCount", { - count: entitlement.paidSeatCapacity, - })}` - : null}
- {additionalSeats > 0 || effectiveThrough ? ( + {effectiveThrough ? (- {t("current.additionalSeats", { count: additionalSeats })} -
- ) : null} {effectiveThrough ? ({t("current.effectiveThrough", { date: effectiveThrough })} diff --git a/apps/web/features/dashboard/billing/billing-plan-cards.tsx b/apps/web/features/dashboard/billing/billing-plan-cards.tsx index 9f8d7bd2..0d3cc11b 100644 --- a/apps/web/features/dashboard/billing/billing-plan-cards.tsx +++ b/apps/web/features/dashboard/billing/billing-plan-cards.tsx @@ -157,10 +157,9 @@ export function BillingPlanCards({ )}
{t("plans.free.price")} - {" "} - - {t("plans.perMemberMonth")}
diff --git a/apps/web/features/dashboard/billing/model.test.ts b/apps/web/features/dashboard/billing/model.test.ts index c19b798e..36e07c99 100644 --- a/apps/web/features/dashboard/billing/model.test.ts +++ b/apps/web/features/dashboard/billing/model.test.ts @@ -2,7 +2,6 @@ import { describe, expect, test } from "bun:test"; import { canRequestAi, canUsePaidFeatures, - getAdditionalSeatCount, getBillingCallout, type WorkspaceBillingEntitlement, } from "./model"; @@ -10,8 +9,7 @@ import { const plusEntitlement: WorkspaceBillingEntitlement = { plan: "plus", subscriptionState: "entitled", - billableSeatCount: 3, - paidSeatCapacity: 3, + workspaceMemberCount: 3, plusEnabled: true, aiAdmissionAvailable: true, availableAiCreditUnits: 500_000n, @@ -46,22 +44,18 @@ describe("billing presentation model", () => { ).toBe(false); }); - test("reports seats beyond paid capacity without negative counts", () => { - expect(getAdditionalSeatCount(plusEntitlement)).toBe(0); - expect( - getAdditionalSeatCount({ - ...plusEntitlement, - billableSeatCount: 5, - paidSeatCapacity: 3, - }), - ).toBe(2); - expect( - getAdditionalSeatCount({ - ...plusEntitlement, - billableSeatCount: 1, - paidSeatCapacity: 3, - }), - ).toBe(0); + test("uses the accepted workspace-member count as the only member value", () => { + const freeEntitlement: WorkspaceBillingEntitlement = { + ...plusEntitlement, + plan: "free", + subscriptionState: "none", + workspaceMemberCount: 8, + plusEnabled: false, + aiAdmissionAvailable: false, + availableAiCreditUnits: 0n, + }; + + expect(freeEntitlement.workspaceMemberCount).toBe(8); }); test("maps non-entitled states to an actionable callout", () => { diff --git a/apps/web/features/dashboard/billing/model.ts b/apps/web/features/dashboard/billing/model.ts index 9e47d09d..7841ab1c 100644 --- a/apps/web/features/dashboard/billing/model.ts +++ b/apps/web/features/dashboard/billing/model.ts @@ -13,8 +13,7 @@ export type SubscriptionState = (typeof subscriptionStates)[number]; export interface WorkspaceBillingEntitlement { plan: "free" | "plus"; subscriptionState: SubscriptionState; - billableSeatCount: number; - paidSeatCapacity: number; + workspaceMemberCount: number; plusEnabled: boolean; aiAdmissionAvailable: boolean; availableAiCreditUnits: bigint; @@ -41,15 +40,6 @@ export function getBillingCallout( return entitlement.subscriptionState; } -export function getAdditionalSeatCount( - entitlement: WorkspaceBillingEntitlement, -): number { - return Math.max( - 0, - entitlement.billableSeatCount - entitlement.paidSeatCapacity, - ); -} - export function canUsePaidFeatures( entitlement: WorkspaceBillingEntitlement, ): boolean { diff --git a/apps/web/features/marketing/content-pages/content/docs/index.fr.mdx b/apps/web/features/marketing/content-pages/content/docs/index.fr.mdx index 9024bf3a..f45e4571 100644 --- a/apps/web/features/marketing/content-pages/content/docs/index.fr.mdx +++ b/apps/web/features/marketing/content-pages/content/docs/index.fr.mdx @@ -45,6 +45,9 @@ BaseBlocks est un constructeur de sites Fair Source pour les équipes. Créez de