from django.urls import path
from . import views
from django.conf import settings
from django.conf.urls.static import static
from .views import (
    ForeignerLoginView,
    ForeignerPasswordResetView,
    ForeignerPasswordResetDoneView,
    ForeignerPasswordResetConfirmView,
    ForeignerPasswordResetCompleteView,
)

app_name = 'expat_life'

urlpatterns = [
    path('', views.home, name='home'),
    path('terms/', views.terms_page, name='terms'),
    path('faq/', views.faq_page, name='faq'),
    path('privacy-policy/', views.privacy_policy_page, name='privacy_policy'),
    path('disclaimer/', views.disclaimer_page, name='disclaimer'),
    path('refund-payment-policy/', views.refund_payment_policy_page, name='refund_payment_policy'),
    path('cookie-policy/', views.cookie_policy_page, name='cookie_policy'),
    path('services/rentals/', views.rental_home, name='rental_home'),
    path('services/rentals/list/', views.public_rental_list, name='public_rental_list'),
    path('services/rentals/<slug:slug>/', views.rental_detail, name='rental_detail'),
    path('services/dating', views.dating_home, name='dating_home'),
    path('services/dating/profiles/', views.public_partner_list, name='public_partner_list'),
    path('services/dating/profiles/<int:pk>/', views.public_partner_detail, name='public_partner_detail'),
    path('services/assistants/', views.service_partner_home, name='service_partner_home'),
    path('services/assistants/profiles/', views.public_assistant_list, name='public_assistant_list'),
    path('services/assistants/<int:pk>/', views.public_assistant_detail, name='public_assistant_detail'),

    path('guest/login/', ForeignerLoginView.as_view(), name='foreigner_login'),

    path(
        'guest/password-reset/',
        ForeignerPasswordResetView.as_view(),
        name='foreigner_password_reset'
    ),
    path(
        'guest/password-reset/done/',
        ForeignerPasswordResetDoneView.as_view(),
        name='foreigner_password_reset_done'
    ),
    path(
        'guest/password-reset-confirm/<uidb64>/<token>/',
        ForeignerPasswordResetConfirmView.as_view(),
        name='foreigner_password_reset_confirm'
    ),
    path(
        'guest/password-reset/complete/',
        ForeignerPasswordResetCompleteView.as_view(),
        name='foreigner_password_reset_complete'
    ),
    path('about-sri-lanka/', views.about_sri_lanka, name='about_sri_lanka'),
    path('about-ensolanka/', views.about_us, name='about_us'),
    path('packages/', views.package_list, name='package_list'),
    path('packages/<slug:slug>/', views.package_detail, name='package_detail'),
    path('packages/<slug:slug>/select/', views.select_package, name='select_package'),
    path('foreigner-signup/', views.foreigner_signup, name='foreigner_signup'),
    path('consultation-request/', views.consultation_request, name='consultation_request'),
    path('contact/', views.contact_page, name='contact_page'),
    path('success/', views.success_page, name='success_page'),
    path('dashboard/', views.foreigner_dashboard, name='foreigner_dashboard'),
    path('dashboard/profile/', views.foreigner_profile_page, name='foreigner_profile_page'),
    path('dashboard/private-listings/', views.private_listings, name='private_listings'),
    path('dashboard/profile/edit/', views.edit_foreigner_profile, name='edit_foreigner_profile'),
    path('dashboard/profile/upload-image/', views.upload_foreigner_profile_image, name='upload_foreigner_profile_image'),
    path('dashboard/profile/change-username/', views.change_foreigner_username, name='change_foreigner_username'),
    path('dashboard/profile/change-password/', views.change_foreigner_password, name='change_foreigner_password'),
    path('foreigners/', views.public_foreigners_list, name='public_foreigners_list'),
    path('foreigners/<int:pk>/', views.public_foreigner_detail, name='public_foreigner_detail'),
    path('foreigners/<int:pk>/express-interest/', views.express_foreigner_interest, name='express_foreigner_interest'),

    path('my-interested-properties/', views.my_interested_properties, name='my_interested_properties'),
    path('select-final-rental-property/<int:interest_id>/', views.select_final_rental_property, name='select_final_rental_property'),
    path(
        'sri-lanka-digital-nomad-visa/',
        views.sri_lanka_digital_nomad_visa,
        name='sri_lanka_digital_nomad_visa'
    ),
    path(
        'dashboard/my-interested-dating-profiles/',
        views.my_interested_dating_profiles,
        name='my_interested_dating_profiles'
    ),
    path(
        'dashboard/my-interested-service-partners/',
        views.my_interested_service_partners,
        name='my_interested_service_partners'
    ),
    path('furniture-packages/', views.furniture_package_list, name='furniture_package_list'),
    path('furniture-packages/<slug:slug>/', views.furniture_package_detail, name='furniture_package_detail'),
    path('furniture-packages/<slug:slug>/select/', views.select_furniture_package, name='select_furniture_package'),
    path('guest/payment-center/', views.foreigner_payment_center, name='foreigner_payment_center'),
    path('guest/payment-checkout/', views.foreigner_payment_checkout, name='foreigner_payment_checkout'),
    path('guest/payment-checkout/pay/', views.foreigner_payment_checkout_pay, name='foreigner_payment_checkout_pay'),
    path('guest/start-stripe/', views.start_foreigner_stripe_checkout, name='start_foreigner_stripe_checkout'),
    path('guest/start-paypal/', views.start_foreigner_paypal_checkout, name='start_foreigner_paypal_checkout'),
    path(
        'guest/payment-success/<int:transaction_id>/',
        views.foreigner_payment_success,
        name='foreigner_payment_success'
    ),
    path(
        'guest/stripe-payment-success/<int:transaction_id>/',
        views.foreigner_stripe_payment_success,
        name='foreigner_stripe_payment_success'
    ),
    path(
        'guest/paypal-payment-success/<int:transaction_id>/',
        views.foreigner_paypal_payment_success,
        name='foreigner_paypal_payment_success'
    ),

    path(
        'guest/payment-cancelled/<int:transaction_id>/',
        views.foreigner_payment_cancelled,
        name='foreigner_payment_cancelled'
    ),

    path(
        'guest/payment-failed/<int:transaction_id>/',
        views.foreigner_payment_failed,
        name='foreigner_payment_failed'
    ),


    path('resources/', views.marketing_resources, name='marketing_resources'),

    # wallet top up
    path(
        'wallet/top-up/',
        views.foreigner_wallet_topup,
        name='foreigner_wallet_topup'
    ),

    path(
        'wallet/topup/start-stripe/',
        views.start_wallet_topup_stripe_checkout,
        name='start_wallet_topup_stripe_checkout'
    ),

    path(
        'wallet/topup/start-paypal/',
        views.start_wallet_topup_paypal_checkout,
        name='start_wallet_topup_paypal_checkout'
    ),

    path(
        'guest/wallet-topup/stripe-success/<int:transaction_id>/',
        views.foreigner_wallet_topup_stripe_success,
        name='foreigner_wallet_topup_stripe_success'
    ),

    path(
        'guest/wallet-topup/paypal-success/<int:transaction_id>/',
        views.foreigner_wallet_topup_paypal_success,
        name='foreigner_wallet_topup_paypal_success'
    ),

    path(
        'guest/wallet-topup/cancelled/<int:transaction_id>/',
        views.foreigner_wallet_topup_cancelled,
        name='foreigner_wallet_topup_cancelled'
    ),

    path(
        'guest/wallet-topup/failed/<int:transaction_id>/',
        views.foreigner_wallet_topup_failed,
        name='foreigner_wallet_topup_failed'
    ),

    # ============================================================
    # Guest-Facing Hosting Experiences
    # ============================================================

    path(
        'hosting-experiences/',
        views.host_experiences_home,
        name='host_experiences_home'
    ),

    path(
        'hosting-experiences/venues/',
        views.guest_host_venue_list,
        name='guest_host_venue_list'
    ),

    path(
        'hosting-experiences/venues/<slug:slug>/',
        views.guest_host_venue_detail,
        name='guest_host_venue_detail'
    ),
    path(
        'hosting-experiences/venues/<slug:slug>/book/',
        views.guest_host_booking_start,
        name='guest_host_booking_start'
    ),
    path(
        'hosting-experiences/bookings/<int:booking_id>/review/',
        views.guest_host_booking_review,
        name='guest_host_booking_review'
    ),
    path(
        'guest/host-event-bookings/',
        views.foreigner_host_event_booking_list,
        name='foreigner_host_event_booking_list'
    ),
]
if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)