<!-- source-hash: f0baaf40642c975086a4698fa70728a9 -->
Brief description: Defines all TypeScript interfaces, types, and enums for the Flamingo Marketing AI system, covering campaigns, AI-generated content, media assets, social accounts, scheduled posts, approvals, and usage tracking.

## Key Components

### Campaign Types
- **`MarketingCampaign`** — Core campaign entity with content seed fields (`content_source_type`, `content_source_id`, `custom_instructions`)
- **`CreateCampaignInput`** / **`UpdateCampaignInput`** — Input shapes for campaign mutations

### Content Types
- **`ContentType`** — `'blog_post' | 'social_post' | 'ad_copy' | 'email'`
- **`ContentStatus`** — Lifecycle states from `'draft'` through `'published'`
- **`AIContent`** — Generated text content with publishing, override, and URL injection fields
- **`CreateAIContentInput`** — Input for creating AI-generated content records

### Media Types
- **`MediaType`** — `'image' | 'video' | 'figma_export'`
- **`MediaProvider`** — Supported AI providers: `dalle`, `flux-pro`, `kling-v2.5`, `luma-ray2`, and more
- **`AIMedia`** — Media asset entity including storage paths, dimensions, Figma integration, and publish overrides
- **`MediaDimensions`** — Width, height, and aspect ratio descriptor

### Social & Scheduling Types
- **`SocialChannel`** — `'slack' | 'linkedin' | 'facebook' | 'instagram' | 'twitter' | 'youtube'`
- **`SocialAccount`** / **`CreateSocialAccountInput`** — OAuth account records with encrypted tokens
- **`ScheduledPost`** / **`CreateScheduledPostInput`** — Post scheduling with retry tracking

### Approval & Usage Types
- **`ContentApproval`** — Approval workflow for content, media, and campaigns
- **`AIUsage`** / **`TrackAIUsageInput`** — Cost and token tracking per AI service and operation
- **`AIService`** — `'anthropic' | 'openai' | 'replicate' | 'figma' | 'google'`

### Aggregate & Source Types
- **`CampaignWithDetails`** — Campaign bundled with its content and media arrays
- **`CampaignStats`** / **`AIUsageSummary`** — Dashboard-level rollup statistics
- **`ContentSourceType`** — Union of 11 seed content origins (`product_release`, `blog_post_seed`, `event`, `podcast`, etc.)
- **`URLInjectionPreference`** — `'none' | 'in_post' | 'as_comment'`

## Usage Example

```typescript
import type {
  CreateCampaignInput,
  AIContent,
  ContentType,
  URLInjectionPreference,
} from './marketing';

// Create a campaign seeded from a product release
const newCampaign: CreateCampaignInput = {
  name: 'Q3 Product Launch',
  content_source_type: 'product_release',
  content_source_id: 42,
  custom_instructions: 'Emphasize enterprise features and ROI',
  start_date: '2025-07-01',
};

// Type-safe AI content with URL injection preference
const socialPost: Partial<AIContent> = {
  content_type: 'social_post' as ContentType,
  status: 'draft',
  social_account_id: 7,
  url_injection_preference: 'as_comment' as URLInjectionPreference,
  selected_for_publish: false,
};
```