from django.contrib import admin

from .models import MollieWebhookEvent


@admin.register(MollieWebhookEvent)
class MollieWebhookEventAdmin(admin.ModelAdmin):
    list_display = (
        "provider_reference",
        "status",
        "received_at",
        "processed_at",
        "failure_reason",
    )
    list_filter = ("status",)
    search_fields = ("provider_reference", "fingerprint")
    readonly_fields = (
        "provider_reference",
        "fingerprint",
        "status",
        "received_at",
        "processed_at",
        "failure_reason",
    )

    def has_add_permission(self, request):
        return False

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