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

namespace Books.Api.EventFlow.ReadModels;

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