Compare commits
19 Commits
master
...
b5cd42b6fa
| Author | SHA1 | Date | |
|---|---|---|---|
| b5cd42b6fa | |||
| 187f4a42fc | |||
| 23d4b2f31e | |||
| 8e71e5b4bb | |||
| b693615561 | |||
| 36dc9266bc | |||
| 9aabe270b4 | |||
| b303b7be06 | |||
| 02937360ea | |||
| c2735b92e0 | |||
| 568f43186c | |||
| 3bc5439b5a | |||
| 22b494a262 | |||
| 209785dda5 | |||
| 44ea893f05 | |||
| b4aa7984aa | |||
| 7c5a505ad1 | |||
| bd6d57e1e8 | |||
| 8403ce2c6a |
@@ -36,6 +36,7 @@ public class MappingProfile : Profile
|
|||||||
CreateMap<Domain.Entities.Receiver, ReceiverDto>();
|
CreateMap<Domain.Entities.Receiver, ReceiverDto>();
|
||||||
CreateMap<Domain.Entities.EnvelopeReceiverReadOnly, EnvelopeReceiverReadOnlyDto>();
|
CreateMap<Domain.Entities.EnvelopeReceiverReadOnly, EnvelopeReceiverReadOnlyDto>();
|
||||||
CreateMap<ElementAnnotation, AnnotationDto>();
|
CreateMap<ElementAnnotation, AnnotationDto>();
|
||||||
|
CreateMap<ThirdPartyModule, ThirdPartyModuleDto>();
|
||||||
|
|
||||||
// DTO to Entity mappings
|
// DTO to Entity mappings
|
||||||
CreateMap<ConfigDto, Config>();
|
CreateMap<ConfigDto, Config>();
|
||||||
|
|||||||
@@ -0,0 +1,57 @@
|
|||||||
|
namespace EnvelopeGenerator.Application.Common.Dto;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public record ThirdPartyModuleDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public int Id { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public bool Active { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string Name { get; init; } = default!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string? Description { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string License { get; init; } = default!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string Version { get; init; } = default!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string? AddedWho { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? AddedWhen { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string? ChangedWho { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? ChangedWhen { get; init; }
|
||||||
|
}
|
||||||
@@ -58,6 +58,12 @@ public static class DependencyInjection
|
|||||||
cfg.RegisterServicesFromAssembly(Assembly.GetExecutingAssembly());
|
cfg.RegisterServicesFromAssembly(Assembly.GetExecutingAssembly());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Add memory cache
|
||||||
|
services.AddMemoryCache();
|
||||||
|
|
||||||
|
// Register mail services
|
||||||
|
services.AddScoped<IEnvelopeMailService, EnvelopeMailService>();
|
||||||
|
|
||||||
return services;
|
return services;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -25,19 +25,23 @@
|
|||||||
<PackageReference Include="Otp.NET" Version="1.4.0" />
|
<PackageReference Include="Otp.NET" Version="1.4.0" />
|
||||||
<PackageReference Include="QRCoder" Version="1.6.0" />
|
<PackageReference Include="QRCoder" Version="1.6.0" />
|
||||||
<PackageReference Include="QRCoder-ImageSharp" Version="0.10.0" />
|
<PackageReference Include="QRCoder-ImageSharp" Version="0.10.0" />
|
||||||
|
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.12" />
|
||||||
<PackageReference Include="UserManager" Version="1.1.3" />
|
<PackageReference Include="UserManager" Version="1.1.3" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
|
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
|
||||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
|
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
|
||||||
|
<PackageReference Include="System.Formats.Asn1" Version="8.0.2" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
|
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
|
||||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.5" />
|
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.5" />
|
||||||
|
<PackageReference Include="System.Formats.Asn1" Version="9.0.10" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
|
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
|
||||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.5" />
|
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.5" />
|
||||||
|
<PackageReference Include="System.Formats.Asn1" Version="9.0.10" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -0,0 +1,92 @@
|
|||||||
|
using AutoMapper;
|
||||||
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
|
using EnvelopeGenerator.Application.Common.Dto;
|
||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
using MediatR;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.ThirdPartyModules.Queries;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public record ReadThirdPartyModuleQuery : IRequest<IEnumerable<ThirdPartyModuleDto>>
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string? Name { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public bool? Active { get; init; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public record ReadThirdPartyModuleQueryHandler : IRequestHandler<ReadThirdPartyModuleQuery, IEnumerable<ThirdPartyModuleDto>>
|
||||||
|
{
|
||||||
|
private readonly IMapper _mapper;
|
||||||
|
|
||||||
|
private readonly IRepository<ThirdPartyModule> _repo;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="mapper"></param>
|
||||||
|
/// <param name="repo"></param>
|
||||||
|
public ReadThirdPartyModuleQueryHandler(IMapper mapper, IRepository<ThirdPartyModule> repo)
|
||||||
|
{
|
||||||
|
_mapper = mapper;
|
||||||
|
_repo = repo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="cancel"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
|
public async Task<IEnumerable<ThirdPartyModuleDto>> Handle(ReadThirdPartyModuleQuery request, CancellationToken cancel)
|
||||||
|
{
|
||||||
|
var query = _repo.Query;
|
||||||
|
|
||||||
|
if(request.Name is string name)
|
||||||
|
query = query.Where(m => m.Name == name);
|
||||||
|
|
||||||
|
if (request.Active is bool active)
|
||||||
|
query = query.Where(m => m.Active == active);
|
||||||
|
|
||||||
|
var modules = await query.ToListAsync(cancel);
|
||||||
|
|
||||||
|
return _mapper.Map<IEnumerable<ThirdPartyModuleDto>>(modules);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public static class ReadThirdPartyModuleQueryExtensions
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="mediator"></param>
|
||||||
|
/// <param name="name"></param>
|
||||||
|
/// <param name="active"></param>
|
||||||
|
/// <param name="cancel"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static async Task<string?> ReadThirdPartyModuleLicenseAsync(this IMediator mediator, string name, bool active = true, CancellationToken cancel = default)
|
||||||
|
{
|
||||||
|
var modules = await mediator.Send(new ReadThirdPartyModuleQuery()
|
||||||
|
{
|
||||||
|
Name = name,
|
||||||
|
Active = active,
|
||||||
|
}, cancel);
|
||||||
|
|
||||||
|
return modules.FirstOrDefault()?.License;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -32,7 +32,7 @@ Public Class frmFinalizePDF
|
|||||||
#Disable Warning BC40000 ' Type or member is obsolete
|
#Disable Warning BC40000 ' Type or member is obsolete
|
||||||
Factory.Shared _
|
Factory.Shared _
|
||||||
.BehaveOnPostBuild(PostBuildBehavior.Ignore) _
|
.BehaveOnPostBuild(PostBuildBehavior.Ignore) _
|
||||||
.AddEnvelopeGeneratorInfrastructureServices(
|
.AddEGInfrastructureServices(
|
||||||
Sub(opt)
|
Sub(opt)
|
||||||
opt.AddDbTriggerParams(
|
opt.AddDbTriggerParams(
|
||||||
Sub(triggers)
|
Sub(triggers)
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ Namespace Jobs
|
|||||||
#Disable Warning BC40000 ' Type or member is obsolete
|
#Disable Warning BC40000 ' Type or member is obsolete
|
||||||
Factory.Shared _
|
Factory.Shared _
|
||||||
.BehaveOnPostBuild(PostBuildBehavior.Ignore) _
|
.BehaveOnPostBuild(PostBuildBehavior.Ignore) _
|
||||||
.AddEnvelopeGeneratorInfrastructureServices(
|
.AddEGInfrastructureServices(
|
||||||
Sub(opt)
|
Sub(opt)
|
||||||
opt.AddDbTriggerParams(
|
opt.AddDbTriggerParams(
|
||||||
Sub(triggers)
|
Sub(triggers)
|
||||||
|
|||||||
98
EnvelopeGenerator.DependencyInjection/DependencyInjection.cs
Normal file
98
EnvelopeGenerator.DependencyInjection/DependencyInjection.cs
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
using DigitalData.EmailProfilerDispatcher;
|
||||||
|
using DigitalData.UserManager.DependencyInjection;
|
||||||
|
using EnvelopeGenerator.Application;
|
||||||
|
using EnvelopeGenerator.Infrastructure;
|
||||||
|
using Microsoft.Extensions.Caching.SqlServer;
|
||||||
|
using Microsoft.Extensions.Configuration;
|
||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
using static EnvelopeGenerator.Infrastructure.DependencyInjection;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.DependencyInjection;
|
||||||
|
|
||||||
|
public static class DependencyInjection
|
||||||
|
{
|
||||||
|
public static IServiceCollection AddEnvelopeGenerator(this IServiceCollection services, Action<EGConfiguration> options)
|
||||||
|
{
|
||||||
|
var egConfig = new EGConfiguration();
|
||||||
|
options.Invoke(egConfig);
|
||||||
|
egConfig.EnsureAllServicesConfigured();
|
||||||
|
egConfig.RegisterAll(services);
|
||||||
|
|
||||||
|
// Add envelope generator services
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
services.AddUserManager<EGDbContext>();
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
|
||||||
|
services.AddDispatcher<EGDbContext>();
|
||||||
|
|
||||||
|
return services;
|
||||||
|
}
|
||||||
|
|
||||||
|
public record EGConfiguration
|
||||||
|
{
|
||||||
|
internal readonly Queue<Action<IServiceCollection>> _serviceRegs = new();
|
||||||
|
|
||||||
|
internal void RegisterAll(IServiceCollection services)
|
||||||
|
{
|
||||||
|
while (_serviceRegs.Count > 0)
|
||||||
|
_serviceRegs.Dequeue().Invoke(services);
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: update to use attributes and reflections instead of _addingStatus-dictionary
|
||||||
|
private readonly Dictionary<string, bool> _addingStatus = new ()
|
||||||
|
{
|
||||||
|
{ nameof(AddLocalization), false },
|
||||||
|
{ nameof(AddDistributedSqlServerCache), false },
|
||||||
|
{ nameof(AddInfrastructure), false },
|
||||||
|
{ nameof(AddServices), false },
|
||||||
|
};
|
||||||
|
|
||||||
|
public EGConfiguration AddLocalization(Action<IServiceCollection>? customLocalizationOptions = null)
|
||||||
|
{
|
||||||
|
_serviceRegs.Enqueue(customLocalizationOptions ?? (s => s.AddLocalization()));
|
||||||
|
_addingStatus[nameof(AddLocalization)] = true;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EGConfiguration AddDistributedSqlServerCache(Action<SqlServerCacheOptions> setupAction)
|
||||||
|
{
|
||||||
|
_serviceRegs.Enqueue(s => s.AddDistributedSqlServerCache(setupAction));
|
||||||
|
_addingStatus[nameof(AddDistributedSqlServerCache)] = true;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EGConfiguration AddInfrastructure(Action<EGInfrastructureConfiguration> options)
|
||||||
|
{
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
_serviceRegs.Enqueue(s => s.AddEGInfrastructureServices(options));
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
_addingStatus[nameof(AddInfrastructure)] = true;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EGConfiguration AddServices(IConfiguration config)
|
||||||
|
{
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
_serviceRegs.Enqueue(s => s.AddEnvelopeGeneratorServices(config));
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
_addingStatus[nameof(AddServices)] = true;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal void EnsureAllServicesConfigured()
|
||||||
|
{
|
||||||
|
var missingServices = _addingStatus
|
||||||
|
.Where(kv => !kv.Value)
|
||||||
|
.Select(kv => kv.Key)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
if (missingServices.Count > 0)
|
||||||
|
{
|
||||||
|
var missingList = string.Join(", ", missingServices);
|
||||||
|
throw new InvalidOperationException(
|
||||||
|
$"Service configuration incomplete. The following required service methods were not called: {missingList}. " +
|
||||||
|
"Please ensure all necessary configuration methods are invoked before building the application.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.10" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Caching.SqlServer" Version="9.0.10" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.10" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\EnvelopeGenerator.Application\EnvelopeGenerator.Application.csproj" />
|
||||||
|
<ProjectReference Include="..\EnvelopeGenerator.Infrastructure\EnvelopeGenerator.Infrastructure.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
73
EnvelopeGenerator.Domain/Entities/ThirdPartyModule.cs
Normal file
73
EnvelopeGenerator.Domain/Entities/ThirdPartyModule.cs
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
#if NETFRAMEWORK
|
||||||
|
using System;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Domain.Entities
|
||||||
|
{
|
||||||
|
[Table("TBDD_3RD_PARTY_MODULES")]
|
||||||
|
public class ThirdPartyModule
|
||||||
|
{
|
||||||
|
[Key]
|
||||||
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
|
[Column("GUID")]
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
[Required]
|
||||||
|
[Column("ACTIVE")]
|
||||||
|
public bool Active { get; set; }
|
||||||
|
|
||||||
|
[Required]
|
||||||
|
[StringLength(50)]
|
||||||
|
[Column("NAME")]
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
[StringLength(500)]
|
||||||
|
[Column("DESCRIPTION")]
|
||||||
|
public string
|
||||||
|
#if nullable
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
Description { get; set; }
|
||||||
|
|
||||||
|
[Required]
|
||||||
|
[Column("LICENSE", TypeName = "varchar(max)")]
|
||||||
|
public string License { get; set; }
|
||||||
|
|
||||||
|
[Required]
|
||||||
|
[StringLength(20)]
|
||||||
|
[Column("VERSION")]
|
||||||
|
public string Version { get; set; }
|
||||||
|
|
||||||
|
[StringLength(50)]
|
||||||
|
[Column("ADDED_WHO")]
|
||||||
|
public string
|
||||||
|
#if nullable
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
AddedWho { get; set; }
|
||||||
|
|
||||||
|
[Column("ADDED_WHEN")]
|
||||||
|
public DateTime
|
||||||
|
#if nullable
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
AddedWhen { get; set; }
|
||||||
|
|
||||||
|
[StringLength(50)]
|
||||||
|
[Column("CHANGED_WHO")]
|
||||||
|
public string
|
||||||
|
#if nullable
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
ChangedWho { get; set; }
|
||||||
|
|
||||||
|
[Column("CHANGED_WHEN")]
|
||||||
|
public DateTime
|
||||||
|
#if nullable
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
ChangedWhen { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk.Worker">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<UserSecretsId>dotnet-EnvelopeGenerator.Finalizer-6d5cc618-4159-4ff2-b600-8a15fbfa8099</UserSecretsId>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.10" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.1" />
|
||||||
|
<PackageReference Include="Serilog.AspNetCore" Version="9.0.0" />
|
||||||
|
<PackageReference Include="Serilog.Settings.Configuration" Version="9.0.0" />
|
||||||
|
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
|
||||||
|
<PackageReference Include="Serilog.Sinks.File" Version="7.0.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\EnvelopeGenerator.Application\EnvelopeGenerator.Application.csproj" />
|
||||||
|
<ProjectReference Include="..\EnvelopeGenerator.DependencyInjection\EnvelopeGenerator.DependencyInjection.csproj" />
|
||||||
|
<ProjectReference Include="..\EnvelopeGenerator.Infrastructure\EnvelopeGenerator.Infrastructure.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Update="appsettings.Database.json">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="appsettings.Logging.json">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
9
EnvelopeGenerator.Finalizer/Models/GdPictureOptions.cs
Normal file
9
EnvelopeGenerator.Finalizer/Models/GdPictureOptions.cs
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
namespace EnvelopeGenerator.Finalizer.Models;
|
||||||
|
|
||||||
|
public class GdPictureOptions
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string License { get; set; } = null!;
|
||||||
|
}
|
||||||
19
EnvelopeGenerator.Finalizer/Models/WorkerOptions.cs
Normal file
19
EnvelopeGenerator.Finalizer/Models/WorkerOptions.cs
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
namespace EnvelopeGenerator.Finalizer.Models;
|
||||||
|
|
||||||
|
public class WorkerOptions
|
||||||
|
{
|
||||||
|
private double _intervalInMin = 1.0;
|
||||||
|
|
||||||
|
public double IntervalInMin {
|
||||||
|
get => _intervalInMin;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_intervalInMin = value;
|
||||||
|
IntervalInMillisecond = Min2Millisecond(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int IntervalInMillisecond { get; private set; } = Min2Millisecond(1.0);
|
||||||
|
|
||||||
|
private static int Min2Millisecond(double min) => Convert.ToInt32(Math.Round(min * 60 * 1000));
|
||||||
|
}
|
||||||
96
EnvelopeGenerator.Finalizer/Program.cs
Normal file
96
EnvelopeGenerator.Finalizer/Program.cs
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
using EnvelopeGenerator.Application.ThirdPartyModules.Queries;
|
||||||
|
using EnvelopeGenerator.DependencyInjection;
|
||||||
|
using EnvelopeGenerator.Finalizer;
|
||||||
|
using EnvelopeGenerator.Finalizer.Models;
|
||||||
|
using EnvelopeGenerator.Infrastructure;
|
||||||
|
using MediatR;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.Extensions.Options;
|
||||||
|
using Serilog;
|
||||||
|
|
||||||
|
// Load Serilog from appsettings.json
|
||||||
|
Log.Logger = new LoggerConfiguration()
|
||||||
|
.ReadFrom.Configuration(new ConfigurationBuilder()
|
||||||
|
.AddJsonFile("appsettings.Logging.json", optional: false, reloadOnChange: true)
|
||||||
|
.Build())
|
||||||
|
.CreateLogger();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Log.Information("Application is starting...");
|
||||||
|
|
||||||
|
var builder = Host.CreateApplicationBuilder(args);
|
||||||
|
|
||||||
|
// add serilog
|
||||||
|
builder.Logging.ClearProviders();
|
||||||
|
builder.Logging.AddSerilog();
|
||||||
|
|
||||||
|
var config = builder.Configuration;
|
||||||
|
|
||||||
|
Directory
|
||||||
|
.GetFiles(builder.Environment.ContentRootPath, "appsettings.*.json", SearchOption.TopDirectoryOnly)
|
||||||
|
.Where(file => Path.GetFileName(file) != $"appsettings.Development.json")
|
||||||
|
.Where(file => Path.GetFileName(file) != $"appsettings.migration.json")
|
||||||
|
.ToList()
|
||||||
|
.ForEach(file => config.AddJsonFile(file, true, true));
|
||||||
|
|
||||||
|
#region Worker
|
||||||
|
builder.Services.AddHostedService<Worker>();
|
||||||
|
builder.Services.Configure<WorkerOptions>(config.GetSection("Worker"));
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Add DB Context, EG Inf. and Services
|
||||||
|
var cnnStrName = "Default";
|
||||||
|
var connStr = config.GetConnectionString(cnnStrName)
|
||||||
|
?? throw new InvalidOperationException($"Connection string '{cnnStrName}' is missing in the application configuration.");
|
||||||
|
|
||||||
|
builder.Services.AddEnvelopeGenerator(egOptions => egOptions
|
||||||
|
.AddLocalization()
|
||||||
|
.AddDistributedSqlServerCache(options =>
|
||||||
|
{
|
||||||
|
options.ConnectionString = connStr;
|
||||||
|
options.SchemaName = "dbo";
|
||||||
|
options.TableName = "TBDD_CACHE";
|
||||||
|
})
|
||||||
|
.AddInfrastructure(opt =>
|
||||||
|
{
|
||||||
|
opt.AddDbTriggerParams(config);
|
||||||
|
opt.AddDbContext((provider, options) =>
|
||||||
|
{
|
||||||
|
var logger = provider.GetRequiredService<ILogger<EGDbContext>>();
|
||||||
|
options.UseSqlServer(connStr)
|
||||||
|
.LogTo(log => logger.LogInformation("{log}", log), LogLevel.Trace)
|
||||||
|
.EnableSensitiveDataLogging()
|
||||||
|
.EnableDetailedErrors();
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.AddServices(config)
|
||||||
|
);
|
||||||
|
#endregion Add DB Context, EG Inf. and Services
|
||||||
|
|
||||||
|
builder.Services.AddOptions<GdPictureOptions>()
|
||||||
|
.Configure((GdPictureOptions opt, IServiceProvider sp) =>
|
||||||
|
{
|
||||||
|
var licenseKey = "GDPICTURE";
|
||||||
|
using var scope = sp.CreateScope();
|
||||||
|
var mediator = scope.ServiceProvider.GetRequiredService<IMediator>();
|
||||||
|
opt.License = mediator.ReadThirdPartyModuleLicenseAsync(licenseKey).GetAwaiter().GetResult()
|
||||||
|
?? throw new InvalidOperationException($"License record not found for key: {licenseKey}");
|
||||||
|
});
|
||||||
|
|
||||||
|
var host = builder.Build();
|
||||||
|
|
||||||
|
var licence = host.Services.GetRequiredService<IOptions<GdPictureOptions>>().Value;
|
||||||
|
|
||||||
|
host.Run();
|
||||||
|
|
||||||
|
Log.Information("The worker was stopped.");
|
||||||
|
}
|
||||||
|
catch(Exception ex)
|
||||||
|
{
|
||||||
|
Log.Fatal(ex, "Worker could not be started!");
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
Log.CloseAndFlush();
|
||||||
|
}
|
||||||
12
EnvelopeGenerator.Finalizer/Properties/launchSettings.json
Normal file
12
EnvelopeGenerator.Finalizer/Properties/launchSettings.json
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"$schema": "http://json.schemastore.org/launchsettings.json",
|
||||||
|
"profiles": {
|
||||||
|
"EnvelopeGenerator.Finalizer": {
|
||||||
|
"commandName": "Project",
|
||||||
|
"dotnetRunMessages": true,
|
||||||
|
"environmentVariables": {
|
||||||
|
"DOTNET_ENVIRONMENT": "Development"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
30
EnvelopeGenerator.Finalizer/Worker.cs
Normal file
30
EnvelopeGenerator.Finalizer/Worker.cs
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
using EnvelopeGenerator.Finalizer.Models;
|
||||||
|
using Microsoft.Extensions.Options;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Finalizer
|
||||||
|
{
|
||||||
|
public class Worker : BackgroundService
|
||||||
|
{
|
||||||
|
private readonly ILogger<Worker> _logger;
|
||||||
|
|
||||||
|
private readonly WorkerOptions _options;
|
||||||
|
|
||||||
|
public Worker(ILogger<Worker> logger, IOptions<WorkerOptions> workerOptions)
|
||||||
|
{
|
||||||
|
_logger = logger;
|
||||||
|
_options = workerOptions.Value;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
|
||||||
|
{
|
||||||
|
while (!stoppingToken.IsCancellationRequested)
|
||||||
|
{
|
||||||
|
if (_logger.IsEnabled(LogLevel.Information))
|
||||||
|
{
|
||||||
|
_logger.LogInformation("Worker running at: {time}", DateTimeOffset.Now);
|
||||||
|
}
|
||||||
|
await Task.Delay(_options.IntervalInMillisecond, stoppingToken);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
21
EnvelopeGenerator.Finalizer/appsettings.Database.json
Normal file
21
EnvelopeGenerator.Finalizer/appsettings.Database.json
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.Hosting.Lifetime": "Information"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"UseDbMigration": false,
|
||||||
|
"ConnectionStrings": {
|
||||||
|
"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;"
|
||||||
|
},
|
||||||
|
"DbTriggerParams": {
|
||||||
|
"Envelope": [ "TBSIG_ENVELOPE_AFT_INS" ],
|
||||||
|
"History": [ "TBSIG_ENVELOPE_HISTORY_AFT_INS" ],
|
||||||
|
"EmailOut": [ "TBEMLP_EMAIL_OUT_AFT_INS", "TBEMLP_EMAIL_OUT_AFT_UPD" ],
|
||||||
|
"EnvelopeReceiverReadOnly": [ "TBSIG_ENVELOPE_RECEIVER_READ_ONLY_UPD" ],
|
||||||
|
"Receiver": [],
|
||||||
|
"EmailTemplate": [ "TBSIG_EMAIL_TEMPLATE_AFT_UPD" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
8
EnvelopeGenerator.Finalizer/appsettings.Development.json
Normal file
8
EnvelopeGenerator.Finalizer/appsettings.Development.json
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.Hosting.Lifetime": "Information"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
81
EnvelopeGenerator.Finalizer/appsettings.Logging.json
Normal file
81
EnvelopeGenerator.Finalizer/appsettings.Logging.json
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
{
|
||||||
|
"Serilog": {
|
||||||
|
"Using": [ "Serilog.Sinks.Console", "Serilog.Sinks.File" ],
|
||||||
|
"MinimumLevel": {
|
||||||
|
"Default": "Verbose",
|
||||||
|
"Override": {
|
||||||
|
"Microsoft": "Warning",
|
||||||
|
"System": "Warning"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"WriteTo": [
|
||||||
|
{
|
||||||
|
"Name": "Console",
|
||||||
|
"Args": {
|
||||||
|
"outputTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "File",
|
||||||
|
"Args": {
|
||||||
|
"path": "E:/LogFiles/Digital Data/signFlow.Finalizer/log.Verbose-.txt",
|
||||||
|
"rollingInterval": "Day",
|
||||||
|
"restrictedToMinimumLevel": "Verbose",
|
||||||
|
"retainedFileCountLimit": 30,
|
||||||
|
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "File",
|
||||||
|
"Args": {
|
||||||
|
"path": "E:/LogFiles/Digital Data/signFlow.Finalizer/log.Debug-.txt",
|
||||||
|
"rollingInterval": "Day",
|
||||||
|
"restrictedToMinimumLevel": "Debug",
|
||||||
|
"retainedFileCountLimit": 30,
|
||||||
|
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "File",
|
||||||
|
"Args": {
|
||||||
|
"path": "E:/LogFiles/Digital Data/signFlow.Finalizer/log.Info-.txt",
|
||||||
|
"rollingInterval": "Day",
|
||||||
|
"restrictedToMinimumLevel": "Information",
|
||||||
|
"retainedFileCountLimit": 30,
|
||||||
|
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "File",
|
||||||
|
"Args": {
|
||||||
|
"path": "E:/LogFiles/Digital Data/signFlow.Finalizer/log.Warning-.txt",
|
||||||
|
"rollingInterval": "Day",
|
||||||
|
"restrictedToMinimumLevel": "Warning",
|
||||||
|
"retainedFileCountLimit": 30,
|
||||||
|
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "File",
|
||||||
|
"Args": {
|
||||||
|
"path": "E:/LogFiles/Digital Data/signFlow.Finalizer/log.Error-.txt",
|
||||||
|
"rollingInterval": "Day",
|
||||||
|
"restrictedToMinimumLevel": "Error",
|
||||||
|
"retainedFileCountLimit": 30,
|
||||||
|
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "File",
|
||||||
|
"Args": {
|
||||||
|
"path": "E:/LogFiles/Digital Data/signFlow.Finalizer/log.Fatal-.txt",
|
||||||
|
"rollingInterval": "Day",
|
||||||
|
"restrictedToMinimumLevel": "Fatal",
|
||||||
|
"retainedFileCountLimit": 30,
|
||||||
|
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"Enrich": [ "FromLogContext", "WithMachineName", "WithThreadId" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
14
EnvelopeGenerator.Finalizer/appsettings.PdfBurner.json
Normal file
14
EnvelopeGenerator.Finalizer/appsettings.PdfBurner.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"IgnoredLabels": {
|
||||||
|
"Label": [
|
||||||
|
"Date",
|
||||||
|
"Datum",
|
||||||
|
"ZIP",
|
||||||
|
"PLZ",
|
||||||
|
"Place",
|
||||||
|
"Ort",
|
||||||
|
"Position",
|
||||||
|
"Stellung"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
21
EnvelopeGenerator.Finalizer/appsettings.Worker.Database.json
Normal file
21
EnvelopeGenerator.Finalizer/appsettings.Worker.Database.json
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.Hosting.Lifetime": "Information"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"UseDbMigration": false,
|
||||||
|
"ConnectionStrings": {
|
||||||
|
"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;"
|
||||||
|
},
|
||||||
|
"DbTriggerParams": {
|
||||||
|
"Envelope": [ "TBSIG_ENVELOPE_AFT_INS" ],
|
||||||
|
"History": [ "TBSIG_ENVELOPE_HISTORY_AFT_INS" ],
|
||||||
|
"EmailOut": [ "TBEMLP_EMAIL_OUT_AFT_INS", "TBEMLP_EMAIL_OUT_AFT_UPD" ],
|
||||||
|
"EnvelopeReceiverReadOnly": [ "TBSIG_ENVELOPE_RECEIVER_READ_ONLY_UPD" ],
|
||||||
|
"Receiver": [],
|
||||||
|
"EmailTemplate": [ "TBSIG_EMAIL_TEMPLATE_AFT_UPD" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.Hosting.Lifetime": "Information"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
81
EnvelopeGenerator.Finalizer/appsettings.Worker.Logging.json
Normal file
81
EnvelopeGenerator.Finalizer/appsettings.Worker.Logging.json
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
{
|
||||||
|
"Serilog": {
|
||||||
|
"Using": [ "Serilog.Sinks.Console", "Serilog.Sinks.File" ],
|
||||||
|
"MinimumLevel": {
|
||||||
|
"Default": "Verbose",
|
||||||
|
"Override": {
|
||||||
|
"Microsoft": "Warning",
|
||||||
|
"System": "Warning"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"WriteTo": [
|
||||||
|
{
|
||||||
|
"Name": "Console",
|
||||||
|
"Args": {
|
||||||
|
"outputTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "File",
|
||||||
|
"Args": {
|
||||||
|
"path": "E:/LogFiles/Digital Data/signFlow.Finalizer/log.Verbose-.txt",
|
||||||
|
"rollingInterval": "Day",
|
||||||
|
"restrictedToMinimumLevel": "Verbose",
|
||||||
|
"retainedFileCountLimit": 30,
|
||||||
|
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "File",
|
||||||
|
"Args": {
|
||||||
|
"path": "E:/LogFiles/Digital Data/signFlow.Finalizer/log.Debug-.txt",
|
||||||
|
"rollingInterval": "Day",
|
||||||
|
"restrictedToMinimumLevel": "Debug",
|
||||||
|
"retainedFileCountLimit": 30,
|
||||||
|
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "File",
|
||||||
|
"Args": {
|
||||||
|
"path": "E:/LogFiles/Digital Data/signFlow.Finalizer/log.Info-.txt",
|
||||||
|
"rollingInterval": "Day",
|
||||||
|
"restrictedToMinimumLevel": "Information",
|
||||||
|
"retainedFileCountLimit": 30,
|
||||||
|
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "File",
|
||||||
|
"Args": {
|
||||||
|
"path": "E:/LogFiles/Digital Data/signFlow.Finalizer/log.Warning-.txt",
|
||||||
|
"rollingInterval": "Day",
|
||||||
|
"restrictedToMinimumLevel": "Warning",
|
||||||
|
"retainedFileCountLimit": 30,
|
||||||
|
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "File",
|
||||||
|
"Args": {
|
||||||
|
"path": "E:/LogFiles/Digital Data/signFlow.Finalizer/log.Error-.txt",
|
||||||
|
"rollingInterval": "Day",
|
||||||
|
"restrictedToMinimumLevel": "Error",
|
||||||
|
"retainedFileCountLimit": 30,
|
||||||
|
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "File",
|
||||||
|
"Args": {
|
||||||
|
"path": "E:/LogFiles/Digital Data/signFlow.Finalizer/log.Fatal-.txt",
|
||||||
|
"rollingInterval": "Day",
|
||||||
|
"restrictedToMinimumLevel": "Fatal",
|
||||||
|
"retainedFileCountLimit": 30,
|
||||||
|
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"Enrich": [ "FromLogContext", "WithMachineName", "WithThreadId" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"IgnoredLabels": {
|
||||||
|
"Label": [
|
||||||
|
"Date",
|
||||||
|
"Datum",
|
||||||
|
"ZIP",
|
||||||
|
"PLZ",
|
||||||
|
"Place",
|
||||||
|
"Ort",
|
||||||
|
"Position",
|
||||||
|
"Stellung"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
5
EnvelopeGenerator.Finalizer/appsettings.Worker.json
Normal file
5
EnvelopeGenerator.Finalizer/appsettings.Worker.json
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"Worker": {
|
||||||
|
"IntervalInMin": 0.01666666666
|
||||||
|
}
|
||||||
|
}
|
||||||
2
EnvelopeGenerator.Finalizer/appsettings.json
Normal file
2
EnvelopeGenerator.Finalizer/appsettings.json
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
{
|
||||||
|
}
|
||||||
@@ -105,6 +105,7 @@ try
|
|||||||
});
|
});
|
||||||
builder.Services.AddOpenApi();
|
builder.Services.AddOpenApi();
|
||||||
|
|
||||||
|
// TODO: Update to configure with EnvelopeGenerator.DependencyInjection
|
||||||
//AddEF Core dbcontext
|
//AddEF Core dbcontext
|
||||||
var useDbMigration = Environment.GetEnvironmentVariable("MIGRATION_TEST_MODE") == true.ToString() || config.GetValue<bool>("UseDbMigration");
|
var useDbMigration = Environment.GetEnvironmentVariable("MIGRATION_TEST_MODE") == true.ToString() || config.GetValue<bool>("UseDbMigration");
|
||||||
var cnnStrName = useDbMigration ? "DbMigrationTest" : "Default";
|
var cnnStrName = useDbMigration ? "DbMigrationTest" : "Default";
|
||||||
@@ -185,7 +186,7 @@ try
|
|||||||
// Envelope generator serives
|
// Envelope generator serives
|
||||||
#pragma warning disable CS0618 // Type or member is obsolete
|
#pragma warning disable CS0618 // Type or member is obsolete
|
||||||
builder.Services
|
builder.Services
|
||||||
.AddEnvelopeGeneratorInfrastructureServices(opt =>
|
.AddEGInfrastructureServices(opt =>
|
||||||
{
|
{
|
||||||
opt.AddDbTriggerParams(config);
|
opt.AddDbTriggerParams(config);
|
||||||
opt.AddDbContext((provider, options) =>
|
opt.AddDbContext((provider, options) =>
|
||||||
|
|||||||
@@ -38,10 +38,10 @@ namespace EnvelopeGenerator.Infrastructure
|
|||||||
/// will be created per HTTP request (or per scope) within the dependency injection container.
|
/// will be created per HTTP request (or per scope) within the dependency injection container.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
[Obsolete("Use IRepository")]
|
[Obsolete("Use IRepository")]
|
||||||
public static IServiceCollection AddEnvelopeGeneratorInfrastructureServices(this IServiceCollection services, Action<Config> options)
|
public static IServiceCollection AddEGInfrastructureServices(this IServiceCollection services, Action<EGInfrastructureConfiguration> options)
|
||||||
{
|
{
|
||||||
// configure custom options
|
// configure custom options
|
||||||
options(new Config(services));
|
options(new EGInfrastructureConfiguration(services));
|
||||||
#if NET
|
#if NET
|
||||||
services.TryAddScoped<IConfigRepository, ConfigRepository>();
|
services.TryAddScoped<IConfigRepository, ConfigRepository>();
|
||||||
services.TryAddScoped<IDocumentReceiverElementRepository, DocumentReceiverElementRepository>();
|
services.TryAddScoped<IDocumentReceiverElementRepository, DocumentReceiverElementRepository>();
|
||||||
@@ -160,11 +160,11 @@ namespace EnvelopeGenerator.Infrastructure
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
public class Config
|
public class EGInfrastructureConfiguration
|
||||||
{
|
{
|
||||||
private readonly IServiceCollection _services;
|
private readonly IServiceCollection _services;
|
||||||
|
|
||||||
internal Config(IServiceCollection services)
|
internal EGInfrastructureConfiguration(IServiceCollection services)
|
||||||
{
|
{
|
||||||
_services = services;
|
_services = services;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,6 +79,8 @@ public abstract class EGDbContextBase : DbContext
|
|||||||
|
|
||||||
public DbSet<ClientUser> ClientUsers { get; set; }
|
public DbSet<ClientUser> ClientUsers { get; set; }
|
||||||
|
|
||||||
|
public DbSet<ThirdPartyModule> ThirdPartyModules { get; set; }
|
||||||
|
|
||||||
private readonly DbTriggerParams _triggers;
|
private readonly DbTriggerParams _triggers;
|
||||||
|
|
||||||
private readonly ILogger
|
private readonly ILogger
|
||||||
|
|||||||
@@ -525,7 +525,7 @@ namespace EnvelopeGenerator.Infrastructure.Migrations
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("EnvelopeGenerator.Domain.Entities.Config", b =>
|
modelBuilder.Entity("EnvelopeGenerator.Domain.Entities.EGInfrastructureConfiguration", b =>
|
||||||
{
|
{
|
||||||
b.Property<string>("ExportPath")
|
b.Property<string>("ExportPath")
|
||||||
.HasColumnType("nvarchar(256)")
|
.HasColumnType("nvarchar(256)")
|
||||||
|
|||||||
@@ -522,7 +522,7 @@ namespace EnvelopeGenerator.Infrastructure.Migrations
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("EnvelopeGenerator.Domain.Entities.Config", b =>
|
modelBuilder.Entity("EnvelopeGenerator.Domain.Entities.EGInfrastructureConfiguration", b =>
|
||||||
{
|
{
|
||||||
b.Property<string>("ExportPath")
|
b.Property<string>("ExportPath")
|
||||||
.HasColumnType("nvarchar(256)")
|
.HasColumnType("nvarchar(256)")
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
using EnvelopeGenerator.Application.Services;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using NLog;
|
using NLog;
|
||||||
using Quartz;
|
using Quartz;
|
||||||
@@ -16,7 +15,6 @@ using EnvelopeGenerator.Web.Sanitizers;
|
|||||||
using EnvelopeGenerator.Web.Models.Annotation;
|
using EnvelopeGenerator.Web.Models.Annotation;
|
||||||
using DigitalData.UserManager.DependencyInjection;
|
using DigitalData.UserManager.DependencyInjection;
|
||||||
using EnvelopeGenerator.Web.Middleware;
|
using EnvelopeGenerator.Web.Middleware;
|
||||||
using EnvelopeGenerator.Application.Common.Interfaces.Services;
|
|
||||||
|
|
||||||
var logger = LogManager.Setup().LoadConfigurationFromAppSettings().GetCurrentClassLogger();
|
var logger = LogManager.Setup().LoadConfigurationFromAppSettings().GetCurrentClassLogger();
|
||||||
logger.Info("Logging initialized!");
|
logger.Info("Logging initialized!");
|
||||||
@@ -88,6 +86,7 @@ try
|
|||||||
builder.Services.AddSwaggerGen();
|
builder.Services.AddSwaggerGen();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Update to configure with EnvelopeGenerator.DependencyInjection
|
||||||
//AddEF Core dbcontext
|
//AddEF Core dbcontext
|
||||||
var useDbMigration = Environment.GetEnvironmentVariable("MIGRATION_TEST_MODE") == true.ToString() || config.GetValue<bool>("UseDbMigration");
|
var useDbMigration = Environment.GetEnvironmentVariable("MIGRATION_TEST_MODE") == true.ToString() || config.GetValue<bool>("UseDbMigration");
|
||||||
var cnnStrName = useDbMigration ? "DbMigrationTest" : "Default";
|
var cnnStrName = useDbMigration ? "DbMigrationTest" : "Default";
|
||||||
@@ -103,7 +102,7 @@ try
|
|||||||
|
|
||||||
// Add envelope generator services
|
// Add envelope generator services
|
||||||
#pragma warning disable CS0618 // Type or member is obsolete
|
#pragma warning disable CS0618 // Type or member is obsolete
|
||||||
builder.Services.AddEnvelopeGeneratorInfrastructureServices(
|
builder.Services.AddEGInfrastructureServices(
|
||||||
opt =>
|
opt =>
|
||||||
{
|
{
|
||||||
opt.AddDbTriggerParams(config);
|
opt.AddDbTriggerParams(config);
|
||||||
@@ -186,15 +185,8 @@ try
|
|||||||
builder.Services.Configure<Cultures>(config.GetSection("Cultures"));
|
builder.Services.Configure<Cultures>(config.GetSection("Cultures"));
|
||||||
builder.Services.AddSingleton(sp => sp.GetRequiredService<IOptions<Cultures>>().Value);
|
builder.Services.AddSingleton(sp => sp.GetRequiredService<IOptions<Cultures>>().Value);
|
||||||
|
|
||||||
// Register mail services
|
|
||||||
#pragma warning disable CS0618 // Type or member is obsolete
|
|
||||||
builder.Services.AddScoped<IEnvelopeMailService, EnvelopeMailService>();
|
|
||||||
#pragma warning restore CS0618 // Type or member is obsolete
|
|
||||||
|
|
||||||
builder.Services.AddDispatcher<EGDbContext>();
|
builder.Services.AddDispatcher<EGDbContext>();
|
||||||
|
|
||||||
builder.Services.AddMemoryCache();
|
|
||||||
|
|
||||||
builder.ConfigureBySection<CustomImages>();
|
builder.ConfigureBySection<CustomImages>();
|
||||||
|
|
||||||
builder.ConfigureBySection<AnnotationParams>();
|
builder.ConfigureBySection<AnnotationParams>();
|
||||||
|
|||||||
@@ -37,6 +37,10 @@ Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "EnvelopeGenerator.Form", "E
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EnvelopeGenerator.PdfEditor", "EnvelopeGenerator.PdfEditor\EnvelopeGenerator.PdfEditor.csproj", "{211619F5-AE25-4BA5-A552-BACAFE0632D3}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EnvelopeGenerator.PdfEditor", "EnvelopeGenerator.PdfEditor\EnvelopeGenerator.PdfEditor.csproj", "{211619F5-AE25-4BA5-A552-BACAFE0632D3}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EnvelopeGenerator.Finalizer", "EnvelopeGenerator.Finalizer\EnvelopeGenerator.Finalizer.csproj", "{49E6A4C0-C2FC-4A34-9821-245AF050CA26}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EnvelopeGenerator.DependencyInjection", "EnvelopeGenerator.DependencyInjection\EnvelopeGenerator.DependencyInjection.csproj", "{B97DE7DD-3190-4A84-85E9-E57AD735BE61}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@@ -91,6 +95,14 @@ Global
|
|||||||
{211619F5-AE25-4BA5-A552-BACAFE0632D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{211619F5-AE25-4BA5-A552-BACAFE0632D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{211619F5-AE25-4BA5-A552-BACAFE0632D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{211619F5-AE25-4BA5-A552-BACAFE0632D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{211619F5-AE25-4BA5-A552-BACAFE0632D3}.Release|Any CPU.Build.0 = Release|Any CPU
|
{211619F5-AE25-4BA5-A552-BACAFE0632D3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{49E6A4C0-C2FC-4A34-9821-245AF050CA26}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{49E6A4C0-C2FC-4A34-9821-245AF050CA26}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{49E6A4C0-C2FC-4A34-9821-245AF050CA26}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{49E6A4C0-C2FC-4A34-9821-245AF050CA26}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{B97DE7DD-3190-4A84-85E9-E57AD735BE61}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{B97DE7DD-3190-4A84-85E9-E57AD735BE61}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{B97DE7DD-3190-4A84-85E9-E57AD735BE61}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{B97DE7DD-3190-4A84-85E9-E57AD735BE61}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
@@ -111,6 +123,8 @@ Global
|
|||||||
{A9F9B431-BB9B-49B8-9E2C-0703634A653A} = {E3C758DC-914D-4B7E-8457-0813F1FDB0CB}
|
{A9F9B431-BB9B-49B8-9E2C-0703634A653A} = {E3C758DC-914D-4B7E-8457-0813F1FDB0CB}
|
||||||
{6D56C01F-D6CB-4D8A-BD3D-4FD34326998C} = {E3C758DC-914D-4B7E-8457-0813F1FDB0CB}
|
{6D56C01F-D6CB-4D8A-BD3D-4FD34326998C} = {E3C758DC-914D-4B7E-8457-0813F1FDB0CB}
|
||||||
{211619F5-AE25-4BA5-A552-BACAFE0632D3} = {9943209E-1744-4944-B1BA-4F87FC1A0EEB}
|
{211619F5-AE25-4BA5-A552-BACAFE0632D3} = {9943209E-1744-4944-B1BA-4F87FC1A0EEB}
|
||||||
|
{49E6A4C0-C2FC-4A34-9821-245AF050CA26} = {E3C758DC-914D-4B7E-8457-0813F1FDB0CB}
|
||||||
|
{B97DE7DD-3190-4A84-85E9-E57AD735BE61} = {E3C758DC-914D-4B7E-8457-0813F1FDB0CB}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
SolutionGuid = {73E60370-756D-45AD-A19A-C40A02DACCC7}
|
SolutionGuid = {73E60370-756D-45AD-A19A-C40A02DACCC7}
|
||||||
|
|||||||
Reference in New Issue
Block a user