Compare commits
12 Commits
22b494a262
...
b5cd42b6fa
| Author | SHA1 | Date | |
|---|---|---|---|
| b5cd42b6fa | |||
| 187f4a42fc | |||
| 23d4b2f31e | |||
| 8e71e5b4bb | |||
| b693615561 | |||
| 36dc9266bc | |||
| 9aabe270b4 | |||
| b303b7be06 | |||
| 02937360ea | |||
| c2735b92e0 | |||
| 568f43186c | |||
| 3bc5439b5a |
@ -36,6 +36,7 @@ public class MappingProfile : Profile
|
||||
CreateMap<Domain.Entities.Receiver, ReceiverDto>();
|
||||
CreateMap<Domain.Entities.EnvelopeReceiverReadOnly, EnvelopeReceiverReadOnlyDto>();
|
||||
CreateMap<ElementAnnotation, AnnotationDto>();
|
||||
CreateMap<ThirdPartyModule, ThirdPartyModuleDto>();
|
||||
|
||||
// DTO to Entity mappings
|
||||
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; }
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
@ -11,10 +11,11 @@ namespace EnvelopeGenerator.DependencyInjection;
|
||||
|
||||
public static class DependencyInjection
|
||||
{
|
||||
public static IServiceCollection AddEnvelopeGenerator(this IServiceCollection services, IConfiguration config, Action<EGConfiguration> options, Action<SqlServerCacheOptions> distributedCacheOptions)
|
||||
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
|
||||
@ -29,41 +30,68 @@ public static class DependencyInjection
|
||||
|
||||
public record EGConfiguration
|
||||
{
|
||||
internal readonly Queue<Action<IServiceCollection>> ServiceRegs = new();
|
||||
internal readonly Queue<Action<IServiceCollection>> _serviceRegs = new();
|
||||
|
||||
internal void RegisterAll(IServiceCollection services)
|
||||
{
|
||||
while (ServiceRegs.Count > 0)
|
||||
ServiceRegs.Dequeue().Invoke(services);
|
||||
while (_serviceRegs.Count > 0)
|
||||
_serviceRegs.Dequeue().Invoke(services);
|
||||
}
|
||||
|
||||
public EGConfiguration AddLocalization()
|
||||
// TODO: update to use attributes and reflections instead of _addingStatus-dictionary
|
||||
private readonly Dictionary<string, bool> _addingStatus = new ()
|
||||
{
|
||||
ServiceRegs.Enqueue(s => s.AddLocalization());
|
||||
{ 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));
|
||||
_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));
|
||||
_serviceRegs.Enqueue(s => s.AddEGInfrastructureServices(options));
|
||||
#pragma warning restore CS0618
|
||||
_addingStatus[nameof(AddInfrastructure)] = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IConfiguration Configuration
|
||||
public EGConfiguration AddServices(IConfiguration config)
|
||||
{
|
||||
set
|
||||
{
|
||||
#pragma warning disable CS0618
|
||||
ServiceRegs.Enqueue(s => s.AddEnvelopeGeneratorServices(value));
|
||||
_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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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; }
|
||||
}
|
||||
}
|
||||
@ -18,6 +18,16 @@
|
||||
|
||||
<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));
|
||||
}
|
||||
@ -1,18 +1,24 @@
|
||||
using EnvelopeGenerator.Application;
|
||||
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.json", optional: false, reloadOnChange: true)
|
||||
.AddJsonFile("appsettings.Logging.json", optional: false, reloadOnChange: true)
|
||||
.Build())
|
||||
.CreateLogger();
|
||||
|
||||
try
|
||||
{
|
||||
Log.Information("Application is starting...");
|
||||
|
||||
var builder = Host.CreateApplicationBuilder(args);
|
||||
|
||||
// add serilog
|
||||
@ -20,35 +26,62 @@ try
|
||||
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.");
|
||||
|
||||
#pragma warning disable CS0618 // Type or member is obsolete
|
||||
builder.Services.AddEGInfrastructureServices(
|
||||
opt =>
|
||||
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), Microsoft.Extensions.Logging.LogLevel.Trace)
|
||||
.LogTo(log => logger.LogInformation("{log}", log), LogLevel.Trace)
|
||||
.EnableSensitiveDataLogging()
|
||||
.EnableDetailedErrors();
|
||||
});
|
||||
});
|
||||
#pragma warning restore CS0618 // Type or member is obsolete
|
||||
|
||||
#pragma warning disable CS0618 // Type or member is obsolete
|
||||
builder.Services.AddEnvelopeGeneratorServices(config);
|
||||
#pragma warning restore CS0618 // Type or member is obsolete
|
||||
})
|
||||
.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.");
|
||||
|
||||
@ -1,12 +1,18 @@
|
||||
using EnvelopeGenerator.Finalizer.Models;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
namespace EnvelopeGenerator.Finalizer
|
||||
{
|
||||
public class Worker : BackgroundService
|
||||
{
|
||||
private readonly ILogger<Worker> _logger;
|
||||
|
||||
public Worker(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)
|
||||
@ -17,7 +23,7 @@ namespace EnvelopeGenerator.Finalizer
|
||||
{
|
||||
_logger.LogInformation("Worker running at: {time}", DateTimeOffset.Now);
|
||||
}
|
||||
await Task.Delay(1000, stoppingToken);
|
||||
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" ]
|
||||
}
|
||||
}
|
||||
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
|
||||
}
|
||||
}
|
||||
@ -1,40 +1,2 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"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;"
|
||||
},
|
||||
"Serilog": {
|
||||
"Using": [ "Serilog.Sinks.Console", "Serilog.Sinks.File" ],
|
||||
"MinimumLevel": {
|
||||
"Default": "Information",
|
||||
"Override": {
|
||||
"Microsoft": "Warning",
|
||||
"System": "Warning"
|
||||
}
|
||||
},
|
||||
"WriteTo": [
|
||||
{
|
||||
"Name": "Console",
|
||||
"Args": {
|
||||
"outputTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "File",
|
||||
"Args": {
|
||||
"path": "Logs/log-.txt",
|
||||
"rollingInterval": "Day",
|
||||
"retainedFileCountLimit": 7,
|
||||
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
|
||||
}
|
||||
}
|
||||
],
|
||||
"Enrich": [ "FromLogContext", "WithMachineName", "WithThreadId" ]
|
||||
}
|
||||
}
|
||||
@ -105,6 +105,7 @@ try
|
||||
});
|
||||
builder.Services.AddOpenApi();
|
||||
|
||||
// TODO: Update to configure with EnvelopeGenerator.DependencyInjection
|
||||
//AddEF Core dbcontext
|
||||
var useDbMigration = Environment.GetEnvironmentVariable("MIGRATION_TEST_MODE") == true.ToString() || config.GetValue<bool>("UseDbMigration");
|
||||
var cnnStrName = useDbMigration ? "DbMigrationTest" : "Default";
|
||||
|
||||
@ -79,6 +79,8 @@ public abstract class EGDbContextBase : DbContext
|
||||
|
||||
public DbSet<ClientUser> ClientUsers { get; set; }
|
||||
|
||||
public DbSet<ThirdPartyModule> ThirdPartyModules { get; set; }
|
||||
|
||||
private readonly DbTriggerParams _triggers;
|
||||
|
||||
private readonly ILogger
|
||||
|
||||
@ -86,6 +86,7 @@ try
|
||||
builder.Services.AddSwaggerGen();
|
||||
}
|
||||
|
||||
// TODO: Update to configure with EnvelopeGenerator.DependencyInjection
|
||||
//AddEF Core dbcontext
|
||||
var useDbMigration = Environment.GetEnvironmentVariable("MIGRATION_TEST_MODE") == true.ToString() || config.GetValue<bool>("UseDbMigration");
|
||||
var cnnStrName = useDbMigration ? "DbMigrationTest" : "Default";
|
||||
|
||||
@ -123,7 +123,7 @@ Global
|
||||
{A9F9B431-BB9B-49B8-9E2C-0703634A653A} = {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}
|
||||
{49E6A4C0-C2FC-4A34-9821-245AF050CA26} = {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
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user