using Books.Api.Domain.JournalEntryDrafts;
using EventFlow.Aggregates;
using EventFlow.ReadStores;

namespace Books.Api.EventFlow.ReadModels;

public class JournalEntryDraftReadModelLocator : IReadModelLocator
{
    public IEnumerable<string> GetReadModelIds(IDomainEvent domainEvent)
    {
        if (domainEvent is IDomainEvent<JournalEntryDraftAggregate, JournalEntryDraftId> typedEvent)
        {
            yield return typedEvent.AggregateIdentity.Value;
        }
    }
}
