260 Commits

Author SHA1 Message Date
Developer 02
8b4ad5e28d Refactor email template commands and controller logic
- 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.
2025-05-08 17:47:18 +02:00
Developer 02
09a231d01f Add GetDocResultAsync method to EnvelopeController
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.
2025-05-08 16:36:26 +02:00
Developer 02
2007ae91fb Add DocResult property and update EnvelopeController
- 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.
2025-05-08 15:46:02 +02:00
Developer 02
0698b44b68 Refactor MemoryCacheExtensions and clean up HistoryController
- 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.
2025-05-08 13:52:57 +02:00
Developer 02
7fefc68061 Refactor enum handling in MemoryCache and HistoryController
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.
2025-05-08 12:00:48 +02:00
Developer 02
3035ec7e9c Add memory caching support in HistoryController
- 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.
2025-05-08 11:30:46 +02:00
Developer 02
3a1fe45524 Add "OrDefault" methods for user claim retrieval
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.
2025-05-08 10:56:46 +02:00
Developer 02
d873d6dcf1 Refactor Signature record and update EnvelopeReceiverController
- 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.
2025-05-08 09:47:03 +02:00
Developer 02
b15616cf53 Refactor email template command and handler
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.
2025-05-07 16:07:43 +02:00
Developer 02
9a71d2b805 Enhance SQL handling in EnvelopeReceiverController
- 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.
2025-05-07 15:09:00 +02:00
Developer 02
5f8e8deb5b Refactor SQL parameter handling in EnvelopeReceiverController
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.
2025-05-07 15:03:27 +02:00
Developer 02
c8f21be905 Rename recipient properties for consistency
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.
2025-05-07 14:26:50 +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
55b01cf396 Refactor command records and simplify document handling
- Updated `ReceiverGetOrCreateCommand` to include a required `IEnumerable<Signature>`.
- Modified `DocumentCreateCommand` to remove `DataAsByte` and enforce a required `DataAsBase64` property with immutability.
- Cleaned up SQL command formatting in `EnvelopeReceiverAddReadSQL`.
- Simplified document validation logic in `EnvelopeReceiverController` by removing redundant checks.
- Changed hardcoded connection string to a variable `_cnnStr` for improved security and flexibility.
2025-05-07 12:04:01 +02:00
Developer 02
49ccd9fef2 Add using directives and update CreateAsync method
- Added `System.ComponentModel` and `System.ComponentModel.DataAnnotations.Schema` using directives for enhanced data annotation support.
- Applied the `[NonAction]` attribute to the `CreateAsync` method to prevent it from being treated as an action method by the ASP.NET MVC framework.
2025-05-07 10:22:21 +02:00
Developer 02
f877910a73 Bump version to 1.2.1 in project file
Updated the `EnvelopeGenerator.GeneratorAPI.csproj` file to reflect the new versioning information, changing `Version`, `FileVersion`, and `AssemblyVersion` from `1.2.0` to `1.2.1`.
2025-05-07 02:18:33 +02:00
Developer 02
f6f4137332 Add history creation functionality to EnvelopeReceiverController
Updated the `EnvelopeReceiverController` to include a new region for creating history. Added a SQL command to insert a history state into the database, established a database connection, and executed the command within a `using` block. The result is read to check for success, and the method now returns an `Ok` response with the result.
2025-05-07 02:17:49 +02:00
Developer 02
486b717801 Update signature handling and database connection management
- Changed `Signature` properties from `int` to `double` for precise positioning.
- Added necessary using directives in `EnvelopeReceiverController.cs` for database operations.
- Introduced a private `_cnnStr` field in `EnvelopeReceiverController` to store the connection string.
- Updated the constructor to accept `IOptions<ConnectionString>` for dependency injection of the connection string.
- Added a SQL command block to handle document element additions using a stored procedure.
- Configured the `ConnectionString` class in `Program.cs` to bind the connection string from app settings.
- Created a new `ConnectionString` class to manage the connection string value.
2025-05-07 02:13:26 +02:00
Developer 02
f2a09ea10e Refactor DocumentCreateCommand and enhance validation
Updated the `DocumentCreateCommand` record to include a nullable `DataAsBase64` property for better encapsulation. Enhanced the `EnvelopeReceiverController` with logic to validate document data, ensuring that either `DataAsBase64` or `DataAsByte` is provided, but not both. Introduced a new static method `IsBase64String` to validate base64 string format.
2025-05-07 01:57:22 +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
613b2130a5 Refactor email template handling and error management
- Updated EmailTemplateDto to allow mutable Body and Subject properties.
- Implemented IRequest interface in UpdateEmailTemplateCommand for MediatR.
- Enhanced error handling in EmailTemplateController with NotFoundException.
- Introduced UpdateEmailTemplateCommandHandler for processing update commands.
- Added NotFoundException class for improved error handling.
2025-05-07 01:02:30 +02:00
Developer 02
e4eb3e1192 Refactor email template command and controller
Updated namespace for `ResetEnvelopeTemplateCommand` and added default values for constructor parameters. Enhanced `EmailTemplateController` by making the `Update` method asynchronous, adding error handling, and incorporating a `try-catch` block for improved responsiveness and error management.
2025-05-07 00:35:43 +02:00
Developer 02
1c4f7f2386 Enhance envelope filtering in EnvelopeController
Updated the success handler to filter envelopes by Id, Status, and Uuid based on the provided envelope object. The method now returns the specific envelope instead of a list of envelopes.
2025-05-07 00:27:34 +02:00
Developer 02
a7e4d6e58f Enhance ReadByUsernameAsync with new query parameters
Updated IEnvelopeReceiverService to include EnvelopeQuery and ReadReceiverQuery in ReadByUsernameAsync for improved filtering capabilities. Modified EnvelopeReceiverService to implement these changes, allowing for more precise data retrieval. Updated EnvelopeReceiverController to pass the new parameters when calling the service method.
2025-05-07 00:17:18 +02:00
Developer 02
b9c4f7da1c Enhance ReadByUsernameAsync with status filtering
Updated the `ReadByUsernameAsync` method in the `EnvelopeReceiverController` to accept additional parameters: `min_status`, `max_status`, and `ignore_statuses`. These parameters are now derived from the `envelopeReceiver` object, allowing for improved status filtering when retrieving records by username.
2025-05-07 00:03:01 +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
a76a079736 Enhance Get method in ReceiverController
Updated the Get method to check for receiver.Id along with EmailAddress and Signature.
If Id is provided, it attempts to read by ID and returns NotFound if not found.
If Id is not provided, it falls back to reading by EmailAddress and Signature,
now also returning NotFound instead of a 500 error for missing receivers.
2025-05-06 22:26:26 +02:00
Developer 02
d2c45f71a0 Refactor email template query handling with MediatR
- Updated `ReadEmailTemplateQuery` to implement `IRequest<ReadEmailTemplateResponse?>`.
- Changed `ReadEmailTemplateResponse` from a record to a class with updated properties.
- Enhanced `EmailTemplateController` to inject `IEmailTemplateRepository` and `IMediator`, and made the `Get` method asynchronous.
- Introduced `ReadEmailTemplateMappingProfile` for AutoMapper mappings.
- Added `ReadEmailTemplateQueryHandler` to manage query logic and response mapping.

These changes improve the structure and maintainability of the email template querying process.
2025-05-06 19:06:21 +02:00
Developer 02
2692fee6d2 Enhance envelope creation functionality and configuration
- Updated DependencyInjection to include new command handler.
- Modified CreateEnvelopeReceiverCommand for nullable responses.
- Altered SQL command in EnvelopeReceiverAddReadSQL.
- Refactored EnvelopeReceiverController with new dependencies and improved CreateAsync method.
- Expanded appsettings.json with additional configuration settings.
- Introduced new DTOs for signatures and receivers in CreateEnvelopeReceiverDtos.
2025-05-06 16:11:02 +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
3ae1b94eb7 refactor(Login): Id in UserId umbenennen 2025-04-29 11:39:21 +02:00
Developer 02
3d1966a715 feat(Jenkinsfile): Als Beispiel erstellt 2025-04-29 09:34:57 +02:00
Developer 02
c173814b8d refactor(AuthController): Login-Methoden aktualisieren, um NotImplementedException zu werfen, nur um Swagger-Dokumentation bereitzustellen 2025-04-29 09:21:05 +02:00
Developer 02
a85397a363 refactor(auth): Refactoring der Login-Methoden für OpenAPI-Kompatibilität
– Die Login-Methoden wurden überarbeitet, um NotImplementedException auszulösen und OpenAPI (Swagger) und Skalar zu konfigurieren.
– Unnötige using-Anweisungen wurden entfernt, um den Code zu optimieren.
2025-04-28 16:49:46 +02:00
Developer 02
2d3987b81e Add JWT Bearer authentication support
- Integrated JWT Bearer authentication for API security.
- Replaced previous CookieAuthenticationDefaults with JwtBearerDefaults as the default authentication scheme.
- Configured JWT token validation with issuer, audience, and signing key parameters.
- Added handling for token retrieval from cookies or query strings when missing in the header.
- Updated the authentication configuration to support both Cookie and JWT authentication schemes.
- Enhanced security by validating JWT tokens against provided public keys.
2025-04-28 16:18:31 +02:00
Developer 02
875ff95278 feat(AuthTokenKeys): Erstellt, um Parameter für Authentifizierungs-Tokens zu konfigurieren.
- AuthTokenKeys aus der Konfiguration in Program.cs lesen.
 - Upgrade von Core.Abstractions auf 3.5
2025-04-28 15:49:40 +02:00
Developer 02
dcdf0844cb feat(Program): DeferredServiceProvider-Instanz erstellen und Fabrik einstellen 2025-04-28 15:08:07 +02:00
Developer 02
27e9de4709 chore(Core.Abstraction): Aktualisiert auf 3.4.4 2025-04-28 15:02:49 +02:00
Developer 02
e2bdc73b76 chore: auth-hub-client hinzufügen und konfigurieren 2025-04-28 14:15:45 +02:00
Developer 02
7abb3a6c8a chore(deps): NuGet-Paketversionen aktualisieren und DigitalData.Auth.Client hinzufügen 2025-04-28 10:47:55 +02:00
Developer 02
ebb248969c fix(DIExtensions): AutoMapper-Konfiguration von UserManager hinzugefügt.
- In das Hauptverzeichnis des Projekts verschoben.
 - Umbenennen in DependencyInjection
2025-04-23 09:27:03 +02:00
Developer 02
ba8394c749 feat(EnvelopeGenerator.Terminal): Downgrade to .net 7 2025-04-23 00:49:15 +02:00
Developer 02
975beff416 feat(ReadDocumentQueryHandler): Logik hinzugefügt 2025-04-22 23:16:22 +02:00
Developer 02
d3db1e74fa chore: aktualisierte Baget-Pakete 2025-04-22 21:06:36 +02:00
Developer 02
ba4a57512f Refaktorierung der Dienste und Aktualisierung der Paketabhängigkeiten
- Vereinfachte `IEnvelopeHistoryService`, `IEnvelopeReceiverReadOnlyService` und `IReceiverService` Schnittstellen durch Entfernung unnötiger generischer Parameter.
- Aktualisierte `EnvelopeHistoryService`, `EnvelopeReceiverReadOnlyService` und `ReceiverService` Klassen, um sie an die Schnittstellenänderungen anzupassen.
- Aktualisierte Paketverweise in mehreren Projektdateien, mit Schwerpunkt auf `DigitalData.Core` und `UserManager`.
- Hinzufügen von `DbSet<ClientUser>` zu `EGDbContext` und Einführung neuer privater Felder.
- Verfeinerung von `TestControllerBase` durch Entfernung überflüssiger Typ-Parameter in Constraints.
- Insgesamt verbessern diese Änderungen die Klarheit des Codes und gewährleisten die Kompatibilität mit aktualisierten Bibliotheken.
2025-04-16 14:25:57 +02:00
Developer 02
c61b497ef2 Update target framework and clean up using directives
Changed target frameworks in `EnvelopeGenerator.GeneratorAPI.csproj` to only `net9.0`. Removed unused `using System.Reflection;` directive in `Program.cs` to streamline the code.
2025-04-14 10:49:51 +02:00
Developer 02
1ece216a27 merge with master 2025-04-14 10:39:34 +02:00
Developer 02
8f6847c060 chore: Aktualisierung der Version auf 1.2.0 für das GeneratorAPI-Projekt 2025-04-14 10:36:25 +02:00
Developer 02
0dc65a53b5 chore: Hinzufügen von IIS-Veröffentlichungsprofilen für .NET 7 und .NET 9 2025-04-14 10:02:03 +02:00