From 031f0d4cce971cfdd4982bdfc8d172f913b8d825 Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Tue, 1 Apr 2025 18:58:26 +0200 Subject: [PATCH 01/23] =?UTF-8?q?Hinzuf=C3=BCgen=20des=20EnvelopeGenerator?= =?UTF-8?q?.Terminal-Projekts=20mit=20CLI-Unterst=C3=BCtzung?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Die Lösung wurde aktualisiert und enthält nun ein neues Projekt `EnvelopeGenerator.Terminal` für .NET 8.0. Hinzufügen der Klassen `CommandManager` und `DependencyInjection` für die Befehlsausführung und die Injektion von Abhängigkeiten mit CommandDotNet. Die Klasse `Program` wurde eingeführt, um den Anwendungshost einzurichten und Befehle auszuführen. Hinzufügen der erforderlichen Paketverweise in der Projektdatei zur Unterstützung neuer Funktionen. --- EnvelopeGenerator.Terminal/CommandManager.cs | 14 ++++++++++ .../DependencyInjection.cs | 28 +++++++++++++++++++ .../EnvelopeGenerator.Terminal.csproj | 23 +++++++++++++++ EnvelopeGenerator.Terminal/Program.cs | 17 +++++++++++ EnvelopeGenerator.sln | 7 +++++ 5 files changed, 89 insertions(+) create mode 100644 EnvelopeGenerator.Terminal/CommandManager.cs create mode 100644 EnvelopeGenerator.Terminal/DependencyInjection.cs create mode 100644 EnvelopeGenerator.Terminal/EnvelopeGenerator.Terminal.csproj create mode 100644 EnvelopeGenerator.Terminal/Program.cs diff --git a/EnvelopeGenerator.Terminal/CommandManager.cs b/EnvelopeGenerator.Terminal/CommandManager.cs new file mode 100644 index 00000000..40a22a86 --- /dev/null +++ b/EnvelopeGenerator.Terminal/CommandManager.cs @@ -0,0 +1,14 @@ +using CommandDotNet; +using System.Reflection; + +namespace EnvelopeGenerator.Terminal; + +public class CommandManager +{ + [DefaultCommand] + public void Execute([Option(Description = "print envelope generator termianal version.")] bool version) + { + if(version) + Console.WriteLine($"v{Assembly.GetExecutingAssembly().GetName().Version}"); + } +} diff --git a/EnvelopeGenerator.Terminal/DependencyInjection.cs b/EnvelopeGenerator.Terminal/DependencyInjection.cs new file mode 100644 index 00000000..e28696c7 --- /dev/null +++ b/EnvelopeGenerator.Terminal/DependencyInjection.cs @@ -0,0 +1,28 @@ +using CommandDotNet.NameCasing; +using CommandDotNet; +using Microsoft.Extensions.DependencyInjection; +using CommandDotNet.IoC.MicrosoftDependencyInjection; + +namespace EnvelopeGenerator.Terminal; + +public static class DependencyInjection +{ + public static IServiceCollection AddCommandManagerRunner(this IServiceCollection services, Case @case = Case.KebabCase) + { + return services + .AddSingleton() + .AddSingleton(sp => + { + var runner = new AppRunner(); + runner.UseMicrosoftDependencyInjection(sp); + runner.UseNameCasing(@case); + return runner; + }); + } + + public static Task RunCommandManagerRunner(this IServiceProvider provider, string[] args) + { + var runner = provider.GetRequiredService>(); + return runner.RunAsync(args); + } +} diff --git a/EnvelopeGenerator.Terminal/EnvelopeGenerator.Terminal.csproj b/EnvelopeGenerator.Terminal/EnvelopeGenerator.Terminal.csproj new file mode 100644 index 00000000..3fa95dea --- /dev/null +++ b/EnvelopeGenerator.Terminal/EnvelopeGenerator.Terminal.csproj @@ -0,0 +1,23 @@ + + + + Exe + net8.0 + enable + enable + true + true + + + + + + + + + + + + + + diff --git a/EnvelopeGenerator.Terminal/Program.cs b/EnvelopeGenerator.Terminal/Program.cs new file mode 100644 index 00000000..b978cf04 --- /dev/null +++ b/EnvelopeGenerator.Terminal/Program.cs @@ -0,0 +1,17 @@ +using Microsoft.Extensions.Hosting; + +namespace EnvelopeGenerator.Terminal; + +public class Program +{ + static async Task Main(string[] args) + { + var builder = Host.CreateApplicationBuilder(args); + + builder.Services.AddCommandManagerRunner(); + + var app = builder.Build(); + + return await app.Services.RunCommandManagerRunner(args); + } +} \ No newline at end of file diff --git a/EnvelopeGenerator.sln b/EnvelopeGenerator.sln index 0275e352..4c8aa8c9 100644 --- a/EnvelopeGenerator.sln +++ b/EnvelopeGenerator.sln @@ -35,6 +35,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "infrastructure", "infrastru EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "presentation", "presentation", "{E3C758DC-914D-4B7E-8457-0813F1FDB0CB}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EnvelopeGenerator.Terminal", "EnvelopeGenerator.Terminal\EnvelopeGenerator.Terminal.csproj", "{A9F9B431-BB9B-49B8-9E2C-0703634A653A}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -85,6 +87,10 @@ Global {A4D0DD1A-67BC-4E1A-AD29-BC4BC0D41399}.Debug|Any CPU.Build.0 = Debug|Any CPU {A4D0DD1A-67BC-4E1A-AD29-BC4BC0D41399}.Release|Any CPU.ActiveCfg = Release|Any CPU {A4D0DD1A-67BC-4E1A-AD29-BC4BC0D41399}.Release|Any CPU.Build.0 = Release|Any CPU + {A9F9B431-BB9B-49B8-9E2C-0703634A653A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A9F9B431-BB9B-49B8-9E2C-0703634A653A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A9F9B431-BB9B-49B8-9E2C-0703634A653A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A9F9B431-BB9B-49B8-9E2C-0703634A653A}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -104,6 +110,7 @@ Global {A4D0DD1A-67BC-4E1A-AD29-BC4BC0D41399} = {0CBC2432-A561-4440-89BC-671B66A24146} {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} = {134D4164-B291-4E19-99B9-E4FA3AFAB62C} {E3C758DC-914D-4B7E-8457-0813F1FDB0CB} = {134D4164-B291-4E19-99B9-E4FA3AFAB62C} + {A9F9B431-BB9B-49B8-9E2C-0703634A653A} = {E3C758DC-914D-4B7E-8457-0813F1FDB0CB} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {73E60370-756D-45AD-A19A-C40A02DACCC7} From 927b89554d204b209019768e350a4795b2166a67 Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Mon, 14 Apr 2025 11:38:21 +0200 Subject: [PATCH 02/23] feat(DependencyInjection): Verbesserung von DI und Konfigurationsmanagement MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DependencyInjection wurde aktualisiert, um IConfiguration zu akzeptieren, appsettings.json für Konfigurationseinstellungen hinzugefügt und Projektreferenzen in der .csproj-Datei geändert. Program.cs wurde angepasst, um die neue Konfigurationsstruktur für die Dienstregistrierung zu nutzen. --- .../DependencyInjection.cs | 7 +- .../EnvelopeGenerator.Terminal.csproj | 13 ++ EnvelopeGenerator.Terminal/Program.cs | 4 +- EnvelopeGenerator.Terminal/appsettings.json | 208 ++++++++++++++++++ 4 files changed, 230 insertions(+), 2 deletions(-) create mode 100644 EnvelopeGenerator.Terminal/appsettings.json diff --git a/EnvelopeGenerator.Terminal/DependencyInjection.cs b/EnvelopeGenerator.Terminal/DependencyInjection.cs index e28696c7..4e510081 100644 --- a/EnvelopeGenerator.Terminal/DependencyInjection.cs +++ b/EnvelopeGenerator.Terminal/DependencyInjection.cs @@ -2,15 +2,20 @@ using CommandDotNet; using Microsoft.Extensions.DependencyInjection; using CommandDotNet.IoC.MicrosoftDependencyInjection; +using EnvelopeGenerator.Infrastructure; +using EnvelopeGenerator.Application.Extensions; +using Microsoft.Extensions.Configuration; namespace EnvelopeGenerator.Terminal; public static class DependencyInjection { - public static IServiceCollection AddCommandManagerRunner(this IServiceCollection services, Case @case = Case.KebabCase) + public static IServiceCollection AddCommandManagerRunner(this IServiceCollection services, IConfiguration configuration, Case @case = Case.KebabCase) { return services .AddSingleton() + .AddEnvelopeGeneratorRepositories() + .AddEnvelopeGeneratorServices(configuration) .AddSingleton(sp => { var runner = new AppRunner(); diff --git a/EnvelopeGenerator.Terminal/EnvelopeGenerator.Terminal.csproj b/EnvelopeGenerator.Terminal/EnvelopeGenerator.Terminal.csproj index 3fa95dea..49187216 100644 --- a/EnvelopeGenerator.Terminal/EnvelopeGenerator.Terminal.csproj +++ b/EnvelopeGenerator.Terminal/EnvelopeGenerator.Terminal.csproj @@ -9,6 +9,14 @@ true + + + PreserveNewest + true + PreserveNewest + + + @@ -20,4 +28,9 @@ + + + + + diff --git a/EnvelopeGenerator.Terminal/Program.cs b/EnvelopeGenerator.Terminal/Program.cs index b978cf04..c99a6dab 100644 --- a/EnvelopeGenerator.Terminal/Program.cs +++ b/EnvelopeGenerator.Terminal/Program.cs @@ -8,7 +8,9 @@ public class Program { var builder = Host.CreateApplicationBuilder(args); - builder.Services.AddCommandManagerRunner(); + var config = builder.Configuration; + + builder.Services.AddCommandManagerRunner(config); var app = builder.Build(); diff --git a/EnvelopeGenerator.Terminal/appsettings.json b/EnvelopeGenerator.Terminal/appsettings.json new file mode 100644 index 00000000..136c48a8 --- /dev/null +++ b/EnvelopeGenerator.Terminal/appsettings.json @@ -0,0 +1,208 @@ +{ + "DiPMode": false, //Please be careful when enabling Development in Production (DiP) mode. It allows Swagger and test controllers to be enabled in a production environment. + "EnableSwagger": true, + "EnableTestControllers": true, + "DetailedErrors": true, + "Logging": { + "LogLevel": { + "Default": "Warning", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information", + "Microsoft.AspNetCore.Hosting.Diagnostics": "Warning" + } + }, + "ConnectionStrings": { + "Default": "Server=SDD-VMP04-SQL17\\DD_DEVELOP01;Database=DD_ECM;User Id=sa;Password=dd;Encrypt=false;TrustServerCertificate=True;" + }, + "PSPDFKitLicenseKey": "SXCtGGY9XA-31OGUXQK-r7c6AkdLGPm2ljuyDr1qu0kkhLvydg-Do-fxpNUF4Rq3fS_xAnZRNFRHbXpE6sQ2BMcCSVTcXVJO6tPviexjpiT-HnrDEySlUERJnnvh-tmeOWprxS6BySPnSILkmaVQtUfOIUS-cUbvvEYHTvQBKbSF8di4XHQFyfv49ihr51axm3NVV3AXwh2EiKL5C5XdqBZ4sQ4O7vXBjM2zvxdPxlxdcNYmiU83uAzw7B83O_jubPzya4CdUHh_YH7Nlp2gP56MeG1Sw2JhMtfG3Rj14Sg4ctaeL9p6AEWca5dDjJ2li5tFIV2fQSsw6A_cowLu0gtMm5i8IfJXeIcQbMC2-0wGv1oe9hZYJvFMdzhTM_FiejM0agemxt3lJyzuyP8zbBSOgp7Si6A85krLWPZptyZBTG7pp7IHboUHfPMxCXqi-zMsqewOJtQBE2mjntU-lPryKnssOpMPfswwQX7QSkJYV5EMqNmEhQX6mEkp2wcqFzMC7bJQew1aO4pOpvChUaMvb1vgRek0HxLag0nwQYX2YrYGh7F_xXJs-8HNwJe8H0-eW4x4faayCgM5rB5772CCCsD9ThZcvXFrjNHHLGJ8WuBUFm6LArvSfFQdii_7j-_sqHMpeKZt26NFgivj1A==", + "Content-Security-Policy": [ // The first format parameter {0} will be replaced by the nonce value. + "default-src 'self'", + "script-src 'self' 'nonce-{0}' 'unsafe-eval'", + "style-src 'self' 'unsafe-inline' https://fonts.googleapis.com:*", + "img-src 'self' data: https: blob:", + "font-src 'self' https://fonts.gstatic.com:*", + "connect-src 'self' https://nominatim.openstreetmap.org:* http://localhost:* https://localhost:* ws://localhost:* wss://localhost:* blob:", + "frame-src 'self'", + "media-src 'self'", + "object-src 'self'" + ], + "AllowedOrigins": [ "https://localhost:7202", "https://digitale.unterschrift.wisag.de/" ], + "NLog": { + "throwConfigExceptions": true, + "variables": { + "logDirectory": "E:\\LogFiles\\Digital Data\\signFlow", + "logFileNamePrefix": "${shortdate}-ECM.EnvelopeGenerator.Web" + }, + "targets": { + "infoLogs": { + "type": "File", + "fileName": "${logDirectory}\\${logFileNamePrefix}-Info.log", + "maxArchiveDays": 30 + }, + "errorLogs": { + "type": "File", + "fileName": "${logDirectory}\\${logFileNamePrefix}-Error.log", + "maxArchiveDays": 30 + }, + "criticalLogs": { + "type": "File", + "fileName": "${logDirectory}\\${logFileNamePrefix}-Critical.log", + "maxArchiveDays": 30 + } + }, + // Trace, Debug, Info, Warn, Error and *Fatal* + "rules": [ + { + "logger": "*", + "minLevel": "Info", + "maxLevel": "Warn", + "writeTo": "infoLogs" + }, + { + "logger": "*", + "level": "Error", + "writeTo": "errorLogs" + }, + { + "logger": "*", + "level": "Fatal", + "writeTo": "criticalLogs" + } + ] + }, + "ContactLink": { + "Label": "Kontakt", + "Href": "https://digitaldata.works/", + "HrefLang": "de", + "Target": "_blank", + "Title": "Digital Data GmbH" + }, + /* Resx naming format is -> Resource.language.resx (eg: Resource.de_DE.resx). + To add a new language, first you should write the required resx file. + first is the default culture name. */ + "Cultures": [ + { + "Language": "de-DE", + "FIClass": "fi-de" + }, + { + "Language": "en-US", + "FIClass": "fi-us" + } + ], + "DisableMultiLanguage": false, + "Regexes": [ + { + "Pattern": "/^\\p{L}+(?:([\\ \\-\\']|(\\.\\ ))\\p{L}+)*$/u", + "Name": "City", + "Platforms": [ ".NET" ] + }, + { + "Pattern": "/^[a-zA-Z\\u0080-\\u024F]+(?:([\\ \\-\\']|(\\.\\ ))[a-zA-Z\\u0080-\\u024F]+)*$/", + "Name": "City", + "Platforms": [ "javascript" ] + } + ], + "CustomImages": { + "App": { + "Src": "/img/DD_signFLOW_LOGO.png", + "Classes": { + "Main": "signFlow-logo" + } + }, + "Company": { + "Src": "/img/digital_data.svg", + "Classes": { + "Show": "dd-show-logo", + "Locked": "dd-locked-logo" + } + } + }, + "DispatcherParams": { + "SendingProfile": 1, + "AddedWho": "DDEnvelopGenerator", + "ReminderTypeId": 202377, + "EmailAttmt1": "" + }, + "MailParams": { + "Placeholders": { + "[NAME_PORTAL]": "signFlow", + "[SIGNATURE_TYPE]": "signieren", + "[REASON]": "" + } + }, + "GtxMessagingParams": { + "Uri": "https://rest.gtx-messaging.net", + "Path": "smsc/sendsms/f566f7e5-bdf2-4a9a-bf52-ed88215a432e/json", + "Headers": {}, + "QueryParams": { + "from": "signFlow" + } + }, + "TFARegParams": { + "TimeLimit": "00:30:00" + }, + "DbTriggerParams": { + "Envelope": [ "TBSIG_ENVELOPE_HISTORY_AFT_INS" ], + "EnvelopeHistory": [ "TBSIG_ENVELOPE_HISTORY_AFT_INS" ], + "EmailOut": [ "TBEMLP_EMAIL_OUT_AFT_INS", "TBEMLP_EMAIL_OUT_AFT_UPD" ], + "EnvelopeReceiverReadOnly": [ "TBSIG_ENVELOPE_RECEIVER_READ_ONLY_UPD" ], + "Receiver": [] + }, + "MainPageTitle": null, + "AnnotationParams": { + "DefaultAnnotation": { + "Width": 1, + "Height": 0.5, + "MarginTop": 1 + }, + "Annotations": [ + { + "Name": "Signature", + "MarginTop": 0 + }, + { + "Name": "PositionLabel", + "VerBoundAnnotName": "Signature", + "WidthRatio": 1.2, + "HeightRatio": 0.5, + "MarginTopRatio": 0.22 + }, + { + "Name": "Position", + "VerBoundAnnotName": "PositionLabel", + "WidthRatio": 1.2, + "HeightRatio": 0.5, + "MarginTopRatio": -0.05 + }, + { + "Name": "CityLabel", + "VerBoundAnnotName": "Position", + "WidthRatio": 1.2, + "HeightRatio": 0.5, + "MarginTopRatio": 0.05 + }, + { + "Name": "City", + "VerBoundAnnotName": "CityLabel", + "WidthRatio": 1.2, + "HeightRatio": 0.5, + "MarginTopRatio": -0.05 + }, + { + "Name": "DateLabel", + "VerBoundAnnotName": "City", + "WidthRatio": 1.55, + "HeightRatio": 0.5, + "MarginTopRatio": 0.05 + }, + { + "Name": "Date", + "VerBoundAnnotName": "DateLabel", + "WidthRatio": 1.55, + "HeightRatio": 0.5, + "MarginTopRatio": -0.1 + } + ] + } +} From c0608b457c3c93a090a9bc2edd342ac7d9d44650 Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Mon, 14 Apr 2025 11:53:38 +0200 Subject: [PATCH 03/23] =?UTF-8?q?Hinzuf=C3=BCgen=20von=20CommandDotNet-Ref?= =?UTF-8?q?erenzen=20f=C3=BCr=20mehrere=20Ziel-Frameworks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hinzufügen von bedingten ``-Elementen in der Projektdatei für `net7.0`, `net8.0` und `net9.0`, die jeweils die entsprechende Version des `CommandDotNet`-Pakets angeben. --- .../EnvelopeGenerator.Application.csproj | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/EnvelopeGenerator.Application/EnvelopeGenerator.Application.csproj b/EnvelopeGenerator.Application/EnvelopeGenerator.Application.csproj index 3fe00e17..246f9551 100644 --- a/EnvelopeGenerator.Application/EnvelopeGenerator.Application.csproj +++ b/EnvelopeGenerator.Application/EnvelopeGenerator.Application.csproj @@ -60,4 +60,22 @@ + + + 7.0.5 + + + + + + 8.1.1 + + + + + + 8.1.1 + + + From a070a0f64ce1b000304d32f0ba45ae53b51e0157 Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Mon, 14 Apr 2025 12:55:48 +0200 Subject: [PATCH 04/23] Enhance CommandManager and Dependency Injection - Updated `CommandManager` to include an `IEnvelopeReceiverService` constructor and a new property for service access. Added version printing functionality in the `Execute` method. - Modified `AddCommandManagerRunner` in `DependencyInjection` to accept a connection string key name and added SQL Server caching configuration. - Added `Microsoft.Extensions.Caching.SqlServer` package reference in the project file for caching support. --- EnvelopeGenerator.Terminal/CommandManager.cs | 6 +++++- .../DependencyInjection.cs | 16 +++++++++++++++- .../EnvelopeGenerator.Terminal.csproj | 1 + 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/EnvelopeGenerator.Terminal/CommandManager.cs b/EnvelopeGenerator.Terminal/CommandManager.cs index 40a22a86..dcbdf53d 100644 --- a/EnvelopeGenerator.Terminal/CommandManager.cs +++ b/EnvelopeGenerator.Terminal/CommandManager.cs @@ -1,9 +1,10 @@ using CommandDotNet; +using EnvelopeGenerator.Application.Contracts.Services; using System.Reflection; namespace EnvelopeGenerator.Terminal; -public class CommandManager +public class CommandManager(IEnvelopeReceiverService envelopeReceiverService) { [DefaultCommand] public void Execute([Option(Description = "print envelope generator termianal version.")] bool version) @@ -11,4 +12,7 @@ public class CommandManager if(version) Console.WriteLine($"v{Assembly.GetExecutingAssembly().GetName().Version}"); } + + [Subcommand] + public IEnvelopeReceiverService EnvelopeReceiverService => envelopeReceiverService; } diff --git a/EnvelopeGenerator.Terminal/DependencyInjection.cs b/EnvelopeGenerator.Terminal/DependencyInjection.cs index 4e510081..be7f7669 100644 --- a/EnvelopeGenerator.Terminal/DependencyInjection.cs +++ b/EnvelopeGenerator.Terminal/DependencyInjection.cs @@ -5,13 +5,27 @@ using CommandDotNet.IoC.MicrosoftDependencyInjection; using EnvelopeGenerator.Infrastructure; using EnvelopeGenerator.Application.Extensions; using Microsoft.Extensions.Configuration; +using Microsoft.EntityFrameworkCore; namespace EnvelopeGenerator.Terminal; public static class DependencyInjection { - public static IServiceCollection AddCommandManagerRunner(this IServiceCollection services, IConfiguration configuration, Case @case = Case.KebabCase) + public static IServiceCollection AddCommandManagerRunner(this IServiceCollection services, IConfiguration configuration, Case @case = Case.KebabCase, string connectionStringKeyName = "Default") { + var connStr = configuration.GetConnectionString(connectionStringKeyName) + ?? throw new InvalidOperationException("There is no default connection string in appsettings.json."); + + services.AddDistributedSqlServerCache(options => + { + options.ConnectionString = connStr; + options.SchemaName = "dbo"; + options.TableName = "TBDD_CACHE"; + }); + + // Add envelope generator services + services.AddEnvelopeGeneratorRepositories(options => options.UseSqlServer(connStr)); + return services .AddSingleton() .AddEnvelopeGeneratorRepositories() diff --git a/EnvelopeGenerator.Terminal/EnvelopeGenerator.Terminal.csproj b/EnvelopeGenerator.Terminal/EnvelopeGenerator.Terminal.csproj index 49187216..d50253f1 100644 --- a/EnvelopeGenerator.Terminal/EnvelopeGenerator.Terminal.csproj +++ b/EnvelopeGenerator.Terminal/EnvelopeGenerator.Terminal.csproj @@ -21,6 +21,7 @@ + From a20c2b556f283adcf07d4b3aac67d3bd60a6e263 Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Mon, 14 Apr 2025 13:07:45 +0200 Subject: [PATCH 05/23] Add CommandDotNet support to IEnvelopeReceiverService Updated IEnvelopeReceiverService to utilize CommandDotNet for command-line functionality. Added a new command attribute to the VerifyAccessCodeAsync method, allowing it to be invoked via command line. Modified the method signature to accept a string identifier for the envelope receiver, enhancing its usability and alignment with intended functionality. --- .../Contracts/Services/IEnvelopeReceiverService.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/EnvelopeGenerator.Application/Contracts/Services/IEnvelopeReceiverService.cs b/EnvelopeGenerator.Application/Contracts/Services/IEnvelopeReceiverService.cs index 0df0f2e9..cc384954 100644 --- a/EnvelopeGenerator.Application/Contracts/Services/IEnvelopeReceiverService.cs +++ b/EnvelopeGenerator.Application/Contracts/Services/IEnvelopeReceiverService.cs @@ -1,4 +1,5 @@ -using DigitalData.Core.Abstractions.Application; +using CommandDotNet; +using DigitalData.Core.Abstractions.Application; using DigitalData.Core.DTO; using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver; using EnvelopeGenerator.Application.DTOs.Messaging; @@ -25,6 +26,7 @@ public interface IEnvelopeReceiverService : IBasicCRUDService> VerifyAccessCodeAsync(string uuid, string signature, string accessCode); + [Command("verify-access-code-async-by-id")] Task> VerifyAccessCodeAsync(string envelopeReceiverId, string accessCode); Task> IsExisting(string envelopeReceiverId); From e171b5086890062d71c2a068feb66b03b592998c Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Mon, 14 Apr 2025 13:15:19 +0200 Subject: [PATCH 06/23] Add service registrations to DependencyInjection Added using directives for application services and registered IEnvelopeMailService with its implementation EnvelopeMailService. Also included in-memory caching to enhance the dependency injection setup. --- EnvelopeGenerator.Terminal/DependencyInjection.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/EnvelopeGenerator.Terminal/DependencyInjection.cs b/EnvelopeGenerator.Terminal/DependencyInjection.cs index be7f7669..48cc9895 100644 --- a/EnvelopeGenerator.Terminal/DependencyInjection.cs +++ b/EnvelopeGenerator.Terminal/DependencyInjection.cs @@ -6,6 +6,8 @@ using EnvelopeGenerator.Infrastructure; using EnvelopeGenerator.Application.Extensions; using Microsoft.Extensions.Configuration; using Microsoft.EntityFrameworkCore; +using EnvelopeGenerator.Application.Contracts.Services; +using EnvelopeGenerator.Application.Services; namespace EnvelopeGenerator.Terminal; @@ -36,7 +38,9 @@ public static class DependencyInjection runner.UseMicrosoftDependencyInjection(sp); runner.UseNameCasing(@case); return runner; - }); + }) + .AddScoped() + .AddMemoryCache(); ; } public static Task RunCommandManagerRunner(this IServiceProvider provider, string[] args) From 54c17f106ea06f4491bab15d40c996664a79ba47 Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Mon, 14 Apr 2025 13:18:50 +0200 Subject: [PATCH 07/23] =?UTF-8?q?feat(Program.cs):=20Hosting-Unterst=C3=BC?= =?UTF-8?q?tzung=20zu=20CommandManagerRunner=20hinzuf=C3=BCgen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Einführung von `Microsoft.Extensions.Hosting` in `DependencyInjection.cs`. - Überladung für `RunCommandManagerRunner` hinzugefügt, um `IHost` zu akzeptieren. - Aktualisiert `Program.cs`, um die neue Methode `RunCommandManagerRunner` zu verwenden. --- EnvelopeGenerator.Terminal/DependencyInjection.cs | 3 +++ EnvelopeGenerator.Terminal/Program.cs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/EnvelopeGenerator.Terminal/DependencyInjection.cs b/EnvelopeGenerator.Terminal/DependencyInjection.cs index 48cc9895..e233b5c3 100644 --- a/EnvelopeGenerator.Terminal/DependencyInjection.cs +++ b/EnvelopeGenerator.Terminal/DependencyInjection.cs @@ -8,6 +8,7 @@ using Microsoft.Extensions.Configuration; using Microsoft.EntityFrameworkCore; using EnvelopeGenerator.Application.Contracts.Services; using EnvelopeGenerator.Application.Services; +using Microsoft.Extensions.Hosting; namespace EnvelopeGenerator.Terminal; @@ -48,4 +49,6 @@ public static class DependencyInjection var runner = provider.GetRequiredService>(); return runner.RunAsync(args); } + + public static Task RunCommandManagerRunner(this IHost host, string[] args) => host.Services.RunCommandManagerRunner(args); } diff --git a/EnvelopeGenerator.Terminal/Program.cs b/EnvelopeGenerator.Terminal/Program.cs index c99a6dab..2aed708a 100644 --- a/EnvelopeGenerator.Terminal/Program.cs +++ b/EnvelopeGenerator.Terminal/Program.cs @@ -14,6 +14,6 @@ public class Program var app = builder.Build(); - return await app.Services.RunCommandManagerRunner(args); + return await app.RunCommandManagerRunner(args); } } \ No newline at end of file From 4b616896f8860152cbd74780d5a3072b94cfa0b1 Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Mon, 14 Apr 2025 13:53:07 +0200 Subject: [PATCH 08/23] Refactor CommandManager und Verbesserung von DependencyInjection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Aktualisierte Eigenschaftsnamen in CommandManager für mehr Klarheit und zusätzliche Lokalisierungsunterstützung in DependencyInjection durch Einbindung der Methode AddLocalization(). --- EnvelopeGenerator.Terminal/CommandManager.cs | 2 +- EnvelopeGenerator.Terminal/DependencyInjection.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/EnvelopeGenerator.Terminal/CommandManager.cs b/EnvelopeGenerator.Terminal/CommandManager.cs index dcbdf53d..44e1d473 100644 --- a/EnvelopeGenerator.Terminal/CommandManager.cs +++ b/EnvelopeGenerator.Terminal/CommandManager.cs @@ -14,5 +14,5 @@ public class CommandManager(IEnvelopeReceiverService envelopeReceiverService) } [Subcommand] - public IEnvelopeReceiverService EnvelopeReceiverService => envelopeReceiverService; + public IEnvelopeReceiverService EnvelopeReceiver => envelopeReceiverService; } diff --git a/EnvelopeGenerator.Terminal/DependencyInjection.cs b/EnvelopeGenerator.Terminal/DependencyInjection.cs index e233b5c3..f4161e04 100644 --- a/EnvelopeGenerator.Terminal/DependencyInjection.cs +++ b/EnvelopeGenerator.Terminal/DependencyInjection.cs @@ -41,7 +41,8 @@ public static class DependencyInjection return runner; }) .AddScoped() - .AddMemoryCache(); ; + .AddMemoryCache() + .AddLocalization(); } public static Task RunCommandManagerRunner(this IServiceProvider provider, string[] args) From 42a1016607b1c13e13208a614230abacfacd282e Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Mon, 14 Apr 2025 14:38:56 +0200 Subject: [PATCH 09/23] fix: Vereinfachung des Ziel-Frameworks in der Projektdatei Aktualisierte `EnvelopeGenerator.Web.csproj`, um ein einziges Ziel-Framework (`net7.0`) anstelle von mehreren Frameworks (`net7.0;net8.0;net9.0`) anzugeben, was die Projektkonfiguration vereinfacht. --- EnvelopeGenerator.Web/EnvelopeGenerator.Web.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EnvelopeGenerator.Web/EnvelopeGenerator.Web.csproj b/EnvelopeGenerator.Web/EnvelopeGenerator.Web.csproj index 7f65cc86..4afba015 100644 --- a/EnvelopeGenerator.Web/EnvelopeGenerator.Web.csproj +++ b/EnvelopeGenerator.Web/EnvelopeGenerator.Web.csproj @@ -1,7 +1,7 @@  - net7.0;net8.0;net9.0 + net7.0 enable enable EnvelopeGenerator.Web From d56aa1a7786b50a95a4e9df352189598c9503d03 Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Mon, 14 Apr 2025 15:18:47 +0200 Subject: [PATCH 10/23] Remove unused import in EnvelopeDocumentRepository.cs --- .../Repositories/EnvelopeDocumentRepository.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/EnvelopeGenerator.Infrastructure/Repositories/EnvelopeDocumentRepository.cs b/EnvelopeGenerator.Infrastructure/Repositories/EnvelopeDocumentRepository.cs index 153510f7..2f15f10f 100644 --- a/EnvelopeGenerator.Infrastructure/Repositories/EnvelopeDocumentRepository.cs +++ b/EnvelopeGenerator.Infrastructure/Repositories/EnvelopeDocumentRepository.cs @@ -1,5 +1,4 @@ using DigitalData.Core.Infrastructure; -using DigitalData.UserManager.Infrastructure.Repositories; using EnvelopeGenerator.Domain.Entities; using EnvelopeGenerator.Application.Contracts.Repositories; From 44aeb534134ebc856afea596493684ea051f4fac Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Mon, 14 Apr 2025 15:19:10 +0200 Subject: [PATCH 11/23] Refactor EnvelopeDocument class for clarity Adjusted namespace and reformatted class attributes for consistency. Moved `[Table]`, `[Key]`, `[DatabaseGenerated]`, and `[Column]` attributes to align with properties. The `Elements` property was also repositioned to enhance class structure readability. --- .../Entities/EnvelopeDocument.cs | 35 +++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/EnvelopeGenerator.Domain/Entities/EnvelopeDocument.cs b/EnvelopeGenerator.Domain/Entities/EnvelopeDocument.cs index 97723f0a..22aa3b2b 100644 --- a/EnvelopeGenerator.Domain/Entities/EnvelopeDocument.cs +++ b/EnvelopeGenerator.Domain/Entities/EnvelopeDocument.cs @@ -2,27 +2,26 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace EnvelopeGenerator.Domain.Entities +namespace EnvelopeGenerator.Domain.Entities; + +[Table("TBSIG_ENVELOPE_DOCUMENT", Schema = "dbo")] +public class EnvelopeDocument : IUnique { - [Table("TBSIG_ENVELOPE_DOCUMENT", Schema = "dbo")] - public class EnvelopeDocument : IUnique - { - [Key] - [DatabaseGenerated(DatabaseGeneratedOption.Identity)] - [Column("GUID")] - public int Id { get; set; } + [Key] + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + [Column("GUID")] + public int Id { get; set; } - [Required] - [Column("ENVELOPE_ID")] - public int EnvelopeId { get; set; } + [Required] + [Column("ENVELOPE_ID")] + public int EnvelopeId { get; set; } - [Required] - [Column("ADDED_WHEN", TypeName = "datetime")] - public required DateTime AddedWhen { get; set; } + [Required] + [Column("ADDED_WHEN", TypeName = "datetime")] + public required DateTime AddedWhen { get; set; } - [Column("BYTE_DATA", TypeName = "varbinary(max)")] - public byte[]? ByteData { get; init; } + [Column("BYTE_DATA", TypeName = "varbinary(max)")] + public byte[]? ByteData { get; init; } - public IEnumerable? Elements { get; set; } - } + public IEnumerable? Elements { get; set; } } \ No newline at end of file From 11f489655641c585c9289061ffc77adcc1a097db Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Mon, 14 Apr 2025 16:12:07 +0200 Subject: [PATCH 12/23] =?UTF-8?q?ReadDocumentQuery=20und=20Handler=20zum?= =?UTF-8?q?=20Abrufen=20von=20Dokumenten=20hinzuf=C3=BCgen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Führt die Struktur `ReadDocumentQuery` zur Abfrage von Dokumenten anhand ihrer eindeutigen Kennung oder der zugehörigen Umschlagkennung ein und implementiert die Schnittstelle `IRequest` von MediatR. Eine neue Handler-Klasse, `ReadDocumentQueryHandler`, wird erstellt, um die Abfrage zu verarbeiten, obwohl die Verarbeitungslogik noch nicht implementiert ist. Außerdem wird eine Antwortstruktur, `ReadDocumentResponse`, definiert, um die Daten zu kapseln, die beim Lesen eines Dokuments zurückgegeben werden, einschließlich der Eigenschaften für die ID des Dokuments, die Umschlag-ID, das Hinzufügedatum und die Binärdaten. Die erforderlichen Namespaces werden für die richtige Organisation und Funktionalität hinzugefügt. --- .../Queries/Read/ReadDocumentQuery.cs | 12 ++++++++++++ .../Queries/Read/ReadDocumentQueryHandler.cs | 19 +++++++++++++++++++ .../Queries/Read/ReadDocumentResponse.cs | 15 +++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 EnvelopeGenerator.Application/Documents/Queries/Read/ReadDocumentQuery.cs create mode 100644 EnvelopeGenerator.Application/Documents/Queries/Read/ReadDocumentQueryHandler.cs create mode 100644 EnvelopeGenerator.Application/Documents/Queries/Read/ReadDocumentResponse.cs diff --git a/EnvelopeGenerator.Application/Documents/Queries/Read/ReadDocumentQuery.cs b/EnvelopeGenerator.Application/Documents/Queries/Read/ReadDocumentQuery.cs new file mode 100644 index 00000000..9f05f21a --- /dev/null +++ b/EnvelopeGenerator.Application/Documents/Queries/Read/ReadDocumentQuery.cs @@ -0,0 +1,12 @@ +using MediatR; + +namespace EnvelopeGenerator.Application.Documents.Queries.Read; + +/// +/// Represents a query to read a document based on its unique identifier or associated envelope identifier. +/// +/// The unique identifier of the document. Optional. +/// The identifier of the envelope associated with the document. Optional. +public record ReadDocumentQuery(int? Id = null, int? EnvelopeId = null) : IRequest +{ +} diff --git a/EnvelopeGenerator.Application/Documents/Queries/Read/ReadDocumentQueryHandler.cs b/EnvelopeGenerator.Application/Documents/Queries/Read/ReadDocumentQueryHandler.cs new file mode 100644 index 00000000..af4e1a74 --- /dev/null +++ b/EnvelopeGenerator.Application/Documents/Queries/Read/ReadDocumentQueryHandler.cs @@ -0,0 +1,19 @@ +using EnvelopeGenerator.Application.Contracts.Repositories; +using MediatR; + +namespace EnvelopeGenerator.Application.Documents.Queries.Read; + +public class ReadDocumentQueryHandler : IRequestHandler +{ + public IEnvelopeDocumentRepository _repo; + + public ReadDocumentQueryHandler(IEnvelopeDocumentRepository envelopeDocumentRepository) + { + _repo = envelopeDocumentRepository; + } + + public Task Handle(ReadDocumentQuery query, CancellationToken cancellationToken) + { + throw new NotImplementedException(); + } +} diff --git a/EnvelopeGenerator.Application/Documents/Queries/Read/ReadDocumentResponse.cs b/EnvelopeGenerator.Application/Documents/Queries/Read/ReadDocumentResponse.cs new file mode 100644 index 00000000..7d9b6ea0 --- /dev/null +++ b/EnvelopeGenerator.Application/Documents/Queries/Read/ReadDocumentResponse.cs @@ -0,0 +1,15 @@ +namespace EnvelopeGenerator.Application.Documents.Queries.Read; + +/// +/// Represents the response for reading a document. +/// +/// The unique identifier of the document. +/// The identifier of the associated envelope. +/// The date and time when the document was added. +/// The binary data of the document, if available. +public record ReadDocumentResponse( + int Guid, + int EnvelopeId, + DateTime AddedWhen, + byte[]? ByteData +); \ No newline at end of file From ba4a57512f84b0ec3eec10749b081f4f04cdb848 Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Wed, 16 Apr 2025 14:25:57 +0200 Subject: [PATCH 13/23] =?UTF-8?q?Refaktorierung=20der=20Dienste=20und=20Ak?= =?UTF-8?q?tualisierung=20der=20Paketabh=C3=A4ngigkeiten?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Vereinfachte `IEnvelopeHistoryService`, `IEnvelopeReceiverReadOnlyService` und `IReceiverService` Schnittstellen durch Entfernung unnötiger generischer Parameter. - Aktualisierte `EnvelopeHistoryService`, `EnvelopeReceiverReadOnlyService` und `ReceiverService` Klassen, um sie an die Schnittstellenänderungen anzupassen. - Aktualisierte Paketverweise in mehreren Projektdateien, mit Schwerpunkt auf `DigitalData.Core` und `UserManager`. - Hinzufügen von `DbSet` zu `EGDbContext` und Einführung neuer privater Felder. - Verfeinerung von `TestControllerBase` durch Entfernung überflüssiger Typ-Parameter in Constraints. - Insgesamt verbessern diese Änderungen die Klarheit des Codes und gewährleisten die Kompatibilität mit aktualisierten Bibliotheken. --- .../Contracts/Services/IEnvelopeHistoryService.cs | 2 +- .../Services/IEnvelopeReceiverReadOnlyService.cs | 2 +- .../Contracts/Services/IReceiverService.cs | 2 +- .../EnvelopeGenerator.Application.csproj | 12 ++++++------ .../Services/EnvelopeHistoryService.cs | 2 +- .../Services/EnvelopeReceiverReadOnlyService.cs | 2 +- .../Services/ReceiverService.cs | 2 +- .../EnvelopeGenerator.Domain.csproj | 6 +++--- .../EnvelopeGenerator.GeneratorAPI.csproj | 5 +++-- EnvelopeGenerator.Infrastructure/EGDbContext.cs | 2 ++ .../EnvelopeGenerator.Infrastructure.csproj | 6 +++--- .../EnvelopeGenerator.Terminal.csproj | 3 +++ .../EnvelopeGenerator.Tests.Application.csproj | 3 +++ .../Controllers/Test/TestControllerBase.cs | 2 +- EnvelopeGenerator.Web/EnvelopeGenerator.Web.csproj | 9 +++++---- 15 files changed, 35 insertions(+), 25 deletions(-) diff --git a/EnvelopeGenerator.Application/Contracts/Services/IEnvelopeHistoryService.cs b/EnvelopeGenerator.Application/Contracts/Services/IEnvelopeHistoryService.cs index 04f7ed9e..9ef1bb4e 100644 --- a/EnvelopeGenerator.Application/Contracts/Services/IEnvelopeHistoryService.cs +++ b/EnvelopeGenerator.Application/Contracts/Services/IEnvelopeHistoryService.cs @@ -7,7 +7,7 @@ using static EnvelopeGenerator.Common.Constants; namespace EnvelopeGenerator.Application.Contracts.Services; -public interface IEnvelopeHistoryService : ICRUDService +public interface IEnvelopeHistoryService : ICRUDService { Task CountAsync(int? envelopeId = null, string? userReference = null, int? status = null); diff --git a/EnvelopeGenerator.Application/Contracts/Services/IEnvelopeReceiverReadOnlyService.cs b/EnvelopeGenerator.Application/Contracts/Services/IEnvelopeReceiverReadOnlyService.cs index 2e4cee14..22e27811 100644 --- a/EnvelopeGenerator.Application/Contracts/Services/IEnvelopeReceiverReadOnlyService.cs +++ b/EnvelopeGenerator.Application/Contracts/Services/IEnvelopeReceiverReadOnlyService.cs @@ -4,6 +4,6 @@ using EnvelopeGenerator.Domain.Entities; namespace EnvelopeGenerator.Application.Contracts.Services; -public interface IEnvelopeReceiverReadOnlyService : ICRUDService +public interface IEnvelopeReceiverReadOnlyService : ICRUDService { } \ No newline at end of file diff --git a/EnvelopeGenerator.Application/Contracts/Services/IReceiverService.cs b/EnvelopeGenerator.Application/Contracts/Services/IReceiverService.cs index 70702642..f56a7958 100644 --- a/EnvelopeGenerator.Application/Contracts/Services/IReceiverService.cs +++ b/EnvelopeGenerator.Application/Contracts/Services/IReceiverService.cs @@ -6,7 +6,7 @@ using EnvelopeGenerator.Domain.Entities; namespace EnvelopeGenerator.Application.Contracts.Services; -public interface IReceiverService : ICRUDService +public interface IReceiverService : ICRUDService { Task> ReadByAsync(string? emailAddress = null, string? signature = null); diff --git a/EnvelopeGenerator.Application/EnvelopeGenerator.Application.csproj b/EnvelopeGenerator.Application/EnvelopeGenerator.Application.csproj index 246f9551..8629362f 100644 --- a/EnvelopeGenerator.Application/EnvelopeGenerator.Application.csproj +++ b/EnvelopeGenerator.Application/EnvelopeGenerator.Application.csproj @@ -14,18 +14,18 @@ - - + + - - + + - - + + diff --git a/EnvelopeGenerator.Application/Services/EnvelopeHistoryService.cs b/EnvelopeGenerator.Application/Services/EnvelopeHistoryService.cs index a5d97c3b..9d0bc453 100644 --- a/EnvelopeGenerator.Application/Services/EnvelopeHistoryService.cs +++ b/EnvelopeGenerator.Application/Services/EnvelopeHistoryService.cs @@ -10,7 +10,7 @@ using EnvelopeGenerator.Application.Contracts.Services; namespace EnvelopeGenerator.Application.Services; -public class EnvelopeHistoryService : CRUDService, IEnvelopeHistoryService +public class EnvelopeHistoryService : CRUDService, IEnvelopeHistoryService { public EnvelopeHistoryService(IEnvelopeHistoryRepository repository, IMapper mapper) : base(repository, mapper) diff --git a/EnvelopeGenerator.Application/Services/EnvelopeReceiverReadOnlyService.cs b/EnvelopeGenerator.Application/Services/EnvelopeReceiverReadOnlyService.cs index aa4d11da..74746ee5 100644 --- a/EnvelopeGenerator.Application/Services/EnvelopeReceiverReadOnlyService.cs +++ b/EnvelopeGenerator.Application/Services/EnvelopeReceiverReadOnlyService.cs @@ -7,7 +7,7 @@ using EnvelopeGenerator.Application.Contracts.Repositories; namespace EnvelopeGenerator.Application.Services; -public class EnvelopeReceiverReadOnlyService : CRUDService, IEnvelopeReceiverReadOnlyService +public class EnvelopeReceiverReadOnlyService : CRUDService, IEnvelopeReceiverReadOnlyService { public EnvelopeReceiverReadOnlyService(IEnvelopeReceiverReadOnlyRepository repository, IMapper mapper) : base(repository, mapper) { diff --git a/EnvelopeGenerator.Application/Services/ReceiverService.cs b/EnvelopeGenerator.Application/Services/ReceiverService.cs index 98b6a58b..2b587daa 100644 --- a/EnvelopeGenerator.Application/Services/ReceiverService.cs +++ b/EnvelopeGenerator.Application/Services/ReceiverService.cs @@ -10,7 +10,7 @@ using EnvelopeGenerator.Application.Contracts.Services; namespace EnvelopeGenerator.Application.Services; -public class ReceiverService : CRUDService, IReceiverService +public class ReceiverService : CRUDService, IReceiverService { public ReceiverService(IReceiverRepository repository, IMapper mapper) : base(repository, mapper) diff --git a/EnvelopeGenerator.Domain/EnvelopeGenerator.Domain.csproj b/EnvelopeGenerator.Domain/EnvelopeGenerator.Domain.csproj index 7827d6d6..4578af3d 100644 --- a/EnvelopeGenerator.Domain/EnvelopeGenerator.Domain.csproj +++ b/EnvelopeGenerator.Domain/EnvelopeGenerator.Domain.csproj @@ -7,9 +7,9 @@ - - - + + + diff --git a/EnvelopeGenerator.GeneratorAPI/EnvelopeGenerator.GeneratorAPI.csproj b/EnvelopeGenerator.GeneratorAPI/EnvelopeGenerator.GeneratorAPI.csproj index e20cd48a..772400d9 100644 --- a/EnvelopeGenerator.GeneratorAPI/EnvelopeGenerator.GeneratorAPI.csproj +++ b/EnvelopeGenerator.GeneratorAPI/EnvelopeGenerator.GeneratorAPI.csproj @@ -19,8 +19,9 @@ - - + + + diff --git a/EnvelopeGenerator.Infrastructure/EGDbContext.cs b/EnvelopeGenerator.Infrastructure/EGDbContext.cs index 7772a47a..89bf900f 100644 --- a/EnvelopeGenerator.Infrastructure/EGDbContext.cs +++ b/EnvelopeGenerator.Infrastructure/EGDbContext.cs @@ -57,6 +57,8 @@ public class EGDbContext : DbContext, IUserManagerDbContext, IMailDbContext public DbSet EnvelopeReceiverReadOnlys { get; set; } + public DbSet ClientUsers { get; set; } + private readonly DbTriggerParams _triggers; private readonly ILogger _logger; diff --git a/EnvelopeGenerator.Infrastructure/EnvelopeGenerator.Infrastructure.csproj b/EnvelopeGenerator.Infrastructure/EnvelopeGenerator.Infrastructure.csproj index 9f46ea48..6dd20eb3 100644 --- a/EnvelopeGenerator.Infrastructure/EnvelopeGenerator.Infrastructure.csproj +++ b/EnvelopeGenerator.Infrastructure/EnvelopeGenerator.Infrastructure.csproj @@ -7,16 +7,16 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/EnvelopeGenerator.Terminal/EnvelopeGenerator.Terminal.csproj b/EnvelopeGenerator.Terminal/EnvelopeGenerator.Terminal.csproj index d50253f1..9443c948 100644 --- a/EnvelopeGenerator.Terminal/EnvelopeGenerator.Terminal.csproj +++ b/EnvelopeGenerator.Terminal/EnvelopeGenerator.Terminal.csproj @@ -21,6 +21,9 @@ + + + diff --git a/EnvelopeGenerator.Tests.Application/EnvelopeGenerator.Tests.Application.csproj b/EnvelopeGenerator.Tests.Application/EnvelopeGenerator.Tests.Application.csproj index b9626bf8..49d2cd76 100644 --- a/EnvelopeGenerator.Tests.Application/EnvelopeGenerator.Tests.Application.csproj +++ b/EnvelopeGenerator.Tests.Application/EnvelopeGenerator.Tests.Application.csproj @@ -23,6 +23,9 @@ + + + diff --git a/EnvelopeGenerator.Web/Controllers/Test/TestControllerBase.cs b/EnvelopeGenerator.Web/Controllers/Test/TestControllerBase.cs index b92ae934..9e81ac1f 100644 --- a/EnvelopeGenerator.Web/Controllers/Test/TestControllerBase.cs +++ b/EnvelopeGenerator.Web/Controllers/Test/TestControllerBase.cs @@ -8,7 +8,7 @@ namespace EnvelopeGenerator.Web.Controllers.Test [ApiController] [Route("api/test/[controller]")] public class TestControllerBase : BasicCRUDControllerBase - where TCRUDService : ICRUDService + where TCRUDService : ICRUDService where TDto : class, IUnique where TEntity : class, IUnique { public TestControllerBase(ILogger logger, TCRUDService service) : base(logger, service) diff --git a/EnvelopeGenerator.Web/EnvelopeGenerator.Web.csproj b/EnvelopeGenerator.Web/EnvelopeGenerator.Web.csproj index 4afba015..ce65a217 100644 --- a/EnvelopeGenerator.Web/EnvelopeGenerator.Web.csproj +++ b/EnvelopeGenerator.Web/EnvelopeGenerator.Web.csproj @@ -2101,9 +2101,10 @@ - - - + + + + @@ -2131,7 +2132,7 @@ - + From 4d34eb7adc43109f02b62a2f21ba01befdbaeee8 Mon Sep 17 00:00:00 2001 From: OlgunR Date: Tue, 22 Apr 2025 10:26:03 +0200 Subject: [PATCH 14/23] Funktion zur Behebung der Rotation - Class EnvelopeEditorController, Class FixPageRotation --- .../Controllers/EnvelopeEditorController.vb | 8 +++- .../EnvelopeGenerator.Form.vbproj | 1 + .../Helper/FixPageRotation.vb | 48 +++++++++++++++++++ 3 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 EnvelopeGenerator.Form/Helper/FixPageRotation.vb diff --git a/EnvelopeGenerator.Form/Controllers/EnvelopeEditorController.vb b/EnvelopeGenerator.Form/Controllers/EnvelopeEditorController.vb index fffe99c4..b26eec0a 100644 --- a/EnvelopeGenerator.Form/Controllers/EnvelopeEditorController.vb +++ b/EnvelopeGenerator.Form/Controllers/EnvelopeEditorController.vb @@ -156,7 +156,11 @@ Public Class EnvelopeEditorController Public Async Function CreateDocument(pDocumentFilePath As String) As Threading.Tasks.Task(Of EnvelopeDocument) Try - Dim oFileInfo = New FileInfo(pDocumentFilePath) + Dim oFixedPath = FixPageRotation.FixPageRotation(pDocumentFilePath) + If oFixedPath <> pDocumentFilePath Then + Logger.Info("PageRotation has been reseted to 0.") + End If + Dim oFileInfo = New FileInfo(oFixedPath) Dim oTempFiles As New TempFiles(State.LogConfig) Dim oTempFilePath = Path.Combine(oTempFiles._TempPath, Guid.NewGuid().ToString + oFileInfo.Extension) @@ -172,7 +176,7 @@ Public Class EnvelopeEditorController .FileNameOriginal = oFileInfo.Name, .Thumbnail = Thumbnail.GetThumbnailFromPDFFile(oTempFilePath), .PageCount = Thumbnail.GetPageCount(oTempFilePath), - .Byte_Data = ReadFile(pDocumentFilePath) + .Byte_Data = ReadFile(oFixedPath) } Return oDocument diff --git a/EnvelopeGenerator.Form/EnvelopeGenerator.Form.vbproj b/EnvelopeGenerator.Form/EnvelopeGenerator.Form.vbproj index 789eba38..869f1ee8 100644 --- a/EnvelopeGenerator.Form/EnvelopeGenerator.Form.vbproj +++ b/EnvelopeGenerator.Form/EnvelopeGenerator.Form.vbproj @@ -362,6 +362,7 @@ Form + diff --git a/EnvelopeGenerator.Form/Helper/FixPageRotation.vb b/EnvelopeGenerator.Form/Helper/FixPageRotation.vb new file mode 100644 index 00000000..58c7a8c9 --- /dev/null +++ b/EnvelopeGenerator.Form/Helper/FixPageRotation.vb @@ -0,0 +1,48 @@ +Imports System.IO +Imports GdPicture14 + +Public Class FixPageRotation + ''' + ''' Checks if there are any rotations in the document. If so, normalizes the page rotation to 0 without affecting its visual appearance. + ''' Creates and uses a new document with the corrected properties. + ''' Fixes the issue of annotations being rotated to match the page's rotation. + ''' + ''' + ''' + Public Shared Function FixPageRotation(pFilePath As String) As String + + Dim oFolder As String = Path.GetDirectoryName(pFilePath) + Dim oChanged As Boolean = False + + Using gdpicturePDF As New GdPicturePDF() + + Dim status As GdPictureStatus = gdpicturePDF.LoadFromFile(pFilePath, True) + If status = GdPictureStatus.OK Then + + Dim count As Integer = gdpicturePDF.GetPageCount() + For i As Integer = 1 To count + If gdpicturePDF.SelectPage(i) = GdPictureStatus.OK Then + Dim rotation As Integer = gdpicturePDF.GetPageRotation() + If rotation <> 0 Then + gdpicturePDF.NormalizePage() + oChanged = True + End If + End If + Next + + End If + + If oChanged Then + Dim newFilesPath As String = Path.Combine(oFolder, "RotationFixed_" & Path.GetFileName(pFilePath)) + If gdpicturePDF.SaveToFile(newFilesPath) = GdPictureStatus.OK Then + Return newFilesPath + End If + End If + + End Using + + Return pFilePath + + End Function + +End Class From d3db1e74fa9a009d83ff2834eaea9c15a67dd243 Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Tue, 22 Apr 2025 21:06:36 +0200 Subject: [PATCH 15/23] chore: aktualisierte Baget-Pakete --- .../EnvelopeGenerator.Application.csproj | 17 ++++++------ .../EnvelopeGenerator.Domain.csproj | 6 ++--- .../EnvelopeGenerator.GeneratorAPI.csproj | 26 ++++++++++++++++-- EnvelopeGenerator.GeneratorAPI/Program.cs | 3 ++- .../EnvelopeGenerator.Infrastructure.csproj | 27 ++++++++++++------- .../EnvelopeGenerator.Terminal.csproj | 9 ++++--- ...EnvelopeGenerator.Tests.Application.csproj | 4 +-- .../EnvelopeGenerator.Web.csproj | 7 +++-- 8 files changed, 66 insertions(+), 33 deletions(-) diff --git a/EnvelopeGenerator.Application/EnvelopeGenerator.Application.csproj b/EnvelopeGenerator.Application/EnvelopeGenerator.Application.csproj index 8629362f..51b45346 100644 --- a/EnvelopeGenerator.Application/EnvelopeGenerator.Application.csproj +++ b/EnvelopeGenerator.Application/EnvelopeGenerator.Application.csproj @@ -13,9 +13,8 @@ - - - + + @@ -24,8 +23,7 @@ - - + @@ -61,18 +59,21 @@ - - 7.0.5 - + + + 7.0.5 + + 8.1.1 + 8.1.1 diff --git a/EnvelopeGenerator.Domain/EnvelopeGenerator.Domain.csproj b/EnvelopeGenerator.Domain/EnvelopeGenerator.Domain.csproj index 4578af3d..c7f0b01d 100644 --- a/EnvelopeGenerator.Domain/EnvelopeGenerator.Domain.csproj +++ b/EnvelopeGenerator.Domain/EnvelopeGenerator.Domain.csproj @@ -1,4 +1,4 @@ - + net7.0;net8.0;net9.0 @@ -7,9 +7,9 @@ - + - + diff --git a/EnvelopeGenerator.GeneratorAPI/EnvelopeGenerator.GeneratorAPI.csproj b/EnvelopeGenerator.GeneratorAPI/EnvelopeGenerator.GeneratorAPI.csproj index 772400d9..8fcf50f7 100644 --- a/EnvelopeGenerator.GeneratorAPI/EnvelopeGenerator.GeneratorAPI.csproj +++ b/EnvelopeGenerator.GeneratorAPI/EnvelopeGenerator.GeneratorAPI.csproj @@ -19,17 +19,39 @@ - + - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EnvelopeGenerator.GeneratorAPI/Program.cs b/EnvelopeGenerator.GeneratorAPI/Program.cs index 1ff1f7c4..c55e3b7a 100644 --- a/EnvelopeGenerator.GeneratorAPI/Program.cs +++ b/EnvelopeGenerator.GeneratorAPI/Program.cs @@ -9,6 +9,7 @@ using Microsoft.EntityFrameworkCore; using System.Globalization; using Scalar.AspNetCore; using Microsoft.OpenApi.Models; +using DigitalData.UserManager.DependencyInjection; var builder = WebApplication.CreateBuilder(args); @@ -101,7 +102,7 @@ builder.Services.AddUserManager(); // LDAP builder.ConfigureBySection(); -builder.Services.AddDirectorySearchService(); +builder.Services.AddDirectorySearchService(config.GetSection("DirectorySearchOptions")); // Localizer builder.Services.AddCookieBasedLocalizer() ; diff --git a/EnvelopeGenerator.Infrastructure/EnvelopeGenerator.Infrastructure.csproj b/EnvelopeGenerator.Infrastructure/EnvelopeGenerator.Infrastructure.csproj index 6dd20eb3..8c1b0b2d 100644 --- a/EnvelopeGenerator.Infrastructure/EnvelopeGenerator.Infrastructure.csproj +++ b/EnvelopeGenerator.Infrastructure/EnvelopeGenerator.Infrastructure.csproj @@ -7,21 +7,30 @@ - - + + - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + + + + + + + + + + + + + + diff --git a/EnvelopeGenerator.Terminal/EnvelopeGenerator.Terminal.csproj b/EnvelopeGenerator.Terminal/EnvelopeGenerator.Terminal.csproj index 9443c948..ec64e2f1 100644 --- a/EnvelopeGenerator.Terminal/EnvelopeGenerator.Terminal.csproj +++ b/EnvelopeGenerator.Terminal/EnvelopeGenerator.Terminal.csproj @@ -21,15 +21,16 @@ - + - + + - + - + diff --git a/EnvelopeGenerator.Tests.Application/EnvelopeGenerator.Tests.Application.csproj b/EnvelopeGenerator.Tests.Application/EnvelopeGenerator.Tests.Application.csproj index 49d2cd76..c6abb4a3 100644 --- a/EnvelopeGenerator.Tests.Application/EnvelopeGenerator.Tests.Application.csproj +++ b/EnvelopeGenerator.Tests.Application/EnvelopeGenerator.Tests.Application.csproj @@ -23,9 +23,9 @@ - + - + diff --git a/EnvelopeGenerator.Web/EnvelopeGenerator.Web.csproj b/EnvelopeGenerator.Web/EnvelopeGenerator.Web.csproj index ce65a217..b1ba17ce 100644 --- a/EnvelopeGenerator.Web/EnvelopeGenerator.Web.csproj +++ b/EnvelopeGenerator.Web/EnvelopeGenerator.Web.csproj @@ -2101,16 +2101,16 @@ - + - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -2132,7 +2132,6 @@ - From 45d39069aa3629e2a45e52e85b27cda6eb86c6e8 Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Tue, 22 Apr 2025 21:23:16 +0200 Subject: [PATCH 16/23] =?UTF-8?q?feat(infrastructure):=20generisches=20Rep?= =?UTF-8?q?ository=20mit=20AutoMapper-Unterst=C3=BCtzung=20integriert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - DbRepository-Registrierungen für alle Umschlag-bezogenen Entitäten mit DigitalData.Core-Infrastruktur und AutoMapper-Integration hinzugefügt. Ermöglicht optimierten Datenzugriff und Mapping-Konfiguration. --- .../DIExtensions.cs | 19 +++++++++++++++++-- .../EnvelopeGenerator.Infrastructure.csproj | 1 + 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/EnvelopeGenerator.Infrastructure/DIExtensions.cs b/EnvelopeGenerator.Infrastructure/DIExtensions.cs index 0f6b7485..c457d264 100644 --- a/EnvelopeGenerator.Infrastructure/DIExtensions.cs +++ b/EnvelopeGenerator.Infrastructure/DIExtensions.cs @@ -3,6 +3,9 @@ using EnvelopeGenerator.Infrastructure.Repositories; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.EntityFrameworkCore; +using DigitalData.Core.Infrastructure; +using EnvelopeGenerator.Domain.Entities; +using DigitalData.Core.Infrastructure.AutoMapper; namespace EnvelopeGenerator.Infrastructure; @@ -30,13 +33,11 @@ public static class DIExtensions services.TryAddScoped(); services.TryAddScoped(); services.TryAddScoped(); - services.TryAddScoped(); services.TryAddScoped(); services.TryAddScoped(); services.TryAddScoped(); services.TryAddScoped(); services.TryAddScoped(); - services.TryAddScoped(); services.TryAddScoped(); services.TryAddScoped(); services.TryAddScoped(); @@ -44,6 +45,20 @@ public static class DIExtensions services.TryAddScoped(); services.TryAddScoped(); + services.AddDbRepository(context => context.Configs).UseAutoMapper(); + services.AddDbRepository(context => context.DocumentReceiverElements).UseAutoMapper(); + services.AddDbRepository(context => context.EnvelopeDocument).UseAutoMapper(); + services.AddDbRepository(context => context.DocumentStatus).UseAutoMapper(); + services.AddDbRepository(context => context.EmailTemplate).UseAutoMapper(); + services.AddDbRepository(context => context.Envelopes).UseAutoMapper(); + services.AddDbRepository(context => context.EnvelopeCertificates).UseAutoMapper(); + services.AddDbRepository(context => context.EnvelopeHistories).UseAutoMapper(); + services.AddDbRepository(context => context.EnvelopeReceivers).UseAutoMapper(); + services.AddDbRepository(context => context.EnvelopeTypes).UseAutoMapper(); + services.AddDbRepository(context => context.Receivers).UseAutoMapper(); + services.AddDbRepository(context => context.UserReceivers).UseAutoMapper(); + services.AddDbRepository(context => context.EnvelopeReceiverReadOnlys).UseAutoMapper(); + return services; } } diff --git a/EnvelopeGenerator.Infrastructure/EnvelopeGenerator.Infrastructure.csproj b/EnvelopeGenerator.Infrastructure/EnvelopeGenerator.Infrastructure.csproj index 8c1b0b2d..bf0554ea 100644 --- a/EnvelopeGenerator.Infrastructure/EnvelopeGenerator.Infrastructure.csproj +++ b/EnvelopeGenerator.Infrastructure/EnvelopeGenerator.Infrastructure.csproj @@ -9,6 +9,7 @@ + From 975beff41676243282d9cf4c7fcac187e651bff5 Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Tue, 22 Apr 2025 23:16:22 +0200 Subject: [PATCH 17/23] =?UTF-8?q?feat(ReadDocumentQueryHandler):=20Logik?= =?UTF-8?q?=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Queries/Read/ReadDocumentQuery.cs | 2 +- .../Queries/Read/ReadDocumentQueryHandler.cs | 41 ++++++++++++++++--- .../EnvelopeGenerator.Application.csproj | 2 +- .../EnvelopeGenerator.Domain.csproj | 2 +- .../EnvelopeGenerator.GeneratorAPI.csproj | 2 +- .../EnvelopeGenerator.Infrastructure.csproj | 6 +-- .../EnvelopeGenerator.Terminal.csproj | 2 +- ...EnvelopeGenerator.Tests.Application.csproj | 2 +- .../EnvelopeGenerator.Web.csproj | 2 +- 9 files changed, 45 insertions(+), 16 deletions(-) diff --git a/EnvelopeGenerator.Application/Documents/Queries/Read/ReadDocumentQuery.cs b/EnvelopeGenerator.Application/Documents/Queries/Read/ReadDocumentQuery.cs index 9f05f21a..be3fc0c6 100644 --- a/EnvelopeGenerator.Application/Documents/Queries/Read/ReadDocumentQuery.cs +++ b/EnvelopeGenerator.Application/Documents/Queries/Read/ReadDocumentQuery.cs @@ -7,6 +7,6 @@ namespace EnvelopeGenerator.Application.Documents.Queries.Read; /// /// The unique identifier of the document. Optional. /// The identifier of the envelope associated with the document. Optional. -public record ReadDocumentQuery(int? Id = null, int? EnvelopeId = null) : IRequest +public record ReadDocumentQuery(int? Id = null, int? EnvelopeId = null) : IRequest { } diff --git a/EnvelopeGenerator.Application/Documents/Queries/Read/ReadDocumentQueryHandler.cs b/EnvelopeGenerator.Application/Documents/Queries/Read/ReadDocumentQueryHandler.cs index af4e1a74..b6e7d636 100644 --- a/EnvelopeGenerator.Application/Documents/Queries/Read/ReadDocumentQueryHandler.cs +++ b/EnvelopeGenerator.Application/Documents/Queries/Read/ReadDocumentQueryHandler.cs @@ -1,19 +1,48 @@ -using EnvelopeGenerator.Application.Contracts.Repositories; +using DigitalData.Core.Abstractions.Infrastructure; +using EnvelopeGenerator.Application.Contracts.Repositories; +using EnvelopeGenerator.Domain.Entities; using MediatR; namespace EnvelopeGenerator.Application.Documents.Queries.Read; -public class ReadDocumentQueryHandler : IRequestHandler +/// +/// Handles queries for reading data based on either the document ID or the envelope ID. +/// +public class ReadDocumentQueryHandler : IRequestHandler { - public IEnvelopeDocumentRepository _repo; + /// + /// Repository for accessing entities. + /// + private readonly IRepository _repo; - public ReadDocumentQueryHandler(IEnvelopeDocumentRepository envelopeDocumentRepository) + /// + /// Initializes a new instance of the class. + /// + /// The repository used to access entities. + public ReadDocumentQueryHandler(IRepository envelopeDocumentRepository) { _repo = envelopeDocumentRepository; } - public Task Handle(ReadDocumentQuery query, CancellationToken cancellationToken) + /// + /// Handles the and returns a based on the provided identifiers. + /// + /// The query containing the document ID or envelope ID to search for. + /// A token to monitor for cancellation requests. + /// + /// A if a matching document is found; otherwise, null. + /// + /// + /// Thrown when neither nor is provided. + /// + public async Task Handle(ReadDocumentQuery query, CancellationToken cancellationToken) { - throw new NotImplementedException(); + if (query.Id is not null) + return await _repo.ReadOrDefaultAsync(d => d.Id == query.Id); + else if (query.EnvelopeId is not null) + return await _repo.ReadOrDefaultAsync(d => d.EnvelopeId == query.EnvelopeId); + + throw new InvalidOperationException( + $"Invalid {nameof(ReadDocumentQuery)}: either {nameof(query.Id)} or {nameof(query.EnvelopeId)} must be provided."); } } diff --git a/EnvelopeGenerator.Application/EnvelopeGenerator.Application.csproj b/EnvelopeGenerator.Application/EnvelopeGenerator.Application.csproj index 51b45346..c1eebe8f 100644 --- a/EnvelopeGenerator.Application/EnvelopeGenerator.Application.csproj +++ b/EnvelopeGenerator.Application/EnvelopeGenerator.Application.csproj @@ -13,7 +13,7 @@ - + diff --git a/EnvelopeGenerator.Domain/EnvelopeGenerator.Domain.csproj b/EnvelopeGenerator.Domain/EnvelopeGenerator.Domain.csproj index c7f0b01d..8a430d70 100644 --- a/EnvelopeGenerator.Domain/EnvelopeGenerator.Domain.csproj +++ b/EnvelopeGenerator.Domain/EnvelopeGenerator.Domain.csproj @@ -7,7 +7,7 @@ - + diff --git a/EnvelopeGenerator.GeneratorAPI/EnvelopeGenerator.GeneratorAPI.csproj b/EnvelopeGenerator.GeneratorAPI/EnvelopeGenerator.GeneratorAPI.csproj index 8fcf50f7..6cf235f1 100644 --- a/EnvelopeGenerator.GeneratorAPI/EnvelopeGenerator.GeneratorAPI.csproj +++ b/EnvelopeGenerator.GeneratorAPI/EnvelopeGenerator.GeneratorAPI.csproj @@ -28,7 +28,7 @@ - + diff --git a/EnvelopeGenerator.Infrastructure/EnvelopeGenerator.Infrastructure.csproj b/EnvelopeGenerator.Infrastructure/EnvelopeGenerator.Infrastructure.csproj index bf0554ea..f18a5f72 100644 --- a/EnvelopeGenerator.Infrastructure/EnvelopeGenerator.Infrastructure.csproj +++ b/EnvelopeGenerator.Infrastructure/EnvelopeGenerator.Infrastructure.csproj @@ -7,9 +7,9 @@ - - - + + + diff --git a/EnvelopeGenerator.Terminal/EnvelopeGenerator.Terminal.csproj b/EnvelopeGenerator.Terminal/EnvelopeGenerator.Terminal.csproj index ec64e2f1..323f96d0 100644 --- a/EnvelopeGenerator.Terminal/EnvelopeGenerator.Terminal.csproj +++ b/EnvelopeGenerator.Terminal/EnvelopeGenerator.Terminal.csproj @@ -21,7 +21,7 @@ - + diff --git a/EnvelopeGenerator.Tests.Application/EnvelopeGenerator.Tests.Application.csproj b/EnvelopeGenerator.Tests.Application/EnvelopeGenerator.Tests.Application.csproj index c6abb4a3..fecfd0e4 100644 --- a/EnvelopeGenerator.Tests.Application/EnvelopeGenerator.Tests.Application.csproj +++ b/EnvelopeGenerator.Tests.Application/EnvelopeGenerator.Tests.Application.csproj @@ -23,7 +23,7 @@ - + diff --git a/EnvelopeGenerator.Web/EnvelopeGenerator.Web.csproj b/EnvelopeGenerator.Web/EnvelopeGenerator.Web.csproj index b1ba17ce..7b50de3b 100644 --- a/EnvelopeGenerator.Web/EnvelopeGenerator.Web.csproj +++ b/EnvelopeGenerator.Web/EnvelopeGenerator.Web.csproj @@ -2101,7 +2101,7 @@ - + From 8785505a91d819aa7cb288b51317f94892f368f9 Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Tue, 22 Apr 2025 23:47:30 +0200 Subject: [PATCH 18/23] feat(CommandManager): Add ReadDocument command. --- .../Queries/Read/ReadDocumentQueryHandler.cs | 1 - .../EnvelopeGenerator.Application.csproj | 3 ++- .../Extensions/DIExtensions.cs | 15 +++++++++++++++ EnvelopeGenerator.Terminal/CommandManager.cs | 18 +++++++++++++++++- .../EnvelopeGenerator.Terminal.csproj | 2 -- 5 files changed, 34 insertions(+), 5 deletions(-) diff --git a/EnvelopeGenerator.Application/Documents/Queries/Read/ReadDocumentQueryHandler.cs b/EnvelopeGenerator.Application/Documents/Queries/Read/ReadDocumentQueryHandler.cs index b6e7d636..f27cfa1a 100644 --- a/EnvelopeGenerator.Application/Documents/Queries/Read/ReadDocumentQueryHandler.cs +++ b/EnvelopeGenerator.Application/Documents/Queries/Read/ReadDocumentQueryHandler.cs @@ -1,5 +1,4 @@ using DigitalData.Core.Abstractions.Infrastructure; -using EnvelopeGenerator.Application.Contracts.Repositories; using EnvelopeGenerator.Domain.Entities; using MediatR; diff --git a/EnvelopeGenerator.Application/EnvelopeGenerator.Application.csproj b/EnvelopeGenerator.Application/EnvelopeGenerator.Application.csproj index c1eebe8f..f032eed8 100644 --- a/EnvelopeGenerator.Application/EnvelopeGenerator.Application.csproj +++ b/EnvelopeGenerator.Application/EnvelopeGenerator.Application.csproj @@ -18,8 +18,9 @@ - + + diff --git a/EnvelopeGenerator.Application/Extensions/DIExtensions.cs b/EnvelopeGenerator.Application/Extensions/DIExtensions.cs index 37579d98..7ae3869b 100644 --- a/EnvelopeGenerator.Application/Extensions/DIExtensions.cs +++ b/EnvelopeGenerator.Application/Extensions/DIExtensions.cs @@ -8,11 +8,21 @@ using Microsoft.Extensions.DependencyInjection.Extensions; using DigitalData.Core.Client; using QRCoder; using EnvelopeGenerator.Application.Contracts.Services; +using System.Reflection; namespace EnvelopeGenerator.Application.Extensions; +/// +/// Extensions method for dependency injection +/// public static class DIExtensions { + /// + /// Adds all required services for envelope generator application + /// + /// + /// + /// public static IServiceCollection AddEnvelopeGeneratorServices(this IServiceCollection services, IConfiguration config) { //Inject CRUD Service and repositoriesad @@ -47,6 +57,11 @@ public static class DIExtensions services.TryAddSingleton(); services.TryAddSingleton(); + services.AddMediatR(cfg => + { + cfg.RegisterServicesFromAssembly(Assembly.GetExecutingAssembly()); + }); + return services; } } \ No newline at end of file diff --git a/EnvelopeGenerator.Terminal/CommandManager.cs b/EnvelopeGenerator.Terminal/CommandManager.cs index 44e1d473..4d558e59 100644 --- a/EnvelopeGenerator.Terminal/CommandManager.cs +++ b/EnvelopeGenerator.Terminal/CommandManager.cs @@ -1,11 +1,19 @@ using CommandDotNet; using EnvelopeGenerator.Application.Contracts.Services; +using EnvelopeGenerator.Application.Documents.Queries.Read; +using MediatR; using System.Reflection; +using System.Text.Json; namespace EnvelopeGenerator.Terminal; -public class CommandManager(IEnvelopeReceiverService envelopeReceiverService) +public class CommandManager(IEnvelopeReceiverService envelopeReceiverService, IMediator mediator) { + private static JsonSerializerOptions Options = new () + { + WriteIndented = true // <-- Bu satır okunabilir JSON için önemli + }; + [DefaultCommand] public void Execute([Option(Description = "print envelope generator termianal version.")] bool version) { @@ -15,4 +23,12 @@ public class CommandManager(IEnvelopeReceiverService envelopeReceiverService) [Subcommand] public IEnvelopeReceiverService EnvelopeReceiver => envelopeReceiverService; + + [Command] + public async Task ReadDocument(IConsole console, int? id = null, int? envelopeId = null) + { + ReadDocumentQuery query = new(id, envelopeId); + var document = await mediator.Send(query); + console.WriteLine(JsonSerializer.Serialize(document, Options)); + } } diff --git a/EnvelopeGenerator.Terminal/EnvelopeGenerator.Terminal.csproj b/EnvelopeGenerator.Terminal/EnvelopeGenerator.Terminal.csproj index 323f96d0..0fc313f8 100644 --- a/EnvelopeGenerator.Terminal/EnvelopeGenerator.Terminal.csproj +++ b/EnvelopeGenerator.Terminal/EnvelopeGenerator.Terminal.csproj @@ -5,8 +5,6 @@ net8.0 enable enable - true - true From 97dcc0f0a1b612f5cfdd3f7393ca8f97a3fe9b07 Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Wed, 23 Apr 2025 00:01:57 +0200 Subject: [PATCH 19/23] feat(ReadDocumentMappingProfile): Added mapping profile of ReadDocumentResponse --- .../Read/ReadDocumentMappingProfile.cs | 18 +++++++++++ .../Queries/Read/ReadDocumentResponse.cs | 32 +++++++++++++------ .../Extensions/DIExtensions.cs | 3 +- 3 files changed, 41 insertions(+), 12 deletions(-) create mode 100644 EnvelopeGenerator.Application/Documents/Queries/Read/ReadDocumentMappingProfile.cs diff --git a/EnvelopeGenerator.Application/Documents/Queries/Read/ReadDocumentMappingProfile.cs b/EnvelopeGenerator.Application/Documents/Queries/Read/ReadDocumentMappingProfile.cs new file mode 100644 index 00000000..ac9c9b18 --- /dev/null +++ b/EnvelopeGenerator.Application/Documents/Queries/Read/ReadDocumentMappingProfile.cs @@ -0,0 +1,18 @@ +using AutoMapper; +using EnvelopeGenerator.Domain.Entities; + +namespace EnvelopeGenerator.Application.Documents.Queries.Read; + +/// +/// +/// +public class ReadDocumentMappingProfile : Profile +{ + /// + /// + /// + public ReadDocumentMappingProfile() + { + CreateMap(); + } +} diff --git a/EnvelopeGenerator.Application/Documents/Queries/Read/ReadDocumentResponse.cs b/EnvelopeGenerator.Application/Documents/Queries/Read/ReadDocumentResponse.cs index 7d9b6ea0..e5d1b287 100644 --- a/EnvelopeGenerator.Application/Documents/Queries/Read/ReadDocumentResponse.cs +++ b/EnvelopeGenerator.Application/Documents/Queries/Read/ReadDocumentResponse.cs @@ -3,13 +3,25 @@ /// /// Represents the response for reading a document. /// -/// The unique identifier of the document. -/// The identifier of the associated envelope. -/// The date and time when the document was added. -/// The binary data of the document, if available. -public record ReadDocumentResponse( - int Guid, - int EnvelopeId, - DateTime AddedWhen, - byte[]? ByteData -); \ No newline at end of file +public class ReadDocumentResponse +{ + /// + /// The unique identifier of the document. + /// + public int Guid { get; init; } + + /// + /// The identifier of the associated envelope. + /// + public int EnvelopeId { get; init; } + + /// + /// The date and time when the document was added. + /// + public DateTime AddedWhen { get; init; } + + /// + /// The binary data of the document, if available. + /// + public byte[]? ByteData { get; init; } +} diff --git a/EnvelopeGenerator.Application/Extensions/DIExtensions.cs b/EnvelopeGenerator.Application/Extensions/DIExtensions.cs index 7ae3869b..a127afc4 100644 --- a/EnvelopeGenerator.Application/Extensions/DIExtensions.cs +++ b/EnvelopeGenerator.Application/Extensions/DIExtensions.cs @@ -42,8 +42,7 @@ public static class DIExtensions services.TryAddScoped(); //Auto mapping profiles - services.AddAutoMapper(typeof(BasicDtoMappingProfile).Assembly); - services.AddAutoMapper(typeof(UserMappingProfile).Assembly); + services.AddAutoMapper(Assembly.GetExecutingAssembly()); services.Configure(config.GetSection(nameof(DispatcherParams))); services.Configure(config.GetSection(nameof(MailParams))); From ba8394c749a647058ffe3626cbb1b060f6eff67c Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Wed, 23 Apr 2025 00:49:15 +0200 Subject: [PATCH 20/23] feat(EnvelopeGenerator.Terminal): Downgrade to .net 7 --- .../EnvelopeGenerator.GeneratorAPI.csproj | 4 ---- EnvelopeGenerator.Terminal/CommandManager.cs | 16 ++++++++++++---- .../EnvelopeGenerator.Terminal.csproj | 17 ++++++++--------- .../EnvelopeGenerator.Tests.Application.csproj | 4 ++-- 4 files changed, 22 insertions(+), 19 deletions(-) diff --git a/EnvelopeGenerator.GeneratorAPI/EnvelopeGenerator.GeneratorAPI.csproj b/EnvelopeGenerator.GeneratorAPI/EnvelopeGenerator.GeneratorAPI.csproj index 6cf235f1..e76957a6 100644 --- a/EnvelopeGenerator.GeneratorAPI/EnvelopeGenerator.GeneratorAPI.csproj +++ b/EnvelopeGenerator.GeneratorAPI/EnvelopeGenerator.GeneratorAPI.csproj @@ -19,15 +19,11 @@ - - - - diff --git a/EnvelopeGenerator.Terminal/CommandManager.cs b/EnvelopeGenerator.Terminal/CommandManager.cs index 4d558e59..3ba0f76a 100644 --- a/EnvelopeGenerator.Terminal/CommandManager.cs +++ b/EnvelopeGenerator.Terminal/CommandManager.cs @@ -7,12 +7,20 @@ using System.Text.Json; namespace EnvelopeGenerator.Terminal; -public class CommandManager(IEnvelopeReceiverService envelopeReceiverService, IMediator mediator) +public class CommandManager { private static JsonSerializerOptions Options = new () { - WriteIndented = true // <-- Bu satır okunabilir JSON için önemli + WriteIndented = true }; + private readonly IEnvelopeReceiverService _envelopeReceiverService; + private readonly IMediator _mediator; + + public CommandManager(IEnvelopeReceiverService envelopeReceiverService, IMediator mediator) + { + _envelopeReceiverService = envelopeReceiverService; + _mediator = mediator; + } [DefaultCommand] public void Execute([Option(Description = "print envelope generator termianal version.")] bool version) @@ -22,13 +30,13 @@ public class CommandManager(IEnvelopeReceiverService envelopeReceiverService, IM } [Subcommand] - public IEnvelopeReceiverService EnvelopeReceiver => envelopeReceiverService; + public IEnvelopeReceiverService EnvelopeReceiver => _envelopeReceiverService; [Command] public async Task ReadDocument(IConsole console, int? id = null, int? envelopeId = null) { ReadDocumentQuery query = new(id, envelopeId); - var document = await mediator.Send(query); + var document = await _mediator.Send(query); console.WriteLine(JsonSerializer.Serialize(document, Options)); } } diff --git a/EnvelopeGenerator.Terminal/EnvelopeGenerator.Terminal.csproj b/EnvelopeGenerator.Terminal/EnvelopeGenerator.Terminal.csproj index 0fc313f8..175074cf 100644 --- a/EnvelopeGenerator.Terminal/EnvelopeGenerator.Terminal.csproj +++ b/EnvelopeGenerator.Terminal/EnvelopeGenerator.Terminal.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net7.0 enable enable @@ -16,19 +16,18 @@ - - - + + + - - - + + - - + + diff --git a/EnvelopeGenerator.Tests.Application/EnvelopeGenerator.Tests.Application.csproj b/EnvelopeGenerator.Tests.Application/EnvelopeGenerator.Tests.Application.csproj index fecfd0e4..cc05f86e 100644 --- a/EnvelopeGenerator.Tests.Application/EnvelopeGenerator.Tests.Application.csproj +++ b/EnvelopeGenerator.Tests.Application/EnvelopeGenerator.Tests.Application.csproj @@ -29,12 +29,12 @@ - + - + From 4077786ef729f49bab34fb4e63819cfd7f5b33b0 Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Wed, 23 Apr 2025 01:01:09 +0200 Subject: [PATCH 21/23] refactor(Test.Application): Configured dependencies --- .../EnvelopeGenerator.Tests.Application.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EnvelopeGenerator.Tests.Application/EnvelopeGenerator.Tests.Application.csproj b/EnvelopeGenerator.Tests.Application/EnvelopeGenerator.Tests.Application.csproj index cc05f86e..c6e028c7 100644 --- a/EnvelopeGenerator.Tests.Application/EnvelopeGenerator.Tests.Application.csproj +++ b/EnvelopeGenerator.Tests.Application/EnvelopeGenerator.Tests.Application.csproj @@ -29,12 +29,12 @@ - + - + From ebb248969c076819e17c318be197db5d0d7d51ac Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Wed, 23 Apr 2025 09:27:03 +0200 Subject: [PATCH 22/23] =?UTF-8?q?fix(DIExtensions):=20AutoMapper-Konfigura?= =?UTF-8?q?tion=20von=20UserManager=20hinzugef=C3=BCgt.=20=20-=20In=20das?= =?UTF-8?q?=20Hauptverzeichnis=20des=20Projekts=20verschoben.=20=20-=20Umb?= =?UTF-8?q?enennen=20in=20DependencyInjection?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DIExtensions.cs => DependencyInjection.cs} | 9 ++++----- EnvelopeGenerator.GeneratorAPI/Program.cs | 2 +- EnvelopeGenerator.Terminal/DependencyInjection.cs | 2 +- EnvelopeGenerator.Tests.Application/Mock.cs | 2 +- EnvelopeGenerator.Web/Program.cs | 1 - 5 files changed, 7 insertions(+), 9 deletions(-) rename EnvelopeGenerator.Application/{Extensions/DIExtensions.cs => DependencyInjection.cs} (92%) diff --git a/EnvelopeGenerator.Application/Extensions/DIExtensions.cs b/EnvelopeGenerator.Application/DependencyInjection.cs similarity index 92% rename from EnvelopeGenerator.Application/Extensions/DIExtensions.cs rename to EnvelopeGenerator.Application/DependencyInjection.cs index a127afc4..0d96155c 100644 --- a/EnvelopeGenerator.Application/Extensions/DIExtensions.cs +++ b/EnvelopeGenerator.Application/DependencyInjection.cs @@ -1,6 +1,4 @@ -using DigitalData.UserManager.Application.MappingProfiles; -using EnvelopeGenerator.Application.MappingProfiles; -using EnvelopeGenerator.Application.Configurations; +using EnvelopeGenerator.Application.Configurations; using EnvelopeGenerator.Application.Services; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; @@ -10,12 +8,12 @@ using QRCoder; using EnvelopeGenerator.Application.Contracts.Services; using System.Reflection; -namespace EnvelopeGenerator.Application.Extensions; +namespace EnvelopeGenerator.Application; /// /// Extensions method for dependency injection /// -public static class DIExtensions +public static class DependencyInjection { /// /// Adds all required services for envelope generator application @@ -43,6 +41,7 @@ public static class DIExtensions //Auto mapping profiles services.AddAutoMapper(Assembly.GetExecutingAssembly()); + services.AddAutoMapper(typeof(DigitalData.UserManager.Application.DIExtensions)); services.Configure(config.GetSection(nameof(DispatcherParams))); services.Configure(config.GetSection(nameof(MailParams))); diff --git a/EnvelopeGenerator.GeneratorAPI/Program.cs b/EnvelopeGenerator.GeneratorAPI/Program.cs index c55e3b7a..77ee0bab 100644 --- a/EnvelopeGenerator.GeneratorAPI/Program.cs +++ b/EnvelopeGenerator.GeneratorAPI/Program.cs @@ -1,7 +1,6 @@ using DigitalData.Core.API; using DigitalData.Core.Application; using DigitalData.UserManager.Application; -using EnvelopeGenerator.Application.Extensions; using EnvelopeGenerator.Infrastructure; using Microsoft.AspNetCore.Authentication.Cookies; using Microsoft.AspNetCore.Localization; @@ -10,6 +9,7 @@ using System.Globalization; using Scalar.AspNetCore; using Microsoft.OpenApi.Models; using DigitalData.UserManager.DependencyInjection; +using EnvelopeGenerator.Application; var builder = WebApplication.CreateBuilder(args); diff --git a/EnvelopeGenerator.Terminal/DependencyInjection.cs b/EnvelopeGenerator.Terminal/DependencyInjection.cs index f4161e04..ad011146 100644 --- a/EnvelopeGenerator.Terminal/DependencyInjection.cs +++ b/EnvelopeGenerator.Terminal/DependencyInjection.cs @@ -3,12 +3,12 @@ using CommandDotNet; using Microsoft.Extensions.DependencyInjection; using CommandDotNet.IoC.MicrosoftDependencyInjection; using EnvelopeGenerator.Infrastructure; -using EnvelopeGenerator.Application.Extensions; using Microsoft.Extensions.Configuration; using Microsoft.EntityFrameworkCore; using EnvelopeGenerator.Application.Contracts.Services; using EnvelopeGenerator.Application.Services; using Microsoft.Extensions.Hosting; +using EnvelopeGenerator.Application; namespace EnvelopeGenerator.Terminal; diff --git a/EnvelopeGenerator.Tests.Application/Mock.cs b/EnvelopeGenerator.Tests.Application/Mock.cs index a9cc42d6..10bc7ea6 100644 --- a/EnvelopeGenerator.Tests.Application/Mock.cs +++ b/EnvelopeGenerator.Tests.Application/Mock.cs @@ -1,10 +1,10 @@ using Microsoft.Extensions.Hosting; -using EnvelopeGenerator.Application.Extensions; using EnvelopeGenerator.Infrastructure; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using EnvelopeGenerator.Application.Services; using Microsoft.EntityFrameworkCore; +using EnvelopeGenerator.Application; namespace EnvelopeGenerator.Tests.Application; diff --git a/EnvelopeGenerator.Web/Program.cs b/EnvelopeGenerator.Web/Program.cs index 96fcec96..8a2f7fc1 100644 --- a/EnvelopeGenerator.Web/Program.cs +++ b/EnvelopeGenerator.Web/Program.cs @@ -15,7 +15,6 @@ using DigitalData.EmailProfilerDispatcher; using EnvelopeGenerator.Infrastructure; using EnvelopeGenerator.Web.Sanitizers; using EnvelopeGenerator.Application.Contracts.Services; -using EnvelopeGenerator.Application.Extensions; var logger = LogManager.Setup().LoadConfigurationFromAppSettings().GetCurrentClassLogger(); logger.Info("Logging initialized!"); From 5f8df74b9de17ec157f5ae034bbf60ca4866df32 Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Wed, 23 Apr 2025 09:36:22 +0200 Subject: [PATCH 23/23] =?UTF-8?q?refactor(BasicDtoMappingProfile):=20Unter?= =?UTF-8?q?=20/DTOs=20verschieben.=20=20-=20umbenennen=20in=20MappingProfi?= =?UTF-8?q?le=20=20-=20Kommentare=20zur=20Dokumentation=20hinzuf=C3=BCgen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DTOs/MappingProfile.cs | 70 +++++++++++++++++++ .../MappingProfiles/BasicDtoMappingProfile.cs | 64 ----------------- 2 files changed, 70 insertions(+), 64 deletions(-) create mode 100644 EnvelopeGenerator.Application/DTOs/MappingProfile.cs delete mode 100644 EnvelopeGenerator.Application/MappingProfiles/BasicDtoMappingProfile.cs diff --git a/EnvelopeGenerator.Application/DTOs/MappingProfile.cs b/EnvelopeGenerator.Application/DTOs/MappingProfile.cs new file mode 100644 index 00000000..3dd3797a --- /dev/null +++ b/EnvelopeGenerator.Application/DTOs/MappingProfile.cs @@ -0,0 +1,70 @@ +using AutoMapper; +using EnvelopeGenerator.Application.DTOs.EnvelopeHistory; +using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver; +using EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly; +using EnvelopeGenerator.Application.DTOs.Messaging; +using EnvelopeGenerator.Application.DTOs.Receiver; +using EnvelopeGenerator.Application.Extensions; +using EnvelopeGenerator.Domain.Entities; + +namespace EnvelopeGenerator.Application.DTOs; + +/// +/// Represents the AutoMapper profile configuration for mapping between +/// domain entities and data transfer objects (DTOs) used within the EnvelopeGenerator application. +/// +public class MappingProfile : Profile +{ + /// + /// Initializes a new instance of the class. + /// Configures the mappings between entities and DTOs used throughout the application. + /// + public MappingProfile() + { + // Entity to DTO mappings + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + + // DTO to Entity mappings + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap().ForMember(rcv => rcv.EnvelopeReceivers, rcvReadDto => rcvReadDto.Ignore()); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + + // Messaging mappings + // for GTX messaging + CreateMap() + .ConstructUsing(gtxRes => gtxRes.Ok() + ? new SmsResponse() { Ok = true } + : new SmsResponse() { Ok = false, Errors = gtxRes }); + } +} \ No newline at end of file diff --git a/EnvelopeGenerator.Application/MappingProfiles/BasicDtoMappingProfile.cs b/EnvelopeGenerator.Application/MappingProfiles/BasicDtoMappingProfile.cs deleted file mode 100644 index ae14252e..00000000 --- a/EnvelopeGenerator.Application/MappingProfiles/BasicDtoMappingProfile.cs +++ /dev/null @@ -1,64 +0,0 @@ -using AutoMapper; -using EnvelopeGenerator.Application.DTOs; -using EnvelopeGenerator.Application.DTOs.EnvelopeHistory; -using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver; -using EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly; -using EnvelopeGenerator.Application.DTOs.Messaging; -using EnvelopeGenerator.Application.DTOs.Receiver; -using EnvelopeGenerator.Application.Extensions; -using EnvelopeGenerator.Domain.Entities; - -namespace EnvelopeGenerator.Application.MappingProfiles -{ - public class BasicDtoMappingProfile : Profile - { - public BasicDtoMappingProfile() - { - // Entity to DTO mappings - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - - // DTO to Entity mappings - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap().ForMember(rcv => rcv.EnvelopeReceivers, rcvReadDto => rcvReadDto.Ignore()); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - - // Messaging mappings - // for GTX messaging - CreateMap() - .ConstructUsing(gtxRes => gtxRes.Ok() - ? new SmsResponse() { Ok = true } - : new SmsResponse() { Ok = false, Errors = gtxRes }); - } - } -} \ No newline at end of file