Compare commits
10 Commits
82831991b0
...
7cb1546934
| Author | SHA1 | Date | |
|---|---|---|---|
| 7cb1546934 | |||
| 60db762bcc | |||
| 5e840db04c | |||
| e724a74f9c | |||
| 48b7afcdc1 | |||
| 717da90c01 | |||
| 8054bb377d | |||
| 200258ff73 | |||
| fa73d939b5 | |||
| ca9e25abcb |
@@ -75,10 +75,12 @@ public record EnvelopeDto : IEnvelope
|
||||
/// </summary>
|
||||
public int? EnvelopeTypeId { get; set; }
|
||||
|
||||
// TODO: use ReadAndConfirm property name
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public bool ReadOnly => EnvelopeTypeId == 2;
|
||||
[Obsolete("Use EnvelopeExtensions.IsReadAndConfirm extension metot instead.")]
|
||||
public bool ReadOnly => this.IsReadAndConfirm();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
||||
@@ -11,5 +11,10 @@
|
||||
{
|
||||
return envelope.EnvelopeTypeId == 2;
|
||||
}
|
||||
|
||||
public static bool IsReadAndSign(this IEnvelope envelope)
|
||||
{
|
||||
return envelope.EnvelopeTypeId != 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ using EnvelopeGenerator.Application.Common.Notifications.DocSigned;
|
||||
using EnvelopeGenerator.Application.EnvelopeReceivers.Queries;
|
||||
using EnvelopeGenerator.Application.Histories.Queries;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
using EnvelopeGenerator.Domain.Interfaces;
|
||||
using EnvelopeGenerator.Web.Extensions;
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
@@ -65,7 +66,7 @@ public class AnnotationController : ControllerBase
|
||||
// Again check if receiver has already signed
|
||||
if (await _mediator.IsSignedAsync(uuid, signature, cancel))
|
||||
return Problem(statusCode: 409);
|
||||
else if (await _mediator.AnyHistoryAsync(uuid, new[] { EnvelopeStatus.EnvelopeRejected, EnvelopeStatus.DocumentRejected }, cancel))
|
||||
else if (er.Envelope.IsReadAndSign() && await _mediator.AnyHistoryAsync(uuid, new[] { EnvelopeStatus.EnvelopeRejected, EnvelopeStatus.DocumentRejected }, cancel))
|
||||
return Problem(statusCode: 423);
|
||||
|
||||
var docSignedNotification = await _mediator
|
||||
@@ -80,6 +81,7 @@ public class AnnotationController : ControllerBase
|
||||
return Ok();
|
||||
}
|
||||
|
||||
//TODO: add logic to check if it is already rejected or signed
|
||||
[Authorize(Roles = Role.ReceiverFull)]
|
||||
[HttpPost("reject")]
|
||||
[Obsolete("Use DigitalData.Core.Exceptions and .Middleware")]
|
||||
@@ -100,7 +102,7 @@ public class AnnotationController : ControllerBase
|
||||
if (envRcvRes.IsFailed)
|
||||
{
|
||||
_logger.LogNotice(envRcvRes.Notices);
|
||||
return Unauthorized("you are not authirized");
|
||||
return Unauthorized();
|
||||
}
|
||||
|
||||
var histRes = await _histService.RecordAsync(envRcvRes.Data.EnvelopeId, userReference: mail, EnvelopeStatus.DocumentRejected, comment: reason);
|
||||
|
||||
@@ -7,6 +7,7 @@ using EnvelopeGenerator.Application.Common.Interfaces.Services;
|
||||
using EnvelopeGenerator.Application.EnvelopeReceivers.Queries;
|
||||
using EnvelopeGenerator.Application.Resources;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
using EnvelopeGenerator.Domain.Interfaces;
|
||||
using EnvelopeGenerator.PdfEditor;
|
||||
using EnvelopeGenerator.Web.Extensions;
|
||||
using EnvelopeGenerator.Web.Models;
|
||||
@@ -78,13 +79,18 @@ public class EnvelopeController : ViewControllerBase
|
||||
return this.ViewEnvelopeNotFound();
|
||||
|
||||
#region Rejected or Signed
|
||||
//check rejection
|
||||
var rejRcvrs = await _historyService.ReadRejectingReceivers(er.Envelope!.Id);
|
||||
if (rejRcvrs.Any())
|
||||
{
|
||||
await HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
|
||||
ViewBag.IsExt = !rejRcvrs.Contains(er.Receiver); //external if the current user is not rejected
|
||||
return View("EnvelopeRejected", er);
|
||||
var isExt = !rejRcvrs.Where(rcv => rcv.Id == er.Receiver!.Id).Any(); //external if the current user is not rejected
|
||||
|
||||
if (er.Envelope.IsReadAndSign() || !isExt)
|
||||
{
|
||||
//TODO: Normally assigned to the isExt variable. However, since the relevant keys are not defined in the resx files, it was assigned false. Fix this.
|
||||
ViewBag.IsExt = true;
|
||||
return View("EnvelopeRejected", er);
|
||||
}
|
||||
}
|
||||
|
||||
//check if it has already signed
|
||||
@@ -162,13 +168,19 @@ public class EnvelopeController : ViewControllerBase
|
||||
}
|
||||
var er_secret = er_secret_res.Data;
|
||||
|
||||
//check rejection
|
||||
var rejRcvrs = await _historyService.ReadRejectingReceivers(er_secret.Envelope!.Id);
|
||||
if (rejRcvrs.Any())
|
||||
{
|
||||
await HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
|
||||
ViewBag.IsExt = !rejRcvrs.Contains(er_secret.Receiver); //external if the current user is not rejected
|
||||
return View("EnvelopeRejected", er_secret);
|
||||
var isExt = !rejRcvrs.Where(rcv => rcv.Id == er_secret.Receiver!.Id).Any(); //external if the current user is not rejected
|
||||
|
||||
//check rejection if the envelope is read-and-sign or non-external (internal)
|
||||
if (er_secret.Envelope.IsReadAndSign() || !isExt)
|
||||
{
|
||||
//TODO: Normally assigned to the isExt variable. However, since the relevant keys are not defined in the resx files, it was assigned false. Fix this.
|
||||
ViewBag.IsExt = true;
|
||||
return View("EnvelopeRejected", er_secret);
|
||||
}
|
||||
}
|
||||
|
||||
// show envelope if already logged in
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
|
||||
<TargetFrameworks>net7.0;net8.0;net9.0</TargetFrameworks>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<PackageId>EnvelopeGenerator.Web</PackageId>
|
||||
@@ -12,9 +12,9 @@
|
||||
<PackageTags>digital data envelope generator web</PackageTags>
|
||||
<Description>EnvelopeGenerator.Web is an ASP.NET MVC application developed to manage signing processes. It uses Entity Framework Core (EF Core) for database operations. The user interface for signing processes is developed with Razor View Engine (.cshtml files) and JavaScript under wwwroot, integrated with PSPDFKit. This integration allows users to view and sign documents seamlessly.</Description>
|
||||
<ApplicationIcon>Assets\icon.ico</ApplicationIcon>
|
||||
<Version>3.12.0</Version> <!-- NuGet package version -->
|
||||
<AssemblyVersion>3.12.0.0</AssemblyVersion> <!-- Assembly version for API compatibility -->
|
||||
<FileVersion>3.12.0.0</FileVersion> <!-- Windows file version -->
|
||||
<Version>3.12.2</Version> <!-- NuGet package version -->
|
||||
<AssemblyVersion>3.12.2.0</AssemblyVersion> <!-- Assembly version for API compatibility -->
|
||||
<FileVersion>3.12.2.0</FileVersion> <!-- Windows file version -->
|
||||
<Copyright>Copyright © 2025 Digital Data GmbH. All rights reserved.</Copyright>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -626,7 +626,6 @@
|
||||
<None Include="wwwroot\lib\bootstrap-icons\icons\clipboard2-pulse.svg" />
|
||||
<None Include="wwwroot\lib\bootstrap-icons\icons\clipboard2-x-fill.svg" />
|
||||
<None Include="wwwroot\lib\bootstrap-icons\icons\clipboard2-x.svg" />
|
||||
<None Include="wwwroot\lib\bootstrap-icons\icons\clipboard2.svg" />
|
||||
<None Include="wwwroot\lib\bootstrap-icons\icons\clock-fill.svg" />
|
||||
<None Include="wwwroot\lib\bootstrap-icons\icons\clock-history.svg" />
|
||||
<None Include="wwwroot\lib\bootstrap-icons\icons\clock.svg" />
|
||||
@@ -2093,6 +2092,31 @@
|
||||
<None Include="wwwroot\lib\bootstrap-icons\icons\zoom-out.svg" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
|
||||
<PackageReference Include="BuildBundlerMinifier2022" Version="2.9.11" />
|
||||
<PackageReference Include="DigitalData.Core.API" Version="2.2.1" />
|
||||
<PackageReference Include="DigitalData.Core.Exceptions" Version="1.1.0" />
|
||||
<PackageReference Include="DigitalData.EmailProfilerDispatcher" Version="3.1.1" />
|
||||
<PackageReference Include="HtmlSanitizer" Version="9.0.892" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.20" />
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.SqlServer" Version="7.0.20" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="NLog" Version="5.2.8" />
|
||||
<PackageReference Include="NLog.Web.AspNetCore" Version="5.3.4" />
|
||||
<PackageReference Include="Quartz" Version="3.7.0" />
|
||||
<PackageReference Include="Quartz.AspNetCore" Version="3.7.0" />
|
||||
<PackageReference Include="Quartz.Plugins" Version="3.7.0" />
|
||||
<PackageReference Include="Quartz.Serialization.Json" Version="3.7.0" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
|
||||
<PackageReference Include="System.Configuration.ConfigurationManager" Version="7.0.0" />
|
||||
<PackageReference Include="System.Diagnostics.PerformanceCounter" Version="7.0.0" />
|
||||
<PackageReference Include="System.DirectoryServices" Version="7.0.1" />
|
||||
<PackageReference Include="System.DirectoryServices.AccountManagement" Version="7.0.1" />
|
||||
<PackageReference Include="System.DirectoryServices.Protocols" Version="7.0.1" />
|
||||
<PackageReference Include="System.Drawing.Common" Version="7.0.0" />
|
||||
<PackageReference Include="System.Security.Cryptography.Cng" Version="5.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
|
||||
<PackageReference Include="BuildBundlerMinifier2022" Version="2.9.9" />
|
||||
<PackageReference Include="DigitalData.Core.API" Version="2.2.1" />
|
||||
|
||||
Reference in New Issue
Block a user