EF Core Beziehungskonfiguration für Envelope-Entität korrigiert

This commit is contained in:
Developer 02
2024-04-04 13:25:41 +02:00
parent 8de0d70e7b
commit 29ae546d98
29 changed files with 282 additions and 45 deletions

View File

@@ -7,5 +7,6 @@ namespace EnvelopeGenerator.Application.Contracts
{
public interface IEnvelopeService : IBasicCRUDService<IEnvelopeRepository, EnvelopeDto, Envelope, int>
{
Task<IServiceResult<IEnumerable<EnvelopeDto>>> ReadAllWithAsync(bool documents = false, bool receivers = false, bool history = false);
}
}

View File

@@ -1,7 +1,7 @@
namespace EnvelopeGenerator.Application.DTOs
{
public record DocumentReceiverElementDto(
int Guid,
int Id,
int DocumentId,
int ReceiverId,
int ElementType,
@@ -17,5 +17,7 @@
DateTime AddedWhen,
DateTime? ChangedWhen,
EnvelopeDocumentDto? Document,
EnvelopeReceiverDto? Receiver);
EnvelopeReceiverDto? Receiver,
double Top,
double Left);
}

View File

@@ -1,7 +1,7 @@
namespace EnvelopeGenerator.Application.DTOs
{
public record DocumentStatusDto(
int Guid,
int Id,
int EnvelopeId,
int ReceiverId,
int Status,

View File

@@ -1,7 +1,7 @@
namespace EnvelopeGenerator.Application.DTOs
{
public record EmailTemplateDto(
int Guid,
int Id,
string Name,
string Body,
string Subject);

View File

@@ -1,7 +1,7 @@
namespace EnvelopeGenerator.Application.DTOs
{
public record EnvelopeCertificateDto(
int Guid,
int Id,
int EnvelopeId,
string EnvelopeUuid,
string EnvelopeSubject,

View File

@@ -1,12 +1,15 @@
namespace EnvelopeGenerator.Application.DTOs
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.DTOs
{
public record EnvelopeDocumentDto
{
public int Guid { get; init; }
public int EnvelopeId { get; init; }
public string Filename { get; init; }
public string Filepath { get; init; }
public DateTime AddedWhen { get; init; }
public string FilenameOriginal { get; init; }
}
(
int Id,
int EnvelopeId,
string Filename,
string Filepath,
DateTime AddedWhen,
string FilenameOriginal,
ICollection<DocumentReceiverElement>? Elements
);
}

View File

@@ -1,10 +1,12 @@
namespace EnvelopeGenerator.Application.DTOs
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.DTOs
{
public record EnvelopeDto(
int Guid,
int Id,
int UserId,
int Status,
string EnvelopeUuid,
string Uuid,
string Message,
DateTime? ExpiresWhen,
DateTime? ExpiresWarningWhen,
@@ -16,12 +18,21 @@
bool? SendReminderEmails,
int? FirstReminderDays,
int? ReminderIntervalDays,
int? EnvelopeType,
int? EnvelopeTypeId,
int? CertificationType,
bool? UseAccessCode,
int? FinalEmailToCreator,
int? FinalEmailToReceivers,
int? ExpiresWhenDays,
int? ExpiresWarningWhenDays,
bool DmzMoved);
bool DmzMoved,
ReceiverDto? User,
EnvelopeType? EnvelopeType,
string? EnvelopeTypeTitle,
bool IsAlreadySent,
string? StatusTranslated,
string? ContractTypeTranslated,
ICollection<EnvelopeDocument>? Documents,
ICollection<EnvelopeReceiver>? Receivers,
ICollection<EnvelopeHistory>? History);
}

View File

@@ -1,7 +1,7 @@
namespace EnvelopeGenerator.Application.DTOs
{
public record EnvelopeHistoryDto(
long Guid,
long Id,
int EnvelopeId,
string UserReference,
int Status,

View File

@@ -1,7 +1,7 @@
namespace EnvelopeGenerator.Application.DTOs
{
public record EnvelopeTypeDto(
int Guid,
int Id,
string Title,
string Language,
int? ExpiresDays,

View File

@@ -1,7 +1,7 @@
namespace EnvelopeGenerator.Application.DTOs
{
public record ReceiverDto(
int Guid,
int Id,
string EmailAddress,
string Signature,
DateTime AddedWhen);

View File

@@ -1,7 +1,7 @@
namespace EnvelopeGenerator.Application.DTOs
{
public record UserReceiverDto(
int Guid,
int Id,
int UserId,
int ReceiverId,
string Name,

View File

@@ -1,5 +1,6 @@
using AutoMapper;
using DigitalData.Core.Application;
using DigitalData.Core.Contracts.Application;
using DigitalData.Core.Contracts.CultureServices;
using EnvelopeGenerator.Application.Contracts;
using EnvelopeGenerator.Application.DTOs;
@@ -14,5 +15,12 @@ namespace EnvelopeGenerator.Application.Services
: base(repository, translationService, mapper)
{
}
public async Task<IServiceResult<IEnumerable<EnvelopeDto>>> ReadAllWithAsync(bool documents = false, bool receivers = false, bool history = false)
{
var entities = await _repository.ReadAllWithAsync(documents: documents, receivers: receivers, history: history);
var readDto = _mapper.MapOrThrow<IEnumerable<EnvelopeDto>>(entities);
return Successful(readDto);
}
}
}