Merge branch 'master' of http://git.dd:3000/AppStd/EnvelopeGenerator
This commit is contained in:
commit
dc42a76f31
@ -1,5 +1,6 @@
|
|||||||
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
|
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
|
||||||
using DigitalData.UserManager.Application.DTOs.User;
|
using DigitalData.UserManager.Application.DTOs.User;
|
||||||
|
using EnvelopeGenerator.Application.Envelopes.Queries;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
@ -24,7 +25,7 @@ public record EnvelopeDto
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int Status { get; set; }
|
public required EnvelopeStatus Status { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Default value is string.Empty
|
/// Default value is string.Empty
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
using DigitalData.UserManager.Application.DTOs.User;
|
using DigitalData.UserManager.Application.DTOs.User;
|
||||||
using EnvelopeGenerator.Application.Dto.Receiver;
|
using EnvelopeGenerator.Application.Dto.Receiver;
|
||||||
using static EnvelopeGenerator.Domain.Constants;
|
using EnvelopeGenerator.Domain;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Dto.EnvelopeHistory;
|
namespace EnvelopeGenerator.Application.Dto.EnvelopeHistory;
|
||||||
|
|
||||||
@ -27,7 +27,17 @@ public record EnvelopeHistoryDto
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Include code of the envelope at this history point.
|
/// Include code of the envelope at this history point.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int Status { get; set; }
|
public Constants.EnvelopeStatus Status { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Type of reference for this history entry.
|
||||||
|
/// </summary>
|
||||||
|
public Constants.ReferenceType ReferenceType => ((int)Status).ToString().FirstOrDefault() switch
|
||||||
|
{
|
||||||
|
'1' => Constants.ReferenceType.Sender,
|
||||||
|
'2' => Constants.ReferenceType.Receiver,
|
||||||
|
_ => Constants.ReferenceType.System,
|
||||||
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Human-readable name of the status.
|
/// Human-readable name of the status.
|
||||||
@ -54,11 +64,6 @@ public record EnvelopeHistoryDto
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public ReceiverReadDto? Receiver { get; set; }
|
public ReceiverReadDto? Receiver { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Type of reference for this history entry.
|
|
||||||
/// </summary>
|
|
||||||
public ReferenceType ReferenceType { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Optional comment related to this history entry.
|
/// Optional comment related to this history entry.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -19,6 +19,7 @@
|
|||||||
<PackageReference Include="DigitalData.Core.Client" Version="2.1.0" />
|
<PackageReference Include="DigitalData.Core.Client" Version="2.1.0" />
|
||||||
<PackageReference Include="DigitalData.Core.Exceptions" Version="1.1.0" />
|
<PackageReference Include="DigitalData.Core.Exceptions" Version="1.1.0" />
|
||||||
<PackageReference Include="DigitalData.EmailProfilerDispatcher" Version="3.1.1" />
|
<PackageReference Include="DigitalData.EmailProfilerDispatcher" Version="3.1.1" />
|
||||||
|
<PackageReference Include="HtmlSanitizer" Version="8.0.865" />
|
||||||
<PackageReference Include="MediatR" Version="12.5.0" />
|
<PackageReference Include="MediatR" Version="12.5.0" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.18" />
|
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.18" />
|
||||||
<PackageReference Include="Otp.NET" Version="1.4.0" />
|
<PackageReference Include="Otp.NET" Version="1.4.0" />
|
||||||
@ -41,7 +42,6 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\EnvelopeGenerator.Domain\EnvelopeGenerator.Domain.csproj" />
|
<ProjectReference Include="..\EnvelopeGenerator.Domain\EnvelopeGenerator.Domain.csproj" />
|
||||||
<ProjectReference Include="..\EnvelopeGenerator.Extensions\EnvelopeGenerator.Extensions.csproj" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@ -3,7 +3,7 @@ using DigitalData.Core.Exceptions;
|
|||||||
using EnvelopeGenerator.Application.Model;
|
using EnvelopeGenerator.Application.Model;
|
||||||
using EnvelopeGenerator.Domain;
|
using EnvelopeGenerator.Domain;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using EnvelopeGenerator.Extensions;
|
using EnvelopeGenerator.Application.Extensions;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using static EnvelopeGenerator.Domain.Constants;
|
using static EnvelopeGenerator.Domain.Constants;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Extensions
|
namespace EnvelopeGenerator.Application.Extensions
|
||||||
{
|
{
|
||||||
public static class DecodingExtensions
|
public static class DecodingExtensions
|
||||||
{
|
{
|
||||||
@ -1,7 +1,7 @@
|
|||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Extensions
|
namespace EnvelopeGenerator.Application.Extensions
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Provides extension methods for decoding and extracting information from an envelope receiver ID.
|
/// Provides extension methods for decoding and extracting information from an envelope receiver ID.
|
||||||
@ -1,7 +1,7 @@
|
|||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Extensions
|
namespace EnvelopeGenerator.Application.Extensions
|
||||||
{
|
{
|
||||||
public static class LoggerExtensions
|
public static class LoggerExtensions
|
||||||
{
|
{
|
||||||
@ -1,6 +1,6 @@
|
|||||||
using Microsoft.Extensions.Caching.Memory;
|
using Microsoft.Extensions.Caching.Memory;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Extensions;
|
namespace EnvelopeGenerator.Application.Extensions;
|
||||||
|
|
||||||
public static class MemoryCacheExtensions
|
public static class MemoryCacheExtensions
|
||||||
{
|
{
|
||||||
@ -1,6 +1,6 @@
|
|||||||
using OtpNet;
|
using OtpNet;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Extensions
|
namespace EnvelopeGenerator.Application.Extensions
|
||||||
{
|
{
|
||||||
public static class StringExtension
|
public static class StringExtension
|
||||||
{
|
{
|
||||||
@ -33,7 +33,7 @@ public static class TaskExtensions
|
|||||||
/// <param name="factory">Exception provider</param>
|
/// <param name="factory">Exception provider</param>
|
||||||
/// <returns>The awaited collection if it is not <c>null</c> or empty.</returns>
|
/// <returns>The awaited collection if it is not <c>null</c> or empty.</returns>
|
||||||
/// <exception cref="NotFoundException">Thrown if the result is <c>null</c> or empty.</exception>
|
/// <exception cref="NotFoundException">Thrown if the result is <c>null</c> or empty.</exception>
|
||||||
public static async Task<IEnumerable<T>> ThrowIfNull<T, TException>(this Task<IEnumerable<T>> task, Func<TException> factory) where TException : Exception
|
public static async Task<IEnumerable<T>> ThrowIfEmpty<T, TException>(this Task<IEnumerable<T>> task, Func<TException> factory) where TException : Exception
|
||||||
{
|
{
|
||||||
var result = await task;
|
var result = await task;
|
||||||
return result?.Any() ?? false ? result : throw factory();
|
return result?.Any() ?? false ? result : throw factory();
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
using Microsoft.Extensions.Localization;
|
using Microsoft.Extensions.Localization;
|
||||||
using System.Text.Encodings.Web;
|
using System.Text.Encodings.Web;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Extensions
|
namespace EnvelopeGenerator.Application.Extensions
|
||||||
{
|
{
|
||||||
public static class XSSExtensions
|
public static class XSSExtensions
|
||||||
{
|
{
|
||||||
@ -1,6 +1,5 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using EnvelopeGenerator.Application.Histories.Commands;
|
using EnvelopeGenerator.Application.Histories.Commands;
|
||||||
using EnvelopeGenerator.Application.Histories.Queries.Read;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Histories;
|
namespace EnvelopeGenerator.Application.Histories;
|
||||||
@ -15,7 +14,6 @@ public class MappingProfile: Profile
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public MappingProfile()
|
public MappingProfile()
|
||||||
{
|
{
|
||||||
CreateMap<EnvelopeHistory, ReadHistoryResponse>();
|
|
||||||
CreateMap<CreateHistoryCommand, EnvelopeHistory>();
|
CreateMap<CreateHistoryCommand, EnvelopeHistory>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,46 +0,0 @@
|
|||||||
using AutoMapper;
|
|
||||||
using EnvelopeGenerator.Application.Interfaces.Repositories;
|
|
||||||
using DigitalData.Core.Exceptions;
|
|
||||||
using MediatR;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Histories.Queries.Read;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public class ReadHistoryQueryHandler : IRequestHandler<ReadHistoryQuery, IEnumerable<ReadHistoryResponse>>
|
|
||||||
{
|
|
||||||
[Obsolete("Use IRepository")]
|
|
||||||
private readonly IEnvelopeHistoryRepository _repository;
|
|
||||||
|
|
||||||
private readonly IMapper _mapper;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="repository"></param>
|
|
||||||
/// <param name="mapper"></param>
|
|
||||||
[Obsolete("Use IRepository")]
|
|
||||||
public ReadHistoryQueryHandler(IEnvelopeHistoryRepository repository, IMapper mapper)
|
|
||||||
{
|
|
||||||
_repository = repository;
|
|
||||||
_mapper = mapper;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="request"></param>
|
|
||||||
/// <param name="cancellationToken"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
/// <exception cref="NotFoundException"></exception>
|
|
||||||
public async Task<IEnumerable<ReadHistoryResponse>> Handle(ReadHistoryQuery request, CancellationToken cancellationToken)
|
|
||||||
{
|
|
||||||
var hists = await _repository.ReadAsync(request.EnvelopeId, status: request.Status is null ? null : request.Status);
|
|
||||||
|
|
||||||
if (!hists.Any())
|
|
||||||
throw new NotFoundException();
|
|
||||||
|
|
||||||
return _mapper.Map<IEnumerable<ReadHistoryResponse>>(hists);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,60 +0,0 @@
|
|||||||
using EnvelopeGenerator.Domain;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Histories.Queries.Read;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Represents the history of an envelope, including its status, user actions, and references.
|
|
||||||
/// </summary>
|
|
||||||
public class ReadHistoryResponse
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the unique identifier of the envelope history record.
|
|
||||||
/// </summary>
|
|
||||||
public long Id { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the identifier of the associated envelope.
|
|
||||||
/// </summary>
|
|
||||||
public int EnvelopeId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the reference identifier of the user who performed the action.
|
|
||||||
/// </summary>
|
|
||||||
public required string UserReference { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the status code of the envelope.
|
|
||||||
/// </summary>
|
|
||||||
public int Status { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public Constants.ReferenceType ReferenceType => Status.ToString().FirstOrDefault() switch
|
|
||||||
{
|
|
||||||
'1' => Constants.ReferenceType.Sender,
|
|
||||||
'2' => Constants.ReferenceType.Receiver,
|
|
||||||
_ => Constants.ReferenceType.System,
|
|
||||||
};
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the date and time when the record was added.
|
|
||||||
/// </summary>
|
|
||||||
public DateTime AddedWhen { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the date and time when the action occurred.
|
|
||||||
/// </summary>
|
|
||||||
public DateTime? ActionDate { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the optional comment about the envelope history record.
|
|
||||||
/// </summary>
|
|
||||||
public string? Comment { get; set; }
|
|
||||||
|
|
||||||
/// <inheritdoc/>
|
|
||||||
public override int GetHashCode()
|
|
||||||
{
|
|
||||||
return Id.GetHashCode();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,8 +1,9 @@
|
|||||||
using EnvelopeGenerator.Domain;
|
using EnvelopeGenerator.Application.Dto.EnvelopeHistory;
|
||||||
|
using EnvelopeGenerator.Domain;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Histories.Queries.Read;
|
namespace EnvelopeGenerator.Application.Histories.Queries;
|
||||||
|
|
||||||
//TODO: Add sender query
|
//TODO: Add sender query
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -15,6 +16,4 @@ public record ReadHistoryQuery(
|
|||||||
[Required]
|
[Required]
|
||||||
int EnvelopeId,
|
int EnvelopeId,
|
||||||
Constants.EnvelopeStatus? Status = null,
|
Constants.EnvelopeStatus? Status = null,
|
||||||
bool? OnlyLast = true) : IRequest<IEnumerable<ReadHistoryResponse>>
|
bool? OnlyLast = true) : IRequest<IEnumerable<EnvelopeHistoryDto>>;
|
||||||
{
|
|
||||||
};
|
|
||||||
@ -0,0 +1,47 @@
|
|||||||
|
using AutoMapper;
|
||||||
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
|
using DigitalData.Core.Exceptions;
|
||||||
|
using EnvelopeGenerator.Application.Dto.EnvelopeHistory;
|
||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
using MediatR;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Histories.Queries;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class ReadHistoryQueryHandler : IRequestHandler<ReadHistoryQuery, IEnumerable<EnvelopeHistoryDto>>
|
||||||
|
{
|
||||||
|
private readonly IRepository<EnvelopeHistory> _repo;
|
||||||
|
|
||||||
|
private readonly IMapper _mapper;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="repo"></param>
|
||||||
|
/// <param name="mapper"></param>
|
||||||
|
public ReadHistoryQueryHandler(IRepository<EnvelopeHistory> repo, IMapper mapper)
|
||||||
|
{
|
||||||
|
_repo = repo;
|
||||||
|
_mapper = mapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="cancel"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="NotFoundException"></exception>
|
||||||
|
public async Task<IEnumerable<EnvelopeHistoryDto>> Handle(ReadHistoryQuery request, CancellationToken cancel = default)
|
||||||
|
{
|
||||||
|
var query = _repo.ReadOnly().Where(h => h.EnvelopeId == request.EnvelopeId);
|
||||||
|
if (request.Status is not null)
|
||||||
|
query = query.Where(h => h.Status == request.Status);
|
||||||
|
|
||||||
|
var hists = await query.ToListAsync(cancel);
|
||||||
|
return _mapper.Map<IEnumerable<EnvelopeHistoryDto>>(hists);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,5 +1,5 @@
|
|||||||
using DigitalData.Core.Exceptions;
|
using DigitalData.Core.Exceptions;
|
||||||
using EnvelopeGenerator.Extensions;
|
using EnvelopeGenerator.Application.Extensions;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Model;
|
namespace EnvelopeGenerator.Application.Model;
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@ using EnvelopeGenerator.Application.Dto.EnvelopeReceiver;
|
|||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
using static EnvelopeGenerator.Domain.Constants;
|
using static EnvelopeGenerator.Domain.Constants;
|
||||||
using EnvelopeGenerator.Extensions;
|
using EnvelopeGenerator.Application.Extensions;
|
||||||
using EnvelopeGenerator.Application.Dto.EnvelopeReceiverReadOnly;
|
using EnvelopeGenerator.Application.Dto.EnvelopeReceiverReadOnly;
|
||||||
using EnvelopeGenerator.Application.Configurations;
|
using EnvelopeGenerator.Application.Configurations;
|
||||||
using EnvelopeGenerator.Application.Extensions;
|
using EnvelopeGenerator.Application.Extensions;
|
||||||
|
|||||||
@ -7,7 +7,7 @@ using EnvelopeGenerator.Domain.Entities;
|
|||||||
using EnvelopeGenerator.Application.Interfaces.Repositories;
|
using EnvelopeGenerator.Application.Interfaces.Repositories;
|
||||||
using Microsoft.Extensions.Localization;
|
using Microsoft.Extensions.Localization;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using EnvelopeGenerator.Extensions;
|
using EnvelopeGenerator.Application.Extensions;
|
||||||
using EnvelopeGenerator.Application.Dto.Messaging;
|
using EnvelopeGenerator.Application.Dto.Messaging;
|
||||||
using EnvelopeGenerator.Application.Interfaces.Services;
|
using EnvelopeGenerator.Application.Interfaces.Services;
|
||||||
using EnvelopeGenerator.Application.Envelopes;
|
using EnvelopeGenerator.Application.Envelopes;
|
||||||
|
|||||||
@ -1,26 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>net7.0</TargetFramework>
|
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
<Description>Test</Description>
|
|
||||||
<FileVersion>1.0.0.1</FileVersion>
|
|
||||||
<AssemblyVersion>1.0.0.2</AssemblyVersion>
|
|
||||||
<PackageReleaseNotes>Versionshinweis xyz</PackageReleaseNotes>
|
|
||||||
<Version>1.1</Version>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="HtmlSanitizer" Version="8.0.865" />
|
|
||||||
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="8.0.1" />
|
|
||||||
<PackageReference Include="Microsoft.Extensions.Localization.Abstractions" Version="7.0.19" />
|
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
|
|
||||||
<PackageReference Include="Otp.NET" Version="1.4.0" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\EnvelopeGenerator.Domain\EnvelopeGenerator.Domain.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
@ -63,13 +63,13 @@ public class EnvelopeController : ControllerBase
|
|||||||
public async Task<IActionResult> GetAsync([FromQuery] ReadEnvelopeQuery envelope)
|
public async Task<IActionResult> GetAsync([FromQuery] ReadEnvelopeQuery envelope)
|
||||||
{
|
{
|
||||||
if (User.GetId() is int intId)
|
if (User.GetId() is int intId)
|
||||||
return await _envelopeService.ReadByUserAsync(intId, min_status: envelope.Status, max_status: envelope.Status).ThenAsync(
|
return await _envelopeService.ReadByUserAsync(intId, min_status: envelope.Status?.Min, max_status: envelope.Status?.Max).ThenAsync(
|
||||||
Success: envelopes =>
|
Success: envelopes =>
|
||||||
{
|
{
|
||||||
if (envelope.Id is int id)
|
if (envelope.Id is int id)
|
||||||
envelopes = envelopes.Where(e => e.Id == id);
|
envelopes = envelopes.Where(e => e.Id == id);
|
||||||
|
|
||||||
if (envelope.Status is int status)
|
if (envelope.Status is EnvelopeStatus status)
|
||||||
envelopes = envelopes.Where(e => e.Status == status);
|
envelopes = envelopes.Where(e => e.Status == status);
|
||||||
|
|
||||||
if (envelope.Uuid is string uuid)
|
if (envelope.Uuid is string uuid)
|
||||||
|
|||||||
@ -15,6 +15,8 @@ using Microsoft.AspNetCore.Mvc;
|
|||||||
using Microsoft.Data.SqlClient;
|
using Microsoft.Data.SqlClient;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
|
using System.Reflection.Metadata;
|
||||||
|
using EnvelopeGenerator.Domain;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.GeneratorAPI.Controllers;
|
namespace EnvelopeGenerator.GeneratorAPI.Controllers;
|
||||||
|
|
||||||
@ -98,11 +100,11 @@ public class EnvelopeReceiverController : ControllerBase
|
|||||||
|
|
||||||
return await _erService.ReadByUsernameAsync(
|
return await _erService.ReadByUsernameAsync(
|
||||||
username: username,
|
username: username,
|
||||||
min_status: envelopeReceiver.Status?.Min,
|
min_status: envelopeReceiver.Envelope.Status?.Min,
|
||||||
max_status: envelopeReceiver.Status?.Max,
|
max_status: envelopeReceiver.Envelope.Status?.Max,
|
||||||
envelopeQuery: envelopeReceiver.Envelope,
|
envelopeQuery: envelopeReceiver.Envelope,
|
||||||
receiverQuery: envelopeReceiver.Receiver,
|
receiverQuery: envelopeReceiver.Receiver,
|
||||||
ignore_statuses: envelopeReceiver.Status?.Ignore ?? Array.Empty<int>())
|
ignore_statuses: envelopeReceiver.Envelope.Status?.Ignore ?? Array.Empty<Constants.EnvelopeStatus>())
|
||||||
.ThenAsync(
|
.ThenAsync(
|
||||||
Success: Ok,
|
Success: Ok,
|
||||||
Fail: IActionResult (msg, ntc) =>
|
Fail: IActionResult (msg, ntc) =>
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
using EnvelopeGenerator.Application.Interfaces.Services;
|
using EnvelopeGenerator.Application.Extensions;
|
||||||
using EnvelopeGenerator.Application.Histories.Queries.Read;
|
|
||||||
using EnvelopeGenerator.Extensions;
|
|
||||||
using MediatR;
|
using MediatR;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.Extensions.Caching.Memory;
|
using Microsoft.Extensions.Caching.Memory;
|
||||||
using static EnvelopeGenerator.Domain.Constants;
|
using EnvelopeGenerator.Domain;
|
||||||
|
using EnvelopeGenerator.Application.Histories.Queries;
|
||||||
|
using EnvelopeGenerator.Application.Extensions;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.GeneratorAPI.Controllers;
|
namespace EnvelopeGenerator.GeneratorAPI.Controllers;
|
||||||
|
|
||||||
@ -17,8 +17,6 @@ namespace EnvelopeGenerator.GeneratorAPI.Controllers;
|
|||||||
[Authorize]
|
[Authorize]
|
||||||
public class HistoryController : ControllerBase
|
public class HistoryController : ControllerBase
|
||||||
{
|
{
|
||||||
private readonly IEnvelopeHistoryService _service;
|
|
||||||
|
|
||||||
private readonly IMemoryCache _memoryCache;
|
private readonly IMemoryCache _memoryCache;
|
||||||
|
|
||||||
private readonly IMediator _mediator;
|
private readonly IMediator _mediator;
|
||||||
@ -26,12 +24,10 @@ public class HistoryController : ControllerBase
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Konstruktor für den HistoryController.
|
/// Konstruktor für den HistoryController.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="service">Der Dienst, der für die Verarbeitung der Umschlaghistorie verantwortlich ist.</param>
|
|
||||||
/// <param name="memoryCache"></param>
|
/// <param name="memoryCache"></param>
|
||||||
/// <param name="mediator"></param>
|
/// <param name="mediator"></param>
|
||||||
public HistoryController(IEnvelopeHistoryService service, IMemoryCache memoryCache, IMediator mediator)
|
public HistoryController(IMemoryCache memoryCache, IMediator mediator)
|
||||||
{
|
{
|
||||||
_service = service;
|
|
||||||
_memoryCache = memoryCache;
|
_memoryCache = memoryCache;
|
||||||
_mediator = mediator;
|
_mediator = mediator;
|
||||||
}
|
}
|
||||||
@ -52,9 +48,11 @@ public class HistoryController : ControllerBase
|
|||||||
/// <response code="200"></response>
|
/// <response code="200"></response>
|
||||||
[HttpGet("related")]
|
[HttpGet("related")]
|
||||||
[Authorize]
|
[Authorize]
|
||||||
public IActionResult GetReferenceTypes(ReferenceType? referenceType = null)
|
public IActionResult GetReferenceTypes(Constants.ReferenceType? referenceType = null)
|
||||||
{
|
{
|
||||||
return referenceType is null ? Ok(_memoryCache.GetEnumAsDictionary<ReferenceType>("gen.api", ReferenceType.Unknown)) : Ok(referenceType.ToString());
|
return referenceType is null
|
||||||
|
? Ok(_memoryCache.GetEnumAsDictionary<Constants.ReferenceType>("gen.api", Constants.ReferenceType.Unknown))
|
||||||
|
: Ok(referenceType.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -93,15 +91,18 @@ public class HistoryController : ControllerBase
|
|||||||
/// <response code="200"></response>
|
/// <response code="200"></response>
|
||||||
[HttpGet("status")]
|
[HttpGet("status")]
|
||||||
[Authorize]
|
[Authorize]
|
||||||
public IActionResult GetEnvelopeStatus([FromQuery] EnvelopeStatus? status = null)
|
public IActionResult GetEnvelopeStatus([FromQuery] Constants.EnvelopeStatus? status = null)
|
||||||
{
|
{
|
||||||
return status is null ? Ok(_memoryCache.GetEnumAsDictionary<EnvelopeStatus>("gen.api", Status.NonHist, Status.RelatedToFormApp)) : Ok(status.ToString());
|
return status is null
|
||||||
|
? Ok(_memoryCache.GetEnumAsDictionary<Constants.EnvelopeStatus>("gen.api", Constants.Status.NonHist, Constants.Status.RelatedToFormApp))
|
||||||
|
: Ok(status.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Ruft die gesamte Umschlaghistorie basierend auf den angegebenen Abfrageparametern ab.
|
/// Ruft die gesamte Umschlaghistorie basierend auf den angegebenen Abfrageparametern ab.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="historyQuery">Die Abfrageparameter, die die Filterkriterien für die Umschlaghistorie definieren.</param>
|
/// <param name="historyQuery">Die Abfrageparameter, die die Filterkriterien für die Umschlaghistorie definieren.</param>
|
||||||
|
/// <param name="cancel"></param>
|
||||||
/// <returns>Eine Liste von Historieneinträgen, die den angegebenen Kriterien entsprechen, oder nur der letzte Eintrag.</returns>
|
/// <returns>Eine Liste von Historieneinträgen, die den angegebenen Kriterien entsprechen, oder nur der letzte Eintrag.</returns>
|
||||||
/// <response code="200">Die Anfrage war erfolgreich, und die Umschlaghistorie wird zurückgegeben.</response>
|
/// <response code="200">Die Anfrage war erfolgreich, und die Umschlaghistorie wird zurückgegeben.</response>
|
||||||
/// <response code="400">Die Anfrage war ungültig oder unvollständig.</response>
|
/// <response code="400">Die Anfrage war ungültig oder unvollständig.</response>
|
||||||
@ -110,10 +111,9 @@ public class HistoryController : ControllerBase
|
|||||||
/// <response code="500">Ein unerwarteter Fehler ist aufgetreten.</response>
|
/// <response code="500">Ein unerwarteter Fehler ist aufgetreten.</response>
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Authorize]
|
[Authorize]
|
||||||
public async Task<IActionResult> GetAllAsync([FromQuery] ReadHistoryQuery historyQuery)
|
public async Task<IActionResult> GetAllAsync([FromQuery] ReadHistoryQuery historyQuery, CancellationToken cancel)
|
||||||
{
|
{
|
||||||
var history = await _mediator.Send(historyQuery);
|
var history = await _mediator.Send(historyQuery, cancel).ThrowIfEmpty(Exceptions.NotFound);
|
||||||
|
|
||||||
return Ok((historyQuery.OnlyLast ?? false) ? history.MaxBy(h => h.AddedWhen) : history);
|
return Ok((historyQuery.OnlyLast ?? false) ? history.MaxBy(h => h.AddedWhen) : history);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -45,7 +45,7 @@ public class CommandManager
|
|||||||
{
|
{
|
||||||
ReadDocumentQuery query = new(id, envelopeId);
|
ReadDocumentQuery query = new(id, envelopeId);
|
||||||
var document = await _mediator.Send(query);
|
var document = await _mediator.Send(query);
|
||||||
console.WriteLine(JsonSerializer.Serialize(save ? document as ReadDocumentResponse : document, Options));
|
console.WriteLine(JsonSerializer.Serialize(document, Options));
|
||||||
|
|
||||||
if (save)
|
if (save)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -9,15 +9,11 @@
|
|||||||
<IsTestProject>true</IsTestProject>
|
<IsTestProject>true</IsTestProject>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<None Remove="appsettings.json" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="appsettings.json">
|
<Content Include="appsettings.json">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
|
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
|
||||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
123
EnvelopeGenerator.Tests.Application/HistoryTests.cs
Normal file
123
EnvelopeGenerator.Tests.Application/HistoryTests.cs
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
using EnvelopeGenerator.Application;
|
||||||
|
using EnvelopeGenerator.Application.Histories.Commands;
|
||||||
|
using EnvelopeGenerator.Application.Histories.Queries;
|
||||||
|
using EnvelopeGenerator.Domain;
|
||||||
|
using EnvelopeGenerator.Infrastructure;
|
||||||
|
using MediatR;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.Extensions.Configuration;
|
||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
using Microsoft.Extensions.Hosting;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Tests.Application;
|
||||||
|
|
||||||
|
[TestFixture]
|
||||||
|
public class HistoryTests
|
||||||
|
{
|
||||||
|
private IHost _host;
|
||||||
|
|
||||||
|
private IServiceProvider Provider => _host.Services;
|
||||||
|
|
||||||
|
[SetUp]
|
||||||
|
public void Setup()
|
||||||
|
{
|
||||||
|
_host = Host.CreateDefaultBuilder()
|
||||||
|
.ConfigureAppConfiguration((context, config) =>
|
||||||
|
{
|
||||||
|
// add appsettings.json
|
||||||
|
config.SetBasePath(Directory.GetCurrentDirectory());
|
||||||
|
config.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true);
|
||||||
|
})
|
||||||
|
.ConfigureServices((context, services) =>
|
||||||
|
{
|
||||||
|
IConfiguration configuration = context.Configuration;
|
||||||
|
|
||||||
|
// add Application and Infrastructure services
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
services.AddEnvelopeGeneratorServices(configuration);
|
||||||
|
services.AddEnvelopeGeneratorInfrastructureServices(
|
||||||
|
(sp, options) => options.UseInMemoryDatabase("EnvelopeGeneratorTestDb"),
|
||||||
|
context.Configuration
|
||||||
|
);
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
})
|
||||||
|
.Build();
|
||||||
|
}
|
||||||
|
|
||||||
|
[TearDown]
|
||||||
|
public void TearDown()
|
||||||
|
{
|
||||||
|
_host.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task<TResponse> Send<TResponse>(IRequest<TResponse> request)
|
||||||
|
{
|
||||||
|
var mediator = Provider.GetRequiredService<IMediator>();
|
||||||
|
return await mediator.Send(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public async Task CreateHistory_And_ReadHistory_Should_Work()
|
||||||
|
{
|
||||||
|
// Arrange
|
||||||
|
var createCmd = new CreateHistoryCommand
|
||||||
|
{
|
||||||
|
EnvelopeId = 1,
|
||||||
|
UserReference = "UserA",
|
||||||
|
Status = Constants.EnvelopeStatus.EnvelopeCreated,
|
||||||
|
Comment = "First create"
|
||||||
|
};
|
||||||
|
|
||||||
|
// Act
|
||||||
|
var id = await Send(createCmd);
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
Assert.That(id, Is.Not.Null);
|
||||||
|
|
||||||
|
// ReadHistory sorgusu
|
||||||
|
var query = new ReadHistoryQuery(1);
|
||||||
|
var result = await Send(query);
|
||||||
|
|
||||||
|
Assert.That(result, Is.Not.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public async Task ReadHistory_Should_Filter_By_Status()
|
||||||
|
{
|
||||||
|
// Arrange
|
||||||
|
var createCmd1 = new CreateHistoryCommand
|
||||||
|
{
|
||||||
|
EnvelopeId = 2,
|
||||||
|
UserReference = "UserX",
|
||||||
|
Status = Constants.EnvelopeStatus.EnvelopeCreated
|
||||||
|
};
|
||||||
|
|
||||||
|
var createCmd2 = new CreateHistoryCommand
|
||||||
|
{
|
||||||
|
EnvelopeId = 2,
|
||||||
|
UserReference = "UserX",
|
||||||
|
Status = Constants.EnvelopeStatus.EnvelopePartlySigned
|
||||||
|
};
|
||||||
|
|
||||||
|
await Send(createCmd1);
|
||||||
|
await Send(createCmd2);
|
||||||
|
|
||||||
|
// Act
|
||||||
|
var result = await Send(new ReadHistoryQuery(2, Constants.EnvelopeStatus.EnvelopePartlySigned));
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
Assert.That(result, Has.Exactly(1).Items);
|
||||||
|
Assert.That(result, Has.All.Matches<EnvelopeGenerator.Application.Dto.EnvelopeHistory.EnvelopeHistoryDto>(
|
||||||
|
r => r.Status == Constants.EnvelopeStatus.EnvelopePartlySigned));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public async Task ReadHistory_Should_Return_Empty_When_No_Record()
|
||||||
|
{
|
||||||
|
// Act
|
||||||
|
var result = await Send(new ReadHistoryQuery(999));
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
Assert.That(result, Is.Empty);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"DiPMode": false, //Please be careful when enabling Development in Production (DiP) mode. It allows Swagger and test controllers to be enabled in a production environment.
|
"DiPMode": false, //Please be careful when enabling Development in Production (DiP) mode. It allows Swagger and test controllers to be enabled in a production environment.
|
||||||
"EnableSwagger": true,
|
"EnableSwagger": true,
|
||||||
|
"UseDbMigration": false,
|
||||||
"EnableTestControllers": true,
|
"EnableTestControllers": true,
|
||||||
"DetailedErrors": true,
|
"DetailedErrors": true,
|
||||||
"Logging": {
|
"Logging": {
|
||||||
@ -12,7 +13,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
"Default": "Server=SDD-VMP04-SQL17\\DD_DEVELOP01;Database=DD_ECM;User Id=sa;Password=dd;Encrypt=false;TrustServerCertificate=True;"
|
"Default": "Server=SDD-VMP04-SQL17\\DD_DEVELOP01;Database=DD_ECM;User Id=sa;Password=dd;Encrypt=false;TrustServerCertificate=True;",
|
||||||
|
"DbMigrationTest": "Server=SDD-VMP04-SQL17\\DD_DEVELOP01;Database=DD_ECM_DATA_MIGR_TEST;User Id=sa;Password=dd;Encrypt=false;TrustServerCertificate=True;"
|
||||||
},
|
},
|
||||||
"PSPDFKitLicenseKey": "SXCtGGY9XA-31OGUXQK-r7c6AkdLGPm2ljuyDr1qu0kkhLvydg-Do-fxpNUF4Rq3fS_xAnZRNFRHbXpE6sQ2BMcCSVTcXVJO6tPviexjpiT-HnrDEySlUERJnnvh-tmeOWprxS6BySPnSILkmaVQtUfOIUS-cUbvvEYHTvQBKbSF8di4XHQFyfv49ihr51axm3NVV3AXwh2EiKL5C5XdqBZ4sQ4O7vXBjM2zvxdPxlxdcNYmiU83uAzw7B83O_jubPzya4CdUHh_YH7Nlp2gP56MeG1Sw2JhMtfG3Rj14Sg4ctaeL9p6AEWca5dDjJ2li5tFIV2fQSsw6A_cowLu0gtMm5i8IfJXeIcQbMC2-0wGv1oe9hZYJvFMdzhTM_FiejM0agemxt3lJyzuyP8zbBSOgp7Si6A85krLWPZptyZBTG7pp7IHboUHfPMxCXqi-zMsqewOJtQBE2mjntU-lPryKnssOpMPfswwQX7QSkJYV5EMqNmEhQX6mEkp2wcqFzMC7bJQew1aO4pOpvChUaMvb1vgRek0HxLag0nwQYX2YrYGh7F_xXJs-8HNwJe8H0-eW4x4faayCgM5rB5772CCCsD9ThZcvXFrjNHHLGJ8WuBUFm6LArvSfFQdii_7j-_sqHMpeKZt26NFgivj1A==",
|
"PSPDFKitLicenseKey": "SXCtGGY9XA-31OGUXQK-r7c6AkdLGPm2ljuyDr1qu0kkhLvydg-Do-fxpNUF4Rq3fS_xAnZRNFRHbXpE6sQ2BMcCSVTcXVJO6tPviexjpiT-HnrDEySlUERJnnvh-tmeOWprxS6BySPnSILkmaVQtUfOIUS-cUbvvEYHTvQBKbSF8di4XHQFyfv49ihr51axm3NVV3AXwh2EiKL5C5XdqBZ4sQ4O7vXBjM2zvxdPxlxdcNYmiU83uAzw7B83O_jubPzya4CdUHh_YH7Nlp2gP56MeG1Sw2JhMtfG3Rj14Sg4ctaeL9p6AEWca5dDjJ2li5tFIV2fQSsw6A_cowLu0gtMm5i8IfJXeIcQbMC2-0wGv1oe9hZYJvFMdzhTM_FiejM0agemxt3lJyzuyP8zbBSOgp7Si6A85krLWPZptyZBTG7pp7IHboUHfPMxCXqi-zMsqewOJtQBE2mjntU-lPryKnssOpMPfswwQX7QSkJYV5EMqNmEhQX6mEkp2wcqFzMC7bJQew1aO4pOpvChUaMvb1vgRek0HxLag0nwQYX2YrYGh7F_xXJs-8HNwJe8H0-eW4x4faayCgM5rB5772CCCsD9ThZcvXFrjNHHLGJ8WuBUFm6LArvSfFQdii_7j-_sqHMpeKZt26NFgivj1A==",
|
||||||
"Content-Security-Policy": [ // The first format parameter {0} will be replaced by the nonce value.
|
"Content-Security-Policy": [ // The first format parameter {0} will be replaced by the nonce value.
|
||||||
@ -39,6 +41,11 @@
|
|||||||
"fileName": "${logDirectory}\\${logFileNamePrefix}-Info.log",
|
"fileName": "${logDirectory}\\${logFileNamePrefix}-Info.log",
|
||||||
"maxArchiveDays": 30
|
"maxArchiveDays": 30
|
||||||
},
|
},
|
||||||
|
"warningLogs": {
|
||||||
|
"type": "File",
|
||||||
|
"fileName": "${logDirectory}\\${logFileNamePrefix}-Warning.log",
|
||||||
|
"maxArchiveDays": 30
|
||||||
|
},
|
||||||
"errorLogs": {
|
"errorLogs": {
|
||||||
"type": "File",
|
"type": "File",
|
||||||
"fileName": "${logDirectory}\\${logFileNamePrefix}-Error.log",
|
"fileName": "${logDirectory}\\${logFileNamePrefix}-Error.log",
|
||||||
@ -50,14 +57,17 @@
|
|||||||
"maxArchiveDays": 30
|
"maxArchiveDays": 30
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// Trace, Debug, Info, Warn, Error and *Fatal*
|
|
||||||
"rules": [
|
"rules": [
|
||||||
{
|
{
|
||||||
"logger": "*",
|
"logger": "*",
|
||||||
"minLevel": "Info",
|
"level": "Info",
|
||||||
"maxLevel": "Warn",
|
|
||||||
"writeTo": "infoLogs"
|
"writeTo": "infoLogs"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"logger": "*",
|
||||||
|
"level": "Warn",
|
||||||
|
"writeTo": "warningLogs"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"logger": "*",
|
"logger": "*",
|
||||||
"level": "Error",
|
"level": "Error",
|
||||||
@ -140,17 +150,33 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"TFARegParams": {
|
"TFARegParams": {
|
||||||
"TimeLimit": "00:30:00"
|
"TimeLimit": "90.00:00:00"
|
||||||
},
|
},
|
||||||
"DbTriggerParams": {
|
"DbTriggerParams": {
|
||||||
"Envelope": [ "TBSIG_ENVELOPE_HISTORY_AFT_INS" ],
|
"Envelope": [ "TBSIG_ENVELOPE_HISTORY_AFT_INS" ],
|
||||||
"EnvelopeHistory": [ "TBSIG_ENVELOPE_HISTORY_AFT_INS" ],
|
"EnvelopeHistory": [ "TBSIG_ENVELOPE_HISTORY_AFT_INS" ],
|
||||||
"EmailOut": [ "TBEMLP_EMAIL_OUT_AFT_INS", "TBEMLP_EMAIL_OUT_AFT_UPD" ],
|
"EmailOut": [ "TBEMLP_EMAIL_OUT_AFT_INS", "TBEMLP_EMAIL_OUT_AFT_UPD" ],
|
||||||
"EnvelopeReceiverReadOnly": [ "TBSIG_ENVELOPE_RECEIVER_READ_ONLY_UPD" ],
|
"EnvelopeReceiverReadOnly": [ "TBSIG_ENVELOPE_RECEIVER_READ_ONLY_UPD" ],
|
||||||
"Receiver": []
|
"Receiver": [],
|
||||||
|
"EmailTemplate": [ "TBSIG_EMAIL_TEMPLATE_AFT_UPD" ]
|
||||||
},
|
},
|
||||||
"MainPageTitle": null,
|
"MainPageTitle": null,
|
||||||
"AnnotationParams": {
|
"AnnotationParams": {
|
||||||
|
"Background": {
|
||||||
|
"Margin": 0.20,
|
||||||
|
"BackgroundColor": {
|
||||||
|
"R": 222,
|
||||||
|
"G": 220,
|
||||||
|
"B": 215
|
||||||
|
},
|
||||||
|
"BorderColor": {
|
||||||
|
"R": 204,
|
||||||
|
"G": 202,
|
||||||
|
"B": 198
|
||||||
|
},
|
||||||
|
"BorderStyle": "underline",
|
||||||
|
"BorderWidth": 4
|
||||||
|
},
|
||||||
"DefaultAnnotation": {
|
"DefaultAnnotation": {
|
||||||
"Width": 1,
|
"Width": 1,
|
||||||
"Height": 0.5,
|
"Height": 0.5,
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
using EnvelopeGenerator.CommonServices;
|
using EnvelopeGenerator.CommonServices;
|
||||||
using EnvelopeGenerator.Web.Services;
|
using EnvelopeGenerator.Web.Services;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using EnvelopeGenerator.Extensions;
|
using EnvelopeGenerator.Application.Extensions;
|
||||||
using EnvelopeGenerator.Application.Interfaces.Services;
|
using EnvelopeGenerator.Application.Interfaces.Services;
|
||||||
using static EnvelopeGenerator.Domain.Constants;
|
using static EnvelopeGenerator.Domain.Constants;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|||||||
@ -3,7 +3,7 @@ using EnvelopeGenerator.Web.Services;
|
|||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using System.Text.Encodings.Web;
|
using System.Text.Encodings.Web;
|
||||||
using EnvelopeGenerator.Extensions;
|
using EnvelopeGenerator.Application.Extensions;
|
||||||
using EnvelopeGenerator.Application.Interfaces.Services;
|
using EnvelopeGenerator.Application.Interfaces.Services;
|
||||||
using static EnvelopeGenerator.Domain.Constants;
|
using static EnvelopeGenerator.Domain.Constants;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
|||||||
@ -6,7 +6,7 @@ using EnvelopeGenerator.Application.Dto.EnvelopeReceiver;
|
|||||||
using EnvelopeGenerator.Application.EnvelopeReceivers.Queries;
|
using EnvelopeGenerator.Application.EnvelopeReceivers.Queries;
|
||||||
using EnvelopeGenerator.Application.Interfaces.Services;
|
using EnvelopeGenerator.Application.Interfaces.Services;
|
||||||
using EnvelopeGenerator.Application.Resources;
|
using EnvelopeGenerator.Application.Resources;
|
||||||
using EnvelopeGenerator.Extensions;
|
using EnvelopeGenerator.Application.Extensions;
|
||||||
using EnvelopeGenerator.Web.Extensions;
|
using EnvelopeGenerator.Web.Extensions;
|
||||||
using EnvelopeGenerator.Web.Models;
|
using EnvelopeGenerator.Web.Models;
|
||||||
using Ganss.Xss;
|
using Ganss.Xss;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
using EnvelopeGenerator.Web.Models;
|
using EnvelopeGenerator.Web.Models;
|
||||||
using Ganss.Xss;
|
using Ganss.Xss;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using EnvelopeGenerator.Extensions;
|
using EnvelopeGenerator.Application.Extensions;
|
||||||
using Microsoft.Extensions.Localization;
|
using Microsoft.Extensions.Localization;
|
||||||
using EnvelopeGenerator.Application.Resources;
|
using EnvelopeGenerator.Application.Resources;
|
||||||
using EnvelopeGenerator.Application.Extensions;
|
using EnvelopeGenerator.Application.Extensions;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
using EnvelopeGenerator.Application.Dto;
|
using EnvelopeGenerator.Application.Dto;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using EnvelopeGenerator.Extensions;
|
using EnvelopeGenerator.Application.Extensions;
|
||||||
using EnvelopeGenerator.Application.Interfaces.Services;
|
using EnvelopeGenerator.Application.Interfaces.Services;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Web.Controllers.Test;
|
namespace EnvelopeGenerator.Web.Controllers.Test;
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
using DigitalData.Core.API;
|
using DigitalData.Core.API;
|
||||||
using EnvelopeGenerator.Extensions;
|
using EnvelopeGenerator.Application.Extensions;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using EnvelopeGenerator.Application.Interfaces.Services;
|
using EnvelopeGenerator.Application.Interfaces.Services;
|
||||||
using DigitalData.Core.Abstraction.Application.DTO;
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
@ -27,7 +27,7 @@ public class TestEnvelopeReceiverController : ControllerBase
|
|||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public async Task<IActionResult> Get([FromQuery] ReadEnvelopeReceiverQuery q, CancellationToken cancel)
|
public async Task<IActionResult> Get([FromQuery] ReadEnvelopeReceiverQuery q, CancellationToken cancel)
|
||||||
=> Ok(await _mediator.Send(q, cancel).ThrowIfNull(Exceptions.NotFound));
|
=> Ok(await _mediator.Send(q, cancel).ThrowIfEmpty(Exceptions.NotFound));
|
||||||
|
|
||||||
[Obsolete("Use MediatR")]
|
[Obsolete("Use MediatR")]
|
||||||
[HttpGet("verify-access-code/{envelope_receiver_id}")]
|
[HttpGet("verify-access-code/{envelope_receiver_id}")]
|
||||||
|
|||||||
@ -2136,7 +2136,6 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\EnvelopeGenerator.Application\EnvelopeGenerator.Application.csproj" />
|
<ProjectReference Include="..\EnvelopeGenerator.Application\EnvelopeGenerator.Application.csproj" />
|
||||||
<ProjectReference Include="..\EnvelopeGenerator.CommonServices\EnvelopeGenerator.CommonServices.vbproj" />
|
<ProjectReference Include="..\EnvelopeGenerator.CommonServices\EnvelopeGenerator.CommonServices.vbproj" />
|
||||||
<ProjectReference Include="..\EnvelopeGenerator.Extensions\EnvelopeGenerator.Extensions.csproj" />
|
|
||||||
<ProjectReference Include="..\EnvelopeGenerator.Infrastructure\EnvelopeGenerator.Infrastructure.csproj" />
|
<ProjectReference Include="..\EnvelopeGenerator.Infrastructure\EnvelopeGenerator.Infrastructure.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
@using EnvelopeGenerator.Web
|
@using EnvelopeGenerator.Web
|
||||||
@using EnvelopeGenerator.Web.Models
|
@using EnvelopeGenerator.Web.Models
|
||||||
@using EnvelopeGenerator.Web.Sanitizers
|
@using EnvelopeGenerator.Web.Sanitizers
|
||||||
@using EnvelopeGenerator.Extensions
|
@using EnvelopeGenerator.Application.Extensions
|
||||||
@using Microsoft.Extensions.Localization
|
@using Microsoft.Extensions.Localization
|
||||||
@using EnvelopeGenerator.Application.Resources
|
@using EnvelopeGenerator.Application.Resources
|
||||||
@using Microsoft.Extensions.Options
|
@using Microsoft.Extensions.Options
|
||||||
|
|||||||
@ -21,8 +21,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EnvelopeGenerator.Applicati
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EnvelopeGenerator.GeneratorAPI", "EnvelopeGenerator.GeneratorAPI\EnvelopeGenerator.GeneratorAPI.csproj", "{E5E12BA4-60C1-48BA-9053-0F8B62B38124}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EnvelopeGenerator.GeneratorAPI", "EnvelopeGenerator.GeneratorAPI\EnvelopeGenerator.GeneratorAPI.csproj", "{E5E12BA4-60C1-48BA-9053-0F8B62B38124}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EnvelopeGenerator.Extensions", "EnvelopeGenerator.Extensions\EnvelopeGenerator.Extensions.csproj", "{47F98812-4280-4D53-B04A-2AAEEA5EBC31}"
|
|
||||||
EndProject
|
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "core", "core", "{9943209E-1744-4944-B1BA-4F87FC1A0EEB}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "core", "core", "{9943209E-1744-4944-B1BA-4F87FC1A0EEB}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{134D4164-B291-4E19-99B9-E4FA3AFAB62C}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{134D4164-B291-4E19-99B9-E4FA3AFAB62C}"
|
||||||
@ -79,10 +77,6 @@ Global
|
|||||||
{E5E12BA4-60C1-48BA-9053-0F8B62B38124}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{E5E12BA4-60C1-48BA-9053-0F8B62B38124}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{E5E12BA4-60C1-48BA-9053-0F8B62B38124}.Release|Any CPU.ActiveCfg = Debug|Any CPU
|
{E5E12BA4-60C1-48BA-9053-0F8B62B38124}.Release|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{E5E12BA4-60C1-48BA-9053-0F8B62B38124}.Release|Any CPU.Build.0 = Debug|Any CPU
|
{E5E12BA4-60C1-48BA-9053-0F8B62B38124}.Release|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{47F98812-4280-4D53-B04A-2AAEEA5EBC31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{47F98812-4280-4D53-B04A-2AAEEA5EBC31}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{47F98812-4280-4D53-B04A-2AAEEA5EBC31}.Release|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{47F98812-4280-4D53-B04A-2AAEEA5EBC31}.Release|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{A4D0DD1A-67BC-4E1A-AD29-BC4BC0D41399}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{A4D0DD1A-67BC-4E1A-AD29-BC4BC0D41399}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{A4D0DD1A-67BC-4E1A-AD29-BC4BC0D41399}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{A4D0DD1A-67BC-4E1A-AD29-BC4BC0D41399}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{A4D0DD1A-67BC-4E1A-AD29-BC4BC0D41399}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{A4D0DD1A-67BC-4E1A-AD29-BC4BC0D41399}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
@ -105,7 +99,6 @@ Global
|
|||||||
{63E32615-0ECA-42DC-96E3-91037324B7C7} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
|
{63E32615-0ECA-42DC-96E3-91037324B7C7} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
|
||||||
{5A9984F8-51A2-4558-A415-EC5FEED7CF7D} = {9943209E-1744-4944-B1BA-4F87FC1A0EEB}
|
{5A9984F8-51A2-4558-A415-EC5FEED7CF7D} = {9943209E-1744-4944-B1BA-4F87FC1A0EEB}
|
||||||
{E5E12BA4-60C1-48BA-9053-0F8B62B38124} = {E3C758DC-914D-4B7E-8457-0813F1FDB0CB}
|
{E5E12BA4-60C1-48BA-9053-0F8B62B38124} = {E3C758DC-914D-4B7E-8457-0813F1FDB0CB}
|
||||||
{47F98812-4280-4D53-B04A-2AAEEA5EBC31} = {9943209E-1744-4944-B1BA-4F87FC1A0EEB}
|
|
||||||
{9943209E-1744-4944-B1BA-4F87FC1A0EEB} = {134D4164-B291-4E19-99B9-E4FA3AFAB62C}
|
{9943209E-1744-4944-B1BA-4F87FC1A0EEB} = {134D4164-B291-4E19-99B9-E4FA3AFAB62C}
|
||||||
{A4D0DD1A-67BC-4E1A-AD29-BC4BC0D41399} = {0CBC2432-A561-4440-89BC-671B66A24146}
|
{A4D0DD1A-67BC-4E1A-AD29-BC4BC0D41399} = {0CBC2432-A561-4440-89BC-671B66A24146}
|
||||||
{02EA681E-C7D8-13C7-8484-4AC65E1B71E8} = {134D4164-B291-4E19-99B9-E4FA3AFAB62C}
|
{02EA681E-C7D8-13C7-8484-4AC65E1B71E8} = {134D4164-B291-4E19-99B9-E4FA3AFAB62C}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user