Implementación AnomalIA - Fix de dropdowns y permisos.
All checks were successful
Optimized Build and Deploy / remote-build-and-deploy (push) Successful in 5m17s

This commit is contained in:
2025-06-30 15:26:14 -03:00
parent 95aa09d62a
commit c96d259892
59 changed files with 1430 additions and 337 deletions

View File

@@ -33,7 +33,6 @@ namespace GestionIntegral.Api.Services.Distribucion
_logger = logger;
}
// CORREGIDO: MapToDto ahora acepta una tupla con tipos anulables
private CanillaDto? MapToDto((Canilla? Canilla, string? NombreZona, string? NombreEmpresa) data)
{
if (data.Canilla == null) return null;
@@ -62,10 +61,14 @@ namespace GestionIntegral.Api.Services.Distribucion
return data.Select(MapToDto).Where(dto => dto != null).Select(dto => dto!);
}
public async Task<IEnumerable<CanillaDropdownDto>> ObtenerTodosDropdownAsync(bool? esAccionista, bool? soloActivos)
{
return await _canillaRepository.GetAllDropdownAsync(esAccionista, soloActivos) ?? Enumerable.Empty<CanillaDropdownDto>();
}
public async Task<CanillaDto?> ObtenerPorIdAsync(int id)
{
var data = await _canillaRepository.GetByIdAsync(id);
// MapToDto ahora devuelve CanillaDto? así que esto es correcto
return MapToDto(data);
}
@@ -89,7 +92,6 @@ namespace GestionIntegral.Api.Services.Distribucion
}
}
// CORREGIDO: Usar directamente el valor booleano
if (createDto.Accionista == true && createDto.Empresa != 0)
{
return (null, "Un canillita accionista no debe tener una empresa asignada (Empresa debe ser 0).");
@@ -287,6 +289,6 @@ namespace GestionIntegral.Api.Services.Distribucion
FechaMod = h.Historial.FechaMod,
TipoMod = h.Historial.TipoMod
}).ToList();
}
}
}
}