From ddd5247e1da29e9b725c85c374907f3706e90d1c Mon Sep 17 00:00:00 2001 From: amianthus <49116958+SirTenzin@users.noreply.github.com> Date: Wed, 25 Feb 2026 14:39:32 +0000 Subject: [PATCH] =?UTF-8?q?refactor(atmn):=20rename=20tierBehaviour=20?= =?UTF-8?q?=E2=86=92=20tierBehavior?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit American English spelling for consistency with the rest of the SDK. API wire format (tier_behaviour) is unchanged. Co-authored-by: Joe Johnson (JJ) --- atmn/src/compose/models/planModels.ts | 2 +- atmn/src/lib/transforms/apiToSdk/planItem.ts | 2 +- atmn/src/lib/transforms/sdkToApi/plan.ts | 6 +++--- atmn/src/lib/transforms/sdkToCode/planItem.ts | 6 +++--- typegen/genUtils/atmnTypeHelpers.ts | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/atmn/src/compose/models/planModels.ts b/atmn/src/compose/models/planModels.ts index 7f0d6f45..f5d2de22 100644 --- a/atmn/src/compose/models/planModels.ts +++ b/atmn/src/compose/models/planModels.ts @@ -252,7 +252,7 @@ type PriceWithTiers = PriceBaseFields & { /** Tiered pricing structure based on usage ranges */ tiers: Array<{ to: number | "inf"; amount: number }>; /** Required when tiers is defined: how tiers are applied */ - tierBehaviour: "graduated" | "volume"; + tierBehavior: "graduated" | "volume"; }; // Price must have either amount OR tiers (not both, not neither) diff --git a/atmn/src/lib/transforms/apiToSdk/planItem.ts b/atmn/src/lib/transforms/apiToSdk/planItem.ts index cce236c7..30b39b81 100644 --- a/atmn/src/lib/transforms/apiToSdk/planItem.ts +++ b/atmn/src/lib/transforms/apiToSdk/planItem.ts @@ -59,7 +59,7 @@ export const planItemTransformer = createTransformer< billingUnits: api.price.billing_units, maxPurchase: api.price.max_purchase ?? undefined, billingMethod: api.price.billing_method, - tierBehaviour: api.price.tier_behaviour, + tierBehavior: api.price.tier_behaviour, // Map API price.interval directly to SDK price.interval interval: api.price.interval, ...(api.price.interval_count !== undefined && { diff --git a/atmn/src/lib/transforms/sdkToApi/plan.ts b/atmn/src/lib/transforms/sdkToApi/plan.ts index df9a3836..788828ff 100644 --- a/atmn/src/lib/transforms/sdkToApi/plan.ts +++ b/atmn/src/lib/transforms/sdkToApi/plan.ts @@ -96,7 +96,7 @@ function transformPlanItem(planItem: PlanItem): ApiPlanItemParams { billingUnits?: number; billingMethod?: string; maxPurchase?: number; - tierBehaviour?: string; + tierBehavior?: string; }; result.price = { @@ -113,8 +113,8 @@ function transformPlanItem(planItem: PlanItem): ApiPlanItemParams { ...(priceWithBilling.maxPurchase !== undefined && { max_purchase: priceWithBilling.maxPurchase, }), - ...(priceWithBilling.tierBehaviour !== undefined && { - tier_behaviour: priceWithBilling.tierBehaviour, + ...(priceWithBilling.tierBehavior !== undefined && { + tier_behaviour: priceWithBilling.tierBehavior, }), }; } diff --git a/atmn/src/lib/transforms/sdkToCode/planItem.ts b/atmn/src/lib/transforms/sdkToCode/planItem.ts index 28ea898a..637f451c 100644 --- a/atmn/src/lib/transforms/sdkToCode/planItem.ts +++ b/atmn/src/lib/transforms/sdkToCode/planItem.ts @@ -65,7 +65,7 @@ export function buildPlanItemCode( billingUnits?: number; billingMethod?: string; maxPurchase?: number; - tierBehaviour?: string; + tierBehavior?: string; }; if (priceWithBilling.billingUnits !== undefined) { @@ -82,8 +82,8 @@ export function buildPlanItemCode( lines.push(`\t\t\t\tmaxPurchase: ${priceWithBilling.maxPurchase},`); } - if (priceWithBilling.tierBehaviour !== undefined) { - lines.push(`\t\t\t\ttierBehaviour: '${priceWithBilling.tierBehaviour}',`); + if (priceWithBilling.tierBehavior !== undefined) { + lines.push(`\t\t\t\ttierBehavior: '${priceWithBilling.tierBehavior}',`); } // Handle price.interval and price.intervalCount (from PriceWithInterval type) diff --git a/typegen/genUtils/atmnTypeHelpers.ts b/typegen/genUtils/atmnTypeHelpers.ts index 0b35e964..792a2432 100644 --- a/typegen/genUtils/atmnTypeHelpers.ts +++ b/typegen/genUtils/atmnTypeHelpers.ts @@ -241,7 +241,7 @@ type PriceWithTiers = PriceBaseFields & { /** Tiered pricing structure based on usage ranges */ tiers: Array<{ to: number | "inf"; amount: number }>; /** Required when tiers is defined: how tiers are applied */ - tierBehaviour: "graduated" | "volume"; + tierBehavior: "graduated" | "volume"; }; // Price must have either amount OR tiers (not both, not neither)