from pydantic import BaseModel
from typing import Optional
from datetime import date, time
from decimal import Decimal
import uuid

class HealthMetricCreate(BaseModel):
    measurement_date: date
    measurement_time: Optional[time] = None
    weight: Optional[Decimal] = None
    height: Optional[Decimal] = None
    body_fat_percentage: Optional[Decimal] = None
    muscle_mass: Optional[Decimal] = None
    waist: Optional[Decimal] = None
    chest: Optional[Decimal] = None
    hips: Optional[Decimal] = None
    notes: Optional[str] = None

class HealthMetricResponse(BaseModel):
    id: uuid.UUID
    user_id: uuid.UUID
    measurement_date: date
    measurement_time: Optional[time]
    weight: Optional[Decimal]
    height: Optional[Decimal]
    body_fat_percentage: Optional[Decimal]
    muscle_mass: Optional[Decimal]
    waist: Optional[Decimal]
    chest: Optional[Decimal]
    hips: Optional[Decimal]
    notes: Optional[str]
    
    class Config:
        from_attributes = True

class HealthMetricUpdate(BaseModel):
    measurement_date: Optional[date] = None
    measurement_time: Optional[time] = None
    weight: Optional[Decimal] = None
    height: Optional[Decimal] = None
    body_fat_percentage: Optional[Decimal] = None
    muscle_mass: Optional[Decimal] = None
    waist: Optional[Decimal] = None
    chest: Optional[Decimal] = None
    hips: Optional[Decimal] = None
    notes: Optional[str] = None

