Compare commits
115 Commits
c746612d80
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| b096cb0e00 | |||
| efc9dce2fe | |||
| 0fbaaf0b92 | |||
| 24613bd598 | |||
| 78924e3469 | |||
| fdece11e1d | |||
| edf0c9d87f | |||
| 4fc00e02e7 | |||
| e65531db57 | |||
| 7b5cf30baf | |||
| 43a6837b9e | |||
| 530bb7055a | |||
| f123d9e785 | |||
| 37c370266e | |||
| 262798f256 | |||
| 7e16f9612b | |||
| 97c6190cba | |||
| f110772700 | |||
| e6ee3098a5 | |||
| e43386ef4f | |||
| d2e8a01068 | |||
| 712fdb61d3 | |||
| ee89a794ea | |||
| 5c0345a810 | |||
| d9a55ec0eb | |||
| 2feebf264b | |||
| 5853868de2 | |||
| 03a3d0a116 | |||
| 3a21b3ba94 | |||
| 224d029c18 | |||
| 6eb92a31a6 | |||
| d0ddf00fc2 | |||
| e13413c7fc | |||
| 6c9b8ad3a8 | |||
| 93d9aa0742 | |||
| fd2b21a73c | |||
| deae4d2acc | |||
| 55140846ba | |||
| 9c2de46253 | |||
| fa56f2059a | |||
| bb5175347c | |||
| 85033ce667 | |||
| c8bd2a348d | |||
| b5c9c8da6c | |||
| abd3c23f8c | |||
| 9d4806bef7 | |||
| 48b2fc0eca | |||
| 18fbc2100f | |||
| 13784cd595 | |||
| 67e435c3fa | |||
| 3c80bc4d26 | |||
| 22895e259a | |||
| f4d2b65943 | |||
| 17da3ea91e | |||
| 621f9333a4 | |||
| 34b184b057 | |||
| c77beb88df | |||
| 35b6093169 | |||
| 23f2056421 | |||
| 2b580f5e3d | |||
| 89a4e789f1 | |||
| 94658b0d9b | |||
| 6ad76fa4b0 | |||
| 31933f5568 | |||
| 47c4f33dfc | |||
| 26d41d9178 | |||
| 238c938ce7 | |||
| 5fb7b5a79e | |||
| 2c8b65d576 | |||
| e1f24249a9 | |||
| f6dc454193 | |||
| b65098fafb | |||
| c6fe7722b4 | |||
| 2065102fb3 | |||
| 858b748e65 | |||
| 25c03b350b | |||
| ed9ea0ac54 | |||
| 18c1adb68a | |||
| ec8b9adb9c | |||
| 4a10db0865 | |||
| ceb2860883 | |||
| 11e72bac53 | |||
| 638b734648 | |||
| eec1b4926b | |||
| d7611a6b59 | |||
| 0cf603fc79 | |||
| e3d2225a44 | |||
| 595bbf3f25 | |||
| ee7d01ed7f | |||
| 85104511fd | |||
| 1b87528cca | |||
| 2913514da8 | |||
| ce7e70162b | |||
| 5e00b6e9ec | |||
| f0b4c8d00c | |||
| abf616c115 | |||
| 42585e1f2c | |||
| ff10fc6b0a | |||
| 7222f7e9a7 | |||
| d913b949e0 | |||
| a35e05d016 | |||
| 8aabc3e233 | |||
| 8b7f99eb76 | |||
| 91e90b322b | |||
| 74e55e9206 | |||
| fc5ad7ea3c | |||
| ff5582c9b5 | |||
| 6523cca945 | |||
| 28d0b6f81c | |||
| 5df38754cb | |||
| c2b7579717 | |||
| ae1ecbc15f | |||
| 4dcfe67038 | |||
| c812d4dc1f | |||
| 8d27718062 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -370,4 +370,3 @@ FodyWeavers.xsd
|
|||||||
/EnvelopeGenerator.Server/EnvelopeGenerator.Server/publish-output
|
/EnvelopeGenerator.Server/EnvelopeGenerator.Server/publish-output
|
||||||
/EnvelopeGenerator.Server/EnvelopeGenerator.Server/tekh_softHSM_test.md
|
/EnvelopeGenerator.Server/EnvelopeGenerator.Server/tekh_softHSM_test.md
|
||||||
/ignore/EnvelopeGenerator.Form
|
/ignore/EnvelopeGenerator.Form
|
||||||
/EnvelopeGenerator.Server/EnvelopeGenerator.Server/appsettings.Secrets.json
|
|
||||||
|
|||||||
@@ -287,6 +287,7 @@ Manual testing workflow:
|
|||||||
- Audit `EnvelopeGenerator.Server/EnvelopeGenerator.Server.Client/Services/` for unnecessary request/payload remapping and remove redundant mappings where direct request DTO usage is safe; review client HTTP methods end-to-end for similar avoidable transformation layers.
|
- Audit `EnvelopeGenerator.Server/EnvelopeGenerator.Server.Client/Services/` for unnecessary request/payload remapping and remove redundant mappings where direct request DTO usage is safe; review client HTTP methods end-to-end for similar avoidable transformation layers.
|
||||||
- Centralize dependency injection registrations into dedicated extension methods/modules (especially server + client service registrations in `Program.cs`) to reduce startup composition sprawl and improve maintainability.
|
- Centralize dependency injection registrations into dedicated extension methods/modules (especially server + client service registrations in `Program.cs`) to reduce startup composition sprawl and improve maintainability.
|
||||||
- Refactor `EnvelopeGenerator.Server/EnvelopeGenerator.Server/Controllers/PdfRenderController.cs` + matching client service contract to remove JSON/base64 `byte[]` transport for PDF rendering; prefer binary streaming (`application/octet-stream` or multipart), avoid `data:` URL bloat where possible, and validate end-to-end memory/latency behavior with large PDFs.
|
- Refactor `EnvelopeGenerator.Server/EnvelopeGenerator.Server/Controllers/PdfRenderController.cs` + matching client service contract to remove JSON/base64 `byte[]` transport for PDF rendering; prefer binary streaming (`application/octet-stream` or multipart), avoid `data:` URL bloat where possible, and validate end-to-end memory/latency behavior with large PDFs.
|
||||||
|
- Move sender PDF image editor initial zoom from hardcoded value to Options pattern configuration (bind from `appsettings.json` and inject via `IOptions`/`IOptionsMonitor`) so default zoom (for example `%180`) is environment-configurable.
|
||||||
- Establish a DevExpress toast-based notification architecture using `DxToastProvider` + `IToastNotificationService` (tab/page-scoped provider strategy, standardized `ToastOptions` factory, and severity-to-style mapping) so sender/receiver flows show consistent, non-duplicated, actionable feedback.
|
- Establish a DevExpress toast-based notification architecture using `DxToastProvider` + `IToastNotificationService` (tab/page-scoped provider strategy, standardized `ToastOptions` factory, and severity-to-style mapping) so sender/receiver flows show consistent, non-duplicated, actionable feedback.
|
||||||
- Eliminate manual property-by-property request→domain mapping drift (example: `CreateEnvelopeCommandHandler`) by introducing a standardized mapping policy (AutoMapper/profile conventions or reflection/source-generator based mapper) and enforcing it across envelope workflows; this needs to be solved in the shared company Core library level so all services get the same guardrails by default.
|
- Eliminate manual property-by-property request→domain mapping drift (example: `CreateEnvelopeCommandHandler`) by introducing a standardized mapping policy (AutoMapper/profile conventions or reflection/source-generator based mapper) and enforcing it across envelope workflows; this needs to be solved in the shared company Core library level so all services get the same guardrails by default.
|
||||||
- P1 security workstream: remove dynamic SQL string composition/interpolation from active save/create/update paths (`string.Format`, `$"...{input}..."`, `ToSqlParam`) and migrate to parameterized queries only; treat this as a potential SQL injection vulnerability (stability + security risk), execute repo-wide audit, and add CI guardrails to block reintroduction.
|
- P1 security workstream: remove dynamic SQL string composition/interpolation from active save/create/update paths (`string.Format`, `$"...{input}..."`, `ToSqlParam`) and migrate to parameterized queries only; treat this as a potential SQL injection vulnerability (stability + security risk), execute repo-wide audit, and add CI guardrails to block reintroduction.
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
namespace EnvelopeGenerator.Application.Common.Configurations;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class SignatureFieldParams
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public double Width { get; init; } = 1.77;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public double Height { get; init; } = 1.96;
|
||||||
|
}
|
||||||
@@ -59,11 +59,6 @@ public record EnvelopeDto : IEnvelope
|
|||||||
[TemplatePlaceholder("[DOCUMENT_TITLE]")]
|
[TemplatePlaceholder("[DOCUMENT_TITLE]")]
|
||||||
public string Title { get; set; } = string.Empty;
|
public string Title { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public int? ContractType { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Default value is 'de-DE'
|
/// Default value is 'de-DE'
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -72,7 +67,7 @@ public record EnvelopeDto : IEnvelope
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? EnvelopeTypeId { get; set; }
|
public EnvelopeType? Type { get; set; }
|
||||||
|
|
||||||
// TODO: use ReadAndConfirm property name
|
// TODO: use ReadAndConfirm property name
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -84,17 +79,12 @@ public record EnvelopeDto : IEnvelope
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? CertificationType { get; set; }
|
public FinalEmailType? FinalEmailToCreator { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? FinalEmailToCreator { get; set; }
|
public FinalEmailType? FinalEmailToReceivers { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public int? FinalEmailToReceivers { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -139,7 +129,7 @@ public record EnvelopeDto : IEnvelope
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public EnvelopeType? EnvelopeType { get; set; }
|
public EnvelopeTypeDefaultsDto? Defaults { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -1,14 +1,16 @@
|
|||||||
namespace EnvelopeGenerator.Application.Common.Dto;
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Common.Dto;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Data Transfer Object representing a type of envelope with its configuration settings.
|
/// Data Transfer Object representing a type of envelope with its configuration settings.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class EnvelopeTypeDto
|
public class EnvelopeTypeDefaultsDto
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the unique identifier of the envelope type.
|
/// Gets or sets the unique identifier of the envelope type.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int Id { get; set; }
|
public EnvelopeType Id { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the title of the envelope type.
|
/// Gets or sets the title of the envelope type.
|
||||||
@@ -25,11 +27,6 @@ public class EnvelopeTypeDto
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public int? ExpiresDays { get; set; }
|
public int? ExpiresDays { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the certification type identifier.
|
|
||||||
/// </summary>
|
|
||||||
public int? CertificationType { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets a value indicating whether an access code is required.
|
/// Gets or sets a value indicating whether an access code is required.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -38,12 +35,12 @@ public class EnvelopeTypeDto
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the final email template ID to be sent to the creator.
|
/// Gets or sets the final email template ID to be sent to the creator.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? FinalEmailToCreator { get; set; }
|
public FinalEmailType? FinalEmailToCreator { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the final email template ID to be sent to the receivers.
|
/// Gets or sets the final email template ID to be sent to the receivers.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? FinalEmailToReceivers { get; set; }
|
public FinalEmailType? FinalEmailToReceivers { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the timestamp when this envelope type was added.
|
/// Gets or sets the timestamp when this envelope type was added.
|
||||||
@@ -74,9 +71,4 @@ public class EnvelopeTypeDto
|
|||||||
/// Gets or sets the interval in days between reminder emails.
|
/// Gets or sets the interval in days between reminder emails.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? ReminderIntervalDays { get; set; }
|
public int? ReminderIntervalDays { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the contract type associated with the envelope type.
|
|
||||||
/// </summary>
|
|
||||||
public int? ContractType { get; set; }
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
namespace EnvelopeGenerator.Application.Common.Interfaces;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public interface IRequestContext
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
string? Origin { get; }
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using DigitalData.Core.Abstraction.Application.Repository;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Common.Interfaces.Repositories;
|
namespace EnvelopeGenerator.Application.Common.Interfaces.Repositories;
|
||||||
@@ -7,6 +8,6 @@ namespace EnvelopeGenerator.Application.Common.Interfaces.Repositories;
|
|||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Obsolete("Use IRepository")]
|
[Obsolete("Use IRepository")]
|
||||||
public interface IEnvelopeTypeRepository : ICRUDRepository<EnvelopeType, int>
|
public interface IEnvelopeTypeRepository : ICRUDRepository<EnvelopeTypeDefaults, EnvelopeType>
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
using DigitalData.Core.Abstraction.Application;
|
using DigitalData.Core.Abstraction.Application;
|
||||||
using EnvelopeGenerator.Application.Common.Dto;
|
using EnvelopeGenerator.Application.Common.Dto;
|
||||||
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Common.Interfaces.Services;
|
namespace EnvelopeGenerator.Application.Common.Interfaces.Services;
|
||||||
@@ -8,6 +9,6 @@ namespace EnvelopeGenerator.Application.Common.Interfaces.Services;
|
|||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Obsolete("Use MediatR")]
|
[Obsolete("Use MediatR")]
|
||||||
public interface IEnvelopeTypeService : IBasicCRUDService<EnvelopeTypeDto, EnvelopeType, int>
|
public interface IEnvelopeTypeService : IBasicCRUDService<EnvelopeTypeDefaultsDto, EnvelopeTypeDefaults, EnvelopeType>
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Common.Interfaces.Services.Notification;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Payload for <see cref="EmailTemplateType.DocumentAccessCodeReceived"/> template.
|
||||||
|
/// </summary>
|
||||||
|
public record DocumentAccessCodeReceivedNotification : EnvelopeNotificationBase
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Replaces <c>[DOCUMENT_TITLE]</c> in mail subject/body.
|
||||||
|
/// </summary>
|
||||||
|
public required string DocumentTitle { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Replaces <c>[NAME_RECEIVER]</c> in mail body.
|
||||||
|
/// </summary>
|
||||||
|
public required string NameReceiver { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Replaces <c>[NAME_SENDER]</c> in mail body.
|
||||||
|
/// </summary>
|
||||||
|
public required string NameSender { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Determines <c>[SIGNATURE_TYPE]</c> text in mail body.
|
||||||
|
/// </summary>
|
||||||
|
public required bool IsReadAndConfirm { private get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Replaces <c>[SIGNATURE_TYPE]</c> in mail body.
|
||||||
|
/// </summary>
|
||||||
|
public string SignatureType => IsReadAndConfirm ? "Signieren" : "Lesen und bestätigen";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Replaces <c>[DOCUMENT_ACCESS_CODE]</c> in mail body.
|
||||||
|
/// </summary>
|
||||||
|
public required string DocumentAccessCode { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Replaces <c>[NAME_PORTAL]</c> in mail body.
|
||||||
|
/// </summary>
|
||||||
|
public string NamePortal { get; init; } = "signFLOW Portal";
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override EmailTemplateType GetTemplateType() => EmailTemplateType.DocumentAccessCodeReceived;
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Common.Interfaces.Services.Notification;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Payload for <see cref="EmailTemplateType.DocumentCompleted"/> template.
|
||||||
|
/// </summary>
|
||||||
|
public record DocumentCompletedNotification : EnvelopeNotificationBase
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Replaces <c>[DOCUMENT_TITLE]</c> in mail subject/body.
|
||||||
|
/// </summary>
|
||||||
|
public required string DocumentTitle { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Replaces <c>[NAME_RECEIVER]</c> in mail body.
|
||||||
|
/// </summary>
|
||||||
|
public required string NameReceiver { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Replaces <c>[NAME_PORTAL]</c> in mail body.
|
||||||
|
/// </summary>
|
||||||
|
public string NamePortal { get; init; } = "signFLOW Portal";
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override EmailTemplateType GetTemplateType() => EmailTemplateType.DocumentCompleted;
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Common.Interfaces.Services.Notification;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Payload for <see cref="EmailTemplateType.DocumentDeleted"/> template.
|
||||||
|
/// </summary>
|
||||||
|
public record DocumentDeletedNotification : EnvelopeNotificationBase
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Replaces <c>[DOCUMENT_TITLE]</c> in mail subject/body.
|
||||||
|
/// </summary>
|
||||||
|
public required string DocumentTitle { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Replaces <c>[NAME_RECEIVER]</c> in mail body.
|
||||||
|
/// </summary>
|
||||||
|
public required string NameReceiver { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Replaces <c>[NAME_SENDER]</c> in mail body.
|
||||||
|
/// </summary>
|
||||||
|
public required string NameSender { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Replaces <c>[REASON]</c> in mail body.
|
||||||
|
/// </summary>
|
||||||
|
public required string Reason { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Replaces <c>[NAME_PORTAL]</c> in mail body.
|
||||||
|
/// </summary>
|
||||||
|
public string NamePortal { get; init; } = "signFLOW Portal";
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override EmailTemplateType GetTemplateType() => EmailTemplateType.DocumentDeleted;
|
||||||
|
}
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
using EnvelopeGenerator.Application.Common.Extensions;
|
||||||
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Common.Interfaces.Services.Notification;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public record DocumentReceivedNotification : EnvelopeNotificationBase
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public required string DocumentTitle { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public required string NameReceiver { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public required string NameSender { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// [SIGNATURE_TYPE]
|
||||||
|
/// </summary>
|
||||||
|
public required bool IsReadAndConfirm { private get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string SignatureType => IsReadAndConfirm ? "Signieren" : "Lesen und bestätigen";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public required bool AdvancedSignature { private get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string DocumentProcess => AdvancedSignature ? " und elektronisch unterschreiben" : string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public required Uri Origin { private get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public required string EnvelopeUuid { private get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public required string ReceiverSignature { private get; init; }
|
||||||
|
|
||||||
|
private Uri EnvelopeURL => new(Origin, $"Envelope/{(EnvelopeUuid, ReceiverSignature).ToEnvelopeKey()}");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string LinkToDocument => EnvelopeURL.AbsoluteUri;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string LinkToDocumentText
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
var urlText = EnvelopeURL.ToString();
|
||||||
|
return $"{urlText[..Math.Min(urlText.Length, 40)]}..";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public required string Message { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string NamePortal { get; set; } = "signFLOW Portal";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public override EmailTemplateType GetTemplateType()
|
||||||
|
{
|
||||||
|
return EmailTemplateType.DocumentReceived;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Common.Interfaces.Services.Notification;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Payload for <see cref="EmailTemplateType.DocumentRejected_ADM"/> template.
|
||||||
|
/// </summary>
|
||||||
|
public record DocumentRejectedAdmNotification : EnvelopeNotificationBase
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Replaces <c>[DOCUMENT_TITLE]</c> in mail subject/body.
|
||||||
|
/// </summary>
|
||||||
|
public required string DocumentTitle { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Replaces <c>[NAME_SENDER]</c> in mail body.
|
||||||
|
/// </summary>
|
||||||
|
public required string NameSender { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Replaces <c>[NAME_RECEIVER]</c> in mail body.
|
||||||
|
/// </summary>
|
||||||
|
public required string NameReceiver { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Replaces <c>[REASON]</c> in mail body.
|
||||||
|
/// </summary>
|
||||||
|
public required string Reason { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Replaces <c>[NAME_PORTAL]</c> in mail body.
|
||||||
|
/// </summary>
|
||||||
|
public string NamePortal { get; init; } = "signFLOW Portal";
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override EmailTemplateType GetTemplateType() => EmailTemplateType.DocumentRejected_ADM;
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Common.Interfaces.Services.Notification;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Payload for <see cref="EmailTemplateType.DocumentRejected_REC_2"/> template.
|
||||||
|
/// </summary>
|
||||||
|
public record DocumentRejectedRec2Notification : EnvelopeNotificationBase
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Replaces <c>[DOCUMENT_TITLE]</c> in mail subject/body.
|
||||||
|
/// </summary>
|
||||||
|
public required string DocumentTitle { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Replaces <c>[NAME_RECEIVER]</c> in mail body.
|
||||||
|
/// </summary>
|
||||||
|
public required string NameReceiver { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Replaces <c>[NAME_SENDER]</c> in mail body.
|
||||||
|
/// </summary>
|
||||||
|
public required string NameSender { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Replaces <c>[NAME_PORTAL]</c> in mail body.
|
||||||
|
/// </summary>
|
||||||
|
public string NamePortal { get; init; } = "signFLOW Portal";
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override EmailTemplateType GetTemplateType() => EmailTemplateType.DocumentRejected_REC_2;
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Common.Interfaces.Services.Notification;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Payload for <see cref="EmailTemplateType.DocumentRejected_REC"/> template.
|
||||||
|
/// </summary>
|
||||||
|
public record DocumentRejectedRecNotification : EnvelopeNotificationBase
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Replaces <c>[DOCUMENT_TITLE]</c> in mail subject/body.
|
||||||
|
/// </summary>
|
||||||
|
public required string DocumentTitle { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Replaces <c>[NAME_RECEIVER]</c> in mail body.
|
||||||
|
/// </summary>
|
||||||
|
public required string NameReceiver { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Replaces <c>[NAME_SENDER]</c> in mail body.
|
||||||
|
/// </summary>
|
||||||
|
public required string NameSender { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Replaces <c>[NAME_PORTAL]</c> in mail body.
|
||||||
|
/// </summary>
|
||||||
|
public string NamePortal { get; init; } = "signFLOW Portal";
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override EmailTemplateType GetTemplateType() => EmailTemplateType.DocumentRejected_REC;
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
using EnvelopeGenerator.Application.Common.Extensions;
|
||||||
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Common.Interfaces.Services.Notification;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Payload for <see cref="EmailTemplateType.DocumentShared"/> template.
|
||||||
|
/// </summary>
|
||||||
|
public record DocumentSharedNotification : EnvelopeNotificationBase
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Replaces <c>[DOCUMENT_TITLE]</c> in mail subject/body.
|
||||||
|
/// </summary>
|
||||||
|
public required string DocumentTitle { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Replaces <c>[NAME_RECEIVER]</c> in mail body.
|
||||||
|
/// </summary>
|
||||||
|
public required string NameReceiver { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Base host used to build document link placeholders.
|
||||||
|
/// </summary>
|
||||||
|
public required Uri Origin { private get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Read-only share identifier used to build link placeholders.
|
||||||
|
/// </summary>
|
||||||
|
public required long ReadOnlyId { private get; init; }
|
||||||
|
|
||||||
|
private Uri EnvelopeUrl => new(Origin, $"EnvelopeKey/{ReadOnlyId.ToEnvelopeKey()}");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Replaces <c>[LINK_TO_DOCUMENT]</c> in mail body.
|
||||||
|
/// </summary>
|
||||||
|
public string LinkToDocument => EnvelopeUrl.AbsoluteUri;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Replaces <c>[LINK_TO_DOCUMENT_TEXT]</c> in mail body.
|
||||||
|
/// </summary>
|
||||||
|
public string LinkToDocumentText
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
var urlText = EnvelopeUrl.ToString();
|
||||||
|
return $"{urlText[..Math.Min(urlText.Length, 40)]}..";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Replaces <c>[NAME_PORTAL]</c> in mail body.
|
||||||
|
/// </summary>
|
||||||
|
public string NamePortal { get; init; } = "signFLOW Portal";
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override EmailTemplateType GetTemplateType() => EmailTemplateType.DocumentShared;
|
||||||
|
}
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
namespace EnvelopeGenerator.Application.Common.Interfaces.Services.Notification;
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Common.Interfaces.Services.Notification;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public record DocumentSignedNotification
|
public record DocumentSignedNotification : EnvelopeNotificationBase
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -23,7 +25,27 @@ public record DocumentSignedNotification
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public required byte[] Attachment { get; init; }
|
public required bool IsReadAndConfirm { private get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string ReceiverAction => IsReadAndConfirm ? "bestätigt" : "unterschrieben";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string FinalStatus => IsReadAndConfirm ? "Lesebestätigung" : "Signatur";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string FinalAction => IsReadAndConfirm ? "Empfänger bestätigt" : "Vertragspartner unterzeichnet";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public override EmailTemplateType GetTemplateType() => EmailTemplateType.DocumentSigned;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Common.Interfaces.Services.Notification;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public abstract record EnvelopeNotificationBase
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public abstract EmailTemplateType GetTemplateType();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public IReadOnlyList<(string FileName, byte[] Content)>? Attachments { get; init; }
|
||||||
|
}
|
||||||
@@ -8,9 +8,11 @@ public interface IEnvelopeNotificationService
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="email"></param>
|
/// <typeparam name="TEnvelopeNotificationBase"></typeparam>
|
||||||
/// <param name="documentSigned"></param>
|
/// <param name="receiverEmail"></param>
|
||||||
|
/// <param name="notification"></param>
|
||||||
/// <param name="cancel"></param>
|
/// <param name="cancel"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public Task Notify(string email, DocumentSignedNotification documentSigned, CancellationToken cancel = default);
|
public Task Notify<TEnvelopeNotificationBase>(string receiverEmail, TEnvelopeNotificationBase notification, CancellationToken cancel = default)
|
||||||
|
where TEnvelopeNotificationBase : EnvelopeNotificationBase;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Common.Interfaces.Services.Notification;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Payload for <see cref="EmailTemplateType.TotpSecret"/> template.
|
||||||
|
/// </summary>
|
||||||
|
public record TotpSecretNotification : EnvelopeNotificationBase
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Replaces <c>[TFA_EXPIRATION]</c> in mail body.
|
||||||
|
/// </summary>
|
||||||
|
public required string TfaExpiration { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Replaces <c>[TFA_QR_CODE]</c> in mail body.
|
||||||
|
/// </summary>
|
||||||
|
public required string TfaQrCode { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Replaces <c>[NAME_PORTAL]</c> in mail body.
|
||||||
|
/// </summary>
|
||||||
|
public string NamePortal { get; init; } = "signFLOW Portal";
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override EmailTemplateType GetTemplateType() => EmailTemplateType.TotpSecret;
|
||||||
|
}
|
||||||
@@ -30,14 +30,14 @@ public class MappingProfile : Profile
|
|||||||
CreateMap<EmailTemplate, EmailTemplateDto>();
|
CreateMap<EmailTemplate, EmailTemplateDto>();
|
||||||
CreateMap<Envelope, EnvelopeDto>()
|
CreateMap<Envelope, EnvelopeDto>()
|
||||||
.ForMember(dest => dest.EnvelopeTypeTitle,
|
.ForMember(dest => dest.EnvelopeTypeTitle,
|
||||||
opt => opt.MapFrom(src => src.Type != null ? src.Type.Title : null));
|
opt => opt.MapFrom(src => src.Defaults != null ? src.Defaults.Title : null));
|
||||||
CreateMap<Document, DocumentDto>();
|
CreateMap<Document, DocumentDto>();
|
||||||
CreateMap<Document, DocumentDetailsDto>();
|
CreateMap<Document, DocumentDetailsDto>();
|
||||||
CreateMap<History, HistoryDto>().ForMember(dest => dest.ActionDate, opt => opt.MapFrom(src => src.ChangedWhen));
|
CreateMap<History, HistoryDto>().ForMember(dest => dest.ActionDate, opt => opt.MapFrom(src => src.ChangedWhen));
|
||||||
CreateMap<History, HistoryCreateDto>().ForMember(dest => dest.ActionDate, opt => opt.MapFrom(src => src.ChangedWhen));
|
CreateMap<History, HistoryCreateDto>().ForMember(dest => dest.ActionDate, opt => opt.MapFrom(src => src.ChangedWhen));
|
||||||
CreateMap<EnvelopeReceiver, EnvelopeReceiverDto>();
|
CreateMap<EnvelopeReceiver, EnvelopeReceiverDto>();
|
||||||
CreateMap<EnvelopeReceiver, EnvelopeReceiverSecretDto>();
|
CreateMap<EnvelopeReceiver, EnvelopeReceiverSecretDto>();
|
||||||
CreateMap<EnvelopeType, EnvelopeTypeDto>();
|
CreateMap<EnvelopeTypeDefaults, EnvelopeTypeDefaultsDto>();
|
||||||
CreateMap<Receiver, ReceiverDto>();
|
CreateMap<Receiver, ReceiverDto>();
|
||||||
CreateMap<EnvelopeReceiverReadOnly, EnvelopeReceiverReadOnlyDto>();
|
CreateMap<EnvelopeReceiverReadOnly, EnvelopeReceiverReadOnlyDto>();
|
||||||
CreateMap<ElementAnnotation, AnnotationDto>();
|
CreateMap<ElementAnnotation, AnnotationDto>();
|
||||||
@@ -55,7 +55,7 @@ public class MappingProfile : Profile
|
|||||||
CreateMap<HistoryDto, History>().ForMember(dest => dest.ChangedWhen, opt => opt.MapFrom(src => src.ActionDate));
|
CreateMap<HistoryDto, History>().ForMember(dest => dest.ChangedWhen, opt => opt.MapFrom(src => src.ActionDate));
|
||||||
CreateMap<HistoryCreateDto, History>().ForMember(dest => dest.ChangedWhen, opt => opt.MapFrom(src => src.ActionDate));
|
CreateMap<HistoryCreateDto, History>().ForMember(dest => dest.ChangedWhen, opt => opt.MapFrom(src => src.ActionDate));
|
||||||
CreateMap<EnvelopeReceiverDto, EnvelopeReceiver>();
|
CreateMap<EnvelopeReceiverDto, EnvelopeReceiver>();
|
||||||
CreateMap<EnvelopeTypeDto, EnvelopeType>();
|
CreateMap<EnvelopeTypeDefaultsDto, EnvelopeTypeDefaults>();
|
||||||
CreateMap<ReceiverDto, Receiver>().ForMember(rcv => rcv.EnvelopeReceivers, rcvReadDto => rcvReadDto.Ignore());
|
CreateMap<ReceiverDto, Receiver>().ForMember(rcv => rcv.EnvelopeReceivers, rcvReadDto => rcvReadDto.Ignore());
|
||||||
CreateMap<EnvelopeReceiverReadOnlyCreateDto, EnvelopeReceiverReadOnly>();
|
CreateMap<EnvelopeReceiverReadOnlyCreateDto, EnvelopeReceiverReadOnly>();
|
||||||
CreateMap<EnvelopeReceiverReadOnlyUpdateDto, EnvelopeReceiverReadOnly>();
|
CreateMap<EnvelopeReceiverReadOnlyUpdateDto, EnvelopeReceiverReadOnly>();
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
using DigitalData.EmailProfilerDispatcher.Abstraction.Entities;
|
using DigitalData.EmailProfilerDispatcher.Abstraction.Entities;
|
||||||
using EnvelopeGenerator.Application.Common.Configurations;
|
using EnvelopeGenerator.Application.Common.Configurations;
|
||||||
using EnvelopeGenerator.Application.Common.Extensions;
|
using EnvelopeGenerator.Application.Common.Extensions;
|
||||||
|
using EnvelopeGenerator.Application.Common.Notifications.EnvelopeDeleted;
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
@@ -96,6 +97,10 @@ public abstract class SendMailHandler<TNotification> : INotificationHandler<TNot
|
|||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public virtual async Task Handle(TNotification notification, CancellationToken cancel)
|
public virtual async Task Handle(TNotification notification, CancellationToken cancel)
|
||||||
{
|
{
|
||||||
|
// do not send email if the envelope is deleted and the status is less than or equal to EnvelopeSaved
|
||||||
|
if (notification is EnvelopeDeletedNotification delNot && delNot.Envelope.Status <= EnvelopeStatus.EnvelopeSaved)
|
||||||
|
return;
|
||||||
|
|
||||||
var placeHolders = CreatePlaceHolders(notification);
|
var placeHolders = CreatePlaceHolders(notification);
|
||||||
|
|
||||||
var temp = await TempRepo
|
var temp = await TempRepo
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ using EnvelopeGenerator.Application.DocReceiverElements.Commands;
|
|||||||
using EnvelopeGenerator.Application.DocReceiverElements.Behaviors;
|
using EnvelopeGenerator.Application.DocReceiverElements.Behaviors;
|
||||||
using EnvelopeGenerator.Application.Common.Behaviors;
|
using EnvelopeGenerator.Application.Common.Behaviors;
|
||||||
using FluentValidation;
|
using FluentValidation;
|
||||||
|
using EnvelopeGenerator.Application.EnvelopeReceivers.Commands;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application;
|
namespace EnvelopeGenerator.Application;
|
||||||
|
|
||||||
@@ -44,14 +45,18 @@ public static class DependencyInjection
|
|||||||
services.TryAddScoped<IEnvelopeReceiverReadOnlyService, EnvelopeReceiverReadOnlyService>();
|
services.TryAddScoped<IEnvelopeReceiverReadOnlyService, EnvelopeReceiverReadOnlyService>();
|
||||||
|
|
||||||
//Auto mapping profiles
|
//Auto mapping profiles
|
||||||
services.AddAutoMapper(Assembly.GetExecutingAssembly());
|
services.AddAutoMapper(
|
||||||
services.AddAutoMapper(typeof(DigitalData.UserManager.Application.DIExtensions));
|
_ => { },
|
||||||
|
Assembly.GetExecutingAssembly(),
|
||||||
|
typeof(DigitalData.UserManager.Application.DIExtensions).Assembly);
|
||||||
|
|
||||||
services.Configure<DispatcherParams>(config.GetSection(nameof(DispatcherParams)));
|
services.Configure<DispatcherParams>(config.GetSection(nameof(DispatcherParams)));
|
||||||
services.Configure<MailParams>(config.GetSection(nameof(MailParams)));
|
services.Configure<MailParams>(config.GetSection(nameof(MailParams)));
|
||||||
|
services.Configure<SignatureFieldParams>(config.GetSection(nameof(SignatureFieldParams)));
|
||||||
services.Configure<AuthenticatorParams>(config.GetSection(nameof(AuthenticatorParams)));
|
services.Configure<AuthenticatorParams>(config.GetSection(nameof(AuthenticatorParams)));
|
||||||
services.Configure<TotpSmsParams>(config.GetSection(nameof(TotpSmsParams)));
|
services.Configure<TotpSmsParams>(config.GetSection(nameof(TotpSmsParams)));
|
||||||
services.Configure<ESignParams>(config.GetSection(nameof(ESignParams)));
|
services.Configure<ESignParams>(config.GetSection(nameof(ESignParams)));
|
||||||
|
services.Configure<SendAccessCodeParams>(config.GetSection(nameof(SendAccessCodeParams)));
|
||||||
|
|
||||||
services.AddHttpClientService<GtxMessagingParams>(config.GetSection(nameof(GtxMessagingParams)));
|
services.AddHttpClientService<GtxMessagingParams>(config.GetSection(nameof(GtxMessagingParams)));
|
||||||
services.TryAddScoped<ISmsSender, GTXSmsSender>(); // Changed: Singleton → Scoped
|
services.TryAddScoped<ISmsSender, GTXSmsSender>(); // Changed: Singleton → Scoped
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
using AutoMapper;
|
|
||||||
using AutoMapper.QueryableExtensions;
|
|
||||||
using DigitalData.Core.Abstraction.Application.Repository;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using EnvelopeGenerator.Application.Common.Dto;
|
using EnvelopeGenerator.Application.Common.Dto;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
@@ -21,12 +19,10 @@ public record ReadDocumentDetailsQuery(int EnvelopeId, int? UserId = null) : IRe
|
|||||||
public class ReadDocumentDetailsQueryHandler : IRequestHandler<ReadDocumentDetailsQuery, DocumentDetailsDto?>
|
public class ReadDocumentDetailsQueryHandler : IRequestHandler<ReadDocumentDetailsQuery, DocumentDetailsDto?>
|
||||||
{
|
{
|
||||||
private readonly IRepository<Document> _repo;
|
private readonly IRepository<Document> _repo;
|
||||||
private readonly IMapper _mapper;
|
|
||||||
|
|
||||||
public ReadDocumentDetailsQueryHandler(IRepository<Document> repo, IMapper mapper)
|
public ReadDocumentDetailsQueryHandler(IRepository<Document> repo)
|
||||||
{
|
{
|
||||||
_repo = repo;
|
_repo = repo;
|
||||||
_mapper = mapper;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<DocumentDetailsDto?> Handle(ReadDocumentDetailsQuery query, CancellationToken cancel)
|
public async Task<DocumentDetailsDto?> Handle(ReadDocumentDetailsQuery query, CancellationToken cancel)
|
||||||
@@ -36,9 +32,71 @@ public class ReadDocumentDetailsQueryHandler : IRequestHandler<ReadDocumentDetai
|
|||||||
if (query.UserId is int userId)
|
if (query.UserId is int userId)
|
||||||
docQuery = docQuery.Where(doc => doc.Envelope.UserId == userId);
|
docQuery = docQuery.Where(doc => doc.Envelope.UserId == userId);
|
||||||
|
|
||||||
return await docQuery
|
// shortcut: manual select avoids AutoMapper ProjectTo pulling BYTE_DATA and the full navigation
|
||||||
|
// graph (Envelope → History → User etc.) which caused an extremely slow query (~87s).
|
||||||
|
// Annotations navigation is IEnumerable<T> on the entity (not ICollection<T>), so EF Core
|
||||||
|
// cannot translate it in a Select projection — we skip it entirely here; sender editor only
|
||||||
|
// needs element coordinates, not annotation payloads.
|
||||||
|
var raw = await docQuery
|
||||||
.Where(d => d.EnvelopeId == query.EnvelopeId)
|
.Where(d => d.EnvelopeId == query.EnvelopeId)
|
||||||
.ProjectTo<DocumentDetailsDto>(_mapper.ConfigurationProvider)
|
.Select(d => new
|
||||||
|
{
|
||||||
|
d.Id,
|
||||||
|
d.EnvelopeId,
|
||||||
|
d.AddedWhen,
|
||||||
|
Elements = d.Elements == null ? null : d.Elements.Select(e => new
|
||||||
|
{
|
||||||
|
e.Id,
|
||||||
|
e.DocumentId,
|
||||||
|
e.ReceiverId,
|
||||||
|
e.ElementType,
|
||||||
|
e.X,
|
||||||
|
e.Y,
|
||||||
|
e.Width,
|
||||||
|
e.Height,
|
||||||
|
e.Page,
|
||||||
|
e.Required,
|
||||||
|
e.Tooltip,
|
||||||
|
e.ReadOnly,
|
||||||
|
e.AnnotationIndex,
|
||||||
|
e.AddedWhen,
|
||||||
|
e.ChangedWhen,
|
||||||
|
e.FullName,
|
||||||
|
e.Position,
|
||||||
|
e.Place,
|
||||||
|
}).ToList()
|
||||||
|
})
|
||||||
.FirstOrDefaultAsync(cancel);
|
.FirstOrDefaultAsync(cancel);
|
||||||
|
|
||||||
|
if (raw is null)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
return new DocumentDetailsDto
|
||||||
|
{
|
||||||
|
Id = raw.Id,
|
||||||
|
EnvelopeId = raw.EnvelopeId,
|
||||||
|
AddedWhen = raw.AddedWhen,
|
||||||
|
Elements = raw.Elements?.Select(e => new DocReceiverElementDto
|
||||||
|
{
|
||||||
|
Id = e.Id,
|
||||||
|
DocumentId = e.DocumentId,
|
||||||
|
ReceiverId = e.ReceiverId,
|
||||||
|
ElementType = e.ElementType,
|
||||||
|
X = e.X,
|
||||||
|
Y = e.Y,
|
||||||
|
Width = e.Width,
|
||||||
|
Height = e.Height,
|
||||||
|
Page = e.Page,
|
||||||
|
Required = e.Required,
|
||||||
|
Tooltip = e.Tooltip,
|
||||||
|
ReadOnly = e.ReadOnly,
|
||||||
|
AnnotationIndex = e.AnnotationIndex,
|
||||||
|
AddedWhen = e.AddedWhen,
|
||||||
|
ChangedWhen = e.ChangedWhen,
|
||||||
|
FullName = e.FullName,
|
||||||
|
Position = e.Position,
|
||||||
|
Place = e.Place,
|
||||||
|
})
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,10 +20,9 @@
|
|||||||
<PackageReference Include="DigitalData.Core.Client" Version="2.1.0" />
|
<PackageReference Include="DigitalData.Core.Client" Version="2.1.0" />
|
||||||
<PackageReference Include="DigitalData.Core.Exceptions" Version="1.1.0" />
|
<PackageReference Include="DigitalData.Core.Exceptions" Version="1.1.0" />
|
||||||
<PackageReference Include="DigitalData.EmailProfilerDispatcher" Version="3.1.1" />
|
<PackageReference Include="DigitalData.EmailProfilerDispatcher" Version="3.1.1" />
|
||||||
<PackageReference Include="FluentValidation" Version="11.11.0" />
|
|
||||||
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="11.11.0" />
|
|
||||||
<PackageReference Include="HtmlSanitizer" Version="9.0.892" />
|
<PackageReference Include="HtmlSanitizer" Version="9.0.892" />
|
||||||
<PackageReference Include="MediatR" Version="12.5.0" />
|
<PackageReference Include="MediatR" Version="14.2.0" />
|
||||||
<PackageReference Include="Microsoft.Identity.Client" Version="4.82.1" />
|
<PackageReference Include="Microsoft.Identity.Client" Version="4.82.1" />
|
||||||
<PackageReference Include="Otp.NET" Version="1.4.0" />
|
<PackageReference Include="Otp.NET" Version="1.4.0" />
|
||||||
<PackageReference Include="QRCoder" Version="1.6.0" />
|
<PackageReference Include="QRCoder" Version="1.6.0" />
|
||||||
@@ -36,14 +35,20 @@
|
|||||||
|
|
||||||
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
|
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
|
||||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
|
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
|
||||||
|
<PackageReference Include="FluentValidation" Version="11.11.0" />
|
||||||
|
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="11.11.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
|
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
|
||||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
|
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
|
||||||
|
<PackageReference Include="FluentValidation" Version="12.1.1" />
|
||||||
|
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="12.1.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
|
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
|
||||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.5" />
|
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.5" />
|
||||||
|
<PackageReference Include="FluentValidation" Version="12.1.1" />
|
||||||
|
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="12.1.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@@ -89,14 +94,14 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
|
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
|
||||||
<PackageReference Include="AutoMapper" Version="14.0.0" />
|
<PackageReference Include="AutoMapper" Version="16.2.0" />
|
||||||
<PackageReference Include="CommandDotNet">
|
<PackageReference Include="CommandDotNet">
|
||||||
<Version>8.1.1</Version>
|
<Version>8.1.1</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
|
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
|
||||||
<PackageReference Include="AutoMapper" Version="14.0.0" />
|
<PackageReference Include="AutoMapper" Version="16.2.0" />
|
||||||
<PackageReference Include="CommandDotNet">
|
<PackageReference Include="CommandDotNet">
|
||||||
<Version>8.1.1</Version>
|
<Version>8.1.1</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|||||||
@@ -0,0 +1,84 @@
|
|||||||
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
|
using DigitalData.Core.Exceptions;
|
||||||
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
using EnvelopeGenerator.Domain.Exceptions;
|
||||||
|
using MediatR;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Commands;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public record RemoveEnvelopeReceiverCommand : IRequest
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public required int EnvelopeId { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public required int ReceiverId { get; init; }
|
||||||
|
|
||||||
|
internal int? UserId { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="userId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public RemoveEnvelopeReceiverCommand Authenticated(int userId)
|
||||||
|
{
|
||||||
|
UserId = userId;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Repo"></param>
|
||||||
|
public class RemoveEnvelopeReceiverCommandHandler(
|
||||||
|
IRepository<EnvelopeReceiver> Repo,
|
||||||
|
IRepository<DocReceiverElement> ElementRepo,
|
||||||
|
IRepository<ElementAnnotation> AnnotRepo) : IRequestHandler<RemoveEnvelopeReceiverCommand>
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="cancel"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
|
public async Task Handle(RemoveEnvelopeReceiverCommand request, CancellationToken cancel)
|
||||||
|
{
|
||||||
|
var er = await Repo.Query
|
||||||
|
.Where(er => er.EnvelopeId == request.EnvelopeId && er.ReceiverId == request.ReceiverId)
|
||||||
|
.Include(er => er.Envelope)
|
||||||
|
.SingleOrDefaultAsync(cancel)
|
||||||
|
?? throw new NotFoundException();
|
||||||
|
|
||||||
|
if (er.Envelope is null)
|
||||||
|
throw new InvalidOperationException($"In {nameof(RemoveEnvelopeReceiverCommandHandler)} EnvelopeReceiver.Envelope is null." +
|
||||||
|
$"This should not happen." +
|
||||||
|
$"EnvelopeId: {request.EnvelopeId}, ReceiverId: {request.ReceiverId}");
|
||||||
|
|
||||||
|
if (request.UserId is int userId && er.Envelope.UserId != userId)
|
||||||
|
throw new AuthorizationException("Cannot remove receiver from envelope that you do not own.");
|
||||||
|
|
||||||
|
if (er.Envelope.Status > EnvelopeStatus.EnvelopeSaved)
|
||||||
|
throw new ForbiddenException("Cannot remove receiver from envelope that is already processed.");
|
||||||
|
|
||||||
|
// 1. Delete all ElementAnnotations for this EnvelopeReceiver
|
||||||
|
await AnnotRepo.DeleteAsync(ann => ann.Element.Document.EnvelopeId == request.EnvelopeId && ann.Element.ReceiverId == request.ReceiverId, cancel);
|
||||||
|
|
||||||
|
// 2. Delete all DocReceiverElements for this EnvelopeReceiver
|
||||||
|
await ElementRepo.DeleteAsync(el => el.Document.EnvelopeId == request.EnvelopeId && el.ReceiverId == request.ReceiverId, cancel);
|
||||||
|
|
||||||
|
// 3. Delete the EnvelopeReceiver
|
||||||
|
await Repo.DeleteAsync(er => er.EnvelopeId == request.EnvelopeId && er.ReceiverId == request.ReceiverId, cancel);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,151 @@
|
|||||||
|
using DigitalData.Core.Exceptions;
|
||||||
|
using EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver;
|
||||||
|
using EnvelopeGenerator.Application.Common.Interfaces.Services;
|
||||||
|
using EnvelopeGenerator.Application.Common.Interfaces.Services.Notification;
|
||||||
|
using EnvelopeGenerator.Application.EnvelopeReceivers.Queries;
|
||||||
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
using EnvelopeGenerator.Domain.Exceptions;
|
||||||
|
using MediatR;
|
||||||
|
using Microsoft.Extensions.Caching.Memory;
|
||||||
|
using Microsoft.Extensions.Options;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Commands;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Key"></param>
|
||||||
|
public record SendAccessCodeCommand(string Key) : IRequest<SendAccessCodeResult>
|
||||||
|
{
|
||||||
|
internal bool MultipleRequestsAllowed { get; private set; } = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public SendAccessCodeCommand AllowMultipleRequests(bool allow = true)
|
||||||
|
{
|
||||||
|
MultipleRequestsAllowed = allow;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Business result of an access-code request.
|
||||||
|
/// </summary>
|
||||||
|
public enum SendAccessCodeResult
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Access code sent successfully. HTTP: 200 OK.
|
||||||
|
/// </summary>
|
||||||
|
Sent,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Receiver has already signed this envelope; requesting a code is no longer applicable. HTTP: 409 Conflict.
|
||||||
|
/// </summary>
|
||||||
|
AlreadySigned,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Envelope does not require an access code. HTTP: 200 OK (or 204 No Content).
|
||||||
|
/// </summary>
|
||||||
|
NoAccessCodeRequired,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Access code was already requested and the request limit/rule blocks another send. HTTP: 429 Too Many Requests.
|
||||||
|
/// </summary>
|
||||||
|
RequestLimitExceeded
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class SendAccessCodeCommandHandler(IMediator Sender, IEnvelopeHistoryService HistoryService, IEnvelopeNotificationService NtfService, IOptions<SendAccessCodeParams> options, IMemoryCache Cache) : IRequestHandler<SendAccessCodeCommand, SendAccessCodeResult>
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public readonly SendAccessCodeParams Options = options.Value;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="cancel"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<SendAccessCodeResult> Handle(SendAccessCodeCommand request, CancellationToken cancel)
|
||||||
|
{
|
||||||
|
// read envelope receiver
|
||||||
|
var ers = (await Sender.Send(new ReadEnvelopeReceiverQuery
|
||||||
|
{
|
||||||
|
Key = request.Key,
|
||||||
|
}, cancel));
|
||||||
|
|
||||||
|
if (ers.SingleOrDefault() is not EnvelopeReceiverDto er || er.Envelope is null || er.Receiver is null)
|
||||||
|
throw new NotFoundException($"Envelope receiver with key '{request.Key}' not found.");
|
||||||
|
|
||||||
|
if (!er.Envelope.UseAccessCode)
|
||||||
|
return SendAccessCodeResult.NoAccessCodeRequired;
|
||||||
|
|
||||||
|
var userReference = er.Receiver.EmailAddress;
|
||||||
|
|
||||||
|
if (await HistoryService.IsSigned(er.EnvelopeId, userReference))
|
||||||
|
return SendAccessCodeResult.AlreadySigned;
|
||||||
|
|
||||||
|
var accessCodeAlreadyRequested = await HistoryService.AccessCodeAlreadyRequested(er.EnvelopeId, userReference);
|
||||||
|
if (accessCodeAlreadyRequested && (!request.MultipleRequestsAllowed || await IsAccessCodeRequestsDisabled(request.Key, cancel)))
|
||||||
|
return SendAccessCodeResult.RequestLimitExceeded;
|
||||||
|
|
||||||
|
// create a history record
|
||||||
|
if (!accessCodeAlreadyRequested)
|
||||||
|
{
|
||||||
|
var historyResult = await HistoryService.RecordAsync(er.EnvelopeId, userReference, EnvelopeStatus.AccessCodeRequested);
|
||||||
|
if (historyResult.IsFailed)
|
||||||
|
{
|
||||||
|
throw new ApplicationException($"Failed to record AccessCodeRequested history for envelope {er.EnvelopeId} and receiver {userReference}.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (er.AccessCode is null)
|
||||||
|
throw new DataIntegrityException($"Access code is null for envelope receiver with key '{request.Key}' although use-access-code is true.");
|
||||||
|
|
||||||
|
await NtfService.Notify(er.Receiver.EmailAddress, new DocumentAccessCodeReceivedNotification()
|
||||||
|
{
|
||||||
|
DocumentAccessCode = er.AccessCode,
|
||||||
|
DocumentTitle = er.Envelope.Title,
|
||||||
|
NameReceiver = er.Name ?? string.Empty,
|
||||||
|
IsReadAndConfirm = er.Envelope.Type == EnvelopeType.ReadAndConfirm,
|
||||||
|
NameSender = er.Envelope.User!.Username,
|
||||||
|
}, cancel);
|
||||||
|
|
||||||
|
await DisableAccessCodeRequests(request.Key, cancel);
|
||||||
|
|
||||||
|
return SendAccessCodeResult.Sent;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string DisableAccessCodeRequestsCacheKeyPrefix => "DisableAccessCodeRequests_";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelopeKey"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
private Task<bool> IsAccessCodeRequestsDisabled(string envelopeKey, CancellationToken cancellationToken = default)
|
||||||
|
{
|
||||||
|
bool hasCache = Cache.TryGetValue<bool>(DisableAccessCodeRequestsCacheKeyPrefix + envelopeKey, out var disabled);
|
||||||
|
return Task.FromResult(hasCache && disabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelopeKey"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
private Task DisableAccessCodeRequests(string envelopeKey, CancellationToken cancellationToken = default)
|
||||||
|
{
|
||||||
|
Cache.Set(DisableAccessCodeRequestsCacheKeyPrefix + envelopeKey, true, Options.RepeatRequestBlockingPeriod);
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Commands;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public record SendAccessCodeParams
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public TimeSpan RepeatRequestBlockingPeriod { get; init; } = TimeSpan.FromMinutes(1);
|
||||||
|
}
|
||||||
@@ -9,20 +9,20 @@ namespace EnvelopeGenerator.Application.EnvelopeTypes.Queries;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public record ReadEnvelopeTypesQuery : IRequest<IEnumerable<EnvelopeTypeDto>>;
|
public record ReadEnvelopeTypesQuery : IRequest<IEnumerable<EnvelopeTypeDefaultsDto>>;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ReadEnvelopeTypesQueryHandler : IRequestHandler<ReadEnvelopeTypesQuery, IEnumerable<EnvelopeTypeDto>>
|
public class ReadEnvelopeTypesQueryHandler : IRequestHandler<ReadEnvelopeTypesQuery, IEnumerable<EnvelopeTypeDefaultsDto>>
|
||||||
{
|
{
|
||||||
private readonly IRepository<EnvelopeType> _repository;
|
private readonly IRepository<EnvelopeTypeDefaults> _repository;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="repository"></param>
|
/// <param name="repository"></param>
|
||||||
public ReadEnvelopeTypesQueryHandler(IRepository<EnvelopeType> repository)
|
public ReadEnvelopeTypesQueryHandler(IRepository<EnvelopeTypeDefaults> repository)
|
||||||
{
|
{
|
||||||
_repository = repository;
|
_repository = repository;
|
||||||
}
|
}
|
||||||
@@ -33,29 +33,27 @@ public class ReadEnvelopeTypesQueryHandler : IRequestHandler<ReadEnvelopeTypesQu
|
|||||||
/// <param name="request"></param>
|
/// <param name="request"></param>
|
||||||
/// <param name="cancellationToken"></param>
|
/// <param name="cancellationToken"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<IEnumerable<EnvelopeTypeDto>> Handle(ReadEnvelopeTypesQuery request, CancellationToken cancellationToken)
|
public async Task<IEnumerable<EnvelopeTypeDefaultsDto>> Handle(ReadEnvelopeTypesQuery request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
// TODO: Temporary manual projection to avoid null-materialization crashes from legacy nullable DB columns in EnvelopeType.
|
// TODO: Temporary manual projection to avoid null-materialization crashes from legacy nullable DB columns in EnvelopeType.
|
||||||
// Revisit and switch to AutoMapper query projection (ProjectTo) after schema nullability and mapping contracts are stabilized.
|
// Revisit and switch to AutoMapper query projection (ProjectTo) after schema nullability and mapping contracts are stabilized.
|
||||||
return await _repository.Query
|
return await _repository.Query
|
||||||
.AsNoTracking()
|
.AsNoTracking()
|
||||||
.Select(t => new EnvelopeTypeDto
|
.Select(t => new EnvelopeTypeDefaultsDto
|
||||||
{
|
{
|
||||||
Id = t.Id,
|
Id = t.Id,
|
||||||
Title = t.Title ?? string.Empty,
|
Title = t.Title ?? string.Empty,
|
||||||
Language = string.IsNullOrWhiteSpace(t.Language) ? "de-DE" : t.Language,
|
Language = string.IsNullOrWhiteSpace(t.Language) ? "de-DE" : t.Language,
|
||||||
ExpiresDays = t.ExpiresDays,
|
ExpiresDays = t.ExpiresDays,
|
||||||
CertificationType = (int?)t.CertificationType,
|
|
||||||
UseAccessCode = t.UseAccessCode,
|
UseAccessCode = t.UseAccessCode,
|
||||||
FinalEmailToCreator = (int?)t.FinalEmailToCreator,
|
FinalEmailToCreator = t.FinalEmailToCreator,
|
||||||
FinalEmailToReceivers = (int?)t.FinalEmailToReceivers,
|
FinalEmailToReceivers = t.FinalEmailToReceivers,
|
||||||
AddedWhen = t.AddedWhen,
|
AddedWhen = t.AddedWhen,
|
||||||
ChangedWhen = t.ChangedWhen,
|
ChangedWhen = t.ChangedWhen,
|
||||||
ExpiresWarningDays = t.ExpiresWarningDays,
|
ExpiresWarningDays = t.ExpiresWarningDays,
|
||||||
SendReminderEmails = t.SendReminderEmails,
|
SendReminderEmails = t.SendReminderEmails,
|
||||||
FirstReminderDays = t.FirstReminderDays,
|
FirstReminderDays = t.FirstReminderDays,
|
||||||
ReminderIntervalDays = t.ReminderIntervalDays,
|
ReminderIntervalDays = t.ReminderIntervalDays,
|
||||||
ContractType = t.ContractType
|
|
||||||
})
|
})
|
||||||
.ToListAsync(cancellationToken);
|
.ToListAsync(cancellationToken);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
using EnvelopeGenerator.Application.Common.Dto;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
|
using EnvelopeGenerator.Application.Common.Dto;
|
||||||
using EnvelopeGenerator.Application.Common.Interfaces.SQLExecutor;
|
using EnvelopeGenerator.Application.Common.Interfaces.SQLExecutor;
|
||||||
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
@@ -20,7 +22,7 @@ public record CreateEnvelopeCommand : IRequest<EnvelopeDto?>
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Kennung des ausgewaehlten Umschlagtyps (Vorlage).
|
/// Kennung des ausgewaehlten Umschlagtyps (Vorlage).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? EnvelopeTypeId { get; set; }
|
public EnvelopeType? Type { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sprachcode fuer Umschlaginhalt und Benachrichtigungen.
|
/// Sprachcode fuer Umschlaginhalt und Benachrichtigungen.
|
||||||
@@ -32,20 +34,15 @@ public record CreateEnvelopeCommand : IRequest<EnvelopeDto?>
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public bool? UseAccessCode { get; set; }
|
public bool? UseAccessCode { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Zertifizierungstyp fuer den Signaturprozess.
|
|
||||||
/// </summary>
|
|
||||||
public int? CertificationType { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Finale E-Mail-Einstellung fuer den Ersteller.
|
/// Finale E-Mail-Einstellung fuer den Ersteller.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? FinalEmailToCreator { get; set; }
|
public FinalEmailType? FinalEmailToCreator { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Finale E-Mail-Einstellung fuer die Empfaenger.
|
/// Finale E-Mail-Einstellung fuer die Empfaenger.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? FinalEmailToReceivers { get; set; }
|
public FinalEmailType? FinalEmailToReceivers { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gibt an, ob Erinnerungs-E-Mails aktiviert sind.
|
/// Gibt an, ob Erinnerungs-E-Mails aktiviert sind.
|
||||||
@@ -129,10 +126,27 @@ public record CreateEnvelopeCommand : IRequest<EnvelopeDto?>
|
|||||||
public bool UseSQLExecutor { get; set; } = true;
|
public bool UseSQLExecutor { get; set; } = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="DataAsBase64"></param>
|
||||||
public record CreateEnvelopeDocumentDto(string DataAsBase64);
|
public record CreateEnvelopeDocumentDto(string DataAsBase64);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="X"></param>
|
||||||
|
/// <param name="Y"></param>
|
||||||
|
/// <param name="Page"></param>
|
||||||
public record CreateEnvelopeFieldDto(double X, double Y, int Page);
|
public record CreateEnvelopeFieldDto(double X, double Y, int Page);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="EmailAddress"></param>
|
||||||
|
/// <param name="Name"></param>
|
||||||
|
/// <param name="PhoneNumber"></param>
|
||||||
|
/// <param name="Fields"></param>
|
||||||
public record CreateEnvelopeReceiverDto(
|
public record CreateEnvelopeReceiverDto(
|
||||||
string EmailAddress,
|
string EmailAddress,
|
||||||
string? Name,
|
string? Name,
|
||||||
|
|||||||
@@ -1,68 +1,68 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using MediatR;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
|
||||||
using Microsoft.Extensions.Options;
|
|
||||||
using DigitalData.Core.Abstraction.Application.Repository;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using DigitalData.EmailProfilerDispatcher.Abstraction.Entities;
|
|
||||||
using DigitalData.Core.Exceptions;
|
using DigitalData.Core.Exceptions;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using DigitalData.EmailProfilerDispatcher.Abstraction.Entities;
|
||||||
using EnvelopeGenerator.Application.Common.Dto;
|
using DigitalData.UserManager.Domain.Entities;
|
||||||
using EnvelopeGenerator.Application.Common.Configurations;
|
using EnvelopeGenerator.Application.Common.Configurations;
|
||||||
|
using EnvelopeGenerator.Application.Common.Dto;
|
||||||
using EnvelopeGenerator.Application.Common.Extensions;
|
using EnvelopeGenerator.Application.Common.Extensions;
|
||||||
|
using EnvelopeGenerator.Application.Common.Interfaces;
|
||||||
using EnvelopeGenerator.Application.Common.Interfaces.Services;
|
using EnvelopeGenerator.Application.Common.Interfaces.Services;
|
||||||
|
using EnvelopeGenerator.Application.Common.Interfaces.Services.Notification;
|
||||||
using EnvelopeGenerator.Application.Common.Interfaces.SQLExecutor;
|
using EnvelopeGenerator.Application.Common.Interfaces.SQLExecutor;
|
||||||
using EnvelopeGenerator.Application.Histories.Commands;
|
using EnvelopeGenerator.Application.Histories.Commands;
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
|
||||||
using EnvelopeGenerator.Domain;
|
using EnvelopeGenerator.Domain;
|
||||||
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
using EnvelopeGenerator.Domain.Interfaces;
|
||||||
|
using MediatR;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using Microsoft.Extensions.Options;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Envelopes.Commands;
|
namespace EnvelopeGenerator.Application.Envelopes.Commands;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class CreateEnvelopeCommandHandler : IRequestHandler<CreateEnvelopeCommand, EnvelopeDto?>
|
/// <param name="Provider"></param>
|
||||||
|
/// <param name="Mapper"></param>
|
||||||
|
/// <param name="EnvNtfService"></param>
|
||||||
|
/// <param name="ReqCntxt"></param>
|
||||||
|
/// <param name="Logger"></param>
|
||||||
|
public class CreateEnvelopeCommandHandler(IServiceProvider Provider, IMapper Mapper, IEnvelopeNotificationService EnvNtfService, IRequestContext ReqCntxt, ILogger<CreateEnvelopeCommandHandler> Logger) : IRequestHandler<CreateEnvelopeCommand, EnvelopeDto?>
|
||||||
{
|
{
|
||||||
private readonly IServiceProvider _provider;
|
private IEnvelopeExecutor Executor => Provider.GetRequiredService<IEnvelopeExecutor>();
|
||||||
|
|
||||||
private IEnvelopeExecutor Executor => _provider.GetRequiredService<IEnvelopeExecutor>();
|
private IRepository<Envelope> Repository => Provider.GetRequiredService<IRepository<Envelope>>();
|
||||||
|
|
||||||
private IRepository<Envelope> Repository => _provider.GetRequiredService<IRepository<Envelope>>();
|
private IRepository<Document> DocumentRepository => Provider.GetRequiredService<IRepository<Document>>();
|
||||||
|
|
||||||
private IRepository<Document> DocumentRepository => _provider.GetRequiredService<IRepository<Document>>();
|
private IRepository<EnvelopeReceiver> EnvelopeReceiverRepository => Provider.GetRequiredService<IRepository<EnvelopeReceiver>>();
|
||||||
|
|
||||||
private IRepository<EnvelopeReceiver> EnvelopeReceiverRepository => _provider.GetRequiredService<IRepository<EnvelopeReceiver>>();
|
private IRepository<EnvelopeTypeDefaults> EnvelopeTypeRepository => Provider.GetRequiredService<IRepository<EnvelopeTypeDefaults>>();
|
||||||
|
|
||||||
private IRepository<EnvelopeType> EnvelopeTypeRepository => _provider.GetRequiredService<IRepository<EnvelopeType>>();
|
private IRepository<Receiver> ReceiverRepository => Provider.GetRequiredService<IRepository<Receiver>>();
|
||||||
|
|
||||||
private IRepository<Receiver> ReceiverRepository => _provider.GetRequiredService<IRepository<Receiver>>();
|
private IRepository<DocReceiverElement> DocReceiverElementRepository => Provider.GetRequiredService<IRepository<DocReceiverElement>>();
|
||||||
|
|
||||||
private IRepository<DocReceiverElement> DocReceiverElementRepository => _provider.GetRequiredService<IRepository<DocReceiverElement>>();
|
private IRepository<EmailTemplate> EmailTemplateRepository => Provider.GetRequiredService<IRepository<EmailTemplate>>();
|
||||||
|
|
||||||
private IRepository<EmailTemplate> EmailTemplateRepository => _provider.GetRequiredService<IRepository<EmailTemplate>>();
|
private IRepository<EmailOut> EmailOutRepository => Provider.GetRequiredService<IRepository<EmailOut>>();
|
||||||
|
|
||||||
private IRepository<EmailOut> EmailOutRepository => _provider.GetRequiredService<IRepository<EmailOut>>();
|
private MailParams MailParams => Provider.GetRequiredService<IOptions<MailParams>>().Value;
|
||||||
|
|
||||||
private MailParams MailParams => _provider.GetRequiredService<IOptions<MailParams>>().Value;
|
private DispatcherParams DispatcherParams => Provider.GetRequiredService<IOptions<DispatcherParams>>().Value;
|
||||||
|
|
||||||
private DispatcherParams DispatcherParams => _provider.GetRequiredService<IOptions<DispatcherParams>>().Value;
|
private SignatureFieldParams SignatureFieldParams => Provider.GetRequiredService<IOptionsMonitor<SignatureFieldParams>>().CurrentValue;
|
||||||
|
|
||||||
private IConfigService ConfigService => _provider.GetRequiredService<IConfigService>();
|
[Obsolete("Use IConfigService instead.")]
|
||||||
|
private IConfigService ConfigService => Provider.GetRequiredService<IConfigService>();
|
||||||
|
|
||||||
private IMediator Mediator => _provider.GetRequiredService<IMediator>();
|
private IMediator Mediator => Provider.GetRequiredService<IMediator>();
|
||||||
|
|
||||||
private readonly IMapper _mapper;
|
private IAuthenticator Authenticator => Provider.GetRequiredService<IAuthenticator>();
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="provider"></param>
|
|
||||||
/// <param name="mapper"></param>
|
|
||||||
public CreateEnvelopeCommandHandler(IServiceProvider provider, IMapper mapper)
|
|
||||||
{
|
|
||||||
_provider = provider;
|
|
||||||
_mapper = mapper;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -95,10 +95,9 @@ public class CreateEnvelopeCommandHandler : IRequestHandler<CreateEnvelopeComman
|
|||||||
e.Title = title;
|
e.Title = title;
|
||||||
e.Message = message;
|
e.Message = message;
|
||||||
e.TfaEnabled = request.TFAEnabled;
|
e.TfaEnabled = request.TFAEnabled;
|
||||||
e.EnvelopeTypeId = settings.EnvelopeTypeId;
|
e.Type = settings.Type;
|
||||||
e.Language = settings.Language;
|
e.Language = settings.Language;
|
||||||
e.UseAccessCode = settings.UseAccessCode;
|
e.UseAccessCode = settings.UseAccessCode;
|
||||||
e.CertificationType = settings.CertificationType;
|
|
||||||
e.FinalEmailToCreator = settings.FinalEmailToCreator;
|
e.FinalEmailToCreator = settings.FinalEmailToCreator;
|
||||||
e.FinalEmailToReceivers = settings.FinalEmailToReceivers;
|
e.FinalEmailToReceivers = settings.FinalEmailToReceivers;
|
||||||
e.SendReminderEmails = settings.SendReminderEmails;
|
e.SendReminderEmails = settings.SendReminderEmails;
|
||||||
@@ -106,7 +105,6 @@ public class CreateEnvelopeCommandHandler : IRequestHandler<CreateEnvelopeComman
|
|||||||
e.ReminderIntervalDays = settings.ReminderIntervalDays;
|
e.ReminderIntervalDays = settings.ReminderIntervalDays;
|
||||||
e.ExpiresWhenDays = settings.ExpiresWhenDays;
|
e.ExpiresWhenDays = settings.ExpiresWhenDays;
|
||||||
e.ExpiresWarningWhenDays = settings.ExpiresWarningWhenDays;
|
e.ExpiresWarningWhenDays = settings.ExpiresWarningWhenDays;
|
||||||
e.ContractType = settings.ContractType;
|
|
||||||
e.ExpiresWhen = settings.ExpiresWhen;
|
e.ExpiresWhen = settings.ExpiresWhen;
|
||||||
e.ExpiresWarningWhen = settings.ExpiresWarningWhen;
|
e.ExpiresWarningWhen = settings.ExpiresWarningWhen;
|
||||||
e.Status = EnvelopeStatus.EnvelopeSaved;
|
e.Status = EnvelopeStatus.EnvelopeSaved;
|
||||||
@@ -116,10 +114,9 @@ public class CreateEnvelopeCommandHandler : IRequestHandler<CreateEnvelopeComman
|
|||||||
envelope.Title = title;
|
envelope.Title = title;
|
||||||
envelope.Message = message;
|
envelope.Message = message;
|
||||||
envelope.TfaEnabled = request.TFAEnabled;
|
envelope.TfaEnabled = request.TFAEnabled;
|
||||||
envelope.EnvelopeTypeId = settings.EnvelopeTypeId;
|
envelope.Type = settings.Type;
|
||||||
envelope.Language = settings.Language;
|
envelope.Language = settings.Language;
|
||||||
envelope.UseAccessCode = settings.UseAccessCode;
|
envelope.UseAccessCode = settings.UseAccessCode;
|
||||||
envelope.CertificationType = settings.CertificationType;
|
|
||||||
envelope.FinalEmailToCreator = settings.FinalEmailToCreator;
|
envelope.FinalEmailToCreator = settings.FinalEmailToCreator;
|
||||||
envelope.FinalEmailToReceivers = settings.FinalEmailToReceivers;
|
envelope.FinalEmailToReceivers = settings.FinalEmailToReceivers;
|
||||||
envelope.SendReminderEmails = settings.SendReminderEmails;
|
envelope.SendReminderEmails = settings.SendReminderEmails;
|
||||||
@@ -127,7 +124,6 @@ public class CreateEnvelopeCommandHandler : IRequestHandler<CreateEnvelopeComman
|
|||||||
envelope.ReminderIntervalDays = settings.ReminderIntervalDays;
|
envelope.ReminderIntervalDays = settings.ReminderIntervalDays;
|
||||||
envelope.ExpiresWhenDays = settings.ExpiresWhenDays;
|
envelope.ExpiresWhenDays = settings.ExpiresWhenDays;
|
||||||
envelope.ExpiresWarningWhenDays = settings.ExpiresWarningWhenDays;
|
envelope.ExpiresWarningWhenDays = settings.ExpiresWarningWhenDays;
|
||||||
envelope.ContractType = settings.ContractType;
|
|
||||||
envelope.ExpiresWhen = settings.ExpiresWhen;
|
envelope.ExpiresWhen = settings.ExpiresWhen;
|
||||||
envelope.ExpiresWarningWhen = settings.ExpiresWarningWhen;
|
envelope.ExpiresWarningWhen = settings.ExpiresWarningWhen;
|
||||||
envelope.Status = EnvelopeStatus.EnvelopeSaved;
|
envelope.Status = EnvelopeStatus.EnvelopeSaved;
|
||||||
@@ -147,11 +143,10 @@ public class CreateEnvelopeCommandHandler : IRequestHandler<CreateEnvelopeComman
|
|||||||
AddedWhen = now,
|
AddedWhen = now,
|
||||||
ChangedWhen = now,
|
ChangedWhen = now,
|
||||||
Comment = string.Empty,
|
Comment = string.Empty,
|
||||||
EnvelopeTypeId = settings.EnvelopeTypeId,
|
Type = settings.Type,
|
||||||
Language = settings.Language,
|
Language = settings.Language,
|
||||||
TfaEnabled = request.TFAEnabled,
|
TfaEnabled = request.TFAEnabled,
|
||||||
UseAccessCode = settings.UseAccessCode,
|
UseAccessCode = settings.UseAccessCode,
|
||||||
CertificationType = settings.CertificationType,
|
|
||||||
FinalEmailToCreator = settings.FinalEmailToCreator,
|
FinalEmailToCreator = settings.FinalEmailToCreator,
|
||||||
FinalEmailToReceivers = settings.FinalEmailToReceivers,
|
FinalEmailToReceivers = settings.FinalEmailToReceivers,
|
||||||
SendReminderEmails = settings.SendReminderEmails,
|
SendReminderEmails = settings.SendReminderEmails,
|
||||||
@@ -160,8 +155,7 @@ public class CreateEnvelopeCommandHandler : IRequestHandler<CreateEnvelopeComman
|
|||||||
ExpiresWhenDays = settings.ExpiresWhenDays,
|
ExpiresWhenDays = settings.ExpiresWhenDays,
|
||||||
ExpiresWarningWhenDays = settings.ExpiresWarningWhenDays,
|
ExpiresWarningWhenDays = settings.ExpiresWarningWhenDays,
|
||||||
ExpiresWhen = settings.ExpiresWhen,
|
ExpiresWhen = settings.ExpiresWhen,
|
||||||
ExpiresWarningWhen = settings.ExpiresWarningWhen,
|
ExpiresWarningWhen = settings.ExpiresWarningWhen
|
||||||
ContractType = settings.ContractType
|
|
||||||
}, cancel);
|
}, cancel);
|
||||||
|
|
||||||
if (request.UseSQLExecutor)
|
if (request.UseSQLExecutor)
|
||||||
@@ -171,10 +165,9 @@ public class CreateEnvelopeCommandHandler : IRequestHandler<CreateEnvelopeComman
|
|||||||
e.Title = title;
|
e.Title = title;
|
||||||
e.Message = message;
|
e.Message = message;
|
||||||
e.TfaEnabled = request.TFAEnabled;
|
e.TfaEnabled = request.TFAEnabled;
|
||||||
e.EnvelopeTypeId = settings.EnvelopeTypeId;
|
e.Type = settings.Type;
|
||||||
e.Language = settings.Language;
|
e.Language = settings.Language;
|
||||||
e.UseAccessCode = settings.UseAccessCode;
|
e.UseAccessCode = settings.UseAccessCode;
|
||||||
e.CertificationType = settings.CertificationType;
|
|
||||||
e.FinalEmailToCreator = settings.FinalEmailToCreator;
|
e.FinalEmailToCreator = settings.FinalEmailToCreator;
|
||||||
e.FinalEmailToReceivers = settings.FinalEmailToReceivers;
|
e.FinalEmailToReceivers = settings.FinalEmailToReceivers;
|
||||||
e.SendReminderEmails = settings.SendReminderEmails;
|
e.SendReminderEmails = settings.SendReminderEmails;
|
||||||
@@ -184,7 +177,6 @@ public class CreateEnvelopeCommandHandler : IRequestHandler<CreateEnvelopeComman
|
|||||||
e.ExpiresWarningWhenDays = settings.ExpiresWarningWhenDays;
|
e.ExpiresWarningWhenDays = settings.ExpiresWarningWhenDays;
|
||||||
e.ExpiresWhen = settings.ExpiresWhen;
|
e.ExpiresWhen = settings.ExpiresWhen;
|
||||||
e.ExpiresWarningWhen = settings.ExpiresWarningWhen;
|
e.ExpiresWarningWhen = settings.ExpiresWarningWhen;
|
||||||
e.ContractType = settings.ContractType;
|
|
||||||
e.Status = EnvelopeStatus.EnvelopeSaved;
|
e.Status = EnvelopeStatus.EnvelopeSaved;
|
||||||
e.ChangedWhen = now;
|
e.ChangedWhen = now;
|
||||||
}, e => e.Id == envelope.Id, cancel);
|
}, e => e.Id == envelope.Id, cancel);
|
||||||
@@ -192,10 +184,9 @@ public class CreateEnvelopeCommandHandler : IRequestHandler<CreateEnvelopeComman
|
|||||||
envelope.Title = title;
|
envelope.Title = title;
|
||||||
envelope.Message = message;
|
envelope.Message = message;
|
||||||
envelope.TfaEnabled = request.TFAEnabled;
|
envelope.TfaEnabled = request.TFAEnabled;
|
||||||
envelope.EnvelopeTypeId = settings.EnvelopeTypeId;
|
envelope.Type = settings.Type;
|
||||||
envelope.Language = settings.Language;
|
envelope.Language = settings.Language;
|
||||||
envelope.UseAccessCode = settings.UseAccessCode;
|
envelope.UseAccessCode = settings.UseAccessCode;
|
||||||
envelope.CertificationType = settings.CertificationType;
|
|
||||||
envelope.FinalEmailToCreator = settings.FinalEmailToCreator;
|
envelope.FinalEmailToCreator = settings.FinalEmailToCreator;
|
||||||
envelope.FinalEmailToReceivers = settings.FinalEmailToReceivers;
|
envelope.FinalEmailToReceivers = settings.FinalEmailToReceivers;
|
||||||
envelope.SendReminderEmails = settings.SendReminderEmails;
|
envelope.SendReminderEmails = settings.SendReminderEmails;
|
||||||
@@ -205,7 +196,6 @@ public class CreateEnvelopeCommandHandler : IRequestHandler<CreateEnvelopeComman
|
|||||||
envelope.ExpiresWarningWhenDays = settings.ExpiresWarningWhenDays;
|
envelope.ExpiresWarningWhenDays = settings.ExpiresWarningWhenDays;
|
||||||
envelope.ExpiresWhen = settings.ExpiresWhen;
|
envelope.ExpiresWhen = settings.ExpiresWhen;
|
||||||
envelope.ExpiresWarningWhen = settings.ExpiresWarningWhen;
|
envelope.ExpiresWarningWhen = settings.ExpiresWarningWhen;
|
||||||
envelope.ContractType = settings.ContractType;
|
|
||||||
envelope.Status = EnvelopeStatus.EnvelopeSaved;
|
envelope.Status = EnvelopeStatus.EnvelopeSaved;
|
||||||
envelope.ChangedWhen = now;
|
envelope.ChangedWhen = now;
|
||||||
}
|
}
|
||||||
@@ -230,17 +220,17 @@ public class CreateEnvelopeCommandHandler : IRequestHandler<CreateEnvelopeComman
|
|||||||
.ThenInclude(er => er.Receiver)
|
.ThenInclude(er => er.Receiver)
|
||||||
.FirstAsync(e => e.Id == envelope.Id, cancel);
|
.FirstAsync(e => e.Id == envelope.Id, cancel);
|
||||||
|
|
||||||
return _mapper.Map<EnvelopeDto>(envelope);
|
return Mapper.Map<EnvelopeDto>(envelope);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<EnvelopeSettings> ResolveEnvelopeSettingsAsync(CreateEnvelopeCommand request, Envelope? existing, CancellationToken cancel)
|
private async Task<EnvelopeSettings> ResolveEnvelopeSettingsAsync(CreateEnvelopeCommand request, Envelope? existing, CancellationToken cancel)
|
||||||
{
|
{
|
||||||
EnvelopeType? selectedType = null;
|
EnvelopeTypeDefaults? selectedType = null;
|
||||||
if (request.EnvelopeTypeId is int envelopeTypeId && envelopeTypeId > 0)
|
if (request.Type is EnvelopeType type)
|
||||||
{
|
{
|
||||||
selectedType = await EnvelopeTypeRepository.Query
|
selectedType = await EnvelopeTypeRepository.Query
|
||||||
.FirstOrDefaultAsync(t => t.Id == envelopeTypeId, cancel)
|
.FirstOrDefaultAsync(t => t.Id == type, cancel)
|
||||||
?? throw new BadRequestException($"Envelope type {envelopeTypeId} not found.");
|
?? throw new BadRequestException($"Envelope type {type} not found.");
|
||||||
}
|
}
|
||||||
|
|
||||||
var expiresWhenDays = Math.Max(0,
|
var expiresWhenDays = Math.Max(0,
|
||||||
@@ -264,21 +254,17 @@ public class CreateEnvelopeCommandHandler : IRequestHandler<CreateEnvelopeComman
|
|||||||
useAccessCode = true;
|
useAccessCode = true;
|
||||||
|
|
||||||
return new EnvelopeSettings(
|
return new EnvelopeSettings(
|
||||||
EnvelopeTypeId: request.EnvelopeTypeId ?? existing?.EnvelopeTypeId,
|
Type: request.Type ?? existing?.Type,
|
||||||
Language: ResolveLanguage(request.Language, selectedType?.Language, existing?.Language),
|
Language: ResolveLanguage(request.Language, selectedType?.Language, existing?.Language),
|
||||||
UseAccessCode: useAccessCode,
|
UseAccessCode: useAccessCode,
|
||||||
CertificationType: request.CertificationType
|
|
||||||
?? (int?)selectedType?.CertificationType
|
|
||||||
?? existing?.CertificationType
|
|
||||||
?? (int)CertificationType.AdvancedElectronicSignature,
|
|
||||||
FinalEmailToCreator: request.FinalEmailToCreator
|
FinalEmailToCreator: request.FinalEmailToCreator
|
||||||
?? (int?)selectedType?.FinalEmailToCreator
|
?? selectedType?.FinalEmailToCreator
|
||||||
?? existing?.FinalEmailToCreator
|
?? existing?.FinalEmailToCreator
|
||||||
?? (int)FinalEmailType.No,
|
?? FinalEmailType.No,
|
||||||
FinalEmailToReceivers: request.FinalEmailToReceivers
|
FinalEmailToReceivers: request.FinalEmailToReceivers
|
||||||
?? (int?)selectedType?.FinalEmailToReceivers
|
?? selectedType?.FinalEmailToReceivers
|
||||||
?? existing?.FinalEmailToReceivers
|
?? existing?.FinalEmailToReceivers
|
||||||
?? (int)FinalEmailType.No,
|
?? FinalEmailType.No,
|
||||||
SendReminderEmails: request.SendReminderEmails
|
SendReminderEmails: request.SendReminderEmails
|
||||||
?? selectedType?.SendReminderEmails
|
?? selectedType?.SendReminderEmails
|
||||||
?? existing?.SendReminderEmails
|
?? existing?.SendReminderEmails
|
||||||
@@ -296,10 +282,7 @@ public class CreateEnvelopeCommandHandler : IRequestHandler<CreateEnvelopeComman
|
|||||||
ExpiresWhenDays: expiresWhenDays,
|
ExpiresWhenDays: expiresWhenDays,
|
||||||
ExpiresWarningWhenDays: expiresWarningWhenDays,
|
ExpiresWarningWhenDays: expiresWarningWhenDays,
|
||||||
ExpiresWhen: expiresWhenDays > 0 ? DateTime.Now.AddDays(expiresWhenDays) : null,
|
ExpiresWhen: expiresWhenDays > 0 ? DateTime.Now.AddDays(expiresWhenDays) : null,
|
||||||
ExpiresWarningWhen: expiresWarningWhenDays > 0 ? DateTime.Now.AddDays(expiresWarningWhenDays) : null,
|
ExpiresWarningWhen: expiresWarningWhenDays > 0 ? DateTime.Now.AddDays(expiresWarningWhenDays) : null);
|
||||||
ContractType: existing?.ContractType
|
|
||||||
?? selectedType?.ContractType
|
|
||||||
?? (int)ContractType.Contract);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string ResolveLanguage(string? preferred, string? fallback1, string? fallback2)
|
private static string ResolveLanguage(string? preferred, string? fallback1, string? fallback2)
|
||||||
@@ -317,20 +300,18 @@ public class CreateEnvelopeCommandHandler : IRequestHandler<CreateEnvelopeComman
|
|||||||
}
|
}
|
||||||
|
|
||||||
private sealed record EnvelopeSettings(
|
private sealed record EnvelopeSettings(
|
||||||
int? EnvelopeTypeId,
|
EnvelopeType? Type,
|
||||||
string Language,
|
string Language,
|
||||||
bool UseAccessCode,
|
bool UseAccessCode,
|
||||||
int CertificationType,
|
FinalEmailType FinalEmailToCreator,
|
||||||
int FinalEmailToCreator,
|
FinalEmailType FinalEmailToReceivers,
|
||||||
int FinalEmailToReceivers,
|
|
||||||
bool SendReminderEmails,
|
bool SendReminderEmails,
|
||||||
int FirstReminderDays,
|
int FirstReminderDays,
|
||||||
int ReminderIntervalDays,
|
int ReminderIntervalDays,
|
||||||
int ExpiresWhenDays,
|
int ExpiresWhenDays,
|
||||||
int ExpiresWarningWhenDays,
|
int ExpiresWarningWhenDays,
|
||||||
DateTime? ExpiresWhen,
|
DateTime? ExpiresWhen,
|
||||||
DateTime? ExpiresWarningWhen,
|
DateTime? ExpiresWarningWhen);
|
||||||
int ContractType);
|
|
||||||
|
|
||||||
private async Task<string> ResolveSenderReferenceAsync(Envelope envelope, CancellationToken cancel)
|
private async Task<string> ResolveSenderReferenceAsync(Envelope envelope, CancellationToken cancel)
|
||||||
{
|
{
|
||||||
@@ -444,8 +425,8 @@ public class CreateEnvelopeCommandHandler : IRequestHandler<CreateEnvelopeComman
|
|||||||
ElementType = 1,
|
ElementType = 1,
|
||||||
X = field.X,
|
X = field.X,
|
||||||
Y = field.Y,
|
Y = field.Y,
|
||||||
Width = 1.77,
|
Width = SignatureFieldParams.Width,
|
||||||
Height = 1.96,
|
Height = SignatureFieldParams.Height,
|
||||||
Page = field.Page,
|
Page = field.Page,
|
||||||
Required = true,
|
Required = true,
|
||||||
ReadOnly = false,
|
ReadOnly = false,
|
||||||
@@ -501,6 +482,8 @@ public class CreateEnvelopeCommandHandler : IRequestHandler<CreateEnvelopeComman
|
|||||||
}
|
}
|
||||||
|
|
||||||
sequence++;
|
sequence++;
|
||||||
|
var accessCode = Authenticator.GenerateCode(5).ToUpperInvariant();
|
||||||
|
|
||||||
var link = await EnvelopeReceiverRepository.CreateAsync(new EnvelopeReceiver
|
var link = await EnvelopeReceiverRepository.CreateAsync(new EnvelopeReceiver
|
||||||
{
|
{
|
||||||
EnvelopeId = envelopeId,
|
EnvelopeId = envelopeId,
|
||||||
@@ -510,7 +493,7 @@ public class CreateEnvelopeCommandHandler : IRequestHandler<CreateEnvelopeComman
|
|||||||
JobTitle = string.Empty,
|
JobTitle = string.Empty,
|
||||||
CompanyName = string.Empty,
|
CompanyName = string.Empty,
|
||||||
PrivateMessage = string.Empty,
|
PrivateMessage = string.Empty,
|
||||||
AccessCode = string.Empty,
|
AccessCode = accessCode,
|
||||||
AddedWhen = now,
|
AddedWhen = now,
|
||||||
ChangedWhen = now,
|
ChangedWhen = now,
|
||||||
PhoneNumber = receiverDraft.PhoneNumber ?? string.Empty
|
PhoneNumber = receiverDraft.PhoneNumber ?? string.Empty
|
||||||
@@ -529,15 +512,15 @@ public class CreateEnvelopeCommandHandler : IRequestHandler<CreateEnvelopeComman
|
|||||||
if (!hasDocument)
|
if (!hasDocument)
|
||||||
throw new BadRequestException("Cannot send envelope without a document.");
|
throw new BadRequestException("Cannot send envelope without a document.");
|
||||||
|
|
||||||
var links = await EnvelopeReceiverRepository.Query
|
var envRcvs = await EnvelopeReceiverRepository.Query
|
||||||
.Include(er => er.Receiver)
|
.Include(er => er.Receiver)
|
||||||
.Where(er => er.EnvelopeId == envelope.Id)
|
.Where(er => er.EnvelopeId == envelope.Id)
|
||||||
.ToListAsync(cancel);
|
.ToListAsync(cancel);
|
||||||
|
|
||||||
if (links.Count == 0)
|
if (envRcvs.Count == 0)
|
||||||
throw new BadRequestException("Cannot send envelope without receivers.");
|
throw new BadRequestException("Cannot send envelope without receivers.");
|
||||||
|
|
||||||
var receiverIds = links.Select(l => l.ReceiverId).Distinct().ToList();
|
var receiverIds = envRcvs.Select(l => l.ReceiverId).Distinct().ToList();
|
||||||
var documentIds = await DocumentRepository.Query
|
var documentIds = await DocumentRepository.Query
|
||||||
.Where(d => d.EnvelopeId == envelope.Id)
|
.Where(d => d.EnvelopeId == envelope.Id)
|
||||||
.Select(d => d.Id)
|
.Select(d => d.Id)
|
||||||
@@ -550,7 +533,7 @@ public class CreateEnvelopeCommandHandler : IRequestHandler<CreateEnvelopeComman
|
|||||||
.Select(g => new { ReceiverId = g.Key, Count = g.Count() })
|
.Select(g => new { ReceiverId = g.Key, Count = g.Count() })
|
||||||
.ToDictionaryAsync(x => x.ReceiverId, x => x.Count, cancel);
|
.ToDictionaryAsync(x => x.ReceiverId, x => x.Count, cancel);
|
||||||
|
|
||||||
var receiversWithoutFields = links
|
var receiversWithoutFields = envRcvs
|
||||||
.Where(link => !receiverFieldCounts.TryGetValue(link.ReceiverId, out var count) || count <= 0)
|
.Where(link => !receiverFieldCounts.TryGetValue(link.ReceiverId, out var count) || count <= 0)
|
||||||
.Select(link => link.Name)
|
.Select(link => link.Name)
|
||||||
.ToList();
|
.ToList();
|
||||||
@@ -574,70 +557,38 @@ public class CreateEnvelopeCommandHandler : IRequestHandler<CreateEnvelopeComman
|
|||||||
Status = EnvelopeStatus.EnvelopeQueued
|
Status = EnvelopeStatus.EnvelopeQueued
|
||||||
}, cancel);
|
}, cancel);
|
||||||
|
|
||||||
await QueueInvitationEmailsAsync(envelope, links, userReference, cancel);
|
await SendInvitationEmailsAsync(envelope, envRcvs, cancel);
|
||||||
|
|
||||||
envelope.Status = EnvelopeStatus.EnvelopeQueued;
|
envelope.Status = EnvelopeStatus.EnvelopeQueued;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task QueueInvitationEmailsAsync(
|
private async Task SendInvitationEmailsAsync(
|
||||||
Envelope envelope,
|
Envelope envelope,
|
||||||
IReadOnlyCollection<EnvelopeReceiver> links,
|
IReadOnlyCollection<EnvelopeReceiver> envRcvs,
|
||||||
string senderReference,
|
|
||||||
CancellationToken cancel)
|
CancellationToken cancel)
|
||||||
{
|
{
|
||||||
var template = await EmailTemplateRepository.Query
|
foreach (var er in envRcvs)
|
||||||
.SingleOrDefaultAsync(x => x.Name == EmailTemplateType.DocumentReceived.ToString(), cancel)
|
|
||||||
?? throw new InvalidOperationException($"Email template not found: {EmailTemplateType.DocumentReceived}");
|
|
||||||
|
|
||||||
var signatureHost = await ConfigService.ReadDefaultSignatureHost();
|
|
||||||
var senderName = senderReference;
|
|
||||||
|
|
||||||
foreach (var link in links)
|
|
||||||
{
|
{
|
||||||
var receiver = link.Receiver;
|
var origin = new Uri(ReqCntxt.Origin ?? throw new InvalidOperationException($"The request origin is missing in {nameof(CreateEnvelopeCommandHandler)}."));
|
||||||
if (receiver is null || string.IsNullOrWhiteSpace(receiver.EmailAddress) || string.IsNullOrWhiteSpace(receiver.Signature))
|
try
|
||||||
continue;
|
|
||||||
|
|
||||||
var envelopeKey = (envelope.Uuid, receiver.Signature).ToEnvelopeKey();
|
|
||||||
var documentLink = $"{signatureHost.TrimEnd('/')}/envelope/login/{Uri.EscapeDataString(envelopeKey)}";
|
|
||||||
|
|
||||||
var placeholders = new Dictionary<string, string>(MailParams.Placeholders)
|
|
||||||
{
|
{
|
||||||
["[NAME_RECEIVER]"] = link.Name ?? string.Empty,
|
await EnvNtfService.Notify(er.Receiver.EmailAddress, new DocumentReceivedNotification
|
||||||
["[NAME_SENDER]"] = senderName ?? string.Empty,
|
{
|
||||||
["[DOCUMENT_TITLE]"] = envelope.Title ?? string.Empty,
|
AdvancedSignature = envelope.Type == EnvelopeType.AdvancedSignature,
|
||||||
["[MESSAGE]"] = envelope.Message ?? string.Empty,
|
DocumentTitle = envelope.Title ?? string.Empty,
|
||||||
["[LINK_TO_DOCUMENT]"] = documentLink,
|
NameReceiver = er.Name ?? string.Empty,
|
||||||
["[LINK_TO_DOCUMENT_TEXT]"] = documentLink[..Math.Min(40, documentLink.Length)] + ".."
|
EnvelopeUuid = envelope.Uuid,
|
||||||
};
|
IsReadAndConfirm = envelope.IsReadAndConfirm(),
|
||||||
|
Message = envelope.Message ?? string.Empty,
|
||||||
var subject = ReplacePlaceHolders(template.Subject, placeholders);
|
NameSender = $"{envelope.User.Prename} {envelope.User.Name}",
|
||||||
var body = ReplacePlaceHolders(template.Body, placeholders);
|
Origin = origin,
|
||||||
|
ReceiverSignature = er.Receiver.Signature,
|
||||||
var emailOut = new EmailOut
|
}, cancel);
|
||||||
|
}
|
||||||
|
catch(Exception ex)
|
||||||
{
|
{
|
||||||
EmailAddress = receiver.EmailAddress,
|
Logger.LogError(ex, "Failed to send invitation email for receiver {emailAddress} in envelope {envelopeId}.", er.Receiver.EmailAddress, envelope.Id);
|
||||||
EmailSubj = subject,
|
}
|
||||||
EmailBody = body,
|
|
||||||
AddedWhen = DateTime.Now,
|
|
||||||
AddedWho = DispatcherParams.AddedWho,
|
|
||||||
SendingProfile = DispatcherParams.SendingProfile,
|
|
||||||
ReminderTypeId = DispatcherParams.ReminderTypeId,
|
|
||||||
EmailAttmt1 = DispatcherParams.EmailAttmt1,
|
|
||||||
WfId = (int)EnvelopeStatus.MessageInvitationSent,
|
|
||||||
ReferenceString = receiver.EmailAddress,
|
|
||||||
ReferenceId = link.ReceiverId
|
|
||||||
};
|
|
||||||
|
|
||||||
await EmailOutRepository.CreateAsync(emailOut, cancel);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string ReplacePlaceHolders(string text, Dictionary<string, string> placeHolders)
|
|
||||||
{
|
|
||||||
foreach (var placeHolder in placeHolders)
|
|
||||||
text = text.Replace(placeHolder.Key, placeHolder.Value);
|
|
||||||
|
|
||||||
return text;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,9 @@
|
|||||||
using EnvelopeGenerator.Domain.Constants;
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
using EnvelopeGenerator.Application.Common.Query;
|
using EnvelopeGenerator.Application.Common.Query;
|
||||||
using EnvelopeGenerator.Application.Common.Dto;
|
using EnvelopeGenerator.Application.Common.Dto;
|
||||||
|
using EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver;
|
||||||
|
using EnvelopeGenerator.Application.Common.Dto.History;
|
||||||
|
using EnvelopeGenerator.Application.Common.Dto.Receiver;
|
||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using DigitalData.Core.Abstraction.Application.Repository;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
@@ -14,6 +17,11 @@ namespace EnvelopeGenerator.Application.Envelopes.Queries;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public record ReadEnvelopeQuery : EnvelopeQueryBase, IRequest<IEnumerable<EnvelopeDto>>
|
public record ReadEnvelopeQuery : EnvelopeQueryBase, IRequest<IEnumerable<EnvelopeDto>>
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public bool IncludeDocAndDocRes { get; init; } = true;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -148,8 +156,86 @@ public class ReadEnvelopeQueryHandler : IRequestHandler<ReadEnvelopeQuery, IEnum
|
|||||||
if (request is { OnlyCompleted: true })
|
if (request is { OnlyCompleted: true })
|
||||||
query = query.Where(e => Status.Completed.Contains(e.Status));
|
query = query.Where(e => Status.Completed.Contains(e.Status));
|
||||||
|
|
||||||
|
if (!request.IncludeDocAndDocRes)
|
||||||
|
{
|
||||||
|
return await query
|
||||||
|
.Select(e => new EnvelopeDto
|
||||||
|
{
|
||||||
|
Id = e.Id,
|
||||||
|
UserId = e.UserId,
|
||||||
|
Status = e.Status,
|
||||||
|
StatusName = string.Empty,
|
||||||
|
Uuid = e.Uuid,
|
||||||
|
Message = e.Message,
|
||||||
|
AddedWhen = e.AddedWhen,
|
||||||
|
ChangedWhen = e.ChangedWhen,
|
||||||
|
Title = e.Title ?? string.Empty,
|
||||||
|
Language = e.Language,
|
||||||
|
Type = e.Type,
|
||||||
|
FinalEmailToCreator = e.FinalEmailToCreator,
|
||||||
|
FinalEmailToReceivers = e.FinalEmailToReceivers,
|
||||||
|
SendReminderEmails = e.SendReminderEmails,
|
||||||
|
FirstReminderDays = e.FirstReminderDays,
|
||||||
|
ReminderIntervalDays = e.ReminderIntervalDays,
|
||||||
|
ExpiresWhenDays = e.ExpiresWhenDays,
|
||||||
|
ExpiresWarningWhenDays = e.ExpiresWarningWhenDays,
|
||||||
|
UseAccessCode = e.UseAccessCode ?? true,
|
||||||
|
TFAEnabled = e.TfaEnabled ?? false,
|
||||||
|
EnvelopeTypeTitle = e.Defaults != null ? e.Defaults.Title : null,
|
||||||
|
IsAlreadySent = false,
|
||||||
|
DocResult = null,
|
||||||
|
Documents = null,
|
||||||
|
EnvelopeReceivers = e.EnvelopeReceivers.Select(er => new EnvelopeReceiverDto
|
||||||
|
{
|
||||||
|
EnvelopeId = er.EnvelopeId,
|
||||||
|
ReceiverId = er.ReceiverId,
|
||||||
|
Sequence = er.Sequence,
|
||||||
|
Name = er.Name,
|
||||||
|
JobTitle = er.JobTitle,
|
||||||
|
CompanyName = er.CompanyName,
|
||||||
|
PrivateMessage = er.PrivateMessage,
|
||||||
|
AccessCode = er.AccessCode,
|
||||||
|
AddedWhen = er.AddedWhen,
|
||||||
|
ChangedWhen = er.ChangedWhen,
|
||||||
|
HasPhoneNumber = er.HasPhoneNumber,
|
||||||
|
Receiver = er.Receiver == null
|
||||||
|
? null
|
||||||
|
: new ReceiverDto
|
||||||
|
{
|
||||||
|
Id = er.Receiver.Id,
|
||||||
|
EmailAddress = er.Receiver.EmailAddress,
|
||||||
|
Signature = er.Receiver.Signature,
|
||||||
|
AddedWhen = er.Receiver.AddedWhen,
|
||||||
|
TfaRegDeadline = er.Receiver.TfaRegDeadline
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
Histories = e.Histories.Select(h => new HistoryDto
|
||||||
|
{
|
||||||
|
Id = h.Id,
|
||||||
|
EnvelopeId = h.EnvelopeId,
|
||||||
|
UserReference = h.UserReference,
|
||||||
|
Status = h.Status,
|
||||||
|
StatusName = null,
|
||||||
|
AddedWhen = h.AddedWhen,
|
||||||
|
ActionDate = h.ActionDate,
|
||||||
|
Comment = h.Comment,
|
||||||
|
Receiver = h.Receiver == null
|
||||||
|
? null
|
||||||
|
: new ReceiverDto
|
||||||
|
{
|
||||||
|
Id = h.Receiver.Id,
|
||||||
|
EmailAddress = h.Receiver.EmailAddress,
|
||||||
|
Signature = h.Receiver.Signature,
|
||||||
|
AddedWhen = h.Receiver.AddedWhen,
|
||||||
|
TfaRegDeadline = h.Receiver.TfaRegDeadline
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.ToListAsync(cancel);
|
||||||
|
}
|
||||||
|
|
||||||
var envelopes = await query
|
var envelopes = await query
|
||||||
.Include(e => e.Type)
|
.Include(e => e.Defaults)
|
||||||
.Include(e => e.EnvelopeReceivers).ThenInclude(er => er.Receiver)
|
.Include(e => e.EnvelopeReceivers).ThenInclude(er => er.Receiver)
|
||||||
.Include(e => e.Histories)
|
.Include(e => e.Histories)
|
||||||
.ToListAsync(cancel);
|
.ToListAsync(cancel);
|
||||||
|
|||||||
@@ -98,7 +98,8 @@ public class FinalizeEnvelopeCommandHandler(IRepository<Envelope> Repo, ISender
|
|||||||
{
|
{
|
||||||
DocumentTitle = envelope.Title,
|
DocumentTitle = envelope.Title,
|
||||||
NameReceiver = er.Name,
|
NameReceiver = er.Name,
|
||||||
Attachment = doc
|
Attachments = [($"unterzeichnetes-dokument.pdf", doc)],
|
||||||
|
IsReadAndConfirm = envelope.IsReadAndConfirm(),
|
||||||
}, cancel);
|
}, cancel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -622,10 +622,10 @@
|
|||||||
<value>Zertifizierungstyp</value>
|
<value>Zertifizierungstyp</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="FinalEmailToCreator" xml:space="preserve">
|
<data name="FinalEmailToCreator" xml:space="preserve">
|
||||||
<value>Finale E-Mail an Ersteller</value>
|
<value>Abgeschlossenes Dokument an Ersteller</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="FinalEmailToReceivers" xml:space="preserve">
|
<data name="FinalEmailToReceivers" xml:space="preserve">
|
||||||
<value>Finale E-Mail an Empfänger</value>
|
<value>Abgeschlossenes Dokument an Empfänger</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="SendReminderEmails" xml:space="preserve">
|
<data name="SendReminderEmails" xml:space="preserve">
|
||||||
<value>Erinnerungs-E-Mails senden</value>
|
<value>Erinnerungs-E-Mails senden</value>
|
||||||
@@ -703,10 +703,19 @@
|
|||||||
<data name="ReceiverLogin_AccessCode_Placeholder" xml:space="preserve"><value>Zugangscode eingeben</value></data>
|
<data name="ReceiverLogin_AccessCode_Placeholder" xml:space="preserve"><value>Zugangscode eingeben</value></data>
|
||||||
<data name="ReceiverLogin_Description" xml:space="preserve"><value>Bitte geben Sie den Zugangscode ein, den Sie per E-Mail erhalten haben, um das Dokument sicher zu öffnen.</value></data>
|
<data name="ReceiverLogin_Description" xml:space="preserve"><value>Bitte geben Sie den Zugangscode ein, den Sie per E-Mail erhalten haben, um das Dokument sicher zu öffnen.</value></data>
|
||||||
<data name="ReceiverLogin_FooterHelp" xml:space="preserve"><value>Bei Problemen wenden Sie sich bitte an den Absender des Dokuments.</value></data>
|
<data name="ReceiverLogin_FooterHelp" xml:space="preserve"><value>Bei Problemen wenden Sie sich bitte an den Absender des Dokuments.</value></data>
|
||||||
|
<data name="ReceiverLogin_InfoTitle" xml:space="preserve"><value>Sicherheit ist uns wichtig.</value></data>
|
||||||
|
<data name="ReceiverLogin_InfoStep1" xml:space="preserve"><value>Direkt nachdem Sie den Link zum Unterzeichnen geöffnet haben, haben wir Ihnen eine zweite E-Mail gesendet.</value></data>
|
||||||
|
<data name="ReceiverLogin_InfoStep2" xml:space="preserve"><value>Darin finden Sie den Zugangscode, den Sie hier eingeben müssen.</value></data>
|
||||||
<data name="ReceiverLogin_InvalidCode_Body" xml:space="preserve"><value>Der eingegebene Code ist falsch. Bitte versuchen Sie es erneut.</value></data>
|
<data name="ReceiverLogin_InvalidCode_Body" xml:space="preserve"><value>Der eingegebene Code ist falsch. Bitte versuchen Sie es erneut.</value></data>
|
||||||
<data name="ReceiverLogin_InvalidCode_Title" xml:space="preserve"><value>Ungültiger Zugangscode.</value></data>
|
<data name="ReceiverLogin_InvalidCode_Title" xml:space="preserve"><value>Ungültiger Zugangscode.</value></data>
|
||||||
<data name="ReceiverLogin_NotFound_Body" xml:space="preserve"><value>Der angegebene Zugangscode konnte keinem Dokument zugeordnet werden. Bitte prüfen Sie den Link in Ihrer E-Mail.</value></data>
|
<data name="ReceiverLogin_NotFound_Body" xml:space="preserve"><value>Der angegebene Zugangscode konnte keinem Dokument zugeordnet werden. Bitte prüfen Sie den Link in Ihrer E-Mail.</value></data>
|
||||||
<data name="ReceiverLogin_NotFound_Title" xml:space="preserve"><value>Dokument nicht gefunden.</value></data>
|
<data name="ReceiverLogin_NotFound_Title" xml:space="preserve"><value>Dokument nicht gefunden.</value></data>
|
||||||
|
<data name="ReceiverLogin_ResendAction" xml:space="preserve"><value>Code erneut senden</value></data>
|
||||||
|
<data name="ReceiverLogin_ResendError" xml:space="preserve"><value>Der Zugangscode konnte nicht erneut gesendet werden. Bitte versuchen Sie es später erneut.</value></data>
|
||||||
|
<data name="ReceiverLogin_ResendInProgress" xml:space="preserve"><value>Code wird gesendet ...</value></data>
|
||||||
|
<data name="ReceiverLogin_ResendPrompt" xml:space="preserve"><value>Zugangscode nicht bekommen?</value></data>
|
||||||
|
<data name="ReceiverLogin_ResendRateLimit" xml:space="preserve"><value>Sie haben soeben einen Code angefordert. Bitte warten Sie kurz und versuchen Sie es erneut.</value></data>
|
||||||
|
<data name="ReceiverLogin_ResendSuccess" xml:space="preserve"><value>Wir haben Ihnen soeben einen neuen Zugangscode per E-Mail gesendet.</value></data>
|
||||||
<data name="ReceiverLogin_Subtitle" xml:space="preserve"><value>Sicherer Zugang mit Zugangscode</value></data>
|
<data name="ReceiverLogin_Subtitle" xml:space="preserve"><value>Sicherer Zugang mit Zugangscode</value></data>
|
||||||
<data name="ReceiverSigned_ConfirmBody" xml:space="preserve"><value>Diese Aktion kann nicht rückgängig gemacht werden. Mit der Bestätigung erklären Sie, das oben angezeigte Dokument elektronisch unterzeichnet zu haben. Das unterzeichnete Dokument wird anschließend an alle beteiligten Parteien übermittelt.</value></data>
|
<data name="ReceiverSigned_ConfirmBody" xml:space="preserve"><value>Diese Aktion kann nicht rückgängig gemacht werden. Mit der Bestätigung erklären Sie, das oben angezeigte Dokument elektronisch unterzeichnet zu haben. Das unterzeichnete Dokument wird anschließend an alle beteiligten Parteien übermittelt.</value></data>
|
||||||
<data name="ReceiverSigned_ConfirmQuestion" xml:space="preserve"><value>Möchten Sie das Dokument verbindlich unterschreiben?</value></data>
|
<data name="ReceiverSigned_ConfirmQuestion" xml:space="preserve"><value>Möchten Sie das Dokument verbindlich unterschreiben?</value></data>
|
||||||
@@ -749,11 +758,25 @@
|
|||||||
<data name="SenderEditor_PageLabel" xml:space="preserve"><value>Seite</value></data>
|
<data name="SenderEditor_PageLabel" xml:space="preserve"><value>Seite</value></data>
|
||||||
<data name="SenderEditor_PlaceSignatureField" xml:space="preserve"><value>Signaturfeld platzieren</value></data>
|
<data name="SenderEditor_PlaceSignatureField" xml:space="preserve"><value>Signaturfeld platzieren</value></data>
|
||||||
<data name="SenderEditor_RemoveAllSignatureFields" xml:space="preserve"><value>Alle Signaturfelder entfernen</value></data>
|
<data name="SenderEditor_RemoveAllSignatureFields" xml:space="preserve"><value>Alle Signaturfelder entfernen</value></data>
|
||||||
|
<data name="SenderEditor_RemoveAllSignatureFieldsConfirm" xml:space="preserve"><value>Diese Aktion entfernt alle platzierten Signaturfelder unwiderruflich. Fortfahren?</value></data>
|
||||||
<data name="SenderEditor_SelectPdf" xml:space="preserve"><value>Bitte wählen Sie eine PDF-Datei aus.</value></data>
|
<data name="SenderEditor_SelectPdf" xml:space="preserve"><value>Bitte wählen Sie eine PDF-Datei aus.</value></data>
|
||||||
|
<data name="SenderEditor_SendConfirm_Message" xml:space="preserve"><value>Wollen Sie den Umschlag jetzt versenden? Hinweis: Nach der Übergabe kann der Vorgang nicht mehr bearbeitet werden.</value></data>
|
||||||
|
<data name="SenderEditor_SendConfirm_Title" xml:space="preserve"><value>Umschlag jetzt versenden?</value></data>
|
||||||
|
<data name="SenderEditor_SendConfirm_Note" xml:space="preserve"><value>Bitte prüfen Sie Empfänger, Signaturfelder und Einstellungen vor dem Versenden.</value></data>
|
||||||
|
<data name="SenderEditor_SendConfirm_Action" xml:space="preserve"><value>Jetzt versenden</value></data>
|
||||||
|
<data name="SenderEditor_SendConfirm_InProgress" xml:space="preserve"><value>Umschlag wird versendet...</value></data>
|
||||||
|
<data name="SenderEditor_SendConfirm_InProgressHint" xml:space="preserve"><value>Bitte warten Sie einen Moment. Der Vorgang wird abgeschlossen.</value></data>
|
||||||
<data name="SenderEditor_Sent_Body" xml:space="preserve"><value>Der bestehende Entwurf wurde versendet.</value></data>
|
<data name="SenderEditor_Sent_Body" xml:space="preserve"><value>Der bestehende Entwurf wurde versendet.</value></data>
|
||||||
<data name="SenderEditor_Sent_Header" xml:space="preserve"><value>Umschlag gesendet</value></data>
|
<data name="SenderEditor_Sent_Header" xml:space="preserve"><value>Umschlag gesendet</value></data>
|
||||||
<data name="SenderEditor_Sent_Title" xml:space="preserve"><value>Umschlag wurde erfolgreich gesendet.</value></data>
|
<data name="SenderEditor_Sent_Title" xml:space="preserve"><value>Umschlag wurde erfolgreich gesendet.</value></data>
|
||||||
<data name="SenderEditor_SignatureField" xml:space="preserve"><value>Signaturfeld</value></data>
|
<data name="SenderEditor_SignatureField" xml:space="preserve"><value>Signaturfeld</value></data>
|
||||||
|
<data name="Receiver_SignField_ClickToSign" xml:space="preserve"><value>Hier unterschreiben</value></data>
|
||||||
|
<data name="Receiver_Signing_Instruction" xml:space="preserve"><value>Bitte klicken Sie auf jedes markierte Feld, um zu unterschreiben.</value></data>
|
||||||
|
<data name="Receiver_SignNav_Previous" xml:space="preserve"><value>Vorheriges Feld</value></data>
|
||||||
|
<data name="Receiver_SignNav_Next" xml:space="preserve"><value>Nächstes Feld</value></data>
|
||||||
|
<data name="Receiver_SignNav_Position" xml:space="preserve"><value>{0} / {1}</value></data>
|
||||||
|
<data name="Receiver_SignNav_PositionWithLabel" xml:space="preserve"><value>{0} / {1} Signaturen</value></data>
|
||||||
|
<data name="Receiver_Signature_Singular" xml:space="preserve"><value>Unterschrift</value></data>
|
||||||
<data name="SenderEditor_Title_Placeholder" xml:space="preserve"><value>z.B. Arbeitsvertrag 2025</value></data>
|
<data name="SenderEditor_Title_Placeholder" xml:space="preserve"><value>z.B. Arbeitsvertrag 2025</value></data>
|
||||||
<data name="SenderEditor_ToOverview" xml:space="preserve"><value>Zur Übersicht</value></data>
|
<data name="SenderEditor_ToOverview" xml:space="preserve"><value>Zur Übersicht</value></data>
|
||||||
<data name="SenderEditor_UploadPdfToPlaceFields" xml:space="preserve"><value>Laden Sie eine PDF-Datei hoch, um Signaturfelder zu platzieren.</value></data>
|
<data name="SenderEditor_UploadPdfToPlaceFields" xml:space="preserve"><value>Laden Sie eine PDF-Datei hoch, um Signaturfelder zu platzieren.</value></data>
|
||||||
@@ -765,18 +788,27 @@
|
|||||||
<data name="SenderEditor_Validation_SignatureFieldRequired" xml:space="preserve"><value>Bitte platzieren Sie mindestens ein Signaturfeld.</value></data>
|
<data name="SenderEditor_Validation_SignatureFieldRequired" xml:space="preserve"><value>Bitte platzieren Sie mindestens ein Signaturfeld.</value></data>
|
||||||
<data name="SenderEditor_Validation_TitleRequired" xml:space="preserve"><value>Bitte geben Sie einen Titel ein.</value></data>
|
<data name="SenderEditor_Validation_TitleRequired" xml:space="preserve"><value>Bitte geben Sie einen Titel ein.</value></data>
|
||||||
<data name="SenderEditor_Validation_UploadPdf" xml:space="preserve"><value>Bitte laden Sie zuerst ein PDF-Dokument hoch.</value></data>
|
<data name="SenderEditor_Validation_UploadPdf" xml:space="preserve"><value>Bitte laden Sie zuerst ein PDF-Dokument hoch.</value></data>
|
||||||
<data name="SenderLogin_Description" xml:space="preserve"><value>Bitte melden Sie sich mit Ihren Zugangsdaten an, um auf das Sender-Dashboard zuzugreifen.</value></data>
|
<data name="SenderLogin_BackToHome" xml:space="preserve"><value>← Zurück zur Startseite</value></data>
|
||||||
|
<data name="SenderLogin_Description" xml:space="preserve"><value>Melden Sie sich mit denselben Zugangsdaten an wie an Ihrem Arbeitsplatz-PC.</value></data>
|
||||||
<data name="SenderLogin_FooterHelp" xml:space="preserve"><value>Bei Problemen wenden Sie sich bitte an den Administrator.</value></data>
|
<data name="SenderLogin_FooterHelp" xml:space="preserve"><value>Bei Problemen wenden Sie sich bitte an den Administrator.</value></data>
|
||||||
<data name="SenderLogin_InvalidCredentials_Body" xml:space="preserve"><value>Benutzername oder Passwort ist falsch. Bitte versuchen Sie es erneut.</value></data>
|
<data name="SenderLogin_InvalidCredentials_Body" xml:space="preserve"><value>Benutzername oder Passwort ist falsch. Bitte versuchen Sie es erneut.</value></data>
|
||||||
<data name="SenderLogin_InvalidCredentials_Title" xml:space="preserve"><value>Ungültige Anmeldedaten.</value></data>
|
<data name="SenderLogin_InvalidCredentials_Title" xml:space="preserve"><value>Ungültige Anmeldedaten.</value></data>
|
||||||
<data name="SenderLogin_Password_Placeholder" xml:space="preserve"><value>Passwort eingeben</value></data>
|
<data name="SenderLogin_Password_Placeholder" xml:space="preserve"><value>Passwort eingeben</value></data>
|
||||||
<data name="SenderLogin_Subtitle" xml:space="preserve"><value>Sicherer Zugang zum Sender-Dashboard</value></data>
|
<data name="SenderLogin_RequiredFields_Body" xml:space="preserve"><value>Bitte Benutzername und Passwort eingeben.</value></data>
|
||||||
<data name="SenderLogin_Title" xml:space="preserve"><value>Sender Anmeldung</value></data>
|
<data name="SenderLogin_RequiredFields_Title" xml:space="preserve"><value>Pflichtfelder fehlen.</value></data>
|
||||||
|
<data name="SenderLogin_Subtitle" xml:space="preserve"><value>Dokumente zur Unterschrift vorbereiten und versenden</value></data>
|
||||||
|
<data name="SenderLogin_Title" xml:space="preserve"><value>Anmeldung</value></data>
|
||||||
|
<data name="SenderLogin_Username_Label" xml:space="preserve"><value>Benutzername, z. B. m.mustermann</value></data>
|
||||||
|
<data name="SenderLogin_Username_Placeholder" xml:space="preserve"><value>z. B. m.mustermann</value></data>
|
||||||
<data name="SenderLogin_Username_Placeholder" xml:space="preserve"><value>Benutzername eingeben</value></data>
|
<data name="SenderLogin_Username_Placeholder" xml:space="preserve"><value>Benutzername eingeben</value></data>
|
||||||
<data name="ServerError" xml:space="preserve"><value>Serverfehler.</value></data>
|
<data name="ServerError" xml:space="preserve"><value>Serverfehler.</value></data>
|
||||||
<data name="Signed" xml:space="preserve"><value>Unterschrieben</value></data>
|
<data name="Signed" xml:space="preserve"><value>Unterschrieben</value></data>
|
||||||
<data name="SignedDocument" xml:space="preserve"><value>Signiertes Dokument</value></data>
|
<data name="SignedDocument" xml:space="preserve"><value>Signiertes Dokument</value></data>
|
||||||
<data name="System" xml:space="preserve"><value>System</value></data>
|
<data name="System" xml:space="preserve"><value>System</value></data>
|
||||||
|
<data name="SenderWizard_Step_Start" xml:space="preserve"><value>Start</value></data>
|
||||||
|
<data name="SenderWizard_DocumentUploadSimpleHint" xml:space="preserve"><value>Dokument hinzufuegen: klicken oder per Drag-and-Drop ablegen</value></data>
|
||||||
|
<data name="SenderWizard_DocumentReplaceHint" xml:space="preserve"><value>Zum Ersetzen klicken oder eine Datei auf diese Flaeche ziehen.</value></data>
|
||||||
|
<data name="SenderWizard_FinalUploadHint" xml:space="preserve"><value>Letzte Moeglichkeit im Wizard: Bitte laden Sie jetzt Ihr PDF ueber den rechten Upload-Bereich hoch. Im Editor koennen Sie spaeter ebenfalls ein Dokument hochladen oder ersetzen.</value></data>
|
||||||
<data name="UnexpectedErrorTryAgainLater" xml:space="preserve"><value>Ein unerwarteter Fehler ist aufgetreten. Bitte versuchen Sie es später erneut.</value></data>
|
<data name="UnexpectedErrorTryAgainLater" xml:space="preserve"><value>Ein unerwarteter Fehler ist aufgetreten. Bitte versuchen Sie es später erneut.</value></data>
|
||||||
<data name="UploadPdf" xml:space="preserve"><value>PDF hochladen</value></data>
|
<data name="UploadPdf" xml:space="preserve"><value>PDF hochladen</value></data>
|
||||||
<data name="UserName" xml:space="preserve"><value>Benutzername</value></data>
|
<data name="UserName" xml:space="preserve"><value>Benutzername</value></data>
|
||||||
|
|||||||
@@ -622,10 +622,10 @@
|
|||||||
<value>Certification Type</value>
|
<value>Certification Type</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="FinalEmailToCreator" xml:space="preserve">
|
<data name="FinalEmailToCreator" xml:space="preserve">
|
||||||
<value>Final Email to Creator</value>
|
<value>Completed Document to Creator</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="FinalEmailToReceivers" xml:space="preserve">
|
<data name="FinalEmailToReceivers" xml:space="preserve">
|
||||||
<value>Final Email to Receivers</value>
|
<value>Completed Document to Receivers</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="SendReminderEmails" xml:space="preserve">
|
<data name="SendReminderEmails" xml:space="preserve">
|
||||||
<value>Send Reminder Emails</value>
|
<value>Send Reminder Emails</value>
|
||||||
@@ -703,10 +703,19 @@
|
|||||||
<data name="ReceiverLogin_AccessCode_Placeholder" xml:space="preserve"><value>Enter access code</value></data>
|
<data name="ReceiverLogin_AccessCode_Placeholder" xml:space="preserve"><value>Enter access code</value></data>
|
||||||
<data name="ReceiverLogin_Description" xml:space="preserve"><value>Please enter the access code you received by email to securely open the document.</value></data>
|
<data name="ReceiverLogin_Description" xml:space="preserve"><value>Please enter the access code you received by email to securely open the document.</value></data>
|
||||||
<data name="ReceiverLogin_FooterHelp" xml:space="preserve"><value>If you have issues, please contact the document sender.</value></data>
|
<data name="ReceiverLogin_FooterHelp" xml:space="preserve"><value>If you have issues, please contact the document sender.</value></data>
|
||||||
|
<data name="ReceiverLogin_InfoTitle" xml:space="preserve"><value>Your security matters to us.</value></data>
|
||||||
|
<data name="ReceiverLogin_InfoStep1" xml:space="preserve"><value>Right after you opened the signing link, we sent you a second email.</value></data>
|
||||||
|
<data name="ReceiverLogin_InfoStep2" xml:space="preserve"><value>That email contains the access code you need to enter here.</value></data>
|
||||||
<data name="ReceiverLogin_InvalidCode_Body" xml:space="preserve"><value>The entered code is incorrect. Please try again.</value></data>
|
<data name="ReceiverLogin_InvalidCode_Body" xml:space="preserve"><value>The entered code is incorrect. Please try again.</value></data>
|
||||||
<data name="ReceiverLogin_InvalidCode_Title" xml:space="preserve"><value>Invalid access code.</value></data>
|
<data name="ReceiverLogin_InvalidCode_Title" xml:space="preserve"><value>Invalid access code.</value></data>
|
||||||
<data name="ReceiverLogin_NotFound_Body" xml:space="preserve"><value>The provided access code could not be matched to a document. Please verify the link in your email.</value></data>
|
<data name="ReceiverLogin_NotFound_Body" xml:space="preserve"><value>The provided access code could not be matched to a document. Please verify the link in your email.</value></data>
|
||||||
<data name="ReceiverLogin_NotFound_Title" xml:space="preserve"><value>Document not found.</value></data>
|
<data name="ReceiverLogin_NotFound_Title" xml:space="preserve"><value>Document not found.</value></data>
|
||||||
|
<data name="ReceiverLogin_ResendAction" xml:space="preserve"><value>Resend code</value></data>
|
||||||
|
<data name="ReceiverLogin_ResendError" xml:space="preserve"><value>The access code could not be resent. Please try again later.</value></data>
|
||||||
|
<data name="ReceiverLogin_ResendInProgress" xml:space="preserve"><value>Sending code ...</value></data>
|
||||||
|
<data name="ReceiverLogin_ResendPrompt" xml:space="preserve"><value>Did not receive the access code?</value></data>
|
||||||
|
<data name="ReceiverLogin_ResendRateLimit" xml:space="preserve"><value>You just requested a code. Please wait a moment and try again.</value></data>
|
||||||
|
<data name="ReceiverLogin_ResendSuccess" xml:space="preserve"><value>We just sent you a new access code by email.</value></data>
|
||||||
<data name="ReceiverLogin_Subtitle" xml:space="preserve"><value>Secure access with access code</value></data>
|
<data name="ReceiverLogin_Subtitle" xml:space="preserve"><value>Secure access with access code</value></data>
|
||||||
<data name="ReceiverSigned_ConfirmBody" xml:space="preserve"><value>This action cannot be undone. By confirming, you declare that you have electronically signed the document shown above. The signed document will then be delivered to all involved parties.</value></data>
|
<data name="ReceiverSigned_ConfirmBody" xml:space="preserve"><value>This action cannot be undone. By confirming, you declare that you have electronically signed the document shown above. The signed document will then be delivered to all involved parties.</value></data>
|
||||||
<data name="ReceiverSigned_ConfirmQuestion" xml:space="preserve"><value>Do you want to sign this document as binding?</value></data>
|
<data name="ReceiverSigned_ConfirmQuestion" xml:space="preserve"><value>Do you want to sign this document as binding?</value></data>
|
||||||
@@ -749,11 +758,25 @@
|
|||||||
<data name="SenderEditor_PageLabel" xml:space="preserve"><value>Page</value></data>
|
<data name="SenderEditor_PageLabel" xml:space="preserve"><value>Page</value></data>
|
||||||
<data name="SenderEditor_PlaceSignatureField" xml:space="preserve"><value>Place signature field</value></data>
|
<data name="SenderEditor_PlaceSignatureField" xml:space="preserve"><value>Place signature field</value></data>
|
||||||
<data name="SenderEditor_RemoveAllSignatureFields" xml:space="preserve"><value>Remove all signature fields</value></data>
|
<data name="SenderEditor_RemoveAllSignatureFields" xml:space="preserve"><value>Remove all signature fields</value></data>
|
||||||
|
<data name="SenderEditor_RemoveAllSignatureFieldsConfirm" xml:space="preserve"><value>This action will permanently remove all placed signature fields. Continue?</value></data>
|
||||||
<data name="SenderEditor_SelectPdf" xml:space="preserve"><value>Please select a PDF file.</value></data>
|
<data name="SenderEditor_SelectPdf" xml:space="preserve"><value>Please select a PDF file.</value></data>
|
||||||
|
<data name="SenderEditor_SendConfirm_Message" xml:space="preserve"><value>Do you want to send the envelope now? Note: After handover, the process can no longer be edited.</value></data>
|
||||||
|
<data name="SenderEditor_SendConfirm_Title" xml:space="preserve"><value>Send envelope now?</value></data>
|
||||||
|
<data name="SenderEditor_SendConfirm_Note" xml:space="preserve"><value>Please review recipients, signature fields, and settings before sending.</value></data>
|
||||||
|
<data name="SenderEditor_SendConfirm_Action" xml:space="preserve"><value>Send now</value></data>
|
||||||
|
<data name="SenderEditor_SendConfirm_InProgress" xml:space="preserve"><value>Sending envelope...</value></data>
|
||||||
|
<data name="SenderEditor_SendConfirm_InProgressHint" xml:space="preserve"><value>Please wait a moment while we complete the process.</value></data>
|
||||||
<data name="SenderEditor_Sent_Body" xml:space="preserve"><value>The existing draft has been sent.</value></data>
|
<data name="SenderEditor_Sent_Body" xml:space="preserve"><value>The existing draft has been sent.</value></data>
|
||||||
<data name="SenderEditor_Sent_Header" xml:space="preserve"><value>Envelope sent</value></data>
|
<data name="SenderEditor_Sent_Header" xml:space="preserve"><value>Envelope sent</value></data>
|
||||||
<data name="SenderEditor_Sent_Title" xml:space="preserve"><value>Envelope was sent successfully.</value></data>
|
<data name="SenderEditor_Sent_Title" xml:space="preserve"><value>Envelope was sent successfully.</value></data>
|
||||||
<data name="SenderEditor_SignatureField" xml:space="preserve"><value>Signature field</value></data>
|
<data name="SenderEditor_SignatureField" xml:space="preserve"><value>Signature field</value></data>
|
||||||
|
<data name="Receiver_SignField_ClickToSign" xml:space="preserve"><value>Sign here</value></data>
|
||||||
|
<data name="Receiver_Signing_Instruction" xml:space="preserve"><value>Please click each highlighted field to sign.</value></data>
|
||||||
|
<data name="Receiver_SignNav_Previous" xml:space="preserve"><value>Previous field</value></data>
|
||||||
|
<data name="Receiver_SignNav_Next" xml:space="preserve"><value>Next field</value></data>
|
||||||
|
<data name="Receiver_SignNav_Position" xml:space="preserve"><value>{0} / {1}</value></data>
|
||||||
|
<data name="Receiver_SignNav_PositionWithLabel" xml:space="preserve"><value>{0} / {1} signatures</value></data>
|
||||||
|
<data name="Receiver_Signature_Singular" xml:space="preserve"><value>Signature</value></data>
|
||||||
<data name="SenderEditor_Title_Placeholder" xml:space="preserve"><value>e.g. Employment contract 2025</value></data>
|
<data name="SenderEditor_Title_Placeholder" xml:space="preserve"><value>e.g. Employment contract 2025</value></data>
|
||||||
<data name="SenderEditor_ToOverview" xml:space="preserve"><value>To overview</value></data>
|
<data name="SenderEditor_ToOverview" xml:space="preserve"><value>To overview</value></data>
|
||||||
<data name="SenderEditor_UploadPdfToPlaceFields" xml:space="preserve"><value>Upload a PDF file to place signature fields.</value></data>
|
<data name="SenderEditor_UploadPdfToPlaceFields" xml:space="preserve"><value>Upload a PDF file to place signature fields.</value></data>
|
||||||
@@ -765,18 +788,27 @@
|
|||||||
<data name="SenderEditor_Validation_SignatureFieldRequired" xml:space="preserve"><value>Please place at least one signature field.</value></data>
|
<data name="SenderEditor_Validation_SignatureFieldRequired" xml:space="preserve"><value>Please place at least one signature field.</value></data>
|
||||||
<data name="SenderEditor_Validation_TitleRequired" xml:space="preserve"><value>Please enter a title.</value></data>
|
<data name="SenderEditor_Validation_TitleRequired" xml:space="preserve"><value>Please enter a title.</value></data>
|
||||||
<data name="SenderEditor_Validation_UploadPdf" xml:space="preserve"><value>Please upload a PDF document first.</value></data>
|
<data name="SenderEditor_Validation_UploadPdf" xml:space="preserve"><value>Please upload a PDF document first.</value></data>
|
||||||
<data name="SenderLogin_Description" xml:space="preserve"><value>Please sign in with your credentials to access the sender dashboard.</value></data>
|
<data name="SenderLogin_BackToHome" xml:space="preserve"><value>← Back to home page</value></data>
|
||||||
|
<data name="SenderLogin_Description" xml:space="preserve"><value>Sign in with the same credentials you use on your workplace PC.</value></data>
|
||||||
<data name="SenderLogin_FooterHelp" xml:space="preserve"><value>If you have issues, please contact the administrator.</value></data>
|
<data name="SenderLogin_FooterHelp" xml:space="preserve"><value>If you have issues, please contact the administrator.</value></data>
|
||||||
<data name="SenderLogin_InvalidCredentials_Body" xml:space="preserve"><value>Username or password is incorrect. Please try again.</value></data>
|
<data name="SenderLogin_InvalidCredentials_Body" xml:space="preserve"><value>Username or password is incorrect. Please try again.</value></data>
|
||||||
<data name="SenderLogin_InvalidCredentials_Title" xml:space="preserve"><value>Invalid credentials.</value></data>
|
<data name="SenderLogin_InvalidCredentials_Title" xml:space="preserve"><value>Invalid credentials.</value></data>
|
||||||
<data name="SenderLogin_Password_Placeholder" xml:space="preserve"><value>Enter password</value></data>
|
<data name="SenderLogin_Password_Placeholder" xml:space="preserve"><value>Enter password</value></data>
|
||||||
<data name="SenderLogin_Subtitle" xml:space="preserve"><value>Secure access to sender dashboard</value></data>
|
<data name="SenderLogin_RequiredFields_Body" xml:space="preserve"><value>Please enter username and password.</value></data>
|
||||||
<data name="SenderLogin_Title" xml:space="preserve"><value>Sender login</value></data>
|
<data name="SenderLogin_RequiredFields_Title" xml:space="preserve"><value>Required fields are missing.</value></data>
|
||||||
|
<data name="SenderLogin_Subtitle" xml:space="preserve"><value>Prepare and send documents for signature</value></data>
|
||||||
|
<data name="SenderLogin_Title" xml:space="preserve"><value>Sign in</value></data>
|
||||||
|
<data name="SenderLogin_Username_Label" xml:space="preserve"><value>Username, e.g. m.mustermann</value></data>
|
||||||
|
<data name="SenderLogin_Username_Placeholder" xml:space="preserve"><value>e.g. m.mustermann</value></data>
|
||||||
<data name="SenderLogin_Username_Placeholder" xml:space="preserve"><value>Enter username</value></data>
|
<data name="SenderLogin_Username_Placeholder" xml:space="preserve"><value>Enter username</value></data>
|
||||||
<data name="ServerError" xml:space="preserve"><value>Server error.</value></data>
|
<data name="ServerError" xml:space="preserve"><value>Server error.</value></data>
|
||||||
<data name="Signed" xml:space="preserve"><value>Signed</value></data>
|
<data name="Signed" xml:space="preserve"><value>Signed</value></data>
|
||||||
<data name="SignedDocument" xml:space="preserve"><value>Signed document</value></data>
|
<data name="SignedDocument" xml:space="preserve"><value>Signed document</value></data>
|
||||||
<data name="System" xml:space="preserve"><value>System</value></data>
|
<data name="System" xml:space="preserve"><value>System</value></data>
|
||||||
|
<data name="SenderWizard_Step_Start" xml:space="preserve"><value>Start</value></data>
|
||||||
|
<data name="SenderWizard_DocumentUploadSimpleHint" xml:space="preserve"><value>Add document: click or drag and drop</value></data>
|
||||||
|
<data name="SenderWizard_DocumentReplaceHint" xml:space="preserve"><value>Click to replace or drag a file onto this area.</value></data>
|
||||||
|
<data name="SenderWizard_FinalUploadHint" xml:space="preserve"><value>Last chance in the wizard: please upload your PDF now using the upload area on the right. In the editor, you can still upload or replace a document later.</value></data>
|
||||||
<data name="UnexpectedErrorTryAgainLater" xml:space="preserve"><value>An unexpected error occurred. Please try again later.</value></data>
|
<data name="UnexpectedErrorTryAgainLater" xml:space="preserve"><value>An unexpected error occurred. Please try again later.</value></data>
|
||||||
<data name="UploadPdf" xml:space="preserve"><value>Upload PDF</value></data>
|
<data name="UploadPdf" xml:space="preserve"><value>Upload PDF</value></data>
|
||||||
<data name="UserName" xml:space="preserve"><value>Username</value></data>
|
<data name="UserName" xml:space="preserve"><value>Username</value></data>
|
||||||
|
|||||||
@@ -622,10 +622,10 @@
|
|||||||
<value>Type de certification</value>
|
<value>Type de certification</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="FinalEmailToCreator" xml:space="preserve">
|
<data name="FinalEmailToCreator" xml:space="preserve">
|
||||||
<value>E-mail final au créateur</value>
|
<value>Document terminé au créateur</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="FinalEmailToReceivers" xml:space="preserve">
|
<data name="FinalEmailToReceivers" xml:space="preserve">
|
||||||
<value>E-mail final aux destinataires</value>
|
<value>Document terminé aux destinataires</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="SendReminderEmails" xml:space="preserve">
|
<data name="SendReminderEmails" xml:space="preserve">
|
||||||
<value>Envoyer des e-mails de rappel</value>
|
<value>Envoyer des e-mails de rappel</value>
|
||||||
@@ -703,10 +703,19 @@
|
|||||||
<data name="ReceiverLogin_AccessCode_Placeholder" xml:space="preserve"><value>Saisir le code d'accès</value></data>
|
<data name="ReceiverLogin_AccessCode_Placeholder" xml:space="preserve"><value>Saisir le code d'accès</value></data>
|
||||||
<data name="ReceiverLogin_Description" xml:space="preserve"><value>Veuillez saisir le code d'accès reçu par e-mail pour ouvrir le document en toute sécurité.</value></data>
|
<data name="ReceiverLogin_Description" xml:space="preserve"><value>Veuillez saisir le code d'accès reçu par e-mail pour ouvrir le document en toute sécurité.</value></data>
|
||||||
<data name="ReceiverLogin_FooterHelp" xml:space="preserve"><value>En cas de problème, veuillez contacter l'expéditeur du document.</value></data>
|
<data name="ReceiverLogin_FooterHelp" xml:space="preserve"><value>En cas de problème, veuillez contacter l'expéditeur du document.</value></data>
|
||||||
|
<data name="ReceiverLogin_InfoTitle" xml:space="preserve"><value>Votre sécurité est importante pour nous.</value></data>
|
||||||
|
<data name="ReceiverLogin_InfoStep1" xml:space="preserve"><value>Juste après avoir ouvert le lien de signature, nous vous avons envoyé un second e-mail.</value></data>
|
||||||
|
<data name="ReceiverLogin_InfoStep2" xml:space="preserve"><value>Cet e-mail contient le code d'accès que vous devez saisir ici.</value></data>
|
||||||
<data name="ReceiverLogin_InvalidCode_Body" xml:space="preserve"><value>Le code saisi est incorrect. Veuillez réessayer.</value></data>
|
<data name="ReceiverLogin_InvalidCode_Body" xml:space="preserve"><value>Le code saisi est incorrect. Veuillez réessayer.</value></data>
|
||||||
<data name="ReceiverLogin_InvalidCode_Title" xml:space="preserve"><value>Code d'accès invalide.</value></data>
|
<data name="ReceiverLogin_InvalidCode_Title" xml:space="preserve"><value>Code d'accès invalide.</value></data>
|
||||||
<data name="ReceiverLogin_NotFound_Body" xml:space="preserve"><value>Le code d'accès indiqué ne correspond à aucun document. Veuillez vérifier le lien dans votre e-mail.</value></data>
|
<data name="ReceiverLogin_NotFound_Body" xml:space="preserve"><value>Le code d'accès indiqué ne correspond à aucun document. Veuillez vérifier le lien dans votre e-mail.</value></data>
|
||||||
<data name="ReceiverLogin_NotFound_Title" xml:space="preserve"><value>Document introuvable.</value></data>
|
<data name="ReceiverLogin_NotFound_Title" xml:space="preserve"><value>Document introuvable.</value></data>
|
||||||
|
<data name="ReceiverLogin_ResendAction" xml:space="preserve"><value>Renvoyer le code</value></data>
|
||||||
|
<data name="ReceiverLogin_ResendError" xml:space="preserve"><value>Le code d'accès n'a pas pu être renvoyé. Veuillez réessayer plus tard.</value></data>
|
||||||
|
<data name="ReceiverLogin_ResendInProgress" xml:space="preserve"><value>Envoi du code ...</value></data>
|
||||||
|
<data name="ReceiverLogin_ResendPrompt" xml:space="preserve"><value>Vous n'avez pas reçu le code d'accès ?</value></data>
|
||||||
|
<data name="ReceiverLogin_ResendRateLimit" xml:space="preserve"><value>Vous venez de demander un code. Veuillez patienter un instant puis réessayer.</value></data>
|
||||||
|
<data name="ReceiverLogin_ResendSuccess" xml:space="preserve"><value>Nous venons de vous envoyer un nouveau code d'accès par e-mail.</value></data>
|
||||||
<data name="ReceiverLogin_Subtitle" xml:space="preserve"><value>Accès sécurisé avec code d'accès</value></data>
|
<data name="ReceiverLogin_Subtitle" xml:space="preserve"><value>Accès sécurisé avec code d'accès</value></data>
|
||||||
<data name="ReceiverSigned_ConfirmBody" xml:space="preserve"><value>Cette action est irréversible. En confirmant, vous déclarez avoir signé électroniquement le document affiché ci-dessus. Le document signé sera ensuite transmis à toutes les parties concernées.</value></data>
|
<data name="ReceiverSigned_ConfirmBody" xml:space="preserve"><value>Cette action est irréversible. En confirmant, vous déclarez avoir signé électroniquement le document affiché ci-dessus. Le document signé sera ensuite transmis à toutes les parties concernées.</value></data>
|
||||||
<data name="ReceiverSigned_ConfirmQuestion" xml:space="preserve"><value>Voulez-vous signer ce document de manière contraignante ?</value></data>
|
<data name="ReceiverSigned_ConfirmQuestion" xml:space="preserve"><value>Voulez-vous signer ce document de manière contraignante ?</value></data>
|
||||||
@@ -749,11 +758,25 @@
|
|||||||
<data name="SenderEditor_PageLabel" xml:space="preserve"><value>Page</value></data>
|
<data name="SenderEditor_PageLabel" xml:space="preserve"><value>Page</value></data>
|
||||||
<data name="SenderEditor_PlaceSignatureField" xml:space="preserve"><value>Placer un champ de signature</value></data>
|
<data name="SenderEditor_PlaceSignatureField" xml:space="preserve"><value>Placer un champ de signature</value></data>
|
||||||
<data name="SenderEditor_RemoveAllSignatureFields" xml:space="preserve"><value>Supprimer tous les champs de signature</value></data>
|
<data name="SenderEditor_RemoveAllSignatureFields" xml:space="preserve"><value>Supprimer tous les champs de signature</value></data>
|
||||||
|
<data name="SenderEditor_RemoveAllSignatureFieldsConfirm" xml:space="preserve"><value>Cette action supprimera définitivement tous les champs de signature placés. Continuer?</value></data>
|
||||||
<data name="SenderEditor_SelectPdf" xml:space="preserve"><value>Veuillez sélectionner un fichier PDF.</value></data>
|
<data name="SenderEditor_SelectPdf" xml:space="preserve"><value>Veuillez sélectionner un fichier PDF.</value></data>
|
||||||
|
<data name="SenderEditor_SendConfirm_Message" xml:space="preserve"><value>Voulez-vous envoyer l'enveloppe maintenant ? Remarque : après la transmission, le processus ne peut plus être modifié.</value></data>
|
||||||
|
<data name="SenderEditor_SendConfirm_Title" xml:space="preserve"><value>Envoyer l'enveloppe maintenant ?</value></data>
|
||||||
|
<data name="SenderEditor_SendConfirm_Note" xml:space="preserve"><value>Veuillez vérifier les destinataires, les champs de signature et les paramètres avant l'envoi.</value></data>
|
||||||
|
<data name="SenderEditor_SendConfirm_Action" xml:space="preserve"><value>Envoyer maintenant</value></data>
|
||||||
|
<data name="SenderEditor_SendConfirm_InProgress" xml:space="preserve"><value>Envoi de l'enveloppe...</value></data>
|
||||||
|
<data name="SenderEditor_SendConfirm_InProgressHint" xml:space="preserve"><value>Veuillez patienter un instant pendant la finalisation du traitement.</value></data>
|
||||||
<data name="SenderEditor_Sent_Body" xml:space="preserve"><value>Le brouillon existant a été envoyé.</value></data>
|
<data name="SenderEditor_Sent_Body" xml:space="preserve"><value>Le brouillon existant a été envoyé.</value></data>
|
||||||
<data name="SenderEditor_Sent_Header" xml:space="preserve"><value>Enveloppe envoyée</value></data>
|
<data name="SenderEditor_Sent_Header" xml:space="preserve"><value>Enveloppe envoyée</value></data>
|
||||||
<data name="SenderEditor_Sent_Title" xml:space="preserve"><value>L'enveloppe a été envoyée avec succès.</value></data>
|
<data name="SenderEditor_Sent_Title" xml:space="preserve"><value>L'enveloppe a été envoyée avec succès.</value></data>
|
||||||
<data name="SenderEditor_SignatureField" xml:space="preserve"><value>Champ de signature</value></data>
|
<data name="SenderEditor_SignatureField" xml:space="preserve"><value>Champ de signature</value></data>
|
||||||
|
<data name="Receiver_SignField_ClickToSign" xml:space="preserve"><value>Signez ici</value></data>
|
||||||
|
<data name="Receiver_Signing_Instruction" xml:space="preserve"><value>Veuillez cliquer sur chaque champ surligne pour signer.</value></data>
|
||||||
|
<data name="Receiver_SignNav_Previous" xml:space="preserve"><value>Champ precedent</value></data>
|
||||||
|
<data name="Receiver_SignNav_Next" xml:space="preserve"><value>Champ suivant</value></data>
|
||||||
|
<data name="Receiver_SignNav_Position" xml:space="preserve"><value>{0} / {1}</value></data>
|
||||||
|
<data name="Receiver_SignNav_PositionWithLabel" xml:space="preserve"><value>{0} / {1} signatures</value></data>
|
||||||
|
<data name="Receiver_Signature_Singular" xml:space="preserve"><value>Signature</value></data>
|
||||||
<data name="SenderEditor_Title_Placeholder" xml:space="preserve"><value>p. ex. Contrat de travail 2025</value></data>
|
<data name="SenderEditor_Title_Placeholder" xml:space="preserve"><value>p. ex. Contrat de travail 2025</value></data>
|
||||||
<data name="SenderEditor_ToOverview" xml:space="preserve"><value>Vers l'aperçu</value></data>
|
<data name="SenderEditor_ToOverview" xml:space="preserve"><value>Vers l'aperçu</value></data>
|
||||||
<data name="SenderEditor_UploadPdfToPlaceFields" xml:space="preserve"><value>Téléversez un fichier PDF pour placer des champs de signature.</value></data>
|
<data name="SenderEditor_UploadPdfToPlaceFields" xml:space="preserve"><value>Téléversez un fichier PDF pour placer des champs de signature.</value></data>
|
||||||
@@ -765,18 +788,27 @@
|
|||||||
<data name="SenderEditor_Validation_SignatureFieldRequired" xml:space="preserve"><value>Veuillez placer au moins un champ de signature.</value></data>
|
<data name="SenderEditor_Validation_SignatureFieldRequired" xml:space="preserve"><value>Veuillez placer au moins un champ de signature.</value></data>
|
||||||
<data name="SenderEditor_Validation_TitleRequired" xml:space="preserve"><value>Veuillez saisir un titre.</value></data>
|
<data name="SenderEditor_Validation_TitleRequired" xml:space="preserve"><value>Veuillez saisir un titre.</value></data>
|
||||||
<data name="SenderEditor_Validation_UploadPdf" xml:space="preserve"><value>Veuillez d'abord téléverser un document PDF.</value></data>
|
<data name="SenderEditor_Validation_UploadPdf" xml:space="preserve"><value>Veuillez d'abord téléverser un document PDF.</value></data>
|
||||||
<data name="SenderLogin_Description" xml:space="preserve"><value>Veuillez vous connecter avec vos identifiants pour accéder au tableau de bord expéditeur.</value></data>
|
<data name="SenderLogin_BackToHome" xml:space="preserve"><value>← Retour à la page d'accueil</value></data>
|
||||||
|
<data name="SenderLogin_Description" xml:space="preserve"><value>Connectez-vous avec les mêmes identifiants que sur votre PC professionnel.</value></data>
|
||||||
<data name="SenderLogin_FooterHelp" xml:space="preserve"><value>En cas de problème, veuillez contacter l'administrateur.</value></data>
|
<data name="SenderLogin_FooterHelp" xml:space="preserve"><value>En cas de problème, veuillez contacter l'administrateur.</value></data>
|
||||||
<data name="SenderLogin_InvalidCredentials_Body" xml:space="preserve"><value>Le nom d'utilisateur ou le mot de passe est incorrect. Veuillez réessayer.</value></data>
|
<data name="SenderLogin_InvalidCredentials_Body" xml:space="preserve"><value>Le nom d'utilisateur ou le mot de passe est incorrect. Veuillez réessayer.</value></data>
|
||||||
<data name="SenderLogin_InvalidCredentials_Title" xml:space="preserve"><value>Identifiants invalides.</value></data>
|
<data name="SenderLogin_InvalidCredentials_Title" xml:space="preserve"><value>Identifiants invalides.</value></data>
|
||||||
<data name="SenderLogin_Password_Placeholder" xml:space="preserve"><value>Saisir le mot de passe</value></data>
|
<data name="SenderLogin_Password_Placeholder" xml:space="preserve"><value>Saisir le mot de passe</value></data>
|
||||||
<data name="SenderLogin_Subtitle" xml:space="preserve"><value>Accès sécurisé au tableau de bord expéditeur</value></data>
|
<data name="SenderLogin_RequiredFields_Body" xml:space="preserve"><value>Veuillez saisir le nom d'utilisateur et le mot de passe.</value></data>
|
||||||
<data name="SenderLogin_Title" xml:space="preserve"><value>Connexion expéditeur</value></data>
|
<data name="SenderLogin_RequiredFields_Title" xml:space="preserve"><value>Champs obligatoires manquants.</value></data>
|
||||||
|
<data name="SenderLogin_Subtitle" xml:space="preserve"><value>Préparer et envoyer des documents à signer</value></data>
|
||||||
|
<data name="SenderLogin_Title" xml:space="preserve"><value>Connexion</value></data>
|
||||||
|
<data name="SenderLogin_Username_Label" xml:space="preserve"><value>Nom d'utilisateur, p. ex. m.mustermann</value></data>
|
||||||
|
<data name="SenderLogin_Username_Placeholder" xml:space="preserve"><value>p. ex. m.mustermann</value></data>
|
||||||
<data name="SenderLogin_Username_Placeholder" xml:space="preserve"><value>Saisir le nom d'utilisateur</value></data>
|
<data name="SenderLogin_Username_Placeholder" xml:space="preserve"><value>Saisir le nom d'utilisateur</value></data>
|
||||||
<data name="ServerError" xml:space="preserve"><value>Erreur serveur.</value></data>
|
<data name="ServerError" xml:space="preserve"><value>Erreur serveur.</value></data>
|
||||||
<data name="Signed" xml:space="preserve"><value>Signé</value></data>
|
<data name="Signed" xml:space="preserve"><value>Signé</value></data>
|
||||||
<data name="SignedDocument" xml:space="preserve"><value>Document signé</value></data>
|
<data name="SignedDocument" xml:space="preserve"><value>Document signé</value></data>
|
||||||
<data name="System" xml:space="preserve"><value>Système</value></data>
|
<data name="System" xml:space="preserve"><value>Système</value></data>
|
||||||
|
<data name="SenderWizard_Step_Start" xml:space="preserve"><value>Démarrer</value></data>
|
||||||
|
<data name="SenderWizard_DocumentUploadSimpleHint" xml:space="preserve"><value>Ajouter un document : cliquer ou glisser-deposer</value></data>
|
||||||
|
<data name="SenderWizard_DocumentReplaceHint" xml:space="preserve"><value>Cliquez pour remplacer ou glissez un fichier sur cette zone.</value></data>
|
||||||
|
<data name="SenderWizard_FinalUploadHint" xml:space="preserve"><value>Derniere possibilite dans l'assistant : veuillez televerser votre PDF maintenant via la zone d'upload a droite. Dans l'editeur, vous pourrez encore televerser ou remplacer un document plus tard.</value></data>
|
||||||
<data name="UnexpectedErrorTryAgainLater" xml:space="preserve"><value>Une erreur inattendue s'est produite. Veuillez réessayer plus tard.</value></data>
|
<data name="UnexpectedErrorTryAgainLater" xml:space="preserve"><value>Une erreur inattendue s'est produite. Veuillez réessayer plus tard.</value></data>
|
||||||
<data name="UploadPdf" xml:space="preserve"><value>Téléverser un PDF</value></data>
|
<data name="UploadPdf" xml:space="preserve"><value>Téléverser un PDF</value></data>
|
||||||
<data name="UserName" xml:space="preserve"><value>Nom d'utilisateur</value></data>
|
<data name="UserName" xml:space="preserve"><value>Nom d'utilisateur</value></data>
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ using DigitalData.Core.Abstraction.Application.DTO;
|
|||||||
using EnvelopeGenerator.Application.Common.Dto;
|
using EnvelopeGenerator.Application.Common.Dto;
|
||||||
using EnvelopeGenerator.Application.Common.Interfaces.Repositories;
|
using EnvelopeGenerator.Application.Common.Interfaces.Repositories;
|
||||||
using EnvelopeGenerator.Application.Common.Interfaces.Services;
|
using EnvelopeGenerator.Application.Common.Interfaces.Services;
|
||||||
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Services;
|
namespace EnvelopeGenerator.Application.Services;
|
||||||
|
|
||||||
@@ -14,7 +15,7 @@ namespace EnvelopeGenerator.Application.Services;
|
|||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Obsolete("Use MediatR")]
|
[Obsolete("Use MediatR")]
|
||||||
public class EnvelopeTypeService : BasicCRUDService<IEnvelopeTypeRepository, EnvelopeTypeDto, EnvelopeType, int>, IEnvelopeTypeService
|
public class EnvelopeTypeService : BasicCRUDService<IEnvelopeTypeRepository, EnvelopeTypeDefaultsDto, EnvelopeTypeDefaults, EnvelopeType>, IEnvelopeTypeService
|
||||||
{
|
{
|
||||||
private static readonly Guid CacheKey = Guid.NewGuid();
|
private static readonly Guid CacheKey = Guid.NewGuid();
|
||||||
|
|
||||||
@@ -36,8 +37,8 @@ public class EnvelopeTypeService : BasicCRUDService<IEnvelopeTypeRepository, Env
|
|||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public override async Task<DataResult<IEnumerable<EnvelopeTypeDto>>> ReadAllAsync()
|
public override async Task<DataResult<IEnumerable<EnvelopeTypeDefaultsDto>>> ReadAllAsync()
|
||||||
=> await _cache.GetOrCreateAsync(CacheKey, async entry => await base.ReadAllAsync())
|
=> await _cache.GetOrCreateAsync(CacheKey, async entry => await base.ReadAllAsync())
|
||||||
?? Result.Fail<IEnumerable<EnvelopeTypeDto>>().Notice(LogLevel.Error, Flag.NotFound, "No cached envelope types are available in the database. If you have added any envelope types after the server started, please restart the server.");
|
?? Result.Fail<IEnumerable<EnvelopeTypeDefaultsDto>>().Notice(LogLevel.Error, Flag.NotFound, "No cached envelope types are available in the database. If you have added any envelope types after the server started, please restart the server.");
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -72,7 +72,7 @@ Public Class EnvelopeModel
|
|||||||
|
|
||||||
oEnvelope.Documents = DocumentModel.List(oEnvelope.Id)
|
oEnvelope.Documents = DocumentModel.List(oEnvelope.Id)
|
||||||
oEnvelope.Histories = HistoryModel.List(oEnvelope.Id)
|
oEnvelope.Histories = HistoryModel.List(oEnvelope.Id)
|
||||||
oEnvelope.Type = EnvelopeTypeModel.GetById(oEnvelope.EnvelopeTypeId)
|
oEnvelope.Defaults = EnvelopeTypeModel.GetById(oEnvelope.EnvelopeTypeId)
|
||||||
|
|
||||||
Return oEnvelope
|
Return oEnvelope
|
||||||
End Function
|
End Function
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ Public Class EnvelopeTypeModel
|
|||||||
MyBase.New(pState)
|
MyBase.New(pState)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function ToEnvelopeType(pRow As DataRow) As EnvelopeType
|
Private Function ToEnvelopeType(pRow As DataRow) As EnvelopeTypeDefaults
|
||||||
Return New EnvelopeType() With {
|
Return New EnvelopeTypeDefaults() With {
|
||||||
.Id = pRow.ItemEx("GUID", 0),
|
.Id = pRow.ItemEx("GUID", 0),
|
||||||
.Title = pRow.ItemEx("TITLE", ""),
|
.Title = pRow.ItemEx("TITLE", ""),
|
||||||
.UseAccessCode = pRow.ItemEx("USE_ACCESS_CODE", False),
|
.UseAccessCode = pRow.ItemEx("USE_ACCESS_CODE", False),
|
||||||
@@ -27,7 +27,7 @@ Public Class EnvelopeTypeModel
|
|||||||
}
|
}
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function GetById(pEnvelopeTypeId As Integer) As EnvelopeType
|
Public Function GetById(pEnvelopeTypeId As Integer) As EnvelopeTypeDefaults
|
||||||
Dim oSql As String = $"SELECT * FROM TBSIG_ENVELOPE_TYPE WHERE GUID = {pEnvelopeTypeId}"
|
Dim oSql As String = $"SELECT * FROM TBSIG_ENVELOPE_TYPE WHERE GUID = {pEnvelopeTypeId}"
|
||||||
Dim oTable As DataTable = Database.GetDatatable(oSql)
|
Dim oTable As DataTable = Database.GetDatatable(oSql)
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ Public Class EnvelopeTypeModel
|
|||||||
Return ToEnvelopeType(oRow)
|
Return ToEnvelopeType(oRow)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function List() As IEnumerable(Of EnvelopeType)
|
Public Function List() As IEnumerable(Of EnvelopeTypeDefaults)
|
||||||
Dim oSql As String = $"SELECT * FROM TBSIG_ENVELOPE_TYPE"
|
Dim oSql As String = $"SELECT * FROM TBSIG_ENVELOPE_TYPE"
|
||||||
Dim oTable As DataTable = Database.GetDatatable(oSql)
|
Dim oTable As DataTable = Database.GetDatatable(oSql)
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
namespace EnvelopeGenerator.Domain.Constants
|
#if NETFRAMEWORK
|
||||||
|
namespace EnvelopeGenerator.Domain.Constants
|
||||||
{
|
{
|
||||||
public enum CertificationType
|
public enum CertificationType
|
||||||
{
|
{
|
||||||
AdvancedElectronicSignature = 1
|
AdvancedElectronicSignature = 1,
|
||||||
// ElectronicSignature = 1
|
ElectronicSignature = 2
|
||||||
// QualifiedSignature = 2
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
namespace EnvelopeGenerator.Domain.Constants
|
#if NETFRAMEWORK
|
||||||
|
namespace EnvelopeGenerator.Domain.Constants
|
||||||
{
|
{
|
||||||
public enum ContractType
|
public enum ContractType
|
||||||
{
|
{
|
||||||
@@ -6,3 +7,4 @@
|
|||||||
ReadAndSign = 2
|
ReadAndSign = 2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
40
EnvelopeGenerator.Domain/Constants/EnvelopeType.cs
Normal file
40
EnvelopeGenerator.Domain/Constants/EnvelopeType.cs
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
#if NETFRAMEWORK
|
||||||
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
using EnvelopeGenerator.Domain.Exceptions;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Domain.Constants
|
||||||
|
{
|
||||||
|
public enum EnvelopeType
|
||||||
|
{
|
||||||
|
SimpleSignature = 1,
|
||||||
|
ReadAndConfirm = 2,
|
||||||
|
AdvancedSignature = 3
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class EnvelopeTypeExtensions
|
||||||
|
{
|
||||||
|
public static EnvelopeType ToEnvelopeType(this int envelopeTypeId)
|
||||||
|
{
|
||||||
|
if (!Enum.IsDefined(typeof(EnvelopeType), envelopeTypeId))
|
||||||
|
{
|
||||||
|
#if NETFRAMEWORK
|
||||||
|
var values = Enum.GetValues(typeof(EnvelopeType)).Cast<EnvelopeType>();
|
||||||
|
#else
|
||||||
|
var values = Enum.GetValues<EnvelopeType>();
|
||||||
|
#endif
|
||||||
|
var validValues = string.Join(", ", values.Select(value => $"{(int)value} = {value}"));
|
||||||
|
|
||||||
|
throw new DataIntegrityException(
|
||||||
|
$"Invalid EnvelopeTypeId '{envelopeTypeId}' for envelope. " +
|
||||||
|
$"Valid {nameof(EnvelopeType)} values are: [{validValues}]. " +
|
||||||
|
"This indicates a data integrity issue: the envelope may have been " +
|
||||||
|
"created or updated with an invalid EnvelopeType in the database.");
|
||||||
|
}
|
||||||
|
|
||||||
|
return (EnvelopeType)Enum.ToObject(typeof(EnvelopeType), envelopeTypeId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -30,7 +30,7 @@ namespace EnvelopeGenerator.Domain.Entities
|
|||||||
SendReminderEmails = false;
|
SendReminderEmails = false;
|
||||||
FirstReminderDays = 0;
|
FirstReminderDays = 0;
|
||||||
ReminderIntervalDays = 0;
|
ReminderIntervalDays = 0;
|
||||||
CertificationType = (int)Constants.CertificationType.AdvancedElectronicSignature;
|
CertificationType = Constants.CertificationType.AdvancedElectronicSignature;
|
||||||
UseAccessCode = false;
|
UseAccessCode = false;
|
||||||
Documents = Enumerable.Empty<Document>().ToList();
|
Documents = Enumerable.Empty<Document>().ToList();
|
||||||
Histories = Enumerable.Empty<History>().ToList();
|
Histories = Enumerable.Empty<History>().ToList();
|
||||||
@@ -82,8 +82,11 @@ namespace EnvelopeGenerator.Domain.Entities
|
|||||||
[Column("COMMENT", TypeName = "nvarchar(128)")]
|
[Column("COMMENT", TypeName = "nvarchar(128)")]
|
||||||
public string Comment { get; set; }
|
public string Comment { get; set; }
|
||||||
|
|
||||||
|
#if NETFRAMEWORK
|
||||||
|
|
||||||
[Column("CONTRACT_TYPE")]
|
[Column("CONTRACT_TYPE")]
|
||||||
public int? ContractType { get; set; }
|
public ContractType? ContractType { get; set; }
|
||||||
|
#endif
|
||||||
|
|
||||||
#if NETFRAMEWORK
|
#if NETFRAMEWORK
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
@@ -103,24 +106,32 @@ namespace EnvelopeGenerator.Domain.Entities
|
|||||||
public int? ReminderIntervalDays { get; set; }
|
public int? ReminderIntervalDays { get; set; }
|
||||||
|
|
||||||
[Column("ENVELOPE_TYPE")]
|
[Column("ENVELOPE_TYPE")]
|
||||||
public int? EnvelopeTypeId { get; set; }
|
#if NET
|
||||||
|
|
||||||
|
public EnvelopeType? Type { get; set; }
|
||||||
|
#elif NETFRAMEWORK
|
||||||
|
public int EnvelopeTypeId { get; set; }
|
||||||
|
#endif
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
[Obsolete("Use EnvelopeGenerator.Domain.Interfaces.EnvelopeExtensions.IsReadAndConfirm extension method instead.")]
|
[Obsolete("Use EnvelopeGenerator.Domain.Interfaces.EnvelopeExtensions.IsReadAndConfirm extension method instead.")]
|
||||||
public bool ReadOnly => this.IsReadAndConfirm();
|
public bool ReadOnly => this.IsReadAndConfirm();
|
||||||
|
|
||||||
|
#if NETFRAMEWORK
|
||||||
|
|
||||||
[Column("CERTIFICATION_TYPE")]
|
[Column("CERTIFICATION_TYPE")]
|
||||||
public int? CertificationType { get; set; }
|
public CertificationType? CertificationType { get; set; }
|
||||||
|
#endif
|
||||||
|
|
||||||
[Column("USE_ACCESS_CODE")]
|
[Column("USE_ACCESS_CODE")]
|
||||||
public bool? UseAccessCode { get; set; }
|
public bool? UseAccessCode { get; set; }
|
||||||
|
|
||||||
[Column("FINAL_EMAIL_TO_CREATOR")]
|
[Column("FINAL_EMAIL_TO_CREATOR")]
|
||||||
public int? FinalEmailToCreator { get; set; }
|
public FinalEmailType? FinalEmailToCreator { get; set; }
|
||||||
|
|
||||||
[Column("FINAL_EMAIL_TO_RECEIVERS")]
|
[Column("FINAL_EMAIL_TO_RECEIVERS")]
|
||||||
public int? FinalEmailToReceivers { get; set; }
|
public FinalEmailType? FinalEmailToReceivers { get; set; }
|
||||||
|
|
||||||
[Column("EXPIRES_WHEN_DAYS")]
|
[Column("EXPIRES_WHEN_DAYS")]
|
||||||
public int? ExpiresWhenDays { get; set; }
|
public int? ExpiresWhenDays { get; set; }
|
||||||
@@ -129,7 +140,11 @@ namespace EnvelopeGenerator.Domain.Entities
|
|||||||
public int? ExpiresWarningWhenDays { get; set; }
|
public int? ExpiresWarningWhenDays { get; set; }
|
||||||
|
|
||||||
[ForeignKey("UserId")]
|
[ForeignKey("UserId")]
|
||||||
public User User { get; set; }
|
public User
|
||||||
|
#if nullable
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
User { get; set; }
|
||||||
|
|
||||||
[Column("TFA_ENABLED")]
|
[Column("TFA_ENABLED")]
|
||||||
public bool? TfaEnabled { get; set; }
|
public bool? TfaEnabled { get; set; }
|
||||||
@@ -145,12 +160,12 @@ namespace EnvelopeGenerator.Domain.Entities
|
|||||||
DocResult
|
DocResult
|
||||||
{ get; set; }
|
{ get; set; }
|
||||||
|
|
||||||
[ForeignKey("EnvelopeTypeId")]
|
[ForeignKey("Type")]
|
||||||
public virtual EnvelopeType
|
public virtual EnvelopeTypeDefaults
|
||||||
#if nullable
|
#if nullable
|
||||||
?
|
?
|
||||||
#endif
|
#endif
|
||||||
Type
|
Defaults
|
||||||
{ get; set; }
|
{ get; set; }
|
||||||
|
|
||||||
#if NETFRAMEWORK
|
#if NETFRAMEWORK
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
|
||||||
#if NETFRAMEWORK
|
#if NETFRAMEWORK
|
||||||
using System;
|
using System;
|
||||||
#endif
|
#endif
|
||||||
@@ -7,12 +9,20 @@ using System;
|
|||||||
namespace EnvelopeGenerator.Domain.Entities
|
namespace EnvelopeGenerator.Domain.Entities
|
||||||
{
|
{
|
||||||
[Table("TBSIG_ENVELOPE_TYPE", Schema = "dbo")]
|
[Table("TBSIG_ENVELOPE_TYPE", Schema = "dbo")]
|
||||||
public class EnvelopeType
|
public class EnvelopeTypeDefaults
|
||||||
{
|
{
|
||||||
|
#if NET
|
||||||
|
|
||||||
|
[Key]
|
||||||
|
[Column("GUID")]
|
||||||
|
public EnvelopeType Id { get; set; }
|
||||||
|
#elif NETFRAMEWORK
|
||||||
|
|
||||||
[Key]
|
[Key]
|
||||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
[Column("GUID")]
|
[Column("GUID")]
|
||||||
public int Id { get; set; } = 0;
|
public int Id { get; set; } = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
[Column("TITLE", TypeName = "nvarchar(128)")]
|
[Column("TITLE", TypeName = "nvarchar(128)")]
|
||||||
@@ -24,17 +34,19 @@ namespace EnvelopeGenerator.Domain.Entities
|
|||||||
[Column("EXPIRES_DAYS")]
|
[Column("EXPIRES_DAYS")]
|
||||||
public int? ExpiresDays { get; set; }
|
public int? ExpiresDays { get; set; }
|
||||||
|
|
||||||
|
#if NETFRAMEWORK
|
||||||
[Column("CERTIFICATION_TYPE")]
|
[Column("CERTIFICATION_TYPE")]
|
||||||
public Constants.CertificationType? CertificationType { get; set; }
|
public CertificationType? CertificationType { get; set; }
|
||||||
|
#endif
|
||||||
|
|
||||||
[Column("USE_ACCESS_CODE")]
|
[Column("USE_ACCESS_CODE")]
|
||||||
public bool? UseAccessCode { get; set; }
|
public bool? UseAccessCode { get; set; }
|
||||||
|
|
||||||
[Column("FINAL_EMAIL_TO_CREATOR")]
|
[Column("FINAL_EMAIL_TO_CREATOR")]
|
||||||
public Constants.FinalEmailType? FinalEmailToCreator { get; set; }
|
public FinalEmailType? FinalEmailToCreator { get; set; }
|
||||||
|
|
||||||
[Column("FINAL_EMAIL_TO_RECEIVERS")]
|
[Column("FINAL_EMAIL_TO_RECEIVERS")]
|
||||||
public Constants.FinalEmailType? FinalEmailToReceivers { get; set; }
|
public FinalEmailType? FinalEmailToReceivers { get; set; }
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
[Column("ADDED_WHEN", TypeName = "datetime")]
|
[Column("ADDED_WHEN", TypeName = "datetime")]
|
||||||
@@ -55,8 +67,10 @@ namespace EnvelopeGenerator.Domain.Entities
|
|||||||
[Column("REMINDER_INTERVAL_DAYS")]
|
[Column("REMINDER_INTERVAL_DAYS")]
|
||||||
public int? ReminderIntervalDays { get; set; }
|
public int? ReminderIntervalDays { get; set; }
|
||||||
|
|
||||||
|
#if NETFRAMEWORK
|
||||||
[Column("CONTRACT_TYPE")]
|
[Column("CONTRACT_TYPE")]
|
||||||
public int? ContractType { get; set; }
|
public ContractType? ContractType { get; set; }
|
||||||
|
#endif
|
||||||
|
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
public bool TFA_Enabled { get; set; } = false;
|
public bool TFA_Enabled { get; set; } = false;
|
||||||
@@ -1,8 +1,20 @@
|
|||||||
namespace EnvelopeGenerator.Domain.Interfaces
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
using EnvelopeGenerator.Domain.Exceptions;
|
||||||
|
#if NETFRAMEWORK
|
||||||
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Domain.Interfaces
|
||||||
{
|
{
|
||||||
public interface IEnvelope
|
public interface IEnvelope
|
||||||
{
|
{
|
||||||
int? EnvelopeTypeId { get; set; }
|
#if NET
|
||||||
|
|
||||||
|
public EnvelopeType? Type { get; set; }
|
||||||
|
#elif NETFRAMEWORK
|
||||||
|
int EnvelopeTypeId { get; set; }
|
||||||
|
#endif
|
||||||
|
|
||||||
byte[]
|
byte[]
|
||||||
#if nullable
|
#if nullable
|
||||||
@@ -15,12 +27,22 @@
|
|||||||
{
|
{
|
||||||
public static bool IsReadAndConfirm(this IEnvelope envelope)
|
public static bool IsReadAndConfirm(this IEnvelope envelope)
|
||||||
{
|
{
|
||||||
return envelope.EnvelopeTypeId == 2;
|
#if NET
|
||||||
|
|
||||||
|
return envelope.Type == EnvelopeType.ReadAndConfirm;
|
||||||
|
#elif NETFRAMEWORK
|
||||||
|
return envelope.EnvelopeTypeId == (int)EnvelopeType.ReadAndConfirm;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool IsReadAndSign(this IEnvelope envelope)
|
public static bool IsReadAndSign(this IEnvelope envelope)
|
||||||
{
|
{
|
||||||
return envelope.EnvelopeTypeId != 2;
|
#if NET
|
||||||
|
|
||||||
|
return envelope.Type != EnvelopeType.ReadAndConfirm;
|
||||||
|
#elif NETFRAMEWORK
|
||||||
|
return envelope.EnvelopeTypeId != (int)EnvelopeType.ReadAndConfirm;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool IsBurned(this IEnvelope envelope)
|
public static bool IsBurned(this IEnvelope envelope)
|
||||||
|
|||||||
@@ -295,10 +295,10 @@
|
|||||||
<value>Use Access Code</value>
|
<value>Use Access Code</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="FinalEmailToCreator" xml:space="preserve">
|
<data name="FinalEmailToCreator" xml:space="preserve">
|
||||||
<value>Final Email to Creator</value>
|
<value>Completed Document to Creator</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="FinalEmailToReceivers" xml:space="preserve">
|
<data name="FinalEmailToReceivers" xml:space="preserve">
|
||||||
<value>Final Email to Receivers</value>
|
<value>Completed Document to Receivers</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="SendReminderEmails" xml:space="preserve">
|
<data name="SendReminderEmails" xml:space="preserve">
|
||||||
<value>Send Reminder Emails</value>
|
<value>Send Reminder Emails</value>
|
||||||
|
|||||||
@@ -132,10 +132,10 @@
|
|||||||
<value>Utiliser un code d'acces</value>
|
<value>Utiliser un code d'acces</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="FinalEmailToCreator" xml:space="preserve">
|
<data name="FinalEmailToCreator" xml:space="preserve">
|
||||||
<value>E-mail final au createur</value>
|
<value>Document termine au createur</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="FinalEmailToReceivers" xml:space="preserve">
|
<data name="FinalEmailToReceivers" xml:space="preserve">
|
||||||
<value>E-mail final aux destinataires</value>
|
<value>Document termine aux destinataires</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="SendReminderEmails" xml:space="preserve">
|
<data name="SendReminderEmails" xml:space="preserve">
|
||||||
<value>Envoyer des e-mails de rappel</value>
|
<value>Envoyer des e-mails de rappel</value>
|
||||||
|
|||||||
@@ -298,10 +298,10 @@
|
|||||||
<value>Zugriffscode verwenden</value>
|
<value>Zugriffscode verwenden</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="FinalEmailToCreator" xml:space="preserve">
|
<data name="FinalEmailToCreator" xml:space="preserve">
|
||||||
<value>Finale E-Mail an Ersteller</value>
|
<value>Abgeschlossenes Dokument an Ersteller</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="FinalEmailToReceivers" xml:space="preserve">
|
<data name="FinalEmailToReceivers" xml:space="preserve">
|
||||||
<value>Finale E-Mail an Empfänger</value>
|
<value>Abgeschlossenes Dokument an Empfänger</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="SendReminderEmails" xml:space="preserve">
|
<data name="SendReminderEmails" xml:space="preserve">
|
||||||
<value>Erinnerungs-E-Mails senden</value>
|
<value>Erinnerungs-E-Mails senden</value>
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ Public Class frmEnvelopeMainData
|
|||||||
Private Property EnvelopeTypeModel As EnvelopeTypeModel
|
Private Property EnvelopeTypeModel As EnvelopeTypeModel
|
||||||
|
|
||||||
<Bindable(True)>
|
<Bindable(True)>
|
||||||
Private Property EnvelopeType As New EnvelopeType
|
Private Property EnvelopeType As New EnvelopeTypeDefaults
|
||||||
|
|
||||||
Public Property State As State
|
Public Property State As State
|
||||||
|
|
||||||
@@ -68,14 +68,14 @@ Public Class frmEnvelopeMainData
|
|||||||
chked_2Faktor.EditValue = DEF_TF_ENABLED
|
chked_2Faktor.EditValue = DEF_TF_ENABLED
|
||||||
|
|
||||||
Else
|
Else
|
||||||
If IsNothing(Envelope.Type) Then
|
If IsNothing(Envelope.Defaults) Then
|
||||||
Envelope.Type = EnvelopeType
|
Envelope.Defaults = EnvelopeType
|
||||||
End If
|
End If
|
||||||
If Envelope.Type.ContractType = 0 Then
|
If Envelope.Defaults.ContractType = 0 Then
|
||||||
cmbEnvelopeType.EditValue = EnvelopeType
|
cmbEnvelopeType.EditValue = EnvelopeType
|
||||||
Else
|
Else
|
||||||
' This will trigger loading values from the type
|
' This will trigger loading values from the type
|
||||||
cmbEnvelopeType.EditValue = Envelope.Type
|
cmbEnvelopeType.EditValue = Envelope.Defaults
|
||||||
' cmbEnvelopeType.SelectedIndex = Convert.ToInt32(Envelope.Type) - 1
|
' cmbEnvelopeType.SelectedIndex = Convert.ToInt32(Envelope.Type) - 1
|
||||||
' cmbEnvelopeType.SelectedIndex = Envelope.Type.Id - 1
|
' cmbEnvelopeType.SelectedIndex = Envelope.Type.Id - 1
|
||||||
' cmbEnvelopeType.SelectedItem = cmbEnvelopeType.Properties.Items.Cast(Of Type).Where(Function(i) i.Id = Envelope.Type.Id).SingleOrDefault()
|
' cmbEnvelopeType.SelectedItem = cmbEnvelopeType.Properties.Items.Cast(Of Type).Where(Function(i) i.Id = Envelope.Type.Id).SingleOrDefault()
|
||||||
@@ -121,12 +121,12 @@ Public Class frmEnvelopeMainData
|
|||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim oEnvelopeType = DirectCast(cmbEnvelopeType.EditValue, EnvelopeType)
|
Dim oEnvelopeType = DirectCast(cmbEnvelopeType.EditValue, EnvelopeTypeDefaults)
|
||||||
If IsNothing(oEnvelopeType) Then
|
If IsNothing(oEnvelopeType) Then
|
||||||
oEnvelopeType = EnvelopeType
|
oEnvelopeType = EnvelopeType
|
||||||
End If
|
End If
|
||||||
Envelope.Title = txtTitle.EditValue.ToString
|
Envelope.Title = txtTitle.EditValue.ToString
|
||||||
Envelope.Type = oEnvelopeType
|
Envelope.Defaults = oEnvelopeType
|
||||||
Envelope.EnvelopeTypeId = IIf(IsNothing(oEnvelopeType), 0, oEnvelopeType.Id)
|
Envelope.EnvelopeTypeId = IIf(IsNothing(oEnvelopeType), 0, oEnvelopeType.Id)
|
||||||
Envelope.CertificationType = cmbCertificationType.SelectedIndex + 1
|
Envelope.CertificationType = cmbCertificationType.SelectedIndex + 1
|
||||||
Envelope.Language = cmbLanguage.EditValue
|
Envelope.Language = cmbLanguage.EditValue
|
||||||
@@ -162,7 +162,7 @@ Public Class frmEnvelopeMainData
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub cmbContractType_SelectedValueChanged(sender As Object, e As EventArgs) Handles cmbEnvelopeType.SelectedValueChanged
|
Private Sub cmbContractType_SelectedValueChanged(sender As Object, e As EventArgs) Handles cmbEnvelopeType.SelectedValueChanged
|
||||||
Dim oSelectedType As EnvelopeType = cmbEnvelopeType.SelectedItem
|
Dim oSelectedType As EnvelopeTypeDefaults = cmbEnvelopeType.SelectedItem
|
||||||
|
|
||||||
If oSelectedType Is Nothing Then
|
If oSelectedType Is Nothing Then
|
||||||
Exit Sub
|
Exit Sub
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
namespace EnvelopeGenerator.Infrastructure.Notification.Configuration;
|
||||||
|
|
||||||
|
public enum ConsumerType
|
||||||
|
{
|
||||||
|
API,
|
||||||
|
RabbitMQ
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
using DigitalData.MessagingService.RabbitMQ;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Infrastructure.Notification.Configuration;
|
||||||
|
|
||||||
|
public class NotificationOptions
|
||||||
|
{
|
||||||
|
public const string SectionName = "Notification";
|
||||||
|
|
||||||
|
public ConsumerType ConsumerType { get; set; }
|
||||||
|
|
||||||
|
public string? ApiUrl { get; set; }
|
||||||
|
|
||||||
|
public string SenderEmail { get; set; } = null!;
|
||||||
|
|
||||||
|
public RabbitMqConnectionConfiguration? RabbitMQ { get; set; }
|
||||||
|
}
|
||||||
@@ -1,41 +1,49 @@
|
|||||||
using DigitalData.MessagingService.Client;
|
using DigitalData.MessagingService.Client;
|
||||||
using DigitalData.MessagingService.Domain.Entities;
|
|
||||||
using DigitalData.MessagingService.RabbitMQ;
|
|
||||||
using EnvelopeGenerator.Application.Common.Interfaces.Services.Notification;
|
using EnvelopeGenerator.Application.Common.Interfaces.Services.Notification;
|
||||||
|
using EnvelopeGenerator.Infrastructure.Notification.Configuration;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Infrastructure.Notification;
|
namespace EnvelopeGenerator.Infrastructure.Notification;
|
||||||
|
|
||||||
public static class DependencyInjection
|
public static class DependencyInjection
|
||||||
{
|
{
|
||||||
public static IServiceCollection AddNotificationInfrastructure(this IServiceCollection services, IConfiguration configuration)
|
public static IServiceCollection AddNotificationInfrastructure(this IServiceCollection services, IConfiguration configuration, string sectionName = NotificationOptions.SectionName)
|
||||||
{
|
{
|
||||||
var rMqConfig = configuration.GetSection("RabbitMQ").Get<RabbitMqConfiguration>()
|
var ntfConfiguration = configuration.GetSection(sectionName);
|
||||||
?? throw new ArgumentNullException(nameof(RabbitMqConfiguration), "RabbitMQ configuration is missing");
|
services.Configure<NotificationOptions>(ntfConfiguration);
|
||||||
|
|
||||||
EmailSender.ConnectRabbitMq(config =>
|
var options = ntfConfiguration.Get<NotificationOptions>()
|
||||||
|
?? throw new InvalidOperationException(
|
||||||
|
$"Failed to bind configuration section '{sectionName}' to {nameof(NotificationOptions)}. Ensure the section exists and is correctly configured.");
|
||||||
|
|
||||||
|
switch (options.ConsumerType)
|
||||||
{
|
{
|
||||||
config.HostName = rMqConfig.HostName;
|
case ConsumerType.API:
|
||||||
config.Port = rMqConfig.Port;
|
if (options.ApiUrl is string apiUrl)
|
||||||
config.UserName = rMqConfig.UserName;
|
services.AddMessagingServiceHttpClient(opt =>
|
||||||
config.Password = rMqConfig.Password;
|
{
|
||||||
|
opt.BaseAddress = new Uri(apiUrl);
|
||||||
|
// Additional configuration for the MessagingServiceHttpClient can be added here if needed
|
||||||
|
});
|
||||||
|
else
|
||||||
|
throw new InvalidOperationException(
|
||||||
|
$"MessagingServiceApiUrl must be provided when ClientType is set to Api in the '{sectionName}' configuration section.");
|
||||||
|
break;
|
||||||
|
case ConsumerType.RabbitMQ:
|
||||||
|
if (options.RabbitMQ is null)
|
||||||
|
throw new InvalidOperationException(
|
||||||
|
$"Missing RabbitMQ configuration. " +
|
||||||
|
$"When ConsumerType is set to RabbitMQ, '{sectionName}:{nameof(NotificationOptions.RabbitMQ)}' must be configured.");
|
||||||
|
|
||||||
config.VirtualHost = "/";
|
services.AddMessagingServiceClient(
|
||||||
config.QueueName = "emailprofiler.email.outbox";
|
configuration,
|
||||||
config.ExchangeName = "emailprofiler.emails";
|
rabbitMqConnectionSectionName: $"{sectionName}:{nameof(NotificationOptions.RabbitMQ)}");
|
||||||
config.RoutingKey = "email.outbox";
|
break;
|
||||||
config.DlqQueueName = "emailprofiler.email.outbox.dlq";
|
default:
|
||||||
config.DlqExchangeName = "emailprofiler.emails.dlq";
|
throw new InvalidOperationException(
|
||||||
config.DlqRoutingKey = "email.outbox.dlq";
|
$"Unsupported ConsumerType '{options.ConsumerType}' in the '{sectionName}' configuration section.");
|
||||||
});
|
}
|
||||||
|
|
||||||
services.Configure<EmailAccount>(configuration.GetSection("NotificationEmailAccount"));
|
|
||||||
|
|
||||||
services.AddScoped<IEnvelopeNotificationService, EnvelopeNotificationService>();
|
services.AddScoped<IEnvelopeNotificationService, EnvelopeNotificationService>();
|
||||||
return services;
|
return services;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="DigitalData.MessagingService.Client" Version="1.0.5" />
|
<PackageReference Include="DigitalData.MessagingService.Client" Version="3.0.1" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="10.0.10" />
|
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="10.0.10" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
using DigitalData.MessagingService.Application.Common.Dto;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Infrastructure.Notification;
|
||||||
|
|
||||||
|
public static class EnvelopeNotificationExtensions
|
||||||
|
{
|
||||||
|
public static EmailAttachmentDto ToEmailAttachmentDto(this (string FileName, byte[] Content) attachment) => new()
|
||||||
|
{
|
||||||
|
FileName = attachment.FileName,
|
||||||
|
Content = attachment.Content
|
||||||
|
};
|
||||||
|
|
||||||
|
public static IEnumerable<EmailAttachmentDto> ToEmailAttachmentDto(this IEnumerable<(string FileName, byte[] Content)> attachments)
|
||||||
|
=> attachments.Select(ToEmailAttachmentDto);
|
||||||
|
}
|
||||||
@@ -1,44 +1,45 @@
|
|||||||
using DigitalData.Core.Abstraction.Application.Repository;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using DigitalData.Core.Exceptions;
|
using DigitalData.MessagingService.Application.Common.Interfaces;
|
||||||
using DigitalData.MessagingService.Application.Common.Dto;
|
using DigitalData.MessagingService.Application.EmailSending.Commands;
|
||||||
using DigitalData.MessagingService.Client;
|
|
||||||
using DigitalData.MessagingService.Domain.Entities;
|
|
||||||
using EnvelopeGenerator.Application.Common.Interfaces.Services.Notification;
|
using EnvelopeGenerator.Application.Common.Interfaces.Services.Notification;
|
||||||
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using MediatR;
|
using EnvelopeGenerator.Domain.Exceptions;
|
||||||
|
using EnvelopeGenerator.Infrastructure.Notification.Configuration;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Infrastructure.Notification;
|
namespace EnvelopeGenerator.Infrastructure.Notification;
|
||||||
|
|
||||||
public class EnvelopeNotificationService(IOptions<EmailAccount> EmailAccountOptions, IRepository<EmailTemplate> TempRepo) : IEnvelopeNotificationService
|
public class EnvelopeNotificationService(IRepository<EmailTemplate> TempRepo, IMessagingServiceClient MsgClient, IOptions<NotificationOptions> ntfOpt) : IEnvelopeNotificationService
|
||||||
{
|
{
|
||||||
public async Task Notify(string email, DocumentSignedNotification documentSigned, CancellationToken cancel = default)
|
private readonly NotificationOptions NtfOpt = ntfOpt.Value;
|
||||||
{
|
|
||||||
var template = await TempRepo.Where(t => t.Name == "DocumentCompleted").FirstOrDefaultAsync(cancel)
|
|
||||||
?? throw new NotFoundException("DocumentCompleted email template not found");
|
|
||||||
var subjectTemplate = Replace(template.Subject, documentSigned);
|
|
||||||
var bodyTemplate = Replace(template.Body, documentSigned);
|
|
||||||
|
|
||||||
await EmailSender.Send(new EmailContext()
|
private async Task<EmailTemplate> GetTemplateAsync(EmailTemplateType templateType, CancellationToken cancel = default)
|
||||||
{
|
{
|
||||||
Body = bodyTemplate,
|
return await TempRepo.Where(t => t.Name == templateType.ToString()).FirstOrDefaultAsync(cancel)
|
||||||
Subject = subjectTemplate,
|
?? throw new DataIntegrityException($"{templateType} email template not found");
|
||||||
Recipients = [email],
|
|
||||||
Sender = EmailAccountOptions.Value,
|
|
||||||
Attachments = [new EmailAttachmentDto()
|
|
||||||
{
|
|
||||||
FileName = "unterzeichnetes-dokument.pdf",
|
|
||||||
Content = documentSigned.Attachment
|
|
||||||
}]
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string Replace(string template, DocumentSignedNotification documentSigned)
|
public async Task Notify<TEnvelopeNotificationBase>(string receiverEmail, TEnvelopeNotificationBase notification, CancellationToken cancel = default)
|
||||||
|
where TEnvelopeNotificationBase : EnvelopeNotificationBase
|
||||||
{
|
{
|
||||||
return template
|
var template = await GetTemplateAsync(notification.GetTemplateType(), cancel);
|
||||||
.Replace("[DOCUMENT_TITLE]", documentSigned.DocumentTitle)
|
|
||||||
.Replace("[NAME_PORTAL]", documentSigned.NamePortal)
|
// create email command
|
||||||
.Replace("[NAME_RECEIVER]", documentSigned.NameReceiver);
|
var mail = new PublishEmailViaSmtpCommand()
|
||||||
|
{
|
||||||
|
Body = template.Body.ReplacePlaceholders(notification),
|
||||||
|
Subject = template.Subject.ReplacePlaceholders(notification),
|
||||||
|
Recipients = [receiverEmail],
|
||||||
|
Sender = NtfOpt.SenderEmail.ToSender(),
|
||||||
|
IsHtml = true
|
||||||
|
};
|
||||||
|
|
||||||
|
// add attachments if any
|
||||||
|
if(notification.Attachments?.Any() ?? false)
|
||||||
|
mail = mail.WithAttachments(notification.Attachments.ToEmailAttachmentDto());
|
||||||
|
|
||||||
|
await MsgClient.SendAsync(mail, cancel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Infrastructure.Notification;
|
||||||
|
|
||||||
|
public static class ReplacePlaceholderExtensions
|
||||||
|
{
|
||||||
|
private sealed record PlaceholderProperty(string Placeholder, PropertyInfo Property);
|
||||||
|
|
||||||
|
private static readonly ConcurrentDictionary<Type, PlaceholderProperty[]> PropertyCache = new();
|
||||||
|
|
||||||
|
public static string ReplacePlaceholders(this string template, object data)
|
||||||
|
{
|
||||||
|
var properties = PropertyCache.GetOrAdd(data.GetType(), CreatePlaceholderProperties);
|
||||||
|
|
||||||
|
foreach (var item in properties)
|
||||||
|
{
|
||||||
|
var value = item.Property.GetValue(data)?.ToString() ?? string.Empty;
|
||||||
|
template = template.Replace(
|
||||||
|
item.Placeholder,
|
||||||
|
value,
|
||||||
|
StringComparison.Ordinal);
|
||||||
|
}
|
||||||
|
|
||||||
|
return template;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static PlaceholderProperty[] CreatePlaceholderProperties(
|
||||||
|
Type type)
|
||||||
|
{
|
||||||
|
return [.. type
|
||||||
|
.GetProperties(BindingFlags.Public | BindingFlags.Instance)
|
||||||
|
.Where(p => p.CanRead && p.GetIndexParameters().Length == 0)
|
||||||
|
.Select(p => new PlaceholderProperty(
|
||||||
|
$"[{ToCapitalSnakeCase(p.Name)}]",
|
||||||
|
p))];
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string ToCapitalSnakeCase(string name)
|
||||||
|
{
|
||||||
|
return Regex.Replace(
|
||||||
|
Regex.Replace(name, @"([A-Z]+)([A-Z][a-z])", "$1_$2"),
|
||||||
|
@"([a-z0-9])([A-Z])",
|
||||||
|
"$1_$2").ToUpperInvariant();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -57,7 +57,7 @@ public abstract class EGDbContextBase : DbContext
|
|||||||
|
|
||||||
public DbSet<History> EnvelopeHistories { get; set; }
|
public DbSet<History> EnvelopeHistories { get; set; }
|
||||||
|
|
||||||
public DbSet<EnvelopeType> EnvelopeTypes { get; set; }
|
public DbSet<EnvelopeTypeDefaults> EnvelopeTypes { get; set; }
|
||||||
|
|
||||||
public DbSet<Receiver> Receivers { get; set; }
|
public DbSet<Receiver> Receivers { get; set; }
|
||||||
|
|
||||||
@@ -233,7 +233,7 @@ public abstract class EGDbContextBase : DbContext
|
|||||||
AddTrigger<History>();
|
AddTrigger<History>();
|
||||||
AddTrigger<EnvelopeReceiver>();
|
AddTrigger<EnvelopeReceiver>();
|
||||||
AddTrigger<EnvelopeReceiverReadOnly>();
|
AddTrigger<EnvelopeReceiverReadOnly>();
|
||||||
AddTrigger<EnvelopeType>();
|
AddTrigger<EnvelopeTypeDefaults>();
|
||||||
AddTrigger<Receiver>();
|
AddTrigger<Receiver>();
|
||||||
#if NET
|
#if NET
|
||||||
AddTrigger<EmailOut>();
|
AddTrigger<EmailOut>();
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
#if NET
|
#if NET
|
||||||
using Dapper;
|
using Dapper;
|
||||||
using DigitalData.UserManager.Application.Contracts.Repositories;
|
|
||||||
using EnvelopeGenerator.Application.Common.Interfaces.SQLExecutor;
|
using EnvelopeGenerator.Application.Common.Interfaces.SQLExecutor;
|
||||||
using EnvelopeGenerator.Application.Common.SQL;
|
using EnvelopeGenerator.Application.Common.SQL;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using Microsoft.Data.SqlClient;
|
using Microsoft.Data.SqlClient;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
|
|
||||||
@@ -12,13 +12,11 @@ namespace EnvelopeGenerator.Infrastructure.Executor;
|
|||||||
|
|
||||||
public class EnvelopeExecutor : SQLExecutor, IEnvelopeExecutor
|
public class EnvelopeExecutor : SQLExecutor, IEnvelopeExecutor
|
||||||
{
|
{
|
||||||
[Obsolete("Use IRepository")]
|
private readonly EGDbContext _dbContext;
|
||||||
private readonly IUserRepository _userRepository;
|
|
||||||
|
|
||||||
[Obsolete("Use IRepository")]
|
public EnvelopeExecutor(IServiceProvider provider, IOptions<SQLExecutorParams> sqlExecutorParamsOptions, EGDbContext dbContext) : base(provider, sqlExecutorParamsOptions)
|
||||||
public EnvelopeExecutor(IServiceProvider provider, IOptions<SQLExecutorParams> sqlExecutorParamsOptions, IUserRepository userRepository) : base(provider, sqlExecutorParamsOptions)
|
|
||||||
{
|
{
|
||||||
_userRepository = userRepository;
|
_dbContext = dbContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
[Obsolete("Use IRepository")]
|
[Obsolete("Use IRepository")]
|
||||||
@@ -33,7 +31,9 @@ public class EnvelopeExecutor : SQLExecutor, IEnvelopeExecutor
|
|||||||
?? throw new InvalidOperationException($"Envelope creation failed. Parameters:" +
|
?? throw new InvalidOperationException($"Envelope creation failed. Parameters:" +
|
||||||
$"userId={userId}, title='{title}', message='{message}', tfaEnabled={tfaEnabled}.");
|
$"userId={userId}, title='{title}', message='{message}', tfaEnabled={tfaEnabled}.");
|
||||||
|
|
||||||
envelope.User = await _userRepository.ReadByIdAsync(envelope.UserId);
|
envelope.User = await _dbContext.Users
|
||||||
|
.AsNoTracking()
|
||||||
|
.FirstOrDefaultAsync(x => x.Id == envelope.UserId, cancellation);
|
||||||
|
|
||||||
return envelope;
|
return envelope;
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,813 +0,0 @@
|
|||||||
#if NET
|
|
||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Infrastructure.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class InitialCreate : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.EnsureSchema(
|
|
||||||
name: "dbo");
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "TBDD_CLIENT_USER",
|
|
||||||
schema: "dbo",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
GUID = table.Column<int>(type: "int", nullable: false)
|
|
||||||
.Annotation("SqlServer:Identity", "1, 1"),
|
|
||||||
USER_ID = table.Column<int>(type: "int", nullable: false),
|
|
||||||
CLIENT_ID = table.Column<int>(type: "int", nullable: false),
|
|
||||||
COMMENT = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
||||||
ADDED_WHO = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
|
||||||
ADDED_WHEN = table.Column<DateTime>(type: "datetime", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_TBDD_CLIENT_USER", x => x.GUID);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "TBDD_GROUPS",
|
|
||||||
schema: "dbo",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
GUID = table.Column<int>(type: "int", nullable: false)
|
|
||||||
.Annotation("SqlServer:Identity", "1, 1"),
|
|
||||||
Name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
|
||||||
AD_SYNC = table.Column<bool>(type: "bit", nullable: false),
|
|
||||||
Internal = table.Column<bool>(type: "bit", nullable: false),
|
|
||||||
Active = table.Column<bool>(type: "bit", nullable: false),
|
|
||||||
Comment = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
|
|
||||||
ECM_FK_ID = table.Column<int>(type: "int", nullable: false),
|
|
||||||
ADDED_WHO = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
|
||||||
CHANGED_WHO = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
|
||||||
ADDED_WHEN = table.Column<DateTime>(type: "datetime", nullable: false),
|
|
||||||
CHANGED_WHEN = table.Column<DateTime>(type: "datetime", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_TBDD_GROUPS", x => x.GUID);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "TBDD_MODULES",
|
|
||||||
schema: "dbo",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
GUID = table.Column<int>(type: "int", nullable: false)
|
|
||||||
.Annotation("SqlServer:Identity", "1, 1"),
|
|
||||||
Name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
|
||||||
SHORT_NAME = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_TBDD_MODULES", x => x.GUID);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "TBDD_USER",
|
|
||||||
schema: "dbo",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
GUID = table.Column<int>(type: "int", nullable: false)
|
|
||||||
.Annotation("SqlServer:Identity", "1, 1"),
|
|
||||||
PRENAME = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
|
||||||
NAME = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
|
||||||
USERNAME = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
|
|
||||||
SHORTNAME = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
|
|
||||||
EMAIL = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
|
|
||||||
LANGUAGE = table.Column<string>(type: "nvarchar(5)", maxLength: 5, nullable: false),
|
|
||||||
COMMENT = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
|
|
||||||
DELETED = table.Column<bool>(type: "bit", nullable: false),
|
|
||||||
DATE_FORMAT = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: false),
|
|
||||||
ACTIVE = table.Column<bool>(type: "bit", nullable: false),
|
|
||||||
GENERAL_VIEWER = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: false),
|
|
||||||
WAN_ENVIRONMENT = table.Column<bool>(type: "bit", nullable: false),
|
|
||||||
USERID_FK_INT_ECM = table.Column<int>(type: "int", nullable: false),
|
|
||||||
DELETED_WHEN = table.Column<DateTime>(type: "datetime2", nullable: false),
|
|
||||||
DELETED_WHO = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
|
|
||||||
ADDED_WHO = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
|
||||||
CHANGED_WHO = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
|
||||||
ADDED_WHEN = table.Column<DateTime>(type: "datetime", nullable: false),
|
|
||||||
CHANGED_WHEN = table.Column<DateTime>(type: "datetime", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_TBDD_USER", x => x.GUID);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "TBEMLP_EMAIL_OUT",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
GUID = table.Column<int>(type: "int", nullable: false)
|
|
||||||
.Annotation("SqlServer:Identity", "1, 1"),
|
|
||||||
REMINDER_TYPE_ID = table.Column<int>(type: "int", nullable: false),
|
|
||||||
SENDING_PROFILE = table.Column<int>(type: "int", nullable: false),
|
|
||||||
REFERENCE_ID = table.Column<int>(type: "int", nullable: false),
|
|
||||||
REFERENCE_STRING = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true),
|
|
||||||
ENTITY_ID = table.Column<int>(type: "int", nullable: true),
|
|
||||||
WF_ID = table.Column<int>(type: "int", nullable: false),
|
|
||||||
WF_REFERENCE = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true),
|
|
||||||
EMAIL_ADRESS = table.Column<string>(type: "varchar(1000)", maxLength: 1000, nullable: false),
|
|
||||||
EMAIL_SUBJ = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: false),
|
|
||||||
EMAIL_BODY = table.Column<string>(type: "varchar(max)", nullable: false),
|
|
||||||
EMAIL_ATTMT1 = table.Column<string>(type: "varchar(512)", maxLength: 512, nullable: true),
|
|
||||||
EMAIL_SENT = table.Column<DateTime>(type: "datetime2", nullable: true),
|
|
||||||
COMMENT = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: true),
|
|
||||||
ADDED_WHO = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false),
|
|
||||||
CHANGED_WHO = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true),
|
|
||||||
CHANGED_WHEN = table.Column<DateTime>(type: "datetime2", nullable: true),
|
|
||||||
ERROR_TIMESTAMP = table.Column<DateTime>(type: "datetime2", nullable: true),
|
|
||||||
ERROR_MSG = table.Column<string>(type: "varchar(900)", maxLength: 900, nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_TBEMLP_EMAIL_OUT", x => x.GUID);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "TBSIG_CONFIG",
|
|
||||||
schema: "dbo",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
SENDING_PROFILE = table.Column<int>(type: "int", nullable: false),
|
|
||||||
SIGNATURE_HOST = table.Column<string>(type: "nvarchar(128)", nullable: false),
|
|
||||||
EXTERNAL_PROGRAM_NAME = table.Column<string>(type: "nvarchar(30)", nullable: true),
|
|
||||||
EXPORT_PATH = table.Column<string>(type: "nvarchar(256)", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "TBSIG_EMAIL_TEMPLATE",
|
|
||||||
schema: "dbo",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
GUID = table.Column<int>(type: "int", nullable: false)
|
|
||||||
.Annotation("SqlServer:Identity", "1, 1"),
|
|
||||||
NAME = table.Column<string>(type: "nvarchar(64)", nullable: true),
|
|
||||||
BODY = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
||||||
SUBJECT = table.Column<string>(type: "nvarchar(512)", nullable: true),
|
|
||||||
ADDED_WHEN = table.Column<DateTime>(type: "datetime", nullable: false),
|
|
||||||
CHANGED_WHEN = table.Column<DateTime>(type: "datetime", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_TBSIG_EMAIL_TEMPLATE", x => x.GUID);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "TBSIG_ENVELOPE_CERTIFICATE",
|
|
||||||
schema: "dbo",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
GUID = table.Column<int>(type: "int", nullable: false)
|
|
||||||
.Annotation("SqlServer:Identity", "1, 1"),
|
|
||||||
ENVELOPE_ID = table.Column<int>(type: "int", nullable: false),
|
|
||||||
ENVELOPE_UUID = table.Column<string>(type: "nvarchar(36)", nullable: false),
|
|
||||||
ENVELOPE_SUBJECT = table.Column<string>(type: "nvarchar(512)", nullable: false),
|
|
||||||
CREATOR_ID = table.Column<int>(type: "int", nullable: false),
|
|
||||||
CREATOR_NAME = table.Column<string>(type: "nvarchar(128)", nullable: false),
|
|
||||||
CREATOR_EMAIL = table.Column<string>(type: "nvarchar(128)", nullable: false),
|
|
||||||
ENVELOPE_STATUS = table.Column<int>(type: "int", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_TBSIG_ENVELOPE_CERTIFICATE", x => x.GUID);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "TBSIG_ENVELOPE_TYPE",
|
|
||||||
schema: "dbo",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
GUID = table.Column<int>(type: "int", nullable: false)
|
|
||||||
.Annotation("SqlServer:Identity", "1, 1"),
|
|
||||||
TITLE = table.Column<string>(type: "nvarchar(128)", nullable: false),
|
|
||||||
LANGUAGE = table.Column<string>(type: "nvarchar(5)", nullable: true),
|
|
||||||
EXPIRES_DAYS = table.Column<int>(type: "int", nullable: false),
|
|
||||||
CERTIFICATION_TYPE = table.Column<int>(type: "int", nullable: false),
|
|
||||||
USE_ACCESS_CODE = table.Column<bool>(type: "bit", nullable: false),
|
|
||||||
FINAL_EMAIL_TO_CREATOR = table.Column<int>(type: "int", nullable: false),
|
|
||||||
FINAL_EMAIL_TO_RECEIVERS = table.Column<int>(type: "int", nullable: false),
|
|
||||||
ADDED_WHEN = table.Column<DateTime>(type: "datetime", nullable: false),
|
|
||||||
CHANGED_WHEN = table.Column<DateTime>(type: "datetime", nullable: false),
|
|
||||||
EXPIRES_WARNING_DAYS = table.Column<int>(type: "int", nullable: false),
|
|
||||||
SEND_REMINDER_EMAILS = table.Column<bool>(type: "bit", nullable: false),
|
|
||||||
FIRST_REMINDER_DAYS = table.Column<int>(type: "int", nullable: false),
|
|
||||||
REMINDER_INTERVAL_DAYS = table.Column<int>(type: "int", nullable: false),
|
|
||||||
CONTRACT_TYPE = table.Column<int>(type: "int", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_TBSIG_ENVELOPE_TYPE", x => x.GUID);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "TBDD_GROUPS_USER",
|
|
||||||
schema: "dbo",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
GUID = table.Column<int>(type: "int", nullable: false)
|
|
||||||
.Annotation("SqlServer:Identity", "1, 1"),
|
|
||||||
USER_ID = table.Column<int>(type: "int", nullable: false),
|
|
||||||
GROUP_ID = table.Column<int>(type: "int", nullable: false),
|
|
||||||
Comment = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
|
|
||||||
ADDED_WHO = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
|
||||||
CHANGED_WHO = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
|
||||||
ADDED_WHEN = table.Column<DateTime>(type: "datetime", nullable: false),
|
|
||||||
CHANGED_WHEN = table.Column<DateTime>(type: "datetime", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_TBDD_GROUPS_USER", x => x.GUID);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_TBDD_GROUPS_USER_TBDD_GROUPS_GROUP_ID",
|
|
||||||
column: x => x.GROUP_ID,
|
|
||||||
principalSchema: "dbo",
|
|
||||||
principalTable: "TBDD_GROUPS",
|
|
||||||
principalColumn: "GUID",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_TBDD_GROUPS_USER_TBDD_USER_USER_ID",
|
|
||||||
column: x => x.USER_ID,
|
|
||||||
principalSchema: "dbo",
|
|
||||||
principalTable: "TBDD_USER",
|
|
||||||
principalColumn: "GUID",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "TBDD_USER_MODULES",
|
|
||||||
schema: "dbo",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
GUID = table.Column<int>(type: "int", nullable: false)
|
|
||||||
.Annotation("SqlServer:Identity", "1, 1"),
|
|
||||||
USER_ID = table.Column<int>(type: "int", nullable: false),
|
|
||||||
MODULE_ID = table.Column<int>(type: "int", nullable: false),
|
|
||||||
COMMENT = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
|
|
||||||
ADDED_WHO = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
|
||||||
CHANGED_WHO = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_TBDD_USER_MODULES", x => x.GUID);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_TBDD_USER_MODULES_TBDD_MODULES_MODULE_ID",
|
|
||||||
column: x => x.MODULE_ID,
|
|
||||||
principalSchema: "dbo",
|
|
||||||
principalTable: "TBDD_MODULES",
|
|
||||||
principalColumn: "GUID",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_TBDD_USER_MODULES_TBDD_USER_USER_ID",
|
|
||||||
column: x => x.USER_ID,
|
|
||||||
principalSchema: "dbo",
|
|
||||||
principalTable: "TBDD_USER",
|
|
||||||
principalColumn: "GUID",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "TBDD_USER_REPRESENTATION",
|
|
||||||
schema: "dbo",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
GUID = table.Column<int>(type: "int", nullable: false)
|
|
||||||
.Annotation("SqlServer:Identity", "1, 1"),
|
|
||||||
USER_ID = table.Column<int>(type: "int", nullable: true),
|
|
||||||
REPR_GROUP = table.Column<int>(type: "int", nullable: true),
|
|
||||||
GROUP_ID = table.Column<int>(type: "int", nullable: true),
|
|
||||||
REPR_USER = table.Column<int>(type: "int", nullable: true),
|
|
||||||
VALID_FROM = table.Column<DateTime>(type: "datetime2", nullable: true),
|
|
||||||
VALID_TO = table.Column<DateTime>(type: "datetime2", nullable: true),
|
|
||||||
ADDED_WHO = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
|
||||||
CHANGED_WHO = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
|
||||||
ADDED_WHEN = table.Column<DateTime>(type: "datetime", nullable: false),
|
|
||||||
CHANGED_WHEN = table.Column<DateTime>(type: "datetime", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_TBDD_USER_REPRESENTATION", x => x.GUID);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_TBDD_USER_REPRESENTATION_TBDD_GROUPS_GROUP_ID",
|
|
||||||
column: x => x.GROUP_ID,
|
|
||||||
principalSchema: "dbo",
|
|
||||||
principalTable: "TBDD_GROUPS",
|
|
||||||
principalColumn: "GUID");
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_TBDD_USER_REPRESENTATION_TBDD_GROUPS_REPR_GROUP",
|
|
||||||
column: x => x.REPR_GROUP,
|
|
||||||
principalSchema: "dbo",
|
|
||||||
principalTable: "TBDD_GROUPS",
|
|
||||||
principalColumn: "GUID");
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_TBDD_USER_REPRESENTATION_TBDD_USER_REPR_USER",
|
|
||||||
column: x => x.REPR_USER,
|
|
||||||
principalSchema: "dbo",
|
|
||||||
principalTable: "TBDD_USER",
|
|
||||||
principalColumn: "GUID");
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_TBDD_USER_REPRESENTATION_TBDD_USER_USER_ID",
|
|
||||||
column: x => x.USER_ID,
|
|
||||||
principalSchema: "dbo",
|
|
||||||
principalTable: "TBDD_USER",
|
|
||||||
principalColumn: "GUID");
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "TBSIG_ENVELOPE",
|
|
||||||
schema: "dbo",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
GUID = table.Column<int>(type: "int", nullable: false)
|
|
||||||
.Annotation("SqlServer:Identity", "1, 1"),
|
|
||||||
USER_ID = table.Column<int>(type: "int", nullable: false),
|
|
||||||
STATUS = table.Column<int>(type: "int", nullable: false),
|
|
||||||
ENVELOPE_UUID = table.Column<string>(type: "nvarchar(36)", nullable: false),
|
|
||||||
MESSAGE = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
||||||
EXPIRES_WHEN = table.Column<DateTime>(type: "datetime", nullable: false),
|
|
||||||
EXPIRES_WARNING_WHEN = table.Column<DateTime>(type: "datetime", nullable: false),
|
|
||||||
ADDED_WHEN = table.Column<DateTime>(type: "datetime", nullable: false),
|
|
||||||
CHANGED_WHEN = table.Column<DateTime>(type: "datetime", nullable: false),
|
|
||||||
TITLE = table.Column<string>(type: "nvarchar(128)", nullable: true),
|
|
||||||
CONTRACT_TYPE = table.Column<int>(type: "int", nullable: false),
|
|
||||||
LANGUAGE = table.Column<string>(type: "nvarchar(5)", nullable: true),
|
|
||||||
SEND_REMINDER_EMAILS = table.Column<bool>(type: "bit", nullable: false),
|
|
||||||
FIRST_REMINDER_DAYS = table.Column<int>(type: "int", nullable: false),
|
|
||||||
REMINDER_INTERVAL_DAYS = table.Column<int>(type: "int", nullable: false),
|
|
||||||
ENVELOPE_TYPE = table.Column<int>(type: "int", nullable: false),
|
|
||||||
CERTIFICATION_TYPE = table.Column<int>(type: "int", nullable: false),
|
|
||||||
USE_ACCESS_CODE = table.Column<bool>(type: "bit", nullable: false),
|
|
||||||
FINAL_EMAIL_TO_CREATOR = table.Column<int>(type: "int", nullable: false),
|
|
||||||
FINAL_EMAIL_TO_RECEIVERS = table.Column<int>(type: "int", nullable: false),
|
|
||||||
EXPIRES_WHEN_DAYS = table.Column<int>(type: "int", nullable: false),
|
|
||||||
EXPIRES_WARNING_WHEN_DAYS = table.Column<int>(type: "int", nullable: false),
|
|
||||||
TFA_ENABLED = table.Column<bool>(type: "bit", nullable: false),
|
|
||||||
DOC_RESULT = table.Column<byte[]>(type: "varbinary(max)", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_TBSIG_ENVELOPE", x => x.GUID);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_TBSIG_ENVELOPE_TBDD_USER_USER_ID",
|
|
||||||
column: x => x.USER_ID,
|
|
||||||
principalSchema: "dbo",
|
|
||||||
principalTable: "TBDD_USER",
|
|
||||||
principalColumn: "GUID",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_TBSIG_ENVELOPE_TBSIG_ENVELOPE_TYPE_ENVELOPE_TYPE",
|
|
||||||
column: x => x.ENVELOPE_TYPE,
|
|
||||||
principalSchema: "dbo",
|
|
||||||
principalTable: "TBSIG_ENVELOPE_TYPE",
|
|
||||||
principalColumn: "GUID",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "TBSIG_ENVELOPE_DOCUMENT",
|
|
||||||
schema: "dbo",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
GUID = table.Column<int>(type: "int", nullable: false)
|
|
||||||
.Annotation("SqlServer:Identity", "1, 1"),
|
|
||||||
ENVELOPE_ID = table.Column<int>(type: "int", nullable: false),
|
|
||||||
ADDED_WHEN = table.Column<DateTime>(type: "datetime", nullable: false),
|
|
||||||
BYTE_DATA = table.Column<byte[]>(type: "varbinary(max)", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_TBSIG_ENVELOPE_DOCUMENT", x => x.GUID);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_TBSIG_ENVELOPE_DOCUMENT_TBSIG_ENVELOPE_ENVELOPE_ID",
|
|
||||||
column: x => x.ENVELOPE_ID,
|
|
||||||
principalSchema: "dbo",
|
|
||||||
principalTable: "TBSIG_ENVELOPE",
|
|
||||||
principalColumn: "GUID",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "TBSIG_RECEIVER",
|
|
||||||
schema: "dbo",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
GUID = table.Column<int>(type: "int", nullable: false)
|
|
||||||
.Annotation("SqlServer:Identity", "1, 1"),
|
|
||||||
EMAIL_ADDRESS = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false),
|
|
||||||
SIGNATURE = table.Column<string>(type: "nvarchar(64)", nullable: false),
|
|
||||||
ADDED_WHEN = table.Column<DateTime>(type: "datetime", nullable: false),
|
|
||||||
TOTP_SECRET_KEY = table.Column<string>(type: "nvarchar(MAX)", nullable: true),
|
|
||||||
TFA_REG_DEADLINE = table.Column<DateTime>(type: "datetime", nullable: false),
|
|
||||||
EnvelopeId = table.Column<int>(type: "int", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_TBSIG_RECEIVER", x => x.GUID);
|
|
||||||
table.UniqueConstraint("AK_TBSIG_RECEIVER_EMAIL_ADDRESS", x => x.EMAIL_ADDRESS);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_TBSIG_RECEIVER_TBSIG_ENVELOPE_EnvelopeId",
|
|
||||||
column: x => x.EnvelopeId,
|
|
||||||
principalSchema: "dbo",
|
|
||||||
principalTable: "TBSIG_ENVELOPE",
|
|
||||||
principalColumn: "GUID");
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "TBSIG_DOCUMENT_RECEIVER_ELEMENT",
|
|
||||||
schema: "dbo",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
GUID = table.Column<int>(type: "int", nullable: false)
|
|
||||||
.Annotation("SqlServer:Identity", "1, 1"),
|
|
||||||
DOCUMENT_ID = table.Column<int>(type: "int", nullable: false),
|
|
||||||
RECEIVER_ID = table.Column<int>(type: "int", nullable: false),
|
|
||||||
ELEMENT_TYPE = table.Column<int>(type: "int", nullable: false),
|
|
||||||
POSITION_X = table.Column<double>(type: "float", nullable: false),
|
|
||||||
POSITION_Y = table.Column<double>(type: "float", nullable: false),
|
|
||||||
WIDTH = table.Column<double>(type: "float", nullable: false),
|
|
||||||
HEIGHT = table.Column<double>(type: "float", nullable: false),
|
|
||||||
PAGE = table.Column<int>(type: "int", nullable: false),
|
|
||||||
REQUIRED = table.Column<bool>(type: "bit", nullable: false),
|
|
||||||
TOOLTIP = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
||||||
READ_ONLY = table.Column<bool>(type: "bit", nullable: false),
|
|
||||||
ANNOTATION_INDEX = table.Column<int>(type: "int", nullable: false),
|
|
||||||
ADDED_WHEN = table.Column<DateTime>(type: "datetime", nullable: false),
|
|
||||||
CHANGED_WHEN = table.Column<DateTime>(type: "datetime", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_TBSIG_DOCUMENT_RECEIVER_ELEMENT", x => x.GUID);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_TBSIG_DOCUMENT_RECEIVER_ELEMENT_TBSIG_ENVELOPE_DOCUMENT_DOCUMENT_ID",
|
|
||||||
column: x => x.DOCUMENT_ID,
|
|
||||||
principalSchema: "dbo",
|
|
||||||
principalTable: "TBSIG_ENVELOPE_DOCUMENT",
|
|
||||||
principalColumn: "GUID",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_TBSIG_DOCUMENT_RECEIVER_ELEMENT_TBSIG_RECEIVER_RECEIVER_ID",
|
|
||||||
column: x => x.RECEIVER_ID,
|
|
||||||
principalSchema: "dbo",
|
|
||||||
principalTable: "TBSIG_RECEIVER",
|
|
||||||
principalColumn: "GUID",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "TBSIG_DOCUMENT_STATUS",
|
|
||||||
schema: "dbo",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
GUID = table.Column<int>(type: "int", nullable: false)
|
|
||||||
.Annotation("SqlServer:Identity", "1, 1"),
|
|
||||||
ENVELOPE_ID = table.Column<int>(type: "int", nullable: false),
|
|
||||||
RECEIVER_ID = table.Column<int>(type: "int", nullable: false),
|
|
||||||
STATUS = table.Column<int>(type: "int", nullable: false),
|
|
||||||
STATUS_CHANGED_WHEN = table.Column<DateTime>(type: "datetime", nullable: false),
|
|
||||||
VALUE = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
||||||
ADDED_WHEN = table.Column<DateTime>(type: "datetime", nullable: false),
|
|
||||||
CHANGED_WHEN = table.Column<DateTime>(type: "datetime", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_TBSIG_DOCUMENT_STATUS", x => x.GUID);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_TBSIG_DOCUMENT_STATUS_TBSIG_ENVELOPE_ENVELOPE_ID",
|
|
||||||
column: x => x.ENVELOPE_ID,
|
|
||||||
principalSchema: "dbo",
|
|
||||||
principalTable: "TBSIG_ENVELOPE",
|
|
||||||
principalColumn: "GUID",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_TBSIG_DOCUMENT_STATUS_TBSIG_RECEIVER_RECEIVER_ID",
|
|
||||||
column: x => x.RECEIVER_ID,
|
|
||||||
principalSchema: "dbo",
|
|
||||||
principalTable: "TBSIG_RECEIVER",
|
|
||||||
principalColumn: "GUID",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "TBSIG_ENVELOPE_HISTORY",
|
|
||||||
schema: "dbo",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
GUID = table.Column<long>(type: "bigint", nullable: false)
|
|
||||||
.Annotation("SqlServer:Identity", "1, 1"),
|
|
||||||
ENVELOPE_ID = table.Column<int>(type: "int", nullable: false),
|
|
||||||
USER_REFERENCE = table.Column<string>(type: "nvarchar(128)", nullable: false),
|
|
||||||
STATUS = table.Column<int>(type: "int", nullable: false),
|
|
||||||
ADDED_WHEN = table.Column<DateTime>(type: "datetime", nullable: false),
|
|
||||||
ACTION_DATE = table.Column<DateTime>(type: "datetime", nullable: false),
|
|
||||||
COMMENT = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
||||||
SenderId = table.Column<int>(type: "int", nullable: true),
|
|
||||||
ReceiverId = table.Column<int>(type: "int", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_TBSIG_ENVELOPE_HISTORY", x => x.GUID);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_TBSIG_ENVELOPE_HISTORY_TBDD_USER_SenderId",
|
|
||||||
column: x => x.SenderId,
|
|
||||||
principalSchema: "dbo",
|
|
||||||
principalTable: "TBDD_USER",
|
|
||||||
principalColumn: "GUID");
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_TBSIG_ENVELOPE_HISTORY_TBSIG_ENVELOPE_ENVELOPE_ID",
|
|
||||||
column: x => x.ENVELOPE_ID,
|
|
||||||
principalSchema: "dbo",
|
|
||||||
principalTable: "TBSIG_ENVELOPE",
|
|
||||||
principalColumn: "GUID",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_TBSIG_ENVELOPE_HISTORY_TBSIG_RECEIVER_ReceiverId",
|
|
||||||
column: x => x.ReceiverId,
|
|
||||||
principalSchema: "dbo",
|
|
||||||
principalTable: "TBSIG_RECEIVER",
|
|
||||||
principalColumn: "GUID");
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "TBSIG_ENVELOPE_RECEIVER",
|
|
||||||
schema: "dbo",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
ENVELOPE_ID = table.Column<int>(type: "int", nullable: false),
|
|
||||||
RECEIVER_ID = table.Column<int>(type: "int", nullable: false),
|
|
||||||
SEQUENCE = table.Column<int>(type: "int", nullable: false),
|
|
||||||
NAME = table.Column<string>(type: "nvarchar(128)", nullable: true),
|
|
||||||
JOB_TITLE = table.Column<string>(type: "nvarchar(128)", nullable: true),
|
|
||||||
COMPANY_NAME = table.Column<string>(type: "nvarchar(128)", nullable: true),
|
|
||||||
PRIVATE_MESSAGE = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
||||||
ACCESS_CODE = table.Column<string>(type: "nvarchar(64)", nullable: true),
|
|
||||||
ADDED_WHEN = table.Column<DateTime>(type: "datetime", nullable: false),
|
|
||||||
CHANGED_WHEN = table.Column<DateTime>(type: "datetime", nullable: false),
|
|
||||||
PHONE_NUMBER = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_TBSIG_ENVELOPE_RECEIVER", x => new { x.ENVELOPE_ID, x.RECEIVER_ID });
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_TBSIG_ENVELOPE_RECEIVER_TBSIG_ENVELOPE_ENVELOPE_ID",
|
|
||||||
column: x => x.ENVELOPE_ID,
|
|
||||||
principalSchema: "dbo",
|
|
||||||
principalTable: "TBSIG_ENVELOPE",
|
|
||||||
principalColumn: "GUID",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_TBSIG_ENVELOPE_RECEIVER_TBSIG_RECEIVER_RECEIVER_ID",
|
|
||||||
column: x => x.RECEIVER_ID,
|
|
||||||
principalSchema: "dbo",
|
|
||||||
principalTable: "TBSIG_RECEIVER",
|
|
||||||
principalColumn: "GUID",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "TBSIG_ENVELOPE_RECEIVER_READ_ONLY",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
GUID = table.Column<long>(type: "bigint", nullable: false)
|
|
||||||
.Annotation("SqlServer:Identity", "1, 1"),
|
|
||||||
ENVELOPE_ID = table.Column<long>(type: "bigint", nullable: false),
|
|
||||||
RECEIVER_MAIL = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false),
|
|
||||||
DATE_VALID = table.Column<DateTime>(type: "datetime2", nullable: false),
|
|
||||||
ADDED_WHO = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false),
|
|
||||||
ADDED_WHEN = table.Column<DateTime>(type: "datetime2", nullable: false),
|
|
||||||
CHANGED_WHO = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
|
|
||||||
CHANGED_WHEN = table.Column<DateTime>(type: "datetime2", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_TBSIG_ENVELOPE_RECEIVER_READ_ONLY", x => x.GUID);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_TBSIG_ENVELOPE_RECEIVER_READ_ONLY_TBSIG_RECEIVER_ADDED_WHO",
|
|
||||||
column: x => x.ADDED_WHO,
|
|
||||||
principalSchema: "dbo",
|
|
||||||
principalTable: "TBSIG_RECEIVER",
|
|
||||||
principalColumn: "EMAIL_ADDRESS",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_TBDD_GROUPS_USER_GROUP_ID",
|
|
||||||
schema: "dbo",
|
|
||||||
table: "TBDD_GROUPS_USER",
|
|
||||||
column: "GROUP_ID");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_TBDD_GROUPS_USER_USER_ID",
|
|
||||||
schema: "dbo",
|
|
||||||
table: "TBDD_GROUPS_USER",
|
|
||||||
column: "USER_ID");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_TBDD_USER_MODULES_MODULE_ID",
|
|
||||||
schema: "dbo",
|
|
||||||
table: "TBDD_USER_MODULES",
|
|
||||||
column: "MODULE_ID");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_TBDD_USER_MODULES_USER_ID",
|
|
||||||
schema: "dbo",
|
|
||||||
table: "TBDD_USER_MODULES",
|
|
||||||
column: "USER_ID");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_TBDD_USER_REPRESENTATION_GROUP_ID",
|
|
||||||
schema: "dbo",
|
|
||||||
table: "TBDD_USER_REPRESENTATION",
|
|
||||||
column: "GROUP_ID");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_TBDD_USER_REPRESENTATION_REPR_GROUP",
|
|
||||||
schema: "dbo",
|
|
||||||
table: "TBDD_USER_REPRESENTATION",
|
|
||||||
column: "REPR_GROUP");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_TBDD_USER_REPRESENTATION_REPR_USER",
|
|
||||||
schema: "dbo",
|
|
||||||
table: "TBDD_USER_REPRESENTATION",
|
|
||||||
column: "REPR_USER");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_TBDD_USER_REPRESENTATION_USER_ID",
|
|
||||||
schema: "dbo",
|
|
||||||
table: "TBDD_USER_REPRESENTATION",
|
|
||||||
column: "USER_ID");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_TBSIG_DOCUMENT_RECEIVER_ELEMENT_DOCUMENT_ID",
|
|
||||||
schema: "dbo",
|
|
||||||
table: "TBSIG_DOCUMENT_RECEIVER_ELEMENT",
|
|
||||||
column: "DOCUMENT_ID");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_TBSIG_DOCUMENT_RECEIVER_ELEMENT_RECEIVER_ID",
|
|
||||||
schema: "dbo",
|
|
||||||
table: "TBSIG_DOCUMENT_RECEIVER_ELEMENT",
|
|
||||||
column: "RECEIVER_ID");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_TBSIG_DOCUMENT_STATUS_ENVELOPE_ID",
|
|
||||||
schema: "dbo",
|
|
||||||
table: "TBSIG_DOCUMENT_STATUS",
|
|
||||||
column: "ENVELOPE_ID");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_TBSIG_DOCUMENT_STATUS_RECEIVER_ID",
|
|
||||||
schema: "dbo",
|
|
||||||
table: "TBSIG_DOCUMENT_STATUS",
|
|
||||||
column: "RECEIVER_ID");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_TBSIG_ENVELOPE_ENVELOPE_TYPE",
|
|
||||||
schema: "dbo",
|
|
||||||
table: "TBSIG_ENVELOPE",
|
|
||||||
column: "ENVELOPE_TYPE");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_TBSIG_ENVELOPE_USER_ID",
|
|
||||||
schema: "dbo",
|
|
||||||
table: "TBSIG_ENVELOPE",
|
|
||||||
column: "USER_ID");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_TBSIG_ENVELOPE_DOCUMENT_ENVELOPE_ID",
|
|
||||||
schema: "dbo",
|
|
||||||
table: "TBSIG_ENVELOPE_DOCUMENT",
|
|
||||||
column: "ENVELOPE_ID");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_TBSIG_ENVELOPE_HISTORY_ENVELOPE_ID",
|
|
||||||
schema: "dbo",
|
|
||||||
table: "TBSIG_ENVELOPE_HISTORY",
|
|
||||||
column: "ENVELOPE_ID");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_TBSIG_ENVELOPE_HISTORY_ReceiverId",
|
|
||||||
schema: "dbo",
|
|
||||||
table: "TBSIG_ENVELOPE_HISTORY",
|
|
||||||
column: "ReceiverId");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_TBSIG_ENVELOPE_HISTORY_SenderId",
|
|
||||||
schema: "dbo",
|
|
||||||
table: "TBSIG_ENVELOPE_HISTORY",
|
|
||||||
column: "SenderId");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_TBSIG_ENVELOPE_RECEIVER_RECEIVER_ID",
|
|
||||||
schema: "dbo",
|
|
||||||
table: "TBSIG_ENVELOPE_RECEIVER",
|
|
||||||
column: "RECEIVER_ID");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_TBSIG_ENVELOPE_RECEIVER_READ_ONLY_ADDED_WHO",
|
|
||||||
table: "TBSIG_ENVELOPE_RECEIVER_READ_ONLY",
|
|
||||||
column: "ADDED_WHO");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_TBSIG_RECEIVER_EnvelopeId",
|
|
||||||
schema: "dbo",
|
|
||||||
table: "TBSIG_RECEIVER",
|
|
||||||
column: "EnvelopeId");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "TBDD_CLIENT_USER",
|
|
||||||
schema: "dbo");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "TBDD_GROUPS_USER",
|
|
||||||
schema: "dbo");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "TBDD_USER_MODULES",
|
|
||||||
schema: "dbo");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "TBDD_USER_REPRESENTATION",
|
|
||||||
schema: "dbo");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "TBEMLP_EMAIL_OUT");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "TBSIG_CONFIG",
|
|
||||||
schema: "dbo");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "TBSIG_DOCUMENT_RECEIVER_ELEMENT",
|
|
||||||
schema: "dbo");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "TBSIG_DOCUMENT_STATUS",
|
|
||||||
schema: "dbo");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "TBSIG_EMAIL_TEMPLATE",
|
|
||||||
schema: "dbo");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "TBSIG_ENVELOPE_CERTIFICATE",
|
|
||||||
schema: "dbo");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "TBSIG_ENVELOPE_HISTORY",
|
|
||||||
schema: "dbo");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "TBSIG_ENVELOPE_RECEIVER",
|
|
||||||
schema: "dbo");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "TBSIG_ENVELOPE_RECEIVER_READ_ONLY");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "TBDD_MODULES",
|
|
||||||
schema: "dbo");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "TBDD_GROUPS",
|
|
||||||
schema: "dbo");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "TBSIG_ENVELOPE_DOCUMENT",
|
|
||||||
schema: "dbo");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "TBSIG_RECEIVER",
|
|
||||||
schema: "dbo");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "TBSIG_ENVELOPE",
|
|
||||||
schema: "dbo");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "TBDD_USER",
|
|
||||||
schema: "dbo");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "TBSIG_ENVELOPE_TYPE",
|
|
||||||
schema: "dbo");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -2,11 +2,12 @@
|
|||||||
using DigitalData.Core.Infrastructure;
|
using DigitalData.Core.Infrastructure;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using EnvelopeGenerator.Application.Common.Interfaces.Repositories;
|
using EnvelopeGenerator.Application.Common.Interfaces.Repositories;
|
||||||
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Infrastructure.Repositories;
|
namespace EnvelopeGenerator.Infrastructure.Repositories;
|
||||||
|
|
||||||
[Obsolete("Use IRepository")]
|
[Obsolete("Use IRepository")]
|
||||||
public class EnvelopeTypeRepository : CRUDRepository<EnvelopeType, int, EGDbContext>, IEnvelopeTypeRepository
|
public class EnvelopeTypeRepository : CRUDRepository<EnvelopeTypeDefaults, EnvelopeType, EGDbContext>, IEnvelopeTypeRepository
|
||||||
{
|
{
|
||||||
public EnvelopeTypeRepository(EGDbContext dbContext) : base(dbContext, dbContext.EnvelopeTypes)
|
public EnvelopeTypeRepository(EGDbContext dbContext) : base(dbContext, dbContext.EnvelopeTypes)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
-- Original email template: DocumentAccessCodeReceived (GUID 5)
|
||||||
|
-- Backed up before redesign: 2026-10-29 16:32:15
|
||||||
|
-- Subject: Zugriffscode für Dokument erhalten: ''[DOCUMENT_TITLE]''
|
||||||
|
-- Restore by running this script against DD_ECM:
|
||||||
|
UPDATE dbo.TBSIG_EMAIL_TEMPLATE
|
||||||
|
SET BODY = N'Guten Tag [NAME_RECEIVER],<br />
|
||||||
|
<br /><B><I>
|
||||||
|
[NAME_SENDER]</I></B> hat Ihnen ein Dokument zum [SIGNATURE_TYPE] gesendet. <br />
|
||||||
|
<br />
|
||||||
|
Verwenden Sie den folgenden Zugriffscode, um das Dokument einzusehen:<br />
|
||||||
|
<br />
|
||||||
|
[DOCUMENT_ACCESS_CODE]<br />
|
||||||
|
<br />
|
||||||
|
Mit freundlichen Grüßen<br />
|
||||||
|
<br />
|
||||||
|
[NAME_PORTAL]'
|
||||||
|
WHERE GUID = 5;
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
-- Original email template: DocumentCompleted (GUID 4)
|
||||||
|
-- Backed up before redesign: 2026-10-29 16:29:55
|
||||||
|
-- Subject: Umschlag abgeschlossen: ''[DOCUMENT_TITLE]''
|
||||||
|
-- Restore by running this script against DD_ECM:
|
||||||
|
UPDATE dbo.TBSIG_EMAIL_TEMPLATE
|
||||||
|
SET BODY = N'Guten Tag [NAME_RECEIVER],<br />
|
||||||
|
<br />
|
||||||
|
Der Vorgang <B><I>''[DOCUMENT_TITLE]''</I></B> wurde erfolgreich abgeschlossen.<br />
|
||||||
|
<br />
|
||||||
|
Sie erhalten das Dokument mit einem detaillierten Ergebnisbericht als Anhang zu dieser Email.<br />
|
||||||
|
<br />
|
||||||
|
Mit freundlichen Grüßen<br />
|
||||||
|
<br />
|
||||||
|
[NAME_PORTAL]'
|
||||||
|
WHERE GUID = 4;
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
-- Original email template: DocumentDeleted (GUID 2)
|
||||||
|
-- Backed up before redesign: 2026-10-29 16:23:45
|
||||||
|
-- Subject: Umschlag zurückgezogen: ''[DOCUMENT_TITLE]''
|
||||||
|
-- Restore by running this script against DD_ECM:
|
||||||
|
UPDATE dbo.TBSIG_EMAIL_TEMPLATE
|
||||||
|
SET BODY = N'Guten Tag [NAME_RECEIVER],<br />
|
||||||
|
<br /><B><I>
|
||||||
|
[NAME_SENDER]</I></B> hat den Umschlag <B><I>''[DOCUMENT_TITLE]''</I></B> gelöscht/zurückgezogen.<br /><p>
|
||||||
|
Begründung: <br /> <I>[REASON]</I> <p>
|
||||||
|
<br />
|
||||||
|
Mit freundlichen Grüßen<br />
|
||||||
|
<br />
|
||||||
|
[NAME_PORTAL]'
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
-- Original email template: DocumentReceived (GUID 1, de-DE)
|
||||||
|
-- Backed up before redesign: 2026-10-29 16:06:07
|
||||||
|
-- Subject: Dokument erhalten: ''[DOCUMENT_TITLE]''
|
||||||
|
-- Restore by running this script against DD_ECM:
|
||||||
|
UPDATE dbo.TBSIG_EMAIL_TEMPLATE
|
||||||
|
SET BODY = N'Guten Tag [NAME_RECEIVER],<br />
|
||||||
|
<br /><B><I>
|
||||||
|
[NAME_SENDER]</I></B> hat Ihnen ein Dokument zum [SIGNATURE_TYPE] gesendet.<br />
|
||||||
|
<br />
|
||||||
|
Über den folgenden Link können Sie das Dokument einsehen[DOCUMENT_PROCESS]: <a href="[LINK_TO_DOCUMENT]">[LINK_TO_DOCUMENT_TEXT]</a><br />
|
||||||
|
<br />
|
||||||
|
[MESSAGE]<br />
|
||||||
|
<br />
|
||||||
|
Mit freundlichen Grüßen<br />
|
||||||
|
<br />
|
||||||
|
[NAME_PORTAL]'
|
||||||
|
WHERE GUID = 1;
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
-- Original email template: DocumentRejected_ADM (GUID 6)
|
||||||
|
-- Backed up before redesign: 2026-10-29 16:33:34
|
||||||
|
-- Subject: ''[DOCUMENT_TITLE]'' - Vorgang zurückgezogen
|
||||||
|
-- Restore by running this script against DD_ECM:
|
||||||
|
UPDATE dbo.TBSIG_EMAIL_TEMPLATE
|
||||||
|
SET BODY = N'Guten Tag [NAME_SENDER],<p><B><I>[NAME_RECEIVER]</I></B> hat den Umschlag <B><I>''[DOCUMENT_TITLE]''</I></B> mit folgendem Grund abgelehnt: <p>
|
||||||
|
[REASON]
|
||||||
|
<p>Der Umschlag wurde auf den Status Rejected gesetzt. <p>
|
||||||
|
Mit freundlichen Grüßen<br />
|
||||||
|
<br />
|
||||||
|
[NAME_PORTAL]'
|
||||||
|
WHERE GUID = 6;
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
-- Original email template: DocumentRejected_REC_2 (GUID 10)
|
||||||
|
-- Backed up before redesign: 2026-10-29 16:37:12
|
||||||
|
-- Subject: ''[DOCUMENT_TITLE]'' - Vorgang abgelehnt.
|
||||||
|
-- Restore by running this script against DD_ECM:
|
||||||
|
UPDATE dbo.TBSIG_EMAIL_TEMPLATE
|
||||||
|
SET BODY = N'Guten Tag [NAME_RECEIVER],
|
||||||
|
<p>Der Vorgang <B><I>''[DOCUMENT_TITLE]''</I></B> wurde durch einen anderen Vertragspartner abgelehnt.<p> Der Absender <B><I>[NAME_SENDER]</I></B> wird sich bei Bedarf mit Ihnen in Verbindung setzen. <p>
|
||||||
|
Mit freundlichen Grüßen<br />
|
||||||
|
<br />
|
||||||
|
[NAME_PORTAL]'
|
||||||
|
WHERE GUID = 10;
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
-- Original email template: DocumentRejected_REC (GUID 9)
|
||||||
|
-- Backed up before redesign: 2026-10-29 16:34:21
|
||||||
|
-- Subject: ''[DOCUMENT_TITLE]'' - Bestätigung der Ablehnung
|
||||||
|
-- Restore by running this script against DD_ECM:
|
||||||
|
UPDATE dbo.TBSIG_EMAIL_TEMPLATE
|
||||||
|
SET BODY = N'Guten Tag [NAME_RECEIVER],
|
||||||
|
<p>Hiermit bestätigen wir Ihnen die Ablehnung des Vorgangs <B><I>''[DOCUMENT_TITLE]''</I></B>!<p>Der Absender <B><I>[NAME_SENDER]</I></B> wurde über die Ablehnung informiert. <p>
|
||||||
|
Mit freundlichen Grüßen<br />
|
||||||
|
<br />
|
||||||
|
[NAME_PORTAL]'
|
||||||
|
WHERE GUID = 9;
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
-- Original email template: DocumentShared (GUID 11)
|
||||||
|
-- Backed up before redesign: 2026-10-29 16:42:51
|
||||||
|
-- Subject: Dokument geteilt: ''[DOCUMENT_TITLE]''
|
||||||
|
-- Restore by running this script against DD_ECM:
|
||||||
|
UPDATE dbo.TBSIG_EMAIL_TEMPLATE
|
||||||
|
SET BODY = N'Guten Tag,<br /> <br /><B><I> [NAME_RECEIVER]</I></B> hat Ihnen ein Dokument zum Ansehen gesendet.<br /> <br /> Über den folgenden Link können Sie das Dokument einsehen: <a href="[LINK_TO_DOCUMENT]">[LINK_TO_DOCUMENT_TEXT]</a><br /> <br /> <br /> Mit freundlichen Grüßen<br /> <br /> [NAME_PORTAL]'
|
||||||
|
WHERE GUID = 11;
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
-- Original email template: DocumentSigned (GUID 3)
|
||||||
|
-- Backed up before redesign: 2026-10-29 16:25:45
|
||||||
|
-- Subject: Dokument [RECEIVER_ACTION]: ''[DOCUMENT_TITLE]''
|
||||||
|
-- Restore by running this script against DD_ECM:
|
||||||
|
UPDATE dbo.TBSIG_EMAIL_TEMPLATE
|
||||||
|
SET BODY = N'Guten Tag [NAME_RECEIVER],<br />
|
||||||
|
<br />
|
||||||
|
hiermit bestätigen wir Ihnen die erfolgreiche [FINAL_STATUS] für den Vorgang <B><I>''[DOCUMENT_TITLE]''</I></B>.<br />
|
||||||
|
Wenn alle [FINAL_ACTION] haben, erhalten Sie ebenfalls per E-Mail ein abgeschlossenes Exemplar mit entsprechendem Zertifikat!
|
||||||
|
<br />
|
||||||
|
Mit freundlichen Grüßen<br />
|
||||||
|
<br />
|
||||||
|
[NAME_PORTAL]'
|
||||||
|
WHERE GUID = 3;
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
-- Original email template: TotpSecret (GUID 12)
|
||||||
|
-- Backed up before redesign: 2026-10-29 16:44:44
|
||||||
|
-- Subject: 2-Faktor-Authentifizierung QR-Code
|
||||||
|
-- Restore by running this script against DD_ECM:
|
||||||
|
UPDATE dbo.TBSIG_EMAIL_TEMPLATE
|
||||||
|
SET BODY = N'Guten Tag,<br /> <br />Sie können auf Ihren Zwei-Faktor-Authentifizierungscode zugreifen, indem Sie den unten stehenden QR-Code mit einer beliebigen Authentifizierungs-App auf Ihrem Telefon scannen (Google Authenticator, Microsoft Authenticator usw.). Dieser Code ist bis zum [TFA_EXPIRATION] gültig.<br /> <br /> <img src="data:image/png;base64,[TFA_QR_CODE]" style="width: 13rem; height: 13rem;"><br /> <br />
|
||||||
|
<br /> Mit freundlichen Grüßen<br /> <br /> [NAME_PORTAL]'
|
||||||
|
WHERE GUID = 12;
|
||||||
@@ -84,25 +84,50 @@
|
|||||||
<div class="sender-image-editor__page-placeholder">@L("SenderEditor_PageLabel", "Seite") @pageNumber</div>
|
<div class="sender-image-editor__page-placeholder">@L("SenderEditor_PageLabel", "Seite") @pageNumber</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
@foreach (var field in Fields.Where(f => f.Page == pageNumber))
|
@foreach (var field in Fields.Where(f => f.Page == pageNumber && !HiddenFieldIndexes.Contains(f.Index)))
|
||||||
{
|
{
|
||||||
<div class="sender-image-editor__field"
|
<div class="sender-image-editor__field @(ActiveFieldIndex == field.Index ? "sender-image-editor__field--active" : string.Empty)"
|
||||||
style="@GetFieldStyle(field, widthPt, heightPt)"
|
style="@GetFieldStyle(field, widthPt, heightPt, FieldCursor)"
|
||||||
title="@field.ReceiverName"
|
title="@field.ReceiverName"
|
||||||
@onmousedown="args => OnFieldMouseDownAsync(args, field)"
|
@onmousedown="args => OnFieldMouseDownAsync(args, field)"
|
||||||
@onmousedown:preventDefault="true"
|
@onmousedown:preventDefault="true"
|
||||||
@onclick:stopPropagation="true">
|
@onclick="() => OnFieldClickAsync(field.Index)"
|
||||||
<span class="sender-image-editor__field-label">@field.ReceiverName</span>
|
@onclick:stopPropagation="true">
|
||||||
<button type="button"
|
<span class="sender-image-editor__field-label">@field.ReceiverName</span>
|
||||||
class="sender-image-editor__field-remove"
|
@if (ShowFieldRemoveButton)
|
||||||
title='@L("Delete", "Löschen")'
|
{
|
||||||
draggable="false"
|
<button type="button"
|
||||||
@onclick:stopPropagation="true"
|
class="sender-image-editor__field-remove"
|
||||||
@onclick="() => RemoveField.InvokeAsync(field.Index)">
|
title='@L("Delete", "Löschen")'
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 16 16" fill="none" aria-hidden="true">
|
draggable="false"
|
||||||
<path d="M4 4L12 12M12 4L4 12" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
|
@onclick:stopPropagation="true"
|
||||||
</svg>
|
@onclick="() => RemoveField.InvokeAsync(field.Index)">
|
||||||
</button>
|
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 16 16" fill="none" aria-hidden="true">
|
||||||
|
<path d="M4 4L12 12M12 4L4 12" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
@foreach (var signature in SignatureOverlays.Where(s => s.Page == pageNumber))
|
||||||
|
{
|
||||||
|
<div class="sender-image-editor__signature"
|
||||||
|
style="@GetSignatureStyle(signature, widthPt, heightPt)">
|
||||||
|
<div class="sender-image-editor__signature-image-wrap">
|
||||||
|
<img class="sender-image-editor__signature-image"
|
||||||
|
src="@signature.DataUrl"
|
||||||
|
alt="Signature"
|
||||||
|
draggable="false" />
|
||||||
|
</div>
|
||||||
|
<div class="sender-image-editor__signature-meta">
|
||||||
|
<div class="sender-image-editor__signature-name">@signature.FullName</div>
|
||||||
|
@if (!string.IsNullOrWhiteSpace(signature.Position))
|
||||||
|
{
|
||||||
|
<div class="sender-image-editor__signature-position">@signature.Position</div>
|
||||||
|
}
|
||||||
|
<div class="sender-image-editor__signature-place">@signature.Place, @signature.DateText</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
@@ -132,6 +157,15 @@
|
|||||||
[Parameter]
|
[Parameter]
|
||||||
public IReadOnlyList<SenderPdfFieldOverlay> Fields { get; set; } = Array.Empty<SenderPdfFieldOverlay>();
|
public IReadOnlyList<SenderPdfFieldOverlay> Fields { get; set; } = Array.Empty<SenderPdfFieldOverlay>();
|
||||||
|
|
||||||
|
[Parameter]
|
||||||
|
public IReadOnlyList<SenderPdfSignatureOverlay> SignatureOverlays { get; set; } = Array.Empty<SenderPdfSignatureOverlay>();
|
||||||
|
|
||||||
|
[Parameter]
|
||||||
|
public bool ShowFieldRemoveButton { get; set; } = true;
|
||||||
|
|
||||||
|
[Parameter]
|
||||||
|
public IReadOnlyCollection<int> HiddenFieldIndexes { get; set; } = Array.Empty<int>();
|
||||||
|
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public EventCallback<MouseEventArgs> EditorClick { get; set; }
|
public EventCallback<MouseEventArgs> EditorClick { get; set; }
|
||||||
|
|
||||||
@@ -141,15 +175,29 @@
|
|||||||
[Parameter]
|
[Parameter]
|
||||||
public EventCallback<SenderPdfFieldMoveRequest> MoveField { get; set; }
|
public EventCallback<SenderPdfFieldMoveRequest> MoveField { get; set; }
|
||||||
|
|
||||||
|
[Parameter]
|
||||||
|
public EventCallback<int> FieldClick { get; set; }
|
||||||
|
|
||||||
|
[Parameter]
|
||||||
|
public string FieldCursor { get; set; } = "move";
|
||||||
|
|
||||||
|
[Parameter]
|
||||||
|
public int? ActiveFieldIndex { get; set; }
|
||||||
|
|
||||||
|
[Parameter]
|
||||||
|
public bool AutoScrollToActiveField { get; set; }
|
||||||
|
|
||||||
private int? _draggedFieldIndex;
|
private int? _draggedFieldIndex;
|
||||||
private bool _isDragging;
|
private bool _isDragging;
|
||||||
private double _grabOffsetXPt;
|
private double _grabOffsetXPt;
|
||||||
private double _grabOffsetYPt;
|
private double _grabOffsetYPt;
|
||||||
private int _currentPage = 1;
|
private int _currentPage = 1;
|
||||||
private int _zoomPercent = 112;
|
private int _zoomPercent = 180;
|
||||||
private bool _zoomOverrideInitialized;
|
private bool _zoomOverrideInitialized;
|
||||||
private bool _isDownloading;
|
private bool _isDownloading;
|
||||||
private bool _isPrinting;
|
private bool _isPrinting;
|
||||||
|
private int? _lastActiveFieldIndex;
|
||||||
|
private ActiveFieldScrollTarget? _pendingActiveFieldScrollTarget;
|
||||||
|
|
||||||
private const int MinZoomPercent = 50;
|
private const int MinZoomPercent = 50;
|
||||||
private const int MaxZoomPercent = 300;
|
private const int MaxZoomPercent = 300;
|
||||||
@@ -157,12 +205,13 @@
|
|||||||
private bool CanDownloadPdf => !string.IsNullOrWhiteSpace(PdfDataUrl);
|
private bool CanDownloadPdf => !string.IsNullOrWhiteSpace(PdfDataUrl);
|
||||||
private bool CanPrintPdf => !string.IsNullOrWhiteSpace(PdfDataUrl);
|
private bool CanPrintPdf => !string.IsNullOrWhiteSpace(PdfDataUrl);
|
||||||
|
|
||||||
private static string GetFieldStyle(SenderPdfFieldOverlay field, double pageWidthPt, double pageHeightPt)
|
private static string GetFieldStyle(SenderPdfFieldOverlay field, double pageWidthPt, double pageHeightPt, string fieldCursor)
|
||||||
{
|
{
|
||||||
var leftPercent = (field.XPt / pageWidthPt) * 100.0;
|
var leftPercent = (field.XPt / pageWidthPt) * 100.0;
|
||||||
var topPercent = (field.YPt / pageHeightPt) * 100.0;
|
var topPercent = (field.YPt / pageHeightPt) * 100.0;
|
||||||
var widthPercent = (127.44 / pageWidthPt) * 100.0;
|
var widthPercent = (127.44 / pageWidthPt) * 100.0;
|
||||||
var heightPercent = (141.12 / pageHeightPt) * 100.0;
|
var heightPercent = (141.12 / pageHeightPt) * 100.0;
|
||||||
|
var cursor = string.IsNullOrWhiteSpace(fieldCursor) ? "move" : fieldCursor;
|
||||||
|
|
||||||
var left = leftPercent.ToString("F4", CultureInfo.InvariantCulture);
|
var left = leftPercent.ToString("F4", CultureInfo.InvariantCulture);
|
||||||
var top = topPercent.ToString("F4", CultureInfo.InvariantCulture);
|
var top = topPercent.ToString("F4", CultureInfo.InvariantCulture);
|
||||||
@@ -184,10 +233,26 @@
|
|||||||
"padding:0.2rem 0.3rem;",
|
"padding:0.2rem 0.3rem;",
|
||||||
"overflow:hidden;",
|
"overflow:hidden;",
|
||||||
"z-index:30;",
|
"z-index:30;",
|
||||||
|
$"cursor:{cursor};",
|
||||||
$"border-color:{field.Color};",
|
$"border-color:{field.Color};",
|
||||||
$"background-color:{field.Color}22;");
|
$"background-color:{field.Color}22;");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static string GetSignatureStyle(SenderPdfSignatureOverlay signature, double pageWidthPt, double pageHeightPt)
|
||||||
|
{
|
||||||
|
var leftPercent = (signature.XPt / pageWidthPt) * 100.0;
|
||||||
|
var topPercent = (signature.YPt / pageHeightPt) * 100.0;
|
||||||
|
var widthPercent = (127.44 / pageWidthPt) * 100.0;
|
||||||
|
var heightPercent = (141.12 / pageHeightPt) * 100.0;
|
||||||
|
|
||||||
|
var left = leftPercent.ToString("F4", CultureInfo.InvariantCulture);
|
||||||
|
var top = topPercent.ToString("F4", CultureInfo.InvariantCulture);
|
||||||
|
var width = widthPercent.ToString("F4", CultureInfo.InvariantCulture);
|
||||||
|
var height = heightPercent.ToString("F4", CultureInfo.InvariantCulture);
|
||||||
|
|
||||||
|
return $"position:absolute;left:{left}%;top:{top}%;width:{width}%;height:{height}%;z-index:30;";
|
||||||
|
}
|
||||||
|
|
||||||
private string GetPageCanvasStyle(double pageWidthPt, double pageHeightPt)
|
private string GetPageCanvasStyle(double pageWidthPt, double pageHeightPt)
|
||||||
{
|
{
|
||||||
var ratio = pageHeightPt <= 0 ? 595.0 / 842.0 : pageWidthPt / pageHeightPt;
|
var ratio = pageHeightPt <= 0 ? 595.0 / 842.0 : pageWidthPt / pageHeightPt;
|
||||||
@@ -213,18 +278,50 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
_currentPage = Math.Max(1, Math.Min(_currentPage, PageCount));
|
_currentPage = Math.Max(1, Math.Min(_currentPage, PageCount));
|
||||||
|
|
||||||
|
if (!AutoScrollToActiveField || ActiveFieldIndex == _lastActiveFieldIndex)
|
||||||
|
return;
|
||||||
|
|
||||||
|
_lastActiveFieldIndex = ActiveFieldIndex;
|
||||||
|
|
||||||
|
if (!ActiveFieldIndex.HasValue)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var activeField = Fields.FirstOrDefault(f => f.Index == ActiveFieldIndex.Value);
|
||||||
|
if (activeField is null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var (_, pageHeightPt) = GetPageSize(activeField.Page);
|
||||||
|
const double sigHeightPt = 1.96 * 72;
|
||||||
|
var normY = (activeField.YPt + (sigHeightPt / 2.0)) / pageHeightPt;
|
||||||
|
normY = Math.Clamp(normY, 0, 1);
|
||||||
|
_pendingActiveFieldScrollTarget = new ActiveFieldScrollTarget(activeField.Page, normY);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||||
{
|
{
|
||||||
if (_zoomOverrideInitialized)
|
if (!_zoomOverrideInitialized)
|
||||||
return;
|
{
|
||||||
|
await JSRuntime.InvokeVoidAsync(
|
||||||
|
"envelopeEditor.ensureZoomOverride",
|
||||||
|
"sender-editor-pdf-viewer");
|
||||||
|
|
||||||
await JSRuntime.InvokeVoidAsync(
|
_zoomOverrideInitialized = true;
|
||||||
"envelopeEditor.ensureZoomOverride",
|
}
|
||||||
"sender-editor-pdf-viewer");
|
|
||||||
|
|
||||||
_zoomOverrideInitialized = true;
|
if (_pendingActiveFieldScrollTarget is not null)
|
||||||
|
{
|
||||||
|
var target = _pendingActiveFieldScrollTarget;
|
||||||
|
_pendingActiveFieldScrollTarget = null;
|
||||||
|
|
||||||
|
await JSRuntime.InvokeVoidAsync(
|
||||||
|
"envelopeEditor.scrollToPdfField",
|
||||||
|
"sender-editor-pdf-viewer",
|
||||||
|
target.PageNumber,
|
||||||
|
target.NormY);
|
||||||
|
|
||||||
|
_currentPage = target.PageNumber;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task HandleClickAsync(MouseEventArgs args)
|
private async Task HandleClickAsync(MouseEventArgs args)
|
||||||
@@ -235,6 +332,9 @@
|
|||||||
|
|
||||||
private async Task OnFieldMouseDownAsync(MouseEventArgs args, SenderPdfFieldOverlay field)
|
private async Task OnFieldMouseDownAsync(MouseEventArgs args, SenderPdfFieldOverlay field)
|
||||||
{
|
{
|
||||||
|
if (!MoveField.HasDelegate)
|
||||||
|
return;
|
||||||
|
|
||||||
var coords = await JSRuntime.InvokeAsync<EditorCoords?>(
|
var coords = await JSRuntime.InvokeAsync<EditorCoords?>(
|
||||||
"envelopeEditor.getClickCoordsOnPdfPage",
|
"envelopeEditor.getClickCoordsOnPdfPage",
|
||||||
"sender-editor-pdf-viewer",
|
"sender-editor-pdf-viewer",
|
||||||
@@ -255,6 +355,14 @@
|
|||||||
_grabOffsetYPt = pointerYPt - field.YPt;
|
_grabOffsetYPt = pointerYPt - field.YPt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async Task OnFieldClickAsync(int fieldIndex)
|
||||||
|
{
|
||||||
|
if (!FieldClick.HasDelegate)
|
||||||
|
return;
|
||||||
|
|
||||||
|
await FieldClick.InvokeAsync(fieldIndex);
|
||||||
|
}
|
||||||
|
|
||||||
private async Task OnEditorMouseMoveAsync(MouseEventArgs args)
|
private async Task OnEditorMouseMoveAsync(MouseEventArgs args)
|
||||||
{
|
{
|
||||||
if (_draggedFieldIndex is null || !MoveField.HasDelegate)
|
if (_draggedFieldIndex is null || !MoveField.HasDelegate)
|
||||||
@@ -449,6 +557,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
private sealed record EditorCoords(double NormX, double NormY, int PageIndex, int PageNumber);
|
private sealed record EditorCoords(double NormX, double NormY, int PageIndex, int PageNumber);
|
||||||
|
private sealed record ActiveFieldScrollTarget(int PageNumber, double NormY);
|
||||||
|
|
||||||
private string L(string key, string fallback)
|
private string L(string key, string fallback)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
namespace EnvelopeGenerator.Server.Client.Components.PdfEditor;
|
||||||
|
|
||||||
|
public sealed record SenderPdfSignatureOverlay(
|
||||||
|
int Page,
|
||||||
|
double XPt,
|
||||||
|
double YPt,
|
||||||
|
string DataUrl,
|
||||||
|
string FullName,
|
||||||
|
string? Position,
|
||||||
|
string Place,
|
||||||
|
string DateText);
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,15 +1,16 @@
|
|||||||
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Server.Client.Components.Sender;
|
namespace EnvelopeGenerator.Server.Client.Components.Sender;
|
||||||
|
|
||||||
public sealed record CreateEnvelopeWizardResult(
|
public sealed record CreateEnvelopeWizardResult(
|
||||||
string Title,
|
string Title,
|
||||||
string Message,
|
string Message,
|
||||||
int? EnvelopeTypeId,
|
EnvelopeType? Type,
|
||||||
string Language,
|
string Language,
|
||||||
bool UseAccessCode,
|
bool UseAccessCode,
|
||||||
bool TFAEnabled,
|
bool TFAEnabled,
|
||||||
int CertificationType,
|
FinalEmailType FinalEmailToCreator,
|
||||||
int FinalEmailToCreator,
|
FinalEmailType FinalEmailToReceivers,
|
||||||
int FinalEmailToReceivers,
|
|
||||||
bool SendReminderEmails,
|
bool SendReminderEmails,
|
||||||
int FirstReminderDays,
|
int FirstReminderDays,
|
||||||
int ReminderIntervalDays,
|
int ReminderIntervalDays,
|
||||||
|
|||||||
@@ -2,10 +2,24 @@
|
|||||||
|
|
||||||
<div class="sender-pdf-dropzone @DropZoneClass">
|
<div class="sender-pdf-dropzone @DropZoneClass">
|
||||||
<div class="sender-pdf-dropzone__content">
|
<div class="sender-pdf-dropzone__content">
|
||||||
<div class="sender-pdf-dropzone__title">@CurrentActionText</div>
|
@if (HasDocument)
|
||||||
@if (!string.IsNullOrWhiteSpace(DragDropHintText))
|
|
||||||
{
|
{
|
||||||
<div class="sender-pdf-dropzone__hint">@DragDropHintText</div>
|
@if (!string.IsNullOrWhiteSpace(DocumentName))
|
||||||
|
{
|
||||||
|
<div class="sender-pdf-dropzone__doc-name">@DocumentName</div>
|
||||||
|
}
|
||||||
|
@if (!string.IsNullOrWhiteSpace(DocumentSizeText))
|
||||||
|
{
|
||||||
|
<div class="sender-pdf-dropzone__doc-size">@DocumentSizeText</div>
|
||||||
|
}
|
||||||
|
@if (!string.IsNullOrWhiteSpace(UploadedHintText))
|
||||||
|
{
|
||||||
|
<div class="sender-pdf-dropzone__hint">@UploadedHintText</div>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (!string.IsNullOrWhiteSpace(CurrentActionText))
|
||||||
|
{
|
||||||
|
<div class="sender-pdf-dropzone__hint">@CurrentActionText</div>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -38,6 +52,15 @@
|
|||||||
[Parameter]
|
[Parameter]
|
||||||
public string DragDropHintText { get; set; } = "Datei hierhin ziehen oder klicken";
|
public string DragDropHintText { get; set; } = "Datei hierhin ziehen oder klicken";
|
||||||
|
|
||||||
|
[Parameter]
|
||||||
|
public string? DocumentName { get; set; }
|
||||||
|
|
||||||
|
[Parameter]
|
||||||
|
public string? DocumentSizeText { get; set; }
|
||||||
|
|
||||||
|
[Parameter]
|
||||||
|
public string UploadedHintText { get; set; } = "Zum Ersetzen klicken oder eine Datei hierher ziehen.";
|
||||||
|
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public EventCallback<InputFileChangeEventArgs> FileSelected { get; set; }
|
public EventCallback<InputFileChangeEventArgs> FileSelected { get; set; }
|
||||||
|
|
||||||
@@ -53,6 +76,9 @@
|
|||||||
if (Disabled)
|
if (Disabled)
|
||||||
return "sender-pdf-dropzone--disabled";
|
return "sender-pdf-dropzone--disabled";
|
||||||
|
|
||||||
|
if (HasDocument)
|
||||||
|
return "sender-pdf-dropzone--has-document";
|
||||||
|
|
||||||
return _isDragActive ? "sender-pdf-dropzone--drag-active" : string.Empty;
|
return _isDragActive ? "sender-pdf-dropzone--drag-active" : string.Empty;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,23 +4,19 @@ namespace EnvelopeGenerator.Server.Client.Components.Sender.ReceiverSuggestionFi
|
|||||||
|
|
||||||
public class ReceiverSuggestionFilterHandler(IEnumerable<RecentReceiverSuggestionDto> suggestions)
|
public class ReceiverSuggestionFilterHandler(IEnumerable<RecentReceiverSuggestionDto> suggestions)
|
||||||
{
|
{
|
||||||
private readonly IReadOnlyList<Entry> _entries = suggestions
|
private readonly IReadOnlyList<Entry> _entries = [.. suggestions
|
||||||
.Where(x => !string.IsNullOrWhiteSpace(x.FullName) && !string.IsNullOrWhiteSpace(x.EmailAddress))
|
.Where(x => !string.IsNullOrWhiteSpace(x.FullName) && !string.IsNullOrWhiteSpace(x.EmailAddress))
|
||||||
.Select(x => new Entry(new ReceiverFilterCriteria(x.FullName, x.EmailAddress), x))
|
.Select(x => new Entry(new ReceiverFilterCriteria(x.FullName, x.EmailAddress), x))];
|
||||||
.ToList();
|
|
||||||
|
|
||||||
private readonly record struct Entry(ReceiverFilterCriteria Criteria, RecentReceiverSuggestionDto Suggestion);
|
private readonly record struct Entry(ReceiverFilterCriteria Criteria, RecentReceiverSuggestionDto Suggestion);
|
||||||
|
|
||||||
public IEnumerable<RecentReceiverSuggestionDto> Filter(ReceiverFilterCriteria criteria)
|
public IEnumerable<RecentReceiverSuggestionDto> Filter(string query)
|
||||||
{
|
{
|
||||||
|
var normalizedQuery = new ReceiverFilterCriteria(query, query);
|
||||||
return _entries
|
return _entries
|
||||||
.Where(x => x.Criteria.Matches(criteria))
|
.Where(x =>
|
||||||
|
x.Criteria.FullName.Contains(normalizedQuery.FullName, StringComparison.Ordinal)
|
||||||
|
|| x.Criteria.EmailAddress.Contains(normalizedQuery.EmailAddress, StringComparison.Ordinal))
|
||||||
.Select(x => x.Suggestion);
|
.Select(x => x.Suggestion);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<RecentReceiverSuggestionDto> Filter(string fullName, string emailAddress)
|
|
||||||
{
|
|
||||||
var criteria = new ReceiverFilterCriteria(fullName, emailAddress);
|
|
||||||
return Filter(criteria);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,12 +6,14 @@
|
|||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<NoDefaultLaunchSettingsFile>true</NoDefaultLaunchSettingsFile>
|
<NoDefaultLaunchSettingsFile>true</NoDefaultLaunchSettingsFile>
|
||||||
<StaticWebAssetProjectMode>Default</StaticWebAssetProjectMode>
|
<StaticWebAssetProjectMode>Default</StaticWebAssetProjectMode>
|
||||||
<WasmBuildNative>true</WasmBuildNative>
|
<WasmBuildNative>false</WasmBuildNative>
|
||||||
|
<WasmEnableSIMD>false</WasmEnableSIMD>
|
||||||
<InvariantGlobalization>false</InvariantGlobalization>
|
<InvariantGlobalization>false</InvariantGlobalization>
|
||||||
<BlazorWebAssemblyLoadAllGlobalizationData>true</BlazorWebAssemblyLoadAllGlobalizationData>
|
<BlazorWebAssemblyLoadAllGlobalizationData>true</BlazorWebAssemblyLoadAllGlobalizationData>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="MudBlazor" Version="8.0.0" />
|
||||||
<PackageReference Include="DevExpress.Blazor.PdfViewer" Version="25.2.3" />
|
<PackageReference Include="DevExpress.Blazor.PdfViewer" Version="25.2.3" />
|
||||||
<PackageReference Include="DevExpress.Blazor.Reporting.JSBasedControls" Version="25.2.3" />
|
<PackageReference Include="DevExpress.Blazor.Reporting.JSBasedControls" Version="25.2.3" />
|
||||||
<PackageReference Include="DevExpress.Blazor.Reporting.Viewer" Version="25.2.3" />
|
<PackageReference Include="DevExpress.Blazor.Reporting.Viewer" Version="25.2.3" />
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
</main>
|
</main>
|
||||||
<footer class="receiver-footer">
|
<footer class="receiver-footer">
|
||||||
<div class="receiver-footer__left">
|
<div class="receiver-footer__left">
|
||||||
<span>© signFLOW 2023-2024 <a href="https://digitaldata.works" target="_blank" rel="noopener">Digital Data GmbH</a></span>
|
<span>© @DateTime.Now.Year <a href="https://digitaldata.works" target="_blank" rel="noopener">Digital Data GmbH</a></span>
|
||||||
<span class="receiver-footer__sep">|</span>
|
<span class="receiver-footer__sep">|</span>
|
||||||
<a href="@GetPrivacyPolicyPath()" target="_blank" rel="noopener">@L("PrivacyPolicy", "Datenschutz")</a>
|
<a href="@GetPrivacyPolicyPath()" target="_blank" rel="noopener">@L("PrivacyPolicy", "Datenschutz")</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Server.Client.Models;
|
namespace EnvelopeGenerator.Server.Client.Models;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -38,10 +40,8 @@ public record EnvelopeClientDto
|
|||||||
public DateTime AddedWhen { get; init; }
|
public DateTime AddedWhen { get; init; }
|
||||||
public DateTime? ChangedWhen { get; init; }
|
public DateTime? ChangedWhen { get; init; }
|
||||||
public string Language { get; init; } = "de-DE";
|
public string Language { get; init; } = "de-DE";
|
||||||
public int? EnvelopeTypeId { get; init; }
|
public EnvelopeType? Type { get; init; }
|
||||||
public string? EnvelopeTypeTitle { get; init; }
|
public string? EnvelopeTypeTitle { get; init; }
|
||||||
public int? ContractType { get; init; }
|
|
||||||
public int? CertificationType { get; init; }
|
|
||||||
public bool UseAccessCode { get; init; }
|
public bool UseAccessCode { get; init; }
|
||||||
public bool TFAEnabled { get; init; }
|
public bool TFAEnabled { get; init; }
|
||||||
public IEnumerable<DocumentClientDto>? Documents { get; init; }
|
public IEnumerable<DocumentClientDto>? Documents { get; init; }
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
@page "/envelope/login/{EnvelopeKey}"
|
@page "/envelope/login/{EnvelopeKey}"
|
||||||
@rendermode InteractiveWebAssembly
|
@rendermode InteractiveWebAssembly
|
||||||
@using EnvelopeGenerator.Server.Client.Services
|
@using EnvelopeGenerator.Server.Client.Services
|
||||||
|
@using EnvelopeGenerator.Application.EnvelopeReceivers.Commands
|
||||||
@using EnvelopeGenerator.Application.Resources
|
@using EnvelopeGenerator.Application.Resources
|
||||||
@using Microsoft.Extensions.Localization
|
@using Microsoft.Extensions.Localization
|
||||||
@inject AuthService AuthService
|
@inject AuthService AuthService
|
||||||
@@ -22,9 +23,18 @@
|
|||||||
|
|
||||||
<div class="card-body p-4">
|
<div class="card-body p-4">
|
||||||
|
|
||||||
<p class="text-muted mb-4" style="font-size: 0.875rem; line-height: 1.5;">
|
<div class="text-muted mb-4" style="font-size: 0.875rem; line-height: 1.5;">
|
||||||
@L("ReceiverLogin_Description", "Bitte geben Sie den Zugangscode ein, den Sie per E-Mail erhalten haben, um das Dokument sicher zu öffnen.")
|
<p class="mb-2 fw-semibold text-dark">@L("ReceiverLogin_InfoTitle", "Sicherheit ist uns wichtig.")</p>
|
||||||
</p>
|
<p class="mb-2">@L("ReceiverLogin_InfoStep1", "Direkt nachdem Sie den Link zum Unterzeichnen geöffnet haben, haben wir Ihnen eine zweite E-Mail gesendet.")</p>
|
||||||
|
<p class="mb-0">@L("ReceiverLogin_InfoStep2", "Darin finden Sie den Zugangscode, den Sie hier eingeben müssen.")</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@if (!IsSecureRequest)
|
||||||
|
{
|
||||||
|
<div class="alert alert-warning py-2" role="alert" style="font-size:0.85rem;">
|
||||||
|
@L("ReceiverLogin_HttpWarning", "Sie verwenden derzeit eine unverschlüsselte HTTP-Verbindung. Bitte geben Sie Zugangsdaten nur in vertrauenswürdigen internen Netzwerken ein.")
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
@if (LoginResult == EnvelopeLoginResult.NotFound)
|
@if (LoginResult == EnvelopeLoginResult.NotFound)
|
||||||
{
|
{
|
||||||
@@ -109,6 +119,33 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<span class="text-muted" style="font-size:0.85rem;">@L("ReceiverLogin_ResendPrompt", "Zugangscode nicht bekommen?")</span>
|
||||||
|
<DxButton Text="@(IsResending ? L("ReceiverLogin_ResendInProgress", "Code wird gesendet ...") : L("ReceiverLogin_ResendAction", "Code erneut senden"))"
|
||||||
|
RenderStyle="ButtonRenderStyle.Link"
|
||||||
|
Click="ResendAccessCodeAsync"
|
||||||
|
Enabled="@(!IsLoading && !IsResending)" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@if (ResendResult == SendAccessCodeResult.Sent)
|
||||||
|
{
|
||||||
|
<div class="alert alert-success py-2" role="alert" style="font-size:0.85rem;">
|
||||||
|
@L("ReceiverLogin_ResendSuccess", "Wir haben Ihnen soeben einen neuen Zugangscode per E-Mail gesendet.")
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
else if (ResendResult == SendAccessCodeResult.RequestLimitExceeded)
|
||||||
|
{
|
||||||
|
<div class="alert alert-warning py-2" role="alert" style="font-size:0.85rem;">
|
||||||
|
@L("ReceiverLogin_ResendRateLimit", "Sie haben soeben einen Code angefordert. Bitte warten Sie kurz und versuchen Sie es erneut.")
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
else if (ResendRequestFailed)
|
||||||
|
{
|
||||||
|
<div class="alert alert-secondary py-2" role="alert" style="font-size:0.85rem;">
|
||||||
|
@L("ReceiverLogin_ResendError", "Der Zugangscode konnte nicht erneut gesendet werden. Bitte versuchen Sie es später erneut.")
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
<button class="btn btn-primary w-100 py-2 fw-medium"
|
<button class="btn btn-primary w-100 py-2 fw-medium"
|
||||||
style="background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%); border: none;"
|
style="background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%); border: none;"
|
||||||
@onclick="SubmitAsync"
|
@onclick="SubmitAsync"
|
||||||
@@ -142,14 +179,25 @@
|
|||||||
string AccessCode = string.Empty;
|
string AccessCode = string.Empty;
|
||||||
bool ShowCode;
|
bool ShowCode;
|
||||||
bool IsLoading;
|
bool IsLoading;
|
||||||
|
bool IsResending;
|
||||||
|
bool IsSecureRequest = true;
|
||||||
|
bool ResendRequestFailed;
|
||||||
EnvelopeLoginResult? LoginResult;
|
EnvelopeLoginResult? LoginResult;
|
||||||
|
SendAccessCodeResult? ResendResult;
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
|
IsSecureRequest = Navigation.Uri.StartsWith("https://", StringComparison.OrdinalIgnoreCase);
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(EnvelopeKey))
|
if (string.IsNullOrWhiteSpace(EnvelopeKey))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_ = await AuthService.RequestEnvelopeReceiverAccessCodeAsync(EnvelopeKey);
|
var requestResult = await AuthService.RequestEnvelopeReceiverAccessCodeAsync(EnvelopeKey, autoGenerated: true);
|
||||||
|
if (requestResult == SendAccessCodeResult.AlreadySigned)
|
||||||
|
{
|
||||||
|
Navigation.NavigateTo("/envelope/signed-result", forceLoad: false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async Task OnKeyDownAsync(Microsoft.AspNetCore.Components.Web.KeyboardEventArgs e)
|
async Task OnKeyDownAsync(Microsoft.AspNetCore.Components.Web.KeyboardEventArgs e)
|
||||||
@@ -179,6 +227,29 @@
|
|||||||
await InvokeAsync(StateHasChanged);
|
await InvokeAsync(StateHasChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async Task ResendAccessCodeAsync()
|
||||||
|
{
|
||||||
|
if (IsLoading || IsResending || string.IsNullOrWhiteSpace(EnvelopeKey))
|
||||||
|
return;
|
||||||
|
|
||||||
|
IsResending = true;
|
||||||
|
ResendRequestFailed = false;
|
||||||
|
ResendResult = null;
|
||||||
|
await InvokeAsync(StateHasChanged);
|
||||||
|
|
||||||
|
var result = await AuthService.RequestEnvelopeReceiverAccessCodeAsync(EnvelopeKey, autoGenerated: false);
|
||||||
|
if (result == SendAccessCodeResult.AlreadySigned)
|
||||||
|
{
|
||||||
|
Navigation.NavigateTo("/envelope/signed-result", forceLoad: false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ResendResult = result;
|
||||||
|
ResendRequestFailed = result is null;
|
||||||
|
IsResending = false;
|
||||||
|
await InvokeAsync(StateHasChanged);
|
||||||
|
}
|
||||||
|
|
||||||
string L(string key, string fallback)
|
string L(string key, string fallback)
|
||||||
{
|
{
|
||||||
var value = UiLocalizer[key];
|
var value = UiLocalizer[key];
|
||||||
|
|||||||
@@ -6,137 +6,161 @@
|
|||||||
@inject AuthService AuthService
|
@inject AuthService AuthService
|
||||||
@inject NavigationManager Navigation
|
@inject NavigationManager Navigation
|
||||||
@inject IStringLocalizer<Resource> UiLocalizer
|
@inject IStringLocalizer<Resource> UiLocalizer
|
||||||
|
@inject CustomImagesService CustomImagesService
|
||||||
|
|
||||||
<div class="login-page-wrapper d-flex align-items-center justify-content-center min-vh-100">
|
<div class="sender-login-page d-flex align-items-center justify-content-center min-vh-100">
|
||||||
<div class="login-card card shadow border-0" style="max-width: 440px; width: 100%;">
|
<div class="sender-login-content">
|
||||||
|
<div class="login-card sender-login-card card shadow border-0" style="max-width: 440px; width: 100%;">
|
||||||
|
|
||||||
<div class="card-header text-white text-center py-4 border-0" style="background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%); border-radius: calc(0.375rem - 1px) calc(0.375rem - 1px) 0 0;">
|
<div class="card-header text-white text-center py-4 border-0" style="border-radius: calc(0.375rem - 1px) calc(0.375rem - 1px) 0 0;">
|
||||||
<div class="mb-2">
|
<div class="mb-2">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" fill="currentColor" viewBox="0 0 16 16">
|
@if (_appLogo is not null && !string.IsNullOrEmpty(_appLogo.Src))
|
||||||
<path d="M11 6a3 3 0 1 1-6 0 3 3 0 0 1 6 0z"/>
|
{
|
||||||
<path fill-rule="evenodd" d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8zm8-7a7 7 0 0 0-5.468 11.37C3.242 11.226 4.805 10 8 10s4.757 1.225 5.468 2.37A7 7 0 0 0 8 1z"/>
|
<img src="@_appLogo.Src"
|
||||||
</svg>
|
style="height: @_appLogo.Height"
|
||||||
</div>
|
class="@_appLogo.GetClass("Main")"
|
||||||
<h5 class="mb-0 fw-semibold">@L("SenderLogin_Title", "Sender Anmeldung")</h5>
|
alt="signFLOW" />
|
||||||
<p class="mb-0 mt-1 opacity-75" style="font-size: 0.85rem;">@L("SenderLogin_Subtitle", "Sicherer Zugang zum Sender-Dashboard")</p>
|
}
|
||||||
</div>
|
else
|
||||||
|
{
|
||||||
<div class="card-body p-4">
|
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" fill="currentColor" viewBox="0 0 16 16">
|
||||||
|
<path d="M0 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V4Zm2-1a1 1 0 0 0-1 1v.217l7 4.2 7-4.2V4a1 1 0 0 0-1-1H2Zm13 2.383-4.708 2.825L15 11.105V5.383Zm-.034 6.876-5.64-3.471L8 9.583l-1.326-.795-5.64 3.47A1 1 0 0 0 2 13h12a1 1 0 0 0 .966-.741ZM1 11.105l4.708-2.897L1 5.383v5.722Z"/>
|
||||||
<p class="text-muted mb-4" style="font-size: 0.875rem; line-height: 1.5;">
|
|
||||||
@L("SenderLogin_Description", "Bitte melden Sie sich mit Ihren Zugangsdaten an, um auf das Sender-Dashboard zuzugreifen.")
|
|
||||||
</p>
|
|
||||||
|
|
||||||
@if (LoginResult == SenderLoginResult.InvalidCredentials) {
|
|
||||||
<div class="alert alert-danger d-flex align-items-start gap-2 py-2" role="alert">
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="currentColor" class="flex-shrink-0 mt-1" viewBox="0 0 16 16">
|
|
||||||
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.646a.5.5 0 0 0 .708.708L8 8.707l2.646 2.647a.5.5 0 0 0 .708-.708L8.707 8l2.647-2.646a.5.5 0 0 0-.708-.708L8 7.293 5.354 4.646z"/>
|
|
||||||
</svg>
|
|
||||||
<div>
|
|
||||||
<strong>@L("SenderLogin_InvalidCredentials_Title", "Ungültige Anmeldedaten.")</strong><br />
|
|
||||||
<span style="font-size:0.85rem;">@L("SenderLogin_InvalidCredentials_Body", "Benutzername oder Passwort ist falsch. Bitte versuchen Sie es erneut.")</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
} else if (LoginResult == SenderLoginResult.Error) {
|
|
||||||
<div class="alert alert-secondary d-flex align-items-start gap-2 py-2" role="alert">
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="currentColor" class="flex-shrink-0 mt-1" viewBox="0 0 16 16">
|
|
||||||
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"/>
|
|
||||||
<path d="M7.002 11a1 1 0 1 1 2 0 1 1 0 0 1-2 0zM7.1 4.995a.905.905 0 1 1 1.8 0l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 4.995z"/>
|
|
||||||
</svg>
|
|
||||||
<div>
|
|
||||||
<strong>@L("ServerError", "Serverfehler.")</strong><br />
|
|
||||||
<span style="font-size:0.85rem;">@L("UnexpectedErrorTryAgainLater", "Ein unerwarteter Fehler ist aufgetreten. Bitte versuchen Sie es später erneut.")</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
|
|
||||||
<div class="mb-3">
|
|
||||||
<label class="form-label fw-medium" for="login-username">
|
|
||||||
@L("UserName", "Benutzername")
|
|
||||||
<span class="text-danger ms-1">*</span>
|
|
||||||
</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<span class="input-group-text bg-light">
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#6c757d" viewBox="0 0 16 16">
|
|
||||||
<path d="M3 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H3Zm5-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"/>
|
|
||||||
</svg>
|
</svg>
|
||||||
</span>
|
}
|
||||||
<input id="login-username"
|
|
||||||
type="text"
|
|
||||||
class="form-control @(LoginResult == SenderLoginResult.InvalidCredentials ? "is-invalid" : null)"
|
|
||||||
placeholder="@L("SenderLogin_Username_Placeholder", "Benutzername eingeben")"
|
|
||||||
@bind="Username"
|
|
||||||
@bind:event="oninput"
|
|
||||||
@onkeydown="OnKeyDownAsync"
|
|
||||||
disabled="@IsLoading"
|
|
||||||
autocomplete="username" />
|
|
||||||
</div>
|
</div>
|
||||||
|
<h5 class="mb-0 fw-semibold">@L("SenderLogin_Title", "Anmeldung")</h5>
|
||||||
|
<p class="mb-0 mt-1 opacity-75" style="font-size: 0.85rem;">@L("SenderLogin_Subtitle", "Dokumente zur Unterschrift vorbereiten und versenden")</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mb-4">
|
<div class="card-body p-4">
|
||||||
<label class="form-label fw-medium" for="login-password">
|
<a class="sender-login-back-link" href="/">@L("SenderLogin_BackToHome", "← Zurück zur Startseite")</a>
|
||||||
@L("Password", "Passwort")
|
|
||||||
<span class="text-danger ms-1">*</span>
|
<p class="text-muted mb-4 mt-3" style="font-size: 0.875rem; line-height: 1.5;">
|
||||||
</label>
|
@L("SenderLogin_Description", "Melden Sie sich mit denselben Zugangsdaten an wie an Ihrem Arbeitsplatz-PC.")
|
||||||
<div class="input-group">
|
</p>
|
||||||
<span class="input-group-text bg-light border-end-0">
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#6c757d" viewBox="0 0 16 16">
|
@if (ShowRequiredValidation && (string.IsNullOrWhiteSpace(Username) || string.IsNullOrWhiteSpace(Password)))
|
||||||
<path d="M8 1a2 2 0 0 1 2 2v4H6V3a2 2 0 0 1 2-2zm3 6V3a3 3 0 0 0-6 0v4a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2z"/>
|
{
|
||||||
|
<div class="alert alert-warning d-flex align-items-start gap-2 py-2" role="alert">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="currentColor" class="flex-shrink-0 mt-1" viewBox="0 0 16 16">
|
||||||
|
<path d="M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"/>
|
||||||
</svg>
|
</svg>
|
||||||
</span>
|
<div>
|
||||||
<input id="login-password"
|
<strong>@L("SenderLogin_RequiredFields_Title", "Pflichtfelder fehlen.")</strong><br />
|
||||||
type="@(ShowPassword ? "text" : "password")"
|
<span style="font-size:0.85rem;">@L("SenderLogin_RequiredFields_Body", "Bitte Benutzername und Passwort eingeben.")</span>
|
||||||
class="form-control border-start-0 border-end-0 @(LoginResult == SenderLoginResult.InvalidCredentials ? "is-invalid" : null)"
|
</div>
|
||||||
placeholder="@L("SenderLogin_Password_Placeholder", "Passwort eingeben")"
|
</div>
|
||||||
@bind="Password"
|
}
|
||||||
@bind:event="oninput"
|
|
||||||
@onkeydown="OnKeyDownAsync"
|
@if (LoginResult == SenderLoginResult.InvalidCredentials) {
|
||||||
disabled="@IsLoading"
|
<div class="alert alert-danger d-flex align-items-start gap-2 py-2" role="alert">
|
||||||
autocomplete="current-password" />
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="currentColor" class="flex-shrink-0 mt-1" viewBox="0 0 16 16">
|
||||||
<button type="button"
|
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.646a.5.5 0 0 0 .708.708L8 8.707l2.646 2.647a.5.5 0 0 0 .708-.708L8.707 8l2.647-2.646a.5.5 0 0 0-.708-.708L8 7.293 5.354 4.646z"/>
|
||||||
class="btn btn-outline-secondary border-start-0"
|
</svg>
|
||||||
style="border-left: none;"
|
<div>
|
||||||
tabindex="-1"
|
<strong>@L("SenderLogin_InvalidCredentials_Title", "Ungültige Anmeldedaten.")</strong><br />
|
||||||
@onclick="() => ShowPassword = !ShowPassword">
|
<span style="font-size:0.85rem;">@L("SenderLogin_InvalidCredentials_Body", "Benutzername oder Passwort ist falsch. Bitte versuchen Sie es erneut.")</span>
|
||||||
@if (ShowPassword) {
|
</div>
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
|
</div>
|
||||||
<path d="M13.359 11.238C15.06 9.72 16 8 16 8s-3-5.5-8-5.5a7.028 7.028 0 0 0-2.79.588l.77.771A5.944 5.944 0 0 1 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.134 13.134 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755-.165.165-.337.328-.517.486l.708.709z"/>
|
} else if (LoginResult == SenderLoginResult.Error) {
|
||||||
<path d="M11.297 9.176a3.5 3.5 0 0 0-4.474-4.474l.823.823a2.5 2.5 0 0 1 2.829 2.829l.822.822zm-2.943 1.299.822.822a3.5 3.5 0 0 1-4.474-4.474l.823.823a2.5 2.5 0 0 0 2.829 2.829z"/>
|
<div class="alert alert-secondary d-flex align-items-start gap-2 py-2" role="alert">
|
||||||
<path d="M3.35 5.47c-.18.16-.353.322-.518.487A13.134 13.134 0 0 0 1.172 8l.195.288c.335.48.83 1.12 1.465 1.755C4.121 11.332 5.881 12.5 8 12.5c.716 0 1.39-.133 2.02-.36l.77.772A7.029 7.029 0 0 1 8 13.5C3 13.5 0 8 0 8s.939-1.721 2.641-3.238l.708.709z"/>
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="currentColor" class="flex-shrink-0 mt-1" viewBox="0 0 16 16">
|
||||||
<path fill-rule="evenodd" d="M13.646 14.354l-12-12 .708-.708 12 12-.708.708z"/>
|
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"/>
|
||||||
</svg>
|
<path d="M7.002 11a1 1 0 1 1 2 0 1 1 0 0 1-2 0zM7.1 4.995a.905.905 0 1 1 1.8 0l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 4.995z"/>
|
||||||
|
</svg>
|
||||||
|
<div>
|
||||||
|
<strong>@L("ServerError", "Serverfehler.")</strong><br />
|
||||||
|
<span style="font-size:0.85rem;">@L("UnexpectedErrorTryAgainLater", "Ein unerwarteter Fehler ist aufgetreten. Bitte versuchen Sie es später erneut.")</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
<form @onsubmit="SubmitFormAsync">
|
||||||
|
<div class="mb-3">
|
||||||
|
<label class="form-label fw-medium" for="login-username">
|
||||||
|
@L("UserName", "Benutzername")
|
||||||
|
</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<span class="input-group-text bg-light">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#6c757d" viewBox="0 0 16 16">
|
||||||
|
<path d="M3 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H3Zm5-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
|
<input id="login-username"
|
||||||
|
type="text"
|
||||||
|
class="form-control @GetUsernameInputClass()"
|
||||||
|
placeholder="@L("SenderLogin_Username_Placeholder", "z. B. m.mustermann")"
|
||||||
|
@bind="Username"
|
||||||
|
@bind:event="oninput"
|
||||||
|
disabled="@IsLoading"
|
||||||
|
autocomplete="username"
|
||||||
|
autofocus
|
||||||
|
@ref="UsernameInputRef" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-4">
|
||||||
|
<label class="form-label fw-medium" for="login-password">
|
||||||
|
@L("Password", "Passwort")
|
||||||
|
</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<span class="input-group-text bg-light">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#6c757d" viewBox="0 0 16 16">
|
||||||
|
<path d="M8 1a2 2 0 0 1 2 2v4H6V3a2 2 0 0 1 2-2zm3 6V3a3 3 0 0 0-6 0v4a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2z"/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
|
<input id="login-password"
|
||||||
|
type="@(ShowPassword ? "text" : "password")"
|
||||||
|
class="form-control @GetPasswordInputClass()"
|
||||||
|
@bind="Password"
|
||||||
|
@bind:event="oninput"
|
||||||
|
disabled="@IsLoading"
|
||||||
|
autocomplete="current-password" />
|
||||||
|
<button type="button"
|
||||||
|
class="btn btn-outline-secondary"
|
||||||
|
style="margin-left: 0;"
|
||||||
|
tabindex="-1"
|
||||||
|
@onclick="() => ShowPassword = !ShowPassword">
|
||||||
|
@if (ShowPassword) {
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
|
||||||
|
<path d="M13.359 11.238C15.06 9.72 16 8 16 8s-3-5.5-8-5.5a7.028 7.028 0 0 0-2.79.588l.77.771A5.944 5.944 0 0 1 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.134 13.134 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755-.165.165-.337.328-.517.486l.708.709z"/>
|
||||||
|
<path d="M11.297 9.176a3.5 3.5 0 0 0-4.474-4.474l.823.823a2.5 2.5 0 0 1 2.829 2.829l.822.822zm-2.943 1.299.822.822a3.5 3.5 0 0 1-4.474-4.474l.823.823a2.5 2.5 0 0 0 2.829 2.829z"/>
|
||||||
|
<path d="M3.35 5.47c-.18.16-.353.322-.518.487A13.134 13.134 0 0 0 1.172 8l.195.288c.335.48.83 1.12 1.465 1.755C4.121 11.332 5.881 12.5 8 12.5c.716 0 1.39-.133 2.02-.36l.77.772A7.029 7.029 0 0 1 8 13.5C3 13.5 0 8 0 8s.939-1.721 2.641-3.238l.708.709z"/>
|
||||||
|
<path fill-rule="evenodd" d="M13.646 14.354l-12-12 .708-.708 12 12-.708.708z"/>
|
||||||
|
</svg>
|
||||||
|
} else {
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
|
||||||
|
<path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/>
|
||||||
|
<path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/>
|
||||||
|
</svg>
|
||||||
|
}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button type="submit"
|
||||||
|
class="btn home-btn-primary w-100 py-2 fw-medium"
|
||||||
|
disabled="@IsLoading">
|
||||||
|
@if (IsLoading) {
|
||||||
|
<span class="spinner-border spinner-border-sm me-2" role="status" aria-hidden="true"></span>
|
||||||
|
<span>@L("LoginInProgress", "Anmelden …")</span>
|
||||||
} else {
|
} else {
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="me-2" viewBox="0 0 16 16">
|
||||||
<path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/>
|
<path fill-rule="evenodd" d="M10 3.5a.5.5 0 0 0-.5-.5h-8a.5.5 0 0 0-.5.5v9a.5.5 0 0 0 .5.5h8a.5.5 0 0 0 .5-.5v-2a.5.5 0 0 1 1 0v2A1.5 1.5 0 0 1 9.5 14h-8A1.5 1.5 0 0 1 0 12.5v-9A1.5 1.5 0 0 1 1.5 2h8A1.5 1.5 0 0 1 11 3.5v2a.5.5 0 0 1-1 0v-2z"/>
|
||||||
<path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/>
|
<path fill-rule="evenodd" d="M4.146 8.354a.5.5 0 0 1 0-.708l3-3a.5.5 0 1 1 .708.708L5.707 7.5H14.5a.5.5 0 0 1 0 1H5.707l2.147 2.146a.5.5 0 0 1-.708.708l-3-3z"/>
|
||||||
</svg>
|
</svg>
|
||||||
|
<span>@L("Login", "Anmelden")</span>
|
||||||
}
|
}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button class="btn btn-primary w-100 py-2 fw-medium"
|
<div class="card-footer text-center text-muted py-3 border-0 bg-transparent" style="font-size: 0.78rem;">
|
||||||
style="background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%); border: none;"
|
© @DateTime.Now.Year Digital Data GmbH
|
||||||
@onclick="SubmitAsync"
|
</div>
|
||||||
disabled="@(IsLoading || string.IsNullOrWhiteSpace(Username) || string.IsNullOrWhiteSpace(Password))">
|
|
||||||
@if (IsLoading) {
|
|
||||||
<span class="spinner-border spinner-border-sm me-2" role="status" aria-hidden="true"></span>
|
|
||||||
<span>@L("LoginInProgress", "Anmelden …")</span>
|
|
||||||
} else {
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="me-2" viewBox="0 0 16 16">
|
|
||||||
<path fill-rule="evenodd" d="M10 3.5a.5.5 0 0 0-.5-.5h-8a.5.5 0 0 0-.5.5v9a.5.5 0 0 0 .5.5h8a.5.5 0 0 0 .5-.5v-2a.5.5 0 0 1 1 0v2A1.5 1.5 0 0 1 9.5 14h-8A1.5 1.5 0 0 1 0 12.5v-9A1.5 1.5 0 0 1 1.5 2h8A1.5 1.5 0 0 1 11 3.5v2a.5.5 0 0 1-1 0v-2z"/>
|
|
||||||
<path fill-rule="evenodd" d="M4.146 8.354a.5.5 0 0 1 0-.708l3-3a.5.5 0 1 1 .708.708L5.707 7.5H14.5a.5.5 0 0 1 0 1H5.707l2.147 2.146a.5.5 0 0 1-.708.708l-3-3z"/>
|
|
||||||
</svg>
|
|
||||||
<span>@L("Login", "Anmelden")</span>
|
|
||||||
}
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card-footer text-center text-muted py-3 border-0 bg-transparent" style="font-size: 0.78rem;">
|
|
||||||
@L("SenderLogin_FooterHelp", "Bei Problemen wenden Sie sich bitte an den Administrator.")
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -145,17 +169,42 @@
|
|||||||
string Password = string.Empty;
|
string Password = string.Empty;
|
||||||
bool ShowPassword;
|
bool ShowPassword;
|
||||||
bool IsLoading;
|
bool IsLoading;
|
||||||
|
bool ShowRequiredValidation;
|
||||||
SenderLoginResult? LoginResult;
|
SenderLoginResult? LoginResult;
|
||||||
|
ElementReference UsernameInputRef;
|
||||||
|
EnvelopeGenerator.Server.Client.Services.CustomImageDto? _appLogo;
|
||||||
|
|
||||||
async Task OnKeyDownAsync(Microsoft.AspNetCore.Components.Web.KeyboardEventArgs e) {
|
protected override async Task OnInitializedAsync()
|
||||||
if (e.Key == "Enter")
|
{
|
||||||
await SubmitAsync();
|
var logos = await CustomImagesService.GetAsync();
|
||||||
|
_appLogo = logos.App;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||||
|
{
|
||||||
|
if (!firstRender)
|
||||||
|
return;
|
||||||
|
|
||||||
|
await UsernameInputRef.FocusAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
async Task SubmitFormAsync()
|
||||||
|
{
|
||||||
|
await SubmitAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
async Task SubmitAsync() {
|
async Task SubmitAsync() {
|
||||||
if (string.IsNullOrWhiteSpace(Username) || string.IsNullOrWhiteSpace(Password) || IsLoading) return;
|
if (IsLoading) return;
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(Username) || string.IsNullOrWhiteSpace(Password)) {
|
||||||
|
ShowRequiredValidation = true;
|
||||||
|
LoginResult = null;
|
||||||
|
await InvokeAsync(StateHasChanged);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
IsLoading = true;
|
IsLoading = true;
|
||||||
|
ShowRequiredValidation = false;
|
||||||
LoginResult = null;
|
LoginResult = null;
|
||||||
await InvokeAsync(StateHasChanged);
|
await InvokeAsync(StateHasChanged);
|
||||||
|
|
||||||
@@ -171,6 +220,20 @@
|
|||||||
await InvokeAsync(StateHasChanged);
|
await InvokeAsync(StateHasChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string GetUsernameInputClass()
|
||||||
|
{
|
||||||
|
if (LoginResult == SenderLoginResult.InvalidCredentials)
|
||||||
|
return "is-invalid";
|
||||||
|
return ShowRequiredValidation && string.IsNullOrWhiteSpace(Username) ? "is-invalid" : string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
string GetPasswordInputClass()
|
||||||
|
{
|
||||||
|
if (LoginResult == SenderLoginResult.InvalidCredentials)
|
||||||
|
return "is-invalid";
|
||||||
|
return ShowRequiredValidation && string.IsNullOrWhiteSpace(Password) ? "is-invalid" : string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
string L(string key, string fallback)
|
string L(string key, string fallback)
|
||||||
{
|
{
|
||||||
var value = UiLocalizer[key];
|
var value = UiLocalizer[key];
|
||||||
|
|||||||
@@ -1,38 +1,36 @@
|
|||||||
@page "/envelope/{EnvelopeKey}"
|
@page "/envelope/{EnvelopeKey}"
|
||||||
@rendermode InteractiveServer
|
@rendermode InteractiveWebAssembly
|
||||||
@using DevExpress.Blazor.Reporting
|
@implements IDisposable
|
||||||
@using DevExpress.XtraReports.UI
|
@using EnvelopeGenerator.Application.Common.Dto
|
||||||
@using EnvelopeGenerator.Server.Client.Models
|
@using EnvelopeGenerator.Server.Client.Models
|
||||||
|
@using EnvelopeGenerator.Server.Client.Components.PdfEditor
|
||||||
@using EnvelopeGenerator.Server.Client.Models.Constants
|
@using EnvelopeGenerator.Server.Client.Models.Constants
|
||||||
@using EnvelopeGenerator.Server.Client.Services
|
@using EnvelopeGenerator.Server.Client.Services
|
||||||
|
@using EnvelopeGenerator.Application.Resources
|
||||||
@using EnvelopeGenerator.Application.Common.Extensions
|
@using EnvelopeGenerator.Application.Common.Extensions
|
||||||
@using EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver
|
|
||||||
@using EnvelopeGenerator.Application.EnvelopeReceivers.Queries
|
@using EnvelopeGenerator.Application.EnvelopeReceivers.Queries
|
||||||
@using EnvelopeGenerator.Domain.Constants
|
@using EnvelopeGenerator.Domain.Constants
|
||||||
@using Microsoft.JSInterop
|
@using Microsoft.JSInterop
|
||||||
@using DevExpress.Blazor
|
@using DevExpress.Blazor
|
||||||
@using System.Drawing
|
|
||||||
@using System.Security.Claims
|
|
||||||
@using System.ComponentModel.DataAnnotations
|
@using System.ComponentModel.DataAnnotations
|
||||||
@using Microsoft.Extensions.Caching.Memory
|
@using Microsoft.Extensions.Localization
|
||||||
@using MediatR
|
|
||||||
@using EnvelopeGenerator.Server.Extensions
|
|
||||||
@inject NavigationManager Navigation
|
@inject NavigationManager Navigation
|
||||||
@inject IJSRuntime JSRuntime
|
@inject IJSRuntime JSRuntime
|
||||||
@inject EnvelopeGenerator.Server.Client.Services.AuthService AuthService
|
@inject EnvelopeGenerator.Server.Client.Services.AuthService AuthService
|
||||||
@inject EnvelopeGenerator.Server.Services.EnvelopeReceiverAuthorizationService ReceiverAuthorizationService
|
|
||||||
@inject EnvelopeGenerator.Server.Services.EnvelopeReceiverPageDataService PageDataService
|
|
||||||
@inject AnnotationService AnnotationService
|
@inject AnnotationService AnnotationService
|
||||||
|
@inject SignatureService SignatureService
|
||||||
|
@inject DocumentService DocumentService
|
||||||
|
@inject EnvelopeReceiverService EnvelopeReceiverService
|
||||||
|
@inject PdfRenderService PdfRenderService
|
||||||
@inject AppVersionService AppVersion
|
@inject AppVersionService AppVersion
|
||||||
@inject IMemoryCache MemoryCache
|
|
||||||
@inject ILogger<ReceiverPage> Logger
|
@inject ILogger<ReceiverPage> Logger
|
||||||
@inject IMediator Mediator
|
@inject IStringLocalizer<Resource> UiLocalizer
|
||||||
@implements IDisposable
|
@inject PersistentComponentState PersistentComponentState
|
||||||
|
|
||||||
<link href="_content/DevExpress.Blazor.Themes/blazing-berry.bs5.min.css" rel="stylesheet" />
|
<link href="_content/DevExpress.Blazor.Themes/blazing-berry.bs5.min.css" rel="stylesheet" />
|
||||||
<link href="_content/DevExpress.Blazor.Reporting.Viewer/css/dx-blazor-reporting-components.bs5.css" rel="stylesheet" />
|
|
||||||
<link href="@AppVersion.GetVersionedUrl("css/envelope-viewer.css")" rel="stylesheet" />
|
<link href="@AppVersion.GetVersionedUrl("css/envelope-viewer.css")" rel="stylesheet" />
|
||||||
<script src="@AppVersion.GetVersionedUrl("js/receiver-signature.js")"></script>
|
<script src="@AppVersion.GetVersionedUrl("js/receiver-signature.js")"></script>
|
||||||
|
<script src="@AppVersion.GetVersionedUrl("js/envelope-editor.js")"></script>
|
||||||
|
|
||||||
<div class="envelope-viewer-layout">
|
<div class="envelope-viewer-layout">
|
||||||
<div class="envelope-action-bar">
|
<div class="envelope-action-bar">
|
||||||
@@ -87,16 +85,49 @@
|
|||||||
}
|
}
|
||||||
@if (_signatures.Count > 0)
|
@if (_signatures.Count > 0)
|
||||||
{
|
{
|
||||||
|
@if (_signatures.Count > 1)
|
||||||
|
{
|
||||||
|
<button class="pdf-toolbar__btn pdf-toolbar__btn--signature-change"
|
||||||
|
@onclick="GoToPreviousSignatureAsync"
|
||||||
|
disabled="@(!CanNavigateToAnotherSignature)"
|
||||||
|
title='@L("Receiver_SignNav_Previous", "Vorheriges Feld")'
|
||||||
|
style="padding: 0.2rem 0.55rem; min-width: 2.1rem; min-height: 1.75rem;">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="currentColor" viewBox="0 0 16 16" aria-hidden="true">
|
||||||
|
<path fill-rule="evenodd" d="M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z" />
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
}
|
||||||
|
|
||||||
<span style="display: inline-flex; align-items: center; padding: 0.125rem 0.4rem; background: @(_capturedSignature is not null ? "#d1fae5" : "#ede9fe"); border-radius: 0.25rem; color: @(_capturedSignature is not null ? "#065f46" : "#6d28d9"); font-weight: 500; white-space: nowrap;">
|
<span style="display: inline-flex; align-items: center; padding: 0.125rem 0.4rem; background: @(_capturedSignature is not null ? "#d1fae5" : "#ede9fe"); border-radius: 0.25rem; color: @(_capturedSignature is not null ? "#065f46" : "#6d28d9"); font-weight: 500; white-space: nowrap;">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="9" height="9" fill="currentColor" class="me-1" viewBox="0 0 16 16">
|
<svg xmlns="http://www.w3.org/2000/svg" width="9" height="9" fill="currentColor" class="me-1" viewBox="0 0 16 16">
|
||||||
<path d="M12.146.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168l10-10zM11.207 2.5 13.5 4.793 14.793 3.5 12.5 1.207 11.207 2.5zm1.586 3L10.5 3.207 4 9.707V10h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.293l6.5-6.5zm-9.761 5.175-.106.106-1.528 3.821 3.821-1.528.106-.106A.5.5 0 0 1 5 12.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.468-.325z" />
|
<path d="M12.146.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168l10-10zM11.207 2.5 13.5 4.793 14.793 3.5 12.5 1.207 11.207 2.5zm1.586 3L10.5 3.207 4 9.707V10h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.293l6.5-6.5zm-9.761 5.175-.106.106-1.528 3.821 3.821-1.528.106-.106A.5.5 0 0 1 5 12.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.468-.325z" />
|
||||||
</svg>
|
</svg>
|
||||||
@_signatures.Count Unterschrift@(_signatures.Count != 1 ? "en" : "")
|
@if (_signatures.Count > 1)
|
||||||
|
{
|
||||||
|
@string.Format(L("Receiver_SignNav_PositionWithLabel", "{0} / {1} Signaturen"), CurrentSignatureDisplayIndex, _signatures.Count)
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
@($"{_signatures.Count} {L("Receiver_Signature_Singular", "Unterschrift")}")
|
||||||
|
}
|
||||||
@if (_capturedSignature is not null)
|
@if (_capturedSignature is not null)
|
||||||
{
|
{
|
||||||
<span class="ms-1">✓</span>
|
<span class="ms-1">✓</span>
|
||||||
}
|
}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
|
@if (_signatures.Count > 1)
|
||||||
|
{
|
||||||
|
<button class="pdf-toolbar__btn pdf-toolbar__btn--signature-change"
|
||||||
|
@onclick="GoToNextSignatureAsync"
|
||||||
|
disabled="@(!CanNavigateToAnotherSignature)"
|
||||||
|
title='@L("Receiver_SignNav_Next", "Nächstes Feld")'
|
||||||
|
style="padding: 0.2rem 0.55rem; min-width: 2.1rem; min-height: 1.75rem;">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="currentColor" viewBox="0 0 16 16" aria-hidden="true">
|
||||||
|
<path fill-rule="evenodd" d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z" />
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@if (_envelopeReceiver.Envelope?.UseAccessCode ?? false)
|
@if (_envelopeReceiver.Envelope?.UseAccessCode ?? false)
|
||||||
{
|
{
|
||||||
@@ -123,14 +154,28 @@
|
|||||||
@* Unterschreiben button — visible only when signature fields exist *@
|
@* Unterschreiben button — visible only when signature fields exist *@
|
||||||
@if (_signatures.Count > 0)
|
@if (_signatures.Count > 0)
|
||||||
{
|
{
|
||||||
|
@if (_capturedSignature is not null)
|
||||||
|
{
|
||||||
|
<button class="pdf-toolbar__btn pdf-toolbar__btn--signature-change pdf-toolbar__btn--signature-change-active"
|
||||||
|
@onclick="() => OpenSignaturePopup()"
|
||||||
|
title="Unterschrift andern"
|
||||||
|
style="flex-shrink: 0;">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="currentColor" viewBox="0 0 16 16">
|
||||||
|
<path d="M12.146.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168l10-10zM11.207 2.5 13.5 4.793 14.793 3.5 12.5 1.207 11.207 2.5zm1.586 3L10.5 3.207 4 9.707V10h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.293l6.5-6.5zm-9.761 5.175-.106.106-1.528 3.821 3.821-1.528.106-.106A.5.5 0 0 1 5 12.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.468-.325z" />
|
||||||
|
</svg>
|
||||||
|
<span class="pdf-toolbar__btn-text">Unterschrift andern</span>
|
||||||
|
</button>
|
||||||
|
}
|
||||||
|
|
||||||
<button class="pdf-toolbar__btn pdf-toolbar__btn--signature-change pdf-toolbar__btn--signature-change-active"
|
<button class="pdf-toolbar__btn pdf-toolbar__btn--signature-change pdf-toolbar__btn--signature-change-active"
|
||||||
@onclick="OpenSignaturePopup"
|
@onclick="OpenSubmitConfirmPopup"
|
||||||
title="Unterschreiben"
|
disabled="@(_capturedSignature is null || _isSubmittingSignature || !AllSignatureFieldsApplied)"
|
||||||
|
title="Abschließen"
|
||||||
style="flex-shrink: 0;">
|
style="flex-shrink: 0;">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="currentColor" viewBox="0 0 16 16">
|
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="currentColor" viewBox="0 0 16 16">
|
||||||
<path d="M12.146.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168l10-10zM11.207 2.5 13.5 4.793 14.793 3.5 12.5 1.207 11.207 2.5zm1.586 3L10.5 3.207 4 9.707V10h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.293l6.5-6.5zm-9.761 5.175-.106.106-1.528 3.821 3.821-1.528.106-.106A.5.5 0 0 1 5 12.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.468-.325z" />
|
<path d="M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z" />
|
||||||
</svg>
|
</svg>
|
||||||
<span class="pdf-toolbar__btn-text">Unterschreiben</span>
|
<span class="pdf-toolbar__btn-text">Abschließen</span>
|
||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
@@ -143,7 +188,6 @@
|
|||||||
@if (!string.IsNullOrWhiteSpace(_envelopeReceiver.Envelope?.Message))
|
@if (!string.IsNullOrWhiteSpace(_envelopeReceiver.Envelope?.Message))
|
||||||
{
|
{
|
||||||
<div style="flex: 1; min-width: 0; padding: 0.2rem 0.4rem; background: #f9fafb; border-radius: 0.25rem; border-left: 2px solid #9ca3af; display: flex; align-items: flex-start; gap: 0.25rem;">
|
<div style="flex: 1; min-width: 0; padding: 0.2rem 0.4rem; background: #f9fafb; border-radius: 0.25rem; border-left: 2px solid #9ca3af; display: flex; align-items: flex-start; gap: 0.25rem;">
|
||||||
<span style="font-weight: 500; color: #374151; flex-shrink: 0;">📧</span>
|
|
||||||
<span style="color: #6b7280; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">@_envelopeReceiver.Envelope.Message</span>
|
<span style="color: #6b7280; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">@_envelopeReceiver.Envelope.Message</span>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
@@ -156,6 +200,13 @@
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@if (_signatures.Count > 0 && !AllSignatureFieldsApplied)
|
||||||
|
{
|
||||||
|
<div class="receiver-signing-hint">
|
||||||
|
@L("Receiver_Signing_Instruction", "Please click each highlighted field to sign.")
|
||||||
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -188,24 +239,86 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
else if (_report is not null)
|
else if (PdfDataUrl is not null)
|
||||||
{
|
{
|
||||||
<DxReportViewer @ref="_reportViewer"
|
<SenderPdfImageEditor IsPlacementMode="false"
|
||||||
Report="_report"
|
PageCount="@_pageCount"
|
||||||
RootCssClasses="w-100 h-100" />
|
Pages="@_pagePreviews"
|
||||||
|
PdfDataUrl="@PdfDataUrl"
|
||||||
|
PdfFileName="@PdfFileName"
|
||||||
|
Fields="@FieldOverlays"
|
||||||
|
HiddenFieldIndexes="@_appliedSignatureFieldIndexes"
|
||||||
|
SignatureOverlays="@SignedOverlays"
|
||||||
|
FieldCursor="pointer"
|
||||||
|
ActiveFieldIndex="@ActiveSignatureFieldIndex"
|
||||||
|
AutoScrollToActiveField="true"
|
||||||
|
FieldClick="OnSignatureFieldClickAsync"
|
||||||
|
ShowFieldRemoveButton="false" />
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@* Signature Popup *@
|
<DxPopup @bind-Visible="_submitConfirmVisible"
|
||||||
<DxPopup @bind-Visible="_signaturePopupVisible"
|
HeaderText="Unterschrift bestätigen"
|
||||||
HeaderText="Unterschrift erstellen"
|
Width="440px"
|
||||||
Width="620px"
|
|
||||||
MaxWidth="95vw"
|
MaxWidth="95vw"
|
||||||
ShowFooter="true"
|
ShowFooter="true"
|
||||||
CloseOnOutsideClick="false"
|
CloseOnOutsideClick="false"
|
||||||
ShowCloseButton="false"
|
ShowCloseButton="false"
|
||||||
CloseOnEscape="false"
|
CloseOnEscape="false">
|
||||||
|
<BodyContentTemplate>
|
||||||
|
<div style="display: flex; align-items: flex-start; gap: 1rem; padding: 0.5rem 0;">
|
||||||
|
<div style="flex-shrink: 0; width: 40px; height: 40px; background: #d1fae5; border-radius: 50%; display: flex; align-items: center; justify-content: center;">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#065f46" viewBox="0 0 16 16">
|
||||||
|
<path d="M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z" />
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<p style="margin: 0 0 0.4rem; font-weight: 600; color: #1f2937; font-size: 0.95rem;">
|
||||||
|
Möchten Sie das Dokument verbindlich unterschreiben?
|
||||||
|
</p>
|
||||||
|
<p style="margin: 0; color: #6b7280; font-size: 0.85rem; line-height: 1.5;">
|
||||||
|
Diese Aktion kann nicht rückgängig gemacht werden. Mit der Bestätigung erklären Sie, das oben angezeigte Dokument elektronisch unterzeichnet zu haben.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@if (!string.IsNullOrWhiteSpace(_submitErrorMessage))
|
||||||
|
{
|
||||||
|
<div class="alert alert-danger mb-0" role="alert" style="font-size: 0.85rem;">
|
||||||
|
@_submitErrorMessage
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</BodyContentTemplate>
|
||||||
|
<FooterContentTemplate>
|
||||||
|
<div class="d-flex gap-2 justify-content-end w-100" style="padding: 0.5rem 0;">
|
||||||
|
<button class="btn btn-outline-secondary"
|
||||||
|
@onclick="() => _submitConfirmVisible = false"
|
||||||
|
style="border-radius: 6px; padding: 0.5rem 1.25rem; font-weight: 500;">
|
||||||
|
Abbrechen
|
||||||
|
</button>
|
||||||
|
<button class="btn btn-primary"
|
||||||
|
@onclick="SubmitAndLogoutAsync"
|
||||||
|
disabled="@_isSubmittingSignature"
|
||||||
|
style="background: linear-gradient(135deg, #059669 0%, #047857 100%); border: none; border-radius: 6px; padding: 0.5rem 1.5rem; font-weight: 600; box-shadow: 0 2px 4px rgba(5, 150, 105, 0.3);">
|
||||||
|
@if (_isSubmittingSignature)
|
||||||
|
{
|
||||||
|
<span class="spinner-border spinner-border-sm me-1" role="status"></span>
|
||||||
|
}
|
||||||
|
Abschließen
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</FooterContentTemplate>
|
||||||
|
</DxPopup>
|
||||||
|
|
||||||
|
@* Signature Popup *@
|
||||||
|
<DxPopup @bind-Visible="SignaturePopupVisible"
|
||||||
|
HeaderText="Unterschrift erstellen"
|
||||||
|
Width="640px"
|
||||||
|
MaxWidth="95vw"
|
||||||
|
ShowFooter="true"
|
||||||
|
CloseOnOutsideClick="true"
|
||||||
|
ShowCloseButton="true"
|
||||||
|
CloseOnEscape="true"
|
||||||
Shown="OnPopupShownAsync">
|
Shown="OnPopupShownAsync">
|
||||||
<BodyContentTemplate>
|
<BodyContentTemplate>
|
||||||
<ul class="nav nav-tabs mb-3" style="border-bottom: 2px solid #e9ecef;">
|
<ul class="nav nav-tabs mb-3" style="border-bottom: 2px solid #e9ecef;">
|
||||||
@@ -240,8 +353,8 @@
|
|||||||
<p style="color: #6c757d; font-size: 0.875rem; margin-bottom: 0.75rem;">Bitte unterschreiben Sie im folgenden Feld.</p>
|
<p style="color: #6c757d; font-size: 0.875rem; margin-bottom: 0.75rem;">Bitte unterschreiben Sie im folgenden Feld.</p>
|
||||||
<canvas id="rp-signature-pad"
|
<canvas id="rp-signature-pad"
|
||||||
width="560"
|
width="560"
|
||||||
height="180"
|
height="360"
|
||||||
style="border: 2px solid #e9ecef; border-radius: 8px; background: white; width: 100%; max-width: 560px; touch-action: none; box-shadow: 0 1px 3px rgba(0,0,0,0.1);"></canvas>
|
style="border: 2px solid #e9ecef; border-radius: 8px; background: white; width: 100%; max-width: 560px; display: block; margin: 0 auto; touch-action: none; box-shadow: 0 1px 3px rgba(0,0,0,0.1);"></canvas>
|
||||||
}
|
}
|
||||||
else if (_activeSignatureTab == SignatureTabText)
|
else if (_activeSignatureTab == SignatureTabText)
|
||||||
{
|
{
|
||||||
@@ -268,8 +381,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<canvas id="rp-typed-signature-pad"
|
<canvas id="rp-typed-signature-pad"
|
||||||
width="560"
|
width="560"
|
||||||
height="180"
|
height="360"
|
||||||
style="border: 2px solid #e9ecef; border-radius: 8px; background: white; width: 100%; max-width: 560px; box-shadow: 0 1px 3px rgba(0,0,0,0.1);"></canvas>
|
style="border: 2px solid #e9ecef; border-radius: 8px; background: white; width: 100%; max-width: 560px; display: block; margin: 0 auto; box-shadow: 0 1px 3px rgba(0,0,0,0.1);"></canvas>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -279,10 +392,16 @@
|
|||||||
type="file"
|
type="file"
|
||||||
accept="image/png,image/jpeg,image/webp"
|
accept="image/png,image/jpeg,image/webp"
|
||||||
style="border: 2px solid #e9ecef; border-radius: 6px; padding: 0.625rem;" />
|
style="border: 2px solid #e9ecef; border-radius: 6px; padding: 0.625rem;" />
|
||||||
|
@if (!string.IsNullOrWhiteSpace(_savedImageFileName))
|
||||||
|
{
|
||||||
|
<div style="font-size: 0.8rem; color: #6c757d; margin: -0.25rem 0 0.75rem;">
|
||||||
|
Letzte Datei: @_savedImageFileName
|
||||||
|
</div>
|
||||||
|
}
|
||||||
<canvas id="rp-image-signature-pad"
|
<canvas id="rp-image-signature-pad"
|
||||||
width="560"
|
width="560"
|
||||||
height="180"
|
height="360"
|
||||||
style="border: 2px solid #e9ecef; border-radius: 8px; background: white; width: 100%; max-width: 560px; box-shadow: 0 1px 3px rgba(0,0,0,0.1);"></canvas>
|
style="border: 2px solid #e9ecef; border-radius: 8px; background: white; width: 100%; max-width: 560px; display: block; margin: 0 auto; box-shadow: 0 1px 3px rgba(0,0,0,0.1);"></canvas>
|
||||||
}
|
}
|
||||||
|
|
||||||
<div style="border-top: 2px solid #e9ecef; margin-top: 1.5rem; padding-top: 1.5rem;">
|
<div style="border-top: 2px solid #e9ecef; margin-top: 1.5rem; padding-top: 1.5rem;">
|
||||||
@@ -372,29 +491,73 @@
|
|||||||
// ----- Parameters -----
|
// ----- Parameters -----
|
||||||
[Parameter] public string? EnvelopeKey { get; set; }
|
[Parameter] public string? EnvelopeKey { get; set; }
|
||||||
|
|
||||||
|
const string InitialStateKeyPrefix = "receiver-page.initial-state.v1:";
|
||||||
|
|
||||||
// ----- Page state -----
|
// ----- Page state -----
|
||||||
bool _isLoading = true;
|
bool _isLoading = true;
|
||||||
string? _errorMessage;
|
string? _errorMessage;
|
||||||
byte[]? _pdfBytes;
|
byte[]? _pdfBytes;
|
||||||
|
byte[]? _displayPdfBytes;
|
||||||
|
List<PdfPageImageDto> _pagePreviews = [];
|
||||||
|
int _pageCount;
|
||||||
IReadOnlyList<SignatureDto> _signatures = [];
|
IReadOnlyList<SignatureDto> _signatures = [];
|
||||||
EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver.EnvelopeReceiverDto? _envelopeReceiver;
|
EnvelopeReceiverDto? _envelopeReceiver;
|
||||||
ClaimsPrincipal? _receiverUser;
|
|
||||||
|
|
||||||
// ----- Report viewer -----
|
IReadOnlyList<SenderPdfFieldOverlay> FieldOverlays => _signatures
|
||||||
DxReportViewer? _reportViewer;
|
.Select((s, i) => new SenderPdfFieldOverlay(i, s.Page, s.X, s.Y, L("Receiver_SignField_ClickToSign", "Sign here"), "#4F46E5"))
|
||||||
XtraReport? _report;
|
.ToList();
|
||||||
|
|
||||||
|
IReadOnlyList<SenderPdfSignatureOverlay> SignedOverlays => _capturedSignature is null
|
||||||
|
? Array.Empty<SenderPdfSignatureOverlay>()
|
||||||
|
: _signatures
|
||||||
|
.Select((s, i) => new { Signature = s, Index = i })
|
||||||
|
.Where(x => _appliedSignatureFieldIndexes.Contains(x.Index))
|
||||||
|
.Select(x => new SenderPdfSignatureOverlay(
|
||||||
|
x.Signature.Page,
|
||||||
|
x.Signature.X,
|
||||||
|
x.Signature.Y,
|
||||||
|
_capturedSignature.DataUrl,
|
||||||
|
_capturedSignature.FullName,
|
||||||
|
_capturedSignature.Position,
|
||||||
|
_capturedSignature.Place,
|
||||||
|
_capturedSignatureDateText ?? DateTime.Now.ToString("dd.MM.yyyy")))
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
bool AllSignatureFieldsApplied => _signatures.Count > 0 && _appliedSignatureFieldIndexes.Count == _signatures.Count;
|
||||||
|
List<int> NavigableSignatureIndexes => Enumerable.Range(0, _signatures.Count).ToList();
|
||||||
|
bool CanNavigateToAnotherSignature => _signatures.Count > 1;
|
||||||
|
int? ActiveSignatureFieldIndex => _currentSignatureNavFieldIndex;
|
||||||
|
int CurrentSignatureDisplayIndex => _currentSignatureNavFieldIndex.HasValue
|
||||||
|
? (_currentSignatureNavFieldIndex.Value + 1)
|
||||||
|
: (_signatures.Count > 0 ? 1 : 0);
|
||||||
|
|
||||||
|
string? PdfDataUrl => _displayPdfBytes is { Length: > 0 }
|
||||||
|
? $"data:application/pdf;base64,{Convert.ToBase64String(_displayPdfBytes)}"
|
||||||
|
: null;
|
||||||
|
|
||||||
|
string PdfFileName => $"Envelope-{EnvelopeKey ?? "receiver"}.pdf";
|
||||||
|
|
||||||
// ----- Signature popup state -----
|
// ----- Signature popup state -----
|
||||||
SignatureCaptureDto? _capturedSignature;
|
SignatureCaptureDto? _capturedSignature;
|
||||||
bool _signaturePopupVisible = false;
|
bool _signaturePopupVisible = false;
|
||||||
|
int? _pendingSignatureFieldIndex;
|
||||||
string? _popupValidationMessage;
|
string? _popupValidationMessage;
|
||||||
string _activeSignatureTab = SignatureTabDraw;
|
string _activeSignatureTab = SignatureTabDraw;
|
||||||
|
string _lastSavedSignatureTab = SignatureTabDraw;
|
||||||
string _typedSignatureText = string.Empty;
|
string _typedSignatureText = string.Empty;
|
||||||
string _typedSignatureFont = "'Brush Script MT', cursive";
|
string _typedSignatureFont = "'Brush Script MT', cursive";
|
||||||
|
string _savedImageFileName = string.Empty;
|
||||||
string _signerFullName = string.Empty;
|
string _signerFullName = string.Empty;
|
||||||
string _signerPosition = string.Empty;
|
string _signerPosition = string.Empty;
|
||||||
string _signaturePlace = string.Empty;
|
string _signaturePlace = string.Empty;
|
||||||
bool _isLoggingOut = false;
|
bool _isLoggingOut = false;
|
||||||
|
bool _isSubmittingSignature = false;
|
||||||
|
bool _submitConfirmVisible = false;
|
||||||
|
string? _submitErrorMessage;
|
||||||
|
string? _capturedSignatureDateText;
|
||||||
|
readonly HashSet<int> _appliedSignatureFieldIndexes = [];
|
||||||
|
int? _currentSignatureNavFieldIndex;
|
||||||
|
PersistingComponentStateSubscription? _persistingSubscription;
|
||||||
|
|
||||||
// ----- Share popup state -----
|
// ----- Share popup state -----
|
||||||
bool _sharePopupVisible = false;
|
bool _sharePopupVisible = false;
|
||||||
@@ -501,6 +664,11 @@
|
|||||||
// ----- Lifecycle -----
|
// ----- Lifecycle -----
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
|
_persistingSubscription ??= PersistentComponentState.RegisterOnPersisting(PersistInitialStateAsync);
|
||||||
|
|
||||||
|
if (TryRestoreInitialState())
|
||||||
|
return;
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(EnvelopeKey))
|
if (string.IsNullOrWhiteSpace(EnvelopeKey))
|
||||||
{
|
{
|
||||||
_errorMessage = "Envelope-Schlüssel fehlt.";
|
_errorMessage = "Envelope-Schlüssel fehlt.";
|
||||||
@@ -514,24 +682,15 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Authorization — same pattern as EnvelopeReceiverPage
|
if (!await AuthService.CheckEnvelopeAccessAsync(EnvelopeKey))
|
||||||
_receiverUser = await ReceiverAuthorizationService.AuthorizeAsync(EnvelopeKey);
|
|
||||||
if (_receiverUser is null)
|
|
||||||
{
|
{
|
||||||
Navigation.NavigateTo($"/envelope/login/{Uri.EscapeDataString(EnvelopeKey)}");
|
Navigation.NavigateTo($"/envelope/login/{Uri.EscapeDataString(EnvelopeKey)}");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (await Mediator.IsSignedAsync(_receiverUser.EnvelopeUuid(), _receiverUser.ReceiverSignature()))
|
|
||||||
{
|
|
||||||
Navigation.NavigateTo("/envelope/signed-result", forceLoad: true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Load PDF bytes via MediatR (uses authenticated user's claims)
|
_pdfBytes = await DocumentService.GetDocumentAsync(EnvelopeKey);
|
||||||
_pdfBytes = await PageDataService.GetDocumentOfReceiverAsync(_receiverUser);
|
|
||||||
if (_pdfBytes is not { Length: > 0 })
|
if (_pdfBytes is not { Length: > 0 })
|
||||||
{
|
{
|
||||||
_errorMessage = "Dokument konnte nicht geladen werden: Keine Daten empfangen.";
|
_errorMessage = "Dokument konnte nicht geladen werden: Keine Daten empfangen.";
|
||||||
@@ -539,11 +698,9 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load signature fields for this receiver
|
_signatures = (await SignatureService.GetAsync(EnvelopeKey)).Convert(UnitOfLength.Point);
|
||||||
_signatures = await PageDataService.GetSignaturesAsync(_receiverUser);
|
|
||||||
|
|
||||||
// Load envelope receiver metadata
|
_envelopeReceiver = await EnvelopeReceiverService.GetAsync(EnvelopeKey);
|
||||||
_envelopeReceiver = await PageDataService.GetEnvelopeReceiverAsync(EnvelopeKey);
|
|
||||||
if (_envelopeReceiver is null)
|
if (_envelopeReceiver is null)
|
||||||
Logger.LogWarning("Envelope receiver data is null for {EnvelopeKey}", EnvelopeKey);
|
Logger.LogWarning("Envelope receiver data is null for {EnvelopeKey}", EnvelopeKey);
|
||||||
else if (IsRejected(_envelopeReceiver))
|
else if (IsRejected(_envelopeReceiver))
|
||||||
@@ -552,38 +709,17 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build initial report (no signature image yet)
|
_displayPdfBytes = _pdfBytes;
|
||||||
_report = BuildReport(_pdfBytes, _signatures, capturedSignature: null);
|
|
||||||
|
|
||||||
// Try to restore cached signature
|
_pagePreviews = (await PdfRenderService.RenderPagesAsync(_displayPdfBytes))
|
||||||
try
|
.OrderBy(p => p.PageNumber)
|
||||||
{
|
.ToList();
|
||||||
var cachedSignature = await PageDataService.GetCachedSignatureAsync(_receiverUser);
|
_pageCount = _pagePreviews.Count > 0 ? _pagePreviews.Count : 1;
|
||||||
if (cachedSignature is not null)
|
|
||||||
{
|
|
||||||
_capturedSignature = cachedSignature;
|
|
||||||
_signerFullName = cachedSignature.FullName;
|
|
||||||
_signerPosition = cachedSignature.Position;
|
|
||||||
_signaturePlace = cachedSignature.Place;
|
|
||||||
_signaturePopupVisible = false;
|
|
||||||
|
|
||||||
// Rebuild with cached signature overlaid
|
_activeSignatureTab = SignatureTabDraw;
|
||||||
_report = BuildReport(_pdfBytes, _signatures, _capturedSignature);
|
_signaturePopupVisible = false;
|
||||||
}
|
_popupValidationMessage = null;
|
||||||
else
|
EnsureActiveNavigableField();
|
||||||
{
|
|
||||||
_activeSignatureTab = SignatureTabDraw;
|
|
||||||
_signaturePopupVisible = false;
|
|
||||||
_popupValidationMessage = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Logger.LogWarning(ex, "Failed to load cached signature for {EnvelopeKey}", EnvelopeKey);
|
|
||||||
_activeSignatureTab = SignatureTabDraw;
|
|
||||||
_signaturePopupVisible = false;
|
|
||||||
_popupValidationMessage = null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -595,152 +731,194 @@
|
|||||||
await InvokeAsync(StateHasChanged);
|
await InvokeAsync(StateHasChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----- Report builder -----
|
bool TryRestoreInitialState()
|
||||||
static bool IsRejected(EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver.EnvelopeReceiverDto envelopeReceiver)
|
|
||||||
{
|
{
|
||||||
var status = envelopeReceiver.Envelope?.Status;
|
if (string.IsNullOrWhiteSpace(EnvelopeKey))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
var stateKey = InitialStateKeyPrefix + EnvelopeKey;
|
||||||
|
if (!PersistentComponentState.TryTakeFromJson<ReceiverPageInitialState>(stateKey, out var state) || state is null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
_envelopeReceiver = state.EnvelopeReceiver;
|
||||||
|
_signatures = state.Signatures ?? [];
|
||||||
|
_displayPdfBytes = state.DisplayPdfBytes;
|
||||||
|
_pagePreviews = state.PagePreviews ?? [];
|
||||||
|
_pageCount = state.PageCount > 0 ? state.PageCount : (_pagePreviews.Count > 0 ? _pagePreviews.Count : 1);
|
||||||
|
_errorMessage = null;
|
||||||
|
_isLoading = false;
|
||||||
|
EnsureActiveNavigableField();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Task PersistInitialStateAsync()
|
||||||
|
{
|
||||||
|
if (_isLoading || !string.IsNullOrWhiteSpace(_errorMessage) || string.IsNullOrWhiteSpace(EnvelopeKey))
|
||||||
|
return Task.CompletedTask;
|
||||||
|
|
||||||
|
var state = new ReceiverPageInitialState
|
||||||
|
{
|
||||||
|
EnvelopeReceiver = _envelopeReceiver,
|
||||||
|
Signatures = _signatures.ToList(),
|
||||||
|
DisplayPdfBytes = _displayPdfBytes,
|
||||||
|
PagePreviews = _pagePreviews,
|
||||||
|
PageCount = _pageCount
|
||||||
|
};
|
||||||
|
|
||||||
|
PersistentComponentState.PersistAsJson(InitialStateKeyPrefix + EnvelopeKey, state);
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----- Report builder -----
|
||||||
|
static bool IsRejected(EnvelopeReceiverDto envelopeReceiver)
|
||||||
|
{
|
||||||
|
var status = (EnvelopeStatus?)envelopeReceiver.Envelope?.Status;
|
||||||
if (status is EnvelopeStatus.DocumentRejected or EnvelopeStatus.EnvelopeRejected)
|
if (status is EnvelopeStatus.DocumentRejected or EnvelopeStatus.EnvelopeRejected)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return envelopeReceiver.Envelope?.Histories?.Any(h =>
|
return false;
|
||||||
h.Status is EnvelopeStatus.DocumentRejected or EnvelopeStatus.EnvelopeRejected) == true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Builds an XtraReport wrapping the PDF bytes.
|
|
||||||
/// If a signature is captured and there are signature fields, the signature image is
|
|
||||||
/// first burned into the PDF via DevExpress PdfDocumentProcessor, then the modified
|
|
||||||
/// PDF is handed to XRPdfContent with GenerateOwnPages = true so that all pages appear.
|
|
||||||
/// </summary>
|
|
||||||
static XtraReport BuildReport(
|
|
||||||
byte[] pdfBytes,
|
|
||||||
IReadOnlyList<SignatureDto> signatures,
|
|
||||||
SignatureCaptureDto? capturedSignature)
|
|
||||||
{
|
|
||||||
// Always draw placeholder boxes on signature fields so the user knows where to sign.
|
|
||||||
// When a captured signature exists, it will be applied in the Signed page instead.
|
|
||||||
byte[] sourcePdf = pdfBytes;
|
|
||||||
if (signatures.Count > 0)
|
|
||||||
{
|
|
||||||
sourcePdf = DrawSignaturePlaceholders(pdfBytes, signatures);
|
|
||||||
}
|
|
||||||
|
|
||||||
var report = new XtraReport
|
|
||||||
{
|
|
||||||
PaperKind = DevExpress.Drawing.Printing.DXPaperKind.A4,
|
|
||||||
Landscape = false,
|
|
||||||
Margins = new System.Drawing.Printing.Margins(0, 0, 0, 0),
|
|
||||||
};
|
|
||||||
|
|
||||||
var detail = new DetailBand { HeightF = 0f };
|
|
||||||
report.Bands.Add(detail);
|
|
||||||
|
|
||||||
detail.Controls.Add(new XRPdfContent
|
|
||||||
{
|
|
||||||
Source = sourcePdf,
|
|
||||||
GenerateOwnPages = true,
|
|
||||||
});
|
|
||||||
|
|
||||||
return report;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Uses PdfSharp to draw a visible signature placeholder box on every signature field.
|
|
||||||
/// sig.X / sig.Y come from GetSignaturesAsync(UnitOfLength.Point) → already in PDF points.
|
|
||||||
/// PdfSharp coordinate origin: bottom-left, Y up. Conversion: pdfY = pageH - sigY - sigH
|
|
||||||
/// Signature field size (fixed): 1.77" × 1.96" = 127.44pt × 141.12pt
|
|
||||||
/// </summary>
|
|
||||||
static byte[] DrawSignaturePlaceholders(
|
|
||||||
byte[] pdfBytes,
|
|
||||||
IReadOnlyList<SignatureDto> signatures)
|
|
||||||
{
|
|
||||||
if (signatures.Count == 0) return pdfBytes;
|
|
||||||
|
|
||||||
using var inputMs = new System.IO.MemoryStream(pdfBytes);
|
|
||||||
using var outputMs = new System.IO.MemoryStream();
|
|
||||||
|
|
||||||
var document = PdfSharp.Pdf.IO.PdfReader.Open(
|
|
||||||
inputMs,
|
|
||||||
PdfSharp.Pdf.IO.PdfDocumentOpenMode.Modify);
|
|
||||||
|
|
||||||
const double sigW = 1.77 * 72; // 127.44 pt
|
|
||||||
const double sigH = 1.96 * 72; // 141.12 pt
|
|
||||||
|
|
||||||
foreach (var sig in signatures)
|
|
||||||
{
|
|
||||||
int pageIndex = sig.Page - 1;
|
|
||||||
if (pageIndex < 0 || pageIndex >= document.PageCount) continue;
|
|
||||||
|
|
||||||
var page = document.Pages[pageIndex];
|
|
||||||
|
|
||||||
// PdfSharp XGraphics uses top-left origin, Y down — same as sig.X/sig.Y
|
|
||||||
// No coordinate conversion needed.
|
|
||||||
using var gfx = PdfSharp.Drawing.XGraphics.FromPdfPage(page);
|
|
||||||
|
|
||||||
var rect = new PdfSharp.Drawing.XRect(sig.X, sig.Y, sigW, sigH);
|
|
||||||
|
|
||||||
// Filled semi-transparent rectangle
|
|
||||||
var fillBrush = new PdfSharp.Drawing.XSolidBrush(
|
|
||||||
PdfSharp.Drawing.XColor.FromArgb(40, 60, 80, 160));
|
|
||||||
var borderPen = new PdfSharp.Drawing.XPen(
|
|
||||||
PdfSharp.Drawing.XColor.FromArgb(200, 60, 80, 200), 1.5);
|
|
||||||
|
|
||||||
gfx.DrawRectangle(fillBrush, rect);
|
|
||||||
gfx.DrawRectangle(borderPen, rect);
|
|
||||||
|
|
||||||
// "UNTERSCHRIFT" label centred in the box
|
|
||||||
var font = new PdfSharp.Drawing.XFont("Arial", 9,
|
|
||||||
PdfSharp.Drawing.XFontStyleEx.Bold);
|
|
||||||
var textBrush = new PdfSharp.Drawing.XSolidBrush(
|
|
||||||
PdfSharp.Drawing.XColor.FromArgb(200, 40, 60, 140));
|
|
||||||
|
|
||||||
var textFmt = new PdfSharp.Drawing.XStringFormat
|
|
||||||
{
|
|
||||||
Alignment = PdfSharp.Drawing.XStringAlignment.Center,
|
|
||||||
LineAlignment = PdfSharp.Drawing.XLineAlignment.Center,
|
|
||||||
};
|
|
||||||
gfx.DrawString("UNTERSCHRIFT", font, textBrush, rect, textFmt);
|
|
||||||
}
|
|
||||||
|
|
||||||
document.Save(outputMs);
|
|
||||||
return outputMs.ToArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>Converts a base64 data URL (data:image/...;base64,...) to raw bytes.</summary>
|
|
||||||
static byte[]? DataUrlToBytes(string dataUrl)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var commaIndex = dataUrl.IndexOf(',');
|
|
||||||
if (commaIndex < 0) return null;
|
|
||||||
return Convert.FromBase64String(dataUrl[(commaIndex + 1)..]);
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----- Signature popup handlers -----
|
// ----- Signature popup handlers -----
|
||||||
void OpenSignaturePopup()
|
void OpenSignaturePopup(bool keepPendingField = false)
|
||||||
{
|
{
|
||||||
_activeSignatureTab = SignatureTabDraw;
|
if (!keepPendingField)
|
||||||
|
_pendingSignatureFieldIndex = null;
|
||||||
|
|
||||||
|
_activeSignatureTab = _capturedSignature is null ? SignatureTabDraw : _lastSavedSignatureTab;
|
||||||
_signaturePopupVisible = true;
|
_signaturePopupVisible = true;
|
||||||
_popupValidationMessage = null;
|
_popupValidationMessage = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OpenSubmitConfirmPopup()
|
||||||
|
{
|
||||||
|
if (_capturedSignature is null || _isSubmittingSignature)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!AllSignatureFieldsApplied)
|
||||||
|
{
|
||||||
|
_submitErrorMessage = "Bitte klicken Sie auf jedes Unterschrift-Feld im Dokument.";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_submitErrorMessage = null;
|
||||||
|
_submitConfirmVisible = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
async Task OnSignatureFieldClickAsync(int fieldIndex)
|
||||||
|
{
|
||||||
|
if (_isSubmittingSignature)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (_capturedSignature is null)
|
||||||
|
{
|
||||||
|
_currentSignatureNavFieldIndex = fieldIndex;
|
||||||
|
_pendingSignatureFieldIndex = fieldIndex;
|
||||||
|
OpenSignaturePopup(keepPendingField: true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fieldIndex < 0 || fieldIndex >= _signatures.Count)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (_appliedSignatureFieldIndexes.Add(fieldIndex))
|
||||||
|
await InvokeAsync(StateHasChanged);
|
||||||
|
}
|
||||||
|
|
||||||
|
Task GoToNextSignatureAsync()
|
||||||
|
{
|
||||||
|
var indexes = NavigableSignatureIndexes;
|
||||||
|
if (indexes.Count == 0)
|
||||||
|
return Task.CompletedTask;
|
||||||
|
|
||||||
|
if (!_currentSignatureNavFieldIndex.HasValue || !indexes.Contains(_currentSignatureNavFieldIndex.Value))
|
||||||
|
{
|
||||||
|
_currentSignatureNavFieldIndex = indexes[0];
|
||||||
|
return InvokeAsync(StateHasChanged);
|
||||||
|
}
|
||||||
|
|
||||||
|
var currentIndex = indexes.IndexOf(_currentSignatureNavFieldIndex.Value);
|
||||||
|
_currentSignatureNavFieldIndex = indexes[(currentIndex + 1) % indexes.Count];
|
||||||
|
return InvokeAsync(StateHasChanged);
|
||||||
|
}
|
||||||
|
|
||||||
|
Task GoToPreviousSignatureAsync()
|
||||||
|
{
|
||||||
|
var indexes = NavigableSignatureIndexes;
|
||||||
|
if (indexes.Count == 0)
|
||||||
|
return Task.CompletedTask;
|
||||||
|
|
||||||
|
if (!_currentSignatureNavFieldIndex.HasValue || !indexes.Contains(_currentSignatureNavFieldIndex.Value))
|
||||||
|
{
|
||||||
|
_currentSignatureNavFieldIndex = indexes[0];
|
||||||
|
return InvokeAsync(StateHasChanged);
|
||||||
|
}
|
||||||
|
|
||||||
|
var currentIndex = indexes.IndexOf(_currentSignatureNavFieldIndex.Value);
|
||||||
|
_currentSignatureNavFieldIndex = indexes[(currentIndex - 1 + indexes.Count) % indexes.Count];
|
||||||
|
return InvokeAsync(StateHasChanged);
|
||||||
|
}
|
||||||
|
|
||||||
async Task OnPopupShownAsync()
|
async Task OnPopupShownAsync()
|
||||||
{
|
{
|
||||||
await InitializeActiveSignatureTabAsync();
|
await InitializeActiveSignatureTabAsync();
|
||||||
|
await RestoreDrawSignatureIfAvailableAsync();
|
||||||
|
await RestoreImageSignatureIfAvailableAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
async Task SetSignatureTabAsync(string tab)
|
async Task SetSignatureTabAsync(string tab)
|
||||||
{
|
{
|
||||||
|
if (_activeSignatureTab == tab)
|
||||||
|
return;
|
||||||
|
|
||||||
|
await ClearSignatureTabStateAsync(_activeSignatureTab);
|
||||||
|
|
||||||
_activeSignatureTab = tab;
|
_activeSignatureTab = tab;
|
||||||
_popupValidationMessage = null;
|
_popupValidationMessage = null;
|
||||||
await InvokeAsync(StateHasChanged);
|
await InvokeAsync(StateHasChanged);
|
||||||
await Task.Delay(50);
|
await Task.Delay(50);
|
||||||
await InitializeActiveSignatureTabAsync();
|
await InitializeActiveSignatureTabAsync();
|
||||||
|
await RestoreDrawSignatureIfAvailableAsync();
|
||||||
|
await RestoreImageSignatureIfAvailableAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
async Task ClearSignatureTabStateAsync(string tab)
|
||||||
|
{
|
||||||
|
if (tab == SignatureTabDraw)
|
||||||
|
{
|
||||||
|
await JSRuntime.InvokeVoidAsync("receiverSignature.clear", DrawCanvasId);
|
||||||
|
}
|
||||||
|
else if (tab == SignatureTabText)
|
||||||
|
{
|
||||||
|
_typedSignatureText = string.Empty;
|
||||||
|
await JSRuntime.InvokeVoidAsync("receiverSignature.clearTyped", TypedCanvasId);
|
||||||
|
}
|
||||||
|
else if (tab == SignatureTabImage)
|
||||||
|
{
|
||||||
|
_savedImageFileName = string.Empty;
|
||||||
|
await JSRuntime.InvokeVoidAsync("receiverSignature.clearImage", ImageInputId, ImageCanvasId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async Task RestoreDrawSignatureIfAvailableAsync()
|
||||||
|
{
|
||||||
|
if (_activeSignatureTab != SignatureTabDraw ||
|
||||||
|
_capturedSignature is null ||
|
||||||
|
_lastSavedSignatureTab != SignatureTabDraw)
|
||||||
|
return;
|
||||||
|
|
||||||
|
await JSRuntime.InvokeVoidAsync("receiverSignature.loadExistingSignature", DrawCanvasId, _capturedSignature.DataUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
async Task RestoreImageSignatureIfAvailableAsync()
|
||||||
|
{
|
||||||
|
if (_activeSignatureTab != SignatureTabImage ||
|
||||||
|
_capturedSignature is null ||
|
||||||
|
_lastSavedSignatureTab != SignatureTabImage)
|
||||||
|
return;
|
||||||
|
|
||||||
|
await JSRuntime.InvokeVoidAsync("receiverSignature.loadExistingImageSignature", ImageCanvasId, _capturedSignature.DataUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
async Task InitializeActiveSignatureTabAsync()
|
async Task InitializeActiveSignatureTabAsync()
|
||||||
@@ -767,7 +945,10 @@
|
|||||||
await JSRuntime.InvokeVoidAsync("receiverSignature.clearTyped", TypedCanvasId);
|
await JSRuntime.InvokeVoidAsync("receiverSignature.clearTyped", TypedCanvasId);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
_savedImageFileName = string.Empty;
|
||||||
await JSRuntime.InvokeVoidAsync("receiverSignature.clearImage", ImageInputId, ImageCanvasId);
|
await JSRuntime.InvokeVoidAsync("receiverSignature.clearImage", ImageInputId, ImageCanvasId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async Task OnTypedSignatureChanged(Microsoft.AspNetCore.Components.ChangeEventArgs args)
|
async Task OnTypedSignatureChanged(Microsoft.AspNetCore.Components.ChangeEventArgs args)
|
||||||
@@ -790,6 +971,8 @@
|
|||||||
|
|
||||||
async Task SaveSignatureAsync()
|
async Task SaveSignatureAsync()
|
||||||
{
|
{
|
||||||
|
var hadExistingSignature = _capturedSignature is not null;
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(_signerFullName))
|
if (string.IsNullOrWhiteSpace(_signerFullName))
|
||||||
{
|
{
|
||||||
_popupValidationMessage = "Bitte geben Sie Vor- und Nachname ein.";
|
_popupValidationMessage = "Bitte geben Sie Vor- und Nachname ein.";
|
||||||
@@ -816,27 +999,88 @@
|
|||||||
Position = _signerPosition.Trim(),
|
Position = _signerPosition.Trim(),
|
||||||
Place = _signaturePlace.Trim(),
|
Place = _signaturePlace.Trim(),
|
||||||
};
|
};
|
||||||
|
_capturedSignatureDateText = DateTime.Now.ToString("dd.MM.yyyy");
|
||||||
|
|
||||||
|
if (_activeSignatureTab == SignatureTabImage)
|
||||||
|
{
|
||||||
|
var selectedImageFileName = await JSRuntime.InvokeAsync<string?>("receiverSignature.getSelectedImageFileName", ImageInputId);
|
||||||
|
if (!string.IsNullOrWhiteSpace(selectedImageFileName))
|
||||||
|
_savedImageFileName = selectedImageFileName;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
_savedImageFileName = string.Empty;
|
||||||
|
|
||||||
|
_lastSavedSignatureTab = _activeSignatureTab;
|
||||||
|
if (!hadExistingSignature)
|
||||||
|
{
|
||||||
|
_appliedSignatureFieldIndexes.Clear();
|
||||||
|
if (_pendingSignatureFieldIndex is int pendingFieldIndex &&
|
||||||
|
pendingFieldIndex >= 0 &&
|
||||||
|
pendingFieldIndex < _signatures.Count)
|
||||||
|
{
|
||||||
|
_appliedSignatureFieldIndexes.Add(pendingFieldIndex);
|
||||||
|
_currentSignatureNavFieldIndex = pendingFieldIndex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
EnsureActiveNavigableField();
|
||||||
|
|
||||||
|
_pendingSignatureFieldIndex = null;
|
||||||
|
_submitErrorMessage = null;
|
||||||
_signaturePopupVisible = false;
|
_signaturePopupVisible = false;
|
||||||
|
|
||||||
// Store signature in IMemoryCache with a Guid key (1 minute TTL)
|
|
||||||
var sid = Guid.NewGuid().ToString("N");
|
|
||||||
MemoryCache.Set(
|
|
||||||
sid,
|
|
||||||
_capturedSignature,
|
|
||||||
TimeSpan.FromMinutes(1));
|
|
||||||
|
|
||||||
Logger.LogInformation(
|
|
||||||
"Signature cached with sid={Sid} for envelope {EnvelopeKey}", sid, EnvelopeKey);
|
|
||||||
|
|
||||||
// Null the report → DxReportViewer removed from DOM → no crash on dispose
|
|
||||||
_report = null;
|
|
||||||
await InvokeAsync(StateHasChanged);
|
await InvokeAsync(StateHasChanged);
|
||||||
await Task.Delay(50);
|
}
|
||||||
|
|
||||||
// Navigate — forceLoad:true for clean circuit teardown
|
bool SignaturePopupVisible
|
||||||
Navigation.NavigateTo(
|
{
|
||||||
$"/envelope/{Uri.EscapeDataString(EnvelopeKey!)}/signed?sid={sid}",
|
get => _signaturePopupVisible;
|
||||||
forceLoad: true);
|
set
|
||||||
|
{
|
||||||
|
_signaturePopupVisible = value;
|
||||||
|
if (!value)
|
||||||
|
_pendingSignatureFieldIndex = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async Task SubmitAndLogoutAsync()
|
||||||
|
{
|
||||||
|
if (_isSubmittingSignature)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(EnvelopeKey) || _capturedSignature is null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
_isSubmittingSignature = true;
|
||||||
|
_submitConfirmVisible = false;
|
||||||
|
_submitErrorMessage = null;
|
||||||
|
await InvokeAsync(StateHasChanged);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (_signatures.Count == 0)
|
||||||
|
throw new InvalidOperationException("No signature fields found for receiver.");
|
||||||
|
|
||||||
|
var payload = _signatures.Select(field => new SignatureSubmitDto
|
||||||
|
{
|
||||||
|
Id = field.Id,
|
||||||
|
DataUrl = _capturedSignature.DataUrl,
|
||||||
|
FullName = _capturedSignature.FullName,
|
||||||
|
Position = string.IsNullOrWhiteSpace(_capturedSignature.Position) ? null : _capturedSignature.Position,
|
||||||
|
Place = _capturedSignature.Place
|
||||||
|
}).ToList();
|
||||||
|
|
||||||
|
await SignatureService.SubmitAsync(EnvelopeKey, payload);
|
||||||
|
|
||||||
|
await AuthService.LogoutEnvelopeReceiverAsync(EnvelopeKey);
|
||||||
|
Navigation.NavigateTo("/envelope/signed-result", forceLoad: true);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logger.LogError(ex, "Failed to finalize signature for {EnvelopeKey}", EnvelopeKey);
|
||||||
|
_submitErrorMessage = "Die Unterschrift konnte nicht abgeschlossen werden. Bitte versuchen Sie es erneut.";
|
||||||
|
_isSubmittingSignature = false;
|
||||||
|
await InvokeAsync(StateHasChanged);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenRejectPopup()
|
void OpenRejectPopup()
|
||||||
@@ -903,9 +1147,40 @@
|
|||||||
return await JSRuntime.InvokeAsync<string?>("receiverSignature.getImageDataUrl", ImageCanvasId);
|
return await JSRuntime.InvokeAsync<string?>("receiverSignature.getImageDataUrl", ImageCanvasId);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----- Disposal -----
|
string L(string key, string fallback)
|
||||||
|
{
|
||||||
|
var value = UiLocalizer[key];
|
||||||
|
return value.ResourceNotFound ? fallback : value.Value;
|
||||||
|
}
|
||||||
|
|
||||||
|
void EnsureActiveNavigableField()
|
||||||
|
{
|
||||||
|
var indexes = NavigableSignatureIndexes;
|
||||||
|
if (indexes.Count == 0)
|
||||||
|
{
|
||||||
|
_currentSignatureNavFieldIndex = null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_currentSignatureNavFieldIndex.HasValue && indexes.Contains(_currentSignatureNavFieldIndex.Value))
|
||||||
|
return;
|
||||||
|
|
||||||
|
_currentSignatureNavFieldIndex = indexes[0];
|
||||||
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
_report?.Dispose();
|
_persistingSubscription?.Dispose();
|
||||||
|
_persistingSubscription = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sealed class ReceiverPageInitialState
|
||||||
|
{
|
||||||
|
public EnvelopeReceiverDto? EnvelopeReceiver { get; set; }
|
||||||
|
public List<SignatureDto> Signatures { get; set; } = [];
|
||||||
|
public byte[]? DisplayPdfBytes { get; set; }
|
||||||
|
public List<PdfPageImageDto> PagePreviews { get; set; } = [];
|
||||||
|
public int PageCount { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
@page "/envelope/{EnvelopeKey}/rejected"
|
@page "/envelope/{EnvelopeKey}/rejected"
|
||||||
@rendermode InteractiveServer
|
@rendermode InteractiveWebAssembly
|
||||||
@using EnvelopeGenerator.Application.Resources
|
@using EnvelopeGenerator.Application.Resources
|
||||||
@using EnvelopeGenerator.Domain.Constants
|
@using EnvelopeGenerator.Domain.Constants
|
||||||
@using EnvelopeGenerator.Domain.Interfaces
|
@using EnvelopeGenerator.Server.Client.Models
|
||||||
@using Microsoft.Extensions.Localization
|
@using Microsoft.Extensions.Localization
|
||||||
@inject NavigationManager Navigation
|
@inject NavigationManager Navigation
|
||||||
@inject EnvelopeGenerator.Server.Services.EnvelopeReceiverAuthorizationService ReceiverAuthorizationService
|
@inject EnvelopeGenerator.Server.Client.Services.AuthService AuthService
|
||||||
@inject EnvelopeGenerator.Server.Services.EnvelopeReceiverPageDataService PageDataService
|
@inject EnvelopeGenerator.Server.Client.Services.EnvelopeReceiverService EnvelopeReceiverService
|
||||||
@inject IStringLocalizer<Resource> UiLocalizer
|
@inject IStringLocalizer<Resource> UiLocalizer
|
||||||
|
|
||||||
<div class="envelope-viewer-layout" style="justify-content: center; align-items: center; padding: 1.5rem;">
|
<div class="envelope-viewer-layout" style="justify-content: center; align-items: center; padding: 1.5rem;">
|
||||||
@@ -55,14 +55,13 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var user = await ReceiverAuthorizationService.AuthorizeAsync(EnvelopeKey);
|
if (!await AuthService.CheckEnvelopeAccessAsync(EnvelopeKey))
|
||||||
if (user is null)
|
|
||||||
{
|
{
|
||||||
Navigation.NavigateTo($"/envelope/login/{Uri.EscapeDataString(EnvelopeKey)}");
|
Navigation.NavigateTo($"/envelope/login/{Uri.EscapeDataString(EnvelopeKey)}");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var envelopeReceiver = await PageDataService.GetEnvelopeReceiverAsync(EnvelopeKey);
|
var envelopeReceiver = await EnvelopeReceiverService.GetAsync(EnvelopeKey);
|
||||||
if (envelopeReceiver is null)
|
if (envelopeReceiver is null)
|
||||||
{
|
{
|
||||||
Navigation.NavigateTo($"/envelope/{Uri.EscapeDataString(EnvelopeKey)}", forceLoad: true);
|
Navigation.NavigateTo($"/envelope/{Uri.EscapeDataString(EnvelopeKey)}", forceLoad: true);
|
||||||
@@ -75,11 +74,9 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_isReadAndConfirm = envelopeReceiver.Envelope?.IsReadAndConfirm() ?? false;
|
_isReadAndConfirm = false;
|
||||||
|
|
||||||
var senderName = envelopeReceiver.Envelope?.User is null
|
var senderName = envelopeReceiver.Envelope?.User?.FullName ?? string.Empty;
|
||||||
? string.Empty
|
|
||||||
: $"{envelopeReceiver.Envelope.User.Prename} {envelopeReceiver.Envelope.User.Name}".Trim();
|
|
||||||
var senderEmail = envelopeReceiver.Envelope?.User?.Email ?? string.Empty;
|
var senderEmail = envelopeReceiver.Envelope?.User?.Email ?? string.Empty;
|
||||||
var envelopeTitle = envelopeReceiver.Envelope?.Title ?? string.Empty;
|
var envelopeTitle = envelopeReceiver.Envelope?.Title ?? string.Empty;
|
||||||
|
|
||||||
@@ -87,14 +84,13 @@
|
|||||||
_messageLine2 = string.Format(template, senderName, senderEmail, envelopeTitle);
|
_messageLine2 = string.Format(template, senderName, senderEmail, envelopeTitle);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool IsRejected(EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver.EnvelopeReceiverDto envelopeReceiver)
|
static bool IsRejected(EnvelopeReceiverDto envelopeReceiver)
|
||||||
{
|
{
|
||||||
var status = envelopeReceiver.Envelope?.Status;
|
var status = (EnvelopeStatus?)envelopeReceiver.Envelope?.Status;
|
||||||
if (status is EnvelopeStatus.DocumentRejected or EnvelopeStatus.EnvelopeRejected)
|
if (status is EnvelopeStatus.DocumentRejected or EnvelopeStatus.EnvelopeRejected)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return envelopeReceiver.Envelope?.Histories?.Any(h =>
|
return false;
|
||||||
h.Status is EnvelopeStatus.DocumentRejected or EnvelopeStatus.EnvelopeRejected) == true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
string L(string key, string fallback)
|
string L(string key, string fallback)
|
||||||
@@ -7,11 +7,13 @@
|
|||||||
@using EnvelopeGenerator.Application.Resources
|
@using EnvelopeGenerator.Application.Resources
|
||||||
@using EnvelopeGenerator.Domain.Constants
|
@using EnvelopeGenerator.Domain.Constants
|
||||||
@using EnvelopeGenerator.Domain.Resources
|
@using EnvelopeGenerator.Domain.Resources
|
||||||
|
@using EnvelopeGenerator.Application.Common.Configurations
|
||||||
@using EnvelopeGenerator.Server.Client.Components.PdfEditor
|
@using EnvelopeGenerator.Server.Client.Components.PdfEditor
|
||||||
@using EnvelopeGenerator.Server.Client.Services
|
@using EnvelopeGenerator.Server.Client.Services
|
||||||
@using Microsoft.AspNetCore.WebUtilities
|
|
||||||
@using Microsoft.AspNetCore.Components.Forms
|
@using Microsoft.AspNetCore.Components.Forms
|
||||||
@using Microsoft.Extensions.Localization
|
@using Microsoft.Extensions.Localization
|
||||||
|
@using Microsoft.Extensions.Options
|
||||||
|
@using EnvelopeGenerator.Domain.Interfaces
|
||||||
@inject IJSRuntime JSRuntime
|
@inject IJSRuntime JSRuntime
|
||||||
@inject NavigationManager NavigationManager
|
@inject NavigationManager NavigationManager
|
||||||
@inject AppVersionService AppVersion
|
@inject AppVersionService AppVersion
|
||||||
@@ -19,23 +21,19 @@
|
|||||||
@inject DocumentService DocumentService
|
@inject DocumentService DocumentService
|
||||||
@inject PdfRenderService PdfRenderService
|
@inject PdfRenderService PdfRenderService
|
||||||
@inject ReceiverService ReceiverService
|
@inject ReceiverService ReceiverService
|
||||||
|
@inject EnvelopeReceiverService EnvelopeReceiverService
|
||||||
@inject EnvelopeService EnvelopeService
|
@inject EnvelopeService EnvelopeService
|
||||||
@inject EnvelopeTypeService EnvelopeTypeService
|
@inject EnvelopeTypeService EnvelopeTypeService
|
||||||
@inject CreateEnvelopeBootstrapStorageService CreateEnvelopeBootstrapStorageService
|
|
||||||
@inject AuthService AuthService
|
@inject AuthService AuthService
|
||||||
@inject IStringLocalizer<Resource> UiLocalizer
|
@inject IStringLocalizer<Resource> UiLocalizer
|
||||||
@inject IStringLocalizer<Model> ModelLocalizer
|
@inject IStringLocalizer<Model> ModelLocalizer
|
||||||
|
@inject IOptionsMonitor<SignatureFieldParams> SignatureFieldOptions
|
||||||
|
|
||||||
<link href="_content/DevExpress.Blazor.Themes/blazing-berry.bs5.min.css" rel="stylesheet" />
|
<link href="_content/DevExpress.Blazor.Themes/blazing-berry.bs5.min.css" rel="stylesheet" />
|
||||||
<link href="_content/DevExpress.Blazor.Viewer/css/dx-blazor-viewer-components.bs5.css" rel="stylesheet" />
|
<link href="_content/DevExpress.Blazor.Viewer/css/dx-blazor-viewer-components.bs5.css" rel="stylesheet" />
|
||||||
<link href="@AppVersion.GetVersionedUrl("css/envelope-viewer.css")" rel="stylesheet" />
|
<link href="@AppVersion.GetVersionedUrl("css/envelope-viewer.css")" rel="stylesheet" />
|
||||||
<script src="@AppVersion.GetVersionedUrl("js/envelope-editor.js")"></script>
|
<script src="@AppVersion.GetVersionedUrl("js/envelope-editor.js")"></script>
|
||||||
|
|
||||||
<DxLoadingPanel Visible="@IsBootstrapLoading"
|
|
||||||
IsContentBlocked="true"
|
|
||||||
ApplyBackgroundShading="true"
|
|
||||||
IndicatorAreaVisible="true"
|
|
||||||
Text='@L("SenderEditor_BootstrapLoadingHint", "Der Umschlag wird vorbereitet und die Daten werden uebernommen.")'>
|
|
||||||
<div class="envelope-viewer-layout">
|
<div class="envelope-viewer-layout">
|
||||||
|
|
||||||
@* ── Action Bar ── *@
|
@* ── Action Bar ── *@
|
||||||
@@ -102,7 +100,7 @@
|
|||||||
<div class="sender-settings-grid">
|
<div class="sender-settings-grid">
|
||||||
<div class="sender-settings-field">
|
<div class="sender-settings-field">
|
||||||
<label class="sender-settings-label">@L("EnvelopeType", "Umschlagtyp")</label>
|
<label class="sender-settings-label">@L("EnvelopeType", "Umschlagtyp")</label>
|
||||||
<select value="@(_selectedEnvelopeTypeId?.ToString() ?? string.Empty)"
|
<select value="@(_selectedType?.ToString() ?? string.Empty)"
|
||||||
@onchange="OnEnvelopeTypeChanged"
|
@onchange="OnEnvelopeTypeChanged"
|
||||||
class="sender-settings-select">
|
class="sender-settings-select">
|
||||||
<option value="">@L("SenderEditor_SelectTemplate", "Vorlage auswählen")</option>
|
<option value="">@L("SenderEditor_SelectTemplate", "Vorlage auswählen")</option>
|
||||||
@@ -123,15 +121,6 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="sender-settings-field">
|
|
||||||
<label class="sender-settings-label">@L("CertificationType", "Zertifizierung")</label>
|
|
||||||
<select @bind="_certificationType" class="sender-settings-select">
|
|
||||||
<option value="1">@L("AdvancedElectronicSignature", "Advanced Electronic Signature")</option>
|
|
||||||
<option value="2">@L("ElectronicSignature", "Electronic Signature")</option>
|
|
||||||
<option value="3">@L("QualifiedSignature", "Qualified Signature")</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="sender-settings-toggles">
|
<div class="sender-settings-toggles">
|
||||||
<label class="sender-settings-toggle">
|
<label class="sender-settings-toggle">
|
||||||
<input type="checkbox" checked="@_tfaEnabled" @onchange="OnTfaChanged" />
|
<input type="checkbox" checked="@_tfaEnabled" @onchange="OnTfaChanged" />
|
||||||
@@ -145,19 +134,25 @@
|
|||||||
|
|
||||||
<div class="sender-settings-field">
|
<div class="sender-settings-field">
|
||||||
<label class="sender-settings-label">@L("FinalEmailToCreator", "Finale E-Mail an Ersteller")</label>
|
<label class="sender-settings-label">@L("FinalEmailToCreator", "Finale E-Mail an Ersteller")</label>
|
||||||
<select @bind="_finalEmailToCreator" class="sender-settings-select">
|
<select id="sender-editor-final-email-to-creator"
|
||||||
<option value="0">@L("No", "Nein")</option>
|
name="sender-editor-final-email-to-creator"
|
||||||
<option value="1">@L("Yes", "Ja")</option>
|
@bind="_finalEmailToCreator"
|
||||||
<option value="2">@L("YesWithAttachment", "Ja, mit Anhang")</option>
|
class="sender-settings-select">
|
||||||
|
<option value="@FinalEmailType.No">@L("No", "Nein")</option>
|
||||||
|
<option value="@FinalEmailType.Yes">@L("Yes", "Ja")</option>
|
||||||
|
<option value="@FinalEmailType.YesWithAttachment">@L("YesWithAttachment", "Ja, mit Anhang")</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="sender-settings-field">
|
<div class="sender-settings-field">
|
||||||
<label class="sender-settings-label">@L("FinalEmailToReceivers", "Finale E-Mail an Empfänger")</label>
|
<label class="sender-settings-label">@L("FinalEmailToReceivers", "Finale E-Mail an Empfänger")</label>
|
||||||
<select @bind="_finalEmailToReceivers" class="sender-settings-select">
|
<select id="sender-editor-final-email-to-receivers"
|
||||||
<option value="0">@L("No", "Nein")</option>
|
name="sender-editor-final-email-to-receivers"
|
||||||
<option value="1">@L("Yes", "Ja")</option>
|
@bind="_finalEmailToReceivers"
|
||||||
<option value="2">@L("YesWithAttachment", "Ja, mit Anhang")</option>
|
class="sender-settings-select">
|
||||||
|
<option value="@FinalEmailType.No">@L("No", "Nein")</option>
|
||||||
|
<option value="@FinalEmailType.Yes">@L("Yes", "Ja")</option>
|
||||||
|
<option value="@FinalEmailType.YesWithAttachment">@L("YesWithAttachment", "Ja, mit Anhang")</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -196,20 +191,43 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="sender-receivers-panel">
|
<div class="sender-receivers-panel">
|
||||||
<div class="sender-receivers-panel__header">
|
<div class="sender-receivers-list">
|
||||||
<div class="sender-receivers-panel__title-wrap">
|
<button class="pdf-toolbar__btn pdf-toolbar__btn--signature-change sender-toolbar-action-btn sender-receivers-list__add-btn"
|
||||||
<span class="sender-receivers-panel__title">@L("Receiver", "Empfänger")</span>
|
|
||||||
<span class="sender-receivers-panel__count">@_receivers.Count</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="pdf-toolbar__btn pdf-toolbar__btn--signature-change sender-toolbar-action-btn"
|
|
||||||
@onclick="OpenAddReceiverPopup"
|
@onclick="OpenAddReceiverPopup"
|
||||||
title='@L("AddReceiver", "Empfänger hinzufügen")'>
|
title='@L("AddReceiver", "Empfänger hinzufügen")'>
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="currentColor" viewBox="0 0 16 16">
|
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="currentColor" viewBox="0 0 16 16">
|
||||||
<path d="M8 1a.5.5 0 0 1 .5.5v6h6a.5.5 0 0 1 0 1h-6v6a.5.5 0 0 1-1 0v-6h-6a.5.5 0 0 1 0-1h6v-6A.5.5 0 0 1 8 1z" />
|
<path d="M8 1a.5.5 0 0 1 .5.5v6h6a.5.5 0 0 1 0 1h-6v6a.5.5 0 0 1-1 0v-6h-6a.5.5 0 0 1 0-1h6v-6A.5.5 0 0 1 8 1z" />
|
||||||
</svg>
|
</svg>
|
||||||
<span class="pdf-toolbar__btn-text">@L("AddReceiver", "Empfänger hinzufügen")</span>
|
<span class="sender-receivers-list__add-text">@L("AddReceiver", "Empfänger hinzufügen")</span>
|
||||||
|
<span class="badge rounded-pill text-bg-primary sender-receivers-list__count">@_receivers.Count</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
@foreach (var receiver in _receivers)
|
||||||
|
{
|
||||||
|
<div class="sender-receiver-chip" style="--receiver-color:@receiver.Color;">
|
||||||
|
<div class="sender-receiver-chip__body">
|
||||||
|
<div class="sender-receiver-chip__email" title="@receiver.FullName">@receiver.Email</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button class="pdf-toolbar__btn pdf-toolbar__btn--reset sender-toolbar-action-btn sender-toolbar-action-btn--compact sender-receiver-chip__action sender-receiver-chip__remove-btn"
|
||||||
|
@onclick="() => RemoveReceiverAsync(receiver)"
|
||||||
|
title='@L("Delete", "Loeschen")'>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="currentColor" viewBox="0 0 16 16">
|
||||||
|
<path d="M4 4L12 12M12 4L4 12" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<button class="pdf-toolbar__btn pdf-toolbar__btn--signature-change sender-toolbar-action-btn sender-toolbar-action-btn--compact sender-receiver-chip__action sender-receiver-chip__place-btn
|
||||||
|
@(_pendingReceiverForPlacement?.Id == receiver.Id ? "sender-receiver-chip__place-btn--active" : "sender-receiver-chip__place-btn--idle")"
|
||||||
|
@onclick="() => ActivatePlacementForReceiver(receiver)"
|
||||||
|
style="--receiver-color:@receiver.Color;"
|
||||||
|
title='@L("SenderEditor_PlaceSignatureField", "Signaturfeld platzieren")'>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="currentColor" viewBox="0 0 16 16">
|
||||||
|
<path d="M12.146.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168l10-10z" />
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@if (_receivers.Count == 0)
|
@if (_receivers.Count == 0)
|
||||||
@@ -218,35 +236,6 @@
|
|||||||
@L("SenderEditor_NoReceiversAdded", "Noch keine Empfänger hinzugefügt.")
|
@L("SenderEditor_NoReceiversAdded", "Noch keine Empfänger hinzugefügt.")
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
<div class="sender-receivers-list">
|
|
||||||
@foreach (var receiver in _receivers)
|
|
||||||
{
|
|
||||||
<div class="sender-receiver-chip" style="--receiver-color:@receiver.Color;">
|
|
||||||
<div class="sender-receiver-chip__body">
|
|
||||||
<div class="sender-receiver-chip__name">@receiver.FullName</div>
|
|
||||||
<div class="sender-receiver-chip__email">@receiver.Email</div>
|
|
||||||
@if (!string.IsNullOrWhiteSpace(receiver.PhoneNumber))
|
|
||||||
{
|
|
||||||
<div class="sender-receiver-chip__phone">@receiver.PhoneNumber</div>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="pdf-toolbar__btn pdf-toolbar__btn--signature-change sender-toolbar-action-btn sender-toolbar-action-btn--compact sender-receiver-chip__place-btn
|
|
||||||
@(_pendingReceiverForPlacement?.Id == receiver.Id ? "sender-receiver-chip__place-btn--active" : "sender-receiver-chip__place-btn--idle")"
|
|
||||||
@onclick="() => ActivatePlacementForReceiver(receiver)"
|
|
||||||
style="--receiver-color:@receiver.Color;"
|
|
||||||
title='@L("SenderEditor_PlaceSignatureField", "Signaturfeld platzieren")'>
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="currentColor" viewBox="0 0 16 16">
|
|
||||||
<path d="M12.146.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168l10-10z" />
|
|
||||||
</svg>
|
|
||||||
<span class="pdf-toolbar__btn-text">@L("SenderEditor_AddSignature", "Signatur hinzufügen")</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -299,12 +288,13 @@
|
|||||||
@if (_pdfLoaded && _signatureFields.Count > 0)
|
@if (_pdfLoaded && _signatureFields.Count > 0)
|
||||||
{
|
{
|
||||||
<button class="pdf-toolbar__btn pdf-toolbar__btn--reset"
|
<button class="pdf-toolbar__btn pdf-toolbar__btn--reset"
|
||||||
@onclick="ClearAllFieldsAsync"
|
@onclick='() => _clearFieldsConfirmVisible = true'
|
||||||
title='@L("SenderEditor_RemoveAllSignatureFields", "Alle Signaturfelder entfernen")'>
|
title='@L("SenderEditor_RemoveAllSignatureFields", "Alle Signaturfelder entfernen")'>
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="currentColor" viewBox="0 0 16 16">
|
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="currentColor" viewBox="0 0 16 16">
|
||||||
<path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z" />
|
<path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z" />
|
||||||
<path fill-rule="evenodd" d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1 0-2h3a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1h3a1 1 0 0 1 1 1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3h11V2h-11v1z" />
|
<path fill-rule="evenodd" d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1 0-2h3a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1h3a1 1 0 0 1 1 1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3h11V2h-11v1z" />
|
||||||
</svg>
|
</svg>
|
||||||
|
<span class="pdf-toolbar__btn-text"> @L("SenderEditor_SignatureField", "Signaturfeld")</span>
|
||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -327,7 +317,7 @@
|
|||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button class="pdf-toolbar__btn pdf-toolbar__btn--success"
|
<button class="pdf-toolbar__btn pdf-toolbar__btn--success"
|
||||||
@onclick="SendAsync"
|
@onclick="RequestSendAsync"
|
||||||
disabled="@_isSaving"
|
disabled="@_isSaving"
|
||||||
title='@L("SendEnvelope", "Umschlag senden")'>
|
title='@L("SendEnvelope", "Umschlag senden")'>
|
||||||
@if (_isSaving)
|
@if (_isSaving)
|
||||||
@@ -431,7 +421,6 @@
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</DxLoadingPanel>
|
|
||||||
|
|
||||||
<DxPopup @bind-Visible="_receiverPopupVisible"
|
<DxPopup @bind-Visible="_receiverPopupVisible"
|
||||||
HeaderText='@L("AddReceiver", "Empfänger hinzufügen")'
|
HeaderText='@L("AddReceiver", "Empfänger hinzufügen")'
|
||||||
@@ -517,6 +506,69 @@
|
|||||||
</FooterContentTemplate>
|
</FooterContentTemplate>
|
||||||
</DxPopup>
|
</DxPopup>
|
||||||
|
|
||||||
|
@* ── Clear all fields confirmation popup ── *@
|
||||||
|
<DxPopup @bind-Visible="_clearFieldsConfirmVisible"
|
||||||
|
Width="400px"
|
||||||
|
MaxWidth="95vw"
|
||||||
|
ShowHeader="false"
|
||||||
|
ShowFooter="false"
|
||||||
|
CloseOnEscape="true"
|
||||||
|
CloseOnOutsideClick="true">
|
||||||
|
<BodyContentTemplate>
|
||||||
|
<div class="sender-confirm-popup">
|
||||||
|
<p class="sender-confirm-popup__message">@L("SenderEditor_RemoveAllSignatureFieldsConfirm", "Diese Aktion entfernt alle platzierten Signaturfelder unwiderruflich. Fortfahren?")</p>
|
||||||
|
<div class="sender-confirm-popup__actions">
|
||||||
|
<DxButton Text='@L("Cancel", "Abbrechen")'
|
||||||
|
RenderStyle="ButtonRenderStyle.Secondary"
|
||||||
|
Click='() => _clearFieldsConfirmVisible = false' />
|
||||||
|
<DxButton Text='@L("Delete", "Löschen")'
|
||||||
|
RenderStyle="ButtonRenderStyle.Danger"
|
||||||
|
Click="ClearAllFieldsAsync" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</BodyContentTemplate>
|
||||||
|
</DxPopup>
|
||||||
|
|
||||||
|
@* ── Send confirmation popup ── *@
|
||||||
|
<DxPopup @bind-Visible="_sendConfirmVisible"
|
||||||
|
HeaderText='@L("SenderEditor_SendConfirm_Title", "Umschlag jetzt versenden?")'
|
||||||
|
SizeMode="SizeMode.Medium"
|
||||||
|
Width="460px"
|
||||||
|
MaxWidth="95vw"
|
||||||
|
ShowFooter="@(!_isSendConfirmSubmitting)"
|
||||||
|
ShowCloseButton="@(!_isSendConfirmSubmitting)"
|
||||||
|
CloseOnEscape="@(!_isSendConfirmSubmitting)"
|
||||||
|
CloseOnOutsideClick="false">
|
||||||
|
<BodyContentTemplate>
|
||||||
|
@if (_isSendConfirmSubmitting)
|
||||||
|
{
|
||||||
|
<div class="sender-send-progress">
|
||||||
|
<DxWaitIndicator Visible="true" />
|
||||||
|
<div>
|
||||||
|
<p class="sender-send-progress__title">@L("SenderEditor_SendConfirm_InProgress", "Umschlag wird versendet...")</p>
|
||||||
|
<p class="sender-send-progress__hint">@L("SenderEditor_SendConfirm_InProgressHint", "Bitte warten Sie einen Moment. Der Vorgang wird abgeschlossen.")</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<div class="sender-confirm-popup sender-confirm-popup--send">
|
||||||
|
<p class="sender-confirm-popup__note">
|
||||||
|
@L("SenderEditor_SendConfirm_Message", "Wollen Sie den Umschlag jetzt versenden? Hinweis: Nach der Übergabe kann der Vorgang nicht mehr bearbeitet werden.")
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</BodyContentTemplate>
|
||||||
|
<FooterContentTemplate>
|
||||||
|
<DxButton Text='@L("No", "Nein")'
|
||||||
|
RenderStyle="ButtonRenderStyle.Secondary"
|
||||||
|
Click='() => _sendConfirmVisible = false' />
|
||||||
|
<DxButton Text='@L("SenderEditor_SendConfirm_Action", "Ja, versenden")'
|
||||||
|
RenderStyle="ButtonRenderStyle.Primary"
|
||||||
|
Click="ConfirmSendAsync" />
|
||||||
|
</FooterContentTemplate>
|
||||||
|
</DxPopup>
|
||||||
|
|
||||||
@* ── Save result popup (success + error) ── *@
|
@* ── Save result popup (success + error) ── *@
|
||||||
<DxPopup @bind-Visible="_savePopupVisible"
|
<DxPopup @bind-Visible="_savePopupVisible"
|
||||||
HeaderText='@(_saveErrorMessage is null ? _saveSuccessHeader : L("Error", "Fehler"))'
|
HeaderText='@(_saveErrorMessage is null ? _saveSuccessHeader : L("Error", "Fehler"))'
|
||||||
@@ -596,13 +648,11 @@
|
|||||||
[SupplyParameterFromQuery(Name = "envelopeId")]
|
[SupplyParameterFromQuery(Name = "envelopeId")]
|
||||||
public int? EnvelopeId { get; set; }
|
public int? EnvelopeId { get; set; }
|
||||||
|
|
||||||
[SupplyParameterFromQuery(Name = "bootstrapToken")]
|
// ── Signature field size (configurable) ──
|
||||||
public string? BootstrapToken { get; set; }
|
double SigWidthInches => SignatureFieldOptions.CurrentValue.Width;
|
||||||
|
double SigHeightInches => SignatureFieldOptions.CurrentValue.Height;
|
||||||
// ── Constants ──
|
double SigWidthPt => SigWidthInches * 72.0;
|
||||||
// Signature field size in PDF points (fixed): 1.77" × 1.96"
|
double SigHeightPt => SigHeightInches * 72.0;
|
||||||
const double SigWidthPt = 1.77 * 72; // 127.44 pt
|
|
||||||
const double SigHeightPt = 1.96 * 72; // 141.12 pt
|
|
||||||
|
|
||||||
// CssClass for JS click coordinate helper
|
// CssClass for JS click coordinate helper
|
||||||
const string ViewerCssClass = "sender-editor-pdf-viewer";
|
const string ViewerCssClass = "sender-editor-pdf-viewer";
|
||||||
@@ -617,10 +667,7 @@
|
|||||||
int _pageCount;
|
int _pageCount;
|
||||||
List<PdfPageImageDto> _pagePreviews = [];
|
List<PdfPageImageDto> _pagePreviews = [];
|
||||||
int? _loadedEnvelopeId;
|
int? _loadedEnvelopeId;
|
||||||
int? _editingEnvelopeId;
|
|
||||||
bool _isLoadingEnvelopeForEdit;
|
bool _isLoadingEnvelopeForEdit;
|
||||||
bool _bootstrapApplied;
|
|
||||||
string? _pendingBootstrapToken;
|
|
||||||
|
|
||||||
List<SignatureFieldDraft> _signatureFields = [];
|
List<SignatureFieldDraft> _signatureFields = [];
|
||||||
ReceiverDraft? _pendingReceiverForPlacement; // Set when user clicks "Signatur hinzufügen"
|
ReceiverDraft? _pendingReceiverForPlacement; // Set when user clicks "Signatur hinzufügen"
|
||||||
@@ -636,26 +683,27 @@
|
|||||||
// ── Save state ──
|
// ── Save state ──
|
||||||
bool _isSaving = false;
|
bool _isSaving = false;
|
||||||
bool _savePopupVisible = false;
|
bool _savePopupVisible = false;
|
||||||
|
bool _clearFieldsConfirmVisible = false;
|
||||||
|
bool _sendConfirmVisible = false;
|
||||||
|
bool _isSendConfirmSubmitting = false;
|
||||||
string? _saveErrorMessage = null;
|
string? _saveErrorMessage = null;
|
||||||
string _saveSuccessHeader = "Erfolg";
|
string _saveSuccessHeader = "Erfolg";
|
||||||
string _saveSuccessTitle = "Vorgang erfolgreich abgeschlossen.";
|
string _saveSuccessTitle = "Vorgang erfolgreich abgeschlossen.";
|
||||||
string _saveSuccessBody = string.Empty;
|
string _saveSuccessBody = string.Empty;
|
||||||
bool _saveNavigateToDashboard = false;
|
bool _saveNavigateToDashboard = false;
|
||||||
bool _saveDraftAfterBootstrap;
|
|
||||||
|
|
||||||
// ── Envelope metadata ──
|
// ── Envelope metadata ──
|
||||||
string _envelopeTitle = string.Empty;
|
string _envelopeTitle = string.Empty;
|
||||||
string _envelopeMessage = string.Empty;
|
string _envelopeMessage = string.Empty;
|
||||||
bool _titleTouched = false;
|
bool _titleTouched = false;
|
||||||
|
|
||||||
List<EnvelopeTypeDto> _envelopeTypes = [];
|
List<EnvelopeTypeDefaultsDto> _envelopeTypes = [];
|
||||||
int? _selectedEnvelopeTypeId;
|
EnvelopeType? _selectedType;
|
||||||
string _language = "de-DE";
|
string _language = "de-DE";
|
||||||
bool _useAccessCode;
|
bool _useAccessCode;
|
||||||
bool _tfaEnabled;
|
bool _tfaEnabled;
|
||||||
int _certificationType = (int)CertificationType.AdvancedElectronicSignature;
|
FinalEmailType _finalEmailToCreator = FinalEmailType.No;
|
||||||
int _finalEmailToCreator = (int)FinalEmailType.No;
|
FinalEmailType _finalEmailToReceivers = FinalEmailType.No;
|
||||||
int _finalEmailToReceivers = (int)FinalEmailType.No;
|
|
||||||
bool _sendReminderEmails;
|
bool _sendReminderEmails;
|
||||||
int _firstReminderDays;
|
int _firstReminderDays;
|
||||||
int _reminderIntervalDays;
|
int _reminderIntervalDays;
|
||||||
@@ -675,9 +723,6 @@
|
|||||||
|
|
||||||
static readonly System.ComponentModel.DataAnnotations.EmailAddressAttribute ReceiverEmailValidator = new();
|
static readonly System.ComponentModel.DataAnnotations.EmailAddressAttribute ReceiverEmailValidator = new();
|
||||||
|
|
||||||
bool IsEditMode => EnvelopeId.HasValue && EnvelopeId.Value > 0;
|
|
||||||
bool IsBootstrapLoading => !IsEditMode && !_bootstrapApplied;
|
|
||||||
|
|
||||||
// ── Lifecycle ──
|
// ── Lifecycle ──
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
@@ -692,12 +737,6 @@
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
_envelopeTypes = (await EnvelopeTypeService.GetAsync()).ToList();
|
_envelopeTypes = (await EnvelopeTypeService.GetAsync()).ToList();
|
||||||
|
|
||||||
if (!IsEditMode && _selectedEnvelopeTypeId is null && _envelopeTypes.Count > 0)
|
|
||||||
{
|
|
||||||
_selectedEnvelopeTypeId = _envelopeTypes[0].Id;
|
|
||||||
ApplyEnvelopeTypeDefaults(_envelopeTypes[0]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -708,95 +747,14 @@
|
|||||||
|
|
||||||
protected override async Task OnParametersSetAsync()
|
protected override async Task OnParametersSetAsync()
|
||||||
{
|
{
|
||||||
if (EnvelopeId.HasValue && EnvelopeId.Value > 0)
|
if (!EnvelopeId.HasValue || EnvelopeId.Value <= 0)
|
||||||
_editingEnvelopeId = EnvelopeId.Value;
|
|
||||||
|
|
||||||
if (IsEditMode && _loadedEnvelopeId != EnvelopeId)
|
|
||||||
{
|
|
||||||
await LoadEnvelopeForEditAsync(EnvelopeId!.Value);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (IsEditMode || _bootstrapApplied)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(BootstrapToken))
|
|
||||||
{
|
{
|
||||||
NavigationManager.NavigateTo("/sender", replace: true);
|
NavigationManager.NavigateTo("/sender", replace: true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_pendingBootstrapToken = BootstrapToken;
|
if (_loadedEnvelopeId != EnvelopeId && !_isLoadingEnvelopeForEdit)
|
||||||
}
|
await LoadEnvelopeForEditAsync(EnvelopeId.Value);
|
||||||
|
|
||||||
async Task TryApplyBootstrapAsync(string token)
|
|
||||||
{
|
|
||||||
var payload = await CreateEnvelopeBootstrapStorageService.ConsumeAsync(token);
|
|
||||||
_bootstrapApplied = true;
|
|
||||||
|
|
||||||
if (payload is null)
|
|
||||||
{
|
|
||||||
NavigationManager.NavigateTo("/sender", replace: true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_envelopeTitle = payload.Title ?? string.Empty;
|
|
||||||
_envelopeMessage = payload.Message ?? string.Empty;
|
|
||||||
_selectedEnvelopeTypeId = payload.EnvelopeTypeId;
|
|
||||||
_language = string.IsNullOrWhiteSpace(payload.Language) ? "de-DE" : payload.Language;
|
|
||||||
_useAccessCode = payload.UseAccessCode;
|
|
||||||
_tfaEnabled = payload.TFAEnabled;
|
|
||||||
_certificationType = payload.CertificationType;
|
|
||||||
_finalEmailToCreator = payload.FinalEmailToCreator;
|
|
||||||
_finalEmailToReceivers = payload.FinalEmailToReceivers;
|
|
||||||
_sendReminderEmails = payload.SendReminderEmails;
|
|
||||||
_firstReminderDays = payload.FirstReminderDays;
|
|
||||||
_reminderIntervalDays = payload.ReminderIntervalDays;
|
|
||||||
_expiresWhenDays = payload.ExpiresWhenDays;
|
|
||||||
_expiresWarningWhenDays = payload.ExpiresWarningWhenDays;
|
|
||||||
NormalizeSettings();
|
|
||||||
|
|
||||||
_receivers = payload.Receivers
|
|
||||||
.Select((receiver, index) => new ReceiverDraft(
|
|
||||||
Guid.NewGuid(),
|
|
||||||
receiver.FullName,
|
|
||||||
receiver.EmailAddress,
|
|
||||||
string.Empty,
|
|
||||||
ReceiverPalette[index % ReceiverPalette.Length]))
|
|
||||||
.ToList();
|
|
||||||
|
|
||||||
_originalPdfBytes = payload.DocumentBytes;
|
|
||||||
_fileName = string.IsNullOrWhiteSpace(payload.DocumentFileName) ? "document.pdf" : payload.DocumentFileName;
|
|
||||||
_pdfLoaded = _originalPdfBytes is { Length: > 0 };
|
|
||||||
|
|
||||||
_signatureFields.Clear();
|
|
||||||
_pendingReceiverForPlacement = null;
|
|
||||||
|
|
||||||
_saveDraftAfterBootstrap = true;
|
|
||||||
|
|
||||||
if (_pdfLoaded && _originalPdfBytes is not null)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
_pagePreviews = (await PdfRenderService.RenderPagesAsync(_originalPdfBytes))
|
|
||||||
.OrderBy(p => p.PageNumber)
|
|
||||||
.ToList();
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Logger.LogWarning(ex, "Failed to render bootstrap PDF previews.");
|
|
||||||
_pagePreviews = [];
|
|
||||||
}
|
|
||||||
|
|
||||||
_pageCount = _pagePreviews.Count > 0
|
|
||||||
? _pagePreviews.Count
|
|
||||||
: EstimatePdfPageCount(_originalPdfBytes) ?? 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_pagePreviews = [];
|
|
||||||
_pageCount = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||||
@@ -806,26 +764,6 @@
|
|||||||
_isPageReady = true;
|
_isPageReady = true;
|
||||||
await InvokeAsync(StateHasChanged);
|
await InvokeAsync(StateHasChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!OperatingSystem.IsBrowser())
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (!IsEditMode && !_bootstrapApplied && !string.IsNullOrWhiteSpace(_pendingBootstrapToken))
|
|
||||||
{
|
|
||||||
var token = _pendingBootstrapToken;
|
|
||||||
_pendingBootstrapToken = null;
|
|
||||||
await TryApplyBootstrapAsync(token);
|
|
||||||
await InvokeAsync(StateHasChanged);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_saveDraftAfterBootstrap && !_isSaving)
|
|
||||||
{
|
|
||||||
_saveDraftAfterBootstrap = false;
|
|
||||||
await SaveDraftAndStayOnEditorAsync();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async Task LoadEnvelopeForEditAsync(int envelopeId)
|
async Task LoadEnvelopeForEditAsync(int envelopeId)
|
||||||
@@ -846,22 +784,21 @@
|
|||||||
|
|
||||||
_envelopeTitle = envelope.Title ?? string.Empty;
|
_envelopeTitle = envelope.Title ?? string.Empty;
|
||||||
_envelopeMessage = envelope.Message ?? string.Empty;
|
_envelopeMessage = envelope.Message ?? string.Empty;
|
||||||
_selectedEnvelopeTypeId = envelope.EnvelopeTypeId;
|
_selectedType = envelope.Type;
|
||||||
_language = string.IsNullOrWhiteSpace(envelope.Language) ? "de-DE" : envelope.Language;
|
_language = string.IsNullOrWhiteSpace(envelope.Language) ? "de-DE" : envelope.Language;
|
||||||
_useAccessCode = envelope.UseAccessCode;
|
_useAccessCode = envelope.UseAccessCode;
|
||||||
_tfaEnabled = envelope.TFAEnabled;
|
_tfaEnabled = envelope.TFAEnabled;
|
||||||
if (_tfaEnabled)
|
if (_tfaEnabled)
|
||||||
_useAccessCode = true;
|
_useAccessCode = true;
|
||||||
|
|
||||||
_certificationType = envelope.CertificationType ?? (int)CertificationType.AdvancedElectronicSignature;
|
_finalEmailToCreator = envelope.FinalEmailToCreator ?? FinalEmailType.No;
|
||||||
_finalEmailToCreator = envelope.FinalEmailToCreator ?? (int)FinalEmailType.No;
|
_finalEmailToReceivers = envelope.FinalEmailToReceivers ?? FinalEmailType.No;
|
||||||
_finalEmailToReceivers = envelope.FinalEmailToReceivers ?? (int)FinalEmailType.No;
|
|
||||||
|
|
||||||
_sendReminderEmails = envelope.SendReminderEmails ?? envelope.EnvelopeType?.SendReminderEmails ?? false;
|
_sendReminderEmails = envelope.SendReminderEmails ?? envelope.Defaults?.SendReminderEmails ?? false;
|
||||||
_firstReminderDays = envelope.FirstReminderDays ?? envelope.EnvelopeType?.FirstReminderDays ?? 0;
|
_firstReminderDays = envelope.FirstReminderDays ?? envelope.Defaults?.FirstReminderDays ?? 0;
|
||||||
_reminderIntervalDays = envelope.ReminderIntervalDays ?? envelope.EnvelopeType?.ReminderIntervalDays ?? 0;
|
_reminderIntervalDays = envelope.ReminderIntervalDays ?? envelope.Defaults?.ReminderIntervalDays ?? 0;
|
||||||
_expiresWhenDays = envelope.ExpiresWhenDays ?? envelope.EnvelopeType?.ExpiresDays ?? 0;
|
_expiresWhenDays = envelope.ExpiresWhenDays ?? envelope.Defaults?.ExpiresDays ?? 0;
|
||||||
_expiresWarningWhenDays = envelope.ExpiresWarningWhenDays ?? envelope.EnvelopeType?.ExpiresWarningDays ?? 0;
|
_expiresWarningWhenDays = envelope.ExpiresWarningWhenDays ?? envelope.Defaults?.ExpiresWarningDays ?? 0;
|
||||||
|
|
||||||
NormalizeSettings();
|
NormalizeSettings();
|
||||||
|
|
||||||
@@ -869,12 +806,17 @@
|
|||||||
_receivers = envelopeReceivers
|
_receivers = envelopeReceivers
|
||||||
.Select((er, index) => new ReceiverDraft(
|
.Select((er, index) => new ReceiverDraft(
|
||||||
Guid.NewGuid(),
|
Guid.NewGuid(),
|
||||||
|
er.ReceiverId,
|
||||||
er.Name ?? er.Receiver?.EmailAddress ?? $"Receiver {er.ReceiverId}",
|
er.Name ?? er.Receiver?.EmailAddress ?? $"Receiver {er.ReceiverId}",
|
||||||
er.Receiver?.EmailAddress ?? string.Empty,
|
er.Receiver?.EmailAddress ?? string.Empty,
|
||||||
string.Empty,
|
string.Empty,
|
||||||
ReceiverPalette[index % ReceiverPalette.Length]))
|
ReceiverPalette[index % ReceiverPalette.Length]))
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
|
var receiverDraftByReceiverId = _receivers
|
||||||
|
.Where(r => r.ReceiverId.HasValue)
|
||||||
|
.ToDictionary(r => r.ReceiverId!.Value, r => r);
|
||||||
|
|
||||||
var receiverById = envelopeReceivers.ToDictionary(er => er.ReceiverId, er => er);
|
var receiverById = envelopeReceivers.ToDictionary(er => er.ReceiverId, er => er);
|
||||||
var colorByEmail = _receivers
|
var colorByEmail = _receivers
|
||||||
.Where(r => !string.IsNullOrWhiteSpace(r.Email))
|
.Where(r => !string.IsNullOrWhiteSpace(r.Email))
|
||||||
@@ -896,10 +838,17 @@
|
|||||||
? receiverColor
|
? receiverColor
|
||||||
: ReceiverPalette[Math.Abs(element.ReceiverId) % ReceiverPalette.Length];
|
: ReceiverPalette[Math.Abs(element.ReceiverId) % ReceiverPalette.Length];
|
||||||
|
|
||||||
|
var receiverDraft = receiverDraftByReceiverId.TryGetValue(element.ReceiverId, out var draft)
|
||||||
|
? draft
|
||||||
|
: _receivers.FirstOrDefault(r =>
|
||||||
|
(!string.IsNullOrWhiteSpace(receiverEmail) && string.Equals(r.Email, receiverEmail, StringComparison.OrdinalIgnoreCase))
|
||||||
|
|| string.Equals(r.FullName, receiverName, StringComparison.OrdinalIgnoreCase));
|
||||||
|
|
||||||
return new SignatureFieldDraft(
|
return new SignatureFieldDraft(
|
||||||
XPt: element.X * 72.0,
|
XPt: element.X * 72.0,
|
||||||
YPt: element.Y * 72.0,
|
YPt: element.Y * 72.0,
|
||||||
Page: element.Page,
|
Page: element.Page,
|
||||||
|
ReceiverDraftId: receiverDraft?.Id ?? Guid.Empty,
|
||||||
ReceiverName: receiverName,
|
ReceiverName: receiverName,
|
||||||
Color: color);
|
Color: color);
|
||||||
})
|
})
|
||||||
@@ -935,7 +884,6 @@
|
|||||||
_fileName = $"Envelope-{envelopeId}.pdf";
|
_fileName = $"Envelope-{envelopeId}.pdf";
|
||||||
_pendingReceiverForPlacement = null;
|
_pendingReceiverForPlacement = null;
|
||||||
_loadedEnvelopeId = envelopeId;
|
_loadedEnvelopeId = envelopeId;
|
||||||
_editingEnvelopeId = envelopeId;
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -1021,13 +969,15 @@
|
|||||||
Task OnEnvelopeTypeChanged(ChangeEventArgs e)
|
Task OnEnvelopeTypeChanged(ChangeEventArgs e)
|
||||||
{
|
{
|
||||||
var raw = e.Value?.ToString();
|
var raw = e.Value?.ToString();
|
||||||
if (!int.TryParse(raw, out var id) || id <= 0)
|
if (!int.TryParse(raw, out var idInt) || idInt <= 0)
|
||||||
{
|
{
|
||||||
_selectedEnvelopeTypeId = null;
|
_selectedType = null;
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
_selectedEnvelopeTypeId = id;
|
var id = idInt.ToEnvelopeType();
|
||||||
|
|
||||||
|
_selectedType = id;
|
||||||
var selectedType = _envelopeTypes.FirstOrDefault(x => x.Id == id);
|
var selectedType = _envelopeTypes.FirstOrDefault(x => x.Id == id);
|
||||||
if (selectedType is not null)
|
if (selectedType is not null)
|
||||||
ApplyEnvelopeTypeDefaults(selectedType);
|
ApplyEnvelopeTypeDefaults(selectedType);
|
||||||
@@ -1035,7 +985,7 @@
|
|||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ApplyEnvelopeTypeDefaults(EnvelopeTypeDto envelopeType)
|
void ApplyEnvelopeTypeDefaults(EnvelopeTypeDefaultsDto envelopeType)
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrWhiteSpace(envelopeType.Language))
|
if (!string.IsNullOrWhiteSpace(envelopeType.Language))
|
||||||
_language = envelopeType.Language;
|
_language = envelopeType.Language;
|
||||||
@@ -1046,9 +996,6 @@
|
|||||||
if (_tfaEnabled)
|
if (_tfaEnabled)
|
||||||
_useAccessCode = true;
|
_useAccessCode = true;
|
||||||
|
|
||||||
if (envelopeType.CertificationType.HasValue)
|
|
||||||
_certificationType = envelopeType.CertificationType.Value;
|
|
||||||
|
|
||||||
if (envelopeType.FinalEmailToCreator.HasValue)
|
if (envelopeType.FinalEmailToCreator.HasValue)
|
||||||
_finalEmailToCreator = envelopeType.FinalEmailToCreator.Value;
|
_finalEmailToCreator = envelopeType.FinalEmailToCreator.Value;
|
||||||
|
|
||||||
@@ -1135,6 +1082,7 @@
|
|||||||
XPt: xPt,
|
XPt: xPt,
|
||||||
YPt: yPt,
|
YPt: yPt,
|
||||||
Page: page1Based,
|
Page: page1Based,
|
||||||
|
ReceiverDraftId: _pendingReceiverForPlacement.Id,
|
||||||
ReceiverName: _pendingReceiverForPlacement.FullName,
|
ReceiverName: _pendingReceiverForPlacement.FullName,
|
||||||
Color: _pendingReceiverForPlacement.Color);
|
Color: _pendingReceiverForPlacement.Color);
|
||||||
|
|
||||||
@@ -1175,6 +1123,7 @@
|
|||||||
// ── Clear all fields ──
|
// ── Clear all fields ──
|
||||||
async Task ClearAllFieldsAsync()
|
async Task ClearAllFieldsAsync()
|
||||||
{
|
{
|
||||||
|
_clearFieldsConfirmVisible = false;
|
||||||
_signatureFields.Clear();
|
_signatureFields.Clear();
|
||||||
_pendingReceiverForPlacement = null;
|
_pendingReceiverForPlacement = null;
|
||||||
await Task.CompletedTask;
|
await Task.CompletedTask;
|
||||||
@@ -1237,9 +1186,8 @@
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var previousEnvelopeId = EnvelopeId;
|
|
||||||
var command = BuildCreateEnvelopeCommand(send: false);
|
var command = BuildCreateEnvelopeCommand(send: false);
|
||||||
Logger.LogInformation("[SenderEditor] Saving draft. EnvelopeId={EnvelopeId} IsEditMode={IsEditMode}", command.EnvelopeId, IsEditMode);
|
Logger.LogInformation("[SenderEditor] Saving draft. EnvelopeId={EnvelopeId}", command.EnvelopeId);
|
||||||
var result = await EnvelopeService.UpsertAsync(command);
|
var result = await EnvelopeService.UpsertAsync(command);
|
||||||
|
|
||||||
if (result is null)
|
if (result is null)
|
||||||
@@ -1247,16 +1195,9 @@
|
|||||||
|
|
||||||
EnvelopeId = result.Id;
|
EnvelopeId = result.Id;
|
||||||
_loadedEnvelopeId = result.Id;
|
_loadedEnvelopeId = result.Id;
|
||||||
_editingEnvelopeId = result.Id;
|
|
||||||
|
|
||||||
if (navigateToDashboard)
|
if (navigateToDashboard)
|
||||||
{
|
|
||||||
NavigationManager.NavigateTo("/sender", forceLoad: false);
|
NavigationManager.NavigateTo("/sender", forceLoad: false);
|
||||||
}
|
|
||||||
else if (previousEnvelopeId != result.Id)
|
|
||||||
{
|
|
||||||
NavigationManager.NavigateTo($"/sender/editor?envelopeId={result.Id}", forceLoad: false);
|
|
||||||
}
|
|
||||||
|
|
||||||
return result.Id;
|
return result.Id;
|
||||||
}
|
}
|
||||||
@@ -1274,12 +1215,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async Task SaveDraftAndStayOnEditorAsync()
|
|
||||||
{
|
|
||||||
Logger.LogInformation("[SenderEditor] Trigger bootstrap draft save.");
|
|
||||||
await SaveDraftCoreAsync(navigateToDashboard: false);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ── Send envelope ──
|
// ── Send envelope ──
|
||||||
async Task SendAsync()
|
async Task SendAsync()
|
||||||
{
|
{
|
||||||
@@ -1319,7 +1254,7 @@
|
|||||||
|
|
||||||
// Warn if any receiver has no signature field, but don't block
|
// Warn if any receiver has no signature field, but don't block
|
||||||
var receiversWithoutField = _receivers
|
var receiversWithoutField = _receivers
|
||||||
.Where(r => !_signatureFields.Any(f => f.ReceiverName == r.FullName))
|
.Where(r => !_signatureFields.Any(f => f.ReceiverDraftId == r.Id))
|
||||||
.ToList();
|
.ToList();
|
||||||
if (receiversWithoutField.Count > 0)
|
if (receiversWithoutField.Count > 0)
|
||||||
{
|
{
|
||||||
@@ -1334,34 +1269,17 @@
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var envelopeId = _editingEnvelopeId
|
var envelopeId = EnvelopeId ?? _loadedEnvelopeId;
|
||||||
?? EnvelopeId
|
|
||||||
?? _loadedEnvelopeId
|
|
||||||
?? GetEnvelopeIdFromCurrentUri();
|
|
||||||
|
|
||||||
if (!envelopeId.HasValue || envelopeId.Value <= 0)
|
if (!envelopeId.HasValue || envelopeId.Value <= 0)
|
||||||
{
|
throw new InvalidOperationException("Envelope id is missing for send.");
|
||||||
var saveResult = await EnvelopeService.UpsertAsync(BuildCreateEnvelopeCommand(send: false))
|
|
||||||
?? throw new InvalidOperationException("Draft save did not return a result.");
|
|
||||||
|
|
||||||
envelopeId = saveResult.Id;
|
|
||||||
EnvelopeId = saveResult.Id;
|
|
||||||
_loadedEnvelopeId = saveResult.Id;
|
|
||||||
_editingEnvelopeId = saveResult.Id;
|
|
||||||
}
|
|
||||||
|
|
||||||
var sendResult = await EnvelopeService.UpsertAsync(BuildCreateEnvelopeCommand(send: true) with { EnvelopeId = envelopeId })
|
var sendResult = await EnvelopeService.UpsertAsync(BuildCreateEnvelopeCommand(send: true) with { EnvelopeId = envelopeId })
|
||||||
?? throw new InvalidOperationException("Send did not return a result.");
|
?? throw new InvalidOperationException("Send did not return a result.");
|
||||||
|
|
||||||
Logger.LogInformation("[SenderEditor] Envelope sent from draft. Id={Id} Status={Status}", sendResult.Id, sendResult.Status);
|
Logger.LogInformation("[SenderEditor] Envelope sent from draft. Id={Id} Status={Status}", sendResult.Id, sendResult.Status);
|
||||||
|
|
||||||
// Success — show popup; GoToDashboard clears cache and navigates
|
NavigationManager.NavigateTo("/sender", forceLoad: false);
|
||||||
_saveErrorMessage = null;
|
|
||||||
_saveSuccessHeader = L("SenderEditor_Sent_Header", "Umschlag gesendet");
|
|
||||||
_saveSuccessTitle = L("SenderEditor_Sent_Title", "Umschlag wurde erfolgreich gesendet.");
|
|
||||||
_saveSuccessBody = L("SenderEditor_Sent_Body", "Der bestehende Entwurf wurde versendet.");
|
|
||||||
_saveNavigateToDashboard = true;
|
|
||||||
_savePopupVisible = true;
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -1375,17 +1293,46 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Task RequestSendAsync()
|
||||||
|
{
|
||||||
|
if (_isSaving)
|
||||||
|
return Task.CompletedTask;
|
||||||
|
|
||||||
|
_sendConfirmVisible = true;
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
|
||||||
|
async Task ConfirmSendAsync()
|
||||||
|
{
|
||||||
|
if (_isSendConfirmSubmitting)
|
||||||
|
return;
|
||||||
|
|
||||||
|
_isSendConfirmSubmitting = true;
|
||||||
|
await InvokeAsync(StateHasChanged);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await SendAsync();
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
_isSendConfirmSubmitting = false;
|
||||||
|
|
||||||
|
if (_savePopupVisible)
|
||||||
|
_sendConfirmVisible = false;
|
||||||
|
|
||||||
|
await InvokeAsync(StateHasChanged);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
CreateEnvelopeCommand BuildCreateEnvelopeCommand(bool send)
|
CreateEnvelopeCommand BuildCreateEnvelopeCommand(bool send)
|
||||||
{
|
{
|
||||||
NormalizeSettings();
|
NormalizeSettings();
|
||||||
|
|
||||||
var envelopeId = _editingEnvelopeId
|
var envelopeId = EnvelopeId ?? _loadedEnvelopeId;
|
||||||
?? EnvelopeId
|
|
||||||
?? _loadedEnvelopeId
|
|
||||||
?? GetEnvelopeIdFromCurrentUri();
|
|
||||||
|
|
||||||
if (IsEditMode && envelopeId is null)
|
if (envelopeId is null)
|
||||||
throw new InvalidOperationException("Edit mode envelope id is missing.");
|
throw new InvalidOperationException("Envelope id is missing.");
|
||||||
|
|
||||||
var docBase64 = _originalPdfBytes is { Length: > 0 }
|
var docBase64 = _originalPdfBytes is { Length: > 0 }
|
||||||
? Convert.ToBase64String(_originalPdfBytes)
|
? Convert.ToBase64String(_originalPdfBytes)
|
||||||
@@ -1394,7 +1341,7 @@
|
|||||||
var receiverCommands = _receivers.Select(receiver =>
|
var receiverCommands = _receivers.Select(receiver =>
|
||||||
{
|
{
|
||||||
var fields = _signatureFields
|
var fields = _signatureFields
|
||||||
.Where(f => f.ReceiverName == receiver.FullName)
|
.Where(f => f.ReceiverDraftId == receiver.Id)
|
||||||
.Select(f => new CreateEnvelopeFieldDto(
|
.Select(f => new CreateEnvelopeFieldDto(
|
||||||
X: f.XPt / 72.0,
|
X: f.XPt / 72.0,
|
||||||
Y: f.YPt / 72.0,
|
Y: f.YPt / 72.0,
|
||||||
@@ -1411,13 +1358,12 @@
|
|||||||
return new CreateEnvelopeCommand
|
return new CreateEnvelopeCommand
|
||||||
{
|
{
|
||||||
EnvelopeId = envelopeId,
|
EnvelopeId = envelopeId,
|
||||||
EnvelopeTypeId = _selectedEnvelopeTypeId,
|
Type = _selectedType,
|
||||||
Title = _envelopeTitle,
|
Title = _envelopeTitle,
|
||||||
Message = _envelopeMessage,
|
Message = _envelopeMessage,
|
||||||
Language = _language,
|
Language = _language,
|
||||||
UseAccessCode = _useAccessCode,
|
UseAccessCode = _useAccessCode,
|
||||||
TFAEnabled = _tfaEnabled,
|
TFAEnabled = _tfaEnabled,
|
||||||
CertificationType = _certificationType,
|
|
||||||
FinalEmailToCreator = _finalEmailToCreator,
|
FinalEmailToCreator = _finalEmailToCreator,
|
||||||
FinalEmailToReceivers = _finalEmailToReceivers,
|
FinalEmailToReceivers = _finalEmailToReceivers,
|
||||||
SendReminderEmails = _sendReminderEmails,
|
SendReminderEmails = _sendReminderEmails,
|
||||||
@@ -1473,28 +1419,6 @@
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int? GetEnvelopeIdFromCurrentUri()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var uri = NavigationManager.ToAbsoluteUri(NavigationManager.Uri);
|
|
||||||
if (string.IsNullOrWhiteSpace(uri.Query))
|
|
||||||
return null;
|
|
||||||
|
|
||||||
var query = QueryHelpers.ParseQuery(uri.Query);
|
|
||||||
if (!query.TryGetValue("envelopeId", out var raw))
|
|
||||||
return null;
|
|
||||||
|
|
||||||
return int.TryParse(raw.ToString(), out var id) && id > 0
|
|
||||||
? id
|
|
||||||
: null;
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ── Receiver popup ──
|
// ── Receiver popup ──
|
||||||
void OpenAddReceiverPopup()
|
void OpenAddReceiverPopup()
|
||||||
{
|
{
|
||||||
@@ -1656,18 +1580,49 @@
|
|||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
_receivers.Add(new ReceiverDraft(Guid.NewGuid(), fullName, email, phoneNumber,
|
_receivers.Add(new ReceiverDraft(Guid.NewGuid(), null, fullName, email, phoneNumber,
|
||||||
ReceiverPalette[_receivers.Count % ReceiverPalette.Length]));
|
ReceiverPalette[_receivers.Count % ReceiverPalette.Length]));
|
||||||
CloseAddReceiverPopup();
|
CloseAddReceiverPopup();
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async Task RemoveReceiverAsync(ReceiverDraft receiver)
|
||||||
|
{
|
||||||
|
if (_isSaving)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var envelopeId = EnvelopeId ?? _loadedEnvelopeId;
|
||||||
|
|
||||||
|
if (envelopeId is int persistedEnvelopeId && persistedEnvelopeId > 0 && receiver.ReceiverId is int persistedReceiverId && persistedReceiverId > 0)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await EnvelopeReceiverService.DeleteAsync(persistedEnvelopeId, persistedReceiverId);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logger.LogError(ex, "[SenderEditor] Failed to remove receiver {ReceiverId} from envelope {EnvelopeId}", persistedReceiverId, persistedEnvelopeId);
|
||||||
|
_saveErrorMessage = string.Format(
|
||||||
|
L("SenderEditor_RemoveReceiverError", "Empfaenger konnte nicht entfernt werden: {0}"),
|
||||||
|
ex.Message);
|
||||||
|
_savePopupVisible = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_receivers.RemoveAll(r => r.Id == receiver.Id);
|
||||||
|
_signatureFields.RemoveAll(f => f.ReceiverDraftId == receiver.Id);
|
||||||
|
|
||||||
|
if (_pendingReceiverForPlacement?.Id == receiver.Id)
|
||||||
|
_pendingReceiverForPlacement = null;
|
||||||
|
}
|
||||||
|
|
||||||
// ── Models ──
|
// ── Models ──
|
||||||
record SignatureFieldDraft(double XPt, double YPt, int Page, string ReceiverName, string Color);
|
record SignatureFieldDraft(double XPt, double YPt, int Page, Guid ReceiverDraftId, string ReceiverName, string Color);
|
||||||
|
|
||||||
record NormalisedCoords(double NormX, double NormY, int PageIndex);
|
record NormalisedCoords(double NormX, double NormY, int PageIndex);
|
||||||
|
|
||||||
record ReceiverDraft(Guid Id, string FullName, string Email, string PhoneNumber, string Color);
|
record ReceiverDraft(Guid Id, int? ReceiverId, string FullName, string Email, string PhoneNumber, string Color);
|
||||||
|
|
||||||
// ── Receiver colour palette (cycles when > 8 receivers) ──
|
// ── Receiver colour palette (cycles when > 8 receivers) ──
|
||||||
static readonly string[] ReceiverPalette =
|
static readonly string[] ReceiverPalette =
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
@page "/sender"
|
@page "/sender"
|
||||||
@rendermode InteractiveWebAssembly
|
@rendermode InteractiveWebAssembly
|
||||||
|
@implements IDisposable
|
||||||
@using System.Text.Json
|
@using System.Text.Json
|
||||||
@using EnvelopeGenerator.Domain.Constants
|
@using EnvelopeGenerator.Domain.Constants
|
||||||
@using EnvelopeGenerator.Server.Client.Models
|
@using EnvelopeGenerator.Server.Client.Models
|
||||||
@@ -7,6 +8,7 @@
|
|||||||
@using EnvelopeGenerator.Server.Client.Services
|
@using EnvelopeGenerator.Server.Client.Services
|
||||||
@using EnvelopeGenerator.Application.Common.Dto
|
@using EnvelopeGenerator.Application.Common.Dto
|
||||||
@using EnvelopeGenerator.Application.Common.Dto.History
|
@using EnvelopeGenerator.Application.Common.Dto.History
|
||||||
|
@using EnvelopeGenerator.Application.Envelopes.Commands
|
||||||
@using EnvelopeGenerator.Application.Resources
|
@using EnvelopeGenerator.Application.Resources
|
||||||
@using EnvelopeGenerator.Domain.Resources
|
@using EnvelopeGenerator.Domain.Resources
|
||||||
@using EnvelopeGenerator.Server.Client.Components.Sender
|
@using EnvelopeGenerator.Server.Client.Components.Sender
|
||||||
@@ -20,17 +22,23 @@
|
|||||||
@inject EnvelopeGenerator.Server.Client.Services.UserPreferencesService UserPreferencesService
|
@inject EnvelopeGenerator.Server.Client.Services.UserPreferencesService UserPreferencesService
|
||||||
@inject EnvelopeGenerator.Server.Client.Services.CustomImagesService CustomImagesService
|
@inject EnvelopeGenerator.Server.Client.Services.CustomImagesService CustomImagesService
|
||||||
@inject EnvelopeGenerator.Server.Client.Services.PdfSignatureService PdfSignatureService
|
@inject EnvelopeGenerator.Server.Client.Services.PdfSignatureService PdfSignatureService
|
||||||
@inject EnvelopeGenerator.Server.Client.Services.CreateEnvelopeBootstrapStorageService CreateEnvelopeBootstrapStorageService
|
@inject EnvelopeGenerator.Server.Client.Services.EnvelopeReceiverService EnvelopeReceiverService
|
||||||
@inject ILogger<SenderPage> Logger
|
@inject ILogger<SenderPage> Logger
|
||||||
@inject NavigationManager Navigation
|
@inject NavigationManager Navigation
|
||||||
@inject IJSRuntime JSRuntime
|
@inject IJSRuntime JSRuntime
|
||||||
@inject AppVersionService AppVersion
|
@inject AppVersionService AppVersion
|
||||||
@inject IStringLocalizer<Model> ModelLocalizer
|
@inject IStringLocalizer<Model> ModelLocalizer
|
||||||
@inject IStringLocalizer<Resource> UiLocalizer
|
@inject IStringLocalizer<Resource> UiLocalizer
|
||||||
|
@inject PersistentComponentState PersistentComponentState
|
||||||
|
|
||||||
<link href="@AppVersion.GetVersionedUrl("css/envelope-viewer.css")" rel="stylesheet" />
|
<link href="@AppVersion.GetVersionedUrl("css/envelope-viewer.css")" rel="stylesheet" />
|
||||||
<link href="@AppVersion.GetVersionedUrl("css/sender-page.css")" rel="stylesheet" />
|
<link href="@AppVersion.GetVersionedUrl("css/sender-page.css")" rel="stylesheet" />
|
||||||
|
|
||||||
|
<MudThemeProvider />
|
||||||
|
<MudPopoverProvider />
|
||||||
|
<MudDialogProvider />
|
||||||
|
<MudSnackbarProvider />
|
||||||
|
|
||||||
<div class="sender-dashboard-layout">
|
<div class="sender-dashboard-layout">
|
||||||
<div class="sender-action-bar">
|
<div class="sender-action-bar">
|
||||||
<div class="sender-action-bar__inner">
|
<div class="sender-action-bar__inner">
|
||||||
@@ -107,12 +115,12 @@
|
|||||||
}
|
}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button class="sender-btn" @onclick="ShowPreview" disabled="@(_selectedEnvelope == null)" title="@L("Sender_Preview_Title", "Ausgewählten Umschlag als PDF anzeigen")">
|
<button class="sender-btn" @onclick="ShowPreview" disabled="@(_selectedEnvelope == null)" title="@L("Sender_ShowOriginalDocument_Title", "Originaldokument anzeigen")">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
|
||||||
<path d="M10.5 8a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0z"/>
|
<path d="M10.5 8a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0z"/>
|
||||||
<path d="M0 8s3-5.5 8-5.5S16 8 16 8s-3 5.5-8 5.5S0 8 0 8zm8 3.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7z"/>
|
<path d="M0 8s3-5.5 8-5.5S16 8 16 8s-3 5.5-8 5.5S0 8 0 8zm8 3.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7z"/>
|
||||||
</svg>
|
</svg>
|
||||||
@L("Preview", "Vorschau")
|
@L("Sender_ShowOriginalDocument", "Original Dokument anzeigen")
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<div class="sender-export-group" title="@L("Sender_ExportView_Title", "Export der aktuellen Tabellenansicht")">
|
<div class="sender-export-group" title="@L("Sender_ExportView_Title", "Export der aktuellen Tabellenansicht")">
|
||||||
@@ -217,200 +225,223 @@
|
|||||||
|
|
||||||
<div class="sender-grid-wrapper">
|
<div class="sender-grid-wrapper">
|
||||||
<DxGrid @key="_activeTab"
|
<DxGrid @key="_activeTab"
|
||||||
Data="@CurrentGridData"
|
Data="@CurrentGridData"
|
||||||
@ref="_grid"
|
@ref="_grid"
|
||||||
KeyFieldName="Id"
|
KeyFieldName="Id"
|
||||||
ShowFilterRow="false"
|
ShowFilterRow="false"
|
||||||
FilterMenuButtonDisplayMode="GridFilterMenuButtonDisplayMode.Always"
|
FilterMenuButtonDisplayMode="GridFilterMenuButtonDisplayMode.Always"
|
||||||
ShowSearchBox="true"
|
ShowSearchBox="true"
|
||||||
AllowColumnReorder="true"
|
AllowColumnReorder="true"
|
||||||
AllowSort="true"
|
AllowSort="true"
|
||||||
ColumnResizeMode="GridColumnResizeMode.ColumnsContainer"
|
ColumnResizeMode="GridColumnResizeMode.ColumnsContainer"
|
||||||
PageSize="20"
|
PageSize="20"
|
||||||
PagerVisible="true"
|
PagerVisible="true"
|
||||||
SelectionMode="GridSelectionMode.Single"
|
SelectionMode="GridSelectionMode.Single"
|
||||||
AllowSelectRowByClick="true"
|
AllowSelectRowByClick="true"
|
||||||
SelectedDataItem="@_selectedEnvelope"
|
SelectedDataItem="@_selectedEnvelope"
|
||||||
SelectedDataItemChanged="@((object o) => _selectedEnvelope = o as EnvelopeDto)"
|
SelectedDataItemChanged="@((object o) => _selectedEnvelope = o as EnvelopeDto)"
|
||||||
RowClick="OnRowClick"
|
RowClick="OnRowClick"
|
||||||
RowDoubleClick="OnRowDoubleClick"
|
RowDoubleClick="OnRowDoubleClick"
|
||||||
CustomizeElement="OnCustomizeElement"
|
CustomizeElement="OnCustomizeElement"
|
||||||
LayoutAutoLoading="OnGridLayoutAutoLoading"
|
LayoutAutoLoading="OnGridLayoutAutoLoading"
|
||||||
LayoutAutoSaving="OnGridLayoutAutoSaving">
|
LayoutAutoSaving="OnGridLayoutAutoSaving"
|
||||||
<Columns>
|
HighlightRowOnHover="true"
|
||||||
<DxGridDataColumn FieldName="Id" Caption="ID"
|
AutoCollapseDetailRow=true
|
||||||
DisplayFormat="0"
|
DetailExpandButtonDisplayMode="GridDetailExpandButtonDisplayMode.Auto">
|
||||||
SortIndex="0"
|
<Columns>
|
||||||
SortOrder="GridColumnSortOrder.Descending">
|
<DxGridDataColumn FieldName="Id" Caption="ID"
|
||||||
<CellDisplayTemplate Context="cellContext">
|
DisplayFormat="0"
|
||||||
@((cellContext.DataItem as EnvelopeDto)?.Id)
|
SortIndex="0"
|
||||||
</CellDisplayTemplate>
|
SortOrder="GridColumnSortOrder.Descending">
|
||||||
</DxGridDataColumn>
|
<CellDisplayTemplate Context="cellContext">
|
||||||
<DxGridDataColumn FieldName="Title" Caption="@L("Title", "Titel")">
|
@((cellContext.DataItem as EnvelopeDto)?.Id)
|
||||||
<CellDisplayTemplate Context="cellContext">
|
</CellDisplayTemplate>
|
||||||
<strong>@((cellContext.DataItem as EnvelopeDto)?.Title)</strong>
|
</DxGridDataColumn>
|
||||||
</CellDisplayTemplate>
|
<DxGridDataColumn FieldName="Title" Caption="@L("Title", "Titel")">
|
||||||
</DxGridDataColumn>
|
<CellDisplayTemplate Context="cellContext">
|
||||||
<DxGridDataColumn FieldName="Status" Caption="@L("Status", "Status")" ExportEnabled="false">
|
<strong>@((cellContext.DataItem as EnvelopeDto)?.Title)</strong>
|
||||||
<EditSettings>
|
</CellDisplayTemplate>
|
||||||
<DxComboBoxSettings Data="@GetStatusFilterItems(CurrentGridData)"
|
</DxGridDataColumn>
|
||||||
ValueFieldName="Value"
|
<DxGridDataColumn FieldName="Status" Caption="@L("Status", "Status")" ExportEnabled="false">
|
||||||
TextFieldName="Text"
|
<EditSettings>
|
||||||
SearchMode="ListSearchMode.AutoSearch"
|
<DxComboBoxSettings Data="@GetStatusFilterItems(CurrentGridData)"
|
||||||
SearchFilterCondition="ListSearchFilterCondition.Contains" />
|
ValueFieldName="Value"
|
||||||
</EditSettings>
|
TextFieldName="Text"
|
||||||
<CellDisplayTemplate Context="cellContext">
|
SearchMode="ListSearchMode.AutoSearch"
|
||||||
@{
|
SearchFilterCondition="ListSearchFilterCondition.Contains" />
|
||||||
var envelope = cellContext.DataItem as EnvelopeDto;
|
</EditSettings>
|
||||||
if (envelope != null)
|
<CellDisplayTemplate Context="cellContext">
|
||||||
{
|
|
||||||
var statusInfo = GetStatusInfo(GetEffectiveEnvelopeStatus(envelope));
|
|
||||||
<div class="status-badge status-badge--@statusInfo.CssClass">
|
|
||||||
<span class="status-dot status-dot--@statusInfo.DotColor"></span>
|
|
||||||
@statusInfo.Label
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</CellDisplayTemplate>
|
|
||||||
</DxGridDataColumn>
|
|
||||||
<DxGridDataColumn FieldName="EnvelopeReceivers" Caption="@L("Receiver", "Empfänger")" ExportEnabled="false">
|
|
||||||
<CellDisplayTemplate Context="cellContext">
|
|
||||||
@{
|
|
||||||
var envelope = cellContext.DataItem as EnvelopeDto;
|
|
||||||
if (envelope != null)
|
|
||||||
{
|
|
||||||
var receivers = envelope.EnvelopeReceivers?.ToList() ?? [];
|
|
||||||
var signed = GetSignedReceiverCount(envelope);
|
|
||||||
var total = receivers.Count;
|
|
||||||
<div style="display: flex; align-items: center; gap: 0.5rem;">
|
|
||||||
<span style="font-size: 0.875rem; color: #6b7280;">
|
|
||||||
@signed / @total @L("Signed", "unterschrieben")
|
|
||||||
</span>
|
|
||||||
@if (total > 0)
|
|
||||||
{
|
|
||||||
<div style="flex: 1; min-width: 60px; max-width: 120px; height: 6px; background: #e5e7eb; border-radius: 3px; overflow: hidden;">
|
|
||||||
<div style="height: 100%; background: linear-gradient(90deg, #81c784 0%, #66bb6a 100%); width: @((signed * 100.0 / total).ToString("F0"))%;"></div>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</CellDisplayTemplate>
|
|
||||||
</DxGridDataColumn>
|
|
||||||
<DxGridDataColumn FieldName="EnvelopeTypeTitle" Caption="@L("Type", "Typ")"
|
|
||||||
Width="120px" AllowSort="true" />
|
|
||||||
<DxGridDataColumn FieldName="AddedWhen" Caption="@L("Created", "Erstellt")"
|
|
||||||
DisplayFormat="{0:dd.MM.yyyy}" Width="110px" AllowSort="true" />
|
|
||||||
<DxGridDataColumn FieldName="ChangedWhen" Caption="@L("ChangedAt", "Geändert am")"
|
|
||||||
DisplayFormat="{0:dd.MM.yyyy}" Width="110px" AllowSort="true" />
|
|
||||||
</Columns>
|
|
||||||
<DetailRowTemplate Context="detailContext">
|
|
||||||
<div style="padding: 1rem; background: #f9fafb;">
|
|
||||||
<h6 style="font-weight: 600; color: #374151; margin-bottom: 0.75rem;">@L("Receiver", "Empfänger")</h6>
|
|
||||||
@{
|
@{
|
||||||
var envelope = detailContext.DataItem as EnvelopeDto;
|
var envelope = cellContext.DataItem as EnvelopeDto;
|
||||||
if (envelope?.EnvelopeReceivers?.Any() == true)
|
if (envelope != null)
|
||||||
{
|
{
|
||||||
<div style="display: flex; flex-direction: column; gap: 0.5rem;">
|
var statusInfo = GetStatusInfo(GetEffectiveEnvelopeStatus(envelope));
|
||||||
@foreach (var receiver in envelope.EnvelopeReceivers)
|
<div class="status-badge status-badge--@statusInfo.CssClass">
|
||||||
|
<span class="status-dot status-dot--@statusInfo.DotColor"></span>
|
||||||
|
@statusInfo.Label
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</CellDisplayTemplate>
|
||||||
|
</DxGridDataColumn>
|
||||||
|
<DxGridDataColumn FieldName="EnvelopeReceivers" Caption="@L("Receiver", "Empfänger")" ExportEnabled="false">
|
||||||
|
<CellDisplayTemplate Context="cellContext">
|
||||||
|
@{
|
||||||
|
var envelope = cellContext.DataItem as EnvelopeDto;
|
||||||
|
if (envelope != null)
|
||||||
|
{
|
||||||
|
var receivers = envelope.EnvelopeReceivers?.ToList() ?? [];
|
||||||
|
var signed = GetSignedReceiverCount(envelope);
|
||||||
|
var total = receivers.Count;
|
||||||
|
<div style="display: flex; align-items: center; gap: 0.5rem;">
|
||||||
|
<span style="font-size: 0.875rem; color: #6b7280;">
|
||||||
|
@signed / @total @L("Signed", "unterschrieben")
|
||||||
|
</span>
|
||||||
|
@if (total > 0)
|
||||||
{
|
{
|
||||||
<div style="display: flex; align-items: center; gap: 1rem; padding: 0.5rem; background: white; border-radius: 6px; border: 1px solid #e5e7eb;">
|
<div style="flex: 1; min-width: 60px; max-width: 120px; height: 6px; background: #e5e7eb; border-radius: 3px; overflow: hidden;">
|
||||||
@{
|
<div style="height: 100%; background: linear-gradient(90deg, #81c784 0%, #66bb6a 100%); width: @((signed * 100.0 / total).ToString("F0"))%;"></div>
|
||||||
var isRejected = IsReceiverRejected(envelope, receiver);
|
|
||||||
var isSigned = IsReceiverSigned(envelope, receiver);
|
|
||||||
var accessCode = receiver.AccessCode;
|
|
||||||
var hasAccessCode = !string.IsNullOrWhiteSpace(accessCode);
|
|
||||||
}
|
|
||||||
<span class="receiver-badge receiver-badge--@(isRejected ? "unsigned" : (isSigned ? "signed" : "unsigned"))" style="min-width: 100px;">
|
|
||||||
@if (isRejected)
|
|
||||||
{
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="currentColor" viewBox="0 0 16 16">
|
|
||||||
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.646a.5.5 0 0 0 .708.708L8 8.707l2.646 2.647a.5.5 0 0 0 .708-.708L8.707 8l2.647-2.646a.5.5 0 0 0-.708-.708L8 7.293 5.354 4.646z" />
|
|
||||||
</svg>
|
|
||||||
<span>@GetStatusLabel(EnvelopeStatus.DocumentRejected)</span>
|
|
||||||
}
|
|
||||||
else if (isSigned)
|
|
||||||
{
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="currentColor" viewBox="0 0 16 16">
|
|
||||||
<path d="M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z" />
|
|
||||||
</svg>
|
|
||||||
<span>@L("Signed", "Unterschrieben")</span>
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="currentColor" viewBox="0 0 16 16">
|
|
||||||
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z" />
|
|
||||||
<path d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z" />
|
|
||||||
</svg>
|
|
||||||
<span>@L("Pending", "Ausstehend")</span>
|
|
||||||
}
|
|
||||||
</span>
|
|
||||||
<div style="flex: 1; font-size: 0.875rem;">
|
|
||||||
<strong style="color: #1f2937;">@receiver.Name</strong>
|
|
||||||
<span style="color: #6b7280; margin-left: 0.5rem;">@receiver.Receiver?.EmailAddress</span>
|
|
||||||
</div>
|
|
||||||
<div class="sender-access-code">
|
|
||||||
<span class="sender-access-code__label">@L("AccessCode", "Access code")</span>
|
|
||||||
<div class="sender-access-code__row">
|
|
||||||
<input class="sender-access-code__value"
|
|
||||||
value="@(hasAccessCode ? accessCode : "-")"
|
|
||||||
readonly
|
|
||||||
title="@L("AccessCode", "Access code")" />
|
|
||||||
<button type="button"
|
|
||||||
class="sender-access-code__copy"
|
|
||||||
disabled="@(!hasAccessCode)"
|
|
||||||
@onclick='() => CopyAccessCodeAsync(accessCode)'
|
|
||||||
title="@L("Copy", "Copy")">
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="currentColor" viewBox="0 0 16 16" aria-hidden="true">
|
|
||||||
<path d="M10 1.5A1.5 1.5 0 0 1 11.5 3v1H13A1.5 1.5 0 0 1 14.5 5.5v8A1.5 1.5 0 0 1 13 15H5A1.5 1.5 0 0 1 3.5 13.5V12H3A1.5 1.5 0 0 1 1.5 10.5v-8A1.5 1.5 0 0 1 3 1h7zm.5 2A.5.5 0 0 0 10 3H3a.5.5 0 0 0-.5.5v7A.5.5 0 0 0 3 11h.5V5.5A1.5 1.5 0 0 1 5 4h5.5v-.5zM5 5a.5.5 0 0 0-.5.5v8a.5.5 0 0 0 .5.5h8a.5.5 0 0 0 .5-.5v-8A.5.5 0 0 0 13 5H5z"/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
{
|
</CellDisplayTemplate>
|
||||||
<p style="color: #9ca3af; font-size: 0.875rem; margin: 0;">@L("Sender_NoReceivers", "Keine Empfänger")</p>
|
</DxGridDataColumn>
|
||||||
}
|
<DxGridDataColumn FieldName="EnvelopeTypeTitle" Caption="@L("Type", "Typ")"
|
||||||
|
Width="120px" AllowSort="true" />
|
||||||
|
<DxGridDataColumn FieldName="AddedWhen" Caption="@L("Created", "Erstellt")"
|
||||||
|
DisplayFormat="{0:dd.MM.yyyy}" Width="110px" AllowSort="true" />
|
||||||
|
<DxGridDataColumn FieldName="ChangedWhen" Caption="@L("ChangedAt", "Geändert am")"
|
||||||
|
DisplayFormat="{0:dd.MM.yyyy}" Width="110px" AllowSort="true" />
|
||||||
|
</Columns>
|
||||||
|
<DetailRowTemplate Context="detailContext">
|
||||||
|
<div style="padding: 1rem; background: #f9fafb;">
|
||||||
|
<h6 style="font-weight: 600; color: #374151; margin-bottom: 0.75rem;">@L("Receiver", "Empfänger")</h6>
|
||||||
|
@{
|
||||||
|
var envelope = detailContext.DataItem as EnvelopeDto;
|
||||||
|
if(envelope is not null && _grid is not null)
|
||||||
|
{
|
||||||
|
_grid.SelectDataItem(envelope);
|
||||||
|
// _grid!.SelectedDataItem = envelope!;
|
||||||
}
|
}
|
||||||
|
|
||||||
<h6 style="font-weight: 600; color: #374151; margin: 1rem 0 0.75rem;">@L("History", "Historie")</h6>
|
if (envelope?.EnvelopeReceivers?.Any() == true)
|
||||||
@{
|
{
|
||||||
var historyEntries = envelope is null
|
<div style="display: flex; flex-direction: column; gap: 0.5rem;">
|
||||||
? Enumerable.Empty<HistoryDto>()
|
@foreach (var receiver in envelope.EnvelopeReceivers)
|
||||||
: GetOrderedHistories(envelope);
|
{
|
||||||
if (historyEntries.Any())
|
<div style="display: flex; align-items: center; gap: 1rem; padding: 0.5rem; background: white; border-radius: 6px; border: 1px solid #e5e7eb;">
|
||||||
{
|
@{
|
||||||
<div class="sender-history-list">
|
var isRejected = IsReceiverRejected(envelope, receiver);
|
||||||
@foreach (var history in historyEntries)
|
var isSigned = IsReceiverSigned(envelope, receiver);
|
||||||
{
|
var accessCode = receiver.AccessCode;
|
||||||
var statusInfo = GetStatusInfo(history.Status);
|
var hasAccessCode = !string.IsNullOrWhiteSpace(accessCode);
|
||||||
<div class="sender-history-item">
|
var hasReceiverEnvelopeUrl = CanOpenReceiverEnvelopeUrl(envelope, receiver);
|
||||||
<div class="sender-history-item__left">
|
}
|
||||||
<div class="status-badge status-badge--@statusInfo.CssClass">
|
<span class="receiver-badge receiver-badge--@(isRejected ? "unsigned" : (isSigned ? "signed" : "unsigned"))" style="min-width: 100px;">
|
||||||
<span class="status-dot status-dot--@statusInfo.DotColor"></span>
|
@if (isRejected)
|
||||||
@statusInfo.Label
|
{
|
||||||
</div>
|
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="currentColor" viewBox="0 0 16 16">
|
||||||
<span class="sender-history-item__actor">@GetHistoryActor(history)</span>
|
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.646a.5.5 0 0 0 .708.708L8 8.707l2.646 2.647a.5.5 0 0 0 .708-.708L8.707 8l2.647-2.646a.5.5 0 0 0-.708-.708L8 7.293 5.354 4.646z" />
|
||||||
</div>
|
</svg>
|
||||||
<div class="sender-history-item__right">
|
<span>@GetStatusLabel(EnvelopeStatus.DocumentRejected)</span>
|
||||||
@GetHistoryDate(history).ToString("dd.MM.yyyy HH:mm")
|
}
|
||||||
|
else if (isSigned)
|
||||||
|
{
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="currentColor" viewBox="0 0 16 16">
|
||||||
|
<path d="M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z" />
|
||||||
|
</svg>
|
||||||
|
<span>@L("Signed", "Unterschrieben")</span>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="currentColor" viewBox="0 0 16 16">
|
||||||
|
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z" />
|
||||||
|
<path d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z" />
|
||||||
|
</svg>
|
||||||
|
<span>@L("Pending", "Ausstehend")</span>
|
||||||
|
}
|
||||||
|
</span>
|
||||||
|
<div style="flex: 1; font-size: 0.875rem;">
|
||||||
|
<strong style="color: #1f2937;">@receiver.Name</strong>
|
||||||
|
<span style="color: #6b7280; margin-left: 0.5rem;">@receiver.Receiver?.EmailAddress</span>
|
||||||
|
</div>
|
||||||
|
<div class="sender-access-code">
|
||||||
|
<span class="sender-access-code__label">@L("AccessCode", "Access code")</span>
|
||||||
|
<div class="sender-access-code__row">
|
||||||
|
<input class="sender-access-code__value"
|
||||||
|
value="@(hasAccessCode ? accessCode : "-")"
|
||||||
|
readonly
|
||||||
|
title="@L("AccessCode", "Access code")" />
|
||||||
|
<button type="button"
|
||||||
|
class="sender-access-code__copy"
|
||||||
|
disabled="@(!hasAccessCode)"
|
||||||
|
@onclick='() => CopyAccessCodeAsync(accessCode)'
|
||||||
|
title="@L("Copy", "Copy")">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="currentColor" viewBox="0 0 16 16" aria-hidden="true">
|
||||||
|
<path d="M10 1.5A1.5 1.5 0 0 1 11.5 3v1H13A1.5 1.5 0 0 1 14.5 5.5v8A1.5 1.5 0 0 1 13 15H5A1.5 1.5 0 0 1 3.5 13.5V12H3A1.5 1.5 0 0 1 1.5 10.5v-8A1.5 1.5 0 0 1 3 1h7zm.5 2A.5.5 0 0 0 10 3H3a.5.5 0 0 0-.5.5v7A.5.5 0 0 0 3 11h.5V5.5A1.5 1.5 0 0 1 5 4h5.5v-.5zM5 5a.5.5 0 0 0-.5.5v8a.5.5 0 0 0 .5.5h8a.5.5 0 0 0 .5-.5v-8A.5.5 0 0 0 13 5H5z"/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
@if (_canUseReceiverEnvelopeUrl)
|
||||||
|
{
|
||||||
|
<button type="button"
|
||||||
|
class="sender-access-code__copy"
|
||||||
|
disabled="@(!hasReceiverEnvelopeUrl)"
|
||||||
|
@onclick='() => OpenReceiverEnvelopeUrlAsync(envelope, receiver)'
|
||||||
|
title="@L("Open", "Open")">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="currentColor" viewBox="0 0 16 16" aria-hidden="true">
|
||||||
|
<path fill-rule="evenodd" d="M6.364 13.5a1.5 1.5 0 0 1-1.5-1.5V4a1.5 1.5 0 0 1 1.5-1.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 0-.5.5v8a.5.5 0 0 0 .5.5h8a.5.5 0 0 0 .5-.5v-4a.5.5 0 0 1 1 0v4a1.5 1.5 0 0 1-1.5 1.5h-8z"/>
|
||||||
|
<path fill-rule="evenodd" d="M8.5 1a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v5a.5.5 0 0 1-1 0V2.707L8.854 7.354a.5.5 0 1 1-.708-.708L12.793 2H9a.5.5 0 0 1-.5-.5z"/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
</div>
|
||||||
</div>
|
}
|
||||||
}
|
</div>
|
||||||
else
|
|
||||||
{
|
|
||||||
<p style="color: #9ca3af; font-size: 0.875rem; margin: 0;">@L("Sender_NoHistory", "Keine Historie vorhanden")</p>
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</div>
|
else
|
||||||
</DetailRowTemplate>
|
{
|
||||||
</DxGrid>
|
<p style="color: #9ca3af; font-size: 0.875rem; margin: 0;">@L("Sender_NoReceivers", "Keine Empfänger")</p>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
<h6 style="font-weight: 600; color: #374151; margin: 1rem 0 0.75rem;">@L("History", "Historie")</h6>
|
||||||
|
@{
|
||||||
|
var historyEntries = envelope is null
|
||||||
|
? Enumerable.Empty<HistoryDto>()
|
||||||
|
: GetOrderedHistories(envelope);
|
||||||
|
if (historyEntries.Any())
|
||||||
|
{
|
||||||
|
<div class="sender-history-list">
|
||||||
|
@foreach (var history in historyEntries)
|
||||||
|
{
|
||||||
|
var statusInfo = GetStatusInfo(history.Status);
|
||||||
|
<div class="sender-history-item">
|
||||||
|
<div class="sender-history-item__left">
|
||||||
|
<div class="status-badge status-badge--@statusInfo.CssClass">
|
||||||
|
<span class="status-dot status-dot--@statusInfo.DotColor"></span>
|
||||||
|
@statusInfo.Label
|
||||||
|
</div>
|
||||||
|
<span class="sender-history-item__actor">@GetHistoryActor(history)</span>
|
||||||
|
</div>
|
||||||
|
<div class="sender-history-item__right">
|
||||||
|
@GetHistoryDate(history).ToString("dd.MM.yyyy HH:mm")
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<p style="color: #9ca3af; font-size: 0.875rem; margin: 0;">@L("Sender_NoHistory", "Keine Historie vorhanden")</p>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</DetailRowTemplate>
|
||||||
|
</DxGrid>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
@@ -419,13 +450,13 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<CreateEnvelopeWizardPopup Visible="@_createWizardVisible"
|
<CreateEnvelopeWizardPopup Visible="@_createWizardVisible"
|
||||||
VisibleChanged="OnCreateWizardVisibleChangedAsync"
|
VisibleChanged="OnCreateWizardVisibleChangedAsync"
|
||||||
EnvelopeTypes="@_envelopeTypes"
|
EnvelopeTypes="@_envelopeTypes"
|
||||||
StartEditorRequested="StartEditorFromWizardAsync" />
|
StartEditorRequested="StartEditorFromWizardAsync" />
|
||||||
|
|
||||||
@* ── PDF Vorschau Popup ────────────────────────────────────────────────── *@
|
@* ── PDF Vorschau Popup ────────────────────────────────────────────────── *@
|
||||||
<DxPopup @bind-Visible="@_previewVisible"
|
<DxPopup @bind-Visible="@_previewVisible"
|
||||||
HeaderText="@($"{(_activeTab == "completed" && _selectedEnvelope?.Status == EnvelopeStatus.EnvelopeCompletelySigned ? L("SignedPdf", "Signiertes PDF") : L("Preview", "Vorschau"))} — {_selectedEnvelope?.Title} (#{_selectedEnvelope?.Id})")"
|
HeaderText="@($"{(_activeTab == "completed" && _selectedEnvelope?.Status == EnvelopeStatus.EnvelopeCompletelySigned ? L("SignedPdf", "Signiertes PDF") : L("Sender_OriginalDocument", "Originaldokument"))} — {_selectedEnvelope?.Title} (#{_selectedEnvelope?.Id})")"
|
||||||
Width="80vw"
|
Width="80vw"
|
||||||
MaxWidth="80vw"
|
MaxWidth="80vw"
|
||||||
Height="90vh"
|
Height="90vh"
|
||||||
@@ -474,6 +505,22 @@
|
|||||||
else if (_previewPdfBytes is not null && _previewViewerMounted)
|
else if (_previewPdfBytes is not null && _previewViewerMounted)
|
||||||
{
|
{
|
||||||
<div class="sender-preview-viewer-wrap">
|
<div class="sender-preview-viewer-wrap">
|
||||||
|
@if (_showPreviewHint)
|
||||||
|
{
|
||||||
|
<div class="sender-preview-info" style="display:flex;align-items:center;justify-content:space-between;gap:0.5rem;padding:0.625rem 0.75rem;margin:0 0 0.5rem 0;background:#eff6ff;border:1px solid #bfdbfe;border-radius:8px;color:#1e3a8a;font-size:0.85rem;">
|
||||||
|
<span>@L("Sender_OriginalDocument_NoSignatureFieldsHint", "Hinweis: In dieser Ansicht werden keine Unterschriftsfelder angezeigt.")</span>
|
||||||
|
<button type="button"
|
||||||
|
class="sender-preview-info__close"
|
||||||
|
@onclick="DismissPreviewHint"
|
||||||
|
title="@L("Close", "Schliessen")"
|
||||||
|
aria-label="@L("Close", "Schliessen")"
|
||||||
|
style="display:inline-flex;align-items:center;justify-content:center;padding:0.125rem;border:none;background:transparent;box-shadow:none;appearance:none;cursor:pointer;color:#1e3a8a;line-height:1;">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="currentColor" viewBox="0 0 16 16" aria-hidden="true" focusable="false">
|
||||||
|
<path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.75.75 0 1 1 1.06 1.06L9.06 8l3.22 3.22a.75.75 0 1 1-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 1 1-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06z"/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
<SenderPdfImageEditor IsPlacementMode="false"
|
<SenderPdfImageEditor IsPlacementMode="false"
|
||||||
PageCount="@_previewPageCount"
|
PageCount="@_previewPageCount"
|
||||||
Pages="@_previewPagePreviews"
|
Pages="@_previewPagePreviews"
|
||||||
@@ -544,6 +591,7 @@
|
|||||||
private string _activeTab = "active";
|
private string _activeTab = "active";
|
||||||
private bool _isLoading = true;
|
private bool _isLoading = true;
|
||||||
private bool _isLoggingOut = false;
|
private bool _isLoggingOut = false;
|
||||||
|
private bool _canUseReceiverEnvelopeUrl = false;
|
||||||
private string? _errorMessage;
|
private string? _errorMessage;
|
||||||
private DxGrid? _grid;
|
private DxGrid? _grid;
|
||||||
|
|
||||||
@@ -561,6 +609,9 @@
|
|||||||
private string _previewFileName = "document.pdf";
|
private string _previewFileName = "document.pdf";
|
||||||
private string? _previewErrorMessage = null;
|
private string? _previewErrorMessage = null;
|
||||||
private readonly IReadOnlyList<SenderPdfFieldOverlay> _previewFieldOverlays = [];
|
private readonly IReadOnlyList<SenderPdfFieldOverlay> _previewFieldOverlays = [];
|
||||||
|
private bool _showPreviewHint = false;
|
||||||
|
private int _previewHintVersion = 0;
|
||||||
|
private const int PreviewHintAutoHideMs = 4000;
|
||||||
|
|
||||||
private string? PreviewPdfDataUrl => _previewPdfBytes is { Length: > 0 }
|
private string? PreviewPdfDataUrl => _previewPdfBytes is { Length: > 0 }
|
||||||
? $"data:application/pdf;base64,{Convert.ToBase64String(_previewPdfBytes)}"
|
? $"data:application/pdf;base64,{Convert.ToBase64String(_previewPdfBytes)}"
|
||||||
@@ -577,11 +628,14 @@
|
|||||||
private string? _deleteErrorMessage;
|
private string? _deleteErrorMessage;
|
||||||
|
|
||||||
private bool _createWizardVisible = false;
|
private bool _createWizardVisible = false;
|
||||||
private IReadOnlyList<EnvelopeTypeDto> _envelopeTypes = [];
|
private IReadOnlyList<EnvelopeTypeDefaultsDto> _envelopeTypes = [];
|
||||||
|
|
||||||
// Stable keys used to store/restore each tab's layout in UserPreferences.GridLayouts
|
// StableDefaults keys used to store/restore each tab's layout in UserPreferences.GridLayouts
|
||||||
private const string GridKeyActive = "sender.active-envelopes";
|
private const string GridKeyActive = "sender.active-envelopes";
|
||||||
private const string GridKeyCompleted = "sender.completed-envelopes";
|
private const string GridKeyCompleted = "sender.completed-envelopes";
|
||||||
|
private const string InitialStateKey = "sender-page.initial-state.v1";
|
||||||
|
|
||||||
|
private PersistingComponentStateSubscription? _persistingSubscription;
|
||||||
|
|
||||||
private IEnumerable<EnvelopeDto> CurrentGridData =>
|
private IEnumerable<EnvelopeDto> CurrentGridData =>
|
||||||
(_activeTab == "completed" ? _completedEnvelopes : _activeEnvelopes) ?? Enumerable.Empty<EnvelopeDto>();
|
(_activeTab == "completed" ? _completedEnvelopes : _activeEnvelopes) ?? Enumerable.Empty<EnvelopeDto>();
|
||||||
@@ -590,6 +644,11 @@
|
|||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
|
_persistingSubscription ??= PersistentComponentState.RegisterOnPersisting(PersistInitialStateAsync);
|
||||||
|
|
||||||
|
if (TryRestoreInitialState())
|
||||||
|
return;
|
||||||
|
|
||||||
var hasAccess = await AuthService.CheckSenderAccessAsync();
|
var hasAccess = await AuthService.CheckSenderAccessAsync();
|
||||||
if (!hasAccess)
|
if (!hasAccess)
|
||||||
{
|
{
|
||||||
@@ -597,20 +656,29 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load theme + DisplayName from server after authentication.
|
// Fan out all independent post-auth calls in parallel to reduce initial load time.
|
||||||
// Non-fatal: if this fails the page still loads with default theme.
|
var themeTask = Task.Run(async () =>
|
||||||
// ThemeService.ScheduleSaveAsync() already logs errors internally.
|
{
|
||||||
try { await ThemeService.LoadFromServerAsync(); }
|
try { await ThemeService.LoadFromServerAsync(); }
|
||||||
catch { /* swallow — default theme remains active */ }
|
catch { /* swallow — default theme remains active */ }
|
||||||
|
});
|
||||||
|
|
||||||
// Load logo config — authenticated, so this should succeed
|
var featureTask = EnvelopeReceiverService.GetReceiverEnvelopeUrlFeatureEnabledAsync();
|
||||||
var logos = await CustomImagesService.GetAsync();
|
var logosTask = CustomImagesService.GetAsync();
|
||||||
|
var typesTask = EnvelopeTypeService.GetAsync();
|
||||||
|
var envelopesTask = EnvelopeService.GetAsync(includeDocAndDocRes: false);
|
||||||
|
|
||||||
|
await Task.WhenAll(themeTask, featureTask, logosTask, typesTask, envelopesTask);
|
||||||
|
|
||||||
|
_canUseReceiverEnvelopeUrl = await featureTask;
|
||||||
|
|
||||||
|
var logos = await logosTask;
|
||||||
_appLogo = logos.App;
|
_appLogo = logos.App;
|
||||||
_companyLogo = logos.Company;
|
_companyLogo = logos.Company;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_envelopeTypes = (await EnvelopeTypeService.GetAsync()).ToList();
|
_envelopeTypes = (await typesTask).ToList();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -618,7 +686,8 @@
|
|||||||
_envelopeTypes = [];
|
_envelopeTypes = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
await LoadEnvelopesAsync();
|
// Use already-fetched envelope data instead of a second HTTP call.
|
||||||
|
await ApplyEnvelopeResultAsync(envelopesTask);
|
||||||
}
|
}
|
||||||
|
|
||||||
async Task LoadEnvelopesAsync()
|
async Task LoadEnvelopesAsync()
|
||||||
@@ -626,16 +695,16 @@
|
|||||||
_isLoading = true;
|
_isLoading = true;
|
||||||
_errorMessage = null;
|
_errorMessage = null;
|
||||||
await InvokeAsync(StateHasChanged);
|
await InvokeAsync(StateHasChanged);
|
||||||
|
await ApplyEnvelopeResultAsync(EnvelopeService.GetAsync(includeDocAndDocRes: false));
|
||||||
|
}
|
||||||
|
|
||||||
|
async Task ApplyEnvelopeResultAsync(Task<IEnumerable<EnvelopeDto>?> envelopesTask)
|
||||||
|
{
|
||||||
|
_isLoading = true;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_allEnvelopes = await EnvelopeService.GetAsync() ?? [];
|
var envelopes = await envelopesTask;
|
||||||
|
ApplyEnvelopeData(envelopes);
|
||||||
// Split into active and completed based on effective status
|
|
||||||
// (history-aware: rejected envelopes should not stay in active tab).
|
|
||||||
var envelopes = _allEnvelopes.ToList();
|
|
||||||
_activeEnvelopes = envelopes.Where(e => GetEffectiveEnvelopeStatus(e).IsActive()).ToList();
|
|
||||||
_completedEnvelopes = envelopes.Where(e => GetEffectiveEnvelopeStatus(e).IsCompleted()).ToList();
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -648,6 +717,57 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ApplyEnvelopeData(IEnumerable<EnvelopeDto>? envelopes)
|
||||||
|
{
|
||||||
|
_allEnvelopes = envelopes ?? [];
|
||||||
|
|
||||||
|
// Split into active and completed based on effective status
|
||||||
|
// (history-aware: rejected envelopes should not stay in active tab).
|
||||||
|
var list = _allEnvelopes.ToList();
|
||||||
|
_activeEnvelopes = list.Where(e => GetEffectiveEnvelopeStatus(e).IsActive()).ToList();
|
||||||
|
_completedEnvelopes = list.Where(e => GetEffectiveEnvelopeStatus(e).IsCompleted()).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TryRestoreInitialState()
|
||||||
|
{
|
||||||
|
if (!PersistentComponentState.TryTakeFromJson<SenderPageInitialState>(InitialStateKey, out var state) || state is null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
_canUseReceiverEnvelopeUrl = state.CanUseReceiverEnvelopeUrl;
|
||||||
|
_appLogo = state.AppLogo;
|
||||||
|
_companyLogo = state.CompanyLogo;
|
||||||
|
_envelopeTypes = state.EnvelopeTypes;
|
||||||
|
ApplyEnvelopeData(state.Envelopes);
|
||||||
|
_errorMessage = null;
|
||||||
|
_isLoading = false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Task PersistInitialStateAsync()
|
||||||
|
{
|
||||||
|
if (_allEnvelopes is null || !string.IsNullOrWhiteSpace(_errorMessage))
|
||||||
|
return Task.CompletedTask;
|
||||||
|
|
||||||
|
var state = new SenderPageInitialState
|
||||||
|
{
|
||||||
|
CanUseReceiverEnvelopeUrl = _canUseReceiverEnvelopeUrl,
|
||||||
|
AppLogo = _appLogo,
|
||||||
|
CompanyLogo = _companyLogo,
|
||||||
|
EnvelopeTypes = _envelopeTypes?.ToList() ?? [],
|
||||||
|
Envelopes = _allEnvelopes.ToList()
|
||||||
|
};
|
||||||
|
|
||||||
|
PersistentComponentState.PersistAsJson(InitialStateKey, state);
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
_persistingSubscription?.Dispose();
|
||||||
|
_persistingSubscription = null;
|
||||||
|
}
|
||||||
|
|
||||||
async Task RefreshEnvelopes()
|
async Task RefreshEnvelopes()
|
||||||
{
|
{
|
||||||
await LoadEnvelopesAsync();
|
await LoadEnvelopesAsync();
|
||||||
@@ -726,29 +846,43 @@
|
|||||||
|
|
||||||
async Task StartEditorFromWizardAsync(CreateEnvelopeWizardResult result)
|
async Task StartEditorFromWizardAsync(CreateEnvelopeWizardResult result)
|
||||||
{
|
{
|
||||||
var payload = new CreateEnvelopeBootstrapPayload(
|
var docBase64 = result.DocumentBytes is { Length: > 0 }
|
||||||
Title: result.Title,
|
? Convert.ToBase64String(result.DocumentBytes)
|
||||||
Message: result.Message,
|
: null;
|
||||||
EnvelopeTypeId: result.EnvelopeTypeId,
|
|
||||||
Language: result.Language,
|
|
||||||
UseAccessCode: result.UseAccessCode,
|
|
||||||
TFAEnabled: result.TFAEnabled,
|
|
||||||
CertificationType: result.CertificationType,
|
|
||||||
FinalEmailToCreator: result.FinalEmailToCreator,
|
|
||||||
FinalEmailToReceivers: result.FinalEmailToReceivers,
|
|
||||||
SendReminderEmails: result.SendReminderEmails,
|
|
||||||
FirstReminderDays: result.FirstReminderDays,
|
|
||||||
ReminderIntervalDays: result.ReminderIntervalDays,
|
|
||||||
ExpiresWhenDays: result.ExpiresWhenDays,
|
|
||||||
ExpiresWarningWhenDays: result.ExpiresWarningWhenDays,
|
|
||||||
Receivers: result.Receivers
|
|
||||||
.Select(x => new CreateEnvelopeBootstrapReceiver(x.FullName, x.EmailAddress))
|
|
||||||
.ToList(),
|
|
||||||
DocumentBytes: result.DocumentBytes,
|
|
||||||
DocumentFileName: result.DocumentFileName);
|
|
||||||
|
|
||||||
var token = await CreateEnvelopeBootstrapStorageService.StoreAsync(payload);
|
var command = new CreateEnvelopeCommand
|
||||||
Navigation.NavigateTo($"/sender/editor?bootstrapToken={token}");
|
{
|
||||||
|
Type = result.Type,
|
||||||
|
Title = result.Title,
|
||||||
|
Message = result.Message,
|
||||||
|
Language = string.IsNullOrWhiteSpace(result.Language) ? "de-DE" : result.Language,
|
||||||
|
UseAccessCode = result.UseAccessCode,
|
||||||
|
TFAEnabled = result.TFAEnabled,
|
||||||
|
FinalEmailToCreator = result.FinalEmailToCreator,
|
||||||
|
FinalEmailToReceivers = result.FinalEmailToReceivers,
|
||||||
|
SendReminderEmails = result.SendReminderEmails,
|
||||||
|
FirstReminderDays = result.FirstReminderDays,
|
||||||
|
ReminderIntervalDays = result.ReminderIntervalDays,
|
||||||
|
ExpiresWhenDays = result.ExpiresWhenDays,
|
||||||
|
ExpiresWarningWhenDays = result.ExpiresWarningWhenDays,
|
||||||
|
Send = false,
|
||||||
|
Document = string.IsNullOrWhiteSpace(docBase64) ? null : new CreateEnvelopeDocumentDto(docBase64),
|
||||||
|
Receivers = result.Receivers
|
||||||
|
.Select(x => new CreateEnvelopeReceiverDto(x.EmailAddress, x.FullName, null, []))
|
||||||
|
.ToList()
|
||||||
|
};
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var envelope = await EnvelopeService.UpsertAsync(command)
|
||||||
|
?? throw new InvalidOperationException("Envelope creation returned no result.");
|
||||||
|
Navigation.NavigateTo($"/sender/editor?envelopeId={envelope.Id}");
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logger.LogError(ex, "Failed to create envelope from wizard.");
|
||||||
|
_errorMessage = ex.Message;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditEnvelope()
|
void EditEnvelope()
|
||||||
@@ -987,6 +1121,35 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async Task OpenReceiverEnvelopeUrlAsync(EnvelopeDto envelope, EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver.EnvelopeReceiverDto receiver)
|
||||||
|
{
|
||||||
|
if (!_canUseReceiverEnvelopeUrl)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!CanOpenReceiverEnvelopeUrl(envelope, receiver))
|
||||||
|
return;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var receiverEnvelopeUrl = await EnvelopeReceiverService.GetReceiverEnvelopeUrlAsync(
|
||||||
|
envelope.Uuid,
|
||||||
|
receiver.Receiver!.Signature!);
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(receiverEnvelopeUrl))
|
||||||
|
return;
|
||||||
|
|
||||||
|
await JSRuntime.InvokeVoidAsync("open", receiverEnvelopeUrl, "_blank", "noopener,noreferrer");
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
await JSRuntime.InvokeVoidAsync("console.warn", "[Sender] Failed to open receiver envelope URL.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool CanOpenReceiverEnvelopeUrl(EnvelopeDto envelope, EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver.EnvelopeReceiverDto receiver)
|
||||||
|
=> !string.IsNullOrWhiteSpace(envelope.Uuid)
|
||||||
|
&& !string.IsNullOrWhiteSpace(receiver.Receiver?.Signature);
|
||||||
|
|
||||||
void OnCustomizeElement(GridCustomizeElementEventArgs e)
|
void OnCustomizeElement(GridCustomizeElementEventArgs e)
|
||||||
{
|
{
|
||||||
// Future: Add custom row coloring based on status if needed
|
// Future: Add custom row coloring based on status if needed
|
||||||
@@ -999,13 +1162,19 @@
|
|||||||
var clicked = e.Grid.GetDataItem(e.VisibleIndex) as EnvelopeDto;
|
var clicked = e.Grid.GetDataItem(e.VisibleIndex) as EnvelopeDto;
|
||||||
if (clicked == null) return;
|
if (clicked == null) return;
|
||||||
|
|
||||||
if (_selectedEnvelope?.Id == clicked.Id)
|
if (e.Grid.IsDetailRowExpanded(e.VisibleIndex))
|
||||||
{
|
{
|
||||||
// Same row clicked again → deselect
|
// Already expanded → collapse and deselect
|
||||||
|
e.Grid.CollapseDetailRow(e.VisibleIndex);
|
||||||
_selectedEnvelope = null;
|
_selectedEnvelope = null;
|
||||||
e.Grid.DeselectDataItem(clicked);
|
e.Grid.DeselectDataItem(clicked);
|
||||||
}
|
}
|
||||||
// Different row: @bind-SelectedDataItem already updated _selectedEnvelope
|
else
|
||||||
|
{
|
||||||
|
// Collapsed → expand and select
|
||||||
|
e.Grid.SelectDataItem(clicked);
|
||||||
|
e.Grid.ExpandDetailRow(e.VisibleIndex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Double-click: select the row and open preview popup
|
// Double-click: select the row and open preview popup
|
||||||
@@ -1070,6 +1239,7 @@
|
|||||||
|
|
||||||
// PDF ready — mount the viewer now
|
// PDF ready — mount the viewer now
|
||||||
_previewViewerMounted = true;
|
_previewViewerMounted = true;
|
||||||
|
ShowPreviewHint();
|
||||||
}
|
}
|
||||||
catch (HttpRequestException ex) when ((int?)ex.StatusCode == 404)
|
catch (HttpRequestException ex) when ((int?)ex.StatusCode == 404)
|
||||||
{
|
{
|
||||||
@@ -1094,6 +1264,9 @@
|
|||||||
|
|
||||||
void OnPreviewClosed()
|
void OnPreviewClosed()
|
||||||
{
|
{
|
||||||
|
_previewHintVersion++;
|
||||||
|
_showPreviewHint = false;
|
||||||
|
|
||||||
// Unmount the viewer first — prevent DevExpress async render from
|
// Unmount the viewer first — prevent DevExpress async render from
|
||||||
// accessing the already-disposed byte array
|
// accessing the already-disposed byte array
|
||||||
_previewViewerMounted = false;
|
_previewViewerMounted = false;
|
||||||
@@ -1125,6 +1298,28 @@
|
|||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DismissPreviewHint()
|
||||||
|
{
|
||||||
|
_previewHintVersion++;
|
||||||
|
_showPreviewHint = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ShowPreviewHint()
|
||||||
|
{
|
||||||
|
_showPreviewHint = true;
|
||||||
|
var currentVersion = ++_previewHintVersion;
|
||||||
|
|
||||||
|
_ = Task.Run(async () =>
|
||||||
|
{
|
||||||
|
await Task.Delay(PreviewHintAutoHideMs);
|
||||||
|
if (currentVersion != _previewHintVersion)
|
||||||
|
return;
|
||||||
|
|
||||||
|
_showPreviewHint = false;
|
||||||
|
await InvokeAsync(StateHasChanged);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
static int? EstimatePdfPageCount(byte[]? documentBytes)
|
static int? EstimatePdfPageCount(byte[]? documentBytes)
|
||||||
{
|
{
|
||||||
if (documentBytes is null || documentBytes.Length == 0)
|
if (documentBytes is null || documentBytes.Length == 0)
|
||||||
@@ -1238,5 +1433,14 @@
|
|||||||
prop.SetValue(target, value);
|
prop.SetValue(target, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private sealed class SenderPageInitialState
|
||||||
|
{
|
||||||
|
public bool CanUseReceiverEnvelopeUrl { get; set; }
|
||||||
|
public CustomImageDto? AppLogo { get; set; }
|
||||||
|
public CustomImageDto? CompanyLogo { get; set; }
|
||||||
|
public List<EnvelopeTypeDefaultsDto> EnvelopeTypes { get; set; } = [];
|
||||||
|
public List<EnvelopeDto> Envelopes { get; set; } = [];
|
||||||
|
}
|
||||||
|
|
||||||
private sealed record StatusFilterItem(EnvelopeStatus Value, string Text);
|
private sealed record StatusFilterItem(EnvelopeStatus Value, string Text);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
|
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
|
||||||
using EnvelopeGenerator.Server.Client.Services;
|
using EnvelopeGenerator.Server.Client.Services;
|
||||||
using EnvelopeGenerator.Server.Client.Options;
|
using EnvelopeGenerator.Server.Client.Options;
|
||||||
|
using MudBlazor.Services;
|
||||||
using DevExpress.Blazor.Reporting;
|
using DevExpress.Blazor.Reporting;
|
||||||
using DevExpress.XtraReports.Web.Extensions;
|
using DevExpress.XtraReports.Web.Extensions;
|
||||||
using DevExpress.DataAccess.Web;
|
using DevExpress.DataAccess.Web;
|
||||||
using DevExpress.XtraReports.Services;
|
using DevExpress.XtraReports.Services;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
using EnvelopeGenerator.Application.Common.Configurations;
|
||||||
|
|
||||||
var builder = WebAssemblyHostBuilder.CreateDefault(args);
|
var builder = WebAssemblyHostBuilder.CreateDefault(args);
|
||||||
|
|
||||||
@@ -15,6 +17,7 @@ CultureInfo.DefaultThreadCurrentCulture = cultureInfo;
|
|||||||
CultureInfo.DefaultThreadCurrentUICulture = cultureInfo;
|
CultureInfo.DefaultThreadCurrentUICulture = cultureInfo;
|
||||||
|
|
||||||
builder.Services.AddLocalization();
|
builder.Services.AddLocalization();
|
||||||
|
builder.Services.AddMudServices();
|
||||||
|
|
||||||
// Named HttpClient for API calls (both for services and DevExpress components)
|
// Named HttpClient for API calls (both for services and DevExpress components)
|
||||||
builder.Services.AddHttpClient("EnvelopeGenerator.Server", client =>
|
builder.Services.AddHttpClient("EnvelopeGenerator.Server", client =>
|
||||||
@@ -31,6 +34,8 @@ builder.Services.AddScoped(sp => new HttpClient
|
|||||||
// Configuration Options
|
// Configuration Options
|
||||||
builder.Services.Configure<PdfViewerOptions>(opts =>
|
builder.Services.Configure<PdfViewerOptions>(opts =>
|
||||||
builder.Configuration.GetSection(PdfViewerOptions.SectionName).Bind(opts));
|
builder.Configuration.GetSection(PdfViewerOptions.SectionName).Bind(opts));
|
||||||
|
builder.Services.Configure<SignatureFieldParams>(opts =>
|
||||||
|
builder.Configuration.GetSection(nameof(SignatureFieldParams)).Bind(opts));
|
||||||
|
|
||||||
// Business Services
|
// Business Services
|
||||||
builder.Services.AddScoped<DocumentService>();
|
builder.Services.AddScoped<DocumentService>();
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Http.Json;
|
using System.Net.Http.Json;
|
||||||
|
using EnvelopeGenerator.Application.EnvelopeReceivers.Commands;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Server.Client.Services;
|
namespace EnvelopeGenerator.Server.Client.Services;
|
||||||
|
|
||||||
@@ -37,14 +38,22 @@ public class AuthService(IHttpClientFactory httpClientFactory)
|
|||||||
/// Triggers access code e-mail request flow for the receiver login page.
|
/// Triggers access code e-mail request flow for the receiver login page.
|
||||||
/// Calls POST /api/Auth/envelope-receiver/{key}/request-access-code.
|
/// Calls POST /api/Auth/envelope-receiver/{key}/request-access-code.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public async Task<bool> RequestEnvelopeReceiverAccessCodeAsync(string envelopeKey, CancellationToken cancel = default)
|
public async Task<SendAccessCodeResult?> RequestEnvelopeReceiverAccessCodeAsync(string envelopeKey, bool autoGenerated = true, CancellationToken cancel = default)
|
||||||
{
|
{
|
||||||
using var http = CreateDefaultClient();
|
using var http = CreateDefaultClient();
|
||||||
var response = await http.PostAsync(
|
var response = await http.PostAsync(
|
||||||
$"/api/Auth/envelope-receiver/{Uri.EscapeDataString(envelopeKey)}/request-access-code",
|
$"/api/Auth/envelope-receiver/{Uri.EscapeDataString(envelopeKey)}/request-access-code?autoGenerated={autoGenerated}",
|
||||||
null,
|
null,
|
||||||
cancel);
|
cancel);
|
||||||
return response.IsSuccessStatusCode;
|
|
||||||
|
return response.StatusCode switch
|
||||||
|
{
|
||||||
|
HttpStatusCode.OK => SendAccessCodeResult.Sent,
|
||||||
|
HttpStatusCode.NoContent => SendAccessCodeResult.NoAccessCodeRequired,
|
||||||
|
HttpStatusCode.Conflict => SendAccessCodeResult.AlreadySigned,
|
||||||
|
HttpStatusCode.TooManyRequests => SendAccessCodeResult.RequestLimitExceeded,
|
||||||
|
_ => null
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
using Microsoft.JSInterop;
|
using Microsoft.JSInterop;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Server.Client.Services;
|
namespace EnvelopeGenerator.Server.Client.Services;
|
||||||
@@ -45,13 +46,12 @@ public sealed class CreateEnvelopeBootstrapStorageService(IJSRuntime jsRuntime)
|
|||||||
public sealed record CreateEnvelopeBootstrapPayload(
|
public sealed record CreateEnvelopeBootstrapPayload(
|
||||||
string Title,
|
string Title,
|
||||||
string Message,
|
string Message,
|
||||||
int? EnvelopeTypeId,
|
EnvelopeType? Type,
|
||||||
string Language,
|
string Language,
|
||||||
bool UseAccessCode,
|
bool UseAccessCode,
|
||||||
bool TFAEnabled,
|
bool TFAEnabled,
|
||||||
int CertificationType,
|
FinalEmailType FinalEmailToCreator,
|
||||||
int FinalEmailToCreator,
|
FinalEmailType FinalEmailToReceivers,
|
||||||
int FinalEmailToReceivers,
|
|
||||||
bool SendReminderEmails,
|
bool SendReminderEmails,
|
||||||
int FirstReminderDays,
|
int FirstReminderDays,
|
||||||
int ReminderIntervalDays,
|
int ReminderIntervalDays,
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using System.Net.Http.Json;
|
|||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using EnvelopeGenerator.Application.EnvelopeReceivers.Commands.CreateEnvelopeReceiver;
|
using EnvelopeGenerator.Application.EnvelopeReceivers.Commands.CreateEnvelopeReceiver;
|
||||||
using EnvelopeGenerator.Server.Client.Models;
|
using EnvelopeGenerator.Server.Client.Models;
|
||||||
|
using Microsoft.AspNetCore.WebUtilities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Server.Client.Services;
|
namespace EnvelopeGenerator.Server.Client.Services;
|
||||||
|
|
||||||
@@ -15,6 +16,8 @@ namespace EnvelopeGenerator.Server.Client.Services;
|
|||||||
public class EnvelopeReceiverService(IHttpClientFactory httpClientFactory)
|
public class EnvelopeReceiverService(IHttpClientFactory httpClientFactory)
|
||||||
{
|
{
|
||||||
private static readonly JsonSerializerOptions _jsonOptions = new(JsonSerializerDefaults.Web);
|
private static readonly JsonSerializerOptions _jsonOptions = new(JsonSerializerDefaults.Web);
|
||||||
|
private sealed record ReceiverEnvelopeUrlResponse(string Url);
|
||||||
|
private sealed record ReceiverEnvelopeUrlEnabledResponse(bool Enabled);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Fetches the envelope receiver data for the given envelope key from the API.
|
/// Fetches the envelope receiver data for the given envelope key from the API.
|
||||||
@@ -63,4 +66,59 @@ public class EnvelopeReceiverService(IHttpClientFactory httpClientFactory)
|
|||||||
|
|
||||||
return await response.Content.ReadFromJsonAsync<CreateEnvelopeReceiverResponse>(_jsonOptions, cancel);
|
return await response.Content.ReadFromJsonAsync<CreateEnvelopeReceiverResponse>(_jsonOptions, cancel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<string?> GetReceiverEnvelopeUrlAsync(string envelopeUuid, string receiverSignature, CancellationToken cancel = default)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(envelopeUuid) || string.IsNullOrWhiteSpace(receiverSignature))
|
||||||
|
return null;
|
||||||
|
|
||||||
|
using var http = httpClientFactory.CreateClient("EnvelopeGenerator.Server");
|
||||||
|
var url = $"/api/EnvelopeReceiver/receiver-envelope-url?envelopeUuid={Uri.EscapeDataString(envelopeUuid)}&receiverSignature={Uri.EscapeDataString(receiverSignature)}";
|
||||||
|
var response = await http.GetAsync(url, cancel);
|
||||||
|
|
||||||
|
if (!response.IsSuccessStatusCode)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
var payload = await response.Content.ReadFromJsonAsync<ReceiverEnvelopeUrlResponse>(_jsonOptions, cancel);
|
||||||
|
return payload?.Url;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<bool> GetReceiverEnvelopeUrlFeatureEnabledAsync(CancellationToken cancel = default)
|
||||||
|
{
|
||||||
|
using var http = httpClientFactory.CreateClient("EnvelopeGenerator.Server");
|
||||||
|
var response = await http.GetAsync("/api/EnvelopeReceiver/receiver-envelope-url/enabled", cancel);
|
||||||
|
|
||||||
|
if (!response.IsSuccessStatusCode)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
var payload = await response.Content.ReadFromJsonAsync<ReceiverEnvelopeUrlEnabledResponse>(_jsonOptions, cancel);
|
||||||
|
return payload?.Enabled == true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task DeleteAsync(int envelopeId, int receiverId, CancellationToken cancel = default)
|
||||||
|
{
|
||||||
|
if (envelopeId <= 0)
|
||||||
|
throw new ArgumentOutOfRangeException(nameof(envelopeId));
|
||||||
|
if (receiverId <= 0)
|
||||||
|
throw new ArgumentOutOfRangeException(nameof(receiverId));
|
||||||
|
|
||||||
|
using var http = httpClientFactory.CreateClient("EnvelopeGenerator.Server");
|
||||||
|
var url = QueryHelpers.AddQueryString("/api/EnvelopeReceiver", new Dictionary<string, string?>
|
||||||
|
{
|
||||||
|
["EnvelopeId"] = envelopeId.ToString(),
|
||||||
|
["ReceiverId"] = receiverId.ToString()
|
||||||
|
});
|
||||||
|
|
||||||
|
var response = await http.DeleteAsync(url, cancel);
|
||||||
|
if (response.IsSuccessStatusCode)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var body = await response.Content.ReadAsStringAsync(cancel);
|
||||||
|
var statusCode = (int)response.StatusCode;
|
||||||
|
var reasonPhrase = response.ReasonPhrase ?? "Unknown error";
|
||||||
|
throw new HttpRequestException(
|
||||||
|
$"Failed to remove receiver. Status: {statusCode} ({reasonPhrase}){(string.IsNullOrWhiteSpace(body) ? string.Empty : $" - {body}")}",
|
||||||
|
null,
|
||||||
|
response.StatusCode);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ public class EnvelopeService(IHttpClientFactory clientFactory)
|
|||||||
string? uuid = null,
|
string? uuid = null,
|
||||||
bool? onlyActive = null,
|
bool? onlyActive = null,
|
||||||
bool? onlyCompleted = null,
|
bool? onlyCompleted = null,
|
||||||
|
bool? includeDocAndDocRes = null,
|
||||||
CancellationToken cancel = default)
|
CancellationToken cancel = default)
|
||||||
{
|
{
|
||||||
var baseUrl = $"/api/Envelope";
|
var baseUrl = $"/api/Envelope";
|
||||||
@@ -46,6 +47,10 @@ public class EnvelopeService(IHttpClientFactory clientFactory)
|
|||||||
{
|
{
|
||||||
queryParams["OnlyCompleted"] = onlyCompleted.Value.ToString();
|
queryParams["OnlyCompleted"] = onlyCompleted.Value.ToString();
|
||||||
}
|
}
|
||||||
|
if (includeDocAndDocRes.HasValue)
|
||||||
|
{
|
||||||
|
queryParams["IncludeDocAndDocRes"] = includeDocAndDocRes.Value.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
var url = QueryHelpers.AddQueryString(baseUrl, queryParams);
|
var url = QueryHelpers.AddQueryString(baseUrl, queryParams);
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ public class EnvelopeTypeService(IHttpClientFactory clientFactory)
|
|||||||
{
|
{
|
||||||
private static readonly JsonSerializerOptions JsonOptions = new(JsonSerializerDefaults.Web);
|
private static readonly JsonSerializerOptions JsonOptions = new(JsonSerializerDefaults.Web);
|
||||||
|
|
||||||
public async Task<IReadOnlyList<EnvelopeTypeDto>> GetAsync(CancellationToken cancel = default)
|
public async Task<IReadOnlyList<EnvelopeTypeDefaultsDto>> GetAsync(CancellationToken cancel = default)
|
||||||
{
|
{
|
||||||
var http = clientFactory.CreateClient("EnvelopeGenerator.Server");
|
var http = clientFactory.CreateClient("EnvelopeGenerator.Server");
|
||||||
var response = await http.GetAsync("/api/EnvelopeType", cancel);
|
var response = await http.GetAsync("/api/EnvelopeType", cancel);
|
||||||
@@ -16,7 +16,7 @@ public class EnvelopeTypeService(IHttpClientFactory clientFactory)
|
|||||||
if (!response.IsSuccessStatusCode)
|
if (!response.IsSuccessStatusCode)
|
||||||
return [];
|
return [];
|
||||||
|
|
||||||
var data = await response.Content.ReadFromJsonAsync<List<EnvelopeTypeDto>>(JsonOptions, cancel);
|
var data = await response.Content.ReadFromJsonAsync<List<EnvelopeTypeDefaultsDto>>(JsonOptions, cancel);
|
||||||
return data ?? [];
|
return data ?? [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
@using EnvelopeGenerator.Server.Client.Models
|
@using EnvelopeGenerator.Server.Client.Models
|
||||||
@using EnvelopeGenerator.Server.Client.Options
|
@using EnvelopeGenerator.Server.Client.Options
|
||||||
@using EnvelopeGenerator.Server.Client.Components.PdfEditor
|
@using EnvelopeGenerator.Server.Client.Components.PdfEditor
|
||||||
|
@using MudBlazor
|
||||||
@using DevExpress.Blazor
|
@using DevExpress.Blazor
|
||||||
@using DevExpress.Blazor.PdfViewer
|
@using DevExpress.Blazor.PdfViewer
|
||||||
@using DevExpress.Blazor.Reporting
|
@using DevExpress.Blazor.Reporting
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flag-icons@7.2.3/css/flag-icons.min.css" />
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flag-icons@7.2.3/css/flag-icons.min.css" />
|
||||||
<link rel="stylesheet" href="css/app.css" />
|
<link rel="stylesheet" href="css/app.css" />
|
||||||
<link rel="stylesheet" href="css/envelope-viewer.css" />
|
<link rel="stylesheet" href="css/envelope-viewer.css" />
|
||||||
|
<link rel="stylesheet" href="_content/MudBlazor/MudBlazor.min.css" />
|
||||||
<link rel="stylesheet" href="EnvelopeGenerator.Server.styles.css" />
|
<link rel="stylesheet" href="EnvelopeGenerator.Server.styles.css" />
|
||||||
<HeadOutlet />
|
<HeadOutlet />
|
||||||
<!-- Apply saved theme immediately on page load — before WASM boots.
|
<!-- Apply saved theme immediately on page load — before WASM boots.
|
||||||
@@ -37,7 +38,19 @@
|
|||||||
<script src="js/receiver-signature.js?v=9"></script>
|
<script src="js/receiver-signature.js?v=9"></script>
|
||||||
<script src="js/signflow-theme.js"></script>
|
<script src="js/signflow-theme.js"></script>
|
||||||
<script src="js/envelope-editor.js"></script>
|
<script src="js/envelope-editor.js"></script>
|
||||||
<script src="_framework/blazor.web.js"></script>
|
<script src="_content/MudBlazor/MudBlazor.min.js"></script>
|
||||||
|
<script src="_framework/blazor.web.js" autostart="false"></script>
|
||||||
|
<script>
|
||||||
|
(function () {
|
||||||
|
if (!window.WebAssembly || !window.Blazor || typeof window.Blazor.start !== 'function') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
window.Blazor.start({
|
||||||
|
webAssembly: {}
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
@page "/envelope/{EnvelopeKey}/signed"
|
@page "/envelope/{EnvelopeKey}/signed"
|
||||||
@rendermode InteractiveServer
|
@rendermode InteractiveServer
|
||||||
@using DevExpress.Blazor.Reporting
|
@attribute [Obsolete("Legacy receiver signed preview route. Signing is finalized inline in /envelope/{EnvelopeKey}.")]
|
||||||
@using DevExpress.XtraReports.UI
|
@using EnvelopeGenerator.Application.Common.Dto
|
||||||
|
@using EnvelopeGenerator.Application.Common.Interfaces.Doc
|
||||||
|
@using EnvelopeGenerator.Server.Client.Components.PdfEditor
|
||||||
@using EnvelopeGenerator.Server.Client.Models
|
@using EnvelopeGenerator.Server.Client.Models
|
||||||
@using EnvelopeGenerator.Server.Client.Services
|
@using EnvelopeGenerator.Server.Client.Services
|
||||||
@using EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver
|
@using EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver
|
||||||
@@ -19,11 +21,11 @@
|
|||||||
@inject IMemoryCache MemoryCache
|
@inject IMemoryCache MemoryCache
|
||||||
@inject ILogger<ReceiverSignedPage> Logger
|
@inject ILogger<ReceiverSignedPage> Logger
|
||||||
@inject IStringLocalizer<Resource> UiLocalizer
|
@inject IStringLocalizer<Resource> UiLocalizer
|
||||||
@implements IDisposable
|
@inject IPdfPageImageRenderer PdfPageImageRenderer
|
||||||
|
|
||||||
<link href="_content/DevExpress.Blazor.Themes/blazing-berry.bs5.min.css" rel="stylesheet" />
|
<link href="_content/DevExpress.Blazor.Themes/blazing-berry.bs5.min.css" rel="stylesheet" />
|
||||||
<link href="_content/DevExpress.Blazor.Reporting.Viewer/css/dx-blazor-reporting-components.bs5.css" rel="stylesheet" />
|
|
||||||
<link href="@AppVersion.GetVersionedUrl("css/envelope-viewer.css")" rel="stylesheet" />
|
<link href="@AppVersion.GetVersionedUrl("css/envelope-viewer.css")" rel="stylesheet" />
|
||||||
|
<script src="@AppVersion.GetVersionedUrl("js/envelope-editor.js")"></script>
|
||||||
|
|
||||||
<div class="envelope-viewer-layout">
|
<div class="envelope-viewer-layout">
|
||||||
<div class="envelope-action-bar">
|
<div class="envelope-action-bar">
|
||||||
@@ -94,9 +96,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
else if (_report is not null)
|
else if (PdfDataUrl is not null)
|
||||||
{
|
{
|
||||||
<DxReportViewer Report="_report" RootCssClasses="w-100 h-100" />
|
<SenderPdfImageEditor IsPlacementMode="false"
|
||||||
|
PageCount="@_pageCount"
|
||||||
|
Pages="@_pagePreviews"
|
||||||
|
PdfDataUrl="@PdfDataUrl"
|
||||||
|
PdfFileName="@PdfFileName"
|
||||||
|
ShowFieldRemoveButton="false" />
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -165,9 +172,17 @@
|
|||||||
ClaimsPrincipal? _receiverUser;
|
ClaimsPrincipal? _receiverUser;
|
||||||
EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver.EnvelopeReceiverDto? _envelopeReceiver;
|
EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver.EnvelopeReceiverDto? _envelopeReceiver;
|
||||||
IReadOnlyList<SignatureDto> _signatures = [];
|
IReadOnlyList<SignatureDto> _signatures = [];
|
||||||
XtraReport? _report;
|
byte[]? _displayPdfBytes;
|
||||||
|
List<PdfPageImageDto> _pagePreviews = [];
|
||||||
|
int _pageCount;
|
||||||
SignatureCaptureDto? _sig;
|
SignatureCaptureDto? _sig;
|
||||||
|
|
||||||
|
string? PdfDataUrl => _displayPdfBytes is { Length: > 0 }
|
||||||
|
? $"data:application/pdf;base64,{Convert.ToBase64String(_displayPdfBytes)}"
|
||||||
|
: null;
|
||||||
|
|
||||||
|
string PdfFileName => $"Envelope-{EnvelopeKey ?? "receiver"}-signed.pdf";
|
||||||
|
|
||||||
// ----- Submit / logout state -----
|
// ----- Submit / logout state -----
|
||||||
bool _isLoggingOut = false;
|
bool _isLoggingOut = false;
|
||||||
bool _submitConfirmVisible = false;
|
bool _submitConfirmVisible = false;
|
||||||
@@ -268,20 +283,11 @@
|
|||||||
if (_sig is not null && _signatures.Count > 0)
|
if (_sig is not null && _signatures.Count > 0)
|
||||||
pdfBytes = DrawSignaturesOnPdf(pdfBytes, _signatures, _sig);
|
pdfBytes = DrawSignaturesOnPdf(pdfBytes, _signatures, _sig);
|
||||||
|
|
||||||
var report = new XtraReport
|
_displayPdfBytes = pdfBytes;
|
||||||
{
|
_pagePreviews = (await PdfPageImageRenderer.RenderPagesAsImagesAsync(_displayPdfBytes))
|
||||||
PaperKind = DevExpress.Drawing.Printing.DXPaperKind.A4,
|
.OrderBy(p => p.PageNumber)
|
||||||
Landscape = false,
|
.ToList();
|
||||||
Margins = new System.Drawing.Printing.Margins(0, 0, 0, 0),
|
_pageCount = _pagePreviews.Count > 0 ? _pagePreviews.Count : 1;
|
||||||
};
|
|
||||||
var detail = new DetailBand();
|
|
||||||
report.Bands.Add(detail);
|
|
||||||
detail.Controls.Add(new XRPdfContent
|
|
||||||
{
|
|
||||||
Source = pdfBytes,
|
|
||||||
GenerateOwnPages = true,
|
|
||||||
});
|
|
||||||
_report = report;
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -309,11 +315,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose()
|
|
||||||
{
|
|
||||||
_report?.Dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
// ----- PDF signature rendering -----
|
// ----- PDF signature rendering -----
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ using Microsoft.AspNetCore.Authentication.Cookies;
|
|||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
|
using EnvelopeGenerator.Application.EnvelopeReceivers.Commands;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Server.Controllers;
|
namespace EnvelopeGenerator.Server.Controllers;
|
||||||
|
|
||||||
@@ -92,58 +93,23 @@ public partial class AuthController(
|
|||||||
/// The operation is idempotent: if the code was already requested, it returns 200 without re-sending.
|
/// The operation is idempotent: if the code was already requested, it returns 200 without re-sending.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="key">Envelope receiver key.</param>
|
/// <param name="key">Envelope receiver key.</param>
|
||||||
|
/// <param name="autoGenerated">If the access code was auto-generated while page is loading.</param>
|
||||||
|
/// <param name="sender">MediatR instance.</param>
|
||||||
|
/// <param name="cancel">Cancellation token.</param>
|
||||||
/// <response code="200">Access code is already available or requested successfully.</response>
|
/// <response code="200">Access code is already available or requested successfully.</response>
|
||||||
/// <response code="404">Envelope receiver key was not found.</response>
|
/// <response code="404">Envelope receiver key was not found.</response>
|
||||||
/// <response code="500">Access code could not be persisted or e-mail could not be sent.</response>
|
/// <response code="500">Access code could not be persisted or e-mail could not be sent.</response>
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
[HttpPost("envelope-receiver/{key}/request-access-code")]
|
[HttpPost("envelope-receiver/{key}/request-access-code")]
|
||||||
public async Task<IActionResult> RequestEnvelopeReceiverAccessCode(
|
public async Task<IActionResult> RequestEnvelopeReceiverAccessCode([FromServices] ISender sender, [FromRoute] string key, [FromQuery] bool autoGenerated = true, CancellationToken cancel = default)
|
||||||
[FromRoute] string key,
|
=> await sender.Send(new SendAccessCodeCommand(key).AllowMultipleRequests(!autoGenerated), cancel) switch
|
||||||
[FromServices] IMediator mediator,
|
|
||||||
[FromServices] IEnvelopeHistoryService historyService,
|
|
||||||
[FromServices] IEnvelopeMailService mailService,
|
|
||||||
[FromServices] ILogger<AuthController> logger,
|
|
||||||
CancellationToken cancel)
|
|
||||||
{
|
|
||||||
var envelopeReceiver = (await mediator.Send(new ReadEnvelopeReceiverQuery { Key = key }, cancel)).SingleOrDefault();
|
|
||||||
|
|
||||||
if (envelopeReceiver is null || envelopeReceiver.Envelope is null || envelopeReceiver.Receiver is null)
|
|
||||||
return NotFound();
|
|
||||||
|
|
||||||
if (envelopeReceiver.Envelope.UseAccessCode != true)
|
|
||||||
return Ok();
|
|
||||||
|
|
||||||
var userReference = envelopeReceiver.Receiver.EmailAddress;
|
|
||||||
|
|
||||||
if (await historyService.IsSigned(envelopeReceiver.EnvelopeId, userReference))
|
|
||||||
return Ok();
|
|
||||||
|
|
||||||
var accessCodeAlreadyRequested = await historyService.AccessCodeAlreadyRequested(envelopeReceiver.EnvelopeId, userReference);
|
|
||||||
if (accessCodeAlreadyRequested)
|
|
||||||
return Ok();
|
|
||||||
|
|
||||||
var historyResult = await historyService.RecordAsync(envelopeReceiver.EnvelopeId, userReference, EnvelopeStatus.AccessCodeRequested);
|
|
||||||
if (historyResult.IsFailed)
|
|
||||||
{
|
{
|
||||||
logger.LogWarning(
|
SendAccessCodeResult.Sent => Ok(),
|
||||||
"Failed to record AccessCodeRequested history for envelope {EnvelopeId} and receiver {ReceiverEmail}.",
|
SendAccessCodeResult.AlreadySigned => Conflict(),
|
||||||
envelopeReceiver.EnvelopeId,
|
SendAccessCodeResult.NoAccessCodeRequired => NoContent(),
|
||||||
userReference);
|
SendAccessCodeResult.RequestLimitExceeded => StatusCode(StatusCodes.Status429TooManyRequests),
|
||||||
return StatusCode(StatusCodes.Status500InternalServerError);
|
_ => Problem(detail: "Unexpected result from SendAccessCodeCommand.", statusCode: StatusCodes.Status500InternalServerError)
|
||||||
}
|
};
|
||||||
|
|
||||||
var mailResult = await mailService.SendAccessCodeAsync(envelopeReceiver);
|
|
||||||
if (mailResult.IsFailed)
|
|
||||||
{
|
|
||||||
logger.LogWarning(
|
|
||||||
"Failed to send access code mail for envelope {EnvelopeId} and receiver {ReceiverEmail}.",
|
|
||||||
envelopeReceiver.EnvelopeId,
|
|
||||||
userReference);
|
|
||||||
return StatusCode(StatusCodes.Status500InternalServerError);
|
|
||||||
}
|
|
||||||
|
|
||||||
return Ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Removes the per-envelope receiver cookie for the given envelope key.
|
/// Removes the per-envelope receiver cookie for the given envelope key.
|
||||||
|
|||||||
@@ -20,7 +20,9 @@ public class CustomImagesController(IOptions<CustomImagesOptions> options) : Con
|
|||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the signFLOW app logo and company logo configuration.
|
/// Returns the signFLOW app logo and company logo configuration.
|
||||||
|
/// Anonymous access allowed so the login page can display branding before the user authenticates.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
|
[AllowAnonymous]
|
||||||
public ActionResult<CustomImagesOptions> Get() => Ok(options.Value);
|
public ActionResult<CustomImagesOptions> Get() => Ok(options.Value);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,27 +23,16 @@ namespace EnvelopeGenerator.Server.Controllers;
|
|||||||
/// - 404 Not Found: Die angeforderte Ressource wurde nicht gefunden.
|
/// - 404 Not Found: Die angeforderte Ressource wurde nicht gefunden.
|
||||||
/// - 500 Internal Server Error: Ein unerwarteter Fehler ist aufgetreten.
|
/// - 500 Internal Server Error: Ein unerwarteter Fehler ist aufgetreten.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
|
/// <remarks>
|
||||||
|
/// Erstellt eine neue Instanz des EnvelopeControllers.
|
||||||
|
/// </remarks>
|
||||||
|
/// <param name="Logger">Der Logger, der für das Protokollieren von Informationen verwendet wird.</param>
|
||||||
|
/// <param name="Mediator"></param>
|
||||||
[Route("api/[controller]")]
|
[Route("api/[controller]")]
|
||||||
[ApiController]
|
[ApiController]
|
||||||
[Authorize]
|
[Authorize]
|
||||||
public class EnvelopeController : ControllerBase
|
public class EnvelopeController(ILogger<EnvelopeController> Logger, IMediator Mediator) : ControllerBase
|
||||||
{
|
{
|
||||||
public record DeleteEnvelopeRequest(string Reason);
|
|
||||||
|
|
||||||
private readonly ILogger<EnvelopeController> _logger;
|
|
||||||
private readonly IMediator _mediator;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Erstellt eine neue Instanz des EnvelopeControllers.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="logger">Der Logger, der für das Protokollieren von Informationen verwendet wird.</param>
|
|
||||||
/// <param name="mediator"></param>
|
|
||||||
public EnvelopeController(ILogger<EnvelopeController> logger, IMediator mediator)
|
|
||||||
{
|
|
||||||
_logger = logger;
|
|
||||||
_mediator = mediator;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Ruft eine Liste von Umschlägen basierend auf dem Benutzer und den angegebenen Statusfiltern ab.
|
/// Ruft eine Liste von Umschlägen basierend auf dem Benutzer und den angegebenen Statusfiltern ab.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -58,8 +47,8 @@ public class EnvelopeController : ControllerBase
|
|||||||
[HttpGet]
|
[HttpGet]
|
||||||
public async Task<IActionResult> GetAsync([FromQuery] ReadEnvelopeQuery envelope)
|
public async Task<IActionResult> GetAsync([FromQuery] ReadEnvelopeQuery envelope)
|
||||||
{
|
{
|
||||||
var result = await _mediator.Send(envelope.Authorize(User.GetId()));
|
var result = await Mediator.Send(envelope.Authorize(User.GetId()));
|
||||||
return result.Any() ? Ok(result) : NotFound();
|
return Ok(result ?? []);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -74,7 +63,7 @@ public class EnvelopeController : ControllerBase
|
|||||||
[HttpGet("doc-result")]
|
[HttpGet("doc-result")]
|
||||||
public async Task<IActionResult> GetDocResultAsync([FromQuery] ReadEnvelopeQuery query, [FromQuery] bool view = false)
|
public async Task<IActionResult> GetDocResultAsync([FromQuery] ReadEnvelopeQuery query, [FromQuery] bool view = false)
|
||||||
{
|
{
|
||||||
var envelopes = await _mediator.Send(query.Authorize(User.GetId()));
|
var envelopes = await Mediator.Send(query.Authorize(User.GetId()));
|
||||||
var envelope = envelopes.FirstOrDefault();
|
var envelope = envelopes.FirstOrDefault();
|
||||||
|
|
||||||
if (envelope is null)
|
if (envelope is null)
|
||||||
@@ -100,22 +89,34 @@ public class EnvelopeController : ControllerBase
|
|||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<IActionResult> CreateAsync([FromBody] CreateEnvelopeCommand command)
|
public async Task<IActionResult> CreateAsync([FromBody] CreateEnvelopeCommand command)
|
||||||
{
|
{
|
||||||
var res = await _mediator.Send(command.WithAuth(User.GetId()));
|
var res = await Mediator.Send(command.WithAuth(User.GetId()));
|
||||||
|
|
||||||
if (res is null)
|
if (res is null)
|
||||||
{
|
{
|
||||||
_logger.LogError("Failed to create envelope. Envelope details: {EnvelopeDetails}", JsonConvert.SerializeObject(command));
|
Logger.LogError("Failed to create envelope. Envelope details: {EnvelopeDetails}", JsonConvert.SerializeObject(command));
|
||||||
return StatusCode(StatusCodes.Status500InternalServerError);
|
return StatusCode(StatusCodes.Status500InternalServerError);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return Ok(res);
|
return Ok(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Reason"></param>
|
||||||
|
public record DeleteEnvelopeRequest(string Reason);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <returns></returns>
|
||||||
[Authorize(AuthenticationSchemes = AuthScheme.Sender)]
|
[Authorize(AuthenticationSchemes = AuthScheme.Sender)]
|
||||||
[HttpDelete("{id:int}")]
|
[HttpDelete("{id:int}")]
|
||||||
public async Task<IActionResult> DeleteAsync([FromRoute] int id, [FromBody] DeleteEnvelopeRequest request)
|
public async Task<IActionResult> DeleteAsync([FromRoute] int id, [FromBody] DeleteEnvelopeRequest request)
|
||||||
{
|
{
|
||||||
var result = await _mediator.Send(new DeleteEnvelopeCommand
|
var result = await Mediator.Send(new DeleteEnvelopeCommand
|
||||||
{
|
{
|
||||||
EnvelopeId = id,
|
EnvelopeId = id,
|
||||||
Reason = request?.Reason ?? string.Empty
|
Reason = request?.Reason ?? string.Empty
|
||||||
@@ -133,7 +134,7 @@ public class EnvelopeController : ControllerBase
|
|||||||
[HttpPost("finalize")]
|
[HttpPost("finalize")]
|
||||||
public async Task<IActionResult> FinalizeEnvelopeAsync([FromQuery] FinalizeEnvelopeCommand command)
|
public async Task<IActionResult> FinalizeEnvelopeAsync([FromQuery] FinalizeEnvelopeCommand command)
|
||||||
{
|
{
|
||||||
await _mediator.Send(command.Authorized(User.GetId()));
|
await Mediator.Send(command.Authorized(User.GetId()));
|
||||||
return Ok();
|
return Ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,9 @@ using EnvelopeGenerator.Application.Common.Interfaces.SQLExecutor;
|
|||||||
using EnvelopeGenerator.Server.Extensions;
|
using EnvelopeGenerator.Server.Extensions;
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
using EnvelopeGenerator.Application.EnvelopeReceivers.Commands.CreateEnvelopeReceiver;
|
using EnvelopeGenerator.Application.EnvelopeReceivers.Commands.CreateEnvelopeReceiver;
|
||||||
|
using EnvelopeGenerator.Application.Common.Extensions;
|
||||||
|
using EnvelopeGenerator.Server.Options;
|
||||||
|
using EnvelopeGenerator.Application.EnvelopeReceivers.Commands;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Server.Controllers;
|
namespace EnvelopeGenerator.Server.Controllers;
|
||||||
|
|
||||||
@@ -24,32 +27,16 @@ namespace EnvelopeGenerator.Server.Controllers;
|
|||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Dieser Controller bietet Endpunkte für das Abrufen und Verwalten von Umschlagempfängerdaten.
|
/// Dieser Controller bietet Endpunkte für das Abrufen und Verwalten von Umschlagempfängerdaten.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
|
/// <remarks>
|
||||||
|
/// Konstruktor für den EnvelopeReceiverController.
|
||||||
|
/// </remarks>
|
||||||
[Route("api/[controller]")]
|
[Route("api/[controller]")]
|
||||||
[Authorize]
|
[Authorize]
|
||||||
[ApiController]
|
[ApiController]
|
||||||
public class EnvelopeReceiverController : ControllerBase
|
public class EnvelopeReceiverController(ILogger<EnvelopeReceiverController> Logger, IMediator Mediator, IMapper Mapper, IEnvelopeExecutor EnvelopeExecutor, IEnvelopeReceiverExecutor ER_Executor, IDocumentExecutor DocExecutor, IOptions<ConnectionString> csOpt, IOptionsMonitor<SenderFeatureAccessOptions> senderFeatAccessOpt) : ControllerBase
|
||||||
{
|
{
|
||||||
private readonly ILogger<EnvelopeReceiverController> _logger;
|
private readonly string _cnnStr = csOpt.Value.Value;
|
||||||
private readonly IMediator _mediator;
|
private readonly IOptionsMonitor<SenderFeatureAccessOptions> SenderFeatAccessOpt = senderFeatAccessOpt;
|
||||||
private readonly IMapper _mapper;
|
|
||||||
private readonly IEnvelopeExecutor _envelopeExecutor;
|
|
||||||
private readonly IEnvelopeReceiverExecutor _erExecutor;
|
|
||||||
private readonly IDocumentExecutor _documentExecutor;
|
|
||||||
private readonly string _cnnStr;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Konstruktor für den EnvelopeReceiverController.
|
|
||||||
/// </summary>
|
|
||||||
public EnvelopeReceiverController(ILogger<EnvelopeReceiverController> logger, IMediator mediator, IMapper mapper, IEnvelopeExecutor envelopeExecutor, IEnvelopeReceiverExecutor erExecutor, IDocumentExecutor documentExecutor, IOptions<ConnectionString> csOpt)
|
|
||||||
{
|
|
||||||
_logger = logger;
|
|
||||||
_mediator = mediator;
|
|
||||||
_mapper = mapper;
|
|
||||||
_envelopeExecutor = envelopeExecutor;
|
|
||||||
_erExecutor = erExecutor;
|
|
||||||
_documentExecutor = documentExecutor;
|
|
||||||
_cnnStr = csOpt.Value.Value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Ruft eine Liste von Umschlagempfängern basierend auf den angegebenen Abfrageparametern ab.
|
/// Ruft eine Liste von Umschlagempfängern basierend auf den angegebenen Abfrageparametern ab.
|
||||||
@@ -69,7 +56,7 @@ public class EnvelopeReceiverController : ControllerBase
|
|||||||
{
|
{
|
||||||
envelopeReceiver = envelopeReceiver with { Username = User.GetUsername() };
|
envelopeReceiver = envelopeReceiver with { Username = User.GetUsername() };
|
||||||
|
|
||||||
var result = await _mediator.Send(envelopeReceiver);
|
var result = await Mediator.Send(envelopeReceiver);
|
||||||
|
|
||||||
return Ok(result);
|
return Ok(result);
|
||||||
}
|
}
|
||||||
@@ -84,7 +71,7 @@ public class EnvelopeReceiverController : ControllerBase
|
|||||||
[HttpGet("{envelopeKey}")]
|
[HttpGet("{envelopeKey}")]
|
||||||
public async Task<IActionResult> GetEnvelopeReceiverOfReceiver([FromRoute] string envelopeKey, CancellationToken cancel)
|
public async Task<IActionResult> GetEnvelopeReceiverOfReceiver([FromRoute] string envelopeKey, CancellationToken cancel)
|
||||||
{
|
{
|
||||||
var er = await _mediator.Send(new ReadEnvelopeReceiverQuery()
|
var er = await Mediator.Send(new ReadEnvelopeReceiverQuery()
|
||||||
{
|
{
|
||||||
Key = envelopeKey
|
Key = envelopeKey
|
||||||
}, cancel);
|
}, cancel);
|
||||||
@@ -108,10 +95,53 @@ public class EnvelopeReceiverController : ControllerBase
|
|||||||
[HttpGet("salute")]
|
[HttpGet("salute")]
|
||||||
public async Task<IActionResult> GetReceiverName([FromQuery] ReadReceiverNameQuery receiver)
|
public async Task<IActionResult> GetReceiverName([FromQuery] ReadReceiverNameQuery receiver)
|
||||||
{
|
{
|
||||||
var name = await _mediator.Send(receiver);
|
var name = await Mediator.Send(receiver);
|
||||||
return name is null ? NotFound() : Ok(name);
|
return name is null ? NotFound() : Ok(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelopeUuid"></param>
|
||||||
|
/// <param name="receiverSignature"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[Authorize(AuthenticationSchemes = AuthScheme.Sender)]
|
||||||
|
[HttpGet("receiver-envelope-url")]
|
||||||
|
public IActionResult GetReceiverEnvelopeUrl([FromQuery] string envelopeUuid, [FromQuery] string receiverSignature)
|
||||||
|
{
|
||||||
|
if (!CanUseReceiverEnvelopeUrlFeature())
|
||||||
|
return Forbid();
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(envelopeUuid) || string.IsNullOrWhiteSpace(receiverSignature))
|
||||||
|
return BadRequest("Envelope uuid and receiver signature are required.");
|
||||||
|
|
||||||
|
var envelopeKey = (envelopeUuid, receiverSignature).ToEnvelopeKey();
|
||||||
|
var absoluteUrl = $"{Request.Scheme}://{Request.Host}/envelope/{Uri.EscapeDataString(envelopeKey)}";
|
||||||
|
|
||||||
|
return Ok(new { url = absoluteUrl });
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[Authorize(AuthenticationSchemes = AuthScheme.Sender)]
|
||||||
|
[HttpGet("receiver-envelope-url/enabled")]
|
||||||
|
public IActionResult GetReceiverEnvelopeUrlFeatureEnabled()
|
||||||
|
{
|
||||||
|
return Ok(new { enabled = CanUseReceiverEnvelopeUrlFeature() });
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool CanUseReceiverEnvelopeUrlFeature()
|
||||||
|
{
|
||||||
|
var senderEmail = User.GetEmail();
|
||||||
|
if (string.IsNullOrWhiteSpace(senderEmail))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
var allowedEmails = SenderFeatAccessOpt.CurrentValue.AllowedReceiverEnvelopeUrlEmails;
|
||||||
|
return allowedEmails.Any(email => string.Equals(email?.Trim(), senderEmail, StringComparison.OrdinalIgnoreCase));
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns recent receiver suggestions for the authenticated sender.
|
/// Returns recent receiver suggestions for the authenticated sender.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -122,7 +152,7 @@ public class EnvelopeReceiverController : ControllerBase
|
|||||||
[HttpGet("recent-suggestions")]
|
[HttpGet("recent-suggestions")]
|
||||||
public async Task<IActionResult> GetRecentSuggestions([FromQuery] ReadRecentReceiverSuggestionsQuery query, CancellationToken cancel)
|
public async Task<IActionResult> GetRecentSuggestions([FromQuery] ReadRecentReceiverSuggestionsQuery query, CancellationToken cancel)
|
||||||
{
|
{
|
||||||
var result = await _mediator.Send(query.ForSender(User.GetUsername()), cancel);
|
var result = await Mediator.Send(query.ForSender(User.GetUsername()), cancel);
|
||||||
return Ok(result);
|
return Ok(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,7 +199,7 @@ public class EnvelopeReceiverController : ControllerBase
|
|||||||
public async Task<IActionResult> CreateAsync([FromBody] CreateEnvelopeReceiverCommand request, CancellationToken cancel)
|
public async Task<IActionResult> CreateAsync([FromBody] CreateEnvelopeReceiverCommand request, CancellationToken cancel)
|
||||||
{
|
{
|
||||||
#region Create Envelope
|
#region Create Envelope
|
||||||
var envelope = await _envelopeExecutor.CreateEnvelopeAsync(User.GetId(), request.Title, request.Message, request.TFAEnabled, cancel);
|
var envelope = await EnvelopeExecutor.CreateEnvelopeAsync(User.GetId(), request.Title, request.Message, request.TFAEnabled, cancel);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Add receivers
|
#region Add receivers
|
||||||
@@ -178,7 +208,7 @@ public class EnvelopeReceiverController : ControllerBase
|
|||||||
|
|
||||||
foreach (var receiver in request.Receivers)
|
foreach (var receiver in request.Receivers)
|
||||||
{
|
{
|
||||||
var envelopeReceiver = await _erExecutor.AddEnvelopeReceiverAsync(envelope.Uuid, receiver.EmailAddress, receiver.Salution, receiver.PhoneNumber, cancel);
|
var envelopeReceiver = await ER_Executor.AddEnvelopeReceiverAsync(envelope.Uuid, receiver.EmailAddress, receiver.Salution, receiver.PhoneNumber, cancel);
|
||||||
|
|
||||||
if (envelopeReceiver is null)
|
if (envelopeReceiver is null)
|
||||||
unsentReceivers.Add(receiver);
|
unsentReceivers.Add(receiver);
|
||||||
@@ -186,13 +216,13 @@ public class EnvelopeReceiverController : ControllerBase
|
|||||||
sentReceivers.Add(envelopeReceiver);
|
sentReceivers.Add(envelopeReceiver);
|
||||||
}
|
}
|
||||||
|
|
||||||
var res = _mapper.Map<CreateEnvelopeReceiverResponse>(envelope);
|
var res = Mapper.Map<CreateEnvelopeReceiverResponse>(envelope);
|
||||||
res.UnsentReceivers = unsentReceivers;
|
res.UnsentReceivers = unsentReceivers;
|
||||||
res.SentReceiver = _mapper.Map<List<ReceiverDto>>(sentReceivers.Select(er => er.Receiver));
|
res.SentReceiver = Mapper.Map<List<ReceiverDto>>(sentReceivers.Select(er => er.Receiver));
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Add document
|
#region Add document
|
||||||
var document = await _documentExecutor.CreateDocumentAsync(request.Document.DataAsBase64, envelope.Uuid, cancel);
|
var document = await DocExecutor.CreateDocumentAsync(request.Document.DataAsBase64, envelope.Uuid, cancel);
|
||||||
|
|
||||||
if (document is null)
|
if (document is null)
|
||||||
return StatusCode(StatusCodes.Status500InternalServerError, "Document creation is failed.");
|
return StatusCode(StatusCodes.Status500InternalServerError, "Document creation is failed.");
|
||||||
@@ -229,7 +259,7 @@ public class EnvelopeReceiverController : ControllerBase
|
|||||||
{
|
{
|
||||||
bool outSuccess = reader.GetBoolean(0);
|
bool outSuccess = reader.GetBoolean(0);
|
||||||
if (!outSuccess)
|
if (!outSuccess)
|
||||||
_logger.LogWarning(
|
Logger.LogWarning(
|
||||||
"PRSIG_API_ADD_DOC_RECEIVER_ELEM returned OUT_SUCCESS=false. DOC_ID={DocId}, RECEIVER_ID={ReceiverId}, Page={Page}",
|
"PRSIG_API_ADD_DOC_RECEIVER_ELEM returned OUT_SUCCESS=false. DOC_ID={DocId}, RECEIVER_ID={ReceiverId}, Page={Page}",
|
||||||
document.Id, rcv.Id, sign.Page);
|
document.Id, rcv.Id, sign.Page);
|
||||||
}
|
}
|
||||||
@@ -261,7 +291,7 @@ public class EnvelopeReceiverController : ControllerBase
|
|||||||
{
|
{
|
||||||
bool outSuccess = reader.GetBoolean(0);
|
bool outSuccess = reader.GetBoolean(0);
|
||||||
if (!outSuccess)
|
if (!outSuccess)
|
||||||
_logger.LogWarning(
|
Logger.LogWarning(
|
||||||
"PRSIG_API_ADD_HISTORY_STATE returned OUT_SUCCESS=false. EnvelopeUuid={EnvelopeUuid}",
|
"PRSIG_API_ADD_HISTORY_STATE returned OUT_SUCCESS=false. EnvelopeUuid={EnvelopeUuid}",
|
||||||
envelope.Uuid);
|
envelope.Uuid);
|
||||||
}
|
}
|
||||||
@@ -292,4 +322,18 @@ public class EnvelopeReceiverController : ControllerBase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="cancel"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpDelete]
|
||||||
|
[Authorize(AuthenticationSchemes = AuthScheme.Sender)]
|
||||||
|
public async Task<IActionResult> RemoveAsync([FromQuery] RemoveEnvelopeReceiverCommand request, CancellationToken cancel)
|
||||||
|
{
|
||||||
|
request = request.Authenticated(User.GetId());
|
||||||
|
await Mediator.Send(request, cancel);
|
||||||
|
return Ok();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user