diff --git a/EnvelopeGenerator.Application/Model/EnvelopeReceiverQueryBase.cs b/EnvelopeGenerator.Application/Model/EnvelopeReceiverQueryBase.cs index 8df8d522..3995263f 100644 --- a/EnvelopeGenerator.Application/Model/EnvelopeReceiverQueryBase.cs +++ b/EnvelopeGenerator.Application/Model/EnvelopeReceiverQueryBase.cs @@ -17,24 +17,26 @@ public record EnvelopeReceiverQueryBase where TEnvelopeQuery : EnvelopeQueryBase, new() where TReceiverQuery : ReceiverQueryBase, new() { + private string? _key; + /// /// /// public virtual string? Key { - get => Envelope?.Uuid is string uuid && Receiver?.Signature is string signature - ? (uuid, signature).EncodeEnvelopeReceiverId() - : null; + get => _key; init { if (value is null) + { + _key = null; return; + } (string? EnvelopeUuid, string? ReceiverSignature) = value.DecodeEnvelopeReceiverId(); if (string.IsNullOrEmpty(EnvelopeUuid) || string.IsNullOrEmpty(ReceiverSignature)) - { throw new BadRequestException("Der EnvelopeReceiverKey muss ein gültiger Base64-kodierter String sein, der die EnvelopeUuid und die ReceiverSignature enthält."); - } + Envelope = new TEnvelopeQuery() { Uuid = EnvelopeUuid @@ -43,6 +45,7 @@ public record EnvelopeReceiverQueryBase { Signature = ReceiverSignature }; + _key = value; } }