from sqlalchemy import Column, Integer, String, DateTime, ForeignKey
from sqlalchemy.sql import func
from app.db.base import Base

class EmailLog(Base):
    __tablename__ = "email_logs"
    __table_args__ = {"schema": "data"}

    id = Column(Integer, primary_key=True, index=True)
    user_id = Column(Integer, nullable=True) # Hozzáadva
    recipient = Column(String, index=True)   # Hozzáadva
    email = Column(String, index=True)
    email_type = Column(String)             # Frissítve a kódhoz
    type = Column(String)                   # Megtartva a kompatibilitás miatt
    provider_id = Column(Integer)           # Hozzáadva
    status = Column(String)                 # Hozzáadva
    sent_at = Column(DateTime(timezone=True), server_default=func.now())
