from sqlalchemy import Column, String, Date, Time, Numeric, ForeignKey
from sqlalchemy.dialects.postgresql import UUID
import uuid

from app.core.database import Base

class HealthMetric(Base):
    __tablename__ = "health_metrics"
    
    id = Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
    user_id = Column(UUID(as_uuid=True), ForeignKey("users.id", ondelete="CASCADE"), nullable=False)
    measurement_date = Column(Date, nullable=False)
    measurement_time = Column(Time)
    weight = Column(Numeric(5, 2))
    height = Column(Numeric(5, 2))
    body_fat_percentage = Column(Numeric(4, 2))
    muscle_mass = Column(Numeric(5, 2))
    waist = Column(Numeric(5, 2))
    chest = Column(Numeric(5, 2))
    hips = Column(Numeric(5, 2))
    notes = Column(String)
