from django.urls import path

from buybackprogram.views import calculate, common, programs, special_taxes, stats

app_name = "buybackprogram"

urlpatterns = [
    path("", common.index, name="index"),
    path("faq", common.faq, name="faq"),
    path("setup", programs.setup, name="setup"),
    path("program_add", programs.program_add, name="program_add"),
    path("location_add", programs.location_add, name="location_add"),
    path("user_settings_edit", common.user_settings_edit, name="user_settings_edit"),
    path("group_autocomplete/", common.group_autocomplete, name="group_autocomplete"),
    path(
        "update_prices/force/", common.trigger_price_update, name="trigger_price_update"
    ),
    path(
        "program/<int:program_pk>/watchlist/edit/",
        special_taxes.program_edit_watchlist,
        name="program_edit_watchlist",
    ),
    path(
        "program/<int:program_pk>/watchlist/<int:watchlist_pk>/remove/",
        special_taxes.remove_watchlist_item,
        name="remove_watchlist_item",
    ),
    path(
        "location<int:location_pk>/remove",
        programs.location_remove,
        name="location_remove",
    ),
    path("stats/sync/", programs.manual_contract_sync, name="manual_contract_sync"),
    path(
        "program/<int:program_pk>/leaderboard",
        stats.leaderboard,
        name="program_leaderboard",
    ),
    path(
        "program/<int:program_pk>/performance",
        stats.program_performance,
        name="program_performance",
    ),
    path(
        "program/<int:program_pk>/special_taxes",
        special_taxes.program_special_taxes,
        name="program_special_taxes",
    ),
    path(
        "program/<int:program_pk>/edit_item",
        special_taxes.program_edit_item,
        name="program_edit_item",
    ),
    path(
        "program/<int:program_pk>/edit_marketgroup",
        special_taxes.program_edit_marketgroup,
        name="program_edit_marketgroup",
    ),
    path(
        "program/<int:program_pk>/edit",
        programs.program_edit,
        name="program_edit",
    ),
    path(
        "program/<int:program_pk>/remove",
        programs.program_remove,
        name="program_remove",
    ),
    path(
        "program/<int:program_pk>/program_item/<int:item_pk>/remove",
        special_taxes.program_item_remove,
        name="program_item_remove",
    ),
    path(
        "program/<int:program_pk>/edit_static_price",
        special_taxes.program_edit_static_price,
        name="program_edit_static_price",
    ),
    path(
        "program/<int:program_pk>/static_price/<int:price_pk>/remove",
        special_taxes.remove_static_price,
        name="remove_static_price",
    ),
    path(
        "program/<int:program_pk>/remove_all",
        special_taxes.program_item_remove_all,
        name="program_item_remove_all",
    ),
    path(
        "program/<int:program_pk>/calculate",
        calculate.program_calculate,
        name="program_calculate",
    ),
    path("my_stats", stats.my_stats, name="my_stats"),
    path(
        "tracking/<str:contract_title>/",
        stats.contract_details,
        name="contract_details",
    ),
    path("program_stats", stats.program_stats, name="program_stats"),
    path("program_stats_all", stats.program_stats_all, name="program_stats_all"),
    path(
        "item_autocomplete/",
        common.item_autocomplete,
        name="item_autocomplete",
    ),
    path(
        "solarsystem_autocomplete/",
        common.solarsystem_autocomplete,
        name="solarsystem_autocomplete",
    ),
    path(
        "marketgroup_autocomplete/",
        common.marketgroup_autocomplete,
        name="marketgroup_autocomplete",
    ),
    # Reverse buyback
    path("reverse/", programs.reverse_index, name="reverse_index"),
    path(
        "reverse/program_add", programs.reverse_program_add, name="reverse_program_add"
    ),
    path(
        "reverse/program/<int:program_pk>/edit",
        programs.reverse_program_edit,
        name="reverse_program_edit",
    ),
    path(
        "reverse/program/<int:program_pk>/remove",
        programs.reverse_program_remove,
        name="reverse_program_remove",
    ),
    path(
        "reverse/program/<int:program_pk>/calculate",
        calculate.reverse_program_calculate,
        name="reverse_program_calculate",
    ),
    path(
        "reverse/hangar_sync",
        programs.manual_hangar_sync,
        name="manual_hangar_sync",
    ),
    path(
        "reverse/my_stats",
        stats.my_reverse_stats,
        name="reverse_my_stats",
    ),
    path(
        "reverse/tracking/<str:contract_title>/",
        stats.reverse_contract_details,
        name="reverse_contract_details",
    ),
    path(
        "reverse/stats/sync/",
        programs.manual_reverse_contract_sync,
        name="manual_reverse_contract_sync",
    ),
    path(
        "reverse/program_stats",
        stats.reverse_program_stats,
        name="reverse_program_stats",
    ),
    path(
        "reverse/hangar_division_autocomplete/",
        programs.hangar_division_autocomplete,
        name="hangar_division_autocomplete",
    ),
    path(
        "wallet_autocomplete/",
        programs.wallet_autocomplete,
        name="wallet_autocomplete",
    ),
]
