Compare commits

...

8 Commits

Author SHA1 Message Date
Developer 02
bdf2527fc1 Refactor using directives and add User entity
- Updated `using` directives in `Config.cs` and `EnvelopeType.cs` to include additional namespaces and removed `DigitalData.Core.Abstractions`.
- Adjusted formatting for `StatusName` and `IsAlreadySent` properties in `Envelope.cs` for consistency.
- Simplified `User` property in `Envelope.cs` by removing the namespace prefix.
- Introduced a new `User` class in `User.cs` with various properties and data annotations for database mapping.
- Removed the `<Nullable>` property from `EnvelopeGenerator.Domain.csproj`, which may impact nullability handling.
2025-05-16 09:56:44 +02:00
Developer 02
1a69478f48 Refactor entity classes for non-nullable properties
Removed nullable types and `init` properties, replacing them with standard getters and setters in various entity classes. Updated properties like `DocumentPath`, `SendingProfile`, and `SignatureHost` to be non-nullable and added required attributes.

Modified the project file to include `net462` as a target framework and added a reference for `System.ComponentModel.Annotations`. Removed the `IUnique<int>` interface from several classes to simplify uniqueness management.

These changes improve data integrity and usability across the entity classes.
2025-05-14 09:16:02 +02:00
Developer 02
83d29bf78d Add EmailProfilerDispatcher and enhance logging
Included the DigitalData.EmailProfilerDispatcher namespace in Program.cs for email profiling functionality. Removed Microsoft.Extensions.DependencyInjection namespace to streamline dependency management. Enhanced logging configuration by adding EnableDetailedErrors() for improved error messages during development while retaining EnableSensitiveDataLogging().
2025-05-13 13:44:13 +02:00
Developer 02
bc45aadf27 Refactor RecordAsync object initialization
Updated the `RecordAsync` method in the `EnvelopeHistoryService` class to use an explicit object initializer with braces for creating a new object in the `CreateAsync` method. This change improves code clarity while maintaining the same functionality.
2025-05-13 11:21:01 +02:00
Developer 02
7e66cd4dae Refactor DTOs for improved structure and documentation
Transitioned from records to classes for flexibility, added XML documentation for clarity, and updated property definitions to use standard getters and setters. Introduced the `required` keyword for essential properties, removed unnecessary constructors, and enhanced property descriptions for better readability. Additionally, overridden `GetHashCode` in `ReceiverReadDto` for proper collection behavior.
2025-05-13 11:05:43 +02:00
Developer 02
cc11d70a27 Refactor DTOs to classes with enhanced properties
Changed `EnvelopeReceiverReadOnlyDto` and `EnvelopeReceiverReadOnlyUpdateDto` from records to classes, converting properties to standard get/set accessors and adding documentation comments. Introduced a default value for `ChangedWhen` in `EnvelopeReceiverReadOnlyUpdateDto`.

Modified `ReceiverCreateDto` to a class structure, updating properties to use init-only accessors and encapsulating SHA256 hash logic in a private field. Retained the `AddedWhen` property with its default value.
2025-05-13 09:56:56 +02:00
Developer 02
02aeaea8a9 Refactor EnvelopeHistoryDto to use properties
The EnvelopeHistoryDto class has been changed from a record type with positional parameters to a traditional class structure with explicit properties. This refactor improves readability and maintainability, and includes XML documentation for each property. The GetHashCode method has also been overridden to ensure uniqueness based on the Id property.
2025-05-12 16:36:21 +02:00
Developer 02
05867cc645 Update DIExtensions for enhanced DbContext configuration
Modified the `AddEnvelopeGeneratorInfrastructureServices` method to accept a service provider, allowing for more complex DbContext configurations. Added a using directive for `Microsoft.Extensions.DependencyInjection` in `Program.cs`. Updated the method call to utilize the new signature, enabling logging of SQL commands and sensitive data during database operations.
2025-05-12 16:35:48 +02:00
34 changed files with 908 additions and 379 deletions

View File

@@ -3,19 +3,45 @@ using Microsoft.AspNetCore.Mvc;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json.Serialization; using System.Text.Json.Serialization;
namespace EnvelopeGenerator.Application.DTOs namespace EnvelopeGenerator.Application.DTOs;
/// <summary>
/// Data Transfer Object representing configuration settings.
/// </summary>
[ApiExplorerSettings(IgnoreApi = true)]
public class ConfigDto : IUnique<int>
{ {
[ApiExplorerSettings(IgnoreApi = true)] /// <summary>
public record ConfigDto( /// Gets or sets the path to the document.
string DocumentPath, /// </summary>
int SendingProfile, public string DocumentPath { get; set; }
string SignatureHost,
string ExternalProgramName, /// <summary>
string ExportPath) : IUnique<int> /// Gets or sets the sending profile identifier.
{ /// </summary>
[NotMapped] public int SendingProfile { get; set; }
[JsonIgnore]
[Obsolete("Configuration does not have an ID; it represents a single table in the database.")] /// <summary>
public int Id => throw new InvalidOperationException("This configuration does not support an ID as it represents a single row in the database."); /// Gets or sets the signature host URL or name.
}; /// </summary>
public string SignatureHost { get; set; }
/// <summary>
/// Gets or sets the name of the external program.
/// </summary>
public string ExternalProgramName { get; set; }
/// <summary>
/// Gets or sets the path where exports will be saved.
/// </summary>
public string ExportPath { get; set; }
/// <summary>
/// Gets the ID of the configuration.
/// This DTO represents a single row in the database and does not support an ID.
/// </summary>
[NotMapped]
[JsonIgnore]
[Obsolete("Configuration does not have an ID; it represents a single table in the database.")]
public int Id => throw new InvalidOperationException("This configuration does not support an ID as it represents a single row in the database.");
} }

View File

@@ -1,26 +1,96 @@
using DigitalData.Core.Abstractions; using DigitalData.Core.Abstractions;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs namespace EnvelopeGenerator.Application.DTOs;
/// <summary>
/// Data Transfer Object representing a positioned element assigned to a document receiver.
/// </summary>
[ApiExplorerSettings(IgnoreApi = true)]
public class DocumentReceiverElementDto : IUnique<int>
{ {
[ApiExplorerSettings(IgnoreApi = true)] /// <summary>
public record DocumentReceiverElementDto( /// Gets or sets the unique identifier of the element.
int Id, /// </summary>
int DocumentId, public int Id { get; set; }
int ReceiverId,
int ElementType, /// <summary>
double X, /// Gets or sets the identifier of the associated document.
double Y, /// </summary>
double Width, public int DocumentId { get; set; }
double Height,
int Page, /// <summary>
bool Required, /// Gets or sets the identifier of the receiver.
string? Tooltip, /// </summary>
bool ReadOnly, public int ReceiverId { get; set; }
int AnnotationIndex,
DateTime AddedWhen, /// <summary>
DateTime? ChangedWhen, /// Gets or sets the type of the element.
double Top, /// </summary>
double Left public int ElementType { get; set; }
): IUnique<int>;
/// <summary>
/// Gets or sets the X coordinate of the element.
/// </summary>
public double X { get; set; }
/// <summary>
/// Gets or sets the Y coordinate of the element.
/// </summary>
public double Y { get; set; }
/// <summary>
/// Gets or sets the width of the element.
/// </summary>
public double Width { get; set; }
/// <summary>
/// Gets or sets the height of the element.
/// </summary>
public double Height { get; set; }
/// <summary>
/// Gets or sets the page number where the element appears.
/// </summary>
public int Page { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the element is required.
/// </summary>
public bool Required { get; set; }
/// <summary>
/// Gets or sets the tooltip text for the element.
/// </summary>
public string? Tooltip { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the element is read-only.
/// </summary>
public bool ReadOnly { get; set; }
/// <summary>
/// Gets or sets the annotation index for ordering or reference.
/// </summary>
public int AnnotationIndex { get; set; }
/// <summary>
/// Gets or sets the timestamp when the element was added.
/// </summary>
public DateTime AddedWhen { get; set; }
/// <summary>
/// Gets or sets the timestamp when the element was last changed, if applicable.
/// </summary>
public DateTime? ChangedWhen { get; set; }
/// <summary>
/// Gets or sets the top position of the element (in layout terms).
/// </summary>
public double Top { get; set; }
/// <summary>
/// Gets or sets the left position of the element (in layout terms).
/// </summary>
public double Left { get; set; }
} }

View File

@@ -1,18 +1,51 @@
using DigitalData.Core.Abstractions; using DigitalData.Core.Abstractions;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs namespace EnvelopeGenerator.Application.DTOs;
/// <summary>
/// Data Transfer Object representing the status of a document for a specific receiver.
/// </summary>
[ApiExplorerSettings(IgnoreApi = true)]
public class DocumentStatusDto : IUnique<int>
{ {
[ApiExplorerSettings(IgnoreApi = true)] /// <summary>
public record DocumentStatusDto( /// Gets or sets the unique identifier of the document status entry.
int Id, /// </summary>
int EnvelopeId, public int Id { get; set; }
int ReceiverId,
int Status, /// <summary>
DateTime? StatusChangedWhen, /// Gets or sets the ID of the associated envelope.
DateTime AddedWhen, /// </summary>
DateTime? ChangedWhen) : IUnique<int> public int EnvelopeId { get; set; }
{
public string? Value { get; set; } /// <summary>
}; /// Gets or sets the ID of the receiver associated with this status.
/// </summary>
public int ReceiverId { get; set; }
/// <summary>
/// Gets or sets the current status code.
/// </summary>
public int Status { get; set; }
/// <summary>
/// Gets or sets the timestamp when the status was changed.
/// </summary>
public DateTime? StatusChangedWhen { get; set; }
/// <summary>
/// Gets or sets the timestamp when this record was added.
/// </summary>
public DateTime AddedWhen { get; set; }
/// <summary>
/// Gets or sets the timestamp when this record was last changed.
/// </summary>
public DateTime? ChangedWhen { get; set; }
/// <summary>
/// Gets or sets the display value associated with the status.
/// </summary>
public string? Value { get; set; }
} }

View File

@@ -1,16 +1,51 @@
using DigitalData.Core.Abstractions; using DigitalData.Core.Abstractions;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs namespace EnvelopeGenerator.Application.DTOs;
/// <summary>
/// Data Transfer Object representing certificate information for an envelope.
/// </summary>
[ApiExplorerSettings(IgnoreApi = true)]
public class EnvelopeCertificateDto : IUnique<int>
{ {
[ApiExplorerSettings(IgnoreApi = true)] /// <summary>
public record EnvelopeCertificateDto( /// Gets the unique identifier of the certificate.
int Id, /// </summary>
int EnvelopeId, public int Id { get; init; }
string EnvelopeUuid,
string EnvelopeSubject, /// <summary>
int CreatorId, /// Gets the envelope ID associated with the certificate.
string CreatorName, /// </summary>
string CreatorEmail, public int EnvelopeId { get; init; }
int EnvelopeStatus) : IUnique<int>;
/// <summary>
/// Gets the UUID of the envelope.
/// </summary>
public string EnvelopeUuid { get; init; }
/// <summary>
/// Gets the subject of the envelope.
/// </summary>
public string EnvelopeSubject { get; init; }
/// <summary>
/// Gets the ID of the creator of the envelope.
/// </summary>
public int CreatorId { get; init; }
/// <summary>
/// Gets the name of the creator.
/// </summary>
public string CreatorName { get; init; }
/// <summary>
/// Gets the email address of the creator.
/// </summary>
public string CreatorEmail { get; init; }
/// <summary>
/// Gets the current status of the envelope.
/// </summary>
public int EnvelopeStatus { get; init; }
} }

View File

@@ -1,15 +1,36 @@
using DigitalData.Core.Abstractions; using DigitalData.Core.Abstractions;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs namespace EnvelopeGenerator.Application.DTOs;
/// <summary>
/// Data Transfer Object representing a document within an envelope, including optional binary data and form elements.
/// </summary>
[ApiExplorerSettings(IgnoreApi = true)]
public class EnvelopeDocumentDto : IUnique<int>
{ {
[ApiExplorerSettings(IgnoreApi = true)] /// <summary>
public record EnvelopeDocumentDto /// Gets or sets the unique identifier of the document.
( /// </summary>
int Id, public int Id { get; set; }
int EnvelopeId,
DateTime AddedWhen, /// <summary>
byte[]? ByteData = null, /// Gets or sets the envelope ID to which the document belongs.
IEnumerable<DocumentReceiverElementDto>? Elements = null /// </summary>
) : IUnique<int>; public int EnvelopeId { get; set; }
}
/// <summary>
/// Gets or sets the date and time when the document was added.
/// </summary>
public DateTime AddedWhen { get; set; }
/// <summary>
/// Gets or sets the binary data of the document, if available.
/// </summary>
public byte[]? ByteData { get; set; }
/// <summary>
/// Gets or sets the collection of elements associated with the document for receiver interactions, if any.
/// </summary>
public IEnumerable<DocumentReceiverElementDto>? Elements { get; set; }
}

View File

@@ -4,53 +4,52 @@ using DigitalData.UserManager.Application.DTOs.User;
using EnvelopeGenerator.Domain.Entities; using EnvelopeGenerator.Domain.Entities;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs namespace EnvelopeGenerator.Application.DTOs;
[ApiExplorerSettings(IgnoreApi = true)]
public record EnvelopeDto : IUnique<int>
{ {
[ApiExplorerSettings(IgnoreApi = true)] public int Id { get; set; }
public record EnvelopeDto() : IUnique<int>
{
public int Id { get; set; }
public int UserId { get; set; } public int UserId { get; set; }
public int Status { get; set; } public int Status { get; set; }
public string StatusName { get; set; } public string StatusName { get; set; }
public string Uuid { get; set; } public string Uuid { get; set; }
[TemplatePlaceholder("[MESSAGE]")] [TemplatePlaceholder("[MESSAGE]")]
public string Message { get; set; } public string Message { get; set; }
public DateTime AddedWhen { get; set; } public DateTime AddedWhen { get; set; }
public DateTime? ChangedWhen { get; set; } public DateTime? ChangedWhen { get; set; }
[TemplatePlaceholder("[DOCUMENT_TITLE]")] [TemplatePlaceholder("[DOCUMENT_TITLE]")]
public string Title { get; set; } public string Title { get; set; }
public int? ContractType { get; set; } public int? ContractType { get; set; }
public string Language { get; set; } public string Language { get; set; }
public int? EnvelopeTypeId { get; set; } public int? EnvelopeTypeId { get; set; }
public int? CertificationType { get; set; } public int? CertificationType { get; set; }
public bool? UseAccessCode { get; set; } public bool? UseAccessCode { get; set; }
public bool TFAEnabled { get; init; } public bool TFAEnabled { get; init; }
public UserReadDto? User { get; set; } public UserReadDto? User { get; set; }
public EnvelopeType? EnvelopeType { get; set; } public EnvelopeType? EnvelopeType { get; set; }
public string? EnvelopeTypeTitle { get; set; } public string? EnvelopeTypeTitle { get; set; }
public bool IsAlreadySent { get; set; } public bool IsAlreadySent { get; set; }
public byte[]? DocResult { get; init; } public byte[]? DocResult { get; init; }
public IEnumerable<EnvelopeDocumentDto>? Documents { get; set; } public IEnumerable<EnvelopeDocumentDto>? Documents { get; set; }
}
} }

View File

@@ -1,12 +1,34 @@
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs.EnvelopeHistory namespace EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
/// <summary>
/// Data Transfer Object for creating a new envelope history record.
/// </summary>
public class EnvelopeHistoryCreateDto
{ {
[ApiExplorerSettings(IgnoreApi = true)] /// <summary>
public record EnvelopeHistoryCreateDto( /// Gets or sets the identifier of the envelope.
int EnvelopeId, /// </summary>
string UserReference, public int EnvelopeId { get; set; }
int Status,
DateTime? ActionDate, /// <summary>
string? Comment = null); /// Gets or sets the user reference associated with the action.
/// </summary>
public required string UserReference { get; set; }
/// <summary>
/// Gets or sets the status of the envelope at the time of the action.
/// </summary>
public int Status { get; set; }
/// <summary>
/// Gets or sets the date and time when the action occurred.
/// </summary>
public DateTime? ActionDate { get; set; }
/// <summary>
/// Gets or sets an optional comment related to the action.
/// </summary>
public string? Comment { get; set; }
} }

View File

@@ -1,36 +1,73 @@
using DigitalData.Core.Abstractions; using DigitalData.Core.Abstractions;
using DigitalData.Core.DTO;
using DigitalData.UserManager.Application.DTOs.User; using DigitalData.UserManager.Application.DTOs.User;
using EnvelopeGenerator.Application.DTOs.Receiver; using EnvelopeGenerator.Application.DTOs.Receiver;
using Microsoft.AspNetCore.Mvc;
using static EnvelopeGenerator.Common.Constants; using static EnvelopeGenerator.Common.Constants;
namespace EnvelopeGenerator.Application.DTOs.EnvelopeHistory; namespace EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
/// <summary> /// <summary>
/// /// Data Transfer Object representing the history of an envelope, including status, sender, receiver, and related metadata.
/// </summary> /// </summary>
/// <param name="Id"></param> public record EnvelopeHistoryDto : IUnique<long>
/// <param name="EnvelopeId"></param> {
/// <param name="UserReference"></param> /// <summary>
/// <param name="Status"></param> /// Unique identifier for the envelope history entry.
/// <param name="StatusName"></param> /// </summary>
/// <param name="AddedWhen"></param> public long Id { get; set; }
/// <param name="ActionDate"></param>
/// <param name="Sender"></param> /// <summary>
/// <param name="Receiver"></param> /// Identifier of the associated envelope.
/// <param name="ReferenceType"></param> /// </summary>
/// <param name="Comment"></param> public int EnvelopeId { get; set; }
[ApiExplorerSettings(IgnoreApi = true)]
public record EnvelopeHistoryDto( /// <summary>
long Id, /// Reference string for the user related to this history entry.
int EnvelopeId, /// </summary>
string UserReference, public string UserReference { get; set; }
int Status,
string? StatusName, /// <summary>
DateTime AddedWhen, /// Status code of the envelope at this history point.
DateTime? ActionDate, /// </summary>
UserCreateDto? Sender, public int Status { get; set; }
ReceiverReadDto? Receiver,
ReferenceType ReferenceType, /// <summary>
string? Comment = null) : BaseDTO<long>(Id), IUnique<long>; /// Human-readable name of the status.
/// </summary>
public string? StatusName { get; set; }
/// <summary>
/// Date and time when this history entry was added.
/// </summary>
public DateTime AddedWhen { get; set; }
/// <summary>
/// Date and time when an action was performed, if applicable.
/// </summary>
public DateTime? ActionDate { get; set; }
/// <summary>
/// Information about the sender associated with this history entry.
/// </summary>
public UserCreateDto? Sender { get; set; }
/// <summary>
/// Information about the receiver associated with this history entry.
/// </summary>
public ReceiverReadDto? Receiver { get; set; }
/// <summary>
/// Type of reference for this history entry.
/// </summary>
public ReferenceType ReferenceType { get; set; }
/// <summary>
/// Optional comment related to this history entry.
/// </summary>
public string? Comment { get; set; }
/// <inheritdoc/>
public override int GetHashCode()
{
return Id.GetHashCode();
}
};

View File

@@ -1,18 +1,62 @@
using EnvelopeGenerator.Application.DTOs.Receiver; using EnvelopeGenerator.Application.DTOs.Receiver;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
/// <summary>
/// Represents a read-only Data Transfer Object (DTO) for an envelope receiver.
/// Contains information about the receiver, associated envelope, and audit details.
/// </summary>
[ApiExplorerSettings(IgnoreApi = true)]
public class EnvelopeReceiverReadOnlyDto
{ {
[ApiExplorerSettings(IgnoreApi = true)] /// <summary>
public record EnvelopeReceiverReadOnlyDto( /// Gets or inits the unique identifier of the envelope receiver.
long Id, /// </summary>
long EnvelopeId, public long Id { get; init; }
string ReceiverMail,
DateTime DateValid, /// <summary>
DateTime AddedWhen, /// Gets or inits the identifier of the associated envelope.
string AddedWho, /// </summary>
EnvelopeDto? Envelope = null, public long EnvelopeId { get; init; }
string? ChangedWho = null,
DateTime? ChangedWhen = null, /// <summary>
ReceiverReadDto? Receiver = null); /// Gets or inits the email address of the receiver.
/// </summary>
public string ReceiverMail { get; set; }
/// <summary>
/// Gets or inits the date until which the receiver is valid.
/// </summary>
public DateTime DateValid { get; set; }
/// <summary>
/// Gets or inits the date and time when the receiver was added.
/// </summary>
public DateTime AddedWhen { get; init; }
/// <summary>
/// Gets or inits the user who added the receiver.
/// </summary>
public string AddedWho { get; init; }
/// <summary>
/// Gets or inits the associated envelope details.
/// </summary>
public EnvelopeDto? Envelope { get; set; }
/// <summary>
/// Gets or inits the user who last changed the receiver, if any.
/// </summary>
public string? ChangedWho { get; set; }
/// <summary>
/// Gets or inits the date and time when the receiver was last changed, if any.
/// </summary>
public DateTime? ChangedWhen { get; set; }
/// <summary>
/// Gets or inits the associated receiver details.
/// </summary>
public ReceiverReadDto? Receiver { get; set; }
} }

View File

@@ -1,14 +1,31 @@
using DigitalData.Core.Abstractions; using DigitalData.Core.Abstractions;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
/// <summary>
/// Data Transfer Object for updating a read-only envelope receiver.
/// </summary>
[ApiExplorerSettings(IgnoreApi = true)]
public class EnvelopeReceiverReadOnlyUpdateDto : IUnique<long>
{ {
[ApiExplorerSettings(IgnoreApi = true)] /// <summary>
public record EnvelopeReceiverReadOnlyUpdateDto( /// Gets or sets the unique identifier of the envelope receiver.
long Id, /// </summary>
DateTime DateValid, public long Id { get; init; }
string ChangedWho) : IUnique<long>
{ /// <summary>
public DateTime ChangedWhen { get; } = DateTime.Now; /// Gets or sets the date when the envelope receiver becomes valid.
}; /// </summary>
public DateTime DateValid { get; set; }
/// <summary>
/// Gets or sets the name of the user who made the change.
/// </summary>
public string ChangedWho { get; set; }
/// <summary>
/// Gets or sets the date and time when the change was made.
/// </summary>
public DateTime ChangedWhen { get; set; } = DateTime.Now;
} }

View File

@@ -1,23 +1,86 @@
using DigitalData.Core.Abstractions; using DigitalData.Core.Abstractions;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs namespace EnvelopeGenerator.Application.DTOs;
/// <summary>
/// Data Transfer Object representing a type of envelope with its configuration settings.
/// </summary>
[ApiExplorerSettings(IgnoreApi = true)]
public class EnvelopeTypeDto : IUnique<int>
{ {
[ApiExplorerSettings(IgnoreApi = true)] /// <summary>
public record EnvelopeTypeDto( /// Gets or sets the unique identifier of the envelope type.
int Id, /// </summary>
string Title, public int Id { get; set; }
string Language,
int? ExpiresDays, /// <summary>
int? CertificationType, /// Gets or sets the title of the envelope type.
bool? UseAccessCode, /// </summary>
int? FinalEmailToCreator, public string Title { get; set; }
int? FinalEmailToReceivers,
DateTime AddedWhen, /// <summary>
DateTime? ChangedWhen, /// Gets or sets the language code used in this envelope type.
int? ExpiresWarningDays, /// </summary>
bool? SendReminderEmails, public string Language { get; set; }
int? FirstReminderDays,
int? ReminderIntervalDays, /// <summary>
int? ContractType) : IUnique<int>; /// Gets or sets the number of days after which the envelope expires.
/// </summary>
public int? ExpiresDays { get; set; }
/// <summary>
/// Gets or sets the certification type identifier.
/// </summary>
public int? CertificationType { get; set; }
/// <summary>
/// Gets or sets a value indicating whether an access code is required.
/// </summary>
public bool? UseAccessCode { get; set; }
/// <summary>
/// Gets or sets the final email template ID to be sent to the creator.
/// </summary>
public int? FinalEmailToCreator { get; set; }
/// <summary>
/// Gets or sets the final email template ID to be sent to the receivers.
/// </summary>
public int? FinalEmailToReceivers { get; set; }
/// <summary>
/// Gets or sets the timestamp when this envelope type was added.
/// </summary>
public DateTime AddedWhen { get; set; }
/// <summary>
/// Gets or sets the timestamp when this envelope type was last changed.
/// </summary>
public DateTime? ChangedWhen { get; set; }
/// <summary>
/// Gets or sets the number of days before expiry when a warning should be sent.
/// </summary>
public int? ExpiresWarningDays { get; set; }
/// <summary>
/// Gets or sets a value indicating whether reminder emails should be sent.
/// </summary>
public bool? SendReminderEmails { get; set; }
/// <summary>
/// Gets or sets the number of days before the first reminder is sent.
/// </summary>
public int? FirstReminderDays { get; set; }
/// <summary>
/// Gets or sets the interval in days between reminder emails.
/// </summary>
public int? ReminderIntervalDays { get; set; }
/// <summary>
/// Gets or sets the contract type associated with the envelope type.
/// </summary>
public int? ContractType { get; set; }
} }

View File

@@ -3,21 +3,30 @@ using System.ComponentModel.DataAnnotations;
using System.Security.Cryptography; using System.Security.Cryptography;
using System.Text; using System.Text;
namespace EnvelopeGenerator.Application.DTOs.Receiver namespace EnvelopeGenerator.Application.DTOs.Receiver;
{
[ApiExplorerSettings(IgnoreApi = true)]
public record ReceiverCreateDto([EmailAddress] string EmailAddress, string? TotpSecretkey = null)
{
public string Signature => sha256HexOfMail.Value;
private readonly Lazy<string> sha256HexOfMail = new(() => [ApiExplorerSettings(IgnoreApi = true)]
public record ReceiverCreateDto
{
public ReceiverCreateDto()
{
_sha256HexOfMail = new(() =>
{ {
var bytes_arr = Encoding.UTF8.GetBytes(EmailAddress.ToUpper()); var bytes_arr = Encoding.UTF8.GetBytes(EmailAddress.ToUpper());
var hash_arr = SHA256.HashData(bytes_arr); var hash_arr = SHA256.HashData(bytes_arr);
var hexa_str = BitConverter.ToString(hash_arr); var hexa_str = BitConverter.ToString(hash_arr);
return hexa_str.Replace("-", string.Empty); return hexa_str.Replace("-", string.Empty);
}); });
}
public DateTime AddedWhen { get; } = DateTime.Now; [EmailAddress]
}; public required string EmailAddress { get; init; }
}
public string? TotpSecretkey { get; init; }
public string Signature => _sha256HexOfMail.Value;
private readonly Lazy<string> _sha256HexOfMail;
public DateTime AddedWhen { get; } = DateTime.Now;
};

View File

@@ -1,5 +1,4 @@
using DigitalData.Core.Abstractions; using DigitalData.Core.Abstractions;
using DigitalData.Core.DTO;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver; using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using System.Text.Json.Serialization; using System.Text.Json.Serialization;
@@ -7,19 +6,27 @@ using System.Text.Json.Serialization;
namespace EnvelopeGenerator.Application.DTOs.Receiver; namespace EnvelopeGenerator.Application.DTOs.Receiver;
[ApiExplorerSettings(IgnoreApi = true)] [ApiExplorerSettings(IgnoreApi = true)]
public record ReceiverReadDto( public class ReceiverReadDto : IUnique<int>
int Id,
string EmailAddress,
string Signature,
DateTime AddedWhen
) : BaseDTO<int>(Id), IUnique<int>
{ {
public int Id { get; set; }
public string EmailAddress { get; set; }
public string Signature { get; set; }
public DateTime AddedWhen { get; set; }
[JsonIgnore] [JsonIgnore]
public IEnumerable<EnvelopeReceiverBasicDto>? EnvelopeReceivers { get; init; } public IEnumerable<EnvelopeReceiverBasicDto>? EnvelopeReceivers { get; set; }
public string? LastUsedName => EnvelopeReceivers?.LastOrDefault()?.Name; public string? LastUsedName => EnvelopeReceivers?.LastOrDefault()?.Name;
public string? TotpSecretkey { get; set; } = null; public string? TotpSecretkey { get; set; } = null;
public DateTime? TfaRegDeadline { get; set; } public DateTime? TfaRegDeadline { get; set; }
};
public override int GetHashCode()
{
return Id.GetHashCode();
}
}

View File

@@ -3,5 +3,26 @@ using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs.Receiver; namespace EnvelopeGenerator.Application.DTOs.Receiver;
/// <summary>
/// Data Transfer Object for updating a receiver's information.
/// </summary>
[ApiExplorerSettings(IgnoreApi = true)] [ApiExplorerSettings(IgnoreApi = true)]
public record ReceiverUpdateDto(int Id, string? TotpSecretkey = null, DateTime? TfaRegDeadline = null) : IUnique<int>; public class ReceiverUpdateDto : IUnique<int>
{
/// <summary>
/// Gets or sets the unique identifier of the receiver.
/// </summary>
public int Id { get; set; }
/// <summary>
/// Gets or sets the TOTP (Time-based One-Time Password) secret key.
/// Optional.
/// </summary>
public string? TotpSecretkey { get; set; }
/// <summary>
/// Gets or sets the deadline for two-factor authentication registration.
/// Optional.
/// </summary>
public DateTime? TfaRegDeadline { get; set; }
}

View File

@@ -1,15 +1,46 @@
using DigitalData.Core.Abstractions; using DigitalData.Core.Abstractions;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs namespace EnvelopeGenerator.Application.DTOs;
/// <summary>
/// Data Transfer Object representing a user receiver with associated details.
/// </summary>
[ApiExplorerSettings(IgnoreApi = true)]
public class UserReceiverDto : IUnique<int>
{ {
[ApiExplorerSettings(IgnoreApi = true)] /// <summary>
public record UserReceiverDto( /// Gets or sets the unique identifier of the user receiver.
int Id, /// </summary>
int UserId, public int Id { get; set; }
int ReceiverId,
string Name, /// <summary>
string CompanyName, /// Gets or sets the identifier of the user associated with the receiver.
string JobTitle, /// </summary>
DateTime AddedWhen) : IUnique<int>; public int UserId { get; set; }
/// <summary>
/// Gets or sets the identifier of the receiver.
/// </summary>
public int ReceiverId { get; set; }
/// <summary>
/// Gets or sets the name of the receiver.
/// </summary>
public string Name { get; set; }
/// <summary>
/// Gets or sets the company name of the receiver.
/// </summary>
public string CompanyName { get; set; }
/// <summary>
/// Gets or sets the job title of the receiver.
/// </summary>
public string JobTitle { get; set; }
/// <summary>
/// Gets or sets the timestamp when the user receiver was added.
/// </summary>
public DateTime AddedWhen { get; set; }
} }

View File

@@ -76,7 +76,14 @@ public class EnvelopeHistoryService : CRUDService<IEnvelopeHistoryRepository, En
} }
public async Task<DataResult<long>> RecordAsync(int envelopeId, string userReference, EnvelopeStatus status, string? comment = null) => public async Task<DataResult<long>> RecordAsync(int envelopeId, string userReference, EnvelopeStatus status, string? comment = null) =>
await CreateAsync(new (EnvelopeId: envelopeId, UserReference: userReference, Status: (int)status, ActionDate: DateTime.Now, Comment: comment)) await CreateAsync(new ()
{
EnvelopeId = envelopeId,
UserReference = userReference,
Status = (int) status,
ActionDate = DateTime.Now,
Comment = comment
})
.ThenAsync( .ThenAsync(
Success: id => Result.Success(id), Success: id => Result.Success(id),
Fail: (mssg, ntc) => Result.Fail<long>().Message(mssg).Notice(ntc) Fail: (mssg, ntc) => Result.Fail<long>().Message(mssg).Notice(ntc)

View File

@@ -1,28 +1,27 @@
using DigitalData.Core.Abstractions; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json.Serialization; using System.Text.Json.Serialization;
namespace EnvelopeGenerator.Domain.Entities namespace EnvelopeGenerator.Domain.Entities
{ {
[Table("TBSIG_CONFIG", Schema = "dbo")] [Table("TBSIG_CONFIG", Schema = "dbo")]
public class Config : IUnique<int> public class Config
{ {
[Column("DOCUMENT_PATH", TypeName = "nvarchar(256)")] [Column("DOCUMENT_PATH", TypeName = "nvarchar(256)")]
public string? DocumentPath { get; init; } public string DocumentPath { get; set; }
[Column("SENDING_PROFILE", TypeName = "int")] [Column("SENDING_PROFILE", TypeName = "int")]
[Required] [Required]
public required int SendingProfile { get; init; } public int SendingProfile { get; set; }
[Column("SIGNATURE_HOST", TypeName = "nvarchar(128)")] [Column("SIGNATURE_HOST", TypeName = "nvarchar(128)")]
public string? SignatureHost { get; init; } public string SignatureHost { get; set; }
[Column("EXTERNAL_PROGRAM_NAME", TypeName = "nvarchar(30)")] [Column("EXTERNAL_PROGRAM_NAME", TypeName = "nvarchar(30)")]
public string? ExternalProgramName { get; init; } public string ExternalProgramName { get; set; }
[Column("EXPORT_PATH", TypeName = "nvarchar(256)")] [Column("EXPORT_PATH", TypeName = "nvarchar(256)")]
public string? ExportPath { get; init; } public string ExportPath { get; set; }
[Obsolete("Configuration does not have an ID; it represents a single table in the database.")] [Obsolete("Configuration does not have an ID; it represents a single table in the database.")]
[NotMapped] [NotMapped]

View File

@@ -1,12 +1,11 @@
using DigitalData.Core.Abstractions; using System.ComponentModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
namespace EnvelopeGenerator.Domain.Entities namespace EnvelopeGenerator.Domain.Entities
{ {
[Table("TBSIG_DOCUMENT_RECEIVER_ELEMENT", Schema = "dbo")] [Table("TBSIG_DOCUMENT_RECEIVER_ELEMENT", Schema = "dbo")]
public class DocumentReceiverElement : IUnique<int> public class DocumentReceiverElement
{ {
[Key] [Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
@@ -57,7 +56,7 @@ namespace EnvelopeGenerator.Domain.Entities
public bool Required { get; set; } public bool Required { get; set; }
[Column("TOOLTIP")] [Column("TOOLTIP")]
public string? Tooltip { get; set; } public string Tooltip { get; set; }
[Required] [Required]
[Column("READ_ONLY")] [Column("READ_ONLY")]
@@ -75,13 +74,13 @@ namespace EnvelopeGenerator.Domain.Entities
public DateTime AddedWhen { get; set; } public DateTime AddedWhen { get; set; }
[Column("CHANGED_WHEN", TypeName = "datetime")] [Column("CHANGED_WHEN", TypeName = "datetime")]
public DateTime? ChangedWhen { get; set; } public DateTime ChangedWhen { get; set; }
[ForeignKey("DocumentId")] [ForeignKey("DocumentId")]
public virtual EnvelopeDocument? Document { get; set; } public virtual EnvelopeDocument Document { get; set; }
[ForeignKey("ReceiverId")] [ForeignKey("ReceiverId")]
public virtual Receiver? Receiver { get; set; } public virtual Receiver Receiver { get; set; }
[NotMapped] [NotMapped]
public double Top => Math.Round(Y, 5); public double Top => Math.Round(Y, 5);

View File

@@ -1,11 +1,10 @@
using DigitalData.Core.Abstractions; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
namespace EnvelopeGenerator.Domain.Entities namespace EnvelopeGenerator.Domain.Entities
{ {
[Table("TBSIG_DOCUMENT_STATUS", Schema = "dbo")] [Table("TBSIG_DOCUMENT_STATUS", Schema = "dbo")]
public class DocumentStatus : IUnique<int> public class DocumentStatus
{ {
[Key] [Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
@@ -25,22 +24,22 @@ namespace EnvelopeGenerator.Domain.Entities
public int Status { get; set; } public int Status { get; set; }
[Column("STATUS_CHANGED_WHEN", TypeName = "datetime")] [Column("STATUS_CHANGED_WHEN", TypeName = "datetime")]
public DateTime? StatusChangedWhen { get; set; } public DateTime StatusChangedWhen { get; set; }
[Column("VALUE", TypeName = "nvarchar(max)")] [Column("VALUE", TypeName = "nvarchar(max)")]
public string? Value { get; set; } public string Value { get; set; }
[Required] [Required]
[Column("ADDED_WHEN", TypeName = "datetime")] [Column("ADDED_WHEN", TypeName = "datetime")]
public DateTime AddedWhen { get; set; } public DateTime AddedWhen { get; set; }
[Column("CHANGED_WHEN", TypeName = "datetime")] [Column("CHANGED_WHEN", TypeName = "datetime")]
public DateTime? ChangedWhen { get; set; } public DateTime ChangedWhen { get; set; }
[ForeignKey("EnvelopeId")] [ForeignKey("EnvelopeId")]
public virtual Envelope? Envelope { get; set; } public virtual Envelope Envelope { get; set; }
[ForeignKey("ReceiverId")] [ForeignKey("ReceiverId")]
public virtual Receiver? Receiver { get; set; } public virtual Receiver Receiver { get; set; }
} }
} }

View File

@@ -1,12 +1,11 @@
using DigitalData.Core.Abstractions; using System.ComponentModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
namespace EnvelopeGenerator.Domain.Entities namespace EnvelopeGenerator.Domain.Entities
{ {
[Table("TBSIG_EMAIL_TEMPLATE", Schema = "dbo")] [Table("TBSIG_EMAIL_TEMPLATE", Schema = "dbo")]
public class EmailTemplate : IUnique<int> public class EmailTemplate
{ {
[Key] [Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
@@ -14,13 +13,13 @@ namespace EnvelopeGenerator.Domain.Entities
public int Id { get; set; } public int Id { get; set; }
[Column("NAME", TypeName = "nvarchar(64)")] [Column("NAME", TypeName = "nvarchar(64)")]
public string? Name { get; set; } public string Name { get; set; }
[Column("BODY", TypeName = "nvarchar(max)")] [Column("BODY", TypeName = "nvarchar(max)")]
public string? Body { get; set; } public string Body { get; set; }
[Column("SUBJECT", TypeName = "nvarchar(512)")] [Column("SUBJECT", TypeName = "nvarchar(512)")]
public string? Subject { get; set; } public string Subject { get; set; }
[Required] [Required]
[Column("ADDED_WHEN", TypeName = "datetime")] [Column("ADDED_WHEN", TypeName = "datetime")]
@@ -28,6 +27,6 @@ namespace EnvelopeGenerator.Domain.Entities
public DateTime AddedWhen { get; set; } public DateTime AddedWhen { get; set; }
[Column("CHANGED_WHEN", TypeName = "datetime")] [Column("CHANGED_WHEN", TypeName = "datetime")]
public DateTime? ChangedWhen { get; set; } public DateTime ChangedWhen { get; set; }
} }
} }

View File

@@ -1,12 +1,11 @@
using DigitalData.Core.Abstractions; using EnvelopeGenerator.Common;
using EnvelopeGenerator.Common;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
namespace EnvelopeGenerator.Domain.Entities namespace EnvelopeGenerator.Domain.Entities
{ {
[Table("TBSIG_ENVELOPE", Schema = "dbo")] [Table("TBSIG_ENVELOPE", Schema = "dbo")]
public class Envelope : IUnique<int> public class Envelope
{ {
[Key] [Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
@@ -22,90 +21,90 @@ namespace EnvelopeGenerator.Domain.Entities
public int Status { get; set; } public int Status { get; set; }
[NotMapped] [NotMapped]
public string StatusName => ((Constants.EnvelopeStatus)Status).ToString(); public string StatusName => ((Constants.EnvelopeStatus)Status).ToString();
[Required] [Required]
[Column("ENVELOPE_UUID", TypeName = "nvarchar(36)")] [Column("ENVELOPE_UUID", TypeName = "nvarchar(36)")]
public required string Uuid { get; init; } public string Uuid { get; set; }
[Column("MESSAGE", TypeName = "nvarchar(max)")] [Column("MESSAGE", TypeName = "nvarchar(max)")]
public string? Message { get; set; } public string Message { get; set; }
[Column("EXPIRES_WHEN", TypeName = "datetime")] [Column("EXPIRES_WHEN", TypeName = "datetime")]
public DateTime? ExpiresWhen { get; set; } public DateTime ExpiresWhen { get; set; }
[Column("EXPIRES_WARNING_WHEN", TypeName = "datetime")] [Column("EXPIRES_WARNING_WHEN", TypeName = "datetime")]
public DateTime? ExpiresWarningWhen { get; set; } public DateTime ExpiresWarningWhen { get; set; }
[Required] [Required]
[Column("ADDED_WHEN", TypeName = "datetime")] [Column("ADDED_WHEN", TypeName = "datetime")]
public DateTime AddedWhen { get; set; } public DateTime AddedWhen { get; set; }
[Column("CHANGED_WHEN", TypeName = "datetime")] [Column("CHANGED_WHEN", TypeName = "datetime")]
public DateTime? ChangedWhen { get; set; } public DateTime ChangedWhen { get; set; }
[Column("TITLE", TypeName = "nvarchar(128)")] [Column("TITLE", TypeName = "nvarchar(128)")]
public string? Title { get; set; } public string Title { get; set; }
[Column("CONTRACT_TYPE")] [Column("CONTRACT_TYPE")]
public int? ContractType { get; set; } public int ContractType { get; set; }
[Column("LANGUAGE", TypeName = "nvarchar(5)")] [Column("LANGUAGE", TypeName = "nvarchar(5)")]
public string? Language { get; set; } public string Language { get; set; }
[Column("SEND_REMINDER_EMAILS")] [Column("SEND_REMINDER_EMAILS")]
public bool? SendReminderEmails { get; set; } public bool SendReminderEmails { get; set; }
[Column("FIRST_REMINDER_DAYS")] [Column("FIRST_REMINDER_DAYS")]
public int? FirstReminderDays { get; set; } public int FirstReminderDays { get; set; }
[Column("REMINDER_INTERVAL_DAYS")] [Column("REMINDER_INTERVAL_DAYS")]
public int? ReminderIntervalDays { get; set; } public int ReminderIntervalDays { get; set; }
[Column("ENVELOPE_TYPE")] [Column("ENVELOPE_TYPE")]
public int? EnvelopeTypeId { get; set; } public int EnvelopeTypeId { get; set; }
[Column("CERTIFICATION_TYPE")] [Column("CERTIFICATION_TYPE")]
public int? CertificationType { get; set; } public int CertificationType { get; set; }
[Column("USE_ACCESS_CODE")] [Column("USE_ACCESS_CODE")]
public bool? UseAccessCode { get; set; } public bool UseAccessCode { get; set; }
[Column("FINAL_EMAIL_TO_CREATOR")] [Column("FINAL_EMAIL_TO_CREATOR")]
public int? FinalEmailToCreator { get; set; } public int FinalEmailToCreator { get; set; }
[Column("FINAL_EMAIL_TO_RECEIVERS")] [Column("FINAL_EMAIL_TO_RECEIVERS")]
public int? FinalEmailToReceivers { get; set; } public int FinalEmailToReceivers { get; set; }
[Column("EXPIRES_WHEN_DAYS")] [Column("EXPIRES_WHEN_DAYS")]
public int? ExpiresWhenDays { get; set; } public int ExpiresWhenDays { get; set; }
[Column("EXPIRES_WARNING_WHEN_DAYS")] [Column("EXPIRES_WARNING_WHEN_DAYS")]
public int? ExpiresWarningWhenDays { get; set; } public int ExpiresWarningWhenDays { get; set; }
[Column("TFA_ENABLED", TypeName = "bit")] [Column("TFA_ENABLED", TypeName = "bit")]
public bool TFAEnabled { get; set; } public bool TFAEnabled { get; set; }
[Column("DOC_RESULT", TypeName = "varbinary(max)")] [Column("DOC_RESULT", TypeName = "varbinary(max)")]
public byte[]? DocResult { get; init; } public byte[] DocResult { get; set; }
/// <summary> /// <summary>
/// The sender of envelope /// The sender of envelope
/// </summary> /// </summary>
[ForeignKey("UserId")] [ForeignKey("UserId")]
public DigitalData.UserManager.Domain.Entities.User? User { get; set; } public User User { get; set; }
[ForeignKey("EnvelopeTypeId")] [ForeignKey("EnvelopeTypeId")]
public EnvelopeType? EnvelopeType { get; set; } public EnvelopeType EnvelopeType { get; set; }
[NotMapped] [NotMapped]
public string? EnvelopeTypeTitle => EnvelopeType?.Title; public string EnvelopeTypeTitle => EnvelopeType.Title;
[NotMapped] [NotMapped]
public bool IsAlreadySent => Status > (int) Constants.EnvelopeStatus.EnvelopeSaved; public bool IsAlreadySent => Status > (int)Constants.EnvelopeStatus.EnvelopeSaved;
public IEnumerable<EnvelopeDocument>? Documents { get; set; } public IEnumerable<EnvelopeDocument> Documents { get; set; }
public IEnumerable<EnvelopeHistory>? History { get; set; } public IEnumerable<EnvelopeHistory> History { get; set; }
} }
} }

View File

@@ -1,11 +1,10 @@
using DigitalData.Core.Abstractions; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
namespace EnvelopeGenerator.Domain.Entities namespace EnvelopeGenerator.Domain.Entities
{ {
[Table("TBSIG_ENVELOPE_CERTIFICATE", Schema = "dbo")] [Table("TBSIG_ENVELOPE_CERTIFICATE", Schema = "dbo")]
public class EnvelopeCertificate : IUnique<int> public class EnvelopeCertificate
{ {
[Key] [Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
@@ -18,11 +17,11 @@ namespace EnvelopeGenerator.Domain.Entities
[Required] [Required]
[Column("ENVELOPE_UUID", TypeName = "nvarchar(36)")] [Column("ENVELOPE_UUID", TypeName = "nvarchar(36)")]
public required string EnvelopeUuid { get; set; } public string EnvelopeUuid { get; set; }
[Required] [Required]
[Column("ENVELOPE_SUBJECT", TypeName = "nvarchar(512)")] [Column("ENVELOPE_SUBJECT", TypeName = "nvarchar(512)")]
public required string EnvelopeSubject { get; set; } public string EnvelopeSubject { get; set; }
[Required] [Required]
[Column("CREATOR_ID")] [Column("CREATOR_ID")]
@@ -30,11 +29,11 @@ namespace EnvelopeGenerator.Domain.Entities
[Required] [Required]
[Column("CREATOR_NAME", TypeName = "nvarchar(128)")] [Column("CREATOR_NAME", TypeName = "nvarchar(128)")]
public required string CreatorName { get; set; } public string CreatorName { get; set; }
[Required] [Required]
[Column("CREATOR_EMAIL", TypeName = "nvarchar(128)")] [Column("CREATOR_EMAIL", TypeName = "nvarchar(128)")]
public required string CreatorEmail { get; set; } public string CreatorEmail { get; set; }
[Required] [Required]
[Column("ENVELOPE_STATUS")] [Column("ENVELOPE_STATUS")]

View File

@@ -1,27 +1,27 @@
using DigitalData.Core.Abstractions; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
namespace EnvelopeGenerator.Domain.Entities; namespace EnvelopeGenerator.Domain.Entities
[Table("TBSIG_ENVELOPE_DOCUMENT", Schema = "dbo")]
public class EnvelopeDocument : IUnique<int>
{ {
[Key] [Table("TBSIG_ENVELOPE_DOCUMENT", Schema = "dbo")]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] public class EnvelopeDocument
[Column("GUID")] {
public int Id { get; set; } [Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
[Column("GUID")]
public int Id { get; set; }
[Required] [Required]
[Column("ENVELOPE_ID")] [Column("ENVELOPE_ID")]
public int EnvelopeId { get; set; } public int EnvelopeId { get; set; }
[Required] [Required]
[Column("ADDED_WHEN", TypeName = "datetime")] [Column("ADDED_WHEN", TypeName = "datetime")]
public required DateTime AddedWhen { get; set; } public DateTime AddedWhen { get; set; }
[Column("BYTE_DATA", TypeName = "varbinary(max)")] [Column("BYTE_DATA", TypeName = "varbinary(max)")]
public byte[]? ByteData { get; init; } public byte[] ByteData { get; set; }
public IEnumerable<DocumentReceiverElement>? Elements { get; set; } public IEnumerable<DocumentReceiverElement> Elements { get; set; }
}
} }

View File

@@ -1,12 +1,10 @@
using DigitalData.Core.Abstractions; using System.ComponentModel.DataAnnotations;
using DigitalData.UserManager.Domain.Entities;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
namespace EnvelopeGenerator.Domain.Entities namespace EnvelopeGenerator.Domain.Entities
{ {
[Table("TBSIG_ENVELOPE_HISTORY", Schema = "dbo")] [Table("TBSIG_ENVELOPE_HISTORY", Schema = "dbo")]
public class EnvelopeHistory : IUnique<long> public class EnvelopeHistory
{ {
[Key] [Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
@@ -19,7 +17,7 @@ namespace EnvelopeGenerator.Domain.Entities
[Required] [Required]
[Column("USER_REFERENCE", TypeName = "nvarchar(128)")] [Column("USER_REFERENCE", TypeName = "nvarchar(128)")]
public required string UserReference { get; init; } public string UserReference { get; set; }
[Required] [Required]
[Column("STATUS")] [Column("STATUS")]
@@ -31,15 +29,15 @@ namespace EnvelopeGenerator.Domain.Entities
public DateTime AddedWhen { get; set; } public DateTime AddedWhen { get; set; }
[Column("ACTION_DATE", TypeName = "datetime")] [Column("ACTION_DATE", TypeName = "datetime")]
public DateTime? ActionDate { get; set; } public DateTime ActionDate { get; set; }
[Column("COMMENT", TypeName = "nvarchar(max)")] [Column("COMMENT", TypeName = "nvarchar(max)")]
public string? Comment { get; set; } public string Comment { get; set; }
[ForeignKey("UserReference")] [ForeignKey("UserReference")]
public virtual User? Sender { get; set; } public virtual User Sender { get; set; }
[ForeignKey("UserReference")] [ForeignKey("UserReference")]
public virtual Receiver? Receiver { get; set; } public virtual Receiver Receiver { get; set; }
} }
} }

View File

@@ -6,9 +6,9 @@ namespace EnvelopeGenerator.Domain.Entities
public class EnvelopeReceiver : EnvelopeReceiverBase public class EnvelopeReceiver : EnvelopeReceiverBase
{ {
[ForeignKey("EnvelopeId")] [ForeignKey("EnvelopeId")]
public Envelope? Envelope { get; set; } public Envelope Envelope { get; set; }
[ForeignKey("ReceiverId")] [ForeignKey("ReceiverId")]
public Receiver? Receiver { get; set; } public Receiver Receiver { get; set; }
} }
} }

View File

@@ -1,11 +1,10 @@
using DigitalData.Core.Abstractions; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
namespace EnvelopeGenerator.Domain.Entities namespace EnvelopeGenerator.Domain.Entities
{ {
[Table("TBSIG_ENVELOPE_RECEIVER", Schema = "dbo")] [Table("TBSIG_ENVELOPE_RECEIVER", Schema = "dbo")]
public class EnvelopeReceiverBase : IUnique<(int Envelope, int Receiver)> public class EnvelopeReceiverBase
{ {
[Key] [Key]
[Column("ENVELOPE_ID")] [Column("ENVELOPE_ID")]
@@ -20,31 +19,31 @@ namespace EnvelopeGenerator.Domain.Entities
public int Sequence { get; set; } public int Sequence { get; set; }
[Column("NAME", TypeName = "nvarchar(128)")] [Column("NAME", TypeName = "nvarchar(128)")]
public string? Name { get; set; } public string Name { get; set; }
[Column("JOB_TITLE", TypeName = "nvarchar(128)")] [Column("JOB_TITLE", TypeName = "nvarchar(128)")]
public string? JobTitle { get; set; } public string JobTitle { get; set; }
[Column("COMPANY_NAME", TypeName = "nvarchar(128)")] [Column("COMPANY_NAME", TypeName = "nvarchar(128)")]
public string? CompanyName { get; set; } public string CompanyName { get; set; }
[Column("PRIVATE_MESSAGE", TypeName = "nvarchar(max)")] [Column("PRIVATE_MESSAGE", TypeName = "nvarchar(max)")]
public string? PrivateMessage { get; set; } public string PrivateMessage { get; set; }
[Column("ACCESS_CODE", TypeName = "nvarchar(64)")] [Column("ACCESS_CODE", TypeName = "nvarchar(64)")]
public string? AccessCode { get; set; } public string AccessCode { get; set; }
[Required] [Required]
[Column("ADDED_WHEN", TypeName = "datetime")] [Column("ADDED_WHEN", TypeName = "datetime")]
public DateTime AddedWhen { get; set; } public DateTime AddedWhen { get; set; }
[Column("CHANGED_WHEN", TypeName = "datetime")] [Column("CHANGED_WHEN", TypeName = "datetime")]
public DateTime? ChangedWhen { get; set; } public DateTime ChangedWhen { get; set; }
[Column("PHONE_NUMBER")] [Column("PHONE_NUMBER")]
[StringLength(20)] [StringLength(20)]
[RegularExpression(@"^\+[0-9]+$", ErrorMessage = "Phone number must start with '+' followed by digits.")] [RegularExpression(@"^\+[0-9]+$", ErrorMessage = "Phone number must start with '+' followed by digits.")]
public string? PhoneNumber { get; set; } public string PhoneNumber { get; set; }
[NotMapped] [NotMapped]
public (int Envelope, int Receiver) Id => (Envelope: EnvelopeId, Receiver: ReceiverId); public (int Envelope, int Receiver) Id => (Envelope: EnvelopeId, Receiver: ReceiverId);

View File

@@ -1,52 +1,50 @@
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using DigitalData.Core.Abstractions;
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
namespace EnvelopeGenerator.Domain.Entities namespace EnvelopeGenerator.Domain.Entities
{ {
[Table("TBSIG_ENVELOPE_RECEIVER_READ_ONLY")] [Table("TBSIG_ENVELOPE_RECEIVER_READ_ONLY")]
public class EnvelopeReceiverReadOnly : IUnique<long> public class EnvelopeReceiverReadOnly
{ {
[Key] [Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
[Column("GUID")] [Column("GUID")]
public long Id { get; init; } public long Id { get; set; }
[Column("ENVELOPE_ID")] [Column("ENVELOPE_ID")]
[Required] [Required]
public long EnvelopeId { get; init; } public long EnvelopeId { get; set; }
//TODO: remove NotMapped attribute when EnvelopeId data type is standardized //TODO: remove NotMapped attribute when EnvelopeId data type is standardized
[NotMapped] [NotMapped]
public Envelope? Envelope { get; set; } public Envelope Envelope { get; set; }
[Column("RECEIVER_MAIL")] [Column("RECEIVER_MAIL")]
[Required] [Required]
[StringLength(250)] [StringLength(250)]
[TemplatePlaceholder("NAME_RECEIVER")] [TemplatePlaceholder("NAME_RECEIVER")]
public required string ReceiverMail { get; init; } public string ReceiverMail { get; set; }
[Column("DATE_VALID")] [Column("DATE_VALID")]
[Required] [Required]
public DateTime DateValid { get; init; } public DateTime DateValid { get; set; }
[Column("ADDED_WHO")] [Column("ADDED_WHO")]
[Required] [Required]
[StringLength(100)] [StringLength(100)]
public required string AddedWho { get; init; } public string AddedWho { get; set; }
public Receiver? Receiver { get; init; } public Receiver Receiver { get; set; }
[Column("ADDED_WHEN")] [Column("ADDED_WHEN")]
[Required] [Required]
public DateTime AddedWhen { get; init; } public DateTime AddedWhen { get; set; }
[Column("CHANGED_WHO")] [Column("CHANGED_WHO")]
[StringLength(100)] [StringLength(100)]
public string? ChangedWho { get; init; } public string ChangedWho { get; set; }
[Column("CHANGED_WHEN")] [Column("CHANGED_WHEN")]
public DateTime? ChangedWhen { get; init; } public DateTime ChangedWhen { get; set; }
} }
} }

View File

@@ -1,11 +1,10 @@
using DigitalData.Core.Abstractions; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
namespace EnvelopeGenerator.Domain.Entities namespace EnvelopeGenerator.Domain.Entities
{ {
[Table("TBSIG_ENVELOPE_TYPE", Schema = "dbo")] [Table("TBSIG_ENVELOPE_TYPE", Schema = "dbo")]
public class EnvelopeType : IUnique<int> public class EnvelopeType
{ {
[Key] [Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
@@ -14,46 +13,46 @@ namespace EnvelopeGenerator.Domain.Entities
[Required] [Required]
[Column("TITLE", TypeName = "nvarchar(128)")] [Column("TITLE", TypeName = "nvarchar(128)")]
public required string Title { get; set; } public string Title { get; set; }
[Column("LANGUAGE", TypeName = "nvarchar(5)")] [Column("LANGUAGE", TypeName = "nvarchar(5)")]
public string? Language { get; set; } public string Language { get; set; }
[Column("EXPIRES_DAYS")] [Column("EXPIRES_DAYS")]
public int? ExpiresDays { get; set; } public int ExpiresDays { get; set; }
[Column("CERTIFICATION_TYPE")] [Column("CERTIFICATION_TYPE")]
public int? CertificationType { get; set; } public int CertificationType { get; set; }
[Column("USE_ACCESS_CODE")] [Column("USE_ACCESS_CODE")]
public bool? UseAccessCode { get; set; } public bool UseAccessCode { get; set; }
[Column("FINAL_EMAIL_TO_CREATOR")] [Column("FINAL_EMAIL_TO_CREATOR")]
public int? FinalEmailToCreator { get; set; } public int FinalEmailToCreator { get; set; }
[Column("FINAL_EMAIL_TO_RECEIVERS")] [Column("FINAL_EMAIL_TO_RECEIVERS")]
public int? FinalEmailToReceivers { get; set; } public int FinalEmailToReceivers { get; set; }
[Required] [Required]
[Column("ADDED_WHEN", TypeName = "datetime")] [Column("ADDED_WHEN", TypeName = "datetime")]
public DateTime AddedWhen { get; set; } public DateTime AddedWhen { get; set; }
[Column("CHANGED_WHEN", TypeName = "datetime")] [Column("CHANGED_WHEN", TypeName = "datetime")]
public DateTime? ChangedWhen { get; set; } public DateTime ChangedWhen { get; set; }
[Column("EXPIRES_WARNING_DAYS")] [Column("EXPIRES_WARNING_DAYS")]
public int? ExpiresWarningDays { get; set; } public int ExpiresWarningDays { get; set; }
[Column("SEND_REMINDER_EMAILS")] [Column("SEND_REMINDER_EMAILS")]
public bool? SendReminderEmails { get; set; } public bool SendReminderEmails { get; set; }
[Column("FIRST_REMINDER_DAYS")] [Column("FIRST_REMINDER_DAYS")]
public int? FirstReminderDays { get; set; } public int FirstReminderDays { get; set; }
[Column("REMINDER_INTERVAL_DAYS")] [Column("REMINDER_INTERVAL_DAYS")]
public int? ReminderIntervalDays { get; set; } public int ReminderIntervalDays { get; set; }
[Column("CONTRACT_TYPE")] [Column("CONTRACT_TYPE")]
public int? ContractType { get; set; } public int ContractType { get; set; }
} }
} }

View File

@@ -1,34 +1,34 @@
using DigitalData.Core.Abstractions; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
namespace EnvelopeGenerator.Domain.Entities; namespace EnvelopeGenerator.Domain.Entities
[Table("TBSIG_RECEIVER", Schema = "dbo")]
public class Receiver : IUnique<int>
{ {
[Key] [Table("TBSIG_RECEIVER", Schema = "dbo")]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] public class Receiver
[Column("GUID")] {
public int Id { get; set; } [Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
[Required, EmailAddress] [Column("GUID")]
[Column("EMAIL_ADDRESS", TypeName = "nvarchar(128)")] public int Id { get; set; }
public required string EmailAddress { get; set; }
[Required] [Required, EmailAddress]
[Column("SIGNATURE", TypeName = "nvarchar(64)")] [Column("EMAIL_ADDRESS", TypeName = "nvarchar(128)")]
public required string Signature { get; set; } public string EmailAddress { get; set; }
[Required] [Required]
[Column("ADDED_WHEN", TypeName = "datetime")] [Column("SIGNATURE", TypeName = "nvarchar(64)")]
public DateTime AddedWhen { get; set; } public string Signature { get; set; }
[Column("TOTP_SECRET_KEY", TypeName = "nvarchar(MAX)")] [Required]
public string? TotpSecretkey { get; set; } [Column("ADDED_WHEN", TypeName = "datetime")]
public DateTime AddedWhen { get; set; }
[Column("TFA_REG_DEADLINE", TypeName = "datetime")] [Column("TOTP_SECRET_KEY", TypeName = "nvarchar(MAX)")]
public DateTime? TfaRegDeadline { get; set; } public string TotpSecretkey { get; set; }
public IEnumerable<EnvelopeReceiver>? EnvelopeReceivers { get; init; } [Column("TFA_REG_DEADLINE", TypeName = "datetime")]
public DateTime TfaRegDeadline { get; set; }
public IEnumerable<EnvelopeReceiver> EnvelopeReceivers { get; set; }
}
} }

View File

@@ -0,0 +1,96 @@
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;
namespace EnvelopeGenerator.Domain.Entities
{
[Table("TBDD_USER", Schema = "dbo")]
public class User
{
[Column("GUID")]
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
[StringLength(50)]
[Column("ADDED_WHO")]
public string AddedWho { get; set; }
[StringLength(50)]
[Column("CHANGED_WHO")]
public string ChangedWho { get; set; }
//TODO: assign it to default value in create dto, not here!
[Column("ADDED_WHEN", TypeName = "datetime")]
[DefaultValue("GETDATE()")]
public DateTime AddedWhen { get; set; } = DateTime.Now;
[Column("CHANGED_WHEN", TypeName = "datetime")]
public DateTime ChangedWhen { get; set; }
[Column("PRENAME")]
[StringLength(50)]
public string Prename { get; set; }
[Column("NAME")]
[StringLength(50)]
public string Name { get; set; }
[Required]
[Column("USERNAME")]
[StringLength(50)]
public string Username { get; set; }
[Column("SHORTNAME")]
[StringLength(30)]
public string Shortname { get; set; }
[Column("EMAIL")]
[StringLength(100)]
public string Email { get; set; }
[Required]
[Column("LANGUAGE")]
[StringLength(5)]
[DefaultValue("de-DE")]
public string Language { get; set; }
[Column("COMMENT")]
[StringLength(500)]
public string Comment { get; set; }
[Column("DELETED")]
public bool Deleted { get; set; }
[Required]
[Column("DATE_FORMAT")]
[StringLength(10)]
[DefaultValue("dd.MM.yyyy")]
public string DateFormat { get; set; }
[Required]
[Column("ACTIVE")]
public bool Active { get; set; }
[Required]
[Column("GENERAL_VIEWER")]
[StringLength(30)]
[DefaultValue("NONE")]
public string GeneralViewer { get; set; }
[Required]
[Column("WAN_ENVIRONMENT")]
public bool WanEnvironment { get; set; }
[Required]
[Column("USERID_FK_INT_ECM")]
public int UseridFkIntEcm { get; set; }
[Column("DELETED_WHEN")]
public DateTime DeletedWhen { get; set; }
[Column("DELETED_WHO")]
[StringLength(50)]
public string DeletedWho { get; set; }
}
}

View File

@@ -1,11 +1,10 @@
using DigitalData.Core.Abstractions; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
namespace EnvelopeGenerator.Domain.Entities namespace EnvelopeGenerator.Domain.Entities
{ {
[Table("TBSIG_USER_RECEIVER", Schema = "dbo")] [Table("TBSIG_USER_RECEIVER", Schema = "dbo")]
public class UserReceiver : IUnique<int> public class UserReceiver
{ {
[Key] [Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
@@ -22,16 +21,16 @@ namespace EnvelopeGenerator.Domain.Entities
[Required] [Required]
[Column("NAME", TypeName = "nvarchar(128)")] [Column("NAME", TypeName = "nvarchar(128)")]
public required string Name { get; set; } public string Name { get; set; }
[Column("COMPANY_NAME", TypeName = "nvarchar(128)")] [Column("COMPANY_NAME", TypeName = "nvarchar(128)")]
public string? CompanyName { get; set; } public string CompanyName { get; set; }
[Column("JOB_TITLE", TypeName = "nvarchar(128)")] [Column("JOB_TITLE", TypeName = "nvarchar(128)")]
public string? JobTitle { get; set; } public string JobTitle { get; set; }
[Required] [Required]
[Column("ADDED_WHEN", TypeName = "datetime")] [Column("ADDED_WHEN", TypeName = "datetime")]
public required DateTime AddedWhen { get; init; } public DateTime AddedWhen { get; set; }
} }
} }

View File

@@ -1,15 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net7.0;net8.0;net9.0</TargetFrameworks> <TargetFrameworks>net462;net7.0;net8.0;net9.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<PackageReference Include="DigitalData.Core.Abstractions" Version="3.6.0" /> <PackageReference Include="System.ComponentModel.Annotations" Version="4.7.0" />
<PackageReference Include="DigitalData.EmailProfilerDispatcher.Abstraction" Version="3.0.0" />
<PackageReference Include="UserManager.Domain" Version="3.0.2" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@@ -33,7 +33,7 @@ public static class DIExtensions
/// will be created per HTTP request (or per scope) within the dependency injection container. /// will be created per HTTP request (or per scope) within the dependency injection container.
/// </remarks> /// </remarks>
public static IServiceCollection AddEnvelopeGeneratorInfrastructureServices(this IServiceCollection services, public static IServiceCollection AddEnvelopeGeneratorInfrastructureServices(this IServiceCollection services,
Action<DbContextOptionsBuilder>? dbContextOptions = null, Action<IServiceProvider, DbContextOptionsBuilder>? dbContextOptions = null,
IConfiguration? sqlExecutorConfiguration = null, IConfiguration? sqlExecutorConfiguration = null,
Action<SQLExecutorParams>? sqlExecutorConfigureOptions = null) Action<SQLExecutorParams>? sqlExecutorConfigureOptions = null)
{ {

View File

@@ -98,7 +98,14 @@ try
}); });
// Add envelope generator services // Add envelope generator services
builder.Services.AddEnvelopeGeneratorInfrastructureServices(options => options.UseSqlServer(connStr)); builder.Services.AddEnvelopeGeneratorInfrastructureServices((provider, options) =>
{
var logger = provider.GetRequiredService<ILogger<EGDbContext>>();
options.UseSqlServer(connStr)
.LogTo(log => logger.LogInformation("{log}", log), Microsoft.Extensions.Logging.LogLevel.Trace)
.EnableSensitiveDataLogging()
.EnableDetailedErrors();
});
builder.Services.AddEnvelopeGeneratorServices(config); builder.Services.AddEnvelopeGeneratorServices(config);