129 Commits

Author SHA1 Message Date
e44fa0b7bd chore Upg UserManager 2025-08-19 12:13:30 +02:00
be51ca31dd Add initial migration for database schema setup
This commit introduces the `InitialCreate` migration class, establishing the initial database schema with multiple tables including `TBDD_CLIENT_USER`, `TBDD_GROUPS`, `TBDD_MODULES`, and `TBDD_USER`. Foreign key relationships are defined to ensure referential integrity, and a `Down` method is included for rollback functionality.

Additionally, the `InitialCreate.Designer.cs` file is generated to capture the model snapshot post-migration, while the `EGDbContextModelSnapshot.cs` file is updated to reflect the current state of the database model for future migrations.
2025-07-01 17:22:13 +02:00
9a9aa2608b Refactor EnvelopeHistory and update DbContext for migrations
Removed Sender and Receiver properties from EnvelopeHistory.
Added ActionDate and Comment properties. Introduced IsMigration
property in EGDbContext to conditionally configure foreign key
relationships for EnvelopeHistory. Updated EGDbContextFactory
to set IsMigration during context creation for migration operations.
2025-07-01 16:38:42 +02:00
349d65d050 Update DbTriggerParams and EF Core package versions
- 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.
2025-07-01 13:07:40 +02:00
351cead423 Update Entity Framework packages and add Design package
The project file `EnvelopeGenerator.Infrastructure.csproj` has been modified to include the `Microsoft.EntityFrameworkCore.Design` package for net7.0, net8.0, and net9.0, with appropriate configurations for `PrivateAssets` and `IncludeAssets`. Additionally, the versions of `Microsoft.EntityFrameworkCore` and `Microsoft.EntityFrameworkCore.Relational` have been updated for net8.0 (from 8.0.15 to 8.0.17) and net9.0 (from 9.0.5 to 9.0.6).
2025-06-30 15:59:35 +02:00
47d190d9ea Remove UserReceiver repository registration 2025-06-30 14:23:20 +02:00
35f46d3182 Remove UserReceiver repository and related entities
This commit removes the `IUserReceiverRepository` service registration from `DIExtensions`, indicating it is no longer needed. The `UserReceiver` and `Config` DbSet properties have been eliminated from the `EGDbContext`, along with their initialization in the constructor. Additionally, the `UserReceiver` entity has been removed from the model builder configuration and the associated trigger has been deleted. These changes reflect a refactoring of the data model to simplify the architecture and improve maintainability.
2025-06-30 14:23:00 +02:00
b9f5ae826a Deprecate user service interfaces in controllers
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.
2025-06-30 14:05:36 +02:00
1c51fafb69 Remove UserReceiver functionality and related components
This commit marks the `IUserReceiverRepository` and `IUserReceiverService` as obsolete and removes their implementations. The `UserReceiverDto`, `UserReceiver`, `UserReceiverService`, and `UserReceiverRepository` classes have been deleted, along with their mappings in the `MappingProfile`. Additionally, the `TestUserReceiverController` has been removed, reflecting the complete removal of user receiver functionality from the codebase.
2025-06-30 13:44:43 +02:00
94d43bce24 Deprecate repositories and update service interfaces
- Marked `IEnvelopeReceiverRepository` and several repository classes as obsolete, recommending the use of `IRepository`.
- Corrected `using` directive in `IReceiverService.cs`.
- Removed `UpdateAsync` method from `IReceiverService`.
- Enhanced `ISmsSender` interface with new properties and methods.
- Updated `ReceiverCreateDto`, `ReceiverReadDto`, and `UserReceiverDto` to enforce non-nullable properties.
- Refactored `TestReceiverController` to suggest using `MediatR`.
2025-06-30 13:37:54 +02:00
1c90e693da Deprecate services in favor of MediatR integration
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.
2025-06-30 10:05:36 +02:00
f039437f4c Merge master branch 2025-06-27 14:43:02 +02:00
2a4255e5a3 Refactor status parameter to use EnvelopeStatus type
Updated IEnvelopeHistoryRepository and IEnvelopeHistoryService
interfaces to replace int? status with Constants.EnvelopeStatus?
status in CountAsync and ReadAsync methods. Adjusted
ReadHistoryQueryHandler and EnvelopeHistoryService methods to
accommodate the new type. Modified EnvelopeHistoryRepository
to accept Constants.EnvelopeStatus? in relevant methods and
marked it as obsolete, suggesting a future refactor.
2025-06-27 09:17:03 +02:00
5c48afd8b0 Update package versions and clean up code
- Bump `UserManager` package to version `1.1.1` in
  `EnvelopeGenerator.Application.csproj` and
  `EnvelopeGenerator.Infrastructure.csproj`.
- Add reference to `DigitalData.UserManager.Domain` version
  `3.2.1.0` and `System.ComponentModel.Annotations` version
  `4.7.0` in `EnvelopeGenerator.CommonServices.vbproj`.
- Add reference to `System.Drawing.Common` version `4.7.3`
  in `EnvelopeGenerator.CommonServices.vbproj`.
- Update `UserManager.Domain` package to version `3.2.1`
  in `EnvelopeGenerator.Domain.csproj`.
- Remove unused properties from `EGUser` class in
  `EGUser.cs`.
- Mark `EnvelopeReceiverRepository` as obsolete, suggesting
  to use `Repository` instead.
- Update `packages.config` to include new package versions.
2025-06-26 16:05:16 +02:00
db05183137 Update package versions for UserManager and DigitalData.Core.API
- 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`.
2025-06-26 14:17:48 +02:00
452077e86a Enhance error reporting for envelope creation failure
Added detailed parameter information to the error message
in `InvalidOperationException` for better debugging context
when envelope creation fails.
2025-06-26 11:56:49 +02:00
Developer 02
3c60f31050 Refactor: Aktualisierung von APIs und Anwendungsschichten zur Umsetzung von Änderungen im Bereich 2025-05-28 12:55:11 +02:00
Developer 02
c1d46b446a refactor(EnvelopeGenerator.Common): umbenennen in EnvelopeGenerator.CommonService 2025-05-26 11:14:12 +02:00
Developer 02
31c4a8a20f chore(EnvelopeGenerator.Domain): DigitalData.EmailProfilerDispatcher.Abstraction.Attributes hinzufügen.
- Aktualisieren Sie DigitalData.EmailProfilerDispatcher & -.Abstraction in verwandten Projekten.
2025-05-20 16:59:26 +02:00
Developer 02
08e1187124 Refactor namespaces and simplify DTOs
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.
2025-05-20 15:14:58 +02:00
Developer 02
1b923dc93b Update DigitalData.Core package references
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.
2025-05-20 10:58:57 +02:00
Developer 02
05867cc645 Update DIExtensions for enhanced DbContext configuration
Modified the `AddEnvelopeGeneratorInfrastructureServices` method to accept a service provider, allowing for more complex DbContext configurations. Added a using directive for `Microsoft.Extensions.DependencyInjection` in `Program.cs`. Updated the method call to utilize the new signature, enabling logging of SQL commands and sensitive data during database operations.
2025-05-12 16:35:48 +02:00
Developer 02
c1bce7c639 Refactor receiver methods for async support
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.
2025-05-12 09:38:29 +02:00
Developer 02
406ddfb226 Update package references and improve code readability
- Added `Microsoft.Data.SqlClient` v5.1.1 to `EnvelopeGenerator.Application.csproj` for enhanced database compatibility.
- Refactored `ReadByUuidSignatureAsync` in `EnvelopeReceiverRepository` to improve query construction and execution clarity.
- Simplified error handling in `HomeController` by replacing `ThenAsync` with a more direct approach for processing results.
- Removed `System.Data.SqlClient` v4.8.5 and added `System.Diagnostics.PerformanceCounter` v7.0.0 in `EnvelopeGenerator.Web.csproj` to focus on performance monitoring.
2025-05-10 03:47:55 +02:00
Developer 02
41e0c51055 Refactor DocumentCreateReadSQL to remove envelope_uuid
Updated CreateParmas method to accept only base64 string.
Converted base64 to byte array and added it as ByteData.
Adjusted SQL command and DocumentExecutor to reflect these changes.
2025-05-07 18:14:06 +02:00
Developer 02
1875acb7b5 Refactor SQL queries and data mappings
- 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.
2025-05-07 14:10:20 +02:00
Developer 02
6bdf0d5220 Enhance SQL parameter handling in CreateDocumentAsync
Updated the CreateDocumentAsync method in the DocumentExecutor class to use ToSqlParam() for formatting SQL query parameters. This change improves security by preventing potential SQL injection vulnerabilities associated with direct variable insertion into the SQL string.
2025-05-07 13:28:06 +02:00
Developer 02
ad855b77cd Refactor SQL execution in DocumentCreateReadSQL
Changed namespace for DocumentCreateReadSQL and updated SQL command to use formatted strings for parameters. Simplified DocumentExecutor to directly use the formatted SQL, enhancing clarity and reducing complexity in parameter handling.
2025-05-07 13:21:17 +02:00
Developer 02
a781440252 Refactor EnvelopeReceiverExecutor dependencies
Added the namespace `EnvelopeGenerator.Application.Contracts.Repositories` and removed the unused `Microsoft.Extensions.Logging` import in `EnvelopeReceiverExecutor.cs` to streamline code dependencies.
2025-05-07 13:15:15 +02:00
Developer 02
5fc689ee4d Refactor SQL query execution in AddEnvelopeReceiverAsync
Updated the SQL query execution in the EnvelopeReceiverExecutor class to use a formatted SQL string directly with parameters instead of a parameterized query method. This change simplifies the execution but may introduce SQL injection risks and affect performance.
2025-05-07 13:14:40 +02:00
Developer 02
38d05850e3 Refactor CreateEnvelopeAsync to use string formatting
Updated the `CreateEnvelopeAsync` method in the `EnvelopeExecutor` class to handle SQL parameters by directly formatting the SQL string with `string.Format`, replacing the previous parameterized query approach. This change enhances readability but may introduce potential SQL injection risks if not managed carefully.
2025-05-07 13:11:52 +02:00
Developer 02
cc86e5fadd Organize EnvelopeReceiverController and add DocumentExecutor
Updated `EnvelopeReceiverController` with new regions for
creating envelopes and managing recipients, improving code
readability. Added service registration for `IDocumentExecutor`
in `DependencyExtensions.cs` to enhance document management.
2025-05-07 01:32:21 +02:00
Developer 02
bce29aa31a Add IDocumentExecutor interface and DocumentExecutor class
Introduces the `IDocumentExecutor` interface with a method
`CreateDocumentAsync` for asynchronous document creation.
Implements the `DocumentExecutor` class that inherits from
`SQLExecutor`, providing the functionality to create documents
using a SQL connection and handle potential errors during
the process.
2025-05-07 01:29:21 +02:00
Developer 02
21859ca6e6 Refactor ReadHistoryQuery and optimize repository queries
- Changed `EnvelopeId` in `ReadHistoryQuery` to nullable
  for improved flexibility in queries.
- Introduced `withReceiver` variable in `HistoryController`
  to enhance query logic for retrieving history records.
- Updated `EnvelopeHistoryRepository` to use `AsNoTracking()`
  for better performance in read-only scenarios.
2025-05-06 23:23:33 +02:00
Developer 02
42451a767b Refactor SQL command and simplify constructor
Updated the `EnvelopeReceiverAddReadSQL` class to correct the formatting of the `@EMAIL_ADRESS` parameter in the SQL command string and improved the XML documentation comments for better readability.

Modified the `EnvelopeReceiverExecutor` class by removing the `ILogger<EnvelopeExecutor>` parameter from the constructor, simplifying its signature while retaining necessary dependencies.
2025-05-06 17:06:24 +02:00
Developer 02
cae00d9177 Refactor EnvelopeExecutor to use IUserRepository
Updated the EnvelopeExecutor class to replace the IEnvelopeRepository dependency with IUserRepository. Modified the constructor and adjusted the CreateEnvelopeAsync method to return the envelope with associated user information instead of retrieving it from the repository.
2025-05-06 14:53:23 +02:00
Developer 02
8c2550ff1d Refactor envelope and receiver methods for clarity
- Changed return type of `CreateEnvelopeAsync` to ensure a non-null `Envelope` is always returned.
- Updated `AddEnvelopeReceiverAsync` to allow nullable `salutation` parameter.
- Renamed cancellation token parameter in `CreateEnvelopeReceiverCommandHandler` for consistency.
- Enhanced error handling in `CreateEnvelopeAsync` to throw exceptions on failure with improved messages.
- Adjusted `CreateParameters` method to accept nullable `salutation`.
2025-05-06 12:05:24 +02:00
Developer 02
b5b9155bc0 Refactor envelope creation methods and parameter handling
- Updated `Extension.cs` to remove old methods and introduce a new parameter creation method.
- Modified `IEnvelopeExecutor.cs` to change `CreateEnvelopeAsync` signature for clarity.
- Added a consistent `CreateParmas` method in `EnvelopeCreateReadSQL.cs`.
- Changed service registration in `DependencyExtensions.cs` from singleton to scoped.
- Revised `CreateEnvelopeAsync` in `EnvelopeExecutor.cs` to utilize the new parameter structure and removed user addition logic.

These changes enhance code clarity, maintainability, and consistency in parameter handling.
2025-05-06 11:24:14 +02:00
Developer 02
37032a48c9 Enhance envelope receiver functionality and documentation
Updated IEnvelopeReceiverExecutor with XML comments for
AddEnvelopeReceiverAsync method and added necessary using
directives. Introduced XML documentation for CreateParameters
in EnvelopeReceiverAddReadSQL. Modified
AddEnvelopeReceiverAsync in EnvelopeReceiverExecutor to
accept individual parameters, improving clarity and usability.
2025-05-06 10:45:54 +02:00
Developer 02
82fc7fa762 Refactor EnvelopeReceiverExecutor and Repository methods
- Updated `EnvelopeReceiverExecutor` to inherit from `SQLExecutor` and added `_erRepository` for enhanced data access.
- Introduced `AddEnvelopeReceiverAsync` method for retrieving envelope receivers.
- Modified `ReadById` in `EnvelopeReceiverRepository` to support flexible querying with new parameters.
- Updated `ReadByIdAsync` to align with changes in `ReadById`.
2025-05-06 10:33:17 +02:00
Developer 02
749366fff5 Refactor DI for Envelope services and add new executor
Updated DIExtensions to register IEnvelopeExecutor as a singleton and added IEnvelopeReceiverExecutor as a new singleton service. Introduced IEnvelopeReceiverExecutor interface and implemented it in the new EnvelopeReceiverExecutor class for future envelope processing functionality.
2025-05-06 09:59:18 +02:00
Developer 02
b609253893 Revert "Refactor envelope handling to use ISQLExecutor"
This reverts commit 4cabaf31917c8860411349c0e5fc1c62e7c5c384.
2025-05-06 09:45:38 +02:00
Developer 02
4cabaf3191 Refactor envelope handling to use ISQLExecutor
This commit removes the IEnvelopeExecutor interface and its implementation, replacing it with ISQLExecutor. The CreateEnvelopeAsync method in Extension.cs now directly creates DynamicParameters. The CreateEnvelopeCommandHandler has been updated to utilize ISQLExecutor. Additionally, the EnvelopeExecutor class has been removed, and a new SQL command class, EnvelopeReceiverCreateReadSQL, has been added for managing envelope receiver SQL operations.
2025-05-06 01:30:59 +02:00
Developer 02
3955a3232d Refactor envelope creation SQL logic
Removed `CreateEnvelopeSQL` and introduced `EnvelopeCreateReadSQL` to handle envelope creation logic. Updated the `Extension` class methods and modified `CreateEnvelopeAsync` in `EnvelopeExecutor` to utilize the new SQL class.
2025-05-05 16:30:39 +02:00
Developer 02
b93ba6be17 Refactor envelope creation logic and add IEnvelopeExecutor
Updated CreateEnvelopeCommandHandler to use IEnvelopeExecutor for managing envelope creation. Introduced CreateParmas method for parameter handling in CreateEnvelopeSQL. Corrected Dapper type mapping method name and added service registration for IEnvelopeExecutor in DependencyExtensions. Refactored SQLExecutor to enhance encapsulation. Created EnvelopeExecutor class implementing IEnvelopeExecutor for dedicated envelope operations.
2025-05-05 16:11:29 +02:00
Developer 02
39ff4b8867 Refactor envelope creation logic and SQL execution
- Changed `_sqlExecutor` type in `CreateEnvelopeCommandHandler` to non-generic `ISQLExecutor`.
- Updated `Handle` method to use `CreateEnvelopeAsync` for simplified parameter handling.
- Restructured `CreateEnvelopeSQL` to implement `ISQL<Envelope>` with a raw SQL command for creating envelopes.
- Added `SetDappeTypeMap<TModel>` method in `DependencyExtensions` for Dapper type mappings.
- Improved overall code structure for better separation of concerns and maintainability.
2025-05-05 13:53:31 +02:00
Developer 02
7b7aba6efd Refactor SQL execution classes into new namespace
Restructure and refactor classes related to SQL execution within the `EnvelopeGenerator.Infrastructure` namespace. Key changes include:
- Added `EnvelopeGenerator.Infrastructure.Executor` namespace.
- Moved and redefined `Query`, `QueryExtension`, `SQLExecutor`, `SQLExecutorBaseEntity`, and `SQLExecutorParams` classes to the new namespace.
- Maintained existing functionality while improving code organization and clarity.
2025-05-05 10:54:09 +02:00
Developer 02
a42e4287ff Refactor envelope generator service dependencies
This commit replaces the `AddEnvelopeGeneratorRepositories` method with `AddEnvelopeGeneratorInfrastructureServices`, allowing for more flexible configuration through `IConfiguration` and `Action<SQLExecutorParams>`. The `SQLExecutor` class now utilizes `SQLExecutorParams` for its connection string, enhancing configurability. A new `SQLExecutorParams` class has been introduced to encapsulate connection string management. Various service registration calls have been updated to integrate the new infrastructure services, improving modularity and ease of database connection management.
2025-05-05 10:47:00 +02:00
Developer 02
a757749767 Refactor SQL execution and enhance envelope creation
- Updated `ISQLExecutor<TEntity>` to inherit from new `ISQLExecutor` interface for improved SQL execution flexibility.
- Added package references for `Dapper` and `DigitalData.Core` in project files.
- Modified `CreateEnvelopeCommand` to include `[BindNever]` on `UserId` for better model binding control.
- Refactored `CreateEnvelopeCommandHandler` to use `DynamicParameters` for SQL parameter handling.
- Updated `CreateEnvelopeSQL` to select only the top record for performance.
- Introduced `GetIdOrDefault` method in `ControllerExtensions` for user ID retrieval with fallback.
- Added `CreateAsync` method in `EnvelopeController` for envelope creation using `IMediator`.
- Ensured infrastructure project has necessary package references.
- Refactored `SQLExecutor` to implement new interface and simplified constructor.
- Introduced `SQLExecutorBaseEntity` for entity-specific SQL command execution.
2025-05-05 10:15:36 +02:00
Developer 02
7cffc3f7bc fix: Change SQLExecutor service registration to scoped
Updated the `AddSQLExecutor<T>` method in the `DIExtensions` class to register `ISQLExecutor<T>` as a scoped service instead of a singleton. This ensures that a new instance of `SQLExecutor<T>` is created for each request within the same scope, improving resource management and request isolation.
2025-05-05 00:36:00 +02:00