"""
LeadDeletionRequest 通过 Django Admin（非 Wagtail）暴露为只读审计视图，
供合规/客服人员查看 PIPL 数据删除申请处理记录，详见
documents/设计方案分析与完善版.md §2.15。
"""
from django.contrib import admin

from .models import LeadDeletionRequest


@admin.register(LeadDeletionRequest)
class LeadDeletionRequestAdmin(admin.ModelAdmin):
    list_display = (
        "contact",
        "status",
        "requested_at",
        "completed_at",
        "deleted_count",
    )
    list_filter = ("status",)
    search_fields = ("contact",)
    readonly_fields = [f.name for f in LeadDeletionRequest._meta.fields]

    def has_add_permission(self, request):
        return False

    def has_change_permission(self, request, obj=None):
        return False
