From 1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1 Mon Sep 17 00:00:00 2001 From: Lucas Faria Mendes Date: Mon, 30 Mar 2026 10:38:18 -0300 Subject: chore: location --- .../Gestor.Model/Model.Domain.Seguros/Cobertura.cs | 86 ++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 Codemerx/Gestor.Model/Model.Domain.Seguros/Cobertura.cs (limited to 'Codemerx/Gestor.Model/Model.Domain.Seguros/Cobertura.cs') diff --git a/Codemerx/Gestor.Model/Model.Domain.Seguros/Cobertura.cs b/Codemerx/Gestor.Model/Model.Domain.Seguros/Cobertura.cs new file mode 100644 index 0000000..f0b8c66 --- /dev/null +++ b/Codemerx/Gestor.Model/Model.Domain.Seguros/Cobertura.cs @@ -0,0 +1,86 @@ +using Gestor.Model.Domain.Generic; +using Gestor.Model.Helper; +using Gestor.Model.Resources; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Runtime.CompilerServices; + +namespace Gestor.Model.Domain.Seguros +{ + public class Cobertura : DomainBase, IDomain + { + private string _observacao; + + public Gestor.Model.Domain.Seguros.CoberturaPadrao CoberturaPadrao + { + get; + set; + } + + public decimal Franquia + { + get; + set; + } + + public Gestor.Model.Domain.Seguros.Item Item + { + get; + set; + } + + public decimal Lmi + { + get; + set; + } + + public string Observacao + { + get + { + string str = this._observacao; + if (str != null) + { + return str.ToUpper(); + } + return null; + } + set + { + this._observacao = (!string.IsNullOrWhiteSpace(value) || this.CoberturaPadrao == null ? value : this.CoberturaPadrao.Descricao); + } + } + + public decimal Premio + { + get; + set; + } + + [JsonIgnore] + public Func>> ValidationEvent + { + get + { + Cobertura cobertura = this; + return new Func>>(cobertura.Validate); + } + } + + public Cobertura() + { + } + + public List> Validate() + { + List> keyValuePairs = ValidationHelper.AddValue(); + if ((this.Lmi != decimal.Zero || this.Premio != decimal.Zero || this.Franquia != decimal.Zero) && string.IsNullOrWhiteSpace(this.Observacao)) + { + keyValuePairs.AddValue("Observacao", Messages.Obrigatorio, true); + } + return keyValuePairs; + } + } +} \ No newline at end of file -- cgit v1.2.3