Updates every seller matching the selector with the given data. Triggered by POST /admin/sellers/:id and POST /vendor/sellers/:id. Emits seller.updated for each updated seller.
Usage
import { updateSellersWorkflow } from "@mercurjs/core/workflows"
const { result } = await updateSellersWorkflow ( container ). run ({
input: {
selector: { id: "sel_123" },
update: { name: "Acme Inc." },
},
})
Filter selecting the sellers to update, e.g. { id: "sel_123" }.
Fields to update; all optional. External system identifier.
One of open, pending_approval, suspended, terminated.
Reason attached to the status.
Start of a store closure window.
End of a store closure window.
Custom data passed through to the workflow hooks.
Result
Hooks
sellersUpdated — runs after the update with { sellers, additional_data }.
updateSellersWorkflow . hooks . sellersUpdated ( async ({ sellers }) => {
// sync updated sellers elsewhere
})