# Forecasts

> Snapshots of the deals forecast call over time: the totals by category and every deal they counted, a list per period, and what changed between two snapshots (added, removed, won, lost, moved).

- Category: CRM & sales
- Module: `forecasts`
- Modes: `managed`
- Docs: https://bettersupabase.com/docs/blocks/forecasts
- Page: https://bettersupabase.com/blocks/forecasts

## Install

```bash
npx better-supabase add forecasts
```

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

## Configure

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

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

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

## Client

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

## Events

- `forecast.snapshotted`

## Related blocks

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

Works with: [outbox](https://bettersupabase.com/blocks/outbox.md), [data-lifecycle](https://bettersupabase.com/blocks/data-lifecycle.md)
