Remove IDocument interface and related dependencies
Decoupled `Document` and `DocumentDetailsDto` from the `IDocument` interface by removing its implementation. Eliminated the `ElementsBase` property from both classes as it was tied to the interface. Simplified the `FinalizeEnvelopeCommandHandler` constructor by removing the unused `HistoryRepo` parameter. Deleted the `IDocument` interface and its extension methods, including `IsSigned`, to reduce unnecessary abstractions and improve code maintainability.
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace EnvelopeGenerator.Domain.Interfaces
|
||||
{
|
||||
public interface IDocument
|
||||
{
|
||||
IEnumerable<IDocReceiverElement>
|
||||
#if nullable
|
||||
?
|
||||
#endif
|
||||
ElementsBase { get; }
|
||||
}
|
||||
|
||||
public static class DocumentExtensions
|
||||
{
|
||||
public static bool IsSigned<TElement, TElements>(this IDocument document)
|
||||
{
|
||||
if(document.ElementsBase == null)
|
||||
throw new ArgumentNullException(nameof(document.ElementsBase), "Elements collection cannot be null. Please add with Includ()");
|
||||
|
||||
foreach (var element in document.ElementsBase)
|
||||
if (!element.IsSigned())
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user