refactor(ReceiverUI/Models): update to use Application layer's DTO

This commit is contained in:
2026-06-17 14:05:01 +02:00
parent 73d793f0a0
commit 9f57baf2e5
4 changed files with 9 additions and 33 deletions

View File

@@ -41,6 +41,9 @@
<ItemGroup> <ItemGroup>
<Folder Include="Properties\PublishProfiles\" /> <Folder Include="Properties\PublishProfiles\" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<ProjectReference Include="..\EnvelopeGenerator.Application\EnvelopeGenerator.Application.csproj" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<Content Update="wwwroot\docs\privacy-policy.en-US.html"> <Content Update="wwwroot\docs\privacy-policy.en-US.html">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>

View File

@@ -1,32 +0,0 @@
namespace EnvelopeGenerator.ReceiverUI.Models;
/// <summary>
/// Represents a pre-assigned signature annotation position on a specific page.
/// <br/><br/>
/// <b>Coordinate unit (X, Y):</b> Inches (GdPicture14 native unit),
/// origin at the <b>top-left</b> corner of the page, both axes increase downward/rightward.
/// <br/><br/>
/// <b>Conversion to DevExpress:</b> Multiply by 100 (DX uses 1/100 inch).
/// Convert: <c>xDX = xInches * 100.0</c>
/// <br/>
/// <b>Conversion to PDF Points:</b> Multiply by 72 (1 inch = 72 points).
/// Convert: <c>xPt = xInches * 72.0</c>
/// <br/>
/// <b>Y-axis for PDF (bottom-left origin):</b> Flip required for iText7.
/// Convert: <c>yPt = (pageHeightInches - yInches - elemHeightInches) * 72.0</c>
/// </summary>
[Obsolete("Use SignatureDto with SignatureService.")]
public record AnnotationDto
{
/// <summary>Unique identifier of the annotation.</summary>
public long Id { get; init; }
/// <summary>1-based page number within the document.</summary>
public int Page { get; init; }
/// <summary>Horizontal position in INCHES from the left edge of the page.</summary>
public double X { get; init; }
/// <summary>Vertical position in INCHES from the top edge of the page.</summary>
public double Y { get; init; }
}

View File

@@ -6,6 +6,7 @@
@using DevExpress.Utils @using DevExpress.Utils
@using DevExpress.XtraPrinting @using DevExpress.XtraPrinting
@using DevExpress.XtraPrinting.Drawing @using DevExpress.XtraPrinting.Drawing
@using EnvelopeGenerator.Application.Common.Dto
@using Microsoft.JSInterop @using Microsoft.JSInterop
@using XtraReport = DevExpress.XtraReports.UI.XtraReport @using XtraReport = DevExpress.XtraReports.UI.XtraReport
@using BottomMarginBand = DevExpress.XtraReports.UI.BottomMarginBand @using BottomMarginBand = DevExpress.XtraReports.UI.BottomMarginBand
@@ -301,7 +302,10 @@ Shown="OnPopupShownAsync">
bool IsLoggingOut; bool IsLoggingOut;
IReadOnlyList<AnnotationDto> _annotations = []; IReadOnlyList<AnnotationDto> _annotations = [];
IEnumerable<int> AnnotationPages => _annotations.Select(a => a.Page).Distinct().OrderBy(p => p); IEnumerable<int> AnnotationPages => _annotations
.Select(a => a.Page ?? throw new InvalidOperationException($"Annotation page is missing for annotation ID {a.Id}. Annotation details: X={a.X}, Y={a.Y}"))
.Distinct()
.OrderBy(p => p);
EnvelopeReceiverDto? _envelopeReceiver; EnvelopeReceiverDto? _envelopeReceiver;
record SignatureCapture(string DataUrl, string FullName, string Position, string Place); record SignatureCapture(string DataUrl, string FullName, string Position, string Place);
SignatureCapture? _capturedSignature; SignatureCapture? _capturedSignature;

View File

@@ -1,5 +1,6 @@
using System.Net.Http.Json; using System.Net.Http.Json;
using System.Text.Json; using System.Text.Json;
using EnvelopeGenerator.Application.Common.Dto;
using EnvelopeGenerator.ReceiverUI.Models; using EnvelopeGenerator.ReceiverUI.Models;
using EnvelopeGenerator.ReceiverUI.Options; using EnvelopeGenerator.ReceiverUI.Options;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;