feat(products): attach rate cards to subscriptions - #5871
Conversation
42c28c5 to
41c1197
Compare
41c1197 to
1d8e8ca
Compare
aafc370 to
8b8b0d9
Compare
8b8b0d9 to
04b2bc0
Compare
04b2bc0 to
b4fdc0f
Compare
b4fdc0f to
882e320
Compare
882e320 to
be11831
Compare
be11831 to
c2df6e0
Compare
a43b497 to
1cb1984
Compare
1cb1984 to
4750454
Compare
4750454 to
c50ad2c
Compare
|
Automated pre-review (advisory, not a required check) — verdict: HOLD · CI green HOLD — the default-on catalog workflow is not billable, and several new subscription-card paths break on realistic inputs.
|
|
Automated pre-review (advisory, not a required check) — verdict: HOLD · CI green HOLD — the new subscription API has backward-compatibility and time-versioning defects.
|
|
Automated pre-review (advisory, not a required check) — verdict: HOLD · CI green HOLD — the new subscription-rate-card paths can create ignored configuration, invalid quantities, and orphaned pricing records.
|
|
Automated pre-review (advisory, not a required check) — verdict: HOLD · CI green HOLD — the new subscription rate-card lifecycle has blocking gaps.
|
|
Automated pre-review (advisory, not a required check) — verdict: HOLD · CI green HOLD — the new subscription rate-card paths can create or expose incorrect billing state.
|
|
Automated pre-review (advisory, not a required check) — verdict: HOLD · CI green HOLD — the new default and subscription-card lifecycle have blocking correctness gaps.
|
|
Automated pre-review (advisory, not a required check) — verdict: HOLD · CI green HOLD — the new subscription-rate-card surface has correctness gaps in supported flows.
|
|
Automated pre-review (advisory, not a required check) — verdict: HOLD · CI green HOLD — the new default billing path and subscription-rate-card updates have blocking correctness gaps.
|
|
Automated pre-review (advisory, not a required check) — verdict: HOLD · CI green HOLD — subscription rate-card lifecycle and scoping are inconsistent across the new API.
|
|
Automated pre-review (advisory, not a required check) — verdict: HOLD · CI green HOLD — the new subscription rate-card API has correctness gaps in version and override handling.
|
|
Automated pre-review (advisory, not a required check) — verdict: HOLD · CI green HOLD — Defaulting new organizations to the product catalog exposes subscriptions that never enter periodic billing: catalog plans have no interval, the billing scheduler only selects legacy plan intervals, and no billing path consumes or advances applied rate cards'
|
|
Automated pre-review (advisory, not a required check) — verdict: HOLD · CI green HOLD — the nested subscription rate-card lifecycle and versioning paths have correctness gaps.
|
|
Automated pre-review (advisory, not a required check) — verdict: HOLD · CI green HOLD — the new subscription rate-card lifecycle has blocking validation and temporal-record inconsistencies.
|
|
Automated pre-review (advisory, not a required check) — verdict: HOLD · CI green HOLD — the new subscription-level catalog API exposes unreachable and invalid states.
|
|
Automated pre-review (advisory, not a required check) — verdict: HOLD · CI green HOLD — the subscription rate-card lifecycle has correctness gaps that can create invalid billing state.
|
|
Automated pre-review (advisory, not a required check) — verdict: HOLD · CI green HOLD — the subscription-level catalog surface has correctness gaps against its plan-side and soft-deletion patterns.
|
|
Automated pre-review (advisory, not a required check) — verdict: HOLD · CI green HOLD — The new subscription-rate-card lifecycle has blocking gaps around future entries, quantity validation, and version cleanup.
|
|
Automated pre-review (advisory, not a required check) — verdict: HOLD · CI green HOLD — the new subscription catalog API has several correctness gaps:
|
|
Automated pre-review (advisory, not a required check) — verdict: HOLD · CI green HOLD — valid subscription-rate-card states are not consistently addressable, and several established sibling invariants are missing.
|
|
Automated pre-review (advisory, not a required check) — verdict: HOLD · CI green HOLD — the subscription-level card lifecycle has correctness gaps in its primary pending and versioned flows.
|
|
Automated pre-review (advisory, not a required check) — verdict: HOLD · CI green HOLD — the new subscription rate-card API breaks important pending and catalog-subscription paths.
|
|
Automated pre-review (advisory, not a required check) — verdict: HOLD · CI green HOLD — future entries are unreachable, and subscription-level pricing diverges from established plan-side behavior.
|
|
Automated pre-review (advisory, not a required check) — verdict: HOLD · CI green HOLD — the new subscription rate-card API has correctness gaps in version and authoring behavior.
|
|
Automated pre-review (advisory, not a required check) — verdict: HOLD · CI green HOLD — the new catalog subscription surface accepts legacy subscriptions and leaves key mutation invariants race-prone.
|
## Context The subscription runtime PR grew past reviewable size, so it is split in two. This first half covers the subscription itself; the follow-up keeps the rate cards attached directly to subscriptions and their endpoints. ## Description - Materialize a plan's rate cards onto the subscription at creation, inheriting the subscription billing anchor and validating billing_anchor_date. - Add phase-aware rate resolution helpers on the catalog models. - Serve product-catalog subscriptions on the v2 API (index and show) with a v2 shape that drops the plan-interval fields and only counts current and scheduled rate cards. - Guard sibling v1 flows: reject plan changes involving catalog plans and resync card dates when a pending subscription moves. - Default new organizations to the product catalog.
Second half of the subscription runtime split: the base PR carries subscription materialization and the v2 subscription endpoints; this one carries the rate cards attached directly to a subscription. - Attach, list, update and detach rate cards on a pending subscription over /api/v2, addressed by external id and card code, with per-card phase sequence endpoints at plan parity. - Version the entry when units change on an active subscription: the current row closes and a successor opens now or at the next billing period, carrying phases and overrides. - Enforce the authoring rules: pending-only edits, one card per pricing slice, currency match, anchor and units validation, and strict override inputs. - Seed a directly-attached negotiated card in the demo catalog.
|
Automated pre-review (advisory, not a required check) — verdict: HOLD · CI green HOLD — this enables a catalog runtime that the current billing paths do not price.
|
Context
Runtime counterpart of the plan-side attachments: when a customer subscribes, the plan's rate cards are materialized onto the subscription so the billing engine has per-subscriber rows to scan, with their own anchor and clock.
Description
unitson an active subscription: the change requiresapply_units(now|next_billing_period), closes the current row and opens a successor, so historical periods keep the units they billed with.