Skip to main content
Validates the rates are deletable, then soft-deletes them. Deletion is reversible on workflow failure (compensation restores the rates). Triggered by DELETE /admin/commission-rates/:id.

Usage

import { deleteCommissionRatesWorkflow } from "@mercurjs/core/workflows"

await deleteCommissionRatesWorkflow(container).run({
  input: { ids: ["comrate_123"] },
})

Input

ids
string[]
required
IDs of the commission rates to delete.

Result

result
void
No return value; the rates are soft-deleted.

Hooks

  • commissionRatesDeleted — runs after deletion with { ids }.
deleteCommissionRatesWorkflow.hooks.commissionRatesDeleted(async ({ ids }) => {
  // react to deleted rates
})