<!-- source-hash: f7e2eb6ca28207daca5b3bc5bf7ad178 -->
Defines TypeScript interfaces for managing waitlist entries in the Flamingo/OpenFrame platform, covering creation, retrieval, and API response shapes.

## Key Components

| Interface | Description |
|-----------|-------------|
| `WaitlistEntry` | Full waitlist record as returned from the database, including tracking, HubSpot integration metadata, enriched data, and cohort membership |
| `CreateWaitlistEntry` | Payload shape for submitting a new waitlist entry (subset of `WaitlistEntry`, no server-generated fields) |
| `WaitlistResponse` | Standard API response wrapper with `success` flag, optional `data`, and optional `error` |

## Usage Example

```typescript
import type {
  WaitlistEntry,
  CreateWaitlistEntry,
  WaitlistResponse,
} from './waitlist';

// Submitting a new waitlist signup
const payload: CreateWaitlistEntry = {
  email: 'dev@example.com',
  name: 'Jane Dev',
  company: 'Acme MSP',
  platform_id: 'openframe',
  referral_source: 'organic',
  utm_source: 'google',
  utm_medium: 'cpc',
  utm_campaign: 'launch-2025',
};

// Handling the API response
const response: WaitlistResponse = await submitWaitlist(payload);

if (response.success && response.data) {
  const entry: WaitlistEntry = response.data;

  // Access HubSpot sync status
  console.log(entry.hubspot_sync_status); // 'success' | 'error' | 'missing' | null

  // Access enriched cohort info (server-side populated)
  if (entry.cohort) {
    console.log(entry.cohort.cohort_name);
    console.log(entry.cohort.access_code_used);
  }
}
```

> **Note:** `WaitlistEntry.cohort_memberships` may contain multiple records from the join, but business rules enforce a maximum of one active cohort per entry. Use the server-populated `cohort` shorthand field for clean access.