Files
site11/services
jungwoo choi 68cc70118f fix: Sync News API models with actual MongoDB schema
## 🔧 Model Synchronization
Updated Pydantic models to match actual article structure in MongoDB

### Changes
- **Article Model**: Complete restructure to match MongoDB documents
  - Added Subtopic, Reference, Entities nested models
  - Changed created_at to Union[str, datetime] with serializer
  - Added all pipeline metadata fields (job_id, keyword_id, etc.)
  - Added translation & image fields
  - Changed category (single) to categories (array)

- **ArticleSummary Model**: Updated for list responses
  - Synced with actual MongoDB structure
  - Added news_id, categories array, images array

- **ArticleService**: Fixed category filtering
  - Changed "category" to "categories" (array field)
  - Updated search to include subtopics and source_keyword
  - Implemented MongoDB aggregation for category list

### Verified Fields
 news_id, title, summary, created_at, language
 subtopics (array of {title, content[]})
 categories (array), entities (nested object)
 references (array), source_keyword, source_count
 pipeline_stages, job_id, keyword_id, processing_time
 images (array), image_prompt, translated_languages

### Testing
- Validated with actual English articles (20,966 total)
- Search functionality working (15,298 AI-related articles)
- Categories endpoint returning 1000+ unique categories
- All datetime fields properly serialized to ISO format

🤖 Generated with [Claude Code](https://claude.ai/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-03 17:27:26 +09:00
..