Compare commits
27 Commits
feat/signF
...
39c1d3e624
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
39c1d3e624 | ||
|
|
39cc30f48b | ||
|
|
79204d4f6d | ||
|
|
806b990556 | ||
|
|
d34a1016c4 | ||
|
|
93dbe63fb4 | ||
|
|
55ffe40c46 | ||
|
|
be9516d852 | ||
|
|
12502bb2de | ||
|
|
26745e0c37 | ||
|
|
2ea5fd7dbb | ||
|
|
446aeb00b1 | ||
|
|
abc3bb7652 | ||
|
|
a8a768d7d6 | ||
|
|
31c4a8a20f | ||
|
|
e98abde5ff | ||
|
|
49497dafd1 | ||
|
|
08e1187124 | ||
|
|
1b923dc93b | ||
|
|
bdf2527fc1 | ||
|
|
1a69478f48 | ||
|
|
83d29bf78d | ||
|
|
bc45aadf27 | ||
|
|
7e66cd4dae | ||
|
|
cc11d70a27 | ||
|
|
02aeaea8a9 | ||
|
|
05867cc645 |
@@ -1,4 +1,4 @@
|
||||
using DigitalData.Core.Abstractions.Client;
|
||||
using DigitalData.Core.Client.Interface;
|
||||
namespace EnvelopeGenerator.Application.Configurations;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using DigitalData.Core.Abstractions.Infrastructure;
|
||||
using DigitalData.Core.Application.Interfaces.Repository;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using DigitalData.Core.Abstractions.Infrastructure;
|
||||
using DigitalData.Core.Application.Interfaces.Repository;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using DigitalData.Core.Abstractions.Infrastructure;
|
||||
using DigitalData.Core.Application.Interfaces.Repository;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using DigitalData.Core.Abstractions.Infrastructure;
|
||||
using DigitalData.Core.Application.Interfaces.Repository;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using static EnvelopeGenerator.Common.Constants;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using DigitalData.Core.Abstractions.Infrastructure;
|
||||
using DigitalData.Core.Application.Interfaces.Repository;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using DigitalData.Core.Abstractions.Infrastructure;
|
||||
using DigitalData.Core.Application.Interfaces.Repository;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using DigitalData.Core.Abstractions.Infrastructure;
|
||||
using DigitalData.Core.Application.Interfaces.Repository;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using DigitalData.Core.Abstractions.Infrastructure;
|
||||
using DigitalData.Core.Application.Interfaces.Repository;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using DigitalData.Core.Abstractions.Infrastructure;
|
||||
using DigitalData.Core.Application.Interfaces.Repository;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using DigitalData.Core.Abstractions.Infrastructure;
|
||||
using DigitalData.Core.Application.Interfaces.Repository;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using DigitalData.Core.Abstractions.Infrastructure;
|
||||
using DigitalData.Core.Application.Interfaces.Repository;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using DigitalData.Core.Abstractions.Infrastructure;
|
||||
using DigitalData.Core.Application.Interfaces.Repository;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using DigitalData.Core.Abstractions.Infrastructure;
|
||||
using DigitalData.Core.Application.Interfaces.Repository;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Contracts.Repositories;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using DigitalData.Core.Abstractions.Application;
|
||||
using DigitalData.Core.Application.Interfaces;
|
||||
using DigitalData.Core.DTO;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using DigitalData.Core.Abstractions.Application;
|
||||
using DigitalData.Core.Application.Interfaces;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using DigitalData.Core.Abstractions.Application;
|
||||
using DigitalData.Core.Application.Interfaces;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
namespace EnvelopeGenerator.Application.Contracts.Services;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using DigitalData.Core.Abstractions.Application;
|
||||
using DigitalData.Core.Application.Interfaces;
|
||||
using DigitalData.Core.DTO;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using DigitalData.Core.Abstractions.Application;
|
||||
using DigitalData.Core.Application.Interfaces;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using DigitalData.Core.Abstractions.Application;
|
||||
using DigitalData.Core.Application.Interfaces;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using DigitalData.Core.Abstractions.Application;
|
||||
using DigitalData.Core.Application.Interfaces;
|
||||
using DigitalData.Core.DTO;
|
||||
using EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
|
||||
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using DigitalData.Core.Abstractions.Application;
|
||||
using DigitalData.Core.Application.Interfaces;
|
||||
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using CommandDotNet;
|
||||
using DigitalData.Core.Abstractions.Application;
|
||||
using DigitalData.Core.Application.Interfaces;
|
||||
using DigitalData.Core.DTO;
|
||||
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
||||
using EnvelopeGenerator.Application.DTOs.Messaging;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using DigitalData.Core.Abstractions.Application;
|
||||
using DigitalData.Core.Application.Interfaces;
|
||||
using DigitalData.Core.DTO;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using DigitalData.Core.Abstractions.Application;
|
||||
using DigitalData.Core.Application.Interfaces;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using DigitalData.Core.Abstractions;
|
||||
using DigitalData.Core.Abstractions.Application;
|
||||
using DigitalData.Core.Application.Interfaces;
|
||||
using DigitalData.Core.DTO;
|
||||
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
@@ -12,5 +12,5 @@ public interface IReceiverService : ICRUDService<ReceiverCreateDto, ReceiverRead
|
||||
|
||||
Task<Result> DeleteByAsync(string? emailAddress = null, string? signature = null);
|
||||
|
||||
Task<Result> UpdateAsync<TUpdateDto>(TUpdateDto updateDto) where TUpdateDto : IUnique<int>;
|
||||
Task<Result> UpdateAsync<TUpdateDto>(TUpdateDto updateDto);
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
using DigitalData.Core.Abstractions.Application;
|
||||
using DigitalData.Core.Application.Interfaces;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
|
||||
@@ -1,21 +1,35 @@
|
||||
using DigitalData.Core.Abstractions;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Text.Json.Serialization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace EnvelopeGenerator.Application.DTOs
|
||||
namespace EnvelopeGenerator.Application.DTOs;
|
||||
|
||||
/// <summary>
|
||||
/// Data Transfer Object representing configuration settings.
|
||||
/// </summary>
|
||||
[ApiExplorerSettings(IgnoreApi = true)]
|
||||
public class ConfigDto
|
||||
{
|
||||
[ApiExplorerSettings(IgnoreApi = true)]
|
||||
public record ConfigDto(
|
||||
string DocumentPath,
|
||||
int SendingProfile,
|
||||
string SignatureHost,
|
||||
string ExternalProgramName,
|
||||
string ExportPath) : IUnique<int>
|
||||
{
|
||||
[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.");
|
||||
};
|
||||
/// <summary>
|
||||
/// Gets or sets the path to the document.
|
||||
/// </summary>
|
||||
public string DocumentPath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the sending profile identifier.
|
||||
/// </summary>
|
||||
public int SendingProfile { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the signature host URL or name.
|
||||
/// </summary>
|
||||
public string SignatureHost { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the external program.
|
||||
/// </summary>
|
||||
public string ExternalProgramName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the path where exports will be saved.
|
||||
/// </summary>
|
||||
public string ExportPath { get; set; }
|
||||
}
|
||||
@@ -1,26 +1,95 @@
|
||||
using DigitalData.Core.Abstractions;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace EnvelopeGenerator.Application.DTOs
|
||||
namespace EnvelopeGenerator.Application.DTOs;
|
||||
|
||||
/// <summary>
|
||||
/// Data Transfer Object representing a positioned element assigned to a document receiver.
|
||||
/// </summary>
|
||||
[ApiExplorerSettings(IgnoreApi = true)]
|
||||
public class DocumentReceiverElementDto
|
||||
{
|
||||
[ApiExplorerSettings(IgnoreApi = true)]
|
||||
public record DocumentReceiverElementDto(
|
||||
int Id,
|
||||
int DocumentId,
|
||||
int ReceiverId,
|
||||
int ElementType,
|
||||
double X,
|
||||
double Y,
|
||||
double Width,
|
||||
double Height,
|
||||
int Page,
|
||||
bool Required,
|
||||
string? Tooltip,
|
||||
bool ReadOnly,
|
||||
int AnnotationIndex,
|
||||
DateTime AddedWhen,
|
||||
DateTime? ChangedWhen,
|
||||
double Top,
|
||||
double Left
|
||||
): IUnique<int>;
|
||||
/// <summary>
|
||||
/// Gets or sets the unique identifier of the element.
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the identifier of the associated document.
|
||||
/// </summary>
|
||||
public int DocumentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the identifier of the receiver.
|
||||
/// </summary>
|
||||
public int ReceiverId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the type of the element.
|
||||
/// </summary>
|
||||
public int ElementType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the X coordinate of the element.
|
||||
/// </summary>
|
||||
public double X { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Y coordinate of the element.
|
||||
/// </summary>
|
||||
public double Y { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the width of the element.
|
||||
/// </summary>
|
||||
public double Width { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the height of the element.
|
||||
/// </summary>
|
||||
public double Height { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the page number where the element appears.
|
||||
/// </summary>
|
||||
public int Page { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the element is required.
|
||||
/// </summary>
|
||||
public bool Required { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the tooltip text for the element.
|
||||
/// </summary>
|
||||
public string? Tooltip { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the element is read-only.
|
||||
/// </summary>
|
||||
public bool ReadOnly { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the annotation index for ordering or reference.
|
||||
/// </summary>
|
||||
public int AnnotationIndex { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the timestamp when the element was added.
|
||||
/// </summary>
|
||||
public DateTime AddedWhen { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the timestamp when the element was last changed, if applicable.
|
||||
/// </summary>
|
||||
public DateTime? ChangedWhen { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the top position of the element (in layout terms).
|
||||
/// </summary>
|
||||
public double Top { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the left position of the element (in layout terms).
|
||||
/// </summary>
|
||||
public double Left { get; set; }
|
||||
}
|
||||
@@ -1,18 +1,50 @@
|
||||
using DigitalData.Core.Abstractions;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace EnvelopeGenerator.Application.DTOs
|
||||
namespace EnvelopeGenerator.Application.DTOs;
|
||||
|
||||
/// <summary>
|
||||
/// Data Transfer Object representing the status of a document for a specific receiver.
|
||||
/// </summary>
|
||||
[ApiExplorerSettings(IgnoreApi = true)]
|
||||
public class DocumentStatusDto
|
||||
{
|
||||
[ApiExplorerSettings(IgnoreApi = true)]
|
||||
public record DocumentStatusDto(
|
||||
int Id,
|
||||
int EnvelopeId,
|
||||
int ReceiverId,
|
||||
int Status,
|
||||
DateTime? StatusChangedWhen,
|
||||
DateTime AddedWhen,
|
||||
DateTime? ChangedWhen) : IUnique<int>
|
||||
{
|
||||
public string? Value { get; set; }
|
||||
};
|
||||
/// <summary>
|
||||
/// Gets or sets the unique identifier of the document status entry.
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ID of the associated envelope.
|
||||
/// </summary>
|
||||
public int EnvelopeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ID of the receiver associated with this status.
|
||||
/// </summary>
|
||||
public int ReceiverId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the current status code.
|
||||
/// </summary>
|
||||
public int Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the timestamp when the status was changed.
|
||||
/// </summary>
|
||||
public DateTime? StatusChangedWhen { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the timestamp when this record was added.
|
||||
/// </summary>
|
||||
public DateTime AddedWhen { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the timestamp when this record was last changed.
|
||||
/// </summary>
|
||||
public DateTime? ChangedWhen { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the display value associated with the status.
|
||||
/// </summary>
|
||||
public string? Value { get; set; }
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using DigitalData.Core.Abstractions;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace EnvelopeGenerator.Application.DTOs
|
||||
{
|
||||
@@ -7,7 +6,7 @@ namespace EnvelopeGenerator.Application.DTOs
|
||||
///
|
||||
/// </summary>
|
||||
[ApiExplorerSettings(IgnoreApi = true)]
|
||||
public record EmailTemplateDto : IUnique<int>
|
||||
public record EmailTemplateDto
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
|
||||
@@ -1,16 +1,50 @@
|
||||
using DigitalData.Core.Abstractions;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace EnvelopeGenerator.Application.DTOs
|
||||
namespace EnvelopeGenerator.Application.DTOs;
|
||||
|
||||
/// <summary>
|
||||
/// Data Transfer Object representing certificate information for an envelope.
|
||||
/// </summary>
|
||||
[ApiExplorerSettings(IgnoreApi = true)]
|
||||
public class EnvelopeCertificateDto
|
||||
{
|
||||
[ApiExplorerSettings(IgnoreApi = true)]
|
||||
public record EnvelopeCertificateDto(
|
||||
int Id,
|
||||
int EnvelopeId,
|
||||
string EnvelopeUuid,
|
||||
string EnvelopeSubject,
|
||||
int CreatorId,
|
||||
string CreatorName,
|
||||
string CreatorEmail,
|
||||
int EnvelopeStatus) : IUnique<int>;
|
||||
/// <summary>
|
||||
/// Gets the unique identifier of the certificate.
|
||||
/// </summary>
|
||||
public int Id { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the envelope ID associated with the certificate.
|
||||
/// </summary>
|
||||
public int EnvelopeId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the UUID of the envelope.
|
||||
/// </summary>
|
||||
public string EnvelopeUuid { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the subject of the envelope.
|
||||
/// </summary>
|
||||
public string EnvelopeSubject { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the ID of the creator of the envelope.
|
||||
/// </summary>
|
||||
public int CreatorId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name of the creator.
|
||||
/// </summary>
|
||||
public string CreatorName { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the email address of the creator.
|
||||
/// </summary>
|
||||
public string CreatorEmail { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current status of the envelope.
|
||||
/// </summary>
|
||||
public int EnvelopeStatus { get; init; }
|
||||
}
|
||||
@@ -1,15 +1,35 @@
|
||||
using DigitalData.Core.Abstractions;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace EnvelopeGenerator.Application.DTOs
|
||||
namespace EnvelopeGenerator.Application.DTOs;
|
||||
|
||||
/// <summary>
|
||||
/// Data Transfer Object representing a document within an envelope, including optional binary data and form elements.
|
||||
/// </summary>
|
||||
[ApiExplorerSettings(IgnoreApi = true)]
|
||||
public class EnvelopeDocumentDto
|
||||
{
|
||||
[ApiExplorerSettings(IgnoreApi = true)]
|
||||
public record EnvelopeDocumentDto
|
||||
(
|
||||
int Id,
|
||||
int EnvelopeId,
|
||||
DateTime AddedWhen,
|
||||
byte[]? ByteData = null,
|
||||
IEnumerable<DocumentReceiverElementDto>? Elements = null
|
||||
) : IUnique<int>;
|
||||
/// <summary>
|
||||
/// Gets or sets the unique identifier of the document.
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the envelope ID to which the document belongs.
|
||||
/// </summary>
|
||||
public int EnvelopeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the date and time when the document was added.
|
||||
/// </summary>
|
||||
public DateTime AddedWhen { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the binary data of the document, if available.
|
||||
/// </summary>
|
||||
public byte[]? ByteData { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the collection of elements associated with the document for receiver interactions, if any.
|
||||
/// </summary>
|
||||
public IEnumerable<DocumentReceiverElementDto>? Elements { get; set; }
|
||||
}
|
||||
@@ -1,56 +1,54 @@
|
||||
using DigitalData.Core.Abstractions;
|
||||
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
|
||||
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
|
||||
using DigitalData.UserManager.Application.DTOs.User;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace EnvelopeGenerator.Application.DTOs
|
||||
namespace EnvelopeGenerator.Application.DTOs;
|
||||
|
||||
[ApiExplorerSettings(IgnoreApi = true)]
|
||||
public record EnvelopeDto
|
||||
{
|
||||
[ApiExplorerSettings(IgnoreApi = true)]
|
||||
public record EnvelopeDto() : IUnique<int>
|
||||
{
|
||||
public int Id { get; set; }
|
||||
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]")]
|
||||
public string Message { get; set; }
|
||||
[TemplatePlaceholder("[MESSAGE]")]
|
||||
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]")]
|
||||
public string Title { get; set; }
|
||||
[TemplatePlaceholder("[DOCUMENT_TITLE]")]
|
||||
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; }
|
||||
}
|
||||
@@ -1,12 +1,34 @@
|
||||
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)]
|
||||
public record EnvelopeHistoryCreateDto(
|
||||
int EnvelopeId,
|
||||
string UserReference,
|
||||
int Status,
|
||||
DateTime? ActionDate,
|
||||
string? Comment = null);
|
||||
/// <summary>
|
||||
/// Gets or sets the identifier of the envelope.
|
||||
/// </summary>
|
||||
public int EnvelopeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the user reference associated with the action.
|
||||
/// </summary>
|
||||
public required string UserReference { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the status of the envelope at the time of the action.
|
||||
/// </summary>
|
||||
public int Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the date and time when the action occurred.
|
||||
/// </summary>
|
||||
public DateTime? ActionDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets an optional comment related to the action.
|
||||
/// </summary>
|
||||
public string? Comment { get; set; }
|
||||
}
|
||||
@@ -1,36 +1,73 @@
|
||||
using DigitalData.Core.Abstractions;
|
||||
using DigitalData.Core.DTO;
|
||||
using DigitalData.UserManager.Application.DTOs.User;
|
||||
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using static EnvelopeGenerator.Common.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Data Transfer Object representing the history of an envelope, including status, sender, receiver, and related metadata.
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <param name="EnvelopeId"></param>
|
||||
/// <param name="UserReference"></param>
|
||||
/// <param name="Status"></param>
|
||||
/// <param name="StatusName"></param>
|
||||
/// <param name="AddedWhen"></param>
|
||||
/// <param name="ActionDate"></param>
|
||||
/// <param name="Sender"></param>
|
||||
/// <param name="Receiver"></param>
|
||||
/// <param name="ReferenceType"></param>
|
||||
/// <param name="Comment"></param>
|
||||
[ApiExplorerSettings(IgnoreApi = true)]
|
||||
public record EnvelopeHistoryDto(
|
||||
long Id,
|
||||
int EnvelopeId,
|
||||
string UserReference,
|
||||
int Status,
|
||||
string? StatusName,
|
||||
DateTime AddedWhen,
|
||||
DateTime? ActionDate,
|
||||
UserCreateDto? Sender,
|
||||
ReceiverReadDto? Receiver,
|
||||
ReferenceType ReferenceType,
|
||||
string? Comment = null) : BaseDTO<long>(Id), IUnique<long>;
|
||||
public record EnvelopeHistoryDto : IUnique<long>
|
||||
{
|
||||
/// <summary>
|
||||
/// Unique identifier for the envelope history entry.
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Identifier of the associated envelope.
|
||||
/// </summary>
|
||||
public int EnvelopeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Reference string for the user related to this history entry.
|
||||
/// </summary>
|
||||
public string UserReference { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Status code of the envelope at this history point.
|
||||
/// </summary>
|
||||
public int Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Human-readable name of the status.
|
||||
/// </summary>
|
||||
public string? StatusName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Date and time when this history entry was added.
|
||||
/// </summary>
|
||||
public DateTime AddedWhen { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Date and time when an action was performed, if applicable.
|
||||
/// </summary>
|
||||
public DateTime? ActionDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Information about the sender associated with this history entry.
|
||||
/// </summary>
|
||||
public UserCreateDto? Sender { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Information about the receiver associated with this history entry.
|
||||
/// </summary>
|
||||
public ReceiverReadDto? Receiver { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Type of reference for this history entry.
|
||||
/// </summary>
|
||||
public ReferenceType ReferenceType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Optional comment related to this history entry.
|
||||
/// </summary>
|
||||
public string? Comment { get; set; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Id.GetHashCode();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,18 +1,62 @@
|
||||
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||
using 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)]
|
||||
public record EnvelopeReceiverReadOnlyDto(
|
||||
long Id,
|
||||
long EnvelopeId,
|
||||
string ReceiverMail,
|
||||
DateTime DateValid,
|
||||
DateTime AddedWhen,
|
||||
string AddedWho,
|
||||
EnvelopeDto? Envelope = null,
|
||||
string? ChangedWho = null,
|
||||
DateTime? ChangedWhen = null,
|
||||
ReceiverReadDto? Receiver = null);
|
||||
/// <summary>
|
||||
/// Gets or inits the unique identifier of the envelope receiver.
|
||||
/// </summary>
|
||||
public long Id { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or inits the identifier of the associated envelope.
|
||||
/// </summary>
|
||||
public long EnvelopeId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or inits the email address of the receiver.
|
||||
/// </summary>
|
||||
public string ReceiverMail { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or inits the date until which the receiver is valid.
|
||||
/// </summary>
|
||||
public DateTime DateValid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or inits the date and time when the receiver was added.
|
||||
/// </summary>
|
||||
public DateTime AddedWhen { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or inits the user who added the receiver.
|
||||
/// </summary>
|
||||
public string AddedWho { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or inits the associated envelope details.
|
||||
/// </summary>
|
||||
public EnvelopeDto? Envelope { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or inits the user who last changed the receiver, if any.
|
||||
/// </summary>
|
||||
public string? ChangedWho { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or inits the date and time when the receiver was last changed, if any.
|
||||
/// </summary>
|
||||
public DateTime? ChangedWhen { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or inits the associated receiver details.
|
||||
/// </summary>
|
||||
public ReceiverReadDto? Receiver { get; set; }
|
||||
}
|
||||
@@ -1,14 +1,31 @@
|
||||
using DigitalData.Core.Abstractions;
|
||||
using 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)]
|
||||
public record EnvelopeReceiverReadOnlyUpdateDto(
|
||||
long Id,
|
||||
DateTime DateValid,
|
||||
string ChangedWho) : IUnique<long>
|
||||
{
|
||||
public DateTime ChangedWhen { get; } = DateTime.Now;
|
||||
};
|
||||
/// <summary>
|
||||
/// Gets or sets the unique identifier of the envelope receiver.
|
||||
/// </summary>
|
||||
public long Id { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the date when the envelope receiver becomes valid.
|
||||
/// </summary>
|
||||
public DateTime DateValid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the user who made the change.
|
||||
/// </summary>
|
||||
public string ChangedWho { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the date and time when the change was made.
|
||||
/// </summary>
|
||||
public DateTime ChangedWhen { get; set; } = DateTime.Now;
|
||||
}
|
||||
@@ -1,23 +1,85 @@
|
||||
using DigitalData.Core.Abstractions;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace EnvelopeGenerator.Application.DTOs
|
||||
namespace EnvelopeGenerator.Application.DTOs;
|
||||
|
||||
/// <summary>
|
||||
/// Data Transfer Object representing a type of envelope with its configuration settings.
|
||||
/// </summary>
|
||||
[ApiExplorerSettings(IgnoreApi = true)]
|
||||
public class EnvelopeTypeDto
|
||||
{
|
||||
[ApiExplorerSettings(IgnoreApi = true)]
|
||||
public record EnvelopeTypeDto(
|
||||
int Id,
|
||||
string Title,
|
||||
string Language,
|
||||
int? ExpiresDays,
|
||||
int? CertificationType,
|
||||
bool? UseAccessCode,
|
||||
int? FinalEmailToCreator,
|
||||
int? FinalEmailToReceivers,
|
||||
DateTime AddedWhen,
|
||||
DateTime? ChangedWhen,
|
||||
int? ExpiresWarningDays,
|
||||
bool? SendReminderEmails,
|
||||
int? FirstReminderDays,
|
||||
int? ReminderIntervalDays,
|
||||
int? ContractType) : IUnique<int>;
|
||||
/// <summary>
|
||||
/// Gets or sets the unique identifier of the envelope type.
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the title of the envelope type.
|
||||
/// </summary>
|
||||
public string Title { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the language code used in this envelope type.
|
||||
/// </summary>
|
||||
public string Language { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the number of days after which the envelope expires.
|
||||
/// </summary>
|
||||
public int? ExpiresDays { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the certification type identifier.
|
||||
/// </summary>
|
||||
public int? CertificationType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether an access code is required.
|
||||
/// </summary>
|
||||
public bool? UseAccessCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the final email template ID to be sent to the creator.
|
||||
/// </summary>
|
||||
public int? FinalEmailToCreator { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the final email template ID to be sent to the receivers.
|
||||
/// </summary>
|
||||
public int? FinalEmailToReceivers { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the timestamp when this envelope type was added.
|
||||
/// </summary>
|
||||
public DateTime AddedWhen { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the timestamp when this envelope type was last changed.
|
||||
/// </summary>
|
||||
public DateTime? ChangedWhen { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the number of days before expiry when a warning should be sent.
|
||||
/// </summary>
|
||||
public int? ExpiresWarningDays { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether reminder emails should be sent.
|
||||
/// </summary>
|
||||
public bool? SendReminderEmails { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the number of days before the first reminder is sent.
|
||||
/// </summary>
|
||||
public int? FirstReminderDays { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the interval in days between reminder emails.
|
||||
/// </summary>
|
||||
public int? ReminderIntervalDays { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the contract type associated with the envelope type.
|
||||
/// </summary>
|
||||
public int? ContractType { get; set; }
|
||||
}
|
||||
@@ -3,21 +3,30 @@ using System.ComponentModel.DataAnnotations;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
|
||||
namespace EnvelopeGenerator.Application.DTOs.Receiver
|
||||
{
|
||||
[ApiExplorerSettings(IgnoreApi = true)]
|
||||
public record ReceiverCreateDto([EmailAddress] string EmailAddress, string? TotpSecretkey = null)
|
||||
{
|
||||
public string Signature => sha256HexOfMail.Value;
|
||||
namespace EnvelopeGenerator.Application.DTOs.Receiver;
|
||||
|
||||
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 hash_arr = SHA256.HashData(bytes_arr);
|
||||
var hexa_str = BitConverter.ToString(hash_arr);
|
||||
return hexa_str.Replace("-", string.Empty);
|
||||
});
|
||||
}
|
||||
|
||||
public DateTime AddedWhen { get; } = DateTime.Now;
|
||||
};
|
||||
}
|
||||
[EmailAddress]
|
||||
public required string EmailAddress { get; init; }
|
||||
|
||||
public string? TotpSecretkey { get; init; }
|
||||
|
||||
public string Signature => _sha256HexOfMail.Value;
|
||||
|
||||
private readonly Lazy<string> _sha256HexOfMail;
|
||||
|
||||
public DateTime AddedWhen { get; } = DateTime.Now;
|
||||
};
|
||||
@@ -1,25 +1,31 @@
|
||||
using DigitalData.Core.Abstractions;
|
||||
using DigitalData.Core.DTO;
|
||||
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
||||
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace EnvelopeGenerator.Application.DTOs.Receiver;
|
||||
|
||||
[ApiExplorerSettings(IgnoreApi = true)]
|
||||
public record ReceiverReadDto(
|
||||
int Id,
|
||||
string EmailAddress,
|
||||
string Signature,
|
||||
DateTime AddedWhen
|
||||
) : BaseDTO<int>(Id), IUnique<int>
|
||||
public class ReceiverReadDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public string EmailAddress { get; set; }
|
||||
|
||||
public string Signature { get; set; }
|
||||
|
||||
public DateTime AddedWhen { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public IEnumerable<EnvelopeReceiverBasicDto>? EnvelopeReceivers { get; init; }
|
||||
public IEnumerable<EnvelopeReceiverBasicDto>? EnvelopeReceivers { get; set; }
|
||||
|
||||
public string? LastUsedName => EnvelopeReceivers?.LastOrDefault()?.Name;
|
||||
|
||||
public string? TotpSecretkey { get; set; } = null;
|
||||
|
||||
public DateTime? TfaRegDeadline { get; set; }
|
||||
};
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Id.GetHashCode();
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,27 @@
|
||||
using DigitalData.Core.Abstractions;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace EnvelopeGenerator.Application.DTOs.Receiver;
|
||||
|
||||
/// <summary>
|
||||
/// Data Transfer Object for updating a receiver's information.
|
||||
/// </summary>
|
||||
[ApiExplorerSettings(IgnoreApi = true)]
|
||||
public record ReceiverUpdateDto(int Id, string? TotpSecretkey = null, DateTime? TfaRegDeadline = null) : IUnique<int>;
|
||||
public class ReceiverUpdateDto
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the unique identifier of the receiver.
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the TOTP (Time-based One-Time Password) secret key.
|
||||
/// Optional.
|
||||
/// </summary>
|
||||
public string? TotpSecretkey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the deadline for two-factor authentication registration.
|
||||
/// Optional.
|
||||
/// </summary>
|
||||
public DateTime? TfaRegDeadline { get; set; }
|
||||
}
|
||||
@@ -1,15 +1,45 @@
|
||||
using DigitalData.Core.Abstractions;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace EnvelopeGenerator.Application.DTOs
|
||||
namespace EnvelopeGenerator.Application.DTOs;
|
||||
|
||||
/// <summary>
|
||||
/// Data Transfer Object representing a user receiver with associated details.
|
||||
/// </summary>
|
||||
[ApiExplorerSettings(IgnoreApi = true)]
|
||||
public class UserReceiverDto
|
||||
{
|
||||
[ApiExplorerSettings(IgnoreApi = true)]
|
||||
public record UserReceiverDto(
|
||||
int Id,
|
||||
int UserId,
|
||||
int ReceiverId,
|
||||
string Name,
|
||||
string CompanyName,
|
||||
string JobTitle,
|
||||
DateTime AddedWhen) : IUnique<int>;
|
||||
/// <summary>
|
||||
/// Gets or sets the unique identifier of the user receiver.
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the identifier of the user associated with the receiver.
|
||||
/// </summary>
|
||||
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; }
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
using DigitalData.Core.Abstractions.Infrastructure;
|
||||
using DigitalData.Core.Application.Interfaces.Repository;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using MediatR;
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using DigitalData.Core.Abstractions.Infrastructure;
|
||||
using DigitalData.Core.Application.Interfaces.Repository;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Application.EmailTemplates.Queries.Read;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using MediatR;
|
||||
|
||||
@@ -70,7 +69,7 @@ public class ResetEmailTemplateCommandHandler : IRequestHandler<ResetEmailTempla
|
||||
new(){
|
||||
Id = 4,
|
||||
Name = "DocumentCompleted",
|
||||
Body = "Guten Tag [NAME_RECEIVER],<br />\r\n<br />\r\nDer Signaturvorgang <B><I>'[DOCUMENT_TITLE]'</I></B> wurde erfolgreich abgeschlossen.<br />\r\n<br />\r\nSie erhalten das Dokument mit einem detaillierten Ergebnisbericht als Anhang zu dieser Email.<br />\r\n<br />\r\nMit freundlichen Grüßen<br />\r\n<br />\r\n[NAME_PORTAL]",
|
||||
Body = "Guten Tag [NAME_RECEIVER],<br />\r\n<br />\r\nDer Signaturvorgang <B><I>'[DOCUMENT_TITLE]'</I></B> wurde erfolgreich abgeschlossen.<br />\r\n<br />\r\nSie erhalten das Dokument mit einem detaillierten Ergebnisbericht als Anhang zu dieser EmailAddress.<br />\r\n<br />\r\nMit freundlichen Grüßen<br />\r\n<br />\r\n[NAME_PORTAL]",
|
||||
Subject = "Umschlag abgeschlossen: '[DOCUMENT_TITLE]'"
|
||||
},
|
||||
new(){
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using DigitalData.Core.Abstractions.Infrastructure;
|
||||
using DigitalData.Core.Application.Interfaces.Repository;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Application.Exceptions;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
@@ -14,16 +14,13 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Dapper" Version="2.1.66" />
|
||||
<PackageReference Include="DigitalData.Core.Abstractions" Version="3.6.0" />
|
||||
<PackageReference Include="DigitalData.Core.Application" Version="3.2.1" />
|
||||
<PackageReference Include="DigitalData.Core.Client" Version="2.0.3" />
|
||||
<PackageReference Include="DigitalData.Core.DTO" Version="2.0.1" />
|
||||
<PackageReference Include="DigitalData.EmailProfilerDispatcher" Version="3.0.0" />
|
||||
<PackageReference Include="DigitalData.Core.Abstractions" Version="4.0.0" />
|
||||
<PackageReference Include="DigitalData.Core.Application" Version="3.3.1" />
|
||||
<PackageReference Include="DigitalData.Core.Client" Version="2.1.0" />
|
||||
<PackageReference Include="DigitalData.EmailProfilerDispatcher" Version="3.1.0" />
|
||||
<PackageReference Include="MediatR" Version="12.5.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.18" />
|
||||
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.1" />
|
||||
<PackageReference Include="Microsoft.Data.SqlClient" Version="6.0.2" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.4" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.5" />
|
||||
<PackageReference Include="Otp.NET" Version="1.4.0" />
|
||||
<PackageReference Include="QRCoder" Version="1.6.0" />
|
||||
<PackageReference Include="QRCoder-ImageSharp" Version="0.10.0" />
|
||||
@@ -65,6 +62,7 @@
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
|
||||
<PackageReference Include="AutoMapper" Version="13.0.1" />
|
||||
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.3" />
|
||||
<PackageReference Include="CommandDotNet">
|
||||
<Version>7.0.5</Version>
|
||||
</PackageReference>
|
||||
@@ -72,6 +70,7 @@
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
|
||||
<PackageReference Include="AutoMapper" Version="14.0.0" />
|
||||
<PackageReference Include="Microsoft.Data.SqlClient" Version="6.0.2" />
|
||||
<PackageReference Include="CommandDotNet">
|
||||
<Version>8.1.1</Version>
|
||||
</PackageReference>
|
||||
@@ -79,6 +78,7 @@
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
|
||||
<PackageReference Include="AutoMapper" Version="14.0.0" />
|
||||
<PackageReference Include="Microsoft.Data.SqlClient" Version="6.0.2" />
|
||||
<PackageReference Include="CommandDotNet">
|
||||
<Version>8.1.1</Version>
|
||||
</PackageReference>
|
||||
|
||||
@@ -7,6 +7,7 @@ using DigitalData.Core.DTO;
|
||||
using EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
|
||||
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||
using EnvelopeGenerator.Application.Contracts.Services;
|
||||
using DigitalData.Core.Application.DTO;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Services;
|
||||
|
||||
@@ -76,9 +77,16 @@ public class EnvelopeHistoryService : CRUDService<IEnvelopeHistoryRepository, En
|
||||
}
|
||||
|
||||
public async Task<DataResult<long>> RecordAsync(int envelopeId, string userReference, EnvelopeStatus status, string? comment = null) =>
|
||||
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(
|
||||
Success: id => Result.Success(id),
|
||||
Success: dto => Result.Success(dto.Id),
|
||||
Fail: (mssg, ntc) => Result.Fail<long>().Message(mssg).Notice(ntc)
|
||||
);
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
using AutoMapper;
|
||||
using DigitalData.Core.Abstractions.Client;
|
||||
using DigitalData.Core.Client.Interface;
|
||||
using DigitalData.Core.Client;
|
||||
using EnvelopeGenerator.Application.Configurations;
|
||||
using EnvelopeGenerator.Application.Contracts.Services;
|
||||
|
||||
@@ -4,7 +4,6 @@ using EnvelopeGenerator.Domain.Entities;
|
||||
using EnvelopeGenerator.Application.Contracts.Repositories;
|
||||
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||
using DigitalData.Core.DTO;
|
||||
using DigitalData.Core.Abstractions;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using EnvelopeGenerator.Application.Contracts.Services;
|
||||
|
||||
@@ -37,12 +36,12 @@ public class ReceiverService : CRUDService<IReceiverRepository, ReceiverCreateDt
|
||||
return await _repository.DeleteAsync(rcv) ? Result.Success() : Result.Fail();
|
||||
}
|
||||
|
||||
public virtual async Task<Result> UpdateAsync<TUpdateDto>(TUpdateDto updateDto) where TUpdateDto : IUnique<int>
|
||||
public virtual async Task<Result> UpdateAsync<TUpdateDto>(TUpdateDto updateDto)
|
||||
{
|
||||
var val = await _repository.ReadByIdAsync(updateDto.Id);
|
||||
var val = await _repository.ReadByIdAsync(updateDto.GetId<int>());
|
||||
if (val == null)
|
||||
{
|
||||
return Result.Fail().Notice(LogLevel.Warning, Flag.NotFound, $"{updateDto.Id} is not found in update process of {GetType()} entity.");
|
||||
return Result.Fail().Notice(LogLevel.Warning, Flag.NotFound, $"{updateDto.GetIdOrDefault<int>()} is not found in update process of {GetType()} entity.");
|
||||
}
|
||||
|
||||
var entity = _mapper.Map(updateDto, val);
|
||||
|
||||
@@ -1,152 +0,0 @@
|
||||
Public Class Constants
|
||||
|
||||
#Region "Status Fields"
|
||||
'http://wiki.dd/xwiki13/bin/view/Anwendungen/Produkt-Handbuch/Sonstiges/SignFlow/Envelope%20Status/
|
||||
Public Enum EnvelopeStatus
|
||||
Invalid = 0
|
||||
EnvelopeCreated = 1001
|
||||
EnvelopeSaved = 1002
|
||||
EnvelopeQueued = 1003
|
||||
EnvelopeSent = 1004 ' Nicht verwendet
|
||||
EnvelopePartlySigned = 1005
|
||||
EnvelopeCompletelySigned = 1006
|
||||
EnvelopeReportCreated = 1007
|
||||
EnvelopeArchived = 1008
|
||||
EnvelopeDeleted = 1009
|
||||
EnvelopeRejected = 10007
|
||||
EnvelopeWithdrawn = 10009
|
||||
AccessCodeRequested = 2001
|
||||
AccessCodeCorrect = 2002
|
||||
AccessCodeIncorrect = 2003
|
||||
DocumentOpened = 2004
|
||||
DocumentSigned = 2005
|
||||
DocumentForwarded = 2006
|
||||
DocumentRejected = 2007
|
||||
EnvelopeShared = 2008
|
||||
EnvelopeViewed = 2009
|
||||
MessageInvitationSent = 3001 ' Wird von Trigger verwendet
|
||||
MessageAccessCodeSent = 3002
|
||||
MessageConfirmationSent = 3003
|
||||
MessageDeletionSent = 3004
|
||||
MessageCompletionSent = 3005
|
||||
DocumentMod_Rotation = 4001
|
||||
End Enum
|
||||
|
||||
Public Class Status
|
||||
Public Shared ReadOnly NonHist As IReadOnlyList(Of EnvelopeStatus) = New List(Of EnvelopeStatus) From {
|
||||
EnvelopeStatus.Invalid,
|
||||
EnvelopeStatus.EnvelopeSaved,
|
||||
EnvelopeStatus.EnvelopeSent,
|
||||
EnvelopeStatus.EnvelopePartlySigned
|
||||
}
|
||||
|
||||
Public Shared ReadOnly RelatedToFormApp As IReadOnlyList(Of EnvelopeStatus) = New List(Of EnvelopeStatus) From {
|
||||
EnvelopeStatus.EnvelopeCreated,
|
||||
EnvelopeStatus.DocumentMod_Rotation
|
||||
}
|
||||
End Class
|
||||
|
||||
'TODO: standardize in xwiki
|
||||
Public Enum ReferenceType
|
||||
Sender = 1
|
||||
Receiver
|
||||
System
|
||||
Unknown
|
||||
End Enum
|
||||
|
||||
Public Enum ElementStatus
|
||||
Created = 0
|
||||
End Enum
|
||||
|
||||
Public Enum DocumentStatus
|
||||
Created = 0
|
||||
Signed = 1
|
||||
End Enum
|
||||
|
||||
Public Enum ReceiverStatus
|
||||
Unsigned = 0
|
||||
Signed = 1
|
||||
End Enum
|
||||
#End Region
|
||||
|
||||
#Region "Type Fields"
|
||||
Public Enum ElementType
|
||||
Signature = 1
|
||||
End Enum
|
||||
|
||||
Public Enum ContractType
|
||||
Contract = 1
|
||||
ReadAndSign = 2
|
||||
End Enum
|
||||
|
||||
Public Enum ColorType
|
||||
ReceiverColor1 = 1
|
||||
ReceiverColor2 = 2
|
||||
ReceiverColor3 = 3
|
||||
ReceiverColor4 = 4
|
||||
ReceiverColor5 = 5
|
||||
ReceiverColor6 = 6
|
||||
ReceiverColor7 = 7
|
||||
ReceiverColor8 = 8
|
||||
ReceiverColor9 = 9
|
||||
ReceiverColor10 = 10
|
||||
End Enum
|
||||
|
||||
Public Enum CertificationType
|
||||
AdvancedElectronicSignature = 1
|
||||
'ElectronicSignature = 1
|
||||
'QualifiedSignature = 2
|
||||
End Enum
|
||||
|
||||
Public Enum FinalEmailType
|
||||
No = 0
|
||||
Yes = 1
|
||||
YesWithAttachment = 2
|
||||
End Enum
|
||||
|
||||
Public Enum PageOrientation
|
||||
Portrait = 0
|
||||
Landscape = 1
|
||||
End Enum
|
||||
|
||||
Public Enum EmailTemplateType
|
||||
DocumentReceived = 0
|
||||
DocumentSigned
|
||||
DocumentDeleted
|
||||
DocumentCompleted
|
||||
DocumentAccessCodeReceived
|
||||
DocumentShared
|
||||
TotpSecret
|
||||
DocumentRejected_ADM
|
||||
DocumentRejected_REC
|
||||
DocumentRejected_REC_2
|
||||
End Enum
|
||||
|
||||
Public Enum EncodeType
|
||||
EnvelopeReceiver
|
||||
EnvelopeReceiverReadOnly
|
||||
Undefined
|
||||
DocumentForwarded
|
||||
DocumentShared
|
||||
End Enum
|
||||
#End Region
|
||||
|
||||
#Region "Role"
|
||||
Public NotInheritable Class ReceiverRole
|
||||
Public Const PreAuth As String = "PreAuth"
|
||||
Public Const FullyAuth As String = "FullyAuth"
|
||||
End Class
|
||||
#End Region
|
||||
|
||||
#Region "Constants"
|
||||
|
||||
Public Const DATABASE = "DATABASE"
|
||||
Public Const LOGCONFIG = "LOGCONFIG"
|
||||
Public Const GDPICTURE = "GDPICTURE"
|
||||
Public Const PDF_BURNER_PARAMS = "PDFBurnerParams"
|
||||
|
||||
Public Const GREEN_300 = "#bbf7d0"
|
||||
Public Const RED_300 = "#fecaca"
|
||||
Public Const ORANGE_300 = "#fed7aa"
|
||||
#End Region
|
||||
End Class
|
||||
@@ -1,10 +0,0 @@
|
||||
Public Class DocumentStatus
|
||||
|
||||
Public Property Id As Integer
|
||||
Public Property EnvelopeId As Integer
|
||||
Public Property ReceiverId As Integer
|
||||
Public Property Value As String
|
||||
Public Property Status As Constants.DocumentStatus = Constants.DocumentStatus.Created
|
||||
Public Property StatusChangedWhen As Date
|
||||
|
||||
End Class
|
||||
@@ -1,4 +0,0 @@
|
||||
Public Class ElementMetadata
|
||||
Public Property Index As Integer
|
||||
Public Property Page As Integer
|
||||
End Class
|
||||
@@ -1,4 +1,7 @@
|
||||
Public Class ElementStatus
|
||||
Imports EnvelopeGenerator.Domain
|
||||
|
||||
<Obsolete("Tabelle TBSIG_ELEMENT_STATUS entfernt")>
|
||||
Public Class ElementStatus
|
||||
|
||||
Public Property Id As Integer
|
||||
Public Property EnvelopeId As Integer
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
|
||||
Imports EnvelopeGenerator.Domain
|
||||
Public Class EmailData
|
||||
Public Property EmailAdress As String = ""
|
||||
Public Property EmailSubject As String = ""
|
||||
@@ -27,8 +27,8 @@ Public Class EmailData
|
||||
''' <param name="pEnvelope"></param>
|
||||
''' <param name="pReceiver"></param>
|
||||
''' <param name="pStatus"></param>
|
||||
Public Sub New(pEnvelope As Envelope, pReceiver As EnvelopeReceiver, pStatus As Constants.EnvelopeStatus)
|
||||
EmailAdress = pReceiver.Email
|
||||
Public Sub New(pEnvelope As Envelope, pReceiver As Receiver, pStatus As Constants.EnvelopeStatus)
|
||||
EmailAdress = pReceiver.EmailAddress
|
||||
EmailSubject = String.Empty
|
||||
EmailType = pStatus
|
||||
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
Public Class EmailTemplate
|
||||
|
||||
Public Property Id As Integer
|
||||
Public Property Name As String
|
||||
Public Property Body As String
|
||||
Public Property Subject As String
|
||||
|
||||
End Class
|
||||
@@ -1,4 +1,7 @@
|
||||
Public Class Envelope
|
||||
Imports EnvelopeGenerator.Domain
|
||||
Imports EnvelopeGenerator.Domain.Entities
|
||||
|
||||
Public Class Envelope
|
||||
Public Property Id As Integer = 0
|
||||
Public Property UserId As Integer
|
||||
Public Property Title As String = ""
|
||||
@@ -29,7 +32,7 @@
|
||||
Public Property User As New User()
|
||||
|
||||
Public Property Documents As New List(Of EnvelopeDocument)
|
||||
Public Property Receivers As New List(Of EnvelopeReceiver)
|
||||
Public Property Receivers As New List(Of Receiver)
|
||||
Public Property History As New List(Of EnvelopeHistoryEntry)
|
||||
Public Property EnvelopeType As EnvelopeType
|
||||
Public Property DOC_RESULT As Byte()
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
Public Class EnvelopeDocumentElement
|
||||
Imports EnvelopeGenerator.Domain
|
||||
|
||||
Public Class EnvelopeDocumentElement
|
||||
Public Property Id As Integer = -1
|
||||
Public Property X As Double
|
||||
Public Property Y As Double
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
Public Class EnvelopeHistoryEntry
|
||||
Imports EnvelopeGenerator.Domain
|
||||
|
||||
Public Class EnvelopeHistoryEntry
|
||||
Public Property EnvelopeId As Integer
|
||||
Public Property UserReference As String
|
||||
Public Property Status As Constants.EnvelopeStatus
|
||||
|
||||
@@ -1,83 +1,4 @@
|
||||
Imports System.Drawing
|
||||
Imports System.Runtime.Serialization
|
||||
Imports DevExpress.Utils.Svg
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports EnvelopeGenerator.Common.Constants
|
||||
Imports Newtonsoft.Json
|
||||
|
||||
Public Class EnvelopeReceiver
|
||||
Public Property Id As Integer = 0
|
||||
Public Property UserId As Integer
|
||||
Public Property Signature As String
|
||||
Public ReadOnly Property Color As Color
|
||||
Get
|
||||
Return Helpers.ColorTypeToColor(ColorType)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<JsonIgnore>
|
||||
Public ReadOnly Property Image As SvgBitmap
|
||||
Get
|
||||
Try
|
||||
Return SvgBitmap.FromFile("Images/circle.svg")
|
||||
Catch ex As Exception
|
||||
Return Nothing
|
||||
End Try
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
Public Property ColorType As ColorType
|
||||
|
||||
Public Property Name As String
|
||||
|
||||
Public Property Company As String = ""
|
||||
|
||||
Public Property JobTitle As String = ""
|
||||
|
||||
Public Property Email As String
|
||||
|
||||
Public Property Status As ReceiverStatus
|
||||
|
||||
Public ReadOnly Property StatusTranslated As String
|
||||
Get
|
||||
Dim oStatus = Status.ToString()
|
||||
Return My.Resources.Model.ResourceManager.GetString(oStatus)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property SignedDate As DateTime = DateTime.MinValue
|
||||
|
||||
Public ReadOnly Property SignedDateDisplayValue As String
|
||||
Get
|
||||
If SignedDate = DateTime.MinValue Then
|
||||
Return "-"
|
||||
Else
|
||||
Return SignedDate.ToString("G")
|
||||
End If
|
||||
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property HasId As Boolean
|
||||
Get
|
||||
Return Id > 0
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property HasEmailAndName As Boolean
|
||||
Get
|
||||
Return String.IsNullOrWhiteSpace(Email) = False And
|
||||
String.IsNullOrWhiteSpace(Name) = False
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property Sequence As Integer = 0
|
||||
Public Property PrivateMessage As String = ""
|
||||
Public Property AccessCode As String = ""
|
||||
Public Property PhoneNumber As String = ""
|
||||
|
||||
Public Function GetSignature() As String
|
||||
Return StringEx.GetChecksum(Email.ToUpper)
|
||||
End Function
|
||||
Public Class EnvelopeReceiver
|
||||
Public Property Envelope As Envelope
|
||||
Public Property Receiver As Receiver
|
||||
End Class
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
Public Class EnvelopeResponse
|
||||
Public Property Envelope As Envelope
|
||||
Public Property Receiver As EnvelopeReceiver
|
||||
End Class
|
||||
@@ -1,4 +1,5 @@
|
||||
Public Class EnvelopeType
|
||||
Imports EnvelopeGenerator.Domain
|
||||
Public Class EnvelopeType
|
||||
|
||||
Public Property Id As Integer = 0
|
||||
Public Property Title As String
|
||||
|
||||
60
EnvelopeGenerator.Common/Entities/Receiver.vb
Normal file
60
EnvelopeGenerator.Common/Entities/Receiver.vb
Normal file
@@ -0,0 +1,60 @@
|
||||
Imports System.Drawing
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports EnvelopeGenerator.Domain.Constants
|
||||
|
||||
Public Class Receiver
|
||||
Public Property Id As Integer = 0
|
||||
Public Property Signature As String
|
||||
Public ReadOnly Property Color As Color
|
||||
Get
|
||||
Return Helpers.ColorTypeToColor(ColorType)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property ColorType As ColorType
|
||||
|
||||
Public Property Name As String
|
||||
|
||||
Public Property Company As String = ""
|
||||
|
||||
Public Property JobTitle As String = ""
|
||||
|
||||
Public Property EmailAddress As String
|
||||
|
||||
Public Property Status As ReceiverStatus
|
||||
|
||||
Public Property SignedDate As DateTime = DateTime.MinValue
|
||||
|
||||
Public ReadOnly Property SignedDateDisplayValue As String
|
||||
Get
|
||||
If SignedDate = DateTime.MinValue Then
|
||||
Return "-"
|
||||
Else
|
||||
Return SignedDate.ToString("G")
|
||||
End If
|
||||
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property HasId As Boolean
|
||||
Get
|
||||
Return Id > 0
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property HasEmailAndName As Boolean
|
||||
Get
|
||||
Return String.IsNullOrWhiteSpace(EmailAddress) = False And
|
||||
String.IsNullOrWhiteSpace(Name) = False
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property Sequence As Integer = 0
|
||||
Public Property PrivateMessage As String = ""
|
||||
Public Property AccessCode As String = ""
|
||||
Public Property PhoneNumber As String = ""
|
||||
|
||||
Public Function GetSignature() As String
|
||||
Return StringEx.GetChecksum(EmailAddress.ToUpper)
|
||||
End Function
|
||||
End Class
|
||||
@@ -1,5 +1,6 @@
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports EnvelopeGenerator.Domain.Entities
|
||||
|
||||
Public Class State
|
||||
Public Property UserId As Integer
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
Public Class User
|
||||
Public Property Id As Integer = 0
|
||||
Public Property Prename As String
|
||||
Public Property Name As String
|
||||
Public Property Username As String
|
||||
Public Property Email As String
|
||||
Public Property Language As String
|
||||
|
||||
Public Property HasAccess As Boolean
|
||||
Public Property IsAdmin As Boolean
|
||||
Public Property GhostModeActive As Boolean
|
||||
|
||||
Public ReadOnly Property FullName() As String
|
||||
Get
|
||||
Return Prename + " " + Name
|
||||
End Get
|
||||
End Property
|
||||
End Class
|
||||
@@ -274,13 +274,9 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Config.vb" />
|
||||
<Compile Include="Constants.vb" />
|
||||
<Compile Include="Entities\DbConfig.vb" />
|
||||
<Compile Include="Entities\ElementMetadata.vb" />
|
||||
<Compile Include="Entities\DocumentStatus.vb" />
|
||||
<Compile Include="Entities\ElementStatus.vb" />
|
||||
<Compile Include="Entities\EmailData.vb" />
|
||||
<Compile Include="Entities\EmailTemplate.vb" />
|
||||
<Compile Include="Jobs\APIBackendJobs\APIEnvelopeJob.vb" />
|
||||
<Compile Include="Jobs\FinalizeDocument\PDFBurnerParams.vb" />
|
||||
<Compile Include="Services\TemplateService.vb" />
|
||||
@@ -288,11 +284,10 @@
|
||||
<Compile Include="Entities\EnvelopeDocument.vb" />
|
||||
<Compile Include="Entities\EnvelopeDocumentElement.vb" />
|
||||
<Compile Include="Entities\EnvelopeHistoryEntry.vb" />
|
||||
<Compile Include="Entities\Receiver.vb" />
|
||||
<Compile Include="Entities\EnvelopeReceiver.vb" />
|
||||
<Compile Include="Entities\EnvelopeResponse.vb" />
|
||||
<Compile Include="Entities\EnvelopeType.vb" />
|
||||
<Compile Include="Entities\State.vb" />
|
||||
<Compile Include="Entities\User.vb" />
|
||||
<Compile Include="Helpers.vb" />
|
||||
<Compile Include="Jobs\FinalizeDocument\FinalizeDocumentExceptions.vb" />
|
||||
<Compile Include="Jobs\FinalizeDocument\FinalizeDocumentJob.vb" />
|
||||
@@ -443,7 +438,12 @@
|
||||
<EmbeddedResource Include="Templates\document_access_code_de.html" />
|
||||
<EmbeddedResource Include="Templates\email_de.html" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\EnvelopeGenerator.Domain\EnvelopeGenerator.Domain.csproj">
|
||||
<Project>{4f32a98d-e6f0-4a09-bd97-1cf26107e837}</Project>
|
||||
<Name>EnvelopeGenerator.Domain</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
|
||||
@@ -3,7 +3,7 @@ Imports System.IO
|
||||
Imports System.Security.Cryptography
|
||||
Imports System.Text
|
||||
Imports DevExpress.Utils.Svg
|
||||
Imports EnvelopeGenerator.Common.Constants
|
||||
Imports EnvelopeGenerator.Domain.Constants
|
||||
|
||||
Public Class Helpers
|
||||
Private Shared key As String = "$xzBvyPETUS&amm8)D8x#)f;4%;?[BPd" ' Passwort-Schlüssel (16, 24, or 32 bytes)
|
||||
|
||||
@@ -1,16 +1,9 @@
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports GdPicture14
|
||||
Imports Quartz
|
||||
Imports System.Security.Cryptography
|
||||
Imports System.IO
|
||||
Imports EnvelopeGenerator.Common.Jobs.FinalizeDocument.FinalizeDocumentExceptions
|
||||
Imports EnvelopeGenerator.Common.Jobs.FinalizeDocument
|
||||
Imports EnvelopeGenerator.Common.Constants
|
||||
Imports DevExpress.DataProcessing
|
||||
Imports System.Data.SqlClient
|
||||
Imports DevExpress.XtraRichEdit.Layout.Engine
|
||||
|
||||
Namespace Jobs
|
||||
Public Class APIEnvelopeJob
|
||||
@@ -39,7 +32,7 @@ Namespace Jobs
|
||||
End Class
|
||||
|
||||
Public Function Execute(pContext As IJobExecutionContext) As Task Implements IJob.Execute
|
||||
LogConfig = pContext.MergedJobDataMap.Item(Constants.LOGCONFIG)
|
||||
LogConfig = pContext.MergedJobDataMap.Item(Domain.Constants.LOGCONFIG)
|
||||
Logger = LogConfig.GetLogger()
|
||||
myTempFiles = New TempFiles(LogConfig)
|
||||
myTempFiles.Create()
|
||||
@@ -179,7 +172,7 @@ Namespace Jobs
|
||||
ActionService = New ActionService(pState, Database)
|
||||
End Sub
|
||||
Private Function GetDatabase(pContext As IJobExecutionContext, pLogConfig As LogConfig) As MSSQLServer
|
||||
Dim oConnectionString As String = pContext.MergedJobDataMap.Item(Constants.DATABASE)
|
||||
Dim oConnectionString As String = pContext.MergedJobDataMap.Item(Domain.Constants.DATABASE)
|
||||
Dim Database = New MSSQLServer(pLogConfig, MSSQLServer.DecryptConnectionString(oConnectionString))
|
||||
|
||||
Return Database
|
||||
|
||||
@@ -7,7 +7,7 @@ Imports System.Security.Cryptography
|
||||
Imports System.IO
|
||||
Imports EnvelopeGenerator.Common.Jobs.FinalizeDocument.FinalizeDocumentExceptions
|
||||
Imports EnvelopeGenerator.Common.Jobs.FinalizeDocument
|
||||
Imports EnvelopeGenerator.Common.Constants
|
||||
Imports EnvelopeGenerator.Domain.Constants
|
||||
Imports DevExpress.DataProcessing
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
@@ -47,8 +47,8 @@ Namespace Jobs
|
||||
End Class
|
||||
|
||||
Public Function Execute(pContext As IJobExecutionContext) As Task Implements IJob.Execute
|
||||
Dim oGdPictureKey As String = pContext.MergedJobDataMap.Item(Constants.GDPICTURE)
|
||||
LogConfig = pContext.MergedJobDataMap.Item(Constants.LOGCONFIG)
|
||||
Dim oGdPictureKey As String = pContext.MergedJobDataMap.Item(Domain.Constants.GDPICTURE)
|
||||
LogConfig = pContext.MergedJobDataMap.Item(Domain.Constants.LOGCONFIG)
|
||||
Logger = LogConfig.GetLogger()
|
||||
myTempFiles = New TempFiles(LogConfig)
|
||||
myTempFiles.Create()
|
||||
@@ -74,7 +74,7 @@ Namespace Jobs
|
||||
InitializeServices(oState)
|
||||
|
||||
Logger.Debug("Loading PDFBurner..")
|
||||
Dim pdfBurnerParams As PDFBurnerParams = pContext.MergedJobDataMap.Item(Constants.PDF_BURNER_PARAMS)
|
||||
Dim pdfBurnerParams As PDFBurnerParams = pContext.MergedJobDataMap.Item(PDF_BURNER_PARAMS)
|
||||
PDFBurner = New PDFBurner(LogConfig, oGdPictureKey, pdfBurnerParams)
|
||||
|
||||
Logger.Debug("Loading PDFMerger..")
|
||||
@@ -90,7 +90,7 @@ Namespace Jobs
|
||||
|
||||
Logger.Debug("ExportPath: [{0}]", Config.ExportPath)
|
||||
|
||||
Dim oCompleteStatus As Integer = Constants.EnvelopeStatus.EnvelopeCompletelySigned
|
||||
Dim oCompleteStatus As Integer = EnvelopeStatus.EnvelopeCompletelySigned
|
||||
Dim oSql = $"SELECT * FROM TBSIG_ENVELOPE WHERE STATUS = {oCompleteStatus} AND DATEDIFF(minute, CHANGED_WHEN, GETDATE()) >= {CompleteWaitTime} ORDER BY GUID"
|
||||
Dim oTable = Database.GetDatatable(oSql)
|
||||
|
||||
@@ -334,7 +334,7 @@ Namespace Jobs
|
||||
|
||||
For Each oReceiver In pEnvelope.Receivers
|
||||
If ActionService.CompleteEnvelope(pEnvelope, oReceiver) = False Then ', oAttachment
|
||||
Logger.Error("Envelope could not be completed for receiver [{0}]", oReceiver.Email)
|
||||
Logger.Error("Envelope could not be completed for receiver [{0}]", oReceiver.EmailAddress)
|
||||
Return False
|
||||
End If
|
||||
Next
|
||||
@@ -436,7 +436,7 @@ Namespace Jobs
|
||||
End Sub
|
||||
|
||||
Private Function GetDatabase(pContext As IJobExecutionContext, pLogConfig As LogConfig) As MSSQLServer
|
||||
Dim oConnectionString As String = pContext.MergedJobDataMap.Item(Constants.DATABASE)
|
||||
Dim oConnectionString As String = pContext.MergedJobDataMap.Item(Domain.Constants.DATABASE)
|
||||
Dim Database = New MSSQLServer(pLogConfig, MSSQLServer.DecryptConnectionString(oConnectionString))
|
||||
|
||||
Return Database
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Imports System.Windows.Forms.VisualStyles.VisualStyleElement
|
||||
Imports EnvelopeGenerator.Domain
|
||||
|
||||
Public Class ReportItem
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Imports System.Data.SqlClient
|
||||
Imports EnvelopeGenerator.Domain.Entities
|
||||
|
||||
Public Class DocumentStatusModel
|
||||
Inherits BaseModel
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.Data.SqlClient
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports EnvelopeGenerator.Domain
|
||||
|
||||
Public Class ElementModel
|
||||
Inherits BaseModel
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
<Obsolete("Tabelle TBSIG_ELEMENT_STATUS entfernt")>
|
||||
Public Class ElementStatusModel
|
||||
Inherits BaseModel
|
||||
|
||||
@@ -7,6 +8,7 @@ Public Class ElementStatusModel
|
||||
MyBase.New(pState)
|
||||
End Sub
|
||||
|
||||
<Obsolete("Tabelle TBSIG_ELEMENT_STATUS entfernt")>
|
||||
Public Function Insert(pElementStatus As ElementStatus) As Boolean
|
||||
Try
|
||||
Dim oSql = "INSERT INTO [dbo].[TBSIG_ELEMENT_STATUS]
|
||||
@@ -41,6 +43,7 @@ Public Class ElementStatusModel
|
||||
End Try
|
||||
End Function
|
||||
|
||||
<Obsolete("Tabelle TBSIG_ELEMENT_STATUS entfernt")>
|
||||
Public Function Update(pElementStatus As ElementStatus) As Boolean
|
||||
Try
|
||||
Dim oSql = "UPDATE [dbo].[TBSIG_ELEMENT_STATUS]
|
||||
@@ -68,6 +71,7 @@ Public Class ElementStatusModel
|
||||
End Try
|
||||
End Function
|
||||
|
||||
<Obsolete("Tabelle TBSIG_ELEMENT_STATUS entfernt")>
|
||||
Private Function GetElementId(pElement As ElementStatus) As Integer
|
||||
Try
|
||||
Return Database.GetScalarValue($"SELECT MAX(GUID) FROM TBSIG_ELEMENT_STATUS
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports EnvelopeGenerator.Common.Constants
|
||||
Imports EnvelopeGenerator.Domain.Constants
|
||||
Imports EnvelopeGenerator.Domain.Entities
|
||||
|
||||
Public Class EmailTemplateModel
|
||||
Inherits BaseModel
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.Web.UI.WebControls
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports EnvelopeGenerator.Common.Constants
|
||||
Imports EnvelopeGenerator.Domain.Constants
|
||||
Imports EnvelopeGenerator.Domain.Entities
|
||||
|
||||
Public Class EnvelopeModel
|
||||
Inherits BaseModel
|
||||
@@ -33,10 +33,10 @@ Public Class EnvelopeModel
|
||||
.Message = pRow.ItemEx("MESSAGE", ""),
|
||||
.UserId = pRow.ItemEx("USER_ID", 0),
|
||||
.Language = pRow.ItemEx("LANGUAGE", "de-DE"),
|
||||
.Status = ObjectEx.ToEnum(Of Constants.EnvelopeStatus)(pRow.ItemEx("STATUS", Constants.EnvelopeStatus.EnvelopeCreated.ToString())),
|
||||
.Status = ObjectEx.ToEnum(Of EnvelopeStatus)(pRow.ItemEx("STATUS", EnvelopeStatus.EnvelopeCreated.ToString())),
|
||||
.AddedWhen = pRow.Item("ADDED_WHEN"),
|
||||
.ChangedWhen = pRow.ItemEx(Of Date)("CHANGED_WHEN", Nothing),
|
||||
.CertificationType = ObjectEx.ToEnum(Of Constants.CertificationType)(pRow.ItemEx("CERTIFICATION_TYPE", Constants.CertificationType.AdvancedElectronicSignature.ToString())),
|
||||
.CertificationType = ObjectEx.ToEnum(Of CertificationType)(pRow.ItemEx("CERTIFICATION_TYPE", CertificationType.AdvancedElectronicSignature.ToString())),
|
||||
.User = New User(),
|
||||
.ExpiresWhen = pRow.ItemEx(Of Date)("EXPIRES_WHEN", Nothing),
|
||||
.ExpiresWarningWhen = pRow.ItemEx(Of Date)("EXPIRES_WARNING_WHEN", Nothing),
|
||||
@@ -46,8 +46,8 @@ Public Class EnvelopeModel
|
||||
.FirstReminderDays = pRow.ItemEx("FIRST_REMINDER_DAYS", 0),
|
||||
.ReminderIntervalDays = pRow.ItemEx("REMINDER_INTERVAL_DAYS", 0),
|
||||
.UseAccessCode = pRow.ItemEx("USE_ACCESS_CODE", False),
|
||||
.FinalEmailToCreator = ObjectEx.ToEnum(Of Constants.FinalEmailType)(pRow.ItemEx("FINAL_EMAIL_TO_CREATOR", Constants.FinalEmailType.No.ToString())),
|
||||
.FinalEmailToReceivers = ObjectEx.ToEnum(Of Constants.FinalEmailType)(pRow.ItemEx("FINAL_EMAIL_TO_RECEIVERS", Constants.FinalEmailType.No.ToString())),
|
||||
.FinalEmailToCreator = ObjectEx.ToEnum(Of FinalEmailType)(pRow.ItemEx("FINAL_EMAIL_TO_CREATOR", FinalEmailType.No.ToString())),
|
||||
.FinalEmailToReceivers = ObjectEx.ToEnum(Of FinalEmailType)(pRow.ItemEx("FINAL_EMAIL_TO_RECEIVERS", FinalEmailType.No.ToString())),
|
||||
.TFA_Enabled = pRow.ItemEx("TFA_Enabled", False)
|
||||
}
|
||||
Dim oDOC_RESULT = pRow.Item("DOC_RESULT")
|
||||
@@ -148,7 +148,7 @@ Public Class EnvelopeModel
|
||||
Dim oSql = $"INSERT INTO [dbo].[TBSIG_ENVELOPE] (MESSAGE, ENVELOPE_UUID, STATUS, USER_ID)
|
||||
VALUES('',
|
||||
'{pEnvelope.Uuid}',
|
||||
'{CInt([Enum].Parse(GetType(EnvelopeStatus), Constants.EnvelopeStatus.EnvelopeCreated))}',
|
||||
'{CInt([Enum].Parse(GetType(EnvelopeStatus), EnvelopeStatus.EnvelopeCreated))}',
|
||||
'{pEnvelope.UserId}')"
|
||||
Dim oCommand As New SqlCommand(oSql)
|
||||
'oCommand.Parameters.Add("MESSAGE", SqlDbType.NVarChar).Value = String.Empty
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports EnvelopeGenerator.Common.Constants
|
||||
Imports EnvelopeGenerator.Domain.Constants
|
||||
|
||||
Public Class EnvelopeTypeModel
|
||||
Inherits BaseModel
|
||||
|
||||
@@ -27,7 +27,7 @@ Public Class HistoryModel
|
||||
End Function
|
||||
|
||||
Public Function HasReceiverSigned(pEnvelopeId As Integer, pReceiverId As Integer) As Boolean
|
||||
Dim oEnvelopeSigned As Integer = Constants.EnvelopeStatus.DocumentSigned
|
||||
Dim oEnvelopeSigned As Integer = Domain.Constants.EnvelopeStatus.DocumentSigned
|
||||
Dim oSql = $"SELECT COUNT(T.GUID)
|
||||
FROM TBSIG_ENVELOPE_HISTORY T
|
||||
JOIN TBSIG_RECEIVER T2 ON T.USER_REFERENCE = T2.EMAIL_ADDRESS
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
Imports System.Net.Mail
|
||||
Imports DevExpress.DataProcessing
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports EnvelopeGenerator.Common.Constants
|
||||
Imports EnvelopeGenerator.Domain.Constants
|
||||
|
||||
Public Class ReceiverModel
|
||||
Inherits BaseModel
|
||||
@@ -11,7 +11,7 @@ Public Class ReceiverModel
|
||||
MyBase.New(pState)
|
||||
End Sub
|
||||
|
||||
Private Function ToReceiver(pRow As DataRow, pColorIndex As Integer) As EnvelopeReceiver
|
||||
Private Function ToReceiver(pRow As DataRow, pColorIndex As Integer) As Receiver
|
||||
Dim EmailAdress As String = pRow.ItemEx("EMAIL_ADDRESS", "")
|
||||
Dim EnvelopeId As Integer = pRow.ItemEx("ENVELOPE_ID", 0)
|
||||
Dim SignedDate As DateTime = DateTime.MinValue
|
||||
@@ -24,9 +24,9 @@ Public Class ReceiverModel
|
||||
End If
|
||||
End If
|
||||
|
||||
Return New EnvelopeReceiver() With {
|
||||
Return New Receiver() With {
|
||||
.Id = pRow.ItemEx("GUID", 0),
|
||||
.Email = pRow.ItemEx("EMAIL_ADDRESS", ""),
|
||||
.EmailAddress = pRow.ItemEx("EMAIL_ADDRESS", ""),
|
||||
.Name = pRow.ItemEx("NAME", ""),
|
||||
.Sequence = pRow.ItemEx("SEQUENCE", 0),
|
||||
.Signature = pRow.ItemEx("SIGNATURE", ""),
|
||||
@@ -38,15 +38,15 @@ Public Class ReceiverModel
|
||||
}
|
||||
End Function
|
||||
|
||||
Private Function ToReceiver(pTable As DataTable) As EnvelopeReceiver
|
||||
Private Function ToReceiver(pTable As DataTable) As Receiver
|
||||
Return pTable?.Rows.Cast(Of DataRow).
|
||||
Select(AddressOf ToReceiver).
|
||||
Single()
|
||||
End Function
|
||||
|
||||
Public Function TestReceiverExists(pReceiver As EnvelopeReceiver) As Boolean
|
||||
Public Function TestReceiverExists(pReceiver As Receiver) As Boolean
|
||||
Try
|
||||
Dim oGuid = Database.GetScalarValue($"SELECT COALESCE(GUID, 0) FROM TBSIG_RECEIVER WHERE EMAIL_ADDRESS = '{pReceiver.Email}'")
|
||||
Dim oGuid = Database.GetScalarValue($"SELECT COALESCE(GUID, 0) FROM TBSIG_RECEIVER WHERE EMAIL_ADDRESS = '{pReceiver.EmailAddress}'")
|
||||
pReceiver.Id = oGuid
|
||||
Return oGuid > 0
|
||||
Catch ex As Exception
|
||||
@@ -55,7 +55,7 @@ Public Class ReceiverModel
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function Insert(pReceiver As EnvelopeReceiver, pTransaction As SqlTransaction) As Boolean
|
||||
Public Function Insert(pReceiver As Receiver, pTransaction As SqlTransaction) As Boolean
|
||||
Try
|
||||
Dim oSignature As String = pReceiver.GetSignature()
|
||||
Dim oCheck = $"SELECT COUNT(GUID) FROM [dbo].[TBSIG_RECEIVER] WHERE SIGNATURE = '{oSignature}'"
|
||||
@@ -66,19 +66,19 @@ Public Class ReceiverModel
|
||||
([EMAIL_ADDRESS]
|
||||
,[SIGNATURE])
|
||||
VALUES
|
||||
('{pReceiver.Email}'
|
||||
('{pReceiver.EmailAddress}'
|
||||
,'{pReceiver.GetSignature()}')"
|
||||
|
||||
Dim oCommand = New SqlCommand(oSql)
|
||||
Dim oResult = Database.ExecuteNonQuery(oCommand)
|
||||
If oResult = True Then
|
||||
pReceiver.Id = GetReceiverIdByEmail(pReceiver.Email, pTransaction)
|
||||
pReceiver.Id = GetReceiverIdByEmail(pReceiver.EmailAddress, pTransaction)
|
||||
Return True
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
Else
|
||||
Logger.Warn($"Receiver [{pReceiver.Email}] already existing! SignatureID: {oSignature} Check SQL {oCheck}")
|
||||
Logger.Warn($"Receiver [{pReceiver.EmailAddress}] already existing! SignatureID: {oSignature} Check SQL {oCheck}")
|
||||
Return True
|
||||
End If
|
||||
Catch ex As Exception
|
||||
@@ -87,7 +87,7 @@ Public Class ReceiverModel
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function Update(pReceiver As EnvelopeReceiver, pTransaction As SqlTransaction) As Boolean
|
||||
Public Function Update(pReceiver As Receiver, pTransaction As SqlTransaction) As Boolean
|
||||
Try
|
||||
Dim oSql As String = $"UPDATE [dbo].[TBSIG_USER_RECEIVER]
|
||||
SET [NAME] = '{pReceiver.Name}'
|
||||
@@ -118,7 +118,7 @@ Public Class ReceiverModel
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function Assign(pEnvelope As Envelope, pReceiver As EnvelopeReceiver, pTransaction As SqlTransaction) As Boolean
|
||||
Public Function Assign(pEnvelope As Envelope, pReceiver As Receiver, pTransaction As SqlTransaction) As Boolean
|
||||
Dim oSql = $"INSERT INTO [dbo].[TBSIG_ENVELOPE_RECEIVER]
|
||||
([ENVELOPE_ID]
|
||||
,[RECEIVER_ID]
|
||||
@@ -153,7 +153,7 @@ Public Class ReceiverModel
|
||||
Return Database.ExecuteNonQuery(oCommand, pTransaction)
|
||||
End Function
|
||||
|
||||
Public Function ListEnvelopeReceivers(pEnvelopeId As Integer) As IEnumerable(Of EnvelopeReceiver)
|
||||
Public Function ListEnvelopeReceivers(pEnvelopeId As Integer) As IEnumerable(Of Receiver)
|
||||
Try
|
||||
Dim oSql = $"SELECT * FROM [dbo].[VWSIG_ENVELOPE_RECEIVERS] WHERE ENVELOPE_ID = {pEnvelopeId}"
|
||||
Dim oTable = Database.GetDatatable(oSql)
|
||||
@@ -187,7 +187,7 @@ Public Class ReceiverModel
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function ListReceivers() As IEnumerable(Of EnvelopeReceiver)
|
||||
Public Function ListReceivers() As IEnumerable(Of Receiver)
|
||||
Try
|
||||
Dim oSql = $"SELECT * FROM [dbo].[TBSIG_RECEIVER]"
|
||||
Dim oTable = Database.GetDatatable(oSql)
|
||||
@@ -202,13 +202,13 @@ Public Class ReceiverModel
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function ListReceivers(pReceiversFromGrid As List(Of EnvelopeReceiver)) As IEnumerable(Of EnvelopeReceiver)
|
||||
Public Function ListReceivers(pReceiversFromGrid As List(Of Receiver)) As IEnumerable(Of Receiver)
|
||||
Try
|
||||
If pReceiversFromGrid.Count = 0 Then
|
||||
Return New List(Of EnvelopeReceiver)
|
||||
Return New List(Of Receiver)
|
||||
End If
|
||||
|
||||
Dim oAddresses = pReceiversFromGrid.Select(Function(r) $"'{r.Email}'").JoinToString(",")
|
||||
Dim oAddresses = pReceiversFromGrid.Select(Function(r) $"'{r.EmailAddress}'").JoinToString(",")
|
||||
|
||||
Dim oSql = $"SELECT * FROM [dbo].[TBSIG_RECEIVER] WHERE EMAIL_ADDRESS IN ({oAddresses})"
|
||||
Dim oTable = Database.GetDatatable(oSql)
|
||||
@@ -235,7 +235,7 @@ Public Class ReceiverModel
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function GetById(pReceiverId As Integer) As EnvelopeReceiver
|
||||
Public Function GetById(pReceiverId As Integer) As Receiver
|
||||
'Try
|
||||
' Dim oSql = $"SELECT * FROM [dbo].[VWSIG_ENVELOPE_RECEIVERS] WHERE RECEIVER_ID = {pReceiverId}"
|
||||
' Dim oTable = Database.GetDatatable(oSql)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports EnvelopeGenerator.Domain.Entities
|
||||
|
||||
Public Class UserModel
|
||||
Inherits BaseModel
|
||||
|
||||
@@ -320,7 +320,7 @@ Partial Public Class rptEnvelopeHistory
|
||||
Me.XrTableCell19.StylePriority.UseBorders = False
|
||||
Me.XrTableCell19.StylePriority.UseFont = False
|
||||
Me.XrTableCell19.StylePriority.UseForeColor = False
|
||||
Me.XrTableCell19.Text = "Email"
|
||||
Me.XrTableCell19.Text = "EmailAddress"
|
||||
Me.XrTableCell19.Weight = 0.11578820509129036R
|
||||
'
|
||||
'XrTableCell20
|
||||
@@ -329,7 +329,7 @@ Partial Public Class rptEnvelopeHistory
|
||||
Me.XrTableCell20.BorderColor = System.Drawing.Color.Empty
|
||||
Me.XrTableCell20.Borders = DevExpress.XtraPrinting.BorderSide.None
|
||||
Me.XrTableCell20.Dpi = 254.0!
|
||||
Me.XrTableCell20.ExpressionBindings.AddRange(New DevExpress.XtraReports.UI.ExpressionBinding() {New DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Envelope].[User].[Email]")})
|
||||
Me.XrTableCell20.ExpressionBindings.AddRange(New DevExpress.XtraReports.UI.ExpressionBinding() {New DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Envelope].[User].[EmailAddress]")})
|
||||
Me.XrTableCell20.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.XrTableCell20.ForeColor = System.Drawing.Color.Black
|
||||
Me.XrTableCell20.Multiline = True
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Imports DevExpress.DataAccess.Native.Web
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports EnvelopeGenerator.Common.Constants
|
||||
Imports EnvelopeGenerator.Domain.Constants
|
||||
Imports EnvelopeGenerator.Common.My.Resources
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports System.ComponentModel
|
||||
@@ -26,7 +26,7 @@ Public Class ActionService
|
||||
End Sub
|
||||
|
||||
Public Function SendEnvelope(pEnvelope As Envelope) As Boolean
|
||||
If HistoryService.SetEnvelopeStatus(pEnvelope, Constants.EnvelopeStatus.EnvelopeQueued, pEnvelope.User.Email) = False Then
|
||||
If HistoryService.SetEnvelopeStatus(pEnvelope, EnvelopeStatus.EnvelopeQueued, pEnvelope.User.Email) = False Then
|
||||
Return False
|
||||
End If
|
||||
|
||||
@@ -41,13 +41,13 @@ Public Class ActionService
|
||||
Return True
|
||||
End Function
|
||||
Public Function SetStatusDocumentRotationChanged(pEnvelope As Envelope) As Boolean
|
||||
If HistoryService.SetEnvelopeStatus(pEnvelope, Constants.EnvelopeStatus.DocumentMod_Rotation, pEnvelope.User.Email) = False Then
|
||||
If HistoryService.SetEnvelopeStatus(pEnvelope, EnvelopeStatus.DocumentMod_Rotation, pEnvelope.User.Email) = False Then
|
||||
Return False
|
||||
End If
|
||||
Return True
|
||||
End Function
|
||||
Public Function Resend_Receiver(pEnvelope As Envelope, pmail As String) As Boolean
|
||||
If HistoryService.SetEnvelopeStatus(pEnvelope, Constants.EnvelopeStatus.EnvelopeQueued, pEnvelope.User.Email) = False Then
|
||||
If HistoryService.SetEnvelopeStatus(pEnvelope, EnvelopeStatus.EnvelopeQueued, pEnvelope.User.Email) = False Then
|
||||
Return False
|
||||
End If
|
||||
Dim oSendResult As Boolean = False
|
||||
@@ -56,7 +56,7 @@ Public Class ActionService
|
||||
Next
|
||||
Return oSendResult
|
||||
End Function
|
||||
Public Function ResendReceiver(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean
|
||||
Public Function ResendReceiver(pEnvelope As Envelope, pReceiver As Receiver) As Boolean
|
||||
Return EmailService.SendDocumentReceivedEmail(pEnvelope, pReceiver)
|
||||
End Function
|
||||
|
||||
@@ -64,9 +64,9 @@ Public Class ActionService
|
||||
Public Function DeleteEnvelope(pEnvelope As Envelope, pReason As String) As Boolean
|
||||
Dim oStatus As EnvelopeStatus
|
||||
If pEnvelope.IsAlreadySent Then
|
||||
oStatus = Constants.EnvelopeStatus.EnvelopeWithdrawn
|
||||
oStatus = EnvelopeStatus.EnvelopeWithdrawn
|
||||
Else
|
||||
oStatus = Constants.EnvelopeStatus.EnvelopeDeleted
|
||||
oStatus = EnvelopeStatus.EnvelopeDeleted
|
||||
End If
|
||||
Dim oUpd = $"UPDATE TBSIG_ENVELOPE SET REJECTION_REASON = '{pReason}' WHERE GUID = {pEnvelope.Id}"
|
||||
myDatabase.ExecuteNonQuery(oUpd)
|
||||
@@ -86,7 +86,7 @@ Public Class ActionService
|
||||
End Function
|
||||
Public Function API_SendWithdrawn_Mails(pEnvelope As Envelope, pReason As String) As Boolean
|
||||
Dim oSendResult As Boolean = False
|
||||
For Each oReceiver As EnvelopeReceiver In pEnvelope.Receivers
|
||||
For Each oReceiver As Receiver In pEnvelope.Receivers
|
||||
If EmailService.SendEnvelopeDeletedEmail(pEnvelope, oReceiver, pReason) = False Then
|
||||
Return False
|
||||
End If
|
||||
@@ -94,50 +94,50 @@ Public Class ActionService
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Function OpenEnvelope(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean
|
||||
Dim oUserReference = pReceiver.Email
|
||||
Public Function OpenEnvelope(pEnvelope As Envelope, pReceiver As Receiver) As Boolean
|
||||
Dim oUserReference = pReceiver.EmailAddress
|
||||
|
||||
If HistoryService.SetEnvelopeStatus(pEnvelope, Constants.EnvelopeStatus.DocumentOpened, oUserReference) = False Then
|
||||
If HistoryService.SetEnvelopeStatus(pEnvelope, EnvelopeStatus.DocumentOpened, oUserReference) = False Then
|
||||
Return False
|
||||
End If
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Function RequestAccessCode(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean
|
||||
Dim oUserReference = pReceiver.Email
|
||||
Public Function RequestAccessCode(pEnvelope As Envelope, pReceiver As Receiver) As Boolean
|
||||
Dim oUserReference = pReceiver.EmailAddress
|
||||
|
||||
If HistoryService.SetEnvelopeStatus(pEnvelope, Constants.EnvelopeStatus.AccessCodeRequested, oUserReference) = False Then
|
||||
If HistoryService.SetEnvelopeStatus(pEnvelope, EnvelopeStatus.AccessCodeRequested, oUserReference) = False Then
|
||||
Return False
|
||||
End If
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Function EnterCorrectAccessCode(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean
|
||||
Dim oUserReference = pReceiver.Email
|
||||
Public Function EnterCorrectAccessCode(pEnvelope As Envelope, pReceiver As Receiver) As Boolean
|
||||
Dim oUserReference = pReceiver.EmailAddress
|
||||
|
||||
If HistoryService.SetEnvelopeStatus(pEnvelope, Constants.EnvelopeStatus.AccessCodeCorrect, oUserReference) = False Then
|
||||
If HistoryService.SetEnvelopeStatus(pEnvelope, EnvelopeStatus.AccessCodeCorrect, oUserReference) = False Then
|
||||
Return False
|
||||
End If
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Function EnterIncorrectAccessCode(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean
|
||||
Dim oUserReference = pReceiver.Email
|
||||
Public Function EnterIncorrectAccessCode(pEnvelope As Envelope, pReceiver As Receiver) As Boolean
|
||||
Dim oUserReference = pReceiver.EmailAddress
|
||||
|
||||
If HistoryService.SetEnvelopeStatus(pEnvelope, Constants.EnvelopeStatus.AccessCodeIncorrect, oUserReference) = False Then
|
||||
If HistoryService.SetEnvelopeStatus(pEnvelope, EnvelopeStatus.AccessCodeIncorrect, oUserReference) = False Then
|
||||
Return False
|
||||
End If
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Function SignEnvelope(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean
|
||||
Dim oUserReference = pReceiver.Email
|
||||
Public Function SignEnvelope(pEnvelope As Envelope, pReceiver As Receiver) As Boolean
|
||||
Dim oUserReference = pReceiver.EmailAddress
|
||||
|
||||
If HistoryService.SetEnvelopeStatus(pEnvelope, Constants.EnvelopeStatus.DocumentSigned, oUserReference) = False Then
|
||||
If HistoryService.SetEnvelopeStatus(pEnvelope, EnvelopeStatus.DocumentSigned, oUserReference) = False Then
|
||||
Return False
|
||||
End If
|
||||
|
||||
@@ -145,15 +145,15 @@ Public Class ActionService
|
||||
End Function
|
||||
|
||||
Public Function FinalizeEnvelope(pEnvelope As Envelope) As Boolean
|
||||
If HistoryService.SetEnvelopeStatus(pEnvelope, Constants.EnvelopeStatus.EnvelopeArchived, "System") = False Then
|
||||
If HistoryService.SetEnvelopeStatus(pEnvelope, EnvelopeStatus.EnvelopeArchived, "System") = False Then
|
||||
Return False
|
||||
End If
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Function CompleteEnvelope(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean ', pAttachment As String
|
||||
If HistoryService.SetEnvelopeStatus(pEnvelope, Constants.EnvelopeStatus.MessageCompletionSent, pReceiver.Email) = False Then
|
||||
Public Function CompleteEnvelope(pEnvelope As Envelope, pReceiver As Receiver) As Boolean ', pAttachment As String
|
||||
If HistoryService.SetEnvelopeStatus(pEnvelope, EnvelopeStatus.MessageCompletionSent, pReceiver.EmailAddress) = False Then
|
||||
Return False
|
||||
End If
|
||||
|
||||
@@ -161,7 +161,7 @@ Public Class ActionService
|
||||
End Function
|
||||
|
||||
Public Function CompleteEnvelope(pEnvelope As Envelope) As Boolean ', pAttachment As String
|
||||
If HistoryService.SetEnvelopeStatus(pEnvelope, Constants.EnvelopeStatus.MessageCompletionSent, pEnvelope.User.Email) = False Then
|
||||
If HistoryService.SetEnvelopeStatus(pEnvelope, EnvelopeStatus.MessageCompletionSent, pEnvelope.User.Email) = False Then
|
||||
Return False
|
||||
End If
|
||||
|
||||
@@ -169,7 +169,7 @@ Public Class ActionService
|
||||
End Function
|
||||
|
||||
Public Function CreateReport(pEnvelope As Envelope) As Boolean
|
||||
If HistoryService.SetEnvelopeStatus(pEnvelope, Constants.EnvelopeStatus.EnvelopeReportCreated, "System") = False Then
|
||||
If HistoryService.SetEnvelopeStatus(pEnvelope, EnvelopeStatus.EnvelopeReportCreated, "System") = False Then
|
||||
Return False
|
||||
End If
|
||||
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports EnvelopeGenerator.Common.My.Resources
|
||||
Imports DigitalData.Modules.Logging
|
||||
|
||||
Public Class EmailService
|
||||
Inherits BaseService
|
||||
@@ -16,9 +13,9 @@ Public Class EmailService
|
||||
EmailTemplate = New TemplateService(pState)
|
||||
End Sub
|
||||
|
||||
Public Function SendEnvelopeDeletedEmail(pEnvelope As Envelope, pReceiver As EnvelopeReceiver, pReason As String) As Boolean
|
||||
Public Function SendEnvelopeDeletedEmail(pEnvelope As Envelope, pReceiver As Receiver, pReason As String) As Boolean
|
||||
Logger.Debug("SendEnvelopeDeletedEmail - Creating email data object...")
|
||||
Dim oEmailData As New EmailData(pEnvelope, pReceiver, Constants.EnvelopeStatus.MessageDeletionSent) With
|
||||
Dim oEmailData As New EmailData(pEnvelope, pReceiver, Domain.Constants.EnvelopeStatus.MessageDeletionSent) With
|
||||
{
|
||||
.SignatureLink = "",
|
||||
.ADDED_WHO_PROCESS = pEnvelope.CURRENT_WORK_APP
|
||||
@@ -34,9 +31,9 @@ Public Class EmailService
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Function SendDocumentReceivedEmail(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean
|
||||
Public Function SendDocumentReceivedEmail(pEnvelope As Envelope, pReceiver As Receiver) As Boolean
|
||||
Logger.Debug("Creating email data object.")
|
||||
Dim oEmailData As New EmailData(pEnvelope, pReceiver, Constants.EnvelopeStatus.MessageInvitationSent) With
|
||||
Dim oEmailData As New EmailData(pEnvelope, pReceiver, Domain.Constants.EnvelopeStatus.MessageInvitationSent) With
|
||||
{
|
||||
.SignatureLink = Helpers.GetEnvelopeURL(State.DbConfig.SignatureHost, pEnvelope.Uuid, pReceiver.Signature),
|
||||
.ADDED_WHO_PROCESS = pEnvelope.CURRENT_WORK_APP
|
||||
@@ -52,11 +49,11 @@ Public Class EmailService
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Function GetReceiverUrl(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As String
|
||||
Public Function GetReceiverUrl(pEnvelope As Envelope, pReceiver As Receiver) As String
|
||||
Logger.Debug($"State.DbConfig.SignatureHost: {State.DbConfig.SignatureHost}")
|
||||
Logger.Debug($" pEnvelope.Uuid: {pEnvelope.Uuid}")
|
||||
Logger.Debug($" pReceiver.Signature: {pReceiver.Signature}")
|
||||
Dim oEmailData As New EmailData(pEnvelope, pReceiver, Constants.EnvelopeStatus.MessageInvitationSent) With
|
||||
Dim oEmailData As New EmailData(pEnvelope, pReceiver, Domain.Constants.EnvelopeStatus.MessageInvitationSent) With
|
||||
{
|
||||
.SignatureLink = Helpers.GetEnvelopeURL(State.DbConfig.SignatureHost, pEnvelope.Uuid, pReceiver.Signature),
|
||||
.ADDED_WHO_PROCESS = pEnvelope.CURRENT_WORK_APP
|
||||
@@ -65,12 +62,12 @@ Public Class EmailService
|
||||
End Function
|
||||
|
||||
|
||||
Public Function SendDocumentAccessCodeReceivedEmail(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean
|
||||
Public Function SendDocumentAccessCodeReceivedEmail(pEnvelope As Envelope, pReceiver As Receiver) As Boolean
|
||||
Logger.Debug("Creating email data object.")
|
||||
Logger.Debug($"State.DbConfig.SignatureHost: {State.DbConfig.SignatureHost}")
|
||||
Logger.Debug($" pEnvelope.Uuid: {pEnvelope.Uuid}")
|
||||
Logger.Debug($" pReceiver.Signature: {pReceiver.Signature}")
|
||||
Dim oEmailData As New EmailData(pEnvelope, pReceiver, Constants.EnvelopeStatus.MessageAccessCodeSent) With
|
||||
Dim oEmailData As New EmailData(pEnvelope, pReceiver, Domain.Constants.EnvelopeStatus.MessageAccessCodeSent) With
|
||||
{
|
||||
.SignatureLink = Helpers.GetEnvelopeURL(State.DbConfig.SignatureHost, pEnvelope.Uuid, pReceiver.Signature),
|
||||
.ADDED_WHO_PROCESS = pEnvelope.CURRENT_WORK_APP
|
||||
@@ -86,9 +83,9 @@ Public Class EmailService
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Function SendSignedEmail(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean
|
||||
Public Function SendSignedEmail(pEnvelope As Envelope, pReceiver As Receiver) As Boolean
|
||||
Logger.Debug("Creating email data object.")
|
||||
Dim oEmailData = New EmailData(pEnvelope, pReceiver, Constants.EnvelopeStatus.MessageConfirmationSent) With
|
||||
Dim oEmailData = New EmailData(pEnvelope, pReceiver, Domain.Constants.EnvelopeStatus.MessageConfirmationSent) With
|
||||
{
|
||||
.SignatureLink = ""
|
||||
}
|
||||
@@ -103,9 +100,9 @@ Public Class EmailService
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Function SendDocumentCompletedEmailToReceiver(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean ', pAttachment As String
|
||||
Public Function SendDocumentCompletedEmailToReceiver(pEnvelope As Envelope, pReceiver As Receiver) As Boolean ', pAttachment As String
|
||||
Logger.Debug("Creating email data object.")
|
||||
Dim oEmailData = New EmailData(pEnvelope, pReceiver, Constants.EnvelopeStatus.MessageCompletionSent) With
|
||||
Dim oEmailData = New EmailData(pEnvelope, pReceiver, Domain.Constants.EnvelopeStatus.MessageCompletionSent) With
|
||||
{
|
||||
.SignatureLink = "",
|
||||
.ATT1_RELATED_ID = pEnvelope.Id,
|
||||
@@ -126,7 +123,7 @@ Public Class EmailService
|
||||
|
||||
Public Function SendDocumentCompletedEmailToCreator(pEnvelope As Envelope) As Boolean ', pAttachment As String
|
||||
Logger.Debug("Creating email data object.")
|
||||
Dim oEmailData = New EmailData(pEnvelope, Constants.EnvelopeStatus.MessageCompletionSent) With
|
||||
Dim oEmailData = New EmailData(pEnvelope, Domain.Constants.EnvelopeStatus.MessageCompletionSent) With
|
||||
{
|
||||
.SignatureLink = "",
|
||||
.ATT1_RELATED_ID = pEnvelope.Id,
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports EnvelopeGenerator.Common.Constants
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports EnvelopeGenerator.Domain.Constants
|
||||
|
||||
Public Class HistoryService
|
||||
Inherits BaseService
|
||||
@@ -34,4 +32,4 @@ Public Class HistoryService
|
||||
Logger.Debug("Envelope status set to [{0}] for Envelope [{1}].", pStatus.ToString, pEnvelope.Id)
|
||||
Return True
|
||||
End Function
|
||||
End Class
|
||||
End Class
|
||||
@@ -1,5 +1,6 @@
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports EnvelopeGenerator.Domain.Constants
|
||||
|
||||
Public Class TemplateService
|
||||
Inherits BaseService
|
||||
@@ -35,7 +36,7 @@ Public Class TemplateService
|
||||
|
||||
Public Sub FillDocumentReceivedEmailBody(pEmailData As EmailData)
|
||||
InitDictionary(pEmailData)
|
||||
Dim oTemplate = EmailHtmlTemplateModel.GetById(Constants.EmailTemplateType.DocumentReceived)
|
||||
Dim oTemplate = EmailHtmlTemplateModel.GetById(EmailTemplateType.DocumentReceived)
|
||||
|
||||
pEmailData.EmailBody = FillTemplate(oTemplate.Body)
|
||||
pEmailData.EmailSubject = FillTemplate(oTemplate.Subject)
|
||||
@@ -43,7 +44,7 @@ Public Class TemplateService
|
||||
|
||||
Public Sub FillEnvelopeDeletedEmailBody(pEmailData As EmailData, pReason As String)
|
||||
InitDictionary(pEmailData, pReason)
|
||||
Dim oTemplate = EmailHtmlTemplateModel.GetById(Constants.EmailTemplateType.DocumentDeleted)
|
||||
Dim oTemplate = EmailHtmlTemplateModel.GetById(EmailTemplateType.DocumentDeleted)
|
||||
|
||||
pEmailData.EmailBody = FillTemplate(oTemplate.Body, pReason)
|
||||
pEmailData.EmailSubject = FillTemplate(oTemplate.Subject)
|
||||
@@ -51,7 +52,7 @@ Public Class TemplateService
|
||||
|
||||
Public Sub FillDocumentSignedEmailBody(pEmailData As EmailData)
|
||||
InitDictionary(pEmailData)
|
||||
Dim oTemplate = EmailHtmlTemplateModel.GetById(Constants.EmailTemplateType.DocumentSigned)
|
||||
Dim oTemplate = EmailHtmlTemplateModel.GetById(EmailTemplateType.DocumentSigned)
|
||||
|
||||
pEmailData.EmailBody = FillTemplate(oTemplate.Body)
|
||||
pEmailData.EmailSubject = FillTemplate(oTemplate.Subject)
|
||||
@@ -59,7 +60,7 @@ Public Class TemplateService
|
||||
|
||||
Public Sub FillDocumentCompletedEmailBody(pEmailData As EmailData)
|
||||
InitDictionary(pEmailData)
|
||||
Dim oTemplate = EmailHtmlTemplateModel.GetById(Constants.EmailTemplateType.DocumentCompleted)
|
||||
Dim oTemplate = EmailHtmlTemplateModel.GetById(EmailTemplateType.DocumentCompleted)
|
||||
|
||||
pEmailData.EmailBody = FillTemplate(oTemplate.Body)
|
||||
pEmailData.EmailSubject = FillTemplate(oTemplate.Subject)
|
||||
@@ -67,7 +68,7 @@ Public Class TemplateService
|
||||
|
||||
Public Sub FillDocumentAccessCodeReceivedEmailBody(pEmailData As EmailData)
|
||||
InitDictionary(pEmailData)
|
||||
Dim oTemplate = EmailHtmlTemplateModel.GetById(Constants.EmailTemplateType.DocumentAccessCodeReceived)
|
||||
Dim oTemplate = EmailHtmlTemplateModel.GetById(EmailTemplateType.DocumentAccessCodeReceived)
|
||||
|
||||
pEmailData.EmailBody = FillTemplate(oTemplate.Body)
|
||||
pEmailData.EmailSubject = FillTemplate(oTemplate.Subject)
|
||||
|
||||
@@ -43,7 +43,7 @@ Namespace My.Resources
|
||||
Public Shared ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
|
||||
Get
|
||||
If Object.ReferenceEquals(resourceMan, Nothing) Then
|
||||
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("EnvelopeGenerator.Common.Email", GetType(Email).Assembly)
|
||||
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("EnvelopeGenerator.Common.EmailAddress", GetType(Email).Assembly)
|
||||
resourceMan = temp
|
||||
End If
|
||||
Return resourceMan
|
||||
|
||||
@@ -236,7 +236,7 @@ Namespace My.Resources
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Sucht eine lokalisierte Zeichenfolge, die Die Email-Adresse [ @Mail ] konnte nicht validiert werden! ähnelt.
|
||||
''' Sucht eine lokalisierte Zeichenfolge, die Die EmailAddress-Adresse [ @Mail ] konnte nicht validiert werden! ähnelt.
|
||||
'''</summary>
|
||||
Public Shared ReadOnly Property Error_email_Validation() As String
|
||||
Get
|
||||
@@ -300,7 +300,7 @@ Namespace My.Resources
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Sucht eine lokalisierte Zeichenfolge, die Mindestens ein Empfänger hat keine Anrede oder keine Email Adresse. ähnelt.
|
||||
''' Sucht eine lokalisierte Zeichenfolge, die Mindestens ein Empfänger hat keine Anrede oder keine EmailAddress Adresse. ähnelt.
|
||||
'''</summary>
|
||||
Public Shared ReadOnly Property Incomplete_Receivers() As String
|
||||
Get
|
||||
@@ -309,11 +309,11 @@ Namespace My.Resources
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Sucht eine lokalisierte Zeichenfolge, die Empfänger {0} hat keine gültige Email Addresse. ähnelt.
|
||||
''' Sucht eine lokalisierte Zeichenfolge, die Empfänger {0} hat keine gültige EmailAddress Addresse. ähnelt.
|
||||
'''</summary>
|
||||
Public Shared ReadOnly Property Invalid_Email_Address() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("Invalid Email Address", resourceCulture)
|
||||
Return ResourceManager.GetString("Invalid EmailAddress Address", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
183
EnvelopeGenerator.Domain/Constants.cs
Normal file
183
EnvelopeGenerator.Domain/Constants.cs
Normal file
@@ -0,0 +1,183 @@
|
||||
#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
|
||||
}
|
||||
}
|
||||
@@ -1,32 +1,25 @@
|
||||
using DigitalData.Core.Abstractions;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace EnvelopeGenerator.Domain.Entities
|
||||
{
|
||||
[Table("TBSIG_CONFIG", Schema = "dbo")]
|
||||
public class Config : IUnique<int>
|
||||
public class Config
|
||||
{
|
||||
[Column("DOCUMENT_PATH", TypeName = "nvarchar(256)")]
|
||||
public string? DocumentPath { get; init; }
|
||||
public string DocumentPath { get; set; }
|
||||
|
||||
[Column("SENDING_PROFILE", TypeName = "int")]
|
||||
[Required]
|
||||
public required int SendingProfile { get; init; }
|
||||
public int SendingProfile { get; set; }
|
||||
|
||||
[Column("SIGNATURE_HOST", TypeName = "nvarchar(128)")]
|
||||
public string? SignatureHost { get; init; }
|
||||
public string SignatureHost { get; set; }
|
||||
|
||||
[Column("EXTERNAL_PROGRAM_NAME", TypeName = "nvarchar(30)")]
|
||||
public string? ExternalProgramName { get; init; }
|
||||
public string ExternalProgramName { get; set; }
|
||||
|
||||
[Column("EXPORT_PATH", TypeName = "nvarchar(256)")]
|
||||
public string? ExportPath { get; init; }
|
||||
|
||||
[Obsolete("Configuration does not have an ID; it represents a single table in the database.")]
|
||||
[NotMapped]
|
||||
[JsonIgnore]
|
||||
public int Id => throw new InvalidOperationException("This configuration does not support an ID as it represents a single table in the database.");
|
||||
public string ExportPath { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,14 @@
|
||||
using DigitalData.Core.Abstractions;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
#if NETFRAMEWORK
|
||||
using System;
|
||||
#endif
|
||||
|
||||
namespace EnvelopeGenerator.Domain.Entities
|
||||
{
|
||||
[Table("TBSIG_DOCUMENT_RECEIVER_ELEMENT", Schema = "dbo")]
|
||||
public class DocumentReceiverElement : IUnique<int>
|
||||
public class DocumentReceiverElement
|
||||
{
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
@@ -57,7 +59,7 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
public bool Required { get; set; }
|
||||
|
||||
[Column("TOOLTIP")]
|
||||
public string? Tooltip { get; set; }
|
||||
public string Tooltip { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("READ_ONLY")]
|
||||
@@ -75,13 +77,13 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
public DateTime AddedWhen { get; set; }
|
||||
|
||||
[Column("CHANGED_WHEN", TypeName = "datetime")]
|
||||
public DateTime? ChangedWhen { get; set; }
|
||||
public DateTime ChangedWhen { get; set; }
|
||||
|
||||
[ForeignKey("DocumentId")]
|
||||
public virtual EnvelopeDocument? Document { get; set; }
|
||||
public virtual EnvelopeDocument Document { get; set; }
|
||||
|
||||
[ForeignKey("ReceiverId")]
|
||||
public virtual Receiver? Receiver { get; set; }
|
||||
public virtual Receiver Receiver { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public double Top => Math.Round(Y, 5);
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
using DigitalData.Core.Abstractions;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
#if NETFRAMEWORK
|
||||
using System;
|
||||
#endif
|
||||
|
||||
namespace EnvelopeGenerator.Domain.Entities
|
||||
{
|
||||
[Table("TBSIG_DOCUMENT_STATUS", Schema = "dbo")]
|
||||
public class DocumentStatus : IUnique<int>
|
||||
public class DocumentStatus
|
||||
{
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
@@ -20,27 +22,28 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
[Column("RECEIVER_ID")]
|
||||
public int ReceiverId { get; set; }
|
||||
|
||||
// TODO: * check Form Application and remove default value
|
||||
[Required]
|
||||
[Column("STATUS")]
|
||||
public int Status { get; set; }
|
||||
public Constants.DocumentStatus Status { get; set; } = Constants.DocumentStatus.Created;
|
||||
|
||||
[Column("STATUS_CHANGED_WHEN", TypeName = "datetime")]
|
||||
public DateTime? StatusChangedWhen { get; set; }
|
||||
public DateTime StatusChangedWhen { get; set; }
|
||||
|
||||
[Column("VALUE", TypeName = "nvarchar(max)")]
|
||||
public string? Value { get; set; }
|
||||
public string Value { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("ADDED_WHEN", TypeName = "datetime")]
|
||||
public DateTime AddedWhen { get; set; }
|
||||
|
||||
[Column("CHANGED_WHEN", TypeName = "datetime")]
|
||||
public DateTime? ChangedWhen { get; set; }
|
||||
public DateTime ChangedWhen { get; set; }
|
||||
|
||||
[ForeignKey("EnvelopeId")]
|
||||
public virtual Envelope? Envelope { get; set; }
|
||||
public virtual Envelope Envelope { get; set; }
|
||||
|
||||
[ForeignKey("ReceiverId")]
|
||||
public virtual Receiver? Receiver { get; set; }
|
||||
public virtual Receiver Receiver { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,14 @@
|
||||
using DigitalData.Core.Abstractions;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
#if NETFRAMEWORK
|
||||
using System;
|
||||
#endif
|
||||
|
||||
namespace EnvelopeGenerator.Domain.Entities
|
||||
{
|
||||
[Table("TBSIG_EMAIL_TEMPLATE", Schema = "dbo")]
|
||||
public class EmailTemplate : IUnique<int>
|
||||
public class EmailTemplate
|
||||
{
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
@@ -14,13 +16,13 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
public int Id { get; set; }
|
||||
|
||||
[Column("NAME", TypeName = "nvarchar(64)")]
|
||||
public string? Name { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
[Column("BODY", TypeName = "nvarchar(max)")]
|
||||
public string? Body { get; set; }
|
||||
public string Body { get; set; }
|
||||
|
||||
[Column("SUBJECT", TypeName = "nvarchar(512)")]
|
||||
public string? Subject { get; set; }
|
||||
public string Subject { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("ADDED_WHEN", TypeName = "datetime")]
|
||||
@@ -28,6 +30,6 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
public DateTime AddedWhen { get; set; }
|
||||
|
||||
[Column("CHANGED_WHEN", TypeName = "datetime")]
|
||||
public DateTime? ChangedWhen { get; set; }
|
||||
public DateTime ChangedWhen { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,111 +1,158 @@
|
||||
using DigitalData.Core.Abstractions;
|
||||
using EnvelopeGenerator.Common;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
#if NETFRAMEWORK
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
#endif
|
||||
|
||||
namespace EnvelopeGenerator.Domain.Entities
|
||||
{
|
||||
[Table("TBSIG_ENVELOPE", Schema = "dbo")]
|
||||
public class Envelope : IUnique<int>
|
||||
public class Envelope
|
||||
{
|
||||
// TODO: * Check the Form App and remove the default value
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
[Column("GUID")]
|
||||
public int Id { get; set; }
|
||||
public int Id { get; set; } = 0;
|
||||
|
||||
[Required]
|
||||
[Column("USER_ID")]
|
||||
public int UserId { get; set; }
|
||||
|
||||
// TODO: * Check the Form App and remove the default value
|
||||
[Required]
|
||||
[Column("STATUS")]
|
||||
public int Status { get; set; }
|
||||
public int Status { get; set; } = (int)Constants.EnvelopeStatus.EnvelopeCreated;
|
||||
|
||||
[NotMapped]
|
||||
public string StatusName => ((Constants.EnvelopeStatus)Status).ToString();
|
||||
public string StatusName => ((Constants.EnvelopeStatus)Status).ToString();
|
||||
|
||||
// TODO: The default value is set to 0. Check the Form App to remove this
|
||||
[Required]
|
||||
[Column("ENVELOPE_UUID", TypeName = "nvarchar(36)")]
|
||||
public required string Uuid { get; init; }
|
||||
public string Uuid { get; set; } = Guid.NewGuid().ToString();
|
||||
|
||||
// TODO: * Check the Form App and remove the default value
|
||||
[Column("MESSAGE", TypeName = "nvarchar(max)")]
|
||||
public string? Message { get; set; }
|
||||
public string Message { get; set; } = My.Resources.Envelope.Please_read_and_sign_this_document;
|
||||
|
||||
[Column("EXPIRES_WHEN", TypeName = "datetime")]
|
||||
public DateTime? ExpiresWhen { get; set; }
|
||||
public DateTime ExpiresWhen { get; set; }
|
||||
|
||||
[Column("EXPIRES_WARNING_WHEN", TypeName = "datetime")]
|
||||
public DateTime? ExpiresWarningWhen { get; set; }
|
||||
public DateTime ExpiresWarningWhen { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("ADDED_WHEN", TypeName = "datetime")]
|
||||
public DateTime AddedWhen { get; set; }
|
||||
|
||||
[Column("CHANGED_WHEN", TypeName = "datetime")]
|
||||
public DateTime? ChangedWhen { get; set; }
|
||||
public DateTime ChangedWhen { get; set; }
|
||||
|
||||
// TODO: * Check the Form App and remove the default value
|
||||
[Column("TITLE", TypeName = "nvarchar(128)")]
|
||||
public string? Title { get; set; }
|
||||
public string Title { get; set; } = string.Empty;
|
||||
|
||||
[Column("CONTRACT_TYPE")]
|
||||
public int? ContractType { get; set; }
|
||||
public int ContractType { get; set; }
|
||||
|
||||
// TODO: * Check the Form App and remove the default value
|
||||
[NotMapped]
|
||||
public string ContractTypeTranslated => My.Resources.Model.ResourceManager.GetString(ContractType.ToString());
|
||||
|
||||
// TODO: * Check the Form App and remove the default value
|
||||
[Column("LANGUAGE", TypeName = "nvarchar(5)")]
|
||||
public string? Language { get; set; }
|
||||
public string Language { get; set; } = "de-DE";
|
||||
|
||||
// TODO: * Check the Form App and remove the default value
|
||||
[Column("SEND_REMINDER_EMAILS")]
|
||||
public bool? SendReminderEmails { get; set; }
|
||||
public bool SendReminderEmails { get; set; } = false;
|
||||
|
||||
// TODO: * Check the Form App and remove the default value
|
||||
[Column("FIRST_REMINDER_DAYS")]
|
||||
public int? FirstReminderDays { get; set; }
|
||||
public int FirstReminderDays { get; set; } = 0;
|
||||
|
||||
// TODO: * Check the Form App and remove the default value
|
||||
[Column("REMINDER_INTERVAL_DAYS")]
|
||||
public int? ReminderIntervalDays { get; set; }
|
||||
public int ReminderIntervalDays { get; set; } = 0;
|
||||
|
||||
[Column("ENVELOPE_TYPE")]
|
||||
public int? EnvelopeTypeId { get; set; }
|
||||
public int EnvelopeTypeId { get; set; }
|
||||
|
||||
// TODO: * Check the Form App and remove the default value
|
||||
[Column("CERTIFICATION_TYPE")]
|
||||
public int? CertificationType { get; set; }
|
||||
public int CertificationType { get; set; } = (int)Constants.CertificationType.AdvancedElectronicSignature;
|
||||
|
||||
// TODO: * Check the Form App and remove the default value
|
||||
[Column("USE_ACCESS_CODE")]
|
||||
public bool? UseAccessCode { get; set; }
|
||||
public bool UseAccessCode { get; set; } = false;
|
||||
|
||||
[Column("FINAL_EMAIL_TO_CREATOR")]
|
||||
public int? FinalEmailToCreator { get; set; }
|
||||
public int FinalEmailToCreator { get; set; }
|
||||
|
||||
[Column("FINAL_EMAIL_TO_RECEIVERS")]
|
||||
public int? FinalEmailToReceivers { get; set; }
|
||||
public int FinalEmailToReceivers { get; set; }
|
||||
|
||||
[Column("EXPIRES_WHEN_DAYS")]
|
||||
public int? ExpiresWhenDays { get; set; }
|
||||
public int ExpiresWhenDays { get; set; }
|
||||
|
||||
[Column("EXPIRES_WARNING_WHEN_DAYS")]
|
||||
public int? ExpiresWarningWhenDays { get; set; }
|
||||
public int ExpiresWarningWhenDays { get; set; }
|
||||
|
||||
// TODO: * Check the Form App and remove the default value
|
||||
[Column("TFA_ENABLED", TypeName = "bit")]
|
||||
public bool TFAEnabled { get; set; }
|
||||
public bool TFAEnabled { get; set; } = false;
|
||||
|
||||
[Column("DOC_RESULT", TypeName = "varbinary(max)")]
|
||||
public byte[]? DocResult { get; init; }
|
||||
public byte[] DocResult { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The sender of envelope
|
||||
/// </summary>
|
||||
[NotMapped]
|
||||
public string CURRENT_WORK_APP { get; set; } = "signFLOW GUI";
|
||||
|
||||
// TODO: * Check the Form App and remove the default value
|
||||
[ForeignKey("UserId")]
|
||||
public DigitalData.UserManager.Domain.Entities.User? User { get; set; }
|
||||
public User User { get; set; } = new User();
|
||||
|
||||
[ForeignKey("EnvelopeTypeId")]
|
||||
public EnvelopeType? EnvelopeType { get; set; }
|
||||
public EnvelopeType EnvelopeType { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public string? EnvelopeTypeTitle => EnvelopeType?.Title;
|
||||
public string EnvelopeTypeTitle => EnvelopeType?.Title;
|
||||
|
||||
[NotMapped]
|
||||
public bool IsAlreadySent => Status > (int) Constants.EnvelopeStatus.EnvelopeSaved;
|
||||
public bool IsAlreadySent => Status > (int)Constants.EnvelopeStatus.EnvelopeSaved;
|
||||
|
||||
public IEnumerable<EnvelopeDocument>? Documents { get; set; }
|
||||
[NotMapped]
|
||||
public string StatusTranslated => My.Resources.Model.ResourceManager.GetString(Status.ToString());
|
||||
|
||||
public IEnumerable<EnvelopeHistory>? History { get; set; }
|
||||
// TODO: * Check the Form App and remove the default value
|
||||
public IEnumerable<EnvelopeDocument> Documents { get; set; } = new List<EnvelopeDocument>();
|
||||
|
||||
// TODO: * Check the Form App and remove the default value
|
||||
public IEnumerable<EnvelopeHistory> History { get; set; } = new List<EnvelopeHistory>();
|
||||
|
||||
// TODO: * Check the Form App and remove the default value
|
||||
public IEnumerable<Receiver> Receivers { get; set; } = new List<Receiver>();
|
||||
|
||||
/// <summary>
|
||||
/// Validates whether the receiver and document data are complete.
|
||||
/// </summary>
|
||||
public List<string> ValidateReceiverDocumentData()
|
||||
{
|
||||
var errors = new List<string>();
|
||||
|
||||
if (!Documents?.Any() ?? true)
|
||||
errors.Add(My.Resources.Envelope.Missing_Documents);
|
||||
|
||||
if (!Receivers?.Any() ?? true)
|
||||
errors.Add(My.Resources.Envelope.Missing_Receivers);
|
||||
|
||||
if (Receivers?.Any(r => !r.HasEmailAndName) ?? false)
|
||||
errors.Add(My.Resources.Envelope.Incomplete_Receivers);
|
||||
|
||||
return errors;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
using DigitalData.Core.Abstractions;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace EnvelopeGenerator.Domain.Entities
|
||||
{
|
||||
[Table("TBSIG_ENVELOPE_CERTIFICATE", Schema = "dbo")]
|
||||
public class EnvelopeCertificate : IUnique<int>
|
||||
public class EnvelopeCertificate
|
||||
{
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
@@ -18,11 +17,11 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
|
||||
[Required]
|
||||
[Column("ENVELOPE_UUID", TypeName = "nvarchar(36)")]
|
||||
public required string EnvelopeUuid { get; set; }
|
||||
public string EnvelopeUuid { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("ENVELOPE_SUBJECT", TypeName = "nvarchar(512)")]
|
||||
public required string EnvelopeSubject { get; set; }
|
||||
public string EnvelopeSubject { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("CREATOR_ID")]
|
||||
@@ -30,11 +29,11 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
|
||||
[Required]
|
||||
[Column("CREATOR_NAME", TypeName = "nvarchar(128)")]
|
||||
public required string CreatorName { get; set; }
|
||||
public string CreatorName { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("CREATOR_EMAIL", TypeName = "nvarchar(128)")]
|
||||
public required string CreatorEmail { get; set; }
|
||||
public string CreatorEmail { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("ENVELOPE_STATUS")]
|
||||
|
||||
@@ -1,27 +1,31 @@
|
||||
using DigitalData.Core.Abstractions;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
#if NETFRAMEWORK
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
#endif
|
||||
|
||||
namespace EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
[Table("TBSIG_ENVELOPE_DOCUMENT", Schema = "dbo")]
|
||||
public class EnvelopeDocument : IUnique<int>
|
||||
namespace EnvelopeGenerator.Domain.Entities
|
||||
{
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
[Column("GUID")]
|
||||
public int Id { get; set; }
|
||||
[Table("TBSIG_ENVELOPE_DOCUMENT", Schema = "dbo")]
|
||||
public class EnvelopeDocument
|
||||
{
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
[Column("GUID")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("ENVELOPE_ID")]
|
||||
public int EnvelopeId { get; set; }
|
||||
[Required]
|
||||
[Column("ENVELOPE_ID")]
|
||||
public int EnvelopeId { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("ADDED_WHEN", TypeName = "datetime")]
|
||||
public required DateTime AddedWhen { get; set; }
|
||||
[Required]
|
||||
[Column("ADDED_WHEN", TypeName = "datetime")]
|
||||
public DateTime AddedWhen { get; set; }
|
||||
|
||||
[Column("BYTE_DATA", TypeName = "varbinary(max)")]
|
||||
public byte[]? ByteData { get; init; }
|
||||
[Column("BYTE_DATA", TypeName = "varbinary(max)")]
|
||||
public byte[] ByteData { get; set; }
|
||||
|
||||
public IEnumerable<DocumentReceiverElement>? Elements { get; set; }
|
||||
public IEnumerable<DocumentReceiverElement> Elements { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,13 @@
|
||||
using DigitalData.Core.Abstractions;
|
||||
using DigitalData.UserManager.Domain.Entities;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
#if NETFRAMEWORK
|
||||
using System;
|
||||
#endif
|
||||
|
||||
namespace EnvelopeGenerator.Domain.Entities
|
||||
{
|
||||
[Table("TBSIG_ENVELOPE_HISTORY", Schema = "dbo")]
|
||||
public class EnvelopeHistory : IUnique<long>
|
||||
public class EnvelopeHistory
|
||||
{
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
@@ -19,7 +20,7 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
|
||||
[Required]
|
||||
[Column("USER_REFERENCE", TypeName = "nvarchar(128)")]
|
||||
public required string UserReference { get; init; }
|
||||
public string UserReference { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("STATUS")]
|
||||
@@ -31,15 +32,15 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
public DateTime AddedWhen { get; set; }
|
||||
|
||||
[Column("ACTION_DATE", TypeName = "datetime")]
|
||||
public DateTime? ActionDate { get; set; }
|
||||
public DateTime ActionDate { get; set; }
|
||||
|
||||
[Column("COMMENT", TypeName = "nvarchar(max)")]
|
||||
public string? Comment { get; set; }
|
||||
public string Comment { get; set; }
|
||||
|
||||
[ForeignKey("UserReference")]
|
||||
public virtual User? Sender { get; set; }
|
||||
public virtual User Sender { get; set; }
|
||||
|
||||
[ForeignKey("UserReference")]
|
||||
public virtual Receiver? Receiver { get; set; }
|
||||
public virtual Receiver Receiver { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -6,9 +6,9 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
public class EnvelopeReceiver : EnvelopeReceiverBase
|
||||
{
|
||||
[ForeignKey("EnvelopeId")]
|
||||
public Envelope? Envelope { get; set; }
|
||||
public Envelope Envelope { get; set; }
|
||||
|
||||
[ForeignKey("ReceiverId")]
|
||||
public Receiver? Receiver { get; set; }
|
||||
public Receiver Receiver { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,13 @@
|
||||
using DigitalData.Core.Abstractions;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
#if NETFRAMEWORK
|
||||
using System;
|
||||
#endif
|
||||
|
||||
namespace EnvelopeGenerator.Domain.Entities
|
||||
{
|
||||
[Table("TBSIG_ENVELOPE_RECEIVER", Schema = "dbo")]
|
||||
public class EnvelopeReceiverBase : IUnique<(int Envelope, int Receiver)>
|
||||
public class EnvelopeReceiverBase
|
||||
{
|
||||
[Key]
|
||||
[Column("ENVELOPE_ID")]
|
||||
@@ -20,34 +22,34 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
public int Sequence { get; set; }
|
||||
|
||||
[Column("NAME", TypeName = "nvarchar(128)")]
|
||||
public string? Name { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
[Column("JOB_TITLE", TypeName = "nvarchar(128)")]
|
||||
public string? JobTitle { get; set; }
|
||||
public string JobTitle { get; set; }
|
||||
|
||||
[Column("COMPANY_NAME", TypeName = "nvarchar(128)")]
|
||||
public string? CompanyName { get; set; }
|
||||
public string CompanyName { get; set; }
|
||||
|
||||
[Column("PRIVATE_MESSAGE", TypeName = "nvarchar(max)")]
|
||||
public string? PrivateMessage { get; set; }
|
||||
public string PrivateMessage { get; set; }
|
||||
|
||||
[Column("ACCESS_CODE", TypeName = "nvarchar(64)")]
|
||||
public string? AccessCode { get; set; }
|
||||
public string AccessCode { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("ADDED_WHEN", TypeName = "datetime")]
|
||||
public DateTime AddedWhen { get; set; }
|
||||
|
||||
[Column("CHANGED_WHEN", TypeName = "datetime")]
|
||||
public DateTime? ChangedWhen { get; set; }
|
||||
public DateTime ChangedWhen { get; set; }
|
||||
|
||||
[Column("PHONE_NUMBER")]
|
||||
[StringLength(20)]
|
||||
[RegularExpression(@"^\+[0-9]+$", ErrorMessage = "Phone number must start with '+' followed by digits.")]
|
||||
public string? PhoneNumber { get; set; }
|
||||
public string PhoneNumber { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public (int Envelope, int Receiver) Id => (Envelope: EnvelopeId, Receiver: ReceiverId);
|
||||
public Tuple<int, int> Id => Tuple.Create(EnvelopeId, ReceiverId);
|
||||
|
||||
[NotMapped]
|
||||
public bool HasPhoneNumber => !string.IsNullOrWhiteSpace(PhoneNumber);
|
||||
|
||||
@@ -1,52 +1,54 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using DigitalData.Core.Abstractions;
|
||||
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
|
||||
#if NETFRAMEWORK
|
||||
using System;
|
||||
#endif
|
||||
|
||||
namespace EnvelopeGenerator.Domain.Entities
|
||||
{
|
||||
[Table("TBSIG_ENVELOPE_RECEIVER_READ_ONLY")]
|
||||
public class EnvelopeReceiverReadOnly : IUnique<long>
|
||||
public class EnvelopeReceiverReadOnly
|
||||
{
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
[Column("GUID")]
|
||||
public long Id { get; init; }
|
||||
public long Id { get; set; }
|
||||
|
||||
[Column("ENVELOPE_ID")]
|
||||
[Required]
|
||||
public long EnvelopeId { get; init; }
|
||||
public long EnvelopeId { get; set; }
|
||||
|
||||
//TODO: remove NotMapped attribute when EnvelopeId data type is standardized
|
||||
[NotMapped]
|
||||
public Envelope? Envelope { get; set; }
|
||||
public Envelope Envelope { get; set; }
|
||||
|
||||
[Column("RECEIVER_MAIL")]
|
||||
[Required]
|
||||
[StringLength(250)]
|
||||
[TemplatePlaceholder("NAME_RECEIVER")]
|
||||
public required string ReceiverMail { get; init; }
|
||||
public string ReceiverMail { get; set; }
|
||||
|
||||
[Column("DATE_VALID")]
|
||||
[Required]
|
||||
public DateTime DateValid { get; init; }
|
||||
public DateTime DateValid { get; set; }
|
||||
|
||||
[Column("ADDED_WHO")]
|
||||
[Required]
|
||||
[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")]
|
||||
[Required]
|
||||
public DateTime AddedWhen { get; init; }
|
||||
public DateTime AddedWhen { get; set; }
|
||||
|
||||
[Column("CHANGED_WHO")]
|
||||
[StringLength(100)]
|
||||
public string? ChangedWho { get; init; }
|
||||
public string ChangedWho { get; set; }
|
||||
|
||||
[Column("CHANGED_WHEN")]
|
||||
public DateTime? ChangedWhen { get; init; }
|
||||
public DateTime ChangedWhen { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,13 @@
|
||||
using DigitalData.Core.Abstractions;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
#if NETFRAMEWORK
|
||||
using System;
|
||||
#endif
|
||||
|
||||
namespace EnvelopeGenerator.Domain.Entities
|
||||
{
|
||||
[Table("TBSIG_ENVELOPE_TYPE", Schema = "dbo")]
|
||||
public class EnvelopeType : IUnique<int>
|
||||
public class EnvelopeType
|
||||
{
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
@@ -14,46 +16,46 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
|
||||
[Required]
|
||||
[Column("TITLE", TypeName = "nvarchar(128)")]
|
||||
public required string Title { get; set; }
|
||||
public string Title { get; set; }
|
||||
|
||||
[Column("LANGUAGE", TypeName = "nvarchar(5)")]
|
||||
public string? Language { get; set; }
|
||||
public string Language { get; set; }
|
||||
|
||||
[Column("EXPIRES_DAYS")]
|
||||
public int? ExpiresDays { get; set; }
|
||||
public int ExpiresDays { get; set; }
|
||||
|
||||
[Column("CERTIFICATION_TYPE")]
|
||||
public int? CertificationType { get; set; }
|
||||
public int CertificationType { get; set; }
|
||||
|
||||
[Column("USE_ACCESS_CODE")]
|
||||
public bool? UseAccessCode { get; set; }
|
||||
public bool UseAccessCode { get; set; }
|
||||
|
||||
[Column("FINAL_EMAIL_TO_CREATOR")]
|
||||
public int? FinalEmailToCreator { get; set; }
|
||||
public int FinalEmailToCreator { get; set; }
|
||||
|
||||
[Column("FINAL_EMAIL_TO_RECEIVERS")]
|
||||
public int? FinalEmailToReceivers { get; set; }
|
||||
public int FinalEmailToReceivers { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("ADDED_WHEN", TypeName = "datetime")]
|
||||
public DateTime AddedWhen { get; set; }
|
||||
|
||||
[Column("CHANGED_WHEN", TypeName = "datetime")]
|
||||
public DateTime? ChangedWhen { get; set; }
|
||||
public DateTime ChangedWhen { get; set; }
|
||||
|
||||
[Column("EXPIRES_WARNING_DAYS")]
|
||||
public int? ExpiresWarningDays { get; set; }
|
||||
public int ExpiresWarningDays { get; set; }
|
||||
|
||||
[Column("SEND_REMINDER_EMAILS")]
|
||||
public bool? SendReminderEmails { get; set; }
|
||||
public bool SendReminderEmails { get; set; }
|
||||
|
||||
[Column("FIRST_REMINDER_DAYS")]
|
||||
public int? FirstReminderDays { get; set; }
|
||||
public int FirstReminderDays { get; set; }
|
||||
|
||||
[Column("REMINDER_INTERVAL_DAYS")]
|
||||
public int? ReminderIntervalDays { get; set; }
|
||||
public int ReminderIntervalDays { get; set; }
|
||||
|
||||
[Column("CONTRACT_TYPE")]
|
||||
public int? ContractType { get; set; }
|
||||
public int ContractType { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,34 +1,89 @@
|
||||
using DigitalData.Core.Abstractions;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Drawing;
|
||||
#if NETFRAMEWORK
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
#endif
|
||||
|
||||
namespace EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
[Table("TBSIG_RECEIVER", Schema = "dbo")]
|
||||
public class Receiver : IUnique<int>
|
||||
namespace EnvelopeGenerator.Domain.Entities
|
||||
{
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
[Column("GUID")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required, EmailAddress]
|
||||
[Column("EMAIL_ADDRESS", TypeName = "nvarchar(128)")]
|
||||
public required string EmailAddress { get; set; }
|
||||
[Table("TBSIG_RECEIVER", Schema = "dbo")]
|
||||
public class Receiver
|
||||
{
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
[Column("GUID")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("SIGNATURE", TypeName = "nvarchar(64)")]
|
||||
public required string Signature { get; set; }
|
||||
[Required, EmailAddress]
|
||||
[Column("EMAIL_ADDRESS", TypeName = "nvarchar(128)")]
|
||||
public string EmailAddress { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("ADDED_WHEN", TypeName = "datetime")]
|
||||
public DateTime AddedWhen { get; set; }
|
||||
[Required]
|
||||
[Column("SIGNATURE", TypeName = "nvarchar(64)")]
|
||||
public string Signature { get; set; }
|
||||
|
||||
[Column("TOTP_SECRET_KEY", TypeName = "nvarchar(MAX)")]
|
||||
public string? TotpSecretkey { get; set; }
|
||||
[Required]
|
||||
[Column("ADDED_WHEN", TypeName = "datetime")]
|
||||
public DateTime AddedWhen { get; set; }
|
||||
|
||||
[Column("TFA_REG_DEADLINE", TypeName = "datetime")]
|
||||
public DateTime? TfaRegDeadline { get; set; }
|
||||
[Column("TOTP_SECRET_KEY", TypeName = "nvarchar(MAX)")]
|
||||
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; }
|
||||
|
||||
[NotMapped]
|
||||
public string Name { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public string Company { get; set; } = string.Empty;
|
||||
|
||||
[NotMapped]
|
||||
public string JobTitle { get; set; } = string.Empty;
|
||||
|
||||
[NotMapped]
|
||||
public string PhoneNumber { get; set; } = string.Empty;
|
||||
|
||||
[NotMapped]
|
||||
public string AccessCode { get; set; } = string.Empty;
|
||||
|
||||
[NotMapped]
|
||||
public string PrivateMessage { get; set; } = string.Empty;
|
||||
|
||||
[NotMapped]
|
||||
public int Sequence { get; set; } = 0;
|
||||
|
||||
[NotMapped]
|
||||
public DateTime SignedDate { get; set; } = DateTime.MinValue;
|
||||
|
||||
[NotMapped]
|
||||
public Constants.ReceiverStatus Status { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public Constants.ColorType ColorType { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public bool HasId => Id > 0;
|
||||
|
||||
[NotMapped]
|
||||
public bool HasEmailAndName =>
|
||||
!string.IsNullOrWhiteSpace(EmailAddress) &&
|
||||
!string.IsNullOrWhiteSpace(Name);
|
||||
|
||||
[NotMapped]
|
||||
public string SignedDateDisplayValue =>
|
||||
SignedDate == DateTime.MinValue ? "-" : SignedDate.ToString("G");
|
||||
|
||||
[NotMapped]
|
||||
public Color Color => ColorType.ToColor();
|
||||
|
||||
public string GetSignature()
|
||||
{
|
||||
return EmailAddress.ToUpperInvariant().GetChecksum();
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user