<!-- source-hash: 8148802670f3c4122204649c0bccdbcd -->
Type definitions for the Flamingo blog system, covering database models, form data, query options, SEO analysis, and filtering structures used across the blog feature.

## Key Components

| Export | Type | Description |
|--------|------|-------------|
| `BlogPost` | Interface | Core database model with SEO fields, relationships, and raw API response structure |
| `BlogStatus` | Union Type | Post lifecycle states: `draft`, `ai_drafted`, `published`, `ai_published`, `scheduled`, `archived` |
| `Platform` | Type | String alias for platform identifiers (fetched dynamically from DB) |
| `CreateBlogPostData` | Interface | Payload shape for creating new posts including platforms, categories, and tags |
| `UpdateBlogPostData` | Interface | Partial update payload for existing posts |
| `GetBlogPostsOptions` | Interface | Query filters including pagination, sorting, platform, and search |
| `BlogPostStats` | Interface | Dashboard aggregates with per-platform post counts |
| `SEOAnalysisResult` | Interface | Scored SEO breakdown with keyword density, suggestions, errors, and warnings |
| `BlogPagination` | Interface | Paginated response wrapping `BlogPostSummary` records |
| `BlogPostSummary` | Interface | Lightweight post projection for listing pages |
| `BlogFilters` | Interface | Filter options (categories + tags) for sidebar filtering UI |

## Usage Example

```typescript
import type {
  BlogPost,
  CreateBlogPostData,
  GetBlogPostsOptions,
  SEOAnalysisResult
} from './blog'

// Fetch options with filtering and pagination
const options: GetBlogPostsOptions = {
  platform: 'flamingo',
  status: 'published',
  page: 1,
  pageSize: 10,
  sortBy: 'published_at',
  sortOrder: 'desc',
  search: 'automation'
}

// Create post payload
const newPost: CreateBlogPostData = {
  title: 'Getting Started with OpenFrame',
  slug: 'getting-started-openframe',
  content: '...',
  author_id: 'user-123',
  status: 'draft',
  platforms: ['flamingo', 'openframe'],
  categories: [1, 3],
  tags: [5]
}

// SEO result from analysis service
const seo: SEOAnalysisResult = {
  overall_score: 82,
  title_score: 90,
  meta_description_score: 75,
  content_score: 85,
  readability_score: 78,
  keyword_density: { 'openframe': 0.03 },
  suggestions: ['Add more internal links'],
  errors: [],
  warnings: ['Meta description slightly short']
}
```