from django.urls import path

from merchant_ops.views_manage import (
    StaffInviteCreateView, StaffInviteListView, StaffInviteRevokeView,
    StaffMemberListView, StaffMemberUpdateRoleView, StaffMemberRemarkUpdateView, StaffMemberRemoveView,
    StaffMemberDisableView, StaffMemberUpdatePermsView,
    StaffRoleListView, StaffRoleCreateView, StaffRoleSetPermsView,
    StaffWalletAllocateView, StaffWalletRevokeView, StaffWalletLedgerView, StaffAuditListView,
    StaffRankView,
)
from merchant_ops.views_staff import StaffBindView, StaffMeView
from merchant_ops.views_orders import (
    StaffOrderListView, StaffOrderDetailView, StaffOrderStatsView, StaffDispatchView,
    StaffProductTypesView, StaffSettleView, StaffCancelView, StaffRefundView,
    StaffPenaltyApplyView, StaffPenaltyManageView, StaffChangePlayerView,
)
from merchant_ops.views_action_stats import (
    StaffOrderActionStatsView, StaffOrderActionOperatorsView,
)
from merchant_ops.views_templates import (
    StaffTemplateListView, StaffTemplateCreateView, StaffTemplateUpdateView,
    StaffTemplateDeleteView, StaffLinkGenerateView, StaffLinkListView,
)

urlpatterns = [
    # 子客服
    path('bind', StaffBindView.as_view(), name='staff_bind'),
    path('me', StaffMeView.as_view(), name='staff_me'),
    # 老板管理
    path('invite/create', StaffInviteCreateView.as_view()),
    path('invite/list', StaffInviteListView.as_view()),
    path('invite/revoke', StaffInviteRevokeView.as_view()),
    path('member/list', StaffMemberListView.as_view()),
    path('member/update-remark', StaffMemberRemarkUpdateView.as_view()),
    path('member/update-role', StaffMemberUpdateRoleView.as_view()),
    path('member/update-perms', StaffMemberUpdatePermsView.as_view()),
    path('member/remove', StaffMemberRemoveView.as_view()),
    path('member/disable', StaffMemberDisableView.as_view()),
    path('role/list', StaffRoleListView.as_view()),
    path('role/create', StaffRoleCreateView.as_view()),
    path('role/set-perms', StaffRoleSetPermsView.as_view()),
    path('wallet/allocate', StaffWalletAllocateView.as_view()),
    path('wallet/revoke', StaffWalletRevokeView.as_view()),
    path('wallet/ledger', StaffWalletLedgerView.as_view()),
    path('audit/list', StaffAuditListView.as_view()),
    path('rank', StaffRankView.as_view()),
    # 子客服订单（全新接口）
    path('order/list', StaffOrderListView.as_view()),
    path('order/stats', StaffOrderStatsView.as_view()),
    path('order/action-stats', StaffOrderActionStatsView.as_view()),
    path('order/action-operators', StaffOrderActionOperatorsView.as_view()),
    path('order/detail', StaffOrderDetailView.as_view()),
    path('order/dispatch', StaffDispatchView.as_view()),
    path('order/product-types', StaffProductTypesView.as_view()),
    path('order/settle', StaffSettleView.as_view()),
    path('order/cancel', StaffCancelView.as_view()),
    path('order/refund', StaffRefundView.as_view()),
    path('order/penalty-apply', StaffPenaltyApplyView.as_view()),
    path('order/penalty-manage', StaffPenaltyManageView.as_view()),
    path('order/change-player', StaffChangePlayerView.as_view()),
    # 子客服模板 / 链接（独立路径，内部代理商家逻辑 + 权限校验）
    path('template/list', StaffTemplateListView.as_view()),
    path('template/create', StaffTemplateCreateView.as_view()),
    path('template/update', StaffTemplateUpdateView.as_view()),
    path('template/delete', StaffTemplateDeleteView.as_view()),
    path('link/generate', StaffLinkGenerateView.as_view()),
    path('link/list', StaffLinkListView.as_view()),
]
