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

namespace Books.Api.EventFlow.ReadModels;

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