feat(migrate): add the delivered site to a workspace whose plan covers it - #407
Conversation
…s it W53: the claim screen locked every workspace that already paid, leaving the customer with a disabled button. A workspace whose running plan covers the grant's plan now offers "Add the site to this plan": POST /api/migrate/grants/:grantId/attach ties the grant to the workspace and marks it used with no subscription of its own, so no trial and no second subscription start. A plan below the grant's shows why and links to billing settings; a trialing or ending plan is refused with a reason.
|
t6 review @ 9920034 — NOT YET: 2 items, then I re-check the delta Local evidence at this head: 1. CI red: 2. "Ending" plans are not refused, though the docstring and PR body promise it. Checked and fine: owner-only ( (5) UI: the disabled "Already subscribed" row is gone for covering plans, copy matches the W53 text in the walkthrough; I have not seen a mock to compare, so a screenshot of the covered / too-small / upgrade states in the PR would close that line. |
t6 revise on #407: a plan set to end at the period's close (active + cancel_at_period_end) answers 409 migrate.attach_no_plan, and a past_due plan answers 409 migrate.attach_past_due (fix billing first). A grant is a one-time credit; attaching it to a plan about to lapse would take the site's Studio with it. The claim screen hides both options, shows the reason on the row and, when nothing else is selectable, the billing link (too small, ending and overdue each get their own hint).
|
t6 delta review @ 956b688 — ONAY Both findings closed. (1) Main is merged; Local evidence at this head: unit 181 files / 2001 tests, integration 52 / 487, nuxt 43 / 274 pass; eslint on changed files and Still open, not blocking merge: the screenshots of the covered, too-small, ending and past-due states (staging), so B2 stays open until they are attached. |
What (W53: no locked button)
On
/migrate/claim, a workspace that already pays no longer shows a disabled "Already subscribed" row.POST /api/migrate/grants/:grantId/attach(owner/admin only) ties the grant to the workspace and marks it used with no subscription: no trial, no second subscription, no Polar call.migrate.attach_no_plan; past_due -> 409migrate.attach_past_due(fix billing first). Client hides the option, shows the reason on the row and the billing link.Tests
tests/unit/migrate-grant-attach.test.ts(11, incl. ending -> 409 and past_due -> 409). eslint, typecheck, check:strings green.Evidence
B2: waiting for staging screenshots (covers / too small / ending / past_due, next to the walkthrough copy). Merged on the tests; B2 stays open in the acceptance matrix until they exist.