refactor(CreateEnvelopeCommand): add UseSQLExecutor-property

This commit is contained in:
tekh 2025-09-01 17:07:16 +02:00
parent 6a34b65825
commit ee7eb08e75
2 changed files with 14 additions and 3 deletions

View File

@ -1,6 +1,10 @@
using EnvelopeGenerator.Application.Dto; using DigitalData.Core.Abstraction.Application.Repository;
using EnvelopeGenerator.Application.Dto;
using EnvelopeGenerator.Application.Interfaces.SQLExecutor;
using MediatR; using MediatR;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json.Serialization;
namespace EnvelopeGenerator.Application.Envelopes.Commands; namespace EnvelopeGenerator.Application.Envelopes.Commands;
@ -30,4 +34,11 @@ public record CreateEnvelopeCommand : IRequest<EnvelopeDto?>
/// ID des Absenders /// ID des Absenders
/// </summary> /// </summary>
public int UserId { get; set; } public int UserId { get; set; }
/// <summary>
/// if true, use <seealso cref="IEnvelopeExecutor"/>; otherwise, use <seealso cref="IRepository{Envelope}"/>
/// </summary>
[JsonIgnore]
[NotMapped]
public bool UseSQLExecutor { get; set; } = true;
} }

View File

@ -104,8 +104,8 @@ public class Fake
var mediator = Mediator; var mediator = Mediator;
foreach (var cmd in Provider.CreateReceiverCommands()) foreach (var cmd in Provider.CreateReceiverCommands())
{ {
var (Id, _) = await mediator.Send(cmd); var (receiver, _) = await mediator.Send(cmd);
_sampleReceivers.Add((Id, cmd.EmailAddress)); _sampleReceivers.Add((receiver.Id, cmd.EmailAddress));
} }
return this; return this;
} }