refactor(MappingProfile): update to ignore Envelope, Sender and Receiver
This commit is contained in:
parent
23ec4fe322
commit
1c9d0a6c47
@ -14,6 +14,9 @@ public class MappingProfile: Profile
|
||||
/// </summary>
|
||||
public MappingProfile()
|
||||
{
|
||||
CreateMap<CreateHistoryCommand, EnvelopeHistory>();
|
||||
CreateMap<CreateHistoryCommand, EnvelopeHistory>()
|
||||
.ForMember(dest => dest.Envelope, opt => opt.Ignore())
|
||||
.ForMember(dest => dest.Sender, opt => opt.Ignore())
|
||||
.ForMember(dest => dest.Receiver, opt => opt.Ignore());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -225,6 +225,21 @@ public static class Extensions
|
||||
.ToList();
|
||||
#endregion
|
||||
|
||||
#region Envelope Receiver
|
||||
public static EnvelopeReceiver CreateEnvelopeReceiver(this Faker faker, int envelopeId, int receiverId) => new()
|
||||
{
|
||||
EnvelopeId = envelopeId,
|
||||
ReceiverId = receiverId,
|
||||
Status = ReceiverStatus.Unsigned,
|
||||
AddedWhen = DateTime.UtcNow,
|
||||
AccessCode = faker.Random.Number(1000, 9999).ToString(),
|
||||
ChangedWhen = DateTime.UtcNow,
|
||||
CompanyName = faker.Company.CompanyName(),
|
||||
JobTitle = faker.Name.JobTitle(),
|
||||
Name = faker.Name.FullName(),
|
||||
};
|
||||
#endregion
|
||||
|
||||
#region History
|
||||
public static CreateHistoryCommand CreateHistoryCommand(this Faker fake, string key, EnvelopeStatus? status = null)
|
||||
{
|
||||
|
||||
@ -35,6 +35,10 @@ public class HistoryTests : TestBase
|
||||
var createReceiverCmd = this.CreateReceiverCommand();
|
||||
(var receiver, _) = await Mediator.Send(createReceiverCmd);
|
||||
|
||||
// Create EnvelopeReceiver
|
||||
var envRcv = this.CreateEnvelopeReceiver(envelope.Id, receiver.Id);
|
||||
envRcv = await GetRepository<EnvelopeReceiver>().CreateAsync(envRcv, cancel);
|
||||
|
||||
var key = (envelope.Uuid, receiver.Signature).ToEnvelopeKey();
|
||||
|
||||
var createCmd = Fake.Provider.CreateHistoryCommand(key);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user