Replaces transient LicenseManager registration (with per-injection license key retrieval via MediatR) with a singleton LicenseManagerFactory. This centralizes license management and may improve performance and maintainability.
Refactored LicenseManager registration to fetch the GdPicture license key from the database using MediatR and ReadThirdPartyModuleLicenseQuery, instead of reading from configuration. Updated using statements accordingly.
JobStateManager is now added as a singleton service, initialized with the InitialJobState from WorkerOptions. This enables consistent state management across the application by providing a shared instance via dependency injection.
Changed AddFinalizeDocumentJob to bind WorkerOptions from the "Worker" section in configuration instead of "WorkerOptions" for correct settings mapping.
Changed FinalizeDocumentJob DI registration from singleton to scoped for better instance management. Added ReportCreator as a scoped service. Removed unused EnvelopeGenerator.ServiceHost.Jobs.Infrastructure import.
The MSSQLServer service is no longer registered in the dependency injection container within DependencyInjection.cs. This change means MSSQLServer will not be available for injection throughout the application. The comment regarding service lifetimes remains for future review.
Removed the deprecated ReportModel class and its List method, along with its registration in the dependency injection setup. This cleanup reflects the migration to EnvelopeReport mediator queries.
Replaced DigitalData.Modules.Database with EnvelopeGenerator.ServiceHost.Jobs.Infrastructure in using statements and class namespaces. All database operations are now organized under the new namespace for better clarity and project structure.
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.
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.
Renamed the ServiceCollectionExtensions class to DependencyInjection to better reflect its purpose and possibly consolidate dependency injection methods. No functional changes were made.
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.
Created LoggerExtensions.cs in EnvelopeGenerator.ServiceHost.Extensions, introducing a LogError extension method for ILogger to simplify exception logging.
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.
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.
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.