"""
Measurement models for Sentinel acquisition.
"""

from dataclasses import dataclass
from datetime import datetime, timezone


@dataclass(frozen=True)
class EquipmentMeasurement:
    """
    Represent one complete equipment measurement.

    Attributes:
        recorded_at: UTC timestamp of the acquisition.
        ambient_temperature_c: Ambient temperature in degrees Celsius.
        internal_temperature_c: Internal equipment temperature.
        evaporator_temperature_c: Evaporator temperature.
        compressor_temperature_c: Compressor surface temperature.
        compressor_current_a: Compressor current in amperes.
        health_score: Equipment health score from 0 to 100.
    """

    recorded_at: datetime
    ambient_temperature_c: float
    internal_temperature_c: float
    evaporator_temperature_c: float
    compressor_temperature_c: float
    compressor_current_a: float
    health_score: float

    @classmethod
    def create(
        cls,
        ambient_temperature_c: float,
        internal_temperature_c: float,
        evaporator_temperature_c: float,
        compressor_temperature_c: float,
        compressor_current_a: float,
        health_score: float,
    ) -> "EquipmentMeasurement":
        """
        Create a measurement timestamped in UTC.

        Returns:
            Complete immutable equipment measurement.
        """
        return cls(
            recorded_at=datetime.now(timezone.utc),
            ambient_temperature_c=ambient_temperature_c,
            internal_temperature_c=internal_temperature_c,
            evaporator_temperature_c=evaporator_temperature_c,
            compressor_temperature_c=compressor_temperature_c,
            compressor_current_a=compressor_current_a,
            health_score=health_score,
        )