Compare commits

..

4 Commits

Author SHA1 Message Date
796b233ba4 Add contract type check to envelope validation
ValidateEnvelopeForSending now skips element checks if the envelope does not require a signature (i.e., contract type is not ReadAndSign), preventing unnecessary validation for such envelopes.
2026-01-23 17:37:14 +01:00
Developer01
1e2e018f7f MS Anpassungen 2025-11-12 21:43:50 +01:00
Developer01
69afea012b Handling InsertReceivers und kleinigkeiten frm Main 2025-09-16 09:00:43 +02:00
Developer01
85e0bc3400 Logging wegen Y-Konstante 2025-09-04 14:35:54 +02:00
167 changed files with 2191 additions and 1831 deletions

View File

@@ -0,0 +1,12 @@
using DigitalData.Core.Abstraction.Application.Repository;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Repositories;
/// <summary>
///
/// </summary>
[Obsolete("Use Read-method returning IReadQuery<TEntity> instead.")]
public interface IEnvelopeCertificateRepository : ICRUDRepository<EnvelopeCertificate, int>
{
}

View File

@@ -1,6 +1,6 @@
using DigitalData.Core.Abstraction.Application;
using DigitalData.Core.Abstraction.Application.DTO;
using EnvelopeGenerator.Application.Dto;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Services;

View File

@@ -1,5 +1,5 @@
using DigitalData.Core.Abstraction.Application;
using EnvelopeGenerator.Application.Dto;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Services;

View File

@@ -1,5 +1,5 @@
using DigitalData.Core.Abstraction.Application;
using EnvelopeGenerator.Application.Dto;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Services;

View File

@@ -1,6 +1,6 @@
using DigitalData.Core.Abstraction.Application;
using DigitalData.Core.Abstraction.Application.DTO;
using EnvelopeGenerator.Application.Dto;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
using static EnvelopeGenerator.Domain.Constants;

View File

@@ -0,0 +1,13 @@
using DigitalData.Core.Abstraction.Application;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Services;
/// <summary>
///
/// </summary>
[Obsolete("Use MediatR")]
public interface IEnvelopeCertificateService : IBasicCRUDService<EnvelopeCertificateDto, EnvelopeCertificate, int>
{
}

View File

@@ -1,5 +1,5 @@
using DigitalData.Core.Abstraction.Application;
using EnvelopeGenerator.Application.Dto;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Services;

View File

@@ -1,7 +1,7 @@
using DigitalData.Core.Abstraction.Application;
using DigitalData.Core.Abstraction.Application.DTO;
using EnvelopeGenerator.Application.Dto.EnvelopeHistory;
using EnvelopeGenerator.Application.Dto.Receiver;
using EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
using EnvelopeGenerator.Application.DTOs.Receiver;
using EnvelopeGenerator.Domain.Entities;
using static EnvelopeGenerator.Domain.Constants;

View File

@@ -1,7 +1,7 @@
using DigitalData.Core.Abstraction.Application.DTO;
using DigitalData.EmailProfilerDispatcher.Abstraction.Contracts;
using EnvelopeGenerator.Application.Dto.EnvelopeReceiver;
using EnvelopeGenerator.Application.Dto.EnvelopeReceiverReadOnly;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
using EnvelopeGenerator.Domain;
namespace EnvelopeGenerator.Application.Contracts.Services;

View File

@@ -1,5 +1,5 @@
using DigitalData.Core.Abstraction.Application;
using EnvelopeGenerator.Application.Dto.EnvelopeReceiverReadOnly;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Services;

View File

@@ -1,11 +1,10 @@
using CommandDotNet;
using DigitalData.Core.Abstraction.Application;
using DigitalData.Core.Abstraction.Application.DTO;
using EnvelopeGenerator.Application.Dto.EnvelopeReceiver;
using EnvelopeGenerator.Application.Dto.Messaging;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
using EnvelopeGenerator.Application.DTOs.Messaging;
using EnvelopeGenerator.Application.Envelopes;
using EnvelopeGenerator.Application.Envelopes.Queries;
using EnvelopeGenerator.Application.Receivers.Queries;
using EnvelopeGenerator.Application.Receivers.Queries.Read;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Services;
@@ -121,7 +120,7 @@ public interface IEnvelopeReceiverService : IBasicCRUDService<EnvelopeReceiverDt
/// <param name="receiverQuery"></param>
/// <param name="ignore_statuses"></param>
/// <returns></returns>
Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUsernameAsync(string username, int? min_status = null, int? max_status = null, ReadEnvelopeQuery? envelopeQuery = null, ReadReceiverQuery? receiverQuery = null, params int[] ignore_statuses);
Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUsernameAsync(string username, int? min_status = null, int? max_status = null, EnvelopeQuery? envelopeQuery = null, ReadReceiverQuery? receiverQuery = null, params int[] ignore_statuses);
/// <summary>
///

View File

@@ -1,6 +1,6 @@
using DigitalData.Core.Abstraction.Application;
using DigitalData.Core.Abstraction.Application.DTO;
using EnvelopeGenerator.Application.Dto;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Services;

View File

@@ -1,5 +1,5 @@
using EnvelopeGenerator.Application.Dto.EnvelopeReceiver;
using EnvelopeGenerator.Application.Dto.Messaging;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
using EnvelopeGenerator.Application.DTOs.Messaging;
namespace EnvelopeGenerator.Application.Contracts.Services;

View File

@@ -1,5 +1,5 @@
using DigitalData.Core.Abstraction.Application;
using EnvelopeGenerator.Application.Dto;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Services;

View File

@@ -1,6 +1,6 @@
using DigitalData.Core.Abstraction.Application;
using DigitalData.Core.Abstraction.Application.DTO;
using EnvelopeGenerator.Application.Dto.Receiver;
using EnvelopeGenerator.Application.DTOs.Receiver;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Services;

View File

@@ -1,4 +1,4 @@
using EnvelopeGenerator.Application.Dto.Messaging;
using EnvelopeGenerator.Application.DTOs.Messaging;
namespace EnvelopeGenerator.Application.Contracts.Services;

View File

@@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.Dto;
namespace EnvelopeGenerator.Application.DTOs;
/// <summary>
/// Data Transfer Object representing configuration settings.

View File

@@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.Dto;
namespace EnvelopeGenerator.Application.DTOs;
/// <summary>
/// Data Transfer Object representing a positioned element assigned to a document receiver.

View File

@@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.Dto;
namespace EnvelopeGenerator.Application.DTOs;
/// <summary>
/// Data Transfer Object representing the status of a document for a specific receiver.

View File

@@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.Dto
namespace EnvelopeGenerator.Application.DTOs
{
/// <summary>
///

View File

@@ -0,0 +1,50 @@
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs;
/// <summary>
/// Data Transfer Object representing certificate information for an envelope.
/// </summary>
[ApiExplorerSettings(IgnoreApi = true)]
public class EnvelopeCertificateDto
{
/// <summary>
/// Gets the unique identifier of the certificate.
/// </summary>
public int Id { get; init; }
/// <summary>
/// Gets the envelope ID associated with the certificate.
/// </summary>
public int EnvelopeId { get; init; }
/// <summary>
/// Gets the UUID of the envelope.
/// </summary>
public string EnvelopeUuid { get; init; } = string.Empty;
/// <summary>
/// Gets the subject of the envelope.
/// </summary>
public string EnvelopeSubject { get; init; } = string.Empty;
/// <summary>
/// Gets the ID of the creator of the envelope.
/// </summary>
public int CreatorId { get; init; }
/// <summary>
/// Gets the name of the creator.
/// </summary>
public string CreatorName { get; init; } = string.Empty;
/// <summary>
/// Gets the email address of the creator.
/// </summary>
public string CreatorEmail { get; init; } = string.Empty;
/// <summary>
/// Gets the current status of the envelope.
/// </summary>
public int EnvelopeStatus { get; init; }
}

View File

@@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.Dto;
namespace EnvelopeGenerator.Application.DTOs;
/// <summary>
/// Data Transfer Object representing a document within an envelope, including optional binary data and form elements.

View File

@@ -3,7 +3,7 @@ using DigitalData.UserManager.Application.DTOs.User;
using EnvelopeGenerator.Domain.Entities;
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.Dto;
namespace EnvelopeGenerator.Application.DTOs;
/// <summary>
///

View File

@@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.Dto.EnvelopeHistory;
namespace EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
/// <summary>
/// Data Transfer Object for creating a new envelope history record.

View File

@@ -1,8 +1,8 @@
using DigitalData.UserManager.Application.DTOs.User;
using EnvelopeGenerator.Application.Dto.Receiver;
using EnvelopeGenerator.Application.DTOs.Receiver;
using static EnvelopeGenerator.Domain.Constants;
namespace EnvelopeGenerator.Application.Dto.EnvelopeHistory;
namespace EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
/// <summary>
/// Data Transfer Object representing the history of an envelope, including status, sender, receiver, and related metadata.

View File

@@ -1,7 +1,7 @@
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.Dto.EnvelopeReceiver;
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
/// <summary>
///

View File

@@ -1,7 +1,7 @@
using EnvelopeGenerator.Application.Dto.Receiver;
using EnvelopeGenerator.Application.DTOs.Receiver;
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.Dto.EnvelopeReceiver;
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
/// <summary>
///

View File

@@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.Dto.EnvelopeReceiver;
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
/// <summary>
///

View File

@@ -2,7 +2,7 @@
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace EnvelopeGenerator.Application.Dto.EnvelopeReceiverReadOnly;
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
/// <summary>
///

View File

@@ -1,7 +1,7 @@
using EnvelopeGenerator.Application.Dto.Receiver;
using EnvelopeGenerator.Application.DTOs.Receiver;
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.Dto.EnvelopeReceiverReadOnly;
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
/// <summary>
/// Represents a read-only Data Transfer Object (DTO) for an envelope receiver.

View File

@@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.Dto.EnvelopeReceiverReadOnly;
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
/// <summary>
/// Data Transfer Object for updating a read-only envelope receiver.

View File

@@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.Dto;
namespace EnvelopeGenerator.Application.DTOs;
/// <summary>
/// Data Transfer Object representing a type of envelope with its configuration settings.

View File

@@ -1,13 +1,13 @@
using AutoMapper;
using EnvelopeGenerator.Application.Dto.EnvelopeHistory;
using EnvelopeGenerator.Application.Dto.EnvelopeReceiver;
using EnvelopeGenerator.Application.Dto.EnvelopeReceiverReadOnly;
using EnvelopeGenerator.Application.Dto.Messaging;
using EnvelopeGenerator.Application.Dto.Receiver;
using EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
using EnvelopeGenerator.Application.DTOs.Messaging;
using EnvelopeGenerator.Application.DTOs.Receiver;
using EnvelopeGenerator.Application.Extensions;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Dto;
namespace EnvelopeGenerator.Application.DTOs;
/// <summary>
/// Represents the AutoMapper profile configuration for mapping between
@@ -27,6 +27,7 @@ public class MappingProfile : Profile
CreateMap<DocumentStatus, DocumentStatusDto>();
CreateMap<EmailTemplate, EmailTemplateDto>();
CreateMap<Envelope, EnvelopeDto>();
CreateMap<EnvelopeCertificate, EnvelopeCertificateDto>();
CreateMap<EnvelopeDocument, EnvelopeDocumentDto>();
CreateMap<Domain.Entities.EnvelopeHistory, EnvelopeHistoryDto>();
CreateMap<Domain.Entities.EnvelopeHistory, EnvelopeHistoryCreateDto>();
@@ -44,6 +45,7 @@ public class MappingProfile : Profile
CreateMap<DocumentStatusDto, DocumentStatus>();
CreateMap<EmailTemplateDto, EmailTemplate>();
CreateMap<EnvelopeDto, Envelope>();
CreateMap<EnvelopeCertificateDto, EnvelopeCertificate>();
CreateMap<EnvelopeDocumentDto, EnvelopeDocument>();
CreateMap<EnvelopeHistoryDto, Domain.Entities.EnvelopeHistory>();
CreateMap<EnvelopeHistoryCreateDto, Domain.Entities.EnvelopeHistory>();

View File

@@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.Dto.Messaging;
namespace EnvelopeGenerator.Application.DTOs.Messaging;
/// <summary>
///

View File

@@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.Dto.Messaging;
namespace EnvelopeGenerator.Application.DTOs.Messaging;
/// <summary>
///

View File

@@ -3,7 +3,7 @@ using System.ComponentModel.DataAnnotations;
using System.Security.Cryptography;
using System.Text;
namespace EnvelopeGenerator.Application.Dto.Receiver;
namespace EnvelopeGenerator.Application.DTOs.Receiver;
/// <summary>
///

View File

@@ -1,8 +1,8 @@
using EnvelopeGenerator.Application.Dto.EnvelopeReceiver;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
using Microsoft.AspNetCore.Mvc;
using System.Text.Json.Serialization;
namespace EnvelopeGenerator.Application.Dto.Receiver;
namespace EnvelopeGenerator.Application.DTOs.Receiver;
/// <summary>
///

View File

@@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.Dto.Receiver;
namespace EnvelopeGenerator.Application.DTOs.Receiver;
/// <summary>
/// Data Transfer Object for updating a receiver's information.

View File

@@ -7,7 +7,7 @@ using DigitalData.Core.Client;
using QRCoder;
using EnvelopeGenerator.Application.Contracts.Services;
using System.Reflection;
using EnvelopeGenerator.Application.EnvelopeReceivers.Commands;
using EnvelopeGenerator.Application.EnvelopeReceivers.Commands.Create;
namespace EnvelopeGenerator.Application;
@@ -33,6 +33,7 @@ public static class DependencyInjection
services.TryAddScoped<IDocumentStatusService, DocumentStatusService>();
services.TryAddScoped<IEmailTemplateService, EmailTemplateService>();
services.TryAddScoped<IEnvelopeService, EnvelopeService>();
services.TryAddScoped<IEnvelopeCertificateService, EnvelopeCertificateService>();
services.TryAddScoped<IEnvelopeDocumentService, EnvelopeDocumentService>();
services.TryAddScoped<IEnvelopeReceiverService, EnvelopeReceiverService>();
services.TryAddScoped<IEnvelopeTypeService, EnvelopeTypeService>();

View File

@@ -0,0 +1,18 @@
using AutoMapper;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Documents.Queries.Read;
/// <summary>
///
/// </summary>
public class ReadDocumentMappingProfile : Profile
{
/// <summary>
///
/// </summary>
public ReadDocumentMappingProfile()
{
CreateMap<EnvelopeDocument, ReadDocumentResponse>();
}
}

View File

@@ -0,0 +1,12 @@
using MediatR;
namespace EnvelopeGenerator.Application.Documents.Queries.Read;
/// <summary>
/// Represents a query to read a document based on its unique identifier or associated envelope identifier.
/// </summary>
/// <param name="Id">The unique identifier of the document. Optional.</param>
/// <param name="EnvelopeId">The identifier of the envelope associated with the document. Optional.</param>
public record ReadDocumentQuery(int? Id = null, int? EnvelopeId = null) : IRequest<ReadDocumentResponse?>
{
}

View File

@@ -1,23 +1,13 @@
using DigitalData.Core.Abstraction.Application.Repository;
using EnvelopeGenerator.Application.Dto;
using MediatR;
using EnvelopeGenerator.Domain.Entities;
using MediatR;
namespace EnvelopeGenerator.Application.Documents.Queries;
/// <summary>
/// Represents a query to read a document based on its unique identifier or associated envelope identifier.
/// </summary>
/// <param name="Id">The unique identifier of the document. Optional.</param>
/// <param name="EnvelopeId">The identifier of the envelope associated with the document. Optional.</param>
public record ReadDocumentQuery(int? Id = null, int? EnvelopeId = null) : IRequest<EnvelopeDocumentDto?>
{
}
namespace EnvelopeGenerator.Application.Documents.Queries.Read;
/// <summary>
/// Handles queries for reading <see cref="EnvelopeDocument"/> data based on either the document ID or the envelope ID.
/// </summary>
public class ReadDocumentQueryHandler : IRequestHandler<ReadDocumentQuery, EnvelopeDocumentDto?>
public class ReadDocumentQueryHandler : IRequestHandler<ReadDocumentQuery, ReadDocumentResponse?>
{
/// <summary>
/// Repository for accessing <see cref="EnvelopeDocument"/> entities.
@@ -34,25 +24,25 @@ public class ReadDocumentQueryHandler : IRequestHandler<ReadDocumentQuery, Envel
}
/// <summary>
/// Handles the <see cref="ReadDocumentQuery"/> and returns a <see cref="EnvelopeDocumentDto"/> based on the provided identifiers.
/// Handles the <see cref="ReadDocumentQuery"/> and returns a <see cref="ReadDocumentResponse"/> based on the provided identifiers.
/// </summary>
/// <param name="query">The query containing the document ID or envelope ID to search for.</param>
/// <param name="cancellationToken">A token to monitor for cancellation requests.</param>
/// <returns>
/// A <see cref="EnvelopeDocumentDto"/> if a matching document is found; otherwise, <c>null</c>.
/// A <see cref="ReadDocumentResponse"/> if a matching document is found; otherwise, <c>null</c>.
/// </returns>
/// <exception cref="InvalidOperationException">
/// Thrown when neither <see cref="ReadDocumentQuery.Id"/> nor <see cref="ReadDocumentQuery.EnvelopeId"/> is provided.
/// </exception>
[Obsolete("Use MediatR")]
public async Task<EnvelopeDocumentDto?> Handle(ReadDocumentQuery query, CancellationToken cancellationToken)
public async Task<ReadDocumentResponse?> Handle(ReadDocumentQuery query, CancellationToken cancellationToken)
{
if (query.Id is not null)
return await _repo.ReadOrDefaultAsync<EnvelopeDocumentDto>(d => d.Id == query.Id);
return await _repo.ReadOrDefaultAsync<ReadDocumentResponse>(d => d.Id == query.Id);
else if (query.EnvelopeId is not null)
return await _repo.ReadOrDefaultAsync<EnvelopeDocumentDto>(d => d.EnvelopeId == query.EnvelopeId);
return await _repo.ReadOrDefaultAsync<ReadDocumentResponse>(d => d.EnvelopeId == query.EnvelopeId);
throw new InvalidOperationException(
$"Invalid {nameof(ReadDocumentQuery)}: either {nameof(query.Id)} or {nameof(query.EnvelopeId)} must be provided.");
}
}
}

View File

@@ -0,0 +1,12 @@
namespace EnvelopeGenerator.Application.Documents.Queries.Read;
/// <summary>
/// Represents the response for reading a document.
/// </summary>
public class ReadDocumentResponse : ReadDocumentResponseBase
{
/// <summary>
/// The binary data of the document, if available.
/// </summary>
public byte[]? ByteData { get; init; }
}

View File

@@ -0,0 +1,22 @@
namespace EnvelopeGenerator.Application.Documents.Queries.Read;
/// <summary>
/// Represents the response for reading a document.
/// </summary>
public class ReadDocumentResponseBase
{
/// <summary>
/// The unique identifier of the document.
/// </summary>
public int Guid { get; init; }
/// <summary>
/// The identifier of the associated envelope.
/// </summary>
public int EnvelopeId { get; init; }
/// <summary>
/// The date and time when the document was added.
/// </summary>
public DateTime AddedWhen { get; init; }
}

View File

@@ -1,5 +1,5 @@
using DigitalData.Core.Abstraction.Application.Repository;
using EnvelopeGenerator.Application.Dto;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
using MediatR;

View File

@@ -1,5 +1,5 @@
using DigitalData.Core.Abstraction.Application.Repository;
using EnvelopeGenerator.Application.Dto;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Application.Exceptions;
using EnvelopeGenerator.Domain;
using EnvelopeGenerator.Domain.Entities;

View File

@@ -1,5 +1,4 @@
using AutoMapper;
using EnvelopeGenerator.Application.EmailTemplates.Queries.Read;
using EnvelopeGenerator.Domain.Entities;
using System;
using System.Collections.Generic;
@@ -7,17 +6,17 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EnvelopeGenerator.Application.EmailTemplates;
namespace EnvelopeGenerator.Application.EmailTemplates.Queries.Read;
/// <summary>
///
/// </summary>
public class MappingProfile : Profile
public class ReadEmailTemplateMappingProfile : Profile
{
/// <summary>
///
/// </summary>
public MappingProfile()
public ReadEmailTemplateMappingProfile()
{
CreateMap<EmailTemplate, ReadEmailTemplateResponse>();
}

View File

@@ -14,28 +14,17 @@
<ItemGroup>
<PackageReference Include="Dapper" Version="2.1.66" />
<PackageReference Include="DigitalData.Core.Abstraction.Application" Version="1.1.0" />
<PackageReference Include="DigitalData.Core.Application" Version="3.4.0" />
<PackageReference Include="DigitalData.Core.Abstraction.Application" Version="1.0.0" />
<PackageReference Include="DigitalData.Core.Application" Version="3.3.4" />
<PackageReference Include="DigitalData.Core.Client" Version="2.1.0" />
<PackageReference Include="DigitalData.EmailProfilerDispatcher" Version="3.1.1" />
<PackageReference Include="MediatR" Version="12.5.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.18" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.5" />
<PackageReference Include="Otp.NET" Version="1.4.0" />
<PackageReference Include="QRCoder" Version="1.6.0" />
<PackageReference Include="QRCoder-ImageSharp" Version="0.10.0" />
<PackageReference Include="UserManager" Version="1.1.3" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.5" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.5" />
<PackageReference Include="UserManager" Version="1.1.1" />
</ItemGroup>
<ItemGroup>

View File

@@ -0,0 +1,21 @@
using EnvelopeGenerator.Application.Envelopes.Commands;
using MediatR;
using System.ComponentModel.DataAnnotations;
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Commands.Create;
/// <summary>
/// Befehl zur Erstellung eines Umschlags.
/// </summary>
/// <param name="Title">Der Titel des Umschlags. Dies ist ein Pflichtfeld.</param>
/// <param name="Message">Die Nachricht, die im Umschlag enthalten sein soll. Dies ist ein Pflichtfeld.</param>
/// <param name="Document">Das mit dem Umschlag verknüpfte Dokument. Dies ist ein Pflichtfeld.</param>
/// <param name="Receivers">Eine Sammlung von Empfängern, die den Umschlag erhalten. Dies ist ein Pflichtfeld.</param>
/// <param name="TFAEnabled">Gibt an, ob die Zwei-Faktor-Authentifizierung für den Umschlag aktiviert ist. Standardmäßig false.</param>
public record CreateEnvelopeReceiverCommand(
[Required] string Title,
[Required] string Message,
[Required] DocumentCreateCommand Document,
[Required] IEnumerable<ReceiverGetOrCreateCommand> Receivers,
bool TFAEnabled = false
) : CreateEnvelopeCommand(Title, Message, TFAEnabled), IRequest<CreateEnvelopeReceiverResponse>;

View File

@@ -1,10 +1,10 @@
using AutoMapper;
using EnvelopeGenerator.Application.Contracts.SQLExecutor;
using EnvelopeGenerator.Application.Dto.Receiver;
using EnvelopeGenerator.Application.DTOs.Receiver;
using EnvelopeGenerator.Domain.Entities;
using MediatR;
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Commands;
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Commands.Create;
/// <summary>
/// Handles the creation of an envelope along with its associated document and recipients.

View File

@@ -1,26 +1,13 @@
using EnvelopeGenerator.Application.Envelopes.Commands;
using MediatR;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Commands;
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Commands.Create;
/// <summary>
/// Befehl zur Erstellung eines Umschlags.
/// </summary>
/// <param name="Title">Der Titel des Umschlags. Dies ist ein Pflichtfeld.</param>
/// <param name="Message">Die Nachricht, die im Umschlag enthalten sein soll. Dies ist ein Pflichtfeld.</param>
/// <param name="Document">Das mit dem Umschlag verknüpfte Dokument. Dies ist ein Pflichtfeld.</param>
/// <param name="Receivers">Eine Sammlung von Empfängern, die den Umschlag erhalten. Dies ist ein Pflichtfeld.</param>
/// <param name="TFAEnabled">Gibt an, ob die Zwei-Faktor-Authentifizierung für den Umschlag aktiviert ist. Standardmäßig false.</param>
public record CreateEnvelopeReceiverCommand(
[Required] string Title,
[Required] string Message,
[Required] DocumentCreateCommand Document,
[Required] IEnumerable<ReceiverGetOrCreateCommand> Receivers,
bool TFAEnabled = false
) : CreateEnvelopeCommand(Title, Message, TFAEnabled), IRequest<CreateEnvelopeReceiverResponse>;
#region Subcommands
#region DTOs
/// <summary>
/// Signaturposition auf einem Dokument.
/// </summary>

View File

@@ -0,0 +1,21 @@
using AutoMapper;
using EnvelopeGenerator.Application.DTOs.Receiver;
using EnvelopeGenerator.Application.Envelopes.Commands;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Commands.Create;
/// <summary>
///
/// </summary>
public class CreateEnvelopeReceiverMappingProfile : Profile
{
/// <summary>
///
/// </summary>
public CreateEnvelopeReceiverMappingProfile()
{
CreateMap<Envelope, CreateEnvelopeResponse>();
CreateMap<Receiver, ReceiverReadDto>();
}
}

View File

@@ -0,0 +1,39 @@
using DigitalData.UserManager.Domain.Entities;
using EnvelopeGenerator.Application.DTOs.Receiver;
using EnvelopeGenerator.Application.Envelopes.Commands;
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Commands.Create;
/// <summary>
///
/// </summary>
public record CreateEnvelopeReceiverResponse : CreateEnvelopeResponse
{
/// <summary>
///
/// </summary>
/// <param name="Id"></param>
/// <param name="UserId"></param>
/// <param name="Status"></param>
/// <param name="Uuid"></param>
/// <param name="Message"></param>
/// <param name="AddedWhen"></param>
/// <param name="ChangedWhen"></param>
/// <param name="Title"></param>
/// <param name="Language"></param>
/// <param name="TFAEnabled"></param>
/// <param name="User"></param>
public CreateEnvelopeReceiverResponse(int Id, int UserId, int Status, string Uuid, string? Message, DateTime AddedWhen, DateTime? ChangedWhen, string? Title, string Language, bool TFAEnabled, User User) : base(Id, UserId, Status, Uuid, Message, AddedWhen, ChangedWhen, Title, Language, TFAEnabled, User)
{
}
/// <summary>
///
/// </summary>
public IEnumerable<ReceiverReadDto> SentReceiver { get; set; } = new List<ReceiverReadDto>();
/// <summary>
///
/// </summary>
public IEnumerable<ReceiverGetOrCreateCommand> UnsentReceivers { get; set; } = new List<ReceiverGetOrCreateCommand>();
}

View File

@@ -1,20 +0,0 @@
using EnvelopeGenerator.Application.Dto;
using EnvelopeGenerator.Application.Dto.Receiver;
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Commands;
/// <summary>
///
/// </summary>
public record CreateEnvelopeReceiverResponse : EnvelopeDto
{
/// <summary>
///
/// </summary>
public IEnumerable<ReceiverReadDto> SentReceiver { get; set; } = new List<ReceiverReadDto>();
/// <summary>
///
/// </summary>
public IEnumerable<ReceiverGetOrCreateCommand> UnsentReceivers { get; set; } = new List<ReceiverGetOrCreateCommand>();
}

View File

@@ -0,0 +1,47 @@
using EnvelopeGenerator.Application.Histories;
namespace EnvelopeGenerator.Application.EnvelopeReceivers;
/// <summary>
/// Stellt eine Abfrage für einen Envelope-Empfänger dar.
/// </summary>
/// <param name="Status">Der Status der Abfrage, optional.</param>
public record EnvelopeReceiverQuery(EnvelopeStatusQuery? Status = null);
/// <summary>
/// Repräsentiert den Status eines Umschlags und dessen Beziehung zum Empfänger. (vgl. auch <see cref="Common.Constants.EnvelopeStatus"/>
/// Invalid (0): Ungültiger Status.
/// EnvelopeCreated (1001): Der Umschlag wurde erstellt.
/// EnvelopeSaved (1002): Der Umschlag wurde gespeichert.
/// EnvelopeQueued (1003): Der Umschlag wurde zur Verarbeitung eingeplant.
/// EnvelopeSent (1004): Der Umschlag wurde versendet. (Nicht verwendet)
/// EnvelopePartlySigned (1005): Der Umschlag wurde teilweise unterschrieben.
/// EnvelopeCompletelySigned (1006): Der Umschlag wurde vollständig unterschrieben.
/// EnvelopeReportCreated (1007): Ein Abschlussbericht wurde für den Umschlag erstellt.
/// EnvelopeArchived (1008): Der Umschlag wurde archiviert.
/// EnvelopeDeleted (1009): Der Umschlag wurde gelöscht.
/// AccessCodeRequested (2001): Der Zugriffscode wurde angefordert.
/// AccessCodeCorrect (2002): Der Zugriffscode war korrekt.
/// AccessCodeIncorrect (2003): Der Zugriffscode war falsch.
/// DocumentOpened (2004): Das Dokument wurde geöffnet.
/// DocumentSigned (2005): Ein Dokument wurde unterschrieben.
/// SignatureConfirmed (2006): Die Signatur wurde bestätigt.
/// DocumentRejected (2007): Ein Dokument wurde abgelehnt.
/// EnvelopeShared (2008): Der Umschlag wurde geteilt.
/// EnvelopeViewed (2009): Der Umschlag wurde angesehen.
/// DocumentForwarded (4001): Das Dokument wurde weitergeleitet.
/// MessageInvitationSent (3001): Einladung wurde gesendet (vom Trigger verwendet).
/// MessageAccessCodeSent (3002): Zugriffscode wurde gesendet.
/// MessageConfirmationSent (3003): Bestätigungsnachricht wurde gesendet.
/// MessageDeletionSent (3004): Löschbenachrichtigung wurde gesendet.
/// MessageCompletionSent (3005): Abschlussbenachrichtigung wurde gesendet.
/// <param name="Min">Der minimale Statuswert, der berücksichtigt werden soll.</param>
/// <param name="Max">Der maximale Statuswert, der berücksichtigt werden soll.</param>
/// <param name="Ignore">Eine Liste von Statuswerten, die ignoriert werden sollen.</param>
/// </summary>
public record EnvelopeStatusQuery(
int? Min = null,
int? Max = null,
int[]? Ignore = null)
{
}

View File

@@ -1,20 +0,0 @@
using AutoMapper;
using EnvelopeGenerator.Application.Dto.Receiver;
using EnvelopeGenerator.Application.Envelopes.Commands;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.EnvelopeReceivers;
/// <summary>
///
/// </summary>
public class MappingProfile : Profile
{
/// <summary>
///
/// </summary>
public MappingProfile()
{
CreateMap<Receiver, ReceiverReadDto>();
}
}

View File

@@ -0,0 +1,30 @@
using EnvelopeGenerator.Application.Histories;
using EnvelopeGenerator.Application.Envelopes.Queries.Read;
using EnvelopeGenerator.Application.Receivers.Queries.Read;
using MediatR;
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Queries.Read;
/// <summary>
/// Repräsentiert eine Abfrage zum Lesen eines Envelope-Empfängers.
/// </summary>
/// <remarks>
/// Diese Abfrage kombiniert Informationen über einen Umschlag (<see cref="ReadEnvelopeQuery"/>)
/// und einen Empfänger (<see cref="ReadReceiverQuery"/>), um eine vollständige Antwort
/// (<see cref="ReadEnvelopeReceiverResponse"/>) zu generieren.
/// Die Antwort enthält Details wie den Status, die Zuordnung zwischen Umschlag und Empfänger
/// sowie zusätzliche Metadaten.
/// </remarks>
/// <param name="Status">Umschlag oder Empfängerstatus.</param>
public record ReadEnvelopeReceiverQuery(EnvelopeStatusQuery? Status = null) : EnvelopeReceiverQuery(Status), IRequest<ReadEnvelopeReceiverResponse>
{
/// <summary>
/// Der Umschlag, der mit dem Empfänger verknüpft ist.
/// </summary>
public ReadEnvelopeQuery? Envelope { get; init; }
/// <summary>
/// Der Empfänger, der mit dem Umschlag verknüpft ist.
/// </summary>
public ReadReceiverQuery? Receiver { get; init; }
};

View File

@@ -0,0 +1,94 @@
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
using EnvelopeGenerator.Application.Envelopes.Queries.Read;
using EnvelopeGenerator.Application.Receivers.Queries.Read;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Queries.Read;
/// <summary>
/// Repräsentiert die Antwort für das Lesen eines Envelope-Empfängers.
/// </summary>
/// <remarks>
/// Diese Klasse enthält Informationen über einen spezifischen Empfänger eines Umschlags (Envelope).
/// Sie verknüpft die Empfängerinformationen mit den zugehörigen Umschlagsdaten und bietet zusätzliche Metadaten.
/// </remarks>
/// <param name="UserId">Die eindeutige Kennung des Benutzers, der den Empfänger erstellt hat.</param>
/// <param name="Status">Der Status des Empfängers als numerischer Wert.</param>
public record ReadEnvelopeReceiverResponse(int UserId, int Status)
{
/// <summary>
/// Gibt die zusammengesetzte Kennung des Empfängers zurück, bestehend aus der Umschlags-ID und der Empfänger-ID.
/// </summary>
/// <remarks>
/// Diese Eigenschaft kombiniert die eindeutige Kennung des Umschlags (EnvelopeId) und die des Empfängers (ReceiverId)
/// zu einer einzigen, leicht zugänglichen Struktur.
/// </remarks>
[NotMapped]
public (int Envelope, int Receiver) Id => (Envelope: EnvelopeId, Receiver: ReceiverId);
/// <summary>
/// Die eindeutige Kennung des zugehörigen Umschlags.
/// </summary>
[Required]
public int EnvelopeId { get; init; }
/// <summary>
/// Die eindeutige Kennung des Empfängers.
/// </summary>
[Required]
public int ReceiverId { get; init; }
/// <summary>
/// Die Reihenfolge des Empfängers innerhalb des Umschlags.
/// </summary>
public int Sequence { get; init; }
/// <summary>
/// Der Name des Empfängers. Kann als Platzhalter verwendet werden.
/// </summary>
[TemplatePlaceholder("[NAME_RECEIVER]")]
public string? Name { get; init; }
/// <summary>
/// Die Berufsbezeichnung des Empfängers.
/// </summary>
public string? JobTitle { get; init; }
/// <summary>
/// Der Firmenname des Empfängers.
/// </summary>
public string? CompanyName { get; init; }
/// <summary>
/// Eine private Nachricht, die mit dem Empfänger verknüpft ist.
/// </summary>
public string? PrivateMessage { get; init; }
/// <summary>
/// Das Datum und die Uhrzeit, wann der Empfänger hinzugefügt wurde.
/// </summary>
public DateTime AddedWhen { get; init; }
/// <summary>
/// Das Datum und die Uhrzeit, wann der Empfänger zuletzt geändert wurde (falls vorhanden).
/// </summary>
public DateTime? ChangedWhen { get; init; }
/// <summary>
/// Gibt an, ob der Empfänger eine Telefonnummer hat.
/// </summary>
public bool HasPhoneNumber { get; init; }
/// <summary>
/// Die zugehörigen Umschlagsdaten.
/// </summary>
[Required]
public required ReadEnvelopeResponse Envelope { get; init; }
/// <summary>
/// Die Liste der Empfängerinformationen.
/// </summary>
[Required]
public IEnumerable<ReadReceiverResponse> Receiver { get; init; } = new List<ReadReceiverResponse>();
}

View File

@@ -1,137 +0,0 @@
using EnvelopeGenerator.Application.Dto.EnvelopeReceiver;
using EnvelopeGenerator.Application.Envelopes.Queries;
using EnvelopeGenerator.Application.Exceptions;
using EnvelopeGenerator.Application.Receivers.Queries;
using EnvelopeGenerator.Domain;
using EnvelopeGenerator.Extensions;
using MediatR;
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Queries;
/// <summary>
/// Repräsentiert eine Abfrage zum Lesen eines Envelope-Empfängers.
/// Invalid (0): Ungültiger Status.
/// EnvelopeCreated (1001): Der Umschlag wurde erstellt.
/// EnvelopeSaved (1002): Der Umschlag wurde gespeichert.
/// EnvelopeQueued (1003): Der Umschlag wurde zur Verarbeitung eingeplant.
/// EnvelopeSent (1004): Der Umschlag wurde versendet. (Nicht verwendet)
/// EnvelopePartlySigned (1005): Der Umschlag wurde teilweise unterschrieben.
/// EnvelopeCompletelySigned (1006): Der Umschlag wurde vollständig unterschrieben.
/// EnvelopeReportCreated (1007): Ein Abschlussbericht wurde für den Umschlag erstellt.
/// EnvelopeArchived (1008): Der Umschlag wurde archiviert.
/// EnvelopeDeleted (1009): Der Umschlag wurde gelöscht.
/// AccessCodeRequested (2001): Der Zugriffscode wurde angefordert.
/// AccessCodeCorrect (2002): Der Zugriffscode war korrekt.
/// AccessCodeIncorrect (2003): Der Zugriffscode war falsch.
/// DocumentOpened (2004): Das Dokument wurde geöffnet.
/// DocumentSigned (2005): Ein Dokument wurde unterschrieben.
/// SignatureConfirmed (2006): Die Signatur wurde bestätigt.
/// DocumentRejected (2007): Ein Dokument wurde abgelehnt.
/// EnvelopeShared (2008): Der Umschlag wurde geteilt.
/// EnvelopeViewed (2009): Der Umschlag wurde angesehen.
/// DocumentForwarded (4001): Das Dokument wurde weitergeleitet.
/// MessageInvitationSent (3001): Einladung wurde gesendet (vom Trigger verwendet).
/// MessageAccessCodeSent (3002): Zugriffscode wurde gesendet.
/// MessageConfirmationSent (3003): Bestätigungsnachricht wurde gesendet.
/// MessageDeletionSent (3004): Löschbenachrichtigung wurde gesendet.
/// MessageCompletionSent (3005): Abschlussbenachrichtigung wurde gesendet.
/// </summary>
/// <remarks>
/// Diese Abfrage kombiniert Informationen über einen Umschlag (<see cref="ReadEnvelopeQuery"/>)
/// und einen Empfänger (<see cref="ReadReceiverQuery"/>), um eine vollständige Antwort
/// (<see cref="EnvelopeReceiverDto"/>) zu generieren.
/// Die Antwort enthält Details wie den Status, die Zuordnung zwischen Umschlag und Empfänger
/// sowie zusätzliche Metadaten.
/// </remarks>
public record ReadEnvelopeReceiverQuery : IRequest<EnvelopeReceiverDto>
{
/// <summary>
///
/// </summary>
public string? Key
{
get => Envelope?.Uuid is string uuid && Receiver?.Signature is string signature
? (uuid, signature).EncodeEnvelopeReceiverId()
: null;
init
{
if (value is null)
return;
(string? EnvelopeUuid, string? ReceiverSignature) = value.DecodeEnvelopeReceiverId();
if(string.IsNullOrEmpty(EnvelopeUuid) || string.IsNullOrEmpty(ReceiverSignature))
{
throw new BadRequestException("Der EnvelopeReceiverKey muss ein gültiger Base64-kodierter String sein, der die EnvelopeUuid und die ReceiverSignature enthält.");
}
Envelope = new ReadEnvelopeQuery()
{
Uuid = EnvelopeUuid
};
Receiver = new ReadReceiverQuery()
{
Signature = ReceiverSignature
};
}
}
/// <summary>
/// Der Umschlag, der mit dem Empfänger verknüpft ist.
/// </summary>
public ReadEnvelopeQuery? Envelope { get; set; }
/// <summary>
/// Der Empfänger, der mit dem Umschlag verknüpft ist.
/// </summary>
public ReadReceiverQuery? Receiver { get; set; }
/// <summary>
/// Abfrage des Status des Umschlags
/// </summary>
public EnvelopeStatusQuery? Status { get; init; }
};
/// <summary>
/// Repräsentiert den Status eines Umschlags und dessen Beziehung zum Empfänger. (vgl. auch <see cref="Constants.EnvelopeStatus"/>
/// Invalid (0): Ungültiger Status.
/// EnvelopeCreated (1001): Der Umschlag wurde erstellt.
/// EnvelopeSaved (1002): Der Umschlag wurde gespeichert.
/// EnvelopeQueued (1003): Der Umschlag wurde zur Verarbeitung eingeplant.
/// EnvelopeSent (1004): Der Umschlag wurde versendet. (Nicht verwendet)
/// EnvelopePartlySigned (1005): Der Umschlag wurde teilweise unterschrieben.
/// EnvelopeCompletelySigned (1006): Der Umschlag wurde vollständig unterschrieben.
/// EnvelopeReportCreated (1007): Ein Abschlussbericht wurde für den Umschlag erstellt.
/// EnvelopeArchived (1008): Der Umschlag wurde archiviert.
/// EnvelopeDeleted (1009): Der Umschlag wurde gelöscht.
/// AccessCodeRequested (2001): Der Zugriffscode wurde angefordert.
/// AccessCodeCorrect (2002): Der Zugriffscode war korrekt.
/// AccessCodeIncorrect (2003): Der Zugriffscode war falsch.
/// DocumentOpened (2004): Das Dokument wurde geöffnet.
/// DocumentSigned (2005): Ein Dokument wurde unterschrieben.
/// SignatureConfirmed (2006): Die Signatur wurde bestätigt.
/// DocumentRejected (2007): Ein Dokument wurde abgelehnt.
/// EnvelopeShared (2008): Der Umschlag wurde geteilt.
/// EnvelopeViewed (2009): Der Umschlag wurde angesehen.
/// DocumentForwarded (4001): Das Dokument wurde weitergeleitet.
/// MessageInvitationSent (3001): Einladung wurde gesendet (vom Trigger verwendet).
/// MessageAccessCodeSent (3002): Zugriffscode wurde gesendet.
/// MessageConfirmationSent (3003): Bestätigungsnachricht wurde gesendet.
/// MessageDeletionSent (3004): Löschbenachrichtigung wurde gesendet.
/// MessageCompletionSent (3005): Abschlussbenachrichtigung wurde gesendet.
/// </summary>
public record EnvelopeStatusQuery
{
/// <summary>
/// Der minimale Statuswert, der berücksichtigt werden soll.
/// </summary>
public int? Min { get; init; }
/// <summary>
/// Der maximale Statuswert, der berücksichtigt werden soll.
/// </summary>
public int? Max { get; init; }
/// <summary>
/// Eine Liste von Statuswerten, die ignoriert werden sollen.
/// </summary>
public int[]? Ignore { get; init; }
}

View File

@@ -1,75 +0,0 @@
using AutoMapper;
using DigitalData.Core.Abstraction.Application.Repository;
using EnvelopeGenerator.Application.Dto.EnvelopeReceiver;
using EnvelopeGenerator.Domain.Entities;
using MediatR;
using Microsoft.EntityFrameworkCore;
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Queries;
/// <summary>
///
/// </summary>
public class ReadEnvelopeReceiverQueryHandler : IRequestHandler<ReadEnvelopeReceiverQuery, EnvelopeReceiverDto>
{
private readonly IRepository<EnvelopeReceiver> _repo;
private readonly IMapper _mapper;
/// <summary>
///
/// </summary>
/// <param name="envelopeReceiver"></param>
public ReadEnvelopeReceiverQueryHandler(IRepository<EnvelopeReceiver> envelopeReceiver, IMapper mapper)
{
_repo = envelopeReceiver;
_mapper = mapper;
}
/// <summary>
///
/// </summary>
/// <param name="request"></param>
/// <param name="cancel"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
public async Task<EnvelopeReceiverDto> Handle(ReadEnvelopeReceiverQuery request, CancellationToken cancel)
{
var q = _repo.Read();
if(request.Envelope is not null)
{
var env = request.Envelope;
if (env.Id is not null)
q = q.Where(er => er.EnvelopeId == env.Id);
if (env.Status is not null)
q = q.Where(er => er.Envelope.Status == env.Status);
if (env.Uuid is not null)
q = q.Where(er => er.Envelope.Uuid == env.Uuid);
}
if (request.Receiver is not null)
{
var rcv = request.Receiver;
if (rcv.Id is not null)
q = q.Where(r => r.ReceiverId == rcv.Id);
if (rcv.EmailAddress is not null)
q = q.Where(r => r.Receiver.EmailAddress == rcv.EmailAddress);
if (rcv.Signature is not null)
q = q.Where(er => er.Receiver.Signature == rcv.Signature);
}
var er = await q.Include(er => er.Envelope).ThenInclude(e => e.Documents).ThenInclude(d => d.Elements)
.Include(er => er.Envelope).ThenInclude(e => e.History)
.Include(er => er.Envelope).ThenInclude(e => e.User)
.Include(er => er.Receiver)
.FirstOrDefaultAsync(cancel);
var dto = _mapper.Map<EnvelopeReceiverDto>(er);
return dto;
}
}

View File

@@ -1,6 +1,4 @@
using EnvelopeGenerator.Application.Dto;
using EnvelopeGenerator.Application.Envelopes.Queries;
using MediatR;
using MediatR;
using Microsoft.AspNetCore.Mvc.ModelBinding;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
@@ -17,7 +15,7 @@ public record CreateEnvelopeCommand(
[Required] string Title,
[Required] string Message,
bool TFAEnabled = false
) : IRequest<EnvelopeDto?>
) : IRequest<CreateEnvelopeResponse?>
{
/// <summary>
/// Id of receiver
@@ -25,4 +23,4 @@ public record CreateEnvelopeCommand(
[JsonIgnore]
[BindNever]
public int? UserId { get; set; }
};
};

View File

@@ -1,6 +1,5 @@
using AutoMapper;
using EnvelopeGenerator.Application.Contracts.SQLExecutor;
using EnvelopeGenerator.Application.Dto;
using MediatR;
namespace EnvelopeGenerator.Application.Envelopes.Commands;
@@ -8,7 +7,7 @@ namespace EnvelopeGenerator.Application.Envelopes.Commands;
/// <summary>
///
/// </summary>
public class CreateEnvelopeCommandHandler : IRequestHandler<CreateEnvelopeCommand, EnvelopeDto?>
public class CreateEnvelopeCommandHandler : IRequestHandler<CreateEnvelopeCommand, CreateEnvelopeResponse?>
{
private readonly IEnvelopeExecutor _envelopeExecutor;
@@ -31,12 +30,12 @@ public class CreateEnvelopeCommandHandler : IRequestHandler<CreateEnvelopeComman
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public async Task<EnvelopeDto?> Handle(CreateEnvelopeCommand request, CancellationToken cancellationToken)
public async Task<CreateEnvelopeResponse?> Handle(CreateEnvelopeCommand request, CancellationToken cancellationToken)
{
int userId = request.UserId ?? throw new InvalidOperationException("UserId cannot be null when creating an envelope.");
var envelope = await _envelopeExecutor.CreateEnvelopeAsync(userId, request.Title, request.Message, request.TFAEnabled, cancellationToken);
return _mapper.Map<EnvelopeDto>(envelope);
return _mapper.Map<CreateEnvelopeResponse>(envelope);
}
}

View File

@@ -0,0 +1,19 @@
using AutoMapper;
using EnvelopeGenerator.Application.EnvelopeReceivers.Commands.Create;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Envelopes.Commands;
/// <summary>
///
/// </summary>
public class CreateEnvelopeMappingProfile : Profile
{
/// <summary>
///
/// </summary>
public CreateEnvelopeMappingProfile()
{
CreateMap<Envelope, CreateEnvelopeReceiverResponse>();
}
}

View File

@@ -0,0 +1,20 @@
using EnvelopeGenerator.Application.Envelopes.Queries.Read;
namespace EnvelopeGenerator.Application.Envelopes.Commands;
/// <summary>
///
/// </summary>
/// <param name="Id"><inheritdoc/></param>
/// <param name="UserId"><inheritdoc/></param>
/// <param name="Status"><inheritdoc/></param>
/// <param name="Uuid"><inheritdoc/></param>
/// <param name="Message"><inheritdoc/></param>
/// <param name="AddedWhen"><inheritdoc/></param>
/// <param name="ChangedWhen"><inheritdoc/></param>
/// <param name="Title"><inheritdoc/></param>
/// <param name="Language"><inheritdoc/></param>
/// <param name="TFAEnabled"><inheritdoc/></param>
/// <param name="User"><inheritdoc/></param>
public record CreateEnvelopeResponse(int Id, int UserId, int Status, string Uuid, string? Message, DateTime AddedWhen, DateTime? ChangedWhen, string? Title, string Language, bool TFAEnabled, DigitalData.UserManager.Domain.Entities.User User)
: ReadEnvelopeResponse(Id, UserId, Status, Uuid, Message, AddedWhen, ChangedWhen, Title, Language, TFAEnabled, User);

View File

@@ -0,0 +1,16 @@
using MediatR;
namespace EnvelopeGenerator.Application.Envelopes;
/// <summary>
/// Repräsentiert eine Abfrage für Umschläge.
/// </summary>
/// <param name="Id">Die eindeutige Kennung des Umschlags.</param>
/// <param name="Status">Der Status des Umschlags.</param>
/// <param name="Uuid">Die universell eindeutige Kennung des Umschlags.</param>
public record EnvelopeQuery(
int? Id = null,
int? Status = null,
string? Uuid = null) : IRequest
{
};

View File

@@ -1,19 +0,0 @@
using AutoMapper;
using EnvelopeGenerator.Application.EnvelopeReceivers.Commands;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Envelopes;
/// <summary>
///
/// </summary>
public class MappingProfile : Profile
{
/// <summary>
///
/// </summary>
public MappingProfile()
{
CreateMap<Envelope, CreateEnvelopeReceiverResponse>();
}
}

View File

@@ -0,0 +1,8 @@
namespace EnvelopeGenerator.Application.Envelopes.Queries.Read;
/// <summary>
/// Stellt eine Abfrage zum Lesen von Briefumschlägen dar.
/// </summary>
public record ReadEnvelopeQuery : EnvelopeQuery
{
}

View File

@@ -0,0 +1,36 @@
using EnvelopeGenerator.Domain;
namespace EnvelopeGenerator.Application.Envelopes.Queries.Read;
/// <summary>
/// Repräsentiert die Antwort für das Lesen eines Umschlags.
/// </summary>
/// <param name="Id">Die eindeutige Kennung des Umschlags.</param>
/// <param name="UserId">Die Kennung des Benutzers, der den Umschlag erstellt hat.</param>
/// <param name="Status">Der Status des Umschlags als numerischer Wert.</param>
/// <param name="Uuid">Die universelle eindeutige Kennung (UUID) des Umschlags.</param>
/// <param name="Message">Eine optionale Nachricht, die mit dem Umschlag verknüpft ist.</param>
/// <param name="AddedWhen">Das Datum und die Uhrzeit, wann der Umschlag hinzugefügt wurde.</param>
/// <param name="ChangedWhen">Das Datum und die Uhrzeit, wann der Umschlag zuletzt geändert wurde (falls vorhanden).</param>
/// <param name="Title">Ein optionaler Titel des Umschlags.</param>
/// <param name="Language">Die Sprache, die mit dem Umschlag verknüpft ist.</param>
/// <param name="TFAEnabled">Gibt an, ob die Zwei-Faktor-Authentifizierung (TFA) aktiviert ist.</param>
/// <param name="User">Das Benutzerobjekt, das mit dem Umschlag verknüpft ist.</param>
public record ReadEnvelopeResponse(
int Id,
int UserId,
int Status,
string Uuid,
string? Message,
DateTime AddedWhen,
DateTime? ChangedWhen,
string? Title,
string Language,
bool TFAEnabled,
DigitalData.UserManager.Domain.Entities.User User)
{
/// <summary>
/// Gibt den Namen des Status zurück, der dem numerischen Statuswert entspricht.
/// </summary>
public string StatusName => ((Constants.EnvelopeStatus)Status).ToString();
}

View File

@@ -1,24 +0,0 @@
using MediatR;
namespace EnvelopeGenerator.Application.Envelopes.Queries;
/// <summary>
/// Repräsentiert eine Abfrage für Umschläge.
/// </summary>
public class ReadEnvelopeQuery : IRequest
{
/// <summary>
/// Die eindeutige Kennung des Umschlags.
/// </summary>
public int? Id { get; init; }
/// <summary>
/// Der Status des Umschlags.
/// </summary>
public int? Status { get; init; }
/// <summary>
/// Die universell eindeutige Kennung des Umschlags.
/// </summary>
public string? Uuid { get; init; }
}

View File

@@ -1,6 +1,6 @@
using EnvelopeGenerator.Application.Receivers.Queries;
using EnvelopeGenerator.Application.Receivers.Queries.Read;
namespace EnvelopeGenerator.Application.Envelopes.Queries;
namespace EnvelopeGenerator.Application.Envelopes.Queries.ReceiverName;
/// <summary>
/// Eine Abfrage, um die zuletzt verwendete Anrede eines Empfängers zu ermitteln,

View File

@@ -1,4 +1,4 @@
using EnvelopeGenerator.Application.Dto.Messaging;
using EnvelopeGenerator.Application.DTOs.Messaging;
namespace EnvelopeGenerator.Application.Extensions;

View File

@@ -1,18 +1,17 @@
using AutoMapper;
using EnvelopeGenerator.Application.Histories.Queries.Read;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Histories;
namespace EnvelopeGenerator.Application.Histories.Queries.Read;
/// <summary>
///
/// </summary>
public class MappingProfile: Profile
public class ReadHistoryMappingProfile: Profile
{
/// <summary>
///
/// </summary>
public MappingProfile()
public ReadHistoryMappingProfile()
{
CreateMap<EnvelopeHistory, ReadHistoryResponse>();
}

View File

@@ -0,0 +1,10 @@
namespace EnvelopeGenerator.Application.Receivers.Queries.Read;
/// <summary>
/// Stellt eine Abfrage dar, um die Details eines Empfängers zu lesen.
/// Diese Abfrage erbt von <see cref="ReceiverQuery"/> und wird verwendet,
/// um spezifische Informationen über einen Empfänger abzurufen.
/// </summary>
public record ReadReceiverQuery : ReceiverQuery
{
}

View File

@@ -0,0 +1,12 @@
namespace EnvelopeGenerator.Application.Receivers.Queries.Read;
/// <summary>
/// Repräsentiert die Antwort auf eine Abfrage, um einen Empfänger zu lesen.
/// </summary>
/// <param name="Id">Die eindeutige Identifikationsnummer des Empfängers.</param>
/// <param name="EmailAddress">Die E-Mail-Adresse des Empfängers.</param>
/// <param name="AddedWhen">Das Datum und die Uhrzeit, wann der Empfänger hinzugefügt wurde.</param>
/// <param name="Signature">Die Signatur des Empfängers.</param>
public record ReadReceiverResponse(int Id, string EmailAddress, DateTime AddedWhen, string Signature)
{
}

View File

@@ -1,23 +0,0 @@
namespace EnvelopeGenerator.Application.Receivers.Queries;
/// <summary>
/// Stellt eine Abfrage dar, um die Details eines Empfängers zu lesen.
/// um spezifische Informationen über einen Empfänger abzurufen.
/// </summary>
public record ReadReceiverQuery
{
/// <summary>
/// ID des Empfängers
/// </summary>
public int? Id { get; init; }
/// <summary>
/// E-Mail Adresse des Empfängers
/// </summary>
public string? EmailAddress { get; init; }
/// <summary>
/// Eindeutige Signatur des Empfängers
/// </summary>
public string? Signature { get; init; }
}

View File

@@ -0,0 +1,9 @@
namespace EnvelopeGenerator.Application.Receivers;
/// <summary>
/// Empfänger des Umschlags
/// </summary>
/// <param name="Id">ID des Empfängers</param>
/// <param name="EmailAddress">E-Mail Adresse des Empfängers</param>
/// <param name="Signature">Eindeutige Signatur des Empfängers</param>
public record ReceiverQuery(int? Id = null, string? EmailAddress = null, string? Signature = null);

View File

@@ -2,7 +2,7 @@
using DigitalData.Core.Application;
using DigitalData.Core.Abstraction.Application.DTO;
using EnvelopeGenerator.Application.Contracts.Services;
using EnvelopeGenerator.Application.Dto;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
using EnvelopeGenerator.Application.Contracts.Repositories;
using Microsoft.Extensions.Caching.Memory;

View File

@@ -1,7 +1,7 @@
using AutoMapper;
using DigitalData.Core.Application;
using EnvelopeGenerator.Application.Contracts.Services;
using EnvelopeGenerator.Application.Dto;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
using EnvelopeGenerator.Application.Contracts.Repositories;

View File

@@ -1,7 +1,7 @@
using AutoMapper;
using DigitalData.Core.Application;
using EnvelopeGenerator.Application.Contracts.Services;
using EnvelopeGenerator.Application.Dto;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
using EnvelopeGenerator.Application.Contracts.Repositories;

View File

@@ -1,6 +1,6 @@
using AutoMapper;
using DigitalData.Core.Application;
using EnvelopeGenerator.Application.Dto;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
using EnvelopeGenerator.Application.Contracts.Repositories;
using static EnvelopeGenerator.Domain.Constants;

View File

@@ -0,0 +1,25 @@
using AutoMapper;
using DigitalData.Core.Application;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
using EnvelopeGenerator.Application.Contracts.Repositories;
using EnvelopeGenerator.Application.Contracts.Services;
namespace EnvelopeGenerator.Application.Services;
/// <summary>
///
/// </summary>
[Obsolete("Use MediatR")]
public class EnvelopeCertificateService : BasicCRUDService<IEnvelopeCertificateRepository, EnvelopeCertificateDto, EnvelopeCertificate, int>, IEnvelopeCertificateService
{
/// <summary>
///
/// </summary>
/// <param name="repository"></param>
/// <param name="mapper"></param>
public EnvelopeCertificateService(IEnvelopeCertificateRepository repository, IMapper mapper)
: base(repository, mapper)
{
}
}

View File

@@ -1,7 +1,7 @@
using AutoMapper;
using DigitalData.Core.Application;
using EnvelopeGenerator.Application.Contracts.Services;
using EnvelopeGenerator.Application.Dto;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
using EnvelopeGenerator.Application.Contracts.Repositories;

View File

@@ -3,8 +3,8 @@ using DigitalData.Core.Application;
using EnvelopeGenerator.Domain.Entities;
using EnvelopeGenerator.Application.Contracts.Repositories;
using static EnvelopeGenerator.Domain.Constants;
using EnvelopeGenerator.Application.Dto.EnvelopeHistory;
using EnvelopeGenerator.Application.Dto.Receiver;
using EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
using EnvelopeGenerator.Application.DTOs.Receiver;
using EnvelopeGenerator.Application.Contracts.Services;
using DigitalData.Core.Abstraction.Application.DTO;

View File

@@ -2,12 +2,12 @@
using DigitalData.EmailProfilerDispatcher.Abstraction.Contracts;
using DigitalData.EmailProfilerDispatcher.Abstraction.DTOs.EmailOut;
using DigitalData.EmailProfilerDispatcher.Abstraction.Services;
using EnvelopeGenerator.Application.Dto.EnvelopeReceiver;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using static EnvelopeGenerator.Domain.Constants;
using EnvelopeGenerator.Extensions;
using EnvelopeGenerator.Application.Dto.EnvelopeReceiverReadOnly;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
using EnvelopeGenerator.Application.Configurations;
using EnvelopeGenerator.Application.Extensions;
using Newtonsoft.Json;

View File

@@ -1,7 +1,7 @@
using AutoMapper;
using DigitalData.Core.Application;
using EnvelopeGenerator.Application.Contracts.Services;
using EnvelopeGenerator.Application.Dto.EnvelopeReceiverReadOnly;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
using EnvelopeGenerator.Domain.Entities;
using EnvelopeGenerator.Application.Contracts.Repositories;

View File

@@ -1,18 +1,17 @@
using AutoMapper;
using DigitalData.Core.Application;
using DigitalData.Core.Abstraction.Application.DTO;
using EnvelopeGenerator.Application.Dto.EnvelopeReceiver;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
using EnvelopeGenerator.Application.Resources;
using EnvelopeGenerator.Domain.Entities;
using EnvelopeGenerator.Application.Contracts.Repositories;
using Microsoft.Extensions.Localization;
using Microsoft.Extensions.Logging;
using EnvelopeGenerator.Extensions;
using EnvelopeGenerator.Application.Dto.Messaging;
using EnvelopeGenerator.Application.DTOs.Messaging;
using EnvelopeGenerator.Application.Contracts.Services;
using EnvelopeGenerator.Application.Envelopes;
using EnvelopeGenerator.Application.Envelopes.Queries;
using EnvelopeGenerator.Application.Receivers.Queries;
using EnvelopeGenerator.Application.Receivers.Queries.Read;
namespace EnvelopeGenerator.Application.Services;
@@ -237,7 +236,7 @@ public class EnvelopeReceiverService : BasicCRUDService<IEnvelopeReceiverReposit
/// <param name="receiverQuery"></param>
/// <param name="ignore_statuses"></param>
/// <returns></returns>
public async Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUsernameAsync(string username, int? min_status = null, int? max_status = null, ReadEnvelopeQuery? envelopeQuery = null, ReadReceiverQuery? receiverQuery = null, params int[] ignore_statuses)
public async Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUsernameAsync(string username, int? min_status = null, int? max_status = null, EnvelopeQuery? envelopeQuery = null, ReadReceiverQuery? receiverQuery = null, params int[] ignore_statuses)
{
var er_list = await _repository.ReadByUsernameAsync(username: username, min_status: min_status, max_status: max_status, ignore_statuses: ignore_statuses);

View File

@@ -2,7 +2,7 @@
using DigitalData.Core.Application;
using DigitalData.Core.Abstraction.Application.DTO;
using EnvelopeGenerator.Application.Contracts.Services;
using EnvelopeGenerator.Application.Dto;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
using EnvelopeGenerator.Application.Contracts.Repositories;

View File

@@ -1,7 +1,7 @@
using EnvelopeGenerator.Application.Configurations;
using EnvelopeGenerator.Application.Contracts.Services;
using EnvelopeGenerator.Application.Dto.EnvelopeReceiver;
using EnvelopeGenerator.Application.Dto.Messaging;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
using EnvelopeGenerator.Application.DTOs.Messaging;
using EnvelopeGenerator.Application.Extensions;
using Microsoft.Extensions.Caching.Distributed;
using Microsoft.Extensions.Options;

View File

@@ -1,6 +1,6 @@
using AutoMapper;
using DigitalData.Core.Application;
using EnvelopeGenerator.Application.Dto;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
using EnvelopeGenerator.Application.Contracts.Repositories;
using Microsoft.Extensions.Caching.Memory;

View File

@@ -3,7 +3,7 @@ using DigitalData.Core.Client.Interface;
using DigitalData.Core.Client;
using EnvelopeGenerator.Application.Configurations;
using EnvelopeGenerator.Application.Contracts.Services;
using EnvelopeGenerator.Application.Dto.Messaging;
using EnvelopeGenerator.Application.DTOs.Messaging;
using Microsoft.Extensions.Options;
namespace EnvelopeGenerator.Application.Services;

View File

@@ -2,7 +2,7 @@
using DigitalData.Core.Application;
using EnvelopeGenerator.Domain.Entities;
using EnvelopeGenerator.Application.Contracts.Repositories;
using EnvelopeGenerator.Application.Dto.Receiver;
using EnvelopeGenerator.Application.DTOs.Receiver;
using DigitalData.Core.Abstraction.Application.DTO;
using EnvelopeGenerator.Application.Contracts.Services;

View File

@@ -1,10 +1,11 @@
Imports DigitalData.Modules.Database
Imports System.IO
Imports System.Security.Cryptography
Imports DigitalData.Modules.Database
Imports DigitalData.Modules.Logging
Imports EnvelopeGenerator.CommonServices.Jobs
Imports EnvelopeGenerator.CommonServices.Jobs.FinalizeDocument
Imports GdPicture14
Imports Newtonsoft.Json.Linq
Imports EnvelopeGenerator.CommonServices.Jobs
Imports System.IO
Imports EnvelopeGenerator.CommonServices.Jobs.FinalizeDocument
Public Class frmFinalizePDF
Private Const CONNECTIONSTRING = "Server=sDD-VMP04-SQL17\DD_DEVELOP01;Database=DD_ECM;User Id=sa;Password=+bk8oAbbQP1AzoHtvZUbd+Mbok2f8Fl4miEx1qssJ5yEaEWoQJ9prg4L14fURpPnqi1WMNs9fE4=;"
@@ -65,6 +66,22 @@ Public Class frmFinalizePDF
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Try
'Dim oEnvelopeData = GetEnvelopeData(oId)
'If oEnvelopeData Is Nothing Then
' Logger.Warn("EnvelopeData could not be loaded for Id [{0}]!", oId)
' Throw New ArgumentNullException("EnvelopeData")
'End If
'Logger.Debug("Burning Annotations to pdf ...")
'sd
'Dim oBurnedDocument As Byte() = BurnAnnotationsToPdf(oEnvelopeData)
'If oBurnedDocument Is Nothing Then
' Logger.Warn("Document could not be finalized!")
' Throw New ApplicationException("Document could not be finalized")
'End If
Dim oTable = LoadAnnotationDataForEnvelope()
Dim oJsonList = oTable.Rows.

View File

@@ -84,8 +84,8 @@
<Reference Include="DigitalData.Modules.Logging, Version=2.6.5.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\DigitalData.Modules.Logging.2.6.5\lib\net462\DigitalData.Modules.Logging.dll</HintPath>
</Reference>
<Reference Include="DigitalData.UserManager.Domain, Version=3.2.3.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\UserManager.Domain.3.2.3\lib\net462\DigitalData.UserManager.Domain.dll</HintPath>
<Reference Include="DigitalData.UserManager.Domain, Version=3.2.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\UserManager.Domain.3.2.1\lib\net462\DigitalData.UserManager.Domain.dll</HintPath>
</Reference>
<Reference Include="DocumentFormat.OpenXml, Version=3.2.0.0, Culture=neutral, PublicKeyToken=8fb06cb64d019a17, processorArchitecture=MSIL">
<HintPath>..\packages\DocumentFormat.OpenXml.3.2.0\lib\net46\DocumentFormat.OpenXml.dll</HintPath>
@@ -436,7 +436,6 @@
<Content Include="Images\circle.svg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Compile Include="Models\ReceiverVM.vb" />
<Content Include="README.txt" />
<EmbeddedResource Include="Templates\document_access_code_de.html" />
<EmbeddedResource Include="Templates\email_de.html" />

View File

@@ -4,7 +4,6 @@ Imports DigitalData.Modules.Base
Imports Quartz
Imports System.Security.Cryptography
Imports DevExpress.DataProcessing
Imports EnvelopeGenerator.Domain.Entities
Namespace Jobs
Public Class APIEnvelopeJob
@@ -84,7 +83,7 @@ Namespace Jobs
oEnvelope.CURRENT_WORK_APP = "signFLOW_API_EnvJob_InvMail"
Logger.Debug("SendInvMail - Loading Envelope Data..")
Dim oEnvelopeData = GetEnvelopeData(oId)
oEnvelope.Receivers = ReceiverModel.ListEnvelopeReceivers(oEnvelope.Id).OfType(Of EnvelopeReceiver).ToList()
oEnvelope.Receivers = ReceiverModel.ListEnvelopeReceivers(oEnvelope.Id).ToList()
Logger.Debug("SendInvMail - Created Reveivers!")
If oEnvelopeData Is Nothing Then
Logger.Warn("SendInvMail - EnvelopeData could not be loaded for Id [{0}]!", oId)
@@ -134,7 +133,7 @@ Namespace Jobs
Throw New ArgumentNullException("EnvelopeData")
End If
oEnvelope.CURRENT_WORK_APP = "signFLOW_API_EnvJob_Withdrawn"
oEnvelope.Receivers = ReceiverModel.ListEnvelopeReceivers(oEnvelope.Id).OfType(Of EnvelopeReceiver).ToList()
oEnvelope.Receivers = ReceiverModel.ListEnvelopeReceivers(oEnvelope.Id).ToList()
Logger.Debug("WithdrawnEnv - Sending Withdrawn Mails..")

View File

@@ -123,6 +123,7 @@ Namespace Jobs
Throw New ArgumentNullException("EnvelopeData")
End If
Logger.Debug("Burning Annotations to pdf ...")
Dim oBurnedDocument As Byte() = BurnAnnotationsToPdf(oEnvelopeData)
If oBurnedDocument Is Nothing Then
Logger.Warn("Document could not be finalized!")
@@ -217,7 +218,7 @@ Namespace Jobs
If Not IsNothing(imageData) Then
sFileName = System.IO.Path.GetFileName(pFilePath)
'Set insert query
qry = $"UPDATE TBSIG_ENVELOPE SET DocResult = @ImageData WHERE GUID = {pEnvelopeID}"
qry = $"UPDATE TBSIG_ENVELOPE SET DOC_RESULT = @ImageData WHERE GUID = {pEnvelopeID}"
'Initialize SqlCommand object for insert.
SqlCom = New SqlCommand(qry, Database.GetConnection)
'We are passing File Name and Image byte data as sql parameters.
@@ -338,7 +339,7 @@ Namespace Jobs
For Each oReceiver In pEnvelope.Receivers
If ActionService.CompleteEnvelope(pEnvelope, oReceiver) = False Then ', oAttachment
Logger.Error("Envelope could not be completed for receiver [{0}]", oReceiver.Receiver.EmailAddress)
Logger.Error("Envelope could not be completed for receiver [{0}]", oReceiver.EmailAddress)
Return False
End If
Next

View File

@@ -16,6 +16,8 @@ Namespace Jobs.FinalizeDocument
Private Const ANNOTATION_TYPE_IMAGE = "pspdfkit/image"
Private Const ANNOTATION_TYPE_INK = "pspdfkit/ink"
Private Const ANNOTATION_TYPE_WIDGET = "pspdfkit/widget"
Private Annotationheight_min As Double = 0
Private Annotationheight_max As Double = 0
Private Property _pdfBurnerParams As PDFBurnerParams
Public Sub New(pLogConfig As LogConfig, pGDPictureLicenseKey As String, pdfBurnerParams As PDFBurnerParams)
@@ -69,12 +71,14 @@ Namespace Jobs.FinalizeDocument
Try
Dim oAnnotationData = JsonConvert.DeserializeObject(Of AnnotationData)(pInstantJSON)
oAnnotationData.annotations.Reverse()
Dim formFieldIndex = 0
Dim formFieldIndex = 0, AnnotationIndex = 0, AnnotationImageIndex = 0
For Each oAnnotation In oAnnotationData.annotations
Logger.Debug("Adding AnnotationID: " + oAnnotation.id)
AnnotationIndex += 1
Logger.Debug("Adding AnnotationID: " + oAnnotation.id + " -Index: " + AnnotationIndex.ToString)
Select Case oAnnotation.type
Case ANNOTATION_TYPE_IMAGE
AddImageAnnotation(oAnnotation, oAnnotationData.attachments)
AnnotationImageIndex += 1
AddImageAnnotation(AnnotationImageIndex, oAnnotation, oAnnotationData.attachments)
Case ANNOTATION_TYPE_INK
AddInkAnnotation(oAnnotation)
@@ -98,19 +102,26 @@ Namespace Jobs.FinalizeDocument
End Try
End Function
Private Function AddImageAnnotation(pAnnotation As Annotation, pAttachments As Dictionary(Of String, Attachment)) As Boolean
Private Function AddImageAnnotation(pidX As Integer, pAnnotation As Annotation, pAttachments As Dictionary(Of String, Attachment)) As Boolean
Try
Dim oAttachment = pAttachments.Where(Function(a) a.Key = pAnnotation.imageAttachmentId).
SingleOrDefault()
' Convert pixels to Inches
Dim oBounds = pAnnotation.bbox.Select(AddressOf ToInches).ToList()
Dim oX = oBounds.Item(0)
Dim oY = oBounds.Item(1)
Dim oWidth = oBounds.Item(2)
Dim oHeight = oBounds.Item(3)
If pidX = 1 Then
If Annotationheight_min = 0 Then
Annotationheight_min = oHeight
Annotationheight_min = oHeight
End If
End If
Manager.SelectPage(pAnnotation.pageIndex + 1)
Manager.AddEmbeddedImageAnnotFromBase64(oAttachment.Value.binary, oX, oY, oWidth, oHeight)

View File

@@ -152,6 +152,9 @@ Public Class ElementModel
pElement.Id = GetElementId(pElement)
Return True
Else
Dim filledSql As String = GetFilledSql(oCommand)
Logger.Warn(filledSql)
Return False
End If
@@ -161,6 +164,26 @@ Public Class ElementModel
End Try
End Function
Function GetFilledSql(command As SqlCommand) As String
Dim oSql As String = command.CommandText
For Each oParam As SqlParameter In command.Parameters
Dim oValue As String
If oParam.Value Is Nothing OrElse oParam.Value Is DBNull.Value Then
oValue = "NULL"
ElseIf TypeOf oParam.Value Is String OrElse TypeOf oParam.Value Is Date Then
oValue = $"'{oParam.Value.ToString().Replace("'", "''")}'"
ElseIf TypeOf oParam.Value Is Boolean Then
oValue = If(CBool(oParam.Value), "1", "0")
Else
oValue = oParam.Value.ToString()
End If
oSql = oSql.Replace("@" & oParam.ParameterName, oValue)
Next
Return oSql
End Function
Public Function Update(pElement As DocumentReceiverElement) As Boolean
Try
Dim oSql = "UPDATE [dbo].[TBSIG_DOCUMENT_RECEIVER_ELEMENT]

View File

@@ -1,5 +1,4 @@
Imports EnvelopeGenerator.CommonServices.EnvelopeGenerator.Domain.Entities
Imports EnvelopeGenerator.Domain
Imports EnvelopeGenerator.Domain
Imports EnvelopeGenerator.Domain.Entities
Public Class EmailData
Public Property EmailAdress As String = ""
@@ -29,7 +28,7 @@ Public Class EmailData
''' <param name="pEnvelope"></param>
''' <param name="pReceiver"></param>
''' <param name="pStatus"></param>
Public Sub New(pEnvelope As Entities.Envelope, pReceiver As ReceiverVM, pStatus As Constants.EnvelopeStatus)
Public Sub New(pEnvelope As Entities.Envelope, pReceiver As Receiver, pStatus As Constants.EnvelopeStatus)
EmailAdress = pReceiver.EmailAddress
EmailSubject = String.Empty
EmailType = pStatus

View File

@@ -49,22 +49,22 @@ Public Class EnvelopeModel
.UseAccessCode = pRow.ItemEx("USE_ACCESS_CODE", False),
.FinalEmailToCreator = ObjectEx.ToEnum(Of FinalEmailType)(pRow.ItemEx("FINAL_EMAIL_TO_CREATOR", FinalEmailType.No.ToString())),
.FinalEmailToReceivers = ObjectEx.ToEnum(Of FinalEmailType)(pRow.ItemEx("FINAL_EMAIL_TO_RECEIVERS", FinalEmailType.No.ToString())),
.TfaEnabled = pRow.ItemEx("TFA_ENABLED", False)
.TFA_Enabled = pRow.ItemEx("TFA_Enabled", False)
}
Dim oDOC_RESULT = pRow.Item("DOC_RESULT")
If Not IsDBNull(oDOC_RESULT) Then
Dim oByte As Byte() = DirectCast(pRow.Item("DOC_RESULT"), Byte())
If Not IsNothing(oByte) Then
oEnvelope.DocResult = oByte
oEnvelope.DOC_RESULT = oByte
End If
Else
oEnvelope.DocResult = Nothing
oEnvelope.DOC_RESULT = Nothing
End If
oEnvelope.User = UserModel.SelectUser(oEnvelope.UserId)
oEnvelope.Receivers = ReceiverModel.ListEnvelopeReceivers(oEnvelope.Id)
oEnvelope.Documents = DocumentModel.List(oEnvelope.Id)
oEnvelope.History = HistoryModel.List(oEnvelope.Id)
oEnvelope.Type = EnvelopeTypeModel.GetById(oEnvelope.EnvelopeTypeId)
oEnvelope.EnvelopeType = EnvelopeTypeModel.GetById(oEnvelope.EnvelopeTypeId)
Return oEnvelope
End Function
@@ -76,9 +76,15 @@ Public Class EnvelopeModel
End Function
Public Function GetByUuid(pEnvelopeUuid As String) As Envelope
Dim oSql = $"SELECT * FROM [dbo].[TBSIG_ENVELOPE] WHERE ENVELOPE_UUID = '{pEnvelopeUuid}'"
Dim oTable = Database.GetDatatable(oSql)
Return ToEnvelope(oTable)
Try
Dim oSql = $"SELECT * FROM [dbo].[TBSIG_ENVELOPE] WHERE ENVELOPE_UUID = '{pEnvelopeUuid}'"
Dim oTable = Database.GetDatatable(oSql)
Return ToEnvelope(oTable)
Catch ex As Exception
Logger.Error(ex)
Return Nothing
End Try
End Function
Public Function GetById(pEnvelopeId As Integer) As Envelope
@@ -185,7 +191,7 @@ Public Class EnvelopeModel
oSql += " [SEND_REMINDER_EMAILS] = @SEND_REMINDER_EMAILS, "
oSql += " [USE_ACCESS_CODE] = @USE_ACCESS_CODE, "
oSql += " [CHANGED_WHEN] = GETDATE(), "
oSql += " [TfaEnabled] = @TfaEnabled"
oSql += " [TFA_Enabled] = @TFA_Enabled"
oSql += " WHERE GUID = @ID AND USER_ID = @USER_ID"
@@ -210,7 +216,7 @@ Public Class EnvelopeModel
oCommand.Parameters.Add("REMINDER_INTERVAL_DAYS", SqlDbType.Int).Value = pEnvelope.ReminderIntervalDays
oCommand.Parameters.Add("SEND_REMINDER_EMAILS", SqlDbType.Bit).Value = pEnvelope.SendReminderEmails
oCommand.Parameters.Add("USE_ACCESS_CODE", SqlDbType.Bit).Value = pEnvelope.UseAccessCode
oCommand.Parameters.Add("TFA_ENABLED", SqlDbType.Bit).Value = pEnvelope.TfaEnabled
oCommand.Parameters.Add("TFA_ENABLED", SqlDbType.Bit).Value = pEnvelope.TFA_Enabled
Return Database.ExecuteNonQuery(oCommand, pTransaction)
Catch ex As Exception

View File

@@ -23,7 +23,7 @@ Public Class EnvelopeTypeModel
.FinalEmailToReceivers = pRow.ItemEx("FINAL_EMAIL_TO_RECEIVERS", 0),
.ContractType = pRow.ItemEx("CONTRACT_TYPE", 0),
.CertificationType = pRow.ItemEx("CERTIFICATION_TYPE", 0),
.TFA_Enabled = pRow.ItemEx("TfaEnabled", 0)
.TFA_Enabled = pRow.ItemEx("TFA_Enabled", 0)
}
End Function

Some files were not shown because too many files have changed in this diff Show More