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.PuntosDeVenta.Create; using SIGCM2.Application.PuntosDeVenta.Deactivate; using SIGCM2.Application.PuntosDeVenta.GetById; using SIGCM2.Application.PuntosDeVenta.List; using SIGCM2.Application.PuntosDeVenta.Reactivate; using SIGCM2.Application.PuntosDeVenta.Update; using SIGCM2.Application.TiposDeIva.Create; using SIGCM2.Application.TiposDeIva.Deactivate; using SIGCM2.Application.TiposDeIva.Dtos; using SIGCM2.Application.TiposDeIva.GetById; using SIGCM2.Application.TiposDeIva.GetHistorial; using SIGCM2.Application.TiposDeIva.List; using SIGCM2.Application.TiposDeIva.NuevaVersion; using SIGCM2.Application.TiposDeIva.Reactivate; using SIGCM2.Application.TiposDeIva.Update; using SIGCM2.Application.IngresosBrutos.Create; using SIGCM2.Application.IngresosBrutos.Deactivate; using SIGCM2.Application.IngresosBrutos.Dtos; using SIGCM2.Application.IngresosBrutos.GetById; using SIGCM2.Application.IngresosBrutos.GetHistorial; using SIGCM2.Application.IngresosBrutos.List; using SIGCM2.Application.IngresosBrutos.NuevaVersion; using SIGCM2.Application.IngresosBrutos.Reactivate; using SIGCM2.Application.IngresosBrutos.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; using SIGCM2.Application.Rubros.Create; using SIGCM2.Application.Rubros.Update; using SIGCM2.Application.Rubros.Deactivate; using SIGCM2.Application.Rubros.Move; using SIGCM2.Application.Rubros.GetTree; using SIGCM2.Application.Rubros.GetById; using SIGCM2.Application.Rubros.Dtos; namespace SIGCM2.Application; public static class DependencyInjection { public static IServiceCollection AddApplication(this IServiceCollection services) { // UDT-011: TimeProvider singleton — available to all handlers for Cat2 date computation services.AddSingleton(TimeProvider.System); // 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>(); // Puntos de Venta (ADM-008) services.AddScoped, CreatePuntoDeVentaCommandHandler>(); services.AddScoped, UpdatePuntoDeVentaCommandHandler>(); services.AddScoped, DeactivatePuntoDeVentaCommandHandler>(); services.AddScoped, ReactivatePuntoDeVentaCommandHandler>(); services.AddScoped>, ListPuntosDeVentaQueryHandler>(); services.AddScoped, GetPuntoDeVentaByIdQueryHandler>(); // Tipos de IVA (ADM-009) services.AddScoped, CreateTipoDeIvaCommandHandler>(); services.AddScoped, UpdateTipoDeIvaCommandHandler>(); services.AddScoped, NuevaVersionTipoDeIvaCommandHandler>(); services.AddScoped, DeactivateTipoDeIvaCommandHandler>(); services.AddScoped, ReactivateTipoDeIvaCommandHandler>(); services.AddScoped, GetTipoDeIvaByIdQueryHandler>(); services.AddScoped>, ListTiposDeIvaQueryHandler>(); services.AddScoped>, GetHistorialTipoDeIvaQueryHandler>(); // Ingresos Brutos (ADM-009) services.AddScoped, CreateIngresosBrutosCommandHandler>(); services.AddScoped, UpdateIngresosBrutosCommandHandler>(); services.AddScoped, NuevaVersionIngresosBrutosCommandHandler>(); services.AddScoped, DeactivateIngresosBrutosCommandHandler>(); services.AddScoped, ReactivateIngresosBrutosCommandHandler>(); services.AddScoped, GetIngresosBrutosByIdQueryHandler>(); services.AddScoped>, ListIngresosBrutosQueryHandler>(); services.AddScoped>, GetHistorialIngresosBrutosQueryHandler>(); // Rubros (CAT-001) services.AddScoped, CreateRubroCommandHandler>(); services.AddScoped, UpdateRubroCommandHandler>(); services.AddScoped, DeactivateRubroCommandHandler>(); services.AddScoped, MoveRubroCommandHandler>(); services.AddScoped>, GetRubroTreeQueryHandler>(); services.AddScoped, GetRubroByIdQueryHandler>(); // FluentValidation validators (scans entire Application assembly) services.AddValidatorsFromAssemblyContaining(); return services; } }