Skip to main content
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" },
})

Input

seller_id
string
required
Id of the seller to terminate.
reason
string
Reason stored in status_reason.

Result

result
void
Nothing is returned.

Hooks

  • sellerTerminated — runs after termination with { seller_id }.
terminateSellerWorkflow.hooks.sellerTerminated(async ({ seller_id }) => {
  // e.g. archive the seller's data
})