from datetime import datetime
from typing import Optional

from sqlmodel import SQLModel, Field


class DeviceFrameBase(SQLModel):
    device_id: int
    frame_path: str
    time: datetime = Field(default_factory=datetime.now)


class DeviceFrame(DeviceFrameBase, table = True):
    __tablename__ = 'device_frame'
    id: Optional[int] = Field(default=None, primary_key=True)


class DeviceFrameCreate(DeviceFrameBase):
    pass


class DeviceFrameInfo(DeviceFrameBase):
    id: int
