Compare commits
16 Commits
838d7e3ab8
...
9434f83b3e
| Author | SHA1 | Date | |
|---|---|---|---|
| 9434f83b3e | |||
| bbe93dad45 | |||
| 0a876fe486 | |||
| a584a548d6 | |||
| 3e3c9d4c54 | |||
| 33fa4b76f5 | |||
| 7a84726a3b | |||
| 27d97ed12a | |||
| f699e5a9aa | |||
| dc723d9f02 | |||
| 48ce0d5f32 | |||
| ef7e694c9f | |||
| c5c040fb15 | |||
| fc4187bb9e | |||
| ae4f5560fe | |||
| 09eb91b6be |
@@ -1,5 +1,5 @@
|
||||
using EnvelopeGenerator.Application.Model;
|
||||
using EnvelopeGenerator.Domain;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Application.DocStatus.Commands;
|
||||
|
||||
@@ -11,7 +11,7 @@ public record ModifyDocStatusCommandBase : EnvelopeReceiverQueryBase
|
||||
/// <summary>
|
||||
/// Gets the current status code.
|
||||
/// </summary>
|
||||
public Constants.DocumentStatus Status => Value is null ? Constants.DocumentStatus.Created : Constants.DocumentStatus.Signed;
|
||||
public DocumentStatus Status => Value is null ? DocumentStatus.Created : DocumentStatus.Signed;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the display value associated with the status.
|
||||
|
||||
@@ -25,7 +25,7 @@ public record EnvelopeDto
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public required EnvelopeStatus Status { get; set; }
|
||||
public required EnvelopeStatusQuery Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Default value is string.Empty
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using DigitalData.UserManager.Application.DTOs.User;
|
||||
using EnvelopeGenerator.Application.Dto.Receiver;
|
||||
using EnvelopeGenerator.Domain;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Dto.EnvelopeHistory;
|
||||
|
||||
@@ -27,16 +27,16 @@ public record EnvelopeHistoryDto
|
||||
/// <summary>
|
||||
/// Include code of the envelope at this history point.
|
||||
/// </summary>
|
||||
public Constants.EnvelopeStatus Status { get; set; }
|
||||
public EnvelopeStatus Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Type of reference for this history entry.
|
||||
/// </summary>
|
||||
public Constants.ReferenceType ReferenceType => ((int)Status).ToString().FirstOrDefault() switch
|
||||
public ReferenceType ReferenceType => ((int)Status).ToString().FirstOrDefault() switch
|
||||
{
|
||||
'1' => Constants.ReferenceType.Sender,
|
||||
'2' => Constants.ReferenceType.Receiver,
|
||||
_ => Constants.ReferenceType.System,
|
||||
'1' => ReferenceType.Sender,
|
||||
'2' => ReferenceType.Receiver,
|
||||
_ => ReferenceType.System,
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using EnvelopeGenerator.Domain;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
using MediatR;
|
||||
|
||||
namespace EnvelopeGenerator.Application.EmailTemplates.Commands.Reset;
|
||||
@@ -33,8 +34,8 @@ public record ResetEmailTemplateCommand : EmailTemplateQuery, IRequest
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="Id">Die optionale ID der E-Mail-Vorlage, die zurückgesetzt werden soll.</param>
|
||||
/// <param name="Type">Der Typ der E-Mail-Vorlage, z. B. <see cref="Constants.EmailTemplateType"/> (optional).</param>
|
||||
public ResetEmailTemplateCommand(int? Id = null, Constants.EmailTemplateType? Type = null) : base(Id, Type)
|
||||
/// <param name="Type">Der Typ der E-Mail-Vorlage, z. B. <see cref="EmailTemplateType"/> (optional).</param>
|
||||
public ResetEmailTemplateCommand(int? Id = null, EmailTemplateType? Type = null) : base(Id, Type)
|
||||
{
|
||||
}
|
||||
};
|
||||
@@ -2,10 +2,10 @@
|
||||
using DigitalData.Core.Abstraction.Application.Repository;
|
||||
using EnvelopeGenerator.Application.Dto;
|
||||
using DigitalData.Core.Exceptions;
|
||||
using EnvelopeGenerator.Domain;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using MediatR;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Application.EmailTemplates.Commands.Update;
|
||||
|
||||
@@ -46,7 +46,7 @@ public class UpdateEmailTemplateCommandHandler : IRequestHandler<UpdateEmailTemp
|
||||
var temp = await _repository.ReadOnly().Where(t => t.Id == id).FirstOrDefaultAsync(cancel);
|
||||
tempDto = _mapper.Map<EmailTemplateDto>(temp);
|
||||
}
|
||||
else if (request!.EmailTemplateQuery!.Type is Constants.EmailTemplateType type)
|
||||
else if (request!.EmailTemplateQuery!.Type is EmailTemplateType type)
|
||||
{
|
||||
var temp = await _repository.ReadOnly().Where(t => t.Name == type.ToString()).FirstOrDefaultAsync(cancel);
|
||||
tempDto = _mapper.Map<EmailTemplateDto>(temp);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using EnvelopeGenerator.Domain;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Application.EmailTemplates;
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace EnvelopeGenerator.Application.EmailTemplates;
|
||||
/// Die Standardkultur ist "de-DE".
|
||||
/// </summary>
|
||||
/// <param name="Id">Die eindeutige Kennung der E-Mail-Vorlage (optional).</param>
|
||||
/// <param name="Type">Der Typ der E-Mail-Vorlage, z. B. <see cref="Constants.EmailTemplateType"/> (optional). Beispiele:
|
||||
/// <param name="Type">Der Typ der E-Mail-Vorlage, z. B. <see cref="EmailTemplateType"/> (optional). Beispiele:
|
||||
/// 0 - DocumentReceived: Benachrichtigung über den Empfang eines Dokuments.
|
||||
/// 1 - DocumentSigned: Benachrichtigung über die Unterzeichnung eines Dokuments.
|
||||
/// 2 - DocumentDeleted: Benachrichtigung über das Löschen eines Dokuments.
|
||||
@@ -19,6 +19,6 @@ namespace EnvelopeGenerator.Application.EmailTemplates;
|
||||
/// 8 - DocumentRejected_REC (Für den ablehnenden Empfänger): Mail an den ablehnenden Empfänger, wenn das Dokument abgelehnt wird.
|
||||
/// 9 - DocumentRejected_REC_2 (Für sonstige Empfänger): Mail an andere Empfänger (Brief), wenn das Dokument abgelehnt wird.
|
||||
/// </param>
|
||||
public record EmailTemplateQuery(int? Id = null, Constants.EmailTemplateType? Type = null)
|
||||
public record EmailTemplateQuery(int? Id = null, EmailTemplateType? Type = null)
|
||||
{
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
using AutoMapper;
|
||||
using EnvelopeGenerator.Application.Interfaces.Repositories;
|
||||
using EnvelopeGenerator.Domain;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
using MediatR;
|
||||
|
||||
namespace EnvelopeGenerator.Application.EmailTemplates.Queries.Read;
|
||||
@@ -41,7 +41,7 @@ public class ReadEmailTemplateQueryHandler : IRequestHandler<ReadEmailTemplateQu
|
||||
{
|
||||
var temp = request.Id is int id
|
||||
? await _repository.ReadByIdAsync(id)
|
||||
: request.Type is Constants.EmailTemplateType type
|
||||
: request.Type is EmailTemplateType type
|
||||
? await _repository.ReadByNameAsync(type)
|
||||
: throw new InvalidOperationException("Either a valid integer ID or a valid EmailTemplateType must be provided in the request.");
|
||||
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
using DigitalData.Core.Abstraction.Application.Repository;
|
||||
using DigitalData.Core.Exceptions;
|
||||
using EnvelopeGenerator.Application.Model;
|
||||
using EnvelopeGenerator.Domain;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using EnvelopeGenerator.Application.Extensions;
|
||||
using MediatR;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Queries;
|
||||
|
||||
@@ -70,9 +69,9 @@ public class ReceiverAlreadySignedQueryHandler : IRequestHandler<ReceiverAlready
|
||||
public async Task<bool> Handle(ReceiverAlreadySignedQuery request, CancellationToken cancel = default)
|
||||
{
|
||||
return await _repo.Read()
|
||||
.Where(er => er.Envelope.Uuid == request.Envelope.Uuid)
|
||||
.Where(er => er.Receiver.Signature == request.Receiver.Signature)
|
||||
.Where(er => er.Envelope.History.Any(hist => hist.Status == Constants.EnvelopeStatus.DocumentSigned))
|
||||
.Where(er => er.Envelope!.Uuid == request.Envelope.Uuid)
|
||||
.Where(er => er.Receiver!.Signature == request.Receiver.Signature)
|
||||
.Where(er => er.Envelope!.History.Any(hist => hist.Status == EnvelopeStatus.DocumentSigned))
|
||||
.AnyAsync(cancel);
|
||||
}
|
||||
}
|
||||
@@ -33,9 +33,7 @@ public class CreateEnvelopeCommandHandler : IRequestHandler<CreateEnvelopeComman
|
||||
/// <returns></returns>
|
||||
public async Task<EnvelopeDto?> 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);
|
||||
var envelope = await _envelopeExecutor.CreateEnvelopeAsync(request.UserId, request.Title, request.Message, request.TFAEnabled, cancellationToken);
|
||||
|
||||
return _mapper.Map<EnvelopeDto>(envelope);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using MediatR;
|
||||
using EnvelopeGenerator.Domain;
|
||||
using EnvelopeGenerator.Application.Model;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Envelopes.Queries;
|
||||
|
||||
@@ -12,11 +12,11 @@ public record ReadEnvelopeQuery : EnvelopeQueryBase, IRequest
|
||||
/// <summary>
|
||||
/// Abfrage des Include des Umschlags
|
||||
/// </summary>
|
||||
public EnvelopeStatus? Status { get; init; }
|
||||
public EnvelopeStatusQuery? Status { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Repräsentiert den Include eines Umschlags und dessen Beziehung zum Empfänger. (vgl. auch <see cref="Constants.EnvelopeStatus"/>
|
||||
/// Repräsentiert den Include eines Umschlags und dessen Beziehung zum Empfänger. (vgl. auch <see cref="EnvelopeStatusQuery"/>
|
||||
/// Invalid (0): Ungültiger Include.
|
||||
/// EnvelopeCreated (1001): Der Umschlag wurde erstellt.
|
||||
/// EnvelopeSaved (1002): Der Umschlag wurde gespeichert.
|
||||
@@ -44,25 +44,25 @@ public record ReadEnvelopeQuery : EnvelopeQueryBase, IRequest
|
||||
/// MessageCompletionSent (3005): Abschlussbenachrichtigung wurde gesendet.
|
||||
/// </summary>
|
||||
|
||||
public record EnvelopeStatus
|
||||
public record EnvelopeStatusQuery
|
||||
{
|
||||
/// <summary>
|
||||
/// Der minimale Statuswert, der berücksichtigt werden.
|
||||
/// </summary>
|
||||
public Constants.EnvelopeStatus? Min { get; init; }
|
||||
public EnvelopeStatus? Min { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Der maximale Statuswert, der berücksichtigt werden.
|
||||
/// </summary>
|
||||
public Constants.EnvelopeStatus? Max { get; init; }
|
||||
public EnvelopeStatus? Max { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Eine Liste von Statuswerten, die einbezogen werden.
|
||||
/// </summary>
|
||||
public Constants.EnvelopeStatus[]? Include { get; init; }
|
||||
public EnvelopeStatus[]? Include { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Eine Liste von Statuswerten, die ignoriert werden werden.
|
||||
/// </summary>
|
||||
public Constants.EnvelopeStatus[]? Ignore { get; init; }
|
||||
public EnvelopeStatus[]? Ignore { get; init; }
|
||||
}
|
||||
@@ -1,152 +1,182 @@
|
||||
using System.Text;
|
||||
using static EnvelopeGenerator.Domain.Constants;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
using System.Text;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Extensions
|
||||
namespace EnvelopeGenerator.Application.Extensions;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public static class DecodingExtensions
|
||||
{
|
||||
public static class DecodingExtensions
|
||||
/// <summary>
|
||||
/// Validates whether a given string is a correctly formatted Base-64 encoded string.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This method checks the string for proper Base-64 formatting, which includes validating
|
||||
/// the length of the string (must be divisible by 4). It also checks each character to ensure
|
||||
/// it belongs to the Base-64 character set (A-Z, a-z, 0-9, '+', '/', and '=' for padding).
|
||||
/// The method ensures that padding characters ('=') only appear at the end of the string and
|
||||
/// are in a valid configuration (either one '=' at the end if the string's length % 4 is 3,
|
||||
/// or two '==' if the length % 4 is 2).
|
||||
/// </remarks>
|
||||
/// <param name="input">The Base-64 encoded string to validate.</param>
|
||||
/// <returns>
|
||||
/// <c>true</c> if the string is a valid Base-64 encoded string; otherwise, <c>false</c>.
|
||||
/// </returns>
|
||||
/// <example>
|
||||
/// <code>
|
||||
/// string testString = "TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlzIHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2YgdGhlIG1pbmQsIHRoYXQgYnk=";
|
||||
/// bool isValid = IsValidBase64String(testString);
|
||||
/// Console.WriteLine(isValid); // Output: true
|
||||
/// </code>
|
||||
/// </example>
|
||||
public static bool IsBase64String(this string input)
|
||||
{
|
||||
/// <summary>
|
||||
/// Validates whether a given string is a correctly formatted Base-64 encoded string.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This method checks the string for proper Base-64 formatting, which includes validating
|
||||
/// the length of the string (must be divisible by 4). It also checks each character to ensure
|
||||
/// it belongs to the Base-64 character set (A-Z, a-z, 0-9, '+', '/', and '=' for padding).
|
||||
/// The method ensures that padding characters ('=') only appear at the end of the string and
|
||||
/// are in a valid configuration (either one '=' at the end if the string's length % 4 is 3,
|
||||
/// or two '==' if the length % 4 is 2).
|
||||
/// </remarks>
|
||||
/// <param name="input">The Base-64 encoded string to validate.</param>
|
||||
/// <returns>
|
||||
/// <c>true</c> if the string is a valid Base-64 encoded string; otherwise, <c>false</c>.
|
||||
/// </returns>
|
||||
/// <example>
|
||||
/// <code>
|
||||
/// string testString = "TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlzIHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2YgdGhlIG1pbmQsIHRoYXQgYnk=";
|
||||
/// bool isValid = IsValidBase64String(testString);
|
||||
/// Console.WriteLine(isValid); // Output: true
|
||||
/// </code>
|
||||
/// </example>
|
||||
public static bool IsBase64String(this string input)
|
||||
// Check if the string is null or empty
|
||||
if (string.IsNullOrEmpty(input))
|
||||
{
|
||||
// Check if the string is null or empty
|
||||
if (string.IsNullOrEmpty(input))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Replace valid base-64 padding
|
||||
input = input.Trim();
|
||||
int mod4 = input.Length % 4;
|
||||
if (mod4 > 0)
|
||||
{
|
||||
// Base-64 string lengths should be divisible by 4
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check each character to ensure it is valid base-64
|
||||
foreach (char c in input)
|
||||
{
|
||||
if (!char.IsLetterOrDigit(c) && c != '+' && c != '/' && c != '=')
|
||||
{
|
||||
// Invalid character detected
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure no invalid padding scenarios exist
|
||||
if (input.EndsWith("==") && (input.Length % 4 == 0) ||
|
||||
input.EndsWith("=") && (input.Length % 4 == 3))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return input.IndexOf('=') == -1; // No padding allowed except at the end
|
||||
}
|
||||
|
||||
public static bool TryDecode(this string encodedKey, out string[] decodedKeys)
|
||||
{
|
||||
try
|
||||
{
|
||||
byte[] bytes = Convert.FromBase64String(encodedKey);
|
||||
string decodedString = Encoding.UTF8.GetString(bytes);
|
||||
decodedKeys = decodedString.Split(new string[] { "::" }, StringSplitOptions.None);
|
||||
return true;
|
||||
}
|
||||
catch(ArgumentNullException) { }
|
||||
catch (FormatException) { }
|
||||
catch(ArgumentException) { }
|
||||
|
||||
decodedKeys = Array.Empty<string>();
|
||||
return false;
|
||||
}
|
||||
|
||||
public static EncodeType GetEncodeType(this string[] decodedKeys) => decodedKeys.Length switch
|
||||
// Replace valid base-64 padding
|
||||
input = input.Trim();
|
||||
int mod4 = input.Length % 4;
|
||||
if (mod4 > 0)
|
||||
{
|
||||
2 => EncodeType.EnvelopeReceiver,
|
||||
3 => long.TryParse(decodedKeys[1], out var _) ? EncodeType.EnvelopeReceiverReadOnly : EncodeType.Undefined,
|
||||
_ => EncodeType.Undefined,
|
||||
};
|
||||
|
||||
public static (string? EnvelopeUuid, string? ReceiverSignature) ParseEnvelopeReceiverId(this string[] decodedKeys)
|
||||
=> decodedKeys.GetEncodeType() == EncodeType.EnvelopeReceiver
|
||||
? (EnvelopeUuid: decodedKeys[0], ReceiverSignature: decodedKeys[1])
|
||||
: throw new InvalidOperationException("Attempted to convert a decoded other than type EnvelopeReceiver to EnvelopeReceiver.");
|
||||
|
||||
public static long ParseReadOnlyId(this string[] decodedKeys)
|
||||
=> decodedKeys.GetEncodeType() == EncodeType.EnvelopeReceiverReadOnly
|
||||
? long.Parse(decodedKeys[1])
|
||||
: throw new InvalidOperationException("Attempted to convert a decoded other than type EnvelopeReceiver to EnvelopeReceiver. ");
|
||||
|
||||
/// <summary>
|
||||
/// Decodes the envelope receiver ID and extracts the envelope UUID and receiver signature.
|
||||
/// </summary>
|
||||
/// <param name="envelopeReceiverId">The base64 encoded string containing the envelope UUID and receiver signature.</param>
|
||||
/// <returns>A tuple containing the envelope UUID and receiver signature.</returns>
|
||||
public static (string? EnvelopeUuid, string? ReceiverSignature) DecodeEnvelopeReceiverId(this string envelopeReceiverId)
|
||||
{
|
||||
if (!envelopeReceiverId.IsBase64String())
|
||||
{
|
||||
return (null, null);
|
||||
}
|
||||
byte[] bytes = Convert.FromBase64String(envelopeReceiverId);
|
||||
string decodedString = Encoding.UTF8.GetString(bytes);
|
||||
string[] parts = decodedString.Split(new string[] { "::" }, StringSplitOptions.None);
|
||||
|
||||
if (parts.Length > 1)
|
||||
return (EnvelopeUuid: parts[0], ReceiverSignature: parts[1]);
|
||||
else
|
||||
return (string.Empty, string.Empty);
|
||||
// Base-64 string lengths should be divisible by 4
|
||||
return false;
|
||||
}
|
||||
|
||||
public static long? DecodeEnvelopeReceiverReadOnlyId(this string envelopeReceiverReadOnlyId)
|
||||
// Check each character to ensure it is valid base-64
|
||||
foreach (char c in input)
|
||||
{
|
||||
if (!envelopeReceiverReadOnlyId.IsBase64String())
|
||||
if (!char.IsLetterOrDigit(c) && c != '+' && c != '/' && c != '=')
|
||||
{
|
||||
return null;
|
||||
// Invalid character detected
|
||||
return false;
|
||||
}
|
||||
byte[] bytes = Convert.FromBase64String(envelopeReceiverReadOnlyId);
|
||||
string decodedString = System.Text.Encoding.UTF8.GetString(bytes);
|
||||
string[] parts = decodedString.Split(new string[] { "::" }, StringSplitOptions.None);
|
||||
|
||||
if (parts.Length > 2)
|
||||
return long.TryParse(parts[1], out long readOnlyId) ? readOnlyId : null;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the envelope UUID from the decoded envelope receiver ID.
|
||||
/// </summary>
|
||||
/// <param name="envelopeReceiverId">The base64 encoded string to decode.</param>
|
||||
/// <returns>The envelope UUID.</returns>
|
||||
public static string? GetEnvelopeUuid(this string envelopeReceiverId) => envelopeReceiverId.DecodeEnvelopeReceiverId().EnvelopeUuid;
|
||||
// Ensure no invalid padding scenarios exist
|
||||
if (input.EndsWith("==") && (input.Length % 4 == 0) ||
|
||||
input.EndsWith("=") && (input.Length % 4 == 3))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the receiver signature from the decoded envelope receiver ID.
|
||||
/// </summary>
|
||||
/// <param name="envelopeReceiverId">The base64 encoded string to decode.</param>
|
||||
/// <returns>The receiver signature.</returns>
|
||||
public static string? GetReceiverSignature(this string envelopeReceiverId) => envelopeReceiverId.DecodeEnvelopeReceiverId().ReceiverSignature;
|
||||
return input.IndexOf('=') == -1; // No padding allowed except at the end
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="encodedKey"></param>
|
||||
/// <param name="decodedKeys"></param>
|
||||
/// <returns></returns>
|
||||
public static bool TryDecode(this string encodedKey, out string[] decodedKeys)
|
||||
{
|
||||
try
|
||||
{
|
||||
byte[] bytes = Convert.FromBase64String(encodedKey);
|
||||
string decodedString = Encoding.UTF8.GetString(bytes);
|
||||
decodedKeys = decodedString.Split(new string[] { "::" }, StringSplitOptions.None);
|
||||
return true;
|
||||
}
|
||||
catch(ArgumentNullException) { }
|
||||
catch (FormatException) { }
|
||||
catch(ArgumentException) { }
|
||||
|
||||
decodedKeys = Array.Empty<string>();
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="decodedKeys"></param>
|
||||
/// <returns></returns>
|
||||
public static EncodeType GetEncodeType(this string[] decodedKeys) => decodedKeys.Length switch
|
||||
{
|
||||
2 => EncodeType.EnvelopeReceiver,
|
||||
3 => long.TryParse(decodedKeys[1], out var _) ? EncodeType.EnvelopeReceiverReadOnly : EncodeType.Undefined,
|
||||
_ => EncodeType.Undefined,
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="decodedKeys"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="InvalidOperationException"></exception>
|
||||
public static (string? EnvelopeUuid, string? ReceiverSignature) ParseEnvelopeReceiverId(this string[] decodedKeys)
|
||||
=> decodedKeys.GetEncodeType() == EncodeType.EnvelopeReceiver
|
||||
? (EnvelopeUuid: decodedKeys[0], ReceiverSignature: decodedKeys[1])
|
||||
: throw new InvalidOperationException("Attempted to convert a decoded other than type EnvelopeReceiver to EnvelopeReceiver.");
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="decodedKeys"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="InvalidOperationException"></exception>
|
||||
public static long ParseReadOnlyId(this string[] decodedKeys)
|
||||
=> decodedKeys.GetEncodeType() == EncodeType.EnvelopeReceiverReadOnly
|
||||
? long.Parse(decodedKeys[1])
|
||||
: throw new InvalidOperationException("Attempted to convert a decoded other than type EnvelopeReceiver to EnvelopeReceiver. ");
|
||||
|
||||
/// <summary>
|
||||
/// Decodes the envelope receiver ID and extracts the envelope UUID and receiver signature.
|
||||
/// </summary>
|
||||
/// <param name="envelopeReceiverId">The base64 encoded string containing the envelope UUID and receiver signature.</param>
|
||||
/// <returns>A tuple containing the envelope UUID and receiver signature.</returns>
|
||||
public static (string? EnvelopeUuid, string? ReceiverSignature) DecodeEnvelopeReceiverId(this string envelopeReceiverId)
|
||||
{
|
||||
if (!envelopeReceiverId.IsBase64String())
|
||||
{
|
||||
return (null, null);
|
||||
}
|
||||
byte[] bytes = Convert.FromBase64String(envelopeReceiverId);
|
||||
string decodedString = Encoding.UTF8.GetString(bytes);
|
||||
string[] parts = decodedString.Split(new string[] { "::" }, StringSplitOptions.None);
|
||||
|
||||
if (parts.Length > 1)
|
||||
return (EnvelopeUuid: parts[0], ReceiverSignature: parts[1]);
|
||||
else
|
||||
return (string.Empty, string.Empty);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="envelopeReceiverReadOnlyId"></param>
|
||||
/// <returns></returns>
|
||||
public static long? DecodeEnvelopeReceiverReadOnlyId(this string envelopeReceiverReadOnlyId)
|
||||
{
|
||||
if (!envelopeReceiverReadOnlyId.IsBase64String())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
byte[] bytes = Convert.FromBase64String(envelopeReceiverReadOnlyId);
|
||||
string decodedString = System.Text.Encoding.UTF8.GetString(bytes);
|
||||
string[] parts = decodedString.Split(new string[] { "::" }, StringSplitOptions.None);
|
||||
|
||||
if (parts.Length > 2)
|
||||
return long.TryParse(parts[1], out long readOnlyId) ? readOnlyId : null;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the envelope UUID from the decoded envelope receiver ID.
|
||||
/// </summary>
|
||||
/// <param name="envelopeReceiverId">The base64 encoded string to decode.</param>
|
||||
/// <returns>The envelope UUID.</returns>
|
||||
public static string? GetEnvelopeUuid(this string envelopeReceiverId) => envelopeReceiverId.DecodeEnvelopeReceiverId().EnvelopeUuid;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the receiver signature from the decoded envelope receiver ID.
|
||||
/// </summary>
|
||||
/// <param name="envelopeReceiverId">The base64 encoded string to decode.</param>
|
||||
/// <returns>The receiver signature.</returns>
|
||||
public static string? GetReceiverSignature(this string envelopeReceiverId) => envelopeReceiverId.DecodeEnvelopeReceiverId().ReceiverSignature;
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
using DigitalData.Core.Abstraction.Application.Repository;
|
||||
using EnvelopeGenerator.Application.Model;
|
||||
using EnvelopeGenerator.Domain;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using MediatR;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using EnvelopeGenerator.Application.Extensions;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Histories.Commands;
|
||||
|
||||
@@ -26,7 +26,7 @@ public record CreateHistoryCommand : EnvelopeReceiverQueryBase, IRequest<long?>
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public Constants.EnvelopeStatus Status { get; set; }
|
||||
public EnvelopeStatus Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using EnvelopeGenerator.Application.Dto.EnvelopeHistory;
|
||||
using EnvelopeGenerator.Domain;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
using MediatR;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
@@ -15,5 +15,5 @@ namespace EnvelopeGenerator.Application.Histories.Queries;
|
||||
public record ReadHistoryQuery(
|
||||
[Required]
|
||||
int EnvelopeId,
|
||||
Constants.EnvelopeStatus? Status = null,
|
||||
EnvelopeStatus? Status = null,
|
||||
bool? OnlyLast = true) : IRequest<IEnumerable<EnvelopeHistoryDto>>;
|
||||
@@ -1,6 +1,6 @@
|
||||
using DigitalData.Core.Abstraction.Application.Repository;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using static EnvelopeGenerator.Domain.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Interfaces.Repositories;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using DigitalData.Core.Abstraction.Application.Repository;
|
||||
using EnvelopeGenerator.Domain;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Interfaces.Repositories;
|
||||
@@ -17,7 +17,7 @@ public interface IEnvelopeHistoryRepository : ICRUDRepository<EnvelopeHistory, l
|
||||
/// <param name="userReference"></param>
|
||||
/// <param name="status"></param>
|
||||
/// <returns></returns>
|
||||
Task<int> CountAsync(int? envelopeId = null, string? userReference = null, Constants.EnvelopeStatus? status = null);
|
||||
Task<int> CountAsync(int? envelopeId = null, string? userReference = null, EnvelopeStatus? status = null);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
@@ -28,5 +28,5 @@ public interface IEnvelopeHistoryRepository : ICRUDRepository<EnvelopeHistory, l
|
||||
/// <param name="withSender"></param>
|
||||
/// <param name="withReceiver"></param>
|
||||
/// <returns></returns>
|
||||
Task<IEnumerable<EnvelopeHistory>> ReadAsync(int? envelopeId = null, string? userReference = null, Constants.EnvelopeStatus? status = null, bool withSender = false, bool withReceiver = false);
|
||||
Task<IEnumerable<EnvelopeHistory>> ReadAsync(int? envelopeId = null, string? userReference = null, EnvelopeStatus? status = null, bool withSender = false, bool withReceiver = false);
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
using DigitalData.Core.Abstraction.Application.Repository;
|
||||
using EnvelopeGenerator.Domain;
|
||||
using EnvelopeGenerator.Application.Envelopes.Queries;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Interfaces.Repositories;
|
||||
@@ -84,7 +85,7 @@ public interface IEnvelopeReceiverRepository : ICRUDRepository<EnvelopeReceiver,
|
||||
/// <param name="max_status"></param>
|
||||
/// <param name="ignore_statuses"></param>
|
||||
/// <returns></returns>
|
||||
Task<IEnumerable<EnvelopeReceiver>> ReadByUsernameAsync(string username, Constants.EnvelopeStatus? min_status = null, Constants.EnvelopeStatus? max_status = null, params Constants.EnvelopeStatus[] ignore_statuses);
|
||||
Task<IEnumerable<EnvelopeReceiver>> ReadByUsernameAsync(string username, EnvelopeStatus? min_status = null, EnvelopeStatus? max_status = null, params EnvelopeStatus[] ignore_statuses);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using DigitalData.Core.Abstraction.Application.Repository;
|
||||
using EnvelopeGenerator.Domain;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Interfaces.Repositories;
|
||||
@@ -39,5 +39,5 @@ public interface IEnvelopeRepository : ICRUDRepository<Envelope, int>
|
||||
/// <param name="max_status"></param>
|
||||
/// <param name="ignore_statuses"></param>
|
||||
/// <returns></returns>
|
||||
Task<IEnumerable<Envelope>> ReadByUserAsync(int userId, Constants.EnvelopeStatus? min_status = null, Constants.EnvelopeStatus? max_status = null, params Constants.EnvelopeStatus[] ignore_statuses);
|
||||
Task<IEnumerable<Envelope>> ReadByUserAsync(int userId, EnvelopeStatus? min_status = null, EnvelopeStatus? max_status = null, params EnvelopeStatus[] ignore_statuses);
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
using DigitalData.Core.Abstraction.Application;
|
||||
using DigitalData.Core.Abstraction.Application.DTO;
|
||||
using EnvelopeGenerator.Application.Dto;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using static EnvelopeGenerator.Domain.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Interfaces.Services;
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
using DigitalData.Core.Abstraction.Application.DTO;
|
||||
using EnvelopeGenerator.Application.Dto.EnvelopeHistory;
|
||||
using EnvelopeGenerator.Application.Dto.Receiver;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using static EnvelopeGenerator.Domain.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Interfaces.Services;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
using DigitalData.EmailProfilerDispatcher.Abstraction.Contracts;
|
||||
using EnvelopeGenerator.Application.Dto.EnvelopeReceiver;
|
||||
using EnvelopeGenerator.Application.Dto.EnvelopeReceiverReadOnly;
|
||||
using EnvelopeGenerator.Domain;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Interfaces.Services;
|
||||
|
||||
@@ -19,7 +19,7 @@ public interface IEnvelopeMailService : IEmailOutService
|
||||
/// <param name="tempType"></param>
|
||||
/// <param name="optionalPlaceholders"></param>
|
||||
/// <returns></returns>
|
||||
Task<DataResult<int>> SendAsync(EnvelopeReceiverDto envelopeReceiverDto, Constants.EmailTemplateType tempType, Dictionary<string, object>? optionalPlaceholders = null);
|
||||
Task<DataResult<int>> SendAsync(EnvelopeReceiverDto envelopeReceiverDto, EmailTemplateType tempType, Dictionary<string, object>? optionalPlaceholders = null);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
||||
@@ -7,6 +7,7 @@ using EnvelopeGenerator.Application.Envelopes;
|
||||
using EnvelopeGenerator.Application.Envelopes.Queries;
|
||||
using EnvelopeGenerator.Application.Receivers.Queries;
|
||||
using EnvelopeGenerator.Domain;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Interfaces.Services;
|
||||
@@ -122,7 +123,7 @@ public interface IEnvelopeReceiverService : IBasicCRUDService<EnvelopeReceiverDt
|
||||
/// <param name="receiverQuery"></param>
|
||||
/// <param name="ignore_statuses"></param>
|
||||
/// <returns></returns>
|
||||
Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUsernameAsync(string username, Constants.EnvelopeStatus? min_status = null, Constants.EnvelopeStatus? max_status = null, ReadEnvelopeQuery? envelopeQuery = null, ReadReceiverQuery? receiverQuery = null, params Constants.EnvelopeStatus[] ignore_statuses);
|
||||
Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUsernameAsync(string username, EnvelopeStatus? min_status = null, EnvelopeStatus? max_status = null, ReadEnvelopeQuery? envelopeQuery = null, ReadReceiverQuery? receiverQuery = null, params EnvelopeStatus[] ignore_statuses);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using DigitalData.Core.Abstraction.Application;
|
||||
using DigitalData.Core.Abstraction.Application.DTO;
|
||||
using EnvelopeGenerator.Application.Dto;
|
||||
using EnvelopeGenerator.Domain;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Interfaces.Services;
|
||||
@@ -41,5 +41,5 @@ public interface IEnvelopeService : IBasicCRUDService<EnvelopeDto, Envelope, int
|
||||
/// <param name="max_status"></param>
|
||||
/// <param name="ignore_statuses"></param>
|
||||
/// <returns></returns>
|
||||
Task<DataResult<IEnumerable<EnvelopeDto>>> ReadByUserAsync(int userId, Constants.EnvelopeStatus? min_status = null, Constants.EnvelopeStatus? max_status = null, params Constants.EnvelopeStatus[] ignore_statuses);
|
||||
Task<DataResult<IEnumerable<EnvelopeDto>>> ReadByUserAsync(int userId, EnvelopeStatus? min_status = null, EnvelopeStatus? max_status = null, params EnvelopeStatus[] ignore_statuses);
|
||||
}
|
||||
@@ -3,10 +3,10 @@ using DigitalData.Core.Application;
|
||||
using EnvelopeGenerator.Application.Dto;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using EnvelopeGenerator.Application.Interfaces.Repositories;
|
||||
using static EnvelopeGenerator.Domain.Constants;
|
||||
using DigitalData.Core.Abstraction.Application.DTO;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using EnvelopeGenerator.Application.Interfaces.Services;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Services;
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
using DigitalData.Core.Application;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using EnvelopeGenerator.Application.Interfaces.Repositories;
|
||||
using static EnvelopeGenerator.Domain.Constants;
|
||||
using EnvelopeGenerator.Application.Dto.EnvelopeHistory;
|
||||
using EnvelopeGenerator.Application.Dto.Receiver;
|
||||
using EnvelopeGenerator.Application.Interfaces.Services;
|
||||
using DigitalData.Core.Abstraction.Application.DTO;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Services;
|
||||
|
||||
|
||||
@@ -5,15 +5,13 @@ using DigitalData.EmailProfilerDispatcher.Abstraction.Services;
|
||||
using EnvelopeGenerator.Application.Dto.EnvelopeReceiver;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
using static EnvelopeGenerator.Domain.Constants;
|
||||
using EnvelopeGenerator.Application.Extensions;
|
||||
using EnvelopeGenerator.Application.Dto.EnvelopeReceiverReadOnly;
|
||||
using EnvelopeGenerator.Application.Configurations;
|
||||
using EnvelopeGenerator.Application.Extensions;
|
||||
using Newtonsoft.Json;
|
||||
using EnvelopeGenerator.Application.Interfaces.Services;
|
||||
using DigitalData.Core.Abstraction.Application.DTO;
|
||||
using EnvelopeGenerator.Domain;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Services;
|
||||
|
||||
@@ -148,7 +146,7 @@ public async Task<DataResult<int>> SendAsync(EnvelopeReceiverReadOnlyDto dto, Di
|
||||
{
|
||||
var tempSerResult = await _tempService.ReadByNameAsync(EmailTemplateType.DocumentShared);
|
||||
if (tempSerResult.IsFailed)
|
||||
return tempSerResult.ToFail<int>().Notice(LogLevel.Error, Flag.DataIntegrityIssue, $"The email cannot send because '{Constants.EmailTemplateType.DocumentShared}' template cannot found.");
|
||||
return tempSerResult.ToFail<int>().Notice(LogLevel.Error, Flag.DataIntegrityIssue, $"The email cannot send because '{EmailTemplateType.DocumentShared}' template cannot found.");
|
||||
var temp = tempSerResult.Data;
|
||||
|
||||
var mail = new EmailOutCreateDto()
|
||||
|
||||
@@ -10,11 +10,9 @@ using Microsoft.Extensions.Logging;
|
||||
using EnvelopeGenerator.Application.Extensions;
|
||||
using EnvelopeGenerator.Application.Dto.Messaging;
|
||||
using EnvelopeGenerator.Application.Interfaces.Services;
|
||||
using EnvelopeGenerator.Application.Envelopes;
|
||||
using EnvelopeGenerator.Application.Envelopes.Queries;
|
||||
using EnvelopeGenerator.Application.Receivers.Queries;
|
||||
using System.Reflection.Metadata;
|
||||
using EnvelopeGenerator.Domain;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Services;
|
||||
|
||||
@@ -239,7 +237,7 @@ public class EnvelopeReceiverService : BasicCRUDService<IEnvelopeReceiverReposit
|
||||
/// <param name="receiverQuery"></param>
|
||||
/// <param name="ignore_statuses"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUsernameAsync(string username, Constants.EnvelopeStatus? min_status = null, Constants.EnvelopeStatus? max_status = null, ReadEnvelopeQuery? envelopeQuery = null, ReadReceiverQuery? receiverQuery = null, params Constants.EnvelopeStatus[] ignore_statuses)
|
||||
public async Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUsernameAsync(string username, EnvelopeStatus? min_status = null, EnvelopeStatus? max_status = null, ReadEnvelopeQuery? envelopeQuery = null, ReadReceiverQuery? receiverQuery = null, params EnvelopeStatus[] ignore_statuses)
|
||||
{
|
||||
var er_list = await _repository.ReadByUsernameAsync(username: username, min_status: min_status, max_status: max_status, ignore_statuses: ignore_statuses);
|
||||
|
||||
@@ -249,7 +247,7 @@ public class EnvelopeReceiverService : BasicCRUDService<IEnvelopeReceiverReposit
|
||||
if (envelopeQuery?.Uuid is string uuid)
|
||||
er_list = er_list.Where(er => er.Envelope?.Uuid == uuid);
|
||||
|
||||
if (envelopeQuery?.Status?.Include?.FirstOrDefault() is Constants.EnvelopeStatus status)
|
||||
if (envelopeQuery?.Status?.Include?.FirstOrDefault() is EnvelopeStatus status)
|
||||
er_list = er_list.Where(er => er.Envelope?.Status == status);
|
||||
|
||||
if(receiverQuery?.Id is int id)
|
||||
|
||||
@@ -5,9 +5,7 @@ using EnvelopeGenerator.Application.Interfaces.Services;
|
||||
using EnvelopeGenerator.Application.Dto;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using EnvelopeGenerator.Application.Interfaces.Repositories;
|
||||
using EnvelopeGenerator.Application.Envelopes.Queries;
|
||||
using System.Reflection.Metadata;
|
||||
using EnvelopeGenerator.Domain;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Services;
|
||||
|
||||
@@ -70,7 +68,7 @@ public class EnvelopeService : BasicCRUDService<IEnvelopeRepository, EnvelopeDto
|
||||
/// <param name="max_status"></param>
|
||||
/// <param name="ignore_statuses"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<DataResult<IEnumerable<EnvelopeDto>>> ReadByUserAsync(int userId, Constants.EnvelopeStatus? min_status = null, Constants.EnvelopeStatus? max_status = null, params Constants.EnvelopeStatus[] ignore_statuses)
|
||||
public async Task<DataResult<IEnumerable<EnvelopeDto>>> ReadByUserAsync(int userId, EnvelopeStatus? min_status = null, EnvelopeStatus? max_status = null, params EnvelopeStatus[] ignore_statuses)
|
||||
{
|
||||
var users = await _repository.ReadByUserAsync(userId: userId, min_status: min_status, max_status: max_status, ignore_statuses: ignore_statuses);
|
||||
var readDto = _mapper.Map<IEnumerable<EnvelopeDto>>(users);
|
||||
|
||||
@@ -5,6 +5,7 @@ Imports Quartz
|
||||
Imports System.Security.Cryptography
|
||||
Imports DevExpress.DataProcessing
|
||||
Imports EnvelopeGenerator.Domain.Entities
|
||||
Imports EnvelopeGenerator.Domain.Constants
|
||||
|
||||
Namespace Jobs
|
||||
Public Class APIEnvelopeJob
|
||||
@@ -33,7 +34,7 @@ Namespace Jobs
|
||||
End Class
|
||||
|
||||
Public Function Execute(pContext As IJobExecutionContext) As Task Implements IJob.Execute
|
||||
LogConfig = pContext.MergedJobDataMap.Item(Domain.Constants.LOGCONFIG)
|
||||
LogConfig = pContext.MergedJobDataMap.Item(Value.LOGCONFIG)
|
||||
Logger = LogConfig.GetLogger()
|
||||
myTempFiles = New TempFiles(LogConfig)
|
||||
myTempFiles.Create()
|
||||
@@ -173,7 +174,7 @@ Namespace Jobs
|
||||
ActionService = New ActionService(pState, Database)
|
||||
End Sub
|
||||
Private Function GetDatabase(pContext As IJobExecutionContext, pLogConfig As LogConfig) As MSSQLServer
|
||||
Dim oConnectionString As String = pContext.MergedJobDataMap.Item(Domain.Constants.DATABASE)
|
||||
Dim oConnectionString As String = pContext.MergedJobDataMap.Item(Value.DATABASE)
|
||||
Dim Database = New MSSQLServer(pLogConfig, MSSQLServer.DecryptConnectionString(oConnectionString))
|
||||
|
||||
Return Database
|
||||
|
||||
@@ -48,8 +48,8 @@ Namespace Jobs
|
||||
End Class
|
||||
|
||||
Public Function Execute(pContext As IJobExecutionContext) As Task Implements IJob.Execute
|
||||
Dim oGdPictureKey As String = pContext.MergedJobDataMap.Item(Domain.Constants.GDPICTURE)
|
||||
LogConfig = pContext.MergedJobDataMap.Item(Domain.Constants.LOGCONFIG)
|
||||
Dim oGdPictureKey As String = pContext.MergedJobDataMap.Item(Value.GDPICTURE)
|
||||
LogConfig = pContext.MergedJobDataMap.Item(Value.LOGCONFIG)
|
||||
Logger = LogConfig.GetLogger()
|
||||
myTempFiles = New TempFiles(LogConfig)
|
||||
myTempFiles.Create()
|
||||
@@ -75,7 +75,7 @@ Namespace Jobs
|
||||
InitializeServices(oState)
|
||||
|
||||
Logger.Debug("Loading PDFBurner..")
|
||||
Dim pdfBurnerParams As PDFBurnerParams = pContext.MergedJobDataMap.Item(PDF_BURNER_PARAMS)
|
||||
Dim pdfBurnerParams As PDFBurnerParams = pContext.MergedJobDataMap.Item(Value.PDF_BURNER_PARAMS)
|
||||
PDFBurner = New PDFBurner(LogConfig, oGdPictureKey, pdfBurnerParams)
|
||||
|
||||
Logger.Debug("Loading PDFMerger..")
|
||||
@@ -440,7 +440,7 @@ Namespace Jobs
|
||||
End Sub
|
||||
|
||||
Private Function GetDatabase(pContext As IJobExecutionContext, pLogConfig As LogConfig) As MSSQLServer
|
||||
Dim oConnectionString As String = pContext.MergedJobDataMap.Item(Domain.Constants.DATABASE)
|
||||
Dim oConnectionString As String = pContext.MergedJobDataMap.Item(Value.DATABASE)
|
||||
Dim Database = New MSSQLServer(pLogConfig, MSSQLServer.DecryptConnectionString(oConnectionString))
|
||||
|
||||
Return Database
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Imports EnvelopeGenerator.Domain
|
||||
Imports EnvelopeGenerator.Domain.Constants
|
||||
Imports EnvelopeGenerator.Domain.Entities
|
||||
|
||||
Public Class ReportItem
|
||||
@@ -8,7 +8,7 @@ Public Class ReportItem
|
||||
Public Property EnvelopeTitle As String
|
||||
Public Property EnvelopeSubject As String
|
||||
|
||||
Public Property ItemStatus As Constants.EnvelopeStatus
|
||||
Public Property ItemStatus As EnvelopeStatus
|
||||
Public ReadOnly Property ItemStatusTranslated As String
|
||||
Get
|
||||
Dim oStatus = ItemStatus.ToString()
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
Imports EnvelopeGenerator.CommonServices.EnvelopeGenerator.Domain.Entities
|
||||
Imports EnvelopeGenerator.Domain
|
||||
Imports EnvelopeGenerator.Domain
|
||||
Imports EnvelopeGenerator.Domain.Constants
|
||||
Imports EnvelopeGenerator.Domain.Entities
|
||||
Public Class EmailData
|
||||
Public Property EmailAdress As String = ""
|
||||
Public Property EmailSubject As String = ""
|
||||
Public Property EmailBody As String = ""
|
||||
Public Property EmailType As Constants.EnvelopeStatus = Constants.EnvelopeStatus.Invalid
|
||||
Public Property EmailType As EnvelopeStatus = EnvelopeStatus.Invalid
|
||||
Public Property ReferenceID As Integer = 0
|
||||
Public Property ReferenceString As String = ""
|
||||
|
||||
@@ -29,7 +29,7 @@ Public Class EmailData
|
||||
''' <param name="pEnvelope"></param>
|
||||
''' <param name="pReceiver"></param>
|
||||
''' <param name="pStatus"></param>
|
||||
Public Sub New(pEnvelope As Entities.Envelope, pReceiver As ReceiverVM, pStatus As Constants.EnvelopeStatus)
|
||||
Public Sub New(pEnvelope As Entities.Envelope, pReceiver As ReceiverVM, pStatus As EnvelopeStatus)
|
||||
EmailAdress = pReceiver.EmailAddress
|
||||
EmailSubject = String.Empty
|
||||
EmailType = pStatus
|
||||
@@ -65,7 +65,7 @@ Public Class EmailData
|
||||
''' </summary>
|
||||
''' <param name="pEnvelope"></param>
|
||||
''' <param name="pStatus"></param>
|
||||
Public Sub New(pEnvelope As Entities.Envelope, pStatus As Constants.EnvelopeStatus)
|
||||
Public Sub New(pEnvelope As Entities.Envelope, pStatus As EnvelopeStatus)
|
||||
EmailAdress = pEnvelope.User.Email
|
||||
EmailSubject = String.Empty
|
||||
EmailType = pStatus
|
||||
|
||||
@@ -148,7 +148,7 @@ Public Class EnvelopeModel
|
||||
Dim oCommand As New SqlCommand(oSql)
|
||||
'oCommand.Parameters.Add("MESSAGE", SqlDbType.NVarChar).Value = String.Empty
|
||||
'oCommand.Parameters.Add("UUID", SqlDbType.NVarChar).Value = pEnvelope.Uuid
|
||||
'oCommand.Parameters.Add("STATUS", SqlDbType.Int).Value = Constants.EnvelopeStatus.EnvelopeCreated
|
||||
'oCommand.Parameters.Add("STATUS", SqlDbType.Int).Value = EnvelopeStatus.EnvelopeCreated
|
||||
'oCommand.Parameters.Add("USER_ID", SqlDbType.Int).Value = pEnvelope.UserId
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
Imports System.Data.SqlClient
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports EnvelopeGenerator.Domain.Constants
|
||||
Imports EnvelopeGenerator.Domain.Entities
|
||||
|
||||
Public Class HistoryModel
|
||||
@@ -28,7 +29,7 @@ Public Class HistoryModel
|
||||
End Function
|
||||
|
||||
Public Function HasReceiverSigned(pEnvelopeId As Integer, pReceiverId As Integer) As Boolean
|
||||
Dim oEnvelopeSigned As Integer = Domain.Constants.EnvelopeStatus.DocumentSigned
|
||||
Dim oEnvelopeSigned As Integer = EnvelopeStatus.DocumentSigned
|
||||
Dim oSql = $"SELECT COUNT(T.GUID)
|
||||
FROM TBSIG_ENVELOPE_HISTORY T
|
||||
JOIN TBSIG_RECEIVER T2 ON T.USER_REFERENCE = T2.EMAIL_ADDRESS
|
||||
|
||||
@@ -37,7 +37,7 @@ Public Class ReceiverModel
|
||||
}
|
||||
End Function
|
||||
|
||||
Public Function Insert(pReceiver As Receiver, pTransaction As SqlTransaction) As Boolean
|
||||
Public Function Insert(pReceiver As ReceiverVM, pTransaction As SqlTransaction) As Boolean
|
||||
Dim oSignature As String = pReceiver.GetSignature()
|
||||
Dim oCheck = $"SELECT COUNT(GUID) FROM [dbo].[TBSIG_RECEIVER] WHERE SIGNATURE = '{oSignature}'"
|
||||
Dim oExists = Database.GetScalarValue(oCheck)
|
||||
@@ -157,7 +157,7 @@ Public Class ReceiverModel
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function ListReceivers(pReceiversFromGrid As List(Of Receiver)) As IEnumerable(Of Receiver)
|
||||
Public Function ListReceivers(pReceiversFromGrid As List(Of ReceiverVM)) As IEnumerable(Of Receiver)
|
||||
Try
|
||||
If pReceiversFromGrid.Count = 0 Then
|
||||
Return New List(Of Receiver)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports EnvelopeGenerator.CommonServices.EnvelopeGenerator.Domain.Entities
|
||||
Imports EnvelopeGenerator.Domain.Constants
|
||||
Imports EnvelopeGenerator.Domain.Entities
|
||||
|
||||
Public Class EmailService
|
||||
@@ -17,7 +18,7 @@ Public Class EmailService
|
||||
|
||||
Public Function SendEnvelopeDeletedEmail(pEnvelope As Envelope, pReceiver As ReceiverVM, pReason As String) As Boolean
|
||||
Logger.Debug("SendEnvelopeDeletedEmail - Creating email data object...")
|
||||
Dim oEmailData As New EmailData(pEnvelope, pReceiver, Domain.Constants.EnvelopeStatus.MessageDeletionSent) With
|
||||
Dim oEmailData As New EmailData(pEnvelope, pReceiver, EnvelopeStatus.MessageDeletionSent) With
|
||||
{
|
||||
.SignatureLink = "",
|
||||
.ADDED_WHO_PROCESS = pEnvelope.CURRENT_WORK_APP
|
||||
@@ -35,7 +36,7 @@ Public Class EmailService
|
||||
|
||||
Public Function SendDocumentReceivedEmail(pEnvelope As Envelope, pReceiver As ReceiverVM) As Boolean
|
||||
Logger.Debug("Creating email data object.")
|
||||
Dim oEmailData As New EmailData(pEnvelope, pReceiver, Domain.Constants.EnvelopeStatus.MessageInvitationSent) With
|
||||
Dim oEmailData As New EmailData(pEnvelope, pReceiver, EnvelopeStatus.MessageInvitationSent) With
|
||||
{
|
||||
.SignatureLink = Helpers.GetEnvelopeURL(State.DbConfig.SignatureHost, pEnvelope.Uuid, pReceiver.Signature),
|
||||
.ADDED_WHO_PROCESS = pEnvelope.CURRENT_WORK_APP
|
||||
@@ -55,7 +56,7 @@ Public Class EmailService
|
||||
Logger.Debug($"State.DbConfig.SignatureHost: {State.DbConfig.SignatureHost}")
|
||||
Logger.Debug($" pEnvelope.Uuid: {pEnvelope.Uuid}")
|
||||
Logger.Debug($" pReceiver.Signature: {pReceiver.Signature}")
|
||||
Dim oEmailData As New EmailData(pEnvelope, pReceiver, Domain.Constants.EnvelopeStatus.MessageInvitationSent) With
|
||||
Dim oEmailData As New EmailData(pEnvelope, pReceiver, EnvelopeStatus.MessageInvitationSent) With
|
||||
{
|
||||
.SignatureLink = Helpers.GetEnvelopeURL(State.DbConfig.SignatureHost, pEnvelope.Uuid, pReceiver.Signature),
|
||||
.ADDED_WHO_PROCESS = pEnvelope.CURRENT_WORK_APP
|
||||
@@ -69,7 +70,7 @@ Public Class EmailService
|
||||
Logger.Debug($"State.DbConfig.SignatureHost: {State.DbConfig.SignatureHost}")
|
||||
Logger.Debug($" pEnvelope.Uuid: {pEnvelope.Uuid}")
|
||||
Logger.Debug($" pReceiver.Signature: {pReceiver.Signature}")
|
||||
Dim oEmailData As New EmailData(pEnvelope, pReceiver, Domain.Constants.EnvelopeStatus.MessageAccessCodeSent) With
|
||||
Dim oEmailData As New EmailData(pEnvelope, pReceiver, EnvelopeStatus.MessageAccessCodeSent) With
|
||||
{
|
||||
.SignatureLink = Helpers.GetEnvelopeURL(State.DbConfig.SignatureHost, pEnvelope.Uuid, pReceiver.Signature),
|
||||
.ADDED_WHO_PROCESS = pEnvelope.CURRENT_WORK_APP
|
||||
@@ -87,7 +88,7 @@ Public Class EmailService
|
||||
|
||||
Public Function SendSignedEmail(pEnvelope As Envelope, pReceiver As ReceiverVM) As Boolean
|
||||
Logger.Debug("Creating email data object.")
|
||||
Dim oEmailData = New EmailData(pEnvelope, pReceiver, Domain.Constants.EnvelopeStatus.MessageConfirmationSent) With
|
||||
Dim oEmailData = New EmailData(pEnvelope, pReceiver, EnvelopeStatus.MessageConfirmationSent) With
|
||||
{
|
||||
.SignatureLink = ""
|
||||
}
|
||||
@@ -104,7 +105,7 @@ Public Class EmailService
|
||||
|
||||
Public Function SendDocumentCompletedEmailToReceiver(pEnvelope As Envelope, pReceiver As ReceiverVM) As Boolean ', pAttachment As String
|
||||
Logger.Debug("Creating email data object.")
|
||||
Dim oEmailData = New EmailData(pEnvelope, pReceiver, Domain.Constants.EnvelopeStatus.MessageCompletionSent) With
|
||||
Dim oEmailData = New EmailData(pEnvelope, pReceiver, EnvelopeStatus.MessageCompletionSent) With
|
||||
{
|
||||
.SignatureLink = "",
|
||||
.ATT1_RELATED_ID = pEnvelope.Id,
|
||||
@@ -125,7 +126,7 @@ Public Class EmailService
|
||||
|
||||
Public Function SendDocumentCompletedEmailToCreator(pEnvelope As Envelope) As Boolean ', pAttachment As String
|
||||
Logger.Debug("Creating email data object.")
|
||||
Dim oEmailData = New EmailData(pEnvelope, Domain.Constants.EnvelopeStatus.MessageCompletionSent) With
|
||||
Dim oEmailData = New EmailData(pEnvelope, EnvelopeStatus.MessageCompletionSent) With
|
||||
{
|
||||
.SignatureLink = "",
|
||||
.ATT1_RELATED_ID = pEnvelope.Id,
|
||||
|
||||
@@ -1,183 +0,0 @@
|
||||
#if NETFRAMEWORK
|
||||
using System.Collections.Generic;
|
||||
#endif
|
||||
|
||||
namespace EnvelopeGenerator.Domain
|
||||
{
|
||||
public static class Constants
|
||||
{
|
||||
#region Status Fields
|
||||
|
||||
// http://wiki.dd/xwiki13/bin/view/Anwendungen/Produkt-Handbuch/Sonstiges/SignFlow/Envelope%20Status/
|
||||
public enum EnvelopeStatus
|
||||
{
|
||||
Invalid = 0,
|
||||
EnvelopeCreated = 1001,
|
||||
EnvelopeSaved = 1002,
|
||||
EnvelopeQueued = 1003,
|
||||
EnvelopeSent = 1004, // Nicht verwendet
|
||||
EnvelopePartlySigned = 1005,
|
||||
EnvelopeCompletelySigned = 1006,
|
||||
EnvelopeReportCreated = 1007,
|
||||
EnvelopeArchived = 1008,
|
||||
EnvelopeDeleted = 1009,
|
||||
EnvelopeRejected = 10007,
|
||||
EnvelopeWithdrawn = 10009,
|
||||
AccessCodeRequested = 2001,
|
||||
AccessCodeCorrect = 2002,
|
||||
AccessCodeIncorrect = 2003,
|
||||
DocumentOpened = 2004,
|
||||
DocumentSigned = 2005,
|
||||
DocumentForwarded = 2006,
|
||||
DocumentRejected = 2007,
|
||||
EnvelopeShared = 2008,
|
||||
EnvelopeViewed = 2009,
|
||||
MessageInvitationSent = 3001, // Wird von Trigger verwendet
|
||||
MessageAccessCodeSent = 3002,
|
||||
MessageConfirmationSent = 3003,
|
||||
MessageDeletionSent = 3004,
|
||||
MessageCompletionSent = 3005,
|
||||
DocumentMod_Rotation = 4001
|
||||
}
|
||||
|
||||
public static class Status
|
||||
{
|
||||
public static readonly IReadOnlyList<EnvelopeStatus> NonHist = new List<EnvelopeStatus>
|
||||
{
|
||||
EnvelopeStatus.Invalid,
|
||||
EnvelopeStatus.EnvelopeSaved,
|
||||
EnvelopeStatus.EnvelopeSent,
|
||||
EnvelopeStatus.EnvelopePartlySigned
|
||||
};
|
||||
|
||||
public static readonly IReadOnlyList<EnvelopeStatus> RelatedToFormApp = new List<EnvelopeStatus>
|
||||
{
|
||||
EnvelopeStatus.EnvelopeCreated,
|
||||
EnvelopeStatus.DocumentMod_Rotation
|
||||
};
|
||||
}
|
||||
|
||||
// TODO: standardize in xwiki
|
||||
public enum ReferenceType
|
||||
{
|
||||
Sender = 1,
|
||||
Receiver,
|
||||
System,
|
||||
Unknown
|
||||
}
|
||||
|
||||
public enum ElementStatus
|
||||
{
|
||||
Created = 0
|
||||
}
|
||||
|
||||
public enum DocumentStatus
|
||||
{
|
||||
Created = 0,
|
||||
Signed = 1
|
||||
}
|
||||
|
||||
public enum ReceiverStatus
|
||||
{
|
||||
Unsigned = 0,
|
||||
Signed = 1
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Type Fields
|
||||
|
||||
public enum ElementType
|
||||
{
|
||||
Signature = 1
|
||||
}
|
||||
|
||||
public enum ContractType
|
||||
{
|
||||
Contract = 1,
|
||||
ReadAndSign = 2
|
||||
}
|
||||
|
||||
public enum ColorType
|
||||
{
|
||||
ReceiverColor1 = 1,
|
||||
ReceiverColor2 = 2,
|
||||
ReceiverColor3 = 3,
|
||||
ReceiverColor4 = 4,
|
||||
ReceiverColor5 = 5,
|
||||
ReceiverColor6 = 6,
|
||||
ReceiverColor7 = 7,
|
||||
ReceiverColor8 = 8,
|
||||
ReceiverColor9 = 9,
|
||||
ReceiverColor10 = 10
|
||||
}
|
||||
|
||||
public enum CertificationType
|
||||
{
|
||||
AdvancedElectronicSignature = 1
|
||||
// ElectronicSignature = 1
|
||||
// QualifiedSignature = 2
|
||||
}
|
||||
|
||||
public enum FinalEmailType
|
||||
{
|
||||
No = 0,
|
||||
Yes = 1,
|
||||
YesWithAttachment = 2
|
||||
}
|
||||
|
||||
public enum PageOrientation
|
||||
{
|
||||
Portrait = 0,
|
||||
Landscape = 1
|
||||
}
|
||||
|
||||
public enum EmailTemplateType
|
||||
{
|
||||
DocumentReceived = 0,
|
||||
DocumentSigned,
|
||||
DocumentDeleted,
|
||||
DocumentCompleted,
|
||||
DocumentAccessCodeReceived,
|
||||
DocumentShared,
|
||||
TotpSecret,
|
||||
DocumentRejected_ADM,
|
||||
DocumentRejected_REC,
|
||||
DocumentRejected_REC_2
|
||||
}
|
||||
|
||||
public enum EncodeType
|
||||
{
|
||||
EnvelopeReceiver,
|
||||
EnvelopeReceiverReadOnly,
|
||||
Undefined,
|
||||
DocumentForwarded,
|
||||
DocumentShared
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Role
|
||||
|
||||
public static class ReceiverRole
|
||||
{
|
||||
public const string PreAuth = "PreAuth";
|
||||
public const string FullyAuth = "FullyAuth";
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constants
|
||||
|
||||
public const string DATABASE = "DATABASE";
|
||||
public const string LOGCONFIG = "LOGCONFIG";
|
||||
public const string GDPICTURE = "GDPICTURE";
|
||||
public const string PDF_BURNER_PARAMS = "PDFBurnerParams";
|
||||
|
||||
public const string GREEN_300 = "#bbf7d0";
|
||||
public const string RED_300 = "#fecaca";
|
||||
public const string ORANGE_300 = "#fed7aa";
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
9
EnvelopeGenerator.Domain/Constants/CertificationType.cs
Normal file
9
EnvelopeGenerator.Domain/Constants/CertificationType.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace EnvelopeGenerator.Domain.Constants
|
||||
{
|
||||
public enum CertificationType
|
||||
{
|
||||
AdvancedElectronicSignature = 1
|
||||
// ElectronicSignature = 1
|
||||
// QualifiedSignature = 2
|
||||
}
|
||||
}
|
||||
16
EnvelopeGenerator.Domain/Constants/ColorType.cs
Normal file
16
EnvelopeGenerator.Domain/Constants/ColorType.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
namespace EnvelopeGenerator.Domain.Constants
|
||||
{
|
||||
public enum ColorType
|
||||
{
|
||||
ReceiverColor1 = 1,
|
||||
ReceiverColor2 = 2,
|
||||
ReceiverColor3 = 3,
|
||||
ReceiverColor4 = 4,
|
||||
ReceiverColor5 = 5,
|
||||
ReceiverColor6 = 6,
|
||||
ReceiverColor7 = 7,
|
||||
ReceiverColor8 = 8,
|
||||
ReceiverColor9 = 9,
|
||||
ReceiverColor10 = 10
|
||||
}
|
||||
}
|
||||
8
EnvelopeGenerator.Domain/Constants/ContractType.cs
Normal file
8
EnvelopeGenerator.Domain/Constants/ContractType.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace EnvelopeGenerator.Domain.Constants
|
||||
{
|
||||
public enum ContractType
|
||||
{
|
||||
Contract = 1,
|
||||
ReadAndSign = 2
|
||||
}
|
||||
}
|
||||
8
EnvelopeGenerator.Domain/Constants/DocumentStatus.cs
Normal file
8
EnvelopeGenerator.Domain/Constants/DocumentStatus.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace EnvelopeGenerator.Domain.Constants
|
||||
{
|
||||
public enum DocumentStatus
|
||||
{
|
||||
Created = 0,
|
||||
Signed = 1
|
||||
}
|
||||
}
|
||||
7
EnvelopeGenerator.Domain/Constants/ElementStatus.cs
Normal file
7
EnvelopeGenerator.Domain/Constants/ElementStatus.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace EnvelopeGenerator.Domain.Constants
|
||||
{
|
||||
public enum ElementStatus
|
||||
{
|
||||
Created = 0
|
||||
}
|
||||
}
|
||||
7
EnvelopeGenerator.Domain/Constants/ElementType.cs
Normal file
7
EnvelopeGenerator.Domain/Constants/ElementType.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace EnvelopeGenerator.Domain.Constants
|
||||
{
|
||||
public enum ElementType
|
||||
{
|
||||
Signature = 1
|
||||
}
|
||||
}
|
||||
16
EnvelopeGenerator.Domain/Constants/EmailTemplateType.cs
Normal file
16
EnvelopeGenerator.Domain/Constants/EmailTemplateType.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
namespace EnvelopeGenerator.Domain.Constants
|
||||
{
|
||||
public enum EmailTemplateType
|
||||
{
|
||||
DocumentReceived = 0,
|
||||
DocumentSigned,
|
||||
DocumentDeleted,
|
||||
DocumentCompleted,
|
||||
DocumentAccessCodeReceived,
|
||||
DocumentShared,
|
||||
TotpSecret,
|
||||
DocumentRejected_ADM,
|
||||
DocumentRejected_REC,
|
||||
DocumentRejected_REC_2
|
||||
}
|
||||
}
|
||||
11
EnvelopeGenerator.Domain/Constants/EncodeType.cs
Normal file
11
EnvelopeGenerator.Domain/Constants/EncodeType.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace EnvelopeGenerator.Domain.Constants
|
||||
{
|
||||
public enum EncodeType
|
||||
{
|
||||
EnvelopeReceiver,
|
||||
EnvelopeReceiverReadOnly,
|
||||
Undefined,
|
||||
DocumentForwarded,
|
||||
DocumentShared
|
||||
}
|
||||
}
|
||||
53
EnvelopeGenerator.Domain/Constants/EnvelopeStatus.cs
Normal file
53
EnvelopeGenerator.Domain/Constants/EnvelopeStatus.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace EnvelopeGenerator.Domain.Constants
|
||||
{
|
||||
// http://wiki.dd/xwiki13/bin/view/Anwendungen/Produkt-Handbuch/Sonstiges/SignFlow/Envelope%20Status/
|
||||
public enum EnvelopeStatus
|
||||
{
|
||||
Invalid = 0,
|
||||
EnvelopeCreated = 1001,
|
||||
EnvelopeSaved = 1002,
|
||||
EnvelopeQueued = 1003,
|
||||
EnvelopeSent = 1004, // Nicht verwendet
|
||||
EnvelopePartlySigned = 1005,
|
||||
EnvelopeCompletelySigned = 1006,
|
||||
EnvelopeReportCreated = 1007,
|
||||
EnvelopeArchived = 1008,
|
||||
EnvelopeDeleted = 1009,
|
||||
EnvelopeRejected = 10007,
|
||||
EnvelopeWithdrawn = 10009,
|
||||
AccessCodeRequested = 2001,
|
||||
AccessCodeCorrect = 2002,
|
||||
AccessCodeIncorrect = 2003,
|
||||
DocumentOpened = 2004,
|
||||
DocumentSigned = 2005,
|
||||
DocumentForwarded = 2006,
|
||||
DocumentRejected = 2007,
|
||||
EnvelopeShared = 2008,
|
||||
EnvelopeViewed = 2009,
|
||||
MessageInvitationSent = 3001, // Wird von Trigger verwendet
|
||||
MessageAccessCodeSent = 3002,
|
||||
MessageConfirmationSent = 3003,
|
||||
MessageDeletionSent = 3004,
|
||||
MessageCompletionSent = 3005,
|
||||
DocumentMod_Rotation = 4001
|
||||
}
|
||||
|
||||
public static class Status
|
||||
{
|
||||
public static readonly IReadOnlyList<EnvelopeStatus> NonHist = new List<EnvelopeStatus>
|
||||
{
|
||||
EnvelopeStatus.Invalid,
|
||||
EnvelopeStatus.EnvelopeSaved,
|
||||
EnvelopeStatus.EnvelopeSent,
|
||||
EnvelopeStatus.EnvelopePartlySigned
|
||||
};
|
||||
|
||||
public static readonly IReadOnlyList<EnvelopeStatus> RelatedToFormApp = new List<EnvelopeStatus>
|
||||
{
|
||||
EnvelopeStatus.EnvelopeCreated,
|
||||
EnvelopeStatus.DocumentMod_Rotation
|
||||
};
|
||||
}
|
||||
}
|
||||
9
EnvelopeGenerator.Domain/Constants/FinalEmailType.cs
Normal file
9
EnvelopeGenerator.Domain/Constants/FinalEmailType.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace EnvelopeGenerator.Domain.Constants
|
||||
{
|
||||
public enum FinalEmailType
|
||||
{
|
||||
No = 0,
|
||||
Yes = 1,
|
||||
YesWithAttachment = 2
|
||||
}
|
||||
}
|
||||
8
EnvelopeGenerator.Domain/Constants/PageOrientation.cs
Normal file
8
EnvelopeGenerator.Domain/Constants/PageOrientation.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace EnvelopeGenerator.Domain.Constants
|
||||
{
|
||||
public enum PageOrientation
|
||||
{
|
||||
Portrait = 0,
|
||||
Landscape = 1
|
||||
}
|
||||
}
|
||||
8
EnvelopeGenerator.Domain/Constants/ReceiverRole.cs
Normal file
8
EnvelopeGenerator.Domain/Constants/ReceiverRole.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace EnvelopeGenerator.Domain.Constants
|
||||
{
|
||||
public static class ReceiverRole
|
||||
{
|
||||
public const string PreAuth = "PreAuth";
|
||||
public const string FullyAuth = "FullyAuth";
|
||||
}
|
||||
}
|
||||
8
EnvelopeGenerator.Domain/Constants/ReceiverStatus.cs
Normal file
8
EnvelopeGenerator.Domain/Constants/ReceiverStatus.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace EnvelopeGenerator.Domain.Constants
|
||||
{
|
||||
public enum ReceiverStatus
|
||||
{
|
||||
Unsigned = 0,
|
||||
Signed = 1
|
||||
}
|
||||
}
|
||||
11
EnvelopeGenerator.Domain/Constants/ReferenceType.cs
Normal file
11
EnvelopeGenerator.Domain/Constants/ReferenceType.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace EnvelopeGenerator.Domain.Constants
|
||||
{
|
||||
// TODO: standardize in xwiki
|
||||
public enum ReferenceType
|
||||
{
|
||||
Sender = 1,
|
||||
Receiver,
|
||||
System,
|
||||
Unknown
|
||||
}
|
||||
}
|
||||
14
EnvelopeGenerator.Domain/Constants/Value.cs
Normal file
14
EnvelopeGenerator.Domain/Constants/Value.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
namespace EnvelopeGenerator.Domain.Constants
|
||||
{
|
||||
public static class Value
|
||||
{
|
||||
public const string DATABASE = "DATABASE";
|
||||
public const string LOGCONFIG = "LOGCONFIG";
|
||||
public const string GDPICTURE = "GDPICTURE";
|
||||
public const string PDF_BURNER_PARAMS = "PDFBurnerParams";
|
||||
|
||||
public const string GREEN_300 = "#bbf7d0";
|
||||
public const string RED_300 = "#fecaca";
|
||||
public const string ORANGE_300 = "#fed7aa";
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
using DigitalData.UserManager.Domain.Entities;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
|
||||
#if NETFRAMEWORK
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -22,7 +24,7 @@ public class Envelope
|
||||
// TODO: * Check the Form App and remove the default value
|
||||
#if NETFRAMEWORK
|
||||
Id = 0;
|
||||
Status = Constants.EnvelopeStatus.EnvelopeCreated;
|
||||
Status = EnvelopeStatus.EnvelopeCreated;
|
||||
Uuid = Guid.NewGuid().ToString();
|
||||
Message = My.Resources.Envelope.Please_read_and_sign_this_document;
|
||||
Title= string.Empty;
|
||||
@@ -50,7 +52,7 @@ public class Envelope
|
||||
|
||||
[Required]
|
||||
[Column("STATUS")]
|
||||
public Constants.EnvelopeStatus Status { get; set; }
|
||||
public EnvelopeStatus Status { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("ENVELOPE_UUID", TypeName = "nvarchar(36)")]
|
||||
@@ -153,7 +155,7 @@ public class Envelope
|
||||
public string CURRENT_WORK_APP { get; set; } = "signFLOW GUI";
|
||||
|
||||
[NotMapped]
|
||||
public bool IsAlreadySent => Status > Constants.EnvelopeStatus.EnvelopeSaved;
|
||||
public bool IsAlreadySent => Status > EnvelopeStatus.EnvelopeSaved;
|
||||
#endif
|
||||
|
||||
public List<EnvelopeDocument> Documents { get; set; }
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using EnvelopeGenerator.Domain.Interfaces;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
|
||||
|
||||
#if NETFRAMEWORK
|
||||
using System;
|
||||
@@ -32,7 +34,7 @@ public class EnvelopeHistory : IHasEnvelope, IHasReceiver
|
||||
|
||||
[Required]
|
||||
[Column("STATUS")]
|
||||
public Constants.EnvelopeStatus Status { get; set; }
|
||||
public EnvelopeStatus Status { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("ADDED_WHEN", TypeName = "datetime")]
|
||||
|
||||
@@ -76,7 +76,7 @@ Public MustInherit Class BaseController
|
||||
End If
|
||||
|
||||
Dim oResult2 = pEnvelope.Receivers.
|
||||
Select(Function(r) ReceiverModel.Delete(r.Id, pEnvelope.Id, oTransaction)).
|
||||
Select(Function(r) ReceiverModel.Delete(r.Receiver.Id, pEnvelope.Id, oTransaction)).
|
||||
All(Function(r) r = True)
|
||||
|
||||
If oResult2 = False Then
|
||||
|
||||
@@ -30,7 +30,7 @@ Public Class EnvelopeEditorController
|
||||
|
||||
Envelope = pEnvelope
|
||||
Envelope.Documents = DocumentModel.List(pEnvelope.Id).ToList()
|
||||
Envelope.Receivers = ReceiverModel.ListEnvelopeReceivers(pEnvelope.Id).ToList()
|
||||
Envelope.Receivers = ReceiverModel.ListEnvelopeReceivers(pEnvelope.Id).Cast(Of EnvelopeReceiver)().ToList()
|
||||
|
||||
Thumbnail = New Thumbnail(pState.LogConfig)
|
||||
ActionService = New ActionService(pState, Nothing)
|
||||
@@ -43,7 +43,7 @@ Public Class EnvelopeEditorController
|
||||
Public Function DocumentRotationChanged() As Boolean
|
||||
Return ActionService.SetStatusDocumentRotationChanged(Envelope)
|
||||
End Function
|
||||
Public Function ResendReceiverInvitation(pEnvelope As Envelope, pReceiver As Receiver) As Boolean
|
||||
Public Function ResendReceiverInvitation(pEnvelope As Envelope, pReceiver As ReceiverVM) As Boolean
|
||||
Return ActionService.ResendReceiver(pEnvelope, pReceiver)
|
||||
End Function
|
||||
|
||||
@@ -56,8 +56,8 @@ Public Class EnvelopeEditorController
|
||||
|
||||
If ElementModel.OneElementPerReceiverExist(Envelope.Id) = False Then
|
||||
|
||||
For Each receiverItem As Receiver In Envelope.Receivers
|
||||
If ElementModel.ElementsExist(Envelope.Id, receiverItem.Id) = False Then
|
||||
For Each receiverItem As EnvelopeReceiver In Envelope.Receivers
|
||||
If ElementModel.ElementsExist(Envelope.Id, receiverItem.Envelope.Id) = False Then
|
||||
oEnvelopeErrors.Add(String.Format(Resources.Envelope.Missing_Elements_for_Receiver, receiverItem.Name))
|
||||
End If
|
||||
Next
|
||||
@@ -90,7 +90,7 @@ Public Class EnvelopeEditorController
|
||||
End If
|
||||
End Function
|
||||
|
||||
Public Function SaveReceivers(pEnvelope As Envelope, pReceiversFromGrid As List(Of Receiver)) As Boolean
|
||||
Public Function SaveReceivers(pEnvelope As Envelope, pReceiversFromGrid As List(Of ReceiverVM)) As Boolean
|
||||
Dim oExistingReceivers As List(Of Receiver) = ReceiverModel.ListReceivers(pReceiversFromGrid).ToList()
|
||||
Dim oExistingAddresses = oExistingReceivers.Select(Function(r) r.EmailAddress)
|
||||
Logger.Debug($"oExistingReceivers.count: {oExistingReceivers.Count}")
|
||||
@@ -277,7 +277,7 @@ Public Class EnvelopeEditorController
|
||||
Return ReceiverModel.ListAllEnvelopeReceiverAddresses(pUserId)
|
||||
End Function
|
||||
|
||||
Public Function CreateNewReceivers(pNewReceivers As List(Of Receiver)) As Boolean
|
||||
Public Function CreateNewReceivers(pNewReceivers As List(Of ReceiverVM)) As Boolean
|
||||
If pNewReceivers.Count = 0 Then
|
||||
Return True
|
||||
End If
|
||||
@@ -380,7 +380,7 @@ Public Class EnvelopeEditorController
|
||||
Return ElementModel.ElementsExist(Envelope.Id, pReceiverId)
|
||||
End Function
|
||||
|
||||
Private Sub InsertReceivers(pReceivers As List(Of Receiver), pTransaction As SqlTransaction)
|
||||
Private Sub InsertReceivers(pReceivers As List(Of ReceiverVM), pTransaction As SqlTransaction)
|
||||
Dim status = pReceivers.
|
||||
Select(Function(r) InsertReceiver(r, pTransaction)).
|
||||
All(Function(pResult) pResult = True)
|
||||
@@ -401,12 +401,8 @@ Public Class EnvelopeEditorController
|
||||
|
||||
End Function
|
||||
|
||||
Private Function InsertReceiver(pReceiver As Receiver, pTransaction As SqlTransaction) As Boolean
|
||||
If pReceiver.HasId = False Then
|
||||
Return ReceiverModel.Insert(pReceiver, pTransaction)
|
||||
Else
|
||||
Return True
|
||||
End If
|
||||
Private Function InsertReceiver(pReceiver As ReceiverVM, pTransaction As SqlTransaction) As Boolean
|
||||
Return ReceiverModel.Insert(pReceiver, pTransaction)
|
||||
End Function
|
||||
|
||||
Public Function GetLastNameByEmailAdress(pEmailAdress As String) As String
|
||||
|
||||
@@ -18,7 +18,7 @@ Imports EnvelopeGenerator.Domain.Entities
|
||||
Partial Public Class frmEnvelopeEditor
|
||||
Public Property Envelope As Envelope
|
||||
Public Property Documents As New BindingList(Of EnvelopeDocument)
|
||||
Public Property Receivers As New BindingList(Of Receiver)
|
||||
Public Property Receivers As New BindingList(Of ReceiverVM)
|
||||
|
||||
Private AllReceiverEmails As New List(Of String)
|
||||
|
||||
@@ -105,7 +105,7 @@ Partial Public Class frmEnvelopeEditor
|
||||
Else
|
||||
Controller = New EnvelopeEditorController(State, Envelope)
|
||||
Documents = New BindingList(Of EnvelopeDocument)(Controller.Envelope.Documents)
|
||||
Receivers = New BindingList(Of Receiver)(Controller.Envelope.Receivers)
|
||||
Receivers = New BindingList(Of ReceiverVM)(Controller.Envelope.Receivers.Select(Function(r) ReceiverVM.From(r)).ToList())
|
||||
|
||||
For Each docItem As EnvelopeDocument In Documents
|
||||
If Not File.Exists(docItem.Filepath) Then
|
||||
@@ -233,7 +233,7 @@ Partial Public Class frmEnvelopeEditor
|
||||
.Document = Controller.Envelope.Documents.
|
||||
Where(Function(d) d.Filename = oDocument.Filename).
|
||||
SingleOrDefault(),
|
||||
.Receivers = Controller.Envelope.Receivers.ToList
|
||||
.Receivers = Controller.Envelope.Receivers.Select(Function(r) ReceiverVM.From(r)).ToList()
|
||||
}
|
||||
oForm.ShowDialog()
|
||||
|
||||
@@ -335,7 +335,7 @@ Partial Public Class frmEnvelopeEditor
|
||||
|
||||
|
||||
|
||||
If Controller.SaveReceivers(oEnvelope, Receivers.ToList) = False Then
|
||||
If Controller.SaveReceivers(oEnvelope, Receivers.ToList()) = False Then
|
||||
MsgBox(Resources.Envelope.Error_when_saving_the_recipients, MsgBoxStyle.Critical, Text)
|
||||
Return False
|
||||
End If
|
||||
@@ -366,7 +366,7 @@ Partial Public Class frmEnvelopeEditor
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim oReceiver As Receiver = ViewReceivers.GetFocusedRow()
|
||||
Dim oReceiver As ReceiverVM = ViewReceivers.GetFocusedRow()
|
||||
|
||||
If oReceiver Is Nothing Then
|
||||
Exit Sub
|
||||
@@ -381,7 +381,7 @@ Partial Public Class frmEnvelopeEditor
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If Controller.DeleteReceiver(oReceiver) Then
|
||||
If Controller.DeleteReceiver(oReceiver.Receiver) Then
|
||||
Receivers.Remove(oReceiver)
|
||||
Else
|
||||
MsgBox(Resources.Envelope.Recipient_could_not_be_deleted, MsgBoxStyle.Critical, Text)
|
||||
@@ -459,7 +459,7 @@ Partial Public Class frmEnvelopeEditor
|
||||
End Sub
|
||||
|
||||
Private Sub ViewReceivers_InitNewRow(sender As Object, e As InitNewRowEventArgs) Handles ViewReceivers.InitNewRow
|
||||
Dim oReceiver As Receiver = ViewReceivers.GetRow(e.RowHandle)
|
||||
Dim oReceiver As ReceiverVM = ViewReceivers.GetRow(e.RowHandle)
|
||||
|
||||
Dim oUsedColors = Receivers.Select(Of Integer)(Function(r) r.ColorType).ToList()
|
||||
Dim oAllColors = [Enum].GetValues(GetType(Domain.Constants.ColorType)).Cast(Of Integer).ToList()
|
||||
|
||||
@@ -19,8 +19,8 @@ Partial Public Class frmFieldEditor
|
||||
Private Controller As FieldEditorController
|
||||
|
||||
Public Property Document As EnvelopeDocument = Nothing
|
||||
Public Property Receivers As List(Of Receiver)
|
||||
Public Property SelectedReceiver As Receiver = Nothing
|
||||
Public Property Receivers As List(Of ReceiverVM)
|
||||
Public Property SelectedReceiver As ReceiverVM = Nothing
|
||||
|
||||
Private UnsavedChanges As Boolean = False
|
||||
|
||||
@@ -106,7 +106,7 @@ Partial Public Class frmFieldEditor
|
||||
UnsavedChanges = True
|
||||
End Sub
|
||||
|
||||
Private Function CreateBarItem(pReceiver As Receiver) As BarItem
|
||||
Private Function CreateBarItem(pReceiver As ReceiverVM) As BarItem
|
||||
Dim oItem = New BarButtonItem(BarManager1, pReceiver.Name)
|
||||
Dim oBaseCircle As SvgImage = SvgImageCollection1.Item(0)
|
||||
Dim oColorCircle = Helpers.GetColorCircle(oBaseCircle, pReceiver.Color)
|
||||
@@ -121,7 +121,7 @@ Partial Public Class frmFieldEditor
|
||||
Private Sub ReceiverItem_Click(sender As Object, e As ItemClickEventArgs)
|
||||
Me.SuspendLayout()
|
||||
|
||||
Dim oSelectedReceiver As Receiver = e.Item.Tag
|
||||
Dim oSelectedReceiver As ReceiverVM = e.Item.Tag
|
||||
Dim oCurrentPage = GDViewer.CurrentPage
|
||||
Dim oCurrentPosition = GDViewer.GetVScrollBarPosition()
|
||||
|
||||
@@ -153,7 +153,7 @@ Partial Public Class frmFieldEditor
|
||||
Me.ResumeLayout()
|
||||
End Sub
|
||||
|
||||
Private Sub SetReceiver(pReceiver As Receiver)
|
||||
Private Sub SetReceiver(pReceiver As ReceiverVM)
|
||||
Dim oBaseCircle As SvgImage = SvgImageCollection1.Item(0)
|
||||
|
||||
txtReceiver.Caption = pReceiver.Name
|
||||
@@ -435,6 +435,4 @@ Partial Public Class frmFieldEditor
|
||||
End Select
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
|
||||
End Class
|
||||
@@ -1,5 +1,4 @@
|
||||
Imports System.ComponentModel
|
||||
Imports System.IdentityModel.Metadata
|
||||
Imports System.IO
|
||||
Imports System.Text
|
||||
Imports DevExpress.LookAndFeel
|
||||
@@ -14,6 +13,7 @@ Imports DigitalData.Modules.Base
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports EnvelopeGenerator.CommonServices
|
||||
Imports EnvelopeGenerator.CommonServices.My
|
||||
Imports EnvelopeGenerator.Domain.Constants
|
||||
Imports EnvelopeGenerator.Domain.Entities
|
||||
|
||||
Public Class frmMain
|
||||
@@ -317,11 +317,11 @@ Public Class frmMain
|
||||
|
||||
Dim oEnvelope As Envelope = ViewEnvelopes.GetRow(e.RowHandle)
|
||||
If oEnvelope.Status = Domain.Constants.EnvelopeStatus.EnvelopePartlySigned Then
|
||||
e.Appearance.BackColor = ColorTranslator.FromHtml(Domain.Constants.GREEN_300)
|
||||
e.Appearance.BackColor = ColorTranslator.FromHtml(Value.GREEN_300)
|
||||
End If
|
||||
|
||||
If oEnvelope.Status = Domain.Constants.EnvelopeStatus.EnvelopeQueued Or oEnvelope.Status = Domain.Constants.EnvelopeStatus.EnvelopeSent Then
|
||||
e.Appearance.BackColor = ColorTranslator.FromHtml(Domain.Constants.ORANGE_300)
|
||||
e.Appearance.BackColor = ColorTranslator.FromHtml(Value.ORANGE_300)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -331,16 +331,16 @@ Public Class frmMain
|
||||
End If
|
||||
|
||||
Dim oView As GridView = DirectCast(sender, GridView)
|
||||
Dim oReceiver As Receiver = oView.GetRow(e.RowHandle)
|
||||
Dim oReceiver As ReceiverVM = oView.GetRow(e.RowHandle)
|
||||
|
||||
If (oReceiver Is Nothing) Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If oReceiver.Status = Domain.Constants.ReceiverStatus.Signed Then
|
||||
e.Appearance.BackColor = ColorTranslator.FromHtml(Domain.Constants.GREEN_300)
|
||||
If oReceiver.Status = ReceiverStatus.Signed Then
|
||||
e.Appearance.BackColor = ColorTranslator.FromHtml(Value.GREEN_300)
|
||||
Else
|
||||
e.Appearance.BackColor = ColorTranslator.FromHtml(Domain.Constants.RED_300)
|
||||
e.Appearance.BackColor = ColorTranslator.FromHtml(Value.RED_300)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -351,11 +351,11 @@ Public Class frmMain
|
||||
|
||||
Dim oEnvelope As Envelope = ViewCompleted.GetRow(e.RowHandle)
|
||||
If oEnvelope.Status = Domain.Constants.EnvelopeStatus.EnvelopeCompletelySigned Then
|
||||
e.Appearance.BackColor = ColorTranslator.FromHtml(Domain.Constants.GREEN_300)
|
||||
e.Appearance.BackColor = ColorTranslator.FromHtml(Value.GREEN_300)
|
||||
End If
|
||||
|
||||
If oEnvelope.Status = Domain.Constants.EnvelopeStatus.EnvelopeDeleted Or oEnvelope.Status = Domain.Constants.EnvelopeStatus.EnvelopeWithdrawn Or oEnvelope.Status = Domain.Constants.EnvelopeStatus.EnvelopeRejected Then
|
||||
e.Appearance.BackColor = ColorTranslator.FromHtml(Domain.Constants.RED_300)
|
||||
e.Appearance.BackColor = ColorTranslator.FromHtml(Value.RED_300)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -365,16 +365,16 @@ Public Class frmMain
|
||||
End If
|
||||
|
||||
Dim oView As GridView = DirectCast(sender, GridView)
|
||||
Dim oReceiver As Receiver = oView.GetRow(e.RowHandle)
|
||||
Dim oReceiver As ReceiverVM = oView.GetRow(e.RowHandle)
|
||||
|
||||
If (oReceiver Is Nothing) Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If oReceiver.Status = Domain.Constants.ReceiverStatus.Signed Then
|
||||
e.Appearance.BackColor = ColorTranslator.FromHtml(Domain.Constants.GREEN_300)
|
||||
e.Appearance.BackColor = ColorTranslator.FromHtml(Value.GREEN_300)
|
||||
Else
|
||||
e.Appearance.BackColor = ColorTranslator.FromHtml(Domain.Constants.RED_300)
|
||||
e.Appearance.BackColor = ColorTranslator.FromHtml(Value.RED_300)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -624,9 +624,8 @@ Public Class frmMain
|
||||
|
||||
Dim oController = New EnvelopeEditorController(State, oEnvelope)
|
||||
Dim Documents As New BindingList(Of EnvelopeDocument)
|
||||
Dim Receivers As New BindingList(Of Receiver)
|
||||
Receivers = New BindingList(Of Receiver)(oController.Envelope.Receivers)
|
||||
For Each oReceiver As Receiver In Receivers
|
||||
Dim Receivers = New BindingList(Of ReceiverVM)(oController.Envelope.Receivers.Select(Function(r) ReceiverVM.From(r)).ToList())
|
||||
For Each oReceiver As ReceiverVM In Receivers
|
||||
If oReceiver.EmailAddress = selReceiver.EmailAddress Then
|
||||
If oController.ActionService.ResendReceiver(oEnvelope, oReceiver) = True Then
|
||||
Dim oMsg = Resources.Envelope.Invitation_successfully_resend.Replace("@Mail", oReceiver.EmailAddress)
|
||||
@@ -873,9 +872,8 @@ Public Class frmMain
|
||||
If oEnvelope.UseAccessCode = True Then
|
||||
Dim oController = New EnvelopeEditorController(State, oEnvelope)
|
||||
Dim Documents As New BindingList(Of EnvelopeDocument)
|
||||
Dim Receivers As New BindingList(Of Receiver)
|
||||
Receivers = New BindingList(Of Receiver)(oController.Envelope.Receivers)
|
||||
For Each oReceiver As Receiver In Receivers
|
||||
Dim Receivers = New BindingList(Of ReceiverVM)(oController.Envelope.Receivers.Select(Function(r) ReceiverVM.From(r)).ToList())
|
||||
For Each oReceiver As ReceiverVM In Receivers
|
||||
If oReceiver.EmailAddress = selReceiver.EmailAddress Then
|
||||
If oController.ActionService.ManuallySendAccessCode(oEnvelope, oReceiver) = True Then
|
||||
Dim oMsg = Resources.Envelope.AccessCode_successfully_send.Replace("@Mail", oReceiver.EmailAddress)
|
||||
|
||||
@@ -69,7 +69,7 @@ public class EnvelopeController : ControllerBase
|
||||
if (envelope.Id is int id)
|
||||
envelopes = envelopes.Where(e => e.Id == id);
|
||||
|
||||
if (envelope.Status is EnvelopeStatus status)
|
||||
if (envelope.Status is EnvelopeStatusQuery status)
|
||||
envelopes = envelopes.Where(e => e.Status == status);
|
||||
|
||||
if (envelope.Uuid is string uuid)
|
||||
|
||||
@@ -17,6 +17,7 @@ using Microsoft.Extensions.Options;
|
||||
using System.Data;
|
||||
using System.Reflection.Metadata;
|
||||
using EnvelopeGenerator.Domain;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.GeneratorAPI.Controllers;
|
||||
|
||||
@@ -104,7 +105,7 @@ public class EnvelopeReceiverController : ControllerBase
|
||||
max_status: envelopeReceiver.Envelope.Status?.Max,
|
||||
envelopeQuery: envelopeReceiver.Envelope,
|
||||
receiverQuery: envelopeReceiver.Receiver,
|
||||
ignore_statuses: envelopeReceiver.Envelope.Status?.Ignore ?? Array.Empty<Constants.EnvelopeStatus>())
|
||||
ignore_statuses: envelopeReceiver.Envelope.Status?.Ignore ?? Array.Empty<EnvelopeStatus>())
|
||||
.ThenAsync(
|
||||
Success: Ok,
|
||||
Fail: IActionResult (msg, ntc) =>
|
||||
@@ -233,22 +234,20 @@ public class EnvelopeReceiverController : ControllerBase
|
||||
SELECT @OUT_SUCCESS as [@OUT_SUCCESS];";
|
||||
|
||||
foreach (var rcv in res.SentReceiver)
|
||||
foreach (var sign in request.Receivers.Where(r => r.EmailAddress == rcv.EmailAddress).FirstOrDefault()?.Signatures ?? Array.Empty<Signature>())
|
||||
foreach (var sign in request.Receivers.Where(r => r.EmailAddress == rcv.EmailAddress).FirstOrDefault()?.Signatures ?? Enumerable.Empty<Signature>())
|
||||
{
|
||||
using (SqlConnection conn = new(_cnnStr))
|
||||
using SqlConnection conn = new(_cnnStr);
|
||||
conn.Open();
|
||||
|
||||
var formattedSQL = string.Format(sql, document.Id.ToSqlParam(), rcv.Id.ToSqlParam(), sign.X.ToSqlParam(), sign.Y.ToSqlParam(), sign.Page.ToSqlParam());
|
||||
|
||||
using SqlCommand cmd = new(formattedSQL, conn);
|
||||
cmd.CommandType = CommandType.Text;
|
||||
|
||||
using SqlDataReader reader = cmd.ExecuteReader();
|
||||
if (reader.Read())
|
||||
{
|
||||
conn.Open();
|
||||
|
||||
var formattedSQL = string.Format(sql, document.Id.ToSqlParam(), rcv.Id.ToSqlParam(), sign.X.ToSqlParam(), sign.Y.ToSqlParam(), sign.Page.ToSqlParam());
|
||||
|
||||
using SqlCommand cmd = new SqlCommand(formattedSQL, conn);
|
||||
cmd.CommandType = CommandType.Text;
|
||||
|
||||
using SqlDataReader reader = cmd.ExecuteReader();
|
||||
if (reader.Read())
|
||||
{
|
||||
bool outSuccess = reader.GetBoolean(0);
|
||||
}
|
||||
bool outSuccess = reader.GetBoolean(0);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -3,9 +3,8 @@ using MediatR;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using EnvelopeGenerator.Domain;
|
||||
using EnvelopeGenerator.Application.Histories.Queries;
|
||||
using EnvelopeGenerator.Application.Extensions;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.GeneratorAPI.Controllers;
|
||||
|
||||
@@ -48,10 +47,10 @@ public class HistoryController : ControllerBase
|
||||
/// <response code="200"></response>
|
||||
[HttpGet("related")]
|
||||
[Authorize]
|
||||
public IActionResult GetReferenceTypes(Constants.ReferenceType? referenceType = null)
|
||||
public IActionResult GetReferenceTypes(ReferenceType? referenceType = null)
|
||||
{
|
||||
return referenceType is null
|
||||
? Ok(_memoryCache.GetEnumAsDictionary<Constants.ReferenceType>("gen.api", Constants.ReferenceType.Unknown))
|
||||
? Ok(_memoryCache.GetEnumAsDictionary<ReferenceType>("gen.api", ReferenceType.Unknown))
|
||||
: Ok(referenceType.ToString());
|
||||
}
|
||||
|
||||
@@ -91,10 +90,10 @@ public class HistoryController : ControllerBase
|
||||
/// <response code="200"></response>
|
||||
[HttpGet("status")]
|
||||
[Authorize]
|
||||
public IActionResult GetEnvelopeStatus([FromQuery] Constants.EnvelopeStatus? status = null)
|
||||
public IActionResult GetEnvelopeStatus([FromQuery] EnvelopeStatus? status = null)
|
||||
{
|
||||
return status is null
|
||||
? Ok(_memoryCache.GetEnumAsDictionary<Constants.EnvelopeStatus>("gen.api", Constants.Status.NonHist, Constants.Status.RelatedToFormApp))
|
||||
? Ok(_memoryCache.GetEnumAsDictionary<EnvelopeStatus>("gen.api", Status.NonHist, Status.RelatedToFormApp))
|
||||
: Ok(status.ToString());
|
||||
}
|
||||
|
||||
|
||||
@@ -844,7 +844,7 @@ namespace EnvelopeGenerator.Infrastructure.Migrations
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("ENVELOPE_ID");
|
||||
|
||||
b.Property<int>("EnvelopeStatus")
|
||||
b.Property<int>("EnvelopeStatusQuery")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("ENVELOPE_STATUS");
|
||||
|
||||
|
||||
@@ -841,7 +841,7 @@ namespace EnvelopeGenerator.Infrastructure.Migrations
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("ENVELOPE_ID");
|
||||
|
||||
b.Property<int>("EnvelopeStatus")
|
||||
b.Property<int>("EnvelopeStatusQuery")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("ENVELOPE_STATUS");
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ using EnvelopeGenerator.Domain.Entities;
|
||||
using EnvelopeGenerator.Application.Interfaces.Repositories;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using static EnvelopeGenerator.Domain.Constants;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Infrastructure.Repositories;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using EnvelopeGenerator.Application.Interfaces.Repositories;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using EnvelopeGenerator.Domain;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Infrastructure.Repositories;
|
||||
|
||||
@@ -13,7 +13,7 @@ public class EnvelopeHistoryRepository : CRUDRepository<EnvelopeHistory, long, E
|
||||
{
|
||||
}
|
||||
|
||||
private IQueryable<EnvelopeHistory> By(int? envelopeId = null, string? userReference = null, Constants.EnvelopeStatus? status = null, bool withSender = false, bool withReceiver = false)
|
||||
private IQueryable<EnvelopeHistory> By(int? envelopeId = null, string? userReference = null, EnvelopeStatus? status = null, bool withSender = false, bool withReceiver = false)
|
||||
{
|
||||
var query = _dbSet.AsNoTracking();
|
||||
|
||||
@@ -35,12 +35,12 @@ public class EnvelopeHistoryRepository : CRUDRepository<EnvelopeHistory, long, E
|
||||
return query;
|
||||
}
|
||||
|
||||
public async Task<int> CountAsync(int? envelopeId = null, string? userReference = null, Constants.EnvelopeStatus? status = null) => await By(
|
||||
public async Task<int> CountAsync(int? envelopeId = null, string? userReference = null, EnvelopeStatus? status = null) => await By(
|
||||
envelopeId: envelopeId,
|
||||
userReference: userReference,
|
||||
status: status).CountAsync();
|
||||
|
||||
public async Task<IEnumerable<EnvelopeHistory>> ReadAsync(int? envelopeId = null, string? userReference = null, Constants.EnvelopeStatus? status = null, bool withSender = false, bool withReceiver = false)
|
||||
public async Task<IEnumerable<EnvelopeHistory>> ReadAsync(int? envelopeId = null, string? userReference = null, EnvelopeStatus? status = null, bool withSender = false, bool withReceiver = false)
|
||||
=> await By(
|
||||
envelopeId: envelopeId,
|
||||
userReference: userReference,
|
||||
|
||||
@@ -3,6 +3,7 @@ using EnvelopeGenerator.Domain.Entities;
|
||||
using EnvelopeGenerator.Application.Interfaces.Repositories;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using EnvelopeGenerator.Domain;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Infrastructure.Repositories;
|
||||
|
||||
@@ -48,7 +49,7 @@ public class EnvelopeRepository : CRUDRepository<Envelope, int, EGDbContext>, IE
|
||||
return await query.FirstOrDefaultAsync();
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<Envelope>> ReadByUserAsync(int userId, Constants.EnvelopeStatus? min_status = null, Constants.EnvelopeStatus? max_status = null, params Constants.EnvelopeStatus[] ignore_statuses)
|
||||
public async Task<IEnumerable<Envelope>> ReadByUserAsync(int userId, EnvelopeStatus? min_status = null, EnvelopeStatus? max_status = null, params EnvelopeStatus[] ignore_statuses)
|
||||
{
|
||||
var query = _dbSet.AsNoTracking().Where(e => e.UserId == userId);
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ using EnvelopeGenerator.Application.Interfaces.Repositories;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using DigitalData.Core.Exceptions;
|
||||
using EnvelopeGenerator.Domain;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Infrastructure.Repositories;
|
||||
|
||||
@@ -80,7 +81,7 @@ public class EnvelopeReceiverRepository : CRUDRepository<EnvelopeReceiver, (int
|
||||
.Select(er => er.AccessCode)
|
||||
.FirstOrDefaultAsync();
|
||||
|
||||
public async Task<IEnumerable<EnvelopeReceiver>> ReadByUsernameAsync(string username, Constants.EnvelopeStatus? min_status = null, Constants.EnvelopeStatus? max_status = null, params Constants.EnvelopeStatus[] ignore_statuses)
|
||||
public async Task<IEnumerable<EnvelopeReceiver>> ReadByUsernameAsync(string username, EnvelopeStatus? min_status = null, EnvelopeStatus? max_status = null, params EnvelopeStatus[] ignore_statuses)
|
||||
{
|
||||
var query = _dbSet.AsNoTracking().Where(er => er.Envelope!.User!.Username == username);
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports EnvelopeGenerator.CommonServices.Jobs
|
||||
Imports EnvelopeGenerator.Domain.Constants
|
||||
Imports Quartz
|
||||
|
||||
Public Class Scheduler_Envelopetask_API
|
||||
@@ -28,8 +29,8 @@ Public Class Scheduler_Envelopetask_API
|
||||
BuildScheduler()
|
||||
Dim oJobKey = New JobKey(JobName)
|
||||
Dim oJobData = New JobDataMap() From {
|
||||
{Domain.Constants.LOGCONFIG, LogConfig},
|
||||
{Domain.Constants.DATABASE, ConnectionString}
|
||||
{Value.LOGCONFIG, LogConfig},
|
||||
{Value.DATABASE, ConnectionString}
|
||||
}
|
||||
|
||||
Logger.Debug("Initialized Job [{0}]", JobName)
|
||||
|
||||
@@ -3,6 +3,7 @@ Imports DigitalData.Modules.Base
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports EnvelopeGenerator.CommonServices.Jobs
|
||||
Imports EnvelopeGenerator.CommonServices.Jobs.FinalizeDocument
|
||||
Imports EnvelopeGenerator.Domain.Constants
|
||||
Imports Quartz
|
||||
|
||||
Public Class Scheduler_FinishEnvelope
|
||||
@@ -37,10 +38,10 @@ Public Class Scheduler_FinishEnvelope
|
||||
|
||||
Dim oJobKey = New JobKey(JobName)
|
||||
Dim oJobData = New JobDataMap() From {
|
||||
{Domain.Constants.GDPICTURE, LicenseKey},
|
||||
{Domain.Constants.LOGCONFIG, LogConfig},
|
||||
{Domain.Constants.DATABASE, ConnectionString},
|
||||
{Domain.Constants.PDF_BURNER_PARAMS, _pdfBurnerParams}
|
||||
{Value.GDPICTURE, LicenseKey},
|
||||
{Value.LOGCONFIG, LogConfig},
|
||||
{Value.DATABASE, ConnectionString},
|
||||
{Value.PDF_BURNER_PARAMS, _pdfBurnerParams}
|
||||
}
|
||||
|
||||
Logger.Debug("Initialized Job [{0}]", JobName)
|
||||
|
||||
@@ -4,6 +4,8 @@ using DigitalData.UserManager.Domain.Entities;
|
||||
using EnvelopeGenerator.Application;
|
||||
using EnvelopeGenerator.Application.EnvelopeReceivers.Commands;
|
||||
using EnvelopeGenerator.Application.Envelopes.Commands;
|
||||
using EnvelopeGenerator.Application.Histories.Commands;
|
||||
using EnvelopeGenerator.Application.Model;
|
||||
using EnvelopeGenerator.Application.Receivers.Commands;
|
||||
using EnvelopeGenerator.Application.Users.Commands;
|
||||
using EnvelopeGenerator.Infrastructure;
|
||||
@@ -14,6 +16,8 @@ using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using QuestPDF.Fluent;
|
||||
using QuestPDF.Infrastructure;
|
||||
using EnvelopeGenerator.Domain;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Tests.Application;
|
||||
|
||||
@@ -128,6 +132,13 @@ public static class Extensions
|
||||
{
|
||||
public static Fake.Host ToFake(this IHost host) => new(host);
|
||||
|
||||
public static T PickEnum<T>(this Faker faker) where T : struct, Enum
|
||||
{
|
||||
var values = Enum.GetValues(typeof(T));
|
||||
var index = faker.Random.Int(0, values.Length - 1);
|
||||
return (T)values.GetValue(index)!;
|
||||
}
|
||||
|
||||
#region Receiver Command
|
||||
public static CreateReceiverCommand CreateReceiverCommand(this Faker fake) => new()
|
||||
{
|
||||
@@ -140,7 +151,7 @@ public static class Extensions
|
||||
.ToList();
|
||||
#endregion
|
||||
|
||||
#region Envelope Command
|
||||
#region Envelope
|
||||
public static CreateEnvelopeCommand CreateEnvelopeCommand(this Faker fake, int userId) => new()
|
||||
{
|
||||
Message = fake.Lorem.Paragraph(fake.Random.Number(2, 5)),
|
||||
@@ -154,7 +165,7 @@ public static class Extensions
|
||||
.ToList();
|
||||
#endregion
|
||||
|
||||
#region Envelope Document
|
||||
#region Document
|
||||
public static string CreatePdfAsBase64(this Faker faker)
|
||||
{
|
||||
string name = faker.Name.FullName();
|
||||
@@ -193,6 +204,20 @@ public static class Extensions
|
||||
.ToList();
|
||||
#endregion
|
||||
|
||||
#region History
|
||||
public static CreateHistoryCommand CreateHistoryCommand<TEnvelopeQuery, TReceiverQuery>(this Faker fake, string key, EnvelopeStatus? status = null)
|
||||
where TEnvelopeQuery : EnvelopeQueryBase
|
||||
where TReceiverQuery : ReceiverQueryBase
|
||||
{
|
||||
return new()
|
||||
{
|
||||
Status = status ?? fake.PickEnum<EnvelopeStatus>(),
|
||||
Comment = fake.Lorem.Sentence(),
|
||||
Key = key,
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region User Command
|
||||
public static CreateUserCommand CreateUserCommand(this Faker fake) => new()
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@ public class HistoryTests
|
||||
{
|
||||
EnvelopeId = 1,
|
||||
UserReference = "UserA",
|
||||
Status = Constants.EnvelopeStatus.EnvelopeCreated,
|
||||
Status = EnvelopeStatus.EnvelopeCreated,
|
||||
Comment = "First create"
|
||||
};
|
||||
|
||||
@@ -55,26 +55,26 @@ public class HistoryTests
|
||||
{
|
||||
EnvelopeId = 2,
|
||||
UserReference = "UserX",
|
||||
Status = Constants.EnvelopeStatus.EnvelopeCreated
|
||||
Status = EnvelopeStatus.EnvelopeCreated
|
||||
};
|
||||
|
||||
var createCmd2 = new CreateHistoryCommand
|
||||
{
|
||||
EnvelopeId = 2,
|
||||
UserReference = "UserX",
|
||||
Status = Constants.EnvelopeStatus.EnvelopePartlySigned
|
||||
Status = EnvelopeStatus.EnvelopePartlySigned
|
||||
};
|
||||
|
||||
await _host.Mediator.Send(createCmd1);
|
||||
await _host.Mediator.Send(createCmd2);
|
||||
|
||||
// Act
|
||||
var result = await _host.Mediator.Send(new ReadHistoryQuery(2, Constants.EnvelopeStatus.EnvelopePartlySigned));
|
||||
var result = await _host.Mediator.Send(new ReadHistoryQuery(2, EnvelopeStatus.EnvelopePartlySigned));
|
||||
|
||||
// Assert
|
||||
Assert.That(result, Has.Exactly(1).Items);
|
||||
Assert.That(result, Has.All.Matches<EnvelopeGenerator.Application.Dto.EnvelopeHistory.EnvelopeHistoryDto>(
|
||||
r => r.Status == Constants.EnvelopeStatus.EnvelopePartlySigned));
|
||||
r => r.Status == EnvelopeStatus.EnvelopePartlySigned));
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -2,14 +2,10 @@
|
||||
using EnvelopeGenerator.CommonServices;
|
||||
using EnvelopeGenerator.Web.Services;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using EnvelopeGenerator.Application.Extensions;
|
||||
using EnvelopeGenerator.Application.Interfaces.Services;
|
||||
using static EnvelopeGenerator.Domain.Constants;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
namespace EnvelopeGenerator.Web.Controllers;
|
||||
|
||||
[Authorize(Roles = ReceiverRole.FullyAuth)]
|
||||
[Authorize(Roles = Domain.Constants.ReceiverRole.FullyAuth)]
|
||||
[Route("api/[controller]")]
|
||||
public class DocumentController : BaseController
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@ using Microsoft.AspNetCore.Mvc;
|
||||
using System.Text.Encodings.Web;
|
||||
using EnvelopeGenerator.Application.Extensions;
|
||||
using EnvelopeGenerator.Application.Interfaces.Services;
|
||||
using static EnvelopeGenerator.Domain.Constants;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using DigitalData.Core.Abstraction.Application.DTO;
|
||||
using EnvelopeGenerator.Web.Extensions;
|
||||
|
||||
@@ -9,18 +9,16 @@ using EnvelopeGenerator.Application.Resources;
|
||||
using EnvelopeGenerator.Application.Extensions;
|
||||
using EnvelopeGenerator.Web.Extensions;
|
||||
using EnvelopeGenerator.Web.Models;
|
||||
using Ganss.Xss;
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
using Microsoft.AspNetCore.Authentication.Cookies;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Localization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using Newtonsoft.Json;
|
||||
using OtpNet;
|
||||
using System.Security.Claims;
|
||||
using static EnvelopeGenerator.Domain.Constants;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Web.Controllers;
|
||||
|
||||
@@ -231,7 +229,7 @@ public class HomeController : ViewControllerBase
|
||||
//check the access code verification
|
||||
if (er_secret.AccessCode != auth.AccessCode)
|
||||
{
|
||||
//Constants.EnvelopeStatus.AccessCodeIncorrect
|
||||
//EnvelopeStatusQuery.AccessCodeIncorrect
|
||||
await _historyService.RecordAsync(er_secret.EnvelopeId, er_secret.Receiver!.EmailAddress, EnvelopeStatus.AccessCodeIncorrect);
|
||||
Response.StatusCode = StatusCodes.Status401Unauthorized;
|
||||
return View("EnvelopeLocked")
|
||||
|
||||
@@ -4,7 +4,7 @@ using EnvelopeGenerator.Application.Dto.EnvelopeReceiverReadOnly;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
using static EnvelopeGenerator.Domain.Constants;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
using EnvelopeGenerator.Web.Extensions;
|
||||
|
||||
namespace EnvelopeGenerator.Web.Controllers
|
||||
|
||||
@@ -4,14 +4,13 @@ using Microsoft.AspNetCore.Mvc;
|
||||
using EnvelopeGenerator.Application.Extensions;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using EnvelopeGenerator.Application.Resources;
|
||||
using EnvelopeGenerator.Application.Extensions;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Authentication.Cookies;
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
using EnvelopeGenerator.Application.Interfaces.Services;
|
||||
using DigitalData.Core.Abstraction.Application.DTO;
|
||||
using static EnvelopeGenerator.Domain.Constants;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
using EnvelopeGenerator.Web.Extensions;
|
||||
|
||||
namespace EnvelopeGenerator.Web.Controllers;
|
||||
|
||||
@@ -3,7 +3,7 @@ using EnvelopeGenerator.Application.Interfaces.Services;
|
||||
using EnvelopeGenerator.Application.Dto;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using static EnvelopeGenerator.Domain.Constants;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Web.Controllers.Test;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ using EnvelopeGenerator.Application.Interfaces.Services;
|
||||
using EnvelopeGenerator.Application.Dto.EnvelopeHistory;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using static EnvelopeGenerator.Domain.Constants;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Web.Controllers.Test;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
@using EnvelopeGenerator.CommonServices;
|
||||
@using EnvelopeGenerator.Domain.Entities;
|
||||
@using static EnvelopeGenerator.Domain.Constants;
|
||||
@using EnvelopeGenerator.Domain.Constants;
|
||||
@{
|
||||
ViewData["Title"] = "Debug";
|
||||
}
|
||||
@@ -8,8 +8,8 @@
|
||||
@functions {
|
||||
string encodeEnvelopeKey(Envelope envelope)
|
||||
{
|
||||
var receiver = envelope.Receivers.First();
|
||||
return Helpers.EncodeEnvelopeReceiverId(envelope.Uuid, receiver.Receiver.Signature);
|
||||
var receiver = envelope.Receivers!.First();
|
||||
return Helpers.EncodeEnvelopeReceiverId(envelope.Uuid, receiver.Receiver!.Signature);
|
||||
}
|
||||
|
||||
IEnumerable<IGrouping<EnvelopeStatus, Envelope>> groupEnvelopes(List<Envelope> envelopes)
|
||||
|
||||
@@ -33,6 +33,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "presentation", "presentatio
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EnvelopeGenerator.Terminal", "EnvelopeGenerator.Terminal\EnvelopeGenerator.Terminal.csproj", "{A9F9B431-BB9B-49B8-9E2C-0703634A653A}"
|
||||
EndProject
|
||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "EnvelopeGenerator.Form", "EnvelopeGenerator.Form\EnvelopeGenerator.Form.vbproj", "{6D56C01F-D6CB-4D8A-BD3D-4FD34326998C}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -79,6 +81,10 @@ Global
|
||||
{A9F9B431-BB9B-49B8-9E2C-0703634A653A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A9F9B431-BB9B-49B8-9E2C-0703634A653A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A9F9B431-BB9B-49B8-9E2C-0703634A653A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{6D56C01F-D6CB-4D8A-BD3D-4FD34326998C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{6D56C01F-D6CB-4D8A-BD3D-4FD34326998C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{6D56C01F-D6CB-4D8A-BD3D-4FD34326998C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{6D56C01F-D6CB-4D8A-BD3D-4FD34326998C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@@ -97,6 +103,7 @@ Global
|
||||
{02EA681E-C7D8-13C7-8484-4AC65E1B71E8} = {134D4164-B291-4E19-99B9-E4FA3AFAB62C}
|
||||
{E3C758DC-914D-4B7E-8457-0813F1FDB0CB} = {134D4164-B291-4E19-99B9-E4FA3AFAB62C}
|
||||
{A9F9B431-BB9B-49B8-9E2C-0703634A653A} = {E3C758DC-914D-4B7E-8457-0813F1FDB0CB}
|
||||
{6D56C01F-D6CB-4D8A-BD3D-4FD34326998C} = {E3C758DC-914D-4B7E-8457-0813F1FDB0CB}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {73E60370-756D-45AD-A19A-C40A02DACCC7}
|
||||
|
||||
Reference in New Issue
Block a user