Compare commits
290 Commits
854ed45abd
...
feat/envel
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
891f6368f1 | ||
|
|
e6011b6201 | ||
|
|
8b86114998 | ||
|
|
c20b115faf | ||
|
|
2c8ccd3e7c | ||
|
|
b1f771c320 | ||
|
|
425645a610 | ||
|
|
24e6ffc5ef | ||
|
|
1dd9ce6bbc | ||
|
|
e528fa6409 | ||
|
|
6440dd09d1 | ||
|
|
869493bd97 | ||
|
|
1cb9042736 | ||
|
|
c9410a1e2e | ||
|
|
c4f0ce7d4b | ||
|
|
dc83486032 | ||
|
|
2a64091c87 | ||
|
|
f65f749208 | ||
|
|
0b6ed00062 | ||
|
|
e87c976e19 | ||
|
|
f31ece3a59 | ||
|
|
cfd08602ab | ||
|
|
4b7152b272 | ||
|
|
5117a66c81 | ||
|
|
83794d4bbc | ||
|
|
76f74778b4 | ||
|
|
ded3425e31 | ||
|
|
738b379fe5 | ||
|
|
cf8b28441f | ||
|
|
0eb5897185 | ||
|
|
25cd1601a6 | ||
|
|
42e4d110ad | ||
|
|
2538f34892 | ||
|
|
3ce11f4cc7 | ||
|
|
f2cd34a79e | ||
|
|
5f923ad485 | ||
|
|
8f70f085d3 | ||
|
|
d6c09ed31a | ||
|
|
7d3ee1331d | ||
|
|
cd5b90a1e2 | ||
|
|
ac861f5fa0 | ||
|
|
c1d8f817bb | ||
|
|
da28a7332b | ||
|
|
bfd4e6a8ed | ||
|
|
b4e0e4b6b2 | ||
|
|
e37caf5c8f | ||
|
|
e95cf24af7 | ||
|
|
524a72caa0 | ||
|
|
1919c562cc | ||
|
|
62b54d6e75 | ||
|
|
efa9160c04 | ||
|
|
bc6955055a | ||
|
|
dc997d5ff2 | ||
|
|
a32f495038 | ||
|
|
210466883c | ||
|
|
728385b70a | ||
|
|
792aa0b922 | ||
|
|
6847b74095 | ||
|
|
54e86b421c | ||
|
|
370666cb0e | ||
|
|
e17f7df930 | ||
|
|
0e91df7acc | ||
|
|
ad26230da5 | ||
|
|
a103f34230 | ||
|
|
806bd3b248 | ||
|
|
c69c39fa44 | ||
|
|
b6badb44af | ||
|
|
b2195ce13f | ||
|
|
f3cb9b8510 | ||
|
|
8edfecb9dc | ||
|
|
c123d103bb | ||
|
|
b92d9da387 | ||
|
|
8841698aab | ||
|
|
6f140f16cd | ||
|
|
8bfd31997b | ||
|
|
4a1459d708 | ||
|
|
361bdeb2b2 | ||
|
|
9ce5af7cd0 | ||
|
|
84fa9e6e7c | ||
|
|
36916ed5c8 | ||
|
|
fb366d3e0b | ||
|
|
e82be8b6a5 | ||
|
|
07320af4ee | ||
|
|
73eb270237 | ||
|
|
222684cfc8 | ||
|
|
3974d2123e | ||
|
|
b837a63b34 | ||
|
|
461316713a | ||
|
|
185af3210b | ||
|
|
e4620b5469 | ||
|
|
5c4acd17a0 | ||
|
|
fc171e5b89 | ||
|
|
662faf2512 | ||
|
|
2fb8af9a4f | ||
|
|
017d03713b | ||
|
|
5f5180d937 | ||
|
|
6b3e6cd6f5 | ||
|
|
f95f3c7b1b | ||
|
|
316b62083c | ||
|
|
530b63f299 | ||
|
|
2f228de163 | ||
|
|
e5e64b25fe | ||
|
|
2d5dde177c | ||
|
|
ce0ad4ba61 | ||
|
|
ebd7c5d6a4 | ||
|
|
341da273c9 | ||
|
|
73d2a43a95 | ||
|
|
eee18889d6 | ||
|
|
590d7fb717 | ||
|
|
dd28ef7ab6 | ||
|
|
36fb033adc | ||
|
|
4275f25f4a | ||
|
|
30b5633498 | ||
|
|
00545fdc50 | ||
|
|
d80e511b08 | ||
|
|
7313355a83 | ||
|
|
66466dc865 | ||
|
|
8cd8df4b02 | ||
|
|
dd7454d38e | ||
|
|
f7c3ed280a | ||
|
|
9ffeb7afe8 | ||
|
|
a83994af43 | ||
|
|
8345034fcd | ||
|
|
a763d3c353 | ||
|
|
5ba5d2755b | ||
|
|
d6bcb8c43d | ||
|
|
2aa2064a67 | ||
|
|
f403d12073 | ||
|
|
b66c2f67da | ||
|
|
d084a4cd81 | ||
|
|
5d2bf56493 | ||
|
|
cd88f5c833 | ||
|
|
ab41e25071 | ||
|
|
eb775da7d4 | ||
|
|
7bc2695da4 | ||
|
|
75fff426bc | ||
|
|
4172df4d78 | ||
|
|
01856b61ef | ||
|
|
2e32559132 | ||
|
|
9adb49df78 | ||
|
|
18e21b0a8e | ||
|
|
e1d7d0e141 | ||
|
|
cfa40e640b | ||
|
|
cb0a45bc17 | ||
|
|
c7b6e5bf24 | ||
|
|
a9ca1b71eb | ||
|
|
97f07bc72d | ||
|
|
8753875d93 | ||
|
|
3692aa80a4 | ||
|
|
b8b09ded5d | ||
|
|
5b8d8b9e55 | ||
|
|
e3fbf4fc77 | ||
|
|
8d680992b7 | ||
|
|
01247f73f4 | ||
|
|
6a7a3dcb90 | ||
|
|
2fbfbb4eb6 | ||
|
|
f88b5d2733 | ||
|
|
363358aaa1 | ||
|
|
7444eeba2a | ||
|
|
e9d686a4c1 | ||
|
|
939ba1bb47 | ||
|
|
d5de868eb9 | ||
|
|
6e3bb6c3a0 | ||
|
|
d347ec420c | ||
|
|
a011b677ea | ||
|
|
8831436809 | ||
|
|
1ededc1f64 | ||
|
|
183c94fd0a | ||
|
|
8629599f86 | ||
|
|
a0a5568d93 | ||
|
|
d166ae5a8b | ||
|
|
145d139e3a | ||
|
|
d3ce34ee31 | ||
|
|
fd61d4431f | ||
|
|
93417d1b37 | ||
|
|
ca3ea36a83 | ||
|
|
c59d9bbf57 | ||
|
|
0cf1cd10c0 | ||
|
|
1da73d1754 | ||
|
|
24037f8366 | ||
|
|
91b891513f | ||
|
|
e7d1f1574f | ||
|
|
80a3a26af8 | ||
|
|
9905ea5a12 | ||
|
|
a7a77cd491 | ||
|
|
f795b1447f | ||
|
|
e5e12bfb61 | ||
|
|
6a8baf08ed | ||
|
|
10ac34a9f7 | ||
|
|
72af1cc2a2 | ||
|
|
cd32ae2a35 | ||
|
|
ddc0c9c6f3 | ||
|
|
489c2a2a9f | ||
|
|
320e81719b | ||
|
|
66a8471f05 | ||
|
|
c7a4ef4722 | ||
|
|
1673ea81df | ||
|
|
306956a7be | ||
|
|
bfe3d38ecc | ||
|
|
6e5bb58f65 | ||
|
|
b96c6c10f8 | ||
|
|
afedfdd596 | ||
|
|
3a7099feb4 | ||
|
|
c704d222f0 | ||
|
|
83ce528e2f | ||
|
|
9cc15f9beb | ||
|
|
d323244157 | ||
|
|
56d35c65bb | ||
|
|
15eabfc834 | ||
|
|
11e8c46e44 | ||
|
|
a14bd78415 | ||
|
|
609f7d09fc | ||
|
|
4c21cb4ba7 | ||
|
|
00ebf45605 | ||
|
|
387777972b | ||
|
|
b7569982ff | ||
|
|
d6be88b61d | ||
|
|
8e454a0419 | ||
|
|
f8932e14c0 | ||
|
|
812bf9b25a | ||
|
|
0d591d5350 | ||
|
|
c9712af73e | ||
|
|
da483706b1 | ||
|
|
4b600cb190 | ||
|
|
25a56a22fa | ||
|
|
4e81f0949c | ||
|
|
18e79cf516 | ||
|
|
fad0a6070c | ||
|
|
755fcfeef2 | ||
|
|
40739b598b | ||
|
|
9782503d1d | ||
|
|
35ced9b9ad | ||
|
|
9b28c0a1d1 | ||
|
|
fd19c5be58 | ||
|
|
58b13e233c | ||
|
|
ce55066208 | ||
|
|
7d582d2422 | ||
|
|
fe1d553a8d | ||
|
|
99c05a44f5 | ||
|
|
678360953d | ||
|
|
9867e81220 | ||
|
|
49cfc3c044 | ||
|
|
43ae15b71c | ||
|
|
1c2df71e0f | ||
|
|
a806ec27db | ||
|
|
14bd2e22fc | ||
|
|
f94728bf67 | ||
|
|
caeaf1774e | ||
|
|
1388b40a6b | ||
|
|
e44d5f644c | ||
|
|
fe9fd3024e | ||
|
|
b664e35b11 | ||
|
|
a77a31121f | ||
|
|
381de6b554 | ||
|
|
13bd727b3e | ||
|
|
9021291aef | ||
|
|
8bd7ab13d0 | ||
|
|
8eefd94569 | ||
|
|
b3b2baf0e4 | ||
|
|
836380048a | ||
|
|
f105aaa567 | ||
|
|
6238d66ca2 | ||
|
|
7e325a7eb6 | ||
|
|
c91446c5ac | ||
| eaf4cd773d | |||
| 8950482bac | |||
|
|
b615446274 | ||
|
|
f276735b5c | ||
|
|
31aa5829f6 | ||
| 27a5538229 | |||
| 322fb2fd7e | |||
| 8e33094806 | |||
| 54b246f8e4 | |||
|
|
5c51ea679e | ||
|
|
e264a10a36 | ||
| 2f8aed8640 | |||
| 29eac347c3 | |||
|
|
dd6ab13e6e | ||
|
|
d94d9f045e | ||
|
|
12bfcb1f25 | ||
|
|
63613f2073 | ||
|
|
1c11a0e8f0 | ||
|
|
d376065246 | ||
|
|
4166dfde4b | ||
|
|
1bc43a5a77 | ||
|
|
33f4c6e489 | ||
|
|
a4b880f1d2 | ||
| a7f38eafb2 | |||
| 67a8506a37 | |||
|
|
ecec1e1206 |
@@ -0,0 +1,13 @@
|
|||||||
|
namespace EnvelopeGenerator.Application.Configurations
|
||||||
|
{
|
||||||
|
public class DispatcherConfig
|
||||||
|
{
|
||||||
|
public int SendingProfile { get; init; } = 1;
|
||||||
|
|
||||||
|
public string AddedWho { get; init; } = "DDEnvelopGenerator";
|
||||||
|
|
||||||
|
public int ReminderTypeId { get; init; } = 202377;
|
||||||
|
|
||||||
|
public string EmailAttmt1 { get; init; } = string.Empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
namespace EnvelopeGenerator.Application.Configurations
|
||||||
|
{
|
||||||
|
public class MailConfig
|
||||||
|
{
|
||||||
|
public required Dictionary<string, string> Placeholders { get; init; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,12 +1,11 @@
|
|||||||
using DigitalData.Core.Contracts.Application;
|
using DigitalData.Core.Abstractions.Application;
|
||||||
using DigitalData.Core.DTO;
|
using DigitalData.Core.DTO;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts
|
namespace EnvelopeGenerator.Application.Contracts
|
||||||
{
|
{
|
||||||
public interface IConfigService : IBasicCRUDService<ConfigDto, Config, int>
|
public interface IConfigService : IReadService<ConfigDto, Config, int>
|
||||||
{
|
{
|
||||||
Task<DataResult<ConfigDto>> ReadFirstAsync();
|
Task<DataResult<ConfigDto>> ReadFirstAsync();
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
using DigitalData.Core.Contracts.Application;
|
using DigitalData.Core.Abstractions.Application;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts
|
namespace EnvelopeGenerator.Application.Contracts
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
using DigitalData.Core.Contracts.Application;
|
using DigitalData.Core.Abstractions.Application;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts
|
namespace EnvelopeGenerator.Application.Contracts
|
||||||
{
|
{
|
||||||
public interface IDocumentStatusService : IBasicCRUDService<DocumentStatusDto, DocumentStatus, int>
|
public interface IDocumentStatusService : IBasicCRUDService<DocumentStatusDto, DocumentStatus, int>
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
using DigitalData.Core.Contracts.Application;
|
using DigitalData.Core.Abstractions.Application;
|
||||||
using DigitalData.Core.DTO;
|
using DigitalData.Core.DTO;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
|
||||||
using static EnvelopeGenerator.Common.Constants;
|
using static EnvelopeGenerator.Common.Constants;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts
|
namespace EnvelopeGenerator.Application.Contracts
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
using DigitalData.Core.Contracts.Application;
|
using DigitalData.Core.Abstractions.Application;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts
|
namespace EnvelopeGenerator.Application.Contracts
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
using DigitalData.Core.Contracts.Application;
|
using DigitalData.Core.Abstractions.Application;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts
|
namespace EnvelopeGenerator.Application.Contracts
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
using DigitalData.Core.Contracts.Application;
|
using DigitalData.Core.Abstractions.Application;
|
||||||
using DigitalData.Core.DTO;
|
using DigitalData.Core.DTO;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
|
||||||
using EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
|
using EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
|
||||||
|
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
|
||||||
using static EnvelopeGenerator.Common.Constants;
|
using static EnvelopeGenerator.Common.Constants;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts
|
namespace EnvelopeGenerator.Application.Contracts
|
||||||
@@ -22,7 +21,7 @@ namespace EnvelopeGenerator.Application.Contracts
|
|||||||
|
|
||||||
Task<IEnumerable<EnvelopeHistoryDto>> ReadRejectedAsync(int envelopeId, string? userReference = null);
|
Task<IEnumerable<EnvelopeHistoryDto>> ReadRejectedAsync(int envelopeId, string? userReference = null);
|
||||||
|
|
||||||
Task<IEnumerable<ReceiverDto>> ReadRejectingReceivers(int envelopeId);
|
Task<IEnumerable<ReceiverReadDto>> ReadRejectingReceivers(int envelopeId);
|
||||||
|
|
||||||
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,6 +1,7 @@
|
|||||||
using DigitalData.Core.DTO;
|
using DigitalData.Core.DTO;
|
||||||
using DigitalData.EmailProfilerDispatcher.Application.Contracts;
|
using DigitalData.EmailProfilerDispatcher.Abstraction.Contracts;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
||||||
|
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
|
||||||
using EnvelopeGenerator.Common;
|
using EnvelopeGenerator.Common;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts
|
namespace EnvelopeGenerator.Application.Contracts
|
||||||
@@ -8,6 +9,9 @@ namespace EnvelopeGenerator.Application.Contracts
|
|||||||
public interface IEnvelopeMailService : IEmailOutService
|
public interface IEnvelopeMailService : IEmailOutService
|
||||||
{
|
{
|
||||||
Task<DataResult<int>> SendAsync(EnvelopeReceiverDto envelopeReceiverDto, Constants.EmailTemplateType tempType);
|
Task<DataResult<int>> SendAsync(EnvelopeReceiverDto envelopeReceiverDto, Constants.EmailTemplateType tempType);
|
||||||
|
|
||||||
|
Task<DataResult<int>> SendAsync(EnvelopeReceiverReadOnlyDto dto);
|
||||||
|
|
||||||
Task<DataResult<int>> SendAccessCodeAsync(EnvelopeReceiverDto envelopeReceiverDto);
|
Task<DataResult<int>> SendAccessCodeAsync(EnvelopeReceiverDto envelopeReceiverDto);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
using DigitalData.Core.Abstractions.Application;
|
||||||
|
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
|
||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Contracts
|
||||||
|
{
|
||||||
|
public interface IEnvelopeReceiverReadOnlyService : ICRUDService<EnvelopeReceiverReadOnlyCreateDto, EnvelopeReceiverReadOnlyDto, EnvelopeReceiverReadOnlyUpdateDto, EnvelopeReceiverReadOnly, long>
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,15 +1,18 @@
|
|||||||
using DigitalData.Core.Contracts.Application;
|
using DigitalData.Core.Abstractions.Application;
|
||||||
using DigitalData.Core.DTO;
|
using DigitalData.Core.DTO;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
||||||
|
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts
|
namespace EnvelopeGenerator.Application.Contracts
|
||||||
{
|
{
|
||||||
public interface IEnvelopeReceiverService : IBasicCRUDService<EnvelopeReceiverDto, EnvelopeReceiver, object>
|
public interface IEnvelopeReceiverService : IBasicCRUDService<EnvelopeReceiverDto, EnvelopeReceiver, (int Envelope, int Receiver)>
|
||||||
{
|
{
|
||||||
|
|
||||||
Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUuidAsync(string uuid, bool withEnvelope = true, bool withReceiver = false);
|
Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUuidAsync(string uuid, bool withEnvelope = true, bool withReceiver = false);
|
||||||
|
|
||||||
|
Task<DataResult<IEnumerable<EnvelopeReceiverSecretDto>>> ReadSecretByUuidAsync(string uuid, bool withEnvelope = false, bool withReceiver = true);
|
||||||
|
|
||||||
Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadBySignatureAsync(string signature, bool withEnvelope = false, bool withReceiver = true);
|
Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadBySignatureAsync(string signature, bool withEnvelope = false, bool withReceiver = true);
|
||||||
|
|
||||||
Task<DataResult<EnvelopeReceiverDto>> ReadByUuidSignatureAsync(string uuid, string signature, bool withEnvelope = true, bool withReceiver = true);
|
Task<DataResult<EnvelopeReceiverDto>> ReadByUuidSignatureAsync(string uuid, string signature, bool withEnvelope = true, bool withReceiver = true);
|
||||||
@@ -24,6 +27,8 @@ namespace EnvelopeGenerator.Application.Contracts
|
|||||||
|
|
||||||
Task<DataResult<bool>> IsExisting(string envelopeReceiverId);
|
Task<DataResult<bool>> IsExisting(string envelopeReceiverId);
|
||||||
|
|
||||||
Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUsernameAsync(string username);
|
Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUsernameAsync(string username, int? min_status = null, int? max_status = null, params int[] ignore_statuses);
|
||||||
|
|
||||||
|
Task<DataResult<string?>> ReadLastUsedReceiverNameByMail(string mail);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
using DigitalData.Core.Contracts.Application;
|
using DigitalData.Core.Abstractions.Application;
|
||||||
using DigitalData.Core.DTO;
|
using DigitalData.Core.DTO;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts
|
namespace EnvelopeGenerator.Application.Contracts
|
||||||
{
|
{
|
||||||
@@ -11,5 +10,7 @@ namespace EnvelopeGenerator.Application.Contracts
|
|||||||
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);
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
|
Task<DataResult<IEnumerable<EnvelopeDto>>> ReadByUserAsync(int userId, int? min_status = null, int? max_status = null, params int[]ignore_statuses);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
using DigitalData.Core.Contracts.Application;
|
using DigitalData.Core.Abstractions.Application;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts
|
namespace EnvelopeGenerator.Application.Contracts
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
using DigitalData.Core.Contracts.Application;
|
using DigitalData.Core.Abstractions.Application;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using DigitalData.Core.DTO;
|
||||||
|
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts
|
namespace EnvelopeGenerator.Application.Contracts
|
||||||
{
|
{
|
||||||
public interface IReceiverService : IBasicCRUDService<ReceiverDto, Receiver, int>
|
public interface IReceiverService : ICRUDService<ReceiverCreateDto, ReceiverReadDto, ReceiverUpdateDto, Receiver, int>
|
||||||
{
|
{
|
||||||
|
public Task<DataResult<ReceiverReadDto>> ReadByAsync(string? emailAddress = null, string? signature = null);
|
||||||
|
|
||||||
|
public Task<Result> DeleteByAsync(string? emailAddress = null, string? signature = null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
using DigitalData.Core.Contracts.Application;
|
using DigitalData.Core.Abstractions.Application;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts
|
namespace EnvelopeGenerator.Application.Contracts
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,21 +1,18 @@
|
|||||||
using DigitalData.UserManager.Application.MappingProfiles;
|
using DigitalData.UserManager.Application.MappingProfiles;
|
||||||
using EnvelopeGenerator.Application.Contracts;
|
using EnvelopeGenerator.Application.Contracts;
|
||||||
using EnvelopeGenerator.Application.MappingProfiles;
|
using EnvelopeGenerator.Application.MappingProfiles;
|
||||||
|
using EnvelopeGenerator.Application.Configurations;
|
||||||
using EnvelopeGenerator.Application.Services;
|
using EnvelopeGenerator.Application.Services;
|
||||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
using EnvelopeGenerator.Infrastructure.Contracts;
|
||||||
using EnvelopeGenerator.Infrastructure.Repositories;
|
using EnvelopeGenerator.Infrastructure.Repositories;
|
||||||
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application
|
namespace EnvelopeGenerator.Application
|
||||||
{
|
{
|
||||||
public static class DIExtensions
|
public static class DIExtensions
|
||||||
{
|
{
|
||||||
public static IServiceCollection AddEnvelopeGenerator(this IServiceCollection services)
|
public static IServiceCollection AddEnvelopeGenerator(this IServiceCollection services, IConfiguration dispatcherConfigSection, IConfiguration mailConfigSection)
|
||||||
{
|
{
|
||||||
//Inject CRUD Service and repositoriesad
|
//Inject CRUD Service and repositoriesad
|
||||||
services.AddScoped<IConfigRepository, ConfigRepository>();
|
services.AddScoped<IConfigRepository, ConfigRepository>();
|
||||||
@@ -33,6 +30,7 @@ namespace EnvelopeGenerator.Application
|
|||||||
services.AddScoped<IEnvelopeTypeRepository, EnvelopeTypeRepository>();
|
services.AddScoped<IEnvelopeTypeRepository, EnvelopeTypeRepository>();
|
||||||
services.AddScoped<IReceiverRepository, ReceiverRepository>();
|
services.AddScoped<IReceiverRepository, ReceiverRepository>();
|
||||||
services.AddScoped<IUserReceiverRepository, UserReceiverRepository>();
|
services.AddScoped<IUserReceiverRepository, UserReceiverRepository>();
|
||||||
|
services.AddScoped<IEnvelopeReceiverReadOnlyRepository, EnvelopeReceiverReadOnlyRepository>();
|
||||||
services.AddScoped<IConfigService, ConfigService>();
|
services.AddScoped<IConfigService, ConfigService>();
|
||||||
services.AddScoped<IDocumentReceiverElementService, DocumentReceiverElementService>();
|
services.AddScoped<IDocumentReceiverElementService, DocumentReceiverElementService>();
|
||||||
services.AddScoped<IEnvelopeDocumentService, EnvelopeDocumentService>();
|
services.AddScoped<IEnvelopeDocumentService, EnvelopeDocumentService>();
|
||||||
@@ -46,12 +44,20 @@ namespace EnvelopeGenerator.Application
|
|||||||
services.AddScoped<IEnvelopeTypeService, EnvelopeTypeService>();
|
services.AddScoped<IEnvelopeTypeService, EnvelopeTypeService>();
|
||||||
services.AddScoped<IReceiverService, ReceiverService>();
|
services.AddScoped<IReceiverService, ReceiverService>();
|
||||||
services.AddScoped<IUserReceiverService, UserReceiverService>();
|
services.AddScoped<IUserReceiverService, UserReceiverService>();
|
||||||
|
services.AddScoped<IEnvelopeReceiverReadOnlyService, EnvelopeReceiverReadOnlyService>();
|
||||||
|
|
||||||
//Auto mapping profiles
|
//Auto mapping profiles
|
||||||
services.AddAutoMapper(typeof(BasicDtoMappingProfile).Assembly);
|
services.AddAutoMapper(typeof(BasicDtoMappingProfile).Assembly);
|
||||||
services.AddAutoMapper(typeof(UserMappingProfile).Assembly);
|
services.AddAutoMapper(typeof(UserMappingProfile).Assembly);
|
||||||
|
|
||||||
|
services.Configure<DispatcherConfig>(dispatcherConfigSection);
|
||||||
|
services.Configure<MailConfig>(mailConfigSection);
|
||||||
|
|
||||||
return services;
|
return services;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static IServiceCollection AddEnvelopeGenerator(this IServiceCollection services, IConfiguration config) => services.AddEnvelopeGenerator(
|
||||||
|
dispatcherConfigSection: config.GetSection("DispatcherConfig"),
|
||||||
|
mailConfigSection: config.GetSection("MailConfig"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,7 @@
|
|||||||
namespace EnvelopeGenerator.Application.DTOs
|
using DigitalData.Core.Abstractions;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.DTOs
|
||||||
{
|
{
|
||||||
public record ConfigDto(
|
public record ConfigDto(
|
||||||
string DocumentPath,
|
string DocumentPath,
|
||||||
@@ -8,5 +11,10 @@
|
|||||||
string ExportPath,
|
string ExportPath,
|
||||||
string DocumentPathDmz,
|
string DocumentPathDmz,
|
||||||
string ExportPathDmz,
|
string ExportPathDmz,
|
||||||
string DocumentPathMoveAftsend);
|
string DocumentPathMoveAftsend) : IUnique<int>
|
||||||
|
{
|
||||||
|
[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,4 +1,6 @@
|
|||||||
namespace EnvelopeGenerator.Application.DTOs
|
using DigitalData.Core.Abstractions;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.DTOs
|
||||||
{
|
{
|
||||||
public record DocumentReceiverElementDto(
|
public record DocumentReceiverElementDto(
|
||||||
int Id,
|
int Id,
|
||||||
@@ -18,5 +20,5 @@
|
|||||||
DateTime? ChangedWhen,
|
DateTime? ChangedWhen,
|
||||||
double Top,
|
double Top,
|
||||||
double Left
|
double Left
|
||||||
);
|
): IUnique<int>;
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
namespace EnvelopeGenerator.Application.DTOs
|
using DigitalData.Core.Abstractions;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.DTOs
|
||||||
{
|
{
|
||||||
public record DocumentStatusDto(
|
public record DocumentStatusDto(
|
||||||
int Id,
|
int Id,
|
||||||
@@ -8,5 +10,5 @@
|
|||||||
DateTime? StatusChangedWhen,
|
DateTime? StatusChangedWhen,
|
||||||
string Value,
|
string Value,
|
||||||
DateTime AddedWhen,
|
DateTime AddedWhen,
|
||||||
DateTime? ChangedWhen);
|
DateTime? ChangedWhen) : IUnique<int>;
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,10 @@
|
|||||||
namespace EnvelopeGenerator.Application.DTOs
|
using DigitalData.Core.Abstractions;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.DTOs
|
||||||
{
|
{
|
||||||
public record EmailTemplateDto(
|
public record EmailTemplateDto(
|
||||||
int Id,
|
int Id,
|
||||||
string Name,
|
string Name,
|
||||||
string Body,
|
string Body,
|
||||||
string Subject);
|
string Subject) : IUnique<int>;
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
namespace EnvelopeGenerator.Application.DTOs
|
using DigitalData.Core.Abstractions;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.DTOs
|
||||||
{
|
{
|
||||||
public record EnvelopeCertificateDto(
|
public record EnvelopeCertificateDto(
|
||||||
int Id,
|
int Id,
|
||||||
@@ -8,5 +10,5 @@
|
|||||||
int CreatorId,
|
int CreatorId,
|
||||||
string CreatorName,
|
string CreatorName,
|
||||||
string CreatorEmail,
|
string CreatorEmail,
|
||||||
int EnvelopeStatus);
|
int EnvelopeStatus) : IUnique<int>;
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
namespace EnvelopeGenerator.Application.DTOs
|
using DigitalData.Core.Abstractions;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.DTOs
|
||||||
{
|
{
|
||||||
public record EnvelopeDocumentDto
|
public record EnvelopeDocumentDto
|
||||||
(
|
(
|
||||||
@@ -6,5 +8,5 @@
|
|||||||
int EnvelopeId,
|
int EnvelopeId,
|
||||||
DateTime AddedWhen,
|
DateTime AddedWhen,
|
||||||
IEnumerable<DocumentReceiverElementDto>? Elements
|
IEnumerable<DocumentReceiverElementDto>? Elements
|
||||||
);
|
) : IUnique<int>;
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,11 @@
|
|||||||
using DigitalData.EmailProfilerDispatcher.Domain.Attributes;
|
using DigitalData.Core.Abstractions;
|
||||||
|
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
|
||||||
using DigitalData.UserManager.Application.DTOs.User;
|
using DigitalData.UserManager.Application.DTOs.User;
|
||||||
using DigitalData.UserManager.Domain.Entities;
|
|
||||||
using EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs
|
namespace EnvelopeGenerator.Application.DTOs
|
||||||
{
|
{
|
||||||
public record EnvelopeDto()
|
public record EnvelopeDto() : IUnique<int>
|
||||||
{
|
{
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
|
|
||||||
@@ -14,7 +13,9 @@ namespace EnvelopeGenerator.Application.DTOs
|
|||||||
|
|
||||||
public int Status { get; set; }
|
public int Status { get; set; }
|
||||||
|
|
||||||
public string Uuid { get; set; }
|
public string StatusName { get; set; }
|
||||||
|
|
||||||
|
public string Uuid { get; set; }
|
||||||
|
|
||||||
[TemplatePlaceholder("[MESSAGE]")]
|
[TemplatePlaceholder("[MESSAGE]")]
|
||||||
public string Message { get; set; }
|
public string Message { get; set; }
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
using DigitalData.Core.DTO;
|
using DigitalData.Core.Abstractions;
|
||||||
|
using DigitalData.Core.DTO;
|
||||||
using DigitalData.UserManager.Application.DTOs.User;
|
using DigitalData.UserManager.Application.DTOs.User;
|
||||||
|
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||||
using static EnvelopeGenerator.Common.Constants;
|
using static EnvelopeGenerator.Common.Constants;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs.EnvelopeHistory
|
namespace EnvelopeGenerator.Application.DTOs.EnvelopeHistory
|
||||||
@@ -9,10 +11,11 @@ namespace EnvelopeGenerator.Application.DTOs.EnvelopeHistory
|
|||||||
int EnvelopeId,
|
int EnvelopeId,
|
||||||
string UserReference,
|
string UserReference,
|
||||||
int Status,
|
int Status,
|
||||||
|
string? StatusName,
|
||||||
DateTime AddedWhen,
|
DateTime AddedWhen,
|
||||||
DateTime? ActionDate,
|
DateTime? ActionDate,
|
||||||
UserCreateDto? Sender,
|
UserCreateDto? Sender,
|
||||||
ReceiverDto? Receiver,
|
ReceiverReadDto? Receiver,
|
||||||
ReferenceType ReferenceType,
|
ReferenceType ReferenceType,
|
||||||
string? Comment = null) : BaseDTO<long>(Id);
|
string? Comment = null) : BaseDTO<long>(Id), IUnique<long>;
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
using DigitalData.Core.Abstractions;
|
||||||
|
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiver
|
||||||
|
{
|
||||||
|
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; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiver
|
||||||
|
{
|
||||||
|
public record EnvelopeReceiverDto() : EnvelopeReceiverBasicDto()
|
||||||
|
{
|
||||||
|
public EnvelopeDto? Envelope { get; set; }
|
||||||
|
|
||||||
|
public ReceiverReadDto? Receiver { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiver
|
||||||
|
{
|
||||||
|
public record EnvelopeReceiverSecretDto(string? AccessCode) : EnvelopeReceiverDto;
|
||||||
|
}
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
using DigitalData.EmailProfilerDispatcher.Domain.Attributes;
|
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
|
||||||
using System.Text.Json.Serialization;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs
|
|
||||||
{
|
|
||||||
public record EnvelopeReceiverDto()
|
|
||||||
{
|
|
||||||
public int EnvelopeId { get; set; }
|
|
||||||
|
|
||||||
public int ReceiverId { get; set; }
|
|
||||||
|
|
||||||
public int Sequence { get; set; }
|
|
||||||
|
|
||||||
[TemplatePlaceholder("[NAME_RECEIVER]")]
|
|
||||||
public string? Name { get; set; }
|
|
||||||
|
|
||||||
public string? JobTitle { get; set; }
|
|
||||||
|
|
||||||
public string? CompanyName { get; set; }
|
|
||||||
|
|
||||||
public string? PrivateMessage { get; set; }
|
|
||||||
|
|
||||||
public DateTime AddedWhen { get; set; }
|
|
||||||
|
|
||||||
public DateTime? ChangedWhen { get; set; }
|
|
||||||
|
|
||||||
public EnvelopeDto? Envelope { get; set; }
|
|
||||||
|
|
||||||
public ReceiverDto? Receiver { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly
|
||||||
|
{
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly
|
||||||
|
{
|
||||||
|
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);
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
using DigitalData.Core.Abstractions;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly
|
||||||
|
{
|
||||||
|
public record EnvelopeReceiverReadOnlyUpdateDto(
|
||||||
|
long Id,
|
||||||
|
DateTime DateValid,
|
||||||
|
string ChangedWho) : IUnique<long>
|
||||||
|
{
|
||||||
|
public DateTime ChangedWhen { get; } = DateTime.Now;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
namespace EnvelopeGenerator.Application.DTOs
|
using DigitalData.Core.Abstractions;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.DTOs
|
||||||
{
|
{
|
||||||
public record EnvelopeTypeDto(
|
public record EnvelopeTypeDto(
|
||||||
int Id,
|
int Id,
|
||||||
@@ -15,5 +17,5 @@
|
|||||||
bool? SendReminderEmails,
|
bool? SendReminderEmails,
|
||||||
int? FirstReminderDays,
|
int? FirstReminderDays,
|
||||||
int? ReminderIntervalDays,
|
int? ReminderIntervalDays,
|
||||||
int? ContractType);
|
int? ContractType) : IUnique<int>;
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.DTOs.Receiver
|
||||||
|
{
|
||||||
|
public record ReceiverCreateDto([EmailAddress] string EmailAddress)
|
||||||
|
{
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
using DigitalData.Core.DTO;
|
||||||
|
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.DTOs.Receiver
|
||||||
|
{
|
||||||
|
public record ReceiverReadDto(
|
||||||
|
int Id,
|
||||||
|
string EmailAddress,
|
||||||
|
string Signature,
|
||||||
|
DateTime AddedWhen
|
||||||
|
) : BaseDTO<int>(Id)
|
||||||
|
{
|
||||||
|
[JsonIgnore]
|
||||||
|
public IEnumerable<EnvelopeReceiverBasicDto>? EnvelopeReceivers { get; init; }
|
||||||
|
|
||||||
|
public string? LastUsedName => EnvelopeReceivers?.LastOrDefault()?.Name;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
using DigitalData.Core.Abstractions;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.DTOs.Receiver
|
||||||
|
{
|
||||||
|
public record ReceiverUpdateDto(int Id) : IUnique<int>;
|
||||||
|
}
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
using DigitalData.Core.DTO;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs
|
|
||||||
{
|
|
||||||
public record ReceiverDto(
|
|
||||||
int Id,
|
|
||||||
string EmailAddress,
|
|
||||||
string Signature,
|
|
||||||
DateTime AddedWhen
|
|
||||||
) : BaseDTO<int>(Id);
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
namespace EnvelopeGenerator.Application.DTOs
|
using DigitalData.Core.Abstractions;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.DTOs
|
||||||
{
|
{
|
||||||
public record UserReceiverDto(
|
public record UserReceiverDto(
|
||||||
int Id,
|
int Id,
|
||||||
@@ -7,5 +9,5 @@
|
|||||||
string Name,
|
string Name,
|
||||||
string CompanyName,
|
string CompanyName,
|
||||||
string JobTitle,
|
string JobTitle,
|
||||||
DateTime AddedWhen);
|
DateTime AddedWhen) : IUnique<int>;
|
||||||
}
|
}
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
namespace EnvelopeGenerator.Application
|
|
||||||
{
|
|
||||||
public class DispatcherConfig
|
|
||||||
{
|
|
||||||
public int SendingProfile { get; init; } = 1;
|
|
||||||
|
|
||||||
public string AddedWho { get; init; } = "DDEnvelopGenerator";
|
|
||||||
|
|
||||||
public int ReminderTypeId { get; init; } = 202377;
|
|
||||||
|
|
||||||
public string EmailAttmt1 { get; init; } = string.Empty;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -7,48 +7,44 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="AutoMapper" Version="13.0.1" />
|
<None Remove="Resources\Model.Designer.vb" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.18" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="AutoMapper" Version="13.0.1" />
|
||||||
|
<PackageReference Include="DigitalData.Core.Abstractions" Version="2.0.0" />
|
||||||
|
<PackageReference Include="DigitalData.Core.Application" Version="2.0.0" />
|
||||||
|
<PackageReference Include="DigitalData.Core.DTO" Version="2.0.0" />
|
||||||
|
<PackageReference Include="DigitalData.EmailProfilerDispatcher" Version="2.0.0" />
|
||||||
|
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.18" />
|
||||||
|
<PackageReference Include="UserManager.Application" Version="2.0.0" />
|
||||||
|
<PackageReference Include="UserManager.Infrastructure" Version="2.0.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\EnvelopeGenerator.Extensions\EnvelopeGenerator.Extensions.csproj" />
|
||||||
<ProjectReference Include="..\EnvelopeGenerator.Infrastructure\EnvelopeGenerator.Infrastructure.csproj" />
|
<ProjectReference Include="..\EnvelopeGenerator.Infrastructure\EnvelopeGenerator.Infrastructure.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="DigitalData.Core.Application">
|
<Compile Update="Resources\Model.Designer.cs">
|
||||||
<HintPath>..\..\WebCoreModules\DigitalData.Core.Application\bin\Debug\net7.0\DigitalData.Core.Application.dll</HintPath>
|
<DesignTime>True</DesignTime>
|
||||||
</Reference>
|
<AutoGen>True</AutoGen>
|
||||||
<Reference Include="DigitalData.Core.Contracts">
|
<DependentUpon>Model.resx</DependentUpon>
|
||||||
<HintPath>..\..\WebCoreModules\DigitalData.Core.Application\bin\Debug\net7.0\DigitalData.Core.Contracts.dll</HintPath>
|
</Compile>
|
||||||
</Reference>
|
|
||||||
<Reference Include="DigitalData.Core.DTO">
|
|
||||||
<HintPath>..\..\WebCoreModules\DigitalData.Core.Application\bin\Debug\net7.0\DigitalData.Core.DTO.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="DigitalData.Core.Infrastructure">
|
|
||||||
<HintPath>..\..\WebUserManager\DigitalData.UserManager.Application\bin\Debug\net7.0\DigitalData.Core.Infrastructure.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="DigitalData.EmailProfilerDispatcher.Application">
|
|
||||||
<HintPath>..\..\EmailProfilerDispatcher\DigitalData.EmailProfilerDispatcher.Application\bin\Debug\net7.0\DigitalData.EmailProfilerDispatcher.Application.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="DigitalData.EmailProfilerDispatcher.Domain">
|
|
||||||
<HintPath>..\..\EmailProfilerDispatcher\DigitalData.EmailProfilerDispatcher.Application\bin\Debug\net7.0\DigitalData.EmailProfilerDispatcher.Domain.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="DigitalData.EmailProfilerDispatcher.Infrastructure">
|
|
||||||
<HintPath>..\..\EmailProfilerDispatcher\DigitalData.EmailProfilerDispatcher.Application\bin\Debug\net7.0\DigitalData.EmailProfilerDispatcher.Infrastructure.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="DigitalData.UserManager.Application">
|
|
||||||
<HintPath>..\..\WebUserManager\DigitalData.UserManager.Application\bin\Debug\net7.0\DigitalData.UserManager.Application.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="DigitalData.UserManager.Domain">
|
|
||||||
<HintPath>..\..\WebUserManager\DigitalData.UserManager.Domain\bin\Debug\net7.0\DigitalData.UserManager.Domain.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="DigitalData.UserManager.Infrastructure">
|
|
||||||
<HintPath>..\..\WebUserManager\DigitalData.UserManager.Application\bin\Debug\net7.0\DigitalData.UserManager.Infrastructure.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<EmbeddedResource Update="Resources\Model.en.resx">
|
||||||
|
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||||
|
<LastGenOutput>Model.en.Designer.vb</LastGenOutput>
|
||||||
|
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Update="Resources\Model.resx">
|
||||||
|
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||||
|
<LastGenOutput>Model.Designer.cs</LastGenOutput>
|
||||||
|
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||||
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Update="Resources\Resource.de-DE.resx">
|
<EmbeddedResource Update="Resources\Resource.de-DE.resx">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
|||||||
@@ -1,148 +0,0 @@
|
|||||||
using Microsoft.Extensions.Logging;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Provides extension methods for decoding and extracting information from an envelope receiver ID.
|
|
||||||
/// </summary>
|
|
||||||
public static class EnvelopeGeneratorExtensions
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Validates whether a given string is a correctly formatted Base-64 encoded string.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// This method checks the string for proper Base-64 formatting, which includes validating
|
|
||||||
/// the length of the string (must be divisible by 4). It also checks each character to ensure
|
|
||||||
/// it belongs to the Base-64 character set (A-Z, a-z, 0-9, '+', '/', and '=' for padding).
|
|
||||||
/// The method ensures that padding characters ('=') only appear at the end of the string and
|
|
||||||
/// are in a valid configuration (either one '=' at the end if the string's length % 4 is 3,
|
|
||||||
/// or two '==' if the length % 4 is 2).
|
|
||||||
/// </remarks>
|
|
||||||
/// <param name="input">The Base-64 encoded string to validate.</param>
|
|
||||||
/// <returns>
|
|
||||||
/// <c>true</c> if the string is a valid Base-64 encoded string; otherwise, <c>false</c>.
|
|
||||||
/// </returns>
|
|
||||||
/// <example>
|
|
||||||
/// <code>
|
|
||||||
/// string testString = "TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlzIHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2YgdGhlIG1pbmQsIHRoYXQgYnk=";
|
|
||||||
/// bool isValid = IsValidBase64String(testString);
|
|
||||||
/// Console.WriteLine(isValid); // Output: true
|
|
||||||
/// </code>
|
|
||||||
/// </example>
|
|
||||||
public static bool IsBase64String(this string input)
|
|
||||||
{
|
|
||||||
// Check if the string is null or empty
|
|
||||||
if (string.IsNullOrEmpty(input))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Replace valid base-64 padding
|
|
||||||
input = input.Trim();
|
|
||||||
int mod4 = input.Length % 4;
|
|
||||||
if (mod4 > 0)
|
|
||||||
{
|
|
||||||
// Base-64 string lengths should be divisible by 4
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check each character to ensure it is valid base-64
|
|
||||||
foreach (char c in input)
|
|
||||||
{
|
|
||||||
if (!char.IsLetterOrDigit(c) && c != '+' && c != '/' && c != '=')
|
|
||||||
{
|
|
||||||
// Invalid character detected
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ensure no invalid padding scenarios exist
|
|
||||||
if (input.EndsWith("==") && (input.Length % 4 == 0) ||
|
|
||||||
input.EndsWith("=") && (input.Length % 4 == 3))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return input.IndexOf('=') == -1; // No padding allowed except at the end
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Decodes the envelope receiver ID and extracts the envelope UUID and receiver signature.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="envelopeReceiverId">The base64 encoded string containing the envelope UUID and receiver signature.</param>
|
|
||||||
/// <returns>A tuple containing the envelope UUID and receiver signature.</returns>
|
|
||||||
public static (string? EnvelopeUuid, string? ReceiverSignature) DecodeEnvelopeReceiverId(this string envelopeReceiverId)
|
|
||||||
{
|
|
||||||
if (!envelopeReceiverId.IsBase64String())
|
|
||||||
{
|
|
||||||
return (null, null);
|
|
||||||
}
|
|
||||||
byte[] bytes = Convert.FromBase64String(envelopeReceiverId);
|
|
||||||
string decodedString = System.Text.Encoding.UTF8.GetString(bytes);
|
|
||||||
string[] parts = decodedString.Split(new string[] { "::" }, StringSplitOptions.None);
|
|
||||||
|
|
||||||
if (parts.Length > 1)
|
|
||||||
return (EnvelopeUuid: parts[0], ReceiverSignature: parts[1]);
|
|
||||||
else
|
|
||||||
return (string.Empty, string.Empty);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the envelope UUID from the decoded envelope receiver ID.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="envelopeReceiverId">The base64 encoded string to decode.</param>
|
|
||||||
/// <returns>The envelope UUID.</returns>
|
|
||||||
public static string? GetEnvelopeUuid(this string envelopeReceiverId) => envelopeReceiverId.DecodeEnvelopeReceiverId().EnvelopeUuid;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the receiver signature from the decoded envelope receiver ID.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="envelopeReceiverId">The base64 encoded string to decode.</param>
|
|
||||||
/// <returns>The receiver signature.</returns>
|
|
||||||
public static string? GetReceiverSignature(this string envelopeReceiverId) => envelopeReceiverId.DecodeEnvelopeReceiverId().ReceiverSignature;
|
|
||||||
|
|
||||||
public static string EncodeEnvelopeReceiverId(this (string envelopeUuid, string receiverSignature) input)
|
|
||||||
{
|
|
||||||
string combinedString = $"{input.envelopeUuid}::{input.receiverSignature}";
|
|
||||||
byte[] bytes = Encoding.UTF8.GetBytes(combinedString);
|
|
||||||
string base64String = Convert.ToBase64String(bytes);
|
|
||||||
|
|
||||||
return base64String;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void LogEnvelopeError(this ILogger logger, string envelopeReceiverId, Exception? exception = null, string? message = null, params object?[] args)
|
|
||||||
{
|
|
||||||
var sb = new StringBuilder().AppendLine(envelopeReceiverId.DecodeEnvelopeReceiverId().ToTitle());
|
|
||||||
|
|
||||||
if (message is not null)
|
|
||||||
sb.AppendLine(message);
|
|
||||||
|
|
||||||
if(exception is null)
|
|
||||||
logger.Log(LogLevel.Error, sb.ToString(), args);
|
|
||||||
else
|
|
||||||
logger.Log(LogLevel.Error, exception, sb.AppendLine(exception.Message).ToString(), args);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void LogEnvelopeError(this ILogger logger, string? uuid, string? signature = null, Exception? exception = null, string? message = null, params object?[] args)
|
|
||||||
{
|
|
||||||
var sb = new StringBuilder($"Envelope Uuid: {uuid}");
|
|
||||||
|
|
||||||
if(signature is not null)
|
|
||||||
sb.AppendLine().Append($"Receiver Signature: {signature}");
|
|
||||||
|
|
||||||
if (message is not null)
|
|
||||||
sb.AppendLine().Append(message);
|
|
||||||
|
|
||||||
if (exception is null)
|
|
||||||
logger.Log(LogLevel.Error, sb.ToString(), args);
|
|
||||||
else
|
|
||||||
logger.Log(LogLevel.Error, exception, sb.ToString(), args);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string ToTitle(this (string? UUID, string? Signature) envelopeReceiverTuple)
|
|
||||||
{
|
|
||||||
return $"UUID is {envelopeReceiverTuple.UUID} and signature is {envelopeReceiverTuple.Signature}";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,9 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
|
using EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
|
||||||
|
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
||||||
|
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
|
||||||
|
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.MappingProfiles
|
namespace EnvelopeGenerator.Application.MappingProfiles
|
||||||
@@ -20,9 +23,13 @@ namespace EnvelopeGenerator.Application.MappingProfiles
|
|||||||
CreateMap<EnvelopeHistory, EnvelopeHistoryDto>();
|
CreateMap<EnvelopeHistory, EnvelopeHistoryDto>();
|
||||||
CreateMap<EnvelopeHistory, EnvelopeHistoryCreateDto>();
|
CreateMap<EnvelopeHistory, EnvelopeHistoryCreateDto>();
|
||||||
CreateMap<EnvelopeReceiver, EnvelopeReceiverDto>();
|
CreateMap<EnvelopeReceiver, EnvelopeReceiverDto>();
|
||||||
|
CreateMap<EnvelopeReceiver, EnvelopeReceiverSecretDto>();
|
||||||
CreateMap<EnvelopeType, EnvelopeTypeDto>();
|
CreateMap<EnvelopeType, EnvelopeTypeDto>();
|
||||||
CreateMap<Receiver, ReceiverDto>();
|
CreateMap<Receiver, ReceiverReadDto>();
|
||||||
|
CreateMap<Receiver, ReceiverCreateDto>();
|
||||||
|
CreateMap<Receiver, ReceiverUpdateDto>();
|
||||||
CreateMap<UserReceiver, UserReceiverDto>();
|
CreateMap<UserReceiver, UserReceiverDto>();
|
||||||
|
CreateMap<EnvelopeReceiverReadOnly, EnvelopeReceiverReadOnlyDto>();
|
||||||
|
|
||||||
// DTO to Entity mappings
|
// DTO to Entity mappings
|
||||||
CreateMap<ConfigDto, Config>();
|
CreateMap<ConfigDto, Config>();
|
||||||
@@ -36,8 +43,13 @@ namespace EnvelopeGenerator.Application.MappingProfiles
|
|||||||
CreateMap<EnvelopeHistoryCreateDto, EnvelopeHistory>();
|
CreateMap<EnvelopeHistoryCreateDto, EnvelopeHistory>();
|
||||||
CreateMap<EnvelopeReceiverDto, EnvelopeReceiver>();
|
CreateMap<EnvelopeReceiverDto, EnvelopeReceiver>();
|
||||||
CreateMap<EnvelopeTypeDto, EnvelopeType>();
|
CreateMap<EnvelopeTypeDto, EnvelopeType>();
|
||||||
CreateMap<ReceiverDto, Receiver>();
|
CreateMap<ReceiverReadDto, Receiver>();
|
||||||
|
CreateMap<ReceiverCreateDto, Receiver>();
|
||||||
|
CreateMap<ReceiverUpdateDto, Receiver>();
|
||||||
CreateMap<UserReceiverDto, UserReceiver>();
|
CreateMap<UserReceiverDto, UserReceiver>();
|
||||||
|
CreateMap<EnvelopeReceiverBase, EnvelopeReceiverBasicDto>();
|
||||||
|
CreateMap<EnvelopeReceiverReadOnlyCreateDto, EnvelopeReceiverReadOnly>();
|
||||||
|
CreateMap<EnvelopeReceiverReadOnlyUpdateDto, EnvelopeReceiverReadOnly>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -145,10 +145,10 @@
|
|||||||
<value>Englisch</value>
|
<value>Englisch</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="EnvelopeInfo1" xml:space="preserve">
|
<data name="EnvelopeInfo1" xml:space="preserve">
|
||||||
<value>Sie müssen {0} Vorgang unterzeichen. Bitte prüfen Sie die Seite {1}.</value>
|
<value>Sie müssen {0} Vorgang unterzeichen. <span class="highlight highlight-envelope-info-1">Bitte prüfen Sie die Seite {1}</span>.</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="EnvelopeInfo2" xml:space="preserve">
|
<data name="EnvelopeInfo2" xml:space="preserve">
|
||||||
<value>Erstellt am {0} von {1}. Sie können den Absender über <a href="mailto:{2}?subject={3}&body=Sehr%20geehrter%20{4}%20{5},%0A%0A%0A">{6}</a> kontaktieren.</value>
|
<value>Erstellt am {0} von {1}. Sie können den Absender über <span class="highlight highlight-envelope-info-2"><a class="mail-link" href="mailto:{2}?subject={3}&body=Sehr%20geehrter%20{4}%20{5},%0A%0A%0A">{6}</a></span> kontaktieren.</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Finalize" xml:space="preserve">
|
<data name="Finalize" xml:space="preserve">
|
||||||
<value>Abschließen</value>
|
<value>Abschließen</value>
|
||||||
@@ -159,6 +159,9 @@
|
|||||||
<data name="LocakedOpen" xml:space="preserve">
|
<data name="LocakedOpen" xml:space="preserve">
|
||||||
<value>Öffnen</value>
|
<value>Öffnen</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="LocationWarning" xml:space="preserve">
|
||||||
|
<value>Bitte überprüfen Sie die Standortinformationen. Wenn sie falsch sind, korrigieren Sie diese bitte.</value>
|
||||||
|
</data>
|
||||||
<data name="LockedAccessCode" xml:space="preserve">
|
<data name="LockedAccessCode" xml:space="preserve">
|
||||||
<value>Zugriffscode</value>
|
<value>Zugriffscode</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -174,6 +177,9 @@
|
|||||||
<data name="LockedTitle" xml:space="preserve">
|
<data name="LockedTitle" xml:space="preserve">
|
||||||
<value>Dokument erfordert einen Zugriffscode</value>
|
<value>Dokument erfordert einen Zugriffscode</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="ReadOnlyMessage" xml:space="preserve">
|
||||||
|
<value>Weitergeleitet von {0}. Gültig bis {1}.</value>
|
||||||
|
</data>
|
||||||
<data name="Reject" xml:space="preserve">
|
<data name="Reject" xml:space="preserve">
|
||||||
<value>Ablehnen</value>
|
<value>Ablehnen</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -201,9 +207,15 @@
|
|||||||
<data name="SignDoc" xml:space="preserve">
|
<data name="SignDoc" xml:space="preserve">
|
||||||
<value>Dokument unterschreiben</value>
|
<value>Dokument unterschreiben</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="SigningProcessTitle" xml:space="preserve">
|
||||||
|
<value>Titel des Unterzeichnungs-Vorgangs</value>
|
||||||
|
</data>
|
||||||
<data name="UnexpectedError" xml:space="preserve">
|
<data name="UnexpectedError" xml:space="preserve">
|
||||||
<value>Ein unerwarteter Fehler ist aufgetreten.</value>
|
<value>Ein unerwarteter Fehler ist aufgetreten.</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="WelcomeToTheESignPortal" xml:space="preserve">
|
||||||
|
<value>Herzlich willkommen im eSign-Portal</value>
|
||||||
|
</data>
|
||||||
<data name="WrongAccessCode" xml:space="preserve">
|
<data name="WrongAccessCode" xml:space="preserve">
|
||||||
<value>Ungültiger Zugangscode.</value>
|
<value>Ungültiger Zugangscode.</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -145,10 +145,10 @@
|
|||||||
<value>English</value>
|
<value>English</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="EnvelopeInfo1" xml:space="preserve">
|
<data name="EnvelopeInfo1" xml:space="preserve">
|
||||||
<value>You have to sign {0} process. Please check page {1}.</value>
|
<value>You have to sign {0} process. <span class="highlight highlight-envelope-info-1">Please check page {1}</span>.</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="EnvelopeInfo2" xml:space="preserve">
|
<data name="EnvelopeInfo2" xml:space="preserve">
|
||||||
<value>Created on {0} by {1}. You can contact the sender via <a href="mailto:{2}?subject={3}&body=Dear%20{4}%20{5},%0A%0A%0A">{6}</a>.</value>
|
<value>Created on {0} by {1}. You can contact the sender via <span class="highlight highlight-envelope-info-2"><a class="mail-link" href="mailto:{2}?subject={3}&body=Dear%20{4}%20{5},%0A%0A%0A">{6}</a></span>.</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Finalize" xml:space="preserve">
|
<data name="Finalize" xml:space="preserve">
|
||||||
<value>Finalize</value>
|
<value>Finalize</value>
|
||||||
@@ -159,6 +159,9 @@
|
|||||||
<data name="LocakedOpen" xml:space="preserve">
|
<data name="LocakedOpen" xml:space="preserve">
|
||||||
<value>Open</value>
|
<value>Open</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="LocationWarning" xml:space="preserve">
|
||||||
|
<value>Please review the location information. If it is incorrect, kindly make the necessary corrections.</value>
|
||||||
|
</data>
|
||||||
<data name="LockedAccessCode" xml:space="preserve">
|
<data name="LockedAccessCode" xml:space="preserve">
|
||||||
<value>Access Code</value>
|
<value>Access Code</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -174,6 +177,9 @@
|
|||||||
<data name="LockedTitle" xml:space="preserve">
|
<data name="LockedTitle" xml:space="preserve">
|
||||||
<value>Document requires an access code</value>
|
<value>Document requires an access code</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="ReadOnlyMessage" xml:space="preserve">
|
||||||
|
<value>Forwarded by {0}. Valid until {1}.</value>
|
||||||
|
</data>
|
||||||
<data name="Reject" xml:space="preserve">
|
<data name="Reject" xml:space="preserve">
|
||||||
<value>Reject</value>
|
<value>Reject</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -201,9 +207,15 @@
|
|||||||
<data name="SignDoc" xml:space="preserve">
|
<data name="SignDoc" xml:space="preserve">
|
||||||
<value>Sign document</value>
|
<value>Sign document</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="SigningProcessTitle" xml:space="preserve">
|
||||||
|
<value>Title of the signing process</value>
|
||||||
|
</data>
|
||||||
<data name="UnexpectedError" xml:space="preserve">
|
<data name="UnexpectedError" xml:space="preserve">
|
||||||
<value>An unexpected error has occurred.</value>
|
<value>An unexpected error has occurred.</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="WelcomeToTheESignPortal" xml:space="preserve">
|
||||||
|
<value>Welcome to the eSign portal</value>
|
||||||
|
</data>
|
||||||
<data name="WrongAccessCode" xml:space="preserve">
|
<data name="WrongAccessCode" xml:space="preserve">
|
||||||
<value>Invalid access code.</value>
|
<value>Invalid access code.</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -3,15 +3,13 @@ using DigitalData.Core.Application;
|
|||||||
using DigitalData.Core.DTO;
|
using DigitalData.Core.DTO;
|
||||||
using EnvelopeGenerator.Application.Contracts;
|
using EnvelopeGenerator.Application.Contracts;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Application.Resources;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
using EnvelopeGenerator.Infrastructure.Contracts;
|
||||||
using Microsoft.Extensions.Caching.Memory;
|
using Microsoft.Extensions.Caching.Memory;
|
||||||
using Microsoft.Extensions.Localization;
|
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
namespace EnvelopeGenerator.Application.Services
|
namespace EnvelopeGenerator.Application.Services
|
||||||
{
|
{
|
||||||
public class ConfigService : BasicCRUDService<IConfigRepository, ConfigDto, Config, int>, IConfigService
|
public class ConfigService : ReadService<IConfigRepository, ConfigDto, Config, int>, IConfigService
|
||||||
{
|
{
|
||||||
private static readonly Guid DefaultConfigCacheId = Guid.NewGuid();
|
private static readonly Guid DefaultConfigCacheId = Guid.NewGuid();
|
||||||
|
|
||||||
@@ -28,7 +26,7 @@ namespace EnvelopeGenerator.Application.Services
|
|||||||
var config = await _repository.ReadFirstAsync();
|
var config = await _repository.ReadFirstAsync();
|
||||||
return config is null
|
return config is null
|
||||||
? Result.Fail<ConfigDto>().Notice(LogLevel.Error, Flag.DataIntegrityIssue, "There is no configuration in DB.")
|
? Result.Fail<ConfigDto>().Notice(LogLevel.Error, Flag.DataIntegrityIssue, "There is no configuration in DB.")
|
||||||
: Result.Success(_mapper.MapOrThrow<ConfigDto>(config));
|
: Result.Success(_mapper.Map<ConfigDto>(config));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -2,10 +2,8 @@
|
|||||||
using DigitalData.Core.Application;
|
using DigitalData.Core.Application;
|
||||||
using EnvelopeGenerator.Application.Contracts;
|
using EnvelopeGenerator.Application.Contracts;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Application.Resources;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
using EnvelopeGenerator.Infrastructure.Contracts;
|
||||||
using Microsoft.Extensions.Localization;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Services
|
namespace EnvelopeGenerator.Application.Services
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,10 +2,8 @@
|
|||||||
using DigitalData.Core.Application;
|
using DigitalData.Core.Application;
|
||||||
using EnvelopeGenerator.Application.Contracts;
|
using EnvelopeGenerator.Application.Contracts;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Application.Resources;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
using EnvelopeGenerator.Infrastructure.Contracts;
|
||||||
using Microsoft.Extensions.Localization;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Services
|
namespace EnvelopeGenerator.Application.Services
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using DigitalData.Core.Application;
|
using DigitalData.Core.Application;
|
||||||
using Microsoft.Extensions.Localization;
|
|
||||||
using EnvelopeGenerator.Application.Contracts;
|
using EnvelopeGenerator.Application.Contracts;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
using EnvelopeGenerator.Infrastructure.Contracts;
|
||||||
using EnvelopeGenerator.Application.Resources;
|
|
||||||
using static EnvelopeGenerator.Common.Constants;
|
using static EnvelopeGenerator.Common.Constants;
|
||||||
using DigitalData.Core.DTO;
|
using DigitalData.Core.DTO;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
@@ -26,7 +24,7 @@ namespace EnvelopeGenerator.Application.Services
|
|||||||
? Result.Fail<EmailTemplateDto>()
|
? Result.Fail<EmailTemplateDto>()
|
||||||
.Message(Key.InnerServiceError)
|
.Message(Key.InnerServiceError)
|
||||||
.Notice(LogLevel.Error, Flag.DataIntegrityIssue, $"EmailTemplateType '{type}' is not found in DB. Please, define required e-mail template.")
|
.Notice(LogLevel.Error, Flag.DataIntegrityIssue, $"EmailTemplateType '{type}' is not found in DB. Please, define required e-mail template.")
|
||||||
: Result.Success(_mapper.MapOrThrow<EmailTemplateDto>(temp));
|
: Result.Success(_mapper.Map<EmailTemplateDto>(temp));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,9 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using DigitalData.Core.Application;
|
using DigitalData.Core.Application;
|
||||||
using DigitalData.Core.Contracts.Application;
|
|
||||||
using Microsoft.Extensions.Localization;
|
|
||||||
using EnvelopeGenerator.Application.Contracts;
|
using EnvelopeGenerator.Application.Contracts;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
using EnvelopeGenerator.Infrastructure.Contracts;
|
||||||
using EnvelopeGenerator.Application.Resources;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Services
|
namespace EnvelopeGenerator.Application.Services
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,20 +1,18 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using DigitalData.Core.Application;
|
using DigitalData.Core.Application;
|
||||||
using Microsoft.Extensions.Localization;
|
|
||||||
using EnvelopeGenerator.Application.Contracts;
|
using EnvelopeGenerator.Application.Contracts;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
using EnvelopeGenerator.Infrastructure.Contracts;
|
||||||
using static EnvelopeGenerator.Common.Constants;
|
using static EnvelopeGenerator.Common.Constants;
|
||||||
using EnvelopeGenerator.Application.Resources;
|
|
||||||
using DigitalData.Core.DTO;
|
using DigitalData.Core.DTO;
|
||||||
using EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
|
using EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Services
|
namespace EnvelopeGenerator.Application.Services
|
||||||
{
|
{
|
||||||
public class EnvelopeHistoryService : CRUDService<IEnvelopeHistoryRepository, EnvelopeHistoryCreateDto, EnvelopeHistoryDto, EnvelopeHistoryDto, EnvelopeHistory, long>, IEnvelopeHistoryService
|
public class EnvelopeHistoryService : CRUDService<IEnvelopeHistoryRepository, EnvelopeHistoryCreateDto, EnvelopeHistoryDto, EnvelopeHistoryDto, EnvelopeHistory, long>, IEnvelopeHistoryService
|
||||||
{
|
{
|
||||||
public EnvelopeHistoryService(IEnvelopeHistoryRepository repository, IStringLocalizer<Resource> localizer, IMapper mapper)
|
public EnvelopeHistoryService(IEnvelopeHistoryRepository repository, IMapper mapper)
|
||||||
: base(repository, mapper)
|
: base(repository, mapper)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -53,7 +51,7 @@ namespace EnvelopeGenerator.Application.Services
|
|||||||
|
|
||||||
public async Task<IEnumerable<EnvelopeHistoryDto>> ReadAsync(int? envelopeId = null, string? userReference = null, ReferenceType? referenceType = null, int? status = null, bool withSender = false, bool withReceiver = false)
|
public async Task<IEnumerable<EnvelopeHistoryDto>> ReadAsync(int? envelopeId = null, string? userReference = null, ReferenceType? referenceType = null, int? status = null, bool withSender = false, bool withReceiver = false)
|
||||||
{
|
{
|
||||||
var histDTOs = _mapper.MapOrThrow<IEnumerable<EnvelopeHistoryDto>>(
|
var histDTOs = _mapper.Map<IEnumerable<EnvelopeHistoryDto>>(
|
||||||
await _repository.ReadAsync(
|
await _repository.ReadAsync(
|
||||||
envelopeId: envelopeId,
|
envelopeId: envelopeId,
|
||||||
userReference: userReference,
|
userReference: userReference,
|
||||||
@@ -67,11 +65,11 @@ namespace EnvelopeGenerator.Application.Services
|
|||||||
await ReadAsync(envelopeId: envelopeId, userReference: userReference, status: (int)EnvelopeStatus.DocumentRejected, withReceiver:true);
|
await ReadAsync(envelopeId: envelopeId, userReference: userReference, status: (int)EnvelopeStatus.DocumentRejected, withReceiver:true);
|
||||||
|
|
||||||
//TODO: use IQueryable in repository to incerease the performance
|
//TODO: use IQueryable in repository to incerease the performance
|
||||||
public async Task<IEnumerable<ReceiverDto>> ReadRejectingReceivers(int envelopeId)
|
public async Task<IEnumerable<ReceiverReadDto>> ReadRejectingReceivers(int envelopeId)
|
||||||
{
|
{
|
||||||
var envelopes = await ReadRejectedAsync(envelopeId);
|
var envelopes = await ReadRejectedAsync(envelopeId);
|
||||||
return envelopes is null
|
return envelopes is null
|
||||||
? Enumerable.Empty<ReceiverDto>()
|
? Enumerable.Empty<ReceiverReadDto>()
|
||||||
: envelopes
|
: envelopes
|
||||||
.Where(eh => eh?.Receiver != null)
|
.Where(eh => eh?.Receiver != null)
|
||||||
.Select(eh => eh.Receiver!);
|
.Select(eh => eh.Receiver!);
|
||||||
|
|||||||
@@ -1,58 +1,70 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using DigitalData.Core.DTO;
|
using DigitalData.Core.DTO;
|
||||||
using DigitalData.EmailProfilerDispatcher.Application.DTOs.EmailOut;
|
using DigitalData.EmailProfilerDispatcher.Abstraction.Contracts;
|
||||||
using DigitalData.EmailProfilerDispatcher.Application.Services;
|
using DigitalData.EmailProfilerDispatcher.Abstraction.DTOs.EmailOut;
|
||||||
using DigitalData.EmailProfilerDispatcher.Infrastructure.Contracts;
|
using DigitalData.EmailProfilerDispatcher.Abstraction.Services;
|
||||||
using DigitalData.UserManager.Application;
|
|
||||||
using EnvelopeGenerator.Application.Contracts;
|
using EnvelopeGenerator.Application.Contracts;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
||||||
using EnvelopeGenerator.Common;
|
using EnvelopeGenerator.Common;
|
||||||
using Microsoft.Extensions.Localization;
|
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
using static EnvelopeGenerator.Common.Constants;
|
using static EnvelopeGenerator.Common.Constants;
|
||||||
|
using EnvelopeGenerator.Extensions;
|
||||||
|
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
|
||||||
|
using EnvelopeGenerator.Application.Configurations;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Services
|
namespace EnvelopeGenerator.Application.Services
|
||||||
{
|
{
|
||||||
public class EnvelopeMailService : EmailOutService, IEnvelopeMailService
|
public class EnvelopeMailService : EmailOutService, IEnvelopeMailService
|
||||||
{
|
{
|
||||||
private readonly IEmailTemplateService _tempService;
|
private readonly IEmailTemplateService _tempService;
|
||||||
private readonly IEnvelopeReceiverService _envRcvService;
|
private readonly IEnvelopeReceiverService _envRcvService;
|
||||||
private readonly DispatcherConfig _dConfig;
|
private readonly DispatcherConfig _dConfig;
|
||||||
private readonly IConfigService _configService;
|
private readonly IConfigService _configService;
|
||||||
|
private readonly Dictionary<string, string> _placeholders;
|
||||||
|
|
||||||
public EnvelopeMailService(IEmailOutRepository repository, IStringLocalizer<Resource> localizer, IMapper mapper, IEmailTemplateService tempService, IEnvelopeReceiverService envelopeReceiverService, IOptions<DispatcherConfig> dispatcherConfigOptions, IConfigService configService) : base(repository, mapper)
|
public EnvelopeMailService(IEmailOutRepository repository, IMapper mapper, IEmailTemplateService tempService, IEnvelopeReceiverService envelopeReceiverService, IOptions<DispatcherConfig> dispatcherConfigOptions, IConfigService configService, IOptions<MailConfig> mailConfig) : base(repository, mapper)
|
||||||
{
|
{
|
||||||
_tempService = tempService;
|
_tempService = tempService;
|
||||||
_envRcvService = envelopeReceiverService;
|
_envRcvService = envelopeReceiverService;
|
||||||
_dConfig = dispatcherConfigOptions.Value;
|
_dConfig = dispatcherConfigOptions.Value;
|
||||||
_configService = configService;
|
_configService = configService;
|
||||||
|
_placeholders = mailConfig.Value.Placeholders;
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: create ioptions and implement TemplatePlaceHolderAttribute instead of this method
|
private async Task<Dictionary<string, string>> CreatePlaceholders(string? accessCode = null, EnvelopeReceiverDto? envelopeReceiverDto = null, EnvelopeReceiverReadOnlyDto? readOnlyDto = null)
|
||||||
private async Task<Dictionary<string, string>> CreatePlaceholders(string? accessCode = null, EnvelopeReceiverDto? envelopeReceiverDto = null)
|
|
||||||
{
|
{
|
||||||
Dictionary<string, string> placeholders = new() {
|
|
||||||
{ "[NAME_PORTAL]", "signFlow" },
|
|
||||||
{ "[SIGNATURE_TYPE]" , "signieren"},
|
|
||||||
{ "[REASON]", string.Empty } };
|
|
||||||
|
|
||||||
if (accessCode is not null)
|
if (accessCode is not null)
|
||||||
placeholders["[DOCUMENT_ACCESS_CODE]"] = accessCode;
|
_placeholders["[DOCUMENT_ACCESS_CODE]"] = accessCode;
|
||||||
|
|
||||||
if(envelopeReceiverDto is not null && envelopeReceiverDto.Envelope is not null && envelopeReceiverDto.Receiver is not null)
|
if(envelopeReceiverDto?.Envelope is not null && envelopeReceiverDto.Receiver is not null)
|
||||||
{
|
{
|
||||||
var erId = (envelopeReceiverDto.Envelope.Uuid, envelopeReceiverDto.Receiver.Signature).EncodeEnvelopeReceiverId();
|
var erId = (envelopeReceiverDto.Envelope.Uuid, envelopeReceiverDto.Receiver.Signature).EncodeEnvelopeReceiverId();
|
||||||
var sigHost = await _configService.ReadDefaultSignatureHost();
|
var sigHost = await _configService.ReadDefaultSignatureHost();
|
||||||
var linkToDoc = $"{sigHost}/envelope/{erId}";
|
var linkToDoc = $"{sigHost}/EnvelopeKey/{erId}";
|
||||||
placeholders["[LINK_TO_DOCUMENT]"] = linkToDoc;
|
_placeholders["[LINK_TO_DOCUMENT]"] = linkToDoc;
|
||||||
placeholders["[LINK_TO_DOCUMENT_TEXT]"] = linkToDoc[..Math.Min(40, linkToDoc.Length)];
|
_placeholders["[LINK_TO_DOCUMENT_TEXT]"] = linkToDoc[..Math.Min(40, linkToDoc.Length)] + "..";
|
||||||
}
|
}
|
||||||
|
|
||||||
return placeholders;
|
return _placeholders;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<DataResult<int>> SendAccessCodeAsync(EnvelopeReceiverDto dto) => await SendAsync(dto: dto, tempType: Constants.EmailTemplateType.DocumentAccessCodeReceived);
|
private async Task<Dictionary<string, string>> CreatePlaceholders(EnvelopeReceiverReadOnlyDto? readOnlyDto = null)
|
||||||
|
{
|
||||||
|
if (readOnlyDto?.Envelope is not null && readOnlyDto.Receiver is not null)
|
||||||
|
{
|
||||||
|
_placeholders["[NAME_RECEIVER]"] = await _envRcvService.ReadLastUsedReceiverNameByMail(readOnlyDto.AddedWho).ThenAsync(res => res, (msg, ntc) => string.Empty) ?? string.Empty;
|
||||||
|
var erReadOnlyId = (readOnlyDto.Id).EncodeEnvelopeReceiverId();
|
||||||
|
var sigHost = await _configService.ReadDefaultSignatureHost();
|
||||||
|
var linkToDoc = $"{sigHost}/EnvelopeKey/{erReadOnlyId}";
|
||||||
|
_placeholders["[LINK_TO_DOCUMENT]"] = linkToDoc;
|
||||||
|
_placeholders["[LINK_TO_DOCUMENT_TEXT]"] = linkToDoc[..Math.Min(40, linkToDoc.Length)] + "..";
|
||||||
|
}
|
||||||
|
|
||||||
|
return _placeholders;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<DataResult<int>> SendAccessCodeAsync(EnvelopeReceiverDto dto) => await SendAsync(dto: dto, tempType: Constants.EmailTemplateType.DocumentAccessCodeReceived);
|
||||||
|
|
||||||
public async Task<DataResult<int>> SendAsync(EnvelopeReceiverDto dto, Constants.EmailTemplateType tempType)
|
public async Task<DataResult<int>> SendAsync(EnvelopeReceiverDto dto, Constants.EmailTemplateType tempType)
|
||||||
{
|
{
|
||||||
@@ -92,8 +104,43 @@ namespace EnvelopeGenerator.Application.Services
|
|||||||
|
|
||||||
var placeholders = await CreatePlaceholders(accessCode: accessCode, envelopeReceiverDto: dto);
|
var placeholders = await CreatePlaceholders(accessCode: accessCode, envelopeReceiverDto: dto);
|
||||||
|
|
||||||
|
//TODO: remove the requirement to add the models using reflections
|
||||||
return await CreateWithTemplateAsync(createDto: mail,placeholders: placeholders,
|
return await CreateWithTemplateAsync(createDto: mail,placeholders: placeholders,
|
||||||
dto, dto.Envelope.User!, dto.Envelope);
|
dto, dto.Envelope.User!, dto.Envelope);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
public async Task<DataResult<int>> SendAsync(EnvelopeReceiverReadOnlyDto dto)
|
||||||
|
{
|
||||||
|
var tempSerResult = await _tempService.ReadByNameAsync(Constants.EmailTemplateType.DocumentShared);
|
||||||
|
if (tempSerResult.IsFailed)
|
||||||
|
return tempSerResult.ToFail<int>().Notice(LogLevel.Error, Flag.DataIntegrityIssue, $"The email cannot send because '{Constants.EmailTemplateType.DocumentShared}' template cannot found.");
|
||||||
|
var temp = tempSerResult.Data;
|
||||||
|
|
||||||
|
var mail = new EmailOutCreateDto()
|
||||||
|
{
|
||||||
|
EmailAddress = dto.ReceiverMail,
|
||||||
|
EmailSubj = temp.Subject,
|
||||||
|
EmailBody = temp.Body,
|
||||||
|
//TODO: remove int casting when all
|
||||||
|
ReferenceId = (int) dto.EnvelopeId, //REFERENCE_ID = ENVELOPE_ID
|
||||||
|
ReferenceString = dto.Envelope!.Uuid, //REFERENCE_STRING = ENVELOPE_UUID
|
||||||
|
//receiver_name = receiver.name,
|
||||||
|
//receiver_access_code = receiver.access_code,
|
||||||
|
//sender_adress = envelope.user.email,
|
||||||
|
//sender_name = envelope.user.full_name,
|
||||||
|
//envelope_title = envelope.title,
|
||||||
|
ReminderTypeId = _dConfig.ReminderTypeId,
|
||||||
|
SendingProfile = _dConfig.SendingProfile,
|
||||||
|
EntityId = null,
|
||||||
|
WfId = (int)EnvelopeStatus.EnvelopeShared,
|
||||||
|
WfReference = null,
|
||||||
|
AddedWho = _dConfig.AddedWho,
|
||||||
|
EmailAttmt1 = _dConfig.EmailAttmt1
|
||||||
|
};
|
||||||
|
|
||||||
|
var placeholders = await CreatePlaceholders(readOnlyDto: dto);
|
||||||
|
|
||||||
|
return await CreateWithTemplateAsync(createDto: mail, placeholders: placeholders, dto.Envelope);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
using AutoMapper;
|
||||||
|
using DigitalData.Core.Application;
|
||||||
|
using EnvelopeGenerator.Application.Contracts;
|
||||||
|
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
|
||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
using EnvelopeGenerator.Infrastructure.Contracts;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Services
|
||||||
|
{
|
||||||
|
public class EnvelopeReceiverReadOnlyService : CRUDService<IEnvelopeReceiverReadOnlyRepository, EnvelopeReceiverReadOnlyCreateDto, EnvelopeReceiverReadOnlyDto, EnvelopeReceiverReadOnlyUpdateDto, EnvelopeReceiverReadOnly, long>, IEnvelopeReceiverReadOnlyService
|
||||||
|
{
|
||||||
|
public EnvelopeReceiverReadOnlyService(IEnvelopeReceiverReadOnlyRepository repository, IMapper mapper) : base(repository, mapper)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,16 +2,17 @@
|
|||||||
using DigitalData.Core.Application;
|
using DigitalData.Core.Application;
|
||||||
using DigitalData.Core.DTO;
|
using DigitalData.Core.DTO;
|
||||||
using EnvelopeGenerator.Application.Contracts;
|
using EnvelopeGenerator.Application.Contracts;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
||||||
using EnvelopeGenerator.Application.Resources;
|
using EnvelopeGenerator.Application.Resources;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
using EnvelopeGenerator.Infrastructure.Contracts;
|
||||||
using Microsoft.Extensions.Localization;
|
using Microsoft.Extensions.Localization;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
using EnvelopeGenerator.Extensions;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Services
|
namespace EnvelopeGenerator.Application.Services
|
||||||
{
|
{
|
||||||
public class EnvelopeReceiverService : BasicCRUDService<IEnvelopeReceiverRepository, EnvelopeReceiverDto, EnvelopeReceiver, object>, IEnvelopeReceiverService
|
public class EnvelopeReceiverService : BasicCRUDService<IEnvelopeReceiverRepository, EnvelopeReceiverDto, EnvelopeReceiver, (int Envelope, int Receiver)>, IEnvelopeReceiverService
|
||||||
{
|
{
|
||||||
private readonly IStringLocalizer<Resource> _localizer;
|
private readonly IStringLocalizer<Resource> _localizer;
|
||||||
|
|
||||||
@@ -24,13 +25,19 @@ namespace EnvelopeGenerator.Application.Services
|
|||||||
public async Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadBySignatureAsync(string signature, bool withEnvelope = false, bool withReceiver = true)
|
public async Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadBySignatureAsync(string signature, bool withEnvelope = false, bool withReceiver = true)
|
||||||
{
|
{
|
||||||
var env_rcvs = await _repository.ReadBySignatureAsync(signature: signature, withEnvelope: withEnvelope, withReceiver: withReceiver);
|
var env_rcvs = await _repository.ReadBySignatureAsync(signature: signature, withEnvelope: withEnvelope, withReceiver: withReceiver);
|
||||||
return Result.Success(_mapper.MapOrThrow<IEnumerable<EnvelopeReceiverDto>>(env_rcvs));
|
return Result.Success(_mapper.Map<IEnumerable<EnvelopeReceiverDto>>(env_rcvs));
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUuidAsync(string uuid, bool withEnvelope = true, bool withReceiver = false)
|
public async Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUuidAsync(string uuid, bool withEnvelope = true, bool withReceiver = false)
|
||||||
{
|
{
|
||||||
var env_rcvs = await _repository.ReadByUuidAsync(uuid: uuid, withEnvelope: withEnvelope, withReceiver: withReceiver);
|
var env_rcvs = await _repository.ReadByUuidAsync(uuid: uuid, withEnvelope: withEnvelope, withReceiver: withReceiver);
|
||||||
return Result.Success(_mapper.MapOrThrow<IEnumerable<EnvelopeReceiverDto>>(env_rcvs));
|
return Result.Success(_mapper.Map<IEnumerable<EnvelopeReceiverDto>>(env_rcvs));
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<DataResult<IEnumerable<EnvelopeReceiverSecretDto>>> ReadSecretByUuidAsync(string uuid, bool withEnvelope = false, bool withReceiver = true)
|
||||||
|
{
|
||||||
|
var env_rcvs = await _repository.ReadByUuidAsync(uuid: uuid, withEnvelope: withEnvelope, withReceiver: withReceiver);
|
||||||
|
return Result.Success(_mapper.Map<IEnumerable<EnvelopeReceiverSecretDto>>(env_rcvs));
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<DataResult<EnvelopeReceiverDto>> ReadByUuidSignatureAsync(string uuid, string signature, bool withEnvelope = true, bool withReceiver = true)
|
public async Task<DataResult<EnvelopeReceiverDto>> ReadByUuidSignatureAsync(string uuid, string signature, bool withEnvelope = true, bool withReceiver = true)
|
||||||
@@ -40,7 +47,7 @@ namespace EnvelopeGenerator.Application.Services
|
|||||||
return Result.Fail<EnvelopeReceiverDto>()
|
return Result.Fail<EnvelopeReceiverDto>()
|
||||||
.Message(Key.EnvelopeReceiverNotFound);
|
.Message(Key.EnvelopeReceiverNotFound);
|
||||||
|
|
||||||
return Result.Success(_mapper.MapOrThrow<EnvelopeReceiverDto>(env_rcv));
|
return Result.Success(_mapper.Map<EnvelopeReceiverDto>(env_rcv));
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<DataResult<EnvelopeReceiverDto>> ReadByEnvelopeReceiverIdAsync(string envelopeReceiverId, bool withEnvelope = true, bool withReceiver = true)
|
public async Task<DataResult<EnvelopeReceiverDto>> ReadByEnvelopeReceiverIdAsync(string envelopeReceiverId, bool withEnvelope = true, bool withReceiver = true)
|
||||||
@@ -116,11 +123,17 @@ namespace EnvelopeGenerator.Application.Services
|
|||||||
: Result.Success(code);
|
: Result.Success(code);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUsernameAsync(string username)
|
public async Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUsernameAsync(string username, int? min_status = null, int? max_status = null, params int[] ignore_statuses)
|
||||||
{
|
{
|
||||||
var er_list = await _repository.ReadByUsernameAsync(username: username);
|
var er_list = await _repository.ReadByUsernameAsync(username: username, min_status: min_status, max_status: max_status, ignore_statuses: ignore_statuses);
|
||||||
var dto_list = _mapper.MapOrThrow<IEnumerable<EnvelopeReceiverDto>>(er_list);
|
var dto_list = _mapper.Map<IEnumerable<EnvelopeReceiverDto>>(er_list);
|
||||||
return Result.Success(dto_list);
|
return Result.Success(dto_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<DataResult<string?>> ReadLastUsedReceiverNameByMail(string mail)
|
||||||
|
{
|
||||||
|
var er = await _repository.ReadLastByReceiver(mail);
|
||||||
|
return er is null ? Result.Fail<string?>().Notice(LogLevel.None, Flag.NotFound) : Result.Success(er.Name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,27 +3,22 @@ using DigitalData.Core.Application;
|
|||||||
using DigitalData.Core.DTO;
|
using DigitalData.Core.DTO;
|
||||||
using EnvelopeGenerator.Application.Contracts;
|
using EnvelopeGenerator.Application.Contracts;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Application.Resources;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
using EnvelopeGenerator.Infrastructure.Contracts;
|
||||||
using Microsoft.Extensions.Localization;
|
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Services
|
namespace EnvelopeGenerator.Application.Services
|
||||||
{
|
{
|
||||||
public class EnvelopeService : BasicCRUDService<IEnvelopeRepository, EnvelopeDto, Envelope, int>, IEnvelopeService
|
public class EnvelopeService : BasicCRUDService<IEnvelopeRepository, EnvelopeDto, Envelope, int>, IEnvelopeService
|
||||||
{
|
{
|
||||||
private readonly ILogger _logger;
|
public EnvelopeService(IEnvelopeRepository repository, IMapper mapper)
|
||||||
public EnvelopeService(IEnvelopeRepository repository, IMapper mapper, ILogger<EnvelopeService> logger)
|
|
||||||
: base(repository, mapper)
|
: base(repository, mapper)
|
||||||
{
|
{
|
||||||
_logger = logger;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<DataResult<IEnumerable<EnvelopeDto>>> ReadAllWithAsync(bool documents = false, bool history = false, bool documentReceiverElement = false)
|
public async Task<DataResult<IEnumerable<EnvelopeDto>>> ReadAllWithAsync(bool documents = false, bool history = false, bool documentReceiverElement = false)
|
||||||
{
|
{
|
||||||
var envelopes = await _repository.ReadAllWithAsync(documents: documents, history: history, documentReceiverElement: documentReceiverElement);
|
var envelopes = await _repository.ReadAllWithAsync(documents: documents, history: history, documentReceiverElement: documentReceiverElement);
|
||||||
var readDto = _mapper.MapOrThrow<IEnumerable<EnvelopeDto>>(envelopes);
|
var readDto = _mapper.Map<IEnumerable<EnvelopeDto>>(envelopes);
|
||||||
return Result.Success(readDto);
|
return Result.Success(readDto);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -34,7 +29,14 @@ namespace EnvelopeGenerator.Application.Services
|
|||||||
if (envelope is null)
|
if (envelope is null)
|
||||||
return Result.Fail<EnvelopeDto>();
|
return Result.Fail<EnvelopeDto>();
|
||||||
|
|
||||||
var readDto = _mapper.MapOrThrow<EnvelopeDto>(envelope);
|
var readDto = _mapper.Map<EnvelopeDto>(envelope);
|
||||||
|
return Result.Success(readDto);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<DataResult<IEnumerable<EnvelopeDto>>> ReadByUserAsync(int userId, int? min_status = null, int? max_status = null, params int[] ignore_statuses)
|
||||||
|
{
|
||||||
|
var users = await _repository.ReadByUserAsync(userId: userId, min_status: min_status, max_status: max_status, ignore_statuses: ignore_statuses);
|
||||||
|
var readDto = _mapper.Map<IEnumerable<EnvelopeDto>>(users);
|
||||||
return Result.Success(readDto);
|
return Result.Success(readDto);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +1,30 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using DigitalData.Core.Application;
|
using DigitalData.Core.Application;
|
||||||
using Microsoft.Extensions.Localization;
|
|
||||||
using EnvelopeGenerator.Application.Contracts;
|
using EnvelopeGenerator.Application.Contracts;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
using EnvelopeGenerator.Infrastructure.Contracts;
|
||||||
using EnvelopeGenerator.Application.Resources;
|
using Microsoft.Extensions.Caching.Memory;
|
||||||
|
using DigitalData.Core.DTO;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Services
|
namespace EnvelopeGenerator.Application.Services
|
||||||
{
|
{
|
||||||
public class EnvelopeTypeService : BasicCRUDService<IEnvelopeTypeRepository, EnvelopeTypeDto, EnvelopeType, int>, IEnvelopeTypeService
|
public class EnvelopeTypeService : BasicCRUDService<IEnvelopeTypeRepository, EnvelopeTypeDto, EnvelopeType, int>, IEnvelopeTypeService
|
||||||
{
|
{
|
||||||
public EnvelopeTypeService(IEnvelopeTypeRepository repository, IMapper mapper)
|
private static readonly Guid CacheKey = Guid.NewGuid();
|
||||||
|
|
||||||
|
private readonly IMemoryCache _cache;
|
||||||
|
|
||||||
|
public EnvelopeTypeService(IEnvelopeTypeRepository repository, IMapper mapper, IMemoryCache cache)
|
||||||
: base(repository, mapper)
|
: base(repository, mapper)
|
||||||
{
|
{
|
||||||
|
_cache = cache;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override async Task<DataResult<IEnumerable<EnvelopeTypeDto>>> ReadAllAsync()
|
||||||
|
=> await _cache.GetOrCreateAsync(CacheKey, async entry => await base.ReadAllAsync())
|
||||||
|
?? Result.Fail<IEnumerable<EnvelopeTypeDto>>().Notice(LogLevel.Error, Flag.NotFound, "No cached envelope types are available in the database. If you have added any envelope types after the server started, please restart the server.");
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,20 +1,38 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using DigitalData.Core.Application;
|
using DigitalData.Core.Application;
|
||||||
using Microsoft.Extensions.Localization;
|
|
||||||
using EnvelopeGenerator.Application.Contracts;
|
using EnvelopeGenerator.Application.Contracts;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
using EnvelopeGenerator.Infrastructure.Contracts;
|
||||||
using EnvelopeGenerator.Application.Resources;
|
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using DigitalData.Core.DTO;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Services
|
namespace EnvelopeGenerator.Application.Services
|
||||||
{
|
{
|
||||||
public class ReceiverService : BasicCRUDService<IReceiverRepository, ReceiverDto, Receiver, int>, IReceiverService
|
public class ReceiverService : CRUDService<IReceiverRepository, ReceiverCreateDto, ReceiverReadDto, ReceiverUpdateDto, Receiver, int>, IReceiverService
|
||||||
{
|
{
|
||||||
public ReceiverService(IReceiverRepository repository, IStringLocalizer<Resource> localizer, IMapper mapper)
|
public ReceiverService(IReceiverRepository repository, IMapper mapper)
|
||||||
: base(repository, mapper)
|
: base(repository, mapper)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<DataResult<ReceiverReadDto>> ReadByAsync(string? emailAddress = null, string? signature = null)
|
||||||
|
{
|
||||||
|
var rcv = await _repository.ReadByAsync(emailAddress: emailAddress, signature: signature);
|
||||||
|
|
||||||
|
if (rcv is null)
|
||||||
|
return Result.Fail<ReceiverReadDto>();
|
||||||
|
|
||||||
|
return Result.Success(_mapper.Map<ReceiverReadDto>(rcv));
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<Result> DeleteByAsync(string? emailAddress = null, string? signature = null)
|
||||||
|
{
|
||||||
|
var rcv = await _repository.ReadByAsync(emailAddress: emailAddress, signature: signature);
|
||||||
|
|
||||||
|
if (rcv is null)
|
||||||
|
return Result.Fail();
|
||||||
|
|
||||||
|
return await _repository.DeleteAsync(rcv) ? Result.Success() : Result.Fail();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,17 +1,15 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using DigitalData.Core.Application;
|
using DigitalData.Core.Application;
|
||||||
using Microsoft.Extensions.Localization;
|
|
||||||
using EnvelopeGenerator.Application.Contracts;
|
using EnvelopeGenerator.Application.Contracts;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
using EnvelopeGenerator.Infrastructure.Contracts;
|
||||||
using EnvelopeGenerator.Application.Resources;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Services
|
namespace EnvelopeGenerator.Application.Services
|
||||||
{
|
{
|
||||||
public class UserReceiverService : BasicCRUDService<IUserReceiverRepository, UserReceiverDto, UserReceiver, int>, IUserReceiverService
|
public class UserReceiverService : BasicCRUDService<IUserReceiverRepository, UserReceiverDto, UserReceiver, int>, IUserReceiverService
|
||||||
{
|
{
|
||||||
public UserReceiverService(IUserReceiverRepository repository, IStringLocalizer<Resource> localizer, IMapper mapper)
|
public UserReceiverService(IUserReceiverRepository repository, IMapper mapper)
|
||||||
: base(repository, mapper)
|
: base(repository, mapper)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
Public Class Constants
|
Public Class Constants
|
||||||
|
|
||||||
#Region "Status Fields"
|
#Region "Status Fields"
|
||||||
|
'http://wiki.dd/xwiki13/bin/view/Anwendungen/Produkt-Handbuch/Sonstiges/SignFlow/Envelope%20Status/
|
||||||
Public Enum EnvelopeStatus
|
Public Enum EnvelopeStatus
|
||||||
Invalid = 0
|
Invalid = 0
|
||||||
EnvelopeCreated = 1001
|
EnvelopeCreated = 1001
|
||||||
@@ -19,6 +20,8 @@
|
|||||||
DocumentSigned = 2005
|
DocumentSigned = 2005
|
||||||
SignatureConfirmed = 2006
|
SignatureConfirmed = 2006
|
||||||
DocumentRejected = 2007
|
DocumentRejected = 2007
|
||||||
|
EnvelopeShared = 2008
|
||||||
|
EnvelopeViewed = 2009
|
||||||
MessageInvitationSent = 3001 ' Wird von Trigger verwendet
|
MessageInvitationSent = 3001 ' Wird von Trigger verwendet
|
||||||
MessageAccessCodeSent = 3002
|
MessageAccessCodeSent = 3002
|
||||||
MessageConfirmationSent = 3003
|
MessageConfirmationSent = 3003
|
||||||
@@ -26,6 +29,7 @@
|
|||||||
MessageCompletionSent = 3005
|
MessageCompletionSent = 3005
|
||||||
End Enum
|
End Enum
|
||||||
|
|
||||||
|
'TODO: standardize in xwiki
|
||||||
Public Enum ReferenceType
|
Public Enum ReferenceType
|
||||||
Receiver
|
Receiver
|
||||||
Sender
|
Sender
|
||||||
@@ -93,6 +97,13 @@
|
|||||||
DocumentDeleted
|
DocumentDeleted
|
||||||
DocumentCompleted
|
DocumentCompleted
|
||||||
DocumentAccessCodeReceived
|
DocumentAccessCodeReceived
|
||||||
|
DocumentShared
|
||||||
|
End Enum
|
||||||
|
|
||||||
|
Public Enum EncodeType
|
||||||
|
EnvelopeReceiver
|
||||||
|
EnvelopeReceiverReadOnly
|
||||||
|
Undefined
|
||||||
End Enum
|
End Enum
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
@@ -102,6 +113,7 @@
|
|||||||
Public Const DATABASE = "DATABASE"
|
Public Const DATABASE = "DATABASE"
|
||||||
Public Const LOGCONFIG = "LOGCONFIG"
|
Public Const LOGCONFIG = "LOGCONFIG"
|
||||||
Public Const GDPICTURE = "GDPICTURE"
|
Public Const GDPICTURE = "GDPICTURE"
|
||||||
|
Public Const IGNORED_LABELS = "IgnoredLabels"
|
||||||
|
|
||||||
Public Const GREEN_300 = "#bbf7d0"
|
Public Const GREEN_300 = "#bbf7d0"
|
||||||
Public Const RED_300 = "#fecaca"
|
Public Const RED_300 = "#fecaca"
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ Public Class EmailData
|
|||||||
Public Property EnvelopeTitle As String = ""
|
Public Property EnvelopeTitle As String = ""
|
||||||
|
|
||||||
Public Property EmailAttachment As String = ""
|
Public Property EmailAttachment As String = ""
|
||||||
|
Public Property ATT1_RELATED_ID As Long
|
||||||
|
Public Property ATT1_REL_TYPE As String = ""
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructor for sending email to receiver
|
''' Constructor for sending email to receiver
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
Public Property Receivers As New List(Of EnvelopeReceiver)
|
Public Property Receivers As New List(Of EnvelopeReceiver)
|
||||||
Public Property History As New List(Of EnvelopeHistoryEntry)
|
Public Property History As New List(Of EnvelopeHistoryEntry)
|
||||||
Public Property EnvelopeType As EnvelopeType
|
Public Property EnvelopeType As EnvelopeType
|
||||||
|
Public Property DOC_RESULT As Byte()
|
||||||
Public ReadOnly Property EnvelopeTypeTitle As String
|
Public ReadOnly Property EnvelopeTypeTitle As String
|
||||||
Get
|
Get
|
||||||
Return EnvelopeType?.Title
|
Return EnvelopeType?.Title
|
||||||
|
|||||||
@@ -19,4 +19,5 @@ Public Class EnvelopeDocument
|
|||||||
Public Property Filepath As String
|
Public Property Filepath As String
|
||||||
|
|
||||||
Public Property PageCount As Integer
|
Public Property PageCount As Integer
|
||||||
|
Public Property Byte_Data As Byte()
|
||||||
End Class
|
End Class
|
||||||
@@ -13,6 +13,8 @@
|
|||||||
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
||||||
<Deterministic>true</Deterministic>
|
<Deterministic>true</Deterministic>
|
||||||
<TargetFrameworkProfile />
|
<TargetFrameworkProfile />
|
||||||
|
<NuGetPackageImportStamp>
|
||||||
|
</NuGetPackageImportStamp>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
@@ -63,22 +65,20 @@
|
|||||||
<Reference Include="DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
<Reference Include="DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
||||||
<Reference Include="DevExpress.XtraGauges.v21.2.Core, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
<Reference Include="DevExpress.XtraGauges.v21.2.Core, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||||
<Reference Include="DevExpress.XtraReports.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
<Reference Include="DevExpress.XtraReports.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||||
<Reference Include="DigitalData.Modules.Base, Version=1.3.4.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="DigitalData.Modules.Base">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<HintPath>..\..\2_DLL Projekte\DDModules\Base\bin\Debug\DigitalData.Modules.Base.dll</HintPath>
|
||||||
<HintPath>..\..\DDModules\Base\bin\Debug\DigitalData.Modules.Base.dll</HintPath>
|
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="DigitalData.Modules.Config">
|
<Reference Include="DigitalData.Modules.Config">
|
||||||
<HintPath>..\..\DDModules\Config\bin\Debug\DigitalData.Modules.Config.dll</HintPath>
|
<HintPath>..\..\2_DLL Projekte\DDModules\Config\bin\Debug\DigitalData.Modules.Config.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="DigitalData.Modules.Database">
|
<Reference Include="DigitalData.Modules.Database">
|
||||||
<HintPath>..\..\DDModules\Database\bin\Debug\DigitalData.Modules.Database.dll</HintPath>
|
<HintPath>..\..\2_DLL Projekte\DDModules\Database\bin\Debug\DigitalData.Modules.Database.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="DigitalData.Modules.Logging, Version=2.6.2.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="DigitalData.Modules.Logging">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<HintPath>..\..\2_DLL Projekte\DDModules\Logging\bin\Debug\DigitalData.Modules.Logging.dll</HintPath>
|
||||||
<HintPath>..\..\DDModules\Logging\bin\Debug\DigitalData.Modules.Logging.dll</HintPath>
|
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="GdPicture.NET.14">
|
<Reference Include="GdPicture.NET.14, Version=14.2.89.0, Culture=neutral, PublicKeyToken=f52a2e60ad468dbb, processorArchitecture=MSIL">
|
||||||
<HintPath>D:\ProgramFiles\GdPicture.NET 14\Redist\GdPicture.NET (.NET Framework 4.5)\GdPicture.NET.14.dll</HintPath>
|
<HintPath>..\packages\GdPicture.14.2.89\lib\net462\GdPicture.NET.14.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=2.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=2.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
@@ -220,6 +220,8 @@
|
|||||||
<DesignTime>True</DesignTime>
|
<DesignTime>True</DesignTime>
|
||||||
<DependentUpon>Model.resx</DependentUpon>
|
<DependentUpon>Model.resx</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Strings\Model.vb" />
|
||||||
|
<Compile Include="TempFiles.vb" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="My Project\licenses.licx" />
|
<EmbeddedResource Include="My Project\licenses.licx" />
|
||||||
@@ -241,11 +243,13 @@
|
|||||||
<Generator>PublicResXFileCodeGenerator</Generator>
|
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||||
<LastGenOutput>Envelope.en.Designer.vb</LastGenOutput>
|
<LastGenOutput>Envelope.en.Designer.vb</LastGenOutput>
|
||||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="Strings\Envelope.resx">
|
<EmbeddedResource Include="Strings\Envelope.resx">
|
||||||
<Generator>PublicResXFileCodeGenerator</Generator>
|
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||||
<LastGenOutput>Envelope1.Designer.vb</LastGenOutput>
|
<LastGenOutput>Envelope1.Designer.vb</LastGenOutput>
|
||||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="Strings\Email.resx">
|
<EmbeddedResource Include="Strings\Email.resx">
|
||||||
<Generator>PublicResXFileCodeGenerator</Generator>
|
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||||
@@ -285,4 +289,11 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup />
|
<ItemGroup />
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||||
|
<Import Project="..\packages\GdPicture.runtimes.windows.14.2.89\build\net462\GdPicture.runtimes.windows.targets" Condition="Exists('..\packages\GdPicture.runtimes.windows.14.2.89\build\net462\GdPicture.runtimes.windows.targets')" />
|
||||||
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
|
<PropertyGroup>
|
||||||
|
<ErrorText>Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Verwenden Sie die Wiederherstellung von NuGet-Paketen, um die fehlenden Dateien herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}".</ErrorText>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Error Condition="!Exists('..\packages\GdPicture.runtimes.windows.14.2.89\build\net462\GdPicture.runtimes.windows.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\GdPicture.runtimes.windows.14.2.89\build\net462\GdPicture.runtimes.windows.targets'))" />
|
||||||
|
</Target>
|
||||||
</Project>
|
</Project>
|
||||||
@@ -7,15 +7,9 @@ Imports System.Security.Cryptography
|
|||||||
Imports System.IO
|
Imports System.IO
|
||||||
Imports EnvelopeGenerator.Common.Jobs.FinalizeDocument.FinalizeDocumentExceptions
|
Imports EnvelopeGenerator.Common.Jobs.FinalizeDocument.FinalizeDocumentExceptions
|
||||||
Imports EnvelopeGenerator.Common.Jobs.FinalizeDocument
|
Imports EnvelopeGenerator.Common.Jobs.FinalizeDocument
|
||||||
Imports EnvelopeGenerator.Common.My.Resources
|
|
||||||
Imports EnvelopeGenerator.Common.Constants
|
Imports EnvelopeGenerator.Common.Constants
|
||||||
Imports DevExpress.XtraBars.Docking
|
|
||||||
Imports System.ServiceModel
|
|
||||||
Imports DevExpress.XtraRichEdit.Export
|
|
||||||
Imports DevExpress.Pdf.Native.BouncyCastle.Asn1.Cms
|
|
||||||
Imports DevExpress.DataAccess.Sql
|
|
||||||
Imports DevExpress.DataProcessing
|
Imports DevExpress.DataProcessing
|
||||||
Imports Quartz.Logging.OperationName
|
Imports System.Data.SqlClient
|
||||||
|
|
||||||
Namespace Jobs
|
Namespace Jobs
|
||||||
Public Class FinalizeDocumentJob
|
Public Class FinalizeDocumentJob
|
||||||
@@ -39,13 +33,16 @@ Namespace Jobs
|
|||||||
Private PDFMerger As PDFMerger
|
Private PDFMerger As PDFMerger
|
||||||
Private ReportCreator As ReportCreator
|
Private ReportCreator As ReportCreator
|
||||||
|
|
||||||
Private ReadOnly CompleteWaitTime As Integer = 5
|
Private ReadOnly CompleteWaitTime As Integer = 1
|
||||||
Private ParentFolderUID As String = ""
|
Private ParentFolderUID As String = ""
|
||||||
|
Private myTempFiles As TempFiles
|
||||||
|
|
||||||
Private Class EnvelopeData
|
Private Class EnvelopeData
|
||||||
Public EnvelopeId As Integer
|
Public EnvelopeId As Integer
|
||||||
|
Public EnvelopeUUID As String
|
||||||
Public DocumentPath As String
|
Public DocumentPath As String
|
||||||
Public AnnotationData As List(Of String)
|
Public AnnotationData As List(Of String)
|
||||||
|
Public DocAsByte As Byte()
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
@@ -53,7 +50,8 @@ Namespace Jobs
|
|||||||
Dim oGdPictureKey As String = pContext.MergedJobDataMap.Item(Constants.GDPICTURE)
|
Dim oGdPictureKey As String = pContext.MergedJobDataMap.Item(Constants.GDPICTURE)
|
||||||
LogConfig = pContext.MergedJobDataMap.Item(Constants.LOGCONFIG)
|
LogConfig = pContext.MergedJobDataMap.Item(Constants.LOGCONFIG)
|
||||||
Logger = LogConfig.GetLogger()
|
Logger = LogConfig.GetLogger()
|
||||||
|
myTempFiles = New TempFiles(LogConfig)
|
||||||
|
myTempFiles.Create()
|
||||||
Dim JobId = pContext.JobDetail.Key
|
Dim JobId = pContext.JobDetail.Key
|
||||||
Logger.Info("Starting job {0}", JobId)
|
Logger.Info("Starting job {0}", JobId)
|
||||||
|
|
||||||
@@ -76,7 +74,8 @@ Namespace Jobs
|
|||||||
InitializeServices(oState)
|
InitializeServices(oState)
|
||||||
|
|
||||||
Logger.Debug("Loading PDFBurner..")
|
Logger.Debug("Loading PDFBurner..")
|
||||||
PDFBurner = New PDFBurner(LogConfig, oGdPictureKey)
|
Dim ignoredLabels As List(Of String) = pContext.MergedJobDataMap.Item(Constants.IGNORED_LABELS)
|
||||||
|
PDFBurner = New PDFBurner(LogConfig, oGdPictureKey, ignoredLabels)
|
||||||
|
|
||||||
Logger.Debug("Loading PDFMerger..")
|
Logger.Debug("Loading PDFMerger..")
|
||||||
PDFMerger = New PDFMerger(LogConfig, oGdPictureKey)
|
PDFMerger = New PDFMerger(LogConfig, oGdPictureKey)
|
||||||
@@ -86,6 +85,7 @@ Namespace Jobs
|
|||||||
Logger.Debug("My.Settings.RuninDMZ: [{0}]", My.Settings.RuninDMZ.ToString)
|
Logger.Debug("My.Settings.RuninDMZ: [{0}]", My.Settings.RuninDMZ.ToString)
|
||||||
Logger.Debug("My.Settings.NetUse_Usr: [{0}]", My.Settings.NetUse_Usr)
|
Logger.Debug("My.Settings.NetUse_Usr: [{0}]", My.Settings.NetUse_Usr)
|
||||||
|
|
||||||
|
|
||||||
If My.Settings.RuninDMZ = True Then
|
If My.Settings.RuninDMZ = True Then
|
||||||
If Config.DocumentPath_DMZ <> String.Empty Then
|
If Config.DocumentPath_DMZ <> String.Empty Then
|
||||||
Logger.Debug("RuninDMZ - Using DocumentPath_DMZ: [{0}] - Overwrite Document-Path", Config.DocumentPath_DMZ)
|
Logger.Debug("RuninDMZ - Using DocumentPath_DMZ: [{0}] - Overwrite Document-Path", Config.DocumentPath_DMZ)
|
||||||
@@ -126,7 +126,7 @@ Namespace Jobs
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
Dim oCompleteStatus As Integer = Constants.EnvelopeStatus.EnvelopeCompletelySigned
|
Dim oCompleteStatus As Integer = Constants.EnvelopeStatus.EnvelopeCompletelySigned
|
||||||
Dim oSql = $"SELECT * FROM TBSIG_ENVELOPE WHERE STATUS = {oCompleteStatus} AND DATEDIFF(minute, CHANGED_WHEN, GETDATE()) >= {CompleteWaitTime}"
|
Dim oSql = $"SELECT * FROM TBSIG_ENVELOPE WHERE STATUS = {oCompleteStatus} AND DATEDIFF(minute, CHANGED_WHEN, GETDATE()) >= {CompleteWaitTime} ORDER BY GUID"
|
||||||
Dim oTable = Database.GetDatatable(oSql)
|
Dim oTable = Database.GetDatatable(oSql)
|
||||||
|
|
||||||
Dim oEnvelopeIds As List(Of Integer) = oTable.Rows.Cast(Of DataRow).
|
Dim oEnvelopeIds As List(Of Integer) = oTable.Rows.Cast(Of DataRow).
|
||||||
@@ -142,99 +142,83 @@ Namespace Jobs
|
|||||||
Dim oCurrent As Integer = 1
|
Dim oCurrent As Integer = 1
|
||||||
|
|
||||||
For Each oId In oEnvelopeIds
|
For Each oId In oEnvelopeIds
|
||||||
|
|
||||||
Logger.Info("Finalizing Envelope [{0}] ({1}/{2})", oId, oCurrent, oTotal)
|
Logger.Info("Finalizing Envelope [{0}] ({1}/{2})", oId, oCurrent, oTotal)
|
||||||
|
|
||||||
Logger.Debug("Loading Envelope..")
|
Logger.Debug("Loading Envelope..")
|
||||||
Dim oEnvelope = EnvelopeModel.GetById(oId)
|
|
||||||
|
|
||||||
If oEnvelope Is Nothing Then
|
|
||||||
Logger.Warn("Envelope could not be loaded for Id [{0}]!", oId)
|
|
||||||
Throw New ArgumentNullException("EnvelopeData")
|
|
||||||
End If
|
|
||||||
|
|
||||||
Logger.Debug("Loading Envelope Data..")
|
|
||||||
Dim oEnvelopeData = GetEnvelopeData(oId)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
If oEnvelopeData Is Nothing Then
|
|
||||||
Logger.Warn("EnvelopeData could not be loaded for Id [{0}]!", oId)
|
|
||||||
Throw New ArgumentNullException("EnvelopeData")
|
|
||||||
End If
|
|
||||||
If Config.DOCUMENT_PATH_MOVE_AFTSEND <> String.Empty Then
|
|
||||||
oEnvelopeData.DocumentPath.Replace(Config.DocumentPathOrigin, Config.DOCUMENT_PATH_MOVE_AFTSEND)
|
|
||||||
Logger.Debug("Replaced Path in oEnvelopeData.DocumentPath!")
|
|
||||||
End If
|
|
||||||
Logger.Debug("Burning Annotations to pdf ...")
|
|
||||||
Dim oBurnedDocument As Byte() = BurnAnnotationsToPdf(oEnvelopeData)
|
|
||||||
If oBurnedDocument Is Nothing Then
|
|
||||||
Logger.Warn("Document could not be finalized!")
|
|
||||||
Throw New ApplicationException("Document could not be finalized")
|
|
||||||
End If
|
|
||||||
|
|
||||||
If ActionService.CreateReport(oEnvelope) = False Then
|
|
||||||
Logger.Warn("Document Report could not be created!")
|
|
||||||
Throw New ApplicationException("Document Report could not be created")
|
|
||||||
End If
|
|
||||||
|
|
||||||
Logger.Debug("Creating report..")
|
|
||||||
Dim oReport As Byte() = ReportCreator.CreateReport(oEnvelope)
|
|
||||||
Logger.Debug("Report created!")
|
|
||||||
|
|
||||||
Logger.Debug("Merging documents ...")
|
|
||||||
Dim oMergedDocument As Byte() = PDFMerger.MergeDocuments(oBurnedDocument, oReport)
|
|
||||||
Logger.Debug("Documents merged!")
|
|
||||||
|
|
||||||
Dim oOutputDirectoryPath = Path.Combine(Config.ExportPath, ParentFolderUID)
|
|
||||||
If Not Directory.Exists(oOutputDirectoryPath) Then
|
|
||||||
Directory.CreateDirectory(oOutputDirectoryPath)
|
|
||||||
End If
|
|
||||||
Dim oOutputFilePath = Path.Combine(oOutputDirectoryPath, $"{oEnvelope.Uuid}.pdf")
|
|
||||||
Logger.Info("Writing finalized Pdf to disk..")
|
|
||||||
Logger.Info("Output path is [{0}]", oOutputFilePath)
|
|
||||||
|
|
||||||
Try
|
Try
|
||||||
File.WriteAllBytes(oOutputFilePath, oMergedDocument)
|
Dim oEnvelope = EnvelopeModel.GetById(oId)
|
||||||
Catch ex As Exception
|
If oEnvelope Is Nothing Then
|
||||||
Logger.Warn("Could not export final document to disk!")
|
Logger.Warn("Envelope could not be loaded for Id [{0}]!", oId)
|
||||||
Throw New ExportDocumentException("Could not export final document to disk!", ex)
|
Throw New ArgumentNullException("EnvelopeData")
|
||||||
End Try
|
End If
|
||||||
|
Logger.Debug("Loading Envelope Data..")
|
||||||
|
Dim oEnvelopeData = GetEnvelopeData(oId)
|
||||||
|
|
||||||
|
If oEnvelopeData Is Nothing Then
|
||||||
|
Logger.Warn("EnvelopeData could not be loaded for Id [{0}]!", oId)
|
||||||
|
Throw New ArgumentNullException("EnvelopeData")
|
||||||
|
End If
|
||||||
|
If Config.DOCUMENT_PATH_MOVE_AFTSEND <> String.Empty Then
|
||||||
|
oEnvelopeData.DocumentPath.Replace(Config.DocumentPathOrigin, Config.DOCUMENT_PATH_MOVE_AFTSEND)
|
||||||
|
Logger.Debug("Replaced Path in oEnvelopeData.DocumentPath!")
|
||||||
|
End If
|
||||||
|
Logger.Debug("Burning Annotations to pdf ...")
|
||||||
|
Dim oBurnedDocument As Byte() = BurnAnnotationsToPdf(oEnvelopeData)
|
||||||
|
If oBurnedDocument Is Nothing Then
|
||||||
|
Logger.Warn("Document could not be finalized!")
|
||||||
|
Throw New ApplicationException("Document could not be finalized")
|
||||||
|
End If
|
||||||
|
|
||||||
|
If ActionService.CreateReport(oEnvelope) = False Then
|
||||||
|
Logger.Warn("Document Report could not be created!")
|
||||||
|
Throw New ApplicationException("Document Report could not be created")
|
||||||
|
End If
|
||||||
|
|
||||||
If Config.NetUse_Finish = True Then
|
Logger.Debug("Creating report..")
|
||||||
If Config.FINISHED_PATH_EX_DMZ <> String.Empty Then
|
Dim oReport As Byte() = ReportCreator.CreateReport(oEnvelope)
|
||||||
If My.Settings.NetUse_PW <> String.Empty And My.Settings.NetUse_Usr <> String.Empty Then
|
Logger.Debug("Report created!")
|
||||||
Clean_DNZ_PAth(Config.FINISHED_PATH_EX_DMZ)
|
|
||||||
'Dim oReturnPath = MoveFileWithNetUse(Config.FINISHED_PATH_EX_DMZ, oOutputFilePath, My.Settings.NetUse_Usr, My.Settings.NetUse_PW)
|
Logger.Debug("Merging documents ...")
|
||||||
'If oReturnPath <> String.Empty Then
|
Dim oMergedDocument As Byte() = PDFMerger.MergeDocuments(oBurnedDocument, oReport)
|
||||||
' oOutputFilePath = oReturnPath
|
Logger.Debug("Documents merged!")
|
||||||
' If Config.EML_PATH_EX_DMZ <> String.Empty Then
|
|
||||||
' Logger.Debug($"Now replacing [{Config.FINISHED_PATH_EX_DMZ}] with ")
|
Dim oOutputDirectoryPath = Path.Combine(Config.ExportPath, ParentFolderUID)
|
||||||
' Logger.Debug($"............. [{Config.EML_PATH_EX_DMZ}] ")
|
If Not Directory.Exists(oOutputDirectoryPath) Then
|
||||||
' oOutputFilePath = oOutputFilePath.Replace(Config.FINISHED_PATH_EX_DMZ, Config.EML_PATH_EX_DMZ)
|
Directory.CreateDirectory(oOutputDirectoryPath)
|
||||||
' Logger.Debug($"oOutputFilePath [{oOutputFilePath}] ")
|
End If
|
||||||
' End If
|
Dim oOutputFilePath = Path.Combine(oOutputDirectoryPath, $"{oEnvelope.Uuid}.pdf")
|
||||||
'Else
|
Logger.Info("Writing finalized Pdf to disk..")
|
||||||
' Logger.Info($"Exiting/Aborting FinalizeDocuments!")
|
Logger.Info("Output path is [{0}]", oOutputFilePath)
|
||||||
' Return Task.FromResult(False)
|
|
||||||
'End If
|
Try
|
||||||
|
File.WriteAllBytes(oOutputFilePath, oMergedDocument)
|
||||||
|
Catch ex As Exception
|
||||||
|
Logger.Warn("Could not export final document to disk!")
|
||||||
|
Throw New ExportDocumentException("Could not export final document to disk!", ex)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
If Config.NetUse_Finish = True Then
|
||||||
|
If Config.FINISHED_PATH_EX_DMZ <> String.Empty Then
|
||||||
|
If My.Settings.NetUse_PW <> String.Empty And My.Settings.NetUse_Usr <> String.Empty Then
|
||||||
|
Clean_DNZ_PAth(Config.FINISHED_PATH_EX_DMZ)
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
Logger.Info("Writing EB-bytes to database...")
|
||||||
|
Update_File_DB(oOutputFilePath, oEnvelope.Id)
|
||||||
|
|
||||||
Logger.Info("Sending finalized report-mails..")
|
Logger.Info("Sending finalized report-mails..")
|
||||||
|
If SendFinalEmails(oEnvelope) = False Then ', oOutputFilePath
|
||||||
|
Throw New ApplicationException("Final emails could not be sent!")
|
||||||
|
End If
|
||||||
|
Logger.Debug("Setting envelope status..")
|
||||||
|
If ActionService.FinalizeEnvelope(oEnvelope) = False Then
|
||||||
|
Logger.Warn("Envelope could not be finalized!")
|
||||||
|
Throw New ApplicationException("Envelope could not be finalized")
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
Logger.Warn($"Unhandled exception while working envelope [{oId}] - [{ex.Message}]")
|
||||||
|
End Try
|
||||||
|
|
||||||
If SendFinalEmails(oEnvelope, oOutputFilePath) = False Then
|
|
||||||
Throw New ApplicationException("Final emails could not be sent!")
|
|
||||||
End If
|
|
||||||
|
|
||||||
Logger.Debug("Setting envelope status..")
|
|
||||||
If ActionService.FinalizeEnvelope(oEnvelope) = False Then
|
|
||||||
Logger.Warn("Envelope could not be finalized!")
|
|
||||||
Throw New ApplicationException("Envelope could not be finalized")
|
|
||||||
End If
|
|
||||||
|
|
||||||
oCurrent += 1
|
oCurrent += 1
|
||||||
Logger.Info("Envelope finalized!")
|
Logger.Info("Envelope finalized!")
|
||||||
@@ -259,6 +243,50 @@ Namespace Jobs
|
|||||||
|
|
||||||
Return Task.FromResult(True)
|
Return Task.FromResult(True)
|
||||||
End Function
|
End Function
|
||||||
|
Private Sub Update_File_DB(pFilePath As String, pEnvelopeID As Long)
|
||||||
|
Dim SqlCom As SqlCommand
|
||||||
|
Dim imageData As Byte()
|
||||||
|
Dim sFileName As String
|
||||||
|
Dim qry As String
|
||||||
|
|
||||||
|
Try
|
||||||
|
'Read Image Bytes into a byte array
|
||||||
|
'Initialize SQL Server Connection
|
||||||
|
|
||||||
|
'Convert File to bytes Array
|
||||||
|
imageData = ReadFile(pFilePath)
|
||||||
|
If Not IsNothing(imageData) Then
|
||||||
|
sFileName = System.IO.Path.GetFileName(pFilePath)
|
||||||
|
'Set insert query
|
||||||
|
qry = $"UPDATE TBSIG_ENVELOPE SET DOC_RESULT = @ImageData WHERE GUID = {pEnvelopeID}"
|
||||||
|
'Initialize SqlCommand object for insert.
|
||||||
|
SqlCom = New SqlCommand(qry, Database.GetConnection)
|
||||||
|
'We are passing File Name and Image byte data as sql parameters.
|
||||||
|
SqlCom.Parameters.Add(New SqlParameter("@ImageData", DirectCast(imageData, Object)))
|
||||||
|
'Execute the Query
|
||||||
|
SqlCom.ExecuteNonQuery()
|
||||||
|
End If
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
Logger.Error(ex)
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
'Open file in to a filestream and read data in a byte array.
|
||||||
|
Private Function ReadFile(ByVal sPath As String) As Byte()
|
||||||
|
'Initialize byte array with a null value initially.
|
||||||
|
Dim data As Byte() = Nothing
|
||||||
|
'Use FileInfo object to get file size.
|
||||||
|
Dim fInfo As New FileInfo(sPath)
|
||||||
|
Dim numBytes As Long = fInfo.Length
|
||||||
|
'Open FileStream to read file
|
||||||
|
Dim fStream As New FileStream(sPath, FileMode.Open, FileAccess.Read)
|
||||||
|
'Use BinaryReader to read file stream into byte array.
|
||||||
|
Dim br As New BinaryReader(fStream)
|
||||||
|
'When you use BinaryReader, you need to supply number of bytes to read from file.
|
||||||
|
'In this case we want to read entire file. So supplying total number of bytes.
|
||||||
|
data = br.ReadBytes(CInt(numBytes))
|
||||||
|
Return data
|
||||||
|
End Function
|
||||||
Private Function NetUse_Command(pDestinationPath As String, pUsername As String, pPassword As String)
|
Private Function NetUse_Command(pDestinationPath As String, pUsername As String, pPassword As String)
|
||||||
Dim oDectryptedPW = Helpers.Decrypt(My.Settings.NetUse_PW)
|
Dim oDectryptedPW = Helpers.Decrypt(My.Settings.NetUse_PW)
|
||||||
Dim netUseCommand As String = $"net use {pDestinationPath} /user:{pUsername} {oDectryptedPW}"
|
Dim netUseCommand As String = $"net use {pDestinationPath} /user:{pUsername} {oDectryptedPW}"
|
||||||
@@ -301,35 +329,33 @@ Namespace Jobs
|
|||||||
|
|
||||||
|
|
||||||
End Function
|
End Function
|
||||||
Private Function SendFinalEmails(pEnvelope As Envelope, pAttachment As String) As Boolean
|
Private Function SendFinalEmails(pEnvelope As Envelope) As Boolean ', pAttachment As String
|
||||||
Dim oMailToCreator = pEnvelope.FinalEmailToCreator
|
Dim oMailToCreator = pEnvelope.FinalEmailToCreator
|
||||||
Dim oMailToReceivers = pEnvelope.FinalEmailToReceivers
|
Dim oMailToReceivers = pEnvelope.FinalEmailToReceivers
|
||||||
|
|
||||||
If oMailToCreator <> FinalEmailType.No Then
|
If oMailToCreator <> FinalEmailType.No Then
|
||||||
Logger.Debug("Sending email to creator ...")
|
Logger.Debug("Sending email to creator ...")
|
||||||
SendFinalEmailToCreator(pEnvelope, pAttachment)
|
SendFinalEmailToCreator(pEnvelope) ', pAttachment
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If oMailToReceivers <> FinalEmailType.No Then
|
If oMailToReceivers <> FinalEmailType.No Then
|
||||||
Logger.Debug("Sending emails to receivers..")
|
Logger.Debug("Sending emails to receivers..")
|
||||||
|
SendFinalEmailToReceivers(pEnvelope) ', pAttachment
|
||||||
|
|
||||||
SendFinalEmailToReceivers(pEnvelope, pAttachment)
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function SendFinalEmailToCreator(pEnvelope As Envelope, pAttachment As String) As Boolean
|
Private Function SendFinalEmailToCreator(pEnvelope As Envelope) As Boolean ', pAttachment As String
|
||||||
Dim oIncludeAttachment = SendFinalEmailWithAttachment(pEnvelope.FinalEmailToCreator)
|
Dim oIncludeAttachment = SendFinalEmailWithAttachment(pEnvelope.FinalEmailToCreator)
|
||||||
Dim oAttachment = String.Empty
|
' Dim oAttachment = String.Empty
|
||||||
|
|
||||||
Logger.Debug("Attachment included: [{0}]", oIncludeAttachment)
|
Logger.Debug("Attachment included: [{0}]", oIncludeAttachment)
|
||||||
If oIncludeAttachment Then
|
If oIncludeAttachment Then
|
||||||
oAttachment = pAttachment
|
'oAttachment = pAttachment
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If ActionService.CompleteEnvelope(pEnvelope, oAttachment) = False Then
|
If ActionService.CompleteEnvelope(pEnvelope) = False Then ', oAttachment
|
||||||
Logger.Error("Envelope could not be completed for receiver [{0}]", pEnvelope.User.Email)
|
Logger.Error("Envelope could not be completed for receiver [{0}]", pEnvelope.User.Email)
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
@@ -337,18 +363,18 @@ Namespace Jobs
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function SendFinalEmailToReceivers(pEnvelope As Envelope, pAttachment As String) As Boolean
|
Private Function SendFinalEmailToReceivers(pEnvelope As Envelope) As Boolean ', pAttachment As String
|
||||||
Dim oIncludeAttachment = SendFinalEmailWithAttachment(pEnvelope.FinalEmailToReceivers)
|
Dim oIncludeAttachment = SendFinalEmailWithAttachment(pEnvelope.FinalEmailToReceivers)
|
||||||
Dim oAttachment = String.Empty
|
'Dim oAttachment = String.Empty
|
||||||
|
|
||||||
Logger.Debug("Attachment included: [{0}]", oIncludeAttachment)
|
Logger.Debug("Attachment included: [{0}]", oIncludeAttachment)
|
||||||
If oIncludeAttachment Then
|
If oIncludeAttachment Then
|
||||||
|
|
||||||
oAttachment = pAttachment
|
' oAttachment = pAttachment
|
||||||
End If
|
End If
|
||||||
|
|
||||||
For Each oReceiver In pEnvelope.Receivers
|
For Each oReceiver In pEnvelope.Receivers
|
||||||
If ActionService.CompleteEnvelope(pEnvelope, oReceiver, oAttachment) = False Then
|
If ActionService.CompleteEnvelope(pEnvelope, oReceiver) = False Then ', oAttachment
|
||||||
Logger.Error("Envelope could not be completed for receiver [{0}]", oReceiver.Email)
|
Logger.Error("Envelope could not be completed for receiver [{0}]", oReceiver.Email)
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
@@ -371,36 +397,52 @@ Namespace Jobs
|
|||||||
Logger.Info($"Burning [{pEnvelopeData.AnnotationData.Count}] signatures")
|
Logger.Info($"Burning [{pEnvelopeData.AnnotationData.Count}] signatures")
|
||||||
Dim oAnnotations = pEnvelopeData.AnnotationData
|
Dim oAnnotations = pEnvelopeData.AnnotationData
|
||||||
Dim oInputPath = ""
|
Dim oInputPath = ""
|
||||||
|
If IsNothing(pEnvelopeData.DocAsByte) Then
|
||||||
If My.Settings.RuninDMZ Then
|
If My.Settings.RuninDMZ Then
|
||||||
Logger.Debug("Replacing Path in pData.DocumentPath ...")
|
Logger.Debug("Replacing Path in pData.DocumentPath ...")
|
||||||
oInputPath = pEnvelopeData.DocumentPath.Replace(Config.DocumentPathOrigin, Config.DocumentPath)
|
oInputPath = pEnvelopeData.DocumentPath.Replace(Config.DocumentPathOrigin, Config.DocumentPath)
|
||||||
ElseIf Config.DOCUMENT_PATH_MOVE_AFTSEND <> String.Empty Then
|
ElseIf Config.DOCUMENT_PATH_MOVE_AFTSEND <> String.Empty Then
|
||||||
Logger.Debug("Replacing Path in pData.DocumentPath ...")
|
Logger.Debug("Replacing Path in pData.DocumentPath ...")
|
||||||
oInputPath = pEnvelopeData.DocumentPath.Replace(Config.DocumentPathOrigin, Config.DOCUMENT_PATH_MOVE_AFTSEND)
|
oInputPath = pEnvelopeData.DocumentPath.Replace(Config.DocumentPathOrigin, Config.DOCUMENT_PATH_MOVE_AFTSEND)
|
||||||
|
Else
|
||||||
|
oInputPath = pEnvelopeData.DocumentPath
|
||||||
|
End If
|
||||||
|
Logger.Info($"Input path: [{oInputPath}]")
|
||||||
Else
|
Else
|
||||||
oInputPath = pEnvelopeData.DocumentPath
|
Logger.Info($"we got bytes..")
|
||||||
|
oInputPath = Config.DocumentPathOrigin
|
||||||
|
Logger.Info($"oInputPath: {Config.DocumentPathOrigin}")
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
If IsNothing(pEnvelopeData.DocAsByte) Then
|
||||||
|
Dim oDirectorySource As String = Path.GetDirectoryName(oInputPath)
|
||||||
|
Dim split As String() = oDirectorySource.Split("\")
|
||||||
|
ParentFolderUID = split(split.Length - 1)
|
||||||
|
Else
|
||||||
|
ParentFolderUID = pEnvelopeData.EnvelopeUUID
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Logger.Info($"Input path: [{oInputPath}]")
|
|
||||||
Dim oDirectorySource As String = Path.GetDirectoryName(oInputPath)
|
|
||||||
Dim split As String() = oDirectorySource.Split("\")
|
|
||||||
ParentFolderUID = split(split.Length - 1)
|
|
||||||
|
|
||||||
Logger.Info("ParentFolderUID: [{0}]", ParentFolderUID)
|
Logger.Info("ParentFolderUID: [{0}]", ParentFolderUID)
|
||||||
Dim oInputDocumentBuffer As Byte()
|
Dim oInputDocumentBuffer As Byte()
|
||||||
Try
|
If Not IsNothing(pEnvelopeData.DocAsByte) Then
|
||||||
oInputDocumentBuffer = File.ReadAllBytes(oInputPath)
|
oInputDocumentBuffer = pEnvelopeData.DocAsByte
|
||||||
Catch ex As Exception
|
Else
|
||||||
Logger.Error(ex)
|
Try
|
||||||
Throw New BurnAnnotationException("Source document could not be read from disk!", ex)
|
oInputDocumentBuffer = File.ReadAllBytes(oInputPath)
|
||||||
End Try
|
Catch ex As Exception
|
||||||
|
Logger.Error(ex)
|
||||||
|
Throw New BurnAnnotationException("Source document could not be read from disk!", ex)
|
||||||
|
End Try
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
Return PDFBurner.BurnInstantJSONAnnotationsToPDF(oInputDocumentBuffer, oAnnotations)
|
Return PDFBurner.BurnInstantJSONAnnotationsToPDF(oInputDocumentBuffer, oAnnotations)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function GetEnvelopeData(pEnvelopeId As Integer) As EnvelopeData
|
Private Function GetEnvelopeData(pEnvelopeId As Integer) As EnvelopeData
|
||||||
Dim oSql = $"SELECT T.GUID, T2.FILEPATH FROM [dbo].[TBSIG_ENVELOPE] T
|
Dim oSql = $"SELECT T.GUID, T.ENVELOPE_UUID,T2.FILEPATH, T2.BYTE_DATA FROM [dbo].[TBSIG_ENVELOPE] T
|
||||||
JOIN TBSIG_ENVELOPE_DOCUMENT T2 ON T.GUID = T2.ENVELOPE_ID
|
JOIN TBSIG_ENVELOPE_DOCUMENT T2 ON T.GUID = T2.ENVELOPE_ID
|
||||||
WHERE T.GUID = {pEnvelopeId}"
|
WHERE T.GUID = {pEnvelopeId}"
|
||||||
Dim oTable As DataTable = Database.GetDatatable(oSql)
|
Dim oTable As DataTable = Database.GetDatatable(oSql)
|
||||||
@@ -413,7 +455,9 @@ Namespace Jobs
|
|||||||
Dim oData As New EnvelopeData With {
|
Dim oData As New EnvelopeData With {
|
||||||
.EnvelopeId = pEnvelopeId,
|
.EnvelopeId = pEnvelopeId,
|
||||||
.DocumentPath = oRow.ItemEx("FILEPATH", ""),
|
.DocumentPath = oRow.ItemEx("FILEPATH", ""),
|
||||||
.AnnotationData = oAnnotationData
|
.AnnotationData = oAnnotationData,
|
||||||
|
.DocAsByte = DirectCast(oRow.Item("BYTE_DATA"), Byte()),
|
||||||
|
.EnvelopeUUID = oRow.ItemEx("ENVELOPE_UUID", "")
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger.Debug("Document path: [{0}]", oData.DocumentPath)
|
Logger.Debug("Document path: [{0}]", oData.DocumentPath)
|
||||||
|
|||||||
@@ -15,14 +15,18 @@ Namespace Jobs.FinalizeDocument
|
|||||||
|
|
||||||
Private Const ANNOTATION_TYPE_IMAGE = "pspdfkit/image"
|
Private Const ANNOTATION_TYPE_IMAGE = "pspdfkit/image"
|
||||||
Private Const ANNOTATION_TYPE_INK = "pspdfkit/ink"
|
Private Const ANNOTATION_TYPE_INK = "pspdfkit/ink"
|
||||||
|
Private Const ANNOTATION_TYPE_WIDGET = "pspdfkit/widget"
|
||||||
|
Private Property _ignoredLabels As List(Of String)
|
||||||
|
|
||||||
Public Sub New(pLogConfig As LogConfig, pGDPictureLicenseKey As String)
|
Public Sub New(pLogConfig As LogConfig, pGDPictureLicenseKey As String, ignoredLabels As List(Of String))
|
||||||
MyBase.New(pLogConfig)
|
MyBase.New(pLogConfig)
|
||||||
|
|
||||||
LicenseManager = New LicenseManager()
|
LicenseManager = New LicenseManager()
|
||||||
LicenseManager.RegisterKEY(pGDPictureLicenseKey)
|
LicenseManager.RegisterKEY(pGDPictureLicenseKey)
|
||||||
|
|
||||||
Manager = New AnnotationManager()
|
Manager = New AnnotationManager()
|
||||||
|
|
||||||
|
_ignoredLabels = ignoredLabels
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Function BurnInstantJSONAnnotationsToPDF(pSourceBuffer As Byte(), pInstantJSONList As List(Of String)) As Byte()
|
Public Function BurnInstantJSONAnnotationsToPDF(pSourceBuffer As Byte(), pInstantJSONList As List(Of String)) As Byte()
|
||||||
@@ -37,11 +41,11 @@ Namespace Jobs.FinalizeDocument
|
|||||||
|
|
||||||
For Each oJSON In pInstantJSONList
|
For Each oJSON In pInstantJSONList
|
||||||
If AddInstantJSONAnnotationToPDF(oJSON) = False Then
|
If AddInstantJSONAnnotationToPDF(oJSON) = False Then
|
||||||
|
Logger.Warn($"Error in AddInstantJSONAnnotationToPDF - oJson: ")
|
||||||
|
Logger.Warn(oJSON)
|
||||||
Throw New BurnAnnotationException($"Adding Annotation failed")
|
Throw New BurnAnnotationException($"Adding Annotation failed")
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
|
|
||||||
|
|
||||||
oResult = Manager.BurnAnnotationsToPage(RemoveInitialAnnots:=True, VectorMode:=True)
|
oResult = Manager.BurnAnnotationsToPage(RemoveInitialAnnots:=True, VectorMode:=True)
|
||||||
If oResult <> GdPictureStatus.OK Then
|
If oResult <> GdPictureStatus.OK Then
|
||||||
Throw New BurnAnnotationException($"Could not burn annotations to file: [{oResult}]")
|
Throw New BurnAnnotationException($"Could not burn annotations to file: [{oResult}]")
|
||||||
@@ -70,6 +74,7 @@ Namespace Jobs.FinalizeDocument
|
|||||||
Dim oAnnotationData = JsonConvert.DeserializeObject(Of AnnotationData)(pInstantJSON)
|
Dim oAnnotationData = JsonConvert.DeserializeObject(Of AnnotationData)(pInstantJSON)
|
||||||
|
|
||||||
For Each oAnnotation In oAnnotationData.annotations
|
For Each oAnnotation In oAnnotationData.annotations
|
||||||
|
Logger.Debug("Adding AnnotationID: " + oAnnotation.id)
|
||||||
Select Case oAnnotation.type
|
Select Case oAnnotation.type
|
||||||
Case ANNOTATION_TYPE_IMAGE
|
Case ANNOTATION_TYPE_IMAGE
|
||||||
AddImageAnnotation(oAnnotation, oAnnotationData.attachments)
|
AddImageAnnotation(oAnnotation, oAnnotationData.attachments)
|
||||||
@@ -77,6 +82,12 @@ Namespace Jobs.FinalizeDocument
|
|||||||
Case ANNOTATION_TYPE_INK
|
Case ANNOTATION_TYPE_INK
|
||||||
AddInkAnnotation(oAnnotation)
|
AddInkAnnotation(oAnnotation)
|
||||||
|
|
||||||
|
Case ANNOTATION_TYPE_WIDGET
|
||||||
|
'Add form field values
|
||||||
|
Dim formFieldValue = oAnnotationData.formFieldValues.FirstOrDefault(Function(fv) fv.name = oAnnotation.id)
|
||||||
|
If formFieldValue IsNot Nothing AndAlso Not _ignoredLabels.Contains(formFieldValue.value) Then
|
||||||
|
AddFormFieldValue(oAnnotation, formFieldValue)
|
||||||
|
End If
|
||||||
End Select
|
End Select
|
||||||
Next
|
Next
|
||||||
|
|
||||||
@@ -137,6 +148,33 @@ Namespace Jobs.FinalizeDocument
|
|||||||
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Private Function AddFormFieldValue(pAnnotation As Annotation, formFieldValue As FormFieldValue) As Boolean
|
||||||
|
Try
|
||||||
|
' Convert pixels to Inches
|
||||||
|
Dim oBounds = pAnnotation.bbox.Select(AddressOf ToInches).ToList()
|
||||||
|
|
||||||
|
Dim oX = oBounds.Item(0)
|
||||||
|
Dim oY = oBounds.Item(1)
|
||||||
|
Dim oWidth = oBounds.Item(2)
|
||||||
|
Dim oHeight = oBounds.Item(3)
|
||||||
|
|
||||||
|
Manager.SelectPage(pAnnotation.pageIndex + 1)
|
||||||
|
' Add the text annotation
|
||||||
|
Dim ant = Manager.AddTextAnnot(oX, oY, oWidth, oHeight, formFieldValue.value)
|
||||||
|
|
||||||
|
' Set the font properties
|
||||||
|
ant.FontName = "Arial"
|
||||||
|
ant.FontSize = 8
|
||||||
|
ant.FontStyle = FontStyle.Italic
|
||||||
|
Manager.SaveAnnotationsToPage()
|
||||||
|
Return True
|
||||||
|
Catch ex As Exception
|
||||||
|
Logger.Warn("Could not add image annotation!")
|
||||||
|
Logger.Error(ex)
|
||||||
|
Return False
|
||||||
|
End Try
|
||||||
|
End Function
|
||||||
|
|
||||||
Private Function ToPointF(pPoints As List(Of Single)) As PointF
|
Private Function ToPointF(pPoints As List(Of Single)) As PointF
|
||||||
Dim oPoints = pPoints.Select(AddressOf ToInches).ToList()
|
Dim oPoints = pPoints.Select(AddressOf ToInches).ToList()
|
||||||
Return New PointF(oPoints.Item(0), oPoints.Item(1))
|
Return New PointF(oPoints.Item(0), oPoints.Item(1))
|
||||||
@@ -153,6 +191,7 @@ Namespace Jobs.FinalizeDocument
|
|||||||
Friend Class AnnotationData
|
Friend Class AnnotationData
|
||||||
Public Property annotations As List(Of Annotation)
|
Public Property annotations As List(Of Annotation)
|
||||||
Public Property attachments As Dictionary(Of String, Attachment)
|
Public Property attachments As Dictionary(Of String, Attachment)
|
||||||
|
Public Property formFieldValues As List(Of FormFieldValue)
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
Friend Class Annotation
|
Friend Class Annotation
|
||||||
@@ -174,5 +213,10 @@ Namespace Jobs.FinalizeDocument
|
|||||||
Public Property binary As String
|
Public Property binary As String
|
||||||
Public Property contentType As String
|
Public Property contentType As String
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
|
Friend Class FormFieldValue
|
||||||
|
Public Property name As String
|
||||||
|
Public Property value As String
|
||||||
|
End Class
|
||||||
End Class
|
End Class
|
||||||
End Namespace
|
End Namespace
|
||||||
|
|||||||
@@ -24,7 +24,8 @@ Public Class DocumentModel
|
|||||||
.Filepath = pRow.ItemEx("FILEPATH", ""),
|
.Filepath = pRow.ItemEx("FILEPATH", ""),
|
||||||
.FileNameOriginal = pRow.ItemEx("FILENAME_ORIGINAL", ""),
|
.FileNameOriginal = pRow.ItemEx("FILENAME_ORIGINAL", ""),
|
||||||
.IsTempFile = False,
|
.IsTempFile = False,
|
||||||
.Elements = ElementModel.List(oDocumentId, pReceiverId)
|
.Elements = ElementModel.List(oDocumentId, pReceiverId),
|
||||||
|
.Byte_Data = DirectCast(pRow.Item("BYTE_DATA"), Byte())
|
||||||
}
|
}
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
@@ -79,18 +80,21 @@ Public Class DocumentModel
|
|||||||
([FILENAME]
|
([FILENAME]
|
||||||
,[FILENAME_ORIGINAL]
|
,[FILENAME_ORIGINAL]
|
||||||
,[FILEPATH]
|
,[FILEPATH]
|
||||||
,[ENVELOPE_ID])
|
,[ENVELOPE_ID]
|
||||||
|
,[BYTE_DATA])
|
||||||
VALUES
|
VALUES
|
||||||
(@FILENAME
|
(@FILENAME
|
||||||
,@FILENAME_ORIGINAL
|
,@FILENAME_ORIGINAL
|
||||||
,@FILEPATH
|
,@FILEPATH
|
||||||
,@ENVELOPE_ID)"
|
,@ENVELOPE_ID
|
||||||
|
,@BYTE_DATA)"
|
||||||
|
|
||||||
Dim oCommand As New SqlCommand(oSql)
|
Dim oCommand As New SqlCommand(oSql)
|
||||||
oCommand.Parameters.Add("FILENAME", SqlDbType.NVarChar).Value = pDocument.Filename
|
oCommand.Parameters.Add("FILENAME", SqlDbType.NVarChar).Value = pDocument.Filename
|
||||||
oCommand.Parameters.Add("FILENAME_ORIGINAL", SqlDbType.NVarChar).Value = pDocument.FileNameOriginal
|
oCommand.Parameters.Add("FILENAME_ORIGINAL", SqlDbType.NVarChar).Value = pDocument.FileNameOriginal
|
||||||
oCommand.Parameters.Add("FILEPATH", SqlDbType.NVarChar).Value = pDocument.Filepath
|
oCommand.Parameters.Add("FILEPATH", SqlDbType.NVarChar).Value = pDocument.Filepath
|
||||||
oCommand.Parameters.Add("ENVELOPE_ID", SqlDbType.Int).Value = pEnvelope.Id
|
oCommand.Parameters.Add("ENVELOPE_ID", SqlDbType.Int).Value = pEnvelope.Id
|
||||||
|
oCommand.Parameters.Add(New SqlParameter("@BYTE_DATA", DirectCast(pDocument.Byte_Data, Object)))
|
||||||
|
|
||||||
If Database.ExecuteNonQuery(oCommand, pTransaction) Then
|
If Database.ExecuteNonQuery(oCommand, pTransaction) Then
|
||||||
pDocument.EnvelopeId = pEnvelope.Id
|
pDocument.EnvelopeId = pEnvelope.Id
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ Public Class EmailModel
|
|||||||
Public Function Insert(pEmail As EmailData) As Boolean
|
Public Function Insert(pEmail As EmailData) As Boolean
|
||||||
Try
|
Try
|
||||||
Dim oSql = "INSERT INTO [dbo].[TBEMLP_EMAIL_OUT] "
|
Dim oSql = "INSERT INTO [dbo].[TBEMLP_EMAIL_OUT] "
|
||||||
oSql += " (EMAIL_ADRESS, EMAIL_SUBJ, EMAIL_BODY, ADDED_WHO, SENDING_PROFILE, REFERENCE_ID, REFERENCE_STRING, REMINDER_TYPE_ID, EMAIL_ATTMT1, WF_ID) "
|
oSql += " (EMAIL_ADRESS, EMAIL_SUBJ, EMAIL_BODY, ADDED_WHO, SENDING_PROFILE, REFERENCE_ID, REFERENCE_STRING, REMINDER_TYPE_ID, WF_ID,ATT1_RELATED_ID,ATT1_REL_TYPE) "
|
||||||
oSql += " VALUES (@EMAIL_ADRESS, @EMAIL_SUBJ, @EMAIL_BODY, @ADDED_WHO, @SENDING_PROFILE, @REFERENCE_ID, @REFERENCE_STRING, @REMINDER_TYPE_ID, @EMAIL_ATTMT1, @WF_ID)"
|
oSql += " VALUES (@EMAIL_ADRESS, @EMAIL_SUBJ, @EMAIL_BODY, @ADDED_WHO, @SENDING_PROFILE, @REFERENCE_ID, @REFERENCE_STRING, @REMINDER_TYPE_ID, @WF_ID,@ATT1_RELATED_ID,@ATT1_REL_TYPE)"
|
||||||
Dim oCommand As New SqlCommand(oSql)
|
Dim oCommand As New SqlCommand(oSql)
|
||||||
oCommand.Parameters.Add("EMAIL_ADRESS", SqlDbType.NVarChar).Value = pEmail.EmailAdress
|
oCommand.Parameters.Add("EMAIL_ADRESS", SqlDbType.NVarChar).Value = pEmail.EmailAdress
|
||||||
oCommand.Parameters.Add("EMAIL_SUBJ", SqlDbType.NVarChar).Value = pEmail.EmailSubject
|
oCommand.Parameters.Add("EMAIL_SUBJ", SqlDbType.NVarChar).Value = pEmail.EmailSubject
|
||||||
@@ -23,8 +23,10 @@ Public Class EmailModel
|
|||||||
oCommand.Parameters.Add("REFERENCE_ID", SqlDbType.Int).Value = pEmail.ReferenceID
|
oCommand.Parameters.Add("REFERENCE_ID", SqlDbType.Int).Value = pEmail.ReferenceID
|
||||||
oCommand.Parameters.Add("REFERENCE_STRING", SqlDbType.NVarChar).Value = pEmail.ReferenceString
|
oCommand.Parameters.Add("REFERENCE_STRING", SqlDbType.NVarChar).Value = pEmail.ReferenceString
|
||||||
oCommand.Parameters.Add("REMINDER_TYPE_ID", SqlDbType.Int).Value = 202377
|
oCommand.Parameters.Add("REMINDER_TYPE_ID", SqlDbType.Int).Value = 202377
|
||||||
oCommand.Parameters.Add("EMAIL_ATTMT1", SqlDbType.NVarChar).Value = pEmail.EmailAttachment
|
'oCommand.Parameters.Add("EMAIL_ATTMT1", SqlDbType.NVarChar).Value = pEmail.EmailAttachment
|
||||||
oCommand.Parameters.Add("WF_ID", SqlDbType.Int).Value = pEmail.EmailType ' Wegen DB-Trigger MUSS dieser Wert gesetzt werden
|
oCommand.Parameters.Add("WF_ID", SqlDbType.Int).Value = pEmail.EmailType ' Wegen DB-Trigger MUSS dieser Wert gesetzt werden
|
||||||
|
oCommand.Parameters.Add("ATT1_RELATED_ID", SqlDbType.Int).Value = pEmail.ATT1_RELATED_ID
|
||||||
|
oCommand.Parameters.Add("ATT1_REL_TYPE", SqlDbType.NVarChar).Value = pEmail.ATT1_REL_TYPE
|
||||||
|
|
||||||
If Database.ExecuteNonQuery(oCommand) Then
|
If Database.ExecuteNonQuery(oCommand) Then
|
||||||
Return True
|
Return True
|
||||||
|
|||||||
@@ -47,7 +47,15 @@ Public Class EnvelopeModel
|
|||||||
.FinalEmailToCreator = ObjectEx.ToEnum(Of Constants.FinalEmailType)(pRow.ItemEx("FINAL_EMAIL_TO_CREATOR", Constants.FinalEmailType.No.ToString())),
|
.FinalEmailToCreator = ObjectEx.ToEnum(Of Constants.FinalEmailType)(pRow.ItemEx("FINAL_EMAIL_TO_CREATOR", Constants.FinalEmailType.No.ToString())),
|
||||||
.FinalEmailToReceivers = ObjectEx.ToEnum(Of Constants.FinalEmailType)(pRow.ItemEx("FINAL_EMAIL_TO_RECEIVERS", Constants.FinalEmailType.No.ToString()))
|
.FinalEmailToReceivers = ObjectEx.ToEnum(Of Constants.FinalEmailType)(pRow.ItemEx("FINAL_EMAIL_TO_RECEIVERS", Constants.FinalEmailType.No.ToString()))
|
||||||
}
|
}
|
||||||
|
Dim oDOC_RESULT = pRow.Item("DOC_RESULT")
|
||||||
|
If Not IsDBNull(oDOC_RESULT) Then
|
||||||
|
Dim oByte As Byte() = DirectCast(pRow.Item("DOC_RESULT"), Byte())
|
||||||
|
If Not IsNothing(oByte) Then
|
||||||
|
oEnvelope.DOC_RESULT = oByte
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
oEnvelope.DOC_RESULT = Nothing
|
||||||
|
End If
|
||||||
oEnvelope.User = UserModel.SelectUser(oEnvelope.UserId)
|
oEnvelope.User = UserModel.SelectUser(oEnvelope.UserId)
|
||||||
oEnvelope.Receivers = ReceiverModel.ListEnvelopeReceivers(oEnvelope.Id)
|
oEnvelope.Receivers = ReceiverModel.ListEnvelopeReceivers(oEnvelope.Id)
|
||||||
oEnvelope.Documents = DocumentModel.List(oEnvelope.Id)
|
oEnvelope.Documents = DocumentModel.List(oEnvelope.Id)
|
||||||
@@ -185,6 +193,9 @@ Public Class EnvelopeModel
|
|||||||
oCommand.Parameters.Add("TITLE", SqlDbType.NVarChar).Value = pEnvelope.Title
|
oCommand.Parameters.Add("TITLE", SqlDbType.NVarChar).Value = pEnvelope.Title
|
||||||
oCommand.Parameters.Add("ENVELOPE_TYPE", SqlDbType.Int).Value = pEnvelope.EnvelopeTypeId
|
oCommand.Parameters.Add("ENVELOPE_TYPE", SqlDbType.Int).Value = pEnvelope.EnvelopeTypeId
|
||||||
oCommand.Parameters.Add("CONTRACT_TYPE", SqlDbType.Int).Value = pEnvelope.ContractType
|
oCommand.Parameters.Add("CONTRACT_TYPE", SqlDbType.Int).Value = pEnvelope.ContractType
|
||||||
|
If IsNothing(pEnvelope.Language) Then
|
||||||
|
pEnvelope.Language = "de-DE"
|
||||||
|
End If
|
||||||
oCommand.Parameters.Add("LANGUAGE", SqlDbType.NVarChar).Value = pEnvelope.Language
|
oCommand.Parameters.Add("LANGUAGE", SqlDbType.NVarChar).Value = pEnvelope.Language
|
||||||
oCommand.Parameters.Add("CERTIFICATION_TYPE", SqlDbType.Int).Value = pEnvelope.CertificationType
|
oCommand.Parameters.Add("CERTIFICATION_TYPE", SqlDbType.Int).Value = pEnvelope.CertificationType
|
||||||
oCommand.Parameters.Add("EXPIRES_WHEN_DAYS", SqlDbType.Int).Value = pEnvelope.ExpiresWhenDays
|
oCommand.Parameters.Add("EXPIRES_WHEN_DAYS", SqlDbType.Int).Value = pEnvelope.ExpiresWhenDays
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ Public Class HistoryModel
|
|||||||
|
|
||||||
Private Function ToEnvelopeHistoryEntry(pRow As DataRow) As EnvelopeHistoryEntry
|
Private Function ToEnvelopeHistoryEntry(pRow As DataRow) As EnvelopeHistoryEntry
|
||||||
Return New EnvelopeHistoryEntry() With {
|
Return New EnvelopeHistoryEntry() With {
|
||||||
.ActionDate = pRow.Item("ACTION_DATE"),
|
.ActionDate = pRow.ItemEx(Of Date)("ACTION_DATE", Nothing),
|
||||||
.EnvelopeId = pRow.Item("ENVELOPE_ID"),
|
.EnvelopeId = pRow.Item("ENVELOPE_ID"),
|
||||||
.Status = pRow.Item("STATUS"),
|
.Status = pRow.Item("STATUS"),
|
||||||
.UserReference = pRow.ItemEx("USER_REFERENCE", "")
|
.UserReference = pRow.ItemEx("USER_REFERENCE", "")
|
||||||
@@ -18,7 +18,7 @@ Public Class HistoryModel
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function List(pEnvelopeId As Integer) As List(Of EnvelopeHistoryEntry)
|
Public Function List(pEnvelopeId As Integer) As List(Of EnvelopeHistoryEntry)
|
||||||
Dim oSql = $"SELECT * FROM TBSIG_ENVELOPE_HISTORY WHERE ENVELOPE_ID = {pEnvelopeId} ORDER BY GUID DESC"
|
Dim oSql = $"SELECT * FROM TBSIG_ENVELOPE_HISTORY WHERE ENVELOPE_ID = {pEnvelopeId} AND ACTION_DATE IS NOT NULL ORDER BY GUID DESC"
|
||||||
Dim oTable = Database.GetDatatable(oSql)
|
Dim oTable = Database.GetDatatable(oSql)
|
||||||
Return oTable?.Rows.
|
Return oTable?.Rows.
|
||||||
Cast(Of DataRow).
|
Cast(Of DataRow).
|
||||||
|
|||||||
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
|||||||
' indem Sie "*" wie unten gezeigt eingeben:
|
' indem Sie "*" wie unten gezeigt eingeben:
|
||||||
' <Assembly: AssemblyVersion("1.0.*")>
|
' <Assembly: AssemblyVersion("1.0.*")>
|
||||||
|
|
||||||
<Assembly: AssemblyVersion("1.6.0.0")>
|
<Assembly: AssemblyVersion("1.9.3.0")>
|
||||||
<Assembly: AssemblyFileVersion("1.6.0.0")>
|
<Assembly: AssemblyFileVersion("1.9.3.0")>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
Imports DevExpress.DataAccess.Native.Web
|
Imports DevExpress.DataAccess.Native.Web
|
||||||
Imports DigitalData.Modules.Base
|
Imports DigitalData.Modules.Base
|
||||||
|
Imports EnvelopeGenerator.Common.My.Resources
|
||||||
|
|
||||||
Public Class ActionService
|
Public Class ActionService
|
||||||
Inherits BaseService
|
Inherits BaseService
|
||||||
@@ -33,6 +34,20 @@ Public Class ActionService
|
|||||||
|
|
||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
Public Function Resend_Receiver(pEnvelope As Envelope, pmail As String) As Boolean
|
||||||
|
If HistoryService.SetEnvelopeStatus(pEnvelope, Constants.EnvelopeStatus.EnvelopeQueued, pEnvelope.User.Email) = False Then
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
Dim oSendResult As Boolean = False
|
||||||
|
For Each oReceiver In pEnvelope.Receivers
|
||||||
|
EmailService.SendDocumentReceivedEmail(pEnvelope, oReceiver)
|
||||||
|
Next
|
||||||
|
Return oSendResult
|
||||||
|
End Function
|
||||||
|
Public Function ResendReceiver(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean
|
||||||
|
EmailService.SendDocumentReceivedEmail(pEnvelope, pReceiver)
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
Public Function DeleteEnvelope(pEnvelope As Envelope, pReason As String) As Boolean
|
Public Function DeleteEnvelope(pEnvelope As Envelope, pReason As String) As Boolean
|
||||||
If HistoryService.SetEnvelopeStatus(pEnvelope, Constants.EnvelopeStatus.EnvelopeDeleted, pEnvelope.User.Email) = False Then
|
If HistoryService.SetEnvelopeStatus(pEnvelope, Constants.EnvelopeStatus.EnvelopeDeleted, pEnvelope.User.Email) = False Then
|
||||||
@@ -108,20 +123,20 @@ Public Class ActionService
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function CompleteEnvelope(pEnvelope As Envelope, pReceiver As EnvelopeReceiver, pAttachment As String) As Boolean
|
Public Function CompleteEnvelope(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean ', pAttachment As String
|
||||||
If HistoryService.SetEnvelopeStatus(pEnvelope, Constants.EnvelopeStatus.MessageCompletionSent, pReceiver.Email) = False Then
|
If HistoryService.SetEnvelopeStatus(pEnvelope, Constants.EnvelopeStatus.MessageCompletionSent, pReceiver.Email) = False Then
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Return EmailService.SendDocumentCompletedEmailToReceiver(pEnvelope, pReceiver, pAttachment)
|
Return EmailService.SendDocumentCompletedEmailToReceiver(pEnvelope, pReceiver) ', pAttachment
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function CompleteEnvelope(pEnvelope As Envelope, pAttachment As String) As Boolean
|
Public Function CompleteEnvelope(pEnvelope As Envelope) As Boolean ', pAttachment As String
|
||||||
If HistoryService.SetEnvelopeStatus(pEnvelope, Constants.EnvelopeStatus.MessageCompletionSent, pEnvelope.User.Email) = False Then
|
If HistoryService.SetEnvelopeStatus(pEnvelope, Constants.EnvelopeStatus.MessageCompletionSent, pEnvelope.User.Email) = False Then
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Return EmailService.SendDocumentCompletedEmailToCreator(pEnvelope, pAttachment)
|
Return EmailService.SendDocumentCompletedEmailToCreator(pEnvelope) ', pAttachment
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function CreateReport(pEnvelope As Envelope) As Boolean
|
Public Function CreateReport(pEnvelope As Envelope) As Boolean
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
|
|
||||||
Imports DigitalData.Modules.Base
|
Imports DigitalData.Modules.Base
|
||||||
Imports DigitalData.Modules.Logging
|
Imports DigitalData.Modules.Logging
|
||||||
|
Imports EnvelopeGenerator.Common.My.Resources
|
||||||
|
|
||||||
Public Class EmailService
|
Public Class EmailService
|
||||||
Inherits BaseService
|
Inherits BaseService
|
||||||
@@ -49,6 +50,15 @@ Public Class EmailService
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Public Function GetReceiverUrl(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As String
|
||||||
|
Dim oEmailData As New EmailData(pEnvelope, pReceiver, Constants.EnvelopeStatus.MessageInvitationSent) With
|
||||||
|
{
|
||||||
|
.SignatureLink = Helpers.GetEnvelopeURL(State.DbConfig.SignatureHost, pEnvelope.Uuid, pReceiver.Signature)
|
||||||
|
}
|
||||||
|
Return oEmailData.SignatureLink
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
Public Function SendDocumentAccessCodeReceivedEmail(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean
|
Public Function SendDocumentAccessCodeReceivedEmail(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean
|
||||||
Logger.Debug("Creating email data object.")
|
Logger.Debug("Creating email data object.")
|
||||||
Dim oEmailData As New EmailData(pEnvelope, pReceiver, Constants.EnvelopeStatus.MessageAccessCodeSent) With
|
Dim oEmailData As New EmailData(pEnvelope, pReceiver, Constants.EnvelopeStatus.MessageAccessCodeSent) With
|
||||||
@@ -83,14 +93,15 @@ Public Class EmailService
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function SendDocumentCompletedEmailToReceiver(pEnvelope As Envelope, pReceiver As EnvelopeReceiver, pAttachment As String) As Boolean
|
Public Function SendDocumentCompletedEmailToReceiver(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean ', pAttachment As String
|
||||||
Logger.Debug("Creating email data object.")
|
Logger.Debug("Creating email data object.")
|
||||||
Dim oEmailData = New EmailData(pEnvelope, pReceiver, Constants.EnvelopeStatus.MessageCompletionSent) With
|
Dim oEmailData = New EmailData(pEnvelope, pReceiver, Constants.EnvelopeStatus.MessageCompletionSent) With
|
||||||
{
|
{
|
||||||
.SignatureLink = "",
|
.SignatureLink = "",
|
||||||
.EmailAttachment = pAttachment
|
.ATT1_RELATED_ID = pEnvelope.Id,
|
||||||
|
.ATT1_REL_TYPE = "EnvelopeResult"
|
||||||
}
|
}
|
||||||
|
' .EmailAttachment = pAttachment,
|
||||||
Logger.Debug("Sending mail to receiver: [{0}]", oEmailData.EmailAdress)
|
Logger.Debug("Sending mail to receiver: [{0}]", oEmailData.EmailAdress)
|
||||||
|
|
||||||
EmailTemplate.FillDocumentCompletedEmailBody(oEmailData)
|
EmailTemplate.FillDocumentCompletedEmailBody(oEmailData)
|
||||||
@@ -103,14 +114,15 @@ Public Class EmailService
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function SendDocumentCompletedEmailToCreator(pEnvelope As Envelope, pAttachment As String) As Boolean
|
Public Function SendDocumentCompletedEmailToCreator(pEnvelope As Envelope) As Boolean ', pAttachment As String
|
||||||
Logger.Debug("Creating email data object.")
|
Logger.Debug("Creating email data object.")
|
||||||
Dim oEmailData = New EmailData(pEnvelope, Constants.EnvelopeStatus.MessageCompletionSent) With
|
Dim oEmailData = New EmailData(pEnvelope, Constants.EnvelopeStatus.MessageCompletionSent) With
|
||||||
{
|
{
|
||||||
.SignatureLink = "",
|
.SignatureLink = "",
|
||||||
.EmailAttachment = pAttachment
|
.ATT1_RELATED_ID = pEnvelope.Id,
|
||||||
|
.ATT1_REL_TYPE = "EnvelopeResult"
|
||||||
}
|
}
|
||||||
|
'.EmailAttachment = pAttachment,
|
||||||
EmailTemplate.FillDocumentCompletedEmailBody(oEmailData)
|
EmailTemplate.FillDocumentCompletedEmailBody(oEmailData)
|
||||||
|
|
||||||
If EmailModel.Insert(oEmailData) = False Then
|
If EmailModel.Insert(oEmailData) = False Then
|
||||||
|
|||||||
@@ -154,7 +154,7 @@
|
|||||||
<value>Envelope could not be sent!</value>
|
<value>Envelope could not be sent!</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Envelope Invitations Sent" xml:space="preserve">
|
<data name="Envelope Invitations Sent" xml:space="preserve">
|
||||||
<value>Envelope Invitations Sent</value>
|
<value>The invitations have been scheduled for dispatch.s</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Envelope Overview" xml:space="preserve">
|
<data name="Envelope Overview" xml:space="preserve">
|
||||||
<value>Overview</value>
|
<value>Overview</value>
|
||||||
@@ -186,6 +186,9 @@
|
|||||||
<data name="Invalid Email Address" xml:space="preserve">
|
<data name="Invalid Email Address" xml:space="preserve">
|
||||||
<value>Receiver {0} has an invalid Email Address.</value>
|
<value>Receiver {0} has an invalid Email Address.</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Invitation successfully resend" xml:space="preserve">
|
||||||
|
<value>Invitation has been send once again!</value>
|
||||||
|
</data>
|
||||||
<data name="Missing Documents" xml:space="preserve">
|
<data name="Missing Documents" xml:space="preserve">
|
||||||
<value>Missing Documents</value>
|
<value>Missing Documents</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -154,7 +154,7 @@
|
|||||||
<value>Umschlag konnte nicht gesendet werden!</value>
|
<value>Umschlag konnte nicht gesendet werden!</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Envelope Invitations Sent" xml:space="preserve">
|
<data name="Envelope Invitations Sent" xml:space="preserve">
|
||||||
<value>Die Einladungen wurden versendet</value>
|
<value>Die Einladungen zum Signieren wurden zum Versand eingereiht.</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Envelope Overview" xml:space="preserve">
|
<data name="Envelope Overview" xml:space="preserve">
|
||||||
<value>Übersicht</value>
|
<value>Übersicht</value>
|
||||||
@@ -186,6 +186,9 @@
|
|||||||
<data name="Invalid Email Address" xml:space="preserve">
|
<data name="Invalid Email Address" xml:space="preserve">
|
||||||
<value>Empfänger {0} hat keine gültige Email Addresse.</value>
|
<value>Empfänger {0} hat keine gültige Email Addresse.</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Invitation successfully resend" xml:space="preserve">
|
||||||
|
<value>Die Einladung wurde nochmal versendet!</value>
|
||||||
|
</data>
|
||||||
<data name="Missing Documents" xml:space="preserve">
|
<data name="Missing Documents" xml:space="preserve">
|
||||||
<value>Fehlendes Dokument</value>
|
<value>Fehlendes Dokument</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ Namespace My.Resources
|
|||||||
End Property
|
End Property
|
||||||
|
|
||||||
'''<summary>
|
'''<summary>
|
||||||
''' Sucht eine lokalisierte Zeichenfolge, die Die Einladungen wurden versendet ähnelt.
|
''' Sucht eine lokalisierte Zeichenfolge, die Die Einladungen zum Signieren wurden zum Versand eingereiht. ähnelt.
|
||||||
'''</summary>
|
'''</summary>
|
||||||
Public Shared ReadOnly Property Envelope_Invitations_Sent() As String
|
Public Shared ReadOnly Property Envelope_Invitations_Sent() As String
|
||||||
Get
|
Get
|
||||||
@@ -271,6 +271,15 @@ Namespace My.Resources
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
'''<summary>
|
||||||
|
''' Sucht eine lokalisierte Zeichenfolge, die Die Einladung wurde nochmal versendet! ähnelt.
|
||||||
|
'''</summary>
|
||||||
|
Public Shared ReadOnly Property Invitation_successfully_resend() As String
|
||||||
|
Get
|
||||||
|
Return ResourceManager.GetString("Invitation successfully resend", resourceCulture)
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
'''<summary>
|
'''<summary>
|
||||||
''' Sucht eine lokalisierte Zeichenfolge, die Fehlendes Dokument ähnelt.
|
''' Sucht eine lokalisierte Zeichenfolge, die Fehlendes Dokument ähnelt.
|
||||||
'''</summary>
|
'''</summary>
|
||||||
|
|||||||
3
EnvelopeGenerator.Common/Strings/Model.vb
Normal file
3
EnvelopeGenerator.Common/Strings/Model.vb
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
Public Class Model
|
||||||
|
|
||||||
|
End Class
|
||||||
60
EnvelopeGenerator.Common/TempFiles.vb
Normal file
60
EnvelopeGenerator.Common/TempFiles.vb
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
Imports System.IO
|
||||||
|
Imports DigitalData.Modules.Base
|
||||||
|
Imports DigitalData.Modules.Logging
|
||||||
|
|
||||||
|
Public Class TempFiles
|
||||||
|
Inherits BaseClass
|
||||||
|
|
||||||
|
Public Property TempPath As String
|
||||||
|
|
||||||
|
Public Sub New(pLogConfig As LogConfig)
|
||||||
|
MyBase.New(pLogConfig)
|
||||||
|
|
||||||
|
Dim oTempDirectoryPath = Path.GetTempPath()
|
||||||
|
TempPath = Path.Combine(oTempDirectoryPath, "EnvelopeGenerator")
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Function Create() As Boolean
|
||||||
|
Try
|
||||||
|
If Directory.Exists(TempPath) = False Then
|
||||||
|
Directory.CreateDirectory(TempPath)
|
||||||
|
Else
|
||||||
|
CleanUpFiles()
|
||||||
|
End If
|
||||||
|
Return True
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
Logger.Error(ex)
|
||||||
|
Return False
|
||||||
|
End Try
|
||||||
|
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Private Function CleanUpFiles() As Boolean
|
||||||
|
Try
|
||||||
|
For Each fileItem As String In Directory.GetFiles(TempPath)
|
||||||
|
Logger.Debug("Deleting tempPath-file: {0} ...", fileItem)
|
||||||
|
File.Delete(fileItem)
|
||||||
|
Next
|
||||||
|
|
||||||
|
Return True
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
Logger.Error(ex)
|
||||||
|
Return False
|
||||||
|
End Try
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Function CleanUp() As Boolean
|
||||||
|
Try
|
||||||
|
Logger.Debug("Deleting tempPath-Data: {0} ...", TempPath)
|
||||||
|
Directory.Delete(TempPath, True)
|
||||||
|
Return True
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
Logger.Error(ex)
|
||||||
|
Return False
|
||||||
|
End Try
|
||||||
|
End Function
|
||||||
|
|
||||||
|
End Class
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
|
<package id="GdPicture" version="14.2.89" targetFramework="net462" />
|
||||||
|
<package id="GdPicture.runtimes.windows" version="14.2.89" targetFramework="net462" />
|
||||||
<package id="Microsoft.Extensions.Logging.Abstractions" version="2.1.1" targetFramework="net462" />
|
<package id="Microsoft.Extensions.Logging.Abstractions" version="2.1.1" targetFramework="net462" />
|
||||||
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net462" />
|
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net462" />
|
||||||
<package id="Quartz" version="3.8.0" targetFramework="net462" />
|
<package id="Quartz" version="3.8.0" targetFramework="net462" />
|
||||||
|
|||||||
@@ -1,43 +1,41 @@
|
|||||||
using System.ComponentModel;
|
using DigitalData.Core.Abstractions;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Domain.Entities
|
namespace EnvelopeGenerator.Domain.Entities
|
||||||
{
|
{
|
||||||
[Table("TBSIG_CONFIG", Schema = "dbo")]
|
[Table("TBSIG_CONFIG", Schema = "dbo")]
|
||||||
public class Config
|
public class Config : IUnique<int>
|
||||||
{
|
{
|
||||||
[Column("DOCUMENT_PATH", TypeName = "nvarchar(256)")]
|
[Column("DOCUMENT_PATH", TypeName = "nvarchar(256)")]
|
||||||
public string DocumentPath { get; set; }
|
public string? DocumentPath { get; init; }
|
||||||
|
|
||||||
[Column("SENDING_PROFILE", TypeName = "int")]
|
[Column("SENDING_PROFILE", TypeName = "int")]
|
||||||
[Required]
|
[Required]
|
||||||
[DatabaseGenerated(DatabaseGeneratedOption.None)] // Assuming SENDING_PROFILE is manually entered or controlled by the application logic
|
public required int SendingProfile { get; init; }
|
||||||
[DefaultValue(0)] // This sets the default value for SENDING_PROFILE
|
|
||||||
public int SendingProfile { get; set; }
|
|
||||||
|
|
||||||
[Column("SIGNATURE_HOST", TypeName = "nvarchar(128)")]
|
[Column("SIGNATURE_HOST", TypeName = "nvarchar(128)")]
|
||||||
public string SignatureHost { get; set; }
|
public string? SignatureHost { get; init; }
|
||||||
|
|
||||||
[Column("EXTERNAL_PROGRAM_NAME", TypeName = "nvarchar(30)")]
|
[Column("EXTERNAL_PROGRAM_NAME", TypeName = "nvarchar(30)")]
|
||||||
public string ExternalProgramName { get; set; }
|
public string? ExternalProgramName { get; init; }
|
||||||
|
|
||||||
[Column("EXPORT_PATH", TypeName = "nvarchar(256)")]
|
[Column("EXPORT_PATH", TypeName = "nvarchar(256)")]
|
||||||
public string ExportPath { get; set; }
|
public string? ExportPath { get; init; }
|
||||||
|
|
||||||
[Column("DOCUMENT_PATH_DMZ", TypeName = "nvarchar(512)")]
|
[Column("DOCUMENT_PATH_DMZ", TypeName = "nvarchar(512)")]
|
||||||
[Required]
|
[Required]
|
||||||
[DefaultValue("")] // This sets the default value for DOCUMENT_PATH_DMZ
|
public string? DocumentPathDmz { get; init; }
|
||||||
public string DocumentPathDmz { get; set; }
|
|
||||||
|
|
||||||
[Column("EXPORT_PATH_DMZ", TypeName = "nvarchar(512)")]
|
[Column("EXPORT_PATH_DMZ", TypeName = "nvarchar(512)")]
|
||||||
[Required]
|
[Required]
|
||||||
[DefaultValue("")] // This sets the default value for EXPORT_PATH_DMZ
|
public required string ExportPathDmz { get; init; }
|
||||||
public string ExportPathDmz { get; set; }
|
|
||||||
|
|
||||||
[Column("DOCUMENT_PATH_MOVE_AFTSEND", TypeName = "nvarchar(512)")]
|
[Column("DOCUMENT_PATH_MOVE_AFTSEND", TypeName = "nvarchar(512)")]
|
||||||
[Required]
|
[Required]
|
||||||
[DefaultValue("")] // This sets the default value for DOCUMENT_PATH_MOVE_AFTSEND
|
public required string DocumentPathMoveAftsend { get; init; }
|
||||||
public string DocumentPathMoveAftsend { get; set; }
|
|
||||||
|
[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 table in the database.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,12 @@
|
|||||||
using System.ComponentModel;
|
using DigitalData.Core.Abstractions;
|
||||||
|
using System.ComponentModel;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Domain.Entities
|
namespace EnvelopeGenerator.Domain.Entities
|
||||||
{
|
{
|
||||||
[Table("TBSIG_DOCUMENT_RECEIVER_ELEMENT", Schema = "dbo")]
|
[Table("TBSIG_DOCUMENT_RECEIVER_ELEMENT", Schema = "dbo")]
|
||||||
public class DocumentReceiverElement
|
public class DocumentReceiverElement : IUnique<int>
|
||||||
{
|
{
|
||||||
[Key]
|
[Key]
|
||||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using DigitalData.Core.Abstractions;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Domain.Entities
|
namespace EnvelopeGenerator.Domain.Entities
|
||||||
{
|
{
|
||||||
[Table("TBSIG_DOCUMENT_STATUS", Schema = "dbo")]
|
[Table("TBSIG_DOCUMENT_STATUS", Schema = "dbo")]
|
||||||
public class DocumentStatus
|
public class DocumentStatus : IUnique<int>
|
||||||
{
|
{
|
||||||
[Key]
|
[Key]
|
||||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
@@ -27,7 +28,7 @@ namespace EnvelopeGenerator.Domain.Entities
|
|||||||
public DateTime? StatusChangedWhen { get; set; }
|
public DateTime? StatusChangedWhen { get; set; }
|
||||||
|
|
||||||
[Column("VALUE", TypeName = "nvarchar(max)")]
|
[Column("VALUE", TypeName = "nvarchar(max)")]
|
||||||
public string Value { get; set; }
|
public string? Value { get; set; }
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
[Column("ADDED_WHEN", TypeName = "datetime")]
|
[Column("ADDED_WHEN", TypeName = "datetime")]
|
||||||
@@ -42,4 +43,4 @@ namespace EnvelopeGenerator.Domain.Entities
|
|||||||
[ForeignKey("ReceiverId")]
|
[ForeignKey("ReceiverId")]
|
||||||
public virtual Receiver? Receiver { get; set; }
|
public virtual Receiver? Receiver { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,11 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using DigitalData.Core.Abstractions;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Domain.Entities
|
namespace EnvelopeGenerator.Domain.Entities
|
||||||
{
|
{
|
||||||
[Table("TBSIG_EMAIL_TEMPLATE", Schema = "dbo")]
|
[Table("TBSIG_EMAIL_TEMPLATE", Schema = "dbo")]
|
||||||
public class EmailTemplate
|
public class EmailTemplate : IUnique<int>
|
||||||
{
|
{
|
||||||
[Key]
|
[Key]
|
||||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
@@ -12,12 +13,12 @@ namespace EnvelopeGenerator.Domain.Entities
|
|||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
|
|
||||||
[Column("NAME", TypeName = "nvarchar(64)")]
|
[Column("NAME", TypeName = "nvarchar(64)")]
|
||||||
public string Name { get; set; }
|
public string? Name { get; set; }
|
||||||
|
|
||||||
[Column("BODY", TypeName = "nvarchar(max)")]
|
[Column("BODY", TypeName = "nvarchar(max)")]
|
||||||
public string Body { get; set; }
|
public string? Body { get; set; }
|
||||||
|
|
||||||
[Column("SUBJECT", TypeName = "nvarchar(512)")]
|
[Column("SUBJECT", TypeName = "nvarchar(512)")]
|
||||||
public string Subject { get; set; }
|
public string? Subject { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
using EnvelopeGenerator.Common;
|
using DigitalData.Core.Abstractions;
|
||||||
using EnvelopeGenerator.Common.My.Resources;
|
using EnvelopeGenerator.Common;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Domain.Entities
|
namespace EnvelopeGenerator.Domain.Entities
|
||||||
{
|
{
|
||||||
[Table("TBSIG_ENVELOPE", Schema = "dbo")]
|
[Table("TBSIG_ENVELOPE", Schema = "dbo")]
|
||||||
public class Envelope
|
public class Envelope : IUnique<int>
|
||||||
{
|
{
|
||||||
[Key]
|
[Key]
|
||||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
@@ -21,13 +21,16 @@ namespace EnvelopeGenerator.Domain.Entities
|
|||||||
[Column("STATUS")]
|
[Column("STATUS")]
|
||||||
public int Status { get; set; }
|
public int Status { get; set; }
|
||||||
|
|
||||||
|
[NotMapped]
|
||||||
|
public string StatusName => ((Constants.EnvelopeStatus)Status).ToString();
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
[Column("ENVELOPE_UUID", TypeName = "nvarchar(36)")]
|
[Column("ENVELOPE_UUID", TypeName = "nvarchar(36)")]
|
||||||
public string Uuid { get; set; }
|
public required string Uuid { get; init; }
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
[Column("MESSAGE", TypeName = "nvarchar(max)")]
|
[Column("MESSAGE", TypeName = "nvarchar(max)")]
|
||||||
public string Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[Column("EXPIRES_WHEN", TypeName = "datetime")]
|
[Column("EXPIRES_WHEN", TypeName = "datetime")]
|
||||||
public DateTime? ExpiresWhen { get; set; }
|
public DateTime? ExpiresWhen { get; set; }
|
||||||
@@ -43,13 +46,13 @@ namespace EnvelopeGenerator.Domain.Entities
|
|||||||
public DateTime? ChangedWhen { get; set; }
|
public DateTime? ChangedWhen { get; set; }
|
||||||
|
|
||||||
[Column("TITLE", TypeName = "nvarchar(128)")]
|
[Column("TITLE", TypeName = "nvarchar(128)")]
|
||||||
public string Title { get; set; }
|
public string? Title { get; set; }
|
||||||
|
|
||||||
[Column("CONTRACT_TYPE")]
|
[Column("CONTRACT_TYPE")]
|
||||||
public int? ContractType { get; set; }
|
public int? ContractType { get; set; }
|
||||||
|
|
||||||
[Column("LANGUAGE", TypeName = "nvarchar(5)")]
|
[Column("LANGUAGE", TypeName = "nvarchar(5)")]
|
||||||
public string Language { get; set; }
|
public required string Language { get; set; }
|
||||||
|
|
||||||
[Column("SEND_REMINDER_EMAILS")]
|
[Column("SEND_REMINDER_EMAILS")]
|
||||||
public bool? SendReminderEmails { get; set; }
|
public bool? SendReminderEmails { get; set; }
|
||||||
@@ -100,19 +103,6 @@ namespace EnvelopeGenerator.Domain.Entities
|
|||||||
[NotMapped]
|
[NotMapped]
|
||||||
public bool IsAlreadySent => Status > (int) Constants.EnvelopeStatus.EnvelopeSaved;
|
public bool IsAlreadySent => Status > (int) Constants.EnvelopeStatus.EnvelopeSaved;
|
||||||
|
|
||||||
[NotMapped]
|
|
||||||
public string? StatusTranslated => Model.ResourceManager.GetString(Status.ToString());
|
|
||||||
|
|
||||||
[NotMapped]
|
|
||||||
public string? ContractTypeTranslated
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
string? oContractType = ContractType.ToString();
|
|
||||||
return oContractType is null ? default : Model.ResourceManager.GetString(oContractType);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public IEnumerable<EnvelopeDocument>? Documents { get; set; }
|
public IEnumerable<EnvelopeDocument>? Documents { get; set; }
|
||||||
|
|
||||||
public IEnumerable<EnvelopeHistory>? History { get; set; }
|
public IEnumerable<EnvelopeHistory>? History { get; set; }
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using DigitalData.Core.Abstractions;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Domain.Entities
|
namespace EnvelopeGenerator.Domain.Entities
|
||||||
{
|
{
|
||||||
[Table("TBSIG_ENVELOPE_CERTIFICATE", Schema = "dbo")]
|
[Table("TBSIG_ENVELOPE_CERTIFICATE", Schema = "dbo")]
|
||||||
public class EnvelopeCertificate
|
public class EnvelopeCertificate : IUnique<int>
|
||||||
{
|
{
|
||||||
[Key]
|
[Key]
|
||||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
@@ -17,11 +18,11 @@ namespace EnvelopeGenerator.Domain.Entities
|
|||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
[Column("ENVELOPE_UUID", TypeName = "nvarchar(36)")]
|
[Column("ENVELOPE_UUID", TypeName = "nvarchar(36)")]
|
||||||
public string EnvelopeUuid { get; set; }
|
public required string EnvelopeUuid { get; set; }
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
[Column("ENVELOPE_SUBJECT", TypeName = "nvarchar(512)")]
|
[Column("ENVELOPE_SUBJECT", TypeName = "nvarchar(512)")]
|
||||||
public string EnvelopeSubject { get; set; }
|
public required string EnvelopeSubject { get; set; }
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
[Column("CREATOR_ID")]
|
[Column("CREATOR_ID")]
|
||||||
@@ -29,11 +30,11 @@ namespace EnvelopeGenerator.Domain.Entities
|
|||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
[Column("CREATOR_NAME", TypeName = "nvarchar(128)")]
|
[Column("CREATOR_NAME", TypeName = "nvarchar(128)")]
|
||||||
public string CreatorName { get; set; }
|
public required string CreatorName { get; set; }
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
[Column("CREATOR_EMAIL", TypeName = "nvarchar(128)")]
|
[Column("CREATOR_EMAIL", TypeName = "nvarchar(128)")]
|
||||||
public string CreatorEmail { get; set; }
|
public required string CreatorEmail { get; set; }
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
[Column("ENVELOPE_STATUS")]
|
[Column("ENVELOPE_STATUS")]
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using DigitalData.Core.Abstractions;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Domain.Entities
|
namespace EnvelopeGenerator.Domain.Entities
|
||||||
{
|
{
|
||||||
[Table("TBSIG_ENVELOPE_DOCUMENT", Schema = "dbo")]
|
[Table("TBSIG_ENVELOPE_DOCUMENT", Schema = "dbo")]
|
||||||
public class EnvelopeDocument
|
public class EnvelopeDocument : IUnique<int>
|
||||||
{
|
{
|
||||||
[Key]
|
[Key]
|
||||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
@@ -17,18 +18,18 @@ namespace EnvelopeGenerator.Domain.Entities
|
|||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
[Column("FILENAME", TypeName = "nvarchar(256)")]
|
[Column("FILENAME", TypeName = "nvarchar(256)")]
|
||||||
public string Filename { get; set; }
|
public required string Filename { get; set; }
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
[Column("FILEPATH", TypeName = "nvarchar(256)")]
|
[Column("FILEPATH", TypeName = "nvarchar(256)")]
|
||||||
public string Filepath { get; set; }
|
public required string Filepath { get; set; }
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
[Column("ADDED_WHEN", TypeName = "datetime")]
|
[Column("ADDED_WHEN", TypeName = "datetime")]
|
||||||
public DateTime AddedWhen { get; set; }
|
public required DateTime AddedWhen { get; set; }
|
||||||
|
|
||||||
[Column("FILENAME_ORIGINAL", TypeName = "nvarchar(256)")]
|
[Column("FILENAME_ORIGINAL", TypeName = "nvarchar(256)")]
|
||||||
public string FilenameOriginal { get; set; }
|
public required string FilenameOriginal { get; set; }
|
||||||
|
|
||||||
public IEnumerable<DocumentReceiverElement>? Elements { get; set; }
|
public IEnumerable<DocumentReceiverElement>? Elements { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using DigitalData.UserManager.Domain.Entities;
|
using DigitalData.Core.Abstractions;
|
||||||
|
using DigitalData.UserManager.Domain.Entities;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
using static EnvelopeGenerator.Common.Constants;
|
using static EnvelopeGenerator.Common.Constants;
|
||||||
@@ -6,7 +7,7 @@ using static EnvelopeGenerator.Common.Constants;
|
|||||||
namespace EnvelopeGenerator.Domain.Entities
|
namespace EnvelopeGenerator.Domain.Entities
|
||||||
{
|
{
|
||||||
[Table("TBSIG_ENVELOPE_HISTORY", Schema = "dbo")]
|
[Table("TBSIG_ENVELOPE_HISTORY", Schema = "dbo")]
|
||||||
public class EnvelopeHistory
|
public class EnvelopeHistory : IUnique<long>
|
||||||
{
|
{
|
||||||
[Key]
|
[Key]
|
||||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
@@ -19,7 +20,7 @@ namespace EnvelopeGenerator.Domain.Entities
|
|||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
[Column("USER_REFERENCE", TypeName = "nvarchar(128)")]
|
[Column("USER_REFERENCE", TypeName = "nvarchar(128)")]
|
||||||
public string UserReference { get; set; }
|
public required string UserReference { get; init; }
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
[Column("STATUS")]
|
[Column("STATUS")]
|
||||||
@@ -43,11 +44,17 @@ namespace EnvelopeGenerator.Domain.Entities
|
|||||||
public virtual Receiver? Receiver { get; set; }
|
public virtual Receiver? Receiver { get; set; }
|
||||||
|
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
public ReferenceType ReferenceType => (Status / 3) switch
|
public ReferenceType ReferenceType => (Status / 1000) switch
|
||||||
{
|
{
|
||||||
1 => ReferenceType.Sender,
|
1 => ReferenceType.Sender,
|
||||||
2 or 3 => ReferenceType.Receiver,
|
2 or 3 => ReferenceType.Receiver,
|
||||||
_ => ReferenceType.Unknown,
|
_ => ReferenceType.Unknown,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
[NotMapped]
|
||||||
|
public string? StatusName
|
||||||
|
=> (Enum.IsDefined(typeof(EnvelopeStatus), Status))
|
||||||
|
? Enum.GetName(typeof(EnvelopeStatus), Status)
|
||||||
|
: null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,45 +1,10 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Domain.Entities
|
namespace EnvelopeGenerator.Domain.Entities
|
||||||
{
|
{
|
||||||
[Table("TBSIG_ENVELOPE_RECEIVER", Schema = "dbo")]
|
[Table("TBSIG_ENVELOPE_RECEIVER", Schema = "dbo")]
|
||||||
public class EnvelopeReceiver
|
public class EnvelopeReceiver : EnvelopeReceiverBase
|
||||||
{
|
{
|
||||||
[Key]
|
|
||||||
[Column("ENVELOPE_ID")]
|
|
||||||
public int EnvelopeId { get; set; }
|
|
||||||
|
|
||||||
[Key]
|
|
||||||
[Column("RECEIVER_ID")]
|
|
||||||
public int ReceiverId { get; set; }
|
|
||||||
|
|
||||||
[Required]
|
|
||||||
[Column("SEQUENCE")]
|
|
||||||
public int Sequence { get; set; }
|
|
||||||
|
|
||||||
[Column("NAME", TypeName = "nvarchar(128)")]
|
|
||||||
public string? Name { get; set; }
|
|
||||||
|
|
||||||
[Column("JOB_TITLE", TypeName = "nvarchar(128)")]
|
|
||||||
public string? JobTitle { get; set; }
|
|
||||||
|
|
||||||
[Column("COMPANY_NAME", TypeName = "nvarchar(128)")]
|
|
||||||
public string? CompanyName { get; set; }
|
|
||||||
|
|
||||||
[Column("PRIVATE_MESSAGE", TypeName = "nvarchar(max)")]
|
|
||||||
public string? PrivateMessage { get; set; }
|
|
||||||
|
|
||||||
[Column("ACCESS_CODE", TypeName = "nvarchar(64)")]
|
|
||||||
public string? AccessCode { get; set; }
|
|
||||||
|
|
||||||
[Required]
|
|
||||||
[Column("ADDED_WHEN", TypeName = "datetime")]
|
|
||||||
public DateTime AddedWhen { get; set; }
|
|
||||||
|
|
||||||
[Column("CHANGED_WHEN", TypeName = "datetime")]
|
|
||||||
public DateTime? ChangedWhen { get; set; }
|
|
||||||
|
|
||||||
[ForeignKey("EnvelopeId")]
|
[ForeignKey("EnvelopeId")]
|
||||||
public Envelope? Envelope { get; set; }
|
public Envelope? Envelope { get; set; }
|
||||||
|
|
||||||
|
|||||||
46
EnvelopeGenerator.Domain/Entities/EnvelopeReceiverBase.cs
Normal file
46
EnvelopeGenerator.Domain/Entities/EnvelopeReceiverBase.cs
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
using DigitalData.Core.Abstractions;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Domain.Entities
|
||||||
|
{
|
||||||
|
[Table("TBSIG_ENVELOPE_RECEIVER", Schema = "dbo")]
|
||||||
|
public class EnvelopeReceiverBase : IUnique<(int Envelope, int Receiver)>
|
||||||
|
{
|
||||||
|
[Key]
|
||||||
|
[Column("ENVELOPE_ID")]
|
||||||
|
public int EnvelopeId { get; set; }
|
||||||
|
|
||||||
|
[Key]
|
||||||
|
[Column("RECEIVER_ID")]
|
||||||
|
public int ReceiverId { get; set; }
|
||||||
|
|
||||||
|
[Required]
|
||||||
|
[Column("SEQUENCE")]
|
||||||
|
public int Sequence { get; set; }
|
||||||
|
|
||||||
|
[Column("NAME", TypeName = "nvarchar(128)")]
|
||||||
|
public string? Name { get; set; }
|
||||||
|
|
||||||
|
[Column("JOB_TITLE", TypeName = "nvarchar(128)")]
|
||||||
|
public string? JobTitle { get; set; }
|
||||||
|
|
||||||
|
[Column("COMPANY_NAME", TypeName = "nvarchar(128)")]
|
||||||
|
public string? CompanyName { get; set; }
|
||||||
|
|
||||||
|
[Column("PRIVATE_MESSAGE", TypeName = "nvarchar(max)")]
|
||||||
|
public string? PrivateMessage { get; set; }
|
||||||
|
|
||||||
|
[Column("ACCESS_CODE", TypeName = "nvarchar(64)")]
|
||||||
|
public string? AccessCode { get; set; }
|
||||||
|
|
||||||
|
[Required]
|
||||||
|
[Column("ADDED_WHEN", TypeName = "datetime")]
|
||||||
|
public DateTime AddedWhen { get; set; }
|
||||||
|
|
||||||
|
[Column("CHANGED_WHEN", TypeName = "datetime")]
|
||||||
|
public DateTime? ChangedWhen { get; set; }
|
||||||
|
|
||||||
|
public (int Envelope, int Receiver) Id => (Envelope: EnvelopeId, Receiver: ReceiverId);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using DigitalData.Core.Abstractions;
|
||||||
|
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Domain.Entities
|
||||||
|
{
|
||||||
|
[Table("TBSIG_ENVELOPE_RECEIVER_READ_ONLY")]
|
||||||
|
public class EnvelopeReceiverReadOnly : IUnique<long>
|
||||||
|
{
|
||||||
|
[Key]
|
||||||
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
|
[Column("GUID")]
|
||||||
|
public long Id { get; init; }
|
||||||
|
|
||||||
|
[Column("ENVELOPE_ID")]
|
||||||
|
[Required]
|
||||||
|
public long EnvelopeId { get; init; }
|
||||||
|
|
||||||
|
//TODO: remove NotMapped attribute when EnvelopeId data type is standardized
|
||||||
|
[NotMapped]
|
||||||
|
public Envelope? Envelope { get; set; }
|
||||||
|
|
||||||
|
[Column("RECEIVER_MAIL")]
|
||||||
|
[Required]
|
||||||
|
[StringLength(250)]
|
||||||
|
[TemplatePlaceholder("NAME_RECEIVER")]
|
||||||
|
public required string ReceiverMail { get; init; }
|
||||||
|
|
||||||
|
[Column("DATE_VALID")]
|
||||||
|
[Required]
|
||||||
|
public DateTime DateValid { get; init; }
|
||||||
|
|
||||||
|
[Column("ADDED_WHO")]
|
||||||
|
[Required]
|
||||||
|
[StringLength(100)]
|
||||||
|
public required string AddedWho { get; init; }
|
||||||
|
|
||||||
|
public Receiver? Receiver { get; init; }
|
||||||
|
|
||||||
|
[Column("ADDED_WHEN")]
|
||||||
|
[Required]
|
||||||
|
public DateTime AddedWhen { get; init; }
|
||||||
|
|
||||||
|
[Column("CHANGED_WHO")]
|
||||||
|
[StringLength(100)]
|
||||||
|
public string? ChangedWho { get; init; }
|
||||||
|
|
||||||
|
[Column("CHANGED_WHEN")]
|
||||||
|
public DateTime? ChangedWhen { get; init; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,12 +1,11 @@
|
|||||||
using System;
|
using DigitalData.Core.Abstractions;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Domain.Entities
|
namespace EnvelopeGenerator.Domain.Entities
|
||||||
{
|
{
|
||||||
[Table("TBSIG_ENVELOPE_TYPE", Schema = "dbo")]
|
[Table("TBSIG_ENVELOPE_TYPE", Schema = "dbo")]
|
||||||
public class EnvelopeType
|
public class EnvelopeType : IUnique<int>
|
||||||
{
|
{
|
||||||
[Key]
|
[Key]
|
||||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
@@ -15,10 +14,10 @@ namespace EnvelopeGenerator.Domain.Entities
|
|||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
[Column("TITLE", TypeName = "nvarchar(128)")]
|
[Column("TITLE", TypeName = "nvarchar(128)")]
|
||||||
public string Title { get; set; }
|
public required string Title { get; set; }
|
||||||
|
|
||||||
[Column("LANGUAGE", TypeName = "nvarchar(5)")]
|
[Column("LANGUAGE", TypeName = "nvarchar(5)")]
|
||||||
public string Language { get; set; }
|
public string? Language { get; set; }
|
||||||
|
|
||||||
[Column("EXPIRES_DAYS")]
|
[Column("EXPIRES_DAYS")]
|
||||||
public int? ExpiresDays { get; set; }
|
public int? ExpiresDays { get; set; }
|
||||||
|
|||||||
@@ -1,26 +1,29 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using DigitalData.Core.Abstractions;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Domain.Entities
|
namespace EnvelopeGenerator.Domain.Entities
|
||||||
{
|
{
|
||||||
[Table("TBSIG_RECEIVER", Schema = "dbo")]
|
[Table("TBSIG_RECEIVER", Schema = "dbo")]
|
||||||
public class Receiver
|
public class Receiver : IUnique<int>
|
||||||
{
|
{
|
||||||
[Key]
|
[Key]
|
||||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
[Column("GUID")]
|
[Column("GUID")]
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
|
|
||||||
[Required]
|
[Required, EmailAddress]
|
||||||
[Column("EMAIL_ADDRESS", TypeName = "nvarchar(128)")]
|
[Column("EMAIL_ADDRESS", TypeName = "nvarchar(128)")]
|
||||||
public string EmailAddress { get; set; }
|
public required string EmailAddress { get; set; }
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
[Column("SIGNATURE", TypeName = "nvarchar(64)")]
|
[Column("SIGNATURE", TypeName = "nvarchar(64)")]
|
||||||
public string Signature { get; set; }
|
public required string Signature { get; set; }
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
[Column("ADDED_WHEN", TypeName = "datetime")]
|
[Column("ADDED_WHEN", TypeName = "datetime")]
|
||||||
public DateTime AddedWhen { get; set; }
|
public DateTime AddedWhen { get; set; }
|
||||||
|
|
||||||
|
public IEnumerable<EnvelopeReceiver>? EnvelopeReceivers { get; init; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,11 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using DigitalData.Core.Abstractions;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Domain.Entities
|
namespace EnvelopeGenerator.Domain.Entities
|
||||||
{
|
{
|
||||||
[Table("TBSIG_USER_RECEIVER", Schema = "dbo")]
|
[Table("TBSIG_USER_RECEIVER", Schema = "dbo")]
|
||||||
public class UserReceiver
|
public class UserReceiver : IUnique<int>
|
||||||
{
|
{
|
||||||
[Key]
|
[Key]
|
||||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
@@ -21,16 +22,16 @@ namespace EnvelopeGenerator.Domain.Entities
|
|||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
[Column("NAME", TypeName = "nvarchar(128)")]
|
[Column("NAME", TypeName = "nvarchar(128)")]
|
||||||
public string Name { get; set; }
|
public required string Name { get; set; }
|
||||||
|
|
||||||
[Column("COMPANY_NAME", TypeName = "nvarchar(128)")]
|
[Column("COMPANY_NAME", TypeName = "nvarchar(128)")]
|
||||||
public string CompanyName { get; set; }
|
public string? CompanyName { get; set; }
|
||||||
|
|
||||||
[Column("JOB_TITLE", TypeName = "nvarchar(128)")]
|
[Column("JOB_TITLE", TypeName = "nvarchar(128)")]
|
||||||
public string JobTitle { get; set; }
|
public string? JobTitle { get; set; }
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
[Column("ADDED_WHEN", TypeName = "datetime")]
|
[Column("ADDED_WHEN", TypeName = "datetime")]
|
||||||
public DateTime AddedWhen { get; set; }
|
public required DateTime AddedWhen { get; init; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7,13 +7,13 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\EnvelopeGenerator.Common\EnvelopeGenerator.Common.vbproj" />
|
<PackageReference Include="DigitalData.Core.Abstractions" Version="2.0.0" />
|
||||||
|
<PackageReference Include="DigitalData.EmailProfilerDispatcher.Abstraction" Version="1.0.0" />
|
||||||
|
<PackageReference Include="UserManager.Domain" Version="1.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="DigitalData.UserManager.Domain">
|
<ProjectReference Include="..\EnvelopeGenerator.Common\EnvelopeGenerator.Common.vbproj" />
|
||||||
<HintPath>..\..\WebUserManager\DigitalData.UserManager.Domain\bin\Debug\net7.0\DigitalData.UserManager.Domain.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
152
EnvelopeGenerator.Extensions/DecodingExtensions.cs
Normal file
152
EnvelopeGenerator.Extensions/DecodingExtensions.cs
Normal file
@@ -0,0 +1,152 @@
|
|||||||
|
using System.Text;
|
||||||
|
using static EnvelopeGenerator.Common.Constants;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Extensions
|
||||||
|
{
|
||||||
|
public static class DecodingExtensions
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Validates whether a given string is a correctly formatted Base-64 encoded string.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// This method checks the string for proper Base-64 formatting, which includes validating
|
||||||
|
/// the length of the string (must be divisible by 4). It also checks each character to ensure
|
||||||
|
/// it belongs to the Base-64 character set (A-Z, a-z, 0-9, '+', '/', and '=' for padding).
|
||||||
|
/// The method ensures that padding characters ('=') only appear at the end of the string and
|
||||||
|
/// are in a valid configuration (either one '=' at the end if the string's length % 4 is 3,
|
||||||
|
/// or two '==' if the length % 4 is 2).
|
||||||
|
/// </remarks>
|
||||||
|
/// <param name="input">The Base-64 encoded string to validate.</param>
|
||||||
|
/// <returns>
|
||||||
|
/// <c>true</c> if the string is a valid Base-64 encoded string; otherwise, <c>false</c>.
|
||||||
|
/// </returns>
|
||||||
|
/// <example>
|
||||||
|
/// <code>
|
||||||
|
/// string testString = "TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlzIHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2YgdGhlIG1pbmQsIHRoYXQgYnk=";
|
||||||
|
/// bool isValid = IsValidBase64String(testString);
|
||||||
|
/// Console.WriteLine(isValid); // Output: true
|
||||||
|
/// </code>
|
||||||
|
/// </example>
|
||||||
|
public static bool IsBase64String(this string input)
|
||||||
|
{
|
||||||
|
// Check if the string is null or empty
|
||||||
|
if (string.IsNullOrEmpty(input))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Replace valid base-64 padding
|
||||||
|
input = input.Trim();
|
||||||
|
int mod4 = input.Length % 4;
|
||||||
|
if (mod4 > 0)
|
||||||
|
{
|
||||||
|
// Base-64 string lengths should be divisible by 4
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check each character to ensure it is valid base-64
|
||||||
|
foreach (char c in input)
|
||||||
|
{
|
||||||
|
if (!char.IsLetterOrDigit(c) && c != '+' && c != '/' && c != '=')
|
||||||
|
{
|
||||||
|
// Invalid character detected
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ensure no invalid padding scenarios exist
|
||||||
|
if (input.EndsWith("==") && (input.Length % 4 == 0) ||
|
||||||
|
input.EndsWith("=") && (input.Length % 4 == 3))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return input.IndexOf('=') == -1; // No padding allowed except at the end
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool TryDecode(this string encodedKey, out string[] decodedKeys)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
byte[] bytes = Convert.FromBase64String(encodedKey);
|
||||||
|
string decodedString = Encoding.UTF8.GetString(bytes);
|
||||||
|
decodedKeys = decodedString.Split(new string[] { "::" }, StringSplitOptions.None);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch(ArgumentNullException) { }
|
||||||
|
catch (FormatException) { }
|
||||||
|
catch(ArgumentException) { }
|
||||||
|
|
||||||
|
decodedKeys = Array.Empty<string>();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static EncodeType GetEncodeType(this string[] decodedKeys) => decodedKeys.Length switch
|
||||||
|
{
|
||||||
|
2 => EncodeType.EnvelopeReceiver,
|
||||||
|
3 => long.TryParse(decodedKeys[1], out var _) ? EncodeType.EnvelopeReceiverReadOnly : EncodeType.Undefined,
|
||||||
|
_ => EncodeType.Undefined,
|
||||||
|
};
|
||||||
|
|
||||||
|
public static (string? EnvelopeUuid, string? ReceiverSignature) ParseEnvelopeReceiverId(this string[] decodedKeys)
|
||||||
|
=> decodedKeys.GetEncodeType() == EncodeType.EnvelopeReceiver
|
||||||
|
? (EnvelopeUuid: decodedKeys[0], ReceiverSignature: decodedKeys[1])
|
||||||
|
: throw new InvalidOperationException("Attempted to convert a decoded other than type EnvelopeReceiver to EnvelopeReceiver.");
|
||||||
|
|
||||||
|
public static long ParseReadOnlyId(this string[] decodedKeys)
|
||||||
|
=> decodedKeys.GetEncodeType() == EncodeType.EnvelopeReceiverReadOnly
|
||||||
|
? long.Parse(decodedKeys[1])
|
||||||
|
: throw new InvalidOperationException("Attempted to convert a decoded other than type EnvelopeReceiver to EnvelopeReceiver. ");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Decodes the envelope receiver ID and extracts the envelope UUID and receiver signature.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelopeReceiverId">The base64 encoded string containing the envelope UUID and receiver signature.</param>
|
||||||
|
/// <returns>A tuple containing the envelope UUID and receiver signature.</returns>
|
||||||
|
public static (string? EnvelopeUuid, string? ReceiverSignature) DecodeEnvelopeReceiverId(this string envelopeReceiverId)
|
||||||
|
{
|
||||||
|
if (!envelopeReceiverId.IsBase64String())
|
||||||
|
{
|
||||||
|
return (null, null);
|
||||||
|
}
|
||||||
|
byte[] bytes = Convert.FromBase64String(envelopeReceiverId);
|
||||||
|
string decodedString = Encoding.UTF8.GetString(bytes);
|
||||||
|
string[] parts = decodedString.Split(new string[] { "::" }, StringSplitOptions.None);
|
||||||
|
|
||||||
|
if (parts.Length > 1)
|
||||||
|
return (EnvelopeUuid: parts[0], ReceiverSignature: parts[1]);
|
||||||
|
else
|
||||||
|
return (string.Empty, string.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static long? DecodeEnvelopeReceiverReadOnlyId(this string envelopeReceiverReadOnlyId)
|
||||||
|
{
|
||||||
|
if (!envelopeReceiverReadOnlyId.IsBase64String())
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
byte[] bytes = Convert.FromBase64String(envelopeReceiverReadOnlyId);
|
||||||
|
string decodedString = System.Text.Encoding.UTF8.GetString(bytes);
|
||||||
|
string[] parts = decodedString.Split(new string[] { "::" }, StringSplitOptions.None);
|
||||||
|
|
||||||
|
if (parts.Length > 2)
|
||||||
|
return long.TryParse(parts[1], out long readOnlyId) ? readOnlyId : null;
|
||||||
|
else
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the envelope UUID from the decoded envelope receiver ID.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelopeReceiverId">The base64 encoded string to decode.</param>
|
||||||
|
/// <returns>The envelope UUID.</returns>
|
||||||
|
public static string? GetEnvelopeUuid(this string envelopeReceiverId) => envelopeReceiverId.DecodeEnvelopeReceiverId().EnvelopeUuid;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the receiver signature from the decoded envelope receiver ID.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelopeReceiverId">The base64 encoded string to decode.</param>
|
||||||
|
/// <returns>The receiver signature.</returns>
|
||||||
|
public static string? GetReceiverSignature(this string envelopeReceiverId) => envelopeReceiverId.DecodeEnvelopeReceiverId().ReceiverSignature;
|
||||||
|
}
|
||||||
|
}
|
||||||
30
EnvelopeGenerator.Extensions/EncodingExtensions.cs
Normal file
30
EnvelopeGenerator.Extensions/EncodingExtensions.cs
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Extensions
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Provides extension methods for decoding and extracting information from an envelope receiver ID.
|
||||||
|
/// </summary>
|
||||||
|
public static class EncodingExtensions
|
||||||
|
{
|
||||||
|
public static string EncodeEnvelopeReceiverId(this long readOnlyId)
|
||||||
|
{
|
||||||
|
//The random number is used as a salt to increase security but it is not saved in the database.
|
||||||
|
string combinedString = $"{Random.Shared.Next()}::{readOnlyId}::{Random.Shared.Next()}";
|
||||||
|
byte[] bytes = Encoding.UTF8.GetBytes(combinedString);
|
||||||
|
string base64String = Convert.ToBase64String(bytes);
|
||||||
|
|
||||||
|
return base64String;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string EncodeEnvelopeReceiverId(this (string envelopeUuid, string receiverSignature) input)
|
||||||
|
{
|
||||||
|
string combinedString = $"{input.envelopeUuid}::{input.receiverSignature}";
|
||||||
|
byte[] bytes = Encoding.UTF8.GetBytes(combinedString);
|
||||||
|
string base64String = Convert.ToBase64String(bytes);
|
||||||
|
|
||||||
|
return base64String;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="HtmlSanitizer" Version="8.0.865" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Localization.Abstractions" Version="7.0.19" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\EnvelopeGenerator.Common\EnvelopeGenerator.Common.vbproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
42
EnvelopeGenerator.Extensions/LoggerExtensions.cs
Normal file
42
EnvelopeGenerator.Extensions/LoggerExtensions.cs
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Extensions
|
||||||
|
{
|
||||||
|
public static class LoggerExtensions
|
||||||
|
{
|
||||||
|
public static void LogEnvelopeError(this ILogger logger, string envelopeReceiverId, Exception? exception = null, string? message = null, params object?[] args)
|
||||||
|
{
|
||||||
|
var sb = new StringBuilder().AppendLine(envelopeReceiverId.DecodeEnvelopeReceiverId().ToTitle());
|
||||||
|
|
||||||
|
if (message is not null)
|
||||||
|
sb.AppendLine(message);
|
||||||
|
|
||||||
|
if (exception is null)
|
||||||
|
logger.Log(LogLevel.Error, sb.ToString(), args);
|
||||||
|
else
|
||||||
|
logger.Log(LogLevel.Error, exception, sb.AppendLine(exception.Message).ToString(), args);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void LogEnvelopeError(this ILogger logger, string? uuid, string? signature = null, Exception? exception = null, string? message = null, params object?[] args)
|
||||||
|
{
|
||||||
|
var sb = new StringBuilder($"Envelope Uuid: {uuid}");
|
||||||
|
|
||||||
|
if (signature is not null)
|
||||||
|
sb.AppendLine().Append($"Receiver Signature: {signature}");
|
||||||
|
|
||||||
|
if (message is not null)
|
||||||
|
sb.AppendLine().Append(message);
|
||||||
|
|
||||||
|
if (exception is null)
|
||||||
|
logger.Log(LogLevel.Error, sb.ToString(), args);
|
||||||
|
else
|
||||||
|
logger.Log(LogLevel.Error, exception, sb.ToString(), args);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string ToTitle(this (string? UUID, string? Signature) envelopeReceiverTuple)
|
||||||
|
{
|
||||||
|
return $"UUID is {envelopeReceiverTuple.UUID} and signature is {envelopeReceiverTuple.Signature}";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
17
EnvelopeGenerator.Extensions/XSSExtensions.cs
Normal file
17
EnvelopeGenerator.Extensions/XSSExtensions.cs
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
using Ganss.Xss;
|
||||||
|
using Microsoft.Extensions.Localization;
|
||||||
|
using System.Text.Encodings.Web;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Extensions
|
||||||
|
{
|
||||||
|
public static class XSSExtensions
|
||||||
|
{
|
||||||
|
public static string? TryEncode(this string? value, UrlEncoder encoder) => value is null ? value : encoder.Encode(value);
|
||||||
|
|
||||||
|
public static string? TryEncode(this LocalizedString? value, UrlEncoder encoder) => value is null ? null : encoder.Encode(value);
|
||||||
|
|
||||||
|
public static string? TrySanitize(this string? html, HtmlSanitizer sanitizer) => html is null ? html : sanitizer.Sanitize(html);
|
||||||
|
|
||||||
|
public static string? TrySanitize(this LocalizedString? html, HtmlSanitizer sanitizer) => html is null ? null : sanitizer.Sanitize(html);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -38,6 +38,9 @@ Public Class EnvelopeEditorController
|
|||||||
Public Function SendEnvelope() As Boolean
|
Public Function SendEnvelope() As Boolean
|
||||||
Return ActionService.SendEnvelope(Envelope)
|
Return ActionService.SendEnvelope(Envelope)
|
||||||
End Function
|
End Function
|
||||||
|
Public Function ResendReceiverInvitation(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean
|
||||||
|
Return ActionService.ResendReceiver(pEnvelope, pReceiver)
|
||||||
|
End Function
|
||||||
|
|
||||||
Public Function ValidateEnvelopeForSending(pErrors As List(Of String)) As List(Of String)
|
Public Function ValidateEnvelopeForSending(pErrors As List(Of String)) As List(Of String)
|
||||||
Dim oEnvelopeErrors = pErrors
|
Dim oEnvelopeErrors = pErrors
|
||||||
@@ -164,7 +167,8 @@ Public Class EnvelopeEditorController
|
|||||||
.Filepath = oFileInfoTemp.FullName,
|
.Filepath = oFileInfoTemp.FullName,
|
||||||
.FileNameOriginal = oFileInfo.Name,
|
.FileNameOriginal = oFileInfo.Name,
|
||||||
.Thumbnail = Thumbnail.GetThumbnailFromPDFFile(oTempFilePath),
|
.Thumbnail = Thumbnail.GetThumbnailFromPDFFile(oTempFilePath),
|
||||||
.PageCount = Thumbnail.GetPageCount(oTempFilePath)
|
.PageCount = Thumbnail.GetPageCount(oTempFilePath),
|
||||||
|
.Byte_Data = ReadFile(pDocumentFilePath)
|
||||||
}
|
}
|
||||||
|
|
||||||
Return oDocument
|
Return oDocument
|
||||||
@@ -174,7 +178,22 @@ Public Class EnvelopeEditorController
|
|||||||
Return Nothing
|
Return Nothing
|
||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
'Open file in to a filestream and read data in a byte array.
|
||||||
|
Private Function ReadFile(ByVal sPath As String) As Byte()
|
||||||
|
'Initialize byte array with a null value initially.
|
||||||
|
Dim data As Byte() = Nothing
|
||||||
|
'Use FileInfo object to get file size.
|
||||||
|
Dim fInfo As New FileInfo(sPath)
|
||||||
|
Dim numBytes As Long = fInfo.Length
|
||||||
|
'Open FileStream to read file
|
||||||
|
Dim fStream As New FileStream(sPath, FileMode.Open, FileAccess.Read)
|
||||||
|
'Use BinaryReader to read file stream into byte array.
|
||||||
|
Dim br As New BinaryReader(fStream)
|
||||||
|
'When you use BinaryReader, you need to supply number of bytes to read from file.
|
||||||
|
'In this case we want to read entire file. So supplying total number of bytes.
|
||||||
|
data = br.ReadBytes(CInt(numBytes))
|
||||||
|
Return data
|
||||||
|
End Function
|
||||||
Public Function CreateThumbnail(pDocumentPath As String) As Bitmap
|
Public Function CreateThumbnail(pDocumentPath As String) As Bitmap
|
||||||
Try
|
Try
|
||||||
Dim oThumbNail As Bitmap = Thumbnail.GetThumbnailFromPDFFile(pDocumentPath)
|
Dim oThumbNail As Bitmap = Thumbnail.GetThumbnailFromPDFFile(pDocumentPath)
|
||||||
|
|||||||
BIN
EnvelopeGenerator.Form/DD_signFLOW_ICON.ico
Normal file
BIN
EnvelopeGenerator.Form/DD_signFLOW_ICON.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.5 KiB |
@@ -14,6 +14,8 @@
|
|||||||
<OptionCompare>Binary</OptionCompare>
|
<OptionCompare>Binary</OptionCompare>
|
||||||
<OptionStrict>Off</OptionStrict>
|
<OptionStrict>Off</OptionStrict>
|
||||||
<OptionInfer>On</OptionInfer>
|
<OptionInfer>On</OptionInfer>
|
||||||
|
<NuGetPackageImportStamp>
|
||||||
|
</NuGetPackageImportStamp>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
@@ -41,7 +43,10 @@
|
|||||||
<StartupObject>EnvelopeGenerator.Form.My.MyApplication</StartupObject>
|
<StartupObject>EnvelopeGenerator.Form.My.MyApplication</StartupObject>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ApplicationIcon>DD_signFLOW_icon_256.ico</ApplicationIcon>
|
<ApplicationIcon>DD_signFLOW_ICON.ico</ApplicationIcon>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Accessibility" />
|
<Reference Include="Accessibility" />
|
||||||
@@ -75,17 +80,27 @@
|
|||||||
<Reference Include="DigitalData.Modules.Base">
|
<Reference Include="DigitalData.Modules.Base">
|
||||||
<HintPath>..\..\DDModules\Base\bin\Debug\DigitalData.Modules.Base.dll</HintPath>
|
<HintPath>..\..\DDModules\Base\bin\Debug\DigitalData.Modules.Base.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="DigitalData.Modules.Config">
|
<Reference Include="DigitalData.Modules.Config, Version=1.2.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\DDModules\Config\bin\Debug\DigitalData.Modules.Config.dll</HintPath>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\..\2_DLL Projekte\DDModules\Config\bin\Debug\DigitalData.Modules.Config.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="DigitalData.Modules.Database">
|
<Reference Include="DigitalData.Modules.Database, Version=2.3.5.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\DDModules\Database\bin\Debug\DigitalData.Modules.Database.dll</HintPath>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\..\2_DLL Projekte\DDModules\Database\bin\Debug\DigitalData.Modules.Database.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="DigitalData.Modules.Logging">
|
<Reference Include="DigitalData.Modules.Logging, Version=2.6.3.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\DDModules\Logging\bin\Debug\DigitalData.Modules.Logging.dll</HintPath>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\..\2_DLL Projekte\DDModules\Logging\bin\Debug\DigitalData.Modules.Logging.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="GdPicture.NET.14">
|
<Reference Include="DigitalData.Modules.Messaging">
|
||||||
<HintPath>D:\ProgramFiles\GdPicture.NET 14\Redist\GdPicture.NET (.NET Framework 4.5)\GdPicture.NET.14.dll</HintPath>
|
<HintPath>..\..\2_DLL Projekte\DDModules\Messaging\bin\Debug\DigitalData.Modules.Messaging.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="EnvelopeGenerator.Common, Version=1.8.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\EnvelopeGenerator.Common\bin\Debug\EnvelopeGenerator.Common.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="GdPicture.NET.14, Version=14.2.89.0, Culture=neutral, PublicKeyToken=f52a2e60ad468dbb, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\GdPicture.14.2.89\lib\net462\GdPicture.NET.14.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
<Reference Include="NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\NLog.5.0.5\lib\net46\NLog.dll</HintPath>
|
<HintPath>..\packages\NLog.5.0.5\lib\net46\NLog.dll</HintPath>
|
||||||
@@ -176,18 +191,22 @@
|
|||||||
<Compile Include="My Project\AssemblyInfo.vb" />
|
<Compile Include="My Project\AssemblyInfo.vb" />
|
||||||
<EmbeddedResource Include="frmEnvelopeEditor.en.resx">
|
<EmbeddedResource Include="frmEnvelopeEditor.en.resx">
|
||||||
<DependentUpon>frmEnvelopeEditor.vb</DependentUpon>
|
<DependentUpon>frmEnvelopeEditor.vb</DependentUpon>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="frmEnvelopeEditor.resx">
|
<EmbeddedResource Include="frmEnvelopeEditor.resx">
|
||||||
<DependentUpon>frmEnvelopeEditor.vb</DependentUpon>
|
<DependentUpon>frmEnvelopeEditor.vb</DependentUpon>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="frmEnvelopeMainData.en.resx">
|
<EmbeddedResource Include="frmEnvelopeMainData.en.resx">
|
||||||
<DependentUpon>frmEnvelopeMainData.vb</DependentUpon>
|
<DependentUpon>frmEnvelopeMainData.vb</DependentUpon>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="frmEnvelopeMainData.resx">
|
<EmbeddedResource Include="frmEnvelopeMainData.resx">
|
||||||
<DependentUpon>frmEnvelopeMainData.vb</DependentUpon>
|
<DependentUpon>frmEnvelopeMainData.vb</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="frmFieldEditor.en.resx">
|
<EmbeddedResource Include="frmFieldEditor.en.resx">
|
||||||
<DependentUpon>frmFieldEditor.vb</DependentUpon>
|
<DependentUpon>frmFieldEditor.vb</DependentUpon>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="frmFieldEditor.resx">
|
<EmbeddedResource Include="frmFieldEditor.resx">
|
||||||
<DependentUpon>frmFieldEditor.vb</DependentUpon>
|
<DependentUpon>frmFieldEditor.vb</DependentUpon>
|
||||||
@@ -238,6 +257,7 @@
|
|||||||
</None>
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Content Include="DD_signFLOW_ICON.ico" />
|
||||||
<Content Include="DD_signFLOW_icon_256.ico" />
|
<Content Include="DD_signFLOW_icon_256.ico" />
|
||||||
<Content Include="DD_signFLOW_Preloader.png" />
|
<Content Include="DD_signFLOW_Preloader.png" />
|
||||||
<Content Include="MailLicense.xml">
|
<Content Include="MailLicense.xml">
|
||||||
@@ -246,11 +266,18 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\EnvelopeGenerator.Common\EnvelopeGenerator.Common.vbproj">
|
<ProjectReference Include="..\EnvelopeGenerator.Common\EnvelopeGenerator.Common.vbproj">
|
||||||
<Project>{6ea0c51f-c2b1-4462-8198-3de0b32b74f8}</Project>
|
<Project>{6EA0C51F-C2B1-4462-8198-3DE0B32B74F8}</Project>
|
||||||
<Name>EnvelopeGenerator.Common</Name>
|
<Name>EnvelopeGenerator.Common</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||||
|
<Import Project="..\packages\GdPicture.runtimes.windows.14.2.89\build\net462\GdPicture.runtimes.windows.targets" Condition="Exists('..\packages\GdPicture.runtimes.windows.14.2.89\build\net462\GdPicture.runtimes.windows.targets')" />
|
||||||
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
|
<PropertyGroup>
|
||||||
|
<ErrorText>Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Verwenden Sie die Wiederherstellung von NuGet-Paketen, um die fehlenden Dateien herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}".</ErrorText>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Error Condition="!Exists('..\packages\GdPicture.runtimes.windows.14.2.89\build\net462\GdPicture.runtimes.windows.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\GdPicture.runtimes.windows.14.2.89\build\net462\GdPicture.runtimes.windows.targets'))" />
|
||||||
|
</Target>
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
<Target Name="BeforeBuild">
|
<Target Name="BeforeBuild">
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user