"""Domain validation helpers."""

from __future__ import annotations

from noteflow.config.constants import (
    ERROR_MSG_END_TIME_PREFIX,
    ERROR_MSG_START_TIME_COMPARISON,
)


def validate_time_range(start_time: float, end_time: float) -> None:
    """Validate that end_time is not before start_time.

    Args:
        start_time: Start time in seconds.
        end_time: End time in seconds.

    Raises:
        ValueError: If end_time is before start_time.
    """
    if end_time < start_time:
        raise ValueError(
            f"{ERROR_MSG_END_TIME_PREFIX}{end_time}){ERROR_MSG_START_TIME_COMPARISON}{start_time})"
        )
