-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f6b514f
commit 373f72b
Showing
3 changed files
with
57 additions
and
6 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
OpenAdm.Application/Models/EnderecosEntregaPedidos/EnderecoEntregaPedidoViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using Domain.Pkg.Entities; | ||
|
||
namespace OpenAdm.Application.Models.EnderecosEntregaPedidos; | ||
|
||
public class EnderecoEntregaPedidoViewModel : BaseModel | ||
{ | ||
public string Cep { get; set; } = string.Empty; | ||
public decimal Frete { get; set; } | ||
public string Logradouro { get; set; } = string.Empty; | ||
public string NumeroEntrega { get; set; } = string.Empty; | ||
public Guid PedidoId { get; set; } | ||
public string? Complemento { get; set; } | ||
public string Bairro { get; set; } = string.Empty; | ||
public string Localidade { get; set; } = string.Empty; | ||
public string Uf { get; set; } = string.Empty; | ||
public string TipoFrete { get; set; } = string.Empty; | ||
|
||
public static EnderecoEntregaPedidoViewModel? ToEntity(EnderecoEntregaPedido? enderecoEntregaPedido) | ||
{ | ||
if (enderecoEntregaPedido == null) return null; | ||
|
||
return new EnderecoEntregaPedidoViewModel() | ||
{ | ||
Bairro = enderecoEntregaPedido.Bairro, | ||
Cep = enderecoEntregaPedido.Cep, | ||
Complemento = enderecoEntregaPedido.Complemento, | ||
DataDeAtualizacao = enderecoEntregaPedido.DataDeAtualizacao, | ||
DataDeCriacao = enderecoEntregaPedido.DataDeCriacao, | ||
Frete = enderecoEntregaPedido.Frete, | ||
Id = enderecoEntregaPedido.Id, | ||
Localidade = enderecoEntregaPedido.Localidade, | ||
Logradouro = enderecoEntregaPedido.Logradouro, | ||
Numero = enderecoEntregaPedido.Numero, | ||
NumeroEntrega = enderecoEntregaPedido.NumeroEntrega, | ||
PedidoId = enderecoEntregaPedido.PedidoId, | ||
TipoFrete = enderecoEntregaPedido.TipoFrete, | ||
Uf = enderecoEntregaPedido.Uf | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters