from pydantic import BaseModel
from typing import Optional
from datetime import datetime

# Word Schema
class WordBase(BaseModel):
    feedback_id: int
    store_id: int
    branch_id: int
    word: str
    sentiment: str

class WordCreate(WordBase):
    pass

class WordResponse(WordBase):
    word_id: int
    created_at: datetime

    class Config:
        from_attributes = True


#  Topic Schema
class TopicBase(BaseModel):
    topic_name: str
    topic_category: str

class TopicCreate(TopicBase):
    pass

class TopicResponse(TopicBase):
    topic_id: int
    created_at: datetime

    class Config:
        from_attributes = True


#  Review Topic Schema
class ReviewTopicBase(BaseModel):
    store_id: int
    branch_id: int
    review_id: int
    topic_id: int
    topic_name: str
    topic_sentiment: str

class ReviewTopicCreate(ReviewTopicBase):
    pass

class ReviewTopicResponse(ReviewTopicBase):
    rt_id: int
    created_at: datetime

    class Config:
        from_attributes = True
