"""Contact form submission model."""
from sqlalchemy import Column, Integer, String, Text, Boolean, TIMESTAMP, func
from app.database import Base


class Contact(Base):
    __tablename__ = "contacts"

    id = Column(Integer, primary_key=True, autoincrement=True)
    name = Column(String(255), nullable=False)
    email = Column(String(255), nullable=False)
    phone = Column(String(64))
    message = Column(Text, nullable=False)
    privacy_consent = Column(Boolean, nullable=False)
    email_sent = Column(Boolean, default=False)
    created_at = Column(TIMESTAMP, server_default=func.now())
