"""
Adtlas Accounts App Configuration for Accounts Module.

This module handles user account management, authentication, and user profile operations.
It provides comprehensive user management functionality including registration, login,
profile management, and account settings.

Features:
- User registration and authentication
- Profile management and customization
- Account settings and preferences
- User role and permission management
- Account security features

Author: Adtlas Development Team
Version: 1.0.0
"""

from django.apps import AppConfig
from django.db.models.signals import post_migrate
from django.utils.translation import gettext_lazy as _


class ChannelsConfig(AppConfig):
    """
    Django application configuration for the Channels app.
    
    This configuration class defines the settings and metadata for the channels
    application, including database field configurations, application naming,
    and initialization hooks.
    
    Attributes:
        default_auto_field (str): The default primary key field type for models
        name (str): The full Python path to the application
        verbose_name (str): Human-readable name for the application
        label (str): Short name for the application (used in migrations)
    """
    
    # Database configuration
    default_auto_field = "django.db.models.BigAutoField"
    
    # Application identification
    name = "apps.channels"
    verbose_name = _("User Channels Management")
    label = "channels"
    
    def ready(self):
        """
        Initialize the application when Django starts.
        
        This method is called when the application is ready and all models
        have been imported. It's used to register signal handlers and
        perform other initialization tasks.
        """
        try:
            # Import signal handlers
            from apps.channels import signals  # noqa: F401

            
            # # Connect the post_migrate signal to initialize default channel zones
            post_migrate.connect(signals.create_default_channel_zones, sender=self) 

        except ImportError:
            # Signals module doesn't exist yet
            pass
        
 