from datetime import datetime

class Profile:
    """User profile information"""
    
    TABLE_NAME = "profiles"
    
    def __init__(self, id, user_id, display_name, age, gender, location, bio, interests, created_at=None, updated_at=None):
        self.id = id
        self.user_id = user_id
        self.display_name = display_name
        self.age = age
        self.gender = gender
        self.location = location
        self.bio = bio
        self.interests = interests  # JSON array
        self.created_at = created_at or datetime.utcnow()
        self.updated_at = updated_at or datetime.utcnow()
    
    def to_dict(self):
        return {
            "id": self.id,
            "user_id": self.user_id,
            "display_name": self.display_name,
            "age": self.age,
            "gender": self.gender,
            "location": self.location,
            "bio": self.bio,
            "interests": self.interests,
            "created_at": self.created_at.isoformat() if self.created_at else None,
            "updated_at": self.updated_at.isoformat() if self.updated_at else None,
        }
