Added `OnlyActive` and `OnlyCompleted` properties to the `ReadEnvelopeQuery` class to enable filtering envelopes by their active or completed status. Updated the `ReadEnvelopeQueryHandler` to apply these filters when the properties are set. Enhanced the `EnvelopeStatus` class by introducing `Active` and `Completed` status lists and adding extension methods (`IsActive` and `IsCompleted`) to determine status categories. Included necessary `using` directives for `System` and `System.Linq`.
78 lines
2.7 KiB
C#
78 lines
2.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
namespace EnvelopeGenerator.Domain.Constants
|
|
{
|
|
// http://wiki.dd/xwiki_prod/bin/view/Anwendungen/Produkt-Handbuch/Sonstiges/signFLOW/signFLOW%20-%20Enwickler-Handbuch/4.%20Anhang/4.3%20Historie%20und%20Status%20der%20Umschl%C3%A4ge/
|
|
public enum EnvelopeStatus
|
|
{
|
|
Invalid = 0,
|
|
EnvelopeCreated = 1001,
|
|
EnvelopeSaved = 1002,
|
|
EnvelopeQueued = 1003,
|
|
EnvelopeSent = 1004, // Nicht verwendet
|
|
EnvelopePartlySigned = 1005,
|
|
EnvelopeCompletelySigned = 1006,
|
|
EnvelopeReportCreated = 1007,
|
|
EnvelopeArchived = 1008,
|
|
EnvelopeDeleted = 1009,
|
|
EnvelopeRejected = 10007,
|
|
EnvelopeWithdrawn = 10009,
|
|
AccessCodeRequested = 2001,
|
|
AccessCodeCorrect = 2002,
|
|
AccessCodeIncorrect = 2003,
|
|
DocumentOpened = 2004,
|
|
DocumentSigned = 2005,
|
|
DocumentForwarded = 2006,
|
|
DocumentRejected = 2007,
|
|
EnvelopeShared = 2008,
|
|
EnvelopeViewed = 2009,
|
|
MessageInvitationSent = 3001, // Wird von Trigger verwendet
|
|
MessageAccessCodeSent = 3002,
|
|
MessageConfirmationSent = 3003,
|
|
MessageDeletionSent = 3004,
|
|
MessageCompletionSent = 3005,
|
|
DocumentMod_Rotation = 4001
|
|
}
|
|
|
|
public static class Status
|
|
{
|
|
public static readonly IReadOnlyList<EnvelopeStatus> NonHist = new List<EnvelopeStatus>
|
|
{
|
|
EnvelopeStatus.Invalid,
|
|
EnvelopeStatus.EnvelopeSaved,
|
|
EnvelopeStatus.EnvelopeSent,
|
|
EnvelopeStatus.EnvelopePartlySigned
|
|
};
|
|
|
|
public static readonly IReadOnlyList<EnvelopeStatus> RelatedToFormApp = new List<EnvelopeStatus>
|
|
{
|
|
EnvelopeStatus.EnvelopeCreated,
|
|
EnvelopeStatus.DocumentMod_Rotation
|
|
};
|
|
|
|
public static readonly List<EnvelopeStatus> Active = Enum.GetValues(typeof(EnvelopeStatus))
|
|
.Cast<EnvelopeStatus>()
|
|
.Where(status => status.IsActive())
|
|
.ToList();
|
|
|
|
public static readonly List<EnvelopeStatus> Completed = Enum.GetValues(typeof(EnvelopeStatus))
|
|
.Cast<EnvelopeStatus>()
|
|
.Where(status => status.IsCompleted())
|
|
.ToList();
|
|
}
|
|
|
|
public static class EnvelopeStatusExtensions
|
|
{
|
|
public static bool IsActive(this EnvelopeStatus status)
|
|
{
|
|
return status >= EnvelopeStatus.EnvelopeCreated && status < EnvelopeStatus.EnvelopePartlySigned;
|
|
}
|
|
|
|
public static bool IsCompleted(this EnvelopeStatus status)
|
|
{
|
|
return status >= EnvelopeStatus.EnvelopeCompletelySigned && status <= EnvelopeStatus.EnvelopeWithdrawn;
|
|
}
|
|
}
|
|
} |