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

namespace Books.Api.EventFlow.ReadModels;

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