refactor(MappingProfile): create to handle model mappings
This commit is contained in:
parent
2355a566e4
commit
05cd8a05f4
@ -36,44 +36,4 @@ public record ModifyDocStatusCommandBase : EnvelopeReceiverQueryBase
|
|||||||
Receiver = Receiver,
|
Receiver = Receiver,
|
||||||
Value = Value
|
Value = Value
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Queries
|
|
||||||
/// <summary>
|
|
||||||
/// Repräsentiert eine Abfrage für Umschläge.
|
|
||||||
/// </summary>
|
|
||||||
public record EnvelopeQuery
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Die eindeutige Kennung des Umschlags.
|
|
||||||
/// </summary>
|
|
||||||
public int? Id { get; init; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Die universell eindeutige Kennung des Umschlags.
|
|
||||||
/// </summary>
|
|
||||||
public string? Uuid { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Stellt eine Abfrage dar, um die Details eines Empfängers zu lesen.
|
|
||||||
/// um spezifische Informationen über einen Empfänger abzurufen.
|
|
||||||
/// </summary>
|
|
||||||
public record ReceiverQuery
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// ID des Empfängers
|
|
||||||
/// </summary>
|
|
||||||
public int? Id { get; init; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// E-Mail Adresse des Empfängers
|
|
||||||
/// </summary>
|
|
||||||
public string? EmailAddress { get; init; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Eindeutige Signatur des Empfängers
|
|
||||||
/// </summary>
|
|
||||||
public string? Signature { get; set; }
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
@ -16,7 +16,5 @@ public class MappingProfile : Profile
|
|||||||
{
|
{
|
||||||
CreateMap<CreateDocStatusCommand, DocumentStatus>();
|
CreateMap<CreateDocStatusCommand, DocumentStatus>();
|
||||||
CreateMap<UpdateDocStatusCommand, DocumentStatus>();
|
CreateMap<UpdateDocStatusCommand, DocumentStatus>();
|
||||||
CreateMap<EnvelopeQuery, Envelope>();
|
|
||||||
CreateMap<ReceiverQuery, Receiver>();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -50,12 +50,13 @@ public record EnvelopeReceiverQueryBase<TEnvelopeQuery, TReceiverQuery>
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
/// Repräsentiert eine Abfrage für Umschläge.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual TEnvelopeQuery Envelope { get; init; } = new();
|
public virtual TEnvelopeQuery Envelope { get; init; } = new();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
/// Stellt eine Abfrage dar, um die Details eines Empfängers zu lesen.
|
||||||
|
/// um spezifische Informationen über einen Empfänger abzurufen.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual TReceiverQuery Receiver { get; init; } = new();
|
public virtual TReceiverQuery Receiver { get; init; } = new();
|
||||||
}
|
}
|
||||||
19
EnvelopeGenerator.Application/Model/MappingProfile.cs
Normal file
19
EnvelopeGenerator.Application/Model/MappingProfile.cs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
using AutoMapper;
|
||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Model;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class MappingProfile : Profile
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public MappingProfile()
|
||||||
|
{
|
||||||
|
CreateMap<EnvelopeQueryBase, Envelope>();
|
||||||
|
CreateMap<ReceiverQueryBase, Receiver>();
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user