from core.database import Base
from datetime import datetime
from sqlalchemy import Column, DateTime, Integer, String


class Agent_availability(Base):
    __tablename__ = "agent_availability"
    __table_args__ = {"extend_existing": True}

    id = Column(Integer, primary_key=True, index=True, autoincrement=True, nullable=False)
    seat_id = Column(Integer, nullable=False)
    status = Column(String, nullable=False)
    last_heartbeat_at = Column(DateTime(timezone=True), nullable=True)
    created_at = Column(DateTime(timezone=True), default=datetime.now)
    updated_at = Column(DateTime(timezone=True), default=datetime.now, onupdate=datetime.now)