EnvelopeGenerator/EnvelopeGenerator.Application/SQL/EnvelopeReceiverAddReadSQL.cs
Developer 02 1b515ea904 Add AddReceiver method and refactor SQL classes
Introduced a new `AddReceiver` method in the `Extension` class to facilitate adding a receiver to an envelope. This method includes parameters for `envelope_uuid`, `emailAdress`, `salutation`, and an optional `phone`, along with XML documentation for clarity.

Removed the `EnvelopeReceiverCreateReadSQL` class and added the `EnvelopeReceiverAddReadSQL` class, which defines the SQL command for adding a receiver. The new class also includes XML documentation comments for better understanding.
2025-05-06 01:41:42 +02:00

34 lines
705 B
C#

using EnvelopeGenerator.Application.Contracts.SQLExecutor;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.SQL;
/// <summary>
///
/// </summary>
public class EnvelopeReceiverAddReadSQL : ISQL<Envelope>
{
/// <summary>
///
/// </summary>
public string Raw => @"
USE [DD_ECM]
GO
DECLARE @OUT_RECEIVER_ID int
DECLARE @ENV_UID varchar(36) = @ENV_UID
EXEC [dbo].[PRSIG_API_CREATE_RECEIVER]
@ENV_UID = @ENV_UID,
@EMAIL_ADRESS = @EMAIL_ADRESS ,
@SALUTATION = @SALUTATION,
@PHONE = @PHONE,
@OUT_RECEIVER_ID = @OUT_RECEIVER_ID OUTPUT
SELECT TOP(1) *
FROM TBSIG_ENVELOPE_RECEIVER
WHERE [GUID] = @OUT_RECEIVER_ID;
";
}