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.Seguros/SinistroAuto.cs | |
| parent | 225aa1499e37faf9d38257caabbadc68d78b427e (diff) | |
| download | gestor-0440c722a221b8068bbf388c1c0c51f0faff0451.tar.gz gestor-0440c722a221b8068bbf388c1c0c51f0faff0451.zip | |
Diffstat (limited to 'Gestor.Model/Gestor.Model.Domain.Seguros/SinistroAuto.cs')
| -rw-r--r-- | Gestor.Model/Gestor.Model.Domain.Seguros/SinistroAuto.cs | 199 |
1 files changed, 199 insertions, 0 deletions
diff --git a/Gestor.Model/Gestor.Model.Domain.Seguros/SinistroAuto.cs b/Gestor.Model/Gestor.Model.Domain.Seguros/SinistroAuto.cs new file mode 100644 index 0000000..0fac555 --- /dev/null +++ b/Gestor.Model/Gestor.Model.Domain.Seguros/SinistroAuto.cs @@ -0,0 +1,199 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using Gestor.Model.Attributes; +using Gestor.Model.Common; +using Gestor.Model.Domain.Generic; +using Gestor.Model.Helper; +using Gestor.Model.Resources; +using Newtonsoft.Json; + +namespace Gestor.Model.Domain.Seguros; + +public class SinistroAuto : DomainBase, IDomain +{ + private string _numeroBo; + + private string _endereco; + + private string _envolvido; + + private string _motorista; + + private string _ddd; + + private string _telefone; + + private string _email; + + private string _cnh; + + public Sinistro Sinistro { get; set; } + + [Log(true)] + [Name(true)] + [Description("NUMERO B.O.")] + public string NumeroBo + { + get + { + return _numeroBo?.ToUpper(); + } + set + { + _numeroBo = value; + } + } + + [Log(true)] + [Name(true)] + [Description("TIPO PERDA")] + public TipoPerda? TipoPerda { get; set; } + + [Log(true)] + [Name(true)] + [Description("DECLARA-SE CULPADO")] + public bool? Culpado { get; set; } + + [Log(true)] + [Name(true)] + [Description("DATA ÚLTIMO DOC. ENVIADO")] + public DateTime? UltimoDocEnviado { get; set; } + + [Log(true)] + [Description("MECÂNICA")] + public Parceiro ParceiroMecanica { get; set; } + + [Log(true)] + [Description("FUNILARIA")] + public Parceiro ParceiroFunilaria { get; set; } + + [Log(true)] + [Name(true)] + [Description("ENDEREÇO")] + public string Endereco + { + get + { + return _endereco?.ToUpper(); + } + set + { + _endereco = value; + } + } + + [Log(true)] + [Name(true)] + public string Envolvido + { + get + { + return _envolvido?.ToUpper(); + } + set + { + _envolvido = value; + } + } + + [Log(true)] + [Name(true)] + public string Motorista + { + get + { + return _motorista?.ToUpper(); + } + set + { + _motorista = value; + } + } + + [Log(true)] + [Name(true)] + [Description("PREFIXO")] + public string Ddd + { + get + { + return _ddd?.ToUpper().Trim(); + } + set + { + _ddd = value; + } + } + + [Log(true)] + [Name(true)] + [Description("TELEFONE")] + public string Telefone + { + get + { + return _telefone?.ToUpper().Trim(); + } + set + { + _telefone = value; + } + } + + [Log(true)] + [Name(true)] + [Description("E-MAIL")] + public string Email + { + get + { + return _email?.ToLower().Trim(); + } + set + { + _email = value; + } + } + + [Log(true)] + [Name(true)] + public string Cnh + { + get + { + return _cnh?.ToUpper().Trim(); + } + set + { + _cnh = value; + } + } + + [Log(true)] + [Name(true)] + [Description("VALOR MECÂNICA")] + public decimal ValorMecanica { get; set; } + + [Log(true)] + [Name(true)] + [Description("VALOR FINILARIA")] + public decimal ValorFunilaria { 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 (Sinistro != null) + { + list.AddRange(Sinistro.Validate()); + } + if (UltimoDocEnviado.HasValue && (DateTime.Compare(UltimoDocEnviado.Value, new DateTime(1753, 1, 1)) < 0 || DateTime.Compare(UltimoDocEnviado.Value, new DateTime(9999, 12, 31)) > 0)) + { + list.AddValue("UltimoDocEnviado", string.Format(Messages.DataInvalida)); + } + return list; + } +} |