Commit Graph

46 Commits

Author SHA1 Message Date
25c31108cb Add EnvelopeReport repository dependency to ReportCreator
Updated ReportCreator constructor to require an IRepository<EnvelopeReport> parameter, enabling direct access to envelope report data within the class. This change prepares the class for future data operations involving envelope reports.
2026-03-09 21:26:19 +01:00
070d9be00c Remove obsolete State class and DI registration
Removed the deprecated State class and its properties from the codebase. Also removed State from the dependency injection configuration, as it is no longer used.
2026-03-09 16:52:52 +01:00
6f7b04a26e Refactor: remove strict checks and logging in finalization
Removed exception throwing and logging for failed report creation, email sending, and envelope finalization in FinalizeDocumentJob. Now, these methods are called without checking their return values. Also improved exception message for file export to include envelope Id and added null-forgiving operator to _config.ExportPath.
2026-03-09 16:31:31 +01:00
8f3aa69cbf Refactor document save to use async repository update
Replaced manual SQL and file read with async repository update for saving final document bytes. Removed obsolete helper methods and cleaned up unused imports for improved maintainability and testability.
2026-03-09 16:18:20 +01:00
eededeb1f1 Remove SendFinalEmailWithAttachment and related logic
Removed the SendFinalEmailWithAttachment method and all references to it from SendFinalEmailToCreator and SendFinalEmailToReceivers. The logic for determining email attachments based on FinalEmailType is no longer used. Other functionality in these methods remains unchanged.
2026-03-09 15:41:56 +01:00
737774f077 Remove PDF annotation and envelope data methods
Removed BurnAnnotationsToPdf, GetEnvelopeData, and GetAnnotationData from FinalizeDocumentJob. These methods handled document reading, annotation retrieval, and PDF annotation burning. This change reflects a refactor or shift in document processing responsibilities.
2026-03-09 15:34:58 +01:00
69499273cc Refactor FinalizeDocumentJob to async and use docStatusRepo
Refactored FinalizeDocumentJob to make the Finalize method asynchronous and fetch document annotations from docStatusRepo instead of using GetEnvelopeData. Updated constructor to inject IRepository<Domain.Entities.DocumentStatus>. Improved logging and removed obsolete envelopeData checks.
2026-03-09 15:32:32 +01:00
d1e2840617 Clean up debug logging in FinalizeDocumentJob
Removed numerous debug-level log statements to reduce log verbosity and focus on warnings and information logs. Updated some log messages to use interpolated strings for clarity. Refactored GetAnnotationData to use C# collection expressions for improved code conciseness.
2026-03-09 11:35:49 +01:00
a39ef6a0e2 Improve error handling in FinalizeDocumentJob
Added RethrowOnError property to control exception rethrowing during envelope finalization. Exceptions are now logged as errors and, if RethrowOnError is true, rethrown to enable stricter error handling and halt execution on failure.
2026-03-09 11:30:43 +01:00
7d620988d8 Refactor envelope finalization into a private method
Extracted envelope finalization logic from the foreach loop into a new private Finalize(Envelope envelope) method. This improves code readability and maintainability by encapsulating all steps of the finalization process without changing functionality.
2026-03-09 11:25:36 +01:00
cc4a7d8c20 Refactor ActionService: DI, CancellationToken support
Refactored ActionService to use constructor injection for IRepository<History>. Updated all public methods to accept optional CancellationToken parameters for improved cancellation support. Added necessary using directives. Class remains a placeholder with [Obsolete] attributes and NotImplementedException.
2026-03-09 10:18:53 +01:00
0b8068f926 Add summary comment to ActionService for migration context
Added an XML summary comment to the ActionService class to indicate it is being migrated from EnvelopeGenerator.CommonServices.Services.ActionService. This provides clarity on the class's origin and intended purpose; no functional changes were made.
2026-03-09 10:12:32 +01:00
9fd7a68798 Refactor envelope processing for per-item error handling
Move per-envelope logic in FinalizeDocumentJob into its own try-catch block within the foreach loop. This ensures that exceptions in processing one envelope do not halt the processing of others, improving robustness and fault tolerance. Removed the outer try-catch-finally block and updated logging to reflect per-envelope and overall job status.
2026-03-09 09:42:55 +01:00
d6e2690bb8 Refactor envelope fetch to use EF LINQ instead of SQL
Replaced raw SQL and DataTable usage with Entity Framework LINQ queries for retrieving completed envelopes. The process now works directly with envelope entities, improving code readability, maintainability, and leveraging EF's querying capabilities. Logging and error handling have been updated to use envelope properties directly.
2026-03-09 09:38:08 +01:00
f04385a03c Remove EnvelopeModel class and its GetById method
Deleted the EnvelopeModel class, which included the GetById method for retrieving Envelope entities from the database. Also removed related using directives and namespace declarations. This cleanup eliminates unused or redundant code.
2026-03-06 14:53:14 +01:00
c88e7b2b9e Refactor FinalizeDocumentJob to use async repository access
Replaced EnvelopeModel with IRepository<Envelope> in FinalizeDocumentJob, switching to dependency-injected, repository-based, and asynchronous data access using Entity Framework. Updated envelope retrieval to use SingleOrDefaultAsync, improving maintainability and scalability. Added necessary using directives to support these changes.
2026-03-06 14:53:00 +01:00
0ee7ec82d6 Mark TempFiles class and members as obsolete
The TempFiles class, including its TempPath property, constructor,
and methods (Create, CleanUpFiles, CleanUp), is now marked with
the [Obsolete("Use memory cache instead of temp files.")] attribute.
This deprecates the use of temp files in favor of a memory cache
approach for future development.
2026-03-06 14:48:19 +01:00
a4082fca45 Remove ConfigModel and DbConfig classes
Deleted ConfigModel.cs and DbConfig.cs, removing both the configuration loading logic and the DbConfig data structure from the codebase. This eliminates database-driven configuration management functionality.
2026-03-06 13:58:29 +01:00
f3ae8a9c49 Refactor config loading to async MediatR query in job
Switched FinalizeDocumentJob to use MediatR for async config retrieval, replacing direct model access. Updated _config type to ConfigDto?, injected IMediator, and removed obsolete DbConfig references. Cleaned up ExecuteAsync method for improved clarity and decoupling.
2026-03-06 13:58:16 +01:00
d6058c41d0 Remove DocumentPathOrigin from DbConfig and usages
DocumentPathOrigin property and all related code references have
been removed from DbConfig, ConfigModel, and FinalizeDocumentJob.
DocumentPath is now used exclusively for document path handling,
simplifying configuration and reducing redundancy.
2026-03-06 13:51:20 +01:00
41dde6f016 Remove BaseModel and BaseService from Jobs namespace
Deleted BaseModel and BaseService classes, along with their
associated using statements and members. This removes the
abstraction layers for database, logging, and state management
from EnvelopeGenerator.ServiceHost.Jobs.
2026-02-26 21:24:21 +01:00
c5b167f0d4 Refactor FinalizeDocumentJob for DI and logging improvements
Refactored FinalizeDocumentJob to use dependency injection for all major services and models, replacing manual initialization. Updated all logging to use injected ILogger with structured messages. Removed obsolete initialization methods. Marked class as [Obsolete] pending migration from CommonServices.Jobs. Improved exception handling and code clarity for better testability and maintainability.
2026-02-26 21:24:03 +01:00
a70faebde6 Refactor ReportModel: remove BaseModel, mark obsolete
Refactored ReportModel to use MSSQLServer Database via primary constructor, removed BaseModel inheritance and State-based constructor. Marked class and List method as obsolete, recommending EnvelopeReport mediator queries. Updated namespace and using directives.
2026-02-26 21:23:07 +01:00
3e01052579 Mark State class obsolete and remove LogConfig property
State is now marked obsolete in favor of DbContext. Removed LogConfig property and its using directive to simplify the class. Minor formatting adjustments applied.
2026-02-26 21:22:41 +01:00
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
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
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