# Path: djangoevents/exceptions.py
# class EventSchemaError(DjangoeventsError):
#     pass
# 
# Path: djangoevents/schema.py
# def load_all_event_schemas():
# def set_event_version(aggregate_cls, event_cls, avro_dir=None):
# def get_event_version(event_cls):
# def load_event_schema(aggregate, event):
# def event_to_schema_path(aggregate_cls, event_cls, avro_dir=None):
# def _find_highest_event_version_based_on_schemas(aggregate_cls, event_cls, avro_dir):
# def _event_to_schema_path(aggregate_cls, event_cls, avro_dir, version):
# def decode_cls_name(cls):
# def parse_event_schema(spec_body):
# def get_schema_for_event(event_cls):
# def validate_event(event, schema=None):
# 
# Path: djangoevents/settings.py
# def is_validation_enabled():
#     config = get_config()
#     return config.get('EVENT_SCHEMA_VALIDATION', {}).get('ENABLED', False)


from django.core.management.base import BaseCommand
from djangoevents.exceptions import EventSchemaError
from djangoevents.schema import load_all_event_schemas, schemas
from djangoevents.settings import is_validation_enabled
"""
Parses event schemas and reports on their validity.
"""


class Command(BaseCommand):

    def handle(self, *args, **options):
        print("=> Searching for schema files...")
        try:
            if is_validation_enabled():
                print("--> Schema validation enabled. Checking state..")
            load_all_event_schemas()

# Path: djangoevents/exceptions.py
# class EventSchemaError(DjangoeventsError):
#     pass
# 
# Path: djangoevents/schema.py
# def load_all_event_schemas():
# def set_event_version(aggregate_cls, event_cls, avro_dir=None):
# def get_event_version(event_cls):
# def load_event_schema(aggregate, event):
# def event_to_schema_path(aggregate_cls, event_cls, avro_dir=None):
# def _find_highest_event_version_based_on_schemas(aggregate_cls, event_cls, avro_dir):
# def _event_to_schema_path(aggregate_cls, event_cls, avro_dir, version):
# def decode_cls_name(cls):
# def parse_event_schema(spec_body):
# def get_schema_for_event(event_cls):
# def validate_event(event, schema=None):
# 
# Path: djangoevents/settings.py
# def is_validation_enabled():
#     config = get_config()
#     return config.get('EVENT_SCHEMA_VALIDATION', {}).get('ENABLED', False)


# Path: djangoevents/management/commands/validate_event_schemas.py
from django.core.management.base import BaseCommand
from djangoevents.exceptions import EventSchemaError
from djangoevents.schema import load_all_event_schemas, schemas
from djangoevents.settings import is_validation_enabled

"""
Parses event schemas and reports on their validity.
"""


class Command(BaseCommand):

    def handle(self, *args, **options):
        print("=> Searching for schema files...")
        try:
            if is_validation_enabled():
                print("--> Schema validation enabled. Checking state..")
            load_all_event_schemas()

        except EventSchemaError as e: