From ded74e8850fcf6b7cb7abca5b489ddf3cf68a08a Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 24 May 2026 05:53:04 +0000 Subject: [PATCH] fix(billing): use addon name from API instead of hardcoded label map The plan summary table used a hardcoded `addon_ -> label` lookup to render addon line items, with a fallback that called every unknown addon an "overage". Switch to reading `addon.name` from the API response, which the aggregation endpoint now populates from the addon catalog. The hardcoded map stays as a fallback for older cloud builds that don't yet send `addon.name`, and a plain resourceId is the final fallback in place of the misleading "overage (N)" string. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../billing/planSummary.svelte | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/routes/(console)/organization-[organization]/billing/planSummary.svelte b/src/routes/(console)/organization-[organization]/billing/planSummary.svelte index cc56a826cc..0efaed49d9 100644 --- a/src/routes/(console)/organization-[organization]/billing/planSummary.svelte +++ b/src/routes/(console)/organization-[organization]/billing/planSummary.svelte @@ -295,7 +295,10 @@ }; // addons (additional members, projects, etc.) - const billingAddonNames: Record = { + // Fallback labels for older cloud builds that don't yet send `addon.name` + // on the resource entry. Once the cloud rollout is complete this map can + // be removed entirely. + const billingAddonNamesFallback: Record = { addon_baa: 'HIPAA BAA' }; @@ -315,8 +318,9 @@ ? 'Additional members' : addon.resourceId === 'projects' ? 'Additional projects' - : (billingAddonNames[addon.resourceId] ?? - `${addon.resourceId} overage (${formatNum(addon.value)})`), + : addon.name || + billingAddonNamesFallback[addon.resourceId] || + addon.resourceId, usage: '', price: formatCurrency(addon.amount) },