using FluentValidation; using Microsoft.Extensions.DependencyInjection; using SIGCM2.Application.Abstractions; using SIGCM2.Application.Auth.Login; using SIGCM2.Application.Auth.Logout; using SIGCM2.Application.Auth.Refresh; using SIGCM2.Application.Common; using SIGCM2.Application.Medios.Create; using SIGCM2.Application.Medios.Deactivate; using SIGCM2.Application.Medios.GetById; using SIGCM2.Application.Medios.List; using SIGCM2.Application.Medios.Reactivate; using SIGCM2.Application.Medios.Update; using SIGCM2.Application.Permisos.Assign; using SIGCM2.Application.Permisos.Dtos; using SIGCM2.Application.Permisos.GetByRol; using SIGCM2.Application.Permisos.List; using SIGCM2.Application.Roles.Create; using SIGCM2.Application.Roles.Deactivate; using SIGCM2.Application.Roles.Dtos; using SIGCM2.Application.Roles.Get; using SIGCM2.Application.Roles.List; using SIGCM2.Application.Roles.Update; using SIGCM2.Application.Secciones.Create; using SIGCM2.Application.Secciones.Deactivate; using SIGCM2.Application.Secciones.GetById; using SIGCM2.Application.Secciones.List; using SIGCM2.Application.Secciones.Reactivate; using SIGCM2.Application.Secciones.Update; using SIGCM2.Application.Usuarios.ChangeMyPassword; using SIGCM2.Application.Usuarios.Create; using SIGCM2.Application.Usuarios.Deactivate; using SIGCM2.Application.Usuarios.GetById; using SIGCM2.Application.Usuarios.List; using SIGCM2.Application.Usuarios.Reactivate; using SIGCM2.Application.Usuarios.ResetPassword; using SIGCM2.Application.Usuarios.Permisos; using SIGCM2.Application.Usuarios.Update; namespace SIGCM2.Application; public static class DependencyInjection { public static IServiceCollection AddApplication(this IServiceCollection services) { // Command handlers services.AddScoped, LoginCommandHandler>(); services.AddScoped, RefreshCommandHandler>(); services.AddScoped, LogoutCommandHandler>(); services.AddScoped, CreateUsuarioCommandHandler>(); // Roles (UDT-004) services.AddScoped>, ListRolesQueryHandler>(); services.AddScoped, GetRolByCodigoQueryHandler>(); services.AddScoped, CreateRolCommandHandler>(); services.AddScoped, UpdateRolCommandHandler>(); services.AddScoped, DeactivateRolCommandHandler>(); // Permisos (UDT-005) services.AddScoped>, ListPermisosQueryHandler>(); services.AddScoped>, GetRolPermisosQueryHandler>(); services.AddScoped>, AssignPermisosToRolCommandHandler>(); // Usuarios (UDT-008) services.AddScoped>, ListUsuariosQueryHandler>(); services.AddScoped, GetUsuarioByIdQueryHandler>(); services.AddScoped, UpdateUsuarioCommandHandler>(); services.AddScoped, DeactivateUsuarioCommandHandler>(); services.AddScoped, ReactivateUsuarioCommandHandler>(); services.AddScoped, ChangeMyPasswordCommandHandler>(); services.AddScoped, ResetUsuarioPasswordCommandHandler>(); // Usuarios/Permisos (UDT-009) services.AddScoped, GetUsuarioPermisosQueryHandler>(); services.AddScoped, UpdateUsuarioPermisosOverridesCommandHandler>(); // Medios (ADM-001) services.AddScoped, CreateMedioCommandHandler>(); services.AddScoped, UpdateMedioCommandHandler>(); services.AddScoped, DeactivateMedioCommandHandler>(); services.AddScoped, ReactivateMedioCommandHandler>(); services.AddScoped>, ListMediosQueryHandler>(); services.AddScoped, GetMedioByIdQueryHandler>(); // Secciones (ADM-001) services.AddScoped, CreateSeccionCommandHandler>(); services.AddScoped, UpdateSeccionCommandHandler>(); services.AddScoped, DeactivateSeccionCommandHandler>(); services.AddScoped, ReactivateSeccionCommandHandler>(); services.AddScoped>, ListSeccionesQueryHandler>(); services.AddScoped, GetSeccionByIdQueryHandler>(); // FluentValidation validators (scans entire Application assembly) services.AddValidatorsFromAssemblyContaining(); return services; } }