Skip to content

Trial cancellation hard-deletes appointments; no paid-trial refund path (audit C5/M7 — must precede #969) #1009

Description

@teetangh

Context

Trial cancellation hard-deletes the appointment (tx.appointment.delete, app/api/trials/[trialId]/route.ts:504-517, 710-727), violating the soft-cancel doctrine every other type follows. Because Payment.appointment is onDelete: Cascade, this becomes a money-destroying delete the moment paid trials ship (#969 adds trial payment columns). There is also no refund path for a paid trial cancellation (route.ts:217-224).

Proposed approach

Convert trial cancellation to the standard soft-cancel (status transition plus slot completion-status update, appointment preserved), and add the paid-trial refund path on top of the refund-gateway wiring. This must land before #969 merges.

Audit ids C5/M7; found alongside #998. Blocks #969.

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

    bugSomething isn't workingfinancePayments, refunds, earnings, payouts, invoicing, ledgerlaunch: pre-mvpGates launch — money, data, or a failure we would not detectpriority: criticaltrialsTrial sessions and trial conversion

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions