EnvelopeGenerator/EnvelopeGenerator.Application/SQL/EnvelopeReceiverAddReadSQL.cs
Developer 02 2692fee6d2 Enhance envelope creation functionality and configuration
- Updated DependencyInjection to include new command handler.
- Modified CreateEnvelopeReceiverCommand for nullable responses.
- Altered SQL command in EnvelopeReceiverAddReadSQL.
- Refactored EnvelopeReceiverController with new dependencies and improved CreateAsync method.
- Expanded appsettings.json with additional configuration settings.
- Introduced new DTOs for signatures and receivers in CreateEnvelopeReceiverDtos.
2025-05-06 16:11:02 +02:00

50 lines
1.3 KiB
C#

using Dapper;
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]
DECLARE @OUT_RECEIVER_ID int
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;
";
/// <summary>
///
/// </summary>
/// <param name="envelope_uuid"></param>
/// <param name="emailAddress"></param>
/// <param name="salutation"></param>
/// <param name="phone"></param>
/// <returns></returns>
public static DynamicParameters CreateParameters(string envelope_uuid, string emailAddress, string? salutation = null, string? phone = null)
{
var parameters = new DynamicParameters();
parameters.Add("@ENV_UID", envelope_uuid);
parameters.Add("@EMAIL_ADRESS", emailAddress);
parameters.Add("@SALUTATION", salutation);
parameters.Add("@PHONE", phone);
return parameters;
}
}