from django.contrib import admin
from . import models


@admin.register(models.Organization)
class OrganizationAdmin(admin.ModelAdmin):
    list_display = ("id", "code", "name", "timezone", "currency_code", "created_at")
    search_fields = ("code", "name")
    list_per_page = 25


@admin.register(models.OrganizationSite)
class OrganizationSiteAdmin(admin.ModelAdmin):
    list_display = ("site", "organization")
    search_fields = ("site__domain", "organization__code", "organization__name")


@admin.register(models.UserProfile)
class UserProfileAdmin(admin.ModelAdmin):
    list_display = ("user", "organization", "role", "created_at")
    list_filter = ("role",)
    search_fields = ("user__username", "user__email")

