# Warehouse

> Warehouse work over inventory: pick waves and pick lists made from stock allocations, picking tasks as work items, confirmed bins, lots and serials, and cycle count plans that hold large variances for review.

- Category: Billing & commerce
- Module: `warehouse`
- Modes: `managed`, `custom`
- Docs: https://bettersupabase.com/docs/blocks/warehouse
- Page: https://bettersupabase.com/blocks/warehouse

## Install

```bash
npx better-supabase add warehouse
```

The command also installs `updated-at`, `memberships`, `permissions`, `catalog`, `ledger`, `inventory`.

## Configure

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

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

export default defineConfig({
  blocks: {
    // Required by warehouse; add installs them too.
    "updated-at": {},
    memberships: {},
    permissions: {},
    catalog: {},
    ledger: {},
    inventory: {},
    // Modes: "managed", "custom". The default is "managed".
    warehouse: { mode: "managed" },
  },
});
```

## Client

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

## Events

- `count_plan.created`
- `count_plan.executed`
- `pick_list.created`
- `pick_list.picked`
- `pick_wave.completed`
- `pick_wave.created`
- `pick_wave.released`

## Related blocks

Requires: [memberships](https://bettersupabase.com/blocks/memberships.md), [permissions](https://bettersupabase.com/blocks/permissions.md), [inventory](https://bettersupabase.com/blocks/inventory.md)

Works with: [tasks](https://bettersupabase.com/blocks/tasks.md), [relations](https://bettersupabase.com/blocks/relations.md), [outbox](https://bettersupabase.com/blocks/outbox.md), [audit](https://bettersupabase.com/blocks/audit.md)
