diff options
| author | Lucas Faria Mendes <lucas.fariamo08@gmail.com> | 2026-03-30 17:17:46 +0000 |
|---|---|---|
| committer | Lucas Faria Mendes <lucas.fariamo08@gmail.com> | 2026-03-30 17:17:46 +0000 |
| commit | 0440c722a221b8068bbf388c1c0c51f0faff0451 (patch) | |
| tree | 169cbf90c50ff7961db82ecb606c50c2a45a1688 /Gestor.Model/Gestor.Model.Domain.Common | |
| parent | 225aa1499e37faf9d38257caabbadc68d78b427e (diff) | |
| download | gestor-0440c722a221b8068bbf388c1c0c51f0faff0451.tar.gz gestor-0440c722a221b8068bbf388c1c0c51f0faff0451.zip | |
Diffstat (limited to 'Gestor.Model/Gestor.Model.Domain.Common')
15 files changed, 1177 insertions, 0 deletions
diff --git a/Gestor.Model/Gestor.Model.Domain.Common/ArquivoDigital.cs b/Gestor.Model/Gestor.Model.Domain.Common/ArquivoDigital.cs new file mode 100644 index 0000000..e6f71ed --- /dev/null +++ b/Gestor.Model/Gestor.Model.Domain.Common/ArquivoDigital.cs @@ -0,0 +1,89 @@ +using System; +using Gestor.Model.Domain.Generic; + +namespace Gestor.Model.Domain.Common; + +public class ArquivoDigital : DomainBase +{ + private string _descricao; + + private string _extensao; + + public string Descricao + { + get + { + return _descricao?.ToUpper(); + } + set + { + _descricao = value; + } + } + + public string Extensao + { + get + { + return _extensao?.ToUpper().Trim(); + } + set + { + _extensao = value; + } + } + + public byte[] Arquivo { get; set; } + + public long IdCliente { get; set; } + + public long IdDocumento { get; set; } + + public long IdItem { get; set; } + + public long IdParcela { get; set; } + + public long IdSinistro { get; set; } + + public long IdSeguradora { get; set; } + + public long IdVendedor { get; set; } + + public long IdUsuario { get; set; } + + public long IdExtrato { get; set; } + + public long IdEmpresa { get; set; } + + public long IdLancamento { get; set; } + + public long IdFornecedor { get; set; } + + public long IdProspeccao { get; set; } + + public long IdSocio { get; set; } + + public long IdTarefa { get; set; } + + public long IdNotaFiscal { get; set; } + + public long IdEstipulante { get; set; } + + public bool Excluido { get; set; } + + public long UsuarioCriacao { get; set; } + + public long UsuarioAtualizacao { get; set; } + + public DateTime? DataCriacao { get; set; } + + public DateTime? DataAtualizacao { get; set; } + + public DateTime? UltimoAcesso { get; set; } + + public int QuantidadeAcesso { get; set; } + + public Guid? AzureGuid { get; set; } + + public string AzureStorage { get; set; } +} diff --git a/Gestor.Model/Gestor.Model.Domain.Common/Atividade.cs b/Gestor.Model/Gestor.Model.Domain.Common/Atividade.cs new file mode 100644 index 0000000..464a0b4 --- /dev/null +++ b/Gestor.Model/Gestor.Model.Domain.Common/Atividade.cs @@ -0,0 +1,34 @@ +using Gestor.Model.Domain.Generic; + +namespace Gestor.Model.Domain.Common; + +public class Atividade : DomainBase +{ + private string _cnac; + + private string _nome; + + public string Cnac + { + get + { + return _cnac?.ToUpper().Trim(); + } + set + { + _cnac = value; + } + } + + public string Nome + { + get + { + return _nome?.ToUpper(); + } + set + { + _nome = value; + } + } +} diff --git a/Gestor.Model/Gestor.Model.Domain.Common/Banco.cs b/Gestor.Model/Gestor.Model.Domain.Common/Banco.cs new file mode 100644 index 0000000..b5cf70c --- /dev/null +++ b/Gestor.Model/Gestor.Model.Domain.Common/Banco.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using Gestor.Model.Attributes; +using Gestor.Model.Domain.Generic; +using Newtonsoft.Json; + +namespace Gestor.Model.Domain.Common; + +public class Banco : IDomain +{ + private string _nome; + + private string _site; + + public int Id { get; set; } + + [Log(true)] + public int Codigo { get; set; } + + [Log(true)] + [Name(true)] + [Description("BANCO")] + public string Nome + { + get + { + return _nome?.ToUpper(); + } + set + { + _nome = value; + } + } + + [Log(true)] + public string Site + { + get + { + return _site?.ToUpper().Trim(); + } + set + { + _site = value; + } + } + + [JsonIgnore] + public Func<List<KeyValuePair<string, string>>> ValidationEvent => Validate; + + public List<KeyValuePair<string, string>> Validate() + { + return new List<KeyValuePair<string, string>>(); + } +} diff --git a/Gestor.Model/Gestor.Model.Domain.Common/Contato.cs b/Gestor.Model/Gestor.Model.Domain.Common/Contato.cs new file mode 100644 index 0000000..7c32d53 --- /dev/null +++ b/Gestor.Model/Gestor.Model.Domain.Common/Contato.cs @@ -0,0 +1,12 @@ +using Gestor.Model.Common; + +namespace Gestor.Model.Domain.Common; + +public class Contato +{ + public TipoContato Tipo { get; set; } + + public TipoTelefone? TipoTelefone { get; set; } + + public string Numero { get; set; } +} diff --git a/Gestor.Model/Gestor.Model.Domain.Common/ControleArquivoDigital.cs b/Gestor.Model/Gestor.Model.Domain.Common/ControleArquivoDigital.cs new file mode 100644 index 0000000..831f1d1 --- /dev/null +++ b/Gestor.Model/Gestor.Model.Domain.Common/ControleArquivoDigital.cs @@ -0,0 +1,10 @@ +using Gestor.Model.Domain.Generic; + +namespace Gestor.Model.Domain.Common; + +public class ControleArquivoDigital : DomainBase +{ + public string Catalogo { get; set; } + + public string Tabela { get; set; } +} diff --git a/Gestor.Model/Gestor.Model.Domain.Common/Empresa.cs b/Gestor.Model/Gestor.Model.Domain.Common/Empresa.cs new file mode 100644 index 0000000..2f228e1 --- /dev/null +++ b/Gestor.Model/Gestor.Model.Domain.Common/Empresa.cs @@ -0,0 +1,413 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using Gestor.Model.Common; +using Gestor.Model.Domain.Generic; +using Gestor.Model.Domain.Seguros; +using Gestor.Model.Helper; +using Gestor.Model.Resources; +using Newtonsoft.Json; + +namespace Gestor.Model.Domain.Common; + +public class Empresa : EnderecoBase, IDomain +{ + private string _nome; + + private string _documento; + + private string _serial; + + private string _site; + + private string _email; + + private string _primeiroPrefixo; + + private string _primeiroTelefone; + + private string _segundoPrefixo; + + private string _segundoTelefone; + + private string _quantidadeFiliais; + + private string _responsavel; + + private string _emailResponsavel; + + private TipoTelefone? _tipo1; + + private TipoTelefone? _tipo2; + + public string Nome + { + get + { + return _nome?.ToUpper(); + } + set + { + _nome = value; + } + } + + public string NomeSocial { get; set; } + + public string Documento + { + get + { + return _documento?.ToUpper().Trim(); + } + set + { + _documento = value; + } + } + + public string Serial + { + get + { + return _serial?.ToUpper().Trim(); + } + set + { + _serial = value; + } + } + + public TipoTelefone TipoTelefone1 + { + get + { + if (!_tipo1.HasValue || _tipo1 == (TipoTelefone)0) + { + return TipoTelefone.Comercial; + } + return _tipo1.Value; + } + set + { + _tipo1 = value; + } + } + + public TipoTelefone TipoTelefone2 + { + get + { + if (!_tipo2.HasValue || _tipo2 == (TipoTelefone)0) + { + return TipoTelefone.Comercial; + } + return _tipo2.Value; + } + set + { + _tipo2 = value; + } + } + + public string Site + { + get + { + return _site?.Trim(); + } + set + { + _site = value; + } + } + + public string Email + { + get + { + return _email?.ToLower().Trim(); + } + set + { + _email = value; + } + } + + public string PrimeiroPrefixo + { + get + { + return _primeiroPrefixo?.ToUpper().Trim(); + } + set + { + _primeiroPrefixo = value; + } + } + + public string PrimeiroTelefone + { + get + { + return _primeiroTelefone?.ToUpper().Trim(); + } + set + { + _primeiroTelefone = value; + } + } + + public string SegundoPrefixo + { + get + { + return _segundoPrefixo?.ToUpper().Trim(); + } + set + { + _segundoPrefixo = value; + } + } + + public string SegundoTelefone + { + get + { + return _segundoTelefone?.ToUpper().Trim(); + } + set + { + _segundoTelefone = value; + } + } + + public long QuantidadeFuncionarios { get; set; } + + public string QuantidadeFiliais + { + get + { + return _quantidadeFiliais?.ToUpper().Trim(); + } + set + { + _quantidadeFiliais = value; + } + } + + public string Responsavel + { + get + { + return _responsavel?.ToUpper(); + } + set + { + _responsavel = value; + } + } + + public string EmailResponsavel + { + get + { + return _emailResponsavel?.ToLower().Trim(); + } + set + { + _emailResponsavel = value; + } + } + + public string SenhaAdmin { get; set; } + + public string Facebook { get; set; } + + public string Instagram { get; set; } + + public string Linkdin { get; set; } + + public string Whatsapp { get; set; } + + public string WhatsappSinistro { get; set; } + + public string Twitter { get; set; } + + public string Localizacao { get; set; } + + public byte[] Logo { get; set; } + + public string LogoId { get; set; } + + public int MaxFileSize { get; set; } + + [JsonIgnore] + public Func<List<KeyValuePair<string, string>>> ValidationEvent => Validate; + + public List<KeyValuePair<string, string>> Validate() + { + List<KeyValuePair<string, string>> list = ValidationHelper.AddValue(); + if (string.IsNullOrWhiteSpace(Documento)) + { + list.AddValue("Documento", Messages.Obrigatorio); + } + else if (!Documento.ValidacaoDocumento()) + { + list.AddValue("Documento", Messages.Invalido); + } + if (string.IsNullOrWhiteSpace(Serial)) + { + list.AddValue("Serial", Messages.Obrigatorio); + } + else if (Serial.Length > 18) + { + list.AddValue("Serial", string.Format(Messages.MaiorQueLimite, 18)); + } + if (!string.IsNullOrWhiteSpace(Site) && Site.Length > 80) + { + list.AddValue("Site", string.Format(Messages.MaiorQueLimite, 80)); + } + if (!string.IsNullOrWhiteSpace(SenhaAdmin) && SenhaAdmin.Length > 90) + { + list.AddValue("SenhaAdmin", string.Format(Messages.MaiorQueLimite, 90)); + } + if (string.IsNullOrWhiteSpace(Nome)) + { + list.AddValue("Nome", Messages.Obrigatorio); + } + else if (Nome.Length > 60) + { + list.AddValue("Nome", string.Format(Messages.MaiorQueLimite, 60)); + } + if (string.IsNullOrWhiteSpace(base.Cep)) + { + list.AddValue("Cep", Messages.Obrigatorio); + } + else if (!base.Cep.ValidacaoCep()) + { + list.AddValue("Cep", Messages.Invalido); + } + if (string.IsNullOrWhiteSpace(base.Endereco)) + { + list.AddValue("Endereco", Messages.Obrigatorio); + } + else if (base.Endereco.Length > 60) + { + list.AddValue("Endereco", string.Format(Messages.MaiorQueLimite, 60)); + } + if (string.IsNullOrWhiteSpace(base.Numero)) + { + list.AddValue("Numero", Messages.Obrigatorio); + } + else if (base.Numero.Length > 10) + { + list.AddValue("Numero", string.Format(Messages.MaiorQueLimite, 10)); + } + if (!string.IsNullOrWhiteSpace(base.Complemento) && base.Complemento.Length > 100) + { + list.AddValue("Complemento", string.Format(Messages.MaiorQueLimite, 100)); + } + if (string.IsNullOrWhiteSpace(base.Bairro)) + { + list.AddValue("Bairro", Messages.Obrigatorio); + } + else if (base.Bairro.Length > 150) + { + list.AddValue("Bairro", string.Format(Messages.MaiorQueLimite, 150)); + } + if (string.IsNullOrWhiteSpace(base.Cidade)) + { + list.AddValue("Cidade", Messages.Obrigatorio); + } + else if (base.Cidade.Length > 30) + { + list.AddValue("Cidade", string.Format(Messages.MaiorQueLimite, 30)); + } + if (string.IsNullOrWhiteSpace(base.Estado)) + { + list.AddValue("Estado", Messages.Obrigatorio); + } + else if (!base.Estado.ValidacaoEstado()) + { + list.AddValue("Estado", Messages.Invalido); + } + if (string.IsNullOrWhiteSpace(Email)) + { + list.AddValue("Email", Messages.Obrigatorio); + } + else if (!Email.ValidacaoEmail()) + { + list.AddValue("Email", Messages.Invalido); + } + else if (Email.Length > 50) + { + list.AddValue("Email", string.Format(Messages.MaiorQueLimite, 50)); + } + if (string.IsNullOrWhiteSpace(EmailResponsavel)) + { + list.AddValue("EmailResponsavel", Messages.Obrigatorio); + } + else if (!EmailResponsavel.ValidacaoEmail()) + { + list.AddValue("EmailResponsavel", Messages.Invalido); + } + else if (EmailResponsavel.Length > 50) + { + list.AddValue("EmailResponsavel", string.Format(Messages.MaiorQueLimite, 50)); + } + if (!string.IsNullOrEmpty(Facebook) && !Facebook.Contains("http")) + { + Facebook = "https://" + Facebook.Trim(); + } + if (!string.IsNullOrEmpty(Instagram) && !Instagram.Contains("http")) + { + Instagram = "https://" + Instagram.Trim(); + } + if (!string.IsNullOrEmpty(Linkdin) && !Linkdin.Contains("http")) + { + Linkdin = "https://" + Linkdin.Trim(); + } + if (!string.IsNullOrEmpty(Twitter) && !Twitter.Contains("http")) + { + Twitter = "https://" + Twitter.Trim(); + } + if (!string.IsNullOrEmpty(Site) && !Site.Contains("http")) + { + Site = "http://" + Site.Trim(); + } + return list; + } + + public List<TupleList> Log() + { + return new List<TupleList> + { + new TupleList + { + Tuples = new ObservableCollection<Tuple<string, string, string>> + { + new Tuple<string, string, string>("DOCUMENTO (CPF/CNPJ)", string.IsNullOrWhiteSpace(Documento) ? "" : Documento, ""), + new Tuple<string, string, string>("NÚMERO DE SÉRIE", string.IsNullOrWhiteSpace(Serial) ? "" : Serial, ""), + new Tuple<string, string, string>("NOME", string.IsNullOrWhiteSpace(Nome) ? "" : Nome, ""), + new Tuple<string, string, string>("CEP", string.IsNullOrWhiteSpace(base.Cep) ? "" : base.Cep, ""), + new Tuple<string, string, string>("ENDEREÇO", string.IsNullOrWhiteSpace(base.Endereco) ? "" : base.Endereco, ""), + new Tuple<string, string, string>("NÚMERO", string.IsNullOrWhiteSpace(base.Numero) ? "" : base.Numero, ""), + new Tuple<string, string, string>("BAIRRO", string.IsNullOrWhiteSpace(base.Bairro) ? "" : base.Bairro, ""), + new Tuple<string, string, string>("CIDADE", string.IsNullOrWhiteSpace(base.Cidade) ? "" : base.Cidade, ""), + new Tuple<string, string, string>("ESTADO", string.IsNullOrWhiteSpace(base.Estado) ? "" : base.Estado, ""), + new Tuple<string, string, string>("SITE", string.IsNullOrWhiteSpace(Site) ? "" : Site, ""), + new Tuple<string, string, string>("E-MAIL", string.IsNullOrWhiteSpace(Email) ? "" : Email, ""), + new Tuple<string, string, string>("PRIMEIRO PREFIXO", string.IsNullOrWhiteSpace(PrimeiroPrefixo) ? "" : PrimeiroPrefixo, ""), + new Tuple<string, string, string>("PRIMEIRO TELEFONE", string.IsNullOrWhiteSpace(PrimeiroTelefone) ? "" : PrimeiroTelefone, ""), + new Tuple<string, string, string>("SEGUNDO PREFIXO", string.IsNullOrWhiteSpace(SegundoPrefixo) ? "" : SegundoPrefixo, ""), + new Tuple<string, string, string>("SEGUNDO TELEFONE", string.IsNullOrWhiteSpace(SegundoTelefone) ? "" : SegundoTelefone, ""), + new Tuple<string, string, string>("E-MAIL", string.IsNullOrWhiteSpace(Email) ? "" : Email, ""), + new Tuple<string, string, string>("NÚMERO DE FUNCIONÁRIOS", QuantidadeFuncionarios.ToString(), ""), + new Tuple<string, string, string>("RESPONSÁVEL FINANCEIRO", string.IsNullOrWhiteSpace(Responsavel) ? "" : Responsavel, ""), + new Tuple<string, string, string>("E-MAIL DO RESPONSÁVEL", string.IsNullOrWhiteSpace(EmailResponsavel) ? "" : EmailResponsavel, "") + } + } + }; + } +} diff --git a/Gestor.Model/Gestor.Model.Domain.Common/Fipe.cs b/Gestor.Model/Gestor.Model.Domain.Common/Fipe.cs new file mode 100644 index 0000000..6246258 --- /dev/null +++ b/Gestor.Model/Gestor.Model.Domain.Common/Fipe.cs @@ -0,0 +1,98 @@ +using System.Collections.Generic; +using System.Linq; +using Gestor.Model.Helper; + +namespace Gestor.Model.Domain.Common; + +public class Fipe +{ + private string _codigo; + + private string _marca; + + private string _modelo; + + private int _anoMaximo; + + private int _anoMinimo; + + public int AnoMaximo + { + get + { + if (Detalhes == null || Detalhes.Count == 0) + { + return _anoMaximo; + } + return Detalhes.OrderByDescending((FipeDetalhe d) => d.AnoModelo).First().AnoModelo.ToInt(); + } + set + { + if (Detalhes == null || Detalhes.Count == 0) + { + _anoMaximo = value; + } + } + } + + public int AnoMinimo + { + get + { + if (Detalhes == null || Detalhes.Count == 0) + { + return _anoMinimo; + } + return Detalhes.OrderBy((FipeDetalhe d) => d.AnoModelo).First().AnoModelo.ToInt(); + } + set + { + if (Detalhes == null || Detalhes.Count == 0) + { + _anoMinimo = value; + } + } + } + + public string Codigo + { + get + { + return _codigo?.ToUpper().Trim(); + } + set + { + _codigo = value; + } + } + + public string Marca + { + get + { + return _marca?.ToUpper(); + } + set + { + _marca = value; + } + } + + public int? IdFabricante { get; set; } + + public string Modelo + { + get + { + return _modelo?.ToUpper(); + } + set + { + _modelo = value; + } + } + + public int TipoVeiculo { get; set; } + + public List<FipeDetalhe> Detalhes { get; set; } +} diff --git a/Gestor.Model/Gestor.Model.Domain.Common/FipeDetalhe.cs b/Gestor.Model/Gestor.Model.Domain.Common/FipeDetalhe.cs new file mode 100644 index 0000000..1dfd1a8 --- /dev/null +++ b/Gestor.Model/Gestor.Model.Domain.Common/FipeDetalhe.cs @@ -0,0 +1,8 @@ +namespace Gestor.Model.Domain.Common; + +public class FipeDetalhe +{ + public string AnoModelo { get; set; } + + public decimal Valor { get; set; } +} diff --git a/Gestor.Model/Gestor.Model.Domain.Common/IndiceArquivoDigital.cs b/Gestor.Model/Gestor.Model.Domain.Common/IndiceArquivoDigital.cs new file mode 100644 index 0000000..a34d759 --- /dev/null +++ b/Gestor.Model/Gestor.Model.Domain.Common/IndiceArquivoDigital.cs @@ -0,0 +1,102 @@ +using System; +using Gestor.Model.Attributes; +using Gestor.Model.Domain.Generic; + +namespace Gestor.Model.Domain.Common; + +public class IndiceArquivoDigital : DomainBase +{ + private string _descricao; + + private string _extensao; + + public bool Assinar { get; set; } + + public bool Selecionado { get; set; } + + public long IdArquivoDigital { get; set; } + + public string Bd { get; set; } + + [Log(true)] + [Name(true)] + public string Descricao + { + get + { + return _descricao?.ToUpper(); + } + set + { + _descricao = value; + } + } + + public string Extensao + { + get + { + return _extensao?.ToUpper().Trim(); + } + set + { + _extensao = value; + } + } + + public long IdCliente { get; set; } + + public long IdDocumento { get; set; } + + public long IdItem { get; set; } + + public long IdParcela { get; set; } + + public long IdSinistro { get; set; } + + public long IdSeguradora { get; set; } + + public long IdVendedor { get; set; } + + public long IdUsuario { get; set; } + + public long IdExtrato { get; set; } + + public long IdEmpresa { get; set; } + + public long IdLancamento { get; set; } + + public long IdFornecedor { get; set; } + + public long IdProspeccao { get; set; } + + public long IdSocio { get; set; } + + public long IdTarefa { get; set; } + + public long IdNotaFiscal { get; set; } + + public long IdEstipulante { get; set; } + + public bool Excluido { get; set; } + + public long UsuarioCriacao { get; set; } + + public long UsuarioAtualizacao { get; set; } + + public DateTime? DataCriacao { get; set; } + + public DateTime? DataAtualizacao { get; set; } + + public bool Assinado { get; set; } + + public bool EnviadoAssinatura { get; set; } + + public string UrlAssinatura { get; set; } + + public Guid? AzureGuid { get; set; } + + public string AzureStorage { get; set; } + + public bool NaoExcluir { get; set; } +} diff --git a/Gestor.Model/Gestor.Model.Domain.Common/PesquisaAvancada.cs b/Gestor.Model/Gestor.Model.Domain.Common/PesquisaAvancada.cs new file mode 100644 index 0000000..026b8c7 --- /dev/null +++ b/Gestor.Model/Gestor.Model.Domain.Common/PesquisaAvancada.cs @@ -0,0 +1,20 @@ +using Gestor.Model.Common; + +namespace Gestor.Model.Domain.Common; + +public class PesquisaAvancada +{ + public FiltroStatusDocumento Status { get; set; } + + public long IdCliente { get; set; } + + public long IdDocumento { get; set; } + + public long IdItem { get; set; } + + public long IdSinistro { get; set; } + + public string Nome { get; set; } + + public string Pesquisa { get; set; } +} diff --git a/Gestor.Model/Gestor.Model.Domain.Common/Profissao.cs b/Gestor.Model/Gestor.Model.Domain.Common/Profissao.cs new file mode 100644 index 0000000..72abec0 --- /dev/null +++ b/Gestor.Model/Gestor.Model.Domain.Common/Profissao.cs @@ -0,0 +1,48 @@ +using Gestor.Model.Domain.Generic; + +namespace Gestor.Model.Domain.Common; + +public class Profissao : DomainBase +{ + private string _codigo; + + private string _nome; + + private string _aniversario; + + public string Codigo + { + get + { + return _codigo?.ToUpper().Trim(); + } + set + { + _codigo = value; + } + } + + public string Nome + { + get + { + return _nome?.ToUpper(); + } + set + { + _nome = value; + } + } + + public string Aniversario + { + get + { + return _aniversario?.ToUpper().Trim(); + } + set + { + _aniversario = value; + } + } +} diff --git a/Gestor.Model/Gestor.Model.Domain.Common/RegistroAcao.cs b/Gestor.Model/Gestor.Model.Domain.Common/RegistroAcao.cs new file mode 100644 index 0000000..4734c6c --- /dev/null +++ b/Gestor.Model/Gestor.Model.Domain.Common/RegistroAcao.cs @@ -0,0 +1,31 @@ +using System; +using Gestor.Model.Common; +using Gestor.Model.Domain.Generic; +using Gestor.Model.Domain.Seguros; + +namespace Gestor.Model.Domain.Common; + +public class RegistroAcao : DomainBase +{ + public long EntidadeId { get; set; } + + public TipoTela? Tela { get; set; } + + public Relatorio? Relatorio { get; set; } + + public Usuario Usuario { get; set; } + + public DateTime DataHora { get; set; } + + public string Descricao { get; set; } + + public string Observacao { get; set; } + + public string NomeMaquina { get; set; } + + public string UsuarioMaquina { get; set; } + + public string Ip { get; set; } + + public string Versao { get; set; } +} diff --git a/Gestor.Model/Gestor.Model.Domain.Common/RegistroLog.cs b/Gestor.Model/Gestor.Model.Domain.Common/RegistroLog.cs new file mode 100644 index 0000000..69dfef4 --- /dev/null +++ b/Gestor.Model/Gestor.Model.Domain.Common/RegistroLog.cs @@ -0,0 +1,31 @@ +using System; +using Gestor.Model.Common; +using Gestor.Model.Domain.Generic; +using Gestor.Model.Domain.Seguros; + +namespace Gestor.Model.Domain.Common; + +public class RegistroLog : DomainBase +{ + public long EntidadeId { get; set; } + + public TipoAcao Acao { get; set; } + + public TipoTela Tela { get; set; } + + public DateTime DataHora { get; set; } + + public string Descricao { get; set; } + + public string Versao { get; set; } + + public Usuario Usuario { get; set; } + + public string NomeMaquina { get; set; } + + public string UsuarioMaquina { get; set; } + + public string Ip { get; set; } + + public bool ModeloNovo { get; set; } +} diff --git a/Gestor.Model/Gestor.Model.Domain.Common/Socio.cs b/Gestor.Model/Gestor.Model.Domain.Common/Socio.cs new file mode 100644 index 0000000..4711695 --- /dev/null +++ b/Gestor.Model/Gestor.Model.Domain.Common/Socio.cs @@ -0,0 +1,118 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using Gestor.Model.Attributes; +using Gestor.Model.Domain.Generic; +using Gestor.Model.Domain.Seguros; +using Gestor.Model.Helper; +using Gestor.Model.Resources; +using Newtonsoft.Json; + +namespace Gestor.Model.Domain.Common; + +public class Socio : EnderecoBase, IDomain +{ + private string _nome; + + private string _email; + + private string _prefixo; + + private string _telefone; + + public long IdEmpresa { get; set; } + + public bool Excluido { get; set; } + + [Log(true)] + [Name(true)] + public string Nome + { + get + { + return _nome?.ToUpper(); + } + set + { + _nome = value; + } + } + + [Log(true)] + [Description("E-MAIL")] + public string Email + { + get + { + return _email?.ToLower().Trim(); + } + set + { + _email = value; + } + } + + [Log(true)] + [Description("PREFIXO")] + public string Prefixo + { + get + { + return _prefixo?.ToUpper().Trim(); + } + set + { + _prefixo = value; + } + } + + [Log(true)] + [Description("TELEFONE")] + public string Telefone + { + get + { + return _telefone?.ToUpper().Trim(); + } + set + { + _telefone = value; + } + } + + [JsonIgnore] + public Func<List<KeyValuePair<string, string>>> ValidationEvent => Validate; + + public List<KeyValuePair<string, string>> Validate() + { + List<KeyValuePair<string, string>> list = ValidationHelper.AddValue(); + if (string.IsNullOrWhiteSpace(Nome)) + { + list.AddValue("Nome", Messages.Obrigatorio); + } + else if (Nome.Length > 60) + { + list.AddValue("Nome", string.Format(Messages.MaiorQueLimite, 60)); + } + return list; + } + + public List<TupleList> Log() + { + return new List<TupleList> + { + new TupleList + { + Tuples = new ObservableCollection<Tuple<string, string, string>> + { + new Tuple<string, string, string>("NOME", string.IsNullOrWhiteSpace(Nome) ? "" : Nome, ""), + new Tuple<string, string, string>("E-MAIL", string.IsNullOrWhiteSpace(Email) ? "" : Email, ""), + new Tuple<string, string, string>("PREFIXO", string.IsNullOrWhiteSpace(Prefixo) ? "" : Prefixo, ""), + new Tuple<string, string, string>("TELEFONE", string.IsNullOrWhiteSpace(Telefone) ? "" : Telefone, ""), + new Tuple<string, string, string>("E-MAIL", string.IsNullOrWhiteSpace(Email) ? "" : Email, "") + } + } + }; + } +} diff --git a/Gestor.Model/Gestor.Model.Domain.Common/TrocaCliente.cs b/Gestor.Model/Gestor.Model.Domain.Common/TrocaCliente.cs new file mode 100644 index 0000000..d97e14b --- /dev/null +++ b/Gestor.Model/Gestor.Model.Domain.Common/TrocaCliente.cs @@ -0,0 +1,107 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using Gestor.Model.Domain.Seguros; + +namespace Gestor.Model.Domain.Common; + +public class TrocaCliente +{ + private string _descricao; + + private long _idClienteTrocado; + + private string _nomeClienteTrocado; + + private long _idclienteNovo; + + private string _nomeClienteNovo; + + private Documento _documento; + + public string Descricao + { + get + { + return _descricao?.ToUpper(); + } + set + { + _descricao = value; + } + } + + public long IdClienteTrocado + { + get + { + return _idClienteTrocado; + } + set + { + _idClienteTrocado = value; + } + } + + public string NomeClienteTrocado + { + get + { + return _nomeClienteTrocado; + } + set + { + _nomeClienteTrocado = value; + } + } + + public long IdClienteNovo + { + get + { + return _idclienteNovo; + } + set + { + _idclienteNovo = value; + } + } + + public string NomeClienteNovo + { + get + { + return _nomeClienteNovo; + } + set + { + _nomeClienteNovo = value; + } + } + + public Documento Documento + { + get + { + return _documento; + } + set + { + _documento = value; + } + } + + public List<TupleList> Log() + { + return new List<TupleList> + { + new TupleList + { + Tuples = new ObservableCollection<Tuple<string, string, string>> + { + new Tuple<string, string, string>("DESCRICAO", string.IsNullOrWhiteSpace(Descricao) ? "" : Descricao, "") + } + } + }; + } +} |