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

namespace Books.Api.EventFlow.ReadModels;

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