Compare commits

...

12 Commits

Author SHA1 Message Date
b5cd42b6fa add WorkerOptions.
- bind IntervalInMin with worker task delay
2025-11-03 16:38:41 +01:00
187f4a42fc feat(GdPictureOptions): Created to configure parameters related to GdPicture.
- Configure the GdPicture license key via a third-party module entity.
2025-11-03 15:36:11 +01:00
23d4b2f31e chore: move finalizer to presentation layer 2025-11-03 14:51:13 +01:00
8e71e5b4bb feat(third-party-modules): add query and handler for reading third-party modules with filtering by name and active status 2025-11-03 14:49:54 +01:00
b693615561 feat(ThirdPartyModuleDto): create DTO of ThirdPartyModule with mapping profile 2025-11-03 14:30:45 +01:00
36dc9266bc Add ThirdPartyModule entity for 3rd party module tracking
- Created ThirdPartyModule class in EnvelopeGenerator.Domain.Entities
- Mapped to TBDD_3RD_PARTY_MODULES table with appropriate columns
- Added properties: Id, Active, Name, Description, License, Version, AddedWho, AddedWhen, ChangedWho, ChangedWhen
- Configured data annotations for primary key, required fields, string lengths, and nullable support
- Conditional nullable support based on compilation symbols
2025-11-03 13:05:24 +01:00
9aabe270b4 add appsettings for PDF burner 2025-11-03 11:56:10 +01:00
b303b7be06 chore(Finalizer.Program): enhance configuration and environment-specific JSON loading
- Changed Serilog configuration file from `appsettings.json` to `appsettings.Logging.json`.
- Added logging for application startup.
- Dynamically load environment-specific appsettings JSON files, excluding `Development` and `migration` files.
2025-11-03 11:41:55 +01:00
02937360ea chore(Finalizer.appsettings): update Serilog configuration to increase log verbosity and retention
- Changed default minimum log level from Information to Verbose.
- Updated console sink to use Verbose level.
- Renamed and consolidated log files for Verbose, Debug, Info, Warning, Error, and Fatal levels.
- Increased retained file count from 7 to 30 for all log levels.
2025-11-03 11:26:14 +01:00
c2735b92e0 feat(logging): enhance Serilog configuration with separate level-based log files 2025-11-03 10:48:35 +01:00
568f43186c refactor(Finalizer.Program): simplify EnvelopeGenerator service registration using AddEnvelopeGenerator extension
- Replaced manual service setup with AddEnvelopeGenerator fluent configuration
- Added EnvelopeGenerator.DependencyInjection namespace
- Integrated distributed SQL Server cache for EG services
- Improved DI structure and reduced obsolete warnings
2025-11-03 10:24:09 +01:00
3bc5439b5a feat(dependency-injection): add service configuration validation and simplify setup
- Removed unnecessary IConfiguration and SqlServerCacheOptions parameters from AddEnvelopeGenerator
- Added EnsureAllServicesConfigured() to validate that all required service methods are invoked
- Introduced _addingStatus dictionary to track configuration status
- Renamed internal queue field to _serviceRegs for consistency
- Added AddServices() method to explicitly register EnvelopeGenerator services
- Improved AddLocalization() to support optional custom localization options
2025-11-03 09:30:43 +01:00
23 changed files with 604 additions and 65 deletions

View File

@ -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>();

View File

@ -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; }
}

View File

@ -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;
}
}

View File

@ -11,10 +11,11 @@ namespace EnvelopeGenerator.DependencyInjection;
public static class 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(); var egConfig = new EGConfiguration();
options.Invoke(egConfig); options.Invoke(egConfig);
egConfig.EnsureAllServicesConfigured();
egConfig.RegisterAll(services); egConfig.RegisterAll(services);
// Add envelope generator services // Add envelope generator services
@ -29,41 +30,68 @@ public static class DependencyInjection
public record EGConfiguration public record EGConfiguration
{ {
internal readonly Queue<Action<IServiceCollection>> ServiceRegs = new(); internal readonly Queue<Action<IServiceCollection>> _serviceRegs = new();
internal void RegisterAll(IServiceCollection services) internal void RegisterAll(IServiceCollection services)
{ {
while (ServiceRegs.Count > 0) while (_serviceRegs.Count > 0)
ServiceRegs.Dequeue().Invoke(services); _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; return this;
} }
public EGConfiguration AddDistributedSqlServerCache(Action<SqlServerCacheOptions> setupAction) public EGConfiguration AddDistributedSqlServerCache(Action<SqlServerCacheOptions> setupAction)
{ {
ServiceRegs.Enqueue(s => s.AddDistributedSqlServerCache(setupAction)); _serviceRegs.Enqueue(s => s.AddDistributedSqlServerCache(setupAction));
_addingStatus[nameof(AddDistributedSqlServerCache)] = true;
return this; return this;
} }
public EGConfiguration AddInfrastructure(Action<EGInfrastructureConfiguration> options) public EGConfiguration AddInfrastructure(Action<EGInfrastructureConfiguration> options)
{ {
#pragma warning disable CS0618 #pragma warning disable CS0618
ServiceRegs.Enqueue(s => s.AddEGInfrastructureServices(options)); _serviceRegs.Enqueue(s => s.AddEGInfrastructureServices(options));
#pragma warning restore CS0618 #pragma warning restore CS0618
_addingStatus[nameof(AddInfrastructure)] = true;
return this; return this;
} }
public IConfiguration Configuration public EGConfiguration AddServices(IConfiguration config)
{
set
{ {
#pragma warning disable CS0618 #pragma warning disable CS0618
ServiceRegs.Enqueue(s => s.AddEnvelopeGeneratorServices(value)); _serviceRegs.Enqueue(s => s.AddEnvelopeGeneratorServices(config));
#pragma warning restore CS0618 #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.");
} }
} }
} }

View 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; }
}
}

View File

@ -18,6 +18,16 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\EnvelopeGenerator.Application\EnvelopeGenerator.Application.csproj" /> <ProjectReference Include="..\EnvelopeGenerator.Application\EnvelopeGenerator.Application.csproj" />
<ProjectReference Include="..\EnvelopeGenerator.DependencyInjection\EnvelopeGenerator.DependencyInjection.csproj" />
<ProjectReference Include="..\EnvelopeGenerator.Infrastructure\EnvelopeGenerator.Infrastructure.csproj" /> <ProjectReference Include="..\EnvelopeGenerator.Infrastructure\EnvelopeGenerator.Infrastructure.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Content Update="appsettings.Database.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="appsettings.Logging.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
</Project> </Project>

View File

@ -0,0 +1,9 @@
namespace EnvelopeGenerator.Finalizer.Models;
public class GdPictureOptions
{
/// <summary>
///
/// </summary>
public string License { get; set; } = null!;
}

View 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));
}

View File

@ -1,18 +1,24 @@
using EnvelopeGenerator.Application; using EnvelopeGenerator.Application.ThirdPartyModules.Queries;
using EnvelopeGenerator.DependencyInjection;
using EnvelopeGenerator.Finalizer; using EnvelopeGenerator.Finalizer;
using EnvelopeGenerator.Finalizer.Models;
using EnvelopeGenerator.Infrastructure; using EnvelopeGenerator.Infrastructure;
using MediatR;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Options;
using Serilog; using Serilog;
// Load Serilog from appsettings.json // Load Serilog from appsettings.json
Log.Logger = new LoggerConfiguration() Log.Logger = new LoggerConfiguration()
.ReadFrom.Configuration(new ConfigurationBuilder() .ReadFrom.Configuration(new ConfigurationBuilder()
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) .AddJsonFile("appsettings.Logging.json", optional: false, reloadOnChange: true)
.Build()) .Build())
.CreateLogger(); .CreateLogger();
try try
{ {
Log.Information("Application is starting...");
var builder = Host.CreateApplicationBuilder(args); var builder = Host.CreateApplicationBuilder(args);
// add serilog // add serilog
@ -20,35 +26,62 @@ try
builder.Logging.AddSerilog(); builder.Logging.AddSerilog();
var config = builder.Configuration; 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.AddHostedService<Worker>();
builder.Services.Configure<WorkerOptions>(config.GetSection("Worker"));
#endregion
#region Add DB Context, EG Inf. and Services #region Add DB Context, EG Inf. and Services
var cnnStrName = "Default"; var cnnStrName = "Default";
var connStr = config.GetConnectionString(cnnStrName) var connStr = config.GetConnectionString(cnnStrName)
?? throw new InvalidOperationException($"Connection string '{cnnStrName}' is missing in the application configuration."); ?? throw new InvalidOperationException($"Connection string '{cnnStrName}' is missing in the application configuration.");
#pragma warning disable CS0618 // Type or member is obsolete builder.Services.AddEnvelopeGenerator(egOptions => egOptions
builder.Services.AddEGInfrastructureServices( .AddLocalization()
opt => .AddDistributedSqlServerCache(options =>
{
options.ConnectionString = connStr;
options.SchemaName = "dbo";
options.TableName = "TBDD_CACHE";
})
.AddInfrastructure(opt =>
{ {
opt.AddDbTriggerParams(config); opt.AddDbTriggerParams(config);
opt.AddDbContext((provider, options) => opt.AddDbContext((provider, options) =>
{ {
var logger = provider.GetRequiredService<ILogger<EGDbContext>>(); var logger = provider.GetRequiredService<ILogger<EGDbContext>>();
options.UseSqlServer(connStr) options.UseSqlServer(connStr)
.LogTo(log => logger.LogInformation("{log}", log), Microsoft.Extensions.Logging.LogLevel.Trace) .LogTo(log => logger.LogInformation("{log}", log), LogLevel.Trace)
.EnableSensitiveDataLogging() .EnableSensitiveDataLogging()
.EnableDetailedErrors(); .EnableDetailedErrors();
}); });
}); })
#pragma warning restore CS0618 // Type or member is obsolete .AddServices(config)
);
#pragma warning disable CS0618 // Type or member is obsolete
builder.Services.AddEnvelopeGeneratorServices(config);
#pragma warning restore CS0618 // Type or member is obsolete
#endregion Add DB Context, EG Inf. and Services #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 host = builder.Build();
var licence = host.Services.GetRequiredService<IOptions<GdPictureOptions>>().Value;
host.Run(); host.Run();
Log.Information("The worker was stopped."); Log.Information("The worker was stopped.");

View File

@ -1,12 +1,18 @@
using EnvelopeGenerator.Finalizer.Models;
using Microsoft.Extensions.Options;
namespace EnvelopeGenerator.Finalizer namespace EnvelopeGenerator.Finalizer
{ {
public class Worker : BackgroundService public class Worker : BackgroundService
{ {
private readonly ILogger<Worker> _logger; private readonly ILogger<Worker> _logger;
public Worker(ILogger<Worker> logger) private readonly WorkerOptions _options;
public Worker(ILogger<Worker> logger, IOptions<WorkerOptions> workerOptions)
{ {
_logger = logger; _logger = logger;
_options = workerOptions.Value;
} }
protected override async Task ExecuteAsync(CancellationToken stoppingToken) protected override async Task ExecuteAsync(CancellationToken stoppingToken)
@ -17,7 +23,7 @@ namespace EnvelopeGenerator.Finalizer
{ {
_logger.LogInformation("Worker running at: {time}", DateTimeOffset.Now); _logger.LogInformation("Worker running at: {time}", DateTimeOffset.Now);
} }
await Task.Delay(1000, stoppingToken); await Task.Delay(_options.IntervalInMillisecond, stoppingToken);
} }
} }
} }

View 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" ]
}
}

View 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" ]
}
}

View File

@ -0,0 +1,14 @@
{
"IgnoredLabels": {
"Label": [
"Date",
"Datum",
"ZIP",
"PLZ",
"Place",
"Ort",
"Position",
"Stellung"
]
}
}

View 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" ]
}
}

View File

@ -0,0 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.Hosting.Lifetime": "Information"
}
}
}

View 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" ]
}
}

View File

@ -0,0 +1,14 @@
{
"IgnoredLabels": {
"Label": [
"Date",
"Datum",
"ZIP",
"PLZ",
"Place",
"Ort",
"Position",
"Stellung"
]
}
}

View File

@ -0,0 +1,5 @@
{
"Worker": {
"IntervalInMin": 0.01666666666
}
}

View File

@ -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" ]
}
} }

View File

@ -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";

View File

@ -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

View File

@ -86,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";

View File

@ -123,7 +123,7 @@ 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} = {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} {B97DE7DD-3190-4A84-85E9-E57AD735BE61} = {E3C758DC-914D-4B7E-8457-0813F1FDB0CB}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution