Skip to content

feat(pricing): restore TB perpetual calculator with reworked pricing model#553

Open
rusikv wants to merge 1 commit into
thingsboard:developfrom
rusikv:feature/perpetual-calculator-restore
Open

feat(pricing): restore TB perpetual calculator with reworked pricing model#553
rusikv wants to merge 1 commit into
thingsboard:developfrom
rusikv:feature/perpetual-calculator-restore

Conversation

@rusikv

@rusikv rusikv commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Restores the ThingsBoard PE perpetual license calculator removed in #485, updated to the current perpetual licensing model as sold on the License Portal.

What's in

Pricing model

  • Base license includes 5,000 devices + 1 production instance ($4,999), 5M AI credits, and white labeling.
  • Symmetric device/instance scaling: each purchased production instance ($4,999) also grants +5,000 devices; every full 5,000 purchased extra devices unlocks 1 complimentary production instance (no extra device capacity — no double counting). The devices field always shows the resulting quota (5,000 + extras + 5,000 × instances, capped at 1M on every path), and the caption under it + the instances helper render from the same state, e.g. 5 000 included + 5 000 included from instance + 7 000 extra devices.
  • AI Credits stepper (1 = 1,000,000 credits; 5 packs included). Extra packs have no public list price, so requesting them routes to the custom-pricing flow.
  • Add-ons: Edge $849 (2 incl., $399/extra), Trendz $1,499 + $0.30 × every device beyond the base 5,000 (incl. instance-granted), Offline $19,999, dev instance $999.

Custom pricing — total ≥ $24,998, Offline Mode, or extra AI credits

  • The calculation summary is replaced by a centered personal-price notification (tag icon + "Get a personal price for these numbers" — "Get a personal price" when Offline Mode is the only selection), Total shows "Custom", and a Send request CTA opens Contact Us prefilled with the configuration — quantities only, no prices.
  • Base + Offline = exactly $24,998, so Offline always routes to a personal quote, as intended.

Implementation — the calculator predates several refactors, so it's rewritten on current conventions rather than reverted: modal lifecycle via modal-controller (portal-to-body + scroll-lock), analytics via calc-analytics with a new tb_perp CalculatorType (calculator_open / calculator_interaction / calculator_export / calculator_cta_click; interaction adds calculator_ai_credits + calculator_addon_offline; total is null and plan is Custom at the custom tier), shared export buttons, @-prefixed import aliases.

Page wiring: hero card regains the "Estimate your cost" primary CTA (window.openTbPerpCalc), secondary Contact Us keeps the autofill message; modal mounted next to the PAYG/Private Cloud modals; FAQ data-open-calc="perp" branch restored. The pre-removal tbPerpetualPlans export was dead code and stays removed.

Shared polish: the Reset button label is now vertically centered and its height matches the footer CTA (36px box under a 24px text line left the label sitting low — affected all calculator modals).

Verification

  • astro check — 0 errors; full astro build — success.
  • Playwright end-to-end against the built site — 51 checks: default $4,999 total and summary rows; 12,000 devices → $11,999 + 1 complimentary instance; +1 purchased instance → quota 17,000 / $16,998 with synced captions; Trendz $22,097; custom wall for threshold / Offline / extra AI packs with both wording variants and price-free Send-request message; GTM events (tb_perp, null total + Custom plan at the custom tier, calculator_ai_credits, export carrying plan+total); typed sub-minimum AI values clamped before the debounced GTM push; 1M device cap held when instances raise the floor; emptied instances field keeps purchases; Reset; Escape close.

…model

Restore the "Estimate your cost" modal calculator removed in thingsboard#485,
updated to the current perpetual licensing model:

- Base license includes 5,000 devices + 1 production instance ($4,999),
  5M AI credits, and white labeling.
- Symmetric device/instance scaling: each purchased production instance
  ($4,999) also grants +5,000 devices; every full 5,000 purchased extra
  devices unlocks 1 complimentary production instance (which grants no
  extra device capacity). The devices field always shows the resulting
  quota (capped at 1M on every path), and the device caption and
  instances helper render from the same state so they stay in sync.
- AI Credits stepper (1 = 1,000,000 credits; 5 packs included). Extra
  packs have no public list price, so they route to the custom-pricing
  flow.
- Custom pricing from a $24,998 total (or Offline Mode / extra AI
  credits): the calculation summary is replaced by a centered
  personal-price notification, Total shows "Custom", and a
  "Send request" CTA opens Contact Us prefilled with the configuration
  (quantities only, no prices).
- Rewritten on current conventions rather than reverted: modal lifecycle
  via modal-controller (portal + scroll-lock), analytics via
  calc-analytics with a new 'tb_perp' CalculatorType (calculator_open /
  interaction / export / cta_click; interaction adds
  calculator_ai_credits and calculator_addon_offline; total is null and
  plan is 'Custom' at the custom tier).
- Shared polish: Reset button label is now vertically centered and its
  height matches the footer CTA (applies to all calculators).

The hero card regains the "Estimate your cost" primary CTA (secondary
Contact Us keeps the autofill message), the modal mounts alongside the
other calculator modals, and the FAQ data-open-calc handler's 'perp'
branch is restored. The pre-removal tbPerpetualPlans export was dead
code and stays removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant