Ein weiterer informativer Text wurde für den Umschlag hinzugefügt, der von anderen Interessengruppen gestrichen wurde.

This commit is contained in:
Developer 02
2024-06-06 16:55:42 +02:00
parent 290a1dd522
commit f509cc8b3b
11 changed files with 74 additions and 27 deletions

View File

@@ -1,5 +1,6 @@
using DigitalData.Core.Contracts.Application;
using DigitalData.Core.DTO;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
using EnvelopeGenerator.Domain.Entities;
using EnvelopeGenerator.Infrastructure.Contracts;
@@ -17,10 +18,12 @@ namespace EnvelopeGenerator.Application.Contracts
Task<bool> IsRejected(int envelopeId, string? userReference = null);
Task<IEnumerable<EnvelopeHistoryDto>> ReadAsync(int? envelopeId = null, string? userReference = null, ReferenceType? referenceType = null, int? status = null);
Task<IEnumerable<EnvelopeHistoryDto>> ReadAsync(int? envelopeId = null, string? userReference = null, ReferenceType? referenceType = null, int? status = null, bool withSender = false, bool withReceiver = false);
Task<IEnumerable<EnvelopeHistoryDto>> ReadRejectedAsync(int envelopeId, string? userReference = null);
Task<DataResult<long>> RecordAsync(int envelopeId, string userReference, EnvelopeStatus status, string? comment = null);
Task<IEnumerable<ReceiverDto>> ReadRejectingReceivers(int envelopeId);
Task<DataResult<long>> RecordAsync(int envelopeId, string userReference, EnvelopeStatus status, string? comment = null);
}
}

View File

@@ -1,4 +1,5 @@
using DigitalData.UserManager.Application.DTOs.User;
using DigitalData.Core.DTO;
using DigitalData.UserManager.Application.DTOs.User;
using static EnvelopeGenerator.Common.Constants;
namespace EnvelopeGenerator.Application.DTOs.EnvelopeHistory
@@ -13,5 +14,5 @@ namespace EnvelopeGenerator.Application.DTOs.EnvelopeHistory
UserCreateDto? Sender,
ReceiverDto? Receiver,
ReferenceType ReferenceType,
string? Comment = null);
string? Comment = null) : BaseDTO<long>(Id);
}

View File

@@ -1,9 +1,11 @@
namespace EnvelopeGenerator.Application.DTOs
using DigitalData.Core.DTO;
namespace EnvelopeGenerator.Application.DTOs
{
public record ReceiverDto(
int Id,
string EmailAddress,
string Signature,
DateTime AddedWhen
);
) : BaseDTO<int>(Id);
}

View File

@@ -102,9 +102,9 @@ namespace EnvelopeGenerator.Application
/// <returns>The receiver signature.</returns>
public static string? GetReceiverSignature(this string envelopeReceiverId) => envelopeReceiverId.DecodeEnvelopeReceiverId().ReceiverSignature;
public static void LogEnvelopeError(this ILogger logger, string envelopeEeceiverId, Exception? exception = null, string? message = null, params object?[] args)
public static void LogEnvelopeError(this ILogger logger, string envelopeReceiverId, Exception? exception = null, string? message = null, params object?[] args)
{
var sb = new StringBuilder().AppendLine(envelopeEeceiverId.DecodeEnvelopeReceiverId().ToTitle());
var sb = new StringBuilder().AppendLine(envelopeReceiverId.DecodeEnvelopeReceiverId().ToTitle());
if (message is not null)
sb.AppendLine(message);

View File

@@ -183,8 +183,14 @@
<data name="RejectionInfo1" xml:space="preserve">
<value>Ihre Ablehnung wurde weitergeleitet!</value>
</data>
<data name="RejectionInfo1_ext" xml:space="preserve">
<value>Vorgang abgebrochen!</value>
</data>
<data name="RejectionInfo2" xml:space="preserve">
<value>Sie können bei Bedarf mit {0}, &lt;a href="mailto:{1}?subject={2}&amp;body=Dear%20{0},%0A%0A%0A"&gt;{1}&lt;/a&gt; Kontakt aufnehmen.</value>
<value>Sie können bei Bedarf mit {0}, &lt;a href="mailto:{1}?subject={2}&amp;body=Sehr geehrte(r)%20{0},%0A%0A%0A"&gt;{1}&lt;/a&gt; Kontakt aufnehmen.</value>
</data>
<data name="RejectionInfo2_ext" xml:space="preserve">
<value>Das Vorgang wurde von einer der beteiligten Parteien abgelehnt. Sie können bei Bedarf mit {0}, &lt;a href="mailto:{1}?subject={2}&amp;body=Sehr geehrte(r)%20{0},%0A%0A%0A"&gt;{1}&lt;/a&gt; Kontakt aufnehmen.</value>
</data>
<data name="RejectionReasonQ" xml:space="preserve">
<value>Bitte geben Sie einen Grund an:</value>

View File

@@ -183,9 +183,15 @@
<data name="RejectionInfo1" xml:space="preserve">
<value>Your rejection has been forwarded!</value>
</data>
<data name="RejectionInfo1_ext" xml:space="preserve">
<value>Process canceled!</value>
</data>
<data name="RejectionInfo2" xml:space="preserve">
<value>You can contact {0}, &lt;a href="mailto:{1}?subject={2}&amp;body=Dear%20{0},%0A%0A%0A"&gt;{1}&lt;/a&gt; if required.</value>
</data>
<data name="RejectionInfo2_ext" xml:space="preserve">
<value>The process has been rejected by one of the parties involved. You can contact {0}, &lt;a href="mailto:{1}?subject={2}&amp;body=Dear%20{0},%0A%0A%0A"&gt;{1}&lt;/a&gt; if required.</value>
</data>
<data name="RejectionReasonQ" xml:space="preserve">
<value>Please give a reason:</value>
</data>

View File

@@ -8,6 +8,7 @@ using static EnvelopeGenerator.Common.Constants;
using EnvelopeGenerator.Application.Resources;
using DigitalData.Core.DTO;
using EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
using EnvelopeGenerator.Application.DTOs;
namespace EnvelopeGenerator.Application.Services
{
@@ -50,20 +51,33 @@ namespace EnvelopeGenerator.Application.Services
status: (int)EnvelopeStatus.DocumentRejected) > 0;
}
public async Task<IEnumerable<EnvelopeHistoryDto>> ReadAsync(int? envelopeId = null, string? userReference = null, ReferenceType? referenceType = null, int? status = null)
public async Task<IEnumerable<EnvelopeHistoryDto>> ReadAsync(int? envelopeId = null, string? userReference = null, ReferenceType? referenceType = null, int? status = null, bool withSender = false, bool withReceiver = false)
{
var histDTOs = _mapper.MapOrThrow<IEnumerable<EnvelopeHistoryDto>>(
await _repository.ReadAsync(
envelopeId: envelopeId,
userReference: userReference,
status: status));
status: status,
withSender: withSender,
withReceiver: withReceiver));
return referenceType is null ? histDTOs : histDTOs.Where(h => h.ReferenceType == referenceType);
}
public async Task<IEnumerable<EnvelopeHistoryDto>> ReadRejectedAsync(int envelopeId, string? userReference = null) =>
await ReadAsync(envelopeId: envelopeId, userReference: userReference, status: (int)EnvelopeStatus.DocumentRejected);
await ReadAsync(envelopeId: envelopeId, userReference: userReference, status: (int)EnvelopeStatus.DocumentRejected, withReceiver:true);
public async Task<DataResult<long>> RecordAsync(int envelopeId, string userReference, EnvelopeStatus status, string? comment = null) =>
//TODO: use IQueryable in repository to incerease the performance
public async Task<IEnumerable<ReceiverDto>> ReadRejectingReceivers(int envelopeId)
{
var envelopes = await ReadRejectedAsync(envelopeId);
return envelopes is null
? Enumerable.Empty<ReceiverDto>()
: envelopes
.Where(eh => eh?.Receiver != null)
.Select(eh => eh.Receiver!);
}
public async Task<DataResult<long>> RecordAsync(int envelopeId, string userReference, EnvelopeStatus status, string? comment = null) =>
await CreateAsync(new (EnvelopeId: envelopeId, UserReference: userReference, Status: (int)status, ActionDate: DateTime.Now, Comment: comment))
.ThenAsync(
Success: id => Result.Success(id),