# Dispatch

> Field service work orders at asset locations: a schedule board of technicians' slots, a status lifecycle from scheduled to done, day routes with ordered stops, and the parts each job used, linked to assets or inventory when those blocks are installed.

- Category: Work management
- Module: `dispatch`
- Modes: `managed`, `custom`
- Docs: https://bettersupabase.com/docs/blocks/dispatch
- Page: https://bettersupabase.com/blocks/dispatch

## Install

```bash
npx better-supabase add dispatch
```

The command also installs `updated-at`, `tenant`, `access`.

## Configure

Add the block to `better-supabase.config.ts`:

```ts
import { defineConfig } from "better-supabase/config";

export default defineConfig({
  blocks: {
    // Required by dispatch; add installs them too.
    "updated-at": {},
    tenant: {},
    access: {},
    // Modes: "managed", "custom". The default is "managed".
    dispatch: { mode: "managed" },
  },
});
```

## Client

The block has no React entry yet. Its server-side TypeScript is in `better-supabase/blocks/dispatch`.

## Events

- `dispatch_route.planned`
- `work_order.created`
- `work_order.part_used`
- `work_order.scheduled`
- `work_order.status_changed`
- `work_order.unscheduled`
- `work_order.updated`

## Related blocks

Requires: [tenant](https://bettersupabase.com/blocks/tenant.md), [access](https://bettersupabase.com/blocks/access.md)

Works with: [outbox](https://bettersupabase.com/blocks/outbox.md), [audit](https://bettersupabase.com/blocks/audit.md), [assets](https://bettersupabase.com/blocks/assets.md), [bookings](https://bettersupabase.com/blocks/bookings.md), [catalog](https://bettersupabase.com/blocks/catalog.md), [inventory](https://bettersupabase.com/blocks/inventory.md)

## Recipes

- [Dispatch board](https://bettersupabase.com/recipes/dispatch-board.md): A week of technicians by day with their scheduled work orders, and the backlog to schedule.
- [Technician day](https://bettersupabase.com/recipes/technician-day.md): A technician's stops for the day in route order, each with the button that moves it on.
