from django.urls import path
from .views import (
    IntegrationsListView,
    toggle_integration,
    save_integration_settings,
    get_integration_form_data,
    test_integration_connection,
    RecommerceBatchSyncView,
    get_openrouter_models,
)

app_name = 'integrations'

urlpatterns = [
    # Страница со списком интеграций
    path("", IntegrationsListView.as_view(), name="list"),

    # API endpoints для управления интеграциями
    path("toggle/<str:integration_id>/", toggle_integration, name="toggle"),
    path("settings/<str:integration_id>/", save_integration_settings, name="settings"),
    path("form/<str:integration_id>/", get_integration_form_data, name="form_data"),
    path("test/<str:integration_id>/", test_integration_connection, name="test"),
    
    # Синхронизация
    path("recommerce/sync/", RecommerceBatchSyncView.as_view(), name="recommerce_sync"),

    # OpenRouter модели
    path("openrouter/models/", get_openrouter_models, name="openrouter_models"),
]
