Summary
In atmn@1.1.8, the tiered plan-item price field is inconsistent across the TypeScript type, the CLI runtime, the Zod schema, and the docs. The net effect is that the documented way of configuring tiers fails type-checking, while the type-checkable way is silently dropped at push time.
The mismatch (3 layers)
- TS builder type —
PriceWithTiers (in compose/models/planModels.d.ts) declares tierBehaviour (British spelling) and marks it required:
type PriceWithTiers = PriceBaseFields & {
amount?: never;
tiers: Array<{ to: number | "inf"; amount: number }>;
tierBehaviour: "graduated" | "volume"; // British + required
};
- CLI runtime (
dist/cli.js) reads the American tierBehavior when serialising to the push payload and when generating config:
...priceWithBilling.tierBehavior !== undefined && { tier_behavior: priceWithBilling.tierBehavior }
// and: tierBehavior: api.price.tier_behavior
- Zod schema (
PlanItemSchema) uses snake_case tier_behavior and marks it optional.
- Docs (Volume-Based Tiers, CLI tab) use the American
tierBehavior, and the tiered example in cli/config omits it entirely (graduated is the default).
Effect / reproduction
Given a tiered price item:
- Following the docs (
tierBehavior: "volume", or omitting it) → tsc fails:
error TS2322: ... Property 'tierBehaviour' is missing in type '...' but required in type 'PriceWithTiers'.
- Using
tierBehaviour (British) to satisfy the type → compiles, but the value is dropped at push (the serialiser reads tierBehavior), so volume can never be set via the CLI; Autumn always falls back to the graduated default.
Suggested fix
Align the builder type with the runtime + Zod + docs:
- Rename
PriceWithTiers.tierBehaviour → tierBehavior (American), and
- Make it optional (graduated is the documented default).
Verified on atmn@1.1.8 (latest at time of writing).
Summary
In
atmn@1.1.8, the tiered plan-item price field is inconsistent across the TypeScript type, the CLI runtime, the Zod schema, and the docs. The net effect is that the documented way of configuring tiers fails type-checking, while the type-checkable way is silently dropped at push time.The mismatch (3 layers)
PriceWithTiers(incompose/models/planModels.d.ts) declarestierBehaviour(British spelling) and marks it required:dist/cli.js) reads the AmericantierBehaviorwhen serialising to the push payload and when generating config:PlanItemSchema) uses snake_casetier_behaviorand marks it optional.tierBehavior, and the tiered example incli/configomits it entirely (graduated is the default).Effect / reproduction
Given a tiered price item:
tierBehavior: "volume", or omitting it) →tscfails:tierBehaviour(British) to satisfy the type → compiles, but the value is dropped at push (the serialiser readstierBehavior), sovolumecan never be set via the CLI; Autumn always falls back to the graduated default.Suggested fix
Align the builder type with the runtime + Zod + docs:
PriceWithTiers.tierBehaviour→tierBehavior(American), andVerified on
atmn@1.1.8(latest at time of writing).