from typing import TYPE_CHECKING

from sqlalchemy import Column, ForeignKey, Integer, String, DateTime, Boolean

from app.db.base_class import Base

class SerialNumber(Base):
  __tablename__ = "serial_number"
  code = Column(String(length=20), primary_key=True)
  time = Column(Integer, nullable=False)
  created_datetime = Column(DateTime)
  is_used = Column(Boolean, nullable=False, default=False)
  used_datetime = Column(DateTime)
  owner_id = Column(Integer, ForeignKey("user.id"))
