# GetSlackWorkspaceIntegration

## Overview

GetSlackWorkspaceIntegration retrieves the tenant's singleton `SlackWorkspaceIntegration` as redacted metadata: `teamId`, `teamName`, `botUserId`, `status` (`ACTIVE` | `REVOKED`), `installedAt`, `lastValidatedAt`, and `revokedAt`. It is used by admin UIs to show "Slack connected / disconnected" and by the install flow to decide whether a re-install is a fresh connect or a reconnect. The bot token is **never** returned — tokens are stored only in the secret manager and read by the Slack DestinationAdapter at send time.

## Business Rules

- Takes no input parameters; the tenant has at most one connection (singleton row)
- Returns `null` when no connection exists (not an error)
- The result never carries the bot token — it is not a column on the row (it lives in the host secret manager), so token material cannot appear in the projection
- Read-only; performs no mutation

## Process Flow

```mermaid
flowchart TD
    A[Receive getSlackWorkspaceIntegration with no parameters] --> B[Select the singleton SlackWorkspaceIntegration row]
    B --> C{row found?}
    C -->|No| D[Return null]
    C -->|Yes| E[Project redacted metadata, omit token]
    E --> F[Return connection metadata]
```

## External Dependencies

- [SlackWorkspaceIntegration](../model/SlackWorkspaceIntegration.md) - the connection row read and redacted

## Error Scenarios

- None — a missing connection returns `null` rather than erroring

## Test Cases

- returns the SlackWorkspaceIntegration as redacted metadata
- returns null when no connection exists
- never includes bot token in the result
