Compare commits
47 Commits
c479ea4179
...
refactor/f
| Author | SHA1 | Date | |
|---|---|---|---|
| 8db72037e0 | |||
| 6b89b9bbf2 | |||
| 83ff3da795 | |||
| 5bb3341f43 | |||
| 7568274c77 | |||
| c59b179a8f | |||
| 248c5bce5a | |||
| c76a772768 | |||
| 3ba7bfd15a | |||
| e8f2c868b1 | |||
| ae669d05e7 | |||
| fbbc05814f | |||
| ec57906290 | |||
| fbfc20705d | |||
| 895eb8977e | |||
| 428f45bff1 | |||
| 9339f24bf1 | |||
| 390cbf9db5 | |||
| 570a192438 | |||
| c8a0264ed8 | |||
| 207bc8bcbd | |||
| 1ac2a476d2 | |||
|
|
41f5d9f1e4 | ||
| 2ae6dda27e | |||
| e5a25c5893 | |||
| 7d0648ede4 | |||
| bb6ca82289 | |||
| ed7068fe71 | |||
| 876c5def56 | |||
| 40697435ff | |||
| b43399ad01 | |||
| f41f26b810 | |||
| 442b7f7451 | |||
| beada59593 | |||
| b78aff102a | |||
| 67f068ef38 | |||
| 122df4bd62 | |||
| 741ebc8975 | |||
| ada76d5030 | |||
| 845d06fc4c | |||
| 59105caffc | |||
| fa8d2f5f62 | |||
| dbf42e13d9 | |||
| e48a86e21c | |||
| 1e6c9ed40e | |||
| 1d605e9da3 | |||
| 77070a8cfc |
@@ -1,4 +1,4 @@
|
|||||||
namespace EnvelopeGenerator.Application.Configurations;
|
namespace EnvelopeGenerator.Application.Common.Configurations;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace EnvelopeGenerator.Application.Configurations;
|
namespace EnvelopeGenerator.Application.Common.Configurations;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace EnvelopeGenerator.Application.Configurations;
|
namespace EnvelopeGenerator.Application.Common.Configurations;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
using DigitalData.Core.Client.Interface;
|
using DigitalData.Core.Client.Interface;
|
||||||
namespace EnvelopeGenerator.Application.Configurations;
|
namespace EnvelopeGenerator.Application.Common.Configurations;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// https://www.gtx-messaging.com/en/api-docs/sms-rest-api/
|
/// https://www.gtx-messaging.com/en/api-docs/sms-rest-api/
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace EnvelopeGenerator.Application.Configurations;
|
namespace EnvelopeGenerator.Application.Common.Configurations;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using OtpNet;
|
using OtpNet;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Configurations;
|
namespace EnvelopeGenerator.Application.Common.Configurations;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Dto;
|
namespace EnvelopeGenerator.Application.Common.Dto;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Data Transfer Object representing configuration settings.
|
/// Data Transfer Object representing configuration settings.
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Dto;
|
namespace EnvelopeGenerator.Application.Common.Dto;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Data Transfer Object representing a document within an envelope, including optional binary data and form elements.
|
/// Data Transfer Object representing a document within an envelope, including optional binary data and form elements.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
public class EnvelopeDocumentDto
|
public class DocumentDto
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the unique identifier of the document.
|
/// Gets or sets the unique identifier of the document.
|
||||||
@@ -31,5 +31,5 @@ public class EnvelopeDocumentDto
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the collection of elements associated with the document for receiver interactions, if any.
|
/// Gets or sets the collection of elements associated with the document for receiver interactions, if any.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IEnumerable<DocumentReceiverElementDto>? Elements { get; set; }
|
public IEnumerable<SignatureDto>? Elements { get; set; }
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using EnvelopeGenerator.Domain.Constants;
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Dto;
|
namespace EnvelopeGenerator.Application.Common.Dto;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Data Transfer Object representing the status of a document for a specific receiver.
|
/// Data Transfer Object representing the status of a document for a specific receiver.
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Dto
|
namespace EnvelopeGenerator.Application.Common.Dto
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
|
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
|
||||||
using DigitalData.UserManager.Application.DTOs.User;
|
using DigitalData.UserManager.Application.DTOs.User;
|
||||||
using EnvelopeGenerator.Application.Envelopes.Queries;
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Dto;
|
namespace EnvelopeGenerator.Application.Common.Dto;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -25,7 +25,7 @@ public record EnvelopeDto
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public required EnvelopeStatusQuery Status { get; set; }
|
public required EnvelopeStatus Status { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Default value is string.Empty
|
/// Default value is string.Empty
|
||||||
@@ -117,5 +117,5 @@ public record EnvelopeDto
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IEnumerable<EnvelopeDocumentDto>? Documents { get; set; }
|
public IEnumerable<DocumentDto>? Documents { get; set; }
|
||||||
}
|
}
|
||||||
@@ -1,14 +1,25 @@
|
|||||||
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
|
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
|
||||||
|
using EnvelopeGenerator.Application.Common.Dto.Receiver;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Dto.EnvelopeReceiver;
|
namespace EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
public record EnvelopeReceiverBasicDto
|
public record EnvelopeReceiverDto
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public EnvelopeDto? Envelope { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public ReceiverDto? Receiver { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Dto.EnvelopeReceiver;
|
namespace EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Dto.EnvelopeReceiverReadOnly;
|
namespace EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiverReadOnly;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
using EnvelopeGenerator.Application.Dto.Receiver;
|
using EnvelopeGenerator.Application.Common.Dto;
|
||||||
|
using EnvelopeGenerator.Application.Common.Dto.Receiver;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Dto.EnvelopeReceiverReadOnly;
|
namespace EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiverReadOnly;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a read-only Data Transfer Object (DTO) for an envelope receiver.
|
/// Represents a read-only Data Transfer Object (DTO) for an envelope receiver.
|
||||||
@@ -59,5 +60,5 @@ public class EnvelopeReceiverReadOnlyDto
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or inits the associated receiver details.
|
/// Gets or inits the associated receiver details.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ReceiverReadDto? Receiver { get; set; }
|
public ReceiverDto? Receiver { get; set; }
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Dto.EnvelopeReceiverReadOnly;
|
namespace EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiverReadOnly;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Data Transfer Object for updating a read-only envelope receiver.
|
/// Data Transfer Object for updating a read-only envelope receiver.
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Dto;
|
namespace EnvelopeGenerator.Application.Common.Dto;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Data Transfer Object representing a type of envelope with its configuration settings.
|
/// Data Transfer Object representing a type of envelope with its configuration settings.
|
||||||
@@ -1,11 +1,9 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
namespace EnvelopeGenerator.Application.Common.Dto.History;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Dto.EnvelopeHistory;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Data Transfer Object for creating a new envelope history record.
|
/// Data Transfer Object for creating a new envelope history record.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class EnvelopeHistoryCreateDto
|
public class HistoryCreateDto
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the identifier of the envelope.
|
/// Gets or sets the identifier of the envelope.
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
using DigitalData.UserManager.Application.DTOs.User;
|
using DigitalData.UserManager.Application.DTOs.User;
|
||||||
using EnvelopeGenerator.Application.Dto.Receiver;
|
using EnvelopeGenerator.Application.Common.Dto.Receiver;
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Dto.EnvelopeHistory;
|
namespace EnvelopeGenerator.Application.Common.Dto.History;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Data Transfer Object representing the history of an envelope, including status, sender, receiver, and related metadata.
|
/// Data Transfer Object representing the history of an envelope, including status, sender, receiver, and related metadata.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public record EnvelopeHistoryDto
|
public record HistoryDto
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Unique identifier for the envelope history entry.
|
/// Unique identifier for the envelope history entry.
|
||||||
@@ -62,7 +62,7 @@ public record EnvelopeHistoryDto
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Information about the receiver associated with this history entry.
|
/// Information about the receiver associated with this history entry.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ReceiverReadDto? Receiver { get; set; }
|
public ReceiverDto? Receiver { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Optional comment related to this history entry.
|
/// Optional comment related to this history entry.
|
||||||
@@ -1,14 +1,13 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using EnvelopeGenerator.Application.Dto.EnvelopeHistory;
|
using EnvelopeGenerator.Application.Common.Dto.History;
|
||||||
using EnvelopeGenerator.Application.Dto.EnvelopeReceiver;
|
using EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver;
|
||||||
using EnvelopeGenerator.Application.Dto.EnvelopeReceiverReadOnly;
|
using EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiverReadOnly;
|
||||||
using EnvelopeGenerator.Application.Dto.Messaging;
|
using EnvelopeGenerator.Application.Common.Dto.Messaging;
|
||||||
using EnvelopeGenerator.Application.Dto.Receiver;
|
using EnvelopeGenerator.Application.Common.Dto.Receiver;
|
||||||
using EnvelopeGenerator.Application.Extensions;
|
using EnvelopeGenerator.Application.Common.Extensions;
|
||||||
using EnvelopeGenerator.Application.Receivers.Commands;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Dto;
|
namespace EnvelopeGenerator.Application.Common.Dto;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents the AutoMapper profile configuration for mapping between
|
/// Represents the AutoMapper profile configuration for mapping between
|
||||||
@@ -24,32 +23,31 @@ public class MappingProfile : Profile
|
|||||||
{
|
{
|
||||||
// Entity to DTO mappings
|
// Entity to DTO mappings
|
||||||
CreateMap<Config, ConfigDto>();
|
CreateMap<Config, ConfigDto>();
|
||||||
CreateMap<DocumentReceiverElement, DocumentReceiverElementDto>();
|
CreateMap<Signature, SignatureDto>();
|
||||||
CreateMap<DocumentStatus, DocumentStatusDto>();
|
CreateMap<DocumentStatus, DocumentStatusDto>();
|
||||||
CreateMap<EmailTemplate, EmailTemplateDto>();
|
CreateMap<EmailTemplate, EmailTemplateDto>();
|
||||||
CreateMap<Envelope, EnvelopeDto>();
|
CreateMap<Envelope, EnvelopeDto>();
|
||||||
CreateMap<EnvelopeDocument, EnvelopeDocumentDto>();
|
CreateMap<Document, DocumentDto>();
|
||||||
CreateMap<Domain.Entities.EnvelopeHistory, EnvelopeHistoryDto>();
|
CreateMap<Domain.Entities.History, HistoryDto>();
|
||||||
CreateMap<Domain.Entities.EnvelopeHistory, EnvelopeHistoryCreateDto>();
|
CreateMap<Domain.Entities.History, HistoryCreateDto>();
|
||||||
CreateMap<Domain.Entities.EnvelopeReceiver, EnvelopeReceiverDto>();
|
CreateMap<Domain.Entities.EnvelopeReceiver, EnvelopeReceiverDto>();
|
||||||
CreateMap<Domain.Entities.EnvelopeReceiver, EnvelopeReceiverSecretDto>();
|
CreateMap<Domain.Entities.EnvelopeReceiver, EnvelopeReceiverSecretDto>();
|
||||||
CreateMap<EnvelopeType, EnvelopeTypeDto>();
|
CreateMap<EnvelopeType, EnvelopeTypeDto>();
|
||||||
CreateMap<Domain.Entities.Receiver, ReceiverReadDto>();
|
CreateMap<Domain.Entities.Receiver, ReceiverDto>();
|
||||||
CreateMap<Domain.Entities.EnvelopeReceiverReadOnly, EnvelopeReceiverReadOnlyDto>();
|
CreateMap<Domain.Entities.EnvelopeReceiverReadOnly, EnvelopeReceiverReadOnlyDto>();
|
||||||
|
|
||||||
// DTO to Entity mappings
|
// DTO to Entity mappings
|
||||||
CreateMap<ConfigDto, Config>();
|
CreateMap<ConfigDto, Config>();
|
||||||
CreateMap<DocumentReceiverElementDto, DocumentReceiverElement>();
|
CreateMap<SignatureDto, Signature>();
|
||||||
CreateMap<DocumentStatusDto, DocumentStatus>();
|
CreateMap<DocumentStatusDto, DocumentStatus>();
|
||||||
CreateMap<EmailTemplateDto, EmailTemplate>();
|
CreateMap<EmailTemplateDto, EmailTemplate>();
|
||||||
CreateMap<EnvelopeDto, Envelope>();
|
CreateMap<EnvelopeDto, Envelope>();
|
||||||
CreateMap<EnvelopeDocumentDto, EnvelopeDocument>();
|
CreateMap<DocumentDto, Document>();
|
||||||
CreateMap<EnvelopeHistoryDto, Domain.Entities.EnvelopeHistory>();
|
CreateMap<HistoryDto, Domain.Entities.History>();
|
||||||
CreateMap<EnvelopeHistoryCreateDto, Domain.Entities.EnvelopeHistory>();
|
CreateMap<HistoryCreateDto, Domain.Entities.History>();
|
||||||
CreateMap<EnvelopeReceiverDto, Domain.Entities.EnvelopeReceiver>();
|
CreateMap<EnvelopeReceiverDto, Domain.Entities.EnvelopeReceiver>();
|
||||||
CreateMap<EnvelopeTypeDto, EnvelopeType>();
|
CreateMap<EnvelopeTypeDto, EnvelopeType>();
|
||||||
CreateMap<ReceiverReadDto, Domain.Entities.Receiver>().ForMember(rcv => rcv.EnvelopeReceivers, rcvReadDto => rcvReadDto.Ignore());
|
CreateMap<ReceiverDto, Domain.Entities.Receiver>().ForMember(rcv => rcv.EnvelopeReceivers, rcvReadDto => rcvReadDto.Ignore());
|
||||||
CreateMap<Domain.Entities.EnvelopeReceiver, EnvelopeReceiverBasicDto>();
|
|
||||||
CreateMap<EnvelopeReceiverReadOnlyCreateDto, Domain.Entities.EnvelopeReceiverReadOnly>();
|
CreateMap<EnvelopeReceiverReadOnlyCreateDto, Domain.Entities.EnvelopeReceiverReadOnly>();
|
||||||
CreateMap<EnvelopeReceiverReadOnlyUpdateDto, Domain.Entities.EnvelopeReceiverReadOnly>();
|
CreateMap<EnvelopeReceiverReadOnlyUpdateDto, Domain.Entities.EnvelopeReceiverReadOnly>();
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Dto.Messaging;
|
namespace EnvelopeGenerator.Application.Common.Dto.Messaging;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Dto.Messaging;
|
namespace EnvelopeGenerator.Application.Common.Dto.Messaging;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
using EnvelopeGenerator.Application.Dto.EnvelopeReceiver;
|
using EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Dto.Receiver;
|
namespace EnvelopeGenerator.Application.Common.Dto.Receiver;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
public class ReceiverReadDto
|
public class ReceiverDto
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -25,6 +25,12 @@ public class ReceiverReadDto
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public required string Signature { get; set; }
|
public required string Signature { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[JsonIgnore]
|
||||||
|
public string? TotpSecretkey { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -34,18 +40,13 @@ public class ReceiverReadDto
|
|||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public IEnumerable<EnvelopeReceiverBasicDto>? EnvelopeReceivers { get; set; }
|
public IEnumerable<EnvelopeReceiverDto>? EnvelopeReceivers { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string? LastUsedName => EnvelopeReceivers?.LastOrDefault()?.Name;
|
public string? LastUsedName => EnvelopeReceivers?.LastOrDefault()?.Name;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public string? TotpSecretkey { get; set; } = null;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Dto;
|
namespace EnvelopeGenerator.Application.Common.Dto;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Data Transfer Object representing a positioned element assigned to a document receiver.
|
/// Data Transfer Object representing a positioned element assigned to a document receiver.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
public class DocumentReceiverElementDto
|
public class SignatureDto
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the unique identifier of the element.
|
/// Gets or sets the unique identifier of the element.
|
||||||
@@ -86,10 +86,10 @@ public class DocumentReceiverElementDto
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the top position of the element (in layout terms).
|
/// Gets or sets the top position of the element (in layout terms).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public double Top { get; set; }
|
public double Top => Y;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the left position of the element (in layout terms).
|
/// Gets or sets the left position of the element (in layout terms).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public double Left { get; set; }
|
public double Left => X;
|
||||||
}
|
}
|
||||||
27
EnvelopeGenerator.Application/Common/EnvelopeFlag.cs
Normal file
27
EnvelopeGenerator.Application/Common/EnvelopeFlag.cs
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
namespace EnvelopeGenerator.Application.Common;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public enum EnvelopeFlag
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
EnvelopeOrReceiverNonexists,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
NonDecodableEnvelopeReceiverId,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
WrongEnvelopeReceiverId,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
AccessCodeNull
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using Microsoft.Extensions.Caching.Distributed;
|
using Microsoft.Extensions.Caching.Distributed;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Extensions;
|
namespace EnvelopeGenerator.Application.Common.Extensions;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using EnvelopeGenerator.Domain.Constants;
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Extensions;
|
namespace EnvelopeGenerator.Application.Common.Extensions;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -58,8 +58,8 @@ public static class DecodingExtensions
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Ensure no invalid padding scenarios exist
|
// Ensure no invalid padding scenarios exist
|
||||||
if (input.EndsWith("==") && (input.Length % 4 == 0) ||
|
if (input.EndsWith("==") && input.Length % 4 == 0 ||
|
||||||
input.EndsWith("=") && (input.Length % 4 == 3))
|
input.EndsWith("=") && input.Length % 4 == 3)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -157,7 +157,7 @@ public static class DecodingExtensions
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
byte[] bytes = Convert.FromBase64String(envelopeReceiverReadOnlyId);
|
byte[] bytes = Convert.FromBase64String(envelopeReceiverReadOnlyId);
|
||||||
string decodedString = System.Text.Encoding.UTF8.GetString(bytes);
|
string decodedString = Encoding.UTF8.GetString(bytes);
|
||||||
string[] parts = decodedString.Split(new string[] { "::" }, StringSplitOptions.None);
|
string[] parts = decodedString.Split(new string[] { "::" }, StringSplitOptions.None);
|
||||||
|
|
||||||
if (parts.Length > 2)
|
if (parts.Length > 2)
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Extensions;
|
namespace EnvelopeGenerator.Application.Common.Extensions;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Provides extension methods for decoding and extracting information from an envelope receiver ID.
|
/// Provides extension methods for decoding and extracting information from an envelope receiver ID.
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Extensions
|
namespace EnvelopeGenerator.Application.Common.Extensions
|
||||||
{
|
{
|
||||||
public static class LoggerExtensions
|
public static class LoggerExtensions
|
||||||
{
|
{
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using EnvelopeGenerator.Application.Dto.Messaging;
|
using EnvelopeGenerator.Application.Common.Dto.Messaging;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Extensions;
|
namespace EnvelopeGenerator.Application.Common.Extensions;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Provides extension methods for common mapping and conversion operations.
|
/// Provides extension methods for common mapping and conversion operations.
|
||||||
@@ -1,11 +1,24 @@
|
|||||||
using Microsoft.Extensions.Caching.Memory;
|
using EnvelopeGenerator.Application.Common.Extensions;
|
||||||
|
using Microsoft.Extensions.Caching.Memory;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Extensions;
|
namespace EnvelopeGenerator.Application.Common.Extensions;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public static class MemoryCacheExtensions
|
public static class MemoryCacheExtensions
|
||||||
{
|
{
|
||||||
private static readonly Guid BaseId = Guid.NewGuid();
|
private static readonly Guid BaseId = Guid.NewGuid();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="TEnum"></typeparam>
|
||||||
|
/// <param name="memoryCache"></param>
|
||||||
|
/// <param name="key"></param>
|
||||||
|
/// <param name="ignores"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="InvalidOperationException"></exception>
|
||||||
public static IDictionary<string, int> GetEnumAsDictionary<TEnum>(this IMemoryCache memoryCache, string key = "", params object[] ignores)
|
public static IDictionary<string, int> GetEnumAsDictionary<TEnum>(this IMemoryCache memoryCache, string key = "", params object[] ignores)
|
||||||
where TEnum : Enum
|
where TEnum : Enum
|
||||||
=> memoryCache.GetOrCreate(BaseId + typeof(TEnum).FullName + key, _ =>
|
=> memoryCache.GetOrCreate(BaseId + typeof(TEnum).FullName + key, _ =>
|
||||||
@@ -1,8 +1,10 @@
|
|||||||
using DigitalData.Core.Exceptions;
|
using DigitalData.Core.Exceptions;
|
||||||
using EnvelopeGenerator.Application.Model;
|
using EnvelopeGenerator.Application.Common.Extensions;
|
||||||
|
using EnvelopeGenerator.Application.Common.Query;
|
||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using EnvelopeGenerator.Domain.Interfaces;
|
using EnvelopeGenerator.Domain.Interfaces;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Extensions;
|
namespace EnvelopeGenerator.Application.Common.Extensions;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -33,6 +35,28 @@ public static class QueryExtensions
|
|||||||
return root;
|
return root;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="root"></param>
|
||||||
|
/// <param name="query"></param>
|
||||||
|
/// <param name="notnull"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="BadRequestException"></exception>
|
||||||
|
public static IQueryable<Envelope> Where(this IQueryable<Envelope> root, EnvelopeQueryBase query, bool notnull = true)
|
||||||
|
{
|
||||||
|
if (query.Id is not null)
|
||||||
|
root = root.Where(e => e.Id == query.Id);
|
||||||
|
else if (query.Uuid is not null)
|
||||||
|
root = root.Where(e => e.Uuid == query.Uuid);
|
||||||
|
else if (notnull)
|
||||||
|
throw new BadRequestException(
|
||||||
|
"Either Envelope Id or Envelope Uuid must be provided in the query."
|
||||||
|
);
|
||||||
|
|
||||||
|
return root;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -59,6 +83,30 @@ public static class QueryExtensions
|
|||||||
return root;
|
return root;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="root"></param>
|
||||||
|
/// <param name="query"></param>
|
||||||
|
/// <param name="notnull"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="BadRequestException"></exception>
|
||||||
|
public static IQueryable<Receiver> Where(this IQueryable<Receiver> root, ReceiverQueryBase query, bool notnull = true)
|
||||||
|
{
|
||||||
|
if (query.Id is not null)
|
||||||
|
root = root.Where(e => e.Id == query.Id);
|
||||||
|
else if (query.EmailAddress is not null)
|
||||||
|
root = root.Where(e => e.EmailAddress == query.EmailAddress);
|
||||||
|
else if (query.Signature is not null)
|
||||||
|
root = root.Where(e => e.Signature == query.Signature);
|
||||||
|
else if (notnull)
|
||||||
|
throw new BadRequestException(
|
||||||
|
"Receiver must have at least one identifier (Id, EmailAddress, or Signature)."
|
||||||
|
);
|
||||||
|
|
||||||
|
return root;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using OtpNet;
|
using OtpNet;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Extensions
|
namespace EnvelopeGenerator.Application.Common.Extensions
|
||||||
{
|
{
|
||||||
public static class StringExtension
|
public static class StringExtension
|
||||||
{
|
{
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using DigitalData.Core.Exceptions;
|
using DigitalData.Core.Exceptions;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Extensions;
|
namespace EnvelopeGenerator.Application.Common.Extensions;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Extension methods for tasks
|
/// Extension methods for tasks
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
using Microsoft.Extensions.Localization;
|
using Microsoft.Extensions.Localization;
|
||||||
using System.Text.Encodings.Web;
|
using System.Text.Encodings.Web;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Extensions
|
namespace EnvelopeGenerator.Application.Common.Extensions
|
||||||
{
|
{
|
||||||
public static class XSSExtensions
|
public static class XSSExtensions
|
||||||
{
|
{
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
using EnvelopeGenerator.Application.Dto.EnvelopeReceiver;
|
using EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver;
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System.Dynamic;
|
using System.Dynamic;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Notifications.DocSigned;
|
namespace EnvelopeGenerator.Application.Common.Notifications.DocSigned;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,9 +1,10 @@
|
|||||||
using EnvelopeGenerator.Application.DocStatus.Commands;
|
using EnvelopeGenerator.Application.Common.Notifications.DocSigned;
|
||||||
|
using EnvelopeGenerator.Application.DocStatus.Commands;
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Notifications.DocSigned.Handlers;
|
namespace EnvelopeGenerator.Application.Common.Notifications.DocSigned.Handlers;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,9 +1,10 @@
|
|||||||
using EnvelopeGenerator.Application.Histories.Commands;
|
using EnvelopeGenerator.Application.Common.Notifications.DocSigned;
|
||||||
|
using EnvelopeGenerator.Application.Histories.Commands;
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Notifications.DocSigned.Handlers;
|
namespace EnvelopeGenerator.Application.Common.Notifications.DocSigned.Handlers;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
using DigitalData.Core.Abstraction.Application.Repository;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using DigitalData.EmailProfilerDispatcher.Abstraction.Entities;
|
using DigitalData.EmailProfilerDispatcher.Abstraction.Entities;
|
||||||
using EnvelopeGenerator.Application.Configurations;
|
using EnvelopeGenerator.Application.Common.Configurations;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Notifications.DocSigned.Handlers;
|
namespace EnvelopeGenerator.Application.Common.Notifications.DocSigned.Handlers;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using DigitalData.Core.Abstraction.Application.Repository;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using DigitalData.EmailProfilerDispatcher.Abstraction.Entities;
|
using DigitalData.EmailProfilerDispatcher.Abstraction.Entities;
|
||||||
using EnvelopeGenerator.Application.Configurations;
|
using EnvelopeGenerator.Application.Common.Configurations;
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
@@ -8,7 +8,7 @@ using Microsoft.EntityFrameworkCore;
|
|||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Notifications;
|
namespace EnvelopeGenerator.Application.Common.Notifications;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace EnvelopeGenerator.Application.Model;
|
namespace EnvelopeGenerator.Application.Common.Query;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Repräsentiert eine Abfrage für Umschläge.
|
/// Repräsentiert eine Abfrage für Umschläge.
|
||||||
@@ -8,10 +8,10 @@ public record EnvelopeQueryBase
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Die eindeutige Kennung des Umschlags.
|
/// Die eindeutige Kennung des Umschlags.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual int? Id { get; init; }
|
public virtual int? Id { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Die universell eindeutige Kennung des Umschlags.
|
/// Die universell eindeutige Kennung des Umschlags.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual string? Uuid { get; init; }
|
public virtual string? Uuid { get; set; }
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using DigitalData.Core.Exceptions;
|
using DigitalData.Core.Exceptions;
|
||||||
using EnvelopeGenerator.Application.Extensions;
|
using EnvelopeGenerator.Application.Common.Extensions;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Model;
|
namespace EnvelopeGenerator.Application.Common.Query;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Model;
|
namespace EnvelopeGenerator.Application.Common.Query;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace EnvelopeGenerator.Application.Model;
|
namespace EnvelopeGenerator.Application.Common.Query;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Stellt eine Abfrage dar, um die Details eines Empfängers zu lesen.
|
/// Stellt eine Abfrage dar, um die Details eines Empfängers zu lesen.
|
||||||
@@ -9,12 +9,12 @@ public record ReceiverQueryBase
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// ID des Empfängers
|
/// ID des Empfängers
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual int? Id { get; init; }
|
public virtual int? Id { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// E-Mail Adresse des Empfängers
|
/// E-Mail Adresse des Empfängers
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual string? EmailAddress { get; init; }
|
public virtual string? EmailAddress { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Eindeutige Signatur des Empfängers
|
/// Eindeutige Signatur des Empfängers
|
||||||
@@ -3,12 +3,12 @@ using EnvelopeGenerator.Application.Interfaces.SQLExecutor;
|
|||||||
using DigitalData.Core.Exceptions;
|
using DigitalData.Core.Exceptions;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.SQL;
|
namespace EnvelopeGenerator.Application.Common.SQL;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class DocumentCreateReadSQL : ISQL<EnvelopeDocument>
|
public class DocumentCreateReadSQL : ISQL<Document>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Base64, OUT_UID
|
/// Base64, OUT_UID
|
||||||
@@ -3,7 +3,7 @@ using EnvelopeGenerator.Application.Interfaces.SQLExecutor;
|
|||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.SQL;
|
namespace EnvelopeGenerator.Application.Common.SQL;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
using EnvelopeGenerator.Application.Interfaces.SQLExecutor;
|
using EnvelopeGenerator.Application.Interfaces.SQLExecutor;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.SQL;
|
namespace EnvelopeGenerator.Application.Common.SQL;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.SQL;
|
namespace EnvelopeGenerator.Application.Common.SQL;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Extension method for converting objects to SQL parameter strings.
|
/// Extension method for converting objects to SQL parameter strings.
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
using DigitalData.Core.Client;
|
using DigitalData.Core.Client;
|
||||||
using EnvelopeGenerator.Application.Configurations;
|
using EnvelopeGenerator.Application.Common.Configurations;
|
||||||
using EnvelopeGenerator.Application.Interfaces.Services;
|
using EnvelopeGenerator.Application.Interfaces.Services;
|
||||||
using EnvelopeGenerator.Application.Services;
|
using EnvelopeGenerator.Application.Services;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using EnvelopeGenerator.Application.Model;
|
using EnvelopeGenerator.Application.Common.Query;
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DocStatus.Commands;
|
namespace EnvelopeGenerator.Application.DocStatus.Commands;
|
||||||
@@ -8,6 +8,21 @@ namespace EnvelopeGenerator.Application.DocStatus.Commands;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public record ModifyDocStatusCommandBase : EnvelopeReceiverQueryBase
|
public record ModifyDocStatusCommandBase : EnvelopeReceiverQueryBase
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public int? EnvelopeId => Envelope.Id;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public int? ReceiverId => Receiver.Id;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public override ReceiverQueryBase Receiver { get => base.Receiver; set => base.Receiver = value; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the current status code.
|
/// Gets the current status code.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using EnvelopeGenerator.Application.Extensions;
|
|
||||||
using EnvelopeGenerator.Application.Dto;
|
|
||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
|
using EnvelopeGenerator.Application.Common.Dto;
|
||||||
|
using EnvelopeGenerator.Application.Common.Extensions;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DocStatus.Commands;
|
namespace EnvelopeGenerator.Application.DocStatus.Commands;
|
||||||
|
|
||||||
@@ -23,15 +23,23 @@ public class SaveDocStatusCommandHandler : IRequestHandler<SaveDocStatusCommand,
|
|||||||
|
|
||||||
private readonly IRepository<DocumentStatus> _repo;
|
private readonly IRepository<DocumentStatus> _repo;
|
||||||
|
|
||||||
|
private readonly IRepository<Envelope> _envRepo;
|
||||||
|
|
||||||
|
private readonly IRepository<Receiver> _rcvRepo;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="mapper"></param>
|
/// <param name="mapper"></param>
|
||||||
/// <param name="repo"></param>
|
/// <param name="repo"></param>
|
||||||
public SaveDocStatusCommandHandler(IMapper mapper, IRepository<DocumentStatus> repo)
|
/// <param name="rcvRepo"></param>
|
||||||
|
/// <param name="envRepo"></param>
|
||||||
|
public SaveDocStatusCommandHandler(IMapper mapper, IRepository<DocumentStatus> repo, IRepository<Receiver> rcvRepo, IRepository<Envelope> envRepo)
|
||||||
{
|
{
|
||||||
_mapper = mapper;
|
_mapper = mapper;
|
||||||
_repo = repo;
|
_repo = repo;
|
||||||
|
_rcvRepo = rcvRepo;
|
||||||
|
_envRepo = envRepo;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -45,6 +53,12 @@ public class SaveDocStatusCommandHandler : IRequestHandler<SaveDocStatusCommand,
|
|||||||
// ceck if exists
|
// ceck if exists
|
||||||
bool isExists = await _repo.ReadOnly().Where(request).AnyAsync(cancel);
|
bool isExists = await _repo.ReadOnly().Where(request).AnyAsync(cancel);
|
||||||
|
|
||||||
|
var env = await _envRepo.ReadOnly().Where(request.Envelope).FirstAsync(cancel);
|
||||||
|
var rcv = await _rcvRepo.ReadOnly().Where(request.Receiver).FirstAsync(cancel);
|
||||||
|
|
||||||
|
request.Envelope.Id = env.Id;
|
||||||
|
request.Receiver.Id = rcv.Id;
|
||||||
|
|
||||||
if (isExists)
|
if (isExists)
|
||||||
{
|
{
|
||||||
var uReq = request.To<UpdateDocStatusCommand>();
|
var uReq = request.To<UpdateDocStatusCommand>();
|
||||||
|
|||||||
@@ -14,7 +14,12 @@ public class MappingProfile : Profile
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public MappingProfile()
|
public MappingProfile()
|
||||||
{
|
{
|
||||||
CreateMap<CreateDocStatusCommand, DocumentStatus>();
|
CreateMap<CreateDocStatusCommand, DocumentStatus>()
|
||||||
CreateMap<UpdateDocStatusCommand, DocumentStatus>();
|
.ForMember(dest => dest.Envelope, opt => opt.Ignore())
|
||||||
|
.ForMember(dest => dest.Receiver, opt => opt.Ignore());
|
||||||
|
|
||||||
|
CreateMap<UpdateDocStatusCommand, DocumentStatus>()
|
||||||
|
.ForMember(dest => dest.Envelope, opt => opt.Ignore())
|
||||||
|
.ForMember(dest => dest.Receiver, opt => opt.Ignore());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
using DigitalData.Core.Abstraction.Application.Repository;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using EnvelopeGenerator.Application.Dto;
|
|
||||||
using MediatR;
|
using MediatR;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
|
using EnvelopeGenerator.Application.Common.Dto;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Documents.Queries;
|
namespace EnvelopeGenerator.Application.Documents.Queries;
|
||||||
|
|
||||||
@@ -12,55 +12,55 @@ namespace EnvelopeGenerator.Application.Documents.Queries;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="Id">The unique identifier of the document. Optional.</param>
|
/// <param name="Id">The unique identifier of the document. Optional.</param>
|
||||||
/// <param name="EnvelopeId">The identifier of the envelope associated with the document. Optional.</param>
|
/// <param name="EnvelopeId">The identifier of the envelope associated with the document. Optional.</param>
|
||||||
public record ReadDocumentQuery(int? Id = null, int? EnvelopeId = null) : IRequest<EnvelopeDocumentDto?>
|
public record ReadDocumentQuery(int? Id = null, int? EnvelopeId = null) : IRequest<DocumentDto?>
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Handles queries for reading <see cref="EnvelopeDocument"/> data based on either the document ID or the envelope ID.
|
/// Handles queries for reading <see cref="Document"/> data based on either the document ID or the envelope ID.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ReadDocumentQueryHandler : IRequestHandler<ReadDocumentQuery, EnvelopeDocumentDto?>
|
public class ReadDocumentQueryHandler : IRequestHandler<ReadDocumentQuery, DocumentDto?>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// TempRepo for accessing <see cref="EnvelopeDocument"/> entities.
|
/// TempRepo for accessing <see cref="Document"/> entities.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private readonly IRepository<EnvelopeDocument> _repo;
|
private readonly IRepository<Document> _repo;
|
||||||
|
|
||||||
private readonly IMapper _mapper;
|
private readonly IMapper _mapper;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="ReadDocumentQueryHandler"/> class.
|
/// Initializes a new instance of the <see cref="ReadDocumentQueryHandler"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="envelopeDocumentRepository">The repository used to access <see cref="EnvelopeDocument"/> entities.</param>
|
/// <param name="envelopeDocumentRepository">The repository used to access <see cref="Document"/> entities.</param>
|
||||||
/// <param name="mapper"></param>
|
/// <param name="mapper"></param>
|
||||||
public ReadDocumentQueryHandler(IRepository<EnvelopeDocument> envelopeDocumentRepository, IMapper mapper)
|
public ReadDocumentQueryHandler(IRepository<Document> envelopeDocumentRepository, IMapper mapper)
|
||||||
{
|
{
|
||||||
_repo = envelopeDocumentRepository;
|
_repo = envelopeDocumentRepository;
|
||||||
_mapper = mapper;
|
_mapper = mapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Handles the <see cref="ReadDocumentQuery"/> and returns a <see cref="EnvelopeDocumentDto"/> based on the provided identifiers.
|
/// Handles the <see cref="ReadDocumentQuery"/> and returns a <see cref="DocumentDto"/> based on the provided identifiers.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="query">The query containing the document ID or envelope ID to search for.</param>
|
/// <param name="query">The query containing the document ID or envelope ID to search for.</param>
|
||||||
/// <param name="cancel">A token to monitor for cancellation requests.</param>
|
/// <param name="cancel">A token to monitor for cancellation requests.</param>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// A <see cref="EnvelopeDocumentDto"/> if a matching document is found; otherwise, <c>null</c>.
|
/// A <see cref="DocumentDto"/> if a matching document is found; otherwise, <c>null</c>.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
/// <exception cref="InvalidOperationException">
|
/// <exception cref="InvalidOperationException">
|
||||||
/// Thrown when neither <see cref="ReadDocumentQuery.Id"/> nor <see cref="ReadDocumentQuery.EnvelopeId"/> is provided.
|
/// Thrown when neither <see cref="ReadDocumentQuery.Id"/> nor <see cref="ReadDocumentQuery.EnvelopeId"/> is provided.
|
||||||
/// </exception>
|
/// </exception>
|
||||||
public async Task<EnvelopeDocumentDto?> Handle(ReadDocumentQuery query, CancellationToken cancel)
|
public async Task<DocumentDto?> Handle(ReadDocumentQuery query, CancellationToken cancel)
|
||||||
{
|
{
|
||||||
if (query.Id is not null)
|
if (query.Id is not null)
|
||||||
{
|
{
|
||||||
var doc = await _repo.ReadOnly().Where(d => d.Id == query.Id).FirstOrDefaultAsync(cancel);
|
var doc = await _repo.ReadOnly().Where(d => d.Id == query.Id).FirstOrDefaultAsync(cancel);
|
||||||
return _mapper.Map<EnvelopeDocumentDto>(doc);
|
return _mapper.Map<DocumentDto>(doc);
|
||||||
}
|
}
|
||||||
else if (query.EnvelopeId is not null)
|
else if (query.EnvelopeId is not null)
|
||||||
{
|
{
|
||||||
var doc = await _repo.ReadOnly().Where(d => d.EnvelopeId == query.EnvelopeId).FirstOrDefaultAsync(cancel);
|
var doc = await _repo.ReadOnly().Where(d => d.EnvelopeId == query.EnvelopeId).FirstOrDefaultAsync(cancel);
|
||||||
return _mapper.Map<EnvelopeDocumentDto>(doc);
|
return _mapper.Map<DocumentDto>(doc);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new InvalidOperationException(
|
throw new InvalidOperationException(
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
using EnvelopeGenerator.Application.Dto.Receiver;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Dto.EnvelopeReceiver;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
|
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
|
||||||
public record EnvelopeReceiverDto() : EnvelopeReceiverBasicDto()
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public EnvelopeDto? Envelope { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public ReceiverReadDto? Receiver { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
using DigitalData.Core.Abstraction.Application.Repository;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using EnvelopeGenerator.Application.Dto;
|
using EnvelopeGenerator.Application.Common.Dto;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using DigitalData.Core.Abstraction.Application.Repository;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using EnvelopeGenerator.Application.Dto;
|
|
||||||
using DigitalData.Core.Exceptions;
|
using DigitalData.Core.Exceptions;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
using EnvelopeGenerator.Application.Common.Dto;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.EmailTemplates.Commands.Update;
|
namespace EnvelopeGenerator.Application.EmailTemplates.Commands.Update;
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
namespace EnvelopeGenerator.Application
|
|
||||||
{
|
|
||||||
public enum EnvelopeFlag
|
|
||||||
{
|
|
||||||
EnvelopeOrReceiverNonexists,
|
|
||||||
NonDecodableEnvelopeReceiverId,
|
|
||||||
WrongEnvelopeReceiverId,
|
|
||||||
AccessCodeNull
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using EnvelopeGenerator.Application.Interfaces.SQLExecutor;
|
using EnvelopeGenerator.Application.Interfaces.SQLExecutor;
|
||||||
using EnvelopeGenerator.Application.Dto.Receiver;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
|
using EnvelopeGenerator.Application.Common.Dto.Receiver;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Commands;
|
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Commands;
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@ public class CreateEnvelopeReceiverCommandHandler : IRequestHandler<CreateEnvelo
|
|||||||
|
|
||||||
var res = _mapper.Map<CreateEnvelopeReceiverResponse>(envelope);
|
var res = _mapper.Map<CreateEnvelopeReceiverResponse>(envelope);
|
||||||
res.UnsentReceivers = unsentRecipients;
|
res.UnsentReceivers = unsentRecipients;
|
||||||
res.SentReceiver = _mapper.Map<IEnumerable<ReceiverReadDto>>(sentRecipients);
|
res.SentReceiver = _mapper.Map<IEnumerable<ReceiverDto>>(sentRecipients);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
using EnvelopeGenerator.Application.Dto;
|
using EnvelopeGenerator.Application.Common.Dto;
|
||||||
using EnvelopeGenerator.Application.Dto.Receiver;
|
using EnvelopeGenerator.Application.Common.Dto.Receiver;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Commands;
|
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Commands;
|
||||||
|
|
||||||
@@ -11,7 +11,7 @@ public record CreateEnvelopeReceiverResponse : EnvelopeDto
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IEnumerable<ReceiverReadDto> SentReceiver { get; set; } = new List<ReceiverReadDto>();
|
public IEnumerable<ReceiverDto> SentReceiver { get; set; } = new List<ReceiverDto>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using EnvelopeGenerator.Application.Dto.Receiver;
|
using EnvelopeGenerator.Application.Common.Dto.Receiver;
|
||||||
using EnvelopeGenerator.Application.Envelopes.Commands;
|
using EnvelopeGenerator.Application.Envelopes.Commands;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
@@ -15,6 +15,6 @@ public class MappingProfile : Profile
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public MappingProfile()
|
public MappingProfile()
|
||||||
{
|
{
|
||||||
CreateMap<Receiver, ReceiverReadDto>();
|
CreateMap<Receiver, ReceiverDto>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using DigitalData.Core.Abstraction.Application.Repository;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using DigitalData.Core.Exceptions;
|
using DigitalData.Core.Exceptions;
|
||||||
using EnvelopeGenerator.Application.Dto.EnvelopeReceiver;
|
|
||||||
using EnvelopeGenerator.Application.Envelopes.Queries;
|
using EnvelopeGenerator.Application.Envelopes.Queries;
|
||||||
using EnvelopeGenerator.Application.Extensions;
|
|
||||||
using EnvelopeGenerator.Application.Model;
|
|
||||||
using EnvelopeGenerator.Application.Receivers.Queries;
|
using EnvelopeGenerator.Application.Receivers.Queries;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver;
|
||||||
|
using EnvelopeGenerator.Application.Common.Query;
|
||||||
|
using EnvelopeGenerator.Application.Common.Extensions;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Queries;
|
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Queries;
|
||||||
|
|
||||||
@@ -66,6 +66,22 @@ public static class Extensions
|
|||||||
var q = new ReadEnvelopeReceiverQuery() { Key = key };
|
var q = new ReadEnvelopeReceiverQuery() { Key = key };
|
||||||
return mediator.Send(q, cancel).Then(envRcvs => envRcvs.FirstOrDefault());
|
return mediator.Send(q, cancel).Then(envRcvs => envRcvs.FirstOrDefault());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="mediator"></param>
|
||||||
|
/// <param name="uuid"></param>
|
||||||
|
/// <param name="signature"></param>
|
||||||
|
/// <param name="cancel"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static Task<EnvelopeReceiverDto?> ReadEnvelopeReceiverAsync(this IMediator mediator, string uuid, string signature, CancellationToken cancel = default)
|
||||||
|
{
|
||||||
|
var q = new ReadEnvelopeReceiverQuery();
|
||||||
|
q.Envelope.Uuid = uuid;
|
||||||
|
q.Receiver.Signature = signature;
|
||||||
|
return mediator.Send(q, cancel).Then(envRcvs => envRcvs.FirstOrDefault());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -97,7 +113,7 @@ public class ReadEnvelopeReceiverQueryHandler : IRequestHandler<ReadEnvelopeRece
|
|||||||
/// <exception cref="BadRequestException"></exception>
|
/// <exception cref="BadRequestException"></exception>
|
||||||
public async Task<IEnumerable<EnvelopeReceiverDto>> Handle(ReadEnvelopeReceiverQuery request, CancellationToken cancel)
|
public async Task<IEnumerable<EnvelopeReceiverDto>> Handle(ReadEnvelopeReceiverQuery request, CancellationToken cancel)
|
||||||
{
|
{
|
||||||
var q = _repo.Read().Where(request, notnull: false);
|
var q = _repo.ReadOnly().Where(request, notnull: false);
|
||||||
|
|
||||||
if (request.Envelope.Status is not null)
|
if (request.Envelope.Status is not null)
|
||||||
{
|
{
|
||||||
@@ -115,12 +131,13 @@ public class ReadEnvelopeReceiverQueryHandler : IRequestHandler<ReadEnvelopeRece
|
|||||||
q = q.Where(er => !status.Ignore.Contains(er.Envelope!.Status));
|
q = q.Where(er => !status.Ignore.Contains(er.Envelope!.Status));
|
||||||
}
|
}
|
||||||
|
|
||||||
var envRcvs = await q.Include(er => er.Envelope).ThenInclude(e => e!.Documents).ThenInclude(d => d.Elements)
|
var envRcvs = await q
|
||||||
.Include(er => er.Envelope).ThenInclude(e => e!.History)
|
.Include(er => er.Envelope).ThenInclude(e => e!.Documents!).ThenInclude(d => d.Elements)
|
||||||
|
.Include(er => er.Envelope).ThenInclude(e => e!.Histories)
|
||||||
.Include(er => er.Envelope).ThenInclude(e => e!.User)
|
.Include(er => er.Envelope).ThenInclude(e => e!.User)
|
||||||
.Include(er => er.Receiver)
|
.Include(er => er.Receiver)
|
||||||
.ToListAsync(cancel);
|
.ToListAsync(cancel);
|
||||||
|
|
||||||
return _mapper.Map<IEnumerable<EnvelopeReceiverDto>>(envRcvs);
|
return _mapper.Map<List<EnvelopeReceiverDto>>(envRcvs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
using DigitalData.Core.Abstraction.Application.Repository;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using EnvelopeGenerator.Application.Model;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using EnvelopeGenerator.Application.Extensions;
|
using EnvelopeGenerator.Application.Common.Extensions;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
using EnvelopeGenerator.Application.Common.Query;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Queries;
|
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Queries;
|
||||||
|
|
||||||
@@ -49,13 +49,13 @@ public static class ReceiverAlreadySignedQueryExtensions
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class ReceiverAlreadySignedQueryHandler : IRequestHandler<ReceiverAlreadySignedQuery, bool>
|
public class ReceiverAlreadySignedQueryHandler : IRequestHandler<ReceiverAlreadySignedQuery, bool>
|
||||||
{
|
{
|
||||||
private readonly IRepository<EnvelopeReceiver> _repo;
|
private readonly IRepository<History> _repo;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="repo"></param>
|
/// <param name="repo"></param>
|
||||||
public ReceiverAlreadySignedQueryHandler(IRepository<EnvelopeReceiver> repo)
|
public ReceiverAlreadySignedQueryHandler(IRepository<History> repo)
|
||||||
{
|
{
|
||||||
_repo = repo;
|
_repo = repo;
|
||||||
}
|
}
|
||||||
@@ -68,10 +68,6 @@ public class ReceiverAlreadySignedQueryHandler : IRequestHandler<ReceiverAlready
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<bool> Handle(ReceiverAlreadySignedQuery request, CancellationToken cancel = default)
|
public async Task<bool> Handle(ReceiverAlreadySignedQuery request, CancellationToken cancel = default)
|
||||||
{
|
{
|
||||||
return await _repo.Read()
|
return await _repo.ReadOnly().Where(request).Where(h => h.Status == EnvelopeStatus.DocumentSigned).AnyAsync(cancel);
|
||||||
.Where(er => er.Envelope!.Uuid == request.Envelope.Uuid)
|
|
||||||
.Where(er => er.Receiver!.Signature == request.Receiver.Signature)
|
|
||||||
.Where(er => er.Envelope!.History.Any(hist => hist.Status == EnvelopeStatus.DocumentSigned))
|
|
||||||
.AnyAsync(cancel);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
using DigitalData.Core.Abstraction.Application.Repository;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using EnvelopeGenerator.Application.Dto;
|
using EnvelopeGenerator.Application.Common.Dto;
|
||||||
using EnvelopeGenerator.Application.Interfaces.SQLExecutor;
|
using EnvelopeGenerator.Application.Interfaces.SQLExecutor;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using EnvelopeGenerator.Application.Interfaces.SQLExecutor;
|
using EnvelopeGenerator.Application.Interfaces.SQLExecutor;
|
||||||
using EnvelopeGenerator.Application.Dto;
|
|
||||||
using MediatR;
|
using MediatR;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using DigitalData.Core.Abstraction.Application.Repository;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
using EnvelopeGenerator.Application.Common.Dto;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Envelopes.Commands;
|
namespace EnvelopeGenerator.Application.Envelopes.Commands;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using MediatR;
|
using MediatR;
|
||||||
using EnvelopeGenerator.Application.Model;
|
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
using EnvelopeGenerator.Application.Common.Query;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Envelopes.Queries;
|
namespace EnvelopeGenerator.Application.Envelopes.Queries;
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using DigitalData.Core.Abstraction.Application.Repository;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using DigitalData.Core.Exceptions;
|
using DigitalData.Core.Exceptions;
|
||||||
using EnvelopeGenerator.Application.Dto.EnvelopeHistory;
|
using EnvelopeGenerator.Application.Common.Dto.History;
|
||||||
using EnvelopeGenerator.Application.Extensions;
|
using EnvelopeGenerator.Application.Common.Extensions;
|
||||||
using EnvelopeGenerator.Application.Model;
|
using EnvelopeGenerator.Application.Common.Query;
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
@@ -14,7 +14,7 @@ namespace EnvelopeGenerator.Application.Histories.Commands;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public record CreateHistoryCommand : EnvelopeReceiverQueryBase, IRequest<EnvelopeHistoryDto?>
|
public record CreateHistoryCommand : EnvelopeReceiverQueryBase, IRequest<HistoryDto?>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -50,9 +50,9 @@ public record CreateHistoryCommand : EnvelopeReceiverQueryBase, IRequest<Envelop
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class CreateHistoryCommandHandler : IRequestHandler<CreateHistoryCommand, EnvelopeHistoryDto?>
|
public class CreateHistoryCommandHandler : IRequestHandler<CreateHistoryCommand, HistoryDto?>
|
||||||
{
|
{
|
||||||
private readonly IRepository<EnvelopeHistory> _repo;
|
private readonly IRepository<History> _repo;
|
||||||
|
|
||||||
private readonly IRepository<EnvelopeReceiver> _erRepo;
|
private readonly IRepository<EnvelopeReceiver> _erRepo;
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ public class CreateHistoryCommandHandler : IRequestHandler<CreateHistoryCommand,
|
|||||||
/// <param name="repo"></param>
|
/// <param name="repo"></param>
|
||||||
/// <param name="erRepo"></param>
|
/// <param name="erRepo"></param>
|
||||||
/// <param name="mapper"></param>
|
/// <param name="mapper"></param>
|
||||||
public CreateHistoryCommandHandler(IRepository<EnvelopeHistory> repo, IRepository<EnvelopeReceiver> erRepo, IMapper mapper)
|
public CreateHistoryCommandHandler(IRepository<History> repo, IRepository<EnvelopeReceiver> erRepo, IMapper mapper)
|
||||||
{
|
{
|
||||||
_repo = repo;
|
_repo = repo;
|
||||||
_erRepo = erRepo;
|
_erRepo = erRepo;
|
||||||
@@ -77,7 +77,7 @@ public class CreateHistoryCommandHandler : IRequestHandler<CreateHistoryCommand,
|
|||||||
/// <param name="request"></param>
|
/// <param name="request"></param>
|
||||||
/// <param name="cancel"></param>
|
/// <param name="cancel"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<EnvelopeHistoryDto?> Handle(CreateHistoryCommand request, CancellationToken cancel)
|
public async Task<HistoryDto?> Handle(CreateHistoryCommand request, CancellationToken cancel)
|
||||||
{
|
{
|
||||||
if(request.UserReference is null)
|
if(request.UserReference is null)
|
||||||
{
|
{
|
||||||
@@ -103,6 +103,6 @@ public class CreateHistoryCommandHandler : IRequestHandler<CreateHistoryCommand,
|
|||||||
// create entitiy
|
// create entitiy
|
||||||
var hist = await _repo.CreateAsync(request, cancel);
|
var hist = await _repo.CreateAsync(request, cancel);
|
||||||
|
|
||||||
return _mapper.Map<EnvelopeHistoryDto>(hist);
|
return _mapper.Map<HistoryDto>(hist);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -14,7 +14,7 @@ public class MappingProfile: Profile
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public MappingProfile()
|
public MappingProfile()
|
||||||
{
|
{
|
||||||
CreateMap<CreateHistoryCommand, EnvelopeHistory>()
|
CreateMap<CreateHistoryCommand, History>()
|
||||||
.ForMember(dest => dest.Envelope, opt => opt.Ignore())
|
.ForMember(dest => dest.Envelope, opt => opt.Ignore())
|
||||||
.ForMember(dest => dest.Sender, opt => opt.Ignore())
|
.ForMember(dest => dest.Sender, opt => opt.Ignore())
|
||||||
.ForMember(dest => dest.Receiver, opt => opt.Ignore());
|
.ForMember(dest => dest.Receiver, opt => opt.Ignore());
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using EnvelopeGenerator.Application.Dto.EnvelopeHistory;
|
using EnvelopeGenerator.Application.Common.Dto.History;
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
@@ -9,7 +9,7 @@ namespace EnvelopeGenerator.Application.Histories.Queries;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Repräsentiert eine Abfrage für die Verlaufshistorie eines Umschlags.
|
/// Repräsentiert eine Abfrage für die Verlaufshistorie eines Umschlags.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public record ReadHistoryQuery : IRequest<IEnumerable<EnvelopeHistoryDto>>
|
public record ReadHistoryQuery : IRequest<IEnumerable<HistoryDto>>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Die eindeutige Kennung des Umschlags.
|
/// Die eindeutige Kennung des Umschlags.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using DigitalData.Core.Abstraction.Application.Repository;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using DigitalData.Core.Exceptions;
|
using DigitalData.Core.Exceptions;
|
||||||
using EnvelopeGenerator.Application.Dto.EnvelopeHistory;
|
using EnvelopeGenerator.Application.Common.Dto.History;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
@@ -11,9 +11,9 @@ namespace EnvelopeGenerator.Application.Histories.Queries;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ReadHistoryQueryHandler : IRequestHandler<ReadHistoryQuery, IEnumerable<EnvelopeHistoryDto>>
|
public class ReadHistoryQueryHandler : IRequestHandler<ReadHistoryQuery, IEnumerable<HistoryDto>>
|
||||||
{
|
{
|
||||||
private readonly IRepository<EnvelopeHistory> _repo;
|
private readonly IRepository<History> _repo;
|
||||||
|
|
||||||
private readonly IMapper _mapper;
|
private readonly IMapper _mapper;
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@ public class ReadHistoryQueryHandler : IRequestHandler<ReadHistoryQuery, IEnumer
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="repo"></param>
|
/// <param name="repo"></param>
|
||||||
/// <param name="mapper"></param>
|
/// <param name="mapper"></param>
|
||||||
public ReadHistoryQueryHandler(IRepository<EnvelopeHistory> repo, IMapper mapper)
|
public ReadHistoryQueryHandler(IRepository<History> repo, IMapper mapper)
|
||||||
{
|
{
|
||||||
_repo = repo;
|
_repo = repo;
|
||||||
_mapper = mapper;
|
_mapper = mapper;
|
||||||
@@ -35,13 +35,13 @@ public class ReadHistoryQueryHandler : IRequestHandler<ReadHistoryQuery, IEnumer
|
|||||||
/// <param name="cancel"></param>
|
/// <param name="cancel"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="NotFoundException"></exception>
|
/// <exception cref="NotFoundException"></exception>
|
||||||
public async Task<IEnumerable<EnvelopeHistoryDto>> Handle(ReadHistoryQuery request, CancellationToken cancel = default)
|
public async Task<IEnumerable<HistoryDto>> Handle(ReadHistoryQuery request, CancellationToken cancel = default)
|
||||||
{
|
{
|
||||||
var query = _repo.ReadOnly().Where(h => h.EnvelopeId == request.EnvelopeId);
|
var query = _repo.ReadOnly().Where(h => h.EnvelopeId == request.EnvelopeId);
|
||||||
if (request.Status is not null)
|
if (request.Status is not null)
|
||||||
query = query.Where(h => h.Status == request.Status);
|
query = query.Where(h => h.Status == request.Status);
|
||||||
|
|
||||||
var hists = await query.ToListAsync(cancel);
|
var hists = await query.ToListAsync(cancel);
|
||||||
return _mapper.Map<IEnumerable<EnvelopeHistoryDto>>(hists);
|
return _mapper.Map<List<HistoryDto>>(hists);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,6 +6,6 @@ namespace EnvelopeGenerator.Application.Interfaces.Repositories;
|
|||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Obsolete("Use IRepository")]
|
[Obsolete("Use IRepository")]
|
||||||
public interface IDocumentReceiverElementRepository : ICRUDRepository<DocumentReceiverElement, int>
|
public interface IDocumentReceiverElementRepository : ICRUDRepository<Signature, int>
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -7,6 +7,6 @@ namespace EnvelopeGenerator.Application.Interfaces.Repositories;
|
|||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Obsolete("Use IRepository")]
|
[Obsolete("Use IRepository")]
|
||||||
public interface IEnvelopeDocumentRepository : ICRUDRepository<EnvelopeDocument, int>
|
public interface IEnvelopeDocumentRepository : ICRUDRepository<Document, int>
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ namespace EnvelopeGenerator.Application.Interfaces.Repositories;
|
|||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Obsolete("Use IRepository")]
|
[Obsolete("Use IRepository")]
|
||||||
public interface IEnvelopeHistoryRepository : ICRUDRepository<EnvelopeHistory, long>
|
public interface IEnvelopeHistoryRepository : ICRUDRepository<History, long>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -28,5 +28,5 @@ public interface IEnvelopeHistoryRepository : ICRUDRepository<EnvelopeHistory, l
|
|||||||
/// <param name="withSender"></param>
|
/// <param name="withSender"></param>
|
||||||
/// <param name="withReceiver"></param>
|
/// <param name="withReceiver"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<IEnumerable<EnvelopeHistory>> ReadAsync(int? envelopeId = null, string? userReference = null, EnvelopeStatus? status = null, bool withSender = false, bool withReceiver = false);
|
Task<IEnumerable<History>> ReadAsync(int? envelopeId = null, string? userReference = null, EnvelopeStatus? status = null, bool withSender = false, bool withReceiver = false);
|
||||||
}
|
}
|
||||||
@@ -14,5 +14,5 @@ public interface IDocumentExecutor
|
|||||||
/// <param name="envelope_uuid"></param>
|
/// <param name="envelope_uuid"></param>
|
||||||
/// <param name="cancellation"></param>
|
/// <param name="cancellation"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<EnvelopeDocument> CreateDocumentAsync(string base64, string envelope_uuid, CancellationToken cancellation = default);
|
Task<Document> CreateDocumentAsync(string base64, string envelope_uuid, CancellationToken cancellation = default);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using DigitalData.Core.Abstraction.Application;
|
using DigitalData.Core.Abstraction.Application;
|
||||||
using DigitalData.Core.Abstraction.Application.DTO;
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
using EnvelopeGenerator.Application.Dto;
|
using EnvelopeGenerator.Application.Common.Dto;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Interfaces.Services;
|
namespace EnvelopeGenerator.Application.Interfaces.Services;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
using DigitalData.Core.Abstraction.Application;
|
using DigitalData.Core.Abstraction.Application;
|
||||||
using EnvelopeGenerator.Application.Dto;
|
using EnvelopeGenerator.Application.Common.Dto;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Interfaces.Services;
|
namespace EnvelopeGenerator.Application.Interfaces.Services;
|
||||||
@@ -8,6 +8,6 @@ namespace EnvelopeGenerator.Application.Interfaces.Services;
|
|||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Obsolete("Use MediatR")]
|
[Obsolete("Use MediatR")]
|
||||||
public interface IDocumentReceiverElementService : IBasicCRUDService<DocumentReceiverElementDto, DocumentReceiverElement, int>
|
public interface IDocumentReceiverElementService : IBasicCRUDService<SignatureDto, Signature, int>
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
using DigitalData.Core.Abstraction.Application;
|
using DigitalData.Core.Abstraction.Application;
|
||||||
using EnvelopeGenerator.Application.Dto;
|
using EnvelopeGenerator.Application.Common.Dto;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
namespace EnvelopeGenerator.Application.Interfaces.Services;
|
namespace EnvelopeGenerator.Application.Interfaces.Services;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using DigitalData.Core.Abstraction.Application;
|
using DigitalData.Core.Abstraction.Application;
|
||||||
using DigitalData.Core.Abstraction.Application.DTO;
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
using EnvelopeGenerator.Application.Dto;
|
using EnvelopeGenerator.Application.Common.Dto;
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
using DigitalData.Core.Abstraction.Application;
|
using DigitalData.Core.Abstraction.Application;
|
||||||
using EnvelopeGenerator.Application.Dto;
|
using EnvelopeGenerator.Application.Common.Dto;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Interfaces.Services;
|
namespace EnvelopeGenerator.Application.Interfaces.Services;
|
||||||
@@ -8,6 +8,6 @@ namespace EnvelopeGenerator.Application.Interfaces.Services;
|
|||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Obsolete("Use MediatR")]
|
[Obsolete("Use MediatR")]
|
||||||
public interface IEnvelopeDocumentService : IBasicCRUDService<EnvelopeDocumentDto, EnvelopeDocument, int>
|
public interface IEnvelopeDocumentService : IBasicCRUDService<DocumentDto, Document, int>
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using DigitalData.Core.Abstraction.Application;
|
using DigitalData.Core.Abstraction.Application;
|
||||||
using DigitalData.Core.Abstraction.Application.DTO;
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
using EnvelopeGenerator.Application.Dto.EnvelopeHistory;
|
using EnvelopeGenerator.Application.Common.Dto.History;
|
||||||
using EnvelopeGenerator.Application.Dto.Receiver;
|
using EnvelopeGenerator.Application.Common.Dto.Receiver;
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
@@ -11,7 +11,7 @@ namespace EnvelopeGenerator.Application.Interfaces.Services;
|
|||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Obsolete("Use MediatR")]
|
[Obsolete("Use MediatR")]
|
||||||
public interface IEnvelopeHistoryService : ICRUDService<EnvelopeHistoryCreateDto, EnvelopeHistoryDto, EnvelopeHistory, long>
|
public interface IEnvelopeHistoryService : ICRUDService<HistoryCreateDto, HistoryDto, History, long>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -56,7 +56,7 @@ public interface IEnvelopeHistoryService : ICRUDService<EnvelopeHistoryCreateDto
|
|||||||
/// <param name="withSender"></param>
|
/// <param name="withSender"></param>
|
||||||
/// <param name="withReceiver"></param>
|
/// <param name="withReceiver"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<IEnumerable<EnvelopeHistoryDto>> ReadAsync(int? envelopeId = null, string? userReference = null, ReferenceType? referenceType = null, EnvelopeStatus? status = null, bool withSender = false, bool withReceiver = false);
|
Task<IEnumerable<HistoryDto>> ReadAsync(int? envelopeId = null, string? userReference = null, ReferenceType? referenceType = null, EnvelopeStatus? status = null, bool withSender = false, bool withReceiver = false);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -64,14 +64,14 @@ public interface IEnvelopeHistoryService : ICRUDService<EnvelopeHistoryCreateDto
|
|||||||
/// <param name="envelopeId"></param>
|
/// <param name="envelopeId"></param>
|
||||||
/// <param name="userReference"></param>
|
/// <param name="userReference"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<IEnumerable<EnvelopeHistoryDto>> ReadRejectedAsync(int envelopeId, string? userReference = null);
|
Task<IEnumerable<HistoryDto>> ReadRejectedAsync(int envelopeId, string? userReference = null);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="envelopeId"></param>
|
/// <param name="envelopeId"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<IEnumerable<ReceiverReadDto>> ReadRejectingReceivers(int envelopeId);
|
Task<IEnumerable<ReceiverDto>> ReadRejectingReceivers(int envelopeId);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using DigitalData.Core.Abstraction.Application.DTO;
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
using DigitalData.EmailProfilerDispatcher.Abstraction.Contracts;
|
using DigitalData.EmailProfilerDispatcher.Abstraction.Contracts;
|
||||||
using EnvelopeGenerator.Application.Dto.EnvelopeReceiver;
|
using EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver;
|
||||||
using EnvelopeGenerator.Application.Dto.EnvelopeReceiverReadOnly;
|
using EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiverReadOnly;
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Interfaces.Services;
|
namespace EnvelopeGenerator.Application.Interfaces.Services;
|
||||||
@@ -35,11 +35,4 @@ public interface IEnvelopeMailService : IEmailOutService
|
|||||||
/// <param name="envelopeReceiverDto"></param>
|
/// <param name="envelopeReceiverDto"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<DataResult<int>> SendAccessCodeAsync(EnvelopeReceiverDto envelopeReceiverDto);
|
Task<DataResult<int>> SendAccessCodeAsync(EnvelopeReceiverDto envelopeReceiverDto);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="envelopeReceiverDto"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<DataResult<int>> SendTFAQrCodeAsync(EnvelopeReceiverDto envelopeReceiverDto);
|
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
using DigitalData.Core.Abstraction.Application;
|
using DigitalData.Core.Abstraction.Application;
|
||||||
using EnvelopeGenerator.Application.Dto.EnvelopeReceiverReadOnly;
|
using EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiverReadOnly;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Interfaces.Services;
|
namespace EnvelopeGenerator.Application.Interfaces.Services;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
using CommandDotNet;
|
using CommandDotNet;
|
||||||
using DigitalData.Core.Abstraction.Application;
|
using DigitalData.Core.Abstraction.Application;
|
||||||
using DigitalData.Core.Abstraction.Application.DTO;
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
using EnvelopeGenerator.Application.Dto.EnvelopeReceiver;
|
using EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver;
|
||||||
using EnvelopeGenerator.Application.Dto.Messaging;
|
using EnvelopeGenerator.Application.Common.Dto.Messaging;
|
||||||
using EnvelopeGenerator.Application.Envelopes;
|
using EnvelopeGenerator.Application.Envelopes;
|
||||||
using EnvelopeGenerator.Application.Envelopes.Queries;
|
using EnvelopeGenerator.Application.Envelopes.Queries;
|
||||||
using EnvelopeGenerator.Application.Receivers.Queries;
|
using EnvelopeGenerator.Application.Receivers.Queries;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using DigitalData.Core.Abstraction.Application;
|
using DigitalData.Core.Abstraction.Application;
|
||||||
using DigitalData.Core.Abstraction.Application.DTO;
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
using EnvelopeGenerator.Application.Dto;
|
using EnvelopeGenerator.Application.Common.Dto;
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
using EnvelopeGenerator.Application.Dto.EnvelopeReceiver;
|
using EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver;
|
||||||
using EnvelopeGenerator.Application.Dto.Messaging;
|
using EnvelopeGenerator.Application.Common.Dto.Messaging;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Interfaces.Services;
|
namespace EnvelopeGenerator.Application.Interfaces.Services;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
using DigitalData.Core.Abstraction.Application;
|
using DigitalData.Core.Abstraction.Application;
|
||||||
using EnvelopeGenerator.Application.Dto;
|
using EnvelopeGenerator.Application.Common.Dto;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Interfaces.Services;
|
namespace EnvelopeGenerator.Application.Interfaces.Services;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using DigitalData.Core.Abstraction.Application;
|
using DigitalData.Core.Abstraction.Application;
|
||||||
using DigitalData.Core.Abstraction.Application.DTO;
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
using EnvelopeGenerator.Application.Dto.Receiver;
|
using EnvelopeGenerator.Application.Common.Dto.Receiver;
|
||||||
using EnvelopeGenerator.Application.Receivers.Commands;
|
using EnvelopeGenerator.Application.Receivers.Commands;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
@@ -10,7 +10,7 @@ namespace EnvelopeGenerator.Application.Interfaces.Services;
|
|||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Obsolete("Use MediatR")]
|
[Obsolete("Use MediatR")]
|
||||||
public interface IReceiverService : ICRUDService<CreateReceiverCommand, ReceiverReadDto, Receiver, int>
|
public interface IReceiverService : ICRUDService<CreateReceiverCommand, ReceiverDto, Receiver, int>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -18,7 +18,7 @@ public interface IReceiverService : ICRUDService<CreateReceiverCommand, Receiver
|
|||||||
/// <param name="emailAddress"></param>
|
/// <param name="emailAddress"></param>
|
||||||
/// <param name="signature"></param>
|
/// <param name="signature"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<DataResult<ReceiverReadDto>> ReadByAsync(string? emailAddress = null, string? signature = null);
|
Task<DataResult<ReceiverDto>> ReadByAsync(string? emailAddress = null, string? signature = null);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using EnvelopeGenerator.Application.Dto.Messaging;
|
using EnvelopeGenerator.Application.Common.Dto.Messaging;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Interfaces.Services;
|
namespace EnvelopeGenerator.Application.Interfaces.Services;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using DigitalData.Core.Abstraction.Application.Repository;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using EnvelopeGenerator.Application.Dto.Receiver;
|
using EnvelopeGenerator.Application.Common.Dto.Receiver;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
@@ -15,7 +15,7 @@ namespace EnvelopeGenerator.Application.Receivers.Commands;
|
|||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
public record CreateReceiverCommand : IRequest<(ReceiverReadDto Receiver, bool AlreadyExists)>
|
public record CreateReceiverCommand : IRequest<(ReceiverDto Receiver, bool AlreadyExists)>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -54,7 +54,7 @@ public record CreateReceiverCommand : IRequest<(ReceiverReadDto Receiver, bool A
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class CreateReceiverCommandHandler : IRequestHandler<CreateReceiverCommand, (ReceiverReadDto Receiver, bool AlreadyExists)>
|
public class CreateReceiverCommandHandler : IRequestHandler<CreateReceiverCommand, (ReceiverDto Receiver, bool AlreadyExists)>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -79,7 +79,7 @@ public class CreateReceiverCommandHandler : IRequestHandler<CreateReceiverComman
|
|||||||
/// <param name="request"></param>
|
/// <param name="request"></param>
|
||||||
/// <param name="cancel"></param>
|
/// <param name="cancel"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<(ReceiverReadDto Receiver, bool AlreadyExists)> Handle(CreateReceiverCommand request, CancellationToken cancel)
|
public async Task<(ReceiverDto Receiver, bool AlreadyExists)> Handle(CreateReceiverCommand request, CancellationToken cancel)
|
||||||
{
|
{
|
||||||
var receiver = await _repo.ReadOnly()
|
var receiver = await _repo.ReadOnly()
|
||||||
.Where(r => r.EmailAddress == request.EmailAddress)
|
.Where(r => r.EmailAddress == request.EmailAddress)
|
||||||
@@ -90,7 +90,7 @@ public class CreateReceiverCommandHandler : IRequestHandler<CreateReceiverComman
|
|||||||
if (!alreadyExists)
|
if (!alreadyExists)
|
||||||
receiver = await _repo.CreateAsync(request, cancel);
|
receiver = await _repo.CreateAsync(request, cancel);
|
||||||
|
|
||||||
var receiverDto = _mapper.Map<ReceiverReadDto>(receiver);
|
var receiverDto = _mapper.Map<ReceiverDto>(receiver);
|
||||||
return (receiverDto, alreadyExists);
|
return (receiverDto, alreadyExists);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
using EnvelopeGenerator.Application.Model;
|
using EnvelopeGenerator.Application.Common.Query;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Receivers.Queries;
|
namespace EnvelopeGenerator.Application.Receivers.Queries;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using Microsoft.Extensions.Localization;
|
using Microsoft.Extensions.Localization;
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Resources;
|
namespace EnvelopeGenerator.Application.Resources;
|
||||||
|
|
||||||
@@ -328,39 +327,39 @@ public static class Extensions
|
|||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="localizer"></param>
|
/// <param name="localizer"></param>
|
||||||
/// <param name="arg0"></param>
|
/// <param name="suffix"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static string LockedTitle(this IStringLocalizer localizer, object? arg0) => string.Format(localizer[nameof(Privacy)].Value, arg0);
|
public static string LockedTitle(this IStringLocalizer localizer, string suffix) => localizer[nameof(LockedTitle) + suffix].Value;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="localizer"></param>
|
/// <param name="localizer"></param>
|
||||||
/// <param name="arg0"></param>
|
/// <param name="suffix"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static string LockedBody(this IStringLocalizer localizer, object? arg0) => string.Format(localizer[nameof(LockedBody)].Value, arg0);
|
public static string LockedBody(this IStringLocalizer localizer, string suffix) => localizer[nameof(LockedBody) + suffix].Value;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="localizer"></param>
|
/// <param name="localizer"></param>
|
||||||
/// <param name="arg0"></param>
|
/// <param name="suffix"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static string LockedCodeLabel(this IStringLocalizer localizer, object? arg0) => string.Format(localizer[nameof(LockedCodeLabel)].Value, arg0);
|
public static string LockedCodeLabel(this IStringLocalizer localizer, string suffix) => localizer[nameof(LockedCodeLabel) + suffix].Value;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="localizer"></param>
|
/// <param name="localizer"></param>
|
||||||
/// <param name="arg0"></param>
|
/// <param name="suffix"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static string LockedFooterTitle(this IStringLocalizer localizer, object? arg0) => string.Format(localizer[nameof(LockedFooterTitle)].Value, arg0);
|
public static string LockedFooterTitle(this IStringLocalizer localizer, string suffix) => localizer[nameof(LockedFooterTitle) + suffix].Value;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="localizer"></param>
|
/// <param name="localizer"></param>
|
||||||
/// <param name="arg0"></param>
|
/// <param name="suffix"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static string LockedFooterBody(this IStringLocalizer localizer, object? arg0) => string.Format(localizer[nameof(LockedFooterBody)].Value, arg0);
|
public static string LockedFooterBody(this IStringLocalizer localizer, string suffix) => localizer[nameof(LockedFooterBody) + suffix].Value;
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
using EnvelopeGenerator.Application.Configurations;
|
using EnvelopeGenerator.Application.Common.Configurations;
|
||||||
using EnvelopeGenerator.Application.Interfaces.Services;
|
using EnvelopeGenerator.Application.Interfaces.Services;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
using OtpNet;
|
using OtpNet;
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
using DigitalData.Core.Application;
|
using DigitalData.Core.Application;
|
||||||
using DigitalData.Core.Abstraction.Application.DTO;
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
using EnvelopeGenerator.Application.Interfaces.Services;
|
using EnvelopeGenerator.Application.Interfaces.Services;
|
||||||
using EnvelopeGenerator.Application.Dto;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using EnvelopeGenerator.Application.Interfaces.Repositories;
|
using EnvelopeGenerator.Application.Interfaces.Repositories;
|
||||||
using Microsoft.Extensions.Caching.Memory;
|
using Microsoft.Extensions.Caching.Memory;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
using EnvelopeGenerator.Application.Common.Dto;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Services;
|
namespace EnvelopeGenerator.Application.Services;
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using DigitalData.Core.Application;
|
using DigitalData.Core.Application;
|
||||||
using EnvelopeGenerator.Application.Interfaces.Services;
|
using EnvelopeGenerator.Application.Interfaces.Services;
|
||||||
using EnvelopeGenerator.Application.Dto;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using EnvelopeGenerator.Application.Interfaces.Repositories;
|
using EnvelopeGenerator.Application.Interfaces.Repositories;
|
||||||
|
using EnvelopeGenerator.Application.Common.Dto;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Services;
|
namespace EnvelopeGenerator.Application.Services;
|
||||||
|
|
||||||
@@ -11,7 +11,7 @@ namespace EnvelopeGenerator.Application.Services;
|
|||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Obsolete("Use MediatR")]
|
[Obsolete("Use MediatR")]
|
||||||
public class DocumentReceiverElementService : BasicCRUDService<IDocumentReceiverElementRepository, DocumentReceiverElementDto, DocumentReceiverElement, int>, IDocumentReceiverElementService
|
public class DocumentReceiverElementService : BasicCRUDService<IDocumentReceiverElementRepository, SignatureDto, Signature, int>, IDocumentReceiverElementService
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using DigitalData.Core.Application;
|
using DigitalData.Core.Application;
|
||||||
using EnvelopeGenerator.Application.Interfaces.Services;
|
using EnvelopeGenerator.Application.Interfaces.Services;
|
||||||
using EnvelopeGenerator.Application.Dto;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using EnvelopeGenerator.Application.Interfaces.Repositories;
|
using EnvelopeGenerator.Application.Interfaces.Repositories;
|
||||||
|
using EnvelopeGenerator.Application.Common.Dto;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Services;
|
namespace EnvelopeGenerator.Application.Services;
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using DigitalData.Core.Application;
|
using DigitalData.Core.Application;
|
||||||
using EnvelopeGenerator.Application.Dto;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using EnvelopeGenerator.Application.Interfaces.Repositories;
|
using EnvelopeGenerator.Application.Interfaces.Repositories;
|
||||||
using DigitalData.Core.Abstraction.Application.DTO;
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using EnvelopeGenerator.Application.Interfaces.Services;
|
using EnvelopeGenerator.Application.Interfaces.Services;
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
using EnvelopeGenerator.Application.Common.Dto;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Services;
|
namespace EnvelopeGenerator.Application.Services;
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using DigitalData.Core.Application;
|
using DigitalData.Core.Application;
|
||||||
using EnvelopeGenerator.Application.Interfaces.Services;
|
using EnvelopeGenerator.Application.Interfaces.Services;
|
||||||
using EnvelopeGenerator.Application.Dto;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using EnvelopeGenerator.Application.Interfaces.Repositories;
|
using EnvelopeGenerator.Application.Interfaces.Repositories;
|
||||||
|
using EnvelopeGenerator.Application.Common.Dto;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Services;
|
namespace EnvelopeGenerator.Application.Services;
|
||||||
|
|
||||||
@@ -11,7 +11,7 @@ namespace EnvelopeGenerator.Application.Services;
|
|||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Obsolete("Use MediatR")]
|
[Obsolete("Use MediatR")]
|
||||||
public class EnvelopeDocumentService : BasicCRUDService<IEnvelopeDocumentRepository, EnvelopeDocumentDto, EnvelopeDocument, int>, IEnvelopeDocumentService
|
public class EnvelopeDocumentService : BasicCRUDService<IEnvelopeDocumentRepository, DocumentDto, Document, int>, IEnvelopeDocumentService
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
using DigitalData.Core.Application;
|
using DigitalData.Core.Application;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using EnvelopeGenerator.Application.Interfaces.Repositories;
|
using EnvelopeGenerator.Application.Interfaces.Repositories;
|
||||||
using EnvelopeGenerator.Application.Dto.EnvelopeHistory;
|
|
||||||
using EnvelopeGenerator.Application.Dto.Receiver;
|
|
||||||
using EnvelopeGenerator.Application.Interfaces.Services;
|
using EnvelopeGenerator.Application.Interfaces.Services;
|
||||||
using DigitalData.Core.Abstraction.Application.DTO;
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
using EnvelopeGenerator.Application.Common.Dto.History;
|
||||||
|
using EnvelopeGenerator.Application.Common.Dto.Receiver;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Services;
|
namespace EnvelopeGenerator.Application.Services;
|
||||||
|
|
||||||
@@ -14,7 +14,7 @@ namespace EnvelopeGenerator.Application.Services;
|
|||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Obsolete("Use MediatR")]
|
[Obsolete("Use MediatR")]
|
||||||
public class EnvelopeHistoryService : CRUDService<IEnvelopeHistoryRepository, EnvelopeHistoryCreateDto, EnvelopeHistoryDto, EnvelopeHistory, long>, IEnvelopeHistoryService
|
public class EnvelopeHistoryService : CRUDService<IEnvelopeHistoryRepository, HistoryCreateDto, HistoryDto, History, long>, IEnvelopeHistoryService
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -94,9 +94,9 @@ public class EnvelopeHistoryService : CRUDService<IEnvelopeHistoryRepository, En
|
|||||||
/// <param name="withSender"></param>
|
/// <param name="withSender"></param>
|
||||||
/// <param name="withReceiver"></param>
|
/// <param name="withReceiver"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<IEnumerable<EnvelopeHistoryDto>> ReadAsync(int? envelopeId = null, string? userReference = null, ReferenceType? referenceType = null, EnvelopeStatus? status = null, bool withSender = false, bool withReceiver = false)
|
public async Task<IEnumerable<HistoryDto>> ReadAsync(int? envelopeId = null, string? userReference = null, ReferenceType? referenceType = null, EnvelopeStatus? status = null, bool withSender = false, bool withReceiver = false)
|
||||||
{
|
{
|
||||||
var histDTOs = _mapper.Map<IEnumerable<EnvelopeHistoryDto>>(
|
var histDTOs = _mapper.Map<IEnumerable<HistoryDto>>(
|
||||||
await _repository.ReadAsync(
|
await _repository.ReadAsync(
|
||||||
envelopeId: envelopeId,
|
envelopeId: envelopeId,
|
||||||
userReference: userReference,
|
userReference: userReference,
|
||||||
@@ -112,7 +112,7 @@ public class EnvelopeHistoryService : CRUDService<IEnvelopeHistoryRepository, En
|
|||||||
/// <param name="envelopeId"></param>
|
/// <param name="envelopeId"></param>
|
||||||
/// <param name="userReference"></param>
|
/// <param name="userReference"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<IEnumerable<EnvelopeHistoryDto>> ReadRejectedAsync(int envelopeId, string? userReference = null) =>
|
public async Task<IEnumerable<HistoryDto>> ReadRejectedAsync(int envelopeId, string? userReference = null) =>
|
||||||
await ReadAsync(envelopeId: envelopeId, userReference: userReference, status: EnvelopeStatus.DocumentRejected, withReceiver:true);
|
await ReadAsync(envelopeId: envelopeId, userReference: userReference, status: EnvelopeStatus.DocumentRejected, withReceiver:true);
|
||||||
|
|
||||||
//TODO: use IQueryable in repository to incerease the performance
|
//TODO: use IQueryable in repository to incerease the performance
|
||||||
@@ -121,11 +121,11 @@ public class EnvelopeHistoryService : CRUDService<IEnvelopeHistoryRepository, En
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="envelopeId"></param>
|
/// <param name="envelopeId"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<IEnumerable<ReceiverReadDto>> ReadRejectingReceivers(int envelopeId)
|
public async Task<IEnumerable<ReceiverDto>> ReadRejectingReceivers(int envelopeId)
|
||||||
{
|
{
|
||||||
var envelopes = await ReadRejectedAsync(envelopeId);
|
var envelopes = await ReadRejectedAsync(envelopeId);
|
||||||
return envelopes is null
|
return envelopes is null
|
||||||
? Enumerable.Empty<ReceiverReadDto>()
|
? Enumerable.Empty<ReceiverDto>()
|
||||||
: envelopes
|
: envelopes
|
||||||
.Where(eh => eh?.Receiver != null)
|
.Where(eh => eh?.Receiver != null)
|
||||||
.Select(eh => eh.Receiver!);
|
.Select(eh => eh.Receiver!);
|
||||||
|
|||||||
@@ -2,16 +2,16 @@
|
|||||||
using DigitalData.EmailProfilerDispatcher.Abstraction.Contracts;
|
using DigitalData.EmailProfilerDispatcher.Abstraction.Contracts;
|
||||||
using DigitalData.EmailProfilerDispatcher.Abstraction.DTOs.EmailOut;
|
using DigitalData.EmailProfilerDispatcher.Abstraction.DTOs.EmailOut;
|
||||||
using DigitalData.EmailProfilerDispatcher.Abstraction.Services;
|
using DigitalData.EmailProfilerDispatcher.Abstraction.Services;
|
||||||
using EnvelopeGenerator.Application.Dto.EnvelopeReceiver;
|
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
using EnvelopeGenerator.Application.Extensions;
|
|
||||||
using EnvelopeGenerator.Application.Dto.EnvelopeReceiverReadOnly;
|
|
||||||
using EnvelopeGenerator.Application.Configurations;
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using EnvelopeGenerator.Application.Interfaces.Services;
|
using EnvelopeGenerator.Application.Interfaces.Services;
|
||||||
using DigitalData.Core.Abstraction.Application.DTO;
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
using EnvelopeGenerator.Application.Common.Configurations;
|
||||||
|
using EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver;
|
||||||
|
using EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiverReadOnly;
|
||||||
|
using EnvelopeGenerator.Application.Common.Extensions;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Services;
|
namespace EnvelopeGenerator.Application.Services;
|
||||||
|
|
||||||
@@ -181,31 +181,10 @@ public async Task<DataResult<int>> SendAsync(EnvelopeReceiverReadOnlyDto dto, Di
|
|||||||
return await CreateWithTemplateAsync(createDto: mail, placeholders: placeholders, dto.Envelope);
|
return await CreateWithTemplateAsync(createDto: mail, placeholders: placeholders, dto.Envelope);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="dto"></param>
|
/// <param name="dto"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<DataResult<int>> SendAccessCodeAsync(EnvelopeReceiverDto dto) => await SendAsync(dto: dto, tempType: EmailTemplateType.DocumentAccessCodeReceived);
|
public async Task<DataResult<int>> SendAccessCodeAsync(EnvelopeReceiverDto dto) => await SendAsync(dto: dto, tempType: EmailTemplateType.DocumentAccessCodeReceived);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="dto"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
/// <exception cref="ArgumentNullException"></exception>
|
|
||||||
public Task<DataResult<int>> SendTFAQrCodeAsync(EnvelopeReceiverDto dto)
|
|
||||||
{
|
|
||||||
// Check if receiver or secret key is null
|
|
||||||
if (dto.Receiver is null)
|
|
||||||
throw new ArgumentNullException(nameof(dto), $"TFA Qr Code cannot sent. Receiver information is missing. Envelope receiver dto is {JsonConvert.SerializeObject(dto)}");
|
|
||||||
if (dto.Receiver.TotpSecretkey is null)
|
|
||||||
throw new ArgumentNullException(nameof(dto), $"TFA Qr Code cannot sent. Receiver.TotpSecretKey is null. Envelope receiver dto is {JsonConvert.SerializeObject(dto)}");
|
|
||||||
|
|
||||||
var totp_qr_64 = _authenticator.GenerateTotpQrCode(userEmail: dto.Receiver.EmailAddress, secretKey: dto.Receiver.TotpSecretkey).ToBase64String();
|
|
||||||
return SendAsync(dto, EmailTemplateType.TotpSecret, new()
|
|
||||||
{
|
|
||||||
{"[TFA_QR_CODE]", totp_qr_64 },
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using DigitalData.Core.Application;
|
using DigitalData.Core.Application;
|
||||||
using EnvelopeGenerator.Application.Interfaces.Services;
|
using EnvelopeGenerator.Application.Interfaces.Services;
|
||||||
using EnvelopeGenerator.Application.Dto.EnvelopeReceiverReadOnly;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using EnvelopeGenerator.Application.Interfaces.Repositories;
|
using EnvelopeGenerator.Application.Interfaces.Repositories;
|
||||||
|
using EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiverReadOnly;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Services;
|
namespace EnvelopeGenerator.Application.Services;
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +1,19 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using DigitalData.Core.Application;
|
using DigitalData.Core.Application;
|
||||||
using DigitalData.Core.Abstraction.Application.DTO;
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
using EnvelopeGenerator.Application.Dto.EnvelopeReceiver;
|
|
||||||
using EnvelopeGenerator.Application.Resources;
|
using EnvelopeGenerator.Application.Resources;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using EnvelopeGenerator.Application.Interfaces.Repositories;
|
using EnvelopeGenerator.Application.Interfaces.Repositories;
|
||||||
using Microsoft.Extensions.Localization;
|
using Microsoft.Extensions.Localization;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using EnvelopeGenerator.Application.Extensions;
|
using EnvelopeGenerator.Application.Common.Extensions;
|
||||||
using EnvelopeGenerator.Application.Dto.Messaging;
|
|
||||||
using EnvelopeGenerator.Application.Interfaces.Services;
|
using EnvelopeGenerator.Application.Interfaces.Services;
|
||||||
using EnvelopeGenerator.Application.Envelopes.Queries;
|
using EnvelopeGenerator.Application.Envelopes.Queries;
|
||||||
using EnvelopeGenerator.Application.Receivers.Queries;
|
using EnvelopeGenerator.Application.Receivers.Queries;
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
using EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver;
|
||||||
|
using EnvelopeGenerator.Application.Common.Dto.Messaging;
|
||||||
|
using EnvelopeGenerator.Application.Common;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Services;
|
namespace EnvelopeGenerator.Application.Services;
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user