"""
Publisher URLs
Phase 5: Sites Renderer & Publishing
"""
from django.urls import path, include
from rest_framework.routers import DefaultRouter

from igny8_core.modules.publisher.views import (
    PublishingRecordViewSet,
    DeploymentRecordViewSet,
    PublisherViewSet,
    SiteDefinitionView,
)

router = DefaultRouter()
router.register(r'publishing-records', PublishingRecordViewSet, basename='publishing-record')
router.register(r'deployments', DeploymentRecordViewSet, basename='deployment')
# Register PublisherViewSet with empty prefix so actions are at root level
router.register(r'', PublisherViewSet, basename='publisher')

urlpatterns = [
    path('', include(router.urls)),
    # Public endpoint for Sites Renderer
    path('sites/<int:site_id>/definition/', SiteDefinitionView.as_view(), name='site-definition'),
]

