Compare commits
3 Commits
c479ea4179
...
feat/signF
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c9cb3f6aa8 | ||
|
|
4b3c5907ae | ||
| cce240125d |
@@ -23,5 +23,5 @@ public class DispatcherParams
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Default value is string.Empty
|
/// Default value is string.Empty
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string? EmailAttmt1 { get; init; } = null;
|
public string EmailAttmt1 { get; init; } = string.Empty;
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using DigitalData.Core.Abstraction.Application.Repository;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Interfaces.Repositories;
|
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using DigitalData.Core.Abstraction.Application.Repository;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Interfaces.Repositories;
|
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using DigitalData.Core.Abstraction.Application.Repository;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Interfaces.Repositories;
|
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
using DigitalData.Core.Abstraction.Application.Repository;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
using static EnvelopeGenerator.Domain.Constants;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Interfaces.Repositories;
|
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete("Use Read-method returning IReadQuery<TEntity> instead.")]
|
||||||
|
public interface IEnvelopeCertificateRepository : ICRUDRepository<EnvelopeCertificate, int>
|
||||||
|
{
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using DigitalData.Core.Abstraction.Application.Repository;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Interfaces.Repositories;
|
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
using DigitalData.Core.Abstraction.Application.Repository;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
using EnvelopeGenerator.Domain;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Interfaces.Repositories;
|
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -17,7 +17,7 @@ public interface IEnvelopeHistoryRepository : ICRUDRepository<EnvelopeHistory, l
|
|||||||
/// <param name="userReference"></param>
|
/// <param name="userReference"></param>
|
||||||
/// <param name="status"></param>
|
/// <param name="status"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<int> CountAsync(int? envelopeId = null, string? userReference = null, EnvelopeStatus? status = null);
|
Task<int> CountAsync(int? envelopeId = null, string? userReference = null, Constants.EnvelopeStatus? status = null);
|
||||||
|
|
||||||
/// <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<EnvelopeHistory>> ReadAsync(int? envelopeId = null, string? userReference = null, Constants.EnvelopeStatus? status = null, bool withSender = false, bool withReceiver = false);
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using DigitalData.Core.Abstraction.Application.Repository;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Interfaces.Repositories;
|
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,9 +1,7 @@
|
|||||||
using DigitalData.Core.Abstraction.Application.Repository;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using EnvelopeGenerator.Application.Envelopes.Queries;
|
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Interfaces.Repositories;
|
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -85,7 +83,7 @@ public interface IEnvelopeReceiverRepository : ICRUDRepository<EnvelopeReceiver,
|
|||||||
/// <param name="max_status"></param>
|
/// <param name="max_status"></param>
|
||||||
/// <param name="ignore_statuses"></param>
|
/// <param name="ignore_statuses"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<IEnumerable<EnvelopeReceiver>> ReadByUsernameAsync(string username, EnvelopeStatus? min_status = null, EnvelopeStatus? max_status = null, params EnvelopeStatus[] ignore_statuses);
|
Task<IEnumerable<EnvelopeReceiver>> ReadByUsernameAsync(string username, int? min_status = null, int? max_status = null, params int[] ignore_statuses);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
using DigitalData.Core.Abstraction.Application.Repository;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Interfaces.Repositories;
|
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -39,5 +38,5 @@ public interface IEnvelopeRepository : ICRUDRepository<Envelope, int>
|
|||||||
/// <param name="max_status"></param>
|
/// <param name="max_status"></param>
|
||||||
/// <param name="ignore_statuses"></param>
|
/// <param name="ignore_statuses"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<IEnumerable<Envelope>> ReadByUserAsync(int userId, EnvelopeStatus? min_status = null, EnvelopeStatus? max_status = null, params EnvelopeStatus[] ignore_statuses);
|
Task<IEnumerable<Envelope>> ReadByUserAsync(int userId, int? min_status = null, int? max_status = null, params int[] ignore_statuses);
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using DigitalData.Core.Abstraction.Application.Repository;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Interfaces.Repositories;
|
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using DigitalData.Core.Abstraction.Application.Repository;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Interfaces.Repositories;
|
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Interfaces.SQLExecutor;
|
namespace EnvelopeGenerator.Application.Contracts.SQLExecutor;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using Dapper;
|
using Dapper;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Interfaces.SQLExecutor;
|
namespace EnvelopeGenerator.Application.Contracts.SQLExecutor;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Interfaces.SQLExecutor;
|
namespace EnvelopeGenerator.Application.Contracts.SQLExecutor;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace EnvelopeGenerator.Application.Interfaces.SQLExecutor;
|
namespace EnvelopeGenerator.Application.Contracts.SQLExecutor;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Provides methods for executing common queries on a given entity type.
|
/// Provides methods for executing common queries on a given entity type.
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace EnvelopeGenerator.Application.Interfaces.SQLExecutor;
|
namespace EnvelopeGenerator.Application.Contracts.SQLExecutor;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a raw SQL query contract.
|
/// Represents a raw SQL query contract.
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace EnvelopeGenerator.Application.Interfaces.SQLExecutor;
|
namespace EnvelopeGenerator.Application.Contracts.SQLExecutor;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Defines methods for executing raw SQL queries or custom SQL query classes and returning query executors for further operations.
|
/// Defines methods for executing raw SQL queries or custom SQL query classes and returning query executors for further operations.
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using Dapper;
|
using Dapper;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Interfaces.SQLExecutor;
|
namespace EnvelopeGenerator.Application.Contracts.SQLExecutor;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using OtpNet;
|
using OtpNet;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Interfaces.Services;
|
namespace EnvelopeGenerator.Application.Contracts.Services;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
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.DTOs;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Interfaces.Services;
|
namespace EnvelopeGenerator.Application.Contracts.Services;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
using DigitalData.Core.Abstraction.Application;
|
using DigitalData.Core.Abstraction.Application;
|
||||||
using EnvelopeGenerator.Application.Dto;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Interfaces.Services;
|
namespace EnvelopeGenerator.Application.Contracts.Services;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using DigitalData.Core.Abstraction.Application;
|
using DigitalData.Core.Abstraction.Application;
|
||||||
using EnvelopeGenerator.Application.Dto;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
namespace EnvelopeGenerator.Application.Interfaces.Services;
|
namespace EnvelopeGenerator.Application.Contracts.Services;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
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.DTOs;
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
using static EnvelopeGenerator.Domain.Constants;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Interfaces.Services;
|
namespace EnvelopeGenerator.Application.Contracts.Services;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
using DigitalData.Core.Abstraction.Application;
|
||||||
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Contracts.Services;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
|
public interface IEnvelopeCertificateService : IBasicCRUDService<EnvelopeCertificateDto, EnvelopeCertificate, int>
|
||||||
|
{
|
||||||
|
}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
using DigitalData.Core.Abstraction.Application;
|
using DigitalData.Core.Abstraction.Application;
|
||||||
using EnvelopeGenerator.Application.Dto;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Interfaces.Services;
|
namespace EnvelopeGenerator.Application.Contracts.Services;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
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.DTOs.EnvelopeHistory;
|
||||||
using EnvelopeGenerator.Application.Dto.Receiver;
|
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
using static EnvelopeGenerator.Domain.Constants;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Interfaces.Services;
|
namespace EnvelopeGenerator.Application.Contracts.Services;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
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.DTOs.EnvelopeReceiver;
|
||||||
using EnvelopeGenerator.Application.Dto.EnvelopeReceiverReadOnly;
|
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
using EnvelopeGenerator.Domain;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Interfaces.Services;
|
namespace EnvelopeGenerator.Application.Contracts.Services;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -19,7 +19,7 @@ public interface IEnvelopeMailService : IEmailOutService
|
|||||||
/// <param name="tempType"></param>
|
/// <param name="tempType"></param>
|
||||||
/// <param name="optionalPlaceholders"></param>
|
/// <param name="optionalPlaceholders"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<DataResult<int>> SendAsync(EnvelopeReceiverDto envelopeReceiverDto, EmailTemplateType tempType, Dictionary<string, object>? optionalPlaceholders = null);
|
Task<DataResult<int>> SendAsync(EnvelopeReceiverDto envelopeReceiverDto, Constants.EmailTemplateType tempType, Dictionary<string, object>? optionalPlaceholders = null);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
using DigitalData.Core.Abstraction.Application;
|
using DigitalData.Core.Abstraction.Application;
|
||||||
using EnvelopeGenerator.Application.Dto.EnvelopeReceiverReadOnly;
|
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Interfaces.Services;
|
namespace EnvelopeGenerator.Application.Contracts.Services;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,16 +1,13 @@
|
|||||||
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.DTOs.EnvelopeReceiver;
|
||||||
using EnvelopeGenerator.Application.Dto.Messaging;
|
using EnvelopeGenerator.Application.DTOs.Messaging;
|
||||||
using EnvelopeGenerator.Application.Envelopes;
|
using EnvelopeGenerator.Application.Envelopes;
|
||||||
using EnvelopeGenerator.Application.Envelopes.Queries;
|
using EnvelopeGenerator.Application.Receivers.Queries.Read;
|
||||||
using EnvelopeGenerator.Application.Receivers.Queries;
|
|
||||||
using EnvelopeGenerator.Domain;
|
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Interfaces.Services;
|
namespace EnvelopeGenerator.Application.Contracts.Services;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -123,7 +120,7 @@ public interface IEnvelopeReceiverService : IBasicCRUDService<EnvelopeReceiverDt
|
|||||||
/// <param name="receiverQuery"></param>
|
/// <param name="receiverQuery"></param>
|
||||||
/// <param name="ignore_statuses"></param>
|
/// <param name="ignore_statuses"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUsernameAsync(string username, EnvelopeStatus? min_status = null, EnvelopeStatus? max_status = null, ReadEnvelopeQuery? envelopeQuery = null, ReadReceiverQuery? receiverQuery = null, params EnvelopeStatus[] ignore_statuses);
|
Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUsernameAsync(string username, int? min_status = null, int? max_status = null, EnvelopeQuery? envelopeQuery = null, ReadReceiverQuery? receiverQuery = null, params int[] ignore_statuses);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,10 +1,9 @@
|
|||||||
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.DTOs;
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Interfaces.Services;
|
namespace EnvelopeGenerator.Application.Contracts.Services;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -41,5 +40,5 @@ public interface IEnvelopeService : IBasicCRUDService<EnvelopeDto, Envelope, int
|
|||||||
/// <param name="max_status"></param>
|
/// <param name="max_status"></param>
|
||||||
/// <param name="ignore_statuses"></param>
|
/// <param name="ignore_statuses"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<DataResult<IEnumerable<EnvelopeDto>>> ReadByUserAsync(int userId, EnvelopeStatus? min_status = null, EnvelopeStatus? max_status = null, params EnvelopeStatus[] ignore_statuses);
|
Task<DataResult<IEnumerable<EnvelopeDto>>> ReadByUserAsync(int userId, int? min_status = null, int? max_status = null, params int[] ignore_statuses);
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using EnvelopeGenerator.Application.Dto.EnvelopeReceiver;
|
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
||||||
using EnvelopeGenerator.Application.Dto.Messaging;
|
using EnvelopeGenerator.Application.DTOs.Messaging;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Interfaces.Services;
|
namespace EnvelopeGenerator.Application.Contracts.Services;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
using DigitalData.Core.Abstraction.Application;
|
using DigitalData.Core.Abstraction.Application;
|
||||||
using EnvelopeGenerator.Application.Dto;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Interfaces.Services;
|
namespace EnvelopeGenerator.Application.Contracts.Services;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,16 +1,15 @@
|
|||||||
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.DTOs.Receiver;
|
||||||
using EnvelopeGenerator.Application.Receivers.Commands;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Interfaces.Services;
|
namespace EnvelopeGenerator.Application.Contracts.Services;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Obsolete("Use MediatR")]
|
[Obsolete("Use MediatR")]
|
||||||
public interface IReceiverService : ICRUDService<CreateReceiverCommand, ReceiverReadDto, Receiver, int>
|
public interface IReceiverService : ICRUDService<ReceiverCreateDto, ReceiverReadDto, Receiver, int>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using EnvelopeGenerator.Application.Dto.Messaging;
|
using EnvelopeGenerator.Application.DTOs.Messaging;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Interfaces.Services;
|
namespace EnvelopeGenerator.Application.Contracts.Services;
|
||||||
|
|
||||||
//TODO: move to DigitalData.Core
|
//TODO: move to DigitalData.Core
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Dto;
|
namespace EnvelopeGenerator.Application.DTOs;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Data Transfer Object representing configuration settings.
|
/// Data Transfer Object representing configuration settings.
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Dto;
|
namespace EnvelopeGenerator.Application.DTOs;
|
||||||
|
|
||||||
/// <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.
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
using EnvelopeGenerator.Domain.Constants;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Dto;
|
namespace EnvelopeGenerator.Application.DTOs;
|
||||||
|
|
||||||
/// <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.
|
||||||
@@ -27,7 +26,7 @@ public class DocumentStatusDto
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the current status code.
|
/// Gets or sets the current status code.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public EnvelopeStatus Status { get; set; }
|
public int Status { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the timestamp when the status was changed.
|
/// Gets or sets the timestamp when the status was changed.
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Dto
|
namespace EnvelopeGenerator.Application.DTOs
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
50
EnvelopeGenerator.Application/DTOs/EnvelopeCertificateDto.cs
Normal file
50
EnvelopeGenerator.Application/DTOs/EnvelopeCertificateDto.cs
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.DTOs;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data Transfer Object representing certificate information for an envelope.
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public class EnvelopeCertificateDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the unique identifier of the certificate.
|
||||||
|
/// </summary>
|
||||||
|
public int Id { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the envelope ID associated with the certificate.
|
||||||
|
/// </summary>
|
||||||
|
public int EnvelopeId { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the UUID of the envelope.
|
||||||
|
/// </summary>
|
||||||
|
public string EnvelopeUuid { get; init; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the subject of the envelope.
|
||||||
|
/// </summary>
|
||||||
|
public string EnvelopeSubject { get; init; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the ID of the creator of the envelope.
|
||||||
|
/// </summary>
|
||||||
|
public int CreatorId { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the name of the creator.
|
||||||
|
/// </summary>
|
||||||
|
public string CreatorName { get; init; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the email address of the creator.
|
||||||
|
/// </summary>
|
||||||
|
public string CreatorEmail { get; init; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the current status of the envelope.
|
||||||
|
/// </summary>
|
||||||
|
public int EnvelopeStatus { get; init; }
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Dto;
|
namespace EnvelopeGenerator.Application.DTOs;
|
||||||
|
|
||||||
/// <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.
|
||||||
@@ -1,10 +1,9 @@
|
|||||||
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.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Dto;
|
namespace EnvelopeGenerator.Application.DTOs;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -25,7 +24,7 @@ public record EnvelopeDto
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public required EnvelopeStatusQuery Status { get; set; }
|
public int Status { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Default value is string.Empty
|
/// Default value is string.Empty
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Dto.EnvelopeHistory;
|
namespace EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Data Transfer Object for creating a new envelope history record.
|
/// Data Transfer Object for creating a new envelope history record.
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
using DigitalData.UserManager.Application.DTOs.User;
|
using DigitalData.UserManager.Application.DTOs.User;
|
||||||
using EnvelopeGenerator.Application.Dto.Receiver;
|
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
using static EnvelopeGenerator.Domain.Constants;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Dto.EnvelopeHistory;
|
namespace EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
|
||||||
|
|
||||||
/// <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.
|
||||||
@@ -25,19 +25,9 @@ public record EnvelopeHistoryDto
|
|||||||
public required string UserReference { get; set; }
|
public required string UserReference { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Include code of the envelope at this history point.
|
/// Status code of the envelope at this history point.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public EnvelopeStatus Status { get; set; }
|
public int Status { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Type of reference for this history entry.
|
|
||||||
/// </summary>
|
|
||||||
public ReferenceType ReferenceType => ((int)Status).ToString().FirstOrDefault() switch
|
|
||||||
{
|
|
||||||
'1' => ReferenceType.Sender,
|
|
||||||
'2' => ReferenceType.Receiver,
|
|
||||||
_ => ReferenceType.System,
|
|
||||||
};
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Human-readable name of the status.
|
/// Human-readable name of the status.
|
||||||
@@ -64,6 +54,11 @@ public record EnvelopeHistoryDto
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public ReceiverReadDto? Receiver { get; set; }
|
public ReceiverReadDto? Receiver { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Type of reference for this history entry.
|
||||||
|
/// </summary>
|
||||||
|
public ReferenceType ReferenceType { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Optional comment related to this history entry.
|
/// Optional comment related to this history entry.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
|
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Dto.EnvelopeReceiver;
|
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using EnvelopeGenerator.Application.Dto.Receiver;
|
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Dto.EnvelopeReceiver;
|
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Dto.EnvelopeReceiver;
|
namespace EnvelopeGenerator.Application.DTOs.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.DTOs.EnvelopeReceiverReadOnly;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using EnvelopeGenerator.Application.Dto.Receiver;
|
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Dto.EnvelopeReceiverReadOnly;
|
namespace EnvelopeGenerator.Application.DTOs.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.
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Dto.EnvelopeReceiverReadOnly;
|
namespace EnvelopeGenerator.Application.DTOs.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.DTOs;
|
||||||
|
|
||||||
/// <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,14 +1,13 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using EnvelopeGenerator.Application.Dto.EnvelopeHistory;
|
using EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
|
||||||
using EnvelopeGenerator.Application.Dto.EnvelopeReceiver;
|
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
||||||
using EnvelopeGenerator.Application.Dto.EnvelopeReceiverReadOnly;
|
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
|
||||||
using EnvelopeGenerator.Application.Dto.Messaging;
|
using EnvelopeGenerator.Application.DTOs.Messaging;
|
||||||
using EnvelopeGenerator.Application.Dto.Receiver;
|
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||||
using EnvelopeGenerator.Application.Extensions;
|
using EnvelopeGenerator.Application.Extensions;
|
||||||
using EnvelopeGenerator.Application.Receivers.Commands;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Dto;
|
namespace EnvelopeGenerator.Application.DTOs;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents the AutoMapper profile configuration for mapping between
|
/// Represents the AutoMapper profile configuration for mapping between
|
||||||
@@ -28,6 +27,7 @@ public class MappingProfile : Profile
|
|||||||
CreateMap<DocumentStatus, DocumentStatusDto>();
|
CreateMap<DocumentStatus, DocumentStatusDto>();
|
||||||
CreateMap<EmailTemplate, EmailTemplateDto>();
|
CreateMap<EmailTemplate, EmailTemplateDto>();
|
||||||
CreateMap<Envelope, EnvelopeDto>();
|
CreateMap<Envelope, EnvelopeDto>();
|
||||||
|
CreateMap<EnvelopeCertificate, EnvelopeCertificateDto>();
|
||||||
CreateMap<EnvelopeDocument, EnvelopeDocumentDto>();
|
CreateMap<EnvelopeDocument, EnvelopeDocumentDto>();
|
||||||
CreateMap<Domain.Entities.EnvelopeHistory, EnvelopeHistoryDto>();
|
CreateMap<Domain.Entities.EnvelopeHistory, EnvelopeHistoryDto>();
|
||||||
CreateMap<Domain.Entities.EnvelopeHistory, EnvelopeHistoryCreateDto>();
|
CreateMap<Domain.Entities.EnvelopeHistory, EnvelopeHistoryCreateDto>();
|
||||||
@@ -35,6 +35,8 @@ public class MappingProfile : Profile
|
|||||||
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, ReceiverReadDto>();
|
||||||
|
CreateMap<Domain.Entities.Receiver, ReceiverCreateDto>();
|
||||||
|
CreateMap<Domain.Entities.Receiver, ReceiverUpdateDto>();
|
||||||
CreateMap<Domain.Entities.EnvelopeReceiverReadOnly, EnvelopeReceiverReadOnlyDto>();
|
CreateMap<Domain.Entities.EnvelopeReceiverReadOnly, EnvelopeReceiverReadOnlyDto>();
|
||||||
|
|
||||||
// DTO to Entity mappings
|
// DTO to Entity mappings
|
||||||
@@ -43,13 +45,16 @@ public class MappingProfile : Profile
|
|||||||
CreateMap<DocumentStatusDto, DocumentStatus>();
|
CreateMap<DocumentStatusDto, DocumentStatus>();
|
||||||
CreateMap<EmailTemplateDto, EmailTemplate>();
|
CreateMap<EmailTemplateDto, EmailTemplate>();
|
||||||
CreateMap<EnvelopeDto, Envelope>();
|
CreateMap<EnvelopeDto, Envelope>();
|
||||||
|
CreateMap<EnvelopeCertificateDto, EnvelopeCertificate>();
|
||||||
CreateMap<EnvelopeDocumentDto, EnvelopeDocument>();
|
CreateMap<EnvelopeDocumentDto, EnvelopeDocument>();
|
||||||
CreateMap<EnvelopeHistoryDto, Domain.Entities.EnvelopeHistory>();
|
CreateMap<EnvelopeHistoryDto, Domain.Entities.EnvelopeHistory>();
|
||||||
CreateMap<EnvelopeHistoryCreateDto, Domain.Entities.EnvelopeHistory>();
|
CreateMap<EnvelopeHistoryCreateDto, Domain.Entities.EnvelopeHistory>();
|
||||||
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<ReceiverReadDto, Domain.Entities.Receiver>().ForMember(rcv => rcv.EnvelopeReceivers, rcvReadDto => rcvReadDto.Ignore());
|
||||||
CreateMap<Domain.Entities.EnvelopeReceiver, EnvelopeReceiverBasicDto>();
|
CreateMap<ReceiverCreateDto, Domain.Entities.Receiver>();
|
||||||
|
CreateMap<ReceiverUpdateDto, Domain.Entities.Receiver>();
|
||||||
|
CreateMap<EnvelopeReceiverBase, 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.DTOs.Messaging;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Dto.Messaging;
|
namespace EnvelopeGenerator.Application.DTOs.Messaging;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.DTOs.Receiver;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public record ReceiverCreateDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public ReceiverCreateDto()
|
||||||
|
{
|
||||||
|
_sha256HexOfMail = new(() =>
|
||||||
|
{
|
||||||
|
var bytes_arr = Encoding.UTF8.GetBytes(EmailAddress!.ToUpper());
|
||||||
|
var hash_arr = SHA256.HashData(bytes_arr);
|
||||||
|
var hexa_str = BitConverter.ToString(hash_arr);
|
||||||
|
return hexa_str.Replace("-", string.Empty);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[EmailAddress]
|
||||||
|
public required string EmailAddress { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string? TotpSecretkey { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// var bytes_arr = Encoding.UTF8.GetBytes(EmailAddress.ToUpper());<br/>
|
||||||
|
/// var hash_arr = SHA256.HashData(bytes_arr);
|
||||||
|
/// var hexa_str = BitConverter.ToString(hash_arr);
|
||||||
|
/// return hexa_str.Replace("-", string.Empty);
|
||||||
|
/// </summary>
|
||||||
|
public string Signature => _sha256HexOfMail.Value;
|
||||||
|
|
||||||
|
private readonly Lazy<string> _sha256HexOfMail;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default value is DateTime.Now
|
||||||
|
/// </summary>
|
||||||
|
public DateTime AddedWhen { get; } = DateTime.Now;
|
||||||
|
};
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
using EnvelopeGenerator.Application.Dto.EnvelopeReceiver;
|
using EnvelopeGenerator.Application.DTOs.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.DTOs.Receiver;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Receivers.Commands;
|
namespace EnvelopeGenerator.Application.DTOs.Receiver;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Data Transfer Object for updating a receiver's information.
|
/// Data Transfer Object for updating a receiver's information.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
public class UpdateReceiverCommand
|
public class ReceiverUpdateDto
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the unique identifier of the receiver.
|
/// Gets or sets the unique identifier of the receiver.
|
||||||
@@ -1,12 +1,13 @@
|
|||||||
using DigitalData.Core.Client;
|
using EnvelopeGenerator.Application.Configurations;
|
||||||
using EnvelopeGenerator.Application.Configurations;
|
|
||||||
using EnvelopeGenerator.Application.Interfaces.Services;
|
|
||||||
using EnvelopeGenerator.Application.Services;
|
using EnvelopeGenerator.Application.Services;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||||
|
using DigitalData.Core.Client;
|
||||||
using QRCoder;
|
using QRCoder;
|
||||||
|
using EnvelopeGenerator.Application.Contracts.Services;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using EnvelopeGenerator.Application.EnvelopeReceivers.Commands.Create;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application;
|
namespace EnvelopeGenerator.Application;
|
||||||
|
|
||||||
@@ -32,6 +33,7 @@ public static class DependencyInjection
|
|||||||
services.TryAddScoped<IDocumentStatusService, DocumentStatusService>();
|
services.TryAddScoped<IDocumentStatusService, DocumentStatusService>();
|
||||||
services.TryAddScoped<IEmailTemplateService, EmailTemplateService>();
|
services.TryAddScoped<IEmailTemplateService, EmailTemplateService>();
|
||||||
services.TryAddScoped<IEnvelopeService, EnvelopeService>();
|
services.TryAddScoped<IEnvelopeService, EnvelopeService>();
|
||||||
|
services.TryAddScoped<IEnvelopeCertificateService, EnvelopeCertificateService>();
|
||||||
services.TryAddScoped<IEnvelopeDocumentService, EnvelopeDocumentService>();
|
services.TryAddScoped<IEnvelopeDocumentService, EnvelopeDocumentService>();
|
||||||
services.TryAddScoped<IEnvelopeReceiverService, EnvelopeReceiverService>();
|
services.TryAddScoped<IEnvelopeReceiverService, EnvelopeReceiverService>();
|
||||||
services.TryAddScoped<IEnvelopeTypeService, EnvelopeTypeService>();
|
services.TryAddScoped<IEnvelopeTypeService, EnvelopeTypeService>();
|
||||||
@@ -57,6 +59,7 @@ public static class DependencyInjection
|
|||||||
services.AddMediatR(cfg =>
|
services.AddMediatR(cfg =>
|
||||||
{
|
{
|
||||||
cfg.RegisterServicesFromAssembly(Assembly.GetExecutingAssembly());
|
cfg.RegisterServicesFromAssembly(Assembly.GetExecutingAssembly());
|
||||||
|
cfg.RegisterServicesFromAssembly(typeof(CreateEnvelopeReceiverCommandHandler).Assembly);
|
||||||
});
|
});
|
||||||
|
|
||||||
return services;
|
return services;
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
namespace EnvelopeGenerator.Application.DocStatus.Commands;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public record CreateDocStatusCommand : ModifyDocStatusCommandBase
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Gets timestamp when this record was added. Returns the StatusChangedWhen value.
|
|
||||||
/// </summary>
|
|
||||||
public DateTime AddedWhen => StatusChangedWhen;
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
using EnvelopeGenerator.Application.Model;
|
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DocStatus.Commands;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public record ModifyDocStatusCommandBase : EnvelopeReceiverQueryBase
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the current status code.
|
|
||||||
/// </summary>
|
|
||||||
public DocumentStatus Status => Value is null ? DocumentStatus.Created : DocumentStatus.Signed;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the display value associated with the status.
|
|
||||||
/// </summary>
|
|
||||||
public string? Value { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets timestamp when this record was added.
|
|
||||||
/// </summary>
|
|
||||||
public DateTime StatusChangedWhen { get; } = DateTime.Now;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Maps the current command to a new instance of the specified type.
|
|
||||||
/// </summary>
|
|
||||||
/// <typeparam name="TDest"></typeparam>
|
|
||||||
/// <returns></returns>
|
|
||||||
public TDest To<TDest>() where TDest : ModifyDocStatusCommandBase, new()
|
|
||||||
=> new()
|
|
||||||
{
|
|
||||||
Key = Key,
|
|
||||||
Envelope = Envelope,
|
|
||||||
Receiver = Receiver,
|
|
||||||
Value = Value
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
using DigitalData.Core.Abstraction.Application.Repository;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
|
||||||
using MediatR;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using EnvelopeGenerator.Application.Extensions;
|
|
||||||
using EnvelopeGenerator.Application.Dto;
|
|
||||||
using AutoMapper;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DocStatus.Commands;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Represents a command to save the status of a document, either by creating a new status or updating an existing one based on the provided envelope and receiver identifiers.
|
|
||||||
/// It returns the identifier of the saved document status.
|
|
||||||
/// </summary>
|
|
||||||
public record SaveDocStatusCommand : ModifyDocStatusCommandBase, IRequest<DocumentStatusDto?>;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public class SaveDocStatusCommandHandler : IRequestHandler<SaveDocStatusCommand, DocumentStatusDto?>
|
|
||||||
{
|
|
||||||
private readonly IMapper _mapper;
|
|
||||||
|
|
||||||
private readonly IRepository<DocumentStatus> _repo;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="mapper"></param>
|
|
||||||
/// <param name="repo"></param>
|
|
||||||
public SaveDocStatusCommandHandler(IMapper mapper, IRepository<DocumentStatus> repo)
|
|
||||||
{
|
|
||||||
_mapper = mapper;
|
|
||||||
_repo = repo;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="request"></param>
|
|
||||||
/// <param name="cancel"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<DocumentStatusDto?> Handle(SaveDocStatusCommand request, CancellationToken cancel)
|
|
||||||
{
|
|
||||||
// ceck if exists
|
|
||||||
bool isExists = await _repo.ReadOnly().Where(request).AnyAsync(cancel);
|
|
||||||
|
|
||||||
if (isExists)
|
|
||||||
{
|
|
||||||
var uReq = request.To<UpdateDocStatusCommand>();
|
|
||||||
await _repo.UpdateAsync(uReq, q => q.Where(request), cancel);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var cReq = request.To<CreateDocStatusCommand>();
|
|
||||||
await _repo.CreateAsync(cReq, cancel);
|
|
||||||
}
|
|
||||||
|
|
||||||
var docStatus = await _repo.ReadOnly().Where(request).SingleOrDefaultAsync(cancel);
|
|
||||||
|
|
||||||
return _mapper.Map<DocumentStatusDto>(docStatus);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
using EnvelopeGenerator.Domain;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DocStatus.Commands;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public record UpdateDocStatusCommand : ModifyDocStatusCommandBase
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Gets timestamp when this record was added. Returns the StatusChangedWhen value.
|
|
||||||
/// </summary>
|
|
||||||
public DateTime? ChangedWhen => StatusChangedWhen;
|
|
||||||
}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
using AutoMapper;
|
|
||||||
using EnvelopeGenerator.Application.DocStatus.Commands;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DocStatus;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public class MappingProfile : Profile
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public MappingProfile()
|
|
||||||
{
|
|
||||||
CreateMap<CreateDocStatusCommand, DocumentStatus>();
|
|
||||||
CreateMap<UpdateDocStatusCommand, DocumentStatus>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
using AutoMapper;
|
||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Documents.Queries.Read;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class ReadDocumentMappingProfile : Profile
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public ReadDocumentMappingProfile()
|
||||||
|
{
|
||||||
|
CreateMap<EnvelopeDocument, ReadDocumentResponse>();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
using MediatR;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Documents.Queries.Read;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Represents a query to read a document based on its unique identifier or associated envelope identifier.
|
||||||
|
/// </summary>
|
||||||
|
/// <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>
|
||||||
|
public record ReadDocumentQuery(int? Id = null, int? EnvelopeId = null) : IRequest<ReadDocumentResponse?>
|
||||||
|
{
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
using MediatR;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Documents.Queries.Read;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handles queries for reading <see cref="EnvelopeDocument"/> data based on either the document ID or the envelope ID.
|
||||||
|
/// </summary>
|
||||||
|
public class ReadDocumentQueryHandler : IRequestHandler<ReadDocumentQuery, ReadDocumentResponse?>
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Repository for accessing <see cref="EnvelopeDocument"/> entities.
|
||||||
|
/// </summary>
|
||||||
|
private readonly IRepository<EnvelopeDocument> _repo;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="ReadDocumentQueryHandler"/> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelopeDocumentRepository">The repository used to access <see cref="EnvelopeDocument"/> entities.</param>
|
||||||
|
public ReadDocumentQueryHandler(IRepository<EnvelopeDocument> envelopeDocumentRepository)
|
||||||
|
{
|
||||||
|
_repo = envelopeDocumentRepository;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handles the <see cref="ReadDocumentQuery"/> and returns a <see cref="ReadDocumentResponse"/> based on the provided identifiers.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="query">The query containing the document ID or envelope ID to search for.</param>
|
||||||
|
/// <param name="cancellationToken">A token to monitor for cancellation requests.</param>
|
||||||
|
/// <returns>
|
||||||
|
/// A <see cref="ReadDocumentResponse"/> if a matching document is found; otherwise, <c>null</c>.
|
||||||
|
/// </returns>
|
||||||
|
/// <exception cref="InvalidOperationException">
|
||||||
|
/// Thrown when neither <see cref="ReadDocumentQuery.Id"/> nor <see cref="ReadDocumentQuery.EnvelopeId"/> is provided.
|
||||||
|
/// </exception>
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
|
public async Task<ReadDocumentResponse?> Handle(ReadDocumentQuery query, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
if (query.Id is not null)
|
||||||
|
return await _repo.ReadOrDefaultAsync<ReadDocumentResponse>(d => d.Id == query.Id);
|
||||||
|
else if (query.EnvelopeId is not null)
|
||||||
|
return await _repo.ReadOrDefaultAsync<ReadDocumentResponse>(d => d.EnvelopeId == query.EnvelopeId);
|
||||||
|
|
||||||
|
throw new InvalidOperationException(
|
||||||
|
$"Invalid {nameof(ReadDocumentQuery)}: either {nameof(query.Id)} or {nameof(query.EnvelopeId)} must be provided.");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
namespace EnvelopeGenerator.Application.Documents.Queries.Read;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Represents the response for reading a document.
|
||||||
|
/// </summary>
|
||||||
|
public class ReadDocumentResponse : ReadDocumentResponseBase
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The binary data of the document, if available.
|
||||||
|
/// </summary>
|
||||||
|
public byte[]? ByteData { get; init; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
namespace EnvelopeGenerator.Application.Documents.Queries.Read;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Represents the response for reading a document.
|
||||||
|
/// </summary>
|
||||||
|
public class ReadDocumentResponseBase
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The unique identifier of the document.
|
||||||
|
/// </summary>
|
||||||
|
public int Guid { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The identifier of the associated envelope.
|
||||||
|
/// </summary>
|
||||||
|
public int EnvelopeId { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The date and time when the document was added.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime AddedWhen { get; init; }
|
||||||
|
}
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
using DigitalData.Core.Abstraction.Application.Repository;
|
|
||||||
using EnvelopeGenerator.Application.Dto;
|
|
||||||
using MediatR;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using AutoMapper;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Documents.Queries;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Represents a query to read a document based on its unique identifier or associated envelope identifier.
|
|
||||||
/// </summary>
|
|
||||||
/// <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>
|
|
||||||
public record ReadDocumentQuery(int? Id = null, int? EnvelopeId = null) : IRequest<EnvelopeDocumentDto?>
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Handles queries for reading <see cref="EnvelopeDocument"/> data based on either the document ID or the envelope ID.
|
|
||||||
/// </summary>
|
|
||||||
public class ReadDocumentQueryHandler : IRequestHandler<ReadDocumentQuery, EnvelopeDocumentDto?>
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// TempRepo for accessing <see cref="EnvelopeDocument"/> entities.
|
|
||||||
/// </summary>
|
|
||||||
private readonly IRepository<EnvelopeDocument> _repo;
|
|
||||||
|
|
||||||
private readonly IMapper _mapper;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Initializes a new instance of the <see cref="ReadDocumentQueryHandler"/> class.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="envelopeDocumentRepository">The repository used to access <see cref="EnvelopeDocument"/> entities.</param>
|
|
||||||
/// <param name="mapper"></param>
|
|
||||||
public ReadDocumentQueryHandler(IRepository<EnvelopeDocument> envelopeDocumentRepository, IMapper mapper)
|
|
||||||
{
|
|
||||||
_repo = envelopeDocumentRepository;
|
|
||||||
_mapper = mapper;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Handles the <see cref="ReadDocumentQuery"/> and returns a <see cref="EnvelopeDocumentDto"/> based on the provided identifiers.
|
|
||||||
/// </summary>
|
|
||||||
/// <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>
|
|
||||||
/// <returns>
|
|
||||||
/// A <see cref="EnvelopeDocumentDto"/> if a matching document is found; otherwise, <c>null</c>.
|
|
||||||
/// </returns>
|
|
||||||
/// <exception cref="InvalidOperationException">
|
|
||||||
/// Thrown when neither <see cref="ReadDocumentQuery.Id"/> nor <see cref="ReadDocumentQuery.EnvelopeId"/> is provided.
|
|
||||||
/// </exception>
|
|
||||||
public async Task<EnvelopeDocumentDto?> Handle(ReadDocumentQuery query, CancellationToken cancel)
|
|
||||||
{
|
|
||||||
if (query.Id is not null)
|
|
||||||
{
|
|
||||||
var doc = await _repo.ReadOnly().Where(d => d.Id == query.Id).FirstOrDefaultAsync(cancel);
|
|
||||||
return _mapper.Map<EnvelopeDocumentDto>(doc);
|
|
||||||
}
|
|
||||||
else if (query.EnvelopeId is not null)
|
|
||||||
{
|
|
||||||
var doc = await _repo.ReadOnly().Where(d => d.EnvelopeId == query.EnvelopeId).FirstOrDefaultAsync(cancel);
|
|
||||||
return _mapper.Map<EnvelopeDocumentDto>(doc);
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new InvalidOperationException(
|
|
||||||
$"Invalid {nameof(ReadDocumentQuery)}: either {nameof(query.Id)} or {nameof(query.EnvelopeId)} must be provided.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
using EnvelopeGenerator.Domain;
|
using EnvelopeGenerator.Domain;
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
|
||||||
using MediatR;
|
using MediatR;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.EmailTemplates.Commands.Reset;
|
namespace EnvelopeGenerator.Application.EmailTemplates.Commands.Reset;
|
||||||
@@ -34,8 +33,8 @@ public record ResetEmailTemplateCommand : EmailTemplateQuery, IRequest
|
|||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="Id">Die optionale ID der E-Mail-Vorlage, die zurückgesetzt werden soll.</param>
|
/// <param name="Id">Die optionale ID der E-Mail-Vorlage, die zurückgesetzt werden soll.</param>
|
||||||
/// <param name="Type">Der Typ der E-Mail-Vorlage, z. B. <see cref="EmailTemplateType"/> (optional).</param>
|
/// <param name="Type">Der Typ der E-Mail-Vorlage, z. B. <see cref="Constants.EmailTemplateType"/> (optional).</param>
|
||||||
public ResetEmailTemplateCommand(int? Id = null, EmailTemplateType? Type = null) : base(Id, Type)
|
public ResetEmailTemplateCommand(int? Id = null, Constants.EmailTemplateType? Type = null) : base(Id, Type)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -1,9 +1,7 @@
|
|||||||
using DigitalData.Core.Abstraction.Application.Repository;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using EnvelopeGenerator.Application.Dto;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.EmailTemplates.Commands.Reset;
|
namespace EnvelopeGenerator.Application.EmailTemplates.Commands.Reset;
|
||||||
|
|
||||||
@@ -33,10 +31,10 @@ public class ResetEmailTemplateCommandHandler : IRequestHandler<ResetEmailTempla
|
|||||||
public async Task Handle(ResetEmailTemplateCommand request, CancellationToken cancel)
|
public async Task Handle(ResetEmailTemplateCommand request, CancellationToken cancel)
|
||||||
{
|
{
|
||||||
var temps = request.Id is not null
|
var temps = request.Id is not null
|
||||||
? await _repository.ReadOnly().Where(t => t.Id == request.Id).ToListAsync(cancel)
|
? await _repository.ReadAllAsync<EmailTemplateDto>(t => t.Id == request.Id, cancel)
|
||||||
: request.Type is not null
|
: request.Type is not null
|
||||||
? await _repository.ReadOnly().Where(t => t.Name == request.Type.ToString()).ToListAsync(cancel)
|
? await _repository.ReadAllAsync<EmailTemplateDto>(t => t.Name == request.Type.ToString(), cancel)
|
||||||
: await _repository.ReadOnly().ToListAsync(cancel);
|
: await _repository.ReadAllAsync<EmailTemplateDto>(cancellation: cancel);
|
||||||
|
|
||||||
foreach (var temp in temps)
|
foreach (var temp in temps)
|
||||||
{
|
{
|
||||||
@@ -84,7 +82,7 @@ public class ResetEmailTemplateCommandHandler : IRequestHandler<ResetEmailTempla
|
|||||||
new(){
|
new(){
|
||||||
Id = 6,
|
Id = 6,
|
||||||
Name = "DocumentRejected_ADM",
|
Name = "DocumentRejected_ADM",
|
||||||
Body = "Guten Tag [NAME_SENDER],<p><B><I>[NAME_RECEIVER]</I></B> hat den Umschlag <B><I>'[DOCUMENT_TITLE]'</I></B> mit folgendem Grund abgelehnt: <p>\r\n[REASON] \r\n<p>Der Umschlag wurde auf den Include Rejected gesetzt. <p> \r\nMit freundlichen Grüßen<br />\r\n<br />\r\n[NAME_PORTAL]",
|
Body = "Guten Tag [NAME_SENDER],<p><B><I>[NAME_RECEIVER]</I></B> hat den Umschlag <B><I>'[DOCUMENT_TITLE]'</I></B> mit folgendem Grund abgelehnt: <p>\r\n[REASON] \r\n<p>Der Umschlag wurde auf den Status Rejected gesetzt. <p> \r\nMit freundlichen Grüßen<br />\r\n<br />\r\n[NAME_PORTAL]",
|
||||||
Subject = "'[DOCUMENT_TITLE]' - Unterzeichnungsvorgang zurückgezogen"
|
Subject = "'[DOCUMENT_TITLE]' - Unterzeichnungsvorgang zurückgezogen"
|
||||||
},
|
},
|
||||||
new(){
|
new(){
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
using AutoMapper;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using DigitalData.Core.Abstraction.Application.Repository;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Application.Dto;
|
using EnvelopeGenerator.Application.Exceptions;
|
||||||
using DigitalData.Core.Exceptions;
|
using EnvelopeGenerator.Domain;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.EmailTemplates.Commands.Update;
|
namespace EnvelopeGenerator.Application.EmailTemplates.Commands.Update;
|
||||||
|
|
||||||
@@ -16,16 +14,13 @@ public class UpdateEmailTemplateCommandHandler : IRequestHandler<UpdateEmailTemp
|
|||||||
{
|
{
|
||||||
private readonly IRepository<EmailTemplate> _repository;
|
private readonly IRepository<EmailTemplate> _repository;
|
||||||
|
|
||||||
private readonly IMapper _mapper;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="repository"></param>
|
/// <param name="repository"></param>
|
||||||
public UpdateEmailTemplateCommandHandler(IRepository<EmailTemplate> repository, IMapper mapper)
|
public UpdateEmailTemplateCommandHandler(IRepository<EmailTemplate> repository)
|
||||||
{
|
{
|
||||||
_repository = repository;
|
_repository = repository;
|
||||||
_mapper = mapper;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -39,34 +34,32 @@ public class UpdateEmailTemplateCommandHandler : IRequestHandler<UpdateEmailTemp
|
|||||||
[Obsolete("Use Read-method returning IReadQuery<TEntity> instead.")]
|
[Obsolete("Use Read-method returning IReadQuery<TEntity> instead.")]
|
||||||
public async Task Handle(UpdateEmailTemplateCommand request, CancellationToken cancel)
|
public async Task Handle(UpdateEmailTemplateCommand request, CancellationToken cancel)
|
||||||
{
|
{
|
||||||
EmailTemplateDto? tempDto;
|
EmailTemplateDto? temp;
|
||||||
|
|
||||||
if (request.EmailTemplateQuery?.Id is int id)
|
if (request.EmailTemplateQuery?.Id is int id)
|
||||||
{
|
{
|
||||||
var temp = await _repository.ReadOnly().Where(t => t.Id == id).FirstOrDefaultAsync(cancel);
|
temp = await _repository.ReadOrDefaultAsync<EmailTemplateDto>(t => t.Id == id, single: false, cancel);
|
||||||
tempDto = _mapper.Map<EmailTemplateDto>(temp);
|
|
||||||
}
|
}
|
||||||
else if (request!.EmailTemplateQuery!.Type is EmailTemplateType type)
|
else if (request!.EmailTemplateQuery!.Type is Constants.EmailTemplateType type)
|
||||||
{
|
{
|
||||||
var temp = await _repository.ReadOnly().Where(t => t.Name == type.ToString()).FirstOrDefaultAsync(cancel);
|
temp = await _repository.ReadOrDefaultAsync<EmailTemplateDto>(t => t.Name == type.ToString(), single: false, cancel);
|
||||||
tempDto = _mapper.Map<EmailTemplateDto>(temp);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
throw new InvalidOperationException("Both id and type is null. Id: " + request.EmailTemplateQuery.Id +". Type: " + request.EmailTemplateQuery.Type.ToString());
|
throw new InvalidOperationException("Both id and type is null. Id: " + request.EmailTemplateQuery.Id +". Type: " + request.EmailTemplateQuery.Type.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tempDto == null)
|
if (temp == null)
|
||||||
{
|
{
|
||||||
throw new NotFoundException();
|
throw new NotFoundException();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (request.Body is not null)
|
if (request.Body is not null)
|
||||||
tempDto.Body = request.Body;
|
temp.Body = request.Body;
|
||||||
|
|
||||||
if (request.Subject is not null)
|
if (request.Subject is not null)
|
||||||
tempDto.Subject = request.Subject;
|
temp.Subject = request.Subject;
|
||||||
|
|
||||||
await _repository.UpdateAsync(tempDto, t => t.Id == tempDto.Id, cancel);
|
await _repository.UpdateAsync(temp, t => t.Id == temp.Id, cancel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using EnvelopeGenerator.Domain.Constants;
|
using EnvelopeGenerator.Domain;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.EmailTemplates;
|
namespace EnvelopeGenerator.Application.EmailTemplates;
|
||||||
|
|
||||||
@@ -7,7 +7,7 @@ namespace EnvelopeGenerator.Application.EmailTemplates;
|
|||||||
/// Die Standardkultur ist "de-DE".
|
/// Die Standardkultur ist "de-DE".
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="Id">Die eindeutige Kennung der E-Mail-Vorlage (optional).</param>
|
/// <param name="Id">Die eindeutige Kennung der E-Mail-Vorlage (optional).</param>
|
||||||
/// <param name="Type">Der Typ der E-Mail-Vorlage, z. B. <see cref="EmailTemplateType"/> (optional). Beispiele:
|
/// <param name="Type">Der Typ der E-Mail-Vorlage, z. B. <see cref="Constants.EmailTemplateType"/> (optional). Beispiele:
|
||||||
/// 0 - DocumentReceived: Benachrichtigung über den Empfang eines Dokuments.
|
/// 0 - DocumentReceived: Benachrichtigung über den Empfang eines Dokuments.
|
||||||
/// 1 - DocumentSigned: Benachrichtigung über die Unterzeichnung eines Dokuments.
|
/// 1 - DocumentSigned: Benachrichtigung über die Unterzeichnung eines Dokuments.
|
||||||
/// 2 - DocumentDeleted: Benachrichtigung über das Löschen eines Dokuments.
|
/// 2 - DocumentDeleted: Benachrichtigung über das Löschen eines Dokuments.
|
||||||
@@ -19,6 +19,6 @@ namespace EnvelopeGenerator.Application.EmailTemplates;
|
|||||||
/// 8 - DocumentRejected_REC (Für den ablehnenden Empfänger): Mail an den ablehnenden Empfänger, wenn das Dokument abgelehnt wird.
|
/// 8 - DocumentRejected_REC (Für den ablehnenden Empfänger): Mail an den ablehnenden Empfänger, wenn das Dokument abgelehnt wird.
|
||||||
/// 9 - DocumentRejected_REC_2 (Für sonstige Empfänger): Mail an andere Empfänger (Brief), wenn das Dokument abgelehnt wird.
|
/// 9 - DocumentRejected_REC_2 (Für sonstige Empfänger): Mail an andere Empfänger (Brief), wenn das Dokument abgelehnt wird.
|
||||||
/// </param>
|
/// </param>
|
||||||
public record EmailTemplateQuery(int? Id = null, EmailTemplateType? Type = null)
|
public record EmailTemplateQuery(int? Id = null, Constants.EmailTemplateType? Type = null)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using EnvelopeGenerator.Application.EmailTemplates.Queries.Read;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -7,17 +6,17 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.EmailTemplates;
|
namespace EnvelopeGenerator.Application.EmailTemplates.Queries.Read;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class MappingProfile : Profile
|
public class ReadEmailTemplateMappingProfile : Profile
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public MappingProfile()
|
public ReadEmailTemplateMappingProfile()
|
||||||
{
|
{
|
||||||
CreateMap<EmailTemplate, ReadEmailTemplateResponse>();
|
CreateMap<EmailTemplate, ReadEmailTemplateResponse>();
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using EnvelopeGenerator.Application.Interfaces.Repositories;
|
using EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
using EnvelopeGenerator.Domain;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.EmailTemplates.Queries.Read;
|
namespace EnvelopeGenerator.Application.EmailTemplates.Queries.Read;
|
||||||
@@ -41,7 +41,7 @@ public class ReadEmailTemplateQueryHandler : IRequestHandler<ReadEmailTemplateQu
|
|||||||
{
|
{
|
||||||
var temp = request.Id is int id
|
var temp = request.Id is int id
|
||||||
? await _repository.ReadByIdAsync(id)
|
? await _repository.ReadByIdAsync(id)
|
||||||
: request.Type is EmailTemplateType type
|
: request.Type is Constants.EmailTemplateType type
|
||||||
? await _repository.ReadByNameAsync(type)
|
? await _repository.ReadByNameAsync(type)
|
||||||
: throw new InvalidOperationException("Either a valid integer ID or a valid EmailTemplateType must be provided in the request.");
|
: throw new InvalidOperationException("Either a valid integer ID or a valid EmailTemplateType must be provided in the request.");
|
||||||
|
|
||||||
|
|||||||
@@ -14,34 +14,22 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Dapper" Version="2.1.66" />
|
<PackageReference Include="Dapper" Version="2.1.66" />
|
||||||
<PackageReference Include="DigitalData.Core.Abstraction.Application" Version="1.2.1" />
|
<PackageReference Include="DigitalData.Core.Abstraction.Application" Version="1.0.0" />
|
||||||
<PackageReference Include="DigitalData.Core.Application" Version="3.4.0" />
|
<PackageReference Include="DigitalData.Core.Application" Version="3.3.4" />
|
||||||
<PackageReference Include="DigitalData.Core.Client" Version="2.1.0" />
|
<PackageReference Include="DigitalData.Core.Client" Version="2.1.0" />
|
||||||
<PackageReference Include="DigitalData.Core.Exceptions" Version="1.1.0" />
|
|
||||||
<PackageReference Include="DigitalData.EmailProfilerDispatcher" Version="3.1.1" />
|
<PackageReference Include="DigitalData.EmailProfilerDispatcher" Version="3.1.1" />
|
||||||
<PackageReference Include="HtmlSanitizer" Version="8.0.865" />
|
|
||||||
<PackageReference Include="MediatR" Version="12.5.0" />
|
<PackageReference Include="MediatR" Version="12.5.0" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.18" />
|
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.18" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.5" />
|
||||||
<PackageReference Include="Otp.NET" Version="1.4.0" />
|
<PackageReference Include="Otp.NET" Version="1.4.0" />
|
||||||
<PackageReference Include="QRCoder" Version="1.6.0" />
|
<PackageReference Include="QRCoder" Version="1.6.0" />
|
||||||
<PackageReference Include="QRCoder-ImageSharp" Version="0.10.0" />
|
<PackageReference Include="QRCoder-ImageSharp" Version="0.10.0" />
|
||||||
<PackageReference Include="UserManager" Version="1.1.3" />
|
<PackageReference Include="UserManager" Version="1.1.1" />
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
|
|
||||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
|
|
||||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.5" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
|
|
||||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.5" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\EnvelopeGenerator.Domain\EnvelopeGenerator.Domain.csproj" />
|
<ProjectReference Include="..\EnvelopeGenerator.Domain\EnvelopeGenerator.Domain.csproj" />
|
||||||
|
<ProjectReference Include="..\EnvelopeGenerator.Extensions\EnvelopeGenerator.Extensions.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
using EnvelopeGenerator.Application.Envelopes.Commands;
|
||||||
|
using MediatR;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Commands.Create;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Befehl zur Erstellung eines Umschlags.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Title">Der Titel des Umschlags. Dies ist ein Pflichtfeld.</param>
|
||||||
|
/// <param name="Message">Die Nachricht, die im Umschlag enthalten sein soll. Dies ist ein Pflichtfeld.</param>
|
||||||
|
/// <param name="Document">Das mit dem Umschlag verknüpfte Dokument. Dies ist ein Pflichtfeld.</param>
|
||||||
|
/// <param name="Receivers">Eine Sammlung von Empfängern, die den Umschlag erhalten. Dies ist ein Pflichtfeld.</param>
|
||||||
|
/// <param name="TFAEnabled">Gibt an, ob die Zwei-Faktor-Authentifizierung für den Umschlag aktiviert ist. Standardmäßig false.</param>
|
||||||
|
public record CreateEnvelopeReceiverCommand(
|
||||||
|
[Required] string Title,
|
||||||
|
[Required] string Message,
|
||||||
|
[Required] DocumentCreateCommand Document,
|
||||||
|
[Required] IEnumerable<ReceiverGetOrCreateCommand> Receivers,
|
||||||
|
bool TFAEnabled = false
|
||||||
|
) : CreateEnvelopeCommand(Title, Message, TFAEnabled), IRequest<CreateEnvelopeReceiverResponse>;
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using EnvelopeGenerator.Application.Interfaces.SQLExecutor;
|
using EnvelopeGenerator.Application.Contracts.SQLExecutor;
|
||||||
using EnvelopeGenerator.Application.Dto.Receiver;
|
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Commands;
|
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Commands.Create;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Handles the creation of an envelope along with its associated document and recipients.
|
/// Handles the creation of an envelope along with its associated document and recipients.
|
||||||
@@ -42,7 +42,9 @@ public class CreateEnvelopeReceiverCommandHandler : IRequestHandler<CreateEnvelo
|
|||||||
/// <returns>A task representing the asynchronous operation.</returns>
|
/// <returns>A task representing the asynchronous operation.</returns>
|
||||||
public async Task<CreateEnvelopeReceiverResponse> Handle(CreateEnvelopeReceiverCommand request, CancellationToken cancel)
|
public async Task<CreateEnvelopeReceiverResponse> Handle(CreateEnvelopeReceiverCommand request, CancellationToken cancel)
|
||||||
{
|
{
|
||||||
var envelope = await _envelopeExecutor.CreateEnvelopeAsync(request.UserId, request.Title, request.Message, request.TFAEnabled, cancel);
|
int userId = request.UserId ?? throw new InvalidOperationException("UserId cannot be null when creating an envelope.");
|
||||||
|
|
||||||
|
var envelope = await _envelopeExecutor.CreateEnvelopeAsync(userId, request.Title, request.Message, request.TFAEnabled, cancel);
|
||||||
|
|
||||||
List<EnvelopeReceiver> sentRecipients = new();
|
List<EnvelopeReceiver> sentRecipients = new();
|
||||||
List<ReceiverGetOrCreateCommand> unsentRecipients = new();
|
List<ReceiverGetOrCreateCommand> unsentRecipients = new();
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Commands.Create;
|
||||||
|
|
||||||
|
#region DTOs
|
||||||
|
/// <summary>
|
||||||
|
/// Signaturposition auf einem Dokument.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="X">X-Position</param>
|
||||||
|
/// <param name="Y">Y-Position</param>
|
||||||
|
/// <param name="Page">Seite, auf der sie sich befindet</param>
|
||||||
|
public record Signature([Required] double X, [Required] double Y, [Required] int Page);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// DTO für Empfänger, die erstellt oder abgerufen werden sollen.
|
||||||
|
/// Wenn nicht, wird sie erstellt und mit einer Signatur versehen.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Signatures">Unterschriften auf Dokumenten.</param>
|
||||||
|
/// <param name="Salution">Der Name, mit dem der Empfänger angesprochen werden soll. Bei Null oder keinem Wert wird der zuletzt verwendete Name verwendet.</param>
|
||||||
|
/// <param name="PhoneNumber">Sollte mit Vorwahl geschrieben werden</param>
|
||||||
|
public record ReceiverGetOrCreateCommand([Required] IEnumerable<Signature> Signatures, string? Salution = null, string? PhoneNumber = null)
|
||||||
|
{
|
||||||
|
private string _emailAddress = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// E-Mail-Adresse des Empfängers.
|
||||||
|
/// </summary>
|
||||||
|
[Required]
|
||||||
|
public string EmailAddress { get => _emailAddress.ToLower(); init => _emailAddress = value.ToLower(); }
|
||||||
|
};
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// DTO zum Erstellen eines Dokuments.
|
||||||
|
/// </summary>
|
||||||
|
public record DocumentCreateCommand()
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Die Dokumentdaten im Base64-String-Format. Wird verwendet, wenn das Dokument als Base64-codierter String bereitgestellt wird.
|
||||||
|
/// </summary>
|
||||||
|
[Required]
|
||||||
|
public required string DataAsBase64 { get; init; }
|
||||||
|
};
|
||||||
|
#endregion
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
using AutoMapper;
|
||||||
|
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||||
|
using EnvelopeGenerator.Application.Envelopes.Commands;
|
||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Commands.Create;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class CreateEnvelopeReceiverMappingProfile : Profile
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public CreateEnvelopeReceiverMappingProfile()
|
||||||
|
{
|
||||||
|
CreateMap<Envelope, CreateEnvelopeResponse>();
|
||||||
|
CreateMap<Receiver, ReceiverReadDto>();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
using DigitalData.UserManager.Domain.Entities;
|
||||||
|
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||||
|
using EnvelopeGenerator.Application.Envelopes.Commands;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Commands.Create;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public record CreateEnvelopeReceiverResponse : CreateEnvelopeResponse
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Id"></param>
|
||||||
|
/// <param name="UserId"></param>
|
||||||
|
/// <param name="Status"></param>
|
||||||
|
/// <param name="Uuid"></param>
|
||||||
|
/// <param name="Message"></param>
|
||||||
|
/// <param name="AddedWhen"></param>
|
||||||
|
/// <param name="ChangedWhen"></param>
|
||||||
|
/// <param name="Title"></param>
|
||||||
|
/// <param name="Language"></param>
|
||||||
|
/// <param name="TFAEnabled"></param>
|
||||||
|
/// <param name="User"></param>
|
||||||
|
public CreateEnvelopeReceiverResponse(int Id, int UserId, int Status, string Uuid, string? Message, DateTime AddedWhen, DateTime? ChangedWhen, string? Title, string Language, bool TFAEnabled, User User) : base(Id, UserId, Status, Uuid, Message, AddedWhen, ChangedWhen, Title, Language, TFAEnabled, User)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public IEnumerable<ReceiverReadDto> SentReceiver { get; set; } = new List<ReceiverReadDto>();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public IEnumerable<ReceiverGetOrCreateCommand> UnsentReceivers { get; set; } = new List<ReceiverGetOrCreateCommand>();
|
||||||
|
}
|
||||||
@@ -1,81 +0,0 @@
|
|||||||
using EnvelopeGenerator.Application.Envelopes.Commands;
|
|
||||||
using MediatR;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Commands;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Befehl zur Erstellung eines Umschlags.
|
|
||||||
/// </summary>
|
|
||||||
public record CreateEnvelopeReceiverCommand : CreateEnvelopeCommand, IRequest<CreateEnvelopeReceiverResponse>
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Das mit dem Umschlag verknüpfte Dokument. Dies ist ein Pflichtfeld.
|
|
||||||
/// </summary>
|
|
||||||
[Required]
|
|
||||||
public required DocumentCreateCommand Document { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Eine Sammlung von Empfängern, die den Umschlag erhalten. Dies ist ein Pflichtfeld.
|
|
||||||
/// </summary>
|
|
||||||
[Required]
|
|
||||||
public List<ReceiverGetOrCreateCommand> Receivers { get; set; } = new();
|
|
||||||
}
|
|
||||||
|
|
||||||
#region Subcommands
|
|
||||||
/// <summary>
|
|
||||||
/// Signaturposition auf einem Dokument.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="X">X-Position</param>
|
|
||||||
/// <param name="Y">Y-Position</param>
|
|
||||||
/// <param name="Page">Seite, auf der sie sich befindet</param>
|
|
||||||
public record Signature([Required] double X, [Required] double Y, [Required] int Page);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// DTO für Empfänger, die erstellt oder abgerufen werden sollen.
|
|
||||||
/// Wenn nicht, wird sie erstellt und mit einer Signatur versehen.
|
|
||||||
/// </summary>
|
|
||||||
public class ReceiverGetOrCreateCommand
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Unterschriften auf Dokumenten.
|
|
||||||
/// </summary>
|
|
||||||
[Required]
|
|
||||||
public List<Signature> Signatures { get; init; } = new();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Der Name, mit dem der Empfänger angesprochen werden soll.
|
|
||||||
/// Bei Null oder keinem Wert wird der zuletzt verwendete Name verwendet.
|
|
||||||
/// </summary>
|
|
||||||
public string? Salution { get; init; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Sollte mit Vorwahl geschrieben werden
|
|
||||||
/// </summary>
|
|
||||||
public string? PhoneNumber { get; init; }
|
|
||||||
|
|
||||||
private string _emailAddress = string.Empty;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// E-Mail-Adresse des Empfängers.
|
|
||||||
/// </summary>
|
|
||||||
[Required]
|
|
||||||
public string EmailAddress
|
|
||||||
{
|
|
||||||
get => _emailAddress.ToLower();
|
|
||||||
init => _emailAddress = value.ToLower();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// DTO zum Erstellen eines Dokuments.
|
|
||||||
/// </summary>
|
|
||||||
public record DocumentCreateCommand()
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Die Dokumentdaten im Base64-String-Format. Wird verwendet, wenn das Dokument als Base64-codierter String bereitgestellt wird.
|
|
||||||
/// </summary>
|
|
||||||
[Required]
|
|
||||||
public required string DataAsBase64 { get; init; }
|
|
||||||
};
|
|
||||||
#endregion
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
using EnvelopeGenerator.Application.Dto;
|
|
||||||
using EnvelopeGenerator.Application.Dto.Receiver;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Commands;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public record CreateEnvelopeReceiverResponse : EnvelopeDto
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public IEnumerable<ReceiverReadDto> SentReceiver { get; set; } = new List<ReceiverReadDto>();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public IEnumerable<ReceiverGetOrCreateCommand> UnsentReceivers { get; set; } = new List<ReceiverGetOrCreateCommand>();
|
|
||||||
}
|
|
||||||
@@ -1,23 +1,16 @@
|
|||||||
using MediatR;
|
using EnvelopeGenerator.Application.Histories;
|
||||||
using EnvelopeGenerator.Application.Model;
|
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Envelopes.Queries;
|
namespace EnvelopeGenerator.Application.EnvelopeReceivers;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Repräsentiert eine Abfrage für Umschläge.
|
/// Stellt eine Abfrage für einen Envelope-Empfänger dar.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public record ReadEnvelopeQuery : EnvelopeQueryBase, IRequest
|
/// <param name="Status">Der Status der Abfrage, optional.</param>
|
||||||
{
|
public record EnvelopeReceiverQuery(EnvelopeStatusQuery? Status = null);
|
||||||
/// <summary>
|
|
||||||
/// Abfrage des Include des Umschlags
|
|
||||||
/// </summary>
|
|
||||||
public EnvelopeStatusQuery? Status { get; init; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Repräsentiert den Include eines Umschlags und dessen Beziehung zum Empfänger. (vgl. auch <see cref="EnvelopeStatusQuery"/>
|
/// Repräsentiert den Status eines Umschlags und dessen Beziehung zum Empfänger. (vgl. auch <see cref="Common.Constants.EnvelopeStatus"/>
|
||||||
/// Invalid (0): Ungültiger Include.
|
/// Invalid (0): Ungültiger Status.
|
||||||
/// EnvelopeCreated (1001): Der Umschlag wurde erstellt.
|
/// EnvelopeCreated (1001): Der Umschlag wurde erstellt.
|
||||||
/// EnvelopeSaved (1002): Der Umschlag wurde gespeichert.
|
/// EnvelopeSaved (1002): Der Umschlag wurde gespeichert.
|
||||||
/// EnvelopeQueued (1003): Der Umschlag wurde zur Verarbeitung eingeplant.
|
/// EnvelopeQueued (1003): Der Umschlag wurde zur Verarbeitung eingeplant.
|
||||||
@@ -42,27 +35,13 @@ public record ReadEnvelopeQuery : EnvelopeQueryBase, IRequest
|
|||||||
/// MessageConfirmationSent (3003): Bestätigungsnachricht wurde gesendet.
|
/// MessageConfirmationSent (3003): Bestätigungsnachricht wurde gesendet.
|
||||||
/// MessageDeletionSent (3004): Löschbenachrichtigung wurde gesendet.
|
/// MessageDeletionSent (3004): Löschbenachrichtigung wurde gesendet.
|
||||||
/// MessageCompletionSent (3005): Abschlussbenachrichtigung wurde gesendet.
|
/// MessageCompletionSent (3005): Abschlussbenachrichtigung wurde gesendet.
|
||||||
|
/// <param name="Min">Der minimale Statuswert, der berücksichtigt werden soll.</param>
|
||||||
|
/// <param name="Max">Der maximale Statuswert, der berücksichtigt werden soll.</param>
|
||||||
|
/// <param name="Ignore">Eine Liste von Statuswerten, die ignoriert werden sollen.</param>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
public record EnvelopeStatusQuery(
|
||||||
public record EnvelopeStatusQuery
|
int? Min = null,
|
||||||
|
int? Max = null,
|
||||||
|
int[]? Ignore = null)
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Der minimale Statuswert, der berücksichtigt werden.
|
|
||||||
/// </summary>
|
|
||||||
public EnvelopeStatus? Min { get; init; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Der maximale Statuswert, der berücksichtigt werden.
|
|
||||||
/// </summary>
|
|
||||||
public EnvelopeStatus? Max { get; init; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Eine Liste von Statuswerten, die einbezogen werden.
|
|
||||||
/// </summary>
|
|
||||||
public EnvelopeStatus[]? Include { get; init; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Eine Liste von Statuswerten, die ignoriert werden werden.
|
|
||||||
/// </summary>
|
|
||||||
public EnvelopeStatus[]? Ignore { get; init; }
|
|
||||||
}
|
}
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
using AutoMapper;
|
|
||||||
using EnvelopeGenerator.Application.Dto.Receiver;
|
|
||||||
using EnvelopeGenerator.Application.Envelopes.Commands;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.EnvelopeReceivers;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public class MappingProfile : Profile
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public MappingProfile()
|
|
||||||
{
|
|
||||||
CreateMap<Receiver, ReceiverReadDto>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
using EnvelopeGenerator.Application.Histories;
|
||||||
|
using EnvelopeGenerator.Application.Envelopes.Queries.Read;
|
||||||
|
using EnvelopeGenerator.Application.Receivers.Queries.Read;
|
||||||
|
using MediatR;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Queries.Read;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Repräsentiert eine Abfrage zum Lesen eines Envelope-Empfängers.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Diese Abfrage kombiniert Informationen über einen Umschlag (<see cref="ReadEnvelopeQuery"/>)
|
||||||
|
/// und einen Empfänger (<see cref="ReadReceiverQuery"/>), um eine vollständige Antwort
|
||||||
|
/// (<see cref="ReadEnvelopeReceiverResponse"/>) zu generieren.
|
||||||
|
/// Die Antwort enthält Details wie den Status, die Zuordnung zwischen Umschlag und Empfänger
|
||||||
|
/// sowie zusätzliche Metadaten.
|
||||||
|
/// </remarks>
|
||||||
|
/// <param name="Status">Umschlag oder Empfängerstatus.</param>
|
||||||
|
public record ReadEnvelopeReceiverQuery(EnvelopeStatusQuery? Status = null) : EnvelopeReceiverQuery(Status), IRequest<ReadEnvelopeReceiverResponse>
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Der Umschlag, der mit dem Empfänger verknüpft ist.
|
||||||
|
/// </summary>
|
||||||
|
public ReadEnvelopeQuery? Envelope { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Der Empfänger, der mit dem Umschlag verknüpft ist.
|
||||||
|
/// </summary>
|
||||||
|
public ReadReceiverQuery? Receiver { get; init; }
|
||||||
|
};
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
|
||||||
|
using EnvelopeGenerator.Application.Envelopes.Queries.Read;
|
||||||
|
using EnvelopeGenerator.Application.Receivers.Queries.Read;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Queries.Read;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Repräsentiert die Antwort für das Lesen eines Envelope-Empfängers.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Diese Klasse enthält Informationen über einen spezifischen Empfänger eines Umschlags (Envelope).
|
||||||
|
/// Sie verknüpft die Empfängerinformationen mit den zugehörigen Umschlagsdaten und bietet zusätzliche Metadaten.
|
||||||
|
/// </remarks>
|
||||||
|
/// <param name="UserId">Die eindeutige Kennung des Benutzers, der den Empfänger erstellt hat.</param>
|
||||||
|
/// <param name="Status">Der Status des Empfängers als numerischer Wert.</param>
|
||||||
|
public record ReadEnvelopeReceiverResponse(int UserId, int Status)
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gibt die zusammengesetzte Kennung des Empfängers zurück, bestehend aus der Umschlags-ID und der Empfänger-ID.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Diese Eigenschaft kombiniert die eindeutige Kennung des Umschlags (EnvelopeId) und die des Empfängers (ReceiverId)
|
||||||
|
/// zu einer einzigen, leicht zugänglichen Struktur.
|
||||||
|
/// </remarks>
|
||||||
|
[NotMapped]
|
||||||
|
public (int Envelope, int Receiver) Id => (Envelope: EnvelopeId, Receiver: ReceiverId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Die eindeutige Kennung des zugehörigen Umschlags.
|
||||||
|
/// </summary>
|
||||||
|
[Required]
|
||||||
|
public int EnvelopeId { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Die eindeutige Kennung des Empfängers.
|
||||||
|
/// </summary>
|
||||||
|
[Required]
|
||||||
|
public int ReceiverId { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Die Reihenfolge des Empfängers innerhalb des Umschlags.
|
||||||
|
/// </summary>
|
||||||
|
public int Sequence { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Der Name des Empfängers. Kann als Platzhalter verwendet werden.
|
||||||
|
/// </summary>
|
||||||
|
[TemplatePlaceholder("[NAME_RECEIVER]")]
|
||||||
|
public string? Name { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Die Berufsbezeichnung des Empfängers.
|
||||||
|
/// </summary>
|
||||||
|
public string? JobTitle { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Der Firmenname des Empfängers.
|
||||||
|
/// </summary>
|
||||||
|
public string? CompanyName { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Eine private Nachricht, die mit dem Empfänger verknüpft ist.
|
||||||
|
/// </summary>
|
||||||
|
public string? PrivateMessage { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Das Datum und die Uhrzeit, wann der Empfänger hinzugefügt wurde.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime AddedWhen { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Das Datum und die Uhrzeit, wann der Empfänger zuletzt geändert wurde (falls vorhanden).
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? ChangedWhen { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gibt an, ob der Empfänger eine Telefonnummer hat.
|
||||||
|
/// </summary>
|
||||||
|
public bool HasPhoneNumber { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Die zugehörigen Umschlagsdaten.
|
||||||
|
/// </summary>
|
||||||
|
[Required]
|
||||||
|
public required ReadEnvelopeResponse Envelope { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Die Liste der Empfängerinformationen.
|
||||||
|
/// </summary>
|
||||||
|
[Required]
|
||||||
|
public IEnumerable<ReadReceiverResponse> Receiver { get; init; } = new List<ReadReceiverResponse>();
|
||||||
|
}
|
||||||
@@ -1,126 +0,0 @@
|
|||||||
using AutoMapper;
|
|
||||||
using DigitalData.Core.Abstraction.Application.Repository;
|
|
||||||
using DigitalData.Core.Exceptions;
|
|
||||||
using EnvelopeGenerator.Application.Dto.EnvelopeReceiver;
|
|
||||||
using EnvelopeGenerator.Application.Envelopes.Queries;
|
|
||||||
using EnvelopeGenerator.Application.Extensions;
|
|
||||||
using EnvelopeGenerator.Application.Model;
|
|
||||||
using EnvelopeGenerator.Application.Receivers.Queries;
|
|
||||||
using MediatR;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Queries;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Repräsentiert eine Abfrage zum Lesen eines Envelope-Empfängers.
|
|
||||||
/// Invalid (0): Ungültiger Include.
|
|
||||||
/// EnvelopeCreated (1001): Der Umschlag wurde erstellt.
|
|
||||||
/// EnvelopeSaved (1002): Der Umschlag wurde gespeichert.
|
|
||||||
/// EnvelopeQueued (1003): Der Umschlag wurde zur Verarbeitung eingeplant.
|
|
||||||
/// EnvelopeSent (1004): Der Umschlag wurde versendet. (Nicht verwendet)
|
|
||||||
/// EnvelopePartlySigned (1005): Der Umschlag wurde teilweise unterschrieben.
|
|
||||||
/// EnvelopeCompletelySigned (1006): Der Umschlag wurde vollständig unterschrieben.
|
|
||||||
/// EnvelopeReportCreated (1007): Ein Abschlussbericht wurde für den Umschlag erstellt.
|
|
||||||
/// EnvelopeArchived (1008): Der Umschlag wurde archiviert.
|
|
||||||
/// EnvelopeDeleted (1009): Der Umschlag wurde gelöscht.
|
|
||||||
/// AccessCodeRequested (2001): Der Zugriffscode wurde angefordert.
|
|
||||||
/// AccessCodeCorrect (2002): Der Zugriffscode war korrekt.
|
|
||||||
/// AccessCodeIncorrect (2003): Der Zugriffscode war falsch.
|
|
||||||
/// DocumentOpened (2004): Das Dokument wurde geöffnet.
|
|
||||||
/// DocumentSigned (2005): Ein Dokument wurde unterschrieben.
|
|
||||||
/// SignatureConfirmed (2006): Die Signatur wurde bestätigt.
|
|
||||||
/// DocumentRejected (2007): Ein Dokument wurde abgelehnt.
|
|
||||||
/// EnvelopeShared (2008): Der Umschlag wurde geteilt.
|
|
||||||
/// EnvelopeViewed (2009): Der Umschlag wurde angesehen.
|
|
||||||
/// DocumentForwarded (4001): Das Dokument wurde weitergeleitet.
|
|
||||||
/// MessageInvitationSent (3001): Einladung wurde gesendet (vom Trigger verwendet).
|
|
||||||
/// MessageAccessCodeSent (3002): Zugriffscode wurde gesendet.
|
|
||||||
/// MessageConfirmationSent (3003): Bestätigungsnachricht wurde gesendet.
|
|
||||||
/// MessageDeletionSent (3004): Löschbenachrichtigung wurde gesendet.
|
|
||||||
/// MessageCompletionSent (3005): Abschlussbenachrichtigung wurde gesendet.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// Diese Abfrage kombiniert Informationen über einen Umschlag (<see cref="ReadEnvelopeQuery"/>)
|
|
||||||
/// und einen Empfänger (<see cref="ReadReceiverQuery"/>), um eine vollständige Antwort
|
|
||||||
/// (<see cref="EnvelopeReceiverDto"/>) zu generieren.
|
|
||||||
/// Die Antwort enthält Details wie den Include, die Zuordnung zwischen Umschlag und Empfänger
|
|
||||||
/// sowie zusätzliche Metadaten.
|
|
||||||
/// </remarks>
|
|
||||||
public record ReadEnvelopeReceiverQuery : EnvelopeReceiverQueryBase<ReadEnvelopeQuery, ReadReceiverQuery>, IRequest<IEnumerable<EnvelopeReceiverDto>>;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public static class Extensions
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="mediator"></param>
|
|
||||||
/// <param name="key"></param>
|
|
||||||
/// <param name="cancel"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public static Task<EnvelopeReceiverDto?> ReadEnvelopeReceiverAsync(this IMediator mediator, string key, CancellationToken cancel = default)
|
|
||||||
{
|
|
||||||
var q = new ReadEnvelopeReceiverQuery() { Key = key };
|
|
||||||
return mediator.Send(q, cancel).Then(envRcvs => envRcvs.FirstOrDefault());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public class ReadEnvelopeReceiverQueryHandler : IRequestHandler<ReadEnvelopeReceiverQuery, IEnumerable<EnvelopeReceiverDto>>
|
|
||||||
{
|
|
||||||
private readonly IRepository<EnvelopeReceiver> _repo;
|
|
||||||
|
|
||||||
private readonly IMapper _mapper;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="envelopeReceiver"></param>
|
|
||||||
/// <param name="mapper"></param>
|
|
||||||
public ReadEnvelopeReceiverQueryHandler(IRepository<EnvelopeReceiver> envelopeReceiver, IMapper mapper)
|
|
||||||
{
|
|
||||||
_repo = envelopeReceiver;
|
|
||||||
_mapper = mapper;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="request"></param>
|
|
||||||
/// <param name="cancel"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
/// <exception cref="BadRequestException"></exception>
|
|
||||||
public async Task<IEnumerable<EnvelopeReceiverDto>> Handle(ReadEnvelopeReceiverQuery request, CancellationToken cancel)
|
|
||||||
{
|
|
||||||
var q = _repo.Read().Where(request, notnull: false);
|
|
||||||
|
|
||||||
if (request.Envelope.Status is not null)
|
|
||||||
{
|
|
||||||
var status = request.Envelope.Status;
|
|
||||||
if (status.Min is not null)
|
|
||||||
q = q.Where(er => er.Envelope!.Status >= status.Min);
|
|
||||||
|
|
||||||
if (status.Max is not null)
|
|
||||||
q = q.Where(er => er.Envelope!.Status <= status.Max);
|
|
||||||
|
|
||||||
if (status.Include?.Length > 0)
|
|
||||||
q = q.Where(er => status.Include.Contains(er.Envelope!.Status));
|
|
||||||
|
|
||||||
if (status.Ignore is not null)
|
|
||||||
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)
|
|
||||||
.Include(er => er.Envelope).ThenInclude(e => e!.History)
|
|
||||||
.Include(er => er.Envelope).ThenInclude(e => e!.User)
|
|
||||||
.Include(er => er.Receiver)
|
|
||||||
.ToListAsync(cancel);
|
|
||||||
|
|
||||||
return _mapper.Map<IEnumerable<EnvelopeReceiverDto>>(envRcvs);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
using DigitalData.Core.Abstraction.Application.Repository;
|
|
||||||
using EnvelopeGenerator.Application.Model;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
|
||||||
using EnvelopeGenerator.Application.Extensions;
|
|
||||||
using MediatR;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Queries;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public record ReceiverAlreadySignedQuery : EnvelopeReceiverQueryBase, IRequest<bool>;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public static class ReceiverAlreadySignedQueryExtensions
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="mediator"></param>
|
|
||||||
/// <param name="key"></param>
|
|
||||||
/// <param name="cancel"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public static Task<bool> IsSignedAsync(this IMediator mediator, string key, CancellationToken cancel = default)
|
|
||||||
=> mediator.Send(new ReceiverAlreadySignedQuery { Key = key }, cancel);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="mediator"></param>
|
|
||||||
/// <param name="uuid"></param>
|
|
||||||
/// <param name="signature"></param>
|
|
||||||
/// <param name="cancel"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public static Task<bool> IsSignedAsync(this IMediator mediator, string uuid, string signature, CancellationToken cancel = default)
|
|
||||||
=> mediator.Send(new ReceiverAlreadySignedQuery
|
|
||||||
{
|
|
||||||
Envelope = new() { Uuid = uuid },
|
|
||||||
Receiver = new() { Signature = signature }
|
|
||||||
}, cancel);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public class ReceiverAlreadySignedQueryHandler : IRequestHandler<ReceiverAlreadySignedQuery, bool>
|
|
||||||
{
|
|
||||||
private readonly IRepository<EnvelopeReceiver> _repo;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="repo"></param>
|
|
||||||
public ReceiverAlreadySignedQueryHandler(IRepository<EnvelopeReceiver> repo)
|
|
||||||
{
|
|
||||||
_repo = repo;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="request"></param>
|
|
||||||
/// <param name="cancel"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<bool> Handle(ReceiverAlreadySignedQuery request, CancellationToken cancel = default)
|
|
||||||
{
|
|
||||||
return await _repo.Read()
|
|
||||||
.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,9 +1,6 @@
|
|||||||
using DigitalData.Core.Abstraction.Application.Repository;
|
using MediatR;
|
||||||
using EnvelopeGenerator.Application.Dto;
|
using Microsoft.AspNetCore.Mvc.ModelBinding;
|
||||||
using EnvelopeGenerator.Application.Interfaces.SQLExecutor;
|
|
||||||
using MediatR;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Envelopes.Commands;
|
namespace EnvelopeGenerator.Application.Envelopes.Commands;
|
||||||
@@ -11,37 +8,19 @@ namespace EnvelopeGenerator.Application.Envelopes.Commands;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Befehl zur Erstellung eines Umschlags.
|
/// Befehl zur Erstellung eines Umschlags.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public record CreateEnvelopeCommand : IRequest<EnvelopeDto?>
|
/// <param name="Title">Der Titel des Umschlags. Dies ist ein Pflichtfeld.</param>
|
||||||
|
/// <param name="Message">Die Nachricht, die im Umschlag enthalten sein soll. Dies ist ein Pflichtfeld.</param>
|
||||||
|
/// <param name="TFAEnabled">Gibt an, ob die Zwei-Faktor-Authentifizierung für den Umschlag aktiviert ist. Standardmäßig false.</param>
|
||||||
|
public record CreateEnvelopeCommand(
|
||||||
|
[Required] string Title,
|
||||||
|
[Required] string Message,
|
||||||
|
bool TFAEnabled = false
|
||||||
|
) : IRequest<CreateEnvelopeResponse?>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Der Titel des Umschlags. Dies ist ein Pflichtfeld.
|
/// Id of receiver
|
||||||
/// </summary>
|
|
||||||
[Required]
|
|
||||||
public required string Title { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Die Nachricht, die im Umschlag enthalten sein soll. Dies ist ein Pflichtfeld.
|
|
||||||
/// </summary>
|
|
||||||
[Required]
|
|
||||||
public required string Message { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gibt an, ob die Zwei-Faktor-Authentifizierung für den Umschlag aktiviert ist. Standardmäßig false.
|
|
||||||
/// </summary>
|
|
||||||
public bool TFAEnabled { get; set; } = false;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ID des Absenders
|
|
||||||
/// </summary>
|
|
||||||
public int UserId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Determines which component is used for envelope processing.
|
|
||||||
/// When <c>true</c>, processing is delegated to <see cref="IEnvelopeExecutor"/>;
|
|
||||||
/// when <c>false</c>, <see cref="IRepository{Envelope}"/> is used instead.
|
|
||||||
/// Note: <see cref="IRepository{Envelope}"/> should only be used in testing scenarios.
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
[NotMapped]
|
[BindNever]
|
||||||
public bool UseSQLExecutor { get; set; } = true;
|
public int? UserId { get; set; }
|
||||||
}
|
};
|
||||||
|
|||||||
@@ -1,34 +1,26 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using EnvelopeGenerator.Application.Interfaces.SQLExecutor;
|
using EnvelopeGenerator.Application.Contracts.SQLExecutor;
|
||||||
using EnvelopeGenerator.Application.Dto;
|
|
||||||
using MediatR;
|
using MediatR;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
|
||||||
using DigitalData.Core.Abstraction.Application.Repository;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Envelopes.Commands;
|
namespace EnvelopeGenerator.Application.Envelopes.Commands;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class CreateEnvelopeCommandHandler : IRequestHandler<CreateEnvelopeCommand, EnvelopeDto?>
|
public class CreateEnvelopeCommandHandler : IRequestHandler<CreateEnvelopeCommand, CreateEnvelopeResponse?>
|
||||||
{
|
{
|
||||||
private readonly IServiceProvider _provider;
|
private readonly IEnvelopeExecutor _envelopeExecutor;
|
||||||
|
|
||||||
private IEnvelopeExecutor Executor => _provider.GetRequiredService<IEnvelopeExecutor>();
|
|
||||||
|
|
||||||
private IRepository<Envelope> Repository => _provider.GetRequiredService<IRepository<Envelope>>();
|
|
||||||
|
|
||||||
private readonly IMapper _mapper;
|
private readonly IMapper _mapper;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="provider"></param>
|
/// <param name="envelopeExecutor"></param>
|
||||||
/// <param name="mapper"></param>
|
/// <param name="mapper"></param>
|
||||||
public CreateEnvelopeCommandHandler(IServiceProvider provider, IMapper mapper)
|
public CreateEnvelopeCommandHandler(IEnvelopeExecutor envelopeExecutor, IMapper mapper)
|
||||||
{
|
{
|
||||||
_provider = provider;
|
_envelopeExecutor = envelopeExecutor;
|
||||||
_mapper = mapper;
|
_mapper = mapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -36,14 +28,14 @@ public class CreateEnvelopeCommandHandler : IRequestHandler<CreateEnvelopeComman
|
|||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="request"></param>
|
/// <param name="request"></param>
|
||||||
/// <param name="cancel"></param>
|
/// <param name="cancellationToken"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<EnvelopeDto?> Handle(CreateEnvelopeCommand request, CancellationToken cancel)
|
public async Task<CreateEnvelopeResponse?> Handle(CreateEnvelopeCommand request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var envelope = request.UseSQLExecutor
|
int userId = request.UserId ?? throw new InvalidOperationException("UserId cannot be null when creating an envelope.");
|
||||||
? await Executor.CreateEnvelopeAsync(request.UserId, request.Title, request.Message, request.TFAEnabled, cancel)
|
|
||||||
: await Repository.CreateAsync(request, cancel);
|
|
||||||
|
|
||||||
return _mapper.Map<EnvelopeDto>(envelope);
|
var envelope = await _envelopeExecutor.CreateEnvelopeAsync(userId, request.Title, request.Message, request.TFAEnabled, cancellationToken);
|
||||||
|
|
||||||
|
return _mapper.Map<CreateEnvelopeResponse>(envelope);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
using AutoMapper;
|
||||||
|
using EnvelopeGenerator.Application.EnvelopeReceivers.Commands.Create;
|
||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Envelopes.Commands;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class CreateEnvelopeMappingProfile : Profile
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public CreateEnvelopeMappingProfile()
|
||||||
|
{
|
||||||
|
CreateMap<Envelope, CreateEnvelopeReceiverResponse>();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
using EnvelopeGenerator.Application.Envelopes.Queries.Read;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Envelopes.Commands;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Id"><inheritdoc/></param>
|
||||||
|
/// <param name="UserId"><inheritdoc/></param>
|
||||||
|
/// <param name="Status"><inheritdoc/></param>
|
||||||
|
/// <param name="Uuid"><inheritdoc/></param>
|
||||||
|
/// <param name="Message"><inheritdoc/></param>
|
||||||
|
/// <param name="AddedWhen"><inheritdoc/></param>
|
||||||
|
/// <param name="ChangedWhen"><inheritdoc/></param>
|
||||||
|
/// <param name="Title"><inheritdoc/></param>
|
||||||
|
/// <param name="Language"><inheritdoc/></param>
|
||||||
|
/// <param name="TFAEnabled"><inheritdoc/></param>
|
||||||
|
/// <param name="User"><inheritdoc/></param>
|
||||||
|
public record CreateEnvelopeResponse(int Id, int UserId, int Status, string Uuid, string? Message, DateTime AddedWhen, DateTime? ChangedWhen, string? Title, string Language, bool TFAEnabled, DigitalData.UserManager.Domain.Entities.User User)
|
||||||
|
: ReadEnvelopeResponse(Id, UserId, Status, Uuid, Message, AddedWhen, ChangedWhen, Title, Language, TFAEnabled, User);
|
||||||
16
EnvelopeGenerator.Application/Envelopes/EnvelopeQuery.cs
Normal file
16
EnvelopeGenerator.Application/Envelopes/EnvelopeQuery.cs
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
using MediatR;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Envelopes;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Repräsentiert eine Abfrage für Umschläge.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Id">Die eindeutige Kennung des Umschlags.</param>
|
||||||
|
/// <param name="Status">Der Status des Umschlags.</param>
|
||||||
|
/// <param name="Uuid">Die universell eindeutige Kennung des Umschlags.</param>
|
||||||
|
public record EnvelopeQuery(
|
||||||
|
int? Id = null,
|
||||||
|
int? Status = null,
|
||||||
|
string? Uuid = null) : IRequest
|
||||||
|
{
|
||||||
|
};
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
using AutoMapper;
|
|
||||||
using EnvelopeGenerator.Application.EnvelopeReceivers.Commands;
|
|
||||||
using EnvelopeGenerator.Application.Envelopes.Commands;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Envelopes;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public class MappingProfile : Profile
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public MappingProfile()
|
|
||||||
{
|
|
||||||
CreateMap<Envelope, CreateEnvelopeReceiverResponse>();
|
|
||||||
CreateMap<CreateEnvelopeCommand, Envelope>()
|
|
||||||
.ForMember(dest => dest.Uuid, opt => opt.MapFrom(_ => Guid.NewGuid().ToString()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
namespace EnvelopeGenerator.Application.Envelopes.Queries.Read;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stellt eine Abfrage zum Lesen von Briefumschlägen dar.
|
||||||
|
/// </summary>
|
||||||
|
public record ReadEnvelopeQuery : EnvelopeQuery
|
||||||
|
{
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
using EnvelopeGenerator.Domain;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Envelopes.Queries.Read;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Repräsentiert die Antwort für das Lesen eines Umschlags.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Id">Die eindeutige Kennung des Umschlags.</param>
|
||||||
|
/// <param name="UserId">Die Kennung des Benutzers, der den Umschlag erstellt hat.</param>
|
||||||
|
/// <param name="Status">Der Status des Umschlags als numerischer Wert.</param>
|
||||||
|
/// <param name="Uuid">Die universelle eindeutige Kennung (UUID) des Umschlags.</param>
|
||||||
|
/// <param name="Message">Eine optionale Nachricht, die mit dem Umschlag verknüpft ist.</param>
|
||||||
|
/// <param name="AddedWhen">Das Datum und die Uhrzeit, wann der Umschlag hinzugefügt wurde.</param>
|
||||||
|
/// <param name="ChangedWhen">Das Datum und die Uhrzeit, wann der Umschlag zuletzt geändert wurde (falls vorhanden).</param>
|
||||||
|
/// <param name="Title">Ein optionaler Titel des Umschlags.</param>
|
||||||
|
/// <param name="Language">Die Sprache, die mit dem Umschlag verknüpft ist.</param>
|
||||||
|
/// <param name="TFAEnabled">Gibt an, ob die Zwei-Faktor-Authentifizierung (TFA) aktiviert ist.</param>
|
||||||
|
/// <param name="User">Das Benutzerobjekt, das mit dem Umschlag verknüpft ist.</param>
|
||||||
|
public record ReadEnvelopeResponse(
|
||||||
|
int Id,
|
||||||
|
int UserId,
|
||||||
|
int Status,
|
||||||
|
string Uuid,
|
||||||
|
string? Message,
|
||||||
|
DateTime AddedWhen,
|
||||||
|
DateTime? ChangedWhen,
|
||||||
|
string? Title,
|
||||||
|
string Language,
|
||||||
|
bool TFAEnabled,
|
||||||
|
DigitalData.UserManager.Domain.Entities.User User)
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gibt den Namen des Status zurück, der dem numerischen Statuswert entspricht.
|
||||||
|
/// </summary>
|
||||||
|
public string StatusName => ((Constants.EnvelopeStatus)Status).ToString();
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using EnvelopeGenerator.Application.Receivers.Queries;
|
using EnvelopeGenerator.Application.Receivers.Queries.Read;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Envelopes.Queries;
|
namespace EnvelopeGenerator.Application.Envelopes.Queries.ReceiverName;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Eine Abfrage, um die zuletzt verwendete Anrede eines Empfängers zu ermitteln,
|
/// Eine Abfrage, um die zuletzt verwendete Anrede eines Empfängers zu ermitteln,
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
namespace EnvelopeGenerator.Application.Exceptions;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Represents an exception that is thrown when a bad request is encountered.
|
||||||
|
/// </summary>
|
||||||
|
public class BadRequestException : Exception
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="BadRequestException"/> class.
|
||||||
|
/// </summary>
|
||||||
|
public BadRequestException()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="BadRequestException"/> class with a specified error message.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message">The message that describes the error.</param>
|
||||||
|
public BadRequestException(string? message) : base(message)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user