from enum import IntEnum

from django.core.management import call_command
from django.core.management.base import BaseCommand

from marketmanager import __title__

# Eve Category IDs
MATERIAL = 4
SHIP = 6
MODULE = 7
CHARGE = 8
DRONE = 18
IMPLANT = 20
SUBSYSTEM = 32
INFRASTRUCTURE_UPGRADES = 39
SOVEREIGNTY_STRUCTURES = 40
PLANETARY_INDUSTRY = 41
PLANETARY_RESOURCES = 42
PLANETARY_COMMODITIES = 43
STRUCTURE = 65
STRUCTURE_MODULE = 66


class Command(BaseCommand):
    help = "Preloads data required for this app from ESI"

    def handle(self, *args, **options):
        call_command(
            "eveuniverse_load_types",
            __title__,
            "--category_id",
            str(MATERIAL),
            "--category_id",
            str(SHIP),
            "--category_id",
            str(MODULE),
            "--category_id",
            str(CHARGE),
            "--category_id",
            str(DRONE),
            "--category_id",
            str(IMPLANT),
            "--category_id",
            str(SUBSYSTEM),
            "--category_id",
            str(INFRASTRUCTURE_UPGRADES),
            "--category_id",
            str(SOVEREIGNTY_STRUCTURES),
            "--category_id",
            str(PLANETARY_INDUSTRY),
            "--category_id",
            str(PLANETARY_RESOURCES),
            "--category_id",
            str(PLANETARY_COMMODITIES),
            "--category_id",
            str(STRUCTURE),
            "--category_id",
            str(STRUCTURE_MODULE),
        )
