Commit Graph

2187 Commits

Author SHA1 Message Date
f49b907574 Refactor EnvelopeModel for DI and logging improvements
Removed BaseModel inheritance and switched to constructor injection for MSSQLServer and ILogger dependencies. Updated using directives and replaced Logger.Error with Logger.LogError. Removed obsolete State-based constructor.
2026-02-26 21:22:15 +01:00
86ed96ae76 Refactor ConfigModel for DI and improved logging
Refactored ConfigModel to use dependency injection for MSSQLServer and ILogger, removed BaseModel inheritance and constructor. Updated using directives and replaced Logger.Error with Logger.LogError for better error handling.
2026-02-26 21:21:44 +01:00
9dbfdaa15e Mark ActionService as obsolete and stub out methods
ActionService is now marked obsolete as a placeholder. Its constructor was removed, and all methods now throw NotImplementedException instead of returning true. Each method is also marked obsolete, indicating logic should be migrated from CommonServices.Jobs.
2026-02-26 19:02:57 +01:00
9d66f1d19e Remove BaseClass and logging utilities
Deleted Base.cs and Logging.cs, removing BaseClass, logging configuration, logger classes, and related extension methods for enums and DataRow. These foundational and logging utilities are no longer part of the project.
2026-02-26 19:02:45 +01:00
14cef05d02 Refactor MSSQLServer to use IConfiguration for connection
Replaced LogConfig and direct connection string injection with IConfiguration. Connection string is now retrieved from configuration using the "Default" key. Removed LogConfig dependency and related code.
2026-02-26 19:02:31 +01:00
bdfb973d55 Refactor ReportCreator: DI, logging, and deprecations
Refactored ReportCreator to use constructor injection for dependencies and removed BaseClass inheritance. Marked legacy methods and fields as [Obsolete] to indicate migration to mediator queries. Improved logging by switching to Logger.LogError and updating string interpolation. Removed unused usings and added MergeEnvelope method (also obsolete). These changes modernize the class and highlight areas for further architectural improvement.
2026-02-26 18:57:58 +01:00
15a18b1bfd Refactor PDFBurner to use dependency injection
Replaced internal construction of dependencies with injected EGDbContext, ILogger, LicenseManager, AnnotationManager, and WorkerOptions. Removed BaseClass inheritance and internal fields. Updated annotation and PDF burning methods to use injected instances. Switched configuration from PDFBurnerParams to WorkerOptions.PDFBurnerOptions. Improves testability and aligns with DI best practices.
2026-02-26 18:55:50 +01:00
6fac1cd96a Refactor PDFMerger for DI and remove BaseClass inheritance
PDFMerger now uses dependency injection for LicenseManager and
AnnotationManager, improving modularity and testability. Removed
inheritance from BaseClass and cleaned up unused usings.
2026-02-26 17:24:13 +01:00
79d2636c14 Refactor TempFiles to use ILogger and DI for logging
Removed BaseClass inheritance and legacy logging dependencies. Updated TempFiles to use ILogger<TempFiles> via dependency injection, replaced Logger.Error and Logger.LogDebug with structured logging calls. Cleaned up unused usings and improved log message formatting.
2026-02-25 17:15:51 +01:00
2172ce8203 Register AnnotationManager as transient service
Updated DI comment for clarity on service lifetimes and added AnnotationManager as a transient service to the dependency injection container.
2026-02-25 17:03:59 +01:00
51ab9fb094 Remove placeholder DbConfig registration from DI
DbConfig is no longer registered as a singleton in the dependency injection setup. This prevents accidental injection and avoids runtime NotImplementedException errors. The related comment about service lifetimes remains for future review.
2026-02-25 16:47:59 +01:00
d8a002cd22 Rename ServiceCollectionExtensions to DependencyInjection
Renamed the ServiceCollectionExtensions class to DependencyInjection to better reflect its purpose and possibly consolidate dependency injection methods. No functional changes were made.
2026-02-25 16:43:23 +01:00
e36684820e Add DI registrations for FinalizeDocumentJob services
Expanded AddFinalizeDocumentJob to register ActionService, TempFiles, PDFBurner, PDFMerger, ReportModel, State, MSSQLServer, GdViewer, and LicenseManager with appropriate lifetimes. Added a placeholder DbConfig registration. Marked the method as [Obsolete] and updated using directives for new dependencies.
2026-02-25 16:42:38 +01:00
2a5d953623 Add LoggerExtensions with LogError extension method
Created LoggerExtensions.cs in EnvelopeGenerator.ServiceHost.Extensions, introducing a LogError extension method for ILogger to simplify exception logging.
2026-02-25 16:40:40 +01:00
0aba9e91e2 Add DataRowExtensions for safe value retrieval with defaults
Introduced DataRowExtensions.cs with extension methods for DataRow:
- ItemEx<T>: Retrieves a value by column name with a default if missing or null.
- ItemEx (string): Overload for string values, using the generic method.
These methods help prevent errors when accessing missing or null columns.
2026-02-25 16:39:55 +01:00
1a0973075b Standardize error logging with LogError method
Replaced all usages of _logger?.Error with _logger?.LogError in FinalizeDocumentJob.cs. Renamed the Error method to LogError in Logging.cs for consistency. This change ensures uniform error logging across the codebase.
2026-02-25 13:43:51 +01:00
b8fd26611c Refactor Logger error handling and add extension method
Refactored Logger.Error(Exception) to use a new ILogger extension method, LogError, for improved error logging. Added an overloaded Error method to Logger for custom messages with exceptions. Introduced LoggerExtensions with a LogError extension for consistent exception logging.
2026-02-25 13:42:33 +01:00
0ca372bf45 Update logging methods to use standard naming conventions
Replaced custom Warn method with LogWarning in Logger class and updated usage in FinalizeDocumentJob. Added LogInformation and LogWarning methods for consistency with common logging practices. LogWarning now accepts an Exception as the first parameter, aligning with standard logging signatures.
2026-02-25 13:38:55 +01:00
5230076d5d Rename Logger.Warn to Logger.LogWarning throughout codebase
Replaces all usages of Logger.Warn with Logger.LogWarning for consistency with .NET logging conventions. Updates the Logger class method name and all related calls, with no changes to logic or parameters.
2026-02-25 13:37:50 +01:00
b28084bf19 Replace Info logging with LogInformation
Renamed all usages of the Info logging method to LogInformation across the codebase, including in the Logger class. This aligns logging with standard conventions and improves consistency with common logging frameworks.
2026-02-25 13:37:00 +01:00
cbc983e070 Rename Logger.Debug to Logger.LogDebug across codebase
Renamed the Logger.Debug method to Logger.LogDebug for improved clarity and consistency. Updated all usages in PDFBurner, ReportCreator, FinalizeDocumentJob, TempFiles, and Logging.cs. No changes to logging logic or other log levels.
2026-02-25 13:36:50 +01:00
3b06f3fdac Remove JobDataKeys.cs and its string constants
The JobDataKeys.cs file was deleted, including the static class JobDataKeys and its four string constants: GdPicture, LogConfig, Database, and PdfBurnerParams. This change removes unused or redundant job data key definitions from the codebase.
2026-02-25 13:34:04 +01:00
a12d74871d Refactor PDF burner options naming in WorkerOptions
Renamed WorkerOptions.PdfBurnerParams to PdfBurner and updated its type from PDFBurnerParams to PDFBurnerOptions. Also renamed the record type accordingly and updated all references in the codebase. No changes to the structure or default values of the options.
2026-02-25 13:33:39 +01:00
45b715ed74 Refactor job execution to remove Quartz and job runner
Simplify FinalizeDocumentJob execution by removing Quartz dependencies and the IFinalizeDocumentJobRunner abstraction. The job now uses an ExecuteAsync method with direct access to configuration and options via dependency injection. Worker is updated to call the job directly, and service registration is streamlined. This improves clarity and integration with .NET DI.
2026-02-25 13:29:00 +01:00
9d5e2e6ad2 Refactor FinalizeDocumentJob config to use WorkerOptions
Replaces JobOptions and PDFBurnerParams with a new WorkerOptions class that encapsulates all job configuration, including PDF burning parameters as a nested record. Updates service registration and job constructor to use IOptions<WorkerOptions>. Removes obsolete configuration classes and centralizes options management for improved maintainability.
2026-02-25 13:27:01 +01:00
c5d2d79563 Rename FinalizeDocumentJobOptions to JobOptions
Renamed the FinalizeDocumentJobOptions class to JobOptions. Added properties for ConnectionString, GdPictureLicenseKey, Debug, and PdfBurnerParams, with appropriate default values.
2026-02-25 11:55:35 +01:00
15d4573321 Übersetzendie FinalizeDocumentJob-Funktion des EnvelopeGenerator.Service-Projekts in C# und kopieren sie. 2026-02-25 11:52:31 +01:00
eb46590c1d Make worker delay configurable via appsettings.json
Refactored Worker to accept IConfiguration and read the delay interval from "Worker:DelayMilliseconds" in appsettings.json, replacing the previously hardcoded value. This allows the worker execution interval to be configured without code changes. Added a minimum delay safeguard and updated appsettings.json accordingly.
2026-02-23 17:17:27 +01:00
c93c32307a feat(FinalizeDocument): aus CommonJobs kopiert, mit einfachen Fehlerbehebungen unter Verwendung von Copilot
- Programmiersprache von VSC zu C# geändert
 - Framework von .NET Framework zu .NET geändert
2026-02-23 17:12:25 +01:00
41cca7fa64 Refactor properties and add JsonIgnore for .NET builds
Refactored Receiver and Annotations property declarations for clarity and conciseness. Added [JsonIgnore] attributes to Top and Left properties under .NET builds to exclude them from JSON serialization, using #if NET directives. Replaced previous #if NETFRAMEWORK logic to clarify platform-specific behavior.
2026-02-23 17:06:50 +01:00
b01c17ab18 Add custom exception classes and Extensions folder
Introduce four custom exceptions (BurnAnnotationException, CreateReportException, ExportDocumentException, MergeDocumentException) under EnvelopeGenerator.ServiceHost.Exceptions for improved error handling. Update the project file to include the new Extensions folder.
2026-02-23 16:09:11 +01:00
c8834dc3be Add Worker background service to log periodic messages
Added a Worker class in EnvelopeGenerator.ServiceHost that logs an informational message every second. Registered the Worker as a hosted service in Program.cs to run alongside the web API.
2026-02-23 11:10:15 +01:00
e385fdda95 Add EnvelopeGenerator.ServiceHost ASP.NET Core Web API project
Created a new EnvelopeGenerator.ServiceHost project targeting .NET 8.0. Set up minimal API host with controllers, Swagger/OpenAPI support, and development configuration files. Updated solution to include the new project with appropriate build settings.
2026-02-23 11:10:01 +01:00
898097cdb5 Remove EnvelopeGenerator.Jobs project from solution
Deleted the EnvelopeGenerator.Jobs project and all its source files. Also removed all references to this project from the solution file, including project entries and build configurations. This cleans up the repository by eliminating unused or deprecated job-related code.
2026-02-23 10:56:03 +01:00
689a1b355a Remove EnvelopeGenerator.WorkerService project
Deleted the EnvelopeGenerator.WorkerService project and all related files, including configuration, job scheduling, and temp file management. Removed all references to the project from the solution file. This eliminates the background worker service component from the solution.
2026-02-23 10:54:32 +01:00
3b3330bd54 Enhance SQL connection security with encryption options
Added Encrypt=True and TrustServerCertificate=True to the SQL Server connection string to ensure encrypted connections and allow trusting the server certificate, improving overall connection security.
2026-02-23 10:04:34 +01:00
511fad3950 Remove try-catch from Button1/2_Click event handlers
Refactored Button1_Click and Button2_Click to eliminate local try-catch blocks, allowing exceptions to propagate. Cleaned up redundant code and improved clarity by moving variable declarations outside of the previous try blocks. Core logic remains unchanged.
2026-02-23 09:58:07 +01:00
f5f137396e Rename ChangedWhen to ActionDate; add wrapper for compatibility
Renamed the ChangedWhen property to ActionDate in the History entity, preserving the database mapping. Added a ChangedWhen property as a wrapper around ActionDate to maintain backward compatibility with existing code.
2026-02-23 09:38:13 +01:00
0d78e9b8f5 Refactor TestEnvelopeController to use MediatR
Replaced direct IEnvelopeService usage with MediatR in TestEnvelopeController. Updated GetAll to use ReadEnvelopeQuery via MediatR, removed legacy service logic, and simplified DecodeEnvelopeReceiverId. Removed unused usings, base class inheritance, and obsolete methods.
2026-02-23 09:15:50 +01:00
d842332d97 Update to v3.10.0 and revise Bootstrap Icons set
Bump project version to 3.10.0 and update assembly/file versions. Replace and streamline included Bootstrap Icons SVGs, focusing on file-related icons and removing many miscellaneous and filetype-specific icons. Some icon entries may be duplicated.
2026-02-17 14:08:46 +01:00
f5b0f25d96 Add ImageSharp dependency to all major projects
Added SixLabors.ImageSharp (v3.1.12) as a dependency to API, Application, Infrastructure, Jobs, Tests, Web, and WorkerService projects to enable advanced image processing capabilities across the solution. This prepares the codebase for features involving image manipulation or generation.
2026-02-17 13:51:07 +01:00
60afc0f320 Update NuGet packages and remove chat.svg reference
Updated Microsoft.Extensions.Logging.Abstractions and Microsoft.Data.SqlClient in EnvelopeGenerator.Jobs.csproj, and System.Configuration.ConfigurationManager in EnvelopeGenerator.Web.csproj. Also removed the chat.svg icon reference from EnvelopeGenerator.Web.csproj.
2026-02-17 13:38:48 +01:00
ce7af03064 Update System.Security.AccessControl to v6.0.1
Upgraded package and assembly references from v5.0.0 to v6.0.1 across all projects. Added binding redirects in app.config files to ensure runtime compatibility. This update provides improved security and compatibility.
2026-02-17 12:40:25 +01:00
8e9bf5d46f Update NuGet packages and binding redirects to latest versions
Upgraded Microsoft.Data.SqlClient, System.Formats.Asn1, Microsoft.Extensions, and other core dependencies to latest versions. Added new package references (Azure.Core, Azure.Identity, System.ClientModel, etc.). Updated assembly binding redirects and project references for compatibility. No application code changes; all updates are related to dependency and configuration management.
2026-02-17 12:35:40 +01:00
07f951ba98 Update Microsoft.Identity.Client to 4.82.1 across solution
Upgraded Microsoft.Identity.Client to version 4.82.1 in all projects, updated related assembly references and binding redirects, and ensured packages.config reflects the new version. Also updated Microsoft.IdentityModel.Abstractions to 8.14.0 and added System.Formats.Asn1 where required. These changes improve consistency and compatibility for authentication dependencies.
2026-02-17 11:54:47 +01:00
3336af0541 Update HtmlSanitizer to v9.0.892 across all projects
Upgraded HtmlSanitizer from 8.0.865 to 9.0.892 in all existing project references. Added HtmlSanitizer 9.0.892 as a new dependency to API, Infrastructure, Jobs, Tests, and WorkerService projects to ensure consistent and up-to-date usage throughout the solution.
2026-02-17 11:51:31 +01:00
4deec9c064 Upgrade BouncyCastle to 2.6.2 and update binding redirects
Upgraded BouncyCastle.Cryptography from 2.5.0 to 2.6.2 across all projects, updating project and package config files as needed. Added/updated PackageReference for .NET Core/Standard projects. Updated app.config with a new binding redirect for System.ValueTuple and changed Microsoft.Identity.Client redirect to 4.55.0.0. These changes improve dependency consistency and resolve potential assembly binding issues.
2026-02-17 10:56:13 +01:00
a1a7f0eef7 Only append envKey if ENV_KEY is defined
Updated request logic to add the "envKey" query parameter only when the global ENV_KEY variable is defined. This prevents errors and avoids unnecessary parameters in requests when ENV_KEY is not set.
2026-02-17 09:59:27 +01:00
352618a745 Improve locale resolution in loadPSPDFKit function
Updated loadPSPDFKit to determine the locale by checking the provided argument, localized.culture, browser language, and defaulting to 'en'. This enhances locale selection robustness and user experience. Minified code updated accordingly.
2026-02-16 18:35:36 +01:00
8cf6484786 Dynamic locale support for date formatting functions
Replaced hardcoded 'de-DE' locale with a new getCurrentCulture function that selects the user's culture from localized.culture or navigator.language. Date formatting now adapts to user language settings in detailedCurrentDate and getLocaleDateString.
2026-02-16 17:34:49 +01:00