"""
Field Mobile URL Configuration

All endpoints are mounted under /api/mobile/

UNUSED_ENDPOINT: All endpoints in this file are for a separate mobile app (React Native/Flutter)
and are not used by the main React web frontend. These are kept for the field technician
mobile application.
"""
from django.urls import path

from .views import (
    # Employee profile
    employee_profile_view,
    logout_view,
    # Job endpoints (list uses /api/appointments/ with date range filtering)
    job_detail_view,
    # Status management
    set_status_view,
    start_en_route_view,
    reschedule_job_view,
    # Location tracking
    location_update_view,
    location_route_view,
    # Calling and SMS
    call_customer_view,
    send_sms_view,
    call_history_view,
    # Twilio webhooks
    twilio_voice_webhook,
    twilio_voice_status_webhook,
    twilio_sms_webhook,
    twilio_sms_status_webhook,
)

app_name = 'field_mobile'

urlpatterns = [
    # Employee profile & auth
    path('me/', employee_profile_view, name='employee_profile'),
    path('logout/', logout_view, name='logout'),

    # Job management (list uses /api/appointments/ with date range filtering)
    path('jobs/<int:job_id>/', job_detail_view, name='job_detail'),

    # Status management
    path('jobs/<int:job_id>/set_status/', set_status_view, name='set_status'),
    path('jobs/<int:job_id>/start_en_route/', start_en_route_view, name='start_en_route'),
    path('jobs/<int:job_id>/reschedule/', reschedule_job_view, name='reschedule_job'),

    # Location tracking
    path('jobs/<int:job_id>/location_update/', location_update_view, name='location_update'),
    path('jobs/<int:job_id>/route/', location_route_view, name='location_route'),

    # Calling and SMS
    path('jobs/<int:job_id>/call_customer/', call_customer_view, name='call_customer'),
    path('jobs/<int:job_id>/send_sms/', send_sms_view, name='send_sms'),
    path('jobs/<int:job_id>/call_history/', call_history_view, name='call_history'),

    # Twilio webhooks (public, no auth required)
    path('twilio/voice/<int:session_id>/', twilio_voice_webhook, name='twilio_voice'),
    path('twilio/voice-status/<int:session_id>/', twilio_voice_status_webhook, name='twilio_voice_status'),
    path('twilio/sms/<int:session_id>/', twilio_sms_webhook, name='twilio_sms'),
    path('twilio/sms-status/<int:session_id>/', twilio_sms_status_webhook, name='twilio_sms_status'),
]
