Compare commits
112 Commits
feat/signF
...
bugfix/wro
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
286e17a900 | ||
|
|
a21db6d6c5 | ||
|
|
fe7030b9d7 | ||
|
|
888c04b5c9 | ||
| de2cc62f95 | |||
| 0cfa732d87 | |||
|
|
b14d9169f2 | ||
| be51ca31dd | |||
| bb8d7cd208 | |||
| b6588db615 | |||
| 9a9aa2608b | |||
| 349d65d050 | |||
| 93593226e2 | |||
| 351cead423 | |||
| 07cab88e0d | |||
| faa019355a | |||
| df9bcf3221 | |||
| cda19e2b83 | |||
| 1586009a72 | |||
| 408b1e9f0d | |||
| 9158933333 | |||
| 902848958d | |||
| f5418499a7 | |||
| 47d190d9ea | |||
| 35f46d3182 | |||
| 425d21084b | |||
| 6aeba4d1e7 | |||
| 6930d7a431 | |||
| c453a1650a | |||
| b9f5ae826a | |||
| 532dc41004 | |||
| 13899cf70a | |||
| 9756303d6e | |||
| 1c51fafb69 | |||
| 94d43bce24 | |||
| f5733228bf | |||
| e3cb2ec219 | |||
|
|
260c1c174d | ||
| 1c90e693da | |||
| e4c6714677 | |||
| 812b49cfcb | |||
| f039437f4c | |||
| 6f73ba929c | |||
| fcbe956095 | |||
| e628309734 | |||
| d6cbd0597e | |||
| 9d45082bfc | |||
| 3304b01d7b | |||
| f5d33846d5 | |||
| 231140505e | |||
| 62a73e4967 | |||
| dedfb924d8 | |||
| 08601adc49 | |||
| 2a4255e5a3 | |||
| 0800e4d13e | |||
| 07381e78b4 | |||
| 5d29ad889d | |||
| 5ee9efbcd9 | |||
| 5c48afd8b0 | |||
| 2dbeae24d5 | |||
| ff1e9f27af | |||
| db05183137 | |||
| 452077e86a | |||
| f8a7239041 | |||
|
|
a1688608ab | ||
| 72fa6fb258 | |||
|
|
3c60f31050 | ||
|
|
f1920e16fa | ||
|
|
c1d46b446a | ||
|
|
a5261baec5 | ||
|
|
3eb11311a7 | ||
|
|
10b05d6301 | ||
|
|
c6fe039dd8 | ||
|
|
1f43dff9f4 | ||
|
|
dafa4f0409 | ||
|
|
3625508460 | ||
|
|
7326f03a8d | ||
|
|
35e9f6404c | ||
|
|
dd6bc55fd6 | ||
|
|
8e4266fcf6 | ||
|
|
10aa857544 | ||
|
|
4fc94fc567 | ||
|
|
b83607d916 | ||
|
|
a38c2cd956 | ||
|
|
502c607ebd | ||
|
|
39c1d3e624 | ||
|
|
39cc30f48b | ||
|
|
79204d4f6d | ||
|
|
806b990556 | ||
|
|
d34a1016c4 | ||
|
|
93dbe63fb4 | ||
|
|
55ffe40c46 | ||
|
|
be9516d852 | ||
|
|
12502bb2de | ||
|
|
26745e0c37 | ||
|
|
2ea5fd7dbb | ||
|
|
446aeb00b1 | ||
|
|
abc3bb7652 | ||
|
|
a8a768d7d6 | ||
|
|
31c4a8a20f | ||
|
|
e98abde5ff | ||
|
|
49497dafd1 | ||
|
|
08e1187124 | ||
|
|
1b923dc93b | ||
|
|
bdf2527fc1 | ||
|
|
1a69478f48 | ||
|
|
83d29bf78d | ||
|
|
bc45aadf27 | ||
|
|
7e66cd4dae | ||
|
|
cc11d70a27 | ||
|
|
02aeaea8a9 | ||
|
|
05867cc645 |
@@ -1,12 +1,24 @@
|
|||||||
namespace EnvelopeGenerator.Application.Configurations
|
namespace EnvelopeGenerator.Application.Configurations;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class AuthenticatorParams
|
||||||
{
|
{
|
||||||
public class AuthenticatorParams
|
/// <summary>
|
||||||
{
|
/// Default value is 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890123456789012345678901234567890123456789'
|
||||||
|
/// </summary>
|
||||||
public string CharPool { get; init; } = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890123456789012345678901234567890123456789";
|
public string CharPool { get; init; } = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890123456789012345678901234567890123456789";
|
||||||
|
|
||||||
//TODO: Increase the DefaultTotpSecretKeyLength (e.g. to 32) but make sure that the QR code is generated correctly and can be scanned by the authenticator.
|
//TODO: Increase the DefaultTotpSecretKeyLength (e.g. to 32) but make sure that the QR code is generated correctly and can be scanned by the authenticator.
|
||||||
|
/// <summary>
|
||||||
|
/// Default value is 20
|
||||||
|
/// </summary>
|
||||||
public int DefaultTotpSecretKeyLength { get; init; } = 20;
|
public int DefaultTotpSecretKeyLength { get; init; } = 20;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default value is
|
||||||
|
/// </summary>
|
||||||
public string TotpIssuer { get; init; } = "signFlow";
|
public string TotpIssuer { get; init; } = "signFlow";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -14,6 +26,8 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string TotpUrlFormat { get; init; } = "otpauth://totp/{0}?secret={1}&issuer={2}";
|
public string TotpUrlFormat { get; init; } = "otpauth://totp/{0}?secret={1}&issuer={2}";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default value is 20.
|
||||||
|
/// </summary>
|
||||||
public int TotpQRPixelsPerModule { get; init; } = 20;
|
public int TotpQRPixelsPerModule { get; init; } = 20;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,8 @@
|
|||||||
namespace EnvelopeGenerator.Application.Configurations;
|
namespace EnvelopeGenerator.Application.Configurations;
|
||||||
|
|
||||||
public class DbTriggerParams : Dictionary<string, IEnumerable<string>>
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class DbTriggerParams : Dictionary<string, ICollection<string>>
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,27 @@
|
|||||||
namespace EnvelopeGenerator.Application.Configurations;
|
namespace EnvelopeGenerator.Application.Configurations;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public class DispatcherParams
|
public class DispatcherParams
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Default value is 1
|
||||||
|
/// </summary>
|
||||||
public int SendingProfile { get; init; } = 1;
|
public int SendingProfile { get; init; } = 1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Defalt value is 'DDEnvelopGenerator'
|
||||||
|
/// </summary>
|
||||||
public string AddedWho { get; init; } = "DDEnvelopGenerator";
|
public string AddedWho { get; init; } = "DDEnvelopGenerator";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default value is 202377
|
||||||
|
/// </summary>
|
||||||
public int ReminderTypeId { get; init; } = 202377;
|
public int ReminderTypeId { get; init; } = 202377;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default value is string.Empty
|
||||||
|
/// </summary>
|
||||||
public string EmailAttmt1 { get; init; } = string.Empty;
|
public string EmailAttmt1 { get; init; } = string.Empty;
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
using DigitalData.Core.Abstractions.Client;
|
using DigitalData.Core.Client.Interface;
|
||||||
namespace EnvelopeGenerator.Application.Configurations;
|
namespace EnvelopeGenerator.Application.Configurations;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -6,15 +6,32 @@ namespace EnvelopeGenerator.Application.Configurations;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class GtxMessagingParams : IHttpClientOptions
|
public class GtxMessagingParams : IHttpClientOptions
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public required string Uri { get; init; }
|
public required string Uri { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public string? Path { get; init; }
|
public string? Path { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public Dictionary<string, object>? Headers { get; init; }
|
public Dictionary<string, object>? Headers { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public Dictionary<string, object?>? QueryParams { get; init; }
|
public Dictionary<string, object?>? QueryParams { get; init; }
|
||||||
|
/// <summary>
|
||||||
|
/// Default value is 'to'
|
||||||
|
/// </summary>
|
||||||
public string RecipientQueryParamName { get; init; } = "to";
|
public string RecipientQueryParamName { get; init; } = "to";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default value is 'text'
|
||||||
|
/// </summary>
|
||||||
public string MessageQueryParamName { get; init; } = "text";
|
public string MessageQueryParamName { get; init; } = "text";
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,12 @@
|
|||||||
namespace EnvelopeGenerator.Application.Configurations;
|
namespace EnvelopeGenerator.Application.Configurations;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public class MailParams
|
public class MailParams
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public required Dictionary<string, string> Placeholders { get; init; }
|
public required Dictionary<string, string> Placeholders { get; init; }
|
||||||
}
|
}
|
||||||
@@ -1,23 +1,38 @@
|
|||||||
using OtpNet;
|
using OtpNet;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Configurations
|
namespace EnvelopeGenerator.Application.Configurations;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class TotpSmsParams
|
||||||
{
|
{
|
||||||
public class TotpSmsParams
|
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The unit is second.
|
/// The unit is second.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int TotpStep { get; init; } = 90;
|
public int TotpStep { get; init; } = 90;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default value is 'Ihr 2FA-Passwort lautet {0}. Gültig bis {1}'
|
||||||
|
/// </summary>
|
||||||
public string Format { get; init; } = "Ihr 2FA-Passwort lautet {0}. Gültig bis {1}";
|
public string Format { get; init; } = "Ihr 2FA-Passwort lautet {0}. Gültig bis {1}";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public ExpirationHandler Expiration { get; init; } = new();
|
public ExpirationHandler Expiration { get; init; } = new();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default value is VerificationWindow.RfcSpecifiedNetworkDelay
|
||||||
|
/// </summary>
|
||||||
public VerificationWindow? TotpVerificationWindow { get; private init; } = VerificationWindow.RfcSpecifiedNetworkDelay;
|
public VerificationWindow? TotpVerificationWindow { get; private init; } = VerificationWindow.RfcSpecifiedNetworkDelay;
|
||||||
|
|
||||||
private IEnumerable<int>? _tvwParams;
|
private IEnumerable<int>? _tvwParams;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public IEnumerable<int>? TotpVerificationWindowParams
|
public IEnumerable<int>? TotpVerificationWindowParams
|
||||||
{
|
{
|
||||||
get => _tvwParams;
|
get => _tvwParams;
|
||||||
@@ -29,21 +44,38 @@ namespace EnvelopeGenerator.Application.Configurations
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public class ExpirationHandler
|
public class ExpirationHandler
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Default value is 'e{0}_r{1}_sms_code_expiration'
|
||||||
|
/// </summary>
|
||||||
public string CacheKeyFormat { get; init; } = "e{0}_r{1}_sms_code_expiration";
|
public string CacheKeyFormat { get; init; } = "e{0}_r{1}_sms_code_expiration";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default value is HH:mm:ss
|
||||||
|
/// </summary>
|
||||||
public string Format { get; init; } = "HH:mm:ss";
|
public string Format { get; init; } = "HH:mm:ss";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default value is 'de-DE'
|
||||||
|
/// </summary>
|
||||||
public string CultureName
|
public string CultureName
|
||||||
{
|
{
|
||||||
get => _cultureInfo.Name;
|
get => _cultureInfo.Name;
|
||||||
init => _cultureInfo = new(value);
|
init => _cultureInfo = new(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default value is 'de-DE'
|
||||||
|
/// </summary>
|
||||||
private CultureInfo _cultureInfo = new("de-DE");
|
private CultureInfo _cultureInfo = new("de-DE");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default value is 'de-DE'
|
||||||
|
/// </summary>
|
||||||
public CultureInfo CultureInfo => _cultureInfo;
|
public CultureInfo CultureInfo => _cultureInfo;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,17 @@
|
|||||||
using DigitalData.Core.Abstractions.Infrastructure;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete("Use IRepository")]
|
||||||
public interface IConfigRepository : ICRUDRepository<Config, int>
|
public interface IConfigRepository : ICRUDRepository<Config, int>
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
Task<Config?> ReadFirstAsync();
|
Task<Config?> ReadFirstAsync();
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,11 @@
|
|||||||
using DigitalData.Core.Abstractions.Infrastructure;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete("Use IRepository")]
|
||||||
public interface IDocumentReceiverElementRepository : ICRUDRepository<DocumentReceiverElement, int>
|
public interface IDocumentReceiverElementRepository : ICRUDRepository<DocumentReceiverElement, int>
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,12 @@
|
|||||||
using DigitalData.Core.Abstractions.Infrastructure;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete("Use IRepository")]
|
||||||
public interface IDocumentStatusRepository : ICRUDRepository<DocumentStatus, int>
|
public interface IDocumentStatusRepository : ICRUDRepository<DocumentStatus, int>
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,19 @@
|
|||||||
using DigitalData.Core.Abstractions.Infrastructure;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using static EnvelopeGenerator.Common.Constants;
|
using static EnvelopeGenerator.Domain.Constants;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete("Use IRepository")]
|
||||||
public interface IEmailTemplateRepository : ICRUDRepository<EmailTemplate, int>
|
public interface IEmailTemplateRepository : ICRUDRepository<EmailTemplate, int>
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="type"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<EmailTemplate?> ReadByNameAsync(EmailTemplateType type);
|
Task<EmailTemplate?> ReadByNameAsync(EmailTemplateType type);
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,12 @@
|
|||||||
using DigitalData.Core.Abstractions.Infrastructure;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete("Use Read-method returning IReadQuery<TEntity> instead.")]
|
||||||
public interface IEnvelopeCertificateRepository : ICRUDRepository<EnvelopeCertificate, int>
|
public interface IEnvelopeCertificateRepository : ICRUDRepository<EnvelopeCertificate, int>
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
using DigitalData.Core.Abstractions.Infrastructure;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete("Use IRepository")]
|
||||||
public interface IEnvelopeDocumentRepository : ICRUDRepository<EnvelopeDocument, int>
|
public interface IEnvelopeDocumentRepository : ICRUDRepository<EnvelopeDocument, int>
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,32 @@
|
|||||||
using DigitalData.Core.Abstractions.Infrastructure;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
|
using EnvelopeGenerator.Domain;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete("Use IRepository")]
|
||||||
public interface IEnvelopeHistoryRepository : ICRUDRepository<EnvelopeHistory, long>
|
public interface IEnvelopeHistoryRepository : ICRUDRepository<EnvelopeHistory, long>
|
||||||
{
|
{
|
||||||
Task<int> CountAsync(int? envelopeId = null, string? userReference = null, int? status = null);
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelopeId"></param>
|
||||||
|
/// <param name="userReference"></param>
|
||||||
|
/// <param name="status"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<int> CountAsync(int? envelopeId = null, string? userReference = null, Constants.EnvelopeStatus? status = null);
|
||||||
|
|
||||||
Task<IEnumerable<EnvelopeHistory>> ReadAsync(int? envelopeId = null, string? userReference = null, int? status = null, bool withSender = false, bool withReceiver = false);
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelopeId"></param>
|
||||||
|
/// <param name="userReference"></param>
|
||||||
|
/// <param name="status"></param>
|
||||||
|
/// <param name="withSender"></param>
|
||||||
|
/// <param name="withReceiver"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<IEnumerable<EnvelopeHistory>> ReadAsync(int? envelopeId = null, string? userReference = null, Constants.EnvelopeStatus? status = null, bool withSender = false, bool withReceiver = false);
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,12 @@
|
|||||||
using DigitalData.Core.Abstractions.Infrastructure;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete("Use IRepository")]
|
||||||
public interface IEnvelopeReceiverReadOnlyRepository : ICRUDRepository<EnvelopeReceiverReadOnly, long>
|
public interface IEnvelopeReceiverReadOnlyRepository : ICRUDRepository<EnvelopeReceiverReadOnly, long>
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,25 +1,96 @@
|
|||||||
using DigitalData.Core.Abstractions.Infrastructure;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete("Use IRepository")]
|
||||||
public interface IEnvelopeReceiverRepository : ICRUDRepository<EnvelopeReceiver, (int Envelope, int Receiver)>
|
public interface IEnvelopeReceiverRepository : ICRUDRepository<EnvelopeReceiver, (int Envelope, int Receiver)>
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="uuid"></param>
|
||||||
|
/// <param name="withEnvelope"></param>
|
||||||
|
/// <param name="withReceiver"></param>
|
||||||
|
/// <param name="readOnly"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<IEnumerable<EnvelopeReceiver>> ReadByUuidAsync(string uuid, bool withEnvelope = true, bool withReceiver = false, bool readOnly = true);
|
Task<IEnumerable<EnvelopeReceiver>> ReadByUuidAsync(string uuid, bool withEnvelope = true, bool withReceiver = false, bool readOnly = true);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="signature"></param>
|
||||||
|
/// <param name="withEnvelope"></param>
|
||||||
|
/// <param name="withReceiver"></param>
|
||||||
|
/// <param name="readOnly"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<IEnumerable<EnvelopeReceiver>> ReadBySignatureAsync(string signature, bool withEnvelope = false, bool withReceiver = true, bool readOnly = true);
|
Task<IEnumerable<EnvelopeReceiver>> ReadBySignatureAsync(string signature, bool withEnvelope = false, bool withReceiver = true, bool readOnly = true);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="uuid"></param>
|
||||||
|
/// <param name="signature"></param>
|
||||||
|
/// <param name="withEnvelope"></param>
|
||||||
|
/// <param name="withReceiver"></param>
|
||||||
|
/// <param name="readOnly"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<EnvelopeReceiver?> ReadByUuidSignatureAsync(string uuid, string signature, bool withEnvelope = true, bool withReceiver = true, bool readOnly = true);
|
Task<EnvelopeReceiver?> ReadByUuidSignatureAsync(string uuid, string signature, bool withEnvelope = true, bool withReceiver = true, bool readOnly = true);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="uuid"></param>
|
||||||
|
/// <param name="signature"></param>
|
||||||
|
/// <param name="readOnly"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<string?> ReadAccessCodeAsync(string uuid, string signature, bool readOnly = true);
|
Task<string?> ReadAccessCodeAsync(string uuid, string signature, bool readOnly = true);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="uuid"></param>
|
||||||
|
/// <param name="signature"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<int> CountAsync(string uuid, string signature);
|
Task<int> CountAsync(string uuid, string signature);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelopeId"></param>
|
||||||
|
/// <param name="receiverId"></param>
|
||||||
|
/// <param name="readOnly"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<EnvelopeReceiver?> ReadByIdAsync(int envelopeId, int receiverId, bool readOnly = true);
|
Task<EnvelopeReceiver?> ReadByIdAsync(int envelopeId, int receiverId, bool readOnly = true);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelopeId"></param>
|
||||||
|
/// <param name="receiverId"></param>
|
||||||
|
/// <param name="readOnly"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<string?> ReadAccessCodeByIdAsync(int envelopeId, int receiverId, bool readOnly = true);
|
Task<string?> ReadAccessCodeByIdAsync(int envelopeId, int receiverId, bool readOnly = true);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="username"></param>
|
||||||
|
/// <param name="min_status"></param>
|
||||||
|
/// <param name="max_status"></param>
|
||||||
|
/// <param name="ignore_statuses"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<IEnumerable<EnvelopeReceiver>> ReadByUsernameAsync(string username, int? min_status = null, int? max_status = null, params int[] ignore_statuses);
|
Task<IEnumerable<EnvelopeReceiver>> ReadByUsernameAsync(string username, int? min_status = null, int? max_status = null, params int[] ignore_statuses);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="email"></param>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <param name="signature"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<EnvelopeReceiver?> ReadLastByReceiverAsync(string? email = null, int? id = null, string? signature = null);
|
Task<EnvelopeReceiver?> ReadLastByReceiverAsync(string? email = null, int? id = null, string? signature = null);
|
||||||
}
|
}
|
||||||
@@ -1,13 +1,42 @@
|
|||||||
using DigitalData.Core.Abstractions.Infrastructure;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete("Use IRepository")]
|
||||||
public interface IEnvelopeRepository : ICRUDRepository<Envelope, int>
|
public interface IEnvelopeRepository : ICRUDRepository<Envelope, int>
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="documents"></param>
|
||||||
|
/// <param name="history"></param>
|
||||||
|
/// <param name="documentReceiverElement"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<IEnumerable<Envelope>> ReadAllWithAsync(bool documents = false, bool history = false, bool documentReceiverElement = false);
|
Task<IEnumerable<Envelope>> ReadAllWithAsync(bool documents = false, bool history = false, bool documentReceiverElement = false);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="uuid"></param>
|
||||||
|
/// <param name="withDocuments"></param>
|
||||||
|
/// <param name="withHistory"></param>
|
||||||
|
/// <param name="withDocumentReceiverElement"></param>
|
||||||
|
/// <param name="withUser"></param>
|
||||||
|
/// <param name="withAll"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<Envelope?> ReadByUuidAsync(string uuid, bool withDocuments = false, bool withHistory = false, bool withDocumentReceiverElement = false, bool withUser = false, bool withAll = false);
|
Task<Envelope?> ReadByUuidAsync(string uuid, bool withDocuments = false, bool withHistory = false, bool withDocumentReceiverElement = false, bool withUser = false, bool withAll = false);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="userId"></param>
|
||||||
|
/// <param name="min_status"></param>
|
||||||
|
/// <param name="max_status"></param>
|
||||||
|
/// <param name="ignore_statuses"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<IEnumerable<Envelope>> ReadByUserAsync(int userId, int? min_status = null, int? max_status = null, params int[] ignore_statuses);
|
Task<IEnumerable<Envelope>> ReadByUserAsync(int userId, int? min_status = null, int? max_status = null, params int[] ignore_statuses);
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,12 @@
|
|||||||
using DigitalData.Core.Abstractions.Infrastructure;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete("Use IRepository")]
|
||||||
public interface IEnvelopeTypeRepository : ICRUDRepository<EnvelopeType, int>
|
public interface IEnvelopeTypeRepository : ICRUDRepository<EnvelopeType, int>
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,19 @@
|
|||||||
using DigitalData.Core.Abstractions.Infrastructure;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete("Use IRepository")]
|
||||||
public interface IReceiverRepository : ICRUDRepository<Receiver, int>
|
public interface IReceiverRepository : ICRUDRepository<Receiver, int>
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="emailAddress"></param>
|
||||||
|
/// <param name="signature"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<Receiver?> ReadByAsync(string? emailAddress = null, string? signature = null);
|
Task<Receiver?> ReadByAsync(string? emailAddress = null, string? signature = null);
|
||||||
}
|
}
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
using DigitalData.Core.Abstractions.Infrastructure;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
|
||||||
|
|
||||||
public interface IUserReceiverRepository : ICRUDRepository<UserReceiver, int>
|
|
||||||
{
|
|
||||||
}
|
|
||||||
@@ -2,17 +2,62 @@
|
|||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Services;
|
namespace EnvelopeGenerator.Application.Contracts.Services;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public interface IAuthenticator
|
public interface IAuthenticator
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="length"></param>
|
||||||
|
/// <returns></returns>
|
||||||
string GenerateCode(int length);
|
string GenerateCode(int length);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="length"></param>
|
||||||
|
/// <returns></returns>
|
||||||
string GenerateTotpSecretKey(int? length = null);
|
string GenerateTotpSecretKey(int? length = null);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="userEmail"></param>
|
||||||
|
/// <param name="secretKey"></param>
|
||||||
|
/// <param name="issuer"></param>
|
||||||
|
/// <param name="totpUrlFormat"></param>
|
||||||
|
/// <param name="pixelsPerModule"></param>
|
||||||
|
/// <returns></returns>
|
||||||
byte[] GenerateTotpQrCode(string userEmail, string secretKey, string? issuer = null, string? totpUrlFormat = null, int? pixelsPerModule = null);
|
byte[] GenerateTotpQrCode(string userEmail, string secretKey, string? issuer = null, string? totpUrlFormat = null, int? pixelsPerModule = null);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="userEmail"></param>
|
||||||
|
/// <param name="length"></param>
|
||||||
|
/// <param name="issuer"></param>
|
||||||
|
/// <param name="totpUrlFormat"></param>
|
||||||
|
/// <param name="pixelsPerModule"></param>
|
||||||
|
/// <returns></returns>
|
||||||
byte[] GenerateTotpQrCode(string userEmail, int? length = null, string? issuer = null, string? totpUrlFormat = null, int? pixelsPerModule = null);
|
byte[] GenerateTotpQrCode(string userEmail, int? length = null, string? issuer = null, string? totpUrlFormat = null, int? pixelsPerModule = null);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="secretKey"></param>
|
||||||
|
/// <param name="step"></param>
|
||||||
|
/// <returns></returns>
|
||||||
string GenerateTotp(string secretKey, int step = 30);
|
string GenerateTotp(string secretKey, int step = 30);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="totpCode"></param>
|
||||||
|
/// <param name="secretKey"></param>
|
||||||
|
/// <param name="step"></param>
|
||||||
|
/// <param name="window"></param>
|
||||||
|
/// <returns></returns>
|
||||||
bool VerifyTotp(string totpCode, string secretKey, int step = 30, VerificationWindow? window = null);
|
bool VerifyTotp(string totpCode, string secretKey, int step = 30, VerificationWindow? window = null);
|
||||||
}
|
}
|
||||||
@@ -1,16 +1,31 @@
|
|||||||
using DigitalData.Core.Abstractions.Application;
|
using DigitalData.Core.Abstraction.Application;
|
||||||
using DigitalData.Core.DTO;
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Services;
|
namespace EnvelopeGenerator.Application.Contracts.Services;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public interface IConfigService : IReadService<ConfigDto, Config, int>
|
public interface IConfigService : IReadService<ConfigDto, Config, int>
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
Task<DataResult<ConfigDto>> ReadFirstAsync();
|
Task<DataResult<ConfigDto>> ReadFirstAsync();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
Task<ConfigDto> ReadDefaultAsync();
|
Task<ConfigDto> ReadDefaultAsync();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
Task<string> ReadDefaultSignatureHost();
|
Task<string> ReadDefaultSignatureHost();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,13 @@
|
|||||||
using DigitalData.Core.Abstractions.Application;
|
using DigitalData.Core.Abstraction.Application;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Services;
|
namespace EnvelopeGenerator.Application.Contracts.Services;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public interface IDocumentReceiverElementService : IBasicCRUDService<DocumentReceiverElementDto, DocumentReceiverElement, int>
|
public interface IDocumentReceiverElementService : IBasicCRUDService<DocumentReceiverElementDto, DocumentReceiverElement, int>
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,12 @@
|
|||||||
using DigitalData.Core.Abstractions.Application;
|
using DigitalData.Core.Abstraction.Application;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Services;
|
namespace EnvelopeGenerator.Application.Contracts.Services;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public interface IDocumentStatusService : IBasicCRUDService<DocumentStatusDto, DocumentStatus, int>
|
public interface IDocumentStatusService : IBasicCRUDService<DocumentStatusDto, DocumentStatus, int>
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,21 @@
|
|||||||
using DigitalData.Core.Abstractions.Application;
|
using DigitalData.Core.Abstraction.Application;
|
||||||
using DigitalData.Core.DTO;
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using static EnvelopeGenerator.Common.Constants;
|
using static EnvelopeGenerator.Domain.Constants;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Services;
|
namespace EnvelopeGenerator.Application.Contracts.Services;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public interface IEmailTemplateService : IBasicCRUDService<EmailTemplateDto, EmailTemplate, int>
|
public interface IEmailTemplateService : IBasicCRUDService<EmailTemplateDto, EmailTemplate, int>
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="type"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<DataResult<EmailTemplateDto>> ReadByNameAsync(EmailTemplateType type);
|
Task<DataResult<EmailTemplateDto>> ReadByNameAsync(EmailTemplateType type);
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,13 @@
|
|||||||
using DigitalData.Core.Abstractions.Application;
|
using DigitalData.Core.Abstraction.Application;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Services;
|
namespace EnvelopeGenerator.Application.Contracts.Services;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public interface IEnvelopeCertificateService : IBasicCRUDService<EnvelopeCertificateDto, EnvelopeCertificate, int>
|
public interface IEnvelopeCertificateService : IBasicCRUDService<EnvelopeCertificateDto, EnvelopeCertificate, int>
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,13 @@
|
|||||||
using DigitalData.Core.Abstractions.Application;
|
using DigitalData.Core.Abstraction.Application;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Services;
|
namespace EnvelopeGenerator.Application.Contracts.Services;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public interface IEnvelopeDocumentService : IBasicCRUDService<EnvelopeDocumentDto, EnvelopeDocument, int>
|
public interface IEnvelopeDocumentService : IBasicCRUDService<EnvelopeDocumentDto, EnvelopeDocument, int>
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -1,27 +1,85 @@
|
|||||||
using DigitalData.Core.Abstractions.Application;
|
using DigitalData.Core.Abstraction.Application;
|
||||||
using DigitalData.Core.DTO;
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
using EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
|
using EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
|
||||||
using EnvelopeGenerator.Application.DTOs.Receiver;
|
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using static EnvelopeGenerator.Common.Constants;
|
using static EnvelopeGenerator.Domain.Constants;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Services;
|
namespace EnvelopeGenerator.Application.Contracts.Services;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public interface IEnvelopeHistoryService : ICRUDService<EnvelopeHistoryCreateDto, EnvelopeHistoryDto, EnvelopeHistory, long>
|
public interface IEnvelopeHistoryService : ICRUDService<EnvelopeHistoryCreateDto, EnvelopeHistoryDto, EnvelopeHistory, long>
|
||||||
{
|
{
|
||||||
Task<int> CountAsync(int? envelopeId = null, string? userReference = null, int? status = null);
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelopeId"></param>
|
||||||
|
/// <param name="userReference"></param>
|
||||||
|
/// <param name="status"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<int> CountAsync(int? envelopeId = null, string? userReference = null, EnvelopeStatus? status = null);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelopeId"></param>
|
||||||
|
/// <param name="userReference"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<bool> AccessCodeAlreadyRequested(int envelopeId, string userReference);
|
Task<bool> AccessCodeAlreadyRequested(int envelopeId, string userReference);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelopeId"></param>
|
||||||
|
/// <param name="userReference"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<bool> IsSigned(int envelopeId, string userReference);
|
Task<bool> IsSigned(int envelopeId, string userReference);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelopeId"></param>
|
||||||
|
/// <param name="userReference"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<bool> IsRejected(int envelopeId, string? userReference = null);
|
Task<bool> IsRejected(int envelopeId, string? userReference = null);
|
||||||
|
|
||||||
Task<IEnumerable<EnvelopeHistoryDto>> ReadAsync(int? envelopeId = null, string? userReference = null, ReferenceType? referenceType = null, int? status = null, bool withSender = false, bool withReceiver = false);
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelopeId"></param>
|
||||||
|
/// <param name="userReference"></param>
|
||||||
|
/// <param name="referenceType"></param>
|
||||||
|
/// <param name="status"></param>
|
||||||
|
/// <param name="withSender"></param>
|
||||||
|
/// <param name="withReceiver"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<IEnumerable<EnvelopeHistoryDto>> ReadAsync(int? envelopeId = null, string? userReference = null, ReferenceType? referenceType = null, EnvelopeStatus? status = null, bool withSender = false, bool withReceiver = false);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelopeId"></param>
|
||||||
|
/// <param name="userReference"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<IEnumerable<EnvelopeHistoryDto>> ReadRejectedAsync(int envelopeId, string? userReference = null);
|
Task<IEnumerable<EnvelopeHistoryDto>> ReadRejectedAsync(int envelopeId, string? userReference = null);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelopeId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<IEnumerable<ReceiverReadDto>> ReadRejectingReceivers(int envelopeId);
|
Task<IEnumerable<ReceiverReadDto>> ReadRejectingReceivers(int envelopeId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelopeId"></param>
|
||||||
|
/// <param name="userReference"></param>
|
||||||
|
/// <param name="status"></param>
|
||||||
|
/// <param name="comment"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<DataResult<long>> RecordAsync(int envelopeId, string userReference, EnvelopeStatus status, string? comment = null);
|
Task<DataResult<long>> RecordAsync(int envelopeId, string userReference, EnvelopeStatus status, string? comment = null);
|
||||||
}
|
}
|
||||||
@@ -1,18 +1,45 @@
|
|||||||
using DigitalData.Core.DTO;
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
using DigitalData.EmailProfilerDispatcher.Abstraction.Contracts;
|
using DigitalData.EmailProfilerDispatcher.Abstraction.Contracts;
|
||||||
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
||||||
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
|
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
|
||||||
using EnvelopeGenerator.Common;
|
using EnvelopeGenerator.Domain;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Services;
|
namespace EnvelopeGenerator.Application.Contracts.Services;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public interface IEnvelopeMailService : IEmailOutService
|
public interface IEnvelopeMailService : IEmailOutService
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelopeReceiverDto"></param>
|
||||||
|
/// <param name="tempType"></param>
|
||||||
|
/// <param name="optionalPlaceholders"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<DataResult<int>> SendAsync(EnvelopeReceiverDto envelopeReceiverDto, Constants.EmailTemplateType tempType, Dictionary<string, object>? optionalPlaceholders = null);
|
Task<DataResult<int>> SendAsync(EnvelopeReceiverDto envelopeReceiverDto, Constants.EmailTemplateType tempType, Dictionary<string, object>? optionalPlaceholders = null);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dto"></param>
|
||||||
|
/// <param name="optionalPlaceholders"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<DataResult<int>> SendAsync(EnvelopeReceiverReadOnlyDto dto, Dictionary<string, object>? optionalPlaceholders = null);
|
Task<DataResult<int>> SendAsync(EnvelopeReceiverReadOnlyDto dto, Dictionary<string, object>? optionalPlaceholders = null);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelopeReceiverDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<DataResult<int>> SendAccessCodeAsync(EnvelopeReceiverDto envelopeReceiverDto);
|
Task<DataResult<int>> SendAccessCodeAsync(EnvelopeReceiverDto envelopeReceiverDto);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelopeReceiverDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<DataResult<int>> SendTFAQrCodeAsync(EnvelopeReceiverDto envelopeReceiverDto);
|
Task<DataResult<int>> SendTFAQrCodeAsync(EnvelopeReceiverDto envelopeReceiverDto);
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,13 @@
|
|||||||
using DigitalData.Core.Abstractions.Application;
|
using DigitalData.Core.Abstraction.Application;
|
||||||
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
|
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Services;
|
namespace EnvelopeGenerator.Application.Contracts.Services;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public interface IEnvelopeReceiverReadOnlyService : ICRUDService<EnvelopeReceiverReadOnlyCreateDto, EnvelopeReceiverReadOnlyDto, EnvelopeReceiverReadOnly, long>
|
public interface IEnvelopeReceiverReadOnlyService : ICRUDService<EnvelopeReceiverReadOnlyCreateDto, EnvelopeReceiverReadOnlyDto, EnvelopeReceiverReadOnly, long>
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using CommandDotNet;
|
using CommandDotNet;
|
||||||
using DigitalData.Core.Abstractions.Application;
|
using DigitalData.Core.Abstraction.Application;
|
||||||
using DigitalData.Core.DTO;
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
||||||
using EnvelopeGenerator.Application.DTOs.Messaging;
|
using EnvelopeGenerator.Application.DTOs.Messaging;
|
||||||
using EnvelopeGenerator.Application.Envelopes;
|
using EnvelopeGenerator.Application.Envelopes;
|
||||||
@@ -9,34 +9,140 @@ using EnvelopeGenerator.Domain.Entities;
|
|||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Services;
|
namespace EnvelopeGenerator.Application.Contracts.Services;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public interface IEnvelopeReceiverService : IBasicCRUDService<EnvelopeReceiverDto, EnvelopeReceiver, (int Envelope, int Receiver)>
|
public interface IEnvelopeReceiverService : IBasicCRUDService<EnvelopeReceiverDto, EnvelopeReceiver, (int Envelope, int Receiver)>
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="uuid"></param>
|
||||||
|
/// <param name="withEnvelope"></param>
|
||||||
|
/// <param name="withReceiver"></param>
|
||||||
|
/// <param name="readOnly"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
|
||||||
Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUuidAsync(string uuid, bool withEnvelope = true, bool withReceiver = false, bool readOnly = true);
|
Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUuidAsync(string uuid, bool withEnvelope = true, bool withReceiver = false, bool readOnly = true);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="uuid"></param>
|
||||||
|
/// <param name="withEnvelope"></param>
|
||||||
|
/// <param name="withReceiver"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<DataResult<IEnumerable<string?>>> ReadAccessCodeByUuidAsync(string uuid, bool withEnvelope = false, bool withReceiver = true);
|
Task<DataResult<IEnumerable<string?>>> ReadAccessCodeByUuidAsync(string uuid, bool withEnvelope = false, bool withReceiver = true);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="signature"></param>
|
||||||
|
/// <param name="withEnvelope"></param>
|
||||||
|
/// <param name="withReceiver"></param>
|
||||||
|
/// <param name="readOnly"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadBySignatureAsync(string signature, bool withEnvelope = false, bool withReceiver = true, bool readOnly = true);
|
Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadBySignatureAsync(string signature, bool withEnvelope = false, bool withReceiver = true, bool readOnly = true);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="uuid"></param>
|
||||||
|
/// <param name="signature"></param>
|
||||||
|
/// <param name="withEnvelope"></param>
|
||||||
|
/// <param name="withReceiver"></param>
|
||||||
|
/// <param name="readOnly"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<DataResult<EnvelopeReceiverDto>> ReadByUuidSignatureAsync(string uuid, string signature, bool withEnvelope = true, bool withReceiver = true, bool readOnly = true);
|
Task<DataResult<EnvelopeReceiverDto>> ReadByUuidSignatureAsync(string uuid, string signature, bool withEnvelope = true, bool withReceiver = true, bool readOnly = true);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="uuid"></param>
|
||||||
|
/// <param name="signature"></param>
|
||||||
|
/// <param name="withEnvelope"></param>
|
||||||
|
/// <param name="withReceiver"></param>
|
||||||
|
/// <param name="readOnly"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<DataResult<EnvelopeReceiverSecretDto>> ReadWithSecretByUuidSignatureAsync(string uuid, string signature, bool withEnvelope = true, bool withReceiver = true, bool readOnly = true);
|
Task<DataResult<EnvelopeReceiverSecretDto>> ReadWithSecretByUuidSignatureAsync(string uuid, string signature, bool withEnvelope = true, bool withReceiver = true, bool readOnly = true);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelopeReceiverId"></param>
|
||||||
|
/// <param name="withEnvelope"></param>
|
||||||
|
/// <param name="withReceiver"></param>
|
||||||
|
/// <param name="readOnly"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<DataResult<EnvelopeReceiverDto>> ReadByEnvelopeReceiverIdAsync(string envelopeReceiverId, bool withEnvelope = true, bool withReceiver = true, bool readOnly = true);
|
Task<DataResult<EnvelopeReceiverDto>> ReadByEnvelopeReceiverIdAsync(string envelopeReceiverId, bool withEnvelope = true, bool withReceiver = true, bool readOnly = true);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelopeId"></param>
|
||||||
|
/// <param name="receiverId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<DataResult<string>> ReadAccessCodeByIdAsync(int envelopeId, int receiverId);
|
Task<DataResult<string>> ReadAccessCodeByIdAsync(int envelopeId, int receiverId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="uuid"></param>
|
||||||
|
/// <param name="signature"></param>
|
||||||
|
/// <param name="accessCode"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<DataResult<bool>> VerifyAccessCodeAsync(string uuid, string signature, string accessCode);
|
Task<DataResult<bool>> VerifyAccessCodeAsync(string uuid, string signature, string accessCode);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelopeReceiverId"></param>
|
||||||
|
/// <param name="accessCode"></param>
|
||||||
|
/// <returns></returns>
|
||||||
[Command("verify-access-code-async-by-id")]
|
[Command("verify-access-code-async-by-id")]
|
||||||
Task<DataResult<bool>> VerifyAccessCodeAsync(string envelopeReceiverId, string accessCode);
|
Task<DataResult<bool>> VerifyAccessCodeAsync(string envelopeReceiverId, string accessCode);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelopeReceiverId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<DataResult<bool>> IsExisting(string envelopeReceiverId);
|
Task<DataResult<bool>> IsExisting(string envelopeReceiverId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="username"></param>
|
||||||
|
/// <param name="min_status"></param>
|
||||||
|
/// <param name="max_status"></param>
|
||||||
|
/// <param name="envelopeQuery"></param>
|
||||||
|
/// <param name="receiverQuery"></param>
|
||||||
|
/// <param name="ignore_statuses"></param>
|
||||||
|
/// <returns></returns>
|
||||||
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);
|
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);
|
||||||
|
|
||||||
Task<DataResult<string?>> ReadLastUsedReceiverNameByMailAsync(string? mail = null, int? id = null, string? signature = null);
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="mail"></param>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <param name="signature"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<DataResult<string>> ReadLastUsedReceiverNameByMailAsync(string? mail = null, int? id = null, string? signature = null);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelopeReceiverId"></param>
|
||||||
|
/// <param name="message"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<DataResult<SmsResponse>> SendSmsAsync(string envelopeReceiverId, string message);
|
Task<DataResult<SmsResponse>> SendSmsAsync(string envelopeReceiverId, string message);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="uuid"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<DataResult<IEnumerable<EnvelopeReceiverSecretDto>>> ReadWithSecretByUuidAsync(string uuid);
|
Task<DataResult<IEnumerable<EnvelopeReceiverSecretDto>>> ReadWithSecretByUuidAsync(string uuid);
|
||||||
}
|
}
|
||||||
@@ -1,15 +1,44 @@
|
|||||||
using DigitalData.Core.Abstractions.Application;
|
using DigitalData.Core.Abstraction.Application;
|
||||||
using DigitalData.Core.DTO;
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Services;
|
namespace EnvelopeGenerator.Application.Contracts.Services;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public interface IEnvelopeService : IBasicCRUDService<EnvelopeDto, Envelope, int>
|
public interface IEnvelopeService : IBasicCRUDService<EnvelopeDto, Envelope, int>
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="documents"></param>
|
||||||
|
/// <param name="history"></param>
|
||||||
|
/// <param name="documentReceiverElement"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<DataResult<IEnumerable<EnvelopeDto>>> ReadAllWithAsync(bool documents = false, bool history = false, bool documentReceiverElement = false);
|
Task<DataResult<IEnumerable<EnvelopeDto>>> ReadAllWithAsync(bool documents = false, bool history = false, bool documentReceiverElement = false);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="uuid"></param>
|
||||||
|
/// <param name="withDocuments"></param>
|
||||||
|
/// <param name="withHistory"></param>
|
||||||
|
/// <param name="withDocumentReceiverElement"></param>
|
||||||
|
/// <param name="withUser"></param>
|
||||||
|
/// <param name="withAll"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<DataResult<EnvelopeDto>> ReadByUuidAsync(string uuid, bool withDocuments = false, bool withHistory = false, bool withDocumentReceiverElement = false, bool withUser = false, bool withAll = false);
|
Task<DataResult<EnvelopeDto>> ReadByUuidAsync(string uuid, bool withDocuments = false, bool withHistory = false, bool withDocumentReceiverElement = false, bool withUser = false, bool withAll = false);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="userId"></param>
|
||||||
|
/// <param name="min_status"></param>
|
||||||
|
/// <param name="max_status"></param>
|
||||||
|
/// <param name="ignore_statuses"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<DataResult<IEnumerable<EnvelopeDto>>> ReadByUserAsync(int userId, int? min_status = null, int? max_status = null, params int[] ignore_statuses);
|
Task<DataResult<IEnumerable<EnvelopeDto>>> ReadByUserAsync(int userId, int? min_status = null, int? max_status = null, params int[] ignore_statuses);
|
||||||
}
|
}
|
||||||
@@ -3,6 +3,9 @@ using EnvelopeGenerator.Application.DTOs.Messaging;
|
|||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Services;
|
namespace EnvelopeGenerator.Application.Contracts.Services;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public interface IEnvelopeSmsHandler
|
public interface IEnvelopeSmsHandler
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -13,5 +16,11 @@ public interface IEnvelopeSmsHandler
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<(SmsResponse? SmsResponse, DateTime Expiration)> SendTotpAsync(EnvelopeReceiverSecretDto er_secret, CancellationToken cToken = default);
|
Task<(SmsResponse? SmsResponse, DateTime Expiration)> SendTotpAsync(EnvelopeReceiverSecretDto er_secret, CancellationToken cToken = default);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="totpCode"></param>
|
||||||
|
/// <param name="secretKey"></param>
|
||||||
|
/// <returns></returns>
|
||||||
bool VerifyTotp(string totpCode, string secretKey);
|
bool VerifyTotp(string totpCode, string secretKey);
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,13 @@
|
|||||||
using DigitalData.Core.Abstractions.Application;
|
using DigitalData.Core.Abstraction.Application;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Services;
|
namespace EnvelopeGenerator.Application.Contracts.Services;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public interface IEnvelopeTypeService : IBasicCRUDService<EnvelopeTypeDto, EnvelopeType, int>
|
public interface IEnvelopeTypeService : IBasicCRUDService<EnvelopeTypeDto, EnvelopeType, int>
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -1,16 +1,29 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
using DigitalData.Core.Abstraction.Application;
|
||||||
using DigitalData.Core.Abstractions.Application;
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
using DigitalData.Core.DTO;
|
|
||||||
using EnvelopeGenerator.Application.DTOs.Receiver;
|
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Services;
|
namespace EnvelopeGenerator.Application.Contracts.Services;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public interface IReceiverService : ICRUDService<ReceiverCreateDto, ReceiverReadDto, Receiver, int>
|
public interface IReceiverService : ICRUDService<ReceiverCreateDto, ReceiverReadDto, Receiver, int>
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="emailAddress"></param>
|
||||||
|
/// <param name="signature"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<DataResult<ReceiverReadDto>> ReadByAsync(string? emailAddress = null, string? signature = null);
|
Task<DataResult<ReceiverReadDto>> ReadByAsync(string? emailAddress = null, string? signature = null);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="emailAddress"></param>
|
||||||
|
/// <param name="signature"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<Result> DeleteByAsync(string? emailAddress = null, string? signature = null);
|
Task<Result> DeleteByAsync(string? emailAddress = null, string? signature = null);
|
||||||
|
|
||||||
Task<Result> UpdateAsync<TUpdateDto>(TUpdateDto updateDto) where TUpdateDto : IUnique<int>;
|
|
||||||
}
|
}
|
||||||
@@ -3,9 +3,21 @@
|
|||||||
namespace EnvelopeGenerator.Application.Contracts.Services;
|
namespace EnvelopeGenerator.Application.Contracts.Services;
|
||||||
|
|
||||||
//TODO: move to DigitalData.Core
|
//TODO: move to DigitalData.Core
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public interface ISmsSender
|
public interface ISmsSender
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
string ServiceProvider { get; }
|
string ServiceProvider { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="recipient"></param>
|
||||||
|
/// <param name="message"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<SmsResponse> SendSmsAsync(string recipient, string message);
|
Task<SmsResponse> SendSmsAsync(string recipient, string message);
|
||||||
}
|
}
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
using DigitalData.Core.Abstractions.Application;
|
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Services;
|
|
||||||
|
|
||||||
public interface IUserReceiverService : IBasicCRUDService<UserReceiverDto, UserReceiver, int>
|
|
||||||
{
|
|
||||||
}
|
|
||||||
@@ -1,21 +1,30 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
|
||||||
using System.Text.Json.Serialization;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs
|
namespace EnvelopeGenerator.Application.DTOs;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data Transfer Object representing configuration settings.
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public class ConfigDto
|
||||||
{
|
{
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
/// <summary>
|
||||||
public record ConfigDto(
|
/// Gets or sets the sending profile identifier.
|
||||||
string DocumentPath,
|
/// </summary>
|
||||||
int SendingProfile,
|
public int SendingProfile { get; set; }
|
||||||
string SignatureHost,
|
|
||||||
string ExternalProgramName,
|
/// <summary>
|
||||||
string ExportPath) : IUnique<int>
|
/// Gets or sets the signature host URL or name.
|
||||||
{
|
/// </summary>
|
||||||
[NotMapped]
|
public required string SignatureHost { get; set; }
|
||||||
[JsonIgnore]
|
|
||||||
[Obsolete("Configuration does not have an ID; it represents a single table in the database.")]
|
/// <summary>
|
||||||
public int Id => throw new InvalidOperationException("This configuration does not support an ID as it represents a single row in the database.");
|
/// Gets or sets the name of the external program.
|
||||||
};
|
/// </summary>
|
||||||
|
public string? ExternalProgramName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the path where exports will be saved.
|
||||||
|
/// </summary>
|
||||||
|
public string? ExportPath { get; set; }
|
||||||
}
|
}
|
||||||
@@ -1,26 +1,95 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs
|
namespace EnvelopeGenerator.Application.DTOs;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data Transfer Object representing a positioned element assigned to a document receiver.
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public class DocumentReceiverElementDto
|
||||||
{
|
{
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
/// <summary>
|
||||||
public record DocumentReceiverElementDto(
|
/// Gets or sets the unique identifier of the element.
|
||||||
int Id,
|
/// </summary>
|
||||||
int DocumentId,
|
public int Id { get; set; }
|
||||||
int ReceiverId,
|
|
||||||
int ElementType,
|
/// <summary>
|
||||||
double X,
|
/// Gets or sets the identifier of the associated document.
|
||||||
double Y,
|
/// </summary>
|
||||||
double Width,
|
public int DocumentId { get; set; }
|
||||||
double Height,
|
|
||||||
int Page,
|
/// <summary>
|
||||||
bool Required,
|
/// Gets or sets the identifier of the receiver.
|
||||||
string? Tooltip,
|
/// </summary>
|
||||||
bool ReadOnly,
|
public int ReceiverId { get; set; }
|
||||||
int AnnotationIndex,
|
|
||||||
DateTime AddedWhen,
|
/// <summary>
|
||||||
DateTime? ChangedWhen,
|
/// Gets or sets the type of the element.
|
||||||
double Top,
|
/// </summary>
|
||||||
double Left
|
public int ElementType { get; set; }
|
||||||
): IUnique<int>;
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the X coordinate of the element.
|
||||||
|
/// </summary>
|
||||||
|
public double X { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the Y coordinate of the element.
|
||||||
|
/// </summary>
|
||||||
|
public double Y { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the width of the element.
|
||||||
|
/// </summary>
|
||||||
|
public double Width { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the height of the element.
|
||||||
|
/// </summary>
|
||||||
|
public double Height { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the page number where the element appears.
|
||||||
|
/// </summary>
|
||||||
|
public int Page { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets a value indicating whether the element is required.
|
||||||
|
/// </summary>
|
||||||
|
public bool Required { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the tooltip text for the element.
|
||||||
|
/// </summary>
|
||||||
|
public string? Tooltip { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets a value indicating whether the element is read-only.
|
||||||
|
/// </summary>
|
||||||
|
public bool ReadOnly { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the annotation index for ordering or reference.
|
||||||
|
/// </summary>
|
||||||
|
public int AnnotationIndex { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the timestamp when the element was added.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime AddedWhen { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the timestamp when the element was last changed, if applicable.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? ChangedWhen { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the top position of the element (in layout terms).
|
||||||
|
/// </summary>
|
||||||
|
public double Top { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the left position of the element (in layout terms).
|
||||||
|
/// </summary>
|
||||||
|
public double Left { get; set; }
|
||||||
}
|
}
|
||||||
@@ -1,18 +1,50 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs
|
namespace EnvelopeGenerator.Application.DTOs;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data Transfer Object representing the status of a document for a specific receiver.
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public class DocumentStatusDto
|
||||||
{
|
{
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
/// <summary>
|
||||||
public record DocumentStatusDto(
|
/// Gets or sets the unique identifier of the document status entry.
|
||||||
int Id,
|
/// </summary>
|
||||||
int EnvelopeId,
|
public int Id { get; set; }
|
||||||
int ReceiverId,
|
|
||||||
int Status,
|
/// <summary>
|
||||||
DateTime? StatusChangedWhen,
|
/// Gets or sets the ID of the associated envelope.
|
||||||
DateTime AddedWhen,
|
/// </summary>
|
||||||
DateTime? ChangedWhen) : IUnique<int>
|
public int EnvelopeId { get; set; }
|
||||||
{
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the ID of the receiver associated with this status.
|
||||||
|
/// </summary>
|
||||||
|
public int ReceiverId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the current status code.
|
||||||
|
/// </summary>
|
||||||
|
public int Status { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the timestamp when the status was changed.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? StatusChangedWhen { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the timestamp when this record was added.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime AddedWhen { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the timestamp when this record was last changed.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? ChangedWhen { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the display value associated with the status.
|
||||||
|
/// </summary>
|
||||||
public string? Value { get; set; }
|
public string? Value { get; set; }
|
||||||
};
|
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs
|
namespace EnvelopeGenerator.Application.DTOs
|
||||||
{
|
{
|
||||||
@@ -7,7 +6,7 @@ namespace EnvelopeGenerator.Application.DTOs
|
|||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
public record EmailTemplateDto : IUnique<int>
|
public record EmailTemplateDto
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -1,16 +1,50 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs
|
namespace EnvelopeGenerator.Application.DTOs;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data Transfer Object representing certificate information for an envelope.
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public class EnvelopeCertificateDto
|
||||||
{
|
{
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
/// <summary>
|
||||||
public record EnvelopeCertificateDto(
|
/// Gets the unique identifier of the certificate.
|
||||||
int Id,
|
/// </summary>
|
||||||
int EnvelopeId,
|
public int Id { get; init; }
|
||||||
string EnvelopeUuid,
|
|
||||||
string EnvelopeSubject,
|
/// <summary>
|
||||||
int CreatorId,
|
/// Gets the envelope ID associated with the certificate.
|
||||||
string CreatorName,
|
/// </summary>
|
||||||
string CreatorEmail,
|
public int EnvelopeId { get; init; }
|
||||||
int EnvelopeStatus) : IUnique<int>;
|
|
||||||
|
/// <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,15 +1,35 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs
|
namespace EnvelopeGenerator.Application.DTOs;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data Transfer Object representing a document within an envelope, including optional binary data and form elements.
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public class EnvelopeDocumentDto
|
||||||
{
|
{
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
/// <summary>
|
||||||
public record EnvelopeDocumentDto
|
/// Gets or sets the unique identifier of the document.
|
||||||
(
|
/// </summary>
|
||||||
int Id,
|
public int Id { get; set; }
|
||||||
int EnvelopeId,
|
|
||||||
DateTime AddedWhen,
|
/// <summary>
|
||||||
byte[]? ByteData = null,
|
/// Gets or sets the envelope ID to which the document belongs.
|
||||||
IEnumerable<DocumentReceiverElementDto>? Elements = null
|
/// </summary>
|
||||||
) : IUnique<int>;
|
public int EnvelopeId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the date and time when the document was added.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime AddedWhen { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the binary data of the document, if available.
|
||||||
|
/// </summary>
|
||||||
|
public byte[]? ByteData { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the collection of elements associated with the document for receiver interactions, if any.
|
||||||
|
/// </summary>
|
||||||
|
public IEnumerable<DocumentReceiverElementDto>? Elements { get; set; }
|
||||||
}
|
}
|
||||||
@@ -1,56 +1,120 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
|
||||||
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
|
|
||||||
using DigitalData.UserManager.Application.DTOs.User;
|
using DigitalData.UserManager.Application.DTOs.User;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs
|
namespace EnvelopeGenerator.Application.DTOs;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public record EnvelopeDto
|
||||||
{
|
{
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
/// <summary>
|
||||||
public record EnvelopeDto() : IUnique<int>
|
///
|
||||||
{
|
/// </summary>
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public int UserId { get; set; }
|
public int UserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public int Status { get; set; }
|
public int Status { get; set; }
|
||||||
|
|
||||||
public string StatusName { get; set; }
|
/// <summary>
|
||||||
|
/// Default value is string.Empty
|
||||||
|
/// </summary>
|
||||||
|
public string StatusName { get; set; } = string.Empty;
|
||||||
|
|
||||||
public string Uuid { get; set; }
|
/// <summary>
|
||||||
|
/// Default value is string.Empty
|
||||||
|
/// </summary>
|
||||||
|
public string Uuid { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default value is string.Empty
|
||||||
|
/// </summary>
|
||||||
[TemplatePlaceholder("[MESSAGE]")]
|
[TemplatePlaceholder("[MESSAGE]")]
|
||||||
public string Message { get; set; }
|
public string Message { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public DateTime AddedWhen { get; set; }
|
public DateTime AddedWhen { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public DateTime? ChangedWhen { get; set; }
|
public DateTime? ChangedWhen { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default value is string.Empty
|
||||||
|
/// </summary>
|
||||||
[TemplatePlaceholder("[DOCUMENT_TITLE]")]
|
[TemplatePlaceholder("[DOCUMENT_TITLE]")]
|
||||||
public string Title { get; set; }
|
public string Title { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public int? ContractType { get; set; }
|
public int? ContractType { get; set; }
|
||||||
|
|
||||||
public string Language { get; set; }
|
/// <summary>
|
||||||
|
/// Default value is 'de-DE'
|
||||||
|
/// </summary>
|
||||||
|
public string Language { get; set; } = "de-DE";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public int? EnvelopeTypeId { get; set; }
|
public int? EnvelopeTypeId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public int? CertificationType { get; set; }
|
public int? CertificationType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public bool? UseAccessCode { get; set; }
|
public bool? UseAccessCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public bool TFAEnabled { get; init; }
|
public bool TFAEnabled { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public UserReadDto? User { get; set; }
|
public UserReadDto? User { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public EnvelopeType? EnvelopeType { get; set; }
|
public EnvelopeType? EnvelopeType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public string? EnvelopeTypeTitle { get; set; }
|
public string? EnvelopeTypeTitle { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public bool IsAlreadySent { get; set; }
|
public bool IsAlreadySent { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public byte[]? DocResult { get; init; }
|
public byte[]? DocResult { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public IEnumerable<EnvelopeDocumentDto>? Documents { get; set; }
|
public IEnumerable<EnvelopeDocumentDto>? Documents { get; set; }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,34 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs.EnvelopeHistory
|
namespace EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data Transfer Object for creating a new envelope history record.
|
||||||
|
/// </summary>
|
||||||
|
public class EnvelopeHistoryCreateDto
|
||||||
{
|
{
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
/// <summary>
|
||||||
public record EnvelopeHistoryCreateDto(
|
/// Gets or sets the identifier of the envelope.
|
||||||
int EnvelopeId,
|
/// </summary>
|
||||||
string UserReference,
|
public int EnvelopeId { get; set; }
|
||||||
int Status,
|
|
||||||
DateTime? ActionDate,
|
/// <summary>
|
||||||
string? Comment = null);
|
/// Gets or sets the user reference associated with the action.
|
||||||
|
/// </summary>
|
||||||
|
public required string UserReference { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the status of the envelope at the time of the action.
|
||||||
|
/// </summary>
|
||||||
|
public int Status { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the date and time when the action occurred.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? ActionDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets an optional comment related to the action.
|
||||||
|
/// </summary>
|
||||||
|
public string? Comment { get; set; }
|
||||||
}
|
}
|
||||||
@@ -1,36 +1,69 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
using DigitalData.UserManager.Application.DTOs.User;
|
||||||
using DigitalData.Core.DTO;
|
|
||||||
using DigitalData.UserManager.Application.DTOs.User;
|
|
||||||
using EnvelopeGenerator.Application.DTOs.Receiver;
|
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using static EnvelopeGenerator.Domain.Constants;
|
||||||
using static EnvelopeGenerator.Common.Constants;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
|
namespace EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
/// Data Transfer Object representing the history of an envelope, including status, sender, receiver, and related metadata.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="Id"></param>
|
public record EnvelopeHistoryDto
|
||||||
/// <param name="EnvelopeId"></param>
|
{
|
||||||
/// <param name="UserReference"></param>
|
/// <summary>
|
||||||
/// <param name="Status"></param>
|
/// Unique identifier for the envelope history entry.
|
||||||
/// <param name="StatusName"></param>
|
/// </summary>
|
||||||
/// <param name="AddedWhen"></param>
|
public long Id { get; set; }
|
||||||
/// <param name="ActionDate"></param>
|
|
||||||
/// <param name="Sender"></param>
|
/// <summary>
|
||||||
/// <param name="Receiver"></param>
|
/// Identifier of the associated envelope.
|
||||||
/// <param name="ReferenceType"></param>
|
/// </summary>
|
||||||
/// <param name="Comment"></param>
|
public int EnvelopeId { get; set; }
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
|
||||||
public record EnvelopeHistoryDto(
|
/// <summary>
|
||||||
long Id,
|
/// Reference string for the user related to this history entry.
|
||||||
int EnvelopeId,
|
/// </summary>
|
||||||
string UserReference,
|
public required string UserReference { get; set; }
|
||||||
int Status,
|
|
||||||
string? StatusName,
|
/// <summary>
|
||||||
DateTime AddedWhen,
|
/// Status code of the envelope at this history point.
|
||||||
DateTime? ActionDate,
|
/// </summary>
|
||||||
UserCreateDto? Sender,
|
public int Status { get; set; }
|
||||||
ReceiverReadDto? Receiver,
|
|
||||||
ReferenceType ReferenceType,
|
/// <summary>
|
||||||
string? Comment = null) : BaseDTO<long>(Id), IUnique<long>;
|
/// Human-readable name of the status.
|
||||||
|
/// </summary>
|
||||||
|
public string? StatusName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Date and time when this history entry was added.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime AddedWhen { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Date and time when an action was performed, if applicable.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? ActionDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Information about the sender associated with this history entry.
|
||||||
|
/// </summary>
|
||||||
|
public UserCreateDto? Sender { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Information about the receiver associated with this history entry.
|
||||||
|
/// </summary>
|
||||||
|
public ReceiverReadDto? Receiver { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Type of reference for this history entry.
|
||||||
|
/// </summary>
|
||||||
|
public ReferenceType ReferenceType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Optional comment related to this history entry.
|
||||||
|
/// </summary>
|
||||||
|
public string? Comment { get; set; }
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public override int GetHashCode() => Id.GetHashCode();
|
||||||
|
};
|
||||||
@@ -1,33 +1,67 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
|
||||||
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiver
|
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public record EnvelopeReceiverBasicDto
|
||||||
{
|
{
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
/// <summary>
|
||||||
public record EnvelopeReceiverBasicDto() : IUnique<(int Envelope, int Receiver)>
|
///
|
||||||
{
|
/// </summary>
|
||||||
public (int Envelope, int Receiver) Id => (Envelope: EnvelopeId, Receiver: ReceiverId);
|
public (int Envelope, int Receiver) Id => (Envelope: EnvelopeId, Receiver: ReceiverId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public int EnvelopeId { get; init; }
|
public int EnvelopeId { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public int ReceiverId { get; init; }
|
public int ReceiverId { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public int Sequence { get; init; }
|
public int Sequence { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
[TemplatePlaceholder("[NAME_RECEIVER]")]
|
[TemplatePlaceholder("[NAME_RECEIVER]")]
|
||||||
public string? Name { get; init; }
|
public string? Name { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public string? JobTitle { get; init; }
|
public string? JobTitle { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public string? CompanyName { get; init; }
|
public string? CompanyName { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public string? PrivateMessage { get; init; }
|
public string? PrivateMessage { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public DateTime AddedWhen { get; init; }
|
public DateTime AddedWhen { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public DateTime? ChangedWhen { get; init; }
|
public DateTime? ChangedWhen { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public bool HasPhoneNumber { get; init; }
|
public bool HasPhoneNumber { get; init; }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,13 +1,22 @@
|
|||||||
using EnvelopeGenerator.Application.DTOs.Receiver;
|
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiver
|
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public record EnvelopeReceiverDto() : EnvelopeReceiverBasicDto()
|
||||||
{
|
{
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
/// <summary>
|
||||||
public record EnvelopeReceiverDto() : EnvelopeReceiverBasicDto()
|
///
|
||||||
{
|
/// </summary>
|
||||||
public EnvelopeDto? Envelope { get; set; }
|
public EnvelopeDto? Envelope { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public ReceiverReadDto? Receiver { get; set; }
|
public ReceiverReadDto? Receiver { get; set; }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,20 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiver
|
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public record EnvelopeReceiverSecretDto : EnvelopeReceiverDto
|
||||||
{
|
{
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
/// <summary>
|
||||||
public record EnvelopeReceiverSecretDto() : EnvelopeReceiverDto()
|
///
|
||||||
{
|
/// </summary>
|
||||||
public string? AccessCode { get; init; }
|
public string? AccessCode { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public string? PhoneNumber { get; init; }
|
public string? PhoneNumber { get; init; }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -2,23 +2,38 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly
|
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
|
||||||
{
|
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
/// <summary>
|
||||||
public record EnvelopeReceiverReadOnlyCreateDto(
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="DateValid"></param>
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public record EnvelopeReceiverReadOnlyCreateDto(
|
||||||
DateTime DateValid)
|
DateTime DateValid)
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
[EmailAddress]
|
[EmailAddress]
|
||||||
[Required]
|
[Required]
|
||||||
public required string ReceiverMail { get; init; }
|
public required string ReceiverMail { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default value is null
|
||||||
|
/// </summary>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public long? EnvelopeId { get; set; } = null;
|
public long? EnvelopeId { get; set; } = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public string? AddedWho { get; set; }
|
public string? AddedWho { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default value is DateTime.Now
|
||||||
|
/// </summary>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public DateTime AddedWhen { get; } = DateTime.Now;
|
public DateTime AddedWhen { get; } = DateTime.Now;
|
||||||
};
|
};
|
||||||
}
|
|
||||||
@@ -1,18 +1,63 @@
|
|||||||
using EnvelopeGenerator.Application.DTOs.Receiver;
|
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly
|
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Represents a read-only Data Transfer Object (DTO) for an envelope receiver.
|
||||||
|
/// Contains information about the receiver, associated envelope, and audit details.
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public class EnvelopeReceiverReadOnlyDto
|
||||||
{
|
{
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
/// <summary>
|
||||||
public record EnvelopeReceiverReadOnlyDto(
|
/// Gets or inits the unique identifier of the envelope receiver.
|
||||||
long Id,
|
/// </summary>
|
||||||
long EnvelopeId,
|
public long Id { get; init; }
|
||||||
string ReceiverMail,
|
|
||||||
DateTime DateValid,
|
/// <summary>
|
||||||
DateTime AddedWhen,
|
/// Gets or inits the identifier of the associated envelope.
|
||||||
string AddedWho,
|
/// </summary>
|
||||||
EnvelopeDto? Envelope = null,
|
public long EnvelopeId { get; init; }
|
||||||
string? ChangedWho = null,
|
|
||||||
DateTime? ChangedWhen = null,
|
/// <summary>
|
||||||
ReceiverReadDto? Receiver = null);
|
/// Gets or inits the email address of the receiver.
|
||||||
|
/// </summary>
|
||||||
|
public required string ReceiverMail { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or inits the date until which the receiver is valid.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime DateValid { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or inits the date and time when the receiver was added.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime AddedWhen { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or inits the user who added the receiver.
|
||||||
|
/// Default value is 'unknown'.
|
||||||
|
/// </summary>
|
||||||
|
public string AddedWho { get; init; } = "Unknown";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or inits the associated envelope details.
|
||||||
|
/// </summary>
|
||||||
|
public EnvelopeDto? Envelope { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or inits the user who last changed the receiver, if any.
|
||||||
|
/// </summary>
|
||||||
|
public string? ChangedWho { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or inits the date and time when the receiver was last changed, if any.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? ChangedWhen { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or inits the associated receiver details.
|
||||||
|
/// </summary>
|
||||||
|
public ReceiverReadDto? Receiver { get; set; }
|
||||||
}
|
}
|
||||||
@@ -1,14 +1,31 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly
|
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data Transfer Object for updating a read-only envelope receiver.
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public class EnvelopeReceiverReadOnlyUpdateDto
|
||||||
{
|
{
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
/// <summary>
|
||||||
public record EnvelopeReceiverReadOnlyUpdateDto(
|
/// Gets or sets the unique identifier of the envelope receiver.
|
||||||
long Id,
|
/// </summary>
|
||||||
DateTime DateValid,
|
public long Id { get; init; }
|
||||||
string ChangedWho) : IUnique<long>
|
|
||||||
{
|
/// <summary>
|
||||||
public DateTime ChangedWhen { get; } = DateTime.Now;
|
/// Gets or sets the date when the envelope receiver becomes valid.
|
||||||
};
|
/// </summary>
|
||||||
|
public DateTime DateValid { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the name of the user who made the change.
|
||||||
|
/// Default value is unknown.
|
||||||
|
/// </summary>
|
||||||
|
public string ChangedWho { get; set; } = "Unknown";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the date and time when the change was made.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime ChangedWhen { get; set; } = DateTime.Now;
|
||||||
}
|
}
|
||||||
@@ -1,23 +1,85 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs
|
namespace EnvelopeGenerator.Application.DTOs;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data Transfer Object representing a type of envelope with its configuration settings.
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public class EnvelopeTypeDto
|
||||||
{
|
{
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
/// <summary>
|
||||||
public record EnvelopeTypeDto(
|
/// Gets or sets the unique identifier of the envelope type.
|
||||||
int Id,
|
/// </summary>
|
||||||
string Title,
|
public int Id { get; set; }
|
||||||
string Language,
|
|
||||||
int? ExpiresDays,
|
/// <summary>
|
||||||
int? CertificationType,
|
/// Gets or sets the title of the envelope type.
|
||||||
bool? UseAccessCode,
|
/// </summary>
|
||||||
int? FinalEmailToCreator,
|
public string Title { get; set; } = string.Empty;
|
||||||
int? FinalEmailToReceivers,
|
|
||||||
DateTime AddedWhen,
|
/// <summary>
|
||||||
DateTime? ChangedWhen,
|
/// Gets or sets the language code used in this envelope type.
|
||||||
int? ExpiresWarningDays,
|
/// </summary>
|
||||||
bool? SendReminderEmails,
|
public string Language { get; set; } = "de-DE";
|
||||||
int? FirstReminderDays,
|
|
||||||
int? ReminderIntervalDays,
|
/// <summary>
|
||||||
int? ContractType) : IUnique<int>;
|
/// Gets or sets the number of days after which the envelope expires.
|
||||||
|
/// </summary>
|
||||||
|
public int? ExpiresDays { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the certification type identifier.
|
||||||
|
/// </summary>
|
||||||
|
public int? CertificationType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets a value indicating whether an access code is required.
|
||||||
|
/// </summary>
|
||||||
|
public bool? UseAccessCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the final email template ID to be sent to the creator.
|
||||||
|
/// </summary>
|
||||||
|
public int? FinalEmailToCreator { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the final email template ID to be sent to the receivers.
|
||||||
|
/// </summary>
|
||||||
|
public int? FinalEmailToReceivers { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the timestamp when this envelope type was added.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime AddedWhen { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the timestamp when this envelope type was last changed.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? ChangedWhen { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the number of days before expiry when a warning should be sent.
|
||||||
|
/// </summary>
|
||||||
|
public int? ExpiresWarningDays { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets a value indicating whether reminder emails should be sent.
|
||||||
|
/// </summary>
|
||||||
|
public bool? SendReminderEmails { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the number of days before the first reminder is sent.
|
||||||
|
/// </summary>
|
||||||
|
public int? FirstReminderDays { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the interval in days between reminder emails.
|
||||||
|
/// </summary>
|
||||||
|
public int? ReminderIntervalDays { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the contract type associated with the envelope type.
|
||||||
|
/// </summary>
|
||||||
|
public int? ContractType { get; set; }
|
||||||
}
|
}
|
||||||
@@ -37,7 +37,6 @@ public class MappingProfile : Profile
|
|||||||
CreateMap<Domain.Entities.Receiver, ReceiverReadDto>();
|
CreateMap<Domain.Entities.Receiver, ReceiverReadDto>();
|
||||||
CreateMap<Domain.Entities.Receiver, ReceiverCreateDto>();
|
CreateMap<Domain.Entities.Receiver, ReceiverCreateDto>();
|
||||||
CreateMap<Domain.Entities.Receiver, ReceiverUpdateDto>();
|
CreateMap<Domain.Entities.Receiver, ReceiverUpdateDto>();
|
||||||
CreateMap<UserReceiver, UserReceiverDto>();
|
|
||||||
CreateMap<Domain.Entities.EnvelopeReceiverReadOnly, EnvelopeReceiverReadOnlyDto>();
|
CreateMap<Domain.Entities.EnvelopeReceiverReadOnly, EnvelopeReceiverReadOnlyDto>();
|
||||||
|
|
||||||
// DTO to Entity mappings
|
// DTO to Entity mappings
|
||||||
@@ -55,7 +54,6 @@ public class MappingProfile : Profile
|
|||||||
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<ReceiverCreateDto, Domain.Entities.Receiver>();
|
CreateMap<ReceiverCreateDto, Domain.Entities.Receiver>();
|
||||||
CreateMap<ReceiverUpdateDto, Domain.Entities.Receiver>();
|
CreateMap<ReceiverUpdateDto, Domain.Entities.Receiver>();
|
||||||
CreateMap<UserReceiverDto, UserReceiver>();
|
|
||||||
CreateMap<EnvelopeReceiverBase, EnvelopeReceiverBasicDto>();
|
CreateMap<EnvelopeReceiverBase, EnvelopeReceiverBasicDto>();
|
||||||
CreateMap<EnvelopeReceiverReadOnlyCreateDto, Domain.Entities.EnvelopeReceiverReadOnly>();
|
CreateMap<EnvelopeReceiverReadOnlyCreateDto, Domain.Entities.EnvelopeReceiverReadOnly>();
|
||||||
CreateMap<EnvelopeReceiverReadOnlyUpdateDto, Domain.Entities.EnvelopeReceiverReadOnly>();
|
CreateMap<EnvelopeReceiverReadOnlyUpdateDto, Domain.Entities.EnvelopeReceiverReadOnly>();
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs.Messaging
|
namespace EnvelopeGenerator.Application.DTOs.Messaging;
|
||||||
{
|
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
/// <summary>
|
||||||
public class GtxMessagingResponse : Dictionary<string, object?> { }
|
///
|
||||||
}
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public class GtxMessagingResponse : Dictionary<string, object?> { }
|
||||||
@@ -1,14 +1,25 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs.Messaging
|
namespace EnvelopeGenerator.Application.DTOs.Messaging;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public record SmsResponse
|
||||||
{
|
{
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
/// <summary>
|
||||||
public record SmsResponse
|
///
|
||||||
{
|
/// </summary>
|
||||||
public required bool Ok { get; init; }
|
public required bool Ok { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns !Ok
|
||||||
|
/// </summary>
|
||||||
public bool Failed => !Ok;
|
public bool Failed => !Ok;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public dynamic? Errors { get; init; }
|
public dynamic? Errors { get; init; }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -3,21 +3,51 @@ using System.ComponentModel.DataAnnotations;
|
|||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs.Receiver
|
namespace EnvelopeGenerator.Application.DTOs.Receiver;
|
||||||
{
|
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
|
||||||
public record ReceiverCreateDto([EmailAddress] string EmailAddress, string? TotpSecretkey = null)
|
|
||||||
{
|
|
||||||
public string Signature => sha256HexOfMail.Value;
|
|
||||||
|
|
||||||
private readonly Lazy<string> sha256HexOfMail = new(() =>
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public record ReceiverCreateDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public ReceiverCreateDto()
|
||||||
{
|
{
|
||||||
var bytes_arr = Encoding.UTF8.GetBytes(EmailAddress.ToUpper());
|
_sha256HexOfMail = new(() =>
|
||||||
|
{
|
||||||
|
var bytes_arr = Encoding.UTF8.GetBytes(EmailAddress!.ToUpper());
|
||||||
var hash_arr = SHA256.HashData(bytes_arr);
|
var hash_arr = SHA256.HashData(bytes_arr);
|
||||||
var hexa_str = BitConverter.ToString(hash_arr);
|
var hexa_str = BitConverter.ToString(hash_arr);
|
||||||
return hexa_str.Replace("-", string.Empty);
|
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;
|
public DateTime AddedWhen { get; } = DateTime.Now;
|
||||||
};
|
};
|
||||||
}
|
|
||||||
@@ -1,25 +1,62 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
||||||
using DigitalData.Core.DTO;
|
|
||||||
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.DTOs.Receiver;
|
namespace EnvelopeGenerator.Application.DTOs.Receiver;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
public record ReceiverReadDto(
|
public class ReceiverReadDto
|
||||||
int Id,
|
|
||||||
string EmailAddress,
|
|
||||||
string Signature,
|
|
||||||
DateTime AddedWhen
|
|
||||||
) : BaseDTO<int>(Id), IUnique<int>
|
|
||||||
{
|
{
|
||||||
[JsonIgnore]
|
/// <summary>
|
||||||
public IEnumerable<EnvelopeReceiverBasicDto>? EnvelopeReceivers { get; init; }
|
///
|
||||||
|
/// </summary>
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public required string EmailAddress { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public required string Signature { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public DateTime AddedWhen { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[JsonIgnore]
|
||||||
|
public IEnumerable<EnvelopeReceiverBasicDto>? EnvelopeReceivers { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public string? LastUsedName => EnvelopeReceivers?.LastOrDefault()?.Name;
|
public string? LastUsedName => EnvelopeReceivers?.LastOrDefault()?.Name;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public string? TotpSecretkey { get; set; } = null;
|
public string? TotpSecretkey { get; set; } = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public DateTime? TfaRegDeadline { get; set; }
|
public DateTime? TfaRegDeadline { get; set; }
|
||||||
};
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public override int GetHashCode()
|
||||||
|
{
|
||||||
|
return Id.GetHashCode();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,27 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs.Receiver;
|
namespace EnvelopeGenerator.Application.DTOs.Receiver;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data Transfer Object for updating a receiver's information.
|
||||||
|
/// </summary>
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
public record ReceiverUpdateDto(int Id, string? TotpSecretkey = null, DateTime? TfaRegDeadline = null) : IUnique<int>;
|
public class ReceiverUpdateDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the unique identifier of the receiver.
|
||||||
|
/// </summary>
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the TOTP (Time-based One-Time Password) secret key.
|
||||||
|
/// Optional.
|
||||||
|
/// </summary>
|
||||||
|
public string? TotpSecretkey { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the deadline for two-factor authentication registration.
|
||||||
|
/// Optional.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? TfaRegDeadline { get; set; }
|
||||||
|
}
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs
|
|
||||||
{
|
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
|
||||||
public record UserReceiverDto(
|
|
||||||
int Id,
|
|
||||||
int UserId,
|
|
||||||
int ReceiverId,
|
|
||||||
string Name,
|
|
||||||
string CompanyName,
|
|
||||||
string JobTitle,
|
|
||||||
DateTime AddedWhen) : IUnique<int>;
|
|
||||||
}
|
|
||||||
@@ -22,6 +22,7 @@ public static class DependencyInjection
|
|||||||
/// <param name="services"></param>
|
/// <param name="services"></param>
|
||||||
/// <param name="config"></param>
|
/// <param name="config"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public static IServiceCollection AddEnvelopeGeneratorServices(this IServiceCollection services, IConfiguration config)
|
public static IServiceCollection AddEnvelopeGeneratorServices(this IServiceCollection services, IConfiguration config)
|
||||||
{
|
{
|
||||||
//Inject CRUD Service and repositoriesad
|
//Inject CRUD Service and repositoriesad
|
||||||
@@ -37,7 +38,6 @@ public static class DependencyInjection
|
|||||||
services.TryAddScoped<IEnvelopeReceiverService, EnvelopeReceiverService>();
|
services.TryAddScoped<IEnvelopeReceiverService, EnvelopeReceiverService>();
|
||||||
services.TryAddScoped<IEnvelopeTypeService, EnvelopeTypeService>();
|
services.TryAddScoped<IEnvelopeTypeService, EnvelopeTypeService>();
|
||||||
services.TryAddScoped<IReceiverService, ReceiverService>();
|
services.TryAddScoped<IReceiverService, ReceiverService>();
|
||||||
services.TryAddScoped<IUserReceiverService, UserReceiverService>();
|
|
||||||
services.TryAddScoped<IEnvelopeReceiverReadOnlyService, EnvelopeReceiverReadOnlyService>();
|
services.TryAddScoped<IEnvelopeReceiverReadOnlyService, EnvelopeReceiverReadOnlyService>();
|
||||||
|
|
||||||
//Auto mapping profiles
|
//Auto mapping profiles
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using DigitalData.Core.Abstractions.Infrastructure;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
|
|
||||||
@@ -34,6 +34,7 @@ public class ReadDocumentQueryHandler : IRequestHandler<ReadDocumentQuery, ReadD
|
|||||||
/// <exception cref="InvalidOperationException">
|
/// <exception cref="InvalidOperationException">
|
||||||
/// Thrown when neither <see cref="ReadDocumentQuery.Id"/> nor <see cref="ReadDocumentQuery.EnvelopeId"/> is provided.
|
/// Thrown when neither <see cref="ReadDocumentQuery.Id"/> nor <see cref="ReadDocumentQuery.EnvelopeId"/> is provided.
|
||||||
/// </exception>
|
/// </exception>
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public async Task<ReadDocumentResponse?> Handle(ReadDocumentQuery query, CancellationToken cancellationToken)
|
public async Task<ReadDocumentResponse?> Handle(ReadDocumentQuery query, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
if (query.Id is not null)
|
if (query.Id is not null)
|
||||||
|
|||||||
@@ -1,24 +1,23 @@
|
|||||||
using EnvelopeGenerator.Common;
|
using EnvelopeGenerator.Domain;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.EmailTemplates.Commands.Reset;
|
namespace EnvelopeGenerator.Application.EmailTemplates.Commands.Reset;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Ein Befehl zum Zurücksetzen einer E-Mail-Vorlage auf die Standardwerte.
|
/// Ein Befehl zum Zurücksetzen einer E-Mail-Vorlage auf die Standardwerte.
|
||||||
/// Erbt von <see cref="EmailTemplateQuery"/> und ermöglicht die Angabe einer optionalen ID und eines Typs der E-Mail-Vorlage.
|
/// Erbt von <see cref="EmailTemplateQuery"/> und ermöglicht die Angabe einer optionalen ID und eines Typs der E-Mail-Vorlage.<br/><br/>
|
||||||
|
/// Beispiele:<br/>
|
||||||
|
/// 0 - DocumentReceived: Benachrichtigung über den Empfang eines Dokuments.<br/>
|
||||||
|
/// 1 - DocumentSigned: Benachrichtigung über die Unterzeichnung eines Dokuments.<br/>
|
||||||
|
/// 2 - DocumentDeleted: Benachrichtigung über das Löschen eines Dokuments.<br/>
|
||||||
|
/// 3 - DocumentCompleted: Benachrichtigung über den Abschluss eines Dokuments.<br/>
|
||||||
|
/// 4 - DocumentAccessCodeReceived: Benachrichtigung über den Erhalt eines Zugangscodes.<br/>
|
||||||
|
/// 5 - DocumentShared: Benachrichtigung über das Teilen eines Dokuments.<br/>
|
||||||
|
/// 6 - TotpSecret: Benachrichtigung über ein TOTP-Geheimnis.<br/>
|
||||||
|
/// 7 - DocumentRejected_ADM (Für den Absender): Mail an den Absender, wenn das Dokument abgelehnt wird.<br/>
|
||||||
|
/// 8 - DocumentRejected_REC (Für den ablehnenden Empfänger): Mail an den ablehnenden Empfänger, wenn das Dokument abgelehnt wird.<br/>
|
||||||
|
/// 9 - DocumentRejected_REC_2 (Für sonstige Empfänger): Mail an andere Empfänger (Brief), wenn das Dokument abgelehnt wird.<br/>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// Beispiele:
|
|
||||||
/// 0 - DocumentReceived: Benachrichtigung über den Empfang eines Dokuments.
|
|
||||||
/// 1 - DocumentSigned: Benachrichtigung über die Unterzeichnung eines Dokuments.
|
|
||||||
/// 2 - DocumentDeleted: Benachrichtigung über das Löschen eines Dokuments.
|
|
||||||
/// 3 - DocumentCompleted: Benachrichtigung über den Abschluss eines Dokuments.
|
|
||||||
/// 4 - DocumentAccessCodeReceived: Benachrichtigung über den Erhalt eines Zugangscodes.
|
|
||||||
/// 5 - DocumentShared: Benachrichtigung über das Teilen eines Dokuments.
|
|
||||||
/// 6 - TotpSecret: Benachrichtigung über ein TOTP-Geheimnis.
|
|
||||||
/// 7 - DocumentRejected_ADM (Für den Absender): Mail an den Absender, 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.
|
|
||||||
/// </param>
|
|
||||||
public record ResetEmailTemplateCommand : EmailTemplateQuery, IRequest
|
public record ResetEmailTemplateCommand : EmailTemplateQuery, IRequest
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -34,7 +33,7 @@ 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="Constants.EmailTemplateType"/> (optional).
|
/// <param name="Type">Der Typ der E-Mail-Vorlage, z. B. <see cref="Constants.EmailTemplateType"/> (optional).</param>
|
||||||
public ResetEmailTemplateCommand(int? Id = null, Constants.EmailTemplateType? Type = null) : base(Id, Type)
|
public ResetEmailTemplateCommand(int? Id = null, Constants.EmailTemplateType? Type = null) : base(Id, Type)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using DigitalData.Core.Abstractions.Infrastructure;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Application.EmailTemplates.Queries.Read;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
|
|
||||||
@@ -28,13 +27,14 @@ public class ResetEmailTemplateCommandHandler : IRequestHandler<ResetEmailTempla
|
|||||||
/// <param name="request"></param>
|
/// <param name="request"></param>
|
||||||
/// <param name="cancel"></param>
|
/// <param name="cancel"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
|
[Obsolete("Use Read-method returning IReadQuery<TEntity> instead.")]
|
||||||
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.ReadAllAsync<EmailTemplateDto>(t => t.Id == request.Id, cancel)
|
? await _repository.ReadAllAsync<EmailTemplateDto>(t => t.Id == request.Id, cancel)
|
||||||
: request.Type is not null
|
: request.Type is not null
|
||||||
? await _repository.ReadAllAsync<EmailTemplateDto>(t => t.Name == request.Type.ToString(), cancel)
|
? await _repository.ReadAllAsync<EmailTemplateDto>(t => t.Name == request.Type.ToString(), cancel)
|
||||||
: await _repository.ReadAllAsync<EmailTemplateDto>(ct: cancel);
|
: await _repository.ReadAllAsync<EmailTemplateDto>(cancellation: cancel);
|
||||||
|
|
||||||
foreach (var temp in temps)
|
foreach (var temp in temps)
|
||||||
{
|
{
|
||||||
@@ -70,7 +70,7 @@ public class ResetEmailTemplateCommandHandler : IRequestHandler<ResetEmailTempla
|
|||||||
new(){
|
new(){
|
||||||
Id = 4,
|
Id = 4,
|
||||||
Name = "DocumentCompleted",
|
Name = "DocumentCompleted",
|
||||||
Body = "Guten Tag [NAME_RECEIVER],<br />\r\n<br />\r\nDer Signaturvorgang <B><I>'[DOCUMENT_TITLE]'</I></B> wurde erfolgreich abgeschlossen.<br />\r\n<br />\r\nSie erhalten das Dokument mit einem detaillierten Ergebnisbericht als Anhang zu dieser Email.<br />\r\n<br />\r\nMit freundlichen Grüßen<br />\r\n<br />\r\n[NAME_PORTAL]",
|
Body = "Guten Tag [NAME_RECEIVER],<br />\r\n<br />\r\nDer Signaturvorgang <B><I>'[DOCUMENT_TITLE]'</I></B> wurde erfolgreich abgeschlossen.<br />\r\n<br />\r\nSie erhalten das Dokument mit einem detaillierten Ergebnisbericht als Anhang zu dieser EmailAddress.<br />\r\n<br />\r\nMit freundlichen Grüßen<br />\r\n<br />\r\n[NAME_PORTAL]",
|
||||||
Subject = "Umschlag abgeschlossen: '[DOCUMENT_TITLE]'"
|
Subject = "Umschlag abgeschlossen: '[DOCUMENT_TITLE]'"
|
||||||
},
|
},
|
||||||
new(){
|
new(){
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using DigitalData.Core.Abstractions.Infrastructure;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Application.Exceptions;
|
using EnvelopeGenerator.Application.Exceptions;
|
||||||
|
using EnvelopeGenerator.Domain;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
|
|
||||||
@@ -30,6 +31,7 @@ public class UpdateEmailTemplateCommandHandler : IRequestHandler<UpdateEmailTemp
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="InvalidOperationException"></exception>
|
/// <exception cref="InvalidOperationException"></exception>
|
||||||
/// <exception cref="NotFoundException"></exception>
|
/// <exception cref="NotFoundException"></exception>
|
||||||
|
[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? temp;
|
EmailTemplateDto? temp;
|
||||||
@@ -38,7 +40,7 @@ public class UpdateEmailTemplateCommandHandler : IRequestHandler<UpdateEmailTemp
|
|||||||
{
|
{
|
||||||
temp = await _repository.ReadOrDefaultAsync<EmailTemplateDto>(t => t.Id == id, single: false, cancel);
|
temp = await _repository.ReadOrDefaultAsync<EmailTemplateDto>(t => t.Id == id, single: false, cancel);
|
||||||
}
|
}
|
||||||
else if (request!.EmailTemplateQuery!.Type is Common.Constants.EmailTemplateType type)
|
else if (request!.EmailTemplateQuery!.Type is Constants.EmailTemplateType type)
|
||||||
{
|
{
|
||||||
temp = await _repository.ReadOrDefaultAsync<EmailTemplateDto>(t => t.Name == type.ToString(), single: false, cancel);
|
temp = await _repository.ReadOrDefaultAsync<EmailTemplateDto>(t => t.Name == type.ToString(), single: false, cancel);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using EnvelopeGenerator.Common;
|
using EnvelopeGenerator.Domain;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.EmailTemplates;
|
namespace EnvelopeGenerator.Application.EmailTemplates;
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using EnvelopeGenerator.Application.Contracts.Repositories;
|
using EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Domain;
|
||||||
using EnvelopeGenerator.Common;
|
|
||||||
using MediatR;
|
using MediatR;
|
||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.EmailTemplates.Queries.Read;
|
namespace EnvelopeGenerator.Application.EmailTemplates.Queries.Read;
|
||||||
|
|
||||||
@@ -15,6 +12,7 @@ public class ReadEmailTemplateQueryHandler : IRequestHandler<ReadEmailTemplateQu
|
|||||||
{
|
{
|
||||||
private readonly IMapper _mapper;
|
private readonly IMapper _mapper;
|
||||||
|
|
||||||
|
[Obsolete("Use Read-method returning IReadQuery<TEntity> instead.")]
|
||||||
private readonly IEmailTemplateRepository _repository;
|
private readonly IEmailTemplateRepository _repository;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -24,6 +22,7 @@ public class ReadEmailTemplateQueryHandler : IRequestHandler<ReadEmailTemplateQu
|
|||||||
/// <param name="repository">
|
/// <param name="repository">
|
||||||
/// Die AutoMapper-Instanz, die zum Zuordnen von Objekten verwendet wird.
|
/// Die AutoMapper-Instanz, die zum Zuordnen von Objekten verwendet wird.
|
||||||
/// </param>
|
/// </param>
|
||||||
|
[Obsolete("Use Read-method returning IReadQuery<TEntity> instead.")]
|
||||||
public ReadEmailTemplateQueryHandler(IMapper mapper, IEmailTemplateRepository repository)
|
public ReadEmailTemplateQueryHandler(IMapper mapper, IEmailTemplateRepository repository)
|
||||||
{
|
{
|
||||||
_mapper = mapper;
|
_mapper = mapper;
|
||||||
@@ -37,6 +36,7 @@ public class ReadEmailTemplateQueryHandler : IRequestHandler<ReadEmailTemplateQu
|
|||||||
/// <param name="cancellationToken"></param>
|
/// <param name="cancellationToken"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="InvalidOperationException"></exception>
|
/// <exception cref="InvalidOperationException"></exception>
|
||||||
|
[Obsolete("Use IRepository")]
|
||||||
public async Task<ReadEmailTemplateResponse?> Handle(ReadEmailTemplateQuery request, CancellationToken cancellationToken)
|
public async Task<ReadEmailTemplateResponse?> Handle(ReadEmailTemplateQuery request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var temp = request.Id is int id
|
var temp = request.Id is int id
|
||||||
|
|||||||
@@ -14,24 +14,20 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Dapper" Version="2.1.66" />
|
<PackageReference Include="Dapper" Version="2.1.66" />
|
||||||
<PackageReference Include="DigitalData.Core.Abstractions" Version="3.6.0" />
|
<PackageReference Include="DigitalData.Core.Abstraction.Application" Version="1.0.0" />
|
||||||
<PackageReference Include="DigitalData.Core.Application" Version="3.2.1" />
|
<PackageReference Include="DigitalData.Core.Application" Version="3.3.4" />
|
||||||
<PackageReference Include="DigitalData.Core.Client" Version="2.0.3" />
|
<PackageReference Include="DigitalData.Core.Client" Version="2.1.0" />
|
||||||
<PackageReference Include="DigitalData.Core.DTO" Version="2.0.1" />
|
<PackageReference Include="DigitalData.EmailProfilerDispatcher" Version="3.1.1" />
|
||||||
<PackageReference Include="DigitalData.EmailProfilerDispatcher" Version="3.0.0" />
|
|
||||||
<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.Data.SqlClient" Version="5.1.1" />
|
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.5" />
|
||||||
<PackageReference Include="Microsoft.Data.SqlClient" Version="6.0.2" />
|
|
||||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.4" />
|
|
||||||
<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.0.0" />
|
<PackageReference Include="UserManager" Version="1.1.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\EnvelopeGenerator.Common\EnvelopeGenerator.Common.vbproj" />
|
|
||||||
<ProjectReference Include="..\EnvelopeGenerator.Domain\EnvelopeGenerator.Domain.csproj" />
|
<ProjectReference Include="..\EnvelopeGenerator.Domain\EnvelopeGenerator.Domain.csproj" />
|
||||||
<ProjectReference Include="..\EnvelopeGenerator.Extensions\EnvelopeGenerator.Extensions.csproj" />
|
<ProjectReference Include="..\EnvelopeGenerator.Extensions\EnvelopeGenerator.Extensions.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
@@ -65,6 +61,7 @@
|
|||||||
|
|
||||||
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
|
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
|
||||||
<PackageReference Include="AutoMapper" Version="13.0.1" />
|
<PackageReference Include="AutoMapper" Version="13.0.1" />
|
||||||
|
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.3" />
|
||||||
<PackageReference Include="CommandDotNet">
|
<PackageReference Include="CommandDotNet">
|
||||||
<Version>7.0.5</Version>
|
<Version>7.0.5</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
@@ -72,6 +69,7 @@
|
|||||||
|
|
||||||
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
|
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
|
||||||
<PackageReference Include="AutoMapper" Version="14.0.0" />
|
<PackageReference Include="AutoMapper" Version="14.0.0" />
|
||||||
|
<PackageReference Include="Microsoft.Data.SqlClient" Version="6.0.2" />
|
||||||
<PackageReference Include="CommandDotNet">
|
<PackageReference Include="CommandDotNet">
|
||||||
<Version>8.1.1</Version>
|
<Version>8.1.1</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
@@ -79,6 +77,7 @@
|
|||||||
|
|
||||||
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
|
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
|
||||||
<PackageReference Include="AutoMapper" Version="14.0.0" />
|
<PackageReference Include="AutoMapper" Version="14.0.0" />
|
||||||
|
<PackageReference Include="Microsoft.Data.SqlClient" Version="6.0.2" />
|
||||||
<PackageReference Include="CommandDotNet">
|
<PackageReference Include="CommandDotNet">
|
||||||
<Version>8.1.1</Version>
|
<Version>8.1.1</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|||||||
@@ -18,4 +18,4 @@ public record CreateEnvelopeReceiverCommand(
|
|||||||
[Required] DocumentCreateCommand Document,
|
[Required] DocumentCreateCommand Document,
|
||||||
[Required] IEnumerable<ReceiverGetOrCreateCommand> Receivers,
|
[Required] IEnumerable<ReceiverGetOrCreateCommand> Receivers,
|
||||||
bool TFAEnabled = false
|
bool TFAEnabled = false
|
||||||
) : CreateEnvelopeCommand(Title, Message, TFAEnabled), IRequest<CreateEnvelopeReceiverResponse?>;
|
) : CreateEnvelopeCommand(Title, Message, TFAEnabled), IRequest<CreateEnvelopeReceiverResponse>;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
using EnvelopeGenerator.Common;
|
using EnvelopeGenerator.Domain;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Envelopes.Queries.Read;
|
namespace EnvelopeGenerator.Application.Envelopes.Queries.Read;
|
||||||
|
|
||||||
|
|||||||
@@ -1,32 +1,83 @@
|
|||||||
using Microsoft.Extensions.Caching.Distributed;
|
using Microsoft.Extensions.Caching.Distributed;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Extensions
|
namespace EnvelopeGenerator.Application.Extensions;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public static class CacheExtensions
|
||||||
{
|
{
|
||||||
public static class CacheExtensions
|
/// <summary>
|
||||||
{
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="cache"></param>
|
||||||
|
/// <param name="key"></param>
|
||||||
|
/// <param name="value"></param>
|
||||||
|
/// <param name="options"></param>
|
||||||
|
/// <param name="cToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public static Task SetLongAsync(this IDistributedCache cache, string key, long value, DistributedCacheEntryOptions? options = null, CancellationToken cToken = default)
|
public static Task SetLongAsync(this IDistributedCache cache, string key, long value, DistributedCacheEntryOptions? options = null, CancellationToken cToken = default)
|
||||||
=> options is null
|
=> options is null
|
||||||
? cache.SetAsync(key, BitConverter.GetBytes(value), token: cToken)
|
? cache.SetAsync(key, BitConverter.GetBytes(value), token: cToken)
|
||||||
: cache.SetAsync(key, BitConverter.GetBytes(value), options: options, token: cToken);
|
: cache.SetAsync(key, BitConverter.GetBytes(value), options: options, token: cToken);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="cache"></param>
|
||||||
|
/// <param name="key"></param>
|
||||||
|
/// <param name="cToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public static async Task<long?> GetLongAsync(this IDistributedCache cache, string key, CancellationToken cToken = default)
|
public static async Task<long?> GetLongAsync(this IDistributedCache cache, string key, CancellationToken cToken = default)
|
||||||
{
|
{
|
||||||
var value = await cache.GetAsync(key, cToken);
|
var value = await cache.GetAsync(key, cToken);
|
||||||
return value is null ? null : BitConverter.ToInt64(value, 0);
|
return value is null ? null : BitConverter.ToInt64(value, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="cache"></param>
|
||||||
|
/// <param name="key"></param>
|
||||||
|
/// <param name="value"></param>
|
||||||
|
/// <param name="options"></param>
|
||||||
|
/// <param name="cToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public static Task SetDateTimeAsync(this IDistributedCache cache, string key, DateTime value, DistributedCacheEntryOptions? options = null, CancellationToken cToken = default)
|
public static Task SetDateTimeAsync(this IDistributedCache cache, string key, DateTime value, DistributedCacheEntryOptions? options = null, CancellationToken cToken = default)
|
||||||
=> cache.SetLongAsync(key: key, value: value.Ticks, options: options, cToken: cToken);
|
=> cache.SetLongAsync(key: key, value: value.Ticks, options: options, cToken: cToken);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="cache"></param>
|
||||||
|
/// <param name="key"></param>
|
||||||
|
/// <param name="cToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public static async Task<DateTime?> GetDateTimeAsync(this IDistributedCache cache, string key, CancellationToken cToken = default)
|
public static async Task<DateTime?> GetDateTimeAsync(this IDistributedCache cache, string key, CancellationToken cToken = default)
|
||||||
{
|
{
|
||||||
var value = await cache.GetAsync(key, cToken);
|
var value = await cache.GetAsync(key, cToken);
|
||||||
return value is null ? null : new(BitConverter.ToInt64(value, 0));
|
return value is null ? null : new(BitConverter.ToInt64(value, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="cache"></param>
|
||||||
|
/// <param name="key"></param>
|
||||||
|
/// <param name="value"></param>
|
||||||
|
/// <param name="options"></param>
|
||||||
|
/// <param name="cToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public static Task SetTimeSpanAsync(this IDistributedCache cache, string key, TimeSpan value, DistributedCacheEntryOptions? options = null, CancellationToken cToken = default)
|
public static Task SetTimeSpanAsync(this IDistributedCache cache, string key, TimeSpan value, DistributedCacheEntryOptions? options = null, CancellationToken cToken = default)
|
||||||
=> cache.SetLongAsync(key: key, value: value.Ticks, options: options, cToken);
|
=> cache.SetLongAsync(key: key, value: value.Ticks, options: options, cToken);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="cache"></param>
|
||||||
|
/// <param name="key"></param>
|
||||||
|
/// <param name="cToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public static async Task<TimeSpan?> GetTimeSpanAsync(this IDistributedCache cache, string key, CancellationToken cToken = default)
|
public static async Task<TimeSpan?> GetTimeSpanAsync(this IDistributedCache cache, string key, CancellationToken cToken = default)
|
||||||
{
|
{
|
||||||
var value = await cache.GetAsync(key, cToken);
|
var value = await cache.GetAsync(key, cToken);
|
||||||
@@ -37,6 +88,17 @@ namespace EnvelopeGenerator.Application.Extensions
|
|||||||
#region GetOrSetAsync
|
#region GetOrSetAsync
|
||||||
|
|
||||||
#region string
|
#region string
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="cache"></param>
|
||||||
|
/// <param name="key"></param>
|
||||||
|
/// <param name="factory"></param>
|
||||||
|
/// <param name="options"></param>
|
||||||
|
/// <param name="cacheInBackground"></param>
|
||||||
|
/// <param name="cToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public static async Task<string> GetOrSetAsync(this IDistributedCache cache, string key, Func<string> factory, DistributedCacheEntryOptions? options = null, bool cacheInBackground = false, CancellationToken cToken = default)
|
public static async Task<string> GetOrSetAsync(this IDistributedCache cache, string key, Func<string> factory, DistributedCacheEntryOptions? options = null, bool cacheInBackground = false, CancellationToken cToken = default)
|
||||||
{
|
{
|
||||||
var value = await cache.GetStringAsync(key, cToken);
|
var value = await cache.GetStringAsync(key, cToken);
|
||||||
@@ -58,6 +120,16 @@ namespace EnvelopeGenerator.Application.Extensions
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="cache"></param>
|
||||||
|
/// <param name="key"></param>
|
||||||
|
/// <param name="factoryAsync"></param>
|
||||||
|
/// <param name="options"></param>
|
||||||
|
/// <param name="cacheInBackground"></param>
|
||||||
|
/// <param name="cToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public static async Task<string> GetOrSetAsync(this IDistributedCache cache, string key, Func<Task<string>> factoryAsync, DistributedCacheEntryOptions? options = null, bool cacheInBackground = false, CancellationToken cToken = default)
|
public static async Task<string> GetOrSetAsync(this IDistributedCache cache, string key, Func<Task<string>> factoryAsync, DistributedCacheEntryOptions? options = null, bool cacheInBackground = false, CancellationToken cToken = default)
|
||||||
{
|
{
|
||||||
var value = await cache.GetStringAsync(key, cToken);
|
var value = await cache.GetStringAsync(key, cToken);
|
||||||
@@ -81,6 +153,16 @@ namespace EnvelopeGenerator.Application.Extensions
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region DateTime
|
#region DateTime
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="cache"></param>
|
||||||
|
/// <param name="key"></param>
|
||||||
|
/// <param name="factory"></param>
|
||||||
|
/// <param name="options"></param>
|
||||||
|
/// <param name="cacheInBackground"></param>
|
||||||
|
/// <param name="cToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public static async Task<DateTime> GetOrSetAsync(this IDistributedCache cache, string key, Func<DateTime> factory, DistributedCacheEntryOptions? options = null, bool cacheInBackground = false, CancellationToken cToken = default)
|
public static async Task<DateTime> GetOrSetAsync(this IDistributedCache cache, string key, Func<DateTime> factory, DistributedCacheEntryOptions? options = null, bool cacheInBackground = false, CancellationToken cToken = default)
|
||||||
{
|
{
|
||||||
if (await cache.GetDateTimeAsync(key, cToken) is DateTime dateTimeValue)
|
if (await cache.GetDateTimeAsync(key, cToken) is DateTime dateTimeValue)
|
||||||
@@ -103,6 +185,16 @@ namespace EnvelopeGenerator.Application.Extensions
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="cache"></param>
|
||||||
|
/// <param name="key"></param>
|
||||||
|
/// <param name="factory"></param>
|
||||||
|
/// <param name="options"></param>
|
||||||
|
/// <param name="cacheInBackground"></param>
|
||||||
|
/// <param name="cToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public static async Task<DateTime> GetOrSetAsync(this IDistributedCache cache, string key, Func<Task<DateTime>> factory, DistributedCacheEntryOptions? options = null, bool cacheInBackground = false, CancellationToken cToken = default)
|
public static async Task<DateTime> GetOrSetAsync(this IDistributedCache cache, string key, Func<Task<DateTime>> factory, DistributedCacheEntryOptions? options = null, bool cacheInBackground = false, CancellationToken cToken = default)
|
||||||
{
|
{
|
||||||
if (await cache.GetDateTimeAsync(key, cToken) is DateTime dateTimeValue)
|
if (await cache.GetDateTimeAsync(key, cToken) is DateTime dateTimeValue)
|
||||||
@@ -127,5 +219,4 @@ namespace EnvelopeGenerator.Application.Extensions
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,14 +1,27 @@
|
|||||||
using EnvelopeGenerator.Application.DTOs.Messaging;
|
using EnvelopeGenerator.Application.DTOs.Messaging;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Extensions
|
namespace EnvelopeGenerator.Application.Extensions;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Provides extension methods for common mapping and conversion operations.
|
||||||
|
/// </summary>
|
||||||
|
public static class MappingExtensions
|
||||||
{
|
{
|
||||||
public static class MappingExtensions
|
/// <summary>
|
||||||
{
|
/// Determines whether the response indicates a successful "OK" message status.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="gtxMessagingResponse">The response object to evaluate.</param>
|
||||||
|
/// <returns><see langword="true"/> if the response contains a "message-status" key with a value of "ok" (case-insensitive);
|
||||||
|
/// otherwise, <see langword="false"/>.</returns>
|
||||||
public static bool Ok(this GtxMessagingResponse gtxMessagingResponse)
|
public static bool Ok(this GtxMessagingResponse gtxMessagingResponse)
|
||||||
=> gtxMessagingResponse.TryGetValue("message-status", out var status)
|
=> gtxMessagingResponse.TryGetValue("message-status", out var status)
|
||||||
&& status?.ToString()?.ToLower() == "ok";
|
&& status?.ToString()?.ToLower() == "ok";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Converts the specified byte array to its equivalent string representation encoded in base-64.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="bytes">The byte array to encode.</param>
|
||||||
|
/// <returns>A base-64 encoded string representation of the input byte array.</returns>
|
||||||
public static string ToBase64String(this byte[] bytes)
|
public static string ToBase64String(this byte[] bytes)
|
||||||
=> Convert.ToBase64String(bytes);
|
=> Convert.ToBase64String(bytes);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
using EnvelopeGenerator.Common;
|
using EnvelopeGenerator.Domain;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ namespace EnvelopeGenerator.Application.Histories.Queries.Read;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class ReadHistoryQueryHandler : IRequestHandler<ReadHistoryQuery, IEnumerable<ReadHistoryResponse>>
|
public class ReadHistoryQueryHandler : IRequestHandler<ReadHistoryQuery, IEnumerable<ReadHistoryResponse>>
|
||||||
{
|
{
|
||||||
|
[Obsolete("Use IRepository")]
|
||||||
private readonly IEnvelopeHistoryRepository _repository;
|
private readonly IEnvelopeHistoryRepository _repository;
|
||||||
|
|
||||||
private readonly IMapper _mapper;
|
private readonly IMapper _mapper;
|
||||||
@@ -19,6 +20,7 @@ public class ReadHistoryQueryHandler : IRequestHandler<ReadHistoryQuery, IEnumer
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="repository"></param>
|
/// <param name="repository"></param>
|
||||||
/// <param name="mapper"></param>
|
/// <param name="mapper"></param>
|
||||||
|
[Obsolete("Use IRepository")]
|
||||||
public ReadHistoryQueryHandler(IEnvelopeHistoryRepository repository, IMapper mapper)
|
public ReadHistoryQueryHandler(IEnvelopeHistoryRepository repository, IMapper mapper)
|
||||||
{
|
{
|
||||||
_repository = repository;
|
_repository = repository;
|
||||||
@@ -34,7 +36,7 @@ public class ReadHistoryQueryHandler : IRequestHandler<ReadHistoryQuery, IEnumer
|
|||||||
/// <exception cref="NotFoundException"></exception>
|
/// <exception cref="NotFoundException"></exception>
|
||||||
public async Task<IEnumerable<ReadHistoryResponse>> Handle(ReadHistoryQuery request, CancellationToken cancellationToken)
|
public async Task<IEnumerable<ReadHistoryResponse>> Handle(ReadHistoryQuery request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var hists = await _repository.ReadAsync(request.EnvelopeId, status: request.Status is null ? null : (int) request.Status);
|
var hists = await _repository.ReadAsync(request.EnvelopeId, status: request.Status is null ? null : request.Status);
|
||||||
|
|
||||||
if (!hists.Any())
|
if (!hists.Any())
|
||||||
throw new NotFoundException();
|
throw new NotFoundException();
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using EnvelopeGenerator.Common;
|
using EnvelopeGenerator.Domain;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Histories.Queries.Read;
|
namespace EnvelopeGenerator.Application.Histories.Queries.Read;
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@ public class ReadHistoryResponse
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the reference identifier of the user who performed the action.
|
/// Gets or sets the reference identifier of the user who performed the action.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string UserReference { get; set; }
|
public required string UserReference { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the status code of the envelope.
|
/// Gets or sets the status code of the envelope.
|
||||||
@@ -30,7 +30,7 @@ public class ReadHistoryResponse
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Common.Constants.ReferenceType ReferenceType => Status.ToString().FirstOrDefault() switch
|
public Constants.ReferenceType ReferenceType => Status.ToString().FirstOrDefault() switch
|
||||||
{
|
{
|
||||||
'1' => Constants.ReferenceType.Sender,
|
'1' => Constants.ReferenceType.Sender,
|
||||||
'2' => Constants.ReferenceType.Receiver,
|
'2' => Constants.ReferenceType.Receiver,
|
||||||
|
|||||||
@@ -1,20 +1,82 @@
|
|||||||
namespace EnvelopeGenerator.Application
|
namespace EnvelopeGenerator.Application;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public static class Key
|
||||||
{
|
{
|
||||||
public static class Key
|
/// <summary>
|
||||||
{
|
///
|
||||||
|
/// </summary>
|
||||||
public static readonly string InnerServiceError = nameof(InnerServiceError);
|
public static readonly string InnerServiceError = nameof(InnerServiceError);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public static readonly string EnvelopeNotFound = nameof(EnvelopeNotFound);
|
public static readonly string EnvelopeNotFound = nameof(EnvelopeNotFound);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public static readonly string EnvelopeReceiverNotFound = nameof(EnvelopeReceiverNotFound);
|
public static readonly string EnvelopeReceiverNotFound = nameof(EnvelopeReceiverNotFound);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public static readonly string AccessCodeNull = nameof(AccessCodeNull);
|
public static readonly string AccessCodeNull = nameof(AccessCodeNull);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public static readonly string WrongAccessCode = nameof(WrongAccessCode);
|
public static readonly string WrongAccessCode = nameof(WrongAccessCode);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public static readonly string DataIntegrityIssue = nameof(DataIntegrityIssue);
|
public static readonly string DataIntegrityIssue = nameof(DataIntegrityIssue);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public static readonly string SecurityBreachOrDataIntegrity = nameof(SecurityBreachOrDataIntegrity);
|
public static readonly string SecurityBreachOrDataIntegrity = nameof(SecurityBreachOrDataIntegrity);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public static readonly string PossibleDataIntegrityIssue = nameof(PossibleDataIntegrityIssue);
|
public static readonly string PossibleDataIntegrityIssue = nameof(PossibleDataIntegrityIssue);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public static readonly string SecurityBreach = nameof(SecurityBreach);
|
public static readonly string SecurityBreach = nameof(SecurityBreach);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public static readonly string PossibleSecurityBreach = nameof(PossibleSecurityBreach);
|
public static readonly string PossibleSecurityBreach = nameof(PossibleSecurityBreach);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public static readonly string WrongEnvelopeReceiverId = nameof(WrongEnvelopeReceiverId);
|
public static readonly string WrongEnvelopeReceiverId = nameof(WrongEnvelopeReceiverId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public static readonly string EnvelopeOrReceiverNonexists = nameof(EnvelopeOrReceiverNonexists);
|
public static readonly string EnvelopeOrReceiverNonexists = nameof(EnvelopeOrReceiverNonexists);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public static readonly string PhoneNumberNonexists = nameof(PhoneNumberNonexists);
|
public static readonly string PhoneNumberNonexists = nameof(PhoneNumberNonexists);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public static readonly string Default = nameof(Default);
|
public static readonly string Default = nameof(Default);
|
||||||
}
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public static readonly string DbMigrationTest = nameof(DbMigrationTest);
|
||||||
}
|
}
|
||||||
@@ -5,24 +5,44 @@ using OtpNet;
|
|||||||
using QRCoder;
|
using QRCoder;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Services
|
namespace EnvelopeGenerator.Application.Services;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class Authenticator : IAuthenticator
|
||||||
{
|
{
|
||||||
public class Authenticator : IAuthenticator
|
/// <summary>
|
||||||
{
|
///
|
||||||
|
/// </summary>
|
||||||
public static Lazy<Authenticator> LazyStatic => new(() => new Authenticator(Options.Create<AuthenticatorParams>(new()), new QRCodeGenerator()));
|
public static Lazy<Authenticator> LazyStatic => new(() => new Authenticator(Options.Create<AuthenticatorParams>(new()), new QRCodeGenerator()));
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public static Authenticator Static => LazyStatic.Value;
|
public static Authenticator Static => LazyStatic.Value;
|
||||||
|
|
||||||
private readonly AuthenticatorParams _params;
|
private readonly AuthenticatorParams _params;
|
||||||
|
|
||||||
private readonly QRCodeGenerator _qrCodeGenerator;
|
private readonly QRCodeGenerator _qrCodeGenerator;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="options"></param>
|
||||||
|
/// <param name="qrCodeGenerator"></param>
|
||||||
public Authenticator(IOptions<AuthenticatorParams> options, QRCodeGenerator qrCodeGenerator)
|
public Authenticator(IOptions<AuthenticatorParams> options, QRCodeGenerator qrCodeGenerator)
|
||||||
{
|
{
|
||||||
_params = options.Value;
|
_params = options.Value;
|
||||||
_qrCodeGenerator = qrCodeGenerator;
|
_qrCodeGenerator = qrCodeGenerator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="length"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="ArgumentException"></exception>
|
||||||
public string GenerateCode(int length)
|
public string GenerateCode(int length)
|
||||||
{
|
{
|
||||||
//TODO: Inject Random as a singleton to support multithreading to improve performance.
|
//TODO: Inject Random as a singleton to support multithreading to improve performance.
|
||||||
@@ -39,9 +59,23 @@ namespace EnvelopeGenerator.Application.Services
|
|||||||
return passwordBuilder.ToString();
|
return passwordBuilder.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="length"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public string GenerateTotpSecretKey(int? length = null)
|
public string GenerateTotpSecretKey(int? length = null)
|
||||||
=> Base32Encoding.ToString(KeyGeneration.GenerateRandomKey(length ?? _params.DefaultTotpSecretKeyLength));
|
=> Base32Encoding.ToString(KeyGeneration.GenerateRandomKey(length ?? _params.DefaultTotpSecretKeyLength));
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="userEmail"></param>
|
||||||
|
/// <param name="secretKey"></param>
|
||||||
|
/// <param name="issuer"></param>
|
||||||
|
/// <param name="totpUrlFormat"></param>
|
||||||
|
/// <param name="pixelsPerModule"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public byte[] GenerateTotpQrCode(string userEmail, string secretKey, string? issuer = null, string? totpUrlFormat = null, int? pixelsPerModule = null)
|
public byte[] GenerateTotpQrCode(string userEmail, string secretKey, string? issuer = null, string? totpUrlFormat = null, int? pixelsPerModule = null)
|
||||||
{
|
{
|
||||||
var url = string.Format(totpUrlFormat ?? _params.TotpUrlFormat,
|
var url = string.Format(totpUrlFormat ?? _params.TotpUrlFormat,
|
||||||
@@ -53,6 +87,15 @@ namespace EnvelopeGenerator.Application.Services
|
|||||||
return qrCode.GetGraphic(pixelsPerModule ?? _params.TotpQRPixelsPerModule);
|
return qrCode.GetGraphic(pixelsPerModule ?? _params.TotpQRPixelsPerModule);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="userEmail"></param>
|
||||||
|
/// <param name="length"></param>
|
||||||
|
/// <param name="issuer"></param>
|
||||||
|
/// <param name="totpUrlFormat"></param>
|
||||||
|
/// <param name="pixelsPerModule"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public byte[] GenerateTotpQrCode(string userEmail, int? length = null, string? issuer = null, string? totpUrlFormat = null, int? pixelsPerModule = null)
|
public byte[] GenerateTotpQrCode(string userEmail, int? length = null, string? issuer = null, string? totpUrlFormat = null, int? pixelsPerModule = null)
|
||||||
{
|
{
|
||||||
return GenerateTotpQrCode(
|
return GenerateTotpQrCode(
|
||||||
@@ -63,9 +106,22 @@ namespace EnvelopeGenerator.Application.Services
|
|||||||
pixelsPerModule: pixelsPerModule);
|
pixelsPerModule: pixelsPerModule);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="secretKey"></param>
|
||||||
|
/// <param name="step"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public string GenerateTotp(string secretKey, int step = 30) => new Totp(Base32Encoding.ToBytes(secretKey), step).ComputeTotp();
|
public string GenerateTotp(string secretKey, int step = 30) => new Totp(Base32Encoding.ToBytes(secretKey), step).ComputeTotp();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="totpCode"></param>
|
||||||
|
/// <param name="secretKey"></param>
|
||||||
|
/// <param name="step"></param>
|
||||||
|
/// <param name="window"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public bool VerifyTotp(string totpCode, string secretKey, int step = 30, VerificationWindow? window = null)
|
public bool VerifyTotp(string totpCode, string secretKey, int step = 30, VerificationWindow? window = null)
|
||||||
=> new Totp(Base32Encoding.ToBytes(secretKey), step).VerifyTotp(totpCode, out _, window);
|
=> new Totp(Base32Encoding.ToBytes(secretKey), step).VerifyTotp(totpCode, out _, window);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,26 +1,44 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using DigitalData.Core.Application;
|
using DigitalData.Core.Application;
|
||||||
using DigitalData.Core.DTO;
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
using EnvelopeGenerator.Application.Contracts.Services;
|
using EnvelopeGenerator.Application.Contracts.Services;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using EnvelopeGenerator.Application.Contracts.Repositories;
|
using EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
using Microsoft.Extensions.Caching.Memory;
|
using Microsoft.Extensions.Caching.Memory;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Services;
|
namespace EnvelopeGenerator.Application.Services;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public class ConfigService : ReadService<IConfigRepository, ConfigDto, Config, int>, IConfigService
|
public class ConfigService : ReadService<IConfigRepository, ConfigDto, Config, int>, IConfigService
|
||||||
{
|
{
|
||||||
private static readonly Guid DefaultConfigCacheId = Guid.NewGuid();
|
private static readonly Guid DefaultConfigCacheId = Guid.NewGuid();
|
||||||
|
|
||||||
private readonly IMemoryCache _cache;
|
private readonly IMemoryCache _cache;
|
||||||
|
|
||||||
private readonly ILogger<ConfigService> _logger;
|
private readonly ILogger<ConfigService> _logger;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="repository"></param>
|
||||||
|
/// <param name="mapper"></param>
|
||||||
|
/// <param name="memoryCache"></param>
|
||||||
|
/// <param name="logger"></param>
|
||||||
public ConfigService(IConfigRepository repository, IMapper mapper, IMemoryCache memoryCache, ILogger<ConfigService> logger) : base(repository, mapper)
|
public ConfigService(IConfigRepository repository, IMapper mapper, IMemoryCache memoryCache, ILogger<ConfigService> logger) : base(repository, mapper)
|
||||||
{
|
{
|
||||||
_cache = memoryCache;
|
_cache = memoryCache;
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
public async Task<DataResult<ConfigDto>> ReadFirstAsync()
|
public async Task<DataResult<ConfigDto>> ReadFirstAsync()
|
||||||
{
|
{
|
||||||
var config = await _repository.ReadFirstAsync();
|
var config = await _repository.ReadFirstAsync();
|
||||||
@@ -50,10 +68,15 @@ public class ConfigService : ReadService<IConfigRepository, ConfigDto, Config, i
|
|||||||
{
|
{
|
||||||
_logger.LogNotice(ntc);
|
_logger.LogNotice(ntc);
|
||||||
throw new InvalidOperationException("Default configuration cannot find.");
|
throw new InvalidOperationException("Default configuration cannot find.");
|
||||||
}));
|
})
|
||||||
|
);
|
||||||
|
|
||||||
return config!;
|
return config!;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
public async Task<string> ReadDefaultSignatureHost() => (await ReadDefaultAsync()).SignatureHost;
|
public async Task<string> ReadDefaultSignatureHost() => (await ReadDefaultAsync()).SignatureHost;
|
||||||
}
|
}
|
||||||
@@ -7,8 +7,18 @@ using EnvelopeGenerator.Application.Contracts.Repositories;
|
|||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Services;
|
namespace EnvelopeGenerator.Application.Services;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public class DocumentReceiverElementService : BasicCRUDService<IDocumentReceiverElementRepository, DocumentReceiverElementDto, DocumentReceiverElement, int>, IDocumentReceiverElementService
|
public class DocumentReceiverElementService : BasicCRUDService<IDocumentReceiverElementRepository, DocumentReceiverElementDto, DocumentReceiverElement, int>, IDocumentReceiverElementService
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="repository"></param>
|
||||||
|
/// <param name="mapper"></param>
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public DocumentReceiverElementService(IDocumentReceiverElementRepository repository, IMapper mapper)
|
public DocumentReceiverElementService(IDocumentReceiverElementRepository repository, IMapper mapper)
|
||||||
: base(repository, mapper)
|
: base(repository, mapper)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,10 +7,19 @@ using EnvelopeGenerator.Application.Contracts.Repositories;
|
|||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Services;
|
namespace EnvelopeGenerator.Application.Services;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public class DocumentStatusService : BasicCRUDService<IDocumentStatusRepository, DocumentStatusDto, DocumentStatus, int>, IDocumentStatusService
|
public class DocumentStatusService : BasicCRUDService<IDocumentStatusRepository, DocumentStatusDto, DocumentStatus, int>, IDocumentStatusService
|
||||||
{
|
{
|
||||||
public DocumentStatusService(IDocumentStatusRepository repository, IMapper mapper)
|
/// <summary>
|
||||||
: base(repository, mapper)
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="repository"></param>
|
||||||
|
/// <param name="mapper"></param>
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
|
public DocumentStatusService(IDocumentStatusRepository repository, IMapper mapper) : base(repository, mapper)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,20 +3,34 @@ using DigitalData.Core.Application;
|
|||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using EnvelopeGenerator.Application.Contracts.Repositories;
|
using EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
using static EnvelopeGenerator.Common.Constants;
|
using static EnvelopeGenerator.Domain.Constants;
|
||||||
using DigitalData.Core.DTO;
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using EnvelopeGenerator.Application.Contracts.Services;
|
using EnvelopeGenerator.Application.Contracts.Services;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Services;
|
namespace EnvelopeGenerator.Application.Services;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public class EmailTemplateService : BasicCRUDService<IEmailTemplateRepository, EmailTemplateDto, EmailTemplate, int>, IEmailTemplateService
|
public class EmailTemplateService : BasicCRUDService<IEmailTemplateRepository, EmailTemplateDto, EmailTemplate, int>, IEmailTemplateService
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="repository"></param>
|
||||||
|
/// <param name="mapper"></param>
|
||||||
public EmailTemplateService(IEmailTemplateRepository repository, IMapper mapper)
|
public EmailTemplateService(IEmailTemplateRepository repository, IMapper mapper)
|
||||||
: base(repository, mapper)
|
: base(repository, mapper)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="type"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public async Task<DataResult<EmailTemplateDto>> ReadByNameAsync(EmailTemplateType type)
|
public async Task<DataResult<EmailTemplateDto>> ReadByNameAsync(EmailTemplateType type)
|
||||||
{
|
{
|
||||||
var temp = await _repository.ReadByNameAsync(type);
|
var temp = await _repository.ReadByNameAsync(type);
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using DigitalData.Core.Application;
|
using DigitalData.Core.Application;
|
||||||
using Microsoft.Extensions.Localization;
|
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using EnvelopeGenerator.Application.Contracts.Repositories;
|
using EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
@@ -8,8 +7,17 @@ using EnvelopeGenerator.Application.Contracts.Services;
|
|||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Services;
|
namespace EnvelopeGenerator.Application.Services;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public class EnvelopeCertificateService : BasicCRUDService<IEnvelopeCertificateRepository, EnvelopeCertificateDto, EnvelopeCertificate, int>, IEnvelopeCertificateService
|
public class EnvelopeCertificateService : BasicCRUDService<IEnvelopeCertificateRepository, EnvelopeCertificateDto, EnvelopeCertificate, int>, IEnvelopeCertificateService
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="repository"></param>
|
||||||
|
/// <param name="mapper"></param>
|
||||||
public EnvelopeCertificateService(IEnvelopeCertificateRepository repository, IMapper mapper)
|
public EnvelopeCertificateService(IEnvelopeCertificateRepository repository, IMapper mapper)
|
||||||
: base(repository, mapper)
|
: base(repository, mapper)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,8 +7,18 @@ using EnvelopeGenerator.Application.Contracts.Repositories;
|
|||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Services;
|
namespace EnvelopeGenerator.Application.Services;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public class EnvelopeDocumentService : BasicCRUDService<IEnvelopeDocumentRepository, EnvelopeDocumentDto, EnvelopeDocument, int>, IEnvelopeDocumentService
|
public class EnvelopeDocumentService : BasicCRUDService<IEnvelopeDocumentRepository, EnvelopeDocumentDto, EnvelopeDocument, int>, IEnvelopeDocumentService
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="repository"></param>
|
||||||
|
/// <param name="mapper"></param>
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public EnvelopeDocumentService(IEnvelopeDocumentRepository repository, IMapper mapper) : base(repository, mapper)
|
public EnvelopeDocumentService(IEnvelopeDocumentRepository repository, IMapper mapper) : base(repository, mapper)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,37 +2,72 @@
|
|||||||
using DigitalData.Core.Application;
|
using DigitalData.Core.Application;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using EnvelopeGenerator.Application.Contracts.Repositories;
|
using EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
using static EnvelopeGenerator.Common.Constants;
|
using static EnvelopeGenerator.Domain.Constants;
|
||||||
using DigitalData.Core.DTO;
|
|
||||||
using EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
|
using EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
|
||||||
using EnvelopeGenerator.Application.DTOs.Receiver;
|
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||||
using EnvelopeGenerator.Application.Contracts.Services;
|
using EnvelopeGenerator.Application.Contracts.Services;
|
||||||
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Services;
|
namespace EnvelopeGenerator.Application.Services;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public class EnvelopeHistoryService : CRUDService<IEnvelopeHistoryRepository, EnvelopeHistoryCreateDto, EnvelopeHistoryDto, EnvelopeHistory, long>, IEnvelopeHistoryService
|
public class EnvelopeHistoryService : CRUDService<IEnvelopeHistoryRepository, EnvelopeHistoryCreateDto, EnvelopeHistoryDto, EnvelopeHistory, long>, IEnvelopeHistoryService
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="repository"></param>
|
||||||
|
/// <param name="mapper"></param>
|
||||||
public EnvelopeHistoryService(IEnvelopeHistoryRepository repository, IMapper mapper)
|
public EnvelopeHistoryService(IEnvelopeHistoryRepository repository, IMapper mapper)
|
||||||
: base(repository, mapper)
|
: base(repository, mapper)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<int> CountAsync(int? envelopeId = null, string? userReference = null, int? status = null) => await _repository.CountAsync(envelopeId: envelopeId, userReference: userReference, status: status);
|
/// <summary>
|
||||||
|
/// /
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelopeId"></param>
|
||||||
|
/// <param name="userReference"></param>
|
||||||
|
/// <param name="status"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<int> CountAsync(int? envelopeId = null, string? userReference = null, EnvelopeStatus? status = null) => await _repository.CountAsync(envelopeId: envelopeId, userReference: userReference, status: status);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="status"></param>
|
||||||
|
/// <param name="envelopeId"></param>
|
||||||
|
/// <param name="userReference"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public async Task<bool> HasStatus(EnvelopeStatus status, int envelopeId, string userReference) => await _repository.CountAsync(
|
public async Task<bool> HasStatus(EnvelopeStatus status, int envelopeId, string userReference) => await _repository.CountAsync(
|
||||||
envelopeId: envelopeId,
|
envelopeId: envelopeId,
|
||||||
userReference: userReference,
|
userReference: userReference,
|
||||||
status: (int) status) > 0;
|
status: status) > 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelopeId"></param>
|
||||||
|
/// <param name="userReference"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public async Task<bool> AccessCodeAlreadyRequested(int envelopeId, string userReference) => await _repository.CountAsync(
|
public async Task<bool> AccessCodeAlreadyRequested(int envelopeId, string userReference) => await _repository.CountAsync(
|
||||||
envelopeId: envelopeId,
|
envelopeId: envelopeId,
|
||||||
userReference:userReference,
|
userReference:userReference,
|
||||||
status: (int) EnvelopeStatus.AccessCodeRequested) > 0;
|
status: EnvelopeStatus.AccessCodeRequested) > 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelopeId"></param>
|
||||||
|
/// <param name="userReference"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public async Task<bool> IsSigned(int envelopeId, string userReference) => await _repository.CountAsync(
|
public async Task<bool> IsSigned(int envelopeId, string userReference) => await _repository.CountAsync(
|
||||||
envelopeId: envelopeId,
|
envelopeId: envelopeId,
|
||||||
userReference: userReference,
|
userReference: userReference,
|
||||||
status: (int) EnvelopeStatus.DocumentSigned) > 0;
|
status: EnvelopeStatus.DocumentSigned) > 0;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks if the specified envelope has been rejected.
|
/// Checks if the specified envelope has been rejected.
|
||||||
@@ -46,10 +81,20 @@ public class EnvelopeHistoryService : CRUDService<IEnvelopeHistoryRepository, En
|
|||||||
return await _repository.CountAsync(
|
return await _repository.CountAsync(
|
||||||
envelopeId: envelopeId,
|
envelopeId: envelopeId,
|
||||||
userReference: userReference,
|
userReference: userReference,
|
||||||
status: (int)EnvelopeStatus.DocumentRejected) > 0;
|
status: EnvelopeStatus.DocumentRejected) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<IEnumerable<EnvelopeHistoryDto>> ReadAsync(int? envelopeId = null, string? userReference = null, ReferenceType? referenceType = null, int? status = null, bool withSender = false, bool withReceiver = false)
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelopeId"></param>
|
||||||
|
/// <param name="userReference"></param>
|
||||||
|
/// <param name="referenceType"></param>
|
||||||
|
/// <param name="status"></param>
|
||||||
|
/// <param name="withSender"></param>
|
||||||
|
/// <param name="withReceiver"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<IEnumerable<EnvelopeHistoryDto>> ReadAsync(int? envelopeId = null, string? userReference = null, ReferenceType? referenceType = null, EnvelopeStatus? status = null, bool withSender = false, bool withReceiver = false)
|
||||||
{
|
{
|
||||||
var histDTOs = _mapper.Map<IEnumerable<EnvelopeHistoryDto>>(
|
var histDTOs = _mapper.Map<IEnumerable<EnvelopeHistoryDto>>(
|
||||||
await _repository.ReadAsync(
|
await _repository.ReadAsync(
|
||||||
@@ -61,10 +106,21 @@ public class EnvelopeHistoryService : CRUDService<IEnvelopeHistoryRepository, En
|
|||||||
return referenceType is null ? histDTOs : histDTOs.Where(h => h.ReferenceType == referenceType);
|
return referenceType is null ? histDTOs : histDTOs.Where(h => h.ReferenceType == referenceType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelopeId"></param>
|
||||||
|
/// <param name="userReference"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public async Task<IEnumerable<EnvelopeHistoryDto>> ReadRejectedAsync(int envelopeId, string? userReference = null) =>
|
public async Task<IEnumerable<EnvelopeHistoryDto>> ReadRejectedAsync(int envelopeId, string? userReference = null) =>
|
||||||
await ReadAsync(envelopeId: envelopeId, userReference: userReference, status: (int)EnvelopeStatus.DocumentRejected, withReceiver:true);
|
await ReadAsync(envelopeId: envelopeId, userReference: userReference, status: EnvelopeStatus.DocumentRejected, withReceiver:true);
|
||||||
|
|
||||||
//TODO: use IQueryable in repository to incerease the performance
|
//TODO: use IQueryable in repository to incerease the performance
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelopeId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public async Task<IEnumerable<ReceiverReadDto>> ReadRejectingReceivers(int envelopeId)
|
public async Task<IEnumerable<ReceiverReadDto>> ReadRejectingReceivers(int envelopeId)
|
||||||
{
|
{
|
||||||
var envelopes = await ReadRejectedAsync(envelopeId);
|
var envelopes = await ReadRejectedAsync(envelopeId);
|
||||||
@@ -75,10 +131,25 @@ public class EnvelopeHistoryService : CRUDService<IEnvelopeHistoryRepository, En
|
|||||||
.Select(eh => eh.Receiver!);
|
.Select(eh => eh.Receiver!);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelopeId"></param>
|
||||||
|
/// <param name="userReference"></param>
|
||||||
|
/// <param name="status"></param>
|
||||||
|
/// <param name="comment"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public async Task<DataResult<long>> RecordAsync(int envelopeId, string userReference, EnvelopeStatus status, string? comment = null) =>
|
public async Task<DataResult<long>> RecordAsync(int envelopeId, string userReference, EnvelopeStatus status, string? comment = null) =>
|
||||||
await CreateAsync(new (EnvelopeId: envelopeId, UserReference: userReference, Status: (int)status, ActionDate: DateTime.Now, Comment: comment))
|
await CreateAsync(new ()
|
||||||
|
{
|
||||||
|
EnvelopeId = envelopeId,
|
||||||
|
UserReference = userReference,
|
||||||
|
Status = (int) status,
|
||||||
|
ActionDate = DateTime.Now,
|
||||||
|
Comment = comment
|
||||||
|
})
|
||||||
.ThenAsync(
|
.ThenAsync(
|
||||||
Success: id => Result.Success(id),
|
Success: dto => Result.Success(dto.Id),
|
||||||
Fail: (mssg, ntc) => Result.Fail<long>().Message(mssg).Notice(ntc)
|
Fail: (mssg, ntc) => Result.Fail<long>().Message(mssg).Notice(ntc)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -1,31 +1,46 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using DigitalData.Core.DTO;
|
|
||||||
using DigitalData.EmailProfilerDispatcher.Abstraction.Contracts;
|
using DigitalData.EmailProfilerDispatcher.Abstraction.Contracts;
|
||||||
using DigitalData.EmailProfilerDispatcher.Abstraction.DTOs.EmailOut;
|
using DigitalData.EmailProfilerDispatcher.Abstraction.DTOs.EmailOut;
|
||||||
using DigitalData.EmailProfilerDispatcher.Abstraction.Services;
|
using DigitalData.EmailProfilerDispatcher.Abstraction.Services;
|
||||||
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
||||||
using EnvelopeGenerator.Common;
|
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
using static EnvelopeGenerator.Common.Constants;
|
using static EnvelopeGenerator.Domain.Constants;
|
||||||
using EnvelopeGenerator.Extensions;
|
using EnvelopeGenerator.Extensions;
|
||||||
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
|
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
|
||||||
using EnvelopeGenerator.Application.Configurations;
|
using EnvelopeGenerator.Application.Configurations;
|
||||||
using EnvelopeGenerator.Application.Extensions;
|
using EnvelopeGenerator.Application.Extensions;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using EnvelopeGenerator.Application.Contracts.Services;
|
using EnvelopeGenerator.Application.Contracts.Services;
|
||||||
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
|
using EnvelopeGenerator.Domain;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Services
|
namespace EnvelopeGenerator.Application.Services;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
|
public class EnvelopeMailService : EmailOutService, IEnvelopeMailService
|
||||||
{
|
{
|
||||||
public class EnvelopeMailService : EmailOutService, IEnvelopeMailService
|
private readonly IEmailTemplateService _tempService;
|
||||||
{
|
private readonly IEnvelopeReceiverService _envRcvService;
|
||||||
private readonly IEmailTemplateService _tempService;
|
private readonly DispatcherParams _dConfig;
|
||||||
private readonly IEnvelopeReceiverService _envRcvService;
|
private readonly IConfigService _configService;
|
||||||
private readonly DispatcherParams _dConfig;
|
private readonly Dictionary<string, string> _placeholders;
|
||||||
private readonly IConfigService _configService;
|
private readonly IAuthenticator _authenticator;
|
||||||
private readonly Dictionary<string, string> _placeholders;
|
|
||||||
private readonly IAuthenticator _authenticator;
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="repository"></param>
|
||||||
|
/// <param name="mapper"></param>
|
||||||
|
/// <param name="tempService"></param>
|
||||||
|
/// <param name="envelopeReceiverService"></param>
|
||||||
|
/// <param name="dispatcherConfigOptions"></param>
|
||||||
|
/// <param name="configService"></param>
|
||||||
|
/// <param name="mailConfig"></param>
|
||||||
|
/// <param name="authenticator"></param>
|
||||||
public EnvelopeMailService(IEmailOutRepository repository, IMapper mapper, IEmailTemplateService tempService, IEnvelopeReceiverService envelopeReceiverService, IOptions<DispatcherParams> dispatcherConfigOptions, IConfigService configService, IOptions<MailParams> mailConfig, IAuthenticator authenticator) : base(repository, mapper)
|
public EnvelopeMailService(IEmailOutRepository repository, IMapper mapper, IEmailTemplateService tempService, IEnvelopeReceiverService envelopeReceiverService, IOptions<DispatcherParams> dispatcherConfigOptions, IConfigService configService, IOptions<MailParams> mailConfig, IAuthenticator authenticator) : base(repository, mapper)
|
||||||
{
|
{
|
||||||
_tempService = tempService;
|
_tempService = tempService;
|
||||||
@@ -36,8 +51,8 @@ namespace EnvelopeGenerator.Application.Services
|
|||||||
_authenticator = authenticator;
|
_authenticator = authenticator;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<Dictionary<string, string>> CreatePlaceholders(string? accessCode = null, EnvelopeReceiverDto? envelopeReceiverDto = null)
|
private async Task<Dictionary<string, string>> CreatePlaceholders(string? accessCode = null, EnvelopeReceiverDto? envelopeReceiverDto = null)
|
||||||
{
|
{
|
||||||
if (accessCode is not null)
|
if (accessCode is not null)
|
||||||
_placeholders["[DOCUMENT_ACCESS_CODE]"] = accessCode;
|
_placeholders["[DOCUMENT_ACCESS_CODE]"] = accessCode;
|
||||||
|
|
||||||
@@ -51,7 +66,7 @@ namespace EnvelopeGenerator.Application.Services
|
|||||||
}
|
}
|
||||||
|
|
||||||
return _placeholders;
|
return _placeholders;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<Dictionary<string, string>> CreatePlaceholders(EnvelopeReceiverReadOnlyDto? readOnlyDto = null)
|
private async Task<Dictionary<string, string>> CreatePlaceholders(EnvelopeReceiverReadOnlyDto? readOnlyDto = null)
|
||||||
{
|
{
|
||||||
@@ -68,11 +83,18 @@ namespace EnvelopeGenerator.Application.Services
|
|||||||
return _placeholders;
|
return _placeholders;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dto"></param>
|
||||||
|
/// <param name="tempType"></param>
|
||||||
|
/// <param name="optionalPlaceholders"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public async Task<DataResult<int>> SendAsync(EnvelopeReceiverDto dto, EmailTemplateType tempType, Dictionary<string, object>? optionalPlaceholders = null)
|
public async Task<DataResult<int>> SendAsync(EnvelopeReceiverDto dto, EmailTemplateType tempType, Dictionary<string, object>? optionalPlaceholders = null)
|
||||||
{
|
{
|
||||||
var tempSerResult = await _tempService.ReadByNameAsync(tempType);
|
var tempSerResult = await _tempService.ReadByNameAsync(tempType);
|
||||||
if (tempSerResult.IsFailed)
|
if (tempSerResult.IsFailed)
|
||||||
return tempSerResult.ToFail<int>().Notice(LogLevel.Error, Flag.DataIntegrityIssue, $"The email cannot send because '{tempType}' template cannot found.");
|
return tempSerResult.ToFail<int>().Notice(LogLevel.Error, DigitalData.Core.Abstraction.Application.DTO.Flag.DataIntegrityIssue, $"The email cannot send because '{tempType}' template cannot found.");
|
||||||
var temp = tempSerResult.Data;
|
var temp = tempSerResult.Data;
|
||||||
|
|
||||||
var mail = new EmailOutCreateDto()
|
var mail = new EmailOutCreateDto()
|
||||||
@@ -114,10 +136,16 @@ namespace EnvelopeGenerator.Application.Services
|
|||||||
//TODO: remove the requirement to add the models using reflections
|
//TODO: remove the requirement to add the models using reflections
|
||||||
return await CreateWithTemplateAsync(createDto: mail,placeholders: placeholders,
|
return await CreateWithTemplateAsync(createDto: mail,placeholders: placeholders,
|
||||||
dto, dto.Envelope.User!, dto.Envelope);
|
dto, dto.Envelope.User!, dto.Envelope);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<DataResult<int>> SendAsync(EnvelopeReceiverReadOnlyDto dto, Dictionary<string, object>? optionalPlaceholders = null)
|
/// <summary>
|
||||||
{
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dto"></param>
|
||||||
|
/// <param name="optionalPlaceholders"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<DataResult<int>> SendAsync(EnvelopeReceiverReadOnlyDto dto, Dictionary<string, object>? optionalPlaceholders = null)
|
||||||
|
{
|
||||||
var tempSerResult = await _tempService.ReadByNameAsync(EmailTemplateType.DocumentShared);
|
var tempSerResult = await _tempService.ReadByNameAsync(EmailTemplateType.DocumentShared);
|
||||||
if (tempSerResult.IsFailed)
|
if (tempSerResult.IsFailed)
|
||||||
return tempSerResult.ToFail<int>().Notice(LogLevel.Error, Flag.DataIntegrityIssue, $"The email cannot send because '{Constants.EmailTemplateType.DocumentShared}' template cannot found.");
|
return tempSerResult.ToFail<int>().Notice(LogLevel.Error, Flag.DataIntegrityIssue, $"The email cannot send because '{Constants.EmailTemplateType.DocumentShared}' template cannot found.");
|
||||||
@@ -155,8 +183,19 @@ namespace EnvelopeGenerator.Application.Services
|
|||||||
return await CreateWithTemplateAsync(createDto: mail, placeholders: placeholders, dto.Envelope);
|
return await CreateWithTemplateAsync(createDto: mail, placeholders: placeholders, dto.Envelope);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public async Task<DataResult<int>> SendAccessCodeAsync(EnvelopeReceiverDto dto) => await SendAsync(dto: dto, tempType: EmailTemplateType.DocumentAccessCodeReceived);
|
public async Task<DataResult<int>> SendAccessCodeAsync(EnvelopeReceiverDto dto) => await SendAsync(dto: dto, tempType: EmailTemplateType.DocumentAccessCodeReceived);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="ArgumentNullException"></exception>
|
||||||
public Task<DataResult<int>> SendTFAQrCodeAsync(EnvelopeReceiverDto dto)
|
public Task<DataResult<int>> SendTFAQrCodeAsync(EnvelopeReceiverDto dto)
|
||||||
{
|
{
|
||||||
// Check if receiver or secret key is null
|
// Check if receiver or secret key is null
|
||||||
@@ -171,5 +210,4 @@ namespace EnvelopeGenerator.Application.Services
|
|||||||
{"[TFA_QR_CODE]", totp_qr_64 },
|
{"[TFA_QR_CODE]", totp_qr_64 },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -7,8 +7,17 @@ using EnvelopeGenerator.Application.Contracts.Repositories;
|
|||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Services;
|
namespace EnvelopeGenerator.Application.Services;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public class EnvelopeReceiverReadOnlyService : CRUDService<IEnvelopeReceiverReadOnlyRepository, EnvelopeReceiverReadOnlyCreateDto, EnvelopeReceiverReadOnlyDto, EnvelopeReceiverReadOnly, long>, IEnvelopeReceiverReadOnlyService
|
public class EnvelopeReceiverReadOnlyService : CRUDService<IEnvelopeReceiverReadOnlyRepository, EnvelopeReceiverReadOnlyCreateDto, EnvelopeReceiverReadOnlyDto, EnvelopeReceiverReadOnly, long>, IEnvelopeReceiverReadOnlyService
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="repository"></param>
|
||||||
|
/// <param name="mapper"></param>
|
||||||
public EnvelopeReceiverReadOnlyService(IEnvelopeReceiverReadOnlyRepository repository, IMapper mapper) : base(repository, mapper)
|
public EnvelopeReceiverReadOnlyService(IEnvelopeReceiverReadOnlyRepository repository, IMapper mapper) : base(repository, mapper)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using DigitalData.Core.Application;
|
using DigitalData.Core.Application;
|
||||||
using DigitalData.Core.DTO;
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
||||||
using EnvelopeGenerator.Application.Resources;
|
using EnvelopeGenerator.Application.Resources;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
@@ -15,12 +15,23 @@ using EnvelopeGenerator.Application.Receivers.Queries.Read;
|
|||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Services;
|
namespace EnvelopeGenerator.Application.Services;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public class EnvelopeReceiverService : BasicCRUDService<IEnvelopeReceiverRepository, EnvelopeReceiverDto, EnvelopeReceiver, (int Envelope, int Receiver)>, IEnvelopeReceiverService
|
public class EnvelopeReceiverService : BasicCRUDService<IEnvelopeReceiverRepository, EnvelopeReceiverDto, EnvelopeReceiver, (int Envelope, int Receiver)>, IEnvelopeReceiverService
|
||||||
{
|
{
|
||||||
private readonly IStringLocalizer<Resource> _localizer;
|
private readonly IStringLocalizer<Resource> _localizer;
|
||||||
|
|
||||||
private readonly ISmsSender _smsSender;
|
private readonly ISmsSender _smsSender;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="repository"></param>
|
||||||
|
/// <param name="localizer"></param>
|
||||||
|
/// <param name="mapper"></param>
|
||||||
|
/// <param name="smsSender"></param>
|
||||||
public EnvelopeReceiverService(IEnvelopeReceiverRepository repository, IStringLocalizer<Resource> localizer, IMapper mapper, ISmsSender smsSender)
|
public EnvelopeReceiverService(IEnvelopeReceiverRepository repository, IStringLocalizer<Resource> localizer, IMapper mapper, ISmsSender smsSender)
|
||||||
: base(repository, mapper)
|
: base(repository, mapper)
|
||||||
{
|
{
|
||||||
@@ -28,24 +39,59 @@ public class EnvelopeReceiverService : BasicCRUDService<IEnvelopeReceiverReposit
|
|||||||
_smsSender = smsSender;
|
_smsSender = smsSender;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="signature"></param>
|
||||||
|
/// <param name="withEnvelope"></param>
|
||||||
|
/// <param name="withReceiver"></param>
|
||||||
|
/// <param name="readOnly"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public async Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadBySignatureAsync(string signature, bool withEnvelope = false, bool withReceiver = true, bool readOnly = true)
|
public async Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadBySignatureAsync(string signature, bool withEnvelope = false, bool withReceiver = true, bool readOnly = true)
|
||||||
{
|
{
|
||||||
var env_rcvs = await _repository.ReadBySignatureAsync(signature: signature, withEnvelope: withEnvelope, withReceiver: withReceiver, readOnly: readOnly);
|
var env_rcvs = await _repository.ReadBySignatureAsync(signature: signature, withEnvelope: withEnvelope, withReceiver: withReceiver, readOnly: readOnly);
|
||||||
return Result.Success(_mapper.Map<IEnumerable<EnvelopeReceiverDto>>(env_rcvs));
|
return Result.Success(_mapper.Map<IEnumerable<EnvelopeReceiverDto>>(env_rcvs));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="uuid"></param>
|
||||||
|
/// <param name="withEnvelope"></param>
|
||||||
|
/// <param name="withReceiver"></param>
|
||||||
|
/// <param name="readOnly"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public async Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUuidAsync(string uuid, bool withEnvelope = true, bool withReceiver = false, bool readOnly = true)
|
public async Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUuidAsync(string uuid, bool withEnvelope = true, bool withReceiver = false, bool readOnly = true)
|
||||||
{
|
{
|
||||||
var env_rcvs = await _repository.ReadByUuidAsync(uuid: uuid, withEnvelope: withEnvelope, withReceiver: withReceiver, readOnly: readOnly);
|
var env_rcvs = await _repository.ReadByUuidAsync(uuid: uuid, withEnvelope: withEnvelope, withReceiver: withReceiver, readOnly: readOnly);
|
||||||
return Result.Success(_mapper.Map<IEnumerable<EnvelopeReceiverDto>>(env_rcvs));
|
return Result.Success(_mapper.Map<IEnumerable<EnvelopeReceiverDto>>(env_rcvs));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="uuid"></param>
|
||||||
|
/// <param name="withEnvelope"></param>
|
||||||
|
/// <param name="withReceiver"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public async Task<DataResult<IEnumerable<string?>>> ReadAccessCodeByUuidAsync(string uuid, bool withEnvelope = false, bool withReceiver = true)
|
public async Task<DataResult<IEnumerable<string?>>> ReadAccessCodeByUuidAsync(string uuid, bool withEnvelope = false, bool withReceiver = true)
|
||||||
{
|
{
|
||||||
var env_rcvs = await _repository.ReadByUuidAsync(uuid: uuid, withEnvelope: withEnvelope, withReceiver: withReceiver);
|
var env_rcvs = await _repository.ReadByUuidAsync(uuid: uuid, withEnvelope: withEnvelope, withReceiver: withReceiver);
|
||||||
return Result.Success(env_rcvs.Select(er => er.AccessCode));
|
if( env_rcvs is null || !env_rcvs.Any())
|
||||||
|
return Result.Fail<IEnumerable<string?>>()
|
||||||
|
.Message(_localizer[Key.EnvelopeReceiverNotFound]);
|
||||||
|
return Result.Success(env_rcvs.Select(er => er.AccessCode) ?? Enumerable.Empty<string?>());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="uuid"></param>
|
||||||
|
/// <param name="signature"></param>
|
||||||
|
/// <param name="withEnvelope"></param>
|
||||||
|
/// <param name="withReceiver"></param>
|
||||||
|
/// <param name="readOnly"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public async Task<DataResult<EnvelopeReceiverDto>> ReadByUuidSignatureAsync(string uuid, string signature, bool withEnvelope = true, bool withReceiver = true, bool readOnly = true)
|
public async Task<DataResult<EnvelopeReceiverDto>> ReadByUuidSignatureAsync(string uuid, string signature, bool withEnvelope = true, bool withReceiver = true, bool readOnly = true)
|
||||||
{
|
{
|
||||||
var env_rcv = await _repository.ReadByUuidSignatureAsync(uuid: uuid, signature: signature, withEnvelope: withEnvelope, withReceiver: withReceiver, readOnly: readOnly);
|
var env_rcv = await _repository.ReadByUuidSignatureAsync(uuid: uuid, signature: signature, withEnvelope: withEnvelope, withReceiver: withReceiver, readOnly: readOnly);
|
||||||
@@ -56,6 +102,15 @@ public class EnvelopeReceiverService : BasicCRUDService<IEnvelopeReceiverReposit
|
|||||||
return Result.Success(_mapper.Map<EnvelopeReceiverDto>(env_rcv));
|
return Result.Success(_mapper.Map<EnvelopeReceiverDto>(env_rcv));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="uuid"></param>
|
||||||
|
/// <param name="signature"></param>
|
||||||
|
/// <param name="withEnvelope"></param>
|
||||||
|
/// <param name="withReceiver"></param>
|
||||||
|
/// <param name="readOnly"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public async Task<DataResult<EnvelopeReceiverSecretDto>> ReadWithSecretByUuidSignatureAsync(string uuid, string signature, bool withEnvelope = true, bool withReceiver = true, bool readOnly = true)
|
public async Task<DataResult<EnvelopeReceiverSecretDto>> ReadWithSecretByUuidSignatureAsync(string uuid, string signature, bool withEnvelope = true, bool withReceiver = true, bool readOnly = true)
|
||||||
{
|
{
|
||||||
var env_rcv = await _repository.ReadByUuidSignatureAsync(uuid: uuid, signature: signature, withEnvelope: withEnvelope, withReceiver: withReceiver, readOnly: readOnly);
|
var env_rcv = await _repository.ReadByUuidSignatureAsync(uuid: uuid, signature: signature, withEnvelope: withEnvelope, withReceiver: withReceiver, readOnly: readOnly);
|
||||||
@@ -66,6 +121,14 @@ public class EnvelopeReceiverService : BasicCRUDService<IEnvelopeReceiverReposit
|
|||||||
return Result.Success(_mapper.Map<EnvelopeReceiverSecretDto>(env_rcv));
|
return Result.Success(_mapper.Map<EnvelopeReceiverSecretDto>(env_rcv));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelopeReceiverId"></param>
|
||||||
|
/// <param name="withEnvelope"></param>
|
||||||
|
/// <param name="withReceiver"></param>
|
||||||
|
/// <param name="readOnly"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public async Task<DataResult<EnvelopeReceiverDto>> ReadByEnvelopeReceiverIdAsync(string envelopeReceiverId, bool withEnvelope = true, bool withReceiver = true, bool readOnly = true)
|
public async Task<DataResult<EnvelopeReceiverDto>> ReadByEnvelopeReceiverIdAsync(string envelopeReceiverId, bool withEnvelope = true, bool withReceiver = true, bool readOnly = true)
|
||||||
{
|
{
|
||||||
(string? uuid, string? signature) = envelopeReceiverId.DecodeEnvelopeReceiverId();
|
(string? uuid, string? signature) = envelopeReceiverId.DecodeEnvelopeReceiverId();
|
||||||
@@ -80,6 +143,13 @@ public class EnvelopeReceiverService : BasicCRUDService<IEnvelopeReceiverReposit
|
|||||||
return await ReadByUuidSignatureAsync(uuid: uuid, signature: signature, withEnvelope: withEnvelope, withReceiver: withReceiver, readOnly: readOnly);
|
return await ReadByUuidSignatureAsync(uuid: uuid, signature: signature, withEnvelope: withEnvelope, withReceiver: withReceiver, readOnly: readOnly);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="uuid"></param>
|
||||||
|
/// <param name="signature"></param>
|
||||||
|
/// <param name="accessCode"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public async Task<DataResult<bool>> VerifyAccessCodeAsync(string uuid, string signature, string accessCode)
|
public async Task<DataResult<bool>> VerifyAccessCodeAsync(string uuid, string signature, string accessCode)
|
||||||
{
|
{
|
||||||
var er = await _repository.ReadByUuidSignatureAsync(uuid: uuid, signature: signature);
|
var er = await _repository.ReadByUuidSignatureAsync(uuid: uuid, signature: signature);
|
||||||
@@ -106,6 +176,12 @@ public class EnvelopeReceiverService : BasicCRUDService<IEnvelopeReceiverReposit
|
|||||||
return Result.Success(true);
|
return Result.Success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelopeReceiverId"></param>
|
||||||
|
/// <param name="accessCode"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public async Task<DataResult<bool>> VerifyAccessCodeAsync(string envelopeReceiverId, string accessCode)
|
public async Task<DataResult<bool>> VerifyAccessCodeAsync(string envelopeReceiverId, string accessCode)
|
||||||
{
|
{
|
||||||
(string? uuid, string? signature) = envelopeReceiverId.DecodeEnvelopeReceiverId();
|
(string? uuid, string? signature) = envelopeReceiverId.DecodeEnvelopeReceiverId();
|
||||||
@@ -120,6 +196,11 @@ public class EnvelopeReceiverService : BasicCRUDService<IEnvelopeReceiverReposit
|
|||||||
return await VerifyAccessCodeAsync(uuid: uuid, signature: signature, accessCode: accessCode);
|
return await VerifyAccessCodeAsync(uuid: uuid, signature: signature, accessCode: accessCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelopeReceiverId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public async Task<DataResult<bool>> IsExisting(string envelopeReceiverId)
|
public async Task<DataResult<bool>> IsExisting(string envelopeReceiverId)
|
||||||
{
|
{
|
||||||
(string? uuid, string? signature) = envelopeReceiverId.DecodeEnvelopeReceiverId();
|
(string? uuid, string? signature) = envelopeReceiverId.DecodeEnvelopeReceiverId();
|
||||||
@@ -131,6 +212,12 @@ public class EnvelopeReceiverService : BasicCRUDService<IEnvelopeReceiverReposit
|
|||||||
return Result.Success(count > 0);
|
return Result.Success(count > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelopeId"></param>
|
||||||
|
/// <param name="receiverId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public async Task<DataResult<string>> ReadAccessCodeByIdAsync(int envelopeId, int receiverId)
|
public async Task<DataResult<string>> ReadAccessCodeByIdAsync(int envelopeId, int receiverId)
|
||||||
{
|
{
|
||||||
var code = await _repository.ReadAccessCodeByIdAsync(envelopeId: envelopeId, receiverId: receiverId);
|
var code = await _repository.ReadAccessCodeByIdAsync(envelopeId: envelopeId, receiverId: receiverId);
|
||||||
@@ -139,6 +226,16 @@ public class EnvelopeReceiverService : BasicCRUDService<IEnvelopeReceiverReposit
|
|||||||
: Result.Success(code);
|
: Result.Success(code);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="username"></param>
|
||||||
|
/// <param name="min_status"></param>
|
||||||
|
/// <param name="max_status"></param>
|
||||||
|
/// <param name="envelopeQuery"></param>
|
||||||
|
/// <param name="receiverQuery"></param>
|
||||||
|
/// <param name="ignore_statuses"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public async 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)
|
public async 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)
|
||||||
{
|
{
|
||||||
var er_list = await _repository.ReadByUsernameAsync(username: username, min_status: min_status, max_status: max_status, ignore_statuses: ignore_statuses);
|
var er_list = await _repository.ReadByUsernameAsync(username: username, min_status: min_status, max_status: max_status, ignore_statuses: ignore_statuses);
|
||||||
@@ -162,12 +259,25 @@ public class EnvelopeReceiverService : BasicCRUDService<IEnvelopeReceiverReposit
|
|||||||
return Result.Success(dto_list);
|
return Result.Success(dto_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<DataResult<string?>> ReadLastUsedReceiverNameByMailAsync(string? mail = null, int? id = null, string? signature = null)
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="mail"></param>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <param name="signature"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<DataResult<string>> ReadLastUsedReceiverNameByMailAsync(string? mail = null, int? id = null, string? signature = null)
|
||||||
{
|
{
|
||||||
var er = await _repository.ReadLastByReceiverAsync(mail, id, signature);
|
var er = await _repository.ReadLastByReceiverAsync(mail, id, signature);
|
||||||
return er is null ? Result.Fail<string?>().Notice(LogLevel.None, Flag.NotFound) : Result.Success(er.Name);
|
return er is null ? Result.Fail<string>().Notice(LogLevel.None, Flag.NotFound) : Result.Success(er.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelopeReceiverId"></param>
|
||||||
|
/// <param name="message"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public async Task<DataResult<SmsResponse>> SendSmsAsync(string envelopeReceiverId, string message)
|
public async Task<DataResult<SmsResponse>> SendSmsAsync(string envelopeReceiverId, string message)
|
||||||
{
|
{
|
||||||
(string? uuid, string? signature) = envelopeReceiverId.DecodeEnvelopeReceiverId();
|
(string? uuid, string? signature) = envelopeReceiverId.DecodeEnvelopeReceiverId();
|
||||||
@@ -194,6 +304,12 @@ public class EnvelopeReceiverService : BasicCRUDService<IEnvelopeReceiverReposit
|
|||||||
return Result.Success(res);
|
return Result.Success(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="uuid"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public Task<DataResult<IEnumerable<EnvelopeReceiverSecretDto>>> ReadWithSecretByUuidAsync(string uuid)
|
public Task<DataResult<IEnumerable<EnvelopeReceiverSecretDto>>> ReadWithSecretByUuidAsync(string uuid)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using DigitalData.Core.Application;
|
using DigitalData.Core.Application;
|
||||||
using DigitalData.Core.DTO;
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
using EnvelopeGenerator.Application.Contracts.Services;
|
using EnvelopeGenerator.Application.Contracts.Services;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
@@ -8,13 +8,29 @@ using EnvelopeGenerator.Application.Contracts.Repositories;
|
|||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Services;
|
namespace EnvelopeGenerator.Application.Services;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public class EnvelopeService : BasicCRUDService<IEnvelopeRepository, EnvelopeDto, Envelope, int>, IEnvelopeService
|
public class EnvelopeService : BasicCRUDService<IEnvelopeRepository, EnvelopeDto, Envelope, int>, IEnvelopeService
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="repository"></param>
|
||||||
|
/// <param name="mapper"></param>
|
||||||
public EnvelopeService(IEnvelopeRepository repository, IMapper mapper)
|
public EnvelopeService(IEnvelopeRepository repository, IMapper mapper)
|
||||||
: base(repository, mapper)
|
: base(repository, mapper)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="documents"></param>
|
||||||
|
/// <param name="history"></param>
|
||||||
|
/// <param name="documentReceiverElement"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public async Task<DataResult<IEnumerable<EnvelopeDto>>> ReadAllWithAsync(bool documents = false, bool history = false, bool documentReceiverElement = false)
|
public async Task<DataResult<IEnumerable<EnvelopeDto>>> ReadAllWithAsync(bool documents = false, bool history = false, bool documentReceiverElement = false)
|
||||||
{
|
{
|
||||||
var envelopes = await _repository.ReadAllWithAsync(documents: documents, history: history, documentReceiverElement: documentReceiverElement);
|
var envelopes = await _repository.ReadAllWithAsync(documents: documents, history: history, documentReceiverElement: documentReceiverElement);
|
||||||
@@ -22,6 +38,16 @@ public class EnvelopeService : BasicCRUDService<IEnvelopeRepository, EnvelopeDto
|
|||||||
return Result.Success(readDto);
|
return Result.Success(readDto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="uuid"></param>
|
||||||
|
/// <param name="withDocuments"></param>
|
||||||
|
/// <param name="withHistory"></param>
|
||||||
|
/// <param name="withDocumentReceiverElement"></param>
|
||||||
|
/// <param name="withUser"></param>
|
||||||
|
/// <param name="withAll"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public async Task<DataResult<EnvelopeDto>> ReadByUuidAsync(string uuid, bool withDocuments = false, bool withHistory = false, bool withDocumentReceiverElement = false, bool withUser = false, bool withAll = false)
|
public async Task<DataResult<EnvelopeDto>> ReadByUuidAsync(string uuid, bool withDocuments = false, bool withHistory = false, bool withDocumentReceiverElement = false, bool withUser = false, bool withAll = false)
|
||||||
{
|
{
|
||||||
var envelope = await _repository.ReadByUuidAsync(uuid: uuid, withDocuments: withDocuments, withHistory: withHistory, withDocumentReceiverElement: withDocumentReceiverElement, withUser:withUser, withAll:withAll);
|
var envelope = await _repository.ReadByUuidAsync(uuid: uuid, withDocuments: withDocuments, withHistory: withHistory, withDocumentReceiverElement: withDocumentReceiverElement, withUser:withUser, withAll:withAll);
|
||||||
@@ -33,6 +59,14 @@ public class EnvelopeService : BasicCRUDService<IEnvelopeRepository, EnvelopeDto
|
|||||||
return Result.Success(readDto);
|
return Result.Success(readDto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="userId"></param>
|
||||||
|
/// <param name="min_status"></param>
|
||||||
|
/// <param name="max_status"></param>
|
||||||
|
/// <param name="ignore_statuses"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public async Task<DataResult<IEnumerable<EnvelopeDto>>> ReadByUserAsync(int userId, int? min_status = null, int? max_status = null, params int[] ignore_statuses)
|
public async Task<DataResult<IEnumerable<EnvelopeDto>>> ReadByUserAsync(int userId, int? min_status = null, int? max_status = null, params int[] ignore_statuses)
|
||||||
{
|
{
|
||||||
var users = await _repository.ReadByUserAsync(userId: userId, min_status: min_status, max_status: max_status, ignore_statuses: ignore_statuses);
|
var users = await _repository.ReadByUserAsync(userId: userId, min_status: min_status, max_status: max_status, ignore_statuses: ignore_statuses);
|
||||||
|
|||||||
@@ -8,6 +8,9 @@ using Microsoft.Extensions.Options;
|
|||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Services;
|
namespace EnvelopeGenerator.Application.Services;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public class EnvelopeSmsHandler : IEnvelopeSmsHandler
|
public class EnvelopeSmsHandler : IEnvelopeSmsHandler
|
||||||
{
|
{
|
||||||
private readonly ISmsSender _sender;
|
private readonly ISmsSender _sender;
|
||||||
@@ -18,6 +21,13 @@ public class EnvelopeSmsHandler : IEnvelopeSmsHandler
|
|||||||
|
|
||||||
private readonly IAuthenticator _authenticator;
|
private readonly IAuthenticator _authenticator;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="totpSmsParamsOptions"></param>
|
||||||
|
/// <param name="distributedCache"></param>
|
||||||
|
/// <param name="authenticator"></param>
|
||||||
public EnvelopeSmsHandler(ISmsSender sender, IOptions<TotpSmsParams> totpSmsParamsOptions, IDistributedCache distributedCache, IAuthenticator authenticator)
|
public EnvelopeSmsHandler(ISmsSender sender, IOptions<TotpSmsParams> totpSmsParamsOptions, IDistributedCache distributedCache, IAuthenticator authenticator)
|
||||||
{
|
{
|
||||||
_sender = sender;
|
_sender = sender;
|
||||||
@@ -49,6 +59,12 @@ public class EnvelopeSmsHandler : IEnvelopeSmsHandler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="totpCode"></param>
|
||||||
|
/// <param name="secretKey"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public bool VerifyTotp(string totpCode, string secretKey) => _authenticator
|
public bool VerifyTotp(string totpCode, string secretKey) => _authenticator
|
||||||
.VerifyTotp(totpCode, secretKey, _totpSmsParams.TotpStep, _totpSmsParams.TotpVerificationWindow);
|
.VerifyTotp(totpCode, secretKey, _totpSmsParams.TotpStep, _totpSmsParams.TotpVerificationWindow);
|
||||||
}
|
}
|
||||||
@@ -4,24 +4,38 @@ using EnvelopeGenerator.Application.DTOs;
|
|||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using EnvelopeGenerator.Application.Contracts.Repositories;
|
using EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
using Microsoft.Extensions.Caching.Memory;
|
using Microsoft.Extensions.Caching.Memory;
|
||||||
using DigitalData.Core.DTO;
|
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using EnvelopeGenerator.Application.Contracts.Services;
|
using EnvelopeGenerator.Application.Contracts.Services;
|
||||||
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Services;
|
namespace EnvelopeGenerator.Application.Services;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public class EnvelopeTypeService : BasicCRUDService<IEnvelopeTypeRepository, EnvelopeTypeDto, EnvelopeType, int>, IEnvelopeTypeService
|
public class EnvelopeTypeService : BasicCRUDService<IEnvelopeTypeRepository, EnvelopeTypeDto, EnvelopeType, int>, IEnvelopeTypeService
|
||||||
{
|
{
|
||||||
private static readonly Guid CacheKey = Guid.NewGuid();
|
private static readonly Guid CacheKey = Guid.NewGuid();
|
||||||
|
|
||||||
private readonly IMemoryCache _cache;
|
private readonly IMemoryCache _cache;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="repository"></param>
|
||||||
|
/// <param name="mapper"></param>
|
||||||
|
/// <param name="cache"></param>
|
||||||
public EnvelopeTypeService(IEnvelopeTypeRepository repository, IMapper mapper, IMemoryCache cache)
|
public EnvelopeTypeService(IEnvelopeTypeRepository repository, IMapper mapper, IMemoryCache cache)
|
||||||
: base(repository, mapper)
|
: base(repository, mapper)
|
||||||
{
|
{
|
||||||
_cache = cache;
|
_cache = cache;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
public override async Task<DataResult<IEnumerable<EnvelopeTypeDto>>> ReadAllAsync()
|
public override async Task<DataResult<IEnumerable<EnvelopeTypeDto>>> ReadAllAsync()
|
||||||
=> await _cache.GetOrCreateAsync(CacheKey, async entry => await base.ReadAllAsync())
|
=> await _cache.GetOrCreateAsync(CacheKey, async entry => await base.ReadAllAsync())
|
||||||
?? Result.Fail<IEnumerable<EnvelopeTypeDto>>().Notice(LogLevel.Error, Flag.NotFound, "No cached envelope types are available in the database. If you have added any envelope types after the server started, please restart the server.");
|
?? Result.Fail<IEnumerable<EnvelopeTypeDto>>().Notice(LogLevel.Error, Flag.NotFound, "No cached envelope types are available in the database. If you have added any envelope types after the server started, please restart the server.");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using DigitalData.Core.Abstractions.Client;
|
using DigitalData.Core.Client.Interface;
|
||||||
using DigitalData.Core.Client;
|
using DigitalData.Core.Client;
|
||||||
using EnvelopeGenerator.Application.Configurations;
|
using EnvelopeGenerator.Application.Configurations;
|
||||||
using EnvelopeGenerator.Application.Contracts.Services;
|
using EnvelopeGenerator.Application.Contracts.Services;
|
||||||
@@ -9,6 +9,9 @@ using Microsoft.Extensions.Options;
|
|||||||
namespace EnvelopeGenerator.Application.Services;
|
namespace EnvelopeGenerator.Application.Services;
|
||||||
|
|
||||||
//TODO: move to DigitalData.Core
|
//TODO: move to DigitalData.Core
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public class GTXSmsSender : ISmsSender
|
public class GTXSmsSender : ISmsSender
|
||||||
{
|
{
|
||||||
private readonly IHttpClientService<GtxMessagingParams> _smsClient;
|
private readonly IHttpClientService<GtxMessagingParams> _smsClient;
|
||||||
@@ -17,8 +20,17 @@ public class GTXSmsSender : ISmsSender
|
|||||||
|
|
||||||
private readonly IMapper _mapper;
|
private readonly IMapper _mapper;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public string ServiceProvider { get; }
|
public string ServiceProvider { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="smsClient"></param>
|
||||||
|
/// <param name="smsParamsOptions"></param>
|
||||||
|
/// <param name="mapper"></param>
|
||||||
public GTXSmsSender(IHttpClientService<GtxMessagingParams> smsClient, IOptions<GtxMessagingParams> smsParamsOptions, IMapper mapper)
|
public GTXSmsSender(IHttpClientService<GtxMessagingParams> smsClient, IOptions<GtxMessagingParams> smsParamsOptions, IMapper mapper)
|
||||||
{
|
{
|
||||||
_smsClient = smsClient;
|
_smsClient = smsClient;
|
||||||
@@ -27,6 +39,12 @@ public class GTXSmsSender : ISmsSender
|
|||||||
ServiceProvider = GetType().Name.Replace("Service", string.Empty);
|
ServiceProvider = GetType().Name.Replace("Service", string.Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="recipient"></param>
|
||||||
|
/// <param name="message"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public async Task<SmsResponse> SendSmsAsync(string recipient, string message)
|
public async Task<SmsResponse> SendSmsAsync(string recipient, string message)
|
||||||
{
|
{
|
||||||
return await _smsClient.FetchAsync(queryParams: new Dictionary<string, object?>()
|
return await _smsClient.FetchAsync(queryParams: new Dictionary<string, object?>()
|
||||||
|
|||||||
@@ -3,20 +3,33 @@ using DigitalData.Core.Application;
|
|||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using EnvelopeGenerator.Application.Contracts.Repositories;
|
using EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
using EnvelopeGenerator.Application.DTOs.Receiver;
|
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||||
using DigitalData.Core.DTO;
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
using DigitalData.Core.Abstractions;
|
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
using EnvelopeGenerator.Application.Contracts.Services;
|
using EnvelopeGenerator.Application.Contracts.Services;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Services;
|
namespace EnvelopeGenerator.Application.Services;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public class ReceiverService : CRUDService<IReceiverRepository, ReceiverCreateDto, ReceiverReadDto, Receiver, int>, IReceiverService
|
public class ReceiverService : CRUDService<IReceiverRepository, ReceiverCreateDto, ReceiverReadDto, Receiver, int>, IReceiverService
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="repository"></param>
|
||||||
|
/// <param name="mapper"></param>
|
||||||
public ReceiverService(IReceiverRepository repository, IMapper mapper)
|
public ReceiverService(IReceiverRepository repository, IMapper mapper)
|
||||||
: base(repository, mapper)
|
: base(repository, mapper)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="emailAddress"></param>
|
||||||
|
/// <param name="signature"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public async Task<DataResult<ReceiverReadDto>> ReadByAsync(string? emailAddress = null, string? signature = null)
|
public async Task<DataResult<ReceiverReadDto>> ReadByAsync(string? emailAddress = null, string? signature = null)
|
||||||
{
|
{
|
||||||
var rcv = await _repository.ReadByAsync(emailAddress: emailAddress, signature: signature);
|
var rcv = await _repository.ReadByAsync(emailAddress: emailAddress, signature: signature);
|
||||||
@@ -27,6 +40,12 @@ public class ReceiverService : CRUDService<IReceiverRepository, ReceiverCreateDt
|
|||||||
return Result.Success(_mapper.Map<ReceiverReadDto>(rcv));
|
return Result.Success(_mapper.Map<ReceiverReadDto>(rcv));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="emailAddress"></param>
|
||||||
|
/// <param name="signature"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public async Task<Result> DeleteByAsync(string? emailAddress = null, string? signature = null)
|
public async Task<Result> DeleteByAsync(string? emailAddress = null, string? signature = null)
|
||||||
{
|
{
|
||||||
var rcv = await _repository.ReadByAsync(emailAddress: emailAddress, signature: signature);
|
var rcv = await _repository.ReadByAsync(emailAddress: emailAddress, signature: signature);
|
||||||
@@ -36,16 +55,4 @@ public class ReceiverService : CRUDService<IReceiverRepository, ReceiverCreateDt
|
|||||||
|
|
||||||
return await _repository.DeleteAsync(rcv) ? Result.Success() : Result.Fail();
|
return await _repository.DeleteAsync(rcv) ? Result.Success() : Result.Fail();
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual async Task<Result> UpdateAsync<TUpdateDto>(TUpdateDto updateDto) where TUpdateDto : IUnique<int>
|
|
||||||
{
|
|
||||||
var val = await _repository.ReadByIdAsync(updateDto.Id);
|
|
||||||
if (val == null)
|
|
||||||
{
|
|
||||||
return Result.Fail().Notice(LogLevel.Warning, Flag.NotFound, $"{updateDto.Id} is not found in update process of {GetType()} entity.");
|
|
||||||
}
|
|
||||||
|
|
||||||
var entity = _mapper.Map(updateDto, val);
|
|
||||||
return (await _repository.UpdateAsync(entity)) ? Result.Success() : Result.Fail();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
using AutoMapper;
|
|
||||||
using DigitalData.Core.Application;
|
|
||||||
using EnvelopeGenerator.Application.Contracts.Services;
|
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
|
||||||
using EnvelopeGenerator.Application.Contracts.Repositories;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Services;
|
|
||||||
|
|
||||||
public class UserReceiverService : BasicCRUDService<IUserReceiverRepository, UserReceiverDto, UserReceiver, int>, IUserReceiverService
|
|
||||||
{
|
|
||||||
public UserReceiverService(IUserReceiverRepository repository, IMapper mapper)
|
|
||||||
: base(repository, mapper)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -100,8 +100,8 @@
|
|||||||
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll</HintPath>
|
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="EnvelopeGenerator.Common">
|
<Reference Include="EnvelopeGenerator.CommonServices">
|
||||||
<HintPath>..\EnvelopeGenerator.Common\bin\Debug\EnvelopeGenerator.Common.dll</HintPath>
|
<HintPath>..\EnvelopeGenerator.CommonServices\bin\Debug\EnvelopeGenerator.CommonServices.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="FirebirdSql.Data.FirebirdClient, Version=7.5.0.0, Culture=neutral, PublicKeyToken=3750abcc3150b00c, processorArchitecture=MSIL">
|
<Reference Include="FirebirdSql.Data.FirebirdClient, Version=7.5.0.0, Culture=neutral, PublicKeyToken=3750abcc3150b00c, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\FirebirdSql.Data.FirebirdClient.7.5.0\lib\net452\FirebirdSql.Data.FirebirdClient.dll</HintPath>
|
<HintPath>..\packages\FirebirdSql.Data.FirebirdClient.7.5.0\lib\net452\FirebirdSql.Data.FirebirdClient.dll</HintPath>
|
||||||
@@ -350,9 +350,13 @@
|
|||||||
</None>
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\EnvelopeGenerator.Common\EnvelopeGenerator.Common.vbproj">
|
<ProjectReference Include="..\EnvelopeGenerator.CommonServices\EnvelopeGenerator.CommonServices.vbproj">
|
||||||
<Project>{6EA0C51F-C2B1-4462-8198-3DE0B32B74F8}</Project>
|
<Project>{6EA0C51F-C2B1-4462-8198-3DE0B32B74F8}</Project>
|
||||||
<Name>EnvelopeGenerator.Common</Name>
|
<Name>EnvelopeGenerator.CommonServices</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\EnvelopeGenerator.Domain\EnvelopeGenerator.Domain.csproj">
|
||||||
|
<Project>{4F32A98D-E6F0-4A09-BD97-1CF26107E837}</Project>
|
||||||
|
<Name>EnvelopeGenerator.Domain</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
Imports DigitalData.Modules.Logging
|
Imports DigitalData.Modules.Logging
|
||||||
Imports GdPicture14
|
Imports GdPicture14
|
||||||
Imports Newtonsoft.Json.Linq
|
Imports Newtonsoft.Json.Linq
|
||||||
Imports EnvelopeGenerator.Common.Jobs
|
Imports EnvelopeGenerator.CommonServices.Jobs
|
||||||
Imports System.IO
|
Imports System.IO
|
||||||
Imports EnvelopeGenerator.Common.Jobs.FinalizeDocument
|
Imports EnvelopeGenerator.CommonServices.Jobs.FinalizeDocument
|
||||||
|
|
||||||
Public Class frmFinalizePDF
|
Public Class frmFinalizePDF
|
||||||
Private Const CONNECTIONSTRING = "Server=sDD-VMP04-SQL17\DD_DEVELOP01;Database=DD_ECM;User Id=sa;Password=+bk8oAbbQP1AzoHtvZUbd+Mbok2f8Fl4miEx1qssJ5yEaEWoQJ9prg4L14fURpPnqi1WMNs9fE4=;"
|
Private Const CONNECTIONSTRING = "Server=sDD-VMP04-SQL17\DD_DEVELOP01;Database=DD_ECM;User Id=sa;Password=+bk8oAbbQP1AzoHtvZUbd+Mbok2f8Fl4miEx1qssJ5yEaEWoQJ9prg4L14fURpPnqi1WMNs9fE4=;"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
Imports DigitalData.Modules.Database
|
Imports DigitalData.Modules.Database
|
||||||
Imports DigitalData.Modules.Config
|
Imports DigitalData.Modules.Config
|
||||||
Imports DigitalData.Modules.Base
|
Imports DigitalData.Modules.Base
|
||||||
Imports EnvelopeGenerator.Common
|
Imports EnvelopeGenerator.CommonServices
|
||||||
|
|
||||||
Public Class frmReportViewer
|
Public Class frmReportViewer
|
||||||
Private LogConfig As LogConfig
|
Private LogConfig As LogConfig
|
||||||
|
|||||||
@@ -1,152 +0,0 @@
|
|||||||
Public Class Constants
|
|
||||||
|
|
||||||
#Region "Status Fields"
|
|
||||||
'http://wiki.dd/xwiki13/bin/view/Anwendungen/Produkt-Handbuch/Sonstiges/SignFlow/Envelope%20Status/
|
|
||||||
Public Enum EnvelopeStatus
|
|
||||||
Invalid = 0
|
|
||||||
EnvelopeCreated = 1001
|
|
||||||
EnvelopeSaved = 1002
|
|
||||||
EnvelopeQueued = 1003
|
|
||||||
EnvelopeSent = 1004 ' Nicht verwendet
|
|
||||||
EnvelopePartlySigned = 1005
|
|
||||||
EnvelopeCompletelySigned = 1006
|
|
||||||
EnvelopeReportCreated = 1007
|
|
||||||
EnvelopeArchived = 1008
|
|
||||||
EnvelopeDeleted = 1009
|
|
||||||
EnvelopeRejected = 10007
|
|
||||||
EnvelopeWithdrawn = 10009
|
|
||||||
AccessCodeRequested = 2001
|
|
||||||
AccessCodeCorrect = 2002
|
|
||||||
AccessCodeIncorrect = 2003
|
|
||||||
DocumentOpened = 2004
|
|
||||||
DocumentSigned = 2005
|
|
||||||
DocumentForwarded = 2006
|
|
||||||
DocumentRejected = 2007
|
|
||||||
EnvelopeShared = 2008
|
|
||||||
EnvelopeViewed = 2009
|
|
||||||
MessageInvitationSent = 3001 ' Wird von Trigger verwendet
|
|
||||||
MessageAccessCodeSent = 3002
|
|
||||||
MessageConfirmationSent = 3003
|
|
||||||
MessageDeletionSent = 3004
|
|
||||||
MessageCompletionSent = 3005
|
|
||||||
DocumentMod_Rotation = 4001
|
|
||||||
End Enum
|
|
||||||
|
|
||||||
Public Class Status
|
|
||||||
Public Shared ReadOnly NonHist As IReadOnlyList(Of EnvelopeStatus) = New List(Of EnvelopeStatus) From {
|
|
||||||
EnvelopeStatus.Invalid,
|
|
||||||
EnvelopeStatus.EnvelopeSaved,
|
|
||||||
EnvelopeStatus.EnvelopeSent,
|
|
||||||
EnvelopeStatus.EnvelopePartlySigned
|
|
||||||
}
|
|
||||||
|
|
||||||
Public Shared ReadOnly RelatedToFormApp As IReadOnlyList(Of EnvelopeStatus) = New List(Of EnvelopeStatus) From {
|
|
||||||
EnvelopeStatus.EnvelopeCreated,
|
|
||||||
EnvelopeStatus.DocumentMod_Rotation
|
|
||||||
}
|
|
||||||
End Class
|
|
||||||
|
|
||||||
'TODO: standardize in xwiki
|
|
||||||
Public Enum ReferenceType
|
|
||||||
Sender = 1
|
|
||||||
Receiver
|
|
||||||
System
|
|
||||||
Unknown
|
|
||||||
End Enum
|
|
||||||
|
|
||||||
Public Enum ElementStatus
|
|
||||||
Created = 0
|
|
||||||
End Enum
|
|
||||||
|
|
||||||
Public Enum DocumentStatus
|
|
||||||
Created = 0
|
|
||||||
Signed = 1
|
|
||||||
End Enum
|
|
||||||
|
|
||||||
Public Enum ReceiverStatus
|
|
||||||
Unsigned = 0
|
|
||||||
Signed = 1
|
|
||||||
End Enum
|
|
||||||
#End Region
|
|
||||||
|
|
||||||
#Region "Type Fields"
|
|
||||||
Public Enum ElementType
|
|
||||||
Signature = 1
|
|
||||||
End Enum
|
|
||||||
|
|
||||||
Public Enum ContractType
|
|
||||||
Contract = 1
|
|
||||||
ReadAndSign = 2
|
|
||||||
End Enum
|
|
||||||
|
|
||||||
Public Enum ColorType
|
|
||||||
ReceiverColor1 = 1
|
|
||||||
ReceiverColor2 = 2
|
|
||||||
ReceiverColor3 = 3
|
|
||||||
ReceiverColor4 = 4
|
|
||||||
ReceiverColor5 = 5
|
|
||||||
ReceiverColor6 = 6
|
|
||||||
ReceiverColor7 = 7
|
|
||||||
ReceiverColor8 = 8
|
|
||||||
ReceiverColor9 = 9
|
|
||||||
ReceiverColor10 = 10
|
|
||||||
End Enum
|
|
||||||
|
|
||||||
Public Enum CertificationType
|
|
||||||
AdvancedElectronicSignature = 1
|
|
||||||
'ElectronicSignature = 1
|
|
||||||
'QualifiedSignature = 2
|
|
||||||
End Enum
|
|
||||||
|
|
||||||
Public Enum FinalEmailType
|
|
||||||
No = 0
|
|
||||||
Yes = 1
|
|
||||||
YesWithAttachment = 2
|
|
||||||
End Enum
|
|
||||||
|
|
||||||
Public Enum PageOrientation
|
|
||||||
Portrait = 0
|
|
||||||
Landscape = 1
|
|
||||||
End Enum
|
|
||||||
|
|
||||||
Public Enum EmailTemplateType
|
|
||||||
DocumentReceived = 0
|
|
||||||
DocumentSigned
|
|
||||||
DocumentDeleted
|
|
||||||
DocumentCompleted
|
|
||||||
DocumentAccessCodeReceived
|
|
||||||
DocumentShared
|
|
||||||
TotpSecret
|
|
||||||
DocumentRejected_ADM
|
|
||||||
DocumentRejected_REC
|
|
||||||
DocumentRejected_REC_2
|
|
||||||
End Enum
|
|
||||||
|
|
||||||
Public Enum EncodeType
|
|
||||||
EnvelopeReceiver
|
|
||||||
EnvelopeReceiverReadOnly
|
|
||||||
Undefined
|
|
||||||
DocumentForwarded
|
|
||||||
DocumentShared
|
|
||||||
End Enum
|
|
||||||
#End Region
|
|
||||||
|
|
||||||
#Region "Role"
|
|
||||||
Public NotInheritable Class ReceiverRole
|
|
||||||
Public Const PreAuth As String = "PreAuth"
|
|
||||||
Public Const FullyAuth As String = "FullyAuth"
|
|
||||||
End Class
|
|
||||||
#End Region
|
|
||||||
|
|
||||||
#Region "Constants"
|
|
||||||
|
|
||||||
Public Const DATABASE = "DATABASE"
|
|
||||||
Public Const LOGCONFIG = "LOGCONFIG"
|
|
||||||
Public Const GDPICTURE = "GDPICTURE"
|
|
||||||
Public Const PDF_BURNER_PARAMS = "PDFBurnerParams"
|
|
||||||
|
|
||||||
Public Const GREEN_300 = "#bbf7d0"
|
|
||||||
Public Const RED_300 = "#fecaca"
|
|
||||||
Public Const ORANGE_300 = "#fed7aa"
|
|
||||||
#End Region
|
|
||||||
End Class
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
Public Class DocumentStatus
|
|
||||||
|
|
||||||
Public Property Id As Integer
|
|
||||||
Public Property EnvelopeId As Integer
|
|
||||||
Public Property ReceiverId As Integer
|
|
||||||
Public Property Value As String
|
|
||||||
Public Property Status As Constants.DocumentStatus = Constants.DocumentStatus.Created
|
|
||||||
Public Property StatusChangedWhen As Date
|
|
||||||
|
|
||||||
End Class
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
Public Class ElementMetadata
|
|
||||||
Public Property Index As Integer
|
|
||||||
Public Property Page As Integer
|
|
||||||
End Class
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
Public Class EmailTemplate
|
|
||||||
|
|
||||||
Public Property Id As Integer
|
|
||||||
Public Property Name As String
|
|
||||||
Public Property Body As String
|
|
||||||
Public Property Subject As String
|
|
||||||
|
|
||||||
End Class
|
|
||||||
@@ -1,81 +0,0 @@
|
|||||||
Public Class Envelope
|
|
||||||
Public Property Id As Integer = 0
|
|
||||||
Public Property UserId As Integer
|
|
||||||
Public Property Title As String = ""
|
|
||||||
Public Property EnvelopeTypeId As Integer
|
|
||||||
Public Property ContractType As Integer
|
|
||||||
Public Property Status As Constants.EnvelopeStatus = Constants.EnvelopeStatus.EnvelopeCreated
|
|
||||||
Public Property Uuid As String = Guid.NewGuid.ToString()
|
|
||||||
Public Property UseAccessCode As Boolean = False
|
|
||||||
Public Property Language As String = "de-DE"
|
|
||||||
Public Property CertificationType As Constants.CertificationType = Constants.CertificationType.AdvancedElectronicSignature
|
|
||||||
Public Property TFA_Enabled As Boolean = False
|
|
||||||
Public Property SendReminderEmails As Boolean = False
|
|
||||||
Public Property FirstReminderDays As Integer = 0
|
|
||||||
Public Property ReminderIntervalDays As Integer = 0
|
|
||||||
|
|
||||||
Public Property ExpiresWhen As Date
|
|
||||||
Public Property ExpiresWarningWhen As Date
|
|
||||||
Public Property ExpiresWhenDays As Integer
|
|
||||||
Public Property ExpiresWarningWhenDays As Integer
|
|
||||||
|
|
||||||
Public Property FinalEmailToCreator As Constants.FinalEmailType
|
|
||||||
Public Property FinalEmailToReceivers As Constants.FinalEmailType
|
|
||||||
|
|
||||||
Public Property Message As String = My.Resources.Envelope.Please_read_and_sign_this_document
|
|
||||||
|
|
||||||
Public Property AddedWhen As Date
|
|
||||||
Public Property ChangedWhen As Date
|
|
||||||
Public Property User As New User()
|
|
||||||
|
|
||||||
Public Property Documents As New List(Of EnvelopeDocument)
|
|
||||||
Public Property Receivers As New List(Of EnvelopeReceiver)
|
|
||||||
Public Property History As New List(Of EnvelopeHistoryEntry)
|
|
||||||
Public Property EnvelopeType As EnvelopeType
|
|
||||||
Public Property DOC_RESULT As Byte()
|
|
||||||
Public Property CURRENT_WORK_APP As String = "signFLOW GUI"
|
|
||||||
Public ReadOnly Property EnvelopeTypeTitle As String
|
|
||||||
Get
|
|
||||||
Return EnvelopeType?.Title
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public ReadOnly Property IsAlreadySent As Boolean
|
|
||||||
Get
|
|
||||||
Return Status > Constants.EnvelopeStatus.EnvelopeSaved
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public ReadOnly Property StatusTranslated As String
|
|
||||||
Get
|
|
||||||
Dim oStatus = Status.ToString()
|
|
||||||
Return My.Resources.Model.ResourceManager.GetString(oStatus)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public ReadOnly Property ContractTypeTranslated As String
|
|
||||||
Get
|
|
||||||
Dim oContractType = ContractType.ToString()
|
|
||||||
Return My.Resources.Model.ResourceManager.GetString(oContractType)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public Function ValidateReceiverDocumentData() As List(Of String)
|
|
||||||
Dim oErrors As New List(Of String)
|
|
||||||
|
|
||||||
If Documents.Count = 0 Then
|
|
||||||
oErrors.Add(My.Resources.Envelope.Missing_Documents)
|
|
||||||
End If
|
|
||||||
|
|
||||||
If Receivers.Count = 0 Then
|
|
||||||
oErrors.Add(My.Resources.Envelope.Missing_Receivers)
|
|
||||||
End If
|
|
||||||
|
|
||||||
If Receivers.Any(Function(r) r.HasEmailAndName = False) Then
|
|
||||||
oErrors.Add(My.Resources.Envelope.Incomplete_Receivers)
|
|
||||||
End If
|
|
||||||
|
|
||||||
Return oErrors
|
|
||||||
End Function
|
|
||||||
|
|
||||||
End Class
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user