From 4f5b8f9d766ad959dacb8e4e0503012255e8db44 Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Tue, 10 Dec 2024 22:48:43 +0100 Subject: [PATCH] =?UTF-8?q?feat(EnvelopeReceiverService):=20Optionale=20sc?= =?UTF-8?q?hreibgesch=C3=BCtzte=20Eingabe=20als=20Schnittstellenimplementi?= =?UTF-8?q?erung=20hinzugef=C3=BCgt.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - als Standard ist Nur-Lesen wahr. --- .../Contracts/IEnvelopeReceiverService.cs | 10 +++++----- .../Services/EnvelopeReceiverService.cs | 20 +++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/EnvelopeGenerator.Application/Contracts/IEnvelopeReceiverService.cs b/EnvelopeGenerator.Application/Contracts/IEnvelopeReceiverService.cs index 65834a4d..f22fde28 100644 --- a/EnvelopeGenerator.Application/Contracts/IEnvelopeReceiverService.cs +++ b/EnvelopeGenerator.Application/Contracts/IEnvelopeReceiverService.cs @@ -9,17 +9,17 @@ namespace EnvelopeGenerator.Application.Contracts public interface IEnvelopeReceiverService : IBasicCRUDService { - Task>> ReadByUuidAsync(string uuid, bool withEnvelope = true, bool withReceiver = false); + Task>> ReadByUuidAsync(string uuid, bool withEnvelope = true, bool withReceiver = false, bool readOnly = true); Task>> ReadAccessCodeByUuidAsync(string uuid, bool withEnvelope = false, bool withReceiver = true); - Task>> ReadBySignatureAsync(string signature, bool withEnvelope = false, bool withReceiver = true); + Task>> ReadBySignatureAsync(string signature, bool withEnvelope = false, bool withReceiver = true, bool readOnly = true); - Task> ReadByUuidSignatureAsync(string uuid, string signature, bool withEnvelope = true, bool withReceiver = true); + Task> ReadByUuidSignatureAsync(string uuid, string signature, bool withEnvelope = true, bool withReceiver = true, bool readOnly = true); - Task> ReadWithSecretByUuidSignatureAsync(string uuid, string signature, bool withEnvelope = true, bool withReceiver = true); + Task> ReadWithSecretByUuidSignatureAsync(string uuid, string signature, bool withEnvelope = true, bool withReceiver = true, bool readOnly = true); - Task> ReadByEnvelopeReceiverIdAsync(string envelopeReceiverId, bool withEnvelope = true, bool withReceiver = true); + Task> ReadByEnvelopeReceiverIdAsync(string envelopeReceiverId, bool withEnvelope = true, bool withReceiver = true, bool readOnly = true); Task> ReadAccessCodeByIdAsync(int envelopeId, int receiverId); diff --git a/EnvelopeGenerator.Application/Services/EnvelopeReceiverService.cs b/EnvelopeGenerator.Application/Services/EnvelopeReceiverService.cs index cdb35a98..ee3e07fe 100644 --- a/EnvelopeGenerator.Application/Services/EnvelopeReceiverService.cs +++ b/EnvelopeGenerator.Application/Services/EnvelopeReceiverService.cs @@ -26,15 +26,15 @@ namespace EnvelopeGenerator.Application.Services _messagingService = messagingService; } - public async Task>> ReadBySignatureAsync(string signature, bool withEnvelope = false, bool withReceiver = true) + public async Task>> ReadBySignatureAsync(string signature, bool withEnvelope = false, bool withReceiver = true, bool readOnly = true) { - var env_rcvs = await _repository.ReadBySignatureAsync(signature: signature, withEnvelope: withEnvelope, withReceiver: withReceiver); + var env_rcvs = await _repository.ReadBySignatureAsync(signature: signature, withEnvelope: withEnvelope, withReceiver: withReceiver, readOnly: readOnly); return Result.Success(_mapper.Map>(env_rcvs)); } - public async Task>> ReadByUuidAsync(string uuid, bool withEnvelope = true, bool withReceiver = false) + public async Task>> ReadByUuidAsync(string uuid, bool withEnvelope = true, bool withReceiver = false, bool readOnly = true) { - var env_rcvs = await _repository.ReadByUuidAsync(uuid: uuid, withEnvelope: withEnvelope, withReceiver: withReceiver); + var env_rcvs = await _repository.ReadByUuidAsync(uuid: uuid, withEnvelope: withEnvelope, withReceiver: withReceiver, readOnly: readOnly); return Result.Success(_mapper.Map>(env_rcvs)); } @@ -44,9 +44,9 @@ namespace EnvelopeGenerator.Application.Services return Result.Success(env_rcvs.Select(er => er.AccessCode)); } - public async Task> ReadByUuidSignatureAsync(string uuid, string signature, bool withEnvelope = true, bool withReceiver = true) + public async Task> ReadByUuidSignatureAsync(string uuid, string signature, bool withEnvelope = true, bool withReceiver = true, bool readOnly = true) { - var env_rcv = await _repository.ReadByUuidSignatureAsync(uuid: uuid, signature: signature, withEnvelope: withEnvelope, withReceiver: withReceiver); + var env_rcv = await _repository.ReadByUuidSignatureAsync(uuid: uuid, signature: signature, withEnvelope: withEnvelope, withReceiver: withReceiver, readOnly: readOnly); if (env_rcv is null) return Result.Fail() .Message(Key.EnvelopeReceiverNotFound); @@ -54,9 +54,9 @@ 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) + public async Task> ReadWithSecretByUuidSignatureAsync(string uuid, string signature, bool withEnvelope = true, bool withReceiver = true, bool readOnly = true) { - var env_rcv = await _repository.ReadByUuidSignatureAsync(uuid: uuid, signature: signature, withEnvelope: withEnvelope, withReceiver: withReceiver); + var env_rcv = await _repository.ReadByUuidSignatureAsync(uuid: uuid, signature: signature, withEnvelope: withEnvelope, withReceiver: withReceiver, readOnly: readOnly); if (env_rcv is null) return Result.Fail() .Message(Key.EnvelopeReceiverNotFound); @@ -64,7 +64,7 @@ namespace EnvelopeGenerator.Application.Services return Result.Success(_mapper.Map(env_rcv)); } - public async Task> ReadByEnvelopeReceiverIdAsync(string envelopeReceiverId, bool withEnvelope = true, bool withReceiver = true) + public async Task> ReadByEnvelopeReceiverIdAsync(string envelopeReceiverId, bool withEnvelope = true, bool withReceiver = true, bool readOnly = true) { (string? uuid, string? signature) = envelopeReceiverId.DecodeEnvelopeReceiverId(); @@ -75,7 +75,7 @@ namespace EnvelopeGenerator.Application.Services .Notice(LogLevel.Warning, EnvelopeFlag.WrongEnvelopeReceiverId) .Notice(LogLevel.Warning, Flag.PossibleSecurityBreach); - return await ReadByUuidSignatureAsync(uuid: uuid, signature: signature, withEnvelope: withEnvelope, withReceiver: withReceiver); + return await ReadByUuidSignatureAsync(uuid: uuid, signature: signature, withEnvelope: withEnvelope, withReceiver: withReceiver, readOnly: readOnly); } public async Task> VerifyAccessCodeAsync(string uuid, string signature, string accessCode)