from typing import Optional

from sqlmodel import SQLModel, Field

from entity.base import TimestampMixin


class DeviceSceneRelationBase(SQLModel):
    scene_id: int
    device_id: int
    range_points: Optional[str] = None


class DeviceSceneRelation(DeviceSceneRelationBase, TimestampMixin, table=True):
    __tablename__ = 'device_scene_relation'
    id: Optional[int] = Field(default=None, primary_key=True)


class DeviceSceneRelationInfo(DeviceSceneRelationBase, TimestampMixin):
    id: int
    scene_name: str
    scene_version: str
    scene_handle_task: str
    scene_remark: Optional[str] = None
