# Fix: Report Label "Read and confirmed" for Read and Sign Envelopes ## Status ✅ **COMPLETED** ## Git Branch ``` fix/report-label-read-and-confirmed ``` --- ## Problem In the **Signature Certificate report** (`Signierungszertifikat`), the history event list always showed **"Document signed"** for status `DocumentSigned` (code `2005`) � even when the envelope type was **"Read and Sign"** (`EnvelopeTypeId = 2`). For "Read and Sign" envelopes the correct label must be **"Read and confirmed"** (DE: **"Gelesen und best�tigt"**). ### Screenshot reference The report shows a table with columns *Ereignis | Benutzer | Zeitstempel*. The row with status 2005 displayed "Document signed" where "Read and confirmed" was expected. --- ## Root Cause `ReportItem.ItemStatusTranslated` in `EnvelopeGenerator.CommonServices\Jobs\FinalizeDocument\ReportItem.vb` resolved the display label by calling: ```vb My.Resources.Model.ResourceManager.GetString(ItemStatus.ToString()) ``` There was **no branching logic** to handle the Read and Sign envelope type. The same `DocumentSigned` key was always used regardless of envelope type. --- ## Solution ### Convention followed The project already uses a `RaC` (**R**ead **a**nd **C**onfirm) suffix for Read-and-Sign label variants across all resource files: | Existing RaC keys | |---| | `DocumentRejectedRaC` | | `EnvelopeReportCreatedRaC` | | `MessageConfirmationSentRaC` | ### New resource key added: `DocumentSignedRaC` | Resource file | Value | |---|---| | `Model.resx` (DE, default) | `Gelesen und best�tigt` | | `Model.en.resx` (EN) | `Read and confirmed` | ### Logic change in `ReportItem.vb` ```vb Public ReadOnly Property ItemStatusTranslated As String Get Dim oStatusKey = ItemStatus.ToString() If ItemStatus = EnvelopeStatus.DocumentSigned AndAlso Envelope IsNot Nothing AndAlso Envelope.IsReadAndConfirm() Then oStatusKey = "DocumentSignedRaC" End If Return My.Resources.Model.ResourceManager.GetString(oStatusKey) End Get End Property ``` `Envelope.IsReadAndConfirm()` is defined in `EnvelopeGenerator.Domain\Interfaces\IEnvelope.cs` and returns `true` when `EnvelopeTypeId == 2`. --- ## Files Changed | # | File | Change | Status | |---|---|---|---| | 1 | `EnvelopeGenerator.CommonServices\Jobs\FinalizeDocument\ReportItem.vb` | Added `RaC` branching logic to `ItemStatusTranslated` | ? Done | | 2 | `EnvelopeGenerator.Domain\Resources\Model.resx` | Added `DocumentSignedRaC` = `Gelesen und bestätigt` | ✅ Done | | 3 | `EnvelopeGenerator.CommonServices\Strings\Model.resx` | Added `DocumentSignedRaC` = `Gelesen und bestätigt` | ✅ Done | | 4 | `EnvelopeGenerator.CommonServices\Strings\Model.en.resx` | Added `DocumentSignedRaC` = `Read and confirmed` | ✅ Done | | 5 | `EnvelopeGenerator.Domain\Resources\Model.Designer.cs` | Added `DocumentSignedRaC` strongly-typed property | ✅ Done | --- ## How to resume (for next agent) All pending items are **resource file additions only**. Each file needs one new `` block inserted **directly after** the existing `DocumentSigned` entry: ```xml Gelesen und best�tigt Read and confirmed ``` `Model.Designer.cs` also needs a new strongly-typed property added after `DocumentSigned`: ```csharp /// /// Looks up a localized string similar to Gelesen und best�tigt. /// public static string DocumentSignedRaC { get { return ResourceManager.GetString("DocumentSignedRaC", resourceCulture); } } ``` --- ## Testing After changes, generate a Signature Certificate report for a **Read and Sign** envelope and verify: - History row with status 2005 shows **"Read and confirmed"** (EN) - History row with status 2005 shows **"Gelesen und best�tigt"** (DE) - Regular (non-RaC) envelopes still show **"Document signed"** / **"Dokument unterzeichnet"**