2025-08-12 13:33:25 +03:00

90 lines
5.9 KiB
Python

"""
Integration app URLs with comprehensive CRUD operations.
"""
from django.urls import path, include
from . import views
app_name = 'integration'
urlpatterns = [
# ============================================================================
# DASHBOARD AND OVERVIEW
# ============================================================================
path('', views.IntegrationDashboardView.as_view(), name='dashboard'),
# ============================================================================
# EXTERNAL SYSTEM URLS (FULL CRUD - Master Data)
# ============================================================================
path('systems/', views.ExternalSystemListView.as_view(), name='external_system_list'),
path('systems/create/', views.ExternalSystemCreateView.as_view(), name='external_system_create'),
path('systems/<int:pk>/', views.ExternalSystemDetailView.as_view(), name='external_system_detail'),
path('systems/<int:pk>/update/', views.ExternalSystemUpdateView.as_view(), name='external_system_update'),
path('systems/<int:pk>/delete/', views.ExternalSystemDeleteView.as_view(), name='external_system_delete'),
# ============================================================================
# INTEGRATION ENDPOINT URLS (FULL CRUD - Operational Data)
# ============================================================================
path('endpoints/', views.IntegrationEndpointListView.as_view(), name='integration_endpoint_list'),
path('endpoints/create/', views.IntegrationEndpointCreateView.as_view(), name='integration_endpoint_create'),
path('endpoints/<int:pk>/', views.IntegrationEndpointDetailView.as_view(), name='integration_endpoint_detail'),
path('endpoints/<int:pk>/update/', views.IntegrationEndpointUpdateView.as_view(), name='integration_endpoint_update'),
path('endpoints/<int:pk>/delete/', views.IntegrationEndpointDeleteView.as_view(), name='integration_endpoint_delete'),
# ============================================================================
# DATA MAPPING URLS (FULL CRUD - Operational Data)
# ============================================================================
path('mappings/', views.DataMappingListView.as_view(), name='data_mapping_list'),
path('mappings/create/', views.DataMappingCreateView.as_view(), name='data_mapping_create'),
path('mappings/<int:pk>/', views.DataMappingDetailView.as_view(), name='data_mapping_detail'),
path('mappings/<int:pk>/update/', views.DataMappingUpdateView.as_view(), name='data_mapping_update'),
path('mappings/<int:pk>/delete/', views.DataMappingDeleteView.as_view(), name='data_mapping_delete'),
# ============================================================================
# INTEGRATION EXECUTION URLS (READ-ONLY - System Generated)
# ============================================================================
path('executions/', views.IntegrationExecutionListView.as_view(), name='integration_execution_list'),
path('executions/<int:pk>/', views.IntegrationExecutionDetailView.as_view(), name='integration_execution_detail'),
# ============================================================================
# WEBHOOK ENDPOINT URLS (FULL CRUD - Operational Data)
# ============================================================================
path('webhooks/', views.WebhookEndpointListView.as_view(), name='webhook_endpoint_list'),
path('webhooks/create/', views.WebhookEndpointCreateView.as_view(), name='webhook_endpoint_create'),
path('webhooks/<int:pk>/', views.WebhookEndpointDetailView.as_view(), name='webhook_endpoint_detail'),
path('webhooks/<int:pk>/update/', views.WebhookEndpointUpdateView.as_view(), name='webhook_endpoint_update'),
path('webhooks/<int:pk>/delete/', views.WebhookEndpointDeleteView.as_view(), name='webhook_endpoint_delete'),
# ============================================================================
# WEBHOOK EXECUTION URLS (READ-ONLY - System Generated)
# ============================================================================
path('webhook-executions/', views.WebhookExecutionListView.as_view(), name='webhook_execution_list'),
path('webhook-executions/<int:pk>/', views.WebhookExecutionDetailView.as_view(), name='webhook_execution_detail'),
# ============================================================================
# INTEGRATION LOG URLS (READ-ONLY - System Generated)
# ============================================================================
path('logs/', views.IntegrationLogListView.as_view(), name='integration_log_list'),
path('logs/<int:pk>/', views.IntegrationLogDetailView.as_view(), name='integration_log_detail'),
# ============================================================================
# HTMX ENDPOINTS FOR REAL-TIME UPDATES
# ============================================================================
path('htmx/stats/', views.integration_stats, name='integration_stats'),
path('htmx/system-health/', views.system_health, name='system_health'),
# ============================================================================
# ACTION URLS FOR WORKFLOW OPERATIONS
# ============================================================================
path('systems/<int:system_id>/test-connection/', views.test_connection, name='test_connection'),
path('endpoints/<int:endpoint_id>/execute/', views.execute_endpoint, name='execute_endpoint'),
path('mappings/<int:mapping_id>/test/', views.test_data_mapping, name='test_data_mapping'),
path('endpoints/bulk-execute/', views.bulk_execute_endpoints, name='bulk_execute_endpoints'),
# ============================================================================
# API ENDPOINTS
# ============================================================================
path('api/', include('integration.api.urls')),
]