using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;

namespace zero.Api.Endpoints.Media;

public class MediaModule : ZeroModule
{
  public override void ConfigureServices(IServiceCollection services, IConfiguration configuration)
  {
    services.AddSingleton<IPermissionProvider, MediaPermissions>();
    services.AddSingleton<IMapperProfile, MediaMapperProfile>();

    services.Configure<RavenOptions>(opts =>
    {
      opts.Indexes.Add<zero_Api_Media_Listing>();
      opts.Indexes.Add<zero_Api_Media_ChildCounts>();
      opts.Indexes.Add<zero_Api_Media_Hierarchy>();
    });
  }
}