from pydantic import BaseModel, Field
from datetime import datetime
from typing import List


class EventCommentCreate(BaseModel):
    content: str = Field(..., min_length=1, max_length=500)


class EventComment(BaseModel):
    id: int
    event_id: int
    user_id: int
    username: str
    content: str
    created_at: datetime

    class Config:
        from_attributes = True


class EventCommentsResponse(BaseModel):
    comments: List[EventComment]
    total: int
