"""
User Database Model
"""
from sqlalchemy import Column, Integer, String, Text
from app.core.database import Base


class User(Base):
    """User model for user management"""
    
    __tablename__ = "user_manage"
    
    id = Column(Integer, primary_key=True, autoincrement=True)
    name = Column(Text, nullable=False)
    email = Column(Text, nullable=False)
    contact = Column(Text, nullable=False)  # Changed to Text to match database usage
    password = Column(Text, nullable=False)
    passkey = Column(Text, nullable=False)
    end_date = Column(Text, nullable=False)
    status = Column(Text, nullable=False)
    user_token = Column(Text, nullable=False)
    created_at = Column(Text, nullable=False)
    updated_at = Column(Text, nullable=False)
    
    def __repr__(self):
        return f"<User(id={self.id}, name={self.name}, email={self.email})>"
