diff --git a/EnvelopeGenerator.sln b/EnvelopeGenerator.sln index 7d53a3cd..b30bc02e 100644 --- a/EnvelopeGenerator.sln +++ b/EnvelopeGenerator.sln @@ -22,6 +22,7 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{134D4164-B291-4E19-99B9-E4FA3AFAB62C}" ProjectSection(SolutionItems) = preProject COPILOT_CONTEXT.md = COPILOT_CONTEXT.md + fix-report-label-read-and-confirmed.md = fix-report-label-read-and-confirmed.md FORM_APPLICATION_CONTEXT.md = FORM_APPLICATION_CONTEXT.md RECEIVER_PDF_VIEWER_CONTEXT.md = RECEIVER_PDF_VIEWER_CONTEXT.md EndProjectSection diff --git a/fix-report-label-read-and-confirmed.md b/fix-report-label-read-and-confirmed.md new file mode 100644 index 00000000..c0b05970 --- /dev/null +++ b/fix-report-label-read-and-confirmed.md @@ -0,0 +1,135 @@ +# Fix: Report Label "Read and confirmed" for Read and Sign Envelopes + +## Status +?? **IN PROGRESS** + +## 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` | ?? Pending | +| 3 | `EnvelopeGenerator.CommonServices\Strings\Model.resx` | Added `DocumentSignedRaC` = `Gelesen und bestätigt` | ?? Pending | +| 4 | `EnvelopeGenerator.CommonServices\Strings\Model.en.resx` | Added `DocumentSignedRaC` = `Read and confirmed` | ?? Pending | +| 5 | `EnvelopeGenerator.Domain\Resources\Model.Designer.cs` | Added `DocumentSignedRaC` strongly-typed property | ?? Pending | + +--- + +## 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"**