# communication/admin.py
from django.contrib import admin
from .models import SMSMessage, Announcement

@admin.register(SMSMessage)
class SMSMessageAdmin(admin.ModelAdmin):
    list_display = ['message_type', 'message', 'status', 'sent_time']
    list_filter = ['message_type', 'status']
    search_fields = ['message']

@admin.register(Announcement)
class AnnouncementAdmin(admin.ModelAdmin):
    list_display = ['title', 'audience', 'priority', 'publish_date', 'is_published']
    list_filter = ['audience', 'priority', 'is_published']
    search_fields = ['title', 'content']
    date_hierarchy = 'publish_date'