feat(migrate): provision the Studio+Migrate bundle (S2) - #404
Merged
Merged
Conversation
… jti back on our own failure Supabase pair: public.migrate_user_id_by_identity reads auth.identities in one indexed lookup (a GitHub linked later is found). Managed pair: auth.identities for the plain-PG lineage, recorded at every OAuth sign-in, so a later Google sign-in no longer hides the GitHub id. account-state releases the jti when its own work fails, so Migrate's retry of the same request is taken.
…r checkout POST /api/migrate/provision takes a signed claim v2, finds or creates the Studio account by GitHub id, records one bundle grant per order and opens one Polar checkout at the quoted total. The webhook then moves the subscription to the yearly list product at the next period; a scheduled reconciler retries a failed move and logs an alarm 30 days before renewal. Migration 044 makes trial days and repo optional for bundle grants.
Pin @contentrain/types 1.44.0 (claim v2 repo optional); keep the bundle grant methods beside the order lookup from main; add a repo-less provision route test.
The cart fine print needs the yearly list price the subscription renews at; Migrate must not compute it. 0 when nothing is added (covers).
Member
Author
|
ONAY (t6) — a0af19d Doğrulama (yerel + CI):
Bloklamayan bulgular (sonraki iş):
|
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.
S2 of the Migrate-with-Studio bundle (founder-approved W48-b).
What
POST /api/migrate/provision(signed claim v2, purposeprovision, jti single-use): ensures the Studio user for the GitHub account, opens a bundle grant (migration 044) and a Polar checkout at the quoted total (Migrate fee + Studio year 1 at 20% off) on a bundle product. Repo-less claims are valid (types 1.44.0).noneis provisioned;covers/too_small→ 409migrate.bundle_state_unsupported(S3). Live subscription → 409.subscription.created/updatedthe subscription moves to the yearly list product effective next period (sandbox-verified); a reconciler (every 6h) retries and alarms when renewal is ≤30 days away.account-stateanswers carryrenewal_cents(yearly list price; 0 when covers) as an extra key until types 1.45.0 (ai#413).ensureUserForProviderAccountin both implementations; Polar plugincreateBundleCheckout/moveBundleSubscriptionToList(Stripe stubs throw); trialcheckout/claimrefuse bundle grants.docs/PAYMENT_PROVIDERS.md). Not set in prod; this ships with v0.4.8 only after founder approval.Not in this PR
polar-sync yearly/bundle products (waiting for the catalog answer), grants revoke/refund (S3), trial removal.
Checks (local)
lint 0 errors, typecheck 0, unit 1991, integration 486, nuxt 274, contract (postgres:16) 158 pass / 1 skip.