plans: annual pricing variants (hobby_yearly / pro_yearly / team_yearly) (P2)#6
Merged
Merged
Conversation
Adds hobby_yearly ($90/yr), pro_yearly ($490/yr), team_yearly ($1990/yr)
to the embedded default registry — each mirrors its monthly counterpart's
limits + features exactly, only `price_monthly_cents` (annual amount in
cents) and `billing_period: yearly` differ.
New helpers:
- Plan.BillingPeriod field
- Registry.BillingPeriod(tier) — "monthly" | "yearly"
- CanonicalTier(tier) — strips "_yearly" suffix so the webhook can map
yearly plan_ids back to the bare tier and teams.plan_tier stays
cycle-agnostic.
Tests pin the mirror invariant (limits + features identical to base tier)
and that yearly_price < monthly_price * 12 so the "save $X/yr" badge is
honest.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
hobby_yearly($90/yr ≈ $7.50/mo, ~17% off),pro_yearly($490/yr ≈ $40.83/mo, ~17% off),team_yearly($1990/yr ≈ $165.83/mo, ~17% off). Each mirrors its monthly counterpart's limits + features byte-for-byte; onlyprice_monthly_cents(annual amount in cents) andbilling_period: yearlydiffer.Plan.BillingPeriod,Registry.BillingPeriod(tier),CanonicalTier(tier)— strips the_yearlysuffix so the webhook can map yearly plan_ids back to the bare tier andteams.plan_tierstays cycle-agnostic.InstaNode-dev/api#pricing/p2-annual-server-fresh) which depends oncommonplans.CanonicalTier+BillingPeriod.Test plan
go test ./plans/...green (4 new tests + existing 21 pass)*_yearlyplan has the sameLimits+Featuresas its base — drift would silently change subscriber headroomyearly_price < monthly_price * 12for all three tiersBillingPeriodreturns"monthly"for base tiers (empty in YAML),"yearly"for variants🤖 Generated with Claude Code