Compare commits
320 Commits
feat/posit
...
02ef05f054
| Author | SHA1 | Date | |
|---|---|---|---|
| 02ef05f054 | |||
| 72134c3d3b | |||
| a4fffaa9b9 | |||
| 3a62f5317f | |||
| 59c93de8b7 | |||
| 5122a2099d | |||
| 95ec19d816 | |||
| c7b3d97b2e | |||
| 196941f73f | |||
| 415fe646b2 | |||
| f42218802d | |||
| fcf00171de | |||
| ca28c4cca4 | |||
| a48e4988d6 | |||
| ec513716ff | |||
| f39b761412 | |||
| 70d122d2ff | |||
| 5bc5fcf764 | |||
| 8db62b41ba | |||
| 0f27600c5b | |||
| 9045655262 | |||
| 5bcac264a7 | |||
| c7bf800cd5 | |||
| 5fb4d03ee7 | |||
| ac70aaa527 | |||
| e877000b14 | |||
| 305422688e | |||
| 9c6135d208 | |||
| 903e4678ed | |||
| 730a318b56 | |||
| 55c0f44954 | |||
| dbb745338c | |||
| 419f421d52 | |||
| e64ac4b5e7 | |||
| d8200993af | |||
| ee98142405 | |||
| c27337a6f5 | |||
| a09ea990ab | |||
| 05888bc57d | |||
| 39af0fe4fd | |||
| f4c61e3bc7 | |||
| 3f5a584399 | |||
| 6aec854a64 | |||
| c360bde103 | |||
| 82d4b0e740 | |||
| 12519f06f7 | |||
| a2471a0c35 | |||
| 4251a24fe9 | |||
| 63a830c8e3 | |||
| acee28ffce | |||
| 50a541c5bf | |||
| d43877db62 | |||
| 242e66cd8d | |||
| e44fa0b7bd | |||
| 4201f7820a | |||
| e095074c22 | |||
| 412f19547f | |||
| b8c00884a9 | |||
| 51d49d68ba | |||
| 4d5ee2b461 | |||
| 8a79ee4126 | |||
| cde9896c01 | |||
| c7d26a87b0 | |||
| 17ceb1f72a | |||
| b2c396c3b2 | |||
|
|
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 | ||
|
|
456c591fae | ||
|
|
41b2841c25 | ||
|
|
6a6da4a876 | ||
|
|
af280ee64e | ||
|
|
9b945ce232 | ||
|
|
8b1199bc71 | ||
|
|
1d74b7ca06 | ||
|
|
c1bce7c639 | ||
|
|
4401a70217 | ||
|
|
fd53f5bfd6 | ||
|
|
6126fce24d | ||
|
|
ce41090979 | ||
|
|
3fa113003c | ||
|
|
5504093591 | ||
|
|
040cf8641d | ||
|
|
09df86000b | ||
|
|
406ddfb226 | ||
|
|
b01f13fb5f | ||
|
|
00fedc7c4c | ||
|
|
171de98552 | ||
|
|
ea6d80918c | ||
|
|
3b82467133 | ||
|
|
686b1a3a59 | ||
|
|
93019362b7 | ||
|
|
7f97fd3113 | ||
|
|
5ce6c25393 | ||
|
|
972b258706 | ||
|
|
4ee5250b01 | ||
|
|
3fce092486 | ||
|
|
89d6abbb6c | ||
|
|
8b4ad5e28d | ||
|
|
773b43b1ad | ||
|
|
83fa5a29e8 | ||
|
|
09a231d01f | ||
|
|
2007ae91fb | ||
|
|
8d118308cd | ||
|
|
5a8f2d298f | ||
|
|
1a978c0ab7 | ||
|
|
ce0b1f1785 | ||
|
|
0698b44b68 | ||
|
|
7fefc68061 | ||
|
|
3035ec7e9c | ||
|
|
3a1fe45524 | ||
|
|
2db0748e60 | ||
|
|
d873d6dcf1 | ||
|
|
41e0c51055 | ||
|
|
126370ebdb | ||
|
|
629c0d51b2 | ||
|
|
dc4b5bade0 | ||
|
|
6fc0c32c46 | ||
|
|
b15616cf53 | ||
|
|
519df50404 | ||
|
|
9a71d2b805 | ||
|
|
5f8e8deb5b | ||
|
|
645153113c | ||
|
|
2ba7f41a21 | ||
|
|
c8f21be905 | ||
|
|
1875acb7b5 | ||
|
|
6bdf0d5220 | ||
|
|
ad855b77cd | ||
|
|
a781440252 | ||
|
|
5fc689ee4d | ||
|
|
38d05850e3 | ||
|
|
06d25b6f5b | ||
|
|
55b01cf396 | ||
|
|
49ccd9fef2 | ||
|
|
f877910a73 | ||
|
|
f6f4137332 | ||
|
|
486b717801 | ||
|
|
f2a09ea10e | ||
|
|
cc86e5fadd | ||
|
|
bce29aa31a | ||
|
|
95a1fd1355 | ||
|
|
613b2130a5 | ||
|
|
e4eb3e1192 | ||
|
|
1c4f7f2386 | ||
|
|
a7e4d6e58f | ||
|
|
b9c4f7da1c | ||
|
|
cec79e5b6d | ||
|
|
2f08991eeb | ||
|
|
21859ca6e6 | ||
|
|
27d9a149bc | ||
|
|
a76a079736 | ||
|
|
10341fd3cc | ||
|
|
05de44bc13 | ||
|
|
d2c45f71a0 | ||
|
|
42451a767b | ||
|
|
2692fee6d2 | ||
|
|
cae00d9177 | ||
|
|
eaa1232490 | ||
|
|
8c2550ff1d | ||
|
|
b5b9155bc0 | ||
|
|
3cc8e2b5db | ||
|
|
37032a48c9 | ||
|
|
82fc7fa762 | ||
|
|
749366fff5 | ||
|
|
40dc0ecda3 | ||
|
|
7b7a4b4f65 | ||
|
|
b609253893 | ||
|
|
b0eb1b6389 | ||
|
|
1b515ea904 | ||
|
|
4cabaf3191 | ||
|
|
8cfa28a863 | ||
|
|
3955a3232d | ||
|
|
b93ba6be17 | ||
|
|
39ff4b8867 | ||
|
|
7b7aba6efd | ||
|
|
a42e4287ff | ||
|
|
a757749767 | ||
|
|
5166f41941 | ||
|
|
928f2a7780 | ||
|
|
d46aa6e2b8 | ||
|
|
7cffc3f7bc | ||
|
|
841da3c261 | ||
|
|
adbfd69418 | ||
|
|
1e54b775a2 | ||
|
|
6e82b24578 | ||
|
|
5331efe3c1 | ||
|
|
3b4ad2960a | ||
|
|
33048e185b | ||
|
|
3ae1b94eb7 | ||
|
|
14e6a661d3 | ||
|
|
3d1966a715 | ||
|
|
c173814b8d | ||
|
|
a85397a363 | ||
|
|
2d3987b81e | ||
|
|
875ff95278 | ||
|
|
dcdf0844cb | ||
|
|
27e9de4709 | ||
|
|
e2bdc73b76 | ||
|
|
4f95a1eed4 | ||
|
|
6874e7e92c | ||
|
|
7abb3a6c8a | ||
|
|
9183ba4da5 | ||
|
|
08e2e91e9a | ||
|
|
2966d64455 | ||
|
|
41cb2c2d93 | ||
|
|
edd54ab302 | ||
|
|
51920089af | ||
|
|
5714c54385 | ||
|
|
09d2640345 | ||
|
|
82cb50b7e1 | ||
|
|
ff36dc47c1 |
@@ -1,19 +1,33 @@
|
|||||||
namespace EnvelopeGenerator.Application.Configurations
|
namespace EnvelopeGenerator.Application.Configurations;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class AuthenticatorParams
|
||||||
{
|
{
|
||||||
public class AuthenticatorParams
|
/// <summary>
|
||||||
{
|
/// Default value is 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890123456789012345678901234567890123456789'
|
||||||
public string CharPool { get; init; } = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890123456789012345678901234567890123456789";
|
/// </summary>
|
||||||
|
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.
|
||||||
public int DefaultTotpSecretKeyLength { get; init; } = 20;
|
/// <summary>
|
||||||
|
/// Default value is 20
|
||||||
|
/// </summary>
|
||||||
|
public int DefaultTotpSecretKeyLength { get; init; } = 20;
|
||||||
|
|
||||||
public string TotpIssuer { get; init; } = "signFlow";
|
/// <summary>
|
||||||
|
/// Default value is
|
||||||
|
/// </summary>
|
||||||
|
public string TotpIssuer { get; init; } = "signFlow";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 0 is user email, 1 is secret key and 2 is issuer.
|
/// 0 is user email, 1 is secret key and 2 is issuer.
|
||||||
/// </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}";
|
||||||
|
|
||||||
public int TotpQRPixelsPerModule { get; init; } = 20;
|
/// <summary>
|
||||||
}
|
/// Default value is 20.
|
||||||
|
/// </summary>
|
||||||
|
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,49 +1,81 @@
|
|||||||
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>
|
||||||
|
/// The unit is second.
|
||||||
|
/// </summary>
|
||||||
|
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}";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public ExpirationHandler Expiration { get; init; } = new();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default value is VerificationWindow.RfcSpecifiedNetworkDelay
|
||||||
|
/// </summary>
|
||||||
|
public VerificationWindow? TotpVerificationWindow { get; private init; } = VerificationWindow.RfcSpecifiedNetworkDelay;
|
||||||
|
|
||||||
|
private IEnumerable<int>? _tvwParams;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public IEnumerable<int>? TotpVerificationWindowParams
|
||||||
{
|
{
|
||||||
/// <summary>
|
get => _tvwParams;
|
||||||
/// The unit is second.
|
init
|
||||||
/// </summary>
|
|
||||||
public int TotpStep { get; init; } = 90;
|
|
||||||
|
|
||||||
public string Format { get; init; } = "Ihr 2FA-Passwort lautet {0}. Gültig bis {1}";
|
|
||||||
|
|
||||||
public ExpirationHandler Expiration { get; init; } = new();
|
|
||||||
|
|
||||||
public VerificationWindow? TotpVerificationWindow { get; private init; } = VerificationWindow.RfcSpecifiedNetworkDelay;
|
|
||||||
|
|
||||||
private IEnumerable<int>? _tvwParams;
|
|
||||||
|
|
||||||
public IEnumerable<int>? TotpVerificationWindowParams
|
|
||||||
{
|
{
|
||||||
get => _tvwParams;
|
_tvwParams = value;
|
||||||
init
|
if(_tvwParams is not null)
|
||||||
{
|
TotpVerificationWindow = new(previous: _tvwParams.ElementAtOrDefault(0), future: _tvwParams.ElementAtOrDefault(0));
|
||||||
_tvwParams = value;
|
|
||||||
if(_tvwParams is not null)
|
|
||||||
TotpVerificationWindow = new(previous: _tvwParams.ElementAtOrDefault(0), future: _tvwParams.ElementAtOrDefault(0));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class ExpirationHandler
|
|
||||||
{
|
|
||||||
public string CacheKeyFormat { get; init; } = "e{0}_r{1}_sms_code_expiration";
|
|
||||||
|
|
||||||
public string Format { get; init; } = "HH:mm:ss";
|
|
||||||
|
|
||||||
public string CultureName
|
|
||||||
{
|
|
||||||
get => _cultureInfo.Name;
|
|
||||||
init => _cultureInfo = new(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
private CultureInfo _cultureInfo = new("de-DE");
|
|
||||||
|
|
||||||
public CultureInfo CultureInfo => _cultureInfo;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
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";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default value is HH:mm:ss
|
||||||
|
/// </summary>
|
||||||
|
public string Format { get; init; } = "HH:mm:ss";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default value is 'de-DE'
|
||||||
|
/// </summary>
|
||||||
|
public string CultureName
|
||||||
|
{
|
||||||
|
get => _cultureInfo.Name;
|
||||||
|
init => _cultureInfo = new(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default value is 'de-DE'
|
||||||
|
/// </summary>
|
||||||
|
private CultureInfo _cultureInfo = new("de-DE");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default value is 'de-DE'
|
||||||
|
/// </summary>
|
||||||
|
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 +0,0 @@
|
|||||||
using DigitalData.Core.Abstractions.Infrastructure;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
Task<EnvelopeReceiver?> ReadLastByReceiver(string email);
|
/// <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);
|
||||||
}
|
}
|
||||||
@@ -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>
|
|
||||||
{
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Contracts.SQLExecutor;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public interface IDocumentExecutor
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="base64"></param>
|
||||||
|
/// <param name="envelope_uuid"></param>
|
||||||
|
/// <param name="cancellation"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<EnvelopeDocument> CreateDocumentAsync(string base64, string envelope_uuid, CancellationToken cancellation = default);
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
using Dapper;
|
||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Contracts.SQLExecutor;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public interface IEnvelopeExecutor : ISQLExecutor
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="userId"></param>
|
||||||
|
/// <param name="title"></param>
|
||||||
|
/// <param name="message"></param>
|
||||||
|
/// <param name="tfaEnabled"></param>
|
||||||
|
/// <param name="cancellation"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Envelope> CreateEnvelopeAsync(int userId, string title = "", string message = "", bool tfaEnabled = false, CancellationToken cancellation = default);
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Contracts.SQLExecutor;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public interface IEnvelopeReceiverExecutor
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelope_uuid"></param>
|
||||||
|
/// <param name="emailAddress"></param>
|
||||||
|
/// <param name="salutation"></param>
|
||||||
|
/// <param name="phone"></param>
|
||||||
|
/// <param name="cancellation"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<EnvelopeReceiver?> AddEnvelopeReceiverAsync(string envelope_uuid, string emailAddress, string? salutation = null, string? phone = null, CancellationToken cancellation = default);
|
||||||
|
}
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
namespace EnvelopeGenerator.Application.Contracts.SQLExecutor;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Provides methods for executing common queries on a given entity type.
|
||||||
|
/// This interface abstracts away the direct usage of ORM libraries (such as Entity Framework) for querying data
|
||||||
|
/// and provides asynchronous and synchronous operations for querying a collection or single entity.
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="TEntity">The type of the entity being queried.</typeparam>
|
||||||
|
public interface IQuery<TEntity>
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Asynchronously retrieves the first entity or a default value if no entity is found.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A task that represents the asynchronous operation. The task result contains the entity or a default value.</returns>
|
||||||
|
public Task<TEntity?> FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Asynchronously retrieves a single entity or a default value if no entity is found.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A task that represents the asynchronous operation. The task result contains the entity or a default value.</returns>
|
||||||
|
public Task<TEntity?> SingleOrDefaultAsync();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Asynchronously retrieves a list of entities.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A task that represents the asynchronous operation. The task result contains the list of entities.</returns>
|
||||||
|
public Task<IEnumerable<TEntity>> ToListAsync();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Asynchronously retrieves the first entity. Throws an exception if no entity is found.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A task that represents the asynchronous operation. The task result contains the first entity.</returns>
|
||||||
|
public Task<TEntity> FirstAsync();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Asynchronously retrieves a single entity. Throws an exception if no entity is found.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A task that represents the asynchronous operation. The task result contains the single entity.</returns>
|
||||||
|
public Task<TEntity> SingleAsync();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Synchronously retrieves the first entity or a default value if no entity is found.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>The first entity or a default value.</returns>
|
||||||
|
public TEntity? FirstOrDefault();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Synchronously retrieves a single entity or a default value if no entity is found.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>The single entity or a default value.</returns>
|
||||||
|
public TEntity? SingleOrDefault();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Synchronously retrieves a list of entities.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>The list of entities.</returns>
|
||||||
|
public IEnumerable<TEntity> ToList();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Synchronously retrieves the first entity. Throws an exception if no entity is found.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>The first entity.</returns>
|
||||||
|
public TEntity First();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Synchronously retrieves a single entity. Throws an exception if no entity is found.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>The single entity.</returns>
|
||||||
|
public TEntity Single();
|
||||||
|
}
|
||||||
20
EnvelopeGenerator.Application/Contracts/SQLExecutor/ISQL.cs
Normal file
20
EnvelopeGenerator.Application/Contracts/SQLExecutor/ISQL.cs
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
namespace EnvelopeGenerator.Application.Contracts.SQLExecutor;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Represents a raw SQL query contract.
|
||||||
|
/// </summary>
|
||||||
|
public interface ISQL
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the raw SQL query string.
|
||||||
|
/// </summary>
|
||||||
|
string Raw { get; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Represents a typed SQL query contract for a specific entity.
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="TEntity">The type of the entity associated with the SQL query.</typeparam>
|
||||||
|
public interface ISQL<TEntity> : ISQL
|
||||||
|
{
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
namespace EnvelopeGenerator.Application.Contracts.SQLExecutor;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Defines methods for executing raw SQL queries or custom SQL query classes and returning query executors for further operations.
|
||||||
|
/// Provides abstraction for raw SQL execution as well as mapping the results to <typeparamref name="TEntity"/> objects.
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="TEntity">The entity type to which the SQL query results will be mapped.</typeparam>
|
||||||
|
public interface ISQLExecutor<TEntity>: ISQLExecutor
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Executes a raw SQL query and returns an <see cref="IQuery{TEntity}"/> for further querying operations on the result.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sql">The raw SQL query to execute.</param>
|
||||||
|
/// <param name="cancellation">Optional cancellation token for the operation.</param>
|
||||||
|
/// <param name="parameters">Optional parameters for the SQL query.</param>
|
||||||
|
/// <returns>An <see cref="IQuery{TEntity}"/> instance for further query operations on the result.</returns>
|
||||||
|
IQuery<TEntity> Execute(string sql, CancellationToken cancellation = default, params object[] parameters);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Executes a custom SQL query defined by a class that implements <see cref="ISQL{TEntity}"/> and returns an <see cref="IQuery{TEntity}"/> for further querying operations on the result.
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="TSQL">The type of the custom SQL query class implementing <see cref="ISQL{TEntity}"/>.</typeparam>
|
||||||
|
/// <param name="cancellation">Optional cancellation token for the operation.</param>
|
||||||
|
/// <param name="parameters">Optional parameters for the SQL query.</param>
|
||||||
|
/// <returns>An <see cref="IQuery{TEntity}"/> instance for further query operations on the result.</returns>
|
||||||
|
IQuery<TEntity> Execute<TSQL>(CancellationToken cancellation = default, params object[] parameters) where TSQL : ISQL<TEntity>;
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
using Dapper;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Contracts.SQLExecutor;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public interface ISQLExecutor
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Executes a raw SQL query and returns an <see cref="IQuery{TEntity}"/> for further querying operations on the result.
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="TEntity">The entity type to which the SQL query results will be mapped.</typeparam>
|
||||||
|
/// <param name="sql">The raw SQL query to execute.</param>
|
||||||
|
/// <param name="parameters">Parameters for the SQL query.</param>
|
||||||
|
/// <param name="cancellation">Optional cancellation token for the operation.</param>
|
||||||
|
/// <returns>An <see cref="IQuery{TEntity}"/> instance for further query operations on the result.</returns>
|
||||||
|
Task<IEnumerable<TEntity>> Execute<TEntity>(string sql, DynamicParameters parameters, CancellationToken cancellation = default);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Executes a custom SQL query defined by a class that implements <see cref="ISQL{TEntity}"/> and returns an <see cref="IQuery{TEntity}"/> for further querying operations on the result.
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="TEntity">The entity type to which the SQL query results will be mapped.</typeparam>
|
||||||
|
/// <typeparam name="TSQL">The type of the custom SQL query class implementing <see cref="ISQL{TEntity}"/>.</typeparam>
|
||||||
|
/// <param name="parameters">Parameters for the SQL query.</param>
|
||||||
|
/// <param name="cancellation">Optional cancellation token for the operation.</param>
|
||||||
|
/// <returns>An <see cref="IQuery{TEntity}"/> instance for further query operations on the result.</returns>
|
||||||
|
Task<IEnumerable<TEntity>> Execute<TEntity, TSQL>(DynamicParameters parameters, CancellationToken cancellation = default) where TSQL : ISQL;
|
||||||
|
}
|
||||||
@@ -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.Dto;
|
||||||
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.Dto;
|
||||||
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.Dto;
|
||||||
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.Dto;
|
||||||
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 +0,0 @@
|
|||||||
using DigitalData.Core.Abstractions.Application;
|
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Services;
|
|
||||||
|
|
||||||
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.Dto;
|
||||||
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.Dto.EnvelopeHistory;
|
||||||
using EnvelopeGenerator.Application.DTOs.Receiver;
|
using EnvelopeGenerator.Application.Dto.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.Dto.EnvelopeReceiver;
|
||||||
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
|
using EnvelopeGenerator.Application.Dto.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.Dto.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,40 +1,149 @@
|
|||||||
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.Dto.EnvelopeReceiver;
|
||||||
using EnvelopeGenerator.Application.DTOs.Messaging;
|
using EnvelopeGenerator.Application.Dto.Messaging;
|
||||||
|
using EnvelopeGenerator.Application.Envelopes;
|
||||||
|
using EnvelopeGenerator.Application.Envelopes.Queries;
|
||||||
|
using EnvelopeGenerator.Application.Receivers.Queries;
|
||||||
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 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);
|
||||||
|
|
||||||
Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUsernameAsync(string username, int? min_status = null, int? max_status = null, params int[] ignore_statuses);
|
/// <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, ReadEnvelopeQuery? envelopeQuery = null, ReadReceiverQuery? receiverQuery = null, params int[] ignore_statuses);
|
||||||
|
|
||||||
Task<DataResult<string?>> ReadLastUsedReceiverNameByMail(string mail);
|
/// <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.Dto;
|
||||||
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);
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,11 @@
|
|||||||
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
using EnvelopeGenerator.Application.Dto.EnvelopeReceiver;
|
||||||
using EnvelopeGenerator.Application.DTOs.Messaging;
|
using EnvelopeGenerator.Application.Dto.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.Dto;
|
||||||
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.Dto.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>;
|
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,23 @@
|
|||||||
using EnvelopeGenerator.Application.DTOs.Messaging;
|
using EnvelopeGenerator.Application.Dto.Messaging;
|
||||||
|
|
||||||
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 +0,0 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
|
||||||
using System.Text.Json.Serialization;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs
|
|
||||||
{
|
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
|
||||||
public record ConfigDto(
|
|
||||||
string DocumentPath,
|
|
||||||
int SendingProfile,
|
|
||||||
string SignatureHost,
|
|
||||||
string ExternalProgramName,
|
|
||||||
string ExportPath) : IUnique<int>
|
|
||||||
{
|
|
||||||
[NotMapped]
|
|
||||||
[JsonIgnore]
|
|
||||||
[Obsolete("Configuration does not have an ID; it represents a single table in the database.")]
|
|
||||||
public int Id => throw new InvalidOperationException("This configuration does not support an ID as it represents a single row in the database.");
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs
|
|
||||||
{
|
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
|
||||||
public record DocumentReceiverElementDto(
|
|
||||||
int Id,
|
|
||||||
int DocumentId,
|
|
||||||
int ReceiverId,
|
|
||||||
int ElementType,
|
|
||||||
double X,
|
|
||||||
double Y,
|
|
||||||
double Width,
|
|
||||||
double Height,
|
|
||||||
int Page,
|
|
||||||
bool Required,
|
|
||||||
string? Tooltip,
|
|
||||||
bool ReadOnly,
|
|
||||||
int AnnotationIndex,
|
|
||||||
DateTime AddedWhen,
|
|
||||||
DateTime? ChangedWhen,
|
|
||||||
double Top,
|
|
||||||
double Left
|
|
||||||
): IUnique<int>;
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs
|
|
||||||
{
|
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
|
||||||
public record DocumentStatusDto(
|
|
||||||
int Id,
|
|
||||||
int EnvelopeId,
|
|
||||||
int ReceiverId,
|
|
||||||
int Status,
|
|
||||||
DateTime? StatusChangedWhen,
|
|
||||||
DateTime AddedWhen,
|
|
||||||
DateTime? ChangedWhen) : IUnique<int>
|
|
||||||
{
|
|
||||||
public string? Value { get; set; }
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs
|
|
||||||
{
|
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
|
||||||
public record EmailTemplateDto(
|
|
||||||
int Id,
|
|
||||||
string Name,
|
|
||||||
string Body,
|
|
||||||
string Subject) : IUnique<int>;
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs
|
|
||||||
{
|
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
|
||||||
public record EnvelopeCertificateDto(
|
|
||||||
int Id,
|
|
||||||
int EnvelopeId,
|
|
||||||
string EnvelopeUuid,
|
|
||||||
string EnvelopeSubject,
|
|
||||||
int CreatorId,
|
|
||||||
string CreatorName,
|
|
||||||
string CreatorEmail,
|
|
||||||
int EnvelopeStatus) : IUnique<int>;
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs
|
|
||||||
{
|
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
|
||||||
public record EnvelopeDocumentDto
|
|
||||||
(
|
|
||||||
int Id,
|
|
||||||
int EnvelopeId,
|
|
||||||
DateTime AddedWhen,
|
|
||||||
byte[]? ByteData = null,
|
|
||||||
IEnumerable<DocumentReceiverElementDto>? Elements = null
|
|
||||||
) : IUnique<int>;
|
|
||||||
}
|
|
||||||
@@ -1,71 +0,0 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
|
||||||
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
|
|
||||||
using DigitalData.UserManager.Application.DTOs.User;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs
|
|
||||||
{
|
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
|
||||||
public record EnvelopeDto() : IUnique<int>
|
|
||||||
{
|
|
||||||
public int Id { get; set; }
|
|
||||||
|
|
||||||
public int UserId { get; set; }
|
|
||||||
|
|
||||||
public int Status { get; set; }
|
|
||||||
|
|
||||||
public string StatusName { get; set; }
|
|
||||||
|
|
||||||
public string Uuid { get; set; }
|
|
||||||
|
|
||||||
[TemplatePlaceholder("[MESSAGE]")]
|
|
||||||
public string Message { get; set; }
|
|
||||||
public DateTime? ExpiresWhen { get; set; }
|
|
||||||
public DateTime? ExpiresWarningWhen { get; set; }
|
|
||||||
public DateTime AddedWhen { get; set; }
|
|
||||||
public DateTime? ChangedWhen { get; set; }
|
|
||||||
|
|
||||||
[TemplatePlaceholder("[DOCUMENT_TITLE]")]
|
|
||||||
public string Title { get; set; }
|
|
||||||
|
|
||||||
public int? ContractType { get; set; }
|
|
||||||
|
|
||||||
public string Language { get; set; }
|
|
||||||
|
|
||||||
public bool? SendReminderEmails { get; set; }
|
|
||||||
|
|
||||||
public int? FirstReminderDays { get; set; }
|
|
||||||
|
|
||||||
public int? ReminderIntervalDays { get; set; }
|
|
||||||
|
|
||||||
public int? EnvelopeTypeId { get; set; }
|
|
||||||
|
|
||||||
public int? CertificationType { get; set; }
|
|
||||||
|
|
||||||
public bool? UseAccessCode { get; set; }
|
|
||||||
|
|
||||||
public int? FinalEmailToCreator { get; set; }
|
|
||||||
|
|
||||||
public int? FinalEmailToReceivers { get; set; }
|
|
||||||
|
|
||||||
public int? ExpiresWhenDays { get; set; }
|
|
||||||
|
|
||||||
public int? ExpiresWarningWhenDays { get; set; }
|
|
||||||
|
|
||||||
public bool TFAEnabled { get; init; }
|
|
||||||
|
|
||||||
public bool DmzMoved { get; set; }
|
|
||||||
public UserReadDto? User { get; set; }
|
|
||||||
public EnvelopeType? EnvelopeType { get; set; }
|
|
||||||
|
|
||||||
public string? EnvelopeTypeTitle { get; set; }
|
|
||||||
|
|
||||||
public bool IsAlreadySent { get; set; }
|
|
||||||
|
|
||||||
public string? StatusTranslated { get; set; }
|
|
||||||
|
|
||||||
public string? ContractTypeTranslated { get; set; }
|
|
||||||
public IEnumerable<EnvelopeDocumentDto>? Documents { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs.EnvelopeHistory
|
|
||||||
{
|
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
|
||||||
public record EnvelopeHistoryCreateDto(
|
|
||||||
int EnvelopeId,
|
|
||||||
string UserReference,
|
|
||||||
int Status,
|
|
||||||
DateTime? ActionDate,
|
|
||||||
string? Comment = null);
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
|
||||||
using DigitalData.Core.DTO;
|
|
||||||
using DigitalData.UserManager.Application.DTOs.User;
|
|
||||||
using EnvelopeGenerator.Application.DTOs.Receiver;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using static EnvelopeGenerator.Common.Constants;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs.EnvelopeHistory
|
|
||||||
{
|
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
|
||||||
public record EnvelopeHistoryDto(
|
|
||||||
long Id,
|
|
||||||
int EnvelopeId,
|
|
||||||
string UserReference,
|
|
||||||
int Status,
|
|
||||||
string? StatusName,
|
|
||||||
DateTime AddedWhen,
|
|
||||||
DateTime? ActionDate,
|
|
||||||
UserCreateDto? Sender,
|
|
||||||
ReceiverReadDto? Receiver,
|
|
||||||
ReferenceType ReferenceType,
|
|
||||||
string? Comment = null) : BaseDTO<long>(Id), IUnique<long>;
|
|
||||||
}
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
|
||||||
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiver
|
|
||||||
{
|
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
|
||||||
public record EnvelopeReceiverBasicDto() : IUnique<(int Envelope, int Receiver)>
|
|
||||||
{
|
|
||||||
public (int Envelope, int Receiver) Id => (Envelope: EnvelopeId, Receiver: ReceiverId);
|
|
||||||
|
|
||||||
public int EnvelopeId { get; init; }
|
|
||||||
|
|
||||||
public int ReceiverId { get; init; }
|
|
||||||
|
|
||||||
public int Sequence { get; init; }
|
|
||||||
|
|
||||||
[TemplatePlaceholder("[NAME_RECEIVER]")]
|
|
||||||
public string? Name { get; init; }
|
|
||||||
|
|
||||||
public string? JobTitle { get; init; }
|
|
||||||
|
|
||||||
public string? CompanyName { get; init; }
|
|
||||||
|
|
||||||
public string? PrivateMessage { get; init; }
|
|
||||||
|
|
||||||
public DateTime AddedWhen { get; init; }
|
|
||||||
|
|
||||||
public DateTime? ChangedWhen { get; init; }
|
|
||||||
|
|
||||||
public bool HasPhoneNumber { get; init; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
using EnvelopeGenerator.Application.DTOs.Receiver;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiver
|
|
||||||
{
|
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
|
||||||
public record EnvelopeReceiverDto() : EnvelopeReceiverBasicDto()
|
|
||||||
{
|
|
||||||
public EnvelopeDto? Envelope { get; set; }
|
|
||||||
|
|
||||||
public ReceiverReadDto? Receiver { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiver
|
|
||||||
{
|
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
|
||||||
public record EnvelopeReceiverSecretDto() : EnvelopeReceiverDto()
|
|
||||||
{
|
|
||||||
public string? AccessCode { get; init; }
|
|
||||||
|
|
||||||
public string? PhoneNumber { get; init; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using System.Text.Json.Serialization;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly
|
|
||||||
{
|
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
|
||||||
public record EnvelopeReceiverReadOnlyCreateDto(
|
|
||||||
DateTime DateValid)
|
|
||||||
{
|
|
||||||
[EmailAddress]
|
|
||||||
[Required]
|
|
||||||
public required string ReceiverMail { get; init; }
|
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
public long? EnvelopeId { get; set; } = null;
|
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
public string? AddedWho { get; set; }
|
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
public DateTime AddedWhen { get; } = DateTime.Now;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
using EnvelopeGenerator.Application.DTOs.Receiver;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly
|
|
||||||
{
|
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
|
||||||
public record EnvelopeReceiverReadOnlyDto(
|
|
||||||
long Id,
|
|
||||||
long EnvelopeId,
|
|
||||||
string ReceiverMail,
|
|
||||||
DateTime DateValid,
|
|
||||||
DateTime AddedWhen,
|
|
||||||
string AddedWho,
|
|
||||||
EnvelopeDto? Envelope = null,
|
|
||||||
string? ChangedWho = null,
|
|
||||||
DateTime? ChangedWhen = null,
|
|
||||||
ReceiverReadDto? Receiver = null);
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly
|
|
||||||
{
|
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
|
||||||
public record EnvelopeReceiverReadOnlyUpdateDto(
|
|
||||||
long Id,
|
|
||||||
DateTime DateValid,
|
|
||||||
string ChangedWho) : IUnique<long>
|
|
||||||
{
|
|
||||||
public DateTime ChangedWhen { get; } = DateTime.Now;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs
|
|
||||||
{
|
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
|
||||||
public record EnvelopeTypeDto(
|
|
||||||
int Id,
|
|
||||||
string Title,
|
|
||||||
string Language,
|
|
||||||
int? ExpiresDays,
|
|
||||||
int? CertificationType,
|
|
||||||
bool? UseAccessCode,
|
|
||||||
int? FinalEmailToCreator,
|
|
||||||
int? FinalEmailToReceivers,
|
|
||||||
DateTime AddedWhen,
|
|
||||||
DateTime? ChangedWhen,
|
|
||||||
int? ExpiresWarningDays,
|
|
||||||
bool? SendReminderEmails,
|
|
||||||
int? FirstReminderDays,
|
|
||||||
int? ReminderIntervalDays,
|
|
||||||
int? ContractType) : IUnique<int>;
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs.Messaging
|
|
||||||
{
|
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
|
||||||
public class GtxMessagingResponse : Dictionary<string, object?> { }
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs.Messaging
|
|
||||||
{
|
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
|
||||||
public record SmsResponse
|
|
||||||
{
|
|
||||||
public required bool Ok { get; init; }
|
|
||||||
|
|
||||||
public bool Failed => !Ok;
|
|
||||||
|
|
||||||
public dynamic? Errors { get; init; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using System.Security.Cryptography;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
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(() =>
|
|
||||||
{
|
|
||||||
var bytes_arr = Encoding.UTF8.GetBytes(EmailAddress.ToUpper());
|
|
||||||
var hash_arr = SHA256.HashData(bytes_arr);
|
|
||||||
var hexa_str = BitConverter.ToString(hash_arr);
|
|
||||||
return hexa_str.Replace("-", string.Empty);
|
|
||||||
});
|
|
||||||
|
|
||||||
public DateTime AddedWhen { get; } = DateTime.Now;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
|
||||||
using DigitalData.Core.DTO;
|
|
||||||
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
|
|
||||||
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using System.Text.Json.Serialization;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs.Receiver;
|
|
||||||
|
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
|
||||||
public record ReceiverReadDto(
|
|
||||||
int Id,
|
|
||||||
string EmailAddress,
|
|
||||||
string Signature,
|
|
||||||
DateTime AddedWhen
|
|
||||||
) : BaseDTO<int>(Id), IUnique<int>
|
|
||||||
{
|
|
||||||
[JsonIgnore]
|
|
||||||
public IEnumerable<EnvelopeReceiverBasicDto>? EnvelopeReceivers { get; init; }
|
|
||||||
|
|
||||||
public string? LastUsedName => EnvelopeReceivers?.LastOrDefault()?.Name;
|
|
||||||
|
|
||||||
public string? TotpSecretkey { get; set; } = null;
|
|
||||||
|
|
||||||
public DateTime? TfaRegDeadline { get; set; }
|
|
||||||
};
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs.Receiver;
|
|
||||||
|
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
|
||||||
public record ReceiverUpdateDto(int Id, string? TotpSecretkey = null, DateTime? TfaRegDeadline = null) : IUnique<int>;
|
|
||||||
@@ -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>;
|
|
||||||
}
|
|
||||||
@@ -7,6 +7,7 @@ using DigitalData.Core.Client;
|
|||||||
using QRCoder;
|
using QRCoder;
|
||||||
using EnvelopeGenerator.Application.Contracts.Services;
|
using EnvelopeGenerator.Application.Contracts.Services;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using EnvelopeGenerator.Application.EnvelopeReceivers.Commands;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application;
|
namespace EnvelopeGenerator.Application;
|
||||||
|
|
||||||
@@ -21,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
|
||||||
@@ -31,12 +33,10 @@ public static class DependencyInjection
|
|||||||
services.TryAddScoped<IDocumentStatusService, DocumentStatusService>();
|
services.TryAddScoped<IDocumentStatusService, DocumentStatusService>();
|
||||||
services.TryAddScoped<IEmailTemplateService, EmailTemplateService>();
|
services.TryAddScoped<IEmailTemplateService, EmailTemplateService>();
|
||||||
services.TryAddScoped<IEnvelopeService, EnvelopeService>();
|
services.TryAddScoped<IEnvelopeService, EnvelopeService>();
|
||||||
services.TryAddScoped<IEnvelopeCertificateService, EnvelopeCertificateService>();
|
|
||||||
services.TryAddScoped<IEnvelopeDocumentService, EnvelopeDocumentService>();
|
services.TryAddScoped<IEnvelopeDocumentService, EnvelopeDocumentService>();
|
||||||
services.TryAddScoped<IEnvelopeReceiverService, EnvelopeReceiverService>();
|
services.TryAddScoped<IEnvelopeReceiverService, EnvelopeReceiverService>();
|
||||||
services.TryAddScoped<IEnvelopeTypeService, EnvelopeTypeService>();
|
services.TryAddScoped<IEnvelopeTypeService, EnvelopeTypeService>();
|
||||||
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
|
||||||
@@ -58,6 +58,7 @@ public static class DependencyInjection
|
|||||||
services.AddMediatR(cfg =>
|
services.AddMediatR(cfg =>
|
||||||
{
|
{
|
||||||
cfg.RegisterServicesFromAssembly(Assembly.GetExecutingAssembly());
|
cfg.RegisterServicesFromAssembly(Assembly.GetExecutingAssembly());
|
||||||
|
cfg.RegisterServicesFromAssembly(typeof(CreateEnvelopeReceiverCommandHandler).Assembly);
|
||||||
});
|
});
|
||||||
|
|
||||||
return services;
|
return services;
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
using AutoMapper;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Documents.Queries.Read;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public class ReadDocumentMappingProfile : Profile
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public ReadDocumentMappingProfile()
|
|
||||||
{
|
|
||||||
CreateMap<EnvelopeDocument, ReadDocumentResponse>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
using MediatR;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Documents.Queries.Read;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Represents a query to read a document based on its unique identifier or associated envelope identifier.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="Id">The unique identifier of the document. Optional.</param>
|
|
||||||
/// <param name="EnvelopeId">The identifier of the envelope associated with the document. Optional.</param>
|
|
||||||
public record ReadDocumentQuery(int? Id = null, int? EnvelopeId = null) : IRequest<ReadDocumentResponse?>
|
|
||||||
{
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
namespace EnvelopeGenerator.Application.Documents.Queries.Read;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Represents the response for reading a document.
|
|
||||||
/// </summary>
|
|
||||||
public class ReadDocumentResponse
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// The unique identifier of the document.
|
|
||||||
/// </summary>
|
|
||||||
public int Guid { get; init; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The identifier of the associated envelope.
|
|
||||||
/// </summary>
|
|
||||||
public int EnvelopeId { get; init; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The date and time when the document was added.
|
|
||||||
/// </summary>
|
|
||||||
public DateTime AddedWhen { get; init; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The binary data of the document, if available.
|
|
||||||
/// </summary>
|
|
||||||
public byte[]? ByteData { get; init; }
|
|
||||||
}
|
|
||||||
@@ -1,13 +1,23 @@
|
|||||||
using DigitalData.Core.Abstractions.Infrastructure;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Application.Dto;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Documents.Queries.Read;
|
namespace EnvelopeGenerator.Application.Documents.Queries;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Represents a query to read a document based on its unique identifier or associated envelope identifier.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Id">The unique identifier of the document. Optional.</param>
|
||||||
|
/// <param name="EnvelopeId">The identifier of the envelope associated with the document. Optional.</param>
|
||||||
|
public record ReadDocumentQuery(int? Id = null, int? EnvelopeId = null) : IRequest<EnvelopeDocumentDto?>
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Handles queries for reading <see cref="EnvelopeDocument"/> data based on either the document ID or the envelope ID.
|
/// Handles queries for reading <see cref="EnvelopeDocument"/> data based on either the document ID or the envelope ID.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ReadDocumentQueryHandler : IRequestHandler<ReadDocumentQuery, ReadDocumentResponse?>
|
public class ReadDocumentQueryHandler : IRequestHandler<ReadDocumentQuery, EnvelopeDocumentDto?>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Repository for accessing <see cref="EnvelopeDocument"/> entities.
|
/// Repository for accessing <see cref="EnvelopeDocument"/> entities.
|
||||||
@@ -24,22 +34,23 @@ public class ReadDocumentQueryHandler : IRequestHandler<ReadDocumentQuery, ReadD
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Handles the <see cref="ReadDocumentQuery"/> and returns a <see cref="ReadDocumentResponse"/> based on the provided identifiers.
|
/// Handles the <see cref="ReadDocumentQuery"/> and returns a <see cref="EnvelopeDocumentDto"/> based on the provided identifiers.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="query">The query containing the document ID or envelope ID to search for.</param>
|
/// <param name="query">The query containing the document ID or envelope ID to search for.</param>
|
||||||
/// <param name="cancellationToken">A token to monitor for cancellation requests.</param>
|
/// <param name="cancellationToken">A token to monitor for cancellation requests.</param>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// A <see cref="ReadDocumentResponse"/> if a matching document is found; otherwise, <c>null</c>.
|
/// A <see cref="EnvelopeDocumentDto"/> if a matching document is found; otherwise, <c>null</c>.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
/// <exception cref="InvalidOperationException">
|
/// <exception cref="InvalidOperationException">
|
||||||
/// Thrown when neither <see cref="ReadDocumentQuery.Id"/> nor <see cref="ReadDocumentQuery.EnvelopeId"/> is provided.
|
/// Thrown when neither <see cref="ReadDocumentQuery.Id"/> nor <see cref="ReadDocumentQuery.EnvelopeId"/> is provided.
|
||||||
/// </exception>
|
/// </exception>
|
||||||
public async Task<ReadDocumentResponse?> Handle(ReadDocumentQuery query, CancellationToken cancellationToken)
|
[Obsolete("Use MediatR")]
|
||||||
|
public async Task<EnvelopeDocumentDto?> Handle(ReadDocumentQuery query, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
if (query.Id is not null)
|
if (query.Id is not null)
|
||||||
return await _repo.ReadOrDefaultAsync<ReadDocumentResponse>(d => d.Id == query.Id);
|
return await _repo.ReadOrDefaultAsync<EnvelopeDocumentDto>(d => d.Id == query.Id);
|
||||||
else if (query.EnvelopeId is not null)
|
else if (query.EnvelopeId is not null)
|
||||||
return await _repo.ReadOrDefaultAsync<ReadDocumentResponse>(d => d.EnvelopeId == query.EnvelopeId);
|
return await _repo.ReadOrDefaultAsync<EnvelopeDocumentDto>(d => d.EnvelopeId == query.EnvelopeId);
|
||||||
|
|
||||||
throw new InvalidOperationException(
|
throw new InvalidOperationException(
|
||||||
$"Invalid {nameof(ReadDocumentQuery)}: either {nameof(query.Id)} or {nameof(query.EnvelopeId)} must be provided.");
|
$"Invalid {nameof(ReadDocumentQuery)}: either {nameof(query.Id)} or {nameof(query.EnvelopeId)} must be provided.");
|
||||||
30
EnvelopeGenerator.Application/Dto/ConfigDto.cs
Normal file
30
EnvelopeGenerator.Application/Dto/ConfigDto.cs
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Dto;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data Transfer Object representing configuration settings.
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public class ConfigDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the sending profile identifier.
|
||||||
|
/// </summary>
|
||||||
|
public int SendingProfile { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the signature host URL or name.
|
||||||
|
/// </summary>
|
||||||
|
public required string SignatureHost { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 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; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Dto;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data Transfer Object representing a positioned element assigned to a document receiver.
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public class DocumentReceiverElementDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the unique identifier of the element.
|
||||||
|
/// </summary>
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the identifier of the associated document.
|
||||||
|
/// </summary>
|
||||||
|
public int DocumentId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the identifier of the receiver.
|
||||||
|
/// </summary>
|
||||||
|
public int ReceiverId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the type of the element.
|
||||||
|
/// </summary>
|
||||||
|
public int ElementType { get; set; }
|
||||||
|
|
||||||
|
/// <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; }
|
||||||
|
}
|
||||||
50
EnvelopeGenerator.Application/Dto/DocumentStatusDto.cs
Normal file
50
EnvelopeGenerator.Application/Dto/DocumentStatusDto.cs
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Dto;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data Transfer Object representing the status of a document for a specific receiver.
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public class DocumentStatusDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the unique identifier of the document status entry.
|
||||||
|
/// </summary>
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the ID of the associated envelope.
|
||||||
|
/// </summary>
|
||||||
|
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; }
|
||||||
|
}
|
||||||
31
EnvelopeGenerator.Application/Dto/EmailTemplateDto.cs
Normal file
31
EnvelopeGenerator.Application/Dto/EmailTemplateDto.cs
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Dto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public record EmailTemplateDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public int Id{ get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public required string Name { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public required string Body { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public required string Subject { get; set; }
|
||||||
|
};
|
||||||
|
}
|
||||||
35
EnvelopeGenerator.Application/Dto/EnvelopeDocumentDto.cs
Normal file
35
EnvelopeGenerator.Application/Dto/EnvelopeDocumentDto.cs
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Dto;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data Transfer Object representing a document within an envelope, including optional binary data and form elements.
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public class EnvelopeDocumentDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the unique identifier of the document.
|
||||||
|
/// </summary>
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the envelope ID to which the document belongs.
|
||||||
|
/// </summary>
|
||||||
|
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; }
|
||||||
|
}
|
||||||
120
EnvelopeGenerator.Application/Dto/EnvelopeDto.cs
Normal file
120
EnvelopeGenerator.Application/Dto/EnvelopeDto.cs
Normal file
@@ -0,0 +1,120 @@
|
|||||||
|
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
|
||||||
|
using DigitalData.UserManager.Application.DTOs.User;
|
||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Dto;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public record EnvelopeDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public int UserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public int Status { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default value is string.Empty
|
||||||
|
/// </summary>
|
||||||
|
public string StatusName { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default value is string.Empty
|
||||||
|
/// </summary>
|
||||||
|
public string Uuid { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default value is string.Empty
|
||||||
|
/// </summary>
|
||||||
|
[TemplatePlaceholder("[MESSAGE]")]
|
||||||
|
public string Message { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public DateTime AddedWhen { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? ChangedWhen { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default value is string.Empty
|
||||||
|
/// </summary>
|
||||||
|
[TemplatePlaceholder("[DOCUMENT_TITLE]")]
|
||||||
|
public string Title { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public int? ContractType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default value is 'de-DE'
|
||||||
|
/// </summary>
|
||||||
|
public string Language { get; set; } = "de-DE";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public int? EnvelopeTypeId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public int? CertificationType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public bool? UseAccessCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public bool TFAEnabled { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public UserReadDto? User { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public EnvelopeType? EnvelopeType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string? EnvelopeTypeTitle { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public bool IsAlreadySent { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public byte[]? DocResult { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public IEnumerable<EnvelopeDocumentDto>? Documents { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Dto.EnvelopeHistory;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data Transfer Object for creating a new envelope history record.
|
||||||
|
/// </summary>
|
||||||
|
public class EnvelopeHistoryCreateDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the identifier of the envelope.
|
||||||
|
/// </summary>
|
||||||
|
public int EnvelopeId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 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; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
using DigitalData.UserManager.Application.DTOs.User;
|
||||||
|
using EnvelopeGenerator.Application.Dto.Receiver;
|
||||||
|
using static EnvelopeGenerator.Domain.Constants;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Dto.EnvelopeHistory;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data Transfer Object representing the history of an envelope, including status, sender, receiver, and related metadata.
|
||||||
|
/// </summary>
|
||||||
|
public record EnvelopeHistoryDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Unique identifier for the envelope history entry.
|
||||||
|
/// </summary>
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Identifier of the associated envelope.
|
||||||
|
/// </summary>
|
||||||
|
public int EnvelopeId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Reference string for the user related to this history entry.
|
||||||
|
/// </summary>
|
||||||
|
public required string UserReference { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Status code of the envelope at this history point.
|
||||||
|
/// </summary>
|
||||||
|
public int Status { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 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();
|
||||||
|
};
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Dto.EnvelopeReceiver;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public record EnvelopeReceiverBasicDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public (int Envelope, int Receiver) Id => (Envelope: EnvelopeId, Receiver: ReceiverId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public int EnvelopeId { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public int ReceiverId { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public int Sequence { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[TemplatePlaceholder("[NAME_RECEIVER]")]
|
||||||
|
public string? Name { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string? JobTitle { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string? CompanyName { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string? PrivateMessage { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public DateTime AddedWhen { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? ChangedWhen { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public bool HasPhoneNumber { get; init; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
using EnvelopeGenerator.Application.Dto.Receiver;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Dto.EnvelopeReceiver;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public record EnvelopeReceiverDto() : EnvelopeReceiverBasicDto()
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public EnvelopeDto? Envelope { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public ReceiverReadDto? Receiver { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Dto.EnvelopeReceiver;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public record EnvelopeReceiverSecretDto : EnvelopeReceiverDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string? AccessCode { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string? PhoneNumber { get; init; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Dto.EnvelopeReceiverReadOnly;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="DateValid"></param>
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public record EnvelopeReceiverReadOnlyCreateDto(
|
||||||
|
DateTime DateValid)
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[EmailAddress]
|
||||||
|
[Required]
|
||||||
|
public required string ReceiverMail { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default value is null
|
||||||
|
/// </summary>
|
||||||
|
[JsonIgnore]
|
||||||
|
public long? EnvelopeId { get; set; } = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[JsonIgnore]
|
||||||
|
public string? AddedWho { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default value is DateTime.Now
|
||||||
|
/// </summary>
|
||||||
|
[JsonIgnore]
|
||||||
|
public DateTime AddedWhen { get; } = DateTime.Now;
|
||||||
|
};
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
using EnvelopeGenerator.Application.Dto.Receiver;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Dto.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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or inits the unique identifier of the envelope receiver.
|
||||||
|
/// </summary>
|
||||||
|
public long Id { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or inits the identifier of the associated envelope.
|
||||||
|
/// </summary>
|
||||||
|
public long EnvelopeId { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 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; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Dto.EnvelopeReceiverReadOnly;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data Transfer Object for updating a read-only envelope receiver.
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public class EnvelopeReceiverReadOnlyUpdateDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the unique identifier of the envelope receiver.
|
||||||
|
/// </summary>
|
||||||
|
public long Id { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 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;
|
||||||
|
}
|
||||||
85
EnvelopeGenerator.Application/Dto/EnvelopeTypeDto.cs
Normal file
85
EnvelopeGenerator.Application/Dto/EnvelopeTypeDto.cs
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Dto;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data Transfer Object representing a type of envelope with its configuration settings.
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public class EnvelopeTypeDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the unique identifier of the envelope type.
|
||||||
|
/// </summary>
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the title of the envelope type.
|
||||||
|
/// </summary>
|
||||||
|
public string Title { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the language code used in this envelope type.
|
||||||
|
/// </summary>
|
||||||
|
public string Language { get; set; } = "de-DE";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 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; }
|
||||||
|
}
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
|
using EnvelopeGenerator.Application.Dto.EnvelopeHistory;
|
||||||
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
using EnvelopeGenerator.Application.Dto.EnvelopeReceiver;
|
||||||
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
|
using EnvelopeGenerator.Application.Dto.EnvelopeReceiverReadOnly;
|
||||||
using EnvelopeGenerator.Application.DTOs.Messaging;
|
using EnvelopeGenerator.Application.Dto.Messaging;
|
||||||
using EnvelopeGenerator.Application.DTOs.Receiver;
|
using EnvelopeGenerator.Application.Dto.Receiver;
|
||||||
using EnvelopeGenerator.Application.Extensions;
|
using EnvelopeGenerator.Application.Extensions;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs;
|
namespace EnvelopeGenerator.Application.Dto;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents the AutoMapper profile configuration for mapping between
|
/// Represents the AutoMapper profile configuration for mapping between
|
||||||
@@ -27,7 +27,6 @@ public class MappingProfile : Profile
|
|||||||
CreateMap<DocumentStatus, DocumentStatusDto>();
|
CreateMap<DocumentStatus, DocumentStatusDto>();
|
||||||
CreateMap<EmailTemplate, EmailTemplateDto>();
|
CreateMap<EmailTemplate, EmailTemplateDto>();
|
||||||
CreateMap<Envelope, EnvelopeDto>();
|
CreateMap<Envelope, EnvelopeDto>();
|
||||||
CreateMap<EnvelopeCertificate, EnvelopeCertificateDto>();
|
|
||||||
CreateMap<EnvelopeDocument, EnvelopeDocumentDto>();
|
CreateMap<EnvelopeDocument, EnvelopeDocumentDto>();
|
||||||
CreateMap<Domain.Entities.EnvelopeHistory, EnvelopeHistoryDto>();
|
CreateMap<Domain.Entities.EnvelopeHistory, EnvelopeHistoryDto>();
|
||||||
CreateMap<Domain.Entities.EnvelopeHistory, EnvelopeHistoryCreateDto>();
|
CreateMap<Domain.Entities.EnvelopeHistory, EnvelopeHistoryCreateDto>();
|
||||||
@@ -37,7 +36,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
|
||||||
@@ -46,7 +44,6 @@ public class MappingProfile : Profile
|
|||||||
CreateMap<DocumentStatusDto, DocumentStatus>();
|
CreateMap<DocumentStatusDto, DocumentStatus>();
|
||||||
CreateMap<EmailTemplateDto, EmailTemplate>();
|
CreateMap<EmailTemplateDto, EmailTemplate>();
|
||||||
CreateMap<EnvelopeDto, Envelope>();
|
CreateMap<EnvelopeDto, Envelope>();
|
||||||
CreateMap<EnvelopeCertificateDto, EnvelopeCertificate>();
|
|
||||||
CreateMap<EnvelopeDocumentDto, EnvelopeDocument>();
|
CreateMap<EnvelopeDocumentDto, EnvelopeDocument>();
|
||||||
CreateMap<EnvelopeHistoryDto, Domain.Entities.EnvelopeHistory>();
|
CreateMap<EnvelopeHistoryDto, Domain.Entities.EnvelopeHistory>();
|
||||||
CreateMap<EnvelopeHistoryCreateDto, Domain.Entities.EnvelopeHistory>();
|
CreateMap<EnvelopeHistoryCreateDto, Domain.Entities.EnvelopeHistory>();
|
||||||
@@ -55,8 +52,7 @@ 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<Domain.Entities.EnvelopeReceiver, EnvelopeReceiverBasicDto>();
|
||||||
CreateMap<EnvelopeReceiverBase, EnvelopeReceiverBasicDto>();
|
|
||||||
CreateMap<EnvelopeReceiverReadOnlyCreateDto, Domain.Entities.EnvelopeReceiverReadOnly>();
|
CreateMap<EnvelopeReceiverReadOnlyCreateDto, Domain.Entities.EnvelopeReceiverReadOnly>();
|
||||||
CreateMap<EnvelopeReceiverReadOnlyUpdateDto, Domain.Entities.EnvelopeReceiverReadOnly>();
|
CreateMap<EnvelopeReceiverReadOnlyUpdateDto, Domain.Entities.EnvelopeReceiverReadOnly>();
|
||||||
|
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Dto.Messaging;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public class GtxMessagingResponse : Dictionary<string, object?> { }
|
||||||
25
EnvelopeGenerator.Application/Dto/Messaging/SmsResponse.cs
Normal file
25
EnvelopeGenerator.Application/Dto/Messaging/SmsResponse.cs
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Dto.Messaging;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public record SmsResponse
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public required bool Ok { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns !Ok
|
||||||
|
/// </summary>
|
||||||
|
public bool Failed => !Ok;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public dynamic? Errors { get; init; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Dto.Receiver;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public record ReceiverCreateDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public ReceiverCreateDto()
|
||||||
|
{
|
||||||
|
_sha256HexOfMail = new(() =>
|
||||||
|
{
|
||||||
|
var bytes_arr = Encoding.UTF8.GetBytes(EmailAddress!.ToUpper());
|
||||||
|
var hash_arr = SHA256.HashData(bytes_arr);
|
||||||
|
var hexa_str = BitConverter.ToString(hash_arr);
|
||||||
|
return hexa_str.Replace("-", string.Empty);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[EmailAddress]
|
||||||
|
public required string EmailAddress { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string? TotpSecretkey { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// var bytes_arr = Encoding.UTF8.GetBytes(EmailAddress.ToUpper());<br/>
|
||||||
|
/// var hash_arr = SHA256.HashData(bytes_arr);
|
||||||
|
/// var hexa_str = BitConverter.ToString(hash_arr);
|
||||||
|
/// return hexa_str.Replace("-", string.Empty);
|
||||||
|
/// </summary>
|
||||||
|
public string Signature => _sha256HexOfMail.Value;
|
||||||
|
|
||||||
|
private readonly Lazy<string> _sha256HexOfMail;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default value is DateTime.Now
|
||||||
|
/// </summary>
|
||||||
|
public DateTime AddedWhen { get; } = DateTime.Now;
|
||||||
|
};
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
using EnvelopeGenerator.Application.Dto.EnvelopeReceiver;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Dto.Receiver;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public class ReceiverReadDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </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;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string? TotpSecretkey { get; set; } = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? TfaRegDeadline { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public override int GetHashCode()
|
||||||
|
{
|
||||||
|
return Id.GetHashCode();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Dto.Receiver;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data Transfer Object for updating a receiver's information.
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
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; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
using EnvelopeGenerator.Domain;
|
||||||
|
using MediatR;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.EmailTemplates.Commands.Reset;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 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.<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>
|
||||||
|
public record ResetEmailTemplateCommand : EmailTemplateQuery, IRequest
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="orginal"></param>
|
||||||
|
public ResetEmailTemplateCommand(EmailTemplateQuery? orginal = null) : base(orginal ?? new())
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <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>
|
||||||
|
public ResetEmailTemplateCommand(int? Id = null, Constants.EmailTemplateType? Type = null) : base(Id, Type)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,114 @@
|
|||||||
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
|
using EnvelopeGenerator.Application.Dto;
|
||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
using MediatR;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.EmailTemplates.Commands.Reset;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class ResetEmailTemplateCommandHandler : IRequestHandler<ResetEmailTemplateCommand>
|
||||||
|
{
|
||||||
|
private readonly IRepository<EmailTemplate> _repository;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="repository"></param>
|
||||||
|
public ResetEmailTemplateCommandHandler(IRepository<EmailTemplate> repository)
|
||||||
|
{
|
||||||
|
_repository = repository;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="cancel"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[Obsolete("Use Read-method returning IReadQuery<TEntity> instead.")]
|
||||||
|
public async Task Handle(ResetEmailTemplateCommand request, CancellationToken cancel)
|
||||||
|
{
|
||||||
|
var temps = request.Id is not null
|
||||||
|
? await _repository.ReadAllAsync<EmailTemplateDto>(t => t.Id == request.Id, cancel)
|
||||||
|
: request.Type is not null
|
||||||
|
? await _repository.ReadAllAsync<EmailTemplateDto>(t => t.Name == request.Type.ToString(), cancel)
|
||||||
|
: await _repository.ReadAllAsync<EmailTemplateDto>(cancellation: cancel);
|
||||||
|
|
||||||
|
foreach (var temp in temps)
|
||||||
|
{
|
||||||
|
var def = Defaults.Where(t => t.Name == temp.Name).FirstOrDefault();
|
||||||
|
if(def is not null)
|
||||||
|
await _repository.UpdateAsync(def, t => t.Id == temp.Id, cancel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public static readonly IEnumerable<EmailTemplateDto> Defaults = new List<EmailTemplateDto>()
|
||||||
|
{
|
||||||
|
new(){
|
||||||
|
Id = 1,
|
||||||
|
Name = "DocumentReceived",
|
||||||
|
Body = "Guten Tag [NAME_RECEIVER],<br />\r\n<br /><B><I>\r\n[NAME_SENDER]</I></B> hat Ihnen ein Dokument zum [SIGNATURE_TYPE] gesendet.<br />\r\n<br />\r\nÜber den folgenden Link können Sie das Dokument einsehen und elektronisch unterschreiben: <a href=\"[LINK_TO_DOCUMENT]\">[LINK_TO_DOCUMENT_TEXT]</a><br />\r\n<br />\r\n[MESSAGE]<br />\r\n<br />\r\nMit freundlichen Grüßen<br />\r\n<br />\r\n[NAME_PORTAL]",
|
||||||
|
Subject = "Dokument erhalten: '[DOCUMENT_TITLE]'"
|
||||||
|
},
|
||||||
|
new(){
|
||||||
|
Id = 2,
|
||||||
|
Name = "DocumentDeleted",
|
||||||
|
Body = "Guten Tag [NAME_RECEIVER],<br />\r\n<br /><B><I>\r\n[NAME_SENDER]</I></B> hat den Umschlag <B><I>'[DOCUMENT_TITLE]'</I></B> gelöscht/zurückgezogen.<br /><p>\rBegründung: <br /> <I>[REASON]</I> <p>\r\n<br />\r\nMit freundlichen Grüßen<br />\r\n<br />\r\n[NAME_PORTAL]",
|
||||||
|
Subject = "Umschlag zurückgezogen: '[DOCUMENT_TITLE]'"
|
||||||
|
},
|
||||||
|
new(){
|
||||||
|
Id = 3,
|
||||||
|
Name = "DocumentSigned",
|
||||||
|
Body = "Guten Tag [NAME_RECEIVER],<br />\r\n<br />\r\nhiermit bestätigen wir Ihnen die erfolgreiche Signatur für den Vorgang <B><I>'[DOCUMENT_TITLE]'</I></B>.<br />\r\nWenn alle Vertragspartner unterzeichnet haben, erhalten Sie ebenfalls per email ein unterschriebenes Exemplar mit dem Signierungszertifikat!\r\n<br />\r\nMit freundlichen Grüßen<br />\r\n<br />\r\n[NAME_PORTAL]",
|
||||||
|
Subject = "Dokument unterschrieben: '[DOCUMENT_TITLE]'"
|
||||||
|
},
|
||||||
|
new(){
|
||||||
|
Id = 4,
|
||||||
|
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 EmailAddress.<br />\r\n<br />\r\nMit freundlichen Grüßen<br />\r\n<br />\r\n[NAME_PORTAL]",
|
||||||
|
Subject = "Umschlag abgeschlossen: '[DOCUMENT_TITLE]'"
|
||||||
|
},
|
||||||
|
new(){
|
||||||
|
Id = 5,
|
||||||
|
Name = "DocumentAccessCodeReceived",
|
||||||
|
Body = "Guten Tag [NAME_RECEIVER],<br />\r\n<br /><B><I>\r\n[NAME_SENDER]</I></B> hat Ihnen ein Dokument zum [SIGNATURE_TYPE] gesendet. <br />\r\n<br />\r\nVerwenden Sie den folgenden Zugriffscode, um das Dokument einzusehen:<br />\r\n<br />\r\n[DOCUMENT_ACCESS_CODE]<br />\r\n<br />\r\nMit freundlichen Grüßen<br />\r\n<br />\r\n[NAME_PORTAL]",
|
||||||
|
Subject = "Zugriffscode für Dokument erhalten: '[DOCUMENT_TITLE]'"
|
||||||
|
},
|
||||||
|
new(){
|
||||||
|
Id = 6,
|
||||||
|
Name = "DocumentRejected_ADM",
|
||||||
|
Body = "Guten Tag [NAME_SENDER],<p><B><I>[NAME_RECEIVER]</I></B> hat den Umschlag <B><I>'[DOCUMENT_TITLE]'</I></B> mit folgendem Grund abgelehnt: <p>\r\n[REASON] \r\n<p>Der Umschlag wurde auf den Status Rejected gesetzt. <p> \r\nMit freundlichen Grüßen<br />\r\n<br />\r\n[NAME_PORTAL]",
|
||||||
|
Subject = "'[DOCUMENT_TITLE]' - Unterzeichnungsvorgang zurückgezogen"
|
||||||
|
},
|
||||||
|
new(){
|
||||||
|
Id = 9,
|
||||||
|
Name = "DocumentRejected_REC",
|
||||||
|
Body = "Guten Tag [NAME_RECEIVER],\r\n<p>Hiermit bestätigen wir Ihnen die Ablehnung des Unterzeichnungsvorganges <B><I>'[DOCUMENT_TITLE]'</I></B>!<p>Der Vertragsinhaber <B><I>[NAME_SENDER]</I></B> wurde über die Ablehnung informiert. <p> \r\nMit freundlichen Grüßen<br />\r\n<br />\r\n[NAME_PORTAL]",
|
||||||
|
Subject = "'[DOCUMENT_TITLE]' - Bestätigung Ablehnung"
|
||||||
|
},
|
||||||
|
new(){
|
||||||
|
Id = 10,
|
||||||
|
Name = "DocumentRejected_REC_2",
|
||||||
|
Body = "Guten Tag [NAME_RECEIVER],\r\n<p>Der Unterzeichnungsvorganges <B><I>'[DOCUMENT_TITLE]'</I></B> wurde durch einen anderen Vertragspartner abgelehnt! Ihre notwendige Unterzeichnung wurde verworfen.<p> Der Vertragsinhaber <B><I>[NAME_SENDER]</I></B> wird sich bei Bedarf mit Ihnen in Verbindung setzen. <p> \r\nMit freundlichen Grüßen<br />\r\n<br />\r\n[NAME_PORTAL]",
|
||||||
|
Subject = "'[DOCUMENT_TITLE]' - Unterzeichnungsvorgang abgelehnt."
|
||||||
|
},
|
||||||
|
new(){
|
||||||
|
Id = 11,
|
||||||
|
Name = "DocumentShared",
|
||||||
|
Body = "Guten Tag,<br /> <br /><B><I> [NAME_RECEIVER]</I></B> hat Ihnen ein Dokument zum Ansehen gesendet.<br /> <br /> Über den folgenden Link können Sie das Dokument einsehen: <a href=\"[LINK_TO_DOCUMENT]\">[LINK_TO_DOCUMENT_TEXT]</a><br /> <br /> <br /> Mit freundlichen Grüßen<br /> <br /> [NAME_PORTAL]",
|
||||||
|
Subject = "Dokument geteilt: '[DOCUMENT_TITLE]'"
|
||||||
|
},
|
||||||
|
new(){
|
||||||
|
Id = 12,
|
||||||
|
Name = "TotpSecret",
|
||||||
|
Body = "Guten Tag,<br /> <br />Sie können auf Ihren Zwei-Faktor-Authentifizierungscode zugreifen, indem Sie den unten stehenden QR-Code mit einer beliebigen Authentifizierungs-App auf Ihrem Telefon scannen (Google Authenticator, Microsoft Authenticator usw.). Dieser Code ist bis zum [TFA_EXPIRATION] gültig.<br /> <br /> <img src=\"data:image/png;base64,[TFA_QR_CODE]\" style=\"width: 13rem; height: 13rem;\"><br /> <br />\r\n<br /> Mit freundlichen Grüßen<br /> <br /> [NAME_PORTAL]",
|
||||||
|
Subject = "2-Faktor-Verifizierung QR-Code"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
using EnvelopeGenerator.Common;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.EmailTemplates.Commands.Reset;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 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.
|
|
||||||
/// </summary>
|
|
||||||
/// <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). 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 ResetEnvelopeTemplateCommand(int? Id, Constants.EmailTemplateType? Type) : EmailTemplateQuery(Id, Type);
|
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using System.Text.Json.Serialization;
|
using MediatR;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.EmailTemplates.Commands.Update;
|
namespace EnvelopeGenerator.Application.EmailTemplates.Commands.Update;
|
||||||
|
|
||||||
@@ -12,11 +13,17 @@ namespace EnvelopeGenerator.Application.EmailTemplates.Commands.Update;
|
|||||||
/// <param name="Subject">
|
/// <param name="Subject">
|
||||||
/// (Optional) Der neue Betreff der E-Mail. Wenn null, bleibt der vorhandene Betreff unverändert.
|
/// (Optional) Der neue Betreff der E-Mail. Wenn null, bleibt der vorhandene Betreff unverändert.
|
||||||
/// </param>
|
/// </param>
|
||||||
public record UpdateEmailTemplateCommand(string? Body = null, string? Subject = null)
|
public record UpdateEmailTemplateCommand(string? Body = null, string? Subject = null) : IRequest
|
||||||
{
|
{
|
||||||
/// <param>
|
/// <param>
|
||||||
/// Die Abfrage, die die E-Mail-Vorlage darstellt, die aktualisiert werden soll.
|
/// Die Abfrage, die die E-Mail-Vorlage darstellt, die aktualisiert werden soll.
|
||||||
/// </param>
|
/// </param>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public EmailTemplateQuery? EmailTemplateQuery { get; set; }
|
public EmailTemplateQuery? EmailTemplateQuery { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[JsonIgnore]
|
||||||
|
public DateTime ChangedWhen { get; init; } = DateTime.Now;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,65 @@
|
|||||||
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
|
using EnvelopeGenerator.Application.Dto;
|
||||||
|
using EnvelopeGenerator.Application.Exceptions;
|
||||||
|
using EnvelopeGenerator.Domain;
|
||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
using MediatR;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.EmailTemplates.Commands.Update;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class UpdateEmailTemplateCommandHandler : IRequestHandler<UpdateEmailTemplateCommand>
|
||||||
|
{
|
||||||
|
private readonly IRepository<EmailTemplate> _repository;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="repository"></param>
|
||||||
|
public UpdateEmailTemplateCommandHandler(IRepository<EmailTemplate> repository)
|
||||||
|
{
|
||||||
|
_repository = repository;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="cancel"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="InvalidOperationException"></exception>
|
||||||
|
/// <exception cref="NotFoundException"></exception>
|
||||||
|
[Obsolete("Use Read-method returning IReadQuery<TEntity> instead.")]
|
||||||
|
public async Task Handle(UpdateEmailTemplateCommand request, CancellationToken cancel)
|
||||||
|
{
|
||||||
|
EmailTemplateDto? temp;
|
||||||
|
|
||||||
|
if (request.EmailTemplateQuery?.Id is int id)
|
||||||
|
{
|
||||||
|
temp = await _repository.ReadOrDefaultAsync<EmailTemplateDto>(t => t.Id == id, single: false, cancel);
|
||||||
|
}
|
||||||
|
else if (request!.EmailTemplateQuery!.Type is Constants.EmailTemplateType type)
|
||||||
|
{
|
||||||
|
temp = await _repository.ReadOrDefaultAsync<EmailTemplateDto>(t => t.Name == type.ToString(), single: false, cancel);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException("Both id and type is null. Id: " + request.EmailTemplateQuery.Id +". Type: " + request.EmailTemplateQuery.Type.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (temp == null)
|
||||||
|
{
|
||||||
|
throw new NotFoundException();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (request.Body is not null)
|
||||||
|
temp.Body = request.Body;
|
||||||
|
|
||||||
|
if (request.Subject is not null)
|
||||||
|
temp.Subject = request.Subject;
|
||||||
|
|
||||||
|
await _repository.UpdateAsync(temp, t => t.Id == temp.Id, cancel);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
using EnvelopeGenerator.Common;
|
using EnvelopeGenerator.Domain;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.EmailTemplates;
|
namespace EnvelopeGenerator.Application.EmailTemplates;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
using AutoMapper;
|
||||||
|
using EnvelopeGenerator.Application.EmailTemplates.Queries.Read;
|
||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.EmailTemplates;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class MappingProfile : Profile
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public MappingProfile()
|
||||||
|
{
|
||||||
|
CreateMap<EmailTemplate, ReadEmailTemplateResponse>();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,10 +1,12 @@
|
|||||||
namespace EnvelopeGenerator.Application.EmailTemplates.Queries.Read;
|
using MediatR;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.EmailTemplates.Queries.Read;
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Stellt eine Abfrage dar, um eine E-Mail-Vorlage zu lesen.
|
/// Stellt eine Abfrage dar, um eine E-Mail-Vorlage zu lesen.
|
||||||
/// Diese Klasse erbt von <see cref="EmailTemplateQuery"/>.
|
/// Diese Klasse erbt von <see cref="EmailTemplateQuery"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public record ReadEmailTemplateQuery : EmailTemplateQuery
|
public record ReadEmailTemplateQuery : EmailTemplateQuery, IRequest<ReadEmailTemplateResponse?>
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,52 @@
|
|||||||
|
using AutoMapper;
|
||||||
|
using EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
|
using EnvelopeGenerator.Domain;
|
||||||
|
using MediatR;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.EmailTemplates.Queries.Read;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class ReadEmailTemplateQueryHandler : IRequestHandler<ReadEmailTemplateQuery, ReadEmailTemplateResponse?>
|
||||||
|
{
|
||||||
|
private readonly IMapper _mapper;
|
||||||
|
|
||||||
|
[Obsolete("Use Read-method returning IReadQuery<TEntity> instead.")]
|
||||||
|
private readonly IEmailTemplateRepository _repository;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initialisiert eine neue Instanz der <see cref="EmailTemplateController"/>-Klasse.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="mapper">
|
||||||
|
/// <param name="repository">
|
||||||
|
/// Die AutoMapper-Instanz, die zum Zuordnen von Objekten verwendet wird.
|
||||||
|
/// </param>
|
||||||
|
[Obsolete("Use Read-method returning IReadQuery<TEntity> instead.")]
|
||||||
|
public ReadEmailTemplateQueryHandler(IMapper mapper, IEmailTemplateRepository repository)
|
||||||
|
{
|
||||||
|
_mapper = mapper;
|
||||||
|
_repository = repository;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="InvalidOperationException"></exception>
|
||||||
|
[Obsolete("Use IRepository")]
|
||||||
|
public async Task<ReadEmailTemplateResponse?> Handle(ReadEmailTemplateQuery request, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
var temp = request.Id is int id
|
||||||
|
? await _repository.ReadByIdAsync(id)
|
||||||
|
: request.Type is Constants.EmailTemplateType type
|
||||||
|
? await _repository.ReadByNameAsync(type)
|
||||||
|
: throw new InvalidOperationException("Either a valid integer ID or a valid EmailTemplateType must be provided in the request.");
|
||||||
|
|
||||||
|
var res = _mapper.Map<ReadEmailTemplateResponse>(temp);
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user