Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrigindo problema de incompatibilidade entre carrinhoItem e Pedido … #81

Merged
merged 1 commit into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified NerdStoreEnterprise/.vs/NerdStoreEnterprise/v17/.suo
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class PedidoDTO
public string VoucherCodigo { get; set; }
public bool VoucherUtilizado { get; set; }

public List<ItemCarrinhoDTO> PedidoItems { get; set; } = new();
public List<ItemPedidoDTO> PedidoItems { get; set; } = new();

#endregion

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace NSE.Pedido.API.Application.Queries
{
public interface IPedidoQueries
{
Task<PedidoQueryDTO> ObterUltimoPedido(Guid clienteId);
Task<PedidoDTO> ObterUltimoPedido(Guid clienteId);
Task<IEnumerable<PedidoDTO>> ObterListaPorClienteId(Guid clienteId);
}
public class PedidoQueries : IPedidoQueries
Expand All @@ -25,7 +25,7 @@ public async Task<IEnumerable<PedidoDTO>> ObterListaPorClienteId(Guid clienteId)
return pedidos.Select(PedidoDTO.ParaPedidoDTO);
}

public async Task<PedidoQueryDTO> ObterUltimoPedido(Guid clienteId)
public async Task<PedidoDTO> ObterUltimoPedido(Guid clienteId)
{
const string sql = @"SELECT
P.ID AS 'ProdutoId', P.CODIGO, P.VOUCHERUTILIZADO, P.DESCONTO, P.VALORTOTAL,P.PEDIDOSTATUS,
Expand All @@ -44,17 +44,17 @@ AND P.DATACADASTRO between DATEADD(minute, -3, GETDATE()) and DATEADD(minute, 0
return MapearPedido(pedido);
}

private PedidoQueryDTO MapearPedido(dynamic result)
private PedidoDTO MapearPedido(dynamic result)
{
var pedido = new PedidoQueryDTO()
var pedido = new PedidoDTO()
{
Codigo = result[0].CODIGO,
Status = result[0].PEDIDOSTATUS,
ValorTotal = result[0].VALORTOTAL,
Desconto = result[0].DESCONTO,
VoucherUtilizado = result[0].VOUCHERUTILIZADO,

PedidoItems = new List<PedidoItemQueryDTO>(),
PedidoItems = new List<PedidoItemDTO>(),
Endereco = new EnderecoDTO
{
Logradouro = result[0].LOGRADOURO,
Expand All @@ -69,10 +69,10 @@ private PedidoQueryDTO MapearPedido(dynamic result)

foreach (var item in result)
{
var pedidoItem = new PedidoItemQueryDTO
var pedidoItem = new PedidoItemDTO
{
Nome = item.PRODUTONOME,
Valor = item.VALORUNITARIO,
ValorUnitario = item.VALORUNITARIO,
Quantidade = item.QUANTIDADE,
Imagem = item.PRODUTOIMAGEM
};
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8ebffdca359520bb3c5a9e2a9ec8a3363697f93b
18b70149bfbce1aa9d3671fca301f8c9d5ccd578
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class ItemPedidoViewModel
public Guid ProdutoId { get; set; }
public string Nome { get; set; }
public int Quantidade { get; set; }
public decimal Valor { get; set; }
public decimal ValorUnitario { get; set; }
public string Imagem { get; set; }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<p>
<b>@item.Nome</b>
</p>
<span>@this.UnidadesPorProdutoValorTotal(item.Quantidade, item.Valor) </span>
<span>@this.UnidadesPorProdutoValorTotal(item.Quantidade, item.ValorUnitario) </span>
</figcaption>
</figure>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<p>
<b>@item.Nome</b>
</p>
<span>@this.UnidadesPorProdutoValorTotal(item.Quantidade, item.Valor) </span>
<span>@this.UnidadesPorProdutoValorTotal(item.Quantidade, item.ValorUnitario) </span>
</figcaption>
</figure>
</li>
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading