- Changed DbTriggerParams to use ICollection<string> for flexibility.
- Updated Microsoft.EntityFrameworkCore.SqlServer to version 9.0.6.
- Made _logger in EGDbContext nullable and optional in constructor.
- Updated logging statements to prevent null reference exceptions.
- Added Microsoft.EntityFrameworkCore.SqlServer package for net8.0 and net9.0.
- Introduced appsettings.migration.json for connection strings and trigger parameters.
- Added EGDbContextFactory for design-time DbContext creation.
Updated `Program.cs` to conditionally select the database connection string based on an environment variable or configuration setting. Introduced a new variable `cnnStrName` for determining the use of a migration test database.
Added a new setting `"UseDbMigration": true` in `appsettings.json` to enable the migration test database, and included the corresponding connection string as `"DbMigrationTest"`. Removed the previous `"Dev"` connection string.
Updated `IssuerSigningKeyResolver` to use array syntax for returning security keys. Changed supported culture names declaration to use square brackets and modified the creation of the `CultureInfo` list to utilize the spread operator. Adjusted exception handling to throw `InvalidOperationException` when no supported culture is found.
Added pragma directives to suppress warnings for obsolete
types when configuring user manager and envelope generator
services. Also set a logout path and enabled sliding
expiration for authentication options.
Added [Obsolete] attributes to _userService in AuthController,
_repository in EmailTemplateController, and _userRepository
in EnvelopeExecutor. These changes guide developers to
transition to using MediatR and IRepository.
This commit introduces the `[Obsolete("Use MediatR")]` attribute to various service fields and methods across multiple controllers and extension classes, signaling a transition to MediatR for handling requests and commands.
Key changes include:
- Marking `IEnvelopeService`, `IEnvelopeReceiverService`, and `IEnvelopeTypeService` as obsolete in their respective controllers.
- Updating `AddEnvelopeGeneratorInfrastructureServices` to utilize `IRepository`.
- Refactoring `AddCommandManagerRunner` and `CreateHost` methods to indicate obsolescence.
- Replacing `DigitalData.Core.DTO` with `DigitalData.Core.Abstraction.Application.DTO` in using directives.
These changes modernize the codebase and improve command and query handling while cleaning up service dependencies.
- Updated `UserManager` from `1.0.0` to `1.1.0` in
`EnvelopeGenerator.Application.csproj` and
`EnvelopeGenerator.Infrastructure.csproj`.
- Updated `DigitalData.Core.API` from `2.2.0` to `2.2.1` in
`EnvelopeGenerator.GeneratorAPI.csproj`,
`EnvelopeGenerator.Tests.Application.csproj`, and
`EnvelopeGenerator.Web.csproj`.
Updated namespaces to align with the new DigitalData.Core structure, replacing `DigitalData.Core.Abstractions` with `DigitalData.Core.Application.Interfaces` and `DigitalData.Core.Client.Interface`. Removed the `IUnique<int>` interface from several DTOs, simplifying their design and altering the handling of entity identification. Updated project files to reflect new dependency versions for improved compatibility and features. Cleaned up using directives to remove obsolete references, enhancing code maintainability.
Updated `DigitalData.Core.Abstractions` to version `4.0.0` and `DigitalData.Core.Application` to version `3.3.0` across multiple project files. Also upgraded `DigitalData.Core.Infrastructure` to version `2.1.0` in `Infrastructure.csproj`. These changes may include important bug fixes, new features, and performance improvements.
Updated project references and introduced MediatR for handling
envelope history queries. Added new mapping profile and response
class, and refactored the HistoryController to utilize the
mediator pattern for improved query handling.
- Introduced a using directive for exceptions in DocumentCreateReadSQL.cs.
- Enhanced CreateParmas method with try-catch for base64 conversion errors, throwing BadRequestException on failure.
- Added switch statement in HistoryController.cs to manage Related property in ReadHistoryQuery, setting flags for receiver and sender.
The `ReadHistoryQuery` record now includes a computed `Related` property that determines the context of the record based on the `Status` value. The constructor has been updated to remove the `Related` parameter.
Additionally, the `GetAllAsync` method in `HistoryController` has been modified to handle the `Related` property, setting the `withReceiver` boolean when the value is `ReferenceType.Receiver`.
This commit removes the conditional check for the `EmailAddress` property in the `GetReceiverName` method. As a result, the method will no longer return a `BadRequest` if `EmailAddress` is null, which may lead to unvalidated null values being passed to the `_erService.ReadLastUsedReceiverNameByMailAsync` method.
Updated repository and service interfaces to use async methods for retrieving receiver information. Changed method signatures to include optional parameters for `id` and `signature`, and made existing parameters nullable. Adjusted related service and controller implementations to ensure consistent usage of the new async methods. Improved error handling in the repository to enforce parameter requirements. Updated using directives in the repository for necessary dependencies.
Updated the `EnvelopeDto` class by removing several properties to simplify the data structure and added `AddedWhen`, `ChangedWhen`, and a nullable `EnvelopeType`.
Modified the return statement in `EnvelopeController.cs` to return `NotFound()` when no envelopes are present, enhancing the accuracy of HTTP responses.
- Added XML documentation comments to properties in `EnvelopeHistoryDto.cs`.
- Changed `EnvelopeId` to non-nullable in `ReadHistoryQuery.cs` and added `Status` parameter for filtering.
- Removed unused `using` directives in `HistoryController.cs` and updated `GetAllAsync` to filter histories by `Status`, returning `NotFound` if no results are found.
Updated MemoryCacheExtensions to accept more flexible parameters in GetEnumAsDictionary and improved the merging logic for ignored values. Simplified HistoryController by removing the logger dependency and adjusted GetReferenceTypes to include a key parameter for cache retrieval.
- Modified `GetEnumAsDictionary` to accept a key and ignores for better caching and filtering of enum values.
- Updated XML documentation in `HistoryController.cs` to correct status code descriptions.
- Adjusted `GetEnvelopeStatus` to use the new parameters for improved control over cached enum values.
Modified the `ReferenceType` enum in `Constants.vb` to change the values for `Sender` and `Receiver`. Removed the `ReferenceType` and `StatusName` properties from `EnvelopeHistory.cs`. Updated status code comments in `HistoryController.cs`, adding new codes for `EnvelopeRejected` and `EnvelopeWithdrawn`, and adjusted parameter descriptions to align with the new enum values.
Conditionally clear logging providers and set up NLog only when the application is not in the development environment. This change improves logging management based on the environment, enhancing production logging behavior.
Updated the version in `EnvelopeGenerator.GeneratorAPI.csproj` from `1.2.1` to `1.2.2` for all version elements.
Modified the `applicationUrl` in `launchSettings.json` to change the HTTPS port from `7174` to `8088`, while keeping the HTTP port at `5131`.
- Removed parameters from ReadReceiverNameQuery, simplifying its structure.
- Added null check for EmailAddress in GetReceiverName method to enhance input validation.
Removed try-catch blocks from various controller methods to simplify error handling and allow exceptions to propagate naturally. Streamlined error logging and response handling using the `ThenAsync` method, enhancing code readability and reducing redundancy. Adjusted conditional checks for improved clarity.
Introduce `ExceptionHandlingMiddleware` to capture and log exceptions globally in the application. This middleware returns appropriate JSON error responses based on specific exception types, such as `BadRequestException` and `NotFoundException`. The middleware is registered in `Program.cs` to ensure it processes all HTTP requests.
- Updated namespace for `ResetEmailTemplateCommand` and added a constructor for flexible initialization.
- Introduced `ChangedWhen` property in `UpdateEmailTemplateCommand` to track modification time.
- Refactored `UpdateEmailTemplateCommandHandler` for improved email template retrieval logic.
- Modified `EmailTemplateController` method signatures and logic for clarity and consistency.
- Added `EmailTemplate` entry in `appsettings.json` for database trigger configuration.
Implemented a new asynchronous method `GetDocResultAsync` in the `EnvelopeController` class to retrieve document results by ID. Added XML documentation for clarity on parameters and responses. Enhanced user authorization handling and error logging for improved reliability.
- Introduced a new `DocResult` property in `EnvelopeDto.cs` and `Envelope.cs` for handling binary data.
- Rearranged properties in `EnvelopeDto.cs` for better organization.
- Modified `EnvelopeController` to return a collection of envelopes instead of a single envelope.
- Introduced a static readonly field `BaseId` in `MemoryCacheExtensions.cs`.
- Refactored `GetEnumAsDictionary<TEnum>` to use expression-bodied syntax and LINQ for improved readability and efficiency.
- Removed the import statement for `Microsoft.IdentityModel.Tokens` in `HistoryController.cs`, indicating a potential shift in authentication/authorization handling.
Updated `GetEnumAsDictionary<TEnum>` in `MemoryCacheExtensions.cs` to use a loop for populating a dictionary of enum values, removing LINQ for simplicity.
Modified `HistoryController.cs` to adjust method signatures for `GetReferenceTypes` and `GetEnvelopeStatus`, allowing optional parameters for better conditional responses. Added necessary using directives.
- Updated `EnvelopeGenerator.Extensions.csproj` to include
`Microsoft.Extensions.Caching.Memory` package.
- Refactored `HistoryController` to use `IMemoryCache` for
caching functionality.
- Replaced manual dictionary creation in `GetReferenceTypes`
with a call to `GetEnumAsDictionary<ReferenceType>()`.
- Changed enum type in `GetEnvelopeStatus` to
`ReferenceType` for consistency.
- Introduced `MemoryCacheExtensions` class with
`GetEnumAsDictionary<TEnum>` method for efficient enum
to dictionary conversion.
Introduce new extension methods in `ControllerExtensions` to safely extract user information from a `ClaimsPrincipal`. Updated methods for ID, username, surname, given name, and email to return `null` if not found, enhancing flexibility. Updated `EnvelopeReceiverController` to utilize these new methods for improved handling of absent user claims.
- Removed default email assignment in Signature record.
- Eliminated unused using directive in EnvelopeReceiverController.
- Added new parameters for document execution and connection string options in the controller's constructor.
Introduced `ResetEmailTemplateCommand` and `ResetEmailTemplateCommandHandler`, replacing the previous `ResetEnvelopeTemplateCommand` and its handler. Updated the controller to utilize the new command, ensuring consistent mapping and command sending.
- Added using directive for EnvelopeGenerator.Application.SQL.
- Updated SQL command formatting to use ToSqlParam() for improved security against SQL injection.
- Modified history creation SQL command to use string interpolation for parameters.
- Removed explicit parameter addition, streamlining SQL parameter handling.
Updated the SQL command execution in `EnvelopeReceiverController.cs` to use a formatted SQL string with `string.Format` instead of parameterized commands. This change simplifies command preparation but may increase the risk of SQL injection if input values are not properly sanitized.
Updated `CreateEnvelopeReceiverResponse` and `EnvelopeReceiverController` to rename `SentRecipients` to `SentReceiver` and `UnsentRecipients` to `UnsentReceivers`. Adjusted corresponding lists and mappings to ensure uniformity in naming conventions across the codebase.
- Updated SQL query in `EnvelopeReceiverAddReadSQL.cs` to select specific columns (`ENVELOPE_ID` and `RECEIVER_ID`) for improved performance and clarity.
- Changed mapping of `SentRecipients` in `EnvelopeReceiverController.cs` to expect a single `ReceiverReadDto` instead of a collection, reflecting a change in data handling.
- Modified `QueryAsync` in `EnvelopeReceiverExecutor.cs` to remove the generic type parameter, allowing for more flexible data handling.