"""
Statistics serializers for ThrillWiki API.

Provides serialization for platform statistics data.
"""

from rest_framework import serializers


class StatsSerializer(serializers.Serializer):
    """
    Serializer for platform statistics response.

    This serializer defines the structure of the statistics API response,
    including all the various counts and breakdowns available.
    """

    # Core entity counts
    total_parks = serializers.IntegerField(help_text="Total number of parks in the database")
    total_rides = serializers.IntegerField(help_text="Total number of rides in the database")
    total_manufacturers = serializers.IntegerField(help_text="Total number of ride manufacturers")
    total_operators = serializers.IntegerField(help_text="Total number of park operators")
    total_designers = serializers.IntegerField(help_text="Total number of ride designers")
    total_property_owners = serializers.IntegerField(help_text="Total number of property owners")
    total_roller_coasters = serializers.IntegerField(help_text="Total number of roller coasters with detailed stats")

    # Photo counts
    total_photos = serializers.IntegerField(help_text="Total number of photos (parks + rides combined)")
    total_park_photos = serializers.IntegerField(help_text="Total number of park photos")
    total_ride_photos = serializers.IntegerField(help_text="Total number of ride photos")

    # Review counts
    total_reviews = serializers.IntegerField(help_text="Total number of reviews (parks + rides)")
    total_park_reviews = serializers.IntegerField(help_text="Total number of park reviews")
    total_ride_reviews = serializers.IntegerField(help_text="Total number of ride reviews")

    # Ride category counts (optional fields since they depend on data)
    roller_coasters = serializers.IntegerField(
        required=False, help_text="Number of rides categorized as roller coasters"
    )
    dark_rides = serializers.IntegerField(required=False, help_text="Number of rides categorized as dark rides")
    flat_rides = serializers.IntegerField(required=False, help_text="Number of rides categorized as flat rides")
    water_rides = serializers.IntegerField(required=False, help_text="Number of rides categorized as water rides")
    transport_rides = serializers.IntegerField(
        required=False, help_text="Number of rides categorized as transport rides"
    )
    other_rides = serializers.IntegerField(required=False, help_text="Number of rides categorized as other")

    # Park status counts (optional fields since they depend on data)
    operating_parks = serializers.IntegerField(required=False, help_text="Number of currently operating parks")
    temporarily_closed_parks = serializers.IntegerField(required=False, help_text="Number of temporarily closed parks")
    permanently_closed_parks = serializers.IntegerField(required=False, help_text="Number of permanently closed parks")
    under_construction_parks = serializers.IntegerField(required=False, help_text="Number of parks under construction")
    demolished_parks = serializers.IntegerField(required=False, help_text="Number of demolished parks")
    relocated_parks = serializers.IntegerField(required=False, help_text="Number of relocated parks")

    # Ride status counts (optional fields since they depend on data)
    operating_rides = serializers.IntegerField(required=False, help_text="Number of currently operating rides")
    temporarily_closed_rides = serializers.IntegerField(required=False, help_text="Number of temporarily closed rides")
    sbno_rides = serializers.IntegerField(required=False, help_text="Number of rides standing but not operating")
    closing_rides = serializers.IntegerField(required=False, help_text="Number of rides in the process of closing")
    permanently_closed_rides = serializers.IntegerField(required=False, help_text="Number of permanently closed rides")
    under_construction_rides = serializers.IntegerField(required=False, help_text="Number of rides under construction")
    demolished_rides = serializers.IntegerField(required=False, help_text="Number of demolished rides")
    relocated_rides = serializers.IntegerField(required=False, help_text="Number of relocated rides")

    # Metadata
    last_updated = serializers.CharField(help_text="ISO timestamp when these statistics were last calculated")
    relative_last_updated = serializers.CharField(
        help_text="Human-readable relative time since last update (e.g., '2 minutes ago')"
    )
