Refactor DocumentCreateCommand and enhance validation
Updated the `DocumentCreateCommand` record to include a nullable `DataAsBase64` property for better encapsulation. Enhanced the `EnvelopeReceiverController` with logic to validate document data, ensuring that either `DataAsBase64` or `DataAsByte` is provided, but not both. Introduced a new static method `IsBase64String` to validate base64 string format.
This commit is contained in:
@@ -39,8 +39,11 @@ public record ReceiverGetOrCreateCommand([Required] IEnumerable<Signature> Signa
|
||||
/// <param name="DataAsByte">
|
||||
/// Die Dokumentdaten im Byte-Array-Format. Wird verwendet, wenn das Dokument als Roh-Binärdaten bereitgestellt wird.
|
||||
/// </param>
|
||||
/// <param name="DataAsBase64">
|
||||
/// Die Dokumentdaten im Base64-String-Format. Wird verwendet, wenn das Dokument als Base64-codierter String bereitgestellt wird.
|
||||
/// </param>
|
||||
public record DocumentCreateCommand(byte[]? DataAsByte = null, string? DataAsBase64 = null);
|
||||
public record DocumentCreateCommand(byte[]? DataAsByte = null)
|
||||
{
|
||||
/// <summary>
|
||||
/// Die Dokumentdaten im Base64-String-Format. Wird verwendet, wenn das Dokument als Base64-codierter String bereitgestellt wird.
|
||||
/// </summary>
|
||||
public string? DataAsBase64 { get; set; }
|
||||
};
|
||||
#endregion
|
||||
Reference in New Issue
Block a user