from rest_framework import serializers


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


class EconomicDataItemSerializer(serializers.Serializer):
    title = serializers.CharField()
    value = serializers.CharField()
    subtitle = serializers.CharField()
    avatarIcon = serializers.CharField()
    avatarColor = serializers.CharField()


class EconomicChartSeriesSerializer(serializers.Serializer):
    name = serializers.CharField()
    data = serializers.ListField(child=serializers.FloatField())


class EconomicOverviewResponseSerializer(serializers.Serializer):
    farm_uuid = serializers.CharField()
    source = serializers.CharField()
    economicData = EconomicDataItemSerializer(many=True)
    chartSeries = EconomicChartSeriesSerializer(many=True)
    chartCategories = serializers.ListField(child=serializers.CharField())
