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.
This commit is contained in:
Developer 02 2025-05-06 01:41:42 +02:00
parent 4cabaf3191
commit 1b515ea904
2 changed files with 23 additions and 1 deletions

View File

@ -29,4 +29,26 @@ public static class Extension
var envelopes = await executor.Execute<Envelope, EnvelopeCreateReadSQL>(parameters, cancellation); var envelopes = await executor.Execute<Envelope, EnvelopeCreateReadSQL>(parameters, cancellation);
return envelopes.FirstOrDefault(); return envelopes.FirstOrDefault();
} }
/// <summary>
///
/// </summary>
/// <param name="executor"></param>
/// <param name="envelope_uuid"></param>
/// <param name="emailAdress"></param>
/// <param name="salutation"></param>
/// <param name="phone"></param>
/// <param name="cancellation"></param>
/// <returns></returns>
public static async Task<EnvelopeReceiver?> AddReceiver(this ISQLExecutor executor, string envelope_uuid, string emailAdress, string salutation, string? phone = null, CancellationToken cancellation = default)
{
var parameters = new DynamicParameters();
parameters.Add("@ENV_UID", envelope_uuid);
parameters.Add("@EMAIL_ADRESS", emailAdress);
parameters.Add("@SALUTATION", salutation);
parameters.Add("@PHONE", phone);
var envelopeReceivers = await executor.Execute<EnvelopeReceiver, EnvelopeReceiverAddReadSQL>(parameters, cancellation);
return envelopeReceivers.FirstOrDefault();
}
} }

View File

@ -6,7 +6,7 @@ namespace EnvelopeGenerator.Application.SQL;
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public class EnvelopeReceiverCreateReadSQL : ISQL<Envelope> public class EnvelopeReceiverAddReadSQL : ISQL<Envelope>
{ {
/// <summary> /// <summary>
/// ///