Skip to content

feat(revenue): plan price on RapidAPI snapshots with est. MRR tiles - #44

Merged
mlava merged 1 commit into
mainfrom
feat/rapidapi-plan-price
Aug 3, 2026
Merged

feat(revenue): plan price on RapidAPI snapshots with est. MRR tiles#44
mlava merged 1 commit into
mainfrom
feat/rapidapi-plan-price

Conversation

@mlava

@mlava mlava commented Aug 3, 2026

Copy link
Copy Markdown
Owner

What

Makes RapidAPI subscriptions count as recurring revenue: snapshots now take an optional monthly plan price, and the panel derives estimated MRR from it.

  • Schema: nullable plan_price_usd_minor (USD cents — RapidAPI bills in USD only) on rapidapi_snapshots, both SQLite and Postgres; additive migrations generated, no backfill needed.
  • Report: grossMrrUsdMinor = latest paying × latest price; netMrrUsdMinor deducts RapidAPI's flat 25% marketplace fee (RAPIDAPI_FEE_RATE), rounded to the cent. Both null when the latest snapshot lacks either input — an older snapshot's price is deliberately not carried forward.
  • Panel:
    • "Plan price $/mo (optional)" form field, entered in dollars, converted to cents. Prefilled from the latest snapshot (the price rarely changes) and kept after logging so subsequent snapshots inherit it with zero retyping.
    • Two new tiles: Est. MRR (gross) with the working as a hint ("5 paying × $5.99"), and Est. net MRR ("After RapidAPI's flat 25% marketplace fee").
    • History table gains a Plan price column.
  • formatMoney now takes optional fraction digits so $5.99-style prices don't render as $6; existing call sites are unchanged (default stays 0).

Verification

  • 7 RapidapiService tests pass (4 new: gross/net math incl. cent rounding, missing-input cases, no price carry-forward)
  • tsc --noEmit and oxlint --type-aware clean
  • Migration applied to local D1

🤖 Generated with Claude Code

RapidAPI marketplace subscriptions are recurring revenue, but the
snapshots only stored subscriber counts, so nothing could be turned
into dollars. Snapshots now take an optional monthly plan price (USD
cents - RapidAPI bills in USD only), and the report derives est. gross
MRR (paying x price) and est. net MRR after RapidAPI's flat 25%
marketplace fee, both from the latest snapshot only.

The panel gains a "Plan price $/mo" form field (prefilled from the
latest snapshot since the price rarely changes, kept after logging),
two MRR tiles with the working shown as hints, and a Plan price history
column. formatMoney takes optional fraction digits so $5.99-style plan
prices don't round to whole dollars.

Additive nullable column on both SQLite and Postgres; migrations
generated and applied locally.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mlava
mlava merged commit a5b2b76 into main Aug 3, 2026
@mlava
mlava deleted the feat/rapidapi-plan-price branch August 3, 2026 16:51
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