- Updated `CreateEnvelopeReceiverCommand` to specify response type for `IRequest`. - Enhanced `CreateEnvelopeReceiverCommandHandler` to use `AutoMapper` and return `CreateEnvelopeReceiverResponse`. - Modified `Handle` method to map envelope data and populate recipient lists. - Changed `CreateEnvelopeReceiverResponse` to inherit from `CreateEnvelopeResponse` and added new properties. - Adjusted mapping profile to map `Envelope` to `CreateEnvelopeReceiverResponse`. - Created new mapping profile for `Receiver` to `ReceiverReadDto`.
25 lines
735 B
C#
25 lines
735 B
C#
using DigitalData.Core.Abstractions;
|
|
using DigitalData.Core.DTO;
|
|
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace EnvelopeGenerator.Application.DTOs.Receiver;
|
|
|
|
[ApiExplorerSettings(IgnoreApi = true)]
|
|
public record ReceiverReadDto(
|
|
int Id,
|
|
string EmailAddress,
|
|
string Signature,
|
|
DateTime AddedWhen
|
|
) : BaseDTO<int>(Id), IUnique<int>
|
|
{
|
|
[JsonIgnore]
|
|
public IEnumerable<EnvelopeReceiverBasicDto>? EnvelopeReceivers { get; init; }
|
|
|
|
public string? LastUsedName => EnvelopeReceivers?.LastOrDefault()?.Name;
|
|
|
|
public string? TotpSecretkey { get; set; } = null;
|
|
|
|
public DateTime? TfaRegDeadline { get; set; }
|
|
}; |