from django.urls import path, include
from rest_framework.routers import DefaultRouter

from apps.calls import views
from apps.calls import tests


router = DefaultRouter()

router.register(
    r'sales', views.SalesCallViewSet,
    basename='sales-calls'
)
router.register(
    r'current-user',
    views.CurrentUserCallViewSet,
    basename='current-user'
)
router.register(
    r'bdc-calls',
    views.BDCProgressViewSet,
    basename='bdc-calls'
)
router.register(
    r'advisor',
    views.AdvisorCallViewSet,
    basename='advisor-calls'
)
router.register(
    r'tony-calls',
    views.TonyCallViewSet,
    basename="tony-call"
)
router.register(
    'dealership',
    views.DealershipCallViewSet,
    basename='dealership-calls'
)
router.register(
    '',
    views.ServiceCallViewSet,
    basename='service-calls'
)

app_name = 'calls'

urlpatterns = [
    path('', include(router.urls)),
    path(
        'calls/<int:pk>/read/',
        views.CallReadViewSet.as_view(),
        name='mark-call-read'
    ),
    path(
        '<int:pk>/played/',
        views.CallPlayViewSet.as_view(),
        name='mark-call-played'
    ),
    
    path(
        "messages",
        views.MessageListView.as_view(),
        name="message-list"
    ),
    path(
        "message/<int:pk>/",
        views.MessageDetailView.as_view(),
        name="message-detail"
    ),
    path(
        "message/<int:pk>/read/",
        views.MarkMessageReadView.as_view(),
        name="message-mark-read"
    ),
    path(
        "notifications",
        views.NotificationListView.as_view(),
        name="notification-list"
    ),
    path(
        "notification/<int:pk>/",
        views.NotificationDetailView.as_view(),
        name="notification-detail"
    ),
    path(
        "notification/<int:pk>/read/",
        views.MarkNotificationReadView.as_view(),
        name="notification-mark-read"
    ),

    path(
        "catch-phrase-report",
        views.CatchPhraseReportAPIView.as_view(),
        name="catchphrase-report"
    ),

    path(
        "test/process-booking-call-intent",
        tests.TestBookingIntentAPIView.as_view(),
        name="test-process-booking-call-intent"
    ),

    path(
        "test/message-notification-webhook",
        tests.SendMessageNotificationTest.as_view(),
        name="test-message-webhook"
    )
]
