fix(billing): use addon name from API instead of hardcoded label map

The plan summary table used a hardcoded `addon_<key> -> 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) <noreply@anthropic.com>
This commit is contained in:
Damodar Lohani
2026-05-24 05:53:04 +00:00
parent ffc553878d
commit ded74e8850
@@ -295,7 +295,10 @@
};
// addons (additional members, projects, etc.)
const billingAddonNames: Record<string, string> = {
// 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<string, string> = {
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)
},