Removed all usage of the obsolete IEnvelopeService from EnvelopeController, refactoring endpoints to use MediatR with ReadEnvelopeQuery. Simplified GetAsync and GetDocResultAsync logic, updated method signatures, and eliminated obsolete code paths and attributes. Cleaned up unused usings and updated constructor dependencies.
Consolidate envelope querying logic by extending ReadEnvelopeQuery to support user filtering and status options, and introduce ReadEnvelopeQueryHandler to process all envelope queries. Remove ReadUserEnvelopesQuery and its handler, reducing duplication and improving maintainability.
Replaces IEmailTemplateRepository with IRepository<EmailTemplate> in EmailTemplateController. Removes unused ILogger dependency and updates the Get method to use the new repository interface. Cleans up obsolete attributes and using directives.
Introduced a CQRS-style ReadReceiverQueryHandler using MediatR to enable flexible querying of receivers by Id, EmailAddress, or Signature. Integrated AutoMapper for DTO mapping and updated ReadReceiverQuery to support MediatR's request/response pipeline.
Introduced ReadEnvelopeTypesQuery and its handler to fetch all
envelope types from the repository, map them to DTOs, and
return the result via MediatR. This enables clean, decoupled
retrieval of envelope types in the application.
Implemented ReadUserEnvelopesQuery and its handler to fetch user envelopes with support for filtering by user ID, status (range, include, ignore), envelope ID, and UUID. Utilizes repository and AutoMapper to return EnvelopeDto results.
Introduced ReadReceiverNameQueryHandler to retrieve the most recently used name ("Anrede") for a receiver, supporting envelope generation. Updated ReadReceiverNameQuery to use MediatR and CQRS patterns, and implemented repository-based lookups for receiver identification and name retrieval. Added necessary using directives for repository and MediatR support.
Extended ReadEnvelopeReceiverQuery to support optional username-based filtering. Refactored the handler to apply this filter, updated repository access for consistency, and improved code clarity and null-safety. Cleaned up comments and formatting.
Updated the project, assembly, and file versions from 3.8.2 to 3.9.0 in the EnvelopeGenerator.Web.csproj file. This prepares the project for the next release.
Retrieve envelope by ID before burning annotations. Throw an exception if not found, and return the original PDF if the envelope is read-only. This adds validation and early exit logic before processing signatures and annotations.
Added a ReadOnly property to the Envelope class that returns true when EnvelopeTypeId is 2. The property is marked with [JsonIgnore] and [NotMapped] to exclude it from JSON serialization and database mapping.
The GetEnvelopeData function's SQL query now selects the ENVELOPE_TYPE column from the TBSIG_ENVELOPE table, allowing retrieval of envelope type information along with other envelope data.
Removed EnvelopeGenerator.CommonServices DLL reference from BBTests project file, updated project GUIDs to lowercase, added WCFMetadata ItemGroup for connected services, and set BBTests Release config to use Debug in solution file.
Enhanced PDFBurner to use a static FontProvider for better font support when rendering form field values. In ReportCreator, removed unused HEAD_TITLE and HEAD_SUBJECT fields from the SQL query and related mapping, streamlining report item loading.
Updated the ConnectionString property in both appsettings.json and appsettings.Development.json from an empty value to a specific SQL Server connection string, including server, database, credentials, and security options. This enables the application to connect to the designated database environment.
- Add WorkerSettings class and update appsettings for config-driven setup
- Integrate Quartz.NET for job scheduling (FinalizeDocumentJob, APIEnvelopeJob)
- Refactor Program.cs for DI of services (TempFileManager, PDFBurner, etc.)
- Implement TempFileManager for temp folder management and cleanup
- Rewrite Worker class for config validation, DB check, and lifecycle logging
- Update csproj to include Quartz and EnvelopeGenerator.Jobs references
- Improve maintainability, error handling, and logging throughout
Refactored all EnvelopeGenerator.Jobs files to use the EnvelopeGenerator.Jobs namespace instead of EnvelopeGenerator.CommonServices.Jobs. Updated the .csproj to remove custom content and compile includes for the Jobs folder. Switched FinalizeDocumentJob to use dependency injection for PDFBurner, PDFMerger, and ReportCreator. Improved image annotation logic in PDFBurner for better placement and scaling, and refactored form field value rendering for conditional font styling. Aliased Document as LayoutDocument in ReportCreator to avoid ambiguity. Removed the obsolete Class1.cs file and made minor type safety improvements. These changes modernize the codebase and enhance maintainability.
Added a new WorkerService project to the solution, targeting .NET 8.0 and using Microsoft.Extensions.Hosting. Implemented a Worker class that logs periodically, set up hosting in Program.cs, and included configuration files for logging and development. Updated the solution file to include and configure the new project.
Introduced new job classes for envelope processing and document finalization, including APIEnvelopeJob and FinalizeDocumentJob, both implementing Quartz IJob. Added supporting utilities for PDF annotation burning (PDFBurner), PDF merging (PDFMerger), and report generation (ReportCreator), along with related data models and exception types. Updated project references and dependencies to support Quartz scheduling, SQL Server access, and PDF manipulation with iText. This establishes a modular, extensible job-processing framework for envelope management and reporting.
Added new EnvelopeGenerator.Jobs project targeting .NET 8.0, with initial Class1.cs placeholder. Updated solution file to include the project with appropriate build configurations and solution folder nesting.
Refactored the Handle method to include a type check for PsPdfKitAnnotation before creating an annotation. This prevents errors when the notification does not contain the expected annotation type.
Refactored DocStatusHandler to assign a blank JSON object ("{}")
to the Value property when PsPdfKitAnnotation is not present or
not of the expected type, preventing potential runtime errors.
Changed PsPdfKitAnnotation in DocSignedNotification to be nullable, removing the need for the null-forgiving operator. Updated ToDocSignedNotification to accept a nullable PsPdfKitAnnotation, ensuring consistency and allowing for cases where the annotation may be absent.
Make psPdfKitAnnotation optional in CreateOrUpdate. Add validation to require an annotation for non read-and-confirm envelopes, returning BadRequest if missing.
Add logic to require all pages viewed before allowing finish when READ_AND_CONFIRM is enabled. Skip annotation and form field validations in this mode. Show warnings for unviewed pages and handle errors for save/sign actions. Update minified app to match new flow.
Only attach click handlers to btn_refresh elements when
READ_AND_CONFIRM is false. btn_complete and btn_reject
handlers remain unaffected. This change applies to both
app.js and app.min.js.
A "Refresh" button with a counterclockwise arrow icon is now shown in the envelope UI, but only when the envelope is not in read-only mode. The button uses standard styling classes for consistency.
The "reset" button in getMobileWritableItems is now only included if READ_AND_CONFIRM is falsy. This prevents the button from appearing when READ_AND_CONFIRM is true. The same conditional logic was applied to the minified ui.min.js. Code was also refactored for clarity.
When preparing the PDF for the view, only apply the Background
method if the envelope is not read-only. This ensures that
read-only envelopes are displayed without additional background
elements.
Annotations are now only loaded if READ_AND_CONFIRM is falsy.
This prevents unnecessary annotation creation in read-and-confirm
scenarios. Changes applied to both app.js and app.min.js.
Previously, page view tracking and sessionStorage updates ran unconditionally. Now, this logic is only executed when READ_AND_CONFIRM is enabled, ensuring viewed/unviewed page state is only tracked when required. Updated both source and minified files accordingly.
Added "ReadAndConfirm" to ViewData, passing the envelope's ReadOnly property to the "ShowEnvelope" view. This enables the view to adjust its behavior or UI based on whether the envelope is read-only.
The ReadOnly property logic was shifted from the Envelope entity
to the EnvelopeDto record, ensuring that read-only status is
determined at the DTO layer rather than in the data model.
Introduced a READ_AND_CONFIRM JavaScript constant in _Layout.cshtml, which reflects the server-side ViewData["ReadAndConfirm"] boolean value. This enables client-side scripts to easily check if the "ReadAndConfirm" flag is set.
Added logic to monitor which PDF pages have been viewed by the user. The list of unviewed pages and a flag for all pages viewed are stored in sessionStorage and updated as the user navigates. Changes applied to both ui.js and ui.min.js.
Refactored ui.js and ui.min.js to eliminate retrieval and logging of the total page count after loading the PSPDFKit instance. The code now returns the instance directly after setting up the page change event listener, reducing unnecessary logging and simplifying the load process.
Added a .then() handler to loadPSPDFKit to log the active page number on page change events and log the total number of pages after loading. This aids in debugging and tracking user navigation within the document.
Removed EnvelopeSigningType enum and related normalization logic. Added a ReadOnly property to Envelope that uses EnvelopeTypeId to determine read-only status. Envelope type handling now relies on EnvelopeTypeId (int?) instead of the enum.
Add conditional logic to map "ENVELOPE_TYPE" to either an int? EnvelopeTypeId (for .NET Framework) or a type-safe EnvelopeSigningType SigningType (for .NET), supporting both legacy and modern approaches.
Added ConstantsTests to verify Normalize behavior for EnvelopeSigningType, including handling of valid and out-of-range enum values using NUnit test cases. Ensures normalization logic works as expected.
All test files and utilities now use the EnvelopeGenerator.Tests.Application namespace for improved organization and clarity. No functional changes were made; updates are limited to namespaces and using directives. This makes it explicit that these are application-level tests and related helpers.
Introduced EnvelopeSigningType enum with WetSignature and ReadAndSign values in the EnvelopeGenerator.Domain.Constants namespace. Added EnvelopeSigningTypeExtensions with a Normalize method to standardize enum values.
Refactored DocSignedNotificationTests to use typed repository
retrieval and explicit service resolution for PsPdfKitAnnotation.
Added a Services property to TestBase for easier access to
IServiceProvider. These changes improve clarity and robustness
of test dependency management.
Refactored Fake.cs to configure both in-memory and SQL Server
database contexts for testing, using the "Default" connection
string from configuration. Added detailed EF logging and SQL
executor setup. In TestBase.cs, fixed Setup to use the correct
repository instance for seeding email templates.
Changed test file namespaces from EnvelopeGenerator.Tests.Application to EnvelopeGenerator.Tests for consistency. Updated DigitalData.Core.Abstraction.Application package from 1.4.0 to 1.6.0 to incorporate latest improvements.
Updated DigitalData.Core.Abstraction.Application from 1.4.0 to 1.6.0 across all relevant project files and package configs. Also updated DigitalData.Core.Infrastructure from 2.4.5 to 2.6.1 in EnvelopeGenerator.Infrastructure.csproj. No other code changes were made.