# Path: djangoevents/domain.py
# class BaseAggregate(EventSourcedEntity):
# class BaseEntity(BaseAggregate):
#     def is_abstract_class(cls):
#     def mutate(cls, aggregate=None, event=None):
#     def create_for_event(cls, event):
#     def is_abstract_class(cls):
#     def mutate(cls, entity=None, event=None):
# 
# Path: djangoevents/schema.py
# def get_event_version(event_cls):
#     return getattr(event_cls, 'version', None) or 1
# 
# Path: djangoevents/settings.py
# def adds_schema_version_to_event_data():
#     config = get_config()
#     return config.get('ADDS_SCHEMA_VERSION_TO_EVENT_DATA', False)
# 
# Path: djangoevents/utils.py
# def camel_case_to_snake_case(text):
# 
#     def repl(match):
#         sep = match.group().lower()
#         if match.start() > 0:
#             sep = '_%s' % sep
#         return sep
# 
#     return re.sub(r'[A-Z][a-z]', repl, text).lower()


from .domain import DomainEvent
from .schema import get_event_version
from .settings import adds_schema_version_to_event_data
from .utils import camel_case_to_snake_case
from collections import namedtuple
from datetime import datetime
from eventsourcing.domain.model.events import resolve_attr
from eventsourcing.domain.services.transcoding import AbstractTranscoder
from eventsourcing.domain.services.transcoding import ObjectJSONDecoder
from eventsourcing.domain.services.transcoding import id_prefix_from_event
from eventsourcing.domain.services.transcoding import make_stored_entity_id
from eventsourcing.utils.time import timestamp_from_uuid
from inspect import isclass
import importlib
import json



UnifiedStoredEvent = namedtuple('UnifiedStoredEvent', [
    'event_id',
    'event_type',
    'event_version',
    'event_data',
    'aggregate_id',
    'aggregate_type',
    'aggregate_version',
    'create_date',
    'metadata',
    'module_name',
    'class_name',
    'stored_entity_id',
])


class UnifiedTranscoder(AbstractTranscoder):
    def __init__(self, json_encoder_cls=None):
        self.json_encoder_cls = json_encoder_cls
        # encrypt not implemented


# Path: djangoevents/domain.py
# class BaseAggregate(EventSourcedEntity):
# class BaseEntity(BaseAggregate):
#     def is_abstract_class(cls):
#     def mutate(cls, aggregate=None, event=None):
#     def create_for_event(cls, event):
#     def is_abstract_class(cls):
#     def mutate(cls, entity=None, event=None):
# 
# Path: djangoevents/schema.py
# def get_event_version(event_cls):
#     return getattr(event_cls, 'version', None) or 1
# 
# Path: djangoevents/settings.py
# def adds_schema_version_to_event_data():
#     config = get_config()
#     return config.get('ADDS_SCHEMA_VERSION_TO_EVENT_DATA', False)
# 
# Path: djangoevents/utils.py
# def camel_case_to_snake_case(text):
# 
#     def repl(match):
#         sep = match.group().lower()
#         if match.start() > 0:
#             sep = '_%s' % sep
#         return sep
# 
#     return re.sub(r'[A-Z][a-z]', repl, text).lower()


# Path: djangoevents/unifiedtranscoder.py
from .domain import DomainEvent
from .schema import get_event_version
from .settings import adds_schema_version_to_event_data
from .utils import camel_case_to_snake_case
from collections import namedtuple
from datetime import datetime
from eventsourcing.domain.model.events import resolve_attr
from eventsourcing.domain.services.transcoding import AbstractTranscoder
from eventsourcing.domain.services.transcoding import ObjectJSONDecoder
from eventsourcing.domain.services.transcoding import id_prefix_from_event
from eventsourcing.domain.services.transcoding import make_stored_entity_id
from eventsourcing.utils.time import timestamp_from_uuid
from inspect import isclass
import importlib
import json




UnifiedStoredEvent = namedtuple('UnifiedStoredEvent', [
    'event_id',
    'event_type',
    'event_version',
    'event_data',
    'aggregate_id',
    'aggregate_type',
    'aggregate_version',
    'create_date',
    'metadata',
    'module_name',
    'class_name',
    'stored_entity_id',
])


class UnifiedTranscoder(AbstractTranscoder):
    def __init__(self, json_encoder_cls=None):
        self.json_encoder_cls = json_encoder_cls
        # encrypt not implemented


    def serialize(self, domain_event):