From e77532ebfd02265b9f6bcedd654b2eed345865f7 Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Fri, 29 Nov 2024 10:11:33 +0100 Subject: [PATCH] =?UTF-8?q?feat(EnvelopeReceiverService):=20ReadWithSecret?= =?UTF-8?q?ByUuidSignatureAsync=20zum=20Lesen=20mit=20Zugangscode=20und=20?= =?UTF-8?q?Telefonnummer=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Contracts/IEnvelopeReceiverService.cs | 2 ++ .../Services/EnvelopeReceiverService.cs | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/EnvelopeGenerator.Application/Contracts/IEnvelopeReceiverService.cs b/EnvelopeGenerator.Application/Contracts/IEnvelopeReceiverService.cs index 88fd8549..65834a4d 100644 --- a/EnvelopeGenerator.Application/Contracts/IEnvelopeReceiverService.cs +++ b/EnvelopeGenerator.Application/Contracts/IEnvelopeReceiverService.cs @@ -17,6 +17,8 @@ namespace EnvelopeGenerator.Application.Contracts Task> ReadByUuidSignatureAsync(string uuid, string signature, bool withEnvelope = true, bool withReceiver = true); + Task> ReadWithSecretByUuidSignatureAsync(string uuid, string signature, bool withEnvelope = true, bool withReceiver = true); + Task> ReadByEnvelopeReceiverIdAsync(string envelopeReceiverId, bool withEnvelope = true, bool withReceiver = true); Task> ReadAccessCodeByIdAsync(int envelopeId, int receiverId); diff --git a/EnvelopeGenerator.Application/Services/EnvelopeReceiverService.cs b/EnvelopeGenerator.Application/Services/EnvelopeReceiverService.cs index 7d4c3b9f..cdb35a98 100644 --- a/EnvelopeGenerator.Application/Services/EnvelopeReceiverService.cs +++ b/EnvelopeGenerator.Application/Services/EnvelopeReceiverService.cs @@ -54,6 +54,16 @@ namespace EnvelopeGenerator.Application.Services return Result.Success(_mapper.Map(env_rcv)); } + public async Task> ReadWithSecretByUuidSignatureAsync(string uuid, string signature, bool withEnvelope = true, bool withReceiver = true) + { + var env_rcv = await _repository.ReadByUuidSignatureAsync(uuid: uuid, signature: signature, withEnvelope: withEnvelope, withReceiver: withReceiver); + if (env_rcv is null) + return Result.Fail() + .Message(Key.EnvelopeReceiverNotFound); + + return Result.Success(_mapper.Map(env_rcv)); + } + public async Task> ReadByEnvelopeReceiverIdAsync(string envelopeReceiverId, bool withEnvelope = true, bool withReceiver = true) { (string? uuid, string? signature) = envelopeReceiverId.DecodeEnvelopeReceiverId();