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/Extrato.cs | |
| parent | 225aa1499e37faf9d38257caabbadc68d78b427e (diff) | |
| download | gestor-master.tar.gz gestor-master.zip | |
Diffstat (limited to 'Gestor.Model/Gestor.Model.Domain.Seguros/Extrato.cs')
| -rw-r--r-- | Gestor.Model/Gestor.Model.Domain.Seguros/Extrato.cs | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/Gestor.Model/Gestor.Model.Domain.Seguros/Extrato.cs b/Gestor.Model/Gestor.Model.Domain.Seguros/Extrato.cs new file mode 100644 index 0000000..0ddb505 --- /dev/null +++ b/Gestor.Model/Gestor.Model.Domain.Seguros/Extrato.cs @@ -0,0 +1,97 @@ +using System; +using System.Collections.Generic; +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 Extrato : DomainBase, IDomain +{ + private string _numero; + + private string _historico; + + private string _observacao; + + public long IdEmpresa { get; set; } + + public Seguradora Seguradora { get; set; } + + public StatusExtrato Status { get; set; } + + public bool Selecionado { get; set; } + + public string Numero + { + get + { + return _numero?.ToUpper(); + } + set + { + _numero = value; + } + } + + public string Historico + { + get + { + return _historico?.ToUpper(); + } + set + { + _historico = value; + } + } + + public DateTime? Data { get; set; } + + public DateTime? DataCredito { get; set; } + + public decimal? Bruto { get; set; } + + public decimal? Liquido { get; set; } + + public decimal? Ir { get; set; } + + public decimal? Iss { get; set; } + + public decimal? Outro { get; set; } + + public bool Completo { get; set; } + + public string Observacao + { + get + { + return _observacao?.ToUpper(); + } + set + { + _observacao = value; + } + } + + public virtual long IdUsuario { 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(Numero) && Numero.Length > 50) + { + list.AddValue("Numero", string.Format(Messages.MaiorQueLimite, 50)); + } + if (Data.HasValue && (DateTime.Compare(Data.Value, new DateTime(1753, 1, 1)) < 0 || DateTime.Compare(Data.Value, new DateTime(9999, 12, 31)) > 0)) + { + list.AddValue("Data", string.Format(Messages.DataInvalida)); + } + return list; + } +} |