Skip to content

Onboarding/billing robustness follow-ups (from release #50 Gemini review) #51

Description

@mahmutkaya

Two robustness suggestions Gemini raised on the release PR #50. They concern already-released code (shipped in 4167a72 via #45), surfaced on the release PR only because the squash-based developmain PR re-lists #45's commits. Deferred out of #50 (a release of the unrelated onboard picker #49 + CI #48) to avoid changing live billing/onboarding behavior in an unrelated release. Both are worth doing in a dedicated PR:

1. lib/actions/onboarding-actions.tsresolveTenantClient should promote an existing client's status to LIVE on onboard

Currently, if a Client already exists for the slug (same partner), it's returned as-is. If it was LEAD/CONTACTED/AGREED, onboarding it (creating a billing plan) leaves its CRM status stale. Consider flipping to LIVE when onboarded. Product nuance to decide: what about a CHURNED client being re-onboarded?

2. lib/billing-onboarding.tsstartFirstPayment reuses an open checkout URL without an age check

Mollie hosted-checkout URLs expire (~1h). Reusing an open/pending first-payment checkoutUrl older than the expiry lands the partner on a Mollie error page. Add a freshness threshold (e.g. only reuse if Date.now() - createdAt < 60min), else mint a fresh checkout.

Not money-safety issues (no double-charge risk); UX/consistency robustness.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions