Files
octopus/myproject/orders/urls.py
Andrey Smakotin 6669d47cdf feat(orders): add recipient management and enhance order forms
- Introduced Recipient model to manage order recipients separately from customers.
- Updated Order model to link to Recipient, replacing recipient_name and recipient_phone fields.
- Enhanced OrderForm to include recipient selection modes: customer, history, and new.
- Added AJAX endpoint to fetch recipient history for customers.
- Updated admin interface to manage recipients and display recipient information in order details.
- Refactored address handling to accommodate new recipient logic.
- Improved demo order creation to include random recipients.
2025-12-23 00:08:41 +03:00

35 lines
1.7 KiB
Python

# -*- coding: utf-8 -*-
from django.urls import path
from . import views
app_name = 'orders'
urlpatterns = [
path('', views.order_list, name='order-list'),
path('create/', views.order_create, name='order-create'),
path('<int:order_number>/', views.order_detail, name='order-detail'),
path('<int:order_number>/edit/', views.order_update, name='order-update'),
path('<int:order_number>/delete/', views.order_delete, name='order-delete'),
# Transaction Management
path('<int:order_number>/transactions/payment/add/', views.transaction_add_payment, name='transaction-add-payment'),
path('<int:order_number>/transactions/refund/add/', views.transaction_add_refund, name='transaction-add-refund'),
path('<int:order_number>/transactions/<int:transaction_id>/delete/', views.transaction_delete, name='transaction-delete'),
# AJAX endpoints
path('api/customer-address-history/', views.get_customer_address_history, name='api-customer-address-history'),
path('api/customer-recipient-history/', views.get_customer_recipient_history, name='api-customer-recipient-history'),
# Wallet payment
path('<int:order_number>/apply-wallet/', views.apply_wallet_payment, name='apply-wallet'),
# AJAX status update
path('api/<int:order_number>/set-status/', views.set_order_status, name='api-set-order-status'),
# Order Status Management URLs
path('statuses/', views.order_status_list, name='status_list'),
path('statuses/create/', views.order_status_create, name='status_create'),
path('statuses/<int:pk>/edit/', views.order_status_update, name='status_edit'),
path('statuses/<int:pk>/delete/', views.order_status_delete, name='status_delete'),
]