Sign-up draft: restore skipped-join audit, delete
Two correctness gaps the epic's coders found and parked as unparented drafts (Tasks 8502 and 8480), which never dispatch. This task replaces both; the operator may delete those drafts.
## 1. `domain_join_skipped_org_id` is no longer audited (regression, R-X4)
Repro (code read): every sign-up now submits through `apps/api/app/signup_draft.py::submit`, which calls `signup.record_submission` without `skipped_org_id`, so the `org_signup` audit row drops `domain_join_skipped_org_id`. The old `/complete` branch that set it, and its test, were deleted in Task 8462 (PR #6467).
Fix: work out the skipped domain-join org on submit, as the old `create_signup` path did, and pass it to `record_submission`. Restore `tests/test_email_signup.py::test_no_skipped_join_is_recorded_without_a_registered_domain` and add the positive case. Also delete `signup_plans.offered_key` (only its own test uses it now) and the `create_signup` docstring line that names it.
## 2. A purged draft leaves the applicant's PII in Stripe
Repro (code read): the `signup-drafts` cron (`apps/api/app/signup_draft.py::purge_drafts`) detaches a purged draft's cards and deletes its `billing_customers` row, but the Stripe Customer stays with the applicant's billing name, email, address and tax ID. The purge writes no audit row.
Fix: add a `customers_delete` gateway method (the fake too) and call it after `payment_methods_detach`. Write one operator-plane activity row per purged draft (org id, never the email).
## 3. A card saved on a paid plan stays attached after switching to a free plan
Fix: at Sign up on a free plan, detach any card the draft saved.
Out of scope: the signup route contract, the web pages, plan prices, approval billing.
Done means:
- An API test: a sign-up whose email domain has a registered org records `domain_join_skipped_org_id`; one without records none.
- A test: purging a draft with a Customer calls `customers_delete` once, after `payment_methods_detach`, and writes an audit row.
- A test: Sign up on a free plan after a card was saved detaches the card.
- `./dc check quick` green; the merge lane's `./dc check full` green; Jaah Deploy succeeds.
Outcome
Restored domain_join_skipped_org_id audit; draft purge now deletes the Stripe Customer (under lock) with an operator-plane audit row; free-plan Sign up detaches saved cards. Quick gate + lane full gate green, #6472 merged, Jaah Deploy succeeded. Memory: used mem-22590, mem-22588; proposed 0.
Artifacts
Activity
- Ready
- Runner started
- Runner ended (done)