Validates the seller can be terminated, then sets status to terminated and records the reason. Emits seller.terminated.
Usage
import { terminateSellerWorkflow } from "@mercurjs/core/workflows"
await terminateSellerWorkflow(container).run({
input: { seller_id: "sel_123", reason: "Account closure requested" },
})
Id of the seller to terminate.
Reason stored in status_reason.
Result
Hooks
sellerTerminated — runs after termination with { seller_id }.
terminateSellerWorkflow.hooks.sellerTerminated(async ({ seller_id }) => {
// e.g. archive the seller's data
})