Replaced "UseKestrelConfig" with "UseCustomKestrelEndpoints" and renamed the "Kestrel" section to "ServerConfig" in both Program.cs and appsettings.json. Updated Kestrel server configuration to use the new section. Added ExceptionHandlingMiddleware to the pipeline for global exception handling.
Introduced ExceptionHandlingMiddleware to handle exceptions across the ASP.NET Core request pipeline. The middleware logs exceptions and returns JSON error responses with appropriate HTTP status codes for BadRequestException (400), NotFoundException (404), and generic errors (500). Dependency injection is used for RequestDelegate and ILogger.
Refactored ReadSingleEnvelopeDocResultQuery to remove inheritance from EnvelopeQueryBase and introduce an Envelope property. Enhanced the handler to ensure DocResult is a non-empty byte array before returning, throwing NotFoundException otherwise.
Added Entity Framework model configuration for EnvelopeReport in EGDbContextBase, specifying it as a keyless entity using HasNoKey(). This allows EnvelopeReport to be used without a primary key in the database context.
The app now checks configuration values to optionally run as a Windows Service ("UseWindowsService") and/or apply custom Kestrel server settings from the "Kestrel" config section ("UseKestrelConfig"). These changes improve deployment flexibility.
Added "UseWindowsService" and "UseKestrelConfig" flags to appsettings.json. Defined a custom Kestrel HTTP endpoint at http://localhost:1111 to control how the application is hosted and served.
Added a new HTTP GET action to DocResultController that accepts a ReadSingleEnvelopeDocResultQuery via query string. The endpoint uses MediatR to retrieve the PDF document and returns it as a file response with the envelope's UUID in the filename and the correct content type.
- Add DigitalData.Core.API and SQL Server distributed cache dependencies
- Register EnvelopeGenerator.Application project reference
- Configure distributed SQL Server cache and memory cache
- Register infrastructure, application, and user management services
- Set up EF Core with SQL Server and detailed logging
- Enable localization with configurable supported cultures
- Improve modularity and extensibility of service registration
Changed target framework to net8.0-windows to specify Windows platform support. Enabled Windows Forms by setting UseWindowsForms to true in the project file.
Added "SupportedCultures" for localization support and a "ConnectionStrings" section with a default SQL Server connection string. Also reformatted "AllowedHosts" for consistency.
Refactored Worker to use IServiceScopeFactory instead of directly injecting FinalizeDocumentJob. Now, a new scope is created in each loop iteration, and FinalizeDocumentJob is resolved from the scoped service provider. This enables FinalizeDocumentJob to use scoped dependencies and improves DI flexibility.
Refactored ReadSingleEnvelopeDocResultQuery to use a parameterless constructor and an Envelope property. Introduced FinalizeDocumentController with a GET endpoint to finalize and return envelope documents as PDFs, supporting force regeneration. Added dependency injection for IMediator and FinalizeDocumentJob. Includes a TODO to migrate forceRegenerate logic into the job.
Introduced DocResultController with a GET endpoint to retrieve envelope PDF documents by sending a query via MediatR. The controller returns the PDF as a file response with an appropriate filename and content type. Added necessary using directives for MediatR, ASP.NET Core MVC, and the application query.
Refactored ReadSingleEnvelopeQuery and its handler to return EnvelopeDto directly and throw NotFoundException or BadRequestException when no or multiple envelopes are found, instead of returning null. Updated imports to include custom exceptions.
Introduced ReadSingleEnvelopeDocResultQuery and its handler to fetch an envelope's document as a byte array via MediatR. Throws NotFoundException if the document is missing. Includes XML documentation for clarity.
Removed MediatorGetOrContext.cs, eliminating the fluent API for handling null or empty MediatR responses with custom exceptions. Added two ExecuteAsync overloads to FinalizeDocumentJob: one for processing a single EnvelopeDto and another for processing all envelopes with the EnvelopeCompletelySigned status.
Renamed MediatorExtensions to MediatorGetOrContext and GetOrContext<TResponse> to MediatorGetOrContext<TResponse> for consistent naming. Moved the GetOr extension method into the new static class. Updated XML docs and reorganized declarations; no functional changes.
Replaced GetOrThrow methods with a fluent GetOr/Throw pattern for handling null or empty MediatR responses. Introduced GetOrContext<TResponse> struct with Throw, ThrowNotFound, ThrowInvalidOperation, and ThrowBadRequest methods. Updated all tests to use the new API and added coverage for new exception types. Improved XML docs and performed minor code cleanup.
Renamed SendOrThrowAsync and SendOrNotFoundAsync extension methods for IMediator to GetOrThrow for ISender, following MediatR best practices. Updated all usages, XML docs, and tests to use ISender and the new method names. Replaced StubMediator with StubSender in tests. Functionality remains the same, but code now aligns with modern MediatR conventions.
Introduce MediatorExtensionsTests to cover SendOrThrowAsync and SendOrNotFoundAsync extension methods for IMediator, including edge cases and cancellation. Refactor CreateEnvelopeCommand in Fake.cs to use Authorize(userId) instead of setting UserId directly. Add test stubs for IMediator and IRequest to support isolated testing.
Generalize null/empty response handling with SendOrThrowAsync<TResponse, TException>, allowing custom exceptions via a factory delegate. SendOrNotFoundAsync now wraps this method for NotFoundException. Improves type safety, flexibility, and XML docs; avoids treating strings as collections.
Introduced MediatorExtensions with SendOrNotFoundAsync methods to enforce non-null and non-empty responses from MediatR requests. These extensions throw NotFoundException when responses are null or empty, centralizing not-found logic and improving error handling.
Introduced ReadSingleEnvelopeQuery and its handler to enable
retrieval of a single envelope with optional user filtering.
Supports filtering by user ID, envelope ID, or UUID, includes
related documents, and maps results to EnvelopeDto using
AutoMapper for secure and flexible access.
Refactored ActionService and FinalizeDocumentJob to use EnvelopeDto and ReceiverDto in place of domain entities. Updated method signatures, internal logic, and envelope receiver handling to operate on DTOs. Improved logging, removed obsolete code, and added necessary using statements for DTO namespaces. Also updated document retrieval logic and removed null-conditional operator from actionService calls.
Updated ReportCreator and ReportItem to accept EnvelopeDto
instead of Envelope, promoting better separation of concerns
and improved data handling via DTOs.
- Bump Microsoft.Extensions.DependencyInjection to 9.0.6 for .NET 9.0
- Add Microsoft.EntityFrameworkCore.SqlServer for .NET 7.0, 8.0, and 9.0
- Improve ItemGroup formatting for clarity and consistency
Added EnvelopeReceivers property to EnvelopeDto to support a collection of envelope receiver DTOs. Also included the required using directive for EnvelopeReceiverDto.
Introduced an optional MinMinutesSinceLastChange filter to ReadEnvelopeQuery and updated the handler to return only envelopes whose last change was at least the specified number of minutes ago. This enables time-based filtering of envelope results.
Introduced a new WorkerController with endpoints to start, stop, and restart the background Worker service via HTTP API. The controller uses dependency injection to locate the Worker instance and logs each operation. Also removed an unused Controllers folder reference from the project file.
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.
The Debug property, previously marked as obsolete in WorkerOptions, has been removed. Debugging should now be managed through ILogger-based logging instead of this flag.
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.
Moved mapping logic from ReportCreator.ToReportItem to a new constructor in ReportItem, improving encapsulation and simplifying report generation. Updated usings to remove unused and add necessary dependencies.
Removed ILogger dependency and all related logging from ReportCreator. Inlined DoCreateReport into CreateReportAsync and eliminated the try-catch block, allowing exceptions to propagate naturally. Improved the error message for missing report data. The class is now more focused and streamlined.
Replaces obsolete DataTable-based logic in ReportCreator with async repository queries for EnvelopeReport entities. Refactors ReportItem to use explicit header and detail fields, removing legacy Envelope references. Updates report designer bindings to match new ReportItem properties. Improves exception handling and overall type safety.
Switch to a designer-generated DevExpress XtraReport for envelope history, replacing the previous manual layout. Added designer (.Designer.cs), resource (.resx), and updated code-behind (.cs) files. Updated the project file to include new report assets. Changed report generation to use the new async API. This modernizes the report, improves maintainability, and enhances appearance.
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.
Added DevExpress.Reporting.Core package reference. Refactored rptEnvelopeHistory to inherit from XtraReport and build its layout programmatically using DevExpress bands, tables, and styling. The report now uses A4 paper size, custom margins, and DevExpress UI components for rendering.
Removed unused constructor parameters from FinalizeDocumentJob for cleaner dependency injection. Updated actionService.FinalizeEnvelope to accept a cancellation token. Added missing using directive for Microsoft.Extensions.Options.
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.
Introduced the EnvelopeReport class in the Domain.Entities namespace, mapped to the "VWSIG_ENVELOPE_REPORT" table using EF Core data annotations. The entity includes properties for envelope ID, head UUID, title, message, status, timestamp, and user, with appropriate column mappings and validation attributes.
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.
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.
Changed ExportPath from a nullable string to a non-nullable string in ConfigDto and initialized it with the null-forgiving operator. This ensures ExportPath always has a value and cannot be null.
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.
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.
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.
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.
Refactored property declarations in the Envelope class for improved readability by removing unnecessary line breaks and nullable preprocessor directives. Added a [NotMapped] DefaultDocument property to return the first document in the Documents list, or null if none exist.