Refactor: Remove CertificationType and ContractType

Removed `CertificationType` and `ContractType` properties and logic across the codebase as they were redundant. Updated `EnvelopeType` to include a validation extension method for improved data integrity. Refactored `CreateEnvelopeWizardPopup.razor` and other UI components to simplify handling of `EnvelopeType`.

Conditionally included `CertificationType` and `ContractType` for `NETFRAMEWORK` targets using `#if NETFRAMEWORK` directives to ensure compatibility. Removed unused enums, imports, and methods. Updated `CreateEnvelopeCommandHandler` and related classes to reflect these changes.
This commit is contained in:
2026-11-13 11:06:12 +01:00
parent 67e435c3fa
commit 13784cd595
17 changed files with 79 additions and 131 deletions

View File

@@ -59,11 +59,6 @@ public record EnvelopeDto : IEnvelope
[TemplatePlaceholder("[DOCUMENT_TITLE]")]
public string Title { get; set; } = string.Empty;
/// <summary>
///
/// </summary>
public ContractType? ContractType { get; set; }
/// <summary>
/// Default value is 'de-DE'
/// </summary>
@@ -81,11 +76,6 @@ public record EnvelopeDto : IEnvelope
[Obsolete("Use EnvelopeExtensions.IsReadAndConfirm extension metot instead.")]
public bool ReadOnly => this.IsReadAndConfirm();
/// <summary>
///
/// </summary>
public CertificationType? CertificationType { get; set; }
/// <summary>
///
/// </summary>

View File

@@ -27,11 +27,6 @@ public class EnvelopeTypeDefaultsDto
/// </summary>
public int? ExpiresDays { get; set; }
/// <summary>
/// Gets or sets the certification type identifier.
/// </summary>
public CertificationType? CertificationType { get; set; }
/// <summary>
/// Gets or sets a value indicating whether an access code is required.
/// </summary>
@@ -76,9 +71,4 @@ public class EnvelopeTypeDefaultsDto
/// Gets or sets the interval in days between reminder emails.
/// </summary>
public int? ReminderIntervalDays { get; set; }
/// <summary>
/// Gets or sets the contract type associated with the envelope type.
/// </summary>
public ContractType? ContractType { get; set; }
}

View File

@@ -45,7 +45,6 @@ public class ReadEnvelopeTypesQueryHandler : IRequestHandler<ReadEnvelopeTypesQu
Title = t.Title ?? string.Empty,
Language = string.IsNullOrWhiteSpace(t.Language) ? "de-DE" : t.Language,
ExpiresDays = t.ExpiresDays,
CertificationType = t.CertificationType,
UseAccessCode = t.UseAccessCode,
FinalEmailToCreator = (int?)t.FinalEmailToCreator,
FinalEmailToReceivers = (int?)t.FinalEmailToReceivers,
@@ -55,7 +54,6 @@ public class ReadEnvelopeTypesQueryHandler : IRequestHandler<ReadEnvelopeTypesQu
SendReminderEmails = t.SendReminderEmails,
FirstReminderDays = t.FirstReminderDays,
ReminderIntervalDays = t.ReminderIntervalDays,
ContractType = t.ContractType
})
.ToListAsync(cancellationToken);
}

View File

@@ -1,4 +1,5 @@
using EnvelopeGenerator.Application.Common.Dto;
using DigitalData.Core.Abstraction.Application.Repository;
using EnvelopeGenerator.Application.Common.Dto;
using EnvelopeGenerator.Application.Common.Interfaces.SQLExecutor;
using EnvelopeGenerator.Domain.Constants;
using MediatR;
@@ -33,11 +34,6 @@ public record CreateEnvelopeCommand : IRequest<EnvelopeDto?>
/// </summary>
public bool? UseAccessCode { get; set; }
/// <summary>
/// Zertifizierungstyp fuer den Signaturprozess.
/// </summary>
public CertificationType? CertificationType { get; set; }
/// <summary>
/// Finale E-Mail-Einstellung fuer den Ersteller.
/// </summary>

View File

@@ -96,7 +96,6 @@ public class CreateEnvelopeCommandHandler(IServiceProvider Provider, IMapper Map
e.EnvelopeTypeId = settings.EnvelopeTypeId;
e.Language = settings.Language;
e.UseAccessCode = settings.UseAccessCode;
e.CertificationType = settings.CertificationType;
e.FinalEmailToCreator = settings.FinalEmailToCreator;
e.FinalEmailToReceivers = settings.FinalEmailToReceivers;
e.SendReminderEmails = settings.SendReminderEmails;
@@ -104,7 +103,6 @@ public class CreateEnvelopeCommandHandler(IServiceProvider Provider, IMapper Map
e.ReminderIntervalDays = settings.ReminderIntervalDays;
e.ExpiresWhenDays = settings.ExpiresWhenDays;
e.ExpiresWarningWhenDays = settings.ExpiresWarningWhenDays;
e.ContractType = settings.ContractType;
e.ExpiresWhen = settings.ExpiresWhen;
e.ExpiresWarningWhen = settings.ExpiresWarningWhen;
e.Status = EnvelopeStatus.EnvelopeSaved;
@@ -117,7 +115,6 @@ public class CreateEnvelopeCommandHandler(IServiceProvider Provider, IMapper Map
envelope.EnvelopeTypeId = settings.EnvelopeTypeId;
envelope.Language = settings.Language;
envelope.UseAccessCode = settings.UseAccessCode;
envelope.CertificationType = settings.CertificationType;
envelope.FinalEmailToCreator = settings.FinalEmailToCreator;
envelope.FinalEmailToReceivers = settings.FinalEmailToReceivers;
envelope.SendReminderEmails = settings.SendReminderEmails;
@@ -125,7 +122,6 @@ public class CreateEnvelopeCommandHandler(IServiceProvider Provider, IMapper Map
envelope.ReminderIntervalDays = settings.ReminderIntervalDays;
envelope.ExpiresWhenDays = settings.ExpiresWhenDays;
envelope.ExpiresWarningWhenDays = settings.ExpiresWarningWhenDays;
envelope.ContractType = settings.ContractType;
envelope.ExpiresWhen = settings.ExpiresWhen;
envelope.ExpiresWarningWhen = settings.ExpiresWarningWhen;
envelope.Status = EnvelopeStatus.EnvelopeSaved;
@@ -149,7 +145,6 @@ public class CreateEnvelopeCommandHandler(IServiceProvider Provider, IMapper Map
Language = settings.Language,
TfaEnabled = request.TFAEnabled,
UseAccessCode = settings.UseAccessCode,
CertificationType = settings.CertificationType,
FinalEmailToCreator = settings.FinalEmailToCreator,
FinalEmailToReceivers = settings.FinalEmailToReceivers,
SendReminderEmails = settings.SendReminderEmails,
@@ -158,8 +153,7 @@ public class CreateEnvelopeCommandHandler(IServiceProvider Provider, IMapper Map
ExpiresWhenDays = settings.ExpiresWhenDays,
ExpiresWarningWhenDays = settings.ExpiresWarningWhenDays,
ExpiresWhen = settings.ExpiresWhen,
ExpiresWarningWhen = settings.ExpiresWarningWhen,
ContractType = settings.ContractType
ExpiresWarningWhen = settings.ExpiresWarningWhen
}, cancel);
if (request.UseSQLExecutor)
@@ -172,7 +166,6 @@ public class CreateEnvelopeCommandHandler(IServiceProvider Provider, IMapper Map
e.EnvelopeTypeId = settings.EnvelopeTypeId;
e.Language = settings.Language;
e.UseAccessCode = settings.UseAccessCode;
e.CertificationType = settings.CertificationType;
e.FinalEmailToCreator = settings.FinalEmailToCreator;
e.FinalEmailToReceivers = settings.FinalEmailToReceivers;
e.SendReminderEmails = settings.SendReminderEmails;
@@ -182,7 +175,6 @@ public class CreateEnvelopeCommandHandler(IServiceProvider Provider, IMapper Map
e.ExpiresWarningWhenDays = settings.ExpiresWarningWhenDays;
e.ExpiresWhen = settings.ExpiresWhen;
e.ExpiresWarningWhen = settings.ExpiresWarningWhen;
e.ContractType = settings.ContractType;
e.Status = EnvelopeStatus.EnvelopeSaved;
e.ChangedWhen = now;
}, e => e.Id == envelope.Id, cancel);
@@ -193,7 +185,6 @@ public class CreateEnvelopeCommandHandler(IServiceProvider Provider, IMapper Map
envelope.EnvelopeTypeId = settings.EnvelopeTypeId;
envelope.Language = settings.Language;
envelope.UseAccessCode = settings.UseAccessCode;
envelope.CertificationType = settings.CertificationType;
envelope.FinalEmailToCreator = settings.FinalEmailToCreator;
envelope.FinalEmailToReceivers = settings.FinalEmailToReceivers;
envelope.SendReminderEmails = settings.SendReminderEmails;
@@ -203,7 +194,6 @@ public class CreateEnvelopeCommandHandler(IServiceProvider Provider, IMapper Map
envelope.ExpiresWarningWhenDays = settings.ExpiresWarningWhenDays;
envelope.ExpiresWhen = settings.ExpiresWhen;
envelope.ExpiresWarningWhen = settings.ExpiresWarningWhen;
envelope.ContractType = settings.ContractType;
envelope.Status = EnvelopeStatus.EnvelopeSaved;
envelope.ChangedWhen = now;
}
@@ -265,10 +255,6 @@ public class CreateEnvelopeCommandHandler(IServiceProvider Provider, IMapper Map
EnvelopeTypeId: request.EnvelopeTypeId ?? existing?.EnvelopeTypeId,
Language: ResolveLanguage(request.Language, selectedType?.Language, existing?.Language),
UseAccessCode: useAccessCode,
CertificationType: request.CertificationType
?? selectedType?.CertificationType
?? existing?.CertificationType
?? CertificationType.AdvancedElectronicSignature,
FinalEmailToCreator: request.FinalEmailToCreator
?? (int?)selectedType?.FinalEmailToCreator
?? existing?.FinalEmailToCreator
@@ -294,10 +280,7 @@ public class CreateEnvelopeCommandHandler(IServiceProvider Provider, IMapper Map
ExpiresWhenDays: expiresWhenDays,
ExpiresWarningWhenDays: expiresWarningWhenDays,
ExpiresWhen: expiresWhenDays > 0 ? DateTime.Now.AddDays(expiresWhenDays) : null,
ExpiresWarningWhen: expiresWarningWhenDays > 0 ? DateTime.Now.AddDays(expiresWarningWhenDays) : null,
ContractType: existing?.ContractType
?? selectedType?.ContractType
?? ContractType.Contract);
ExpiresWarningWhen: expiresWarningWhenDays > 0 ? DateTime.Now.AddDays(expiresWarningWhenDays) : null);
}
private static string ResolveLanguage(string? preferred, string? fallback1, string? fallback2)
@@ -318,7 +301,6 @@ public class CreateEnvelopeCommandHandler(IServiceProvider Provider, IMapper Map
int? EnvelopeTypeId,
string Language,
bool UseAccessCode,
CertificationType CertificationType,
int FinalEmailToCreator,
int FinalEmailToReceivers,
bool SendReminderEmails,
@@ -327,8 +309,7 @@ public class CreateEnvelopeCommandHandler(IServiceProvider Provider, IMapper Map
int ExpiresWhenDays,
int ExpiresWarningWhenDays,
DateTime? ExpiresWhen,
DateTime? ExpiresWarningWhen,
ContractType ContractType);
DateTime? ExpiresWarningWhen);
private async Task<string> ResolveSenderReferenceAsync(Envelope envelope, CancellationToken cancel)
{
@@ -584,13 +565,12 @@ public class CreateEnvelopeCommandHandler(IServiceProvider Provider, IMapper Map
{
foreach (var er in envRcvs)
{
var advancedSignature = envelope.CertificationType == CertificationType.AdvancedElectronicSignature;
var origin = new Uri(ReqCntxt.Origin ?? throw new InvalidOperationException($"The request origin is missing in {nameof(CreateEnvelopeCommandHandler)}."));
try
{
await EnvNtfService.Notify(er.Receiver.EmailAddress, new DocumentReceivedNotification
{
AdvancedSignature = advancedSignature,
AdvancedSignature = envelope.Type() == EnvelopeType.AdvancedSignature,
DocumentTitle = envelope.Title ?? string.Empty,
NameReceiver = er.Name ?? string.Empty,
EnvelopeUuid = envelope.Uuid,

View File

@@ -170,10 +170,8 @@ public class ReadEnvelopeQueryHandler : IRequestHandler<ReadEnvelopeQuery, IEnum
AddedWhen = e.AddedWhen,
ChangedWhen = e.ChangedWhen,
Title = e.Title ?? string.Empty,
ContractType = e.ContractType,
Language = e.Language,
EnvelopeTypeId = e.EnvelopeTypeId,
CertificationType = e.CertificationType,
FinalEmailToCreator = e.FinalEmailToCreator,
FinalEmailToReceivers = e.FinalEmailToReceivers,
SendReminderEmails = e.SendReminderEmails,

View File

@@ -1,4 +1,5 @@
namespace EnvelopeGenerator.Domain.Constants
#if NETFRAMEWORK
namespace EnvelopeGenerator.Domain.Constants
{
public enum CertificationType
{
@@ -6,3 +7,4 @@
ElectronicSignature = 2
}
}
#endif

View File

@@ -1,8 +1,10 @@
namespace EnvelopeGenerator.Domain.Constants
#if NETFRAMEWORK
namespace EnvelopeGenerator.Domain.Constants
{
public enum ContractType
{
Contract = 1,
ReadAndSign = 2
}
}
}
#endif

View File

@@ -1,4 +1,11 @@
namespace EnvelopeGenerator.Domain.Constants
#if NETFRAMEWORK
using System;
using System.Linq;
#endif
using EnvelopeGenerator.Domain.Exceptions;
namespace EnvelopeGenerator.Domain.Constants
{
public enum EnvelopeType
{
@@ -6,4 +13,28 @@
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 EnvelopeTypeId in the database.");
}
return (EnvelopeType)Enum.ToObject(typeof(EnvelopeType), envelopeTypeId);
}
}
}

View File

@@ -82,8 +82,11 @@ namespace EnvelopeGenerator.Domain.Entities
[Column("COMMENT", TypeName = "nvarchar(128)")]
public string Comment { get; set; }
#if NETFRAMEWORK
[Column("CONTRACT_TYPE")]
public ContractType? ContractType { get; set; }
#endif
#if NETFRAMEWORK
[NotMapped]
@@ -110,8 +113,11 @@ namespace EnvelopeGenerator.Domain.Entities
[Obsolete("Use EnvelopeGenerator.Domain.Interfaces.EnvelopeExtensions.IsReadAndConfirm extension method instead.")]
public bool ReadOnly => this.IsReadAndConfirm();
#if NETFRAMEWORK
[Column("CERTIFICATION_TYPE")]
public CertificationType? CertificationType { get; set; }
#endif
[Column("USE_ACCESS_CODE")]
public bool? UseAccessCode { get; set; }

View File

@@ -26,17 +26,19 @@ namespace EnvelopeGenerator.Domain.Entities
[Column("EXPIRES_DAYS")]
public int? ExpiresDays { get; set; }
#if NETFRAMEWORK
[Column("CERTIFICATION_TYPE")]
public Constants.CertificationType? CertificationType { get; set; }
public CertificationType? CertificationType { get; set; }
#endif
[Column("USE_ACCESS_CODE")]
public bool? UseAccessCode { get; set; }
[Column("FINAL_EMAIL_TO_CREATOR")]
public Constants.FinalEmailType? FinalEmailToCreator { get; set; }
public FinalEmailType? FinalEmailToCreator { get; set; }
[Column("FINAL_EMAIL_TO_RECEIVERS")]
public Constants.FinalEmailType? FinalEmailToReceivers { get; set; }
public FinalEmailType? FinalEmailToReceivers { get; set; }
[Required]
[Column("ADDED_WHEN", TypeName = "datetime")]
@@ -57,8 +59,10 @@ namespace EnvelopeGenerator.Domain.Entities
[Column("REMINDER_INTERVAL_DAYS")]
public int? ReminderIntervalDays { get; set; }
#if NETFRAMEWORK
[Column("CONTRACT_TYPE")]
public ContractType? ContractType { get; set; }
#endif
[NotMapped]
public bool TFA_Enabled { get; set; } = false;

View File

@@ -35,25 +35,11 @@ namespace EnvelopeGenerator.Domain.Interfaces
return envelope.DocResult != null;
}
public static EnvelopeType Type(this IEnvelope envelope)
public static EnvelopeType? Type(this IEnvelope envelope)
{
if (!Enum.IsDefined(typeof(EnvelopeType), envelope.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 '{envelope.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 EnvelopeTypeId in the database.");
}
return (EnvelopeType)Enum.ToObject(typeof(EnvelopeType), envelope.EnvelopeTypeId);
if (envelope.EnvelopeTypeId is int envelopeTypeId)
return envelopeTypeId.ToEnvelopeType();
return null;
}
public static void SetType(this IEnvelope envelope, EnvelopeType type)

View File

@@ -81,7 +81,7 @@
<MudIconButton Icon="@Icons.Material.Filled.Info" Color="Color.Tertiary" Size="Size.Small" Class="sender-create-wizard__help-icon" aria-label='@L("SenderWizard_HelpAria_EnvelopeType", "Hilfe zum Feld Umschlagtyp")' />
</MudTooltip>
</label>
<select value="@(_selectedEnvelopeTypeId?.ToString() ?? string.Empty)"
<select value="@(_selectedEnvelopeType?.ToString() ?? string.Empty)"
@onchange="OnEnvelopeTypeChanged"
class="sender-create-wizard__select">
@foreach (var type in EnvelopeTypes)
@@ -172,7 +172,7 @@
<div class="sender-create-wizard__field sender-create-wizard__field--full">
<div class="sender-create-wizard__settings-toggles">
<label class="sender-create-wizard__settings-toggle">
<input type="checkbox" checked="@_tfaEnabled" @onchange="OnTfaChanged" disabled="@IsFesSelected" />
<input type="checkbox" checked="@_tfaEnabled" @onchange="OnTfaChanged" disabled="@(_selectedEnvelopeType == EnvelopeType.AdvancedSignature)" />
<span>@L("TFAEnabled", "2FA aktiviert")</span>
<MudTooltip Text='@L("SenderWizard_Help_TfaEnabled", "Wenn aktiviert, ist die Signaturfreigabe nur mit zusaetzlicher Verifizierung moeglich.")'>
<MudIconButton Icon="@Icons.Material.Filled.Info" Color="Color.Tertiary" Size="Size.Small" Class="sender-create-wizard__help-icon" aria-label='@L("SenderWizard_HelpAria_TfaEnabled", "Hilfe zur Option 2FA")' />
@@ -434,12 +434,11 @@
private readonly HashSet<int> _completedSteps = [];
private string _title = string.Empty;
private int? _selectedEnvelopeTypeId;
private EnvelopeType? _selectedEnvelopeType;
private string _message = string.Empty;
private string _language = "de-DE";
private bool _useAccessCode;
private bool _tfaEnabled;
private CertificationType _certificationType = CertificationType.AdvancedElectronicSignature;
private int _finalEmailToCreator = (int)FinalEmailType.No;
private int _finalEmailToReceivers = (int)FinalEmailType.No;
private bool _sendReminderEmails;
@@ -468,7 +467,6 @@
private string? _validationMessage;
private bool IsActionLocked => _isDocumentUploading || _isStepActionRunning || _isFinishing;
private bool IsFesSelected => _certificationType == CertificationType.AdvancedElectronicSignature;
private bool IsFirstStep => _currentStep <= 0;
private bool IsLastStep => _currentStep >= TotalSteps - 1;
@@ -497,7 +495,7 @@
{
_isVisible = Visible;
if (_selectedEnvelopeTypeId is null && EnvelopeTypes.Count > 0)
if (_selectedEnvelopeType is null && EnvelopeTypes.Count > 0)
ApplyDefaultEnvelopeType();
if (Visible && !_previousVisible)
@@ -547,7 +545,7 @@
var raw = args.Value?.ToString();
if (int.TryParse(raw, out var id) && id > 0)
{
_selectedEnvelopeTypeId = id;
_selectedEnvelopeType = id.ToEnvelopeType();
var selectedType = EnvelopeTypes.FirstOrDefault(x => x.Id == id);
if (selectedType is not null)
ApplyEnvelopeTypeDefaults(selectedType);
@@ -555,7 +553,7 @@
return Task.CompletedTask;
}
_selectedEnvelopeTypeId = null;
_selectedEnvelopeType = null;
return Task.CompletedTask;
}
@@ -758,11 +756,10 @@
var result = new CreateEnvelopeWizardResult(
Title: _title.Trim(),
Message: _message.Trim(),
EnvelopeTypeId: _selectedEnvelopeTypeId,
EnvelopeTypeId: (int?)_selectedEnvelopeType,
Language: string.IsNullOrWhiteSpace(_language) ? "de-DE" : _language,
UseAccessCode: _useAccessCode,
TFAEnabled: _tfaEnabled,
CertificationType: _certificationType,
FinalEmailToCreator: _finalEmailToCreator,
FinalEmailToReceivers: _finalEmailToReceivers,
SendReminderEmails: _sendReminderEmails,
@@ -867,8 +864,8 @@
{
if (_currentStep == 0)
{
if (_selectedEnvelopeTypeId is null && EnvelopeTypes.Count > 0)
_selectedEnvelopeTypeId = GetDefaultEnvelopeTypeId();
if (_selectedEnvelopeType is null && EnvelopeTypes.Count > 0)
_selectedEnvelopeType = EnvelopeType.SimpleSignature;
if (string.IsNullOrWhiteSpace(_title))
{
@@ -876,7 +873,7 @@
return false;
}
if (!_selectedEnvelopeTypeId.HasValue || _selectedEnvelopeTypeId.Value <= 0)
if (!_selectedEnvelopeType.HasValue || _selectedEnvelopeType.Value <= 0)
{
_validationMessage = L("SenderWizard_Validation_EnvelopeTypeRequired", "Bitte wählen Sie einen Umschlagtyp aus.");
return false;
@@ -963,7 +960,7 @@
{
_validationMessage = null;
if (IsFesSelected)
if (_selectedEnvelopeType == EnvelopeType.AdvancedSignature)
{
_tfaEnabled = true;
_useAccessCode = true;
@@ -1013,9 +1010,6 @@
if (_tfaEnabled)
_useAccessCode = true;
if (envelopeType.CertificationType.HasValue)
_certificationType = envelopeType.CertificationType.Value;
if (envelopeType.FinalEmailToCreator.HasValue)
_finalEmailToCreator = envelopeType.FinalEmailToCreator.Value;
@@ -1044,7 +1038,7 @@
{
_language = string.IsNullOrWhiteSpace(_language) ? "de-DE" : _language.Trim();
if (IsFesSelected)
if (_selectedEnvelopeType == EnvelopeType.AdvancedSignature)
_tfaEnabled = true;
if (_tfaEnabled)
@@ -1087,11 +1081,11 @@
private void ApplyDefaultEnvelopeType()
{
_selectedEnvelopeTypeId = GetDefaultEnvelopeTypeId();
if (!_selectedEnvelopeTypeId.HasValue)
_selectedEnvelopeType = EnvelopeType.SimpleSignature;
if (!_selectedEnvelopeType.HasValue)
return;
var selectedType = EnvelopeTypes.FirstOrDefault(x => x.Id == _selectedEnvelopeTypeId.Value);
var selectedType = EnvelopeTypes.FirstOrDefault(x => x.Id == (int)_selectedEnvelopeType);
if (selectedType is not null)
ApplyEnvelopeTypeDefaults(selectedType);
}
@@ -1103,12 +1097,11 @@
_validationMessage = null;
_title = string.Empty;
_selectedEnvelopeTypeId = null;
_selectedEnvelopeType = null;
_message = string.Empty;
_language = "de-DE";
_useAccessCode = false;
_tfaEnabled = false;
_certificationType = CertificationType.AdvancedElectronicSignature;
_finalEmailToCreator = (int)FinalEmailType.No;
_finalEmailToReceivers = (int)FinalEmailType.No;
_sendReminderEmails = false;
@@ -1133,18 +1126,6 @@
NormalizeSettings();
}
private int? GetDefaultEnvelopeTypeId()
{
if (EnvelopeTypes.Count == 0)
return null;
var handwrittenType = EnvelopeTypes.FirstOrDefault(x =>
!string.IsNullOrWhiteSpace(x.Title)
&& x.Title.Contains("Handschriftliche Unterschrift", StringComparison.OrdinalIgnoreCase));
return handwrittenType?.Id ?? EnvelopeTypes[0].Id;
}
private string L(string key, string fallback)
{
var modelValue = ModelLocalizer[key];

View File

@@ -9,7 +9,6 @@ public sealed record CreateEnvelopeWizardResult(
string Language,
bool UseAccessCode,
bool TFAEnabled,
CertificationType CertificationType,
int FinalEmailToCreator,
int FinalEmailToReceivers,
bool SendReminderEmails,

View File

@@ -13,6 +13,7 @@
@using Microsoft.AspNetCore.Components.Forms
@using Microsoft.Extensions.Localization
@using Microsoft.Extensions.Options
@using EnvelopeGenerator.Domain.Interfaces
@inject IJSRuntime JSRuntime
@inject NavigationManager NavigationManager
@inject AppVersionService AppVersion
@@ -120,14 +121,6 @@
</select>
</div>
<div class="sender-settings-field">
<label class="sender-settings-label">@L("CertificationType", "Zertifizierung")</label>
<select @bind="_certificationType" class="sender-settings-select">
<option value="@CertificationType.AdvancedElectronicSignature">@L("AdvancedElectronicSignature", "Advanced Electronic Signature")</option>
<option value="@CertificationType.ElectronicSignature">@L("ElectronicSignature", "Electronic Signature")</option>
</select>
</div>
<div class="sender-settings-toggles">
<label class="sender-settings-toggle">
<input type="checkbox" checked="@_tfaEnabled" @onchange="OnTfaChanged" />
@@ -703,7 +696,6 @@
string _language = "de-DE";
bool _useAccessCode;
bool _tfaEnabled;
CertificationType _certificationType = CertificationType.AdvancedElectronicSignature;
int _finalEmailToCreator = (int)FinalEmailType.No;
int _finalEmailToReceivers = (int)FinalEmailType.No;
bool _sendReminderEmails;
@@ -793,7 +785,6 @@
if (_tfaEnabled)
_useAccessCode = true;
_certificationType = envelope.CertificationType ?? CertificationType.AdvancedElectronicSignature;
_finalEmailToCreator = envelope.FinalEmailToCreator ?? (int)FinalEmailType.No;
_finalEmailToReceivers = envelope.FinalEmailToReceivers ?? (int)FinalEmailType.No;
@@ -997,9 +988,6 @@
if (_tfaEnabled)
_useAccessCode = true;
if (envelopeType.CertificationType.HasValue)
_certificationType = envelopeType.CertificationType.Value;
if (envelopeType.FinalEmailToCreator.HasValue)
_finalEmailToCreator = envelopeType.FinalEmailToCreator.Value;
@@ -1368,7 +1356,6 @@
Language = _language,
UseAccessCode = _useAccessCode,
TFAEnabled = _tfaEnabled,
CertificationType = _certificationType,
FinalEmailToCreator = _finalEmailToCreator,
FinalEmailToReceivers = _finalEmailToReceivers,
SendReminderEmails = _sendReminderEmails,

View File

@@ -802,7 +802,6 @@
Language = string.IsNullOrWhiteSpace(result.Language) ? "de-DE" : result.Language,
UseAccessCode = result.UseAccessCode,
TFAEnabled = result.TFAEnabled,
CertificationType = result.CertificationType,
FinalEmailToCreator = result.FinalEmailToCreator,
FinalEmailToReceivers = result.FinalEmailToReceivers,
SendReminderEmails = result.SendReminderEmails,

View File

@@ -50,7 +50,6 @@ public sealed record CreateEnvelopeBootstrapPayload(
string Language,
bool UseAccessCode,
bool TFAEnabled,
CertificationType CertificationType,
int FinalEmailToCreator,
int FinalEmailToReceivers,
bool SendReminderEmails,