from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .views import (
    SiteViewSet, SiteConfigViewSet, PageViewSet, DomainViewSet, PublicPageView, PublicServiceViewSet,
    PublicAvailabilityView, PublicBusinessHoursView, PublicWeeklyHoursView, PublicBookingView,
    PublicPaymentIntentView, PublicBusinessInfoView, PublicSiteConfigView, PublicContactFormView
)

router = DefaultRouter()
router.register(r'sites', SiteViewSet, basename='site')
router.register(r'site-config', SiteConfigViewSet, basename='site-config')
router.register(r'pages', PageViewSet, basename='page')
router.register(r'domains', DomainViewSet, basename='domain')
router.register(r'public/services', PublicServiceViewSet, basename='public-service')

urlpatterns = [
    path('', include(router.urls)),
    path('sites/me/config/', SiteConfigViewSet.as_view({'get': 'me', 'patch': 'me'}), name='site-config-me'),
    path('public/page/', PublicPageView.as_view(), name='public-page'),
    path('public/site-config/', PublicSiteConfigView.as_view(), name='public-site-config'),
    path('public/business/', PublicBusinessInfoView.as_view(), name='public-business'),
    path('public/availability/', PublicAvailabilityView.as_view(), name='public-availability'),
    path('public/business-hours/', PublicBusinessHoursView.as_view(), name='public-business-hours'),
    path('public/weekly-hours/', PublicWeeklyHoursView.as_view(), name='public-weekly-hours'),
    path('public/bookings/', PublicBookingView.as_view(), name='public-booking'),
    path('public/payments/intent/', PublicPaymentIntentView.as_view(), name='public-payment-intent'),
    path('public/contact/', PublicContactFormView.as_view(), name='public-contact-form'),
]