Skip to content

Offering-editor residuals, sessionsPerWeek rename incident, and schema-policy conflict on #1045 #1089

Description

@teetangh

Follow-ups from the 2026-08-01 stream/merge/offering session. P0 offering edit 404s and org billing crash are in #1088; this issue holds what that PR deliberately left alone, plus an incident record.

Offering editor — residual defects (verified in code, not fixed in #1088)

Found while fixing consultation/subscription edit 404s. None of these need a Prisma schema change.

  1. Draft/publish gate is a no-op for webinar and class. OfferingEditorContainer sets status: publish ? "SCHEDULED" : "DRAFT", but webinar/class buildRequestBody never forwards status.
  2. Edit mode always shows a "Published" badge. OfferingEditorContainer hard-codes status={planId ? "PUBLISHED" : null} regardless of the real plan status.
  3. Class POST defaults status to SCHEDULED with no startDate. Webinar POST correctly uses DRAFT when unscheduled.
  4. Owner's own ORG_ONLY plans can vanish from the planner and the edit page. GET /api/plans/consultations and /subscriptions apply marketplaceVisibilityWhere(), so a consultant may not see (or open) their own org-only plans.
  5. Org catalog has no edit route — list + [type]/new only.
  6. Webinar scheduledAt type mismatch. WebinarPlanSchema.scheduledAt is z.string(), but the date control emits a Date. Publishing a webinar is expected to fail validation ("Expected string, received date"). Reproduce before treating as confirmed.
  7. Cover image persists on Cancel. /api/plans/image writes imageUrl on upload, independently of form save — Cancel cannot undo an image change. (imageUrl itself already round-trips; do not wire it through the form save path as a second writer.)
  8. Webinar/class save still omits ADR-24 fields that consultation/subscription already send: subtitle, targetAudience, whatsIncluded, faqs.

Related: sticky editor chrome + planner breadcrumb links also shipped on #1088 after the initial authoring commits.

Incident record — callsPerWeek / meetingsPerWeeksessionsPerWeek

On 2026-08-01, production Sentry showed PrismaClientKnownRequestError for missing columns ClassPlan.meetingsPerWeek and SubscriptionPlan.callsPerWeek. Cause: a db push renamed those columns to sessionsPerWeek before the matching Prisma client release was deployed. Transient; cleared once the release carrying the rename was live.

Lesson (already policy, restated): schema changes on the shared Supabase project are additive only — no DROP, no rename, no retype. A rename that lands in the DB ahead of the client is a production outage. Prefer add-new-column → dual-write/read → stop reading old → drop later only with an explicit decision.

Live DB was checked after #1069 merged: RescheduleRequest.preferredTimeOfDay / preferredDays exist and are nullable (safe additive).

#1045 — additive-only conflict

#1045 drops LEMON_SQUEEZY and XFLOW from the live PaymentGateway enum. That is a destructive enum change and conflicts with the additive-only rule above, even if the DDL was already applied out-of-band. It needs an explicit product/ops decision before merge; do not treat "already applied to DB" as automatic license to land the code change without that call. Comment also posted on the PR.

Out of scope for this issue

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