from rest_framework import serializers


class FarmWeatherRequestSerializer(serializers.Serializer):
    farm_uuid = serializers.UUIDField(required=True, help_text="شناسه یکتای مزرعه")


class WeatherChartDataSerializer(serializers.Serializer):
    labels = serializers.ListField(child=serializers.CharField())
    series = serializers.ListField(child=serializers.ListField(child=serializers.FloatField()))


class FarmWeatherResponseSerializer(serializers.Serializer):
    condition = serializers.CharField()
    temperature = serializers.FloatField()
    unit = serializers.CharField()
    humidity = serializers.FloatField()
    windSpeed = serializers.FloatField()
    windUnit = serializers.CharField()
    chartData = WeatherChartDataSerializer()


class WaterNeedPredictionRequestSerializer(serializers.Serializer):
    farm_uuid = serializers.UUIDField(required=True, help_text="شناسه یکتای مزرعه")


class WaterNeedPredictionResponseSerializer(serializers.Serializer):
    farm_uuid = serializers.CharField()
    totalNext7Days = serializers.FloatField()
    unit = serializers.CharField()
    categories = serializers.ListField(child=serializers.CharField())
    series = serializers.JSONField()
    dailyBreakdown = serializers.JSONField()
    insight = serializers.JSONField()
    raw_response = serializers.CharField(allow_null=True, required=False)
