from django.contrib import admin
from .models import Invoice, Payment


@admin.register(Invoice)
class InvoiceAdmin(admin.ModelAdmin):
    list_display = ("id", "tenant", "unit", "amount", "status", "due_date")
    list_filter = ("status", "due_date")
    search_fields = ("tenant__username",)


@admin.register(Payment)
class PaymentAdmin(admin.ModelAdmin):
    list_display = ("tenant", "amount", "status", "transaction_id", "created_at")
    search_fields = ("transaction_id",)