"""
Core System Rich Choice Objects

This module defines all choice objects for core system functionality,
including health checks, API statuses, and other system-level choices.
"""

from .base import ChoiceCategory, RichChoice
from .registry import register_choices

# Health Check Status Choices
HEALTH_STATUSES = [
    RichChoice(
        value="healthy",
        label="Healthy",
        description="System is operating normally with no issues detected",
        metadata={
            "color": "green",
            "icon": "check-circle",
            "css_class": "bg-green-100 text-green-800",
            "sort_order": 1,
            "http_status": 200,
        },
        category=ChoiceCategory.STATUS,
    ),
    RichChoice(
        value="unhealthy",
        label="Unhealthy",
        description="System has detected issues that may affect functionality",
        metadata={
            "color": "red",
            "icon": "x-circle",
            "css_class": "bg-red-100 text-red-800",
            "sort_order": 2,
            "http_status": 503,
        },
        category=ChoiceCategory.STATUS,
    ),
]

# Simple Health Check Status Choices
SIMPLE_HEALTH_STATUSES = [
    RichChoice(
        value="ok",
        label="OK",
        description="Basic health check passed",
        metadata={
            "color": "green",
            "icon": "check",
            "css_class": "bg-green-100 text-green-800",
            "sort_order": 1,
            "http_status": 200,
        },
        category=ChoiceCategory.STATUS,
    ),
    RichChoice(
        value="error",
        label="Error",
        description="Basic health check failed",
        metadata={
            "color": "red",
            "icon": "x",
            "css_class": "bg-red-100 text-red-800",
            "sort_order": 2,
            "http_status": 500,
        },
        category=ChoiceCategory.STATUS,
    ),
]

# Entity Type Choices for Search
ENTITY_TYPES = [
    RichChoice(
        value="park",
        label="Park",
        description="Theme parks and amusement parks",
        metadata={
            "color": "green",
            "icon": "map-pin",
            "css_class": "bg-green-100 text-green-800",
            "sort_order": 1,
            "search_weight": 1.0,
        },
        category=ChoiceCategory.CLASSIFICATION,
    ),
    RichChoice(
        value="ride",
        label="Ride",
        description="Individual rides and attractions",
        metadata={
            "color": "blue",
            "icon": "activity",
            "css_class": "bg-blue-100 text-blue-800",
            "sort_order": 2,
            "search_weight": 1.0,
        },
        category=ChoiceCategory.CLASSIFICATION,
    ),
    RichChoice(
        value="company",
        label="Company",
        description="Manufacturers, operators, and designers",
        metadata={
            "color": "purple",
            "icon": "building",
            "css_class": "bg-purple-100 text-purple-800",
            "sort_order": 3,
            "search_weight": 0.8,
        },
        category=ChoiceCategory.CLASSIFICATION,
    ),
    RichChoice(
        value="user",
        label="User",
        description="User profiles and accounts",
        metadata={
            "color": "orange",
            "icon": "user",
            "css_class": "bg-orange-100 text-orange-800",
            "sort_order": 4,
            "search_weight": 0.5,
        },
        category=ChoiceCategory.CLASSIFICATION,
    ),
]


def register_core_choices():
    """Register all core system choices with the global registry"""

    register_choices(
        name="health_statuses",
        choices=HEALTH_STATUSES,
        domain="core",
        description="Health check status options",
        metadata={"domain": "core", "type": "health_status"},
    )

    register_choices(
        name="simple_health_statuses",
        choices=SIMPLE_HEALTH_STATUSES,
        domain="core",
        description="Simple health check status options",
        metadata={"domain": "core", "type": "simple_health_status"},
    )

    register_choices(
        name="entity_types",
        choices=ENTITY_TYPES,
        domain="core",
        description="Entity type classifications for search functionality",
        metadata={"domain": "core", "type": "entity_type"},
    )


# Auto-register choices when module is imported
register_core_choices()
