"""News schemas.""" from typing import Optional from datetime import datetime from uuid import UUID from pydantic import BaseModel, Field class NewsBase(BaseModel): """Base news schema.""" title: str url: str source: str published_at: datetime class NewsCreate(NewsBase): """Schema for creating a news article.""" content: Optional[str] = None summary: Optional[str] = None author: Optional[str] = None image_url: Optional[str] = None class NewsResponse(NewsBase): """Schema for news response.""" id: UUID summary: Optional[str] = None author: Optional[str] = None fetched_at: datetime class Config: from_attributes = True class NewsWithSentiment(NewsResponse): """News response with sentiment analysis.""" content: Optional[str] = None image_url: Optional[str] = None sentiment_score: Optional[float] = None sentiment_label: Optional[str] = None sentiment_confidence: Optional[float] = None is_processed: bool = False