Compare commits
4 Commits
a0ed3e2fe4
...
a49dd0ff81
| Author | SHA1 | Date | |
|---|---|---|---|
| a49dd0ff81 | |||
| e420e8d47a | |||
| d7f86adffe | |||
| cfb5c15fda |
@@ -40,6 +40,7 @@ public class MappingProfile : Profile
|
|||||||
// DTO to Entity mappings
|
// DTO to Entity mappings
|
||||||
CreateMap<ConfigDto, Config>();
|
CreateMap<ConfigDto, Config>();
|
||||||
CreateMap<DocReceiverElementDto, DocReceiverElement>();
|
CreateMap<DocReceiverElementDto, DocReceiverElement>();
|
||||||
|
CreateMap<Signature, DocReceiverElement>().MapChangedWhen();
|
||||||
CreateMap<DocumentStatusDto, DocumentStatus>();
|
CreateMap<DocumentStatusDto, DocumentStatus>();
|
||||||
CreateMap<EmailTemplateDto, EmailTemplate>();
|
CreateMap<EmailTemplateDto, EmailTemplate>();
|
||||||
CreateMap<EnvelopeDto, Envelope>();
|
CreateMap<EnvelopeDto, Envelope>();
|
||||||
|
|||||||
65
EnvelopeGenerator.Application/Common/Dto/Signature.cs
Normal file
65
EnvelopeGenerator.Application/Common/Dto/Signature.cs
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
namespace EnvelopeGenerator.Application.Common.Dto;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Represents a captured signature with metadata created by the receiver in the signature popup.
|
||||||
|
/// This model holds the signature image (as base64 data URL) along with signer information
|
||||||
|
/// used for rendering applied signatures on the PDF canvas.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// <b>Used in:</b> EnvelopeViewer.razor signature popup workflow
|
||||||
|
/// <br/>
|
||||||
|
/// <b>Creation:</b> User draws/types/uploads signature and fills required fields
|
||||||
|
/// </remarks>
|
||||||
|
public sealed record Signature
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// TBDD_DOCUMENT_RECEIVER_ELEMENT.ID - identifies the specific signature field on the PDF page.
|
||||||
|
/// </summary>
|
||||||
|
public required int ElementId { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Base64-encoded data URL of the signature image.
|
||||||
|
/// <br/>
|
||||||
|
/// <b>Format:</b> <c>data:image/png;base64,iVBORw0KG...</c>
|
||||||
|
/// <br/>
|
||||||
|
/// <b>Source:</b> Canvas.toDataURL() from signature pad (draw/text/image tabs)
|
||||||
|
/// <br/>
|
||||||
|
/// <b>Usage:</b> Set as <c>img.src</c> in applied signature overlay
|
||||||
|
/// </summary>
|
||||||
|
public required string DataUrl { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Full name of the signer (first and last name).
|
||||||
|
/// <br/>
|
||||||
|
/// <b>Required:</b> Yes (validated in popup)
|
||||||
|
/// <br/>
|
||||||
|
/// <b>Example:</b> "Max Mustermann"
|
||||||
|
/// </summary>
|
||||||
|
public required string FullName { get; init; }
|
||||||
|
|
||||||
|
private readonly string? _position = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Job title or position of the signer.
|
||||||
|
/// <br/>
|
||||||
|
/// <b>Required:</b> No (optional field)
|
||||||
|
/// <br/>
|
||||||
|
/// <b>Example:</b> "Geschäftsführer" or empty string
|
||||||
|
/// </summary>
|
||||||
|
public string? Position
|
||||||
|
{
|
||||||
|
get => _position;
|
||||||
|
init => _position = string.IsNullOrWhiteSpace(value) ? value : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Location/place where the signature was created.
|
||||||
|
/// <br/>
|
||||||
|
/// <b>Required:</b> Yes (validated in popup)
|
||||||
|
/// <br/>
|
||||||
|
/// <b>Display:</b> Shown with current date in German format (dd.MM.yyyy)
|
||||||
|
/// <br/>
|
||||||
|
/// <b>Example:</b> "Berlin" ? rendered as "Berlin, 26.01.2025"
|
||||||
|
/// </summary>
|
||||||
|
public required string Place { get; init; }
|
||||||
|
}
|
||||||
@@ -5,70 +5,6 @@ using EnvelopeGenerator.Application.Common.Query;
|
|||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DocReceiverElements.Commands;
|
namespace EnvelopeGenerator.Application.DocReceiverElements.Commands;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Represents a captured signature with metadata created by the receiver in the signature popup.
|
|
||||||
/// This model holds the signature image (as base64 data URL) along with signer information
|
|
||||||
/// used for rendering applied signatures on the PDF canvas.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// <b>Used in:</b> EnvelopeViewer.razor signature popup workflow
|
|
||||||
/// <br/>
|
|
||||||
/// <b>Creation:</b> User draws/types/uploads signature and fills required fields
|
|
||||||
/// </remarks>
|
|
||||||
public sealed record SignatureDto
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// TBDD_DOCUMENT_RECEIVER_ELEMENT.ID - identifies the specific signature field on the PDF page.
|
|
||||||
/// </summary>
|
|
||||||
public required int ElementId { get; init; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Base64-encoded data URL of the signature image.
|
|
||||||
/// <br/>
|
|
||||||
/// <b>Format:</b> <c>data:image/png;base64,iVBORw0KG...</c>
|
|
||||||
/// <br/>
|
|
||||||
/// <b>Source:</b> Canvas.toDataURL() from signature pad (draw/text/image tabs)
|
|
||||||
/// <br/>
|
|
||||||
/// <b>Usage:</b> Set as <c>img.src</c> in applied signature overlay
|
|
||||||
/// </summary>
|
|
||||||
public required string DataUrl { get; init; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Full name of the signer (first and last name).
|
|
||||||
/// <br/>
|
|
||||||
/// <b>Required:</b> Yes (validated in popup)
|
|
||||||
/// <br/>
|
|
||||||
/// <b>Example:</b> "Max Mustermann"
|
|
||||||
/// </summary>
|
|
||||||
public required string FullName { get; init; }
|
|
||||||
|
|
||||||
private readonly string? _position = null;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Job title or position of the signer.
|
|
||||||
/// <br/>
|
|
||||||
/// <b>Required:</b> No (optional field)
|
|
||||||
/// <br/>
|
|
||||||
/// <b>Example:</b> "Geschäftsführer" or empty string
|
|
||||||
/// </summary>
|
|
||||||
public string? Position
|
|
||||||
{
|
|
||||||
get => _position;
|
|
||||||
init => _position = string.IsNullOrWhiteSpace(value) ? value : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Location/place where the signature was created.
|
|
||||||
/// <br/>
|
|
||||||
/// <b>Required:</b> Yes (validated in popup)
|
|
||||||
/// <br/>
|
|
||||||
/// <b>Display:</b> Shown with current date in German format (dd.MM.yyyy)
|
|
||||||
/// <br/>
|
|
||||||
/// <b>Example:</b> "Berlin" ? rendered as "Berlin, 26.01.2025"
|
|
||||||
/// </summary>
|
|
||||||
public required string Place { get; init; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Command to sign a document by a receiver.
|
/// Command to sign a document by a receiver.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -99,7 +35,7 @@ public record SigningCommand : EnvelopeReceiverQueryBase, IRequest
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IEnumerable<SignatureDto>? Signatures { get; init; }
|
public IEnumerable<Signature>? Signatures { get; init; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
using AutoMapper;
|
|
||||||
using EnvelopeGenerator.Application.DocReceiverElements.Commands;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DocReceiverElements;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public class MappingProfile : Profile
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public MappingProfile()
|
|
||||||
{
|
|
||||||
CreateMap<SignatureDto, DocReceiverElement>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
using AutoMapper;
|
||||||
|
using EnvelopeGenerator.Application.Common.Dto;
|
||||||
|
using EnvelopeGenerator.Application.Common.Query;
|
||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
using MediatR;
|
||||||
|
using EnvelopeGenerator.Application.Common.Extensions;
|
||||||
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.DocReceiverElements.Queries;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public record ReadDocReceiverElementQuery : EnvelopeReceiverQueryBase, IRequest<IEnumerable<DocReceiverElementDto>>
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class ReadDocReceiverElementQueryHandler : IRequestHandler<ReadDocReceiverElementQuery, IEnumerable<DocReceiverElementDto>>
|
||||||
|
{
|
||||||
|
private readonly IRepository<DocReceiverElement> _repository;
|
||||||
|
|
||||||
|
private readonly IMapper _mapper;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="repository"></param>
|
||||||
|
/// <param name="mapper"></param>
|
||||||
|
public ReadDocReceiverElementQueryHandler(IRepository<DocReceiverElement> repository, IMapper mapper)
|
||||||
|
{
|
||||||
|
_repository = repository;
|
||||||
|
_mapper = mapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
|
public async Task<IEnumerable<DocReceiverElementDto>> Handle(ReadDocReceiverElementQuery request, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
var q = _repository.Query;
|
||||||
|
|
||||||
|
if(request.Envelope.Id is int envelopeId)
|
||||||
|
q = q.Where(e => e.Document.EnvelopeId == envelopeId);
|
||||||
|
|
||||||
|
if (request.Envelope.Uuid is string envelopeUuid)
|
||||||
|
q = q.Where(e => e.Document.Envelope.Uuid == envelopeUuid);
|
||||||
|
|
||||||
|
if (request.Receiver.Id is int receiverId)
|
||||||
|
q = q.Where(e => e.ReceiverId == receiverId);
|
||||||
|
|
||||||
|
if (request.Receiver.Signature is string signature)
|
||||||
|
q = q.Where(e => e.Receiver.Signature == signature);
|
||||||
|
|
||||||
|
var elements = await q.ToListAsync(cancellationToken);
|
||||||
|
|
||||||
|
return _mapper.Map<IEnumerable<DocReceiverElementDto>>(elements);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
@page "/documentviewer"
|
@page "/example/documentviewer"
|
||||||
|
|
||||||
<DxDocumentViewer ReportName="LargeDatasetReport" CssClass="dx-blazor-reporting-container" Height="@null" Width="@null">
|
<DxDocumentViewer ReportName="LargeDatasetReport" CssClass="dx-blazor-reporting-container" Height="@null" Width="@null">
|
||||||
<DxDocumentViewerTabPanelSettings Width="340" />
|
<DxDocumentViewerTabPanelSettings Width="340" />
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
@page "/sender"
|
@page "/example/sender"
|
||||||
@using DevExpress.DataAccess.Json;
|
@using DevExpress.DataAccess.Json;
|
||||||
@using EnvelopeGenerator.ReceiverUI.Services;
|
@using EnvelopeGenerator.ReceiverUI.Services;
|
||||||
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
@page "/receiver/{EnvelopeKey}"
|
@page "/example/receiver/{EnvelopeKey}"
|
||||||
@page "/report-viewer/{EnvelopeKey}"
|
@page "/example/report-viewer/{EnvelopeKey}"
|
||||||
@using System.Drawing
|
@using System.Drawing
|
||||||
@using DevExpress.Blazor
|
@using DevExpress.Blazor
|
||||||
@using DevExpress.Drawing
|
@using DevExpress.Drawing
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
@page "/test"
|
@page "/example/test"
|
||||||
@using System.Drawing
|
@using System.Drawing
|
||||||
@using DevExpress.Drawing
|
@using DevExpress.Drawing
|
||||||
@using DevExpress.Utils
|
@using DevExpress.Utils
|
||||||
Reference in New Issue
Block a user