from typing import Optional

from pydantic import BaseModel



class SerialNumberBase(BaseModel):
    code: Optional[str] = None
    time: Optional[int] = None
    created_datetime: Optional[str] = None
    is_used: Optional[bool] = False
    used_datetime: Optional[str] = None

# Properties to receive via API on creation
class SerialNumberCreate(SerialNumberBase):
    pass


# Properties to receive via API on update
class SerialNumberUpdate(SerialNumberBase):
    owner_id: int