feat(admin): move the /pricing publish switch into the Stripe tier catalog mapping (BUNYIP-524) #520

Merged
longjacksonle merged 1 commit from feat/BUNYIP-524-pricing-switch-in-catalog-mapping into main 2026-08-12 15:57:40 +02:00

What

Moves the public /pricing publish switch (pricing_enabled) out of the Pricing tiers page and into the Tier catalog mapping on the Stripe page, so the switch lives with the price bindings it depends on. Finishes the BUNYIP-417 consolidation of all Stripe config under one nav entry.

Why

The publish switch sat on /admin/tier-settings, while the price-to-tier bindings that decide what /pricing can even advertise sit on /admin/stripe. An admin who had just mapped prices had to leave for another page to turn the page on, and the switch was nowhere near what it controlled.

Changes

  • Tier catalog mapping (Stripe page) gains a Show pricing on the public page checkbox, checked from the saved pricing_enabled so it survives save + reload, plus the live pricing status directly under it (published tiers in a success box, or one error box per reason it is not publishing, or a load-failure note). One Save catalog mapping persists the price bindings and the publish switch together. The checkbox is authoritative (absent = off), so it is always sent, unlike the price ids whose omission means "keep".
  • Pricing tiers page is stripped to slots + trial days and links to the Stripe page. It no longer sends pricing_enabled, so saving slots/trials there can no longer silently turn the pricing page off. No second toggle for the same field remains.
  • pricing_status_block moves from tier_settings.rs to stripe.rs next to the switch it now describes. The tier-settings resolved-amount block and its Stripe-price fetch are removed (the catalog dropdowns already show each tier's resolved amount). Switch + status tests move to exercise stripe_catalog_section.

Verification

  • just check-container green (fmt + clippy -D warnings + workspace tests, 248 web tests pass).
  • Rendered both states (screenshot below): switch-on shows the green "/pricing is live and advertising: Lifetime, Early Adopter, Standard." box with a checked toggle above the tier cards; switch-off shows the red "Early Adopter: price_old is archived in Stripe. Map an active price." reason box with an unchecked toggle.

Out of scope

The public /pricing page layout/content and any Products/Prices list behaviour.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GkNbvEq6awuMRULFCiYKe3

## What Moves the public `/pricing` publish switch (`pricing_enabled`) out of the Pricing tiers page and into the Tier catalog mapping on the Stripe page, so the switch lives with the price bindings it depends on. Finishes the BUNYIP-417 consolidation of all Stripe config under one nav entry. ## Why The publish switch sat on `/admin/tier-settings`, while the price-to-tier bindings that decide what `/pricing` can even advertise sit on `/admin/stripe`. An admin who had just mapped prices had to leave for another page to turn the page on, and the switch was nowhere near what it controlled. ## Changes - Tier catalog mapping (Stripe page) gains a **Show pricing on the public page** checkbox, checked from the saved `pricing_enabled` so it survives save + reload, plus the live pricing status directly under it (published tiers in a success box, or one error box per reason it is not publishing, or a load-failure note). One **Save catalog mapping** persists the price bindings and the publish switch together. The checkbox is authoritative (absent = off), so it is always sent, unlike the price ids whose omission means "keep". - Pricing tiers page is stripped to slots + trial days and links to the Stripe page. It no longer sends `pricing_enabled`, so saving slots/trials there can no longer silently turn the pricing page off. No second toggle for the same field remains. - `pricing_status_block` moves from `tier_settings.rs` to `stripe.rs` next to the switch it now describes. The tier-settings resolved-amount block and its Stripe-price fetch are removed (the catalog dropdowns already show each tier's resolved amount). Switch + status tests move to exercise `stripe_catalog_section`. ## Verification - `just check-container` green (fmt + clippy -D warnings + workspace tests, 248 web tests pass). - Rendered both states (screenshot below): switch-on shows the green "/pricing is live and advertising: Lifetime, Early Adopter, Standard." box with a checked toggle above the tier cards; switch-off shows the red "Early Adopter: price_old is archived in Stripe. Map an active price." reason box with an unchecked toggle. ## Out of scope The public `/pricing` page layout/content and any Products/Prices list behaviour. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01GkNbvEq6awuMRULFCiYKe3
feat(admin): move the public /pricing publish switch into the Stripe tier catalog mapping (BUNYIP-524)
All checks were successful
E2E / PR gate (pull_request) Successful in 23s
Check / fmt + clippy + build + tests (pull_request) Successful in 5m0s
Create release / Create release from merged PR (pull_request) Has been skipped
8f52b0997a
The switch that publishes the public /pricing page (pricing_enabled) sat on the Pricing tiers page (/admin/tier-settings), while the price-to-tier bindings that decide what /pricing can even advertise sit in the Tier catalog mapping on the Stripe page. An admin who had just mapped prices had to leave for another page to turn the page on, and the switch was nowhere near the thing it depended on. BUNYIP-417 already moved the price/product mapping onto the Stripe page to keep all Stripe config under one nav entry; this finishes that consolidation for the publish control.

The Tier catalog mapping form now carries a "Show pricing on the public page" checkbox (checked from the saved pricing_enabled, so it survives save + reload) and the live pricing status directly under it: a success box naming the published tiers, or one error box per reason it is not publishing, or a load-failure note. One "Save catalog mapping" persists the price bindings and the publish switch together; an unchecked box turns publishing off (the checkbox is authoritative, so it is always sent, unlike the price ids whose omission means "keep").

The Pricing tiers page is stripped back to its non-Stripe concerns (membership slot limits and trial lengths) and links to the Stripe page. Critically, it no longer sends pricing_enabled, so saving slots/trials there can no longer silently turn the pricing page off. No second toggle for the same field remains.

pricing_status_block moves from tier_settings.rs to stripe.rs next to the switch it now describes; the tier-settings-only resolved-amount block and its Stripe-price fetch are removed (the catalog dropdowns already show each tier's resolved amount). Tests for the switch and the pricing status move to exercise stripe_catalog_section.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GkNbvEq6awuMRULFCiYKe3
longjacksonle deleted branch feat/BUNYIP-524-pricing-switch-in-catalog-mapping 2026-08-12 15:57:41 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/bunyip!520
No description provided.