from django.apps import AppConfig
from django.core.checks import (
    Tags,
    register,
)
from django.utils.translation import gettext_lazy as _

from vq_django_auth import checks


class VQDjangoAuthConfig(AppConfig):
    """
    AppConfig for vq-django-auth application.

    This handles app initialization, validation of settings,
    and Django system checks integration.
    """

    name = "vq_django_auth"
    verbose_name = _("VQ Django Authentication")
    default_auto_field = "django.db.models.BigAutoField"

    def ready(self) -> None:
        """
        Validate settings and register system checks when the app is ready.
        """
        # Register system checks
        register(Tags.security)(checks.auth_security_check)
        register(Tags.compatibility)(checks.auth_compatibility_check)
        register(Tags.compatibility)(checks.front_url_is_set)
