Compare commits
154 Commits
feat/annot
...
a8a768d7d6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a8a768d7d6 | ||
|
|
31c4a8a20f | ||
|
|
e98abde5ff | ||
|
|
49497dafd1 | ||
|
|
08e1187124 | ||
|
|
1b923dc93b | ||
|
|
bdf2527fc1 | ||
|
|
1a69478f48 | ||
|
|
83d29bf78d | ||
|
|
bc45aadf27 | ||
|
|
7e66cd4dae | ||
|
|
cc11d70a27 | ||
|
|
02aeaea8a9 | ||
|
|
05867cc645 | ||
|
|
456c591fae | ||
|
|
41b2841c25 | ||
|
|
6a6da4a876 | ||
|
|
af280ee64e | ||
|
|
9b945ce232 | ||
|
|
8b1199bc71 | ||
|
|
1d74b7ca06 | ||
|
|
c1bce7c639 | ||
|
|
4401a70217 | ||
|
|
fd53f5bfd6 | ||
|
|
6126fce24d | ||
|
|
ce41090979 | ||
|
|
3fa113003c | ||
|
|
5504093591 | ||
|
|
040cf8641d | ||
|
|
09df86000b | ||
|
|
406ddfb226 | ||
|
|
b01f13fb5f | ||
|
|
00fedc7c4c | ||
|
|
171de98552 | ||
|
|
ea6d80918c | ||
|
|
3b82467133 | ||
|
|
686b1a3a59 | ||
|
|
93019362b7 | ||
|
|
7f97fd3113 | ||
|
|
5ce6c25393 | ||
|
|
972b258706 | ||
|
|
4ee5250b01 | ||
|
|
3fce092486 | ||
|
|
89d6abbb6c | ||
|
|
8b4ad5e28d | ||
|
|
773b43b1ad | ||
|
|
83fa5a29e8 | ||
|
|
09a231d01f | ||
|
|
2007ae91fb | ||
|
|
8d118308cd | ||
|
|
5a8f2d298f | ||
|
|
1a978c0ab7 | ||
|
|
ce0b1f1785 | ||
|
|
0698b44b68 | ||
|
|
7fefc68061 | ||
|
|
3035ec7e9c | ||
|
|
3a1fe45524 | ||
|
|
2db0748e60 | ||
|
|
d873d6dcf1 | ||
|
|
41e0c51055 | ||
|
|
126370ebdb | ||
|
|
629c0d51b2 | ||
|
|
dc4b5bade0 | ||
|
|
6fc0c32c46 | ||
|
|
b15616cf53 | ||
|
|
519df50404 | ||
|
|
9a71d2b805 | ||
|
|
5f8e8deb5b | ||
|
|
645153113c | ||
|
|
2ba7f41a21 | ||
|
|
c8f21be905 | ||
|
|
1875acb7b5 | ||
|
|
6bdf0d5220 | ||
|
|
ad855b77cd | ||
|
|
a781440252 | ||
|
|
5fc689ee4d | ||
|
|
38d05850e3 | ||
|
|
06d25b6f5b | ||
|
|
55b01cf396 | ||
|
|
49ccd9fef2 | ||
|
|
f877910a73 | ||
|
|
f6f4137332 | ||
|
|
486b717801 | ||
|
|
f2a09ea10e | ||
|
|
cc86e5fadd | ||
|
|
bce29aa31a | ||
|
|
95a1fd1355 | ||
|
|
613b2130a5 | ||
|
|
e4eb3e1192 | ||
|
|
1c4f7f2386 | ||
|
|
a7e4d6e58f | ||
|
|
b9c4f7da1c | ||
|
|
cec79e5b6d | ||
|
|
2f08991eeb | ||
|
|
21859ca6e6 | ||
|
|
27d9a149bc | ||
|
|
a76a079736 | ||
|
|
10341fd3cc | ||
|
|
05de44bc13 | ||
|
|
d2c45f71a0 | ||
|
|
42451a767b | ||
|
|
2692fee6d2 | ||
|
|
cae00d9177 | ||
|
|
eaa1232490 | ||
|
|
8c2550ff1d | ||
|
|
b5b9155bc0 | ||
|
|
3cc8e2b5db | ||
|
|
37032a48c9 | ||
|
|
82fc7fa762 | ||
|
|
749366fff5 | ||
|
|
40dc0ecda3 | ||
|
|
7b7a4b4f65 | ||
|
|
b609253893 | ||
|
|
b0eb1b6389 | ||
|
|
1b515ea904 | ||
|
|
4cabaf3191 | ||
|
|
8cfa28a863 | ||
|
|
3955a3232d | ||
|
|
b93ba6be17 | ||
|
|
39ff4b8867 | ||
|
|
7b7aba6efd | ||
|
|
a42e4287ff | ||
|
|
a757749767 | ||
|
|
5166f41941 | ||
|
|
928f2a7780 | ||
|
|
d46aa6e2b8 | ||
|
|
7cffc3f7bc | ||
|
|
841da3c261 | ||
|
|
adbfd69418 | ||
|
|
1e54b775a2 | ||
|
|
6e82b24578 | ||
|
|
5331efe3c1 | ||
|
|
3b4ad2960a | ||
|
|
33048e185b | ||
|
|
3ae1b94eb7 | ||
|
|
14e6a661d3 | ||
|
|
3d1966a715 | ||
|
|
c173814b8d | ||
|
|
a85397a363 | ||
|
|
2d3987b81e | ||
|
|
875ff95278 | ||
|
|
dcdf0844cb | ||
|
|
27e9de4709 | ||
|
|
e2bdc73b76 | ||
|
|
4f95a1eed4 | ||
|
|
6874e7e92c | ||
|
|
7abb3a6c8a | ||
|
|
9183ba4da5 | ||
|
|
08e2e91e9a | ||
|
|
2966d64455 | ||
|
|
41cb2c2d93 | ||
|
|
edd54ab302 | ||
|
|
5714c54385 | ||
|
|
09d2640345 |
@@ -1,4 +1,4 @@
|
|||||||
using DigitalData.Core.Abstractions.Client;
|
using DigitalData.Core.Client.Interface;
|
||||||
namespace EnvelopeGenerator.Application.Configurations;
|
namespace EnvelopeGenerator.Application.Configurations;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using DigitalData.Core.Abstractions.Infrastructure;
|
using DigitalData.Core.Application.Interfaces.Repository;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using DigitalData.Core.Abstractions.Infrastructure;
|
using DigitalData.Core.Application.Interfaces.Repository;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using DigitalData.Core.Abstractions.Infrastructure;
|
using DigitalData.Core.Application.Interfaces.Repository;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using DigitalData.Core.Abstractions.Infrastructure;
|
using DigitalData.Core.Application.Interfaces.Repository;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using static EnvelopeGenerator.Common.Constants;
|
using static EnvelopeGenerator.Common.Constants;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using DigitalData.Core.Abstractions.Infrastructure;
|
using DigitalData.Core.Application.Interfaces.Repository;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using DigitalData.Core.Abstractions.Infrastructure;
|
using DigitalData.Core.Application.Interfaces.Repository;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using DigitalData.Core.Abstractions.Infrastructure;
|
using DigitalData.Core.Application.Interfaces.Repository;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using DigitalData.Core.Abstractions.Infrastructure;
|
using DigitalData.Core.Application.Interfaces.Repository;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using DigitalData.Core.Abstractions.Infrastructure;
|
using DigitalData.Core.Application.Interfaces.Repository;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
@@ -21,5 +21,5 @@ public interface IEnvelopeReceiverRepository : ICRUDRepository<EnvelopeReceiver,
|
|||||||
|
|
||||||
Task<IEnumerable<EnvelopeReceiver>> ReadByUsernameAsync(string username, int? min_status = null, int? max_status = null, params int[] ignore_statuses);
|
Task<IEnumerable<EnvelopeReceiver>> ReadByUsernameAsync(string username, int? min_status = null, int? max_status = null, params int[] ignore_statuses);
|
||||||
|
|
||||||
Task<EnvelopeReceiver?> ReadLastByReceiver(string email);
|
Task<EnvelopeReceiver?> ReadLastByReceiverAsync(string? email = null, int? id = null, string? signature = null);
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
using DigitalData.Core.Abstractions.Infrastructure;
|
using DigitalData.Core.Application.Interfaces.Repository;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using DigitalData.Core.Abstractions.Infrastructure;
|
using DigitalData.Core.Application.Interfaces.Repository;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using DigitalData.Core.Abstractions.Infrastructure;
|
using DigitalData.Core.Application.Interfaces.Repository;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using DigitalData.Core.Abstractions.Infrastructure;
|
using DigitalData.Core.Application.Interfaces.Repository;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Contracts.SQLExecutor;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public interface IDocumentExecutor
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="base64"></param>
|
||||||
|
/// <param name="envelope_uuid"></param>
|
||||||
|
/// <param name="cancellation"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<EnvelopeDocument> CreateDocumentAsync(string base64, string envelope_uuid, CancellationToken cancellation = default);
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
using Dapper;
|
||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Contracts.SQLExecutor;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public interface IEnvelopeExecutor : ISQLExecutor
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="userId"></param>
|
||||||
|
/// <param name="title"></param>
|
||||||
|
/// <param name="message"></param>
|
||||||
|
/// <param name="tfaEnabled"></param>
|
||||||
|
/// <param name="cancellation"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Envelope> CreateEnvelopeAsync(int userId, string title = "", string message = "", bool tfaEnabled = false, CancellationToken cancellation = default);
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Contracts.SQLExecutor;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public interface IEnvelopeReceiverExecutor
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelope_uuid"></param>
|
||||||
|
/// <param name="emailAddress"></param>
|
||||||
|
/// <param name="salutation"></param>
|
||||||
|
/// <param name="phone"></param>
|
||||||
|
/// <param name="cancellation"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<EnvelopeReceiver?> AddEnvelopeReceiverAsync(string envelope_uuid, string emailAddress, string? salutation = null, string? phone = null, CancellationToken cancellation = default);
|
||||||
|
}
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
namespace EnvelopeGenerator.Application.Contracts.SQLExecutor;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Provides methods for executing common queries on a given entity type.
|
||||||
|
/// This interface abstracts away the direct usage of ORM libraries (such as Entity Framework) for querying data
|
||||||
|
/// and provides asynchronous and synchronous operations for querying a collection or single entity.
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="TEntity">The type of the entity being queried.</typeparam>
|
||||||
|
public interface IQuery<TEntity>
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Asynchronously retrieves the first entity or a default value if no entity is found.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A task that represents the asynchronous operation. The task result contains the entity or a default value.</returns>
|
||||||
|
public Task<TEntity?> FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Asynchronously retrieves a single entity or a default value if no entity is found.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A task that represents the asynchronous operation. The task result contains the entity or a default value.</returns>
|
||||||
|
public Task<TEntity?> SingleOrDefaultAsync();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Asynchronously retrieves a list of entities.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A task that represents the asynchronous operation. The task result contains the list of entities.</returns>
|
||||||
|
public Task<IEnumerable<TEntity>> ToListAsync();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Asynchronously retrieves the first entity. Throws an exception if no entity is found.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A task that represents the asynchronous operation. The task result contains the first entity.</returns>
|
||||||
|
public Task<TEntity> FirstAsync();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Asynchronously retrieves a single entity. Throws an exception if no entity is found.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A task that represents the asynchronous operation. The task result contains the single entity.</returns>
|
||||||
|
public Task<TEntity> SingleAsync();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Synchronously retrieves the first entity or a default value if no entity is found.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>The first entity or a default value.</returns>
|
||||||
|
public TEntity? FirstOrDefault();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Synchronously retrieves a single entity or a default value if no entity is found.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>The single entity or a default value.</returns>
|
||||||
|
public TEntity? SingleOrDefault();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Synchronously retrieves a list of entities.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>The list of entities.</returns>
|
||||||
|
public IEnumerable<TEntity> ToList();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Synchronously retrieves the first entity. Throws an exception if no entity is found.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>The first entity.</returns>
|
||||||
|
public TEntity First();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Synchronously retrieves a single entity. Throws an exception if no entity is found.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>The single entity.</returns>
|
||||||
|
public TEntity Single();
|
||||||
|
}
|
||||||
20
EnvelopeGenerator.Application/Contracts/SQLExecutor/ISQL.cs
Normal file
20
EnvelopeGenerator.Application/Contracts/SQLExecutor/ISQL.cs
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
namespace EnvelopeGenerator.Application.Contracts.SQLExecutor;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Represents a raw SQL query contract.
|
||||||
|
/// </summary>
|
||||||
|
public interface ISQL
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the raw SQL query string.
|
||||||
|
/// </summary>
|
||||||
|
string Raw { get; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Represents a typed SQL query contract for a specific entity.
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="TEntity">The type of the entity associated with the SQL query.</typeparam>
|
||||||
|
public interface ISQL<TEntity> : ISQL
|
||||||
|
{
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
namespace EnvelopeGenerator.Application.Contracts.SQLExecutor;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Defines methods for executing raw SQL queries or custom SQL query classes and returning query executors for further operations.
|
||||||
|
/// Provides abstraction for raw SQL execution as well as mapping the results to <typeparamref name="TEntity"/> objects.
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="TEntity">The entity type to which the SQL query results will be mapped.</typeparam>
|
||||||
|
public interface ISQLExecutor<TEntity>: ISQLExecutor
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Executes a raw SQL query and returns an <see cref="IQuery{TEntity}"/> for further querying operations on the result.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sql">The raw SQL query to execute.</param>
|
||||||
|
/// <param name="cancellation">Optional cancellation token for the operation.</param>
|
||||||
|
/// <param name="parameters">Optional parameters for the SQL query.</param>
|
||||||
|
/// <returns>An <see cref="IQuery{TEntity}"/> instance for further query operations on the result.</returns>
|
||||||
|
IQuery<TEntity> Execute(string sql, CancellationToken cancellation = default, params object[] parameters);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Executes a custom SQL query defined by a class that implements <see cref="ISQL{TEntity}"/> and returns an <see cref="IQuery{TEntity}"/> for further querying operations on the result.
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="TSQL">The type of the custom SQL query class implementing <see cref="ISQL{TEntity}"/>.</typeparam>
|
||||||
|
/// <param name="cancellation">Optional cancellation token for the operation.</param>
|
||||||
|
/// <param name="parameters">Optional parameters for the SQL query.</param>
|
||||||
|
/// <returns>An <see cref="IQuery{TEntity}"/> instance for further query operations on the result.</returns>
|
||||||
|
IQuery<TEntity> Execute<TSQL>(CancellationToken cancellation = default, params object[] parameters) where TSQL : ISQL<TEntity>;
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
using Dapper;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Contracts.SQLExecutor;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public interface ISQLExecutor
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Executes a raw SQL query and returns an <see cref="IQuery{TEntity}"/> for further querying operations on the result.
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="TEntity">The entity type to which the SQL query results will be mapped.</typeparam>
|
||||||
|
/// <param name="sql">The raw SQL query to execute.</param>
|
||||||
|
/// <param name="parameters">Parameters for the SQL query.</param>
|
||||||
|
/// <param name="cancellation">Optional cancellation token for the operation.</param>
|
||||||
|
/// <returns>An <see cref="IQuery{TEntity}"/> instance for further query operations on the result.</returns>
|
||||||
|
Task<IEnumerable<TEntity>> Execute<TEntity>(string sql, DynamicParameters parameters, CancellationToken cancellation = default);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Executes a custom SQL query defined by a class that implements <see cref="ISQL{TEntity}"/> and returns an <see cref="IQuery{TEntity}"/> for further querying operations on the result.
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="TEntity">The entity type to which the SQL query results will be mapped.</typeparam>
|
||||||
|
/// <typeparam name="TSQL">The type of the custom SQL query class implementing <see cref="ISQL{TEntity}"/>.</typeparam>
|
||||||
|
/// <param name="parameters">Parameters for the SQL query.</param>
|
||||||
|
/// <param name="cancellation">Optional cancellation token for the operation.</param>
|
||||||
|
/// <returns>An <see cref="IQuery{TEntity}"/> instance for further query operations on the result.</returns>
|
||||||
|
Task<IEnumerable<TEntity>> Execute<TEntity, TSQL>(DynamicParameters parameters, CancellationToken cancellation = default) where TSQL : ISQL;
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
using DigitalData.Core.Abstractions.Application;
|
using DigitalData.Core.Application.Interfaces;
|
||||||
using DigitalData.Core.DTO;
|
using DigitalData.Core.DTO;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using DigitalData.Core.Abstractions.Application;
|
using DigitalData.Core.Application.Interfaces;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using DigitalData.Core.Abstractions.Application;
|
using DigitalData.Core.Application.Interfaces;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Services;
|
namespace EnvelopeGenerator.Application.Contracts.Services;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using DigitalData.Core.Abstractions.Application;
|
using DigitalData.Core.Application.Interfaces;
|
||||||
using DigitalData.Core.DTO;
|
using DigitalData.Core.DTO;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using DigitalData.Core.Abstractions.Application;
|
using DigitalData.Core.Application.Interfaces;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using DigitalData.Core.Abstractions.Application;
|
using DigitalData.Core.Application.Interfaces;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using DigitalData.Core.Abstractions.Application;
|
using DigitalData.Core.Application.Interfaces;
|
||||||
using DigitalData.Core.DTO;
|
using DigitalData.Core.DTO;
|
||||||
using EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
|
using EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
|
||||||
using EnvelopeGenerator.Application.DTOs.Receiver;
|
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using DigitalData.Core.Abstractions.Application;
|
using DigitalData.Core.Application.Interfaces;
|
||||||
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
|
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
using CommandDotNet;
|
using CommandDotNet;
|
||||||
using DigitalData.Core.Abstractions.Application;
|
using DigitalData.Core.Application.Interfaces;
|
||||||
using DigitalData.Core.DTO;
|
using DigitalData.Core.DTO;
|
||||||
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
||||||
using EnvelopeGenerator.Application.DTOs.Messaging;
|
using EnvelopeGenerator.Application.DTOs.Messaging;
|
||||||
|
using EnvelopeGenerator.Application.Envelopes;
|
||||||
|
using EnvelopeGenerator.Application.Receivers.Queries.Read;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Contracts.Services;
|
namespace EnvelopeGenerator.Application.Contracts.Services;
|
||||||
@@ -31,9 +33,9 @@ public interface IEnvelopeReceiverService : IBasicCRUDService<EnvelopeReceiverDt
|
|||||||
|
|
||||||
Task<DataResult<bool>> IsExisting(string envelopeReceiverId);
|
Task<DataResult<bool>> IsExisting(string envelopeReceiverId);
|
||||||
|
|
||||||
Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUsernameAsync(string username, int? min_status = null, int? max_status = null, params int[] ignore_statuses);
|
Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUsernameAsync(string username, int? min_status = null, int? max_status = null, EnvelopeQuery? envelopeQuery = null, ReadReceiverQuery? receiverQuery = null, params int[] ignore_statuses);
|
||||||
|
|
||||||
Task<DataResult<string?>> ReadLastUsedReceiverNameByMail(string mail);
|
Task<DataResult<string?>> ReadLastUsedReceiverNameByMailAsync(string? mail = null, int? id = null, string? signature = null);
|
||||||
|
|
||||||
Task<DataResult<SmsResponse>> SendSmsAsync(string envelopeReceiverId, string message);
|
Task<DataResult<SmsResponse>> SendSmsAsync(string envelopeReceiverId, string message);
|
||||||
Task<DataResult<IEnumerable<EnvelopeReceiverSecretDto>>> ReadWithSecretByUuidAsync(string uuid);
|
Task<DataResult<IEnumerable<EnvelopeReceiverSecretDto>>> ReadWithSecretByUuidAsync(string uuid);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using DigitalData.Core.Abstractions.Application;
|
using DigitalData.Core.Application.Interfaces;
|
||||||
using DigitalData.Core.DTO;
|
using DigitalData.Core.DTO;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using DigitalData.Core.Abstractions.Application;
|
using DigitalData.Core.Application.Interfaces;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
using DigitalData.Core.Abstractions;
|
||||||
using DigitalData.Core.Abstractions.Application;
|
using DigitalData.Core.Application.Interfaces;
|
||||||
using DigitalData.Core.DTO;
|
using DigitalData.Core.DTO;
|
||||||
using EnvelopeGenerator.Application.DTOs.Receiver;
|
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
@@ -12,5 +12,5 @@ public interface IReceiverService : ICRUDService<ReceiverCreateDto, ReceiverRead
|
|||||||
|
|
||||||
Task<Result> DeleteByAsync(string? emailAddress = null, string? signature = null);
|
Task<Result> DeleteByAsync(string? emailAddress = null, string? signature = null);
|
||||||
|
|
||||||
Task<Result> UpdateAsync<TUpdateDto>(TUpdateDto updateDto) where TUpdateDto : IUnique<int>;
|
Task<Result> UpdateAsync<TUpdateDto>(TUpdateDto updateDto);
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
using DigitalData.Core.Abstractions.Application;
|
using DigitalData.Core.Application.Interfaces;
|
||||||
using EnvelopeGenerator.Application.DTOs;
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
|
|||||||
@@ -1,21 +1,35 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
|
||||||
using System.Text.Json.Serialization;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs
|
namespace EnvelopeGenerator.Application.DTOs;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data Transfer Object representing configuration settings.
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public class ConfigDto
|
||||||
{
|
{
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
/// <summary>
|
||||||
public record ConfigDto(
|
/// Gets or sets the path to the document.
|
||||||
string DocumentPath,
|
/// </summary>
|
||||||
int SendingProfile,
|
public string DocumentPath { get; set; }
|
||||||
string SignatureHost,
|
|
||||||
string ExternalProgramName,
|
/// <summary>
|
||||||
string ExportPath) : IUnique<int>
|
/// Gets or sets the sending profile identifier.
|
||||||
{
|
/// </summary>
|
||||||
[NotMapped]
|
public int SendingProfile { get; set; }
|
||||||
[JsonIgnore]
|
|
||||||
[Obsolete("Configuration does not have an ID; it represents a single table in the database.")]
|
/// <summary>
|
||||||
public int Id => throw new InvalidOperationException("This configuration does not support an ID as it represents a single row in the database.");
|
/// Gets or sets the signature host URL or name.
|
||||||
};
|
/// </summary>
|
||||||
|
public string SignatureHost { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the name of the external program.
|
||||||
|
/// </summary>
|
||||||
|
public string ExternalProgramName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the path where exports will be saved.
|
||||||
|
/// </summary>
|
||||||
|
public string ExportPath { get; set; }
|
||||||
}
|
}
|
||||||
@@ -1,26 +1,95 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs
|
namespace EnvelopeGenerator.Application.DTOs;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data Transfer Object representing a positioned element assigned to a document receiver.
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public class DocumentReceiverElementDto
|
||||||
{
|
{
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
/// <summary>
|
||||||
public record DocumentReceiverElementDto(
|
/// Gets or sets the unique identifier of the element.
|
||||||
int Id,
|
/// </summary>
|
||||||
int DocumentId,
|
public int Id { get; set; }
|
||||||
int ReceiverId,
|
|
||||||
int ElementType,
|
/// <summary>
|
||||||
double X,
|
/// Gets or sets the identifier of the associated document.
|
||||||
double Y,
|
/// </summary>
|
||||||
double Width,
|
public int DocumentId { get; set; }
|
||||||
double Height,
|
|
||||||
int Page,
|
/// <summary>
|
||||||
bool Required,
|
/// Gets or sets the identifier of the receiver.
|
||||||
string? Tooltip,
|
/// </summary>
|
||||||
bool ReadOnly,
|
public int ReceiverId { get; set; }
|
||||||
int AnnotationIndex,
|
|
||||||
DateTime AddedWhen,
|
/// <summary>
|
||||||
DateTime? ChangedWhen,
|
/// Gets or sets the type of the element.
|
||||||
double Top,
|
/// </summary>
|
||||||
double Left
|
public int ElementType { get; set; }
|
||||||
): IUnique<int>;
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the X coordinate of the element.
|
||||||
|
/// </summary>
|
||||||
|
public double X { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the Y coordinate of the element.
|
||||||
|
/// </summary>
|
||||||
|
public double Y { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the width of the element.
|
||||||
|
/// </summary>
|
||||||
|
public double Width { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the height of the element.
|
||||||
|
/// </summary>
|
||||||
|
public double Height { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the page number where the element appears.
|
||||||
|
/// </summary>
|
||||||
|
public int Page { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets a value indicating whether the element is required.
|
||||||
|
/// </summary>
|
||||||
|
public bool Required { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the tooltip text for the element.
|
||||||
|
/// </summary>
|
||||||
|
public string? Tooltip { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets a value indicating whether the element is read-only.
|
||||||
|
/// </summary>
|
||||||
|
public bool ReadOnly { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the annotation index for ordering or reference.
|
||||||
|
/// </summary>
|
||||||
|
public int AnnotationIndex { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the timestamp when the element was added.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime AddedWhen { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the timestamp when the element was last changed, if applicable.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? ChangedWhen { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the top position of the element (in layout terms).
|
||||||
|
/// </summary>
|
||||||
|
public double Top { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the left position of the element (in layout terms).
|
||||||
|
/// </summary>
|
||||||
|
public double Left { get; set; }
|
||||||
}
|
}
|
||||||
@@ -1,18 +1,50 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs
|
namespace EnvelopeGenerator.Application.DTOs;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data Transfer Object representing the status of a document for a specific receiver.
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public class DocumentStatusDto
|
||||||
{
|
{
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
/// <summary>
|
||||||
public record DocumentStatusDto(
|
/// Gets or sets the unique identifier of the document status entry.
|
||||||
int Id,
|
/// </summary>
|
||||||
int EnvelopeId,
|
public int Id { get; set; }
|
||||||
int ReceiverId,
|
|
||||||
int Status,
|
/// <summary>
|
||||||
DateTime? StatusChangedWhen,
|
/// Gets or sets the ID of the associated envelope.
|
||||||
DateTime AddedWhen,
|
/// </summary>
|
||||||
DateTime? ChangedWhen) : IUnique<int>
|
public int EnvelopeId { get; set; }
|
||||||
{
|
|
||||||
public string? Value { get; set; }
|
/// <summary>
|
||||||
};
|
/// Gets or sets the ID of the receiver associated with this status.
|
||||||
|
/// </summary>
|
||||||
|
public int ReceiverId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the current status code.
|
||||||
|
/// </summary>
|
||||||
|
public int Status { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the timestamp when the status was changed.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? StatusChangedWhen { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the timestamp when this record was added.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime AddedWhen { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the timestamp when this record was last changed.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? ChangedWhen { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the display value associated with the status.
|
||||||
|
/// </summary>
|
||||||
|
public string? Value { get; set; }
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,31 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs
|
namespace EnvelopeGenerator.Application.DTOs
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
public record EmailTemplateDto(
|
public record EmailTemplateDto
|
||||||
int Id,
|
{
|
||||||
string Name,
|
/// <summary>
|
||||||
string Body,
|
///
|
||||||
string Subject) : IUnique<int>;
|
/// </summary>
|
||||||
|
public int Id{ get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public required string Name { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public required string Body { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public required string Subject { get; set; }
|
||||||
|
};
|
||||||
}
|
}
|
||||||
@@ -1,16 +1,50 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs
|
namespace EnvelopeGenerator.Application.DTOs;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data Transfer Object representing certificate information for an envelope.
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public class EnvelopeCertificateDto
|
||||||
{
|
{
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
/// <summary>
|
||||||
public record EnvelopeCertificateDto(
|
/// Gets the unique identifier of the certificate.
|
||||||
int Id,
|
/// </summary>
|
||||||
int EnvelopeId,
|
public int Id { get; init; }
|
||||||
string EnvelopeUuid,
|
|
||||||
string EnvelopeSubject,
|
/// <summary>
|
||||||
int CreatorId,
|
/// Gets the envelope ID associated with the certificate.
|
||||||
string CreatorName,
|
/// </summary>
|
||||||
string CreatorEmail,
|
public int EnvelopeId { get; init; }
|
||||||
int EnvelopeStatus) : IUnique<int>;
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the UUID of the envelope.
|
||||||
|
/// </summary>
|
||||||
|
public string EnvelopeUuid { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the subject of the envelope.
|
||||||
|
/// </summary>
|
||||||
|
public string EnvelopeSubject { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the ID of the creator of the envelope.
|
||||||
|
/// </summary>
|
||||||
|
public int CreatorId { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the name of the creator.
|
||||||
|
/// </summary>
|
||||||
|
public string CreatorName { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the email address of the creator.
|
||||||
|
/// </summary>
|
||||||
|
public string CreatorEmail { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the current status of the envelope.
|
||||||
|
/// </summary>
|
||||||
|
public int EnvelopeStatus { get; init; }
|
||||||
}
|
}
|
||||||
@@ -1,15 +1,35 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs
|
namespace EnvelopeGenerator.Application.DTOs;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data Transfer Object representing a document within an envelope, including optional binary data and form elements.
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public class EnvelopeDocumentDto
|
||||||
{
|
{
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
/// <summary>
|
||||||
public record EnvelopeDocumentDto
|
/// Gets or sets the unique identifier of the document.
|
||||||
(
|
/// </summary>
|
||||||
int Id,
|
public int Id { get; set; }
|
||||||
int EnvelopeId,
|
|
||||||
DateTime AddedWhen,
|
/// <summary>
|
||||||
byte[]? ByteData = null,
|
/// Gets or sets the envelope ID to which the document belongs.
|
||||||
IEnumerable<DocumentReceiverElementDto>? Elements = null
|
/// </summary>
|
||||||
) : IUnique<int>;
|
public int EnvelopeId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the date and time when the document was added.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime AddedWhen { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the binary data of the document, if available.
|
||||||
|
/// </summary>
|
||||||
|
public byte[]? ByteData { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the collection of elements associated with the document for receiver interactions, if any.
|
||||||
|
/// </summary>
|
||||||
|
public IEnumerable<DocumentReceiverElementDto>? Elements { get; set; }
|
||||||
}
|
}
|
||||||
@@ -1,71 +1,54 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
|
||||||
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
|
|
||||||
using DigitalData.UserManager.Application.DTOs.User;
|
using DigitalData.UserManager.Application.DTOs.User;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs
|
namespace EnvelopeGenerator.Application.DTOs;
|
||||||
|
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public record EnvelopeDto
|
||||||
{
|
{
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
public int Id { get; set; }
|
||||||
public record EnvelopeDto() : IUnique<int>
|
|
||||||
{
|
|
||||||
public int Id { get; set; }
|
|
||||||
|
|
||||||
public int UserId { get; set; }
|
public int UserId { get; set; }
|
||||||
|
|
||||||
public int Status { get; set; }
|
public int Status { get; set; }
|
||||||
|
|
||||||
public string StatusName { get; set; }
|
public string StatusName { get; set; }
|
||||||
|
|
||||||
public string Uuid { get; set; }
|
public string Uuid { get; set; }
|
||||||
|
|
||||||
[TemplatePlaceholder("[MESSAGE]")]
|
[TemplatePlaceholder("[MESSAGE]")]
|
||||||
public string Message { get; set; }
|
public string Message { get; set; }
|
||||||
public DateTime? ExpiresWhen { get; set; }
|
|
||||||
public DateTime? ExpiresWarningWhen { get; set; }
|
|
||||||
public DateTime AddedWhen { get; set; }
|
|
||||||
public DateTime? ChangedWhen { get; set; }
|
|
||||||
|
|
||||||
[TemplatePlaceholder("[DOCUMENT_TITLE]")]
|
public DateTime AddedWhen { get; set; }
|
||||||
public string Title { get; set; }
|
|
||||||
|
|
||||||
public int? ContractType { get; set; }
|
public DateTime? ChangedWhen { get; set; }
|
||||||
|
|
||||||
public string Language { get; set; }
|
[TemplatePlaceholder("[DOCUMENT_TITLE]")]
|
||||||
|
public string Title { get; set; }
|
||||||
|
|
||||||
public bool? SendReminderEmails { get; set; }
|
public int? ContractType { get; set; }
|
||||||
|
|
||||||
public int? FirstReminderDays { get; set; }
|
public string Language { get; set; }
|
||||||
|
|
||||||
public int? ReminderIntervalDays { get; set; }
|
public int? EnvelopeTypeId { get; set; }
|
||||||
|
|
||||||
public int? EnvelopeTypeId { get; set; }
|
public int? CertificationType { get; set; }
|
||||||
|
|
||||||
public int? CertificationType { get; set; }
|
public bool? UseAccessCode { get; set; }
|
||||||
|
|
||||||
public bool? UseAccessCode { get; set; }
|
public bool TFAEnabled { get; init; }
|
||||||
|
|
||||||
public int? FinalEmailToCreator { get; set; }
|
public UserReadDto? User { get; set; }
|
||||||
|
|
||||||
public int? FinalEmailToReceivers { get; set; }
|
public EnvelopeType? EnvelopeType { get; set; }
|
||||||
|
|
||||||
public int? ExpiresWhenDays { get; set; }
|
public string? EnvelopeTypeTitle { get; set; }
|
||||||
|
|
||||||
public int? ExpiresWarningWhenDays { get; set; }
|
public bool IsAlreadySent { get; set; }
|
||||||
|
|
||||||
public bool TFAEnabled { get; init; }
|
public byte[]? DocResult { get; init; }
|
||||||
|
|
||||||
public bool DmzMoved { get; set; }
|
public IEnumerable<EnvelopeDocumentDto>? Documents { get; set; }
|
||||||
public UserReadDto? User { get; set; }
|
|
||||||
public EnvelopeType? EnvelopeType { get; set; }
|
|
||||||
|
|
||||||
public string? EnvelopeTypeTitle { get; set; }
|
|
||||||
|
|
||||||
public bool IsAlreadySent { get; set; }
|
|
||||||
|
|
||||||
public string? StatusTranslated { get; set; }
|
|
||||||
|
|
||||||
public string? ContractTypeTranslated { get; set; }
|
|
||||||
public IEnumerable<EnvelopeDocumentDto>? Documents { get; set; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,34 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs.EnvelopeHistory
|
namespace EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data Transfer Object for creating a new envelope history record.
|
||||||
|
/// </summary>
|
||||||
|
public class EnvelopeHistoryCreateDto
|
||||||
{
|
{
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
/// <summary>
|
||||||
public record EnvelopeHistoryCreateDto(
|
/// Gets or sets the identifier of the envelope.
|
||||||
int EnvelopeId,
|
/// </summary>
|
||||||
string UserReference,
|
public int EnvelopeId { get; set; }
|
||||||
int Status,
|
|
||||||
DateTime? ActionDate,
|
/// <summary>
|
||||||
string? Comment = null);
|
/// Gets or sets the user reference associated with the action.
|
||||||
|
/// </summary>
|
||||||
|
public required string UserReference { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the status of the envelope at the time of the action.
|
||||||
|
/// </summary>
|
||||||
|
public int Status { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the date and time when the action occurred.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? ActionDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets an optional comment related to the action.
|
||||||
|
/// </summary>
|
||||||
|
public string? Comment { get; set; }
|
||||||
}
|
}
|
||||||
@@ -1,23 +1,73 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
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 EnvelopeGenerator.Application.DTOs.Receiver;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using static EnvelopeGenerator.Common.Constants;
|
using static EnvelopeGenerator.Common.Constants;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs.EnvelopeHistory
|
namespace EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data Transfer Object representing the history of an envelope, including status, sender, receiver, and related metadata.
|
||||||
|
/// </summary>
|
||||||
|
public record EnvelopeHistoryDto : IUnique<long>
|
||||||
{
|
{
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
/// <summary>
|
||||||
public record EnvelopeHistoryDto(
|
/// Unique identifier for the envelope history entry.
|
||||||
long Id,
|
/// </summary>
|
||||||
int EnvelopeId,
|
public long Id { get; set; }
|
||||||
string UserReference,
|
|
||||||
int Status,
|
/// <summary>
|
||||||
string? StatusName,
|
/// Identifier of the associated envelope.
|
||||||
DateTime AddedWhen,
|
/// </summary>
|
||||||
DateTime? ActionDate,
|
public int EnvelopeId { get; set; }
|
||||||
UserCreateDto? Sender,
|
|
||||||
ReceiverReadDto? Receiver,
|
/// <summary>
|
||||||
ReferenceType ReferenceType,
|
/// Reference string for the user related to this history entry.
|
||||||
string? Comment = null) : BaseDTO<long>(Id), IUnique<long>;
|
/// </summary>
|
||||||
}
|
public string UserReference { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Status code of the envelope at this history point.
|
||||||
|
/// </summary>
|
||||||
|
public int Status { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Human-readable name of the status.
|
||||||
|
/// </summary>
|
||||||
|
public string? StatusName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Date and time when this history entry was added.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime AddedWhen { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Date and time when an action was performed, if applicable.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? ActionDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Information about the sender associated with this history entry.
|
||||||
|
/// </summary>
|
||||||
|
public UserCreateDto? Sender { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Information about the receiver associated with this history entry.
|
||||||
|
/// </summary>
|
||||||
|
public ReceiverReadDto? Receiver { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Type of reference for this history entry.
|
||||||
|
/// </summary>
|
||||||
|
public ReferenceType ReferenceType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Optional comment related to this history entry.
|
||||||
|
/// </summary>
|
||||||
|
public string? Comment { get; set; }
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public override int GetHashCode()
|
||||||
|
{
|
||||||
|
return Id.GetHashCode();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|||||||
@@ -1,18 +1,62 @@
|
|||||||
using EnvelopeGenerator.Application.DTOs.Receiver;
|
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly
|
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Represents a read-only Data Transfer Object (DTO) for an envelope receiver.
|
||||||
|
/// Contains information about the receiver, associated envelope, and audit details.
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public class EnvelopeReceiverReadOnlyDto
|
||||||
{
|
{
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
/// <summary>
|
||||||
public record EnvelopeReceiverReadOnlyDto(
|
/// Gets or inits the unique identifier of the envelope receiver.
|
||||||
long Id,
|
/// </summary>
|
||||||
long EnvelopeId,
|
public long Id { get; init; }
|
||||||
string ReceiverMail,
|
|
||||||
DateTime DateValid,
|
/// <summary>
|
||||||
DateTime AddedWhen,
|
/// Gets or inits the identifier of the associated envelope.
|
||||||
string AddedWho,
|
/// </summary>
|
||||||
EnvelopeDto? Envelope = null,
|
public long EnvelopeId { get; init; }
|
||||||
string? ChangedWho = null,
|
|
||||||
DateTime? ChangedWhen = null,
|
/// <summary>
|
||||||
ReceiverReadDto? Receiver = null);
|
/// Gets or inits the email address of the receiver.
|
||||||
|
/// </summary>
|
||||||
|
public string ReceiverMail { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or inits the date until which the receiver is valid.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime DateValid { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or inits the date and time when the receiver was added.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime AddedWhen { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or inits the user who added the receiver.
|
||||||
|
/// </summary>
|
||||||
|
public string AddedWho { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or inits the associated envelope details.
|
||||||
|
/// </summary>
|
||||||
|
public EnvelopeDto? Envelope { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or inits the user who last changed the receiver, if any.
|
||||||
|
/// </summary>
|
||||||
|
public string? ChangedWho { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or inits the date and time when the receiver was last changed, if any.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? ChangedWhen { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or inits the associated receiver details.
|
||||||
|
/// </summary>
|
||||||
|
public ReceiverReadDto? Receiver { get; set; }
|
||||||
}
|
}
|
||||||
@@ -1,14 +1,31 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
using DigitalData.Core.Abstractions;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly
|
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data Transfer Object for updating a read-only envelope receiver.
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public class EnvelopeReceiverReadOnlyUpdateDto : IUnique<long>
|
||||||
{
|
{
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
/// <summary>
|
||||||
public record EnvelopeReceiverReadOnlyUpdateDto(
|
/// Gets or sets the unique identifier of the envelope receiver.
|
||||||
long Id,
|
/// </summary>
|
||||||
DateTime DateValid,
|
public long Id { get; init; }
|
||||||
string ChangedWho) : IUnique<long>
|
|
||||||
{
|
/// <summary>
|
||||||
public DateTime ChangedWhen { get; } = DateTime.Now;
|
/// Gets or sets the date when the envelope receiver becomes valid.
|
||||||
};
|
/// </summary>
|
||||||
|
public DateTime DateValid { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the name of the user who made the change.
|
||||||
|
/// </summary>
|
||||||
|
public string ChangedWho { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the date and time when the change was made.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime ChangedWhen { get; set; } = DateTime.Now;
|
||||||
}
|
}
|
||||||
@@ -1,23 +1,85 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs
|
namespace EnvelopeGenerator.Application.DTOs;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data Transfer Object representing a type of envelope with its configuration settings.
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public class EnvelopeTypeDto
|
||||||
{
|
{
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
/// <summary>
|
||||||
public record EnvelopeTypeDto(
|
/// Gets or sets the unique identifier of the envelope type.
|
||||||
int Id,
|
/// </summary>
|
||||||
string Title,
|
public int Id { get; set; }
|
||||||
string Language,
|
|
||||||
int? ExpiresDays,
|
/// <summary>
|
||||||
int? CertificationType,
|
/// Gets or sets the title of the envelope type.
|
||||||
bool? UseAccessCode,
|
/// </summary>
|
||||||
int? FinalEmailToCreator,
|
public string Title { get; set; }
|
||||||
int? FinalEmailToReceivers,
|
|
||||||
DateTime AddedWhen,
|
/// <summary>
|
||||||
DateTime? ChangedWhen,
|
/// Gets or sets the language code used in this envelope type.
|
||||||
int? ExpiresWarningDays,
|
/// </summary>
|
||||||
bool? SendReminderEmails,
|
public string Language { get; set; }
|
||||||
int? FirstReminderDays,
|
|
||||||
int? ReminderIntervalDays,
|
/// <summary>
|
||||||
int? ContractType) : IUnique<int>;
|
/// Gets or sets the number of days after which the envelope expires.
|
||||||
|
/// </summary>
|
||||||
|
public int? ExpiresDays { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the certification type identifier.
|
||||||
|
/// </summary>
|
||||||
|
public int? CertificationType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets a value indicating whether an access code is required.
|
||||||
|
/// </summary>
|
||||||
|
public bool? UseAccessCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the final email template ID to be sent to the creator.
|
||||||
|
/// </summary>
|
||||||
|
public int? FinalEmailToCreator { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the final email template ID to be sent to the receivers.
|
||||||
|
/// </summary>
|
||||||
|
public int? FinalEmailToReceivers { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the timestamp when this envelope type was added.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime AddedWhen { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the timestamp when this envelope type was last changed.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? ChangedWhen { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the number of days before expiry when a warning should be sent.
|
||||||
|
/// </summary>
|
||||||
|
public int? ExpiresWarningDays { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets a value indicating whether reminder emails should be sent.
|
||||||
|
/// </summary>
|
||||||
|
public bool? SendReminderEmails { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the number of days before the first reminder is sent.
|
||||||
|
/// </summary>
|
||||||
|
public int? FirstReminderDays { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the interval in days between reminder emails.
|
||||||
|
/// </summary>
|
||||||
|
public int? ReminderIntervalDays { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the contract type associated with the envelope type.
|
||||||
|
/// </summary>
|
||||||
|
public int? ContractType { get; set; }
|
||||||
}
|
}
|
||||||
@@ -3,21 +3,30 @@ using System.ComponentModel.DataAnnotations;
|
|||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs.Receiver
|
namespace EnvelopeGenerator.Application.DTOs.Receiver;
|
||||||
{
|
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
|
||||||
public record ReceiverCreateDto([EmailAddress] string EmailAddress, string? TotpSecretkey = null)
|
|
||||||
{
|
|
||||||
public string Signature => sha256HexOfMail.Value;
|
|
||||||
|
|
||||||
private readonly Lazy<string> sha256HexOfMail = new(() =>
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public record ReceiverCreateDto
|
||||||
|
{
|
||||||
|
public ReceiverCreateDto()
|
||||||
|
{
|
||||||
|
_sha256HexOfMail = new(() =>
|
||||||
{
|
{
|
||||||
var bytes_arr = Encoding.UTF8.GetBytes(EmailAddress.ToUpper());
|
var bytes_arr = Encoding.UTF8.GetBytes(EmailAddress.ToUpper());
|
||||||
var hash_arr = SHA256.HashData(bytes_arr);
|
var hash_arr = SHA256.HashData(bytes_arr);
|
||||||
var hexa_str = BitConverter.ToString(hash_arr);
|
var hexa_str = BitConverter.ToString(hash_arr);
|
||||||
return hexa_str.Replace("-", string.Empty);
|
return hexa_str.Replace("-", string.Empty);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public DateTime AddedWhen { get; } = DateTime.Now;
|
[EmailAddress]
|
||||||
};
|
public required string EmailAddress { get; init; }
|
||||||
}
|
|
||||||
|
public string? TotpSecretkey { get; init; }
|
||||||
|
|
||||||
|
public string Signature => _sha256HexOfMail.Value;
|
||||||
|
|
||||||
|
private readonly Lazy<string> _sha256HexOfMail;
|
||||||
|
|
||||||
|
public DateTime AddedWhen { get; } = DateTime.Now;
|
||||||
|
};
|
||||||
@@ -1,26 +1,31 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
||||||
using DigitalData.Core.DTO;
|
|
||||||
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
|
|
||||||
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs.Receiver;
|
namespace EnvelopeGenerator.Application.DTOs.Receiver;
|
||||||
|
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
public record ReceiverReadDto(
|
public class ReceiverReadDto
|
||||||
int Id,
|
|
||||||
string EmailAddress,
|
|
||||||
string Signature,
|
|
||||||
DateTime AddedWhen
|
|
||||||
) : BaseDTO<int>(Id), IUnique<int>
|
|
||||||
{
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
public string EmailAddress { get; set; }
|
||||||
|
|
||||||
|
public string Signature { get; set; }
|
||||||
|
|
||||||
|
public DateTime AddedWhen { get; set; }
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public IEnumerable<EnvelopeReceiverBasicDto>? EnvelopeReceivers { get; init; }
|
public IEnumerable<EnvelopeReceiverBasicDto>? EnvelopeReceivers { get; set; }
|
||||||
|
|
||||||
public string? LastUsedName => EnvelopeReceivers?.LastOrDefault()?.Name;
|
public string? LastUsedName => EnvelopeReceivers?.LastOrDefault()?.Name;
|
||||||
|
|
||||||
public string? TotpSecretkey { get; set; } = null;
|
public string? TotpSecretkey { get; set; } = null;
|
||||||
|
|
||||||
public DateTime? TfaRegDeadline { get; set; }
|
public DateTime? TfaRegDeadline { get; set; }
|
||||||
};
|
|
||||||
|
public override int GetHashCode()
|
||||||
|
{
|
||||||
|
return Id.GetHashCode();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,27 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs.Receiver;
|
namespace EnvelopeGenerator.Application.DTOs.Receiver;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data Transfer Object for updating a receiver's information.
|
||||||
|
/// </summary>
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
public record ReceiverUpdateDto(int Id, string? TotpSecretkey = null, DateTime? TfaRegDeadline = null) : IUnique<int>;
|
public class ReceiverUpdateDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the unique identifier of the receiver.
|
||||||
|
/// </summary>
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the TOTP (Time-based One-Time Password) secret key.
|
||||||
|
/// Optional.
|
||||||
|
/// </summary>
|
||||||
|
public string? TotpSecretkey { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the deadline for two-factor authentication registration.
|
||||||
|
/// Optional.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? TfaRegDeadline { get; set; }
|
||||||
|
}
|
||||||
@@ -1,15 +1,45 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs
|
namespace EnvelopeGenerator.Application.DTOs;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data Transfer Object representing a user receiver with associated details.
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
|
public class UserReceiverDto
|
||||||
{
|
{
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
/// <summary>
|
||||||
public record UserReceiverDto(
|
/// Gets or sets the unique identifier of the user receiver.
|
||||||
int Id,
|
/// </summary>
|
||||||
int UserId,
|
public int Id { get; set; }
|
||||||
int ReceiverId,
|
|
||||||
string Name,
|
/// <summary>
|
||||||
string CompanyName,
|
/// Gets or sets the identifier of the user associated with the receiver.
|
||||||
string JobTitle,
|
/// </summary>
|
||||||
DateTime AddedWhen) : IUnique<int>;
|
public int UserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the identifier of the receiver.
|
||||||
|
/// </summary>
|
||||||
|
public int ReceiverId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the name of the receiver.
|
||||||
|
/// </summary>
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the company name of the receiver.
|
||||||
|
/// </summary>
|
||||||
|
public string CompanyName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the job title of the receiver.
|
||||||
|
/// </summary>
|
||||||
|
public string JobTitle { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the timestamp when the user receiver was added.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime AddedWhen { get; set; }
|
||||||
}
|
}
|
||||||
@@ -7,6 +7,7 @@ using DigitalData.Core.Client;
|
|||||||
using QRCoder;
|
using QRCoder;
|
||||||
using EnvelopeGenerator.Application.Contracts.Services;
|
using EnvelopeGenerator.Application.Contracts.Services;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using EnvelopeGenerator.Application.EnvelopeReceivers.Commands.Create;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application;
|
namespace EnvelopeGenerator.Application;
|
||||||
|
|
||||||
@@ -58,6 +59,7 @@ public static class DependencyInjection
|
|||||||
services.AddMediatR(cfg =>
|
services.AddMediatR(cfg =>
|
||||||
{
|
{
|
||||||
cfg.RegisterServicesFromAssembly(Assembly.GetExecutingAssembly());
|
cfg.RegisterServicesFromAssembly(Assembly.GetExecutingAssembly());
|
||||||
|
cfg.RegisterServicesFromAssembly(typeof(CreateEnvelopeReceiverCommandHandler).Assembly);
|
||||||
});
|
});
|
||||||
|
|
||||||
return services;
|
return services;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using DigitalData.Core.Abstractions.Infrastructure;
|
using DigitalData.Core.Application.Interfaces.Repository;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
|
|
||||||
|
|||||||
@@ -3,23 +3,8 @@
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents the response for reading a document.
|
/// Represents the response for reading a document.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ReadDocumentResponse
|
public class ReadDocumentResponse : ReadDocumentResponseBase
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// The unique identifier of the document.
|
|
||||||
/// </summary>
|
|
||||||
public int Guid { get; init; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The identifier of the associated envelope.
|
|
||||||
/// </summary>
|
|
||||||
public int EnvelopeId { get; init; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The date and time when the document was added.
|
|
||||||
/// </summary>
|
|
||||||
public DateTime AddedWhen { get; init; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The binary data of the document, if available.
|
/// The binary data of the document, if available.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
namespace EnvelopeGenerator.Application.Documents.Queries.Read;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Represents the response for reading a document.
|
||||||
|
/// </summary>
|
||||||
|
public class ReadDocumentResponseBase
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The unique identifier of the document.
|
||||||
|
/// </summary>
|
||||||
|
public int Guid { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The identifier of the associated envelope.
|
||||||
|
/// </summary>
|
||||||
|
public int EnvelopeId { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The date and time when the document was added.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime AddedWhen { get; init; }
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using EnvelopeGenerator.Common;
|
using EnvelopeGenerator.Common;
|
||||||
|
using MediatR;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.EmailTemplates.Commands.Reset;
|
namespace EnvelopeGenerator.Application.EmailTemplates.Commands.Reset;
|
||||||
|
|
||||||
@@ -6,8 +7,7 @@ namespace EnvelopeGenerator.Application.EmailTemplates.Commands.Reset;
|
|||||||
/// Ein Befehl zum Zurücksetzen einer E-Mail-Vorlage auf die Standardwerte.
|
/// Ein Befehl zum Zurücksetzen einer E-Mail-Vorlage auf die Standardwerte.
|
||||||
/// Erbt von <see cref="EmailTemplateQuery"/> und ermöglicht die Angabe einer optionalen ID und eines Typs der E-Mail-Vorlage.
|
/// Erbt von <see cref="EmailTemplateQuery"/> und ermöglicht die Angabe einer optionalen ID und eines Typs der E-Mail-Vorlage.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="Id">Die optionale ID der E-Mail-Vorlage, die zurückgesetzt werden soll.</param>
|
/// Beispiele:
|
||||||
/// <param name="Type">Der Typ der E-Mail-Vorlage, z. B. <see cref="Constants.EmailTemplateType"/> (optional). Beispiele:
|
|
||||||
/// 0 - DocumentReceived: Benachrichtigung über den Empfang eines Dokuments.
|
/// 0 - DocumentReceived: Benachrichtigung über den Empfang eines Dokuments.
|
||||||
/// 1 - DocumentSigned: Benachrichtigung über die Unterzeichnung eines Dokuments.
|
/// 1 - DocumentSigned: Benachrichtigung über die Unterzeichnung eines Dokuments.
|
||||||
/// 2 - DocumentDeleted: Benachrichtigung über das Löschen eines Dokuments.
|
/// 2 - DocumentDeleted: Benachrichtigung über das Löschen eines Dokuments.
|
||||||
@@ -19,4 +19,23 @@ namespace EnvelopeGenerator.Application.EmailTemplates.Commands.Reset;
|
|||||||
/// 8 - DocumentRejected_REC (Für den ablehnenden Empfänger): Mail an den ablehnenden Empfänger, wenn das Dokument abgelehnt wird.
|
/// 8 - DocumentRejected_REC (Für den ablehnenden Empfänger): Mail an den ablehnenden Empfänger, wenn das Dokument abgelehnt wird.
|
||||||
/// 9 - DocumentRejected_REC_2 (Für sonstige Empfänger): Mail an andere Empfänger (Brief), wenn das Dokument abgelehnt wird.
|
/// 9 - DocumentRejected_REC_2 (Für sonstige Empfänger): Mail an andere Empfänger (Brief), wenn das Dokument abgelehnt wird.
|
||||||
/// </param>
|
/// </param>
|
||||||
public record ResetEnvelopeTemplateCommand(int? Id, Constants.EmailTemplateType? Type) : EmailTemplateQuery(Id, Type);
|
public record ResetEmailTemplateCommand : EmailTemplateQuery, IRequest
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="orginal"></param>
|
||||||
|
public ResetEmailTemplateCommand(EmailTemplateQuery? orginal = null) : base(orginal ?? new())
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Id">Die optionale ID der E-Mail-Vorlage, die zurückgesetzt werden soll.</param>
|
||||||
|
/// <param name="Type">Der Typ der E-Mail-Vorlage, z. B. <see cref="Constants.EmailTemplateType"/> (optional).
|
||||||
|
public ResetEmailTemplateCommand(int? Id = null, Constants.EmailTemplateType? Type = null) : base(Id, Type)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,113 @@
|
|||||||
|
using DigitalData.Core.Application.Interfaces.Repository;
|
||||||
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
using MediatR;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.EmailTemplates.Commands.Reset;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class ResetEmailTemplateCommandHandler : IRequestHandler<ResetEmailTemplateCommand>
|
||||||
|
{
|
||||||
|
private readonly IRepository<EmailTemplate> _repository;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="repository"></param>
|
||||||
|
public ResetEmailTemplateCommandHandler(IRepository<EmailTemplate> repository)
|
||||||
|
{
|
||||||
|
_repository = repository;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="cancel"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task Handle(ResetEmailTemplateCommand request, CancellationToken cancel)
|
||||||
|
{
|
||||||
|
var temps = request.Id is not null
|
||||||
|
? await _repository.ReadAllAsync<EmailTemplateDto>(t => t.Id == request.Id, cancel)
|
||||||
|
: request.Type is not null
|
||||||
|
? await _repository.ReadAllAsync<EmailTemplateDto>(t => t.Name == request.Type.ToString(), cancel)
|
||||||
|
: await _repository.ReadAllAsync<EmailTemplateDto>(ct: cancel);
|
||||||
|
|
||||||
|
foreach (var temp in temps)
|
||||||
|
{
|
||||||
|
var def = Defaults.Where(t => t.Name == temp.Name).FirstOrDefault();
|
||||||
|
if(def is not null)
|
||||||
|
await _repository.UpdateAsync(def, t => t.Id == temp.Id, cancel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public static readonly IEnumerable<EmailTemplateDto> Defaults = new List<EmailTemplateDto>()
|
||||||
|
{
|
||||||
|
new(){
|
||||||
|
Id = 1,
|
||||||
|
Name = "DocumentReceived",
|
||||||
|
Body = "Guten Tag [NAME_RECEIVER],<br />\r\n<br /><B><I>\r\n[NAME_SENDER]</I></B> hat Ihnen ein Dokument zum [SIGNATURE_TYPE] gesendet.<br />\r\n<br />\r\nÜber den folgenden Link können Sie das Dokument einsehen und elektronisch unterschreiben: <a href=\"[LINK_TO_DOCUMENT]\">[LINK_TO_DOCUMENT_TEXT]</a><br />\r\n<br />\r\n[MESSAGE]<br />\r\n<br />\r\nMit freundlichen Grüßen<br />\r\n<br />\r\n[NAME_PORTAL]",
|
||||||
|
Subject = "Dokument erhalten: '[DOCUMENT_TITLE]'"
|
||||||
|
},
|
||||||
|
new(){
|
||||||
|
Id = 2,
|
||||||
|
Name = "DocumentDeleted",
|
||||||
|
Body = "Guten Tag [NAME_RECEIVER],<br />\r\n<br /><B><I>\r\n[NAME_SENDER]</I></B> hat den Umschlag <B><I>'[DOCUMENT_TITLE]'</I></B> gelöscht/zurückgezogen.<br /><p>\rBegründung: <br /> <I>[REASON]</I> <p>\r\n<br />\r\nMit freundlichen Grüßen<br />\r\n<br />\r\n[NAME_PORTAL]",
|
||||||
|
Subject = "Umschlag zurückgezogen: '[DOCUMENT_TITLE]'"
|
||||||
|
},
|
||||||
|
new(){
|
||||||
|
Id = 3,
|
||||||
|
Name = "DocumentSigned",
|
||||||
|
Body = "Guten Tag [NAME_RECEIVER],<br />\r\n<br />\r\nhiermit bestätigen wir Ihnen die erfolgreiche Signatur für den Vorgang <B><I>'[DOCUMENT_TITLE]'</I></B>.<br />\r\nWenn alle Vertragspartner unterzeichnet haben, erhalten Sie ebenfalls per email ein unterschriebenes Exemplar mit dem Signierungszertifikat!\r\n<br />\r\nMit freundlichen Grüßen<br />\r\n<br />\r\n[NAME_PORTAL]",
|
||||||
|
Subject = "Dokument unterschrieben: '[DOCUMENT_TITLE]'"
|
||||||
|
},
|
||||||
|
new(){
|
||||||
|
Id = 4,
|
||||||
|
Name = "DocumentCompleted",
|
||||||
|
Body = "Guten Tag [NAME_RECEIVER],<br />\r\n<br />\r\nDer Signaturvorgang <B><I>'[DOCUMENT_TITLE]'</I></B> wurde erfolgreich abgeschlossen.<br />\r\n<br />\r\nSie erhalten das Dokument mit einem detaillierten Ergebnisbericht als Anhang zu dieser Email.<br />\r\n<br />\r\nMit freundlichen Grüßen<br />\r\n<br />\r\n[NAME_PORTAL]",
|
||||||
|
Subject = "Umschlag abgeschlossen: '[DOCUMENT_TITLE]'"
|
||||||
|
},
|
||||||
|
new(){
|
||||||
|
Id = 5,
|
||||||
|
Name = "DocumentAccessCodeReceived",
|
||||||
|
Body = "Guten Tag [NAME_RECEIVER],<br />\r\n<br /><B><I>\r\n[NAME_SENDER]</I></B> hat Ihnen ein Dokument zum [SIGNATURE_TYPE] gesendet. <br />\r\n<br />\r\nVerwenden Sie den folgenden Zugriffscode, um das Dokument einzusehen:<br />\r\n<br />\r\n[DOCUMENT_ACCESS_CODE]<br />\r\n<br />\r\nMit freundlichen Grüßen<br />\r\n<br />\r\n[NAME_PORTAL]",
|
||||||
|
Subject = "Zugriffscode für Dokument erhalten: '[DOCUMENT_TITLE]'"
|
||||||
|
},
|
||||||
|
new(){
|
||||||
|
Id = 6,
|
||||||
|
Name = "DocumentRejected_ADM",
|
||||||
|
Body = "Guten Tag [NAME_SENDER],<p><B><I>[NAME_RECEIVER]</I></B> hat den Umschlag <B><I>'[DOCUMENT_TITLE]'</I></B> mit folgendem Grund abgelehnt: <p>\r\n[REASON] \r\n<p>Der Umschlag wurde auf den Status Rejected gesetzt. <p> \r\nMit freundlichen Grüßen<br />\r\n<br />\r\n[NAME_PORTAL]",
|
||||||
|
Subject = "'[DOCUMENT_TITLE]' - Unterzeichnungsvorgang zurückgezogen"
|
||||||
|
},
|
||||||
|
new(){
|
||||||
|
Id = 9,
|
||||||
|
Name = "DocumentRejected_REC",
|
||||||
|
Body = "Guten Tag [NAME_RECEIVER],\r\n<p>Hiermit bestätigen wir Ihnen die Ablehnung des Unterzeichnungsvorganges <B><I>'[DOCUMENT_TITLE]'</I></B>!<p>Der Vertragsinhaber <B><I>[NAME_SENDER]</I></B> wurde über die Ablehnung informiert. <p> \r\nMit freundlichen Grüßen<br />\r\n<br />\r\n[NAME_PORTAL]",
|
||||||
|
Subject = "'[DOCUMENT_TITLE]' - Bestätigung Ablehnung"
|
||||||
|
},
|
||||||
|
new(){
|
||||||
|
Id = 10,
|
||||||
|
Name = "DocumentRejected_REC_2",
|
||||||
|
Body = "Guten Tag [NAME_RECEIVER],\r\n<p>Der Unterzeichnungsvorganges <B><I>'[DOCUMENT_TITLE]'</I></B> wurde durch einen anderen Vertragspartner abgelehnt! Ihre notwendige Unterzeichnung wurde verworfen.<p> Der Vertragsinhaber <B><I>[NAME_SENDER]</I></B> wird sich bei Bedarf mit Ihnen in Verbindung setzen. <p> \r\nMit freundlichen Grüßen<br />\r\n<br />\r\n[NAME_PORTAL]",
|
||||||
|
Subject = "'[DOCUMENT_TITLE]' - Unterzeichnungsvorgang abgelehnt."
|
||||||
|
},
|
||||||
|
new(){
|
||||||
|
Id = 11,
|
||||||
|
Name = "DocumentShared",
|
||||||
|
Body = "Guten Tag,<br /> <br /><B><I> [NAME_RECEIVER]</I></B> hat Ihnen ein Dokument zum Ansehen gesendet.<br /> <br /> Über den folgenden Link können Sie das Dokument einsehen: <a href=\"[LINK_TO_DOCUMENT]\">[LINK_TO_DOCUMENT_TEXT]</a><br /> <br /> <br /> Mit freundlichen Grüßen<br /> <br /> [NAME_PORTAL]",
|
||||||
|
Subject = "Dokument geteilt: '[DOCUMENT_TITLE]'"
|
||||||
|
},
|
||||||
|
new(){
|
||||||
|
Id = 12,
|
||||||
|
Name = "TotpSecret",
|
||||||
|
Body = "Guten Tag,<br /> <br />Sie können auf Ihren Zwei-Faktor-Authentifizierungscode zugreifen, indem Sie den unten stehenden QR-Code mit einer beliebigen Authentifizierungs-App auf Ihrem Telefon scannen (Google Authenticator, Microsoft Authenticator usw.). Dieser Code ist bis zum [TFA_EXPIRATION] gültig.<br /> <br /> <img src=\"data:image/png;base64,[TFA_QR_CODE]\" style=\"width: 13rem; height: 13rem;\"><br /> <br />\r\n<br /> Mit freundlichen Grüßen<br /> <br /> [NAME_PORTAL]",
|
||||||
|
Subject = "2-Faktor-Verifizierung QR-Code"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using System.Text.Json.Serialization;
|
using MediatR;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.EmailTemplates.Commands.Update;
|
namespace EnvelopeGenerator.Application.EmailTemplates.Commands.Update;
|
||||||
|
|
||||||
@@ -12,11 +13,17 @@ namespace EnvelopeGenerator.Application.EmailTemplates.Commands.Update;
|
|||||||
/// <param name="Subject">
|
/// <param name="Subject">
|
||||||
/// (Optional) Der neue Betreff der E-Mail. Wenn null, bleibt der vorhandene Betreff unverändert.
|
/// (Optional) Der neue Betreff der E-Mail. Wenn null, bleibt der vorhandene Betreff unverändert.
|
||||||
/// </param>
|
/// </param>
|
||||||
public record UpdateEmailTemplateCommand(string? Body = null, string? Subject = null)
|
public record UpdateEmailTemplateCommand(string? Body = null, string? Subject = null) : IRequest
|
||||||
{
|
{
|
||||||
/// <param>
|
/// <param>
|
||||||
/// Die Abfrage, die die E-Mail-Vorlage darstellt, die aktualisiert werden soll.
|
/// Die Abfrage, die die E-Mail-Vorlage darstellt, die aktualisiert werden soll.
|
||||||
/// </param>
|
/// </param>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public EmailTemplateQuery? EmailTemplateQuery { get; set; }
|
public EmailTemplateQuery? EmailTemplateQuery { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[JsonIgnore]
|
||||||
|
public DateTime ChangedWhen { get; init; } = DateTime.Now;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,63 @@
|
|||||||
|
using DigitalData.Core.Application.Interfaces.Repository;
|
||||||
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
|
using EnvelopeGenerator.Application.Exceptions;
|
||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
using MediatR;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.EmailTemplates.Commands.Update;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class UpdateEmailTemplateCommandHandler : IRequestHandler<UpdateEmailTemplateCommand>
|
||||||
|
{
|
||||||
|
private readonly IRepository<EmailTemplate> _repository;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="repository"></param>
|
||||||
|
public UpdateEmailTemplateCommandHandler(IRepository<EmailTemplate> repository)
|
||||||
|
{
|
||||||
|
_repository = repository;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="cancel"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="InvalidOperationException"></exception>
|
||||||
|
/// <exception cref="NotFoundException"></exception>
|
||||||
|
public async Task Handle(UpdateEmailTemplateCommand request, CancellationToken cancel)
|
||||||
|
{
|
||||||
|
EmailTemplateDto? temp;
|
||||||
|
|
||||||
|
if (request.EmailTemplateQuery?.Id is int id)
|
||||||
|
{
|
||||||
|
temp = await _repository.ReadOrDefaultAsync<EmailTemplateDto>(t => t.Id == id, single: false, cancel);
|
||||||
|
}
|
||||||
|
else if (request!.EmailTemplateQuery!.Type is Common.Constants.EmailTemplateType type)
|
||||||
|
{
|
||||||
|
temp = await _repository.ReadOrDefaultAsync<EmailTemplateDto>(t => t.Name == type.ToString(), single: false, cancel);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException("Both id and type is null. Id: " + request.EmailTemplateQuery.Id +". Type: " + request.EmailTemplateQuery.Type.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (temp == null)
|
||||||
|
{
|
||||||
|
throw new NotFoundException();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (request.Body is not null)
|
||||||
|
temp.Body = request.Body;
|
||||||
|
|
||||||
|
if (request.Subject is not null)
|
||||||
|
temp.Subject = request.Subject;
|
||||||
|
|
||||||
|
await _repository.UpdateAsync(temp, t => t.Id == temp.Id, cancel);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
using AutoMapper;
|
||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.EmailTemplates.Queries.Read;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class ReadEmailTemplateMappingProfile : Profile
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public ReadEmailTemplateMappingProfile()
|
||||||
|
{
|
||||||
|
CreateMap<EmailTemplate, ReadEmailTemplateResponse>();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,10 +1,12 @@
|
|||||||
namespace EnvelopeGenerator.Application.EmailTemplates.Queries.Read;
|
using MediatR;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.EmailTemplates.Queries.Read;
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Stellt eine Abfrage dar, um eine E-Mail-Vorlage zu lesen.
|
/// Stellt eine Abfrage dar, um eine E-Mail-Vorlage zu lesen.
|
||||||
/// Diese Klasse erbt von <see cref="EmailTemplateQuery"/>.
|
/// Diese Klasse erbt von <see cref="EmailTemplateQuery"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public record ReadEmailTemplateQuery : EmailTemplateQuery
|
public record ReadEmailTemplateQuery : EmailTemplateQuery, IRequest<ReadEmailTemplateResponse?>
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,52 @@
|
|||||||
|
using AutoMapper;
|
||||||
|
using EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
|
using EnvelopeGenerator.Application.DTOs;
|
||||||
|
using EnvelopeGenerator.Common;
|
||||||
|
using MediatR;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.EmailTemplates.Queries.Read;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class ReadEmailTemplateQueryHandler : IRequestHandler<ReadEmailTemplateQuery, ReadEmailTemplateResponse?>
|
||||||
|
{
|
||||||
|
private readonly IMapper _mapper;
|
||||||
|
|
||||||
|
private readonly IEmailTemplateRepository _repository;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initialisiert eine neue Instanz der <see cref="EmailTemplateController"/>-Klasse.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="mapper">
|
||||||
|
/// <param name="repository">
|
||||||
|
/// Die AutoMapper-Instanz, die zum Zuordnen von Objekten verwendet wird.
|
||||||
|
/// </param>
|
||||||
|
public ReadEmailTemplateQueryHandler(IMapper mapper, IEmailTemplateRepository repository)
|
||||||
|
{
|
||||||
|
_mapper = mapper;
|
||||||
|
_repository = repository;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="InvalidOperationException"></exception>
|
||||||
|
public async Task<ReadEmailTemplateResponse?> Handle(ReadEmailTemplateQuery request, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
var temp = request.Id is int id
|
||||||
|
? await _repository.ReadByIdAsync(id)
|
||||||
|
: request.Type is Constants.EmailTemplateType type
|
||||||
|
? await _repository.ReadByNameAsync(type)
|
||||||
|
: throw new InvalidOperationException("Either a valid integer ID or a valid EmailTemplateType must be provided in the request.");
|
||||||
|
|
||||||
|
var res = _mapper.Map<ReadEmailTemplateResponse>(temp);
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,18 +3,35 @@
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Stellt die Antwort für eine Abfrage von E-Mail-Vorlagen bereit.
|
/// Stellt die Antwort für eine Abfrage von E-Mail-Vorlagen bereit.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="Id">Die eindeutige Kennung der E-Mail-Vorlage.</param>
|
public class ReadEmailTemplateResponse
|
||||||
/// <param name="Type">Der Typ der E-Mail-Vorlage.</param>
|
|
||||||
/// <param name="AddedWhen">Das Datum und die Uhrzeit, wann die Vorlage hinzugefügt wurde.</param>
|
|
||||||
/// <param name="Body">Der Inhalt (Body) der E-Mail-Vorlage. Kann null sein.</param>
|
|
||||||
/// <param name="Subject">Der Betreff der E-Mail-Vorlage. Kann null sein.</param>
|
|
||||||
/// <param name="ChangedWhen">Das Datum und die Uhrzeit, wann die Vorlage zuletzt geändert wurde. Kann null sein.</param>
|
|
||||||
public record ReadEmailTemplateResponse(
|
|
||||||
int Id,
|
|
||||||
int Type,
|
|
||||||
DateTime AddedWhen,
|
|
||||||
string? Body = null,
|
|
||||||
string? Subject = null,
|
|
||||||
DateTime? ChangedWhen = null)
|
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Die eindeutige Kennung der E-Mail-Vorlage.
|
||||||
|
/// </summary>
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Name des Typs
|
||||||
|
/// </summary>
|
||||||
|
public required string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Das Datum und die Uhrzeit, wann die Vorlage hinzugefügt wurde.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime AddedWhen { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Der Inhalt (Body) der E-Mail-Vorlage. Kann null sein.
|
||||||
|
/// </summary>
|
||||||
|
public string? Body { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Der Betreff der E-Mail-Vorlage. Kann null sein.
|
||||||
|
/// </summary>
|
||||||
|
public string? Subject { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Das Datum und die Uhrzeit, wann die Vorlage zuletzt geändert wurde. Kann null sein.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? ChangedWhen { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,14 +13,16 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="DigitalData.Core.Abstractions" Version="3.4.3" />
|
<PackageReference Include="Dapper" Version="2.1.66" />
|
||||||
<PackageReference Include="DigitalData.Core.Application" Version="3.2.1" />
|
<PackageReference Include="DigitalData.Core.Abstractions" Version="4.0.0" />
|
||||||
<PackageReference Include="DigitalData.Core.Client" Version="2.0.3" />
|
<PackageReference Include="DigitalData.Core.Application" Version="3.3.1" />
|
||||||
<PackageReference Include="DigitalData.Core.DTO" Version="2.0.1" />
|
<PackageReference Include="DigitalData.Core.Client" Version="2.1.0" />
|
||||||
<PackageReference Include="DigitalData.EmailProfilerDispatcher" Version="3.0.0" />
|
<PackageReference Include="DigitalData.EmailProfilerDispatcher" Version="3.1.0" />
|
||||||
<PackageReference Include="MediatR" Version="12.5.0" />
|
<PackageReference Include="MediatR" Version="12.5.0" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.18" />
|
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.18" />
|
||||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.4" />
|
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.1" />
|
||||||
|
<PackageReference Include="Microsoft.Data.SqlClient" Version="6.0.2" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.5" />
|
||||||
<PackageReference Include="Otp.NET" Version="1.4.0" />
|
<PackageReference Include="Otp.NET" Version="1.4.0" />
|
||||||
<PackageReference Include="QRCoder" Version="1.6.0" />
|
<PackageReference Include="QRCoder" Version="1.6.0" />
|
||||||
<PackageReference Include="QRCoder-ImageSharp" Version="0.10.0" />
|
<PackageReference Include="QRCoder-ImageSharp" Version="0.10.0" />
|
||||||
@@ -28,6 +30,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\EnvelopeGenerator.Common\EnvelopeGenerator.Common.vbproj" />
|
||||||
<ProjectReference Include="..\EnvelopeGenerator.Domain\EnvelopeGenerator.Domain.csproj" />
|
<ProjectReference Include="..\EnvelopeGenerator.Domain\EnvelopeGenerator.Domain.csproj" />
|
||||||
<ProjectReference Include="..\EnvelopeGenerator.Extensions\EnvelopeGenerator.Extensions.csproj" />
|
<ProjectReference Include="..\EnvelopeGenerator.Extensions\EnvelopeGenerator.Extensions.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using MediatR;
|
using EnvelopeGenerator.Application.Envelopes.Commands;
|
||||||
|
using MediatR;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Commands.Create;
|
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Commands.Create;
|
||||||
@@ -17,43 +18,4 @@ public record CreateEnvelopeReceiverCommand(
|
|||||||
[Required] DocumentCreateCommand Document,
|
[Required] DocumentCreateCommand Document,
|
||||||
[Required] IEnumerable<ReceiverGetOrCreateCommand> Receivers,
|
[Required] IEnumerable<ReceiverGetOrCreateCommand> Receivers,
|
||||||
bool TFAEnabled = false
|
bool TFAEnabled = false
|
||||||
) : IRequest;
|
) : CreateEnvelopeCommand(Title, Message, TFAEnabled), IRequest<CreateEnvelopeReceiverResponse?>;
|
||||||
|
|
||||||
#region DTOs
|
|
||||||
/// <summary>
|
|
||||||
/// Signaturposition auf einem Dokument.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="X">X-Position</param>
|
|
||||||
/// <param name="Y">Y-Position</param>
|
|
||||||
/// <param name="Page">Seite, auf der sie sich befindet</param>
|
|
||||||
public record Signature([Required] int X, [Required] int Y, [Required] int Page);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// DTO für Empfänger, die erstellt oder abgerufen werden sollen.
|
|
||||||
/// Wenn nicht, wird sie erstellt und mit einer Signatur versehen.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="Signatures">Unterschriften auf Dokumenten.</param>
|
|
||||||
/// <param name="Salution">Der Name, mit dem der Empfänger angesprochen werden soll. Bei Null oder keinem Wert wird der zuletzt verwendete Name verwendet.</param>
|
|
||||||
/// <param name="PhoneNumber">Sollte mit Vorwahl geschrieben werden</param>
|
|
||||||
public record ReceiverGetOrCreateCommand([Required] IEnumerable<Signature> Signatures, string? Salution = null, string? PhoneNumber = null)
|
|
||||||
{
|
|
||||||
private string _emailAddress = string.Empty;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// E-Mail-Adresse des Empfängers.
|
|
||||||
/// </summary>
|
|
||||||
[Required]
|
|
||||||
public required string EmailAddress { get => _emailAddress.ToLower(); init => _emailAddress = _emailAddress.ToLower(); }
|
|
||||||
};
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// DTO zum Erstellen eines Dokuments.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="DataAsByte">
|
|
||||||
/// Die Dokumentdaten im Byte-Array-Format. Wird verwendet, wenn das Dokument als Roh-Binärdaten bereitgestellt wird.
|
|
||||||
/// </param>
|
|
||||||
/// <param name="DataAsBase64">
|
|
||||||
/// Die Dokumentdaten im Base64-String-Format. Wird verwendet, wenn das Dokument als Base64-codierter String bereitgestellt wird.
|
|
||||||
/// </param>
|
|
||||||
public record DocumentCreateCommand(byte[]? DataAsByte = null, string? DataAsBase64 = null);
|
|
||||||
#endregion
|
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
using AutoMapper;
|
||||||
|
using EnvelopeGenerator.Application.Contracts.SQLExecutor;
|
||||||
|
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
using MediatR;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Commands.Create;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handles the creation of an envelope along with its associated document and recipients.
|
||||||
|
/// This command processes the envelope data, including title, message, document content,
|
||||||
|
/// recipient list, and optional two-factor authentication settings.
|
||||||
|
/// </summary>
|
||||||
|
public class CreateEnvelopeReceiverCommandHandler : IRequestHandler<CreateEnvelopeReceiverCommand, CreateEnvelopeReceiverResponse>
|
||||||
|
{
|
||||||
|
private readonly IMapper _mapper;
|
||||||
|
|
||||||
|
private readonly IEnvelopeExecutor _envelopeExecutor;
|
||||||
|
|
||||||
|
private readonly IEnvelopeReceiverExecutor _erExecutor;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="mapper"></param>
|
||||||
|
/// <param name="envelopeExecutor"></param>
|
||||||
|
/// <param name="erExecutor"></param>
|
||||||
|
public CreateEnvelopeReceiverCommandHandler(IMapper mapper, IEnvelopeExecutor envelopeExecutor, IEnvelopeReceiverExecutor erExecutor)
|
||||||
|
{
|
||||||
|
_mapper = mapper;
|
||||||
|
_envelopeExecutor = envelopeExecutor;
|
||||||
|
_erExecutor = erExecutor;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handles the execution of the <see cref="CreateEnvelopeReceiverCommand"/>.
|
||||||
|
/// Responsible for validating input data, creating or retrieving recipients, associating signatures,
|
||||||
|
/// and storing the envelope and document details.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request">The command containing all necessary information to create an envelope.</param>
|
||||||
|
/// <param name="cancel">Token to observe while waiting for the task to complete.</param>
|
||||||
|
/// <returns>A task representing the asynchronous operation.</returns>
|
||||||
|
public async Task<CreateEnvelopeReceiverResponse> Handle(CreateEnvelopeReceiverCommand request, CancellationToken cancel)
|
||||||
|
{
|
||||||
|
int userId = request.UserId ?? throw new InvalidOperationException("UserId cannot be null when creating an envelope.");
|
||||||
|
|
||||||
|
var envelope = await _envelopeExecutor.CreateEnvelopeAsync(userId, request.Title, request.Message, request.TFAEnabled, cancel);
|
||||||
|
|
||||||
|
List<EnvelopeReceiver> sentRecipients = new();
|
||||||
|
List<ReceiverGetOrCreateCommand> unsentRecipients = new();
|
||||||
|
|
||||||
|
foreach (var receiver in request.Receivers)
|
||||||
|
{
|
||||||
|
var envelopeReceiver = await _erExecutor.AddEnvelopeReceiverAsync(envelope.Uuid, receiver.EmailAddress, receiver.Salution, receiver.PhoneNumber, cancel);
|
||||||
|
|
||||||
|
if (envelopeReceiver is null)
|
||||||
|
unsentRecipients.Add(receiver);
|
||||||
|
else
|
||||||
|
sentRecipients.Add(envelopeReceiver);
|
||||||
|
}
|
||||||
|
|
||||||
|
var res = _mapper.Map<CreateEnvelopeReceiverResponse>(envelope);
|
||||||
|
res.UnsentReceivers = unsentRecipients;
|
||||||
|
res.SentReceiver = _mapper.Map<IEnumerable<ReceiverReadDto>>(sentRecipients);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Commands.Create;
|
||||||
|
|
||||||
|
#region DTOs
|
||||||
|
/// <summary>
|
||||||
|
/// Signaturposition auf einem Dokument.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="X">X-Position</param>
|
||||||
|
/// <param name="Y">Y-Position</param>
|
||||||
|
/// <param name="Page">Seite, auf der sie sich befindet</param>
|
||||||
|
public record Signature([Required] double X, [Required] double Y, [Required] int Page);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// DTO für Empfänger, die erstellt oder abgerufen werden sollen.
|
||||||
|
/// Wenn nicht, wird sie erstellt und mit einer Signatur versehen.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Signatures">Unterschriften auf Dokumenten.</param>
|
||||||
|
/// <param name="Salution">Der Name, mit dem der Empfänger angesprochen werden soll. Bei Null oder keinem Wert wird der zuletzt verwendete Name verwendet.</param>
|
||||||
|
/// <param name="PhoneNumber">Sollte mit Vorwahl geschrieben werden</param>
|
||||||
|
public record ReceiverGetOrCreateCommand([Required] IEnumerable<Signature> Signatures, string? Salution = null, string? PhoneNumber = null)
|
||||||
|
{
|
||||||
|
private string _emailAddress = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// E-Mail-Adresse des Empfängers.
|
||||||
|
/// </summary>
|
||||||
|
[Required]
|
||||||
|
public string EmailAddress { get => _emailAddress.ToLower(); init => _emailAddress = value.ToLower(); }
|
||||||
|
};
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// DTO zum Erstellen eines Dokuments.
|
||||||
|
/// </summary>
|
||||||
|
public record DocumentCreateCommand()
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Die Dokumentdaten im Base64-String-Format. Wird verwendet, wenn das Dokument als Base64-codierter String bereitgestellt wird.
|
||||||
|
/// </summary>
|
||||||
|
[Required]
|
||||||
|
public required string DataAsBase64 { get; init; }
|
||||||
|
};
|
||||||
|
#endregion
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
using AutoMapper;
|
||||||
|
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||||
|
using EnvelopeGenerator.Application.Envelopes.Commands;
|
||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Commands.Create;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class CreateEnvelopeReceiverMappingProfile : Profile
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public CreateEnvelopeReceiverMappingProfile()
|
||||||
|
{
|
||||||
|
CreateMap<Envelope, CreateEnvelopeResponse>();
|
||||||
|
CreateMap<Receiver, ReceiverReadDto>();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
using DigitalData.UserManager.Domain.Entities;
|
||||||
|
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||||
|
using EnvelopeGenerator.Application.Envelopes.Commands;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Commands.Create;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public record CreateEnvelopeReceiverResponse : CreateEnvelopeResponse
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Id"></param>
|
||||||
|
/// <param name="UserId"></param>
|
||||||
|
/// <param name="Status"></param>
|
||||||
|
/// <param name="Uuid"></param>
|
||||||
|
/// <param name="Message"></param>
|
||||||
|
/// <param name="AddedWhen"></param>
|
||||||
|
/// <param name="ChangedWhen"></param>
|
||||||
|
/// <param name="Title"></param>
|
||||||
|
/// <param name="Language"></param>
|
||||||
|
/// <param name="TFAEnabled"></param>
|
||||||
|
/// <param name="User"></param>
|
||||||
|
public CreateEnvelopeReceiverResponse(int Id, int UserId, int Status, string Uuid, string? Message, DateTime AddedWhen, DateTime? ChangedWhen, string? Title, string Language, bool TFAEnabled, User User) : base(Id, UserId, Status, Uuid, Message, AddedWhen, ChangedWhen, Title, Language, TFAEnabled, User)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public IEnumerable<ReceiverReadDto> SentReceiver { get; set; } = new List<ReceiverReadDto>();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public IEnumerable<ReceiverGetOrCreateCommand> UnsentReceivers { get; set; } = new List<ReceiverGetOrCreateCommand>();
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
using MediatR;
|
||||||
|
using Microsoft.AspNetCore.Mvc.ModelBinding;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Envelopes.Commands;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Befehl zur Erstellung eines Umschlags.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Title">Der Titel des Umschlags. Dies ist ein Pflichtfeld.</param>
|
||||||
|
/// <param name="Message">Die Nachricht, die im Umschlag enthalten sein soll. Dies ist ein Pflichtfeld.</param>
|
||||||
|
/// <param name="TFAEnabled">Gibt an, ob die Zwei-Faktor-Authentifizierung für den Umschlag aktiviert ist. Standardmäßig false.</param>
|
||||||
|
public record CreateEnvelopeCommand(
|
||||||
|
[Required] string Title,
|
||||||
|
[Required] string Message,
|
||||||
|
bool TFAEnabled = false
|
||||||
|
) : IRequest<CreateEnvelopeResponse?>
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Id of receiver
|
||||||
|
/// </summary>
|
||||||
|
[JsonIgnore]
|
||||||
|
[BindNever]
|
||||||
|
public int? UserId { get; set; }
|
||||||
|
};
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
using AutoMapper;
|
||||||
|
using EnvelopeGenerator.Application.Contracts.SQLExecutor;
|
||||||
|
using MediatR;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Envelopes.Commands;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class CreateEnvelopeCommandHandler : IRequestHandler<CreateEnvelopeCommand, CreateEnvelopeResponse?>
|
||||||
|
{
|
||||||
|
private readonly IEnvelopeExecutor _envelopeExecutor;
|
||||||
|
|
||||||
|
private readonly IMapper _mapper;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelopeExecutor"></param>
|
||||||
|
/// <param name="mapper"></param>
|
||||||
|
public CreateEnvelopeCommandHandler(IEnvelopeExecutor envelopeExecutor, IMapper mapper)
|
||||||
|
{
|
||||||
|
_envelopeExecutor = envelopeExecutor;
|
||||||
|
_mapper = mapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<CreateEnvelopeResponse?> Handle(CreateEnvelopeCommand request, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
int userId = request.UserId ?? throw new InvalidOperationException("UserId cannot be null when creating an envelope.");
|
||||||
|
|
||||||
|
var envelope = await _envelopeExecutor.CreateEnvelopeAsync(userId, request.Title, request.Message, request.TFAEnabled, cancellationToken);
|
||||||
|
|
||||||
|
return _mapper.Map<CreateEnvelopeResponse>(envelope);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
using AutoMapper;
|
||||||
|
using EnvelopeGenerator.Application.EnvelopeReceivers.Commands.Create;
|
||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Envelopes.Commands;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class CreateEnvelopeMappingProfile : Profile
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public CreateEnvelopeMappingProfile()
|
||||||
|
{
|
||||||
|
CreateMap<Envelope, CreateEnvelopeReceiverResponse>();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
using EnvelopeGenerator.Application.Envelopes.Queries.Read;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Envelopes.Commands;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Id"><inheritdoc/></param>
|
||||||
|
/// <param name="UserId"><inheritdoc/></param>
|
||||||
|
/// <param name="Status"><inheritdoc/></param>
|
||||||
|
/// <param name="Uuid"><inheritdoc/></param>
|
||||||
|
/// <param name="Message"><inheritdoc/></param>
|
||||||
|
/// <param name="AddedWhen"><inheritdoc/></param>
|
||||||
|
/// <param name="ChangedWhen"><inheritdoc/></param>
|
||||||
|
/// <param name="Title"><inheritdoc/></param>
|
||||||
|
/// <param name="Language"><inheritdoc/></param>
|
||||||
|
/// <param name="TFAEnabled"><inheritdoc/></param>
|
||||||
|
/// <param name="User"><inheritdoc/></param>
|
||||||
|
public record CreateEnvelopeResponse(int Id, int UserId, int Status, string Uuid, string? Message, DateTime AddedWhen, DateTime? ChangedWhen, string? Title, string Language, bool TFAEnabled, DigitalData.UserManager.Domain.Entities.User User)
|
||||||
|
: ReadEnvelopeResponse(Id, UserId, Status, Uuid, Message, AddedWhen, ChangedWhen, Title, Language, TFAEnabled, User);
|
||||||
@@ -6,8 +6,6 @@ namespace EnvelopeGenerator.Application.Envelopes.Queries.ReceiverName;
|
|||||||
/// Eine Abfrage, um die zuletzt verwendete Anrede eines Empfängers zu ermitteln,
|
/// Eine Abfrage, um die zuletzt verwendete Anrede eines Empfängers zu ermitteln,
|
||||||
/// damit diese für zukünftige Umschläge wiederverwendet werden kann.
|
/// damit diese für zukünftige Umschläge wiederverwendet werden kann.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="Envelope">Der Umschlag, für den die Anrede des Empfängers ermittelt werden soll.</param>
|
public record ReadReceiverNameQuery() : ReadReceiverQuery
|
||||||
/// <param name="OnlyLast">Gibt an, ob nur die zuletzt verwendete Anrede zurückgegeben werden soll.</param>
|
|
||||||
public record ReadReceiverNameQuery(EnvelopeQuery? Envelope = null, bool OnlyLast = true) : ReadReceiverQuery
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
namespace EnvelopeGenerator.Application.Exceptions;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Represents an exception that is thrown when a bad request is encountered.
|
||||||
|
/// </summary>
|
||||||
|
public class BadRequestException : Exception
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="BadRequestException"/> class.
|
||||||
|
/// </summary>
|
||||||
|
public BadRequestException()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="BadRequestException"/> class with a specified error message.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message">The message that describes the error.</param>
|
||||||
|
public BadRequestException(string? message) : base(message)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
namespace EnvelopeGenerator.Application.Exceptions;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Represents an exception that is thrown when a requested resource is not found.
|
||||||
|
/// </summary>
|
||||||
|
public class NotFoundException : Exception
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="NotFoundException"/> class.
|
||||||
|
/// </summary>
|
||||||
|
public NotFoundException()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="NotFoundException"/> class with a specified error message.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message">The message that describes the error.</param>
|
||||||
|
public NotFoundException(string? message) : base(message)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
using AutoMapper;
|
||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Histories.Queries.Read;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class ReadHistoryMappingProfile: Profile
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public ReadHistoryMappingProfile()
|
||||||
|
{
|
||||||
|
CreateMap<EnvelopeHistory, ReadHistoryResponse>();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,20 +1,20 @@
|
|||||||
using EnvelopeGenerator.Application.Envelopes.Queries.Read;
|
using EnvelopeGenerator.Common;
|
||||||
using EnvelopeGenerator.Application.Receivers.Queries.Read;
|
using MediatR;
|
||||||
using EnvelopeGenerator.Common;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Histories.Queries.Read;
|
namespace EnvelopeGenerator.Application.Histories.Queries.Read;
|
||||||
|
|
||||||
|
//TODO: Add sender query
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Repräsentiert eine Abfrage für die Verlaufshistorie eines Umschlags.
|
/// Repräsentiert eine Abfrage für die Verlaufshistorie eines Umschlags.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="EnvelopeId">Die eindeutige Kennung des Umschlags.</param>
|
/// <param name="EnvelopeId">Die eindeutige Kennung des Umschlags.</param>
|
||||||
/// <param name="Envelope">Die Abfrage, die den Umschlag beschreibt.</param>
|
/// <param name="Status">Der Status des Umschlags, der abgefragt werden soll. Kann optional angegeben werden, um die Ergebnisse zu filtern.</param>
|
||||||
/// <param name="Receiver">Die Abfrage, die den Empfänger beschreibt.</param>
|
|
||||||
/// <param name="Related">Abfrage, die angibt, worauf sich der Datensatz bezieht. Ob er sich auf den Empfänger, den Sender oder das System bezieht, wird durch 0, 1 bzw. 2 dargestellt.</param>
|
|
||||||
/// <param name="OnlyLast">Abfrage zur Steuerung, ob nur der aktuelle Status oder der gesamte Datensatz zurückgegeben wird.</param>
|
/// <param name="OnlyLast">Abfrage zur Steuerung, ob nur der aktuelle Status oder der gesamte Datensatz zurückgegeben wird.</param>
|
||||||
public record ReadHistoryQuery(
|
public record ReadHistoryQuery(
|
||||||
|
[Required]
|
||||||
int EnvelopeId,
|
int EnvelopeId,
|
||||||
ReadEnvelopeQuery? Envelope = null,
|
Constants.EnvelopeStatus? Status = null,
|
||||||
ReadReceiverQuery? Receiver = null,
|
bool? OnlyLast = true) : IRequest<IEnumerable<ReadHistoryResponse>>
|
||||||
Constants.ReferenceType? Related = null,
|
{
|
||||||
bool? OnlyLast = true);
|
};
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
using AutoMapper;
|
||||||
|
using EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
|
using EnvelopeGenerator.Application.Exceptions;
|
||||||
|
using MediatR;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Histories.Queries.Read;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class ReadHistoryQueryHandler : IRequestHandler<ReadHistoryQuery, IEnumerable<ReadHistoryResponse>>
|
||||||
|
{
|
||||||
|
private readonly IEnvelopeHistoryRepository _repository;
|
||||||
|
|
||||||
|
private readonly IMapper _mapper;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="repository"></param>
|
||||||
|
/// <param name="mapper"></param>
|
||||||
|
public ReadHistoryQueryHandler(IEnvelopeHistoryRepository repository, IMapper mapper)
|
||||||
|
{
|
||||||
|
_repository = repository;
|
||||||
|
_mapper = mapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="NotFoundException"></exception>
|
||||||
|
public async Task<IEnumerable<ReadHistoryResponse>> Handle(ReadHistoryQuery request, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
var hists = await _repository.ReadAsync(request.EnvelopeId, status: request.Status is null ? null : (int) request.Status);
|
||||||
|
|
||||||
|
if (!hists.Any())
|
||||||
|
throw new NotFoundException();
|
||||||
|
|
||||||
|
return _mapper.Map<IEnumerable<ReadHistoryResponse>>(hists);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
using EnvelopeGenerator.Common;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Histories.Queries.Read;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Represents the history of an envelope, including its status, user actions, and references.
|
||||||
|
/// </summary>
|
||||||
|
public class ReadHistoryResponse
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the unique identifier of the envelope history record.
|
||||||
|
/// </summary>
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the identifier of the associated envelope.
|
||||||
|
/// </summary>
|
||||||
|
public int EnvelopeId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the reference identifier of the user who performed the action.
|
||||||
|
/// </summary>
|
||||||
|
public string UserReference { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the status code of the envelope.
|
||||||
|
/// </summary>
|
||||||
|
public int Status { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public Common.Constants.ReferenceType ReferenceType => Status.ToString().FirstOrDefault() switch
|
||||||
|
{
|
||||||
|
'1' => Constants.ReferenceType.Sender,
|
||||||
|
'2' => Constants.ReferenceType.Receiver,
|
||||||
|
_ => Constants.ReferenceType.System,
|
||||||
|
};
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the date and time when the record was added.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime AddedWhen { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the date and time when the action occurred.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? ActionDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the optional comment about the envelope history record.
|
||||||
|
/// </summary>
|
||||||
|
public string? Comment { get; set; }
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public override int GetHashCode()
|
||||||
|
{
|
||||||
|
return Id.GetHashCode();
|
||||||
|
}
|
||||||
|
}
|
||||||
50
EnvelopeGenerator.Application/SQL/DocumentCreateReadSQL.cs
Normal file
50
EnvelopeGenerator.Application/SQL/DocumentCreateReadSQL.cs
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
using Dapper;
|
||||||
|
using EnvelopeGenerator.Application.Contracts.SQLExecutor;
|
||||||
|
using EnvelopeGenerator.Application.Exceptions;
|
||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.SQL;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class DocumentCreateReadSQL : ISQL<EnvelopeDocument>
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Base64, OUT_UID
|
||||||
|
/// </summary>
|
||||||
|
public string Raw => @"
|
||||||
|
DECLARE @BYTE_DATA1 as VARBINARY(MAX)
|
||||||
|
SET @BYTE_DATA1 = @ByteData
|
||||||
|
DECLARE @OUT_DOCID int
|
||||||
|
|
||||||
|
EXEC [dbo].[PRSIG_API_ADD_DOC]
|
||||||
|
{0},
|
||||||
|
@BYTE_DATA1,
|
||||||
|
@OUT_DOCID OUTPUT
|
||||||
|
|
||||||
|
SELECT TOP(1) *
|
||||||
|
FROM [dbo].[TBSIG_ENVELOPE_DOCUMENT]
|
||||||
|
WHERE [GUID] = @OUT_DOCID
|
||||||
|
";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="base64"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static DynamicParameters CreateParmas(string base64)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var parameters = new DynamicParameters();
|
||||||
|
byte[] byteData = Convert.FromBase64String(base64);
|
||||||
|
parameters.Add("ByteData", byteData, System.Data.DbType.Binary);
|
||||||
|
return parameters;
|
||||||
|
}
|
||||||
|
catch(FormatException ex)
|
||||||
|
{
|
||||||
|
throw new BadRequestException(ex.Message.Replace("input", "dataAsBase64"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
49
EnvelopeGenerator.Application/SQL/EnvelopeCreateReadSQL.cs
Normal file
49
EnvelopeGenerator.Application/SQL/EnvelopeCreateReadSQL.cs
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
using Dapper;
|
||||||
|
using EnvelopeGenerator.Application.Contracts.SQLExecutor;
|
||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
using System.Data;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.SQL;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class EnvelopeCreateReadSQL : ISQL<Envelope>
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// USER_ID, TITLE, TFAEnabled, MESSAGE
|
||||||
|
/// </summary>
|
||||||
|
public string Raw => @"
|
||||||
|
DECLARE @OUT_UID varchar(36);
|
||||||
|
|
||||||
|
EXEC [dbo].[PRSIG_API_CREATE_ENVELOPE]
|
||||||
|
{0},
|
||||||
|
{1},
|
||||||
|
{2},
|
||||||
|
{3},
|
||||||
|
@OUT_UID OUTPUT;
|
||||||
|
|
||||||
|
SELECT TOP(1) *
|
||||||
|
FROM [dbo].[TBSIG_ENVELOPE]
|
||||||
|
WHERE [ENVELOPE_UUID] = @OUT_UID;
|
||||||
|
";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="userId"></param>
|
||||||
|
/// <param name="title"></param>
|
||||||
|
/// <param name="message"></param>
|
||||||
|
/// <param name="tfaEnabled"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static DynamicParameters CreateParams(int userId, string title = "", string message = "", bool tfaEnabled = false)
|
||||||
|
{
|
||||||
|
var parameters = new DynamicParameters();
|
||||||
|
parameters.Add("@UserId", userId);
|
||||||
|
parameters.Add("@Title", title);
|
||||||
|
parameters.Add("@TfaEnabled", tfaEnabled ? 1 : 0);
|
||||||
|
parameters.Add("@Message", message);
|
||||||
|
parameters.Add("@OutUid", dbType: DbType.String, size: 36, direction: ParameterDirection.Output);
|
||||||
|
return parameters;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
using Dapper;
|
||||||
|
using EnvelopeGenerator.Application.Contracts.SQLExecutor;
|
||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.SQL;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class EnvelopeReceiverAddReadSQL : ISQL<Envelope>
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// ENV_UID, EMAIL_ADRESS, SALUTATION, PHONE,
|
||||||
|
/// </summary>
|
||||||
|
public string Raw => @"
|
||||||
|
DECLARE @OUT_RECEIVER_ID int
|
||||||
|
|
||||||
|
EXEC [dbo].[PRSIG_API_CREATE_RECEIVER]
|
||||||
|
{0},
|
||||||
|
{1},
|
||||||
|
{2},
|
||||||
|
{3},
|
||||||
|
@OUT_RECEIVER_ID OUTPUT
|
||||||
|
|
||||||
|
SELECT TOP(1) [ENVELOPE_ID] As EnvelopeId, [RECEIVER_ID] As ReceiverId
|
||||||
|
FROM [dbo].[TBSIG_ENVELOPE_RECEIVER]
|
||||||
|
WHERE [GUID] = @OUT_RECEIVER_ID;
|
||||||
|
";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelope_uuid"></param>
|
||||||
|
/// <param name="emailAddress"></param>
|
||||||
|
/// <param name="salutation"></param>
|
||||||
|
/// <param name="phone"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static DynamicParameters CreateParameters(string envelope_uuid, string emailAddress, string? salutation = null, string? phone = null)
|
||||||
|
{
|
||||||
|
var parameters = new DynamicParameters();
|
||||||
|
parameters.Add("@ENV_UID", envelope_uuid);
|
||||||
|
parameters.Add("@EMAIL_ADRESS", emailAddress);
|
||||||
|
parameters.Add("@SALUTATION", salutation);
|
||||||
|
parameters.Add("@PHONE", phone);
|
||||||
|
return parameters;
|
||||||
|
}
|
||||||
|
}
|
||||||
30
EnvelopeGenerator.Application/SQL/ParamsExtensions.cs
Normal file
30
EnvelopeGenerator.Application/SQL/ParamsExtensions.cs
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
using System.Globalization;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.SQL;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Extension method for converting objects to SQL parameter strings.
|
||||||
|
/// </summary>
|
||||||
|
public static class ParamsExtensions
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Converts a .NET object to its corresponding SQL-safe parameter string.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="obj">The object to convert.</param>
|
||||||
|
/// <returns>A string representing the SQL parameter.</returns>
|
||||||
|
public static string ToSqlParam(this object? obj)
|
||||||
|
{
|
||||||
|
if (obj is null)
|
||||||
|
return "NULL";
|
||||||
|
else if (obj is string strVal)
|
||||||
|
return $"'{strVal}'";
|
||||||
|
else if (obj is bool boolVal)
|
||||||
|
return boolVal ? "1" : "0";
|
||||||
|
else if (obj is double doubleVal)
|
||||||
|
return $"'{doubleVal.ToString(CultureInfo.InvariantCulture)}'";
|
||||||
|
else if (obj is int intVal)
|
||||||
|
return intVal.ToString();
|
||||||
|
else
|
||||||
|
throw new NotSupportedException($"Type '{obj.GetType().FullName}' is not supported for SQL parameter conversion.");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,6 +7,7 @@ using DigitalData.Core.DTO;
|
|||||||
using EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
|
using EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
|
||||||
using EnvelopeGenerator.Application.DTOs.Receiver;
|
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||||
using EnvelopeGenerator.Application.Contracts.Services;
|
using EnvelopeGenerator.Application.Contracts.Services;
|
||||||
|
using DigitalData.Core.Application.DTO;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Services;
|
namespace EnvelopeGenerator.Application.Services;
|
||||||
|
|
||||||
@@ -76,9 +77,16 @@ public class EnvelopeHistoryService : CRUDService<IEnvelopeHistoryRepository, En
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async Task<DataResult<long>> RecordAsync(int envelopeId, string userReference, EnvelopeStatus status, string? comment = null) =>
|
public async Task<DataResult<long>> RecordAsync(int envelopeId, string userReference, EnvelopeStatus status, string? comment = null) =>
|
||||||
await CreateAsync(new (EnvelopeId: envelopeId, UserReference: userReference, Status: (int)status, ActionDate: DateTime.Now, Comment: comment))
|
await CreateAsync(new ()
|
||||||
|
{
|
||||||
|
EnvelopeId = envelopeId,
|
||||||
|
UserReference = userReference,
|
||||||
|
Status = (int) status,
|
||||||
|
ActionDate = DateTime.Now,
|
||||||
|
Comment = comment
|
||||||
|
})
|
||||||
.ThenAsync(
|
.ThenAsync(
|
||||||
Success: id => Result.Success(id),
|
Success: dto => Result.Success(dto.Id),
|
||||||
Fail: (mssg, ntc) => Result.Fail<long>().Message(mssg).Notice(ntc)
|
Fail: (mssg, ntc) => Result.Fail<long>().Message(mssg).Notice(ntc)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -57,7 +57,7 @@ namespace EnvelopeGenerator.Application.Services
|
|||||||
{
|
{
|
||||||
if (readOnlyDto?.Envelope is not null && readOnlyDto.Receiver is not 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;
|
_placeholders["[NAME_RECEIVER]"] = await _envRcvService.ReadLastUsedReceiverNameByMailAsync(readOnlyDto.AddedWho).ThenAsync(res => res, (msg, ntc) => string.Empty) ?? string.Empty;
|
||||||
var erReadOnlyId = (readOnlyDto.Id).EncodeEnvelopeReceiverId();
|
var erReadOnlyId = (readOnlyDto.Id).EncodeEnvelopeReceiverId();
|
||||||
var sigHost = await _configService.ReadDefaultSignatureHost();
|
var sigHost = await _configService.ReadDefaultSignatureHost();
|
||||||
var linkToDoc = $"{sigHost}/EnvelopeKey/{erReadOnlyId}";
|
var linkToDoc = $"{sigHost}/EnvelopeKey/{erReadOnlyId}";
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ using Microsoft.Extensions.Logging;
|
|||||||
using EnvelopeGenerator.Extensions;
|
using EnvelopeGenerator.Extensions;
|
||||||
using EnvelopeGenerator.Application.DTOs.Messaging;
|
using EnvelopeGenerator.Application.DTOs.Messaging;
|
||||||
using EnvelopeGenerator.Application.Contracts.Services;
|
using EnvelopeGenerator.Application.Contracts.Services;
|
||||||
|
using EnvelopeGenerator.Application.Envelopes;
|
||||||
|
using EnvelopeGenerator.Application.Receivers.Queries.Read;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Services;
|
namespace EnvelopeGenerator.Application.Services;
|
||||||
|
|
||||||
@@ -137,16 +139,32 @@ public class EnvelopeReceiverService : BasicCRUDService<IEnvelopeReceiverReposit
|
|||||||
: Result.Success(code);
|
: Result.Success(code);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUsernameAsync(string username, int? min_status = null, int? max_status = null, params int[] ignore_statuses)
|
public async Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUsernameAsync(string username, int? min_status = null, int? max_status = null, EnvelopeQuery? envelopeQuery = null, ReadReceiverQuery? receiverQuery = null, params int[] ignore_statuses)
|
||||||
{
|
{
|
||||||
var er_list = await _repository.ReadByUsernameAsync(username: username, min_status: min_status, max_status: max_status, ignore_statuses: ignore_statuses);
|
var er_list = await _repository.ReadByUsernameAsync(username: username, min_status: min_status, max_status: max_status, ignore_statuses: ignore_statuses);
|
||||||
|
|
||||||
|
if(envelopeQuery?.Id is int eId)
|
||||||
|
er_list = er_list.Where(er => er.EnvelopeId == eId);
|
||||||
|
|
||||||
|
if (envelopeQuery?.Uuid is string uuid)
|
||||||
|
er_list = er_list.Where(er => er.Envelope?.Uuid == uuid);
|
||||||
|
|
||||||
|
if (envelopeQuery?.Status is int status)
|
||||||
|
er_list = er_list.Where(er => er.Envelope?.Status == status);
|
||||||
|
|
||||||
|
if(receiverQuery?.Id is int id)
|
||||||
|
er_list = er_list.Where(er => er.Receiver?.Id == id);
|
||||||
|
|
||||||
|
if (receiverQuery?.Signature is string signature)
|
||||||
|
er_list = er_list.Where(er => er.Receiver?.Signature == signature);
|
||||||
|
|
||||||
var dto_list = _mapper.Map<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)
|
public async Task<DataResult<string?>> ReadLastUsedReceiverNameByMailAsync(string? mail = null, int? id = null, string? signature = null)
|
||||||
{
|
{
|
||||||
var er = await _repository.ReadLastByReceiver(mail);
|
var er = await _repository.ReadLastByReceiverAsync(mail, id, signature);
|
||||||
return er is null ? Result.Fail<string?>().Notice(LogLevel.None, Flag.NotFound) : Result.Success(er.Name);
|
return er is null ? Result.Fail<string?>().Notice(LogLevel.None, Flag.NotFound) : Result.Success(er.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using DigitalData.Core.Abstractions.Client;
|
using DigitalData.Core.Client.Interface;
|
||||||
using DigitalData.Core.Client;
|
using DigitalData.Core.Client;
|
||||||
using EnvelopeGenerator.Application.Configurations;
|
using EnvelopeGenerator.Application.Configurations;
|
||||||
using EnvelopeGenerator.Application.Contracts.Services;
|
using EnvelopeGenerator.Application.Contracts.Services;
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ using EnvelopeGenerator.Domain.Entities;
|
|||||||
using EnvelopeGenerator.Application.Contracts.Repositories;
|
using EnvelopeGenerator.Application.Contracts.Repositories;
|
||||||
using EnvelopeGenerator.Application.DTOs.Receiver;
|
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||||
using DigitalData.Core.DTO;
|
using DigitalData.Core.DTO;
|
||||||
using DigitalData.Core.Abstractions;
|
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using EnvelopeGenerator.Application.Contracts.Services;
|
using EnvelopeGenerator.Application.Contracts.Services;
|
||||||
|
|
||||||
@@ -37,12 +36,12 @@ public class ReceiverService : CRUDService<IReceiverRepository, ReceiverCreateDt
|
|||||||
return await _repository.DeleteAsync(rcv) ? Result.Success() : Result.Fail();
|
return await _repository.DeleteAsync(rcv) ? Result.Success() : Result.Fail();
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual async Task<Result> UpdateAsync<TUpdateDto>(TUpdateDto updateDto) where TUpdateDto : IUnique<int>
|
public virtual async Task<Result> UpdateAsync<TUpdateDto>(TUpdateDto updateDto)
|
||||||
{
|
{
|
||||||
var val = await _repository.ReadByIdAsync(updateDto.Id);
|
var val = await _repository.ReadByIdAsync(updateDto.GetId<int>());
|
||||||
if (val == null)
|
if (val == null)
|
||||||
{
|
{
|
||||||
return Result.Fail().Notice(LogLevel.Warning, Flag.NotFound, $"{updateDto.Id} is not found in update process of {GetType()} entity.");
|
return Result.Fail().Notice(LogLevel.Warning, Flag.NotFound, $"{updateDto.GetIdOrDefault<int>()} is not found in update process of {GetType()} entity.");
|
||||||
}
|
}
|
||||||
|
|
||||||
var entity = _mapper.Map(updateDto, val);
|
var entity = _mapper.Map(updateDto, val);
|
||||||
|
|||||||
@@ -1,139 +0,0 @@
|
|||||||
Public Class Constants
|
|
||||||
|
|
||||||
#Region "Status Fields"
|
|
||||||
'http://wiki.dd/xwiki13/bin/view/Anwendungen/Produkt-Handbuch/Sonstiges/SignFlow/Envelope%20Status/
|
|
||||||
Public Enum EnvelopeStatus
|
|
||||||
Invalid = 0
|
|
||||||
EnvelopeCreated = 1001
|
|
||||||
EnvelopeSaved = 1002
|
|
||||||
EnvelopeQueued = 1003
|
|
||||||
EnvelopeSent = 1004 ' Nicht verwendet
|
|
||||||
EnvelopePartlySigned = 1005
|
|
||||||
EnvelopeCompletelySigned = 1006
|
|
||||||
EnvelopeReportCreated = 1007
|
|
||||||
EnvelopeArchived = 1008
|
|
||||||
EnvelopeDeleted = 1009
|
|
||||||
EnvelopeRejected = 10007
|
|
||||||
EnvelopeWithdrawn = 10009
|
|
||||||
AccessCodeRequested = 2001
|
|
||||||
AccessCodeCorrect = 2002
|
|
||||||
AccessCodeIncorrect = 2003
|
|
||||||
DocumentOpened = 2004
|
|
||||||
DocumentSigned = 2005
|
|
||||||
DocumentForwarded = 4001
|
|
||||||
SignatureConfirmed = 2006
|
|
||||||
DocumentRejected = 2007
|
|
||||||
EnvelopeShared = 2008
|
|
||||||
EnvelopeViewed = 2009
|
|
||||||
MessageInvitationSent = 3001 ' Wird von Trigger verwendet
|
|
||||||
MessageAccessCodeSent = 3002
|
|
||||||
MessageConfirmationSent = 3003
|
|
||||||
MessageDeletionSent = 3004
|
|
||||||
MessageCompletionSent = 3005
|
|
||||||
DocumentMod_Rotation = 4001
|
|
||||||
End Enum
|
|
||||||
|
|
||||||
'TODO: standardize in xwiki
|
|
||||||
Public Enum ReferenceType
|
|
||||||
Receiver = 0
|
|
||||||
Sender
|
|
||||||
System
|
|
||||||
Unknown
|
|
||||||
End Enum
|
|
||||||
|
|
||||||
Public Enum ElementStatus
|
|
||||||
Created = 0
|
|
||||||
End Enum
|
|
||||||
|
|
||||||
Public Enum DocumentStatus
|
|
||||||
Created = 0
|
|
||||||
Signed = 1
|
|
||||||
End Enum
|
|
||||||
|
|
||||||
Public Enum ReceiverStatus
|
|
||||||
Unsigned = 0
|
|
||||||
Signed = 1
|
|
||||||
End Enum
|
|
||||||
#End Region
|
|
||||||
|
|
||||||
#Region "Type Fields"
|
|
||||||
Public Enum ElementType
|
|
||||||
Signature = 1
|
|
||||||
End Enum
|
|
||||||
|
|
||||||
Public Enum ContractType
|
|
||||||
Contract = 1
|
|
||||||
ReadAndSign = 2
|
|
||||||
End Enum
|
|
||||||
|
|
||||||
Public Enum ColorType
|
|
||||||
ReceiverColor1 = 1
|
|
||||||
ReceiverColor2 = 2
|
|
||||||
ReceiverColor3 = 3
|
|
||||||
ReceiverColor4 = 4
|
|
||||||
ReceiverColor5 = 5
|
|
||||||
ReceiverColor6 = 6
|
|
||||||
ReceiverColor7 = 7
|
|
||||||
ReceiverColor8 = 8
|
|
||||||
ReceiverColor9 = 9
|
|
||||||
ReceiverColor10 = 10
|
|
||||||
End Enum
|
|
||||||
|
|
||||||
Public Enum CertificationType
|
|
||||||
AdvancedElectronicSignature = 1
|
|
||||||
'ElectronicSignature = 1
|
|
||||||
'QualifiedSignature = 2
|
|
||||||
End Enum
|
|
||||||
|
|
||||||
Public Enum FinalEmailType
|
|
||||||
No = 0
|
|
||||||
Yes = 1
|
|
||||||
YesWithAttachment = 2
|
|
||||||
End Enum
|
|
||||||
|
|
||||||
Public Enum PageOrientation
|
|
||||||
Portrait = 0
|
|
||||||
Landscape = 1
|
|
||||||
End Enum
|
|
||||||
|
|
||||||
Public Enum EmailTemplateType
|
|
||||||
DocumentReceived = 0
|
|
||||||
DocumentSigned
|
|
||||||
DocumentDeleted
|
|
||||||
DocumentCompleted
|
|
||||||
DocumentAccessCodeReceived
|
|
||||||
DocumentShared
|
|
||||||
TotpSecret
|
|
||||||
DocumentRejected_ADM
|
|
||||||
DocumentRejected_REC
|
|
||||||
DocumentRejected_REC_2
|
|
||||||
End Enum
|
|
||||||
|
|
||||||
Public Enum EncodeType
|
|
||||||
EnvelopeReceiver
|
|
||||||
EnvelopeReceiverReadOnly
|
|
||||||
Undefined
|
|
||||||
DocumentForwarded
|
|
||||||
DocumentShared
|
|
||||||
End Enum
|
|
||||||
#End Region
|
|
||||||
|
|
||||||
#Region "Role"
|
|
||||||
Public NotInheritable Class ReceiverRole
|
|
||||||
Public Const PreAuth As String = "PreAuth"
|
|
||||||
Public Const FullyAuth As String = "FullyAuth"
|
|
||||||
End Class
|
|
||||||
#End Region
|
|
||||||
|
|
||||||
#Region "Constants"
|
|
||||||
|
|
||||||
Public Const DATABASE = "DATABASE"
|
|
||||||
Public Const LOGCONFIG = "LOGCONFIG"
|
|
||||||
Public Const GDPICTURE = "GDPICTURE"
|
|
||||||
Public Const PDF_BURNER_PARAMS = "PDFBurnerParams"
|
|
||||||
|
|
||||||
Public Const GREEN_300 = "#bbf7d0"
|
|
||||||
Public Const RED_300 = "#fecaca"
|
|
||||||
Public Const ORANGE_300 = "#fed7aa"
|
|
||||||
#End Region
|
|
||||||
End Class
|
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
Public Class DocumentStatus
|
Imports EnvelopeGenerator.Domain
|
||||||
|
|
||||||
|
Public Class DocumentStatus
|
||||||
|
|
||||||
Public Property Id As Integer
|
Public Property Id As Integer
|
||||||
Public Property EnvelopeId As Integer
|
Public Property EnvelopeId As Integer
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
Public Class ElementStatus
|
Imports EnvelopeGenerator.Domain
|
||||||
|
|
||||||
|
Public Class ElementStatus
|
||||||
|
|
||||||
Public Property Id As Integer
|
Public Property Id As Integer
|
||||||
Public Property EnvelopeId As Integer
|
Public Property EnvelopeId As Integer
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
|
Imports EnvelopeGenerator.Domain
|
||||||
Public Class EmailData
|
Public Class EmailData
|
||||||
Public Property EmailAdress As String = ""
|
Public Property EmailAdress As String = ""
|
||||||
Public Property EmailSubject As String = ""
|
Public Property EmailSubject As String = ""
|
||||||
@@ -19,6 +19,7 @@ Public Class EmailData
|
|||||||
Public Property EmailAttachment As String = ""
|
Public Property EmailAttachment As String = ""
|
||||||
Public Property ATT1_RELATED_ID As Long
|
Public Property ATT1_RELATED_ID As Long
|
||||||
Public Property ATT1_REL_TYPE As String = ""
|
Public Property ATT1_REL_TYPE As String = ""
|
||||||
|
Public Property ADDED_WHO_PROCESS As String = "DDEnvelopGenerator"
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructor for sending email to receiver
|
''' Constructor for sending email to receiver
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
Public Class Envelope
|
Imports EnvelopeGenerator.Domain
|
||||||
|
|
||||||
|
Public Class Envelope
|
||||||
Public Property Id As Integer = 0
|
Public Property Id As Integer = 0
|
||||||
Public Property UserId As Integer
|
Public Property UserId As Integer
|
||||||
Public Property Title As String = ""
|
Public Property Title As String = ""
|
||||||
@@ -25,6 +27,7 @@
|
|||||||
Public Property Message As String = My.Resources.Envelope.Please_read_and_sign_this_document
|
Public Property Message As String = My.Resources.Envelope.Please_read_and_sign_this_document
|
||||||
|
|
||||||
Public Property AddedWhen As Date
|
Public Property AddedWhen As Date
|
||||||
|
Public Property ChangedWhen As Date
|
||||||
Public Property User As New User()
|
Public Property User As New User()
|
||||||
|
|
||||||
Public Property Documents As New List(Of EnvelopeDocument)
|
Public Property Documents As New List(Of EnvelopeDocument)
|
||||||
@@ -32,6 +35,7 @@
|
|||||||
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 Property DOC_RESULT As Byte()
|
||||||
|
Public Property CURRENT_WORK_APP As String = "signFLOW GUI"
|
||||||
Public ReadOnly Property EnvelopeTypeTitle As String
|
Public ReadOnly Property EnvelopeTypeTitle As String
|
||||||
Get
|
Get
|
||||||
Return EnvelopeType?.Title
|
Return EnvelopeType?.Title
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
Public Class EnvelopeDocumentElement
|
Imports EnvelopeGenerator.Domain
|
||||||
|
|
||||||
|
Public Class EnvelopeDocumentElement
|
||||||
Public Property Id As Integer = -1
|
Public Property Id As Integer = -1
|
||||||
Public Property X As Double
|
Public Property X As Double
|
||||||
Public Property Y As Double
|
Public Property Y As Double
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
Public Class EnvelopeHistoryEntry
|
Imports EnvelopeGenerator.Domain
|
||||||
|
|
||||||
|
Public Class EnvelopeHistoryEntry
|
||||||
Public Property EnvelopeId As Integer
|
Public Property EnvelopeId As Integer
|
||||||
Public Property UserReference As String
|
Public Property UserReference As String
|
||||||
Public Property Status As Constants.EnvelopeStatus
|
Public Property Status As Constants.EnvelopeStatus
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
Imports System.Drawing
|
Imports System.Drawing
|
||||||
Imports System.Runtime.Serialization
|
|
||||||
Imports DevExpress.Utils.Svg
|
Imports DevExpress.Utils.Svg
|
||||||
Imports DigitalData.Modules.Base
|
Imports DigitalData.Modules.Base
|
||||||
Imports EnvelopeGenerator.Common.Constants
|
Imports EnvelopeGenerator.Domain.Constants
|
||||||
Imports Newtonsoft.Json
|
Imports Newtonsoft.Json
|
||||||
|
|
||||||
Public Class EnvelopeReceiver
|
Public Class EnvelopeReceiver
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
Public Class EnvelopeType
|
Imports EnvelopeGenerator.Domain
|
||||||
|
Public Class EnvelopeType
|
||||||
|
|
||||||
Public Property Id As Integer = 0
|
Public Property Id As Integer = 0
|
||||||
Public Property Title As String
|
Public Property Title As String
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
Public Property HasAccess As Boolean
|
Public Property HasAccess As Boolean
|
||||||
Public Property IsAdmin As Boolean
|
Public Property IsAdmin As Boolean
|
||||||
|
Public Property GhostModeActive As Boolean
|
||||||
|
|
||||||
Public ReadOnly Property FullName() As String
|
Public ReadOnly Property FullName() As String
|
||||||
Get
|
Get
|
||||||
|
|||||||
@@ -274,14 +274,14 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Config.vb" />
|
<Compile Include="Config.vb" />
|
||||||
<Compile Include="Constants.vb" />
|
|
||||||
<Compile Include="Entities\DbConfig.vb" />
|
<Compile Include="Entities\DbConfig.vb" />
|
||||||
<Compile Include="Entities\ElementMetadata.vb" />
|
<Compile Include="Entities\ElementMetadata.vb" />
|
||||||
<Compile Include="Entities\DocumentStatus.vb" />
|
<Compile Include="Entities\DocumentStatus.vb" />
|
||||||
<Compile Include="Entities\ElementStatus.vb" />
|
<Compile Include="Entities\ElementStatus.vb" />
|
||||||
<Compile Include="Entities\EmailData.vb" />
|
<Compile Include="Entities\EmailData.vb" />
|
||||||
<Compile Include="Entities\EmailTemplate.vb" />
|
<Compile Include="Entities\EmailTemplate.vb" />
|
||||||
<Compile Include="Jobs\PDFBurnerParams.vb" />
|
<Compile Include="Jobs\APIBackendJobs\APIEnvelopeJob.vb" />
|
||||||
|
<Compile Include="Jobs\FinalizeDocument\PDFBurnerParams.vb" />
|
||||||
<Compile Include="Services\TemplateService.vb" />
|
<Compile Include="Services\TemplateService.vb" />
|
||||||
<Compile Include="Entities\Envelope.vb" />
|
<Compile Include="Entities\Envelope.vb" />
|
||||||
<Compile Include="Entities\EnvelopeDocument.vb" />
|
<Compile Include="Entities\EnvelopeDocument.vb" />
|
||||||
@@ -442,7 +442,12 @@
|
|||||||
<EmbeddedResource Include="Templates\document_access_code_de.html" />
|
<EmbeddedResource Include="Templates\document_access_code_de.html" />
|
||||||
<EmbeddedResource Include="Templates\email_de.html" />
|
<EmbeddedResource Include="Templates\email_de.html" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup />
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\EnvelopeGenerator.Domain\EnvelopeGenerator.Domain.csproj">
|
||||||
|
<Project>{4f32a98d-e6f0-4a09-bd97-1cf26107e837}</Project>
|
||||||
|
<Name>EnvelopeGenerator.Domain</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ Imports System.IO
|
|||||||
Imports System.Security.Cryptography
|
Imports System.Security.Cryptography
|
||||||
Imports System.Text
|
Imports System.Text
|
||||||
Imports DevExpress.Utils.Svg
|
Imports DevExpress.Utils.Svg
|
||||||
Imports EnvelopeGenerator.Common.Constants
|
Imports EnvelopeGenerator.Domain.Constants
|
||||||
|
|
||||||
Public Class Helpers
|
Public Class Helpers
|
||||||
Private Shared key As String = "$xzBvyPETUS&amm8)D8x#)f;4%;?[BPd" ' Passwort-Schlüssel (16, 24, or 32 bytes)
|
Private Shared key As String = "$xzBvyPETUS&amm8)D8x#)f;4%;?[BPd" ' Passwort-Schlüssel (16, 24, or 32 bytes)
|
||||||
@@ -52,6 +52,7 @@ Public Class Helpers
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Shared Function GetEnvelopeURL(pHost As String, pEnvelopeUuid As String, pReceiverSignature As String) As String
|
Public Shared Function GetEnvelopeURL(pHost As String, pEnvelopeUuid As String, pReceiverSignature As String) As String
|
||||||
|
|
||||||
Dim oEnvelopeUserReference As String = EncodeEnvelopeReceiverId(pEnvelopeUuid, pReceiverSignature)
|
Dim oEnvelopeUserReference As String = EncodeEnvelopeReceiverId(pEnvelopeUuid, pReceiverSignature)
|
||||||
Dim oURL As String = String.Format("{0}/EnvelopeKey/{1}", pHost.Trim(), oEnvelopeUserReference)
|
Dim oURL As String = String.Format("{0}/EnvelopeKey/{1}", pHost.Trim(), oEnvelopeUserReference)
|
||||||
Return oURL
|
Return oURL
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user