"""
Script to help migrate main.py endpoints to router files.
This script analyzes endpoint patterns and generates router code.
"""

# Endpoint grouping patterns
ROUTER_GROUPS = {
    "game_routes": [
        "/api/game/state",
        "/api/game/profile",
        "/api/game/spend_point",
        "/api/game/location",
        "/api/game/move",
        "/api/game/inspect",
        "/api/game/interact",
        "/api/game/use_item",
        "/api/game/pickup",
        "/api/game/inventory",
        "/api/game/item/drop"
    ],
    "equipment": [
        "/api/game/equip",
        "/api/game/unequip",
        "/api/game/equipment",
        "/api/game/repair_item",
        "/api/game/repairable",
        "/api/game/salvageable"
    ],
    "crafting": [
        "/api/game/craftable",
        "/api/game/craft_item",
        "/api/game/uncraft_item"
    ],
    "loot": [
        "/api/game/corpse/{corpse_id}",
        "/api/game/loot_corpse"
    ],
    "combat": [
        "/api/game/combat",
        "/api/game/combat/initiate",
        "/api/game/combat/action",
        "/api/game/pvp/initiate",
        "/api/game/pvp/status",
        "/api/game/pvp/acknowledge",
        "/api/game/pvp/action"
    ],
    "admin": [
        "/api/internal/player/by_id/{player_id}",
        "/api/internal/player/{player_id}/combat",
        "/api/internal/combat/create",
        "/api/internal/combat/{player_id}",
        "/api/internal/player/{player_id}",
        "/api/internal/player/{player_id}/move",
        "/api/internal/player/{player_id}/inspect",
        "/api/internal/player/{player_id}/interact",
        "/api/internal/player/{player_id}/inventory",
        "/api/internal/player/{player_id}/use_item",
        "/api/internal/player/{player_id}/pickup",
        "/api/internal/player/{player_id}/drop_item",
        "/api/internal/player/{player_id}/equip",
        "/api/internal/player/{player_id}/unequip",
        "/api/internal/dropped-items",
        "/api/internal/dropped-items/{dropped_item_id}",
        "/api/internal/location/{location_id}/dropped-items",
        "/api/internal/corpses/player",
        "/api/internal/corpses/player/{corpse_id}",
        "/api/internal/corpses/npc",
        "/api/internal/corpses/npc/{corpse_id}",
        "/api/internal/wandering-enemies",
        "/api/internal/location/{location_id}/wandering-enemies",
        "/api/internal/wandering-enemies/{enemy_id}",
        "/api/internal/inventory/item/{item_db_id}",
        "/api/internal/cooldown/{cooldown_key}",
        "/api/internal/location/{location_id}/corpses/player",
        "/api/internal/location/{location_id}/corpses/npc",
        "/api/internal/image-cache/{image_path:path}",
        "/api/internal/image-cache",
        "/api/internal/player/{player_id}/status-effects"
    ],
    "statistics": [
        "/api/statistics/{player_id}",
        "/api/statistics/me",
        "/api/leaderboard/{stat_name}"
    ]
}

print("Router migration patterns defined")
print(f"Total routes to migrate: {sum(len(v) for v in ROUTER_GROUPS.values())}")
for router_name, routes in ROUTER_GROUPS.items():
    print(f"  - {router_name}: {len(routes)} routes")
