Updated the Signature Certificate report to display the correct
label "Read and confirmed" for "Read and Sign" envelopes.
- Added `DocumentSignedRaC` resource key to `Model.resx` and
`Model.en.resx` with localized values ("Gelesen und bestätigt"
and "Read and confirmed").
- Updated `ReportItem.vb` to include conditional logic in
`ItemStatusTranslated` for "Read and Sign" envelopes.
- Added strongly-typed property for `DocumentSignedRaC` in
`Model.Designer.cs`.
- Updated `fix-report-label-read-and-confirmed.md` documentation
to reflect changes, including testing steps and task completion.
These changes ensure accurate status labels in the report for
different envelope types.
136 lines
4.0 KiB
Markdown
136 lines
4.0 KiB
Markdown
# 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`) <20>
|
||
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<73>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<73>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 `<data>` block inserted **directly after** the existing
|
||
`DocumentSigned` entry:
|
||
|
||
```xml
|
||
<data name="DocumentSignedRaC" xml:space="preserve">
|
||
<value>Gelesen und best<73>tigt</value> <!-- DE files -->
|
||
<!-- OR -->
|
||
<value>Read and confirmed</value> <!-- EN file -->
|
||
</data>
|
||
```
|
||
|
||
`Model.Designer.cs` also needs a new strongly-typed property added after
|
||
`DocumentSigned`:
|
||
|
||
```csharp
|
||
/// <summary>
|
||
/// Looks up a localized string similar to Gelesen und best<73>tigt.
|
||
/// </summary>
|
||
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<73>tigt"** (DE)
|
||
- Regular (non-RaC) envelopes still show **"Document signed"** / **"Dokument unterzeichnet"**
|