from django.urls import path

from core import views

app_name = 'core'
urlpatterns = [
path('patient/profile/<int:patient_id>/', views.patient_profile_details, name='patient_profile_details'),
        # whatsapp urls
    # path('patient/reservations/<int:pk>/', views.ReserveView.as_view(), name='reserveview'),
    path('patient/reservations/<int:pk>/', views.reservation_list, name='patient_reservation_list'),
    path('patients/reservations/images/upload/', views.upload_patient_image, name='patient_reservation_gallery_list'),
    path('patients/reservations/images/<int:pk>/delete/', views.delete_patient_image, name='delete_patient_image'),
    path('patient/add/', views.patient_add, name='patient_add'),
    path('search-api/<int:pk>/', views.reservation_search, name='reservation_search'),
    path('patient/reservation/calendar-data/<int:pk>/', views.reservation_calendar_data, name='reservation-calendar-data'),

    path('whatsapp/', views.WhatsappView.as_view(), name='whatsapp'),
    path("send-wa/", views.send_whatsapp, name="send_whatsapp"),



    path('doctor/<int:doctor_id>/', views.doctor_profile, name='doctor_profile'),
    path('patient/<int:patient_id>/', views.patient_profile, name='patient_profile'),
    path('technician/<int:technician_id>/', views.technician_profile, name='technician_profile'),

    # List views
    path('doctors/', views.doctors_list, name='doctors_list'),
    path('patients/', views.patients_list, name='patients_list'),
    path('technicians/', views.technicians_list, name='technicians_list'),

    # AJAX endpoints
    path('reservation/<int:reservation_id>/details/', views.get_reservation_details, name='reservation_details'),
    path('reservation/<int:reservation_id>/update-status/', views.update_reservation_status,
         name='update_reservation_status'),







    path('', views.DashboardView.as_view(), name='dashboard'),
    path('profile/<str:person_type>/<int:pk>/', views.ProfileView.as_view(), name='profile'),
    # path('report/<str:person_type>/<int:pk>/', views.ReportView.as_view(), name='profile'),


    # صفحه نمایش پرونده پزشکی
    path('medical-record/<int:reservation_id>/', views.ReportView.as_view(), name='medical_record_page'),
    # path('report/<int:reservation_id>/', views.medical_report_view, name='medical_report'),
    path('<str:person_type>/report/<int:reservation_id>/', views.medical_report_view, name='medical_report'),
    # API endpoints for medical record functionality
    path('api/reservations/<int:reservation_id>/details/', views.get_reservation_details, name='reservation_details'),
    path('api/reservations/<int:reservation_id>/lab-report/', views.get_lab_details, name='get_lab_details'),
    path('api/reservations/<int:reservation_id>/medical-record/', views.get_medical_record, name='get_medical_record'),
    path('api/reservations/<int:reservation_id>/medical-record/update/', views.update_medical_record,
         name='update_medical_record'),
    path('api/reservations/<int:reservation_id>/entries/', views.get_medical_entries, name='get_medical_entries'),
    path('api/reservations/<int:reservation_id>/entries/create/', views.create_medical_entry,
         name='create_medical_entry'),
    path('api/reservations/<int:reservation_id>/entries/<str:entry_type>/', views.get_medical_entries_by_type,
         name='get_medical_entries_by_type'),
    path('api/reservations/<int:reservation_id>/history/', views.get_reservation_history_view,
         name='reservation_history'),

    # General reservation management
    path('update-status/<int:reservation_id>/', views.update_reservation_status, name='update_reservation_status'),
    path('delete/<int:reservation_id>/', views.delete_reservation, name='delete_reservation'),





















path('update-rate/', views.UpdateRateView.as_view(), name='update-rate'),
path('api/exchange/', views.GetRateView.as_view(), name='get-rate'),
    # path('service/', views.ServiceView.as_view(), name='service-setting'),
    # path('search/service/all/', views.get_all_services, name='search_all_service'),
    # path('search/category/all/', views.get_all_categories, name='search_all_category'),
    path('service/', views.ServiceView.as_view(), name='service-setting'),
    path('search/service/all/', views.ServiceView.as_view(), name='search_all_service'),  # API خدمات
    path('search/service/', views.search_service, name='search_service'),


    path('service/create/', views.ServiceNewCreateView.as_view(), name='service_new_create'),
    path('service/update/<int:pk>/', views.ServiceUpdateView.as_view(), name='service_category_update'),
    path('service/delete/<int:pk>/', views.ServiceDeleteView.as_view(),
         name='service_delete'),

    path('service/change-status/', views.ChangeServiceStatusView.as_view(),
         name='service-change-status'),

    path('service/new/', views.ServiceCreateView.as_view(), name='service-create'),
    path('service/edit/<int:id>/',
         views.ServiceEditView.as_view(), name='service-edit'),

    path('service-category/', views.ServiceCategoryListView.as_view(), name='service_category_list'),
    path('search/category/all/', views.get_all_categories, name='search_all_category'),  # API دسته‌بندی‌ها
    path('service-category/create/', views.ServiceCategoryCreateView.as_view(), name='service_category_create'),
    path('service-category/update/<int:pk>/', views.ServiceCategoryUpdateView.as_view(), name='service_category_update'),
    path('service-category/delete/<int:pk>/', views.ServiceCategoryDeleteView.as_view(), name='service_category_delete'),

    path('search/category/', views.search_category, name='search_category'),

]
