from django.contrib import admin
from django.contrib.auth import get_user_model
from django.utils.translation import gettext_lazy as _

User = get_user_model()

@admin.register(User)
class UserAdmin(admin.ModelAdmin):
	list_display = (
		"id", "email", "role", "phone_number", "city", "street", "postal_code", "gdpr", "is_active", "email_verified", "create_time"
	)
	list_filter = ("role", "gdpr", "is_active", "email_verified", "city", "postal_code")
	search_fields = ("email", "phone_number", "city", "street", "postal_code")
	ordering = ("-create_time",)
	fieldsets = (
		(None, {"fields": ("email", "password", "role")}),
		(_("Personal info"), {"fields": ("phone_number", "city", "street", "postal_code")}),
		(_("Permissions"), {"fields": ("gdpr", "is_active", "email_verified")}),
		(_("Important dates"), {"fields": ("create_time",)}),
	)
	readonly_fields = ("create_time",)

# Register your models here.
