namespace Femto.Common.Infrastructure.Outbox;

/// <summary>
/// A mapping based on the CLR type name
/// Brittle in the case of types being moved as they will then not be able to be handled by the outbox. but simple in implementation
/// </summary>
public class ClrTypenameMessageMapping : IOutboxMessageMapping
{
    public Type? GetTypeOfEvent(string eventName)
    {
        return Type.GetType(eventName);
    }

    public string? GetEventName(Type eventType)
    {
        return eventType.AssemblyQualifiedName;
    }
}