EF Core Beziehungskonfiguration für Envelope-Entität korrigiert
This commit is contained in:
parent
8de0d70e7b
commit
29ae546d98
@ -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);
|
||||
}
|
||||
}
|
||||
@ -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);
|
||||
}
|
||||
@ -1,7 +1,7 @@
|
||||
namespace EnvelopeGenerator.Application.DTOs
|
||||
{
|
||||
public record DocumentStatusDto(
|
||||
int Guid,
|
||||
int Id,
|
||||
int EnvelopeId,
|
||||
int ReceiverId,
|
||||
int Status,
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
namespace EnvelopeGenerator.Application.DTOs
|
||||
{
|
||||
public record EmailTemplateDto(
|
||||
int Guid,
|
||||
int Id,
|
||||
string Name,
|
||||
string Body,
|
||||
string Subject);
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
namespace EnvelopeGenerator.Application.DTOs
|
||||
{
|
||||
public record EnvelopeCertificateDto(
|
||||
int Guid,
|
||||
int Id,
|
||||
int EnvelopeId,
|
||||
string EnvelopeUuid,
|
||||
string EnvelopeSubject,
|
||||
|
||||
@ -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
|
||||
);
|
||||
}
|
||||
@ -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);
|
||||
}
|
||||
@ -1,7 +1,7 @@
|
||||
namespace EnvelopeGenerator.Application.DTOs
|
||||
{
|
||||
public record EnvelopeHistoryDto(
|
||||
long Guid,
|
||||
long Id,
|
||||
int EnvelopeId,
|
||||
string UserReference,
|
||||
int Status,
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
namespace EnvelopeGenerator.Application.DTOs
|
||||
{
|
||||
public record EnvelopeTypeDto(
|
||||
int Guid,
|
||||
int Id,
|
||||
string Title,
|
||||
string Language,
|
||||
int? ExpiresDays,
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
namespace EnvelopeGenerator.Application.DTOs
|
||||
{
|
||||
public record ReceiverDto(
|
||||
int Guid,
|
||||
int Id,
|
||||
string EmailAddress,
|
||||
string Signature,
|
||||
DateTime AddedWhen);
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
namespace EnvelopeGenerator.Application.DTOs
|
||||
{
|
||||
public record UserReceiverDto(
|
||||
int Guid,
|
||||
int Id,
|
||||
int UserId,
|
||||
int ReceiverId,
|
||||
string Name,
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
119
EnvelopeGenerator.Domain/Constants.cs
Normal file
119
EnvelopeGenerator.Domain/Constants.cs
Normal file
@ -0,0 +1,119 @@
|
||||
namespace EnvelopeGenerator.Domain
|
||||
{
|
||||
public class Constants
|
||||
{
|
||||
#region Status Fields
|
||||
public enum EnvelopeStatus
|
||||
{
|
||||
Invalid = 0,
|
||||
EnvelopeCreated = 1001,
|
||||
EnvelopeSaved = 1002,
|
||||
EnvelopeQueued = 1003,
|
||||
EnvelopeSent = 1004, // Not used
|
||||
EnvelopePartlySigned = 1005,
|
||||
EnvelopeCompletelySigned = 1006,
|
||||
EnvelopeReportCreated = 1007,
|
||||
EnvelopeArchived = 1008,
|
||||
EnvelopeDeleted = 1009,
|
||||
AccessCodeRequested = 2001,
|
||||
AccessCodeCorrect = 2002,
|
||||
AccessCodeIncorrect = 2003,
|
||||
DocumentOpened = 2004,
|
||||
DocumentSigned = 2005,
|
||||
SignatureConfirmed = 2006,
|
||||
MessageInvitationSent = 3001, // Used by Trigger
|
||||
MessageAccessCodeSent = 3002,
|
||||
MessageConfirmationSent = 3003,
|
||||
MessageDeletionSent = 3004,
|
||||
MessageCompletionSent = 3005
|
||||
}
|
||||
|
||||
public enum ElementStatus
|
||||
{
|
||||
Created = 0
|
||||
}
|
||||
|
||||
public enum DocumentStatus
|
||||
{
|
||||
Created = 0,
|
||||
Signed = 1
|
||||
}
|
||||
|
||||
public enum ReceiverStatus
|
||||
{
|
||||
Unsigned = 0,
|
||||
Signed = 1
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Type Fields
|
||||
|
||||
public enum ElementType
|
||||
{
|
||||
Signature = 1
|
||||
}
|
||||
|
||||
public enum ContractType
|
||||
{
|
||||
Contract = 1,
|
||||
ReadAndSign = 2
|
||||
}
|
||||
|
||||
public enum ColorType
|
||||
{
|
||||
ReceiverColor1 = 1,
|
||||
ReceiverColor2 = 2,
|
||||
ReceiverColor3 = 3,
|
||||
ReceiverColor4 = 4,
|
||||
ReceiverColor5 = 5,
|
||||
ReceiverColor6 = 6,
|
||||
ReceiverColor7 = 7,
|
||||
ReceiverColor8 = 8,
|
||||
ReceiverColor9 = 9,
|
||||
ReceiverColor10 = 10
|
||||
}
|
||||
|
||||
public enum CertificationType
|
||||
{
|
||||
ElectronicSignature = 1,
|
||||
QualifiedSignature = 2
|
||||
}
|
||||
|
||||
public enum FinalEmailType
|
||||
{
|
||||
No = 0,
|
||||
Yes = 1,
|
||||
YesWithAttachment = 2
|
||||
}
|
||||
|
||||
public enum PageOrientation
|
||||
{
|
||||
Portrait = 0,
|
||||
Landscape = 1
|
||||
}
|
||||
|
||||
public enum EmailTemplateType
|
||||
{
|
||||
DocumentReceived,
|
||||
DocumentSigned,
|
||||
DocumentDeleted,
|
||||
DocumentCompleted,
|
||||
DocumentAccessCodeReceived
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constants
|
||||
|
||||
public const string DATABASE = "DATABASE";
|
||||
public const string LOGCONFIG = "LOGCONFIG";
|
||||
public const string GDPICTURE = "GDPICTURE";
|
||||
|
||||
public const string GREEN_300 = "#bbf7d0";
|
||||
public const string RED_300 = "#fecaca";
|
||||
public const string ORANGE_300 = "#fed7aa";
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -10,7 +10,7 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
[Column("GUID")]
|
||||
public int Guid { get; set; }
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("DOCUMENT_ID")]
|
||||
@ -28,12 +28,12 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
[Required]
|
||||
[Column("POSITION_X")]
|
||||
[DefaultValue(0)]
|
||||
public double PositionX { get; set; }
|
||||
public double X { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("POSITION_Y")]
|
||||
[DefaultValue(0)]
|
||||
public double PositionY { get; set; }
|
||||
public double Y { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("WIDTH")]
|
||||
@ -81,5 +81,11 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
|
||||
[ForeignKey("ReceiverId")]
|
||||
public virtual Receiver? Receiver { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public double Top => Math.Round(Y, 5);
|
||||
|
||||
[NotMapped]
|
||||
public double Left => Math.Round(X, 5);
|
||||
}
|
||||
}
|
||||
@ -9,7 +9,7 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
[Column("GUID")]
|
||||
public int Guid { get; set; }
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("ENVELOPE_ID")]
|
||||
|
||||
@ -9,7 +9,7 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
[Column("GUID")]
|
||||
public int Guid { get; set; }
|
||||
public int Id { get; set; }
|
||||
|
||||
[Column("NAME", TypeName = "nvarchar(64)")]
|
||||
public string Name { get; set; }
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using EnvelopeGenerator.Common.My.Resources;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace EnvelopeGenerator.Domain.Entities
|
||||
@ -9,7 +10,7 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
[Column("GUID")]
|
||||
public int Guid { get; set; }
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("USER_ID")]
|
||||
@ -21,7 +22,7 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
|
||||
[Required]
|
||||
[Column("ENVELOPE_UUID", TypeName = "nvarchar(36)")]
|
||||
public string EnvelopeUuid { get; set; }
|
||||
public string Uuid { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("MESSAGE", TypeName = "nvarchar(max)")]
|
||||
@ -59,7 +60,7 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
public int? ReminderIntervalDays { get; set; }
|
||||
|
||||
[Column("ENVELOPE_TYPE")]
|
||||
public int? EnvelopeType { get; set; }
|
||||
public int? EnvelopeTypeId { get; set; }
|
||||
|
||||
[Column("CERTIFICATION_TYPE")]
|
||||
public int? CertificationType { get; set; }
|
||||
@ -82,5 +83,36 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
[Required]
|
||||
[Column("DMZ_MOVED")]
|
||||
public bool DmzMoved { get; set; }
|
||||
|
||||
[ForeignKey("UserId")]
|
||||
public Receiver? User { get; set; }
|
||||
|
||||
[ForeignKey("EnvelopeTypeId")]
|
||||
public EnvelopeType? EnvelopeType { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public string? EnvelopeTypeTitle => EnvelopeType?.Title;
|
||||
|
||||
[NotMapped]
|
||||
public bool IsAlreadySent => Status > (int) Constants.EnvelopeStatus.EnvelopeSaved;
|
||||
|
||||
[NotMapped]
|
||||
public string? StatusTranslated => Model.ResourceManager.GetString(Status.ToString());
|
||||
|
||||
[NotMapped]
|
||||
public string? ContractTypeTranslated
|
||||
{
|
||||
get
|
||||
{
|
||||
string? oContractType = ContractType.ToString();
|
||||
return oContractType is null ? default : Model.ResourceManager.GetString(oContractType);
|
||||
}
|
||||
}
|
||||
|
||||
public ICollection<EnvelopeDocument>? Documents { get; set; }
|
||||
|
||||
public ICollection<EnvelopeReceiver>? Receivers { get; set; }
|
||||
|
||||
public ICollection<EnvelopeHistory>? History { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -9,7 +9,7 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
[Column("GUID")]
|
||||
public int Guid { get; set; }
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("ENVELOPE_ID")]
|
||||
|
||||
@ -9,7 +9,7 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
[Column("GUID")]
|
||||
public int Guid { get; set; }
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("ENVELOPE_ID")]
|
||||
@ -29,5 +29,7 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
|
||||
[Column("FILENAME_ORIGINAL", TypeName = "nvarchar(256)")]
|
||||
public string FilenameOriginal { get; set; }
|
||||
|
||||
public ICollection<DocumentReceiverElement>? Elements { get; set; }
|
||||
}
|
||||
}
|
||||
@ -9,7 +9,7 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
[Column("GUID")]
|
||||
public long Guid { get; set; }
|
||||
public long Id { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("ENVELOPE_ID")]
|
||||
|
||||
@ -6,7 +6,6 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
[Table("TBSIG_ENVELOPE_RECEIVER", Schema = "dbo")]
|
||||
public class EnvelopeReceiver
|
||||
{
|
||||
|
||||
[Column("ENVELOPE_ID")]
|
||||
public int EnvelopeId { get; set; }
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
[Column("GUID")]
|
||||
public int Guid { get; set; }
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("TITLE", TypeName = "nvarchar(128)")]
|
||||
|
||||
@ -9,7 +9,7 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
[Column("GUID")]
|
||||
public int Guid { get; set; }
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("EMAIL_ADDRESS", TypeName = "nvarchar(128)")]
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
namespace EnvelopeGenerator.Domain.Entities
|
||||
{
|
||||
@ -11,7 +9,7 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
[Column("GUID")]
|
||||
public int Guid { get; set; }
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("USER_ID")]
|
||||
|
||||
@ -6,4 +6,8 @@
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\EnvelopeGenerator.Common\EnvelopeGenerator.Common.vbproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@ -5,5 +5,6 @@ namespace EnvelopeGenerator.Infrastructure.Contracts
|
||||
{
|
||||
public interface IEnvelopeRepository : ICRUDRepository<Envelope, int>
|
||||
{
|
||||
Task<IEnumerable<Envelope>> ReadAllWithAsync(bool documents = false, bool receivers = false, bool history = false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -13,7 +13,8 @@ namespace DigitalData.UserManager.Infrastructure.Repositories
|
||||
{
|
||||
modelBuilder.Entity<Config>().HasNoKey();
|
||||
|
||||
modelBuilder.Entity<EnvelopeReceiver>().HasNoKey();
|
||||
modelBuilder.Entity<EnvelopeReceiver>()
|
||||
.HasKey(er => new { er.EnvelopeId, er.ReceiverId });
|
||||
|
||||
modelBuilder.Entity<EnvelopeDocument>();
|
||||
modelBuilder.Entity<DocumentReceiverElement>();
|
||||
@ -26,6 +27,22 @@ namespace DigitalData.UserManager.Infrastructure.Repositories
|
||||
modelBuilder.Entity<Receiver>();
|
||||
modelBuilder.Entity<UserReceiver>();
|
||||
|
||||
// Configure the one-to-many relationship of Envelope
|
||||
modelBuilder.Entity<Envelope>()
|
||||
.HasMany(e => e.Documents)
|
||||
.WithOne()
|
||||
.HasForeignKey(ed => ed.EnvelopeId);
|
||||
|
||||
modelBuilder.Entity<Envelope>()
|
||||
.HasMany(e => e.Receivers)
|
||||
.WithOne()
|
||||
.HasForeignKey(er => er.EnvelopeId);
|
||||
|
||||
modelBuilder.Entity<Envelope>()
|
||||
.HasMany(e => e.History)
|
||||
.WithOne()
|
||||
.HasForeignKey(eh => eh.EnvelopeId);
|
||||
|
||||
base.OnModelCreating(modelBuilder);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
using DigitalData.UserManager.Infrastructure.Repositories;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace EnvelopeGenerator.Infrastructure.Repositories
|
||||
{
|
||||
@ -10,5 +11,21 @@ namespace EnvelopeGenerator.Infrastructure.Repositories
|
||||
public EnvelopeRepository(EGDbContext dbContext) : base(dbContext)
|
||||
{
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<Envelope>> ReadAllWithAsync(bool documents = false, bool receivers = false, bool history = false)
|
||||
{
|
||||
var query = _dbSet.AsQueryable();
|
||||
|
||||
if (documents)
|
||||
query = query.Include(e => e.Documents);
|
||||
|
||||
if (receivers)
|
||||
query = query.Include(e => e.Receivers);
|
||||
|
||||
if (history)
|
||||
query = query.Include(e => e.History);
|
||||
|
||||
return await query.ToListAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3,6 +3,7 @@ using EnvelopeGenerator.Application.Contracts;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace EnvelopeGenerator.Web.Controllers
|
||||
{
|
||||
@ -10,7 +11,23 @@ namespace EnvelopeGenerator.Web.Controllers
|
||||
{
|
||||
public TestEnvelopeController(ILogger<TestEnvelopeController> logger, IEnvelopeService service) : base(logger, service)
|
||||
{
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
public override Task<IActionResult> GetAll()
|
||||
{
|
||||
return base.GetAll();
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public virtual async Task<IActionResult> GetAll([FromQuery] bool withDocuments = false, [FromQuery] bool withReceivers = false, [FromQuery] bool withHistory = false)
|
||||
{
|
||||
var result = await _service.ReadAllWithAsync(documents: withDocuments, receivers: withReceivers, history: withHistory);
|
||||
if (result.IsSuccess)
|
||||
{
|
||||
return Ok(result);
|
||||
}
|
||||
return NotFound(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user