from pydantic import BaseModel
from typing import Optional

class CategoryBase(BaseModel):
    name: str

class CategoryCreate(CategoryBase):
    pass

class CategoryUpdate(CategoryBase):
    pass

class CategoryPublic(CategoryBase):
    id: int
    user_id: Optional[int] = None
    group_id: Optional[int] = None

    class Config:
        orm_mode = True 