From 887d76e2fcb2d68686f388b507b82a88e1f415f7 Mon Sep 17 00:00:00 2001 From: OlgunR Date: Mon, 23 Feb 2026 16:03:09 +0100 Subject: [PATCH] Add IsReadAndSign and enhance StatusTranslated logic Refactored StatusTranslated to append "4RaC" to the resource key for "Read and Sign" envelopes (EnvelopeTypeId == 2). Introduced an IsReadAndSign extension method for Envelope. Added necessary namespace import for extension support. --- EnvelopeGenerator.Domain/Entities/Envelope.cs | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/EnvelopeGenerator.Domain/Entities/Envelope.cs b/EnvelopeGenerator.Domain/Entities/Envelope.cs index b03ebc58..afa5baa1 100644 --- a/EnvelopeGenerator.Domain/Entities/Envelope.cs +++ b/EnvelopeGenerator.Domain/Entities/Envelope.cs @@ -1,6 +1,8 @@ using DigitalData.UserManager.Domain.Entities; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using EnvelopeGenerator.Domain; + #if NETFRAMEWORK using System; using System.Collections.Generic; @@ -129,7 +131,21 @@ namespace EnvelopeGenerator.Domain.Entities public bool IsAlreadySent => Status > (int)Constants.EnvelopeStatus.EnvelopeSaved; [NotMapped] - public string StatusTranslated => My.Resources.Model.ResourceManager.GetString(((Constants.EnvelopeStatus)Status).ToString()); + public string StatusTranslated + { + get + { + if(this.IsReadAndSign()) + { + return My.Resources.Model.ResourceManager.GetString(((Constants.EnvelopeStatus)Status).ToString() + "4RaC"); + } + else + { + return My.Resources.Model.ResourceManager.GetString(((Constants.EnvelopeStatus)Status).ToString()); + + } + } + } [NotMapped] public bool TFA_Enabled { get; set; } = false; @@ -168,4 +184,12 @@ namespace EnvelopeGenerator.Domain.Entities return errors; } } + + public static class Extensions + { + public static bool IsReadAndSign(this Envelope envelope) + { + return envelope.EnvelopeTypeId == 2; + } + } } \ No newline at end of file