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