fix: tornar suite da API compativel com MVE audit
This commit is contained in:
parent
6af6674468
commit
ae378ba9cc
|
|
@ -5408,17 +5408,17 @@ namespace line_gestao_api.Controllers
|
|||
let clienteOriginal = (line.Cliente ?? "").Trim()
|
||||
let clientePorLinha = (udLine.Cliente ?? "").Trim()
|
||||
let clientePorItem = (udItem.Cliente ?? "").Trim()
|
||||
let isStock = EF.Functions.ILike(clienteOriginal, "RESERVA")
|
||||
let isStock = clienteOriginal.ToUpper() == "RESERVA"
|
||||
let clienteEfetivo = isStock
|
||||
? "ESTOQUE"
|
||||
: (!string.IsNullOrEmpty(clienteOriginal) &&
|
||||
!EF.Functions.ILike(clienteOriginal, "RESERVA"))
|
||||
clienteOriginal.ToUpper() != "RESERVA")
|
||||
? clienteOriginal
|
||||
: (!string.IsNullOrEmpty(clientePorLinha) &&
|
||||
!EF.Functions.ILike(clientePorLinha, "RESERVA"))
|
||||
clientePorLinha.ToUpper() != "RESERVA")
|
||||
? clientePorLinha
|
||||
: (!string.IsNullOrEmpty(clientePorItem) &&
|
||||
!EF.Functions.ILike(clientePorItem, "RESERVA"))
|
||||
clientePorItem.ToUpper() != "RESERVA")
|
||||
? clientePorItem
|
||||
: ""
|
||||
select new ReservaLineProjection
|
||||
|
|
@ -5455,9 +5455,9 @@ namespace line_gestao_api.Controllers
|
|||
private static IQueryable<MobileLine> ApplyReservaContextFilter(IQueryable<MobileLine> query)
|
||||
{
|
||||
return query.Where(x =>
|
||||
EF.Functions.ILike((x.Usuario ?? "").Trim(), "RESERVA") ||
|
||||
EF.Functions.ILike((x.Skil ?? "").Trim(), "RESERVA") ||
|
||||
EF.Functions.ILike((x.Cliente ?? "").Trim(), "RESERVA"));
|
||||
(x.Usuario ?? "").Trim().ToUpper() == "RESERVA" ||
|
||||
(x.Skil ?? "").Trim().ToUpper() == "RESERVA" ||
|
||||
(x.Cliente ?? "").Trim().ToUpper() == "RESERVA");
|
||||
}
|
||||
|
||||
private static IQueryable<ReservaLineProjection> ApplyReservaMode(
|
||||
|
|
@ -5470,7 +5470,7 @@ namespace line_gestao_api.Controllers
|
|||
"stock" => query.Where(x => x.IsStock),
|
||||
"assigned" => query.Where(x =>
|
||||
!x.IsStock &&
|
||||
!EF.Functions.ILike((x.Cliente ?? "").Trim(), "RESERVA")),
|
||||
(x.Cliente ?? "").Trim().ToUpper() != "RESERVA"),
|
||||
_ => query
|
||||
};
|
||||
}
|
||||
|
|
@ -5489,9 +5489,9 @@ namespace line_gestao_api.Controllers
|
|||
private static IQueryable<MobileLine> ExcludeReservaContext(IQueryable<MobileLine> query)
|
||||
{
|
||||
return query.Where(x =>
|
||||
!EF.Functions.ILike((x.Usuario ?? "").Trim(), "RESERVA") &&
|
||||
!EF.Functions.ILike((x.Skil ?? "").Trim(), "RESERVA") &&
|
||||
!EF.Functions.ILike((x.Cliente ?? "").Trim(), "RESERVA"));
|
||||
(x.Usuario ?? "").Trim().ToUpper() != "RESERVA" &&
|
||||
(x.Skil ?? "").Trim().ToUpper() != "RESERVA" &&
|
||||
(x.Cliente ?? "").Trim().ToUpper() != "RESERVA");
|
||||
}
|
||||
|
||||
private static IQueryable<MobileLine> ApplyAdditionalFilters(
|
||||
|
|
|
|||
|
|
@ -14,6 +14,11 @@ public sealed class MveAuditSchemaBootstrapper
|
|||
|
||||
public async Task EnsureSchemaAsync(CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (!_db.Database.IsRelational())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
await _db.Database.ExecuteSqlRawAsync(
|
||||
"""
|
||||
ALTER TABLE "Aparelhos"
|
||||
|
|
|
|||
|
|
@ -5,9 +5,11 @@ using line_gestao_api.Data;
|
|||
using line_gestao_api.Dtos;
|
||||
using line_gestao_api.Models;
|
||||
using line_gestao_api.Services;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Mvc.Testing;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||
|
|
@ -324,6 +326,7 @@ public class SystemTenantIntegrationTests
|
|||
|
||||
services.RemoveAll<AppDbContext>();
|
||||
services.RemoveAll<DbContextOptions<AppDbContext>>();
|
||||
services.RemoveAll<IDbContextOptionsConfiguration<AppDbContext>>();
|
||||
|
||||
services.AddDbContext<AppDbContext>(options =>
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue