from django.contrib import admin
from .models import Notification

@admin.register(Notification)
class NotificationAdmin(admin.ModelAdmin):
    list_display = ["recipient", "notif_type", "title", "is_read", "created_at"]
    list_filter = ["notif_type", "is_read", "created_at"]
    search_fields = ["recipient__username", "title"]
    actions = ["mark_read"]

    def mark_read(self, request, queryset):
        queryset.update(is_read=True)
    mark_read.short_description = "Mark as read"
