from django.contrib import admin
from django.contrib.auth.admin import UserAdmin

from .models import Team, TeamMember, User


@admin.register(User)
class AirShelfUserAdmin(UserAdmin):
    list_display = ("username", "email", "status", "is_staff", "date_joined")
    list_filter = ("status", "is_staff", "is_superuser")


@admin.register(Team)
class TeamAdmin(admin.ModelAdmin):
    list_display = ("name", "owner", "status", "created_at")
    search_fields = ("name", "owner__username", "owner__email")
    list_filter = ("status",)


@admin.register(TeamMember)
class TeamMemberAdmin(admin.ModelAdmin):
    list_display = ("team", "user", "role", "status", "monthly_credit_limit")
    search_fields = ("team__name", "user__username", "user__email")
    list_filter = ("role", "status")

