- Changed `Signature` properties from `int` to `double` for precise positioning. - Added necessary using directives in `EnvelopeReceiverController.cs` for database operations. - Introduced a private `_cnnStr` field in `EnvelopeReceiverController` to store the connection string. - Updated the constructor to accept `IOptions<ConnectionString>` for dependency injection of the connection string. - Added a SQL command block to handle document element additions using a stored procedure. - Configured the `ConnectionString` class in `Program.cs` to bind the connection string from app settings. - Created a new `ConnectionString` class to manage the connection string value.
49 lines
1.9 KiB
C#
49 lines
1.9 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Commands.Create;
|
|
|
|
#region DTOs
|
|
/// <summary>
|
|
/// Signaturposition auf einem Dokument.
|
|
/// </summary>
|
|
/// <param name="X">X-Position</param>
|
|
/// <param name="Y">Y-Position</param>
|
|
/// <param name="Page">Seite, auf der sie sich befindet</param>
|
|
public record Signature([Required] double X, [Required] double Y, [Required] int Page);
|
|
|
|
/// <summary>
|
|
/// DTO für Empfänger, die erstellt oder abgerufen werden sollen.
|
|
/// Wenn nicht, wird sie erstellt und mit einer Signatur versehen.
|
|
/// </summary>
|
|
/// <param name="Signatures">Unterschriften auf Dokumenten.</param>
|
|
/// <param name="Salution">Der Name, mit dem der Empfänger angesprochen werden soll. Bei Null oder keinem Wert wird der zuletzt verwendete Name verwendet.</param>
|
|
/// <param name="PhoneNumber">Sollte mit Vorwahl geschrieben werden</param>
|
|
public record ReceiverGetOrCreateCommand([Required] IEnumerable<Signature> Signatures, string? Salution = null, string? PhoneNumber = null)
|
|
{
|
|
private string? _emailAddress = "h.tek@digitaldata.works";
|
|
|
|
/// <summary>
|
|
/// E-Mail-Adresse des Empfängers.
|
|
/// </summary>
|
|
public string? EmailAddress { get => _emailAddress?.ToLower(); init => _emailAddress = _emailAddress?.ToLower() ?? "h.tek@digitaldata.works"; }
|
|
};
|
|
|
|
/// <summary>
|
|
/// DTO zum Erstellen eines Dokuments.
|
|
/// </summary>
|
|
/// <param name="DataAsByte">
|
|
/// Die Dokumentdaten im Byte-Array-Format. Wird verwendet, wenn das Dokument als Roh-Binärdaten bereitgestellt wird.
|
|
/// </param>
|
|
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 |