using Baya.Application.Contracts.Common; using Baya.Infrastructure.CrossCutting.Seams; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; namespace Baya.Infrastructure.CrossCutting.ServiceConfiguration; public static class ServiceCollectionExtension { /// /// Registers the cross-cutting seams (time, PII encryption, cache, object storage) with their /// in-memory/local mock implementations. Swapping in a real provider later is a registration change /// here — callers depend only on the Application contracts. (The real in-app /// INotificationDispatcher needs the database, so it is registered in the Persistence layer.) /// public static IServiceCollection AddCrossCuttingSeams(this IServiceCollection services, IConfiguration configuration) { services.Configure(configuration.GetSection(SeamOptions.SectionName)); services.AddMemoryCache(); services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); return services; } }