from django.apps import AppConfig


class ScheduleConfig(AppConfig):
    default_auto_field = 'django.db.models.BigAutoField'
    name = 'smoothschedule.scheduling.schedule'
    label = 'schedule'
    verbose_name = 'Schedule Management'

    def ready(self):
        """
        Initialize the schedule app.
        Called when Django starts.
        """
        # Import builtin plugins to register them
        try:
            from . import builtin_plugins  # noqa: F401
        except Exception as e:
            import logging
            logger = logging.getLogger(__name__)
            logger.warning(f"Failed to load builtin plugins: {e}")

        # Import signals to register them
        try:
            from . import signals  # noqa: F401
        except Exception as e:
            import logging
            logger = logging.getLogger(__name__)
            logger.warning(f"Failed to load signals: {e}")
