Compare commits

448 Commits

Author SHA1 Message Date
425d21084b Refactor TestSanitizeController for improved clarity
- Updated namespace for consistency.
- Changed constructor and method parameters to non-nullable strings.
- Enhanced method signatures for `Sanitize` and `Encoder`.
- Improved overall class structure and formatting for better readability.
2025-06-30 14:13:36 +02:00
6aeba4d1e7 Deprecate methods and streamline controller code
Added [Obsolete("Use MediatR")] attribute to several methods
across `DocumentController`, `HomeController`,
`TestConfigController`, `TestDocumentReceiverElementController`,
and `TestEnvelopeController` to indicate they should no longer
be used.

Refactored constructors in `TestConfigController` and
`TestEnvelopeController` to remove unnecessary empty blocks.

Improved formatting and structure of the `GetAll` method in
`TestEnvelopeController` for better clarity while maintaining
functionality.

Updated `Program.cs` to suppress warnings about obsolete
types/members during service registrations, indicating a
transition to newer implementations.
2025-06-30 14:11:56 +02:00
6930d7a431 Mark CommandManager as obsolete; add warning suppression
Updated `CommandManager` to mark the `_envelopeReceiverService` field and its constructor as obsolete, recommending the use of `MediatR`. Added a new obsolete property `EnvelopeReceiver` for accessing the service. In `Program.cs`, added warning suppression for the obsolete member during command manager runner registration.
2025-06-30 14:07:39 +02:00
c453a1650a Suppress obsolete warnings and update auth options
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.
2025-06-30 14:06:26 +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
532dc41004 Remove DocumentPath, add SignatureHost to Config
Removed the `DocumentPath` property from the `Config` class. Added a new required property `SignatureHost` of type `string`, mapped to the database column `SIGNATURE_HOST` (nvarchar(128)). Other properties remain unchanged.
2025-06-30 14:01:30 +02:00
13899cf70a Refactor ConfigDto class and update properties
- Change namespace to `EnvelopeGenerator.Application.DTOs`
- Remove `DocumentPath` property
- Update `SignatureHost` to be a required string
2025-06-30 13:59:18 +02:00
9756303d6e Refactor repositories and enhance documentation
- Mark `IEmailTemplateRepository` and `_repository` in `ReadEmailTemplateQueryHandler` as obsolete, suggesting the use of `IRepository`.
- Update `ResetEmailTemplateCommand` with additional documentation and examples for `Type`.
- Change return type of `CreateEnvelopeReceiverCommand` to `IRequest<CreateEnvelopeReceiverResponse>`.
- Improve caching methods in `CacheExtensions.cs` for better functionality and clarity.
- Add XML documentation to the `Ok` method in `MappingExtensions`.
- Make `UserReference` property required in `ReadHistoryResponse`.
2025-06-30 13:56:49 +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
e3cb2ec219 Add new library references and update packages
- Added references to `DigitalData.UserManager.Domain` v3.2.2.0, `System.ComponentModel.Annotations` v4.2.1.0, and `System.Drawing.Common` v4.0.0.2 in `EnvelopeGenerator.Form.vbproj`.
- Updated `packages.config` to include `System.ComponentModel.Annotations` v4.7.0, `System.Drawing.Common` v4.7.3, and `UserManager.Domain` v3.2.2.
2025-06-30 11:27:26 +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
e4c6714677 Behebung von Post-Merge-Fehlern.
- CommonServices in den Ordner core verschieben
2025-06-27 14:51:50 +02:00
812b49cfcb Merge master branch 2025-06-27 14:43:47 +02:00
f039437f4c Merge master branch 2025-06-27 14:43:02 +02:00
6f73ba929c Refactor controllers and update envelope status handling
- Updated `TestEnvelopeHistoryController` to use `EnvelopeStatus` for status parameters and marked it as obsolete.
- Modified `TestViewController` with new route attributes, simplified constructor, and improved error handling in HTTP methods.
- Cleaned up `DebugEnvelopes.cshtml` by removing unnecessary using directives and ensuring type safety in envelope grouping.
2025-06-27 13:51:51 +02:00
fcbe956095 Refactor controllers and views for MediatR integration
Updated several C# controllers to use the new
`DigitalData.Core.Abstraction.Application.DTO` namespace
and removed references to `DigitalData.Core.DTO`. Added
`[Obsolete("Use MediatR")]` attributes to indicate a shift
towards MediatR for request handling. Improved error
handling and code organization in key methods. Updated
Razor view files to reflect namespace changes for
consistency across the application.
2025-06-27 13:24:12 +02:00
e628309734 Refactor TestEnvelopeMailController for clarity
Updated using directives, added Obsolete attributes, and improved error handling in SendAccessCode method. Enhanced code clarity while preserving overall structure.
2025-06-27 13:14:14 +02:00
d6cbd0597e Mark TestEnvelopeDocumentController as obsolete
The `TestEnvelopeDocumentController` class has been marked as obsolete, with a recommendation to use MediatR instead. This change reflects a shift in the architecture, promoting the use of MediatR for handling requests and responses in the application.
2025-06-27 13:12:14 +02:00
9d45082bfc Refactor TestEmailTemplateController and update namespaces
- Updated `using` directives to include new namespaces.
- Marked `TestEmailTemplateController` as obsolete with a suggestion to use MediatR.
- Simplified the constructor by removing an empty block.
- Modified `GetAll` method to include `[HttpGet]` and `[Obsolete]` attributes while retaining functionality.
- Added a non-action `GetAll` method that overrides the base implementation.
2025-06-27 13:11:40 +02:00
3304b01d7b Refactor TestDocumentStatusController
Added [Obsolete] attribute to indicate replacement with MediatR. Updated constructor to include logger parameter and removed empty constructor body for clarity.
2025-06-27 13:09:13 +02:00
f5d33846d5 Refactor TestControllerBase and update using directives
Consolidated using directives and removed unnecessary ones.
Added attributes to the namespace declaration for API routing
and deprecation notice. Simplified the class definition by
removing the IUnique<TId> constraint and cleaned up the
constructor by eliminating empty braces.
2025-06-27 12:13:13 +02:00
231140505e Refactor ReadOnlyController to use MediatR
Updated service dependencies to use MediatR, marking
several fields and methods as obsolete. Modified import
statements to include new namespaces and removed old
ones. Adjusted the CreateAsync method to correctly
access IDs and updated the RecordAsync call to use
the new EnvelopeStatus reference. These changes
enhance code maintainability and align with modern
architectural patterns.
2025-06-27 12:08:30 +02:00
62a73e4967 Refactor HomeController for MediatR and domain model
- Added new using directives for domain-driven design.
- Marked several fields and methods as obsolete to transition to MediatR for request handling.
- Updated action methods to use middleware for exception management.
- Changed response type in EnvelopeSigned method for consistency with new domain model.
- Overall improvements for maintainability and adherence to best practices.
2025-06-27 12:06:41 +02:00
dedfb924d8 Refactor EnvelopeController and EnvelopeOldService
Significantly refactored `EnvelopeController.cs` to improve structure, add logging, and enhance error handling in methods. Introduced new private fields and updated constructor parameters, with some marked as obsolete.

Updated `EnvelopeOldService.cs` to add private fields, improve logging, and enhance error handling in key methods. Introduced `ReceiverAlreadySigned` method and marked `GetDocument` as obsolete. Improved overall functionality and maintainability.
2025-06-27 10:59:52 +02:00
08601adc49 Refactor DocumentController for clarity and updates
Updated the DocumentController to use new namespace for constants and added a directive for domain entities. Marked the constructor as obsolete for future MediatR implementation. Refactored Get and Open methods to enhance readability by simplifying error handling. Maintained authorization attributes in their original positions.
2025-06-27 10:26:56 +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
0800e4d13e refacto(EGUser): rename FormUser 2025-06-26 16:49:56 +02:00
07381e78b4 Refactor name retrieval to use GetFullName method
Updated the `CertificateModel.vb` and `EmailData.vb` files to replace direct access to the `FullName` property with the `GetFullName()` method for retrieving creator, sender, and receiver names. This change enhances flexibility and maintains consistency across the codebase.

Additionally, added a new static `GetFullName` method in the `EGUserExtensions.cs` file to centralize the formatting of user names by concatenating the `Prename` and `Name` properties.
2025-06-26 16:46:55 +02:00
5d29ad889d Refactor EGUser construction and add extension method
Removed constructors from EGUser class and introduced a new
static class EGUserExtensions with a ToEGUser extension method
to facilitate the conversion from User to EGUser. Updated
namespace imports to include DigitalData.UserManager.Domain.Entities.
2025-06-26 16:27:28 +02:00
5ee9efbcd9 Refactor user-related classes and properties
- Added parameterless and user-initializing constructors to `EGUser`.
- Removed unnecessary `using` directives and `#if NETFRAMEWORK` from `EGUser.cs`, `Envelope.cs`, and `EnvelopeHistory.cs`.
- Replaced `EGUser` property with `User` in `Envelope.cs` and `EnvelopeHistory.cs`.
- Retained default value for `CURRENT_WORK_APP` in `Envelope.cs`.
2025-06-26 16:21:22 +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
2dbeae24d5 Refactor property name for consistency
Updated the property name `UseridFkIntEcm` to `UserIdFkIntEcm` to adhere to a more consistent naming convention.
2025-06-26 14:27:54 +02:00
ff1e9f27af Replace User class with EGUser across the codebase
This commit introduces the new `EGUser` class, which replaces the existing `User` class in multiple files, including `EnvelopeModel.vb`, `State.vb`, and `UserModel.vb`. The `EGUser` class extends `User`, adding new properties while maintaining existing functionality.

Key changes include:
- Updated property types from `User` to `EGUser` in relevant models.
- Method signatures in `UserModel.vb` modified to accept and return `EGUser`.
- Domain entities in `Envelope.cs` and `EnvelopeHistory.cs` now reference `EGUser`.
- Complete removal of the `User.cs` file.
- Added a new package reference for `UserManager.Domain` in the project file.
- Updated `MYUSER` variable in `ModuleSettings.vb` to use `EGUser`.

These changes enhance the user model to better meet application requirements.
2025-06-26 14:26:21 +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
f8a7239041 Remove references to EnvelopeGenerator.CommonServices
Refactored multiple files to eliminate dependencies on the
EnvelopeGenerator.CommonServices namespace. This includes
removing using directives in `ReadEmailTemplateQueryHandler.cs`,
`ReadEnvelopeResponse.cs`, and `ReadHistoryResponse.cs`.
Additionally, project references to `EnvelopeGenerator.CommonServices.vbproj`
were removed from both `EnvelopeGenerator.Application.csproj` and
`EnvelopeGenerator.Extensions.csproj`, indicating a shift towards
using only the `EnvelopeGenerator.Domain` project.
2025-06-25 14:24:22 +02:00
Developer01
a1688608ab Exception TFA Null Verweis 2025-06-25 13:49:55 +02:00
72fa6fb258 Refactor EnvelopeReceiverService and update methods
- Changed return type of `ReadLastUsedReceiverNameByMailAsync` to non-nullable string.
- Marked `EnvelopeReceiverService` as obsolete; suggested using MediatR.
- Added new methods for enhanced functionality: `ReadBySignatureAsync`, `ReadByUuidAsync`, `ReadAccessCodeByUuidAsync`, `ReadByUuidSignatureAsync`, `ReadWithSecretByUuidSignatureAsync`, `ReadByEnvelopeReceiverIdAsync`, `VerifyAccessCodeAsync`, and `IsExisting`.
- Improved null handling in `ReadAccessCodeByUuidAsync` and added localized failure messages.
- Overloaded `VerifyAccessCodeAsync` to accept `envelopeReceiverId`.
- Introduced `SendSmsAsync` for sending SMS messages.
- Added `ReadWithSecretByUuidAsync` method (not yet implemented).
- Enhanced error handling in `ReadAccessCodeByIdAsync`.
- Updated `ReadByUsernameAsync` to support additional filtering parameters.
2025-06-25 11:06:19 +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
Developer01
f1920e16fa MS Job 2025-05-27 14:04:45 +02:00
Developer 02
c1d46b446a refactor(EnvelopeGenerator.Common): umbenennen in EnvelopeGenerator.CommonService 2025-05-26 11:14:12 +02:00
Developer 02
a5261baec5 fix(document-model): Behandle DBNull für BYTE_DATA, um Laufzeit-Cast-Fehler zu vermeiden 2025-05-26 10:50:25 +02:00
Developer 02
3eb11311a7 refactor: DbConfig, ElementStatus, EmailData, EnvelopeReceiver und State nach Models verschieben 2025-05-26 10:49:11 +02:00
Developer 02
10b05d6301 refactor(EnvelopeHistory): ersetzt mitg als Common.Entites.EnvelopeHistory 2025-05-26 10:07:48 +02:00
Developer 02
c6fe039dd8 refactor(EnvelopeHistoryEntry): Umbenennung von EnvelopeHistoryEntry in EnvelopeHistory 2025-05-26 10:02:50 +02:00
Developer 02
1f43dff9f4 refactor(EnvelopeHistory): EnvelopeHistory aktualisiert, um EnvelopeHistoryEntry zu enthalten 2025-05-26 10:01:50 +02:00
Developer 02
dafa4f0409 refactor(Bereich): IEnumerable und ICollections auf List aktualisiert, um Fehler in VB-Projekten zur Compilerzeit zu erhalten 2025-05-26 09:54:45 +02:00
Developer 02
3625508460 refactor(Common.Entities.DocumentReceiverElement): Ersetzt durch Common.Entities.DocumentReceiverElement 2025-05-26 09:49:01 +02:00
Developer 02
7326f03a8d refactor(Common.Entities.EnvelopeDocumentElement): umbenennen in DocumentReceiverElement 2025-05-26 09:44:44 +02:00
Developer 02
35e9f6404c refactor(DocumentReceiverElement): Aktualisiert zur Aufnahme von Common.Entities.DocumentReceiverElement 2025-05-26 09:41:41 +02:00
Developer 02
dd6bc55fd6 refactor(EnvelopeDocument): Aktualisiert zur Aufnahme von Common.Entities.EnvelopeDocument 2025-05-26 09:31:38 +02:00
Developer 02
8e4266fcf6 refactor(EnvelopeDocument): Aktualisiert, um Comon.Entities.EnvelopeDocument zu enthalten 2025-05-23 11:29:20 +02:00
Developer 02
10aa857544 refactor(Form): aktualisierte Importe zur Verwendung von Domain 2025-05-22 18:01:21 +02:00
Developer 02
4fc94fc567 refactor(Common.Entities.EnvelopeType): entfernt und aktualisiert Form, um Domain.Entities.EnvelopeType zu verwenden 2025-05-22 15:39:32 +02:00
Developer 02
b83607d916 refactor(Domain.Entities.EnvelopeType): Aktualisiert, um Common.Entities.EnvelopeType zu enthalten.
- Geändert CertificationType, FinalEmailToCreator und FinalEmailToReceivers verwenden nun Enum-Typen von Constants
- Standardwerte für einige Eigenschaften hinzugefügt, um eine sicherere Initialisierung zu gewährleisten
- Einführung von NotMapped-Eigenschaften (TFA_Enabled, ExpiresWhen, ExpiresWarningWhen, ExpiresWhenDays, ExpiresWarningWhenDays) für zusätzliche Geschäftslogik ohne Datenbank-Mapping
- ToString() überschrieben, um den Titel zur einfacheren Fehlersuche und Anzeige zurückzugeben
2025-05-22 15:37:41 +02:00
Developer 02
a38c2cd956 refactor(Common): Ersetzen Sie Envelope und Receiver durch Domain.Entities 2025-05-22 14:13:08 +02:00
Developer 02
502c607ebd fix(Comon): Mehrdeutigkeiten aufgrund von Domain.Helpers behoben 2025-05-22 10:13:32 +02:00
Developer 02
39c1d3e624 Add helper methods for color conversion and string checksum generation
- Implemented ToColor extension method to convert predefined ColorType enums to HTML hex colors.
- Added GetChecksum extension method to generate a SHA-256 checksum from a string.
- Included conditional directive for .NET Framework compatibility.
2025-05-21 19:52:58 +02:00
Developer 02
39cc30f48b feat(Receiver): Entsprechend aktualisiert, um die Eigenschaften der Formularanwendung einzubeziehen 2025-05-21 19:31:59 +02:00
Developer 02
79204d4f6d refactor(EnvelopeStatus): umbenennen in EnvelopeReceiver 2025-05-21 18:43:48 +02:00
Developer 02
806b990556 refactor(EnvelopeReceiver): unbenutzte Eigenschaften entfernen und in Receiver umbenennen 2025-05-21 18:41:42 +02:00
Developer 02
d34a1016c4 refactor(Envelope): Eigenschaft StatusTranslated hinzufügen 2025-05-21 18:25:10 +02:00
Developer 02
93dbe63fb4 refactor(Domain.Entites.Envelope): Aktualisiert, um Common.Entities.Envelope zu enthalten 2025-05-21 18:18:40 +02:00
Developer 02
55ffe40c46 Hinzufügen des Attributs Obsolete zu ElementStatus und zugehörigen Methoden 2025-05-21 17:05:52 +02:00
Developer 02
be9516d852 refactor(Domain.Entites.DocumentStatus): Ersetzt durch Common.Entites.DocumentStatus 2025-05-21 15:28:10 +02:00
Developer 02
12502bb2de refactor(EmailMetadata): Entfernt 2025-05-21 12:16:45 +02:00
Developer 02
26745e0c37 feat(Domain.EmailTemplate): Ersetzt durch Common.EmailTemplate 2025-05-21 12:12:29 +02:00
Developer 02
2ea5fd7dbb feat(Domain.User): Ersetzt durch Common.User 2025-05-21 12:08:28 +02:00
Developer 02
446aeb00b1 feat(User): Erforderliche Eigenschaften für Formular hinzugefügt 2025-05-21 11:50:58 +02:00
Developer 02
abc3bb7652 refactor(Applciation): Update Microsoft.Data.SqlClient mit bedingter Versionierung abhängig vom Framework 2025-05-21 09:59:35 +02:00
Developer 02
a8a768d7d6 refactor(.Form): Aktualisiert, um die Domain zu verwenden 2025-05-20 17:30:57 +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
e98abde5ff refactor(domain): Hinzufügen von bedingten Referenzen für .net framework 2025-05-20 16:01:51 +02:00
Developer 02
49497dafd1 Update project file for framework-specific settings
Added conditional property groups in `EnvelopeGenerator.Domain.csproj` to manage `ImplicitUsings` and `LangVersion` based on the target framework. Set `ImplicitUsings` to `disable` and `LangVersion` to `7.3` for `net462`, while enabling `ImplicitUsings` and using `latest` for `net7.0`, `net8.0`, and `net9.0`.
2025-05-20 15:50:39 +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
bdf2527fc1 Refactor using directives and add User entity
- Updated `using` directives in `Config.cs` and `EnvelopeType.cs` to include additional namespaces and removed `DigitalData.Core.Abstractions`.
- Adjusted formatting for `StatusName` and `IsAlreadySent` properties in `Envelope.cs` for consistency.
- Simplified `User` property in `Envelope.cs` by removing the namespace prefix.
- Introduced a new `User` class in `User.cs` with various properties and data annotations for database mapping.
- Removed the `<Nullable>` property from `EnvelopeGenerator.Domain.csproj`, which may impact nullability handling.
2025-05-16 09:56:44 +02:00
Developer 02
1a69478f48 Refactor entity classes for non-nullable properties
Removed nullable types and `init` properties, replacing them with standard getters and setters in various entity classes. Updated properties like `DocumentPath`, `SendingProfile`, and `SignatureHost` to be non-nullable and added required attributes.

Modified the project file to include `net462` as a target framework and added a reference for `System.ComponentModel.Annotations`. Removed the `IUnique<int>` interface from several classes to simplify uniqueness management.

These changes improve data integrity and usability across the entity classes.
2025-05-14 09:16:02 +02:00
Developer 02
83d29bf78d Add EmailProfilerDispatcher and enhance logging
Included the DigitalData.EmailProfilerDispatcher namespace in Program.cs for email profiling functionality. Removed Microsoft.Extensions.DependencyInjection namespace to streamline dependency management. Enhanced logging configuration by adding EnableDetailedErrors() for improved error messages during development while retaining EnableSensitiveDataLogging().
2025-05-13 13:44:13 +02:00
Developer 02
bc45aadf27 Refactor RecordAsync object initialization
Updated the `RecordAsync` method in the `EnvelopeHistoryService` class to use an explicit object initializer with braces for creating a new object in the `CreateAsync` method. This change improves code clarity while maintaining the same functionality.
2025-05-13 11:21:01 +02:00
Developer 02
7e66cd4dae Refactor DTOs for improved structure and documentation
Transitioned from records to classes for flexibility, added XML documentation for clarity, and updated property definitions to use standard getters and setters. Introduced the `required` keyword for essential properties, removed unnecessary constructors, and enhanced property descriptions for better readability. Additionally, overridden `GetHashCode` in `ReceiverReadDto` for proper collection behavior.
2025-05-13 11:05:43 +02:00
Developer 02
cc11d70a27 Refactor DTOs to classes with enhanced properties
Changed `EnvelopeReceiverReadOnlyDto` and `EnvelopeReceiverReadOnlyUpdateDto` from records to classes, converting properties to standard get/set accessors and adding documentation comments. Introduced a default value for `ChangedWhen` in `EnvelopeReceiverReadOnlyUpdateDto`.

Modified `ReceiverCreateDto` to a class structure, updating properties to use init-only accessors and encapsulating SHA256 hash logic in a private field. Retained the `AddedWhen` property with its default value.
2025-05-13 09:56:56 +02:00
Developer 02
02aeaea8a9 Refactor EnvelopeHistoryDto to use properties
The EnvelopeHistoryDto class has been changed from a record type with positional parameters to a traditional class structure with explicit properties. This refactor improves readability and maintainability, and includes XML documentation for each property. The GetHashCode method has also been overridden to ensure uniqueness based on the Id property.
2025-05-12 16:36:21 +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
456c591fae Bump version to 1.2.3 for EnvelopeGenerator.GeneratorAPI
Updated the version information in the project file,
incrementing `<Version>`, `<FileVersion>`, and `<AssemblyVersion>`
from 1.2.2 to 1.2.3.
2025-05-12 11:14:56 +02:00
Developer 02
41b2841c25 Add validation to ReadHistoryQuery and remove StatusName
Updated ReadHistoryQuery to include a [Required] attribute for the EnvelopeId property, enforcing mandatory validation. Removed the StatusName property from ReadHistoryResponse, which may impact how status is accessed in the application.
2025-05-12 11:07:53 +02:00
Developer 02
6a6da4a876 Update mapping in ReadHistoryMappingProfile constructor
Changed mapping from EnvelopeHistory to ReadHistoryResponse.
2025-05-12 10:58:21 +02:00
Developer 02
af280ee64e Add MediatR support for envelope history queries
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.
2025-05-12 10:55:19 +02:00
Developer 02
9b945ce232 Add error handling and update history query logic
- 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.
2025-05-12 10:04:33 +02:00
Developer 02
8b1199bc71 Add Related property to ReadHistoryQuery and update controller
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`.
2025-05-12 09:57:14 +02:00
Developer 02
1d74b7ca06 Remove null check for EmailAddress in GetReceiverName
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.
2025-05-12 09:46:59 +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
4401a70217 Refactor EnvelopeDto and improve response handling
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.
2025-05-12 09:19:12 +02:00
Developer 02
fd53f5bfd6 Enhance DTOs and controller with documentation and checks
- 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.
2025-05-11 20:54:04 +02:00
Developer 02
6126fce24d Refactor MemoryCacheExtensions and HistoryController
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.
2025-05-11 15:19:37 +02:00
Developer 02
ce41090979 Enhance MemoryCacheExtensions and update HistoryController
- 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.
2025-05-11 15:01:12 +02:00
Developer 02
3fa113003c Update ReferenceType enum and clean up status handling
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.
2025-05-11 14:27:28 +02:00
Developer 02
5504093591 Update access code for DocumentForwarded constant
Changed the value of the constant `DocumentForwarded` from `4001` to `2006` to align it with the other access codes, which are now consistently in the range of `2001` to `2009`.
2025-05-11 13:15:25 +02:00
Developer 02
040cf8641d Configure logging for non-development environments
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.
2025-05-11 11:13:30 +02:00
Developer 02
09df86000b Bump version to 3.1.4 in project file
Updated package, assembly, and file versions from 3.1.3 to 3.1.4 to reflect the new release.
2025-05-10 03:49:46 +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
b01f13fb5f Add CommandDotNet and update logging configuration
- Included `CommandDotNet.Execution` namespace in `Program.cs`.
- Adjusted logging setup to clear providers and use NLog only in non-development environments.
- Added `AddHttpContextAccessor` to the service collection.
- Introduced a new `ConnectionStrings` section in `appsettings.Development.json` with a database connection string.
2025-05-10 02:39:32 +02:00
Developer 02
00fedc7c4c Enhance logging and refactor configuration in API
Updated `EnvelopeGenerator.GeneratorAPI.csproj` to include NLog packages for improved logging.
2025-05-10 01:25:32 +02:00
Developer 02
171de98552 Update version and enhance logging configuration
- Bump `EnvelopeGenerator.Web` version to `3.1.3`.
- Improve logging setup in `Program.cs` with NLog and Trace level.
- Modify `ServiceContainer` to accept `MSSQLServer` parameter.
- Update `ModelContainer` to utilize new database service.
- Add `warningLogs` section in `appsettings.json` for logging.
- Streamline logging rules by consolidating level properties.
2025-05-09 23:27:10 +02:00
Developer 02
ea6d80918c Merge branch 'master' of http://git.dd:3000/AppStd/EnvelopeGenerator 2025-05-09 17:00:24 +02:00
Developer 02
3b82467133 Merge branch 'feat/signFlow-gen' 2025-05-09 17:00:12 +02:00
Developer01
686b1a3a59 MS Common 2025-05-09 16:51:31 +02:00
Developer 02
93019362b7 Bump version to 1.2.2 and update launch settings
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`.
2025-05-09 13:54:30 +02:00
Developer 02
7f97fd3113 Refactor ReadReceiverNameQuery and improve validation
- Removed parameters from ReadReceiverNameQuery, simplifying its structure.
- Added null check for EmailAddress in GetReceiverName method to enhance input validation.
2025-05-09 10:53:44 +02:00
Developer 02
5ce6c25393 Refactor error handling in controllers
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.
2025-05-09 10:42:11 +02:00
Developer 02
972b258706 Refactor exception handling in middleware
Updated `HandleExceptionAsync` to set response status
directly for each exception type and streamlined JSON
serialization of error messages.
2025-05-09 10:35:04 +02:00
Developer 02
4ee5250b01 Add global exception handling middleware
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.
2025-05-09 10:11:28 +02:00
Developer 02
3fce092486 Enhance NotFoundException documentation
Added XML documentation comments to the `NotFoundException` class and its constructors. This improves code readability and provides clear descriptions for developers using this exception.
2025-05-09 10:07:20 +02:00
Developer 02
89d6abbb6c Cleanup unused directives and add BadRequestException
Removed unnecessary using directives in `UpdateEmailTemplateCommandHandler.cs`. Added a new `BadRequestException` class in `BadRequestException.cs` to handle bad request scenarios with customizable error messages.
2025-05-09 09:56:42 +02:00
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
Developer01
773b43b1ad Common Rejection update, SendInvitationMailJob 2025-05-08 17:01:12 +02:00
Developer 02
83fa5a29e8 Add XML documentation for Handle method
Enhanced the `Handle` method in the `ResetEmailTemplateCommandHandler` class with XML documentation comments, including a summary and detailed parameter descriptions for better code clarity and maintainability.
2025-05-08 16:55:43 +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
8d118308cd Remove Procedures folder and update configurations
- Removed folder reference for "Procedures" in the project file.
- Added `DocumentMod_Rotation` to the `Constants.vb` enum.
- Replaced `NonHistStatuses` with a new `Status` class containing `NonHist` and `RelatedToFormApp` lists.
- Updated `TimeLimit` in `appsettings.json` from "00:30:00" to "90.00:00:00".
2025-05-08 15:15:01 +02:00
Developer01
5a8f2d298f MS Service Invitations API,Form 2Faktor Properties 2025-05-08 14:37:34 +02:00
Developer 02
1a978c0ab7 Update Constants.vb with new statuses and cleanup
Removed comment for SignatureConfirmed. Added a new shared read-only list, NonHistStatuses, containing EnvelopeStatus values: Invalid, EnvelopeSaved, EnvelopeSent, and EnvelopePartlySigned. Added TODO for standardization in xwiki. ReferenceType enum remains unchanged.
2025-05-08 14:26:36 +02:00
Developer 02
ce0b1f1785 Comment out unused constants in Constants.vb
The `SignatureConfirmed` and `DocumentMod_Rotation` constants have been commented out to indicate that they are no longer active or used in the code. This helps to clean up the codebase and improve maintainability.
2025-05-08 13:53:16 +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
2db0748e60 Update ReceiverGetOrCreateCommand email handling
Changed _emailAddress from nullable to non-nullable,
initialized to an empty string. Updated EmailAddress
property to be required, with modified getter and setter
to ensure lowercase formatting.
2025-05-08 10:25:06 +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
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
126370ebdb Add user management services to Program.cs
This commit introduces a new using directive for
`DigitalData.UserManager.DependencyInjection` and
registers the user manager service with
`builder.Services.AddUserManager<EGDbContext>();`.
These changes enhance the application's capabilities
related to user management.
2025-05-07 18:00:28 +02:00
Developer 02
629c0d51b2 Enhance email template handling and documentation
- Added XML documentation to the `Handle` method in `UpdateEmailTemplateCommandHandler`.
- Improved readability in `ReadEmailTemplateQueryHandler` by storing the mapped response in a variable.
- Updated properties in `ReadEmailTemplateResponse` to be mutable and renamed `Type` to `Name` with a type change from `int` to `string`.
- Added data annotations in `EmailTemplate` for `AddedWhen` and introduced a new nullable `ChangedWhen` property.
- Included necessary using directives for data annotations in `EmailTemplate.cs`.
2025-05-07 17:00:26 +02:00
Developer01
dc4b5bade0 Merge branch 'master' of http://git.dd:3000/AppStd/EnvelopeGenerator 2025-05-07 16:51:02 +02:00
Developer01
6fc0c32c46 Common und Service API Send API Mails 2025-05-07 16:50:46 +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
519df50404 Add culture-specific formatting for SQL parameters
Updated ParamsExtensions to include System.Globalization for
culture-invariant formatting of double values. This change
ensures proper SQL parameterization by avoiding issues with
decimal separators across different cultures.
2025-05-07 15:35:14 +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
645153113c Update SQL parameters in DocumentCreateReadSQL class
Modified the parameters for the stored procedure `[dbo].[PRSIG_API_ADD_DOC]` in the `DocumentCreateReadSQL` class. Replaced `@BYTE_DATA` with `@BYTE_DATA1`, repositioned `@ENV_UID`, and ensured `@OUT_DOCID` is explicitly marked as an output parameter.
2025-05-07 14:33:07 +02:00
Developer 02
2ba7f41a21 Remove SQL command string from DocumentCreateReadSQL
This commit removes a SQL command string from the `Raw` property in the `DocumentCreateReadSQL` class. The changes include the deletion of a `USE` statement for the `[DD_ECM]` database, variable declarations, and the execution of a stored procedure. This alters the structure and execution of SQL commands within the class.
2025-05-07 14:27:09 +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
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
06d25b6f5b Refactor SQL handling in EnvelopeGenerator application
- Added `System.Data` using directive in `EnvelopeCreateReadSQL.cs`.
- Updated SQL command strings to use parameter placeholders.
- Corrected method name from `CreateParmas` to `CreateParams` and added output parameter `@OutUid`.
- Made similar updates in `EnvelopeReceiverAddReadSQL.cs`.
- Introduced `ParamsExtensions` class with `ToSqlParam` method for converting .NET objects to SQL-safe parameter strings.
2025-05-07 13:09:59 +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
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
95a1fd1355 Add DocumentCreateReadSQL class for SQL operations
Introduces the `DocumentCreateReadSQL` class in the
`EnvelopeGenerator.Application.SQL` namespace, implementing
the `ISQL<EnvelopeDocument>` interface. This class includes
a `Raw` property for a SQL query to insert and retrieve
documents, along with a static method `CreateParmas`
to generate `DynamicParameters` for SQL queries using
base64 encoded strings and envelope UUIDs.
2025-05-07 01:20:27 +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
cec79e5b6d Add TODO for sender query and update documentation
Added a comment to indicate a TODO for implementing a sender query in the `ReadHistoryQuery` record. Removed the parameter description for "Receiver" from the summary documentation while keeping the rest of the documentation intact.
2025-05-06 23:26:08 +02:00
Developer 02
2f08991eeb Refactor ReadHistoryQuery by removing parameters
Removed the `Envelope` and `Receiver` parameters from the
`ReadHistoryQuery` record in `ReadHistoryQuery.cs`. This
simplifies the record by reducing the number of parameters
it accepts, enhancing clarity and maintainability.
2025-05-06 23:25:34 +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
27d9a149bc Refactor Envelope properties in Envelope.cs
- Added required `Uuid` property with column mapping.
- Removed `Message` property.
- Changed `Language` from required to nullable string.
- Other properties (`ContractType`, `ExpiresWhen`, `SendReminderEmails`) remain unchanged.
2025-05-06 22:54:19 +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
10341fd3cc Refactor EmailTemplateDto and update command handler
The `EmailTemplateDto` class has been changed from a record with positional parameters to a class with explicit properties, including XML documentation and required modifiers for `Name`, `Body`, and `Subject`.

In the `ResetEnvelopeTemplateCommandHandler`, added necessary using directives, modified the constructor to accept an `IRepository<EmailTemplate>`, and updated the `Handle` method to read and update email templates based on the request's ID or type. The static `Default` collection has been renamed to `Defaults` and now uses `EmailTemplateDto`.
2025-05-06 20:58:52 +02:00
Developer 02
05de44bc13 Implement MediatR support for envelope template reset
- Modified `ResetEnvelopeTemplateCommand` to implement `IRequest`.
- Introduced `ResetEnvelopeTemplateCommandHandler` to handle requests.
- Added a collection of default email templates for notifications.
2025-05-06 19:23:01 +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
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
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
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
eaa1232490 Refactor envelope receiver command and response handling
- Updated `CreateEnvelopeReceiverCommand` to specify response type for `IRequest`.
- Enhanced `CreateEnvelopeReceiverCommandHandler` to use `AutoMapper` and return `CreateEnvelopeReceiverResponse`.
- Modified `Handle` method to map envelope data and populate recipient lists.
- Changed `CreateEnvelopeReceiverResponse` to inherit from `CreateEnvelopeResponse` and added new properties.
- Adjusted mapping profile to map `Envelope` to `CreateEnvelopeReceiverResponse`.
- Created new mapping profile for `Receiver` to `ReceiverReadDto`.
2025-05-06 12:32:54 +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
3cc8e2b5db Add envelope executors to CreateEnvelopeReceiver handler
This commit introduces two new dependencies: `IEnvelopeExecutor` and `IEnvelopeReceiverExecutor`. The `using` directive for `IEnvelopeExecutor` has been added, and a new private field `_erExecutor` has been introduced in the `CreateEnvelopeReceiverCommandHandler` class. A constructor has also been added to initialize both `_envelopeExecutor` and `_erExecutor`, enabling the handler to effectively process envelope-related commands.
2025-05-06 11:06:47 +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
40dc0ecda3 Add CreateEnvelopeReceiverResponse record
Introduces the `CreateEnvelopeReceiverResponse` record in the
`EnvelopeGenerator.Application.EnvelopeReceivers.Commands.Create`
namespace. This record inherits from `ReadEnvelopeReceiverQuery`
and includes an optional `Status` parameter of type
`EnvelopeStatusQuery`. Also adds necessary using directives.
2025-05-06 09:56:35 +02:00
Developer 02
7b7a4b4f65 Add AddEnvelopeReceiver method and SQL class
Introduces the `AddEnvelopeReceiver` method in the `Extension` class to add envelope receivers with parameters for UUID, email, salutation, and optional phone.

Also adds the `EnvelopeReceiverAddReadSQL` class implementing `ISQL<Envelope>`, containing a SQL query to create a new receiver using the stored procedure `PRSIG_API_CREATE_RECEIVER`.

Includes XML documentation for improved code readability and maintainability.
2025-05-06 09:50:20 +02:00
Developer 02
b609253893 Revert "Refactor envelope handling to use ISQLExecutor"
This reverts commit 4cabaf3191.
2025-05-06 09:45:38 +02:00
Developer 02
b0eb1b6389 Revert "Add AddReceiver method and refactor SQL classes"
This reverts commit 1b515ea904.
2025-05-06 09:44:15 +02:00
Developer 02
1b515ea904 Add AddReceiver method and refactor SQL classes
Introduced a new `AddReceiver` method in the `Extension` class to facilitate adding a receiver to an envelope. This method includes parameters for `envelope_uuid`, `emailAdress`, `salutation`, and an optional `phone`, along with XML documentation for clarity.

Removed the `EnvelopeReceiverCreateReadSQL` class and added the `EnvelopeReceiverAddReadSQL` class, which defines the SQL command for adding a receiver. The new class also includes XML documentation comments for better understanding.
2025-05-06 01:41:42 +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
8cfa28a863 Refactor envelope creation logic into Extension class
Added a new static class `Extension` in `Extension.cs` to encapsulate methods for creating parameters and asynchronous envelope creation. Removed previous implementations from `EnvelopeCreateReadSQL.cs` for better organization. Updated `using` directives in `CreateEnvelopeCommandHandler.cs` and `EnvelopeCreateReadSQL.cs` for consistency.
2025-05-05 16:36:16 +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
5166f41941 Refactor CreateEnvelopeResponse to use record type
Changed CreateEnvelopeResponse from a class to a record type for improved immutability and conciseness. The new definition inherits from ReadEnvelopeResponse, reusing its functionality. Added XML documentation comments for better clarity on each parameter.
2025-05-05 02:06:33 +02:00
Developer 02
928f2a7780 Add AutoMapper profile for envelope mapping
Introduces `CreateEnvelopeMappingProfile` class to define
mapping between `Envelope` entity and `CreateEnvelopeResponse`
DTO using AutoMapper's `CreateMap` method.
2025-05-05 02:03:56 +02:00
Developer 02
d46aa6e2b8 Add envelope creation functionality and SQL integration
- Updated `EnvelopeGenerator.Application.csproj` to include `Microsoft.Data.SqlClient` package.
- Refactored `CreateEnvelopeReceiverCommand` to inherit from `CreateEnvelopeCommand`.
- Enhanced `CreateEnvelopeSQL` with a SQL script for envelope creation.
- Introduced `CreateEnvelopeCommand` to encapsulate envelope creation data.
- Added `CreateEnvelopeCommandHandler` to process commands and interact with the database.
- Created `CreateEnvelopeResponse` class for handling responses from envelope creation.
2025-05-05 02:01:01 +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
Developer 02
841da3c261 Refactor DI extensions and add SQL executor support
Removed `DIExtensions.cs` and integrated its content into `DependencyExtensions.cs`, enhancing the dependency injection setup with repository and SQL executor registrations. Added a new `CreateEnvelopeSQL` class implementing the `ISQL<Envelope>` interface, currently with a placeholder implementation.
2025-05-05 00:31:58 +02:00
Developer 02
adbfd69418 feat(IQueryExecutor): IQuery umbenennen 2025-04-30 16:49:26 +02:00
Developer 02
1e54b775a2 refactor: Vereinfachung der SQLExecutor-Implementierung zur Rückgabe von IQueryExecutor
- Aktualisiert `SQLExecutor<T>` um `ISQLExecutor<T>` zu implementieren und `IQueryExecutor<T>` für die weitere Abfrageausführung zurückzugeben.
- Umstrukturierte Methoden zur Verwendung von `ToExecutor()` für die Konvertierung von rohen SQL-Abfragen in einen `IQueryExecutor<T>`.
- Geänderter Konstruktor, um `IServiceProvider` für die Injektion von Abhängigkeiten von benutzerdefinierten SQL-Abfrageklassen zu akzeptieren.
2025-04-29 17:14:38 +02:00
Developer 02
6e82b24578 feat: Implement QueryExecutor for executing queries using IQueryable
- Added a record `QueryExecutor<TEntity>` implementing `IQueryExecutor<TEntity>` for executing common query operations like First, Single, and ToList both synchronously and asynchronously.
- Methods leverage the IQueryable interface to perform database queries for entity types.
2025-04-29 16:56:13 +02:00
Developer 02
5331efe3c1 feat(sql): Hinzufügen generischer Überladungen zu SQLExecutor unter Verwendung von ISQL<T> über DI
Es wurden Überladungen für ExecuteFirstAsync, ExecuteSingleAsync und ExecuteAllAsync
eingeführt, die SQL-Definitionen aus dem Dependency Injection Container mittels ISQL<T> auflösen.
Außerdem wurde ein Fehler bei der Verwendung der Direktive von .cs zu standardmäßigem Schnittstellenimport korrigiert.
2025-04-29 16:39:18 +02:00
Developer 02
3b4ad2960a feat: SQLExecutor-Klasse für die Ausführung von Roh-SQL-Abfragen mit Entity Framework Core hinzufügen 2025-04-29 16:26:26 +02:00
Developer 02
33048e185b feat(CreateEnvelopeReceiverCommandHandler): initialized 2025-04-29 14:41:21 +02:00
Developer 02
3ae1b94eb7 refactor(Login): Id in UserId umbenennen 2025-04-29 11:39:21 +02:00
Developer 02
14e6a661d3 Merge branch 'master' of http://git.dd:3000/AppStd/EnvelopeGenerator 2025-04-29 09:37:12 +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
Developer01
4f95a1eed4 Merge branch 'master' of http://git.dd:3000/AppStd/EnvelopeGenerator 2025-04-28 13:27:38 +02:00
Developer01
6874e7e92c MS Initial 2.9.1 2025-04-28 13:27:27 +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
9183ba4da5 Merge branch 'feat/terminal' 2025-04-28 09:19:52 +02:00
Developer 02
08e2e91e9a feat(program): Konfiguration aus appsettings.json laden
Die Anwendung lädt nun Konfigurationseinstellungen aus einer "appsettings.json"-Datei im Basisverzeichnis.
Dies ermöglicht eine externe Konfiguration ohne Codeänderungen und unterstützt das Neuladen der Einstellungen zur Laufzeit bei Änderungen der Datei.
2025-04-28 09:16:24 +02:00
Developer 02
2966d64455 feat(terminal): ReadDocument-Befehl um PDF-Speicheroptionen erweitert
Optionen `save`, `dir` und `fileName` zum `ReadDocument`-Befehl hinzugefügt.
Wenn `save` aktiviert ist, wird das PDF an dem angegebenen oder dem Standardpfad gespeichert.
Ermöglicht dem Benutzer mehr Kontrolle über Speicherort und Dateinamen.
2025-04-25 19:33:29 +02:00
Developer 02
41cb2c2d93 fix(PDFBurnerParams): Verschieben in das Verzeichnis /FinalizeDocument 2025-04-25 11:39:59 +02:00
Developer 02
edd54ab302 Merge branch 'master' of http://git.dd:3000/AppStd/EnvelopeGenerator 2025-04-24 16:08:48 +02:00
Developer 02
51920089af feat(PDFBurner): PDFBurnerParams hinzufügen und Konfiguration binden 2025-04-24 16:08:05 +02:00
Developer01
5714c54385 Merge branch 'master' of http://git.dd:3000/AppStd/EnvelopeGenerator 2025-04-24 16:00:29 +02:00
Developer01
09d2640345 V 2.9.0.0 WISAG 2025-04-24 16:00:16 +02:00
Developer 02
82cb50b7e1 feat(PDFBurnerParams): erstellt, um PDFBurner zu konfigurieren 2025-04-24 15:50:08 +02:00
Developer 02
ff36dc47c1 refactor(PDFBurner): Logik hinzufügen, um den Unterschied zwischen FormField-Annotationen zu verringern 2025-04-24 15:29:22 +02:00
Developer 02
186f3c3319 Merge branch 'master' of http://git.dd:3000/AppStd/EnvelopeGenerator 2025-04-24 12:01:55 +02:00
Developer 02
276adda516 unnötige Protokollierung entfernt 2025-04-24 11:48:54 +02:00
Developer 02
ac0ae10fab unnötige Protokollierung entfernt 2025-04-24 11:47:11 +02:00
Developer01
3713669ec5 Merge 2025-04-24 11:45:38 +02:00
Developer 02
7f0131fc2d refactor(FinalizeDocumentJob): Update für detaillierte Protokollierung 2025-04-24 11:44:29 +02:00
Developer01
d9deb589d1 MS AdminTab 2025-04-24 11:43:55 +02:00
OlgunR
c961e9fffd Merge branch 'master' of http://git.dd:3000/AppStd/EnvelopeGenerator 2025-04-24 11:43:18 +02:00
OlgunR
ae31b1da0f Funktion zur Aufhebung der Formfelder im Signiervorgang - Class EnvelopeEditorController, Class FlattenFormFields 2025-04-24 11:42:50 +02:00
Developer 02
bf5faf53bd refactor(frmFinalizePDF): Aktualisieren von Button1_Click zum Öffnen von PDF nach dem Brennvorgang 2025-04-24 11:37:46 +02:00
Developer 02
9a74b448f2 Merge branch 'master' of http://git.dd:3000/AppStd/EnvelopeGenerator 2025-04-24 09:32:34 +02:00
Developer 02
784a834214 chore: auf 3.1.2 aufgerüstet 2025-04-24 09:28:27 +02:00
Developer01
3c5f5cb5f5 Neues Release plus Flatternformfleds RO 2025-04-24 08:56:33 +02:00
Developer 02
7c57b7e332 refactor(network): add bias to annot.top 2025-04-24 02:23:22 +02:00
Developer 02
4bf91df85f fx(network): add bias to left position 2025-04-24 02:11:12 +02:00
Developer 02
50796b22d9 refactor(network): convert getAnnotation params to async method 2025-04-24 02:10:18 +02:00
Developer 02
2974ddb985 feat(ConfigController): add authorize attribute 2025-04-24 02:01:09 +02:00
Developer 02
54f39103e1 feat(IAnnotation): Hinzufügen und Implementieren der Eigenschaften BackgroundColor, BorderColor, BorderStyle und BorderWidth.
- Hintergrund mit neuen Eigenschaften in Annotations.js binden
2025-04-24 00:36:24 +02:00
Developer 02
8b505ae39a feat(annotations): verbessertes Styling für Hintergrund-Anmerkungen
- Hintergrundfarbe der Hintergrund-Anmerkungen auf einen benutzerdefinierten hellen Ton geändert
- Unterstrichener Rahmenstil mit spezifischer Farbe und Breite hinzugefügt
- Blendmodus von 'multiply' zu 'normal' vereinheitlicht für bessere Konsistenz
- Visuelle Hierarchie der Anmerkungselemente verbessert
2025-04-23 22:59:45 +02:00
Developer 02
d75da655d2 feat(Hintergrund): Locate add, um die Position des Hintergrunds anhand anderer Anmerkungen zu berechnen.
- Standort des Hintergrunds zu Anmerkungen hinzugefügt
2025-04-23 18:13:46 +02:00
Developer 02
e72ea534e5 refactor(AnnotationParams): AnnotationJSObject aktualisieren, um IAnnotation (anstelle von Annotation) zu enthalten
- Hintergrund in AnnotationJSObject hinzufügen, wenn er nicht null ist
2025-04-23 17:25:58 +02:00
Developer 02
e95d1d782e feat(IAnnotation): Erstellt, um die grundlegenden Eigenschaften einer Annotation zu behandeln.
- implementiert in Annotation und Hintergrund
2025-04-23 16:50:10 +02:00
Developer 02
32be5077f9 feat(Hintergrund): Erstellen, um den Hintergrund von Anmerkungen mit der Eigenschaft MarginRatio zu konfigurieren.
- verschiebt Anmerkungen nach
2025-04-23 15:41:53 +02:00
Developer 02
d80fa0b023 feat(Background): Add Width, Height, Top and Left properties.
- Add JsonIgnroe property to BackGround
2025-04-23 15:38:14 +02:00
Developer 02
ea6ee11a4e feat(Hintergrund): Erstellen, um den Hintergrund von Anmerkungen mit der Eigenschaft MarginRatio zu konfigurieren.
- verschiebt Anmerkungen nach
2025-04-23 15:31:35 +02:00
Developer 02
13a87f29d9 refactor(Annotations.js): Hinzufügen von Container-Widget-Annotationen als Hintergrund von Annotationen ohne BoundingBox-Konfiguration.
- Konvertieren von Signaturen Hintergrundfarbe von gelb zu hellgelb.
2025-04-23 13:38:32 +02:00
Developer01
4e2682a75d DocumentRotationChanged 2025-04-23 12:40:28 +02:00
Developer01
278d56c58d Merge branch 'master' of http://git.dd:3000/AppStd/EnvelopeGenerator 2025-04-23 12:38:02 +02:00
Developer01
9f71579c78 MS Neue Konstante 2025-04-23 12:37:57 +02:00
Developer 02
5f8df74b9d refactor(BasicDtoMappingProfile): Unter /DTOs verschieben.
- umbenennen in MappingProfile
 - Kommentare zur Dokumentation hinzufügen
2025-04-23 09:36:22 +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
4040741e6f Merge remote-tracking branch 'origin/bugfix/signaturfeld-rotiert' 2025-04-23 08:42:38 +02:00
Developer 02
4077786ef7 refactor(Test.Application): Configured dependencies 2025-04-23 01:01:09 +02:00
Developer 02
ba8394c749 feat(EnvelopeGenerator.Terminal): Downgrade to .net 7 2025-04-23 00:49:15 +02:00
Developer 02
97dcc0f0a1 feat(ReadDocumentMappingProfile): Added mapping profile of ReadDocumentResponse 2025-04-23 00:01:57 +02:00
Developer 02
8785505a91 feat(CommandManager): Add ReadDocument command. 2025-04-22 23:47:30 +02:00
Developer 02
975beff416 feat(ReadDocumentQueryHandler): Logik hinzugefügt 2025-04-22 23:16:22 +02:00
Developer 02
45d39069aa feat(infrastructure): generisches Repository mit AutoMapper-Unterstützung integriert
- DbRepository-Registrierungen für alle Umschlag-bezogenen Entitäten mit DigitalData.Core-Infrastruktur und AutoMapper-Integration hinzugefügt. Ermöglicht optimierten Datenzugriff und Mapping-Konfiguration.
2025-04-22 21:23:16 +02:00
Developer 02
d3db1e74fa chore: aktualisierte Baget-Pakete 2025-04-22 21:06:36 +02:00
OlgunR
4d34eb7adc Funktion zur Behebung der Rotation - Class EnvelopeEditorController, Class FixPageRotation 2025-04-22 10:26:03 +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
11f4896556 ReadDocumentQuery und Handler zum Abrufen von Dokumenten hinzufügen
Führt die Struktur `ReadDocumentQuery` zur Abfrage von Dokumenten anhand ihrer eindeutigen Kennung oder der zugehörigen Umschlagkennung ein und implementiert die Schnittstelle `IRequest<ReadDocumentResponse>` von MediatR.

Eine neue Handler-Klasse, `ReadDocumentQueryHandler`, wird erstellt, um die Abfrage zu verarbeiten, obwohl die Verarbeitungslogik noch nicht implementiert ist.

Außerdem wird eine Antwortstruktur, `ReadDocumentResponse`, definiert, um die Daten zu kapseln, die beim Lesen eines Dokuments zurückgegeben werden, einschließlich der Eigenschaften für die ID des Dokuments, die Umschlag-ID, das Hinzufügedatum und die Binärdaten.

Die erforderlichen Namespaces werden für die richtige Organisation und Funktionalität hinzugefügt.
2025-04-14 16:12:07 +02:00
Developer 02
44aeb53413 Refactor EnvelopeDocument class for clarity
Adjusted namespace and reformatted class attributes for consistency. Moved `[Table]`, `[Key]`, `[DatabaseGenerated]`, and `[Column]` attributes to align with properties. The `Elements` property was also repositioned to enhance class structure readability.
2025-04-14 15:19:10 +02:00
Developer 02
d56aa1a778 Remove unused import in EnvelopeDocumentRepository.cs 2025-04-14 15:18:47 +02:00
Developer 02
a012396dd4 Merge branch 'master' into feat/terminal 2025-04-14 14:39:31 +02:00
Developer 02
42a1016607 fix: Vereinfachung des Ziel-Frameworks in der Projektdatei
Aktualisierte `EnvelopeGenerator.Web.csproj`, um ein einziges
Ziel-Framework (`net7.0`) anstelle von mehreren Frameworks
(`net7.0;net8.0;net9.0`) anzugeben, was die Projektkonfiguration vereinfacht.
2025-04-14 14:38:56 +02:00
Developer 02
4b616896f8 Refactor CommandManager und Verbesserung von DependencyInjection
Aktualisierte Eigenschaftsnamen in CommandManager für mehr Klarheit und zusätzliche Lokalisierungsunterstützung in DependencyInjection durch Einbindung der Methode AddLocalization().
2025-04-14 13:53:07 +02:00
Developer 02
54c17f106e feat(Program.cs): Hosting-Unterstützung zu CommandManagerRunner hinzufügen
- Einführung von `Microsoft.Extensions.Hosting` in `DependencyInjection.cs`.
- Überladung für `RunCommandManagerRunner` hinzugefügt, um `IHost` zu akzeptieren.
- Aktualisiert `Program.cs`, um die neue Methode `RunCommandManagerRunner` zu verwenden.
2025-04-14 13:18:50 +02:00
Developer 02
e171b50868 Add service registrations to DependencyInjection
Added using directives for application services and registered
IEnvelopeMailService with its implementation EnvelopeMailService.
Also included in-memory caching to enhance the dependency
injection setup.
2025-04-14 13:15:19 +02:00
Developer 02
a20c2b556f Add CommandDotNet support to IEnvelopeReceiverService
Updated IEnvelopeReceiverService to utilize CommandDotNet for command-line functionality. Added a new command attribute to the VerifyAccessCodeAsync method, allowing it to be invoked via command line. Modified the method signature to accept a string identifier for the envelope receiver, enhancing its usability and alignment with intended functionality.
2025-04-14 13:07:45 +02:00
Developer 02
a070a0f64c Enhance CommandManager and Dependency Injection
- Updated `CommandManager` to include an `IEnvelopeReceiverService` constructor and a new property for service access. Added version printing functionality in the `Execute` method.
- Modified `AddCommandManagerRunner` in `DependencyInjection` to accept a connection string key name and added SQL Server caching configuration.
- Added `Microsoft.Extensions.Caching.SqlServer` package reference in the project file for caching support.
2025-04-14 12:55:48 +02:00
Developer 02
c0608b457c Hinzufügen von CommandDotNet-Referenzen für mehrere Ziel-Frameworks
Hinzufügen von bedingten `<ItemGroup>`-Elementen in der Projektdatei
für `net7.0`, `net8.0` und `net9.0`, die jeweils die
entsprechende Version des `CommandDotNet`-Pakets angeben.
2025-04-14 11:53:38 +02:00
Developer 02
927b89554d feat(DependencyInjection): Verbesserung von DI und Konfigurationsmanagement
DependencyInjection wurde aktualisiert, um IConfiguration zu akzeptieren, appsettings.json für Konfigurationseinstellungen hinzugefügt und Projektreferenzen in der .csproj-Datei geändert. Program.cs wurde angepasst, um die neue Konfigurationsstruktur für die Dienstregistrierung zu nutzen.
2025-04-14 11:38:21 +02:00
Developer 02
160005e230 Merge branch 'master' into feat/terminal 2025-04-14 10:56:45 +02:00
Developer 02
2848425625 Merge branch 'master' of http://git.dd:3000/AppStd/EnvelopeGenerator 2025-04-14 10:52:21 +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
Developer 02
7b75a373bd Fix casing of Bearer scheme in Swagger configuration 2025-04-12 02:11:43 +02:00
Developer 02
fe252b9979 Refactor email template commands and add controller
- Updated `UpdateEmailTemplateCommand` to use a property for `EmailTemplateQuery` with `JsonIgnore`, allowing optional body and subject parameters.
- Simplified `UpdateToDefaultCommand` by removing documentation comments and constructor parameters.
- Corrected namespace for `ReadEmailTemplateQuery` from `Query.Read` to `Queries.Read`.
- Introduced `ResetEnvelopeTemplateCommand` with optional ID and type, inheriting from `EmailTemplateQuery`, along with detailed XML documentation.
- Added `EmailTemplateController` to manage email templates, including methods for retrieval and updates, utilizing AutoMapper and authorization attributes.
2025-04-12 01:20:04 +02:00
Developer 02
f17820e011 Add UpdateToDefaultCommand for email template reset
Introduces a new namespace `EnvelopeGenerator.Application.EmailTemplates.Commands.UpdateToDefault` and defines the `UpdateToDefaultCommand` record. This command allows resetting an email template to its default values, inheriting from `EmailTemplateQuery`. It includes optional parameters for `Id` and `Type`, with comprehensive XML documentation detailing the command's purpose and the possible email template types.
2025-04-12 00:42:04 +02:00
Developer 02
a21c993cb5 Refactor email template handling and namespaces
Updated namespaces for email template files and improved
class structures. Removed the Language parameter from
EmailTemplateQuery. Added ReadEmailTemplateQuery and
ReadEmailTemplateResponse with updated parameters.
Introduced UpdateEmailTemplateCommand for template updates.
These changes enhance clarity and functionality in the
email template management system.
2025-04-12 00:37:13 +02:00
Developer 02
dd4afc5ddf Refactor email template query and response structures
Updated `EmailTemplateQuery` to use `Language` instead of `Culture` and added an explicit body. Introduced a new namespace for better organization and added `ReadEmailTemplateResponse` to provide a structured response for querying email templates, including relevant parameters.
2025-04-12 00:18:14 +02:00
Developer 02
c220b9e1c8 Add new email template types and query records
- Updated `Constants.vb` to include new email template types:
  `DocumentRejected_ADM`, `DocumentRejected_REC`, and
  `DocumentRejected_REC_2`.

- Introduced `EmailTemplateQuery` record in `EmailTemplateQuery.cs`
  with parameters for `Id`, `Type`, and `Culture`, along with
  German documentation.

- Added `ReadEmailTemplateQuery` record in
  `ReadEmailTemplateQuery.cs` that inherits from
  `EmailTemplateQuery` for reading email templates.
2025-04-12 00:11:21 +02:00
Developer 02
778a498e00 Refactor command records for envelope creation
Updated `CreateEnvelopeReceiverCommand` to use new types for `Document` and `Receivers`. Renamed `ReceiverGetOrCreateDto` to `ReceiverGetOrCreateCommand` and `DocumentCreateDto` to `DocumentCreateCommand` to align with the new command structure. Properties within these records remain unchanged.
2025-04-11 23:46:14 +02:00
Developer 02
48240f2f30 Change namespace and update documentation comments
Updated the namespace for the `EnvelopeReceiverQuery` class to `EnvelopeGenerator.Application.EnvelopeReceivers`. Revised the documentation for the `EnvelopeStatusQuery` record to provide a more concise list of envelope statuses while keeping the existing parameters.
2025-04-11 23:43:46 +02:00
Developer 02
e3dfa8dd39 Add ApiExplorerSettings to DTOs and update controllers
This commit introduces the `[ApiExplorerSettings(IgnoreApi = true)]` attribute to various DTO classes to exclude them from API documentation. The `using Microsoft.AspNetCore.Mvc;` directive has been added to several files to support ASP.NET Core MVC features.

Additionally, comments in `HistoryController.cs` have been reformatted for clarity, and `LocalizationController.cs` has been updated with standard API controller attributes. These changes improve code organization and maintain cleaner API documentation.
2025-04-11 23:41:47 +02:00
Developer 02
6e641395d5 Add JWT Bearer authentication to Swagger setup
Implemented security definitions and requirements for JWT Bearer authentication in the Swagger configuration. This includes defining a "Bearer" security scheme and adding a security requirement to support JWT authorization via the Authorization header.
2025-04-11 23:34:43 +02:00
Developer 02
fbd09cb570 Update comments in HistoryController for clarity
Improved descriptions of historical records related to sender, receiver, system, and unknown statuses. Enhanced formatting and provided detailed explanations of associated status codes for better readability.
2025-04-11 23:18:30 +02:00
Developer 02
7389909d77 Update comments in HistoryController class
Revised comments to remove outdated information about letter sending parties. Added new comments to clarify the method's functionality in returning status references for history records, enabling client applications to stay updated.
2025-04-11 22:56:38 +02:00
Developer 02
ded88383b3 refactor(HistoryController): Added new using directives for EmailProfiler and EF Core.
- Expanded XML documentation for GetEnvelopeStatus method,
clarifying the related parameter and its usage.
 - Updated
method signature to include [FromQuery] for better
parameter binding from the query string.
2025-04-11 22:51:40 +02:00
Developer 02
1b9b51fbd2 Add GetEnvelopeStatus method to HistoryController
Implemented a new method `GetEnvelopeStatus` in the `HistoryController` class. This method is accessible via HTTP GET and requires authorization. It returns a dictionary of envelope statuses, enhancing the API's functionality. Additional comments and documentation have been included to clarify the method's purpose and the statuses it handles.
2025-04-11 22:35:47 +02:00
Developer 02
afa6dda16f Update documentation for GetReferenceTypes method
Significantly revised the comments for the GetReferenceTypes method in the HistoryController class. Removed previous summary and response code details, and added a detailed description of the roles involved in the envelope sending process (Receiver, Sender, System, Unknown). Improved clarity with a list format and simplified return type documentation.
2025-04-11 21:08:23 +02:00
Developer 02
994c844f25 Refactor envelope and history query structures
- Removed `Sender` parameter and properties from `EnvelopeQuery`.
- Deleted `SenderQuery` class entirely.
- Cleaned up `HistoryQuery` by removing unused `using` directives and `ReferenceType` logic.
- Added `Related` parameter to `ReadHistoryQuery` for reference type indication.
- Updated `ReferenceType` enum in `Constants.vb` to use explicit integer values.
- Modified `HistoryController` to utilize the new `Related` property for determining sender/receiver inclusion.
2025-04-11 20:51:21 +02:00
Developer 02
4551e5dc64 Refactor envelope history queries and namespaces
Renamed `EnvelopeHistoryQuery` to `HistoryQuery` and
`ReadEnvelopeHistoryQuery` to `ReadHistoryQuery` to improve
clarity. Moved `StatusQuery` to the new
`EnvelopeGenerator.Application.Histories` namespace. Updated
`HistoryController` to use `ReadHistoryQuery`. Removed
unused `using` directives and added relevant ones to align
with the new structure. These changes enhance code
maintainability and organization.
2025-04-11 20:23:51 +02:00
Developer 02
ff34e6afab Revert "Remove GetReferenceTypes method from HistoryController"
This reverts commit a78912260a.
2025-04-11 19:45:12 +02:00
Developer 02
a78912260a Remove GetReferenceTypes method from HistoryController
This commit removes the entire GetReferenceTypes method, along with its XML documentation comments, from the HistoryController class. The method was responsible for retrieving reference types as key-value pairs and returning them in an HTTP response. Its removal indicates a change in functionality, suggesting that reference types are no longer needed or will be managed differently in the application.
2025-04-11 19:43:09 +02:00
Developer 02
c1e81c546f Add OnlyLast parameter to history query records
Updated `EnvelopeHistoryQuery` and `ReadEnvelopeHistoryQuery` to include a new optional `OnlyLast` parameter, removing the `Status` parameter. Documentation comments have been revised to reflect these changes, including updates in the `HistoryController` class.
2025-04-11 19:39:58 +02:00
Developer 02
9a950ae37d Enhance EnvelopeReceiver queries and controller
- Updated `EnvelopeReceiverQuery` to include an optional, nullable `Status` parameter.
- Modified `ReadEnvelopeReceiverQuery` to inherit from the updated `EnvelopeReceiverQuery`.
- Added new using directives in `EnvelopeReceiverController` and enhanced response documentation to include a 401 Unauthorized response.
- Implemented authorization for the `GetEnvelopeReceiver` method.
- Improved documentation and method signature for `GetReceiverName` to accept a `ReadReceiverNameQuery` object.
- Introduced a new `ReadReceiverNameQuery` record for querying the last used salutation of a receiver.
2025-04-11 19:27:53 +02:00
Developer 02
6cec82abd5 Update envelope controllers and improve documentation
- Added using directives in `EnvelopeController.cs` for
  `EnvelopeGenerator.Application.Envelopes.Queries.Read`
  and `EnvelopeGenerator.Common.Constants`.
- Modified `GetAsync` method to use `ReadEnvelopeQuery`
  instead of `StatusQuery`, updating the logic for
  retrieving envelope data.
- Enhanced parameter description in
  `EnvelopeReceiverController.cs` for clarity on
  filtering criteria for envelope recipients.
2025-04-11 18:35:02 +02:00
Developer 02
26616b4cab Update HistoryController comments and response codes
Replaced "Verlaufshistorie" with "Umschlaghistorie" in
the `HistoryController` class to clarify API context.
Added detailed response codes for `GetReferenceTypes`
and `GetAllAsync` methods to enhance API documentation.
2025-04-11 15:08:37 +02:00
Developer 02
178ec9226d Enhance API documentation in EnvelopeController
Added detailed response documentation for HTTP status codes
in the EnvelopeController class. This improves clarity on
expected responses for various scenarios, including success,
client errors, unauthorized access, and server errors.
2025-04-10 19:14:05 +02:00
Developer 02
0147f525fa Update AuthController and Login model for API changes
- Updated API documentation in AuthController.cs to include an optional "id" field in the authentication request body.
- Modified the Login record in Login.cs to require a "Password" field and include optional "Id" and "Username" fields, along with updated documentation comments.
2025-04-10 19:12:01 +02:00
Developer 02
f0ed6137d1 Remove GetSecretAsync method from EnvelopeReceiverController
The GetSecretAsync method, which retrieved secret information based on a UUID, has been completely removed along with its XML documentation comments and error handling logic. This change eliminates the functionality to access secret information via the specified endpoint in the controller.
2025-04-10 19:08:49 +02:00
Developer 02
b4ab2c4423 Enhance API documentation and error handling
Updated `EnvelopeReceiverController` with additional XML documentation for HTTP response codes in key methods. Improved formatting of catch blocks and enhanced logging statements for better error context.
2025-04-10 19:08:35 +02:00
Developer 02
5715343651 Refactor envelope command and controller response
Removed unnecessary parameters from CreateEnvelopeReceiverCommand, simplifying envelope creation. Updated EnvelopeReceiverController to reflect these changes by removing related fields from the JSON response, focusing on essential information.
2025-04-10 19:04:22 +02:00
Developer 02
6550be0235 Add XML documentation for GetReferenceTypes method
This commit introduces XML documentation comments to the
GetReferenceTypes method in the HistoryController class.
The comments clarify the method's purpose, indicating that
it retrieves available reference types and returns them
as key-value pairs, along with a summary and return type
information.
2025-04-10 18:57:48 +02:00
Developer 02
99b0dba79f Refactor envelope sender handling and update namespaces
Changed the namespace for `EnvelopeQuery` and updated the `Sender` parameter type to `SenderQuery?`. Removed `UserQuery.cs` as it is no longer needed. Introduced `SenderQuery.cs` with properties for sender details and added XML documentation for clarity.
2025-04-10 18:50:24 +02:00
Developer 02
2f8d5f1fc8 Refactor Envelope classes to use Sender instead of User
Updated the `EnvelopeHistoryQuery` to determine `ReferenceType` based on the presence of a `Sender` instead of a `User`.

In the `EnvelopeQuery`, replaced the `User` parameter with `Sender`, and updated related properties to reflect this change. This refactor shifts the focus from a user-centric model to a sender-centric model for envelope queries.
2025-04-10 18:49:01 +02:00
Developer 02
6969f5f93e Add XML documentation for EnvelopeQuery properties
This commit introduces XML documentation comments for the `UserId`, `Username`, and `UserEmail` properties in the `EnvelopeQuery` record. The comments clarify the purpose of each property, enhancing code readability and maintainability.
2025-04-10 18:48:08 +02:00
Developer 02
7bbed3890e Add Status parameter to EnvelopeHistoryQuery records
Updated EnvelopeHistoryQuery to include a new `Status` parameter for describing the envelope's status. Modified the `ReferenceType` property to return `ReferenceType.System` when neither the envelope's `User` nor the `Receiver` is defined.

Updated ReadEnvelopeHistoryQuery to include the `Status` parameter and set default values of `null` for `Envelope` and `Receiver`, ensuring consistency with the base class.
2025-04-10 18:46:37 +02:00
Developer 02
98290c7b28 Update comments in ReadEnvelopeReceiverResponse.cs
Enhanced clarity and detail in class documentation.
Rephrased summaries and remarks for better understanding
of the class and its properties, including the relationship
between envelope and receiver. Clarified parameters
`UserId` and `Status` for improved overall documentation.
2025-04-10 18:42:51 +02:00
Developer 02
d55006fdda chore: Hinzufügen von XML-Dokumentationsgenerierung und Swagger-Kommentaren
Aktualisierte Projektdateien zur Aktivierung der XML-Dokumentationsgenerierung durch Hinzufügen der Eigenschaften `<GenerateDocumentationFile>` und `<DocumentationFile>`. Geänderte Swagger-Konfiguration in `Program.cs`, um alle XML-Dateien im Basisverzeichnis für eine flexiblere Einbindung der Dokumentation einzuschließen.
2025-04-10 18:30:12 +02:00
Developer 02
b2cc0cb65a Refactor envelope creation commands and DTOs
Removed `CreateEnvelopeCommand` and introduced `CreateEnvelopeReceiverCommand` with updated parameters. Updated `ReceiverGetOrCreateDto` to include a new `Salution` parameter. Added XML documentation for the new command and associated DTOs.
2025-04-10 18:08:35 +02:00
Developer 02
049827a133 refactor: Deutsche Dokumentation für Umschlagbefehlsdatensätze hinzugefügt
XML-Dokumentationskommentare für `CreateEnvelopeCommand`, `ReceiverGetOrCreateDto` und `DocumentCreateDto` auf Deutsch aktualisiert. Die bestehende englische Dokumentation wurde entfernt, um eine einheitliche Sprache in der Codebasis zu gewährleisten.
2025-04-10 18:03:38 +02:00
Developer01
b8e4dfdf26 Merge branch 'master' of http://git.dd:3000/AppStd/EnvelopeGenerator 2025-04-10 17:47:25 +02:00
Developer01
8a9d5f92f3 MS Bodytext, Bugfixing deleting 2025-04-10 17:46:33 +02:00
Developer 02
b02ab585cb Hinzufügen der Methoden „Create“ und „GetById“ zu ReceiverController
Die Klasse `ReceiverController` wurde um zwei neue Methoden erweitert: `Create` und `GetById`. Beide Methoden sind mit dem Attribut `[NonAction]` gekennzeichnet und derzeit deaktiviert. Die Methode `Create` akzeptiert einen `ReceiverCreateDto`-Parameter, während die Methode `GetById` einen `int`-Parameter annimmt. Die bestehende Methode `Update` bleibt unverändert.

Übersetzt mit DeepL.com (kostenlose Version)
2025-04-10 16:45:17 +02:00
Developer 02
c8a5a8627d Verbesserung der Dokumentation im ReceiverController
Der ReceiverController wurde mit XML-Dokumentationskommentaren versehen, um seinen Zweck und seine Funktionalität zu verdeutlichen. Beibehaltung des Konstruktors mit Parametererklärungen. Verbesserung der Get-Methode für eine bessere Fehlerbehandlung und Protokollierung. Die Create-, Delete- und Update-Methoden wurden als deaktiviert markiert, während ihre Basisfunktionalität beibehalten wurde. Die #region REMOVED ENDPOINTS wurde aktualisiert, um unbenutzte Methoden zu berücksichtigen. Insgesamt verbessern diese Änderungen die Code-Dokumentation und erhalten die Kernfunktionalität.
2025-04-10 16:42:20 +02:00
Developer 02
ecf0771f9e Refactor ReceiverController to use ReadReceiverQuery
Aktualisierte Get- und Delete-Methoden, um ReadReceiverQuery
für die Parameterbehandlung zu verwenden, was die Organisation und Kapselung verbessert.
Service-Aufrufe wurden angepasst, um Eigenschaften des neuen Query-Objekts
anstelle von individuellen Parametern zu verwenden.
2025-04-10 16:40:07 +02:00
Developer 02
02c7040b39 Verbesserung von LocalizationController mit XML-Dokumentation
Die Klasse LocalizationController wurde aktualisiert, um XML-Dokumentationskommentare für eine bessere Klarheit und ein besseres Verständnis der Methoden und Eigenschaften einzuschließen. Zusammenfassungen von Konstruktoren und Methoden sowie Parameterbeschreibungen wurden in deutscher Sprache hinzugefügt. Die allgemeine Struktur und Formatierung der Klasse wurde verbessert, um die richtige Definition und Lesbarkeit zu gewährleisten.
2025-04-10 16:37:33 +02:00
Developer 02
2cb5d0c0d5 Refactor envelope and user query structures
- Introduced a new `UserQuery` record to encapsulate user-related information, replacing individual fields in `EnvelopeQuery`.
- Added a `ReferenceType` property in `EnvelopeHistoryQuery` to enhance reference handling logic.
- Modified `EnvelopeQuery` to use the new `UserQuery` structure, simplifying the data model.
- Updated `HistoryController` with a new constructor and restructured the `GetReferenceTypes` method.
- Introduced `ReadEnvelopeHistoryQuery` to allow for more specific envelope history queries.
- Overall improvements enhance code structure, clarity, and querying capabilities.
2025-04-10 16:35:40 +02:00
Developer 02
9f186afdff refactor(EnvelopeTypeController): aktualisiert zu ignoriert von open-api 2025-04-10 16:09:45 +02:00
Developer 02
ec76014ce7 Verbesserung von EnvelopeReceiverController mit neuen Funktionen
Die Klasse EnvelopeReceiverController wurde aktualisiert, um die Funktionalität und Dokumentation zu verbessern. Es wurde eine neue using-Direktive hinzugefügt und die Namespace-Deklaration verschoben. Einführung der XML-Dokumentation in deutscher Sprache für mehr Klarheit. Die GetEnvelopeReceiver-Methode wurde so geändert, dass sie einen ReadEnvelopeReceiverQuery-Parameter akzeptiert, wodurch ihre Signatur verbessert wurde. Verbesserte Fehlerbehandlung und Protokollierung bei allen Methoden. GetSecretAsync hinzugefügt, um geheime Informationen nach UUID abzurufen. CreateAsync wurde aktualisiert, um die createEnvelopeQuery über den Mediator zu senden und einen akzeptierten Status zurückzugeben.
2025-04-10 16:07:08 +02:00
Developer 02
e7bc43b339 Refactor envelope query structures and controller methods
- Aktualisiert `EnvelopeHistoryQuery` um optionale `Envelope`, `Receiver` und neue `Status` Parameter für mehr Flexibilität zu enthalten.
- Vereinfachte `EnvelopeReceiverQuery`, so dass sie nur noch einen `Status`-Parameter enthält und unnötige Parameter entfernt wurden.
- ReadEnvelopeReceiverQuery„ wurde an das neue Design von ‚EnvelopeReceiverQuery‘ angepasst, indem ein “Status"-Parameter akzeptiert wird.
- Verbesserte XML-Dokumentation in `EnvelopeController` für mehr Klarheit über Methoden und Parameter.
- Die `GetAsync`-Methode wurde gestrafft, um einen `StatusQuery`-Parameter zu akzeptieren, der separate Status-Parameter ersetzt.
- Einführung eines neuen `StatusQuery`-Datensatzes, um Statuswerte mit detaillierter Dokumentation zu kapseln.
- Aktualisierte „using“-Direktiven in relevanten Dateien, um den neuen „EnvelopeHistories“-Namensraum einzubeziehen.
2025-04-10 16:01:21 +02:00
Developer 02
26be8d4565 feat(EnvelopeHistoryQuery): Hinzufügen des EnvelopeHistoryQuery-Datensatzes für den Umschlagverlauf.
- Führt einen neuen Datensatztyp `EnvelopeHistoryQuery` im `EnvelopeGenerator.Application.EnvelopeHistories` Namespace ein. Dieser Datensatz kapselt die Parameter `EnvelopeId`, `Envelope` und `Receiver`, wobei die letzten beiden generische Typen sind, die auf `EnvelopeQuery` und `ReceiverQuery` beschränkt sind. Die XML-Dokumentation enthält Kommentare zur Beschreibung des Datensatzes und seiner Parameter.
2025-04-10 13:19:21 +02:00
Developer 02
17902c4824 Refactor DTOs und Queries für Klarheit und Konsistenz
- Aktualisiert `ReceiverGetOrCreateDto`, um E-Mail in Kleinbuchstaben korrekt zuzuordnen und verbesserte Dokumentation.
- Der Parameter `Receiver` wurde aus der `EnvelopeReceiverQuery` entfernt.
- Verbesserte Kommentare in `ReadEnvelopeReceiverQuery`, um den Zweck zu verdeutlichen.
- Detaillierte Zusammenfassungskommentare zu `ReadEnvelopeReceiverResponse` und `ReadEnvelopeResponse` zum besseren Verständnis der Eigenschaften hinzugefügt.
- Es wurden neue zusammenfassende Kommentare in `ReadReceiverQuery` und `ReadReceiverResponse` eingeführt, um ihre Rollen und Beziehungen zu beschreiben.
2025-04-10 12:45:51 +02:00
Developer 02
115cb86968 Merge branch 'master' of http://git.dd:3000/AppStd/EnvelopeGenerator 2025-04-09 14:25:33 +02:00
Developer 02
4a898e40ac chore: Hinzufügen von IIS-Veröffentlichungsprofilen für .NET 7 und .NET 9
Mit diesem Commit werden zwei neue XML-Projektdateien eingeführt: `IISProfileNet7.pubxml` für .NET 7.0 und `IISProfileNet9Win64.pubxml` für .NET 9.0 mit Windows 64-bit. Diese Dateien definieren wesentliche Eigenschaften für die Veröffentlichung von .NET-Anwendungen, einschließlich der Web-Publishing-Methode, der Build-Konfiguration, des Speicherorts des Pakets und des Bereitstellungspfads, wodurch die ordnungsgemäße Paketierung und Bereitstellung für IIS erleichtert wird.
2025-04-09 14:25:17 +02:00
Developer 02
bdc0286253 chore: Aktualisierung der Ziel-Frameworks in der Projektdatei
Modifizierte `EnvelopeGenerator.GeneratorAPI.csproj`, um
mehrere Ziel-Frameworks zu unterstützen: `net7.0`, `net8.0`, und `net9.0`.
Diese Änderung verbessert die Kompatibilität und macht die Anwendung zukunftssicher.
2025-04-09 13:26:40 +02:00
Developer 02
8bdc305b82 chore: Aktualisierung der Zielframeworks in der Projektdatei
Die Projektdatei `EnvelopeGenerator.Web.csproj` wurde geändert, um mehrere Zielframeworks zu unterstützen. Das bisherige einzelne Zielframework `net7.0` wurde durch `net7.0`, `net8.0` und `net9.0` ersetzt, was eine verbesserte Kompatibilität und Zukunftssicherheit der Anwendung ermöglicht.
2025-04-09 13:25:48 +02:00
Developer 02
396c6014fb Hinzufügen von XML-Dokumentation für ReadEnvelopeQuery
Der Datensatz `ReadEnvelopeQuery` wurde um XML-Kommentare
erweitert, um seinen Zweck als Abfrage zum Lesen von Umschlägen zu verdeutlichen.
2025-04-09 10:30:36 +02:00
Developer 02
06175b0c95 feat(ReceiverQuery): Hinzufügen von XML-Dokumentation zum ReceiverQuery-Datensatz
- Verbesserte Klarheit und Benutzerfreundlichkeit des Codes durch Hinzufügen von XML-Dokumentationskommentaren zum ReceiverQuery-Datensatz, einschließlich einer Zusammenfassung und detaillierter Parameterbeschreibungen.
2025-04-09 10:28:28 +02:00
Developer 02
5375d89d5b Refactor envelope response and query records
`ReadEnvelopeReceiverResponse` wurde aktualisiert, um mehrere Empfänger zuzulassen und `HasPhoneNumber` hinzugefügt. EnvelopeQuery„ wurde durch die Einführung der optionalen Parameter ‚Username‘ und “E-Mail" für einen besseren Benutzerkontext verbessert.
2025-04-09 10:23:19 +02:00
Developer 02
abd1807b18 chore: Aktualisierung der Projekt-Metadaten in der .csproj-Datei
- Hinzufügen von Paket-ID, Titel, Autoren, Firma, Produktname,
Versionsinformationen und Paketausgabepfad zu
`EnvelopeGenerator.GeneratorAPI.csproj` für verbesserte
Identifizierung und Verwaltung in Paket-Repositories.
2025-04-09 09:59:29 +02:00
Developer 02
3f33be452c feat: Option zur Verwendung von Swagger und Scalar in der Produktion hinzufügen.
- Login-Endpunkt beheben
2025-04-09 09:53:13 +02:00
Developer01
7481691b4e MS 2025-04-07 15:00:48 +02:00
Developer01
0d635830f9 MS Merge 2025-04-07 14:57:30 +02:00
Developer01
9b72a7b472 MS Update DocumentViewer 2025-04-07 14:55:48 +02:00
Developer 02
9a4931781a Refactor envelope and receiver response models
- Updated `ReadEnvelopeReceiverResponse` to use `ReadEnvelopeResponse` instead of `ReadReceiverResponse`.
- Modified `ReadReceiverResponse` to include additional parameters in its constructor for better detail.
- Introduced a new `ReadEnvelopeResponse` record with comprehensive properties and a computed `StatusName`.
2025-04-07 14:53:31 +02:00
Developer 02
b3a2e1559a Refactor envelope handling and introduce new queries
Restructured the `CreateEnvelope` functionality by moving the `CreateEnvelopeCommand` and related DTOs to a new namespace. Der `EnvelopeReceiverController` wurde aktualisiert, um diese Änderungen widerzuspiegeln, und die Parameter wurden zur besseren Übersichtlichkeit umbenannt. Es wurden neue Abfragesätze für das Lesen von Umschlag-Empfängern und definierte Antwortstrukturen eingeführt, wodurch die Gesamtorganisation und die Wartbarkeit der Codebasis verbessert wurden.

Übersetzt mit DeepL.com (kostenlose Version)
2025-04-07 12:03:34 +02:00
Developer 02
261d1b3db9 Verbesserte Funktionen zur Erstellung von Umschlägen und Aktualisierung von Projekten
Neue DTOs und Befehle zur Erstellung von Umschlägen in CreateEnvelope.cs hinzugefügt. Aktualisierte Projektdateien, um net7.0, net8.0 und net9.0 zu unterstützen. Refactored EnvelopeController für bessere Struktur und Fehlerbehandlung. Einführung einer Methode zur Erstellung von Umschlägen in EnvelopeReceiverController unter Verwendung von IMediator. Allgemeine Verbesserungen der Funktionalität und Kompatibilität.
2025-04-04 15:36:03 +02:00
Developer 02
401d03aac2 Verbesserung der Umschlagserstellung mit neuen DTOs und Befehlen
Einführung neuer Datenübertragungsobjekte für Signaturen und Empfänger.
Aktualisiert `CreateEnvelopeCommand` um benötigte Felder wie
`Title`, `Message`, `Document` und `Receivers`, zusammen mit optionalen
Parametern. Entfernt `EnvelopeCreateDto` für einen besser strukturierten
Ansatz zur Verwaltung von Umschlagserstellungsdaten.
2025-04-04 14:02:30 +02:00
Developer 02
7871bf72f6 Add CreateEnvelope command and DTO for envelope creation
Führt den `CreateEnvelopeCommand` Datensatz und seinen Handler ein, der die `IRequest` Schnittstelle von MediatR implementiert. Der Handler wirft derzeit eine `NotImplementedException`.

Fügt die Klasse „EnvelopeCreateDto“ mit Eigenschaften für Titel, Nachricht, Sprache, Verfallsdaten, Vertragstyp und TFA-Flag hinzu. Erforderliche Felder werden mit Datenanmerkungen validiert, und für bestimmte Eigenschaften werden Standardwerte festgelegt.
2025-04-03 17:48:49 +02:00
Developer 02
7e07afa384 Add MediatR package reference to project
This commit adds a new package reference for "MediatR"
with version "11.1.0" to the project file
`EnvelopeGenerator.Application.csproj`.
2025-04-03 13:21:08 +02:00
Developer 02
251420134a Verbesserung der Authentifizierungsmethoden und der Dokumentation
Die XML-Dokumentation für die Methode „Login“ wurde aktualisiert, um die Antwortcodes zu verdeutlichen, und es wurden Beispielanfragen hinzugefügt. Einführung einer neuen „Logout“-Methode mit entsprechender Dokumentation und Autorisierung. Hinzufügen einer Methode `IsAuthenticated` zur Überprüfung auf gültige Token, mit aktualisierter Antwortbehandlung und Dokumentation. Das `AllowAnonymous`-Attribut von `IsAuthenticated` wurde entfernt, um die Autorisierung zu erzwingen.
2025-04-03 11:12:33 +02:00
Developer 02
701b26289b Refactor AuthController and update Login method
- Added using directive for EnvelopeGenerator.GeneratorAPI.Models.
- Changed Login method parameter type from LogInDto to Login.
- Modified HTTP route for Login method from "/form" to "form".
- Enhanced XML documentation for better clarity on method usage.
- Specified response type for successful login as text/javascript.
- Removed ProducesResponseType for 500 Internal Server Error.
2025-04-03 08:02:42 +02:00
Developer 02
754e3ddc7a Verbesserung des AuthControllers und der Projektdokumentation
- AuthController.cs mit XML-Dokumentation aktualisiert und Parameter der Login-Methode umstrukturiert.
- Geänderte Klassendefinition zu partiell für Erweiterbarkeit.
- XML-Dokumentationsgenerierung zur Projektdatei hinzugefügt.
- Verbesserte Swagger-Dokumentation in Program.cs und korrigierte API-Beschreibung.
- Einführung einer neuen Datei Login.cs für ein strukturiertes Login-Datenmodell.
2025-04-02 17:07:07 +02:00
Developer 02
a0e8cc6989 Das Swagger-Setup wurde aktualisiert und enthält nun eine detaillierte Dokumentation mit Versionsangaben, Titel, Beschreibung und Kontaktinformationen. 2025-04-02 15:12:59 +02:00
Developer 02
b9f25a0ac4 Update Swashbuckle.AspNetCore to version 8.1.0 2025-04-02 15:02:36 +02:00
Developer 02
f40ee49977 Verbesserung der Login-Methode und Vereinfachung der IsAuthenticated-Route
- Die Login-Methode wurde geändert, um einen zusätzlichen `bool cookie`-Parameter für mehr Flexibilität zu akzeptieren.
- Hinzufügen einer neuen Login-Methode, die LogInDto aus Formulardaten verarbeitet und die ursprüngliche Methode mit `cookie` auf true setzt.
- Aufnahme eines Platzhalters für JWT- und Cookie-Handling in die ursprüngliche Login-Methode.
2025-04-02 14:40:02 +02:00
Developer 02
d08e93cbef Aktualisieren Sie das Projekt auf .NET 9.0 und verbessern Sie die API-Unterstützung
- Zielen Sie nur auf .NET 9.0 in `EnvelopeGenerator.GeneratorAPI.csproj`.
- Fügen Sie das Paket `AspNetCore.Scalar` hinzu und aktualisieren Sie `Microsoft.AspNetCore.OpenApi` auf Version 9.0.3.
- Scalar.AspNetCore„ in die Datei “Program.cs" einbinden.
- Integrieren Sie OpenAPI-Unterstützung mit `AddOpenApi()` und bilden Sie Endpunkte mit `app.MapOpenApi()` und `app.MapScalarApiReference()` ab.
2025-04-02 11:21:31 +02:00
Developer 02
4a48bbb3e2 Update target frameworks in project file
The project file `EnvelopeGenerator.GeneratorAPI.csproj` has been modified to target multiple frameworks, replacing the single target `net7.0` with `net8.0` and `net9.0`. This change enables the project to be built for the latest versions of .NET.
2025-04-01 20:43:35 +02:00
Developer 02
9725e2a729 fix(Programm): Update des „Envelope Generator“-Repositorys und der Dienstkonfiguration 2025-04-01 19:05:33 +02:00
Developer 02
031f0d4cce Hinzufügen des EnvelopeGenerator.Terminal-Projekts mit CLI-Unterstützung
Die Lösung wurde aktualisiert und enthält nun ein neues Projekt `EnvelopeGenerator.Terminal` für .NET 8.0. Hinzufügen der Klassen `CommandManager` und `DependencyInjection` für die Befehlsausführung und die Injektion von Abhängigkeiten mit CommandDotNet. Die Klasse `Program` wurde eingeführt, um den Anwendungshost einzurichten und Befehle auszuführen. Hinzufügen der erforderlichen Paketverweise in der Projektdatei zur Unterstützung neuer Funktionen.
2025-04-01 18:58:26 +02:00
Developer 02
ea09edbc7f chore: Hinzufügen von Infrastruktur- und Präsentationsprojekten zur Lösung
- Einführung der neuen Projekte "Infrastruktur" und "Präsentation" mit ihren jeweiligen GUIDs.
- Die Projektkonfiguration wurde aktualisiert und enthält nun eine „Release“-Einstellung für das angegebene Projekt.
- Angepasste verschachtelte Projektbeziehungen, um die neuen Projekte einzubeziehen.
2025-03-31 11:48:11 +02:00
Developer 02
bd150bf0c0 chore: Aktualisiert auf 3.1.1 2025-03-31 10:31:16 +02:00
Developer 02
4a53e24618 refacto(DocumentStatusDto): Eigenschaft-Value veränderbar gemacht 2025-03-28 15:14:45 +01:00
Developer 02
7c969c8950 ignore annotations.json for bug fix 2025-03-28 15:12:26 +01:00
Developer 02
77831592f9 ignore bug fix test 2025-03-28 15:07:56 +01:00
Developer 02
55290c93e7 feat(mock): Unterstützung für echte Datenbankkonfiguration hinzugefügt
- Parameter `useRealDb` zur Methode `CreateHost` hinzugefügt, um zwischen In-Memory- und echter Datenbank zu wechseln.
- `Microsoft.EntityFrameworkCore` für die Datenbankkonfiguration integriert.
- SQL Server-Verbindung konfiguriert, wenn `useRealDb` auf `true` gesetzt ist, ansonsten wird standardmäßig eine In-Memory-Datenbank verwendet.
2025-03-28 14:08:38 +01:00
Developer 02
77713997bf refactor(DIExtensions): Option zum Hinzufügen von db-Kontext über dbContextOptions-Eingang hinzugefügt 2025-03-28 13:42:49 +01:00
Developer 02
8824bfef00 refactor(DocumentStatusServiceTests): Service-Verzeichnis verschieben. 2025-03-28 13:29:09 +01:00
Developer 02
cc6b4e63a9 feat(Mock): Erstellt, um gefälschte Daten zu erzeugen.
- Methode zur Erstellung eines gefälschten Hosts hinzugefügt.
2025-03-28 13:14:30 +01:00
Developer 02
99f7a5ee43 refactor(EnvelopeGenerator.Tests): umbenannt in EnvelopeGenerator.Tests.Application 2025-03-28 11:45:48 +01:00
Developer 02
b566785668 chore(EnvelopeGenerator.Tests): Fügen Sie das Paket Microsoft.Extensions.DependencyInjection.Abstractions entsprechend der Framework-Version hinzu 2025-03-28 11:40:31 +01:00
Developer 02
0e0f3f412d feat(DocumentStatusServiceTests): initalisiert 2025-03-28 11:27:35 +01:00
Developer 02
f8920a573b feat(EnvelopeGenerator.Test): Erstellt, um Einheitstest von Projekten zu behandeln 2025-03-28 10:57:19 +01:00
Developer 02
cc07a65f09 refactor(Service): Unnötige Importe entfernen 2025-03-28 10:25:25 +01:00
Developer 02
fbba7f2bfc refactor(EnvelopeGenerator.BBTests): Hinzufügen des Nuget-Pakets DigitalData.Controls.DocumentViewer 2025-03-28 10:23:52 +01:00
Developer 02
ba392eb128 Fix: Konflikte beim Zusammenführen 2025-03-28 10:12:07 +01:00
Developer 02
e4906ad9be refactor(EnvelopeGenerator.Test): Umbenennung von EnvelopeGenerator.BBTests 2025-03-28 10:05:54 +01:00
Developer 02
98773eb888 chore: Projekte sind in zwei separate Lösungsdateien unterteilt, „src“ und „tests“. 2025-03-28 09:54:04 +01:00
Developer 02
943481da80 refactor(Core): in Kleinbuchstaben umgewandelt 2025-03-28 09:46:26 +01:00
Developer01
b5579a68cd Merge branch 'master' of http://git.dd:3000/AppStd/EnvelopeGenerator 2025-03-27 17:16:59 +01:00
Developer01
fb069d0ee2 MS 2025-03-27 17:16:50 +01:00
Developer 02
559c4b6340 chore: Aufgerüstet auf 3.1.0 2025-03-27 16:47:12 +01:00
Developer 02
891436ceef refactor(frmFinalizePDF): _ignoredLabels „Position“, „Stellung“ hinzufügen 2025-03-27 16:19:57 +01:00
Developer 02
88777e0c27 refactor(Config): Standardliste IgnoredLabels aktualisieren 2025-03-27 14:01:33 +01:00
Developer 02
7eb8ae6697 Merge branch 'master' into feat/position 2025-03-26 15:10:57 +01:00
Developer01
deda2480b0 MS EG.Test Baget Refresh 2025-03-26 15:10:11 +01:00
Developer01
269be5109c MS Form Baget References 2025-03-26 14:59:28 +01:00
Developer01
3b40a889a3 Merge branch 'master' of http://git.dd:3000/AppStd/EnvelopeGenerator 2025-03-26 14:41:08 +01:00
Developer01
5b60326fbe MS Common GDPicture Update, Baget Integration 2025-03-26 14:40:52 +01:00
Developer 02
6083eea496 refactor(frmFinalizePDF): Aktualisiert, um die Datei aus der DB zu lesen 2025-03-26 13:55:24 +01:00
Developer 02
88c2721ba5 refactor(appsettings): bearbeitete Größenparameter der annotations 2025-03-26 10:55:46 +01:00
Developer 02
db5a2a8640 feat(AnnotationParams): Hinzufügen der Eigenschaft AnnotationDictionary, um Anmerkungen in Form eines Wörterbuchs zu speichern. 2025-03-26 10:42:34 +01:00
Developer 02
fb0022bd2c fix(annotation): Die klassenbasierte Struktur wurde entfernt und die Methode createSignature in die Methode createAnnotations integriert. 2025-03-26 10:15:05 +01:00
Developer 02
c45e6875d0 feat(postion): Hinzufügen und Konfigurieren von Positions- und Positionsbeschriftungsannotationen. 2025-03-25 17:13:51 +01:00
Developer 02
0f855158c3 fix(annotation.js): Unnötige Variablen entfernen. 2025-03-24 13:19:59 +01:00
Developer 02
e9cb49c6a7 feat(annotation.js): Konfigurierte Beschriftungen 2025-03-24 12:48:28 +01:00
Developer 02
9ae1efb946 refactor(network): Die Methode getAnnotationParams wurde aktualisiert, um die Anmerkung übersetzen und das Verhältnis ihrer Größe ändern zu können. 2025-03-24 10:24:35 +01:00
Developer 02
eef6bf27f1 feat(ConfigController): GetAnnotationParams aktualisiert, um Wörterbuch zu senden 2025-03-21 16:14:31 +01:00
Developer 02
2dfe508552 feat(network.js): Methode zum Abrufen von Anmerkungsparametern hinzugefügt 2025-03-21 15:39:24 +01:00
Developer 02
a7b980bd28 refactor(Annotation): Aktualisiert, um null anstelle von Standard zu verwenden 2025-03-21 14:13:49 +01:00
Developer 02
2d7c0a292b feat(appsettings): Konfigurierte AnnotationParams 2025-03-21 13:11:54 +01:00
Developer 02
91f1296e9b Revert "feat(ClientCoefficient): Erstellt, um die Dimensionen für den Kunden bis zu einem gewissen Grad zu erhöhen"
This reverts commit 80e1e7dcf3.
2025-03-21 12:29:39 +01:00
Developer 02
80e1e7dcf3 feat(ClientCoefficient): Erstellt, um die Dimensionen für den Kunden bis zu einem gewissen Grad zu erhöhen 2025-03-21 12:01:42 +01:00
Developer 02
eb024acfa7 featAnnotation): Hinzufügen von Verhältnisanteilen, um die Konfiguration über das Verhältnis zu ermöglichen 2025-03-20 17:16:42 +01:00
Developer 02
210ce072f8 refactor(AnnotationParams): vereinfacht 2025-03-20 17:01:13 +01:00
Developer 02
036e1f68a8 refactor(Annotation): Default.set hinzugefügt, um Standardwerte zu setzen 2025-03-20 16:48:42 +01:00
Developer 02
0b87a3746a fix(Annotation): Aktualisiert, um MarginLeft und Top bei der Berechnung von HorBoundary und VerBoundary zu berücksichtigen 2025-03-20 15:52:21 +01:00
Developer 02
db84abf0e7 feat(Anmerkung): JsonIgnore-Attribut für nicht-clientbezogene Entitäten hinzugefügt 2025-03-20 14:58:41 +01:00
Developer 02
14be46d3d6 refactor(Annotation): Umbenennen von left in marginLeft, top in marginTop, posX in Left und posY in top für eine CSS-ähnlichere Benennung 2025-03-20 14:56:36 +01:00
Developer 02
78b5e3f5cc feat(Annotations): Konvertiere _annots von Dictionary zu IEnumerable.
- Zugehörige Index- und TryGet-Methoden hinzugefügt.
2025-03-20 14:44:57 +01:00
Developer 02
093e64de81 feat(Annotation): Hinzufügen der Eigenschaft Name 2025-03-20 14:27:58 +01:00
Developer 02
43db4e275b fix(Annotation): JsonIgnore-Attribut zu HorBoundAnnot und VerBoundAnnot hinzufügen 2025-03-20 12:46:57 +01:00
Developer 02
353f7698f4 feat(ConfigController): Erstellt, um Webanwendungen über den Server zu konfigurieren.
- GetAnnotationParams Endpunkt hinzufügen, um Annotationsdaten zu senden
2025-03-20 11:50:59 +01:00
Developer 02
d5b4ea46d3 feat(DefaultAnnotation): Hinzufügen der Möglichkeit, eine Annotation mit zentralen Standardwerten zu konfigurieren. 2025-03-20 11:39:40 +01:00
Developer 02
b6563d71b0 feat(Annotation): marginX in left und marginY in top umbenannt. 2025-03-20 10:27:53 +01:00
Developer 02
8a6a11c1bc feat(AnnotationParams): Aktualisiert, um Standardwerte in Annots.init zu setzen. 2025-03-20 10:23:33 +01:00
Developer 02
cbd71aa2b9 feat(AnnotationParams): Logik zur Initialisierung von gebundenen Annotationen hinzugefügt Annots.init 2025-03-20 09:41:51 +01:00
Developer 02
df019a7243 feat(AnnotationParams): Erstellt, um Annotationen über Appsettings zu konfigurieren. 2025-03-20 09:22:36 +01:00
Developer 02
6c222ca9ad Merge branch 'master' into feat/position 2025-03-20 09:05:36 +01:00
Developer 02
53c64ef83e feat(Annotation): Erstellt, um Größe und Layout der Anmerkungen von Umschlägen zu handhaben 2025-03-20 09:00:56 +01:00
Developer 02
3ac0cbeaae chore(frmFinalizePDF): Modul „Encryption“ hinzufügen. 2025-03-18 12:00:58 +01:00
Developer 02
b471c469b5 chore(frmFinalizePDF): GdPicture-Lizenzschlüssel aktualisieren 2025-03-18 11:58:44 +01:00
Developer 02
31a1c0e3a8 chore: GdPicture aktualisieren 2025-03-18 11:57:49 +01:00
Developer 02
08dd6a9aa7 feat(EnvelopeReceiverService): Erstellen der Methode ReadWithSecretByUuidAsync ohne Implementierung. 2025-03-18 11:50:20 +01:00
Developer 02
b6e15dbf03 fix(EnvelopeGenerator.Web): DDModules-Abhängigkeiten unter 2_DLL Projekte verschoben. 2025-03-18 11:46:53 +01:00
Developer 02
146dd2e9d3 Revert "refactor: Erforderliche Abhängigkeiten für GdPicture hinzugefügt und Lizenzschlüssel von frmFinalizePDF aktualisiert"
This reverts commit fa70360c9e.
2025-03-18 11:21:44 +01:00
Developer 02
2cca1b6d4d Revert "refactor(EnvelopeGenerator.Form): GdPicture aktualisieren"
This reverts commit ddc96b96e7.
2025-03-18 11:21:26 +01:00
Developer 02
ddc96b96e7 refactor(EnvelopeGenerator.Form): GdPicture aktualisieren 2025-03-18 10:59:57 +01:00
Developer 02
fa70360c9e refactor: Erforderliche Abhängigkeiten für GdPicture hinzugefügt und Lizenzschlüssel von frmFinalizePDF aktualisiert 2025-03-18 10:38:12 +01:00
Developer 02
da3c7bc0c2 feat(annotation.js): Datum und Ort wurden vertauscht, um die Lesbarkeit zu verbessern. 2025-03-17 15:47:38 +01:00
Developer 02
0692922f12 Merge branch 'master' of http://git.dd:3000/AppStd/EnvelopeGenerator 2025-03-05 11:45:12 +01:00
Developer01
e15e27db16 MS Layout Signaturfeld 2025-02-25 16:23:24 +01:00
Developer01
ac279148ba MS Handling Löschen 2025-02-25 15:17:47 +01:00
Developer01
ab5fdbd41e Merge branch 'master' of http://git.dd:3000/AppStd/EnvelopeGenerator 2025-02-25 10:22:47 +01:00
Developer01
0b93f96a20 MS 2025-02-25 10:22:32 +01:00
Developer 02
1a8d3c2e76 chore(Web): Hochgestuft auf 3 2025-02-13 01:32:07 +01:00
Developer 02
43019e6710 feat(Main.cshtml): Bindung des Titels mit Appettigns über MainViewModel 2025-02-13 01:27:44 +01:00
Developer 02
2f634f18bd refactor(Main.cshtml): App-Logo mit Appsettings über CustomImages verbunden.
- Logo aktualisiert.
 - CSS für Logo hinzugefügt
2025-02-13 01:06:46 +01:00
Developer 02
41b5b62f2c feat(CustomImages): Implementiert anstelle von Bildern, um mehrere Bilder über ein Wörterbuch zu konfigurieren 2025-02-13 00:48:47 +01:00
Developer 02
1e34042f77 refactor(Logo): umbenannt in Img 2025-02-13 00:30:03 +01:00
Developer 02
54e3eed557 feat(Logo): Konvertierung von Klassen in ein Wörterbuch anstelle von getrennten Eigenschaften 2025-02-13 00:19:59 +01:00
Developer 02
934414c3b6 fix(EGDbContext): Unnötige Trigger-Konfiguration entfernt 2025-02-12 21:12:40 +01:00
Developer 02
f9c34ef8fd refactor(EGDbContext): AddTrigger zur Konfiguration von Triggern über appsettings.json erstellt und implementiert 2025-02-12 21:11:08 +01:00
Developer 02
4615205aa5 refactor: Aktualisierung der Anwendungs- und Infrastrukturebenen, so dass die Infrastruktur von der Anwendung abhängig ist.
- Repository-Schnittstellen wurden in die Anwendungsschicht verschoben.
 - Erweiterungsmethoden für die Injektion von Repository-Abhängigkeiten wurden in die Infrastruktur verschoben.
2025-02-12 19:31:13 +01:00
Developer 02
a5a8a9e416 refactor(DbTriggerParams): Erstellt, um Trigger über appsettings.json zu konfigurieren 2025-02-12 18:49:53 +01:00
493 changed files with 19905 additions and 7190 deletions

2
.gitignore vendored
View File

@@ -363,3 +363,5 @@ MigrationBackup/
FodyWeavers.xsd FodyWeavers.xsd
/EnvelopeGenerator.Web/.config/dotnet-tools.json /EnvelopeGenerator.Web/.config/dotnet-tools.json
/EnvelopeGenerator.GeneratorAPI/ClientApp/envelope-generator-ui/.vscode /EnvelopeGenerator.GeneratorAPI/ClientApp/envelope-generator-ui/.vscode
/EnvelopeGenerator.Tests.Application/Services/BugFixTests.cs
/EnvelopeGenerator.Tests.Application/annotations.json

View File

@@ -1,19 +1,33 @@
namespace EnvelopeGenerator.Application.Configurations namespace EnvelopeGenerator.Application.Configurations;
/// <summary>
///
/// </summary>
public class AuthenticatorParams
{ {
public class AuthenticatorParams /// <summary>
{ /// Default value is 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890123456789012345678901234567890123456789'
public string CharPool { get; init; } = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890123456789012345678901234567890123456789"; /// </summary>
public string CharPool { get; init; } = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890123456789012345678901234567890123456789";
//TODO: Increase the DefaultTotpSecretKeyLength (e.g. to 32) but make sure that the QR code is generated correctly and can be scanned by the authenticator. //TODO: Increase the DefaultTotpSecretKeyLength (e.g. to 32) but make sure that the QR code is generated correctly and can be scanned by the authenticator.
public int DefaultTotpSecretKeyLength { get; init; } = 20; /// <summary>
/// Default value is 20
/// </summary>
public int DefaultTotpSecretKeyLength { get; init; } = 20;
public string TotpIssuer { get; init; } = "signFlow"; /// <summary>
/// Default value is
/// </summary>
public string TotpIssuer { get; init; } = "signFlow";
/// <summary> /// <summary>
/// 0 is user email, 1 is secret key and 2 is issuer. /// 0 is user email, 1 is secret key and 2 is issuer.
/// </summary> /// </summary>
public string TotpUrlFormat { get; init; } = "otpauth://totp/{0}?secret={1}&issuer={2}"; public string TotpUrlFormat { get; init; } = "otpauth://totp/{0}?secret={1}&issuer={2}";
public int TotpQRPixelsPerModule { get; init; } = 20; /// <summary>
} /// Default value is 20.
/// </summary>
public int TotpQRPixelsPerModule { get; init; } = 20;
} }

View File

@@ -0,0 +1,8 @@
namespace EnvelopeGenerator.Application.Configurations;
/// <summary>
///
/// </summary>
public class DbTriggerParams : Dictionary<string, IEnumerable<string>>
{
}

View File

@@ -1,12 +1,27 @@
namespace EnvelopeGenerator.Application.Configurations; namespace EnvelopeGenerator.Application.Configurations;
/// <summary>
///
/// </summary>
public class DispatcherParams public class DispatcherParams
{ {
/// <summary>
/// Default value is 1
/// </summary>
public int SendingProfile { get; init; } = 1; public int SendingProfile { get; init; } = 1;
/// <summary>
/// Defalt value is 'DDEnvelopGenerator'
/// </summary>
public string AddedWho { get; init; } = "DDEnvelopGenerator"; public string AddedWho { get; init; } = "DDEnvelopGenerator";
/// <summary>
/// Default value is 202377
/// </summary>
public int ReminderTypeId { get; init; } = 202377; public int ReminderTypeId { get; init; } = 202377;
/// <summary>
/// Default value is string.Empty
/// </summary>
public string EmailAttmt1 { get; init; } = string.Empty; public string EmailAttmt1 { get; init; } = string.Empty;
} }

View File

@@ -1,4 +1,4 @@
using DigitalData.Core.Abstractions.Client; using DigitalData.Core.Client.Interface;
namespace EnvelopeGenerator.Application.Configurations; namespace EnvelopeGenerator.Application.Configurations;
/// <summary> /// <summary>
@@ -6,15 +6,32 @@ namespace EnvelopeGenerator.Application.Configurations;
/// </summary> /// </summary>
public class GtxMessagingParams : IHttpClientOptions public class GtxMessagingParams : IHttpClientOptions
{ {
/// <summary>
///
/// </summary>
public required string Uri { get; init; } public required string Uri { get; init; }
/// <summary>
///
/// </summary>
public string? Path { get; init; } public string? Path { get; init; }
/// <summary>
///
/// </summary>
public Dictionary<string, object>? Headers { get; init; } public Dictionary<string, object>? Headers { get; init; }
/// <summary>
///
/// </summary>
public Dictionary<string, object?>? QueryParams { get; init; } public Dictionary<string, object?>? QueryParams { get; init; }
/// <summary>
/// Default value is 'to'
/// </summary>
public string RecipientQueryParamName { get; init; } = "to"; public string RecipientQueryParamName { get; init; } = "to";
/// <summary>
/// Default value is 'text'
/// </summary>
public string MessageQueryParamName { get; init; } = "text"; public string MessageQueryParamName { get; init; } = "text";
} }

View File

@@ -1,6 +1,12 @@
namespace EnvelopeGenerator.Application.Configurations; namespace EnvelopeGenerator.Application.Configurations;
/// <summary>
///
/// </summary>
public class MailParams public class MailParams
{ {
/// <summary>
///
/// </summary>
public required Dictionary<string, string> Placeholders { get; init; } public required Dictionary<string, string> Placeholders { get; init; }
} }

View File

@@ -1,49 +1,81 @@
using OtpNet; using OtpNet;
using System.Globalization; using System.Globalization;
namespace EnvelopeGenerator.Application.Configurations namespace EnvelopeGenerator.Application.Configurations;
/// <summary>
///
/// </summary>
public class TotpSmsParams
{ {
public class TotpSmsParams /// <summary>
/// The unit is second.
/// </summary>
public int TotpStep { get; init; } = 90;
/// <summary>
/// Default value is 'Ihr 2FA-Passwort lautet {0}. Gültig bis {1}'
/// </summary>
public string Format { get; init; } = "Ihr 2FA-Passwort lautet {0}. Gültig bis {1}";
/// <summary>
///
/// </summary>
public ExpirationHandler Expiration { get; init; } = new();
/// <summary>
/// Default value is VerificationWindow.RfcSpecifiedNetworkDelay
/// </summary>
public VerificationWindow? TotpVerificationWindow { get; private init; } = VerificationWindow.RfcSpecifiedNetworkDelay;
private IEnumerable<int>? _tvwParams;
/// <summary>
///
/// </summary>
public IEnumerable<int>? TotpVerificationWindowParams
{ {
/// <summary> get => _tvwParams;
/// The unit is second. init
/// </summary>
public int TotpStep { get; init; } = 90;
public string Format { get; init; } = "Ihr 2FA-Passwort lautet {0}. Gültig bis {1}";
public ExpirationHandler Expiration { get; init; } = new();
public VerificationWindow? TotpVerificationWindow { get; private init; } = VerificationWindow.RfcSpecifiedNetworkDelay;
private IEnumerable<int>? _tvwParams;
public IEnumerable<int>? TotpVerificationWindowParams
{ {
get => _tvwParams; _tvwParams = value;
init if(_tvwParams is not null)
{ TotpVerificationWindow = new(previous: _tvwParams.ElementAtOrDefault(0), future: _tvwParams.ElementAtOrDefault(0));
_tvwParams = value;
if(_tvwParams is not null)
TotpVerificationWindow = new(previous: _tvwParams.ElementAtOrDefault(0), future: _tvwParams.ElementAtOrDefault(0));
}
}
public class ExpirationHandler
{
public string CacheKeyFormat { get; init; } = "e{0}_r{1}_sms_code_expiration";
public string Format { get; init; } = "HH:mm:ss";
public string CultureName
{
get => _cultureInfo.Name;
init => _cultureInfo = new(value);
}
private CultureInfo _cultureInfo = new("de-DE");
public CultureInfo CultureInfo => _cultureInfo;
} }
} }
/// <summary>
///
/// </summary>
public class ExpirationHandler
{
/// <summary>
/// Default value is 'e{0}_r{1}_sms_code_expiration'
/// </summary>
public string CacheKeyFormat { get; init; } = "e{0}_r{1}_sms_code_expiration";
/// <summary>
/// Default value is HH:mm:ss
/// </summary>
public string Format { get; init; } = "HH:mm:ss";
/// <summary>
/// Default value is 'de-DE'
/// </summary>
public string CultureName
{
get => _cultureInfo.Name;
init => _cultureInfo = new(value);
}
/// <summary>
/// Default value is 'de-DE'
/// </summary>
private CultureInfo _cultureInfo = new("de-DE");
/// <summary>
/// Default value is 'de-DE'
/// </summary>
public CultureInfo CultureInfo => _cultureInfo;
}
} }

View File

@@ -1,19 +0,0 @@
using OtpNet;
namespace EnvelopeGenerator.Application.Contracts
{
public interface IAuthenticator
{
string GenerateCode(int length);
string GenerateTotpSecretKey(int? length = null);
byte[] GenerateTotpQrCode(string userEmail, string secretKey, string? issuer = null, string? totpUrlFormat = null, int? pixelsPerModule = null);
byte[] GenerateTotpQrCode(string userEmail, int? length = null, string? issuer = null, string? totpUrlFormat = null, int? pixelsPerModule = null);
string GenerateTotp(string secretKey, int step = 30);
bool VerifyTotp(string totpCode, string secretKey, int step = 30, VerificationWindow? window = null);
}
}

View File

@@ -1,17 +0,0 @@
using DigitalData.Core.Abstractions.Application;
using DigitalData.Core.DTO;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts
{
public interface IConfigService : IReadService<ConfigDto, Config, int>
{
Task<DataResult<ConfigDto>> ReadFirstAsync();
Task<ConfigDto> ReadDefaultAsync();
Task<string> ReadDefaultSignatureHost();
}
}

View File

@@ -1,10 +0,0 @@
using DigitalData.Core.Abstractions.Application;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts
{
public interface IDocumentReceiverElementService : IBasicCRUDService<DocumentReceiverElementDto, DocumentReceiverElement, int>
{
}
}

View File

@@ -1,9 +0,0 @@
using DigitalData.Core.Abstractions.Application;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts
{
public interface IDocumentStatusService : IBasicCRUDService<DocumentStatusDto, DocumentStatus, int>
{
}
}

View File

@@ -1,13 +0,0 @@
using DigitalData.Core.Abstractions.Application;
using DigitalData.Core.DTO;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
using static EnvelopeGenerator.Common.Constants;
namespace EnvelopeGenerator.Application.Contracts
{
public interface IEmailTemplateService : IBasicCRUDService<EmailTemplateDto, EmailTemplate, int>
{
Task<DataResult<EmailTemplateDto>> ReadByNameAsync(EmailTemplateType type);
}
}

View File

@@ -1,10 +0,0 @@
using DigitalData.Core.Abstractions.Application;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts
{
public interface IEnvelopeCertificateService : IBasicCRUDService<EnvelopeCertificateDto, EnvelopeCertificate, int>
{
}
}

View File

@@ -1,10 +0,0 @@
using DigitalData.Core.Abstractions.Application;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts
{
public interface IEnvelopeDocumentService : IBasicCRUDService<EnvelopeDocumentDto, EnvelopeDocument, int>
{
}
}

View File

@@ -1,28 +0,0 @@
using DigitalData.Core.Abstractions.Application;
using DigitalData.Core.DTO;
using EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
using EnvelopeGenerator.Application.DTOs.Receiver;
using EnvelopeGenerator.Domain.Entities;
using static EnvelopeGenerator.Common.Constants;
namespace EnvelopeGenerator.Application.Contracts
{
public interface IEnvelopeHistoryService : ICRUDService<EnvelopeHistoryCreateDto, EnvelopeHistoryDto, EnvelopeHistoryDto, EnvelopeHistory, long>
{
Task<int> CountAsync(int? envelopeId = null, string? userReference = null, int? status = null);
Task<bool> AccessCodeAlreadyRequested(int envelopeId, string userReference);
Task<bool> IsSigned(int envelopeId, string userReference);
Task<bool> IsRejected(int envelopeId, string? userReference = null);
Task<IEnumerable<EnvelopeHistoryDto>> ReadAsync(int? envelopeId = null, string? userReference = null, ReferenceType? referenceType = null, int? status = null, bool withSender = false, bool withReceiver = false);
Task<IEnumerable<EnvelopeHistoryDto>> ReadRejectedAsync(int envelopeId, string? userReference = null);
Task<IEnumerable<ReceiverReadDto>> ReadRejectingReceivers(int envelopeId);
Task<DataResult<long>> RecordAsync(int envelopeId, string userReference, EnvelopeStatus status, string? comment = null);
}
}

View File

@@ -1,19 +0,0 @@
using DigitalData.Core.DTO;
using DigitalData.EmailProfilerDispatcher.Abstraction.Contracts;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
using EnvelopeGenerator.Common;
namespace EnvelopeGenerator.Application.Contracts
{
public interface IEnvelopeMailService : IEmailOutService
{
Task<DataResult<int>> SendAsync(EnvelopeReceiverDto envelopeReceiverDto, Constants.EmailTemplateType tempType, Dictionary<string, object>? optionalPlaceholders = null);
Task<DataResult<int>> SendAsync(EnvelopeReceiverReadOnlyDto dto, Dictionary<string, object>? optionalPlaceholders = null);
Task<DataResult<int>> SendAccessCodeAsync(EnvelopeReceiverDto envelopeReceiverDto);
Task<DataResult<int>> SendTFAQrCodeAsync(EnvelopeReceiverDto envelopeReceiverDto);
}
}

View File

@@ -1,10 +0,0 @@
using DigitalData.Core.Abstractions.Application;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts
{
public interface IEnvelopeReceiverReadOnlyService : ICRUDService<EnvelopeReceiverReadOnlyCreateDto, EnvelopeReceiverReadOnlyDto, EnvelopeReceiverReadOnlyUpdateDto, EnvelopeReceiverReadOnly, long>
{
}
}

View File

@@ -1,38 +0,0 @@
using DigitalData.Core.Abstractions.Application;
using DigitalData.Core.DTO;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
using EnvelopeGenerator.Application.DTOs.Messaging;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts
{
public interface IEnvelopeReceiverService : IBasicCRUDService<EnvelopeReceiverDto, EnvelopeReceiver, (int Envelope, int Receiver)>
{
Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUuidAsync(string uuid, bool withEnvelope = true, bool withReceiver = false, bool readOnly = true);
Task<DataResult<IEnumerable<string?>>> ReadAccessCodeByUuidAsync(string uuid, bool withEnvelope = false, bool withReceiver = true);
Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadBySignatureAsync(string signature, bool withEnvelope = false, bool withReceiver = true, bool readOnly = true);
Task<DataResult<EnvelopeReceiverDto>> ReadByUuidSignatureAsync(string uuid, string signature, bool withEnvelope = true, bool withReceiver = true, bool readOnly = true);
Task<DataResult<EnvelopeReceiverSecretDto>> ReadWithSecretByUuidSignatureAsync(string uuid, string signature, bool withEnvelope = true, bool withReceiver = true, bool readOnly = true);
Task<DataResult<EnvelopeReceiverDto>> ReadByEnvelopeReceiverIdAsync(string envelopeReceiverId, bool withEnvelope = true, bool withReceiver = true, bool readOnly = true);
Task<DataResult<string>> ReadAccessCodeByIdAsync(int envelopeId, int receiverId);
Task<DataResult<bool>> VerifyAccessCodeAsync(string uuid, string signature, string accessCode);
Task<DataResult<bool>> VerifyAccessCodeAsync(string envelopeReceiverId, string accessCode);
Task<DataResult<bool>> IsExisting(string envelopeReceiverId);
Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUsernameAsync(string username, int? min_status = null, int? max_status = null, params int[] ignore_statuses);
Task<DataResult<string?>> ReadLastUsedReceiverNameByMail(string mail);
Task<DataResult<SmsResponse>> SendSmsAsync(string envelopeReceiverId, string message);
}
}

View File

@@ -1,16 +0,0 @@
using DigitalData.Core.Abstractions.Application;
using DigitalData.Core.DTO;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts
{
public interface IEnvelopeService : IBasicCRUDService<EnvelopeDto, Envelope, int>
{
Task<DataResult<IEnumerable<EnvelopeDto>>> ReadAllWithAsync(bool documents = false, bool history = false, bool documentReceiverElement = false);
Task<DataResult<EnvelopeDto>> ReadByUuidAsync(string uuid, bool withDocuments = false, bool withHistory = false, bool withDocumentReceiverElement = false, bool withUser = false, bool withAll = false);
Task<DataResult<IEnumerable<EnvelopeDto>>> ReadByUserAsync(int userId, int? min_status = null, int? max_status = null, params int[]ignore_statuses);
}
}

View File

@@ -1,10 +0,0 @@
using DigitalData.Core.Abstractions.Application;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts
{
public interface IEnvelopeTypeService : IBasicCRUDService<EnvelopeTypeDto, EnvelopeType, int>
{
}
}

View File

@@ -1,17 +0,0 @@
using DigitalData.Core.Abstractions;
using DigitalData.Core.Abstractions.Application;
using DigitalData.Core.DTO;
using EnvelopeGenerator.Application.DTOs.Receiver;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts
{
public interface IReceiverService : ICRUDService<ReceiverCreateDto, ReceiverReadDto, ReceiverUpdateDto, Receiver, int>
{
Task<DataResult<ReceiverReadDto>> ReadByAsync(string? emailAddress = null, string? signature = null);
Task<Result> DeleteByAsync(string? emailAddress = null, string? signature = null);
Task<Result> UpdateAsync<TUpdateDto>(TUpdateDto updateDto) where TUpdateDto : IUnique<int>;
}
}

View File

@@ -1,11 +0,0 @@
using EnvelopeGenerator.Application.DTOs.Messaging;
namespace EnvelopeGenerator.Application.Contracts;
//TODO: move to DigitalData.Core
public interface ISmsSender
{
string ServiceProvider { get; }
Task<SmsResponse> SendSmsAsync(string recipient, string message);
}

View File

@@ -1,10 +0,0 @@
using DigitalData.Core.Abstractions.Application;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts
{
public interface IUserReceiverService : IBasicCRUDService<UserReceiverDto, UserReceiver, int>
{
}
}

View File

@@ -0,0 +1,17 @@
using DigitalData.Core.Abstraction.Application.Repository;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Repositories;
/// <summary>
///
/// </summary>
[Obsolete("Use IRepository")]
public interface IConfigRepository : ICRUDRepository<Config, int>
{
/// <summary>
///
/// </summary>
/// <returns></returns>
Task<Config?> ReadFirstAsync();
}

View File

@@ -0,0 +1,11 @@
using DigitalData.Core.Abstraction.Application.Repository;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Repositories;
/// <summary>
///
/// </summary>
[Obsolete("Use IRepository")]
public interface IDocumentReceiverElementRepository : ICRUDRepository<DocumentReceiverElement, int>
{
}

View File

@@ -0,0 +1,12 @@
using DigitalData.Core.Abstraction.Application.Repository;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Repositories;
/// <summary>
///
/// </summary>
[Obsolete("Use IRepository")]
public interface IDocumentStatusRepository : ICRUDRepository<DocumentStatus, int>
{
}

View File

@@ -0,0 +1,19 @@
using DigitalData.Core.Abstraction.Application.Repository;
using EnvelopeGenerator.Domain.Entities;
using static EnvelopeGenerator.Domain.Constants;
namespace EnvelopeGenerator.Application.Contracts.Repositories;
/// <summary>
///
/// </summary>
[Obsolete("Use IRepository")]
public interface IEmailTemplateRepository : ICRUDRepository<EmailTemplate, int>
{
/// <summary>
///
/// </summary>
/// <param name="type"></param>
/// <returns></returns>
Task<EmailTemplate?> ReadByNameAsync(EmailTemplateType type);
}

View File

@@ -0,0 +1,12 @@
using DigitalData.Core.Abstraction.Application.Repository;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Repositories;
/// <summary>
///
/// </summary>
[Obsolete("Use Read-method returning IReadQuery<TEntity> instead.")]
public interface IEnvelopeCertificateRepository : ICRUDRepository<EnvelopeCertificate, int>
{
}

View File

@@ -0,0 +1,12 @@
using DigitalData.Core.Abstraction.Application.Repository;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Repositories;
/// <summary>
///
/// </summary>
[Obsolete("Use IRepository")]
public interface IEnvelopeDocumentRepository : ICRUDRepository<EnvelopeDocument, int>
{
}

View File

@@ -0,0 +1,32 @@
using DigitalData.Core.Abstraction.Application.Repository;
using EnvelopeGenerator.Domain;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Repositories;
/// <summary>
///
/// </summary>
[Obsolete("Use IRepository")]
public interface IEnvelopeHistoryRepository : ICRUDRepository<EnvelopeHistory, long>
{
/// <summary>
///
/// </summary>
/// <param name="envelopeId"></param>
/// <param name="userReference"></param>
/// <param name="status"></param>
/// <returns></returns>
Task<int> CountAsync(int? envelopeId = null, string? userReference = null, Constants.EnvelopeStatus? status = null);
/// <summary>
///
/// </summary>
/// <param name="envelopeId"></param>
/// <param name="userReference"></param>
/// <param name="status"></param>
/// <param name="withSender"></param>
/// <param name="withReceiver"></param>
/// <returns></returns>
Task<IEnumerable<EnvelopeHistory>> ReadAsync(int? envelopeId = null, string? userReference = null, Constants.EnvelopeStatus? status = null, bool withSender = false, bool withReceiver = false);
}

View File

@@ -0,0 +1,12 @@
using DigitalData.Core.Abstraction.Application.Repository;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Repositories;
/// <summary>
///
/// </summary>
[Obsolete("Use IRepository")]
public interface IEnvelopeReceiverReadOnlyRepository : ICRUDRepository<EnvelopeReceiverReadOnly, long>
{
}

View File

@@ -0,0 +1,96 @@
using DigitalData.Core.Abstraction.Application.Repository;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Repositories;
/// <summary>
///
/// </summary>
[Obsolete("Use IRepository")]
public interface IEnvelopeReceiverRepository : ICRUDRepository<EnvelopeReceiver, (int Envelope, int Receiver)>
{
/// <summary>
///
/// </summary>
/// <param name="uuid"></param>
/// <param name="withEnvelope"></param>
/// <param name="withReceiver"></param>
/// <param name="readOnly"></param>
/// <returns></returns>
Task<IEnumerable<EnvelopeReceiver>> ReadByUuidAsync(string uuid, bool withEnvelope = true, bool withReceiver = false, bool readOnly = true);
/// <summary>
///
/// </summary>
/// <param name="signature"></param>
/// <param name="withEnvelope"></param>
/// <param name="withReceiver"></param>
/// <param name="readOnly"></param>
/// <returns></returns>
Task<IEnumerable<EnvelopeReceiver>> ReadBySignatureAsync(string signature, bool withEnvelope = false, bool withReceiver = true, bool readOnly = true);
/// <summary>
///
/// </summary>
/// <param name="uuid"></param>
/// <param name="signature"></param>
/// <param name="withEnvelope"></param>
/// <param name="withReceiver"></param>
/// <param name="readOnly"></param>
/// <returns></returns>
Task<EnvelopeReceiver?> ReadByUuidSignatureAsync(string uuid, string signature, bool withEnvelope = true, bool withReceiver = true, bool readOnly = true);
/// <summary>
///
/// </summary>
/// <param name="uuid"></param>
/// <param name="signature"></param>
/// <param name="readOnly"></param>
/// <returns></returns>
Task<string?> ReadAccessCodeAsync(string uuid, string signature, bool readOnly = true);
/// <summary>
///
/// </summary>
/// <param name="uuid"></param>
/// <param name="signature"></param>
/// <returns></returns>
Task<int> CountAsync(string uuid, string signature);
/// <summary>
///
/// </summary>
/// <param name="envelopeId"></param>
/// <param name="receiverId"></param>
/// <param name="readOnly"></param>
/// <returns></returns>
Task<EnvelopeReceiver?> ReadByIdAsync(int envelopeId, int receiverId, bool readOnly = true);
/// <summary>
///
/// </summary>
/// <param name="envelopeId"></param>
/// <param name="receiverId"></param>
/// <param name="readOnly"></param>
/// <returns></returns>
Task<string?> ReadAccessCodeByIdAsync(int envelopeId, int receiverId, bool readOnly = true);
/// <summary>
///
/// </summary>
/// <param name="username"></param>
/// <param name="min_status"></param>
/// <param name="max_status"></param>
/// <param name="ignore_statuses"></param>
/// <returns></returns>
Task<IEnumerable<EnvelopeReceiver>> ReadByUsernameAsync(string username, int? min_status = null, int? max_status = null, params int[] ignore_statuses);
/// <summary>
///
/// </summary>
/// <param name="email"></param>
/// <param name="id"></param>
/// <param name="signature"></param>
/// <returns></returns>
Task<EnvelopeReceiver?> ReadLastByReceiverAsync(string? email = null, int? id = null, string? signature = null);
}

View File

@@ -0,0 +1,42 @@
using DigitalData.Core.Abstraction.Application.Repository;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Repositories;
/// <summary>
///
/// </summary>
[Obsolete("Use IRepository")]
public interface IEnvelopeRepository : ICRUDRepository<Envelope, int>
{
/// <summary>
///
/// </summary>
/// <param name="documents"></param>
/// <param name="history"></param>
/// <param name="documentReceiverElement"></param>
/// <returns></returns>
Task<IEnumerable<Envelope>> ReadAllWithAsync(bool documents = false, bool history = false, bool documentReceiverElement = false);
/// <summary>
///
/// </summary>
/// <param name="uuid"></param>
/// <param name="withDocuments"></param>
/// <param name="withHistory"></param>
/// <param name="withDocumentReceiverElement"></param>
/// <param name="withUser"></param>
/// <param name="withAll"></param>
/// <returns></returns>
Task<Envelope?> ReadByUuidAsync(string uuid, bool withDocuments = false, bool withHistory = false, bool withDocumentReceiverElement = false, bool withUser = false, bool withAll = false);
/// <summary>
///
/// </summary>
/// <param name="userId"></param>
/// <param name="min_status"></param>
/// <param name="max_status"></param>
/// <param name="ignore_statuses"></param>
/// <returns></returns>
Task<IEnumerable<Envelope>> ReadByUserAsync(int userId, int? min_status = null, int? max_status = null, params int[] ignore_statuses);
}

View File

@@ -0,0 +1,12 @@
using DigitalData.Core.Abstraction.Application.Repository;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Repositories;
/// <summary>
///
/// </summary>
[Obsolete("Use IRepository")]
public interface IEnvelopeTypeRepository : ICRUDRepository<EnvelopeType, int>
{
}

View File

@@ -0,0 +1,19 @@
using DigitalData.Core.Abstraction.Application.Repository;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Repositories;
/// <summary>
///
/// </summary>
[Obsolete("Use IRepository")]
public interface IReceiverRepository : ICRUDRepository<Receiver, int>
{
/// <summary>
///
/// </summary>
/// <param name="emailAddress"></param>
/// <param name="signature"></param>
/// <returns></returns>
Task<Receiver?> ReadByAsync(string? emailAddress = null, string? signature = null);
}

View File

@@ -0,0 +1,18 @@
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.SQLExecutor;
/// <summary>
///
/// </summary>
public interface IDocumentExecutor
{
/// <summary>
///
/// </summary>
/// <param name="base64"></param>
/// <param name="envelope_uuid"></param>
/// <param name="cancellation"></param>
/// <returns></returns>
Task<EnvelopeDocument> CreateDocumentAsync(string base64, string envelope_uuid, CancellationToken cancellation = default);
}

View File

@@ -0,0 +1,21 @@
using Dapper;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.SQLExecutor;
/// <summary>
///
/// </summary>
public interface IEnvelopeExecutor : ISQLExecutor
{
/// <summary>
///
/// </summary>
/// <param name="userId"></param>
/// <param name="title"></param>
/// <param name="message"></param>
/// <param name="tfaEnabled"></param>
/// <param name="cancellation"></param>
/// <returns></returns>
Task<Envelope> CreateEnvelopeAsync(int userId, string title = "", string message = "", bool tfaEnabled = false, CancellationToken cancellation = default);
}

View File

@@ -0,0 +1,20 @@
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.SQLExecutor;
/// <summary>
///
/// </summary>
public interface IEnvelopeReceiverExecutor
{
/// <summary>
///
/// </summary>
/// <param name="envelope_uuid"></param>
/// <param name="emailAddress"></param>
/// <param name="salutation"></param>
/// <param name="phone"></param>
/// <param name="cancellation"></param>
/// <returns></returns>
Task<EnvelopeReceiver?> AddEnvelopeReceiverAsync(string envelope_uuid, string emailAddress, string? salutation = null, string? phone = null, CancellationToken cancellation = default);
}

View File

@@ -0,0 +1,70 @@
namespace EnvelopeGenerator.Application.Contracts.SQLExecutor;
/// <summary>
/// Provides methods for executing common queries on a given entity type.
/// This interface abstracts away the direct usage of ORM libraries (such as Entity Framework) for querying data
/// and provides asynchronous and synchronous operations for querying a collection or single entity.
/// </summary>
/// <typeparam name="TEntity">The type of the entity being queried.</typeparam>
public interface IQuery<TEntity>
{
/// <summary>
/// Asynchronously retrieves the first entity or a default value if no entity is found.
/// </summary>
/// <returns>A task that represents the asynchronous operation. The task result contains the entity or a default value.</returns>
public Task<TEntity?> FirstOrDefaultAsync();
/// <summary>
/// Asynchronously retrieves a single entity or a default value if no entity is found.
/// </summary>
/// <returns>A task that represents the asynchronous operation. The task result contains the entity or a default value.</returns>
public Task<TEntity?> SingleOrDefaultAsync();
/// <summary>
/// Asynchronously retrieves a list of entities.
/// </summary>
/// <returns>A task that represents the asynchronous operation. The task result contains the list of entities.</returns>
public Task<IEnumerable<TEntity>> ToListAsync();
/// <summary>
/// Asynchronously retrieves the first entity. Throws an exception if no entity is found.
/// </summary>
/// <returns>A task that represents the asynchronous operation. The task result contains the first entity.</returns>
public Task<TEntity> FirstAsync();
/// <summary>
/// Asynchronously retrieves a single entity. Throws an exception if no entity is found.
/// </summary>
/// <returns>A task that represents the asynchronous operation. The task result contains the single entity.</returns>
public Task<TEntity> SingleAsync();
/// <summary>
/// Synchronously retrieves the first entity or a default value if no entity is found.
/// </summary>
/// <returns>The first entity or a default value.</returns>
public TEntity? FirstOrDefault();
/// <summary>
/// Synchronously retrieves a single entity or a default value if no entity is found.
/// </summary>
/// <returns>The single entity or a default value.</returns>
public TEntity? SingleOrDefault();
/// <summary>
/// Synchronously retrieves a list of entities.
/// </summary>
/// <returns>The list of entities.</returns>
public IEnumerable<TEntity> ToList();
/// <summary>
/// Synchronously retrieves the first entity. Throws an exception if no entity is found.
/// </summary>
/// <returns>The first entity.</returns>
public TEntity First();
/// <summary>
/// Synchronously retrieves a single entity. Throws an exception if no entity is found.
/// </summary>
/// <returns>The single entity.</returns>
public TEntity Single();
}

View File

@@ -0,0 +1,20 @@
namespace EnvelopeGenerator.Application.Contracts.SQLExecutor;
/// <summary>
/// Represents a raw SQL query contract.
/// </summary>
public interface ISQL
{
/// <summary>
/// Gets the raw SQL query string.
/// </summary>
string Raw { get; }
}
/// <summary>
/// Represents a typed SQL query contract for a specific entity.
/// </summary>
/// <typeparam name="TEntity">The type of the entity associated with the SQL query.</typeparam>
public interface ISQL<TEntity> : ISQL
{
}

View File

@@ -0,0 +1,27 @@
namespace EnvelopeGenerator.Application.Contracts.SQLExecutor;
/// <summary>
/// Defines methods for executing raw SQL queries or custom SQL query classes and returning query executors for further operations.
/// Provides abstraction for raw SQL execution as well as mapping the results to <typeparamref name="TEntity"/> objects.
/// </summary>
/// <typeparam name="TEntity">The entity type to which the SQL query results will be mapped.</typeparam>
public interface ISQLExecutor<TEntity>: ISQLExecutor
{
/// <summary>
/// Executes a raw SQL query and returns an <see cref="IQuery{TEntity}"/> for further querying operations on the result.
/// </summary>
/// <param name="sql">The raw SQL query to execute.</param>
/// <param name="cancellation">Optional cancellation token for the operation.</param>
/// <param name="parameters">Optional parameters for the SQL query.</param>
/// <returns>An <see cref="IQuery{TEntity}"/> instance for further query operations on the result.</returns>
IQuery<TEntity> Execute(string sql, CancellationToken cancellation = default, params object[] parameters);
/// <summary>
/// Executes a custom SQL query defined by a class that implements <see cref="ISQL{TEntity}"/> and returns an <see cref="IQuery{TEntity}"/> for further querying operations on the result.
/// </summary>
/// <typeparam name="TSQL">The type of the custom SQL query class implementing <see cref="ISQL{TEntity}"/>.</typeparam>
/// <param name="cancellation">Optional cancellation token for the operation.</param>
/// <param name="parameters">Optional parameters for the SQL query.</param>
/// <returns>An <see cref="IQuery{TEntity}"/> instance for further query operations on the result.</returns>
IQuery<TEntity> Execute<TSQL>(CancellationToken cancellation = default, params object[] parameters) where TSQL : ISQL<TEntity>;
}

View File

@@ -0,0 +1,29 @@
using Dapper;
namespace EnvelopeGenerator.Application.Contracts.SQLExecutor;
/// <summary>
///
/// </summary>
public interface ISQLExecutor
{
/// <summary>
/// Executes a raw SQL query and returns an <see cref="IQuery{TEntity}"/> for further querying operations on the result.
/// </summary>
/// <typeparam name="TEntity">The entity type to which the SQL query results will be mapped.</typeparam>
/// <param name="sql">The raw SQL query to execute.</param>
/// <param name="parameters">Parameters for the SQL query.</param>
/// <param name="cancellation">Optional cancellation token for the operation.</param>
/// <returns>An <see cref="IQuery{TEntity}"/> instance for further query operations on the result.</returns>
Task<IEnumerable<TEntity>> Execute<TEntity>(string sql, DynamicParameters parameters, CancellationToken cancellation = default);
/// <summary>
/// Executes a custom SQL query defined by a class that implements <see cref="ISQL{TEntity}"/> and returns an <see cref="IQuery{TEntity}"/> for further querying operations on the result.
/// </summary>
/// <typeparam name="TEntity">The entity type to which the SQL query results will be mapped.</typeparam>
/// <typeparam name="TSQL">The type of the custom SQL query class implementing <see cref="ISQL{TEntity}"/>.</typeparam>
/// <param name="parameters">Parameters for the SQL query.</param>
/// <param name="cancellation">Optional cancellation token for the operation.</param>
/// <returns>An <see cref="IQuery{TEntity}"/> instance for further query operations on the result.</returns>
Task<IEnumerable<TEntity>> Execute<TEntity, TSQL>(DynamicParameters parameters, CancellationToken cancellation = default) where TSQL : ISQL;
}

View File

@@ -0,0 +1,63 @@
using OtpNet;
namespace EnvelopeGenerator.Application.Contracts.Services;
/// <summary>
///
/// </summary>
public interface IAuthenticator
{
/// <summary>
///
/// </summary>
/// <param name="length"></param>
/// <returns></returns>
string GenerateCode(int length);
/// <summary>
///
/// </summary>
/// <param name="length"></param>
/// <returns></returns>
string GenerateTotpSecretKey(int? length = null);
/// <summary>
///
/// </summary>
/// <param name="userEmail"></param>
/// <param name="secretKey"></param>
/// <param name="issuer"></param>
/// <param name="totpUrlFormat"></param>
/// <param name="pixelsPerModule"></param>
/// <returns></returns>
byte[] GenerateTotpQrCode(string userEmail, string secretKey, string? issuer = null, string? totpUrlFormat = null, int? pixelsPerModule = null);
/// <summary>
///
/// </summary>
/// <param name="userEmail"></param>
/// <param name="length"></param>
/// <param name="issuer"></param>
/// <param name="totpUrlFormat"></param>
/// <param name="pixelsPerModule"></param>
/// <returns></returns>
byte[] GenerateTotpQrCode(string userEmail, int? length = null, string? issuer = null, string? totpUrlFormat = null, int? pixelsPerModule = null);
/// <summary>
///
/// </summary>
/// <param name="secretKey"></param>
/// <param name="step"></param>
/// <returns></returns>
string GenerateTotp(string secretKey, int step = 30);
/// <summary>
///
/// </summary>
/// <param name="totpCode"></param>
/// <param name="secretKey"></param>
/// <param name="step"></param>
/// <param name="window"></param>
/// <returns></returns>
bool VerifyTotp(string totpCode, string secretKey, int step = 30, VerificationWindow? window = null);
}

View File

@@ -0,0 +1,31 @@
using DigitalData.Core.Abstraction.Application;
using DigitalData.Core.Abstraction.Application.DTO;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Services;
/// <summary>
///
/// </summary>
[Obsolete("Use MediatR")]
public interface IConfigService : IReadService<ConfigDto, Config, int>
{
/// <summary>
///
/// </summary>
/// <returns></returns>
Task<DataResult<ConfigDto>> ReadFirstAsync();
/// <summary>
///
/// </summary>
/// <returns></returns>
Task<ConfigDto> ReadDefaultAsync();
/// <summary>
///
/// </summary>
/// <returns></returns>
Task<string> ReadDefaultSignatureHost();
}

View File

@@ -0,0 +1,13 @@
using DigitalData.Core.Abstraction.Application;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Services;
/// <summary>
///
/// </summary>
[Obsolete("Use MediatR")]
public interface IDocumentReceiverElementService : IBasicCRUDService<DocumentReceiverElementDto, DocumentReceiverElement, int>
{
}

View File

@@ -0,0 +1,12 @@
using DigitalData.Core.Abstraction.Application;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Services;
/// <summary>
///
/// </summary>
[Obsolete("Use MediatR")]
public interface IDocumentStatusService : IBasicCRUDService<DocumentStatusDto, DocumentStatus, int>
{
}

View File

@@ -0,0 +1,21 @@
using DigitalData.Core.Abstraction.Application;
using DigitalData.Core.Abstraction.Application.DTO;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
using static EnvelopeGenerator.Domain.Constants;
namespace EnvelopeGenerator.Application.Contracts.Services;
/// <summary>
///
/// </summary>
[Obsolete("Use MediatR")]
public interface IEmailTemplateService : IBasicCRUDService<EmailTemplateDto, EmailTemplate, int>
{
/// <summary>
///
/// </summary>
/// <param name="type"></param>
/// <returns></returns>
Task<DataResult<EmailTemplateDto>> ReadByNameAsync(EmailTemplateType type);
}

View File

@@ -0,0 +1,13 @@
using DigitalData.Core.Abstraction.Application;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Services;
/// <summary>
///
/// </summary>
[Obsolete("Use MediatR")]
public interface IEnvelopeCertificateService : IBasicCRUDService<EnvelopeCertificateDto, EnvelopeCertificate, int>
{
}

View File

@@ -0,0 +1,13 @@
using DigitalData.Core.Abstraction.Application;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Services;
/// <summary>
///
/// </summary>
[Obsolete("Use MediatR")]
public interface IEnvelopeDocumentService : IBasicCRUDService<EnvelopeDocumentDto, EnvelopeDocument, int>
{
}

View File

@@ -0,0 +1,85 @@
using DigitalData.Core.Abstraction.Application;
using DigitalData.Core.Abstraction.Application.DTO;
using EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
using EnvelopeGenerator.Application.DTOs.Receiver;
using EnvelopeGenerator.Domain.Entities;
using static EnvelopeGenerator.Domain.Constants;
namespace EnvelopeGenerator.Application.Contracts.Services;
/// <summary>
///
/// </summary>
[Obsolete("Use MediatR")]
public interface IEnvelopeHistoryService : ICRUDService<EnvelopeHistoryCreateDto, EnvelopeHistoryDto, EnvelopeHistory, long>
{
/// <summary>
///
/// </summary>
/// <param name="envelopeId"></param>
/// <param name="userReference"></param>
/// <param name="status"></param>
/// <returns></returns>
Task<int> CountAsync(int? envelopeId = null, string? userReference = null, EnvelopeStatus? status = null);
/// <summary>
///
/// </summary>
/// <param name="envelopeId"></param>
/// <param name="userReference"></param>
/// <returns></returns>
Task<bool> AccessCodeAlreadyRequested(int envelopeId, string userReference);
/// <summary>
///
/// </summary>
/// <param name="envelopeId"></param>
/// <param name="userReference"></param>
/// <returns></returns>
Task<bool> IsSigned(int envelopeId, string userReference);
/// <summary>
///
/// </summary>
/// <param name="envelopeId"></param>
/// <param name="userReference"></param>
/// <returns></returns>
Task<bool> IsRejected(int envelopeId, string? userReference = null);
/// <summary>
///
/// </summary>
/// <param name="envelopeId"></param>
/// <param name="userReference"></param>
/// <param name="referenceType"></param>
/// <param name="status"></param>
/// <param name="withSender"></param>
/// <param name="withReceiver"></param>
/// <returns></returns>
Task<IEnumerable<EnvelopeHistoryDto>> ReadAsync(int? envelopeId = null, string? userReference = null, ReferenceType? referenceType = null, EnvelopeStatus? status = null, bool withSender = false, bool withReceiver = false);
/// <summary>
///
/// </summary>
/// <param name="envelopeId"></param>
/// <param name="userReference"></param>
/// <returns></returns>
Task<IEnumerable<EnvelopeHistoryDto>> ReadRejectedAsync(int envelopeId, string? userReference = null);
/// <summary>
///
/// </summary>
/// <param name="envelopeId"></param>
/// <returns></returns>
Task<IEnumerable<ReceiverReadDto>> ReadRejectingReceivers(int envelopeId);
/// <summary>
///
/// </summary>
/// <param name="envelopeId"></param>
/// <param name="userReference"></param>
/// <param name="status"></param>
/// <param name="comment"></param>
/// <returns></returns>
Task<DataResult<long>> RecordAsync(int envelopeId, string userReference, EnvelopeStatus status, string? comment = null);
}

View File

@@ -0,0 +1,45 @@
using DigitalData.Core.Abstraction.Application.DTO;
using DigitalData.EmailProfilerDispatcher.Abstraction.Contracts;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
using EnvelopeGenerator.Domain;
namespace EnvelopeGenerator.Application.Contracts.Services;
/// <summary>
///
/// </summary>
[Obsolete("Use MediatR")]
public interface IEnvelopeMailService : IEmailOutService
{
/// <summary>
///
/// </summary>
/// <param name="envelopeReceiverDto"></param>
/// <param name="tempType"></param>
/// <param name="optionalPlaceholders"></param>
/// <returns></returns>
Task<DataResult<int>> SendAsync(EnvelopeReceiverDto envelopeReceiverDto, Constants.EmailTemplateType tempType, Dictionary<string, object>? optionalPlaceholders = null);
/// <summary>
///
/// </summary>
/// <param name="dto"></param>
/// <param name="optionalPlaceholders"></param>
/// <returns></returns>
Task<DataResult<int>> SendAsync(EnvelopeReceiverReadOnlyDto dto, Dictionary<string, object>? optionalPlaceholders = null);
/// <summary>
///
/// </summary>
/// <param name="envelopeReceiverDto"></param>
/// <returns></returns>
Task<DataResult<int>> SendAccessCodeAsync(EnvelopeReceiverDto envelopeReceiverDto);
/// <summary>
///
/// </summary>
/// <param name="envelopeReceiverDto"></param>
/// <returns></returns>
Task<DataResult<int>> SendTFAQrCodeAsync(EnvelopeReceiverDto envelopeReceiverDto);
}

View File

@@ -0,0 +1,13 @@
using DigitalData.Core.Abstraction.Application;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Services;
/// <summary>
///
/// </summary>
[Obsolete("Use MediatR")]
public interface IEnvelopeReceiverReadOnlyService : ICRUDService<EnvelopeReceiverReadOnlyCreateDto, EnvelopeReceiverReadOnlyDto, EnvelopeReceiverReadOnly, long>
{
}

View File

@@ -0,0 +1,148 @@
using CommandDotNet;
using DigitalData.Core.Abstraction.Application;
using DigitalData.Core.Abstraction.Application.DTO;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
using EnvelopeGenerator.Application.DTOs.Messaging;
using EnvelopeGenerator.Application.Envelopes;
using EnvelopeGenerator.Application.Receivers.Queries.Read;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Services;
/// <summary>
///
/// </summary>
[Obsolete("Use MediatR")]
public interface IEnvelopeReceiverService : IBasicCRUDService<EnvelopeReceiverDto, EnvelopeReceiver, (int Envelope, int Receiver)>
{
/// <summary>
///
/// </summary>
/// <param name="uuid"></param>
/// <param name="withEnvelope"></param>
/// <param name="withReceiver"></param>
/// <param name="readOnly"></param>
/// <returns></returns>
Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUuidAsync(string uuid, bool withEnvelope = true, bool withReceiver = false, bool readOnly = true);
/// <summary>
///
/// </summary>
/// <param name="uuid"></param>
/// <param name="withEnvelope"></param>
/// <param name="withReceiver"></param>
/// <returns></returns>
Task<DataResult<IEnumerable<string?>>> ReadAccessCodeByUuidAsync(string uuid, bool withEnvelope = false, bool withReceiver = true);
/// <summary>
///
/// </summary>
/// <param name="signature"></param>
/// <param name="withEnvelope"></param>
/// <param name="withReceiver"></param>
/// <param name="readOnly"></param>
/// <returns></returns>
Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadBySignatureAsync(string signature, bool withEnvelope = false, bool withReceiver = true, bool readOnly = true);
/// <summary>
///
/// </summary>
/// <param name="uuid"></param>
/// <param name="signature"></param>
/// <param name="withEnvelope"></param>
/// <param name="withReceiver"></param>
/// <param name="readOnly"></param>
/// <returns></returns>
Task<DataResult<EnvelopeReceiverDto>> ReadByUuidSignatureAsync(string uuid, string signature, bool withEnvelope = true, bool withReceiver = true, bool readOnly = true);
/// <summary>
///
/// </summary>
/// <param name="uuid"></param>
/// <param name="signature"></param>
/// <param name="withEnvelope"></param>
/// <param name="withReceiver"></param>
/// <param name="readOnly"></param>
/// <returns></returns>
Task<DataResult<EnvelopeReceiverSecretDto>> ReadWithSecretByUuidSignatureAsync(string uuid, string signature, bool withEnvelope = true, bool withReceiver = true, bool readOnly = true);
/// <summary>
///
/// </summary>
/// <param name="envelopeReceiverId"></param>
/// <param name="withEnvelope"></param>
/// <param name="withReceiver"></param>
/// <param name="readOnly"></param>
/// <returns></returns>
Task<DataResult<EnvelopeReceiverDto>> ReadByEnvelopeReceiverIdAsync(string envelopeReceiverId, bool withEnvelope = true, bool withReceiver = true, bool readOnly = true);
/// <summary>
///
/// </summary>
/// <param name="envelopeId"></param>
/// <param name="receiverId"></param>
/// <returns></returns>
Task<DataResult<string>> ReadAccessCodeByIdAsync(int envelopeId, int receiverId);
/// <summary>
///
/// </summary>
/// <param name="uuid"></param>
/// <param name="signature"></param>
/// <param name="accessCode"></param>
/// <returns></returns>
Task<DataResult<bool>> VerifyAccessCodeAsync(string uuid, string signature, string accessCode);
/// <summary>
///
/// </summary>
/// <param name="envelopeReceiverId"></param>
/// <param name="accessCode"></param>
/// <returns></returns>
[Command("verify-access-code-async-by-id")]
Task<DataResult<bool>> VerifyAccessCodeAsync(string envelopeReceiverId, string accessCode);
/// <summary>
///
/// </summary>
/// <param name="envelopeReceiverId"></param>
/// <returns></returns>
Task<DataResult<bool>> IsExisting(string envelopeReceiverId);
/// <summary>
///
/// </summary>
/// <param name="username"></param>
/// <param name="min_status"></param>
/// <param name="max_status"></param>
/// <param name="envelopeQuery"></param>
/// <param name="receiverQuery"></param>
/// <param name="ignore_statuses"></param>
/// <returns></returns>
Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUsernameAsync(string username, int? min_status = null, int? max_status = null, EnvelopeQuery? envelopeQuery = null, ReadReceiverQuery? receiverQuery = null, params int[] ignore_statuses);
/// <summary>
///
/// </summary>
/// <param name="mail"></param>
/// <param name="id"></param>
/// <param name="signature"></param>
/// <returns></returns>
Task<DataResult<string>> ReadLastUsedReceiverNameByMailAsync(string? mail = null, int? id = null, string? signature = null);
/// <summary>
///
/// </summary>
/// <param name="envelopeReceiverId"></param>
/// <param name="message"></param>
/// <returns></returns>
Task<DataResult<SmsResponse>> SendSmsAsync(string envelopeReceiverId, string message);
/// <summary>
///
/// </summary>
/// <param name="uuid"></param>
/// <returns></returns>
Task<DataResult<IEnumerable<EnvelopeReceiverSecretDto>>> ReadWithSecretByUuidAsync(string uuid);
}

View File

@@ -0,0 +1,44 @@
using DigitalData.Core.Abstraction.Application;
using DigitalData.Core.Abstraction.Application.DTO;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Services;
/// <summary>
///
/// </summary>
[Obsolete("Use MediatR")]
public interface IEnvelopeService : IBasicCRUDService<EnvelopeDto, Envelope, int>
{
/// <summary>
///
/// </summary>
/// <param name="documents"></param>
/// <param name="history"></param>
/// <param name="documentReceiverElement"></param>
/// <returns></returns>
Task<DataResult<IEnumerable<EnvelopeDto>>> ReadAllWithAsync(bool documents = false, bool history = false, bool documentReceiverElement = false);
/// <summary>
///
/// </summary>
/// <param name="uuid"></param>
/// <param name="withDocuments"></param>
/// <param name="withHistory"></param>
/// <param name="withDocumentReceiverElement"></param>
/// <param name="withUser"></param>
/// <param name="withAll"></param>
/// <returns></returns>
Task<DataResult<EnvelopeDto>> ReadByUuidAsync(string uuid, bool withDocuments = false, bool withHistory = false, bool withDocumentReceiverElement = false, bool withUser = false, bool withAll = false);
/// <summary>
///
/// </summary>
/// <param name="userId"></param>
/// <param name="min_status"></param>
/// <param name="max_status"></param>
/// <param name="ignore_statuses"></param>
/// <returns></returns>
Task<DataResult<IEnumerable<EnvelopeDto>>> ReadByUserAsync(int userId, int? min_status = null, int? max_status = null, params int[] ignore_statuses);
}

View File

@@ -1,8 +1,11 @@
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver; using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
using EnvelopeGenerator.Application.DTOs.Messaging; using EnvelopeGenerator.Application.DTOs.Messaging;
namespace EnvelopeGenerator.Application.Contracts; namespace EnvelopeGenerator.Application.Contracts.Services;
/// <summary>
///
/// </summary>
public interface IEnvelopeSmsHandler public interface IEnvelopeSmsHandler
{ {
/// <summary> /// <summary>
@@ -13,5 +16,11 @@ public interface IEnvelopeSmsHandler
/// <returns></returns> /// <returns></returns>
Task<(SmsResponse? SmsResponse, DateTime Expiration)> SendTotpAsync(EnvelopeReceiverSecretDto er_secret, CancellationToken cToken = default); Task<(SmsResponse? SmsResponse, DateTime Expiration)> SendTotpAsync(EnvelopeReceiverSecretDto er_secret, CancellationToken cToken = default);
/// <summary>
///
/// </summary>
/// <param name="totpCode"></param>
/// <param name="secretKey"></param>
/// <returns></returns>
bool VerifyTotp(string totpCode, string secretKey); bool VerifyTotp(string totpCode, string secretKey);
} }

View File

@@ -0,0 +1,13 @@
using DigitalData.Core.Abstraction.Application;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Services;
/// <summary>
///
/// </summary>
[Obsolete("Use MediatR")]
public interface IEnvelopeTypeService : IBasicCRUDService<EnvelopeTypeDto, EnvelopeType, int>
{
}

View File

@@ -0,0 +1,29 @@
using DigitalData.Core.Abstraction.Application;
using DigitalData.Core.Abstraction.Application.DTO;
using EnvelopeGenerator.Application.DTOs.Receiver;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Services;
/// <summary>
///
/// </summary>
[Obsolete("Use MediatR")]
public interface IReceiverService : ICRUDService<ReceiverCreateDto, ReceiverReadDto, Receiver, int>
{
/// <summary>
///
/// </summary>
/// <param name="emailAddress"></param>
/// <param name="signature"></param>
/// <returns></returns>
Task<DataResult<ReceiverReadDto>> ReadByAsync(string? emailAddress = null, string? signature = null);
/// <summary>
///
/// </summary>
/// <param name="emailAddress"></param>
/// <param name="signature"></param>
/// <returns></returns>
Task<Result> DeleteByAsync(string? emailAddress = null, string? signature = null);
}

View File

@@ -0,0 +1,23 @@
using EnvelopeGenerator.Application.DTOs.Messaging;
namespace EnvelopeGenerator.Application.Contracts.Services;
//TODO: move to DigitalData.Core
/// <summary>
///
/// </summary>
public interface ISmsSender
{
/// <summary>
///
/// </summary>
string ServiceProvider { get; }
/// <summary>
///
/// </summary>
/// <param name="recipient"></param>
/// <param name="message"></param>
/// <returns></returns>
Task<SmsResponse> SendSmsAsync(string recipient, string message);
}

View File

@@ -1,19 +1,30 @@
using DigitalData.Core.Abstractions; using Microsoft.AspNetCore.Mvc;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json.Serialization;
namespace EnvelopeGenerator.Application.DTOs namespace EnvelopeGenerator.Application.DTOs;
/// <summary>
/// Data Transfer Object representing configuration settings.
/// </summary>
[ApiExplorerSettings(IgnoreApi = true)]
public class ConfigDto
{ {
public record ConfigDto( /// <summary>
string DocumentPath, /// Gets or sets the sending profile identifier.
int SendingProfile, /// </summary>
string SignatureHost, public int SendingProfile { get; set; }
string ExternalProgramName,
string ExportPath) : IUnique<int> /// <summary>
{ /// Gets or sets the signature host URL or name.
[NotMapped] /// </summary>
[JsonIgnore] public required string SignatureHost { get; set; }
[Obsolete("Configuration does not have an ID; it represents a single table in the database.")]
public int Id => throw new InvalidOperationException("This configuration does not support an ID as it represents a single row in the database."); /// <summary>
}; /// Gets or sets the name of the external program.
/// </summary>
public string? ExternalProgramName { get; set; }
/// <summary>
/// Gets or sets the path where exports will be saved.
/// </summary>
public string? ExportPath { get; set; }
} }

View File

@@ -1,24 +1,95 @@
using DigitalData.Core.Abstractions; using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs namespace EnvelopeGenerator.Application.DTOs;
/// <summary>
/// Data Transfer Object representing a positioned element assigned to a document receiver.
/// </summary>
[ApiExplorerSettings(IgnoreApi = true)]
public class DocumentReceiverElementDto
{ {
public record DocumentReceiverElementDto( /// <summary>
int Id, /// Gets or sets the unique identifier of the element.
int DocumentId, /// </summary>
int ReceiverId, public int Id { get; set; }
int ElementType,
double X, /// <summary>
double Y, /// Gets or sets the identifier of the associated document.
double Width, /// </summary>
double Height, public int DocumentId { get; set; }
int Page,
bool Required, /// <summary>
string? Tooltip, /// Gets or sets the identifier of the receiver.
bool ReadOnly, /// </summary>
int AnnotationIndex, public int ReceiverId { get; set; }
DateTime AddedWhen,
DateTime? ChangedWhen, /// <summary>
double Top, /// Gets or sets the type of the element.
double Left /// </summary>
): IUnique<int>; public int ElementType { get; set; }
/// <summary>
/// Gets or sets the X coordinate of the element.
/// </summary>
public double X { get; set; }
/// <summary>
/// Gets or sets the Y coordinate of the element.
/// </summary>
public double Y { get; set; }
/// <summary>
/// Gets or sets the width of the element.
/// </summary>
public double Width { get; set; }
/// <summary>
/// Gets or sets the height of the element.
/// </summary>
public double Height { get; set; }
/// <summary>
/// Gets or sets the page number where the element appears.
/// </summary>
public int Page { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the element is required.
/// </summary>
public bool Required { get; set; }
/// <summary>
/// Gets or sets the tooltip text for the element.
/// </summary>
public string? Tooltip { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the element is read-only.
/// </summary>
public bool ReadOnly { get; set; }
/// <summary>
/// Gets or sets the annotation index for ordering or reference.
/// </summary>
public int AnnotationIndex { get; set; }
/// <summary>
/// Gets or sets the timestamp when the element was added.
/// </summary>
public DateTime AddedWhen { get; set; }
/// <summary>
/// Gets or sets the timestamp when the element was last changed, if applicable.
/// </summary>
public DateTime? ChangedWhen { get; set; }
/// <summary>
/// Gets or sets the top position of the element (in layout terms).
/// </summary>
public double Top { get; set; }
/// <summary>
/// Gets or sets the left position of the element (in layout terms).
/// </summary>
public double Left { get; set; }
} }

View File

@@ -1,14 +1,50 @@
using DigitalData.Core.Abstractions; using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs namespace EnvelopeGenerator.Application.DTOs;
/// <summary>
/// Data Transfer Object representing the status of a document for a specific receiver.
/// </summary>
[ApiExplorerSettings(IgnoreApi = true)]
public class DocumentStatusDto
{ {
public record DocumentStatusDto( /// <summary>
int Id, /// Gets or sets the unique identifier of the document status entry.
int EnvelopeId, /// </summary>
int ReceiverId, public int Id { get; set; }
int Status,
DateTime? StatusChangedWhen, /// <summary>
string Value, /// Gets or sets the ID of the associated envelope.
DateTime AddedWhen, /// </summary>
DateTime? ChangedWhen) : IUnique<int>; public int EnvelopeId { get; set; }
/// <summary>
/// Gets or sets the ID of the receiver associated with this status.
/// </summary>
public int ReceiverId { get; set; }
/// <summary>
/// Gets or sets the current status code.
/// </summary>
public int Status { get; set; }
/// <summary>
/// Gets or sets the timestamp when the status was changed.
/// </summary>
public DateTime? StatusChangedWhen { get; set; }
/// <summary>
/// Gets or sets the timestamp when this record was added.
/// </summary>
public DateTime AddedWhen { get; set; }
/// <summary>
/// Gets or sets the timestamp when this record was last changed.
/// </summary>
public DateTime? ChangedWhen { get; set; }
/// <summary>
/// Gets or sets the display value associated with the status.
/// </summary>
public string? Value { get; set; }
} }

View File

@@ -1,10 +1,31 @@
using DigitalData.Core.Abstractions; using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs namespace EnvelopeGenerator.Application.DTOs
{ {
public record EmailTemplateDto( /// <summary>
int Id, ///
string Name, /// </summary>
string Body, [ApiExplorerSettings(IgnoreApi = true)]
string Subject) : IUnique<int>; public record EmailTemplateDto
{
/// <summary>
///
/// </summary>
public int Id{ get; init; }
/// <summary>
///
/// </summary>
public required string Name { get; init; }
/// <summary>
///
/// </summary>
public required string Body { get; set; }
/// <summary>
///
/// </summary>
public required string Subject { get; set; }
};
} }

View File

@@ -1,14 +1,50 @@
using DigitalData.Core.Abstractions; using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs namespace EnvelopeGenerator.Application.DTOs;
/// <summary>
/// Data Transfer Object representing certificate information for an envelope.
/// </summary>
[ApiExplorerSettings(IgnoreApi = true)]
public class EnvelopeCertificateDto
{ {
public record EnvelopeCertificateDto( /// <summary>
int Id, /// Gets the unique identifier of the certificate.
int EnvelopeId, /// </summary>
string EnvelopeUuid, public int Id { get; init; }
string EnvelopeSubject,
int CreatorId, /// <summary>
string CreatorName, /// Gets the envelope ID associated with the certificate.
string CreatorEmail, /// </summary>
int EnvelopeStatus) : IUnique<int>; public int EnvelopeId { get; init; }
/// <summary>
/// Gets the UUID of the envelope.
/// </summary>
public string EnvelopeUuid { get; init; } = string.Empty;
/// <summary>
/// Gets the subject of the envelope.
/// </summary>
public string EnvelopeSubject { get; init; } = string.Empty;
/// <summary>
/// Gets the ID of the creator of the envelope.
/// </summary>
public int CreatorId { get; init; }
/// <summary>
/// Gets the name of the creator.
/// </summary>
public string CreatorName { get; init; } = string.Empty;
/// <summary>
/// Gets the email address of the creator.
/// </summary>
public string CreatorEmail { get; init; } = string.Empty;
/// <summary>
/// Gets the current status of the envelope.
/// </summary>
public int EnvelopeStatus { get; init; }
} }

View File

@@ -1,13 +1,35 @@
using DigitalData.Core.Abstractions; using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs namespace EnvelopeGenerator.Application.DTOs;
/// <summary>
/// Data Transfer Object representing a document within an envelope, including optional binary data and form elements.
/// </summary>
[ApiExplorerSettings(IgnoreApi = true)]
public class EnvelopeDocumentDto
{ {
public record EnvelopeDocumentDto /// <summary>
( /// Gets or sets the unique identifier of the document.
int Id, /// </summary>
int EnvelopeId, public int Id { get; set; }
DateTime AddedWhen,
byte[]? ByteData = null, /// <summary>
IEnumerable<DocumentReceiverElementDto>? Elements = null /// Gets or sets the envelope ID to which the document belongs.
) : IUnique<int>; /// </summary>
public int EnvelopeId { get; set; }
/// <summary>
/// Gets or sets the date and time when the document was added.
/// </summary>
public DateTime AddedWhen { get; set; }
/// <summary>
/// Gets or sets the binary data of the document, if available.
/// </summary>
public byte[]? ByteData { get; set; }
/// <summary>
/// Gets or sets the collection of elements associated with the document for receiver interactions, if any.
/// </summary>
public IEnumerable<DocumentReceiverElementDto>? Elements { get; set; }
} }

View File

@@ -1,69 +1,120 @@
using DigitalData.Core.Abstractions; using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
using DigitalData.UserManager.Application.DTOs.User; using DigitalData.UserManager.Application.DTOs.User;
using EnvelopeGenerator.Domain.Entities; using EnvelopeGenerator.Domain.Entities;
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs namespace EnvelopeGenerator.Application.DTOs;
/// <summary>
///
/// </summary>
[ApiExplorerSettings(IgnoreApi = true)]
public record EnvelopeDto
{ {
public record EnvelopeDto() : IUnique<int> /// <summary>
{ ///
public int Id { get; set; } /// </summary>
public int Id { get; set; }
public int UserId { get; set; } /// <summary>
///
/// </summary>
public int UserId { get; set; }
public int Status { get; set; } /// <summary>
///
/// </summary>
public int Status { get; set; }
public string StatusName { get; set; } /// <summary>
/// Default value is string.Empty
/// </summary>
public string StatusName { get; set; } = string.Empty;
public string Uuid { get; set; } /// <summary>
/// Default value is string.Empty
/// </summary>
public string Uuid { get; set; } = string.Empty;
[TemplatePlaceholder("[MESSAGE]")] /// <summary>
public string Message { get; set; } /// Default value is string.Empty
public DateTime? ExpiresWhen { get; set; } /// </summary>
public DateTime? ExpiresWarningWhen { get; set; } [TemplatePlaceholder("[MESSAGE]")]
public DateTime AddedWhen { get; set; } public string Message { get; set; } = string.Empty;
public DateTime? ChangedWhen { get; set; }
[TemplatePlaceholder("[DOCUMENT_TITLE]")] /// <summary>
public string Title { get; set; } ///
/// </summary>
public DateTime AddedWhen { get; set; }
public int? ContractType { get; set; } /// <summary>
///
/// </summary>
public DateTime? ChangedWhen { get; set; }
public string Language { get; set; } /// <summary>
/// Default value is string.Empty
/// </summary>
[TemplatePlaceholder("[DOCUMENT_TITLE]")]
public string Title { get; set; } = string.Empty;
public bool? SendReminderEmails { get; set; } /// <summary>
///
/// </summary>
public int? ContractType { get; set; }
public int? FirstReminderDays { get; set; } /// <summary>
/// Default value is 'de-DE'
/// </summary>
public string Language { get; set; } = "de-DE";
public int? ReminderIntervalDays { get; set; } /// <summary>
///
/// </summary>
public int? EnvelopeTypeId { get; set; }
public int? EnvelopeTypeId { get; set; } /// <summary>
///
/// </summary>
public int? CertificationType { get; set; }
public int? CertificationType { get; set; } /// <summary>
///
/// </summary>
public bool? UseAccessCode { get; set; }
public bool? UseAccessCode { get; set; } /// <summary>
///
/// </summary>
public bool TFAEnabled { get; init; }
public int? FinalEmailToCreator { get; set; } /// <summary>
///
/// </summary>
public UserReadDto? User { get; set; }
public int? FinalEmailToReceivers { get; set; } /// <summary>
///
/// </summary>
public EnvelopeType? EnvelopeType { get; set; }
public int? ExpiresWhenDays { get; set; } /// <summary>
///
/// </summary>
public string? EnvelopeTypeTitle { get; set; }
public int? ExpiresWarningWhenDays { get; set; } /// <summary>
///
/// </summary>
public bool IsAlreadySent { get; set; }
public bool TFAEnabled { get; init; } /// <summary>
///
/// </summary>
public byte[]? DocResult { get; init; }
public bool DmzMoved { get; set; } /// <summary>
public UserReadDto? User { get; set; } ///
public EnvelopeType? EnvelopeType { get; set; } /// </summary>
public IEnumerable<EnvelopeDocumentDto>? Documents { get; set; }
public string? EnvelopeTypeTitle { get; set; }
public bool IsAlreadySent { get; set; }
public string? StatusTranslated { get; set; }
public string? ContractTypeTranslated { get; set; }
public IEnumerable<EnvelopeDocumentDto>? Documents { get; set; }
}
} }

View File

@@ -1,9 +1,34 @@
namespace EnvelopeGenerator.Application.DTOs.EnvelopeHistory using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
/// <summary>
/// Data Transfer Object for creating a new envelope history record.
/// </summary>
public class EnvelopeHistoryCreateDto
{ {
public record EnvelopeHistoryCreateDto( /// <summary>
int EnvelopeId, /// Gets or sets the identifier of the envelope.
string UserReference, /// </summary>
int Status, public int EnvelopeId { get; set; }
DateTime? ActionDate,
string? Comment = null); /// <summary>
/// Gets or sets the user reference associated with the action.
/// </summary>
public required string UserReference { get; set; }
/// <summary>
/// Gets or sets the status of the envelope at the time of the action.
/// </summary>
public int Status { get; set; }
/// <summary>
/// Gets or sets the date and time when the action occurred.
/// </summary>
public DateTime? ActionDate { get; set; }
/// <summary>
/// Gets or sets an optional comment related to the action.
/// </summary>
public string? Comment { get; set; }
} }

View File

@@ -1,21 +1,69 @@
using DigitalData.Core.Abstractions; using DigitalData.UserManager.Application.DTOs.User;
using DigitalData.Core.DTO;
using DigitalData.UserManager.Application.DTOs.User;
using EnvelopeGenerator.Application.DTOs.Receiver; using EnvelopeGenerator.Application.DTOs.Receiver;
using static EnvelopeGenerator.Common.Constants; using static EnvelopeGenerator.Domain.Constants;
namespace EnvelopeGenerator.Application.DTOs.EnvelopeHistory namespace EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
/// <summary>
/// Data Transfer Object representing the history of an envelope, including status, sender, receiver, and related metadata.
/// </summary>
public record EnvelopeHistoryDto
{ {
public record EnvelopeHistoryDto( /// <summary>
long Id, /// Unique identifier for the envelope history entry.
int EnvelopeId, /// </summary>
string UserReference, public long Id { get; set; }
int Status,
string? StatusName, /// <summary>
DateTime AddedWhen, /// Identifier of the associated envelope.
DateTime? ActionDate, /// </summary>
UserCreateDto? Sender, public int EnvelopeId { get; set; }
ReceiverReadDto? Receiver,
ReferenceType ReferenceType, /// <summary>
string? Comment = null) : BaseDTO<long>(Id), IUnique<long>; /// Reference string for the user related to this history entry.
} /// </summary>
public required string UserReference { get; set; }
/// <summary>
/// Status code of the envelope at this history point.
/// </summary>
public int Status { get; set; }
/// <summary>
/// Human-readable name of the status.
/// </summary>
public string? StatusName { get; set; }
/// <summary>
/// Date and time when this history entry was added.
/// </summary>
public DateTime AddedWhen { get; set; }
/// <summary>
/// Date and time when an action was performed, if applicable.
/// </summary>
public DateTime? ActionDate { get; set; }
/// <summary>
/// Information about the sender associated with this history entry.
/// </summary>
public UserCreateDto? Sender { get; set; }
/// <summary>
/// Information about the receiver associated with this history entry.
/// </summary>
public ReceiverReadDto? Receiver { get; set; }
/// <summary>
/// Type of reference for this history entry.
/// </summary>
public ReferenceType ReferenceType { get; set; }
/// <summary>
/// Optional comment related to this history entry.
/// </summary>
public string? Comment { get; set; }
/// <inheritdoc/>
public override int GetHashCode() => Id.GetHashCode();
};

View File

@@ -1,31 +1,67 @@
using DigitalData.Core.Abstractions; using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes; using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiver namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
/// <summary>
///
/// </summary>
[ApiExplorerSettings(IgnoreApi = true)]
public record EnvelopeReceiverBasicDto
{ {
public record EnvelopeReceiverBasicDto() : IUnique<(int Envelope, int Receiver)> /// <summary>
{ ///
public (int Envelope, int Receiver) Id => (Envelope: EnvelopeId, Receiver: ReceiverId); /// </summary>
public (int Envelope, int Receiver) Id => (Envelope: EnvelopeId, Receiver: ReceiverId);
public int EnvelopeId { get; init; } /// <summary>
///
/// </summary>
public int EnvelopeId { get; init; }
public int ReceiverId { get; init; } /// <summary>
///
/// </summary>
public int ReceiverId { get; init; }
public int Sequence { get; init; } /// <summary>
///
/// </summary>
public int Sequence { get; init; }
[TemplatePlaceholder("[NAME_RECEIVER]")] /// <summary>
public string? Name { get; init; } ///
/// </summary>
[TemplatePlaceholder("[NAME_RECEIVER]")]
public string? Name { get; init; }
public string? JobTitle { get; init; } /// <summary>
///
/// </summary>
public string? JobTitle { get; init; }
public string? CompanyName { get; init; } /// <summary>
///
/// </summary>
public string? CompanyName { get; init; }
public string? PrivateMessage { get; init; } /// <summary>
///
/// </summary>
public string? PrivateMessage { get; init; }
public DateTime AddedWhen { get; init; } /// <summary>
///
/// </summary>
public DateTime AddedWhen { get; init; }
public DateTime? ChangedWhen { get; init; } /// <summary>
///
/// </summary>
public DateTime? ChangedWhen { get; init; }
public bool HasPhoneNumber { get; init; } /// <summary>
} ///
/// </summary>
public bool HasPhoneNumber { get; init; }
} }

View File

@@ -1,11 +1,22 @@
using EnvelopeGenerator.Application.DTOs.Receiver; using EnvelopeGenerator.Application.DTOs.Receiver;
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiver namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
/// <summary>
///
/// </summary>
[ApiExplorerSettings(IgnoreApi = true)]
public record EnvelopeReceiverDto() : EnvelopeReceiverBasicDto()
{ {
public record EnvelopeReceiverDto() : EnvelopeReceiverBasicDto() /// <summary>
{ ///
public EnvelopeDto? Envelope { get; set; } /// </summary>
public EnvelopeDto? Envelope { get; set; }
public ReceiverReadDto? Receiver { get; set; } /// <summary>
} ///
/// </summary>
public ReceiverReadDto? Receiver { get; set; }
} }

View File

@@ -1,9 +1,20 @@
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiver using Microsoft.AspNetCore.Mvc;
{
public record EnvelopeReceiverSecretDto() : EnvelopeReceiverDto()
{
public string? AccessCode { get; init; }
public string? PhoneNumber { get; init; } namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
}
/// <summary>
///
/// </summary>
[ApiExplorerSettings(IgnoreApi = true)]
public record EnvelopeReceiverSecretDto : EnvelopeReceiverDto
{
/// <summary>
///
/// </summary>
public string? AccessCode { get; init; }
/// <summary>
///
/// </summary>
public string? PhoneNumber { get; init; }
} }

View File

@@ -1,22 +1,39 @@
using System.ComponentModel.DataAnnotations; using Microsoft.AspNetCore.Mvc;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization; using System.Text.Json.Serialization;
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
/// <summary>
///
/// </summary>
/// <param name="DateValid"></param>
[ApiExplorerSettings(IgnoreApi = true)]
public record EnvelopeReceiverReadOnlyCreateDto(
DateTime DateValid)
{ {
public record EnvelopeReceiverReadOnlyCreateDto( /// <summary>
DateTime DateValid) ///
{ /// </summary>
[EmailAddress] [EmailAddress]
[Required] [Required]
public required string ReceiverMail { get; init; } public required string ReceiverMail { get; init; }
[JsonIgnore] /// <summary>
public long? EnvelopeId { get; set; } = null; /// Default value is null
/// </summary>
[JsonIgnore]
public long? EnvelopeId { get; set; } = null;
[JsonIgnore] /// <summary>
public string? AddedWho { get; set; } ///
/// </summary>
[JsonIgnore]
public string? AddedWho { get; set; }
[JsonIgnore] /// <summary>
public DateTime AddedWhen { get; } = DateTime.Now; /// Default value is DateTime.Now
}; /// </summary>
} [JsonIgnore]
public DateTime AddedWhen { get; } = DateTime.Now;
};

View File

@@ -1,16 +1,63 @@
using EnvelopeGenerator.Application.DTOs.Receiver; using EnvelopeGenerator.Application.DTOs.Receiver;
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
/// <summary>
/// Represents a read-only Data Transfer Object (DTO) for an envelope receiver.
/// Contains information about the receiver, associated envelope, and audit details.
/// </summary>
[ApiExplorerSettings(IgnoreApi = true)]
public class EnvelopeReceiverReadOnlyDto
{ {
public record EnvelopeReceiverReadOnlyDto( /// <summary>
long Id, /// Gets or inits the unique identifier of the envelope receiver.
long EnvelopeId, /// </summary>
string ReceiverMail, public long Id { get; init; }
DateTime DateValid,
DateTime AddedWhen, /// <summary>
string AddedWho, /// Gets or inits the identifier of the associated envelope.
EnvelopeDto? Envelope = null, /// </summary>
string? ChangedWho = null, public long EnvelopeId { get; init; }
DateTime? ChangedWhen = null,
ReceiverReadDto? Receiver = null); /// <summary>
/// Gets or inits the email address of the receiver.
/// </summary>
public required string ReceiverMail { get; set; }
/// <summary>
/// Gets or inits the date until which the receiver is valid.
/// </summary>
public DateTime DateValid { get; set; }
/// <summary>
/// Gets or inits the date and time when the receiver was added.
/// </summary>
public DateTime AddedWhen { get; init; }
/// <summary>
/// Gets or inits the user who added the receiver.
/// Default value is 'unknown'.
/// </summary>
public string AddedWho { get; init; } = "Unknown";
/// <summary>
/// Gets or inits the associated envelope details.
/// </summary>
public EnvelopeDto? Envelope { get; set; }
/// <summary>
/// Gets or inits the user who last changed the receiver, if any.
/// </summary>
public string? ChangedWho { get; set; }
/// <summary>
/// Gets or inits the date and time when the receiver was last changed, if any.
/// </summary>
public DateTime? ChangedWhen { get; set; }
/// <summary>
/// Gets or inits the associated receiver details.
/// </summary>
public ReceiverReadDto? Receiver { get; set; }
} }

View File

@@ -1,12 +1,31 @@
using DigitalData.Core.Abstractions; using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
/// <summary>
/// Data Transfer Object for updating a read-only envelope receiver.
/// </summary>
[ApiExplorerSettings(IgnoreApi = true)]
public class EnvelopeReceiverReadOnlyUpdateDto
{ {
public record EnvelopeReceiverReadOnlyUpdateDto( /// <summary>
long Id, /// Gets or sets the unique identifier of the envelope receiver.
DateTime DateValid, /// </summary>
string ChangedWho) : IUnique<long> public long Id { get; init; }
{
public DateTime ChangedWhen { get; } = DateTime.Now; /// <summary>
}; /// Gets or sets the date when the envelope receiver becomes valid.
/// </summary>
public DateTime DateValid { get; set; }
/// <summary>
/// Gets or sets the name of the user who made the change.
/// Default value is unknown.
/// </summary>
public string ChangedWho { get; set; } = "Unknown";
/// <summary>
/// Gets or sets the date and time when the change was made.
/// </summary>
public DateTime ChangedWhen { get; set; } = DateTime.Now;
} }

View File

@@ -1,21 +1,85 @@
using DigitalData.Core.Abstractions; using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs namespace EnvelopeGenerator.Application.DTOs;
/// <summary>
/// Data Transfer Object representing a type of envelope with its configuration settings.
/// </summary>
[ApiExplorerSettings(IgnoreApi = true)]
public class EnvelopeTypeDto
{ {
public record EnvelopeTypeDto( /// <summary>
int Id, /// Gets or sets the unique identifier of the envelope type.
string Title, /// </summary>
string Language, public int Id { get; set; }
int? ExpiresDays,
int? CertificationType, /// <summary>
bool? UseAccessCode, /// Gets or sets the title of the envelope type.
int? FinalEmailToCreator, /// </summary>
int? FinalEmailToReceivers, public string Title { get; set; } = string.Empty;
DateTime AddedWhen,
DateTime? ChangedWhen, /// <summary>
int? ExpiresWarningDays, /// Gets or sets the language code used in this envelope type.
bool? SendReminderEmails, /// </summary>
int? FirstReminderDays, public string Language { get; set; } = "de-DE";
int? ReminderIntervalDays,
int? ContractType) : IUnique<int>; /// <summary>
/// Gets or sets the number of days after which the envelope expires.
/// </summary>
public int? ExpiresDays { get; set; }
/// <summary>
/// Gets or sets the certification type identifier.
/// </summary>
public int? CertificationType { get; set; }
/// <summary>
/// Gets or sets a value indicating whether an access code is required.
/// </summary>
public bool? UseAccessCode { get; set; }
/// <summary>
/// Gets or sets the final email template ID to be sent to the creator.
/// </summary>
public int? FinalEmailToCreator { get; set; }
/// <summary>
/// Gets or sets the final email template ID to be sent to the receivers.
/// </summary>
public int? FinalEmailToReceivers { get; set; }
/// <summary>
/// Gets or sets the timestamp when this envelope type was added.
/// </summary>
public DateTime AddedWhen { get; set; }
/// <summary>
/// Gets or sets the timestamp when this envelope type was last changed.
/// </summary>
public DateTime? ChangedWhen { get; set; }
/// <summary>
/// Gets or sets the number of days before expiry when a warning should be sent.
/// </summary>
public int? ExpiresWarningDays { get; set; }
/// <summary>
/// Gets or sets a value indicating whether reminder emails should be sent.
/// </summary>
public bool? SendReminderEmails { get; set; }
/// <summary>
/// Gets or sets the number of days before the first reminder is sent.
/// </summary>
public int? FirstReminderDays { get; set; }
/// <summary>
/// Gets or sets the interval in days between reminder emails.
/// </summary>
public int? ReminderIntervalDays { get; set; }
/// <summary>
/// Gets or sets the contract type associated with the envelope type.
/// </summary>
public int? ContractType { get; set; }
} }

View File

@@ -0,0 +1,68 @@
using AutoMapper;
using EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
using EnvelopeGenerator.Application.DTOs.Messaging;
using EnvelopeGenerator.Application.DTOs.Receiver;
using EnvelopeGenerator.Application.Extensions;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.DTOs;
/// <summary>
/// Represents the AutoMapper profile configuration for mapping between
/// domain entities and data transfer objects (DTOs) used within the EnvelopeGenerator application.
/// </summary>
public class MappingProfile : Profile
{
/// <summary>
/// Initializes a new instance of the <see cref="MappingProfile"/> class.
/// Configures the mappings between entities and DTOs used throughout the application.
/// </summary>
public MappingProfile()
{
// Entity to DTO mappings
CreateMap<Config, ConfigDto>();
CreateMap<DocumentReceiverElement, DocumentReceiverElementDto>();
CreateMap<DocumentStatus, DocumentStatusDto>();
CreateMap<EmailTemplate, EmailTemplateDto>();
CreateMap<Envelope, EnvelopeDto>();
CreateMap<EnvelopeCertificate, EnvelopeCertificateDto>();
CreateMap<EnvelopeDocument, EnvelopeDocumentDto>();
CreateMap<Domain.Entities.EnvelopeHistory, EnvelopeHistoryDto>();
CreateMap<Domain.Entities.EnvelopeHistory, EnvelopeHistoryCreateDto>();
CreateMap<Domain.Entities.EnvelopeReceiver, EnvelopeReceiverDto>();
CreateMap<Domain.Entities.EnvelopeReceiver, EnvelopeReceiverSecretDto>();
CreateMap<EnvelopeType, EnvelopeTypeDto>();
CreateMap<Domain.Entities.Receiver, ReceiverReadDto>();
CreateMap<Domain.Entities.Receiver, ReceiverCreateDto>();
CreateMap<Domain.Entities.Receiver, ReceiverUpdateDto>();
CreateMap<Domain.Entities.EnvelopeReceiverReadOnly, EnvelopeReceiverReadOnlyDto>();
// DTO to Entity mappings
CreateMap<ConfigDto, Config>();
CreateMap<DocumentReceiverElementDto, DocumentReceiverElement>();
CreateMap<DocumentStatusDto, DocumentStatus>();
CreateMap<EmailTemplateDto, EmailTemplate>();
CreateMap<EnvelopeDto, Envelope>();
CreateMap<EnvelopeCertificateDto, EnvelopeCertificate>();
CreateMap<EnvelopeDocumentDto, EnvelopeDocument>();
CreateMap<EnvelopeHistoryDto, Domain.Entities.EnvelopeHistory>();
CreateMap<EnvelopeHistoryCreateDto, Domain.Entities.EnvelopeHistory>();
CreateMap<EnvelopeReceiverDto, Domain.Entities.EnvelopeReceiver>();
CreateMap<EnvelopeTypeDto, EnvelopeType>();
CreateMap<ReceiverReadDto, Domain.Entities.Receiver>().ForMember(rcv => rcv.EnvelopeReceivers, rcvReadDto => rcvReadDto.Ignore());
CreateMap<ReceiverCreateDto, Domain.Entities.Receiver>();
CreateMap<ReceiverUpdateDto, Domain.Entities.Receiver>();
CreateMap<EnvelopeReceiverBase, EnvelopeReceiverBasicDto>();
CreateMap<EnvelopeReceiverReadOnlyCreateDto, Domain.Entities.EnvelopeReceiverReadOnly>();
CreateMap<EnvelopeReceiverReadOnlyUpdateDto, Domain.Entities.EnvelopeReceiverReadOnly>();
// Messaging mappings
// for GTX messaging
CreateMap<GtxMessagingResponse, SmsResponse>()
.ConstructUsing(gtxRes => gtxRes.Ok()
? new SmsResponse() { Ok = true }
: new SmsResponse() { Ok = false, Errors = gtxRes });
}
}

View File

@@ -1,4 +1,9 @@
namespace EnvelopeGenerator.Application.DTOs.Messaging using Microsoft.AspNetCore.Mvc;
{
public class GtxMessagingResponse : Dictionary<string, object?> { } namespace EnvelopeGenerator.Application.DTOs.Messaging;
}
/// <summary>
///
/// </summary>
[ApiExplorerSettings(IgnoreApi = true)]
public class GtxMessagingResponse : Dictionary<string, object?> { }

View File

@@ -1,11 +1,25 @@
namespace EnvelopeGenerator.Application.DTOs.Messaging using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs.Messaging;
/// <summary>
///
/// </summary>
[ApiExplorerSettings(IgnoreApi = true)]
public record SmsResponse
{ {
public record SmsResponse /// <summary>
{ ///
public required bool Ok { get; init; } /// </summary>
public required bool Ok { get; init; }
public bool Failed => !Ok; /// <summary>
/// Returns !Ok
/// </summary>
public bool Failed => !Ok;
public dynamic? Errors { get; init; } /// <summary>
} ///
/// </summary>
public dynamic? Errors { get; init; }
} }

View File

@@ -1,21 +1,53 @@
using System.ComponentModel.DataAnnotations; using Microsoft.AspNetCore.Mvc;
using System.ComponentModel.DataAnnotations;
using System.Security.Cryptography; using System.Security.Cryptography;
using System.Text; using System.Text;
namespace EnvelopeGenerator.Application.DTOs.Receiver namespace EnvelopeGenerator.Application.DTOs.Receiver;
{
public record ReceiverCreateDto([EmailAddress] string EmailAddress, string? TotpSecretkey = null)
{
public string Signature => sha256HexOfMail.Value;
private readonly Lazy<string> sha256HexOfMail = new(() => /// <summary>
///
/// </summary>
[ApiExplorerSettings(IgnoreApi = true)]
public record ReceiverCreateDto
{
/// <summary>
///
/// </summary>
public ReceiverCreateDto()
{
_sha256HexOfMail = new(() =>
{ {
var bytes_arr = Encoding.UTF8.GetBytes(EmailAddress.ToUpper()); var bytes_arr = Encoding.UTF8.GetBytes(EmailAddress!.ToUpper());
var hash_arr = SHA256.HashData(bytes_arr); var hash_arr = SHA256.HashData(bytes_arr);
var hexa_str = BitConverter.ToString(hash_arr); var hexa_str = BitConverter.ToString(hash_arr);
return hexa_str.Replace("-", string.Empty); return hexa_str.Replace("-", string.Empty);
}); });
}
public DateTime AddedWhen { get; } = DateTime.Now; /// <summary>
}; ///
} /// </summary>
[EmailAddress]
public required string EmailAddress { get; init; }
/// <summary>
///
/// </summary>
public string? TotpSecretkey { get; init; }
/// <summary>
/// var bytes_arr = Encoding.UTF8.GetBytes(EmailAddress.ToUpper());<br/>
/// var hash_arr = SHA256.HashData(bytes_arr);
/// var hexa_str = BitConverter.ToString(hash_arr);
/// return hexa_str.Replace("-", string.Empty);
/// </summary>
public string Signature => _sha256HexOfMail.Value;
private readonly Lazy<string> _sha256HexOfMail;
/// <summary>
/// Default value is DateTime.Now
/// </summary>
public DateTime AddedWhen { get; } = DateTime.Now;
};

View File

@@ -1,24 +1,62 @@
using DigitalData.Core.Abstractions; using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
using DigitalData.Core.DTO; using Microsoft.AspNetCore.Mvc;
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
using System.Text.Json.Serialization; using System.Text.Json.Serialization;
namespace EnvelopeGenerator.Application.DTOs.Receiver; namespace EnvelopeGenerator.Application.DTOs.Receiver;
public record ReceiverReadDto( /// <summary>
int Id, ///
string EmailAddress, /// </summary>
string Signature, [ApiExplorerSettings(IgnoreApi = true)]
DateTime AddedWhen public class ReceiverReadDto
) : BaseDTO<int>(Id), IUnique<int>
{ {
[JsonIgnore] /// <summary>
public IEnumerable<EnvelopeReceiverBasicDto>? EnvelopeReceivers { get; init; } ///
/// </summary>
public int Id { get; set; }
/// <summary>
///
/// </summary>
public required string EmailAddress { get; set; }
/// <summary>
///
/// </summary>
public required string Signature { get; set; }
/// <summary>
///
/// </summary>
public DateTime AddedWhen { get; set; }
/// <summary>
///
/// </summary>
[JsonIgnore]
public IEnumerable<EnvelopeReceiverBasicDto>? EnvelopeReceivers { get; set; }
/// <summary>
///
/// </summary>
public string? LastUsedName => EnvelopeReceivers?.LastOrDefault()?.Name; public string? LastUsedName => EnvelopeReceivers?.LastOrDefault()?.Name;
/// <summary>
///
/// </summary>
public string? TotpSecretkey { get; set; } = null; public string? TotpSecretkey { get; set; } = null;
/// <summary>
///
/// </summary>
public DateTime? TfaRegDeadline { get; set; } public DateTime? TfaRegDeadline { get; set; }
};
/// <summary>
///
/// </summary>
/// <returns></returns>
public override int GetHashCode()
{
return Id.GetHashCode();
}
}

View File

@@ -1,5 +1,27 @@
using DigitalData.Core.Abstractions; using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs.Receiver; namespace EnvelopeGenerator.Application.DTOs.Receiver;
public record ReceiverUpdateDto(int Id, string? TotpSecretkey = null, DateTime? TfaRegDeadline = null) : IUnique<int>; /// <summary>
/// Data Transfer Object for updating a receiver's information.
/// </summary>
[ApiExplorerSettings(IgnoreApi = true)]
public class ReceiverUpdateDto
{
/// <summary>
/// Gets or sets the unique identifier of the receiver.
/// </summary>
public int Id { get; set; }
/// <summary>
/// Gets or sets the TOTP (Time-based One-Time Password) secret key.
/// Optional.
/// </summary>
public string? TotpSecretkey { get; set; }
/// <summary>
/// Gets or sets the deadline for two-factor authentication registration.
/// Optional.
/// </summary>
public DateTime? TfaRegDeadline { get; set; }
}

View File

@@ -1,13 +0,0 @@
using DigitalData.Core.Abstractions;
namespace EnvelopeGenerator.Application.DTOs
{
public record UserReceiverDto(
int Id,
int UserId,
int ReceiverId,
string Name,
string CompanyName,
string JobTitle,
DateTime AddedWhen) : IUnique<int>;
}

View File

@@ -1,39 +1,31 @@
using DigitalData.UserManager.Application.MappingProfiles; using EnvelopeGenerator.Application.Configurations;
using EnvelopeGenerator.Application.Contracts;
using EnvelopeGenerator.Application.MappingProfiles;
using EnvelopeGenerator.Application.Configurations;
using EnvelopeGenerator.Application.Services; using EnvelopeGenerator.Application.Services;
using EnvelopeGenerator.Infrastructure.Contracts;
using EnvelopeGenerator.Infrastructure.Repositories;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.DependencyInjection.Extensions;
using DigitalData.Core.Client; using DigitalData.Core.Client;
using QRCoder; using QRCoder;
using EnvelopeGenerator.Application.Contracts.Services;
using System.Reflection;
using EnvelopeGenerator.Application.EnvelopeReceivers.Commands.Create;
namespace EnvelopeGenerator.Application.Extensions; namespace EnvelopeGenerator.Application;
public static class DIExtensions /// <summary>
/// Extensions method for dependency injection
/// </summary>
public static class DependencyInjection
{ {
public static IServiceCollection AddEnvelopeGenerator(this IServiceCollection services, IConfiguration config) /// <summary>
/// Adds all required services for envelope generator application
/// </summary>
/// <param name="services"></param>
/// <param name="config"></param>
/// <returns></returns>
[Obsolete("Use MediatR")]
public static IServiceCollection AddEnvelopeGeneratorServices(this IServiceCollection services, IConfiguration config)
{ {
//Inject CRUD Service and repositoriesad //Inject CRUD Service and repositoriesad
services.TryAddScoped<IConfigRepository, ConfigRepository>();
services.TryAddScoped<IDocumentReceiverElementRepository, DocumentReceiverElementRepository>();
services.TryAddScoped<IEnvelopeDocumentRepository, EnvelopeDocumentRepository>();
services.TryAddScoped<IConfigRepository, ConfigRepository>();
services.TryAddScoped<IDocumentReceiverElementRepository, DocumentReceiverElementRepository>();
services.TryAddScoped<IDocumentStatusRepository, DocumentStatusRepository>();
services.TryAddScoped<IEmailTemplateRepository, EmailTemplateRepository>();
services.TryAddScoped<IEnvelopeRepository, EnvelopeRepository>();
services.TryAddScoped<IEnvelopeCertificateRepository, EnvelopeCertificateRepository>();
services.TryAddScoped<IEnvelopeDocumentRepository, EnvelopeDocumentRepository>();
services.TryAddScoped<IEnvelopeHistoryRepository, EnvelopeHistoryRepository>();
services.TryAddScoped<IEnvelopeReceiverRepository, EnvelopeReceiverRepository>();
services.TryAddScoped<IEnvelopeTypeRepository, EnvelopeTypeRepository>();
services.TryAddScoped<IReceiverRepository, ReceiverRepository>();
services.TryAddScoped<IUserReceiverRepository, UserReceiverRepository>();
services.TryAddScoped<IEnvelopeReceiverReadOnlyRepository, EnvelopeReceiverReadOnlyRepository>();
services.TryAddScoped<IConfigService, ConfigService>(); services.TryAddScoped<IConfigService, ConfigService>();
services.TryAddScoped<IDocumentReceiverElementService, DocumentReceiverElementService>(); services.TryAddScoped<IDocumentReceiverElementService, DocumentReceiverElementService>();
services.TryAddScoped<IEnvelopeDocumentService, EnvelopeDocumentService>(); services.TryAddScoped<IEnvelopeDocumentService, EnvelopeDocumentService>();
@@ -50,13 +42,14 @@ public static class DIExtensions
services.TryAddScoped<IEnvelopeReceiverReadOnlyService, EnvelopeReceiverReadOnlyService>(); services.TryAddScoped<IEnvelopeReceiverReadOnlyService, EnvelopeReceiverReadOnlyService>();
//Auto mapping profiles //Auto mapping profiles
services.AddAutoMapper(typeof(BasicDtoMappingProfile).Assembly); services.AddAutoMapper(Assembly.GetExecutingAssembly());
services.AddAutoMapper(typeof(UserMappingProfile).Assembly); services.AddAutoMapper(typeof(DigitalData.UserManager.Application.DIExtensions));
services.Configure<DispatcherParams>(config.GetSection(nameof(DispatcherParams))); services.Configure<DispatcherParams>(config.GetSection(nameof(DispatcherParams)));
services.Configure<MailParams>(config.GetSection(nameof(MailParams))); services.Configure<MailParams>(config.GetSection(nameof(MailParams)));
services.Configure<AuthenticatorParams>(config.GetSection(nameof(AuthenticatorParams))); services.Configure<AuthenticatorParams>(config.GetSection(nameof(AuthenticatorParams)));
services.Configure<TotpSmsParams>(config.GetSection(nameof(TotpSmsParams))); services.Configure<TotpSmsParams>(config.GetSection(nameof(TotpSmsParams)));
services.Configure<DbTriggerParams>(config.GetSection(nameof(DbTriggerParams)));
services.AddHttpClientService<GtxMessagingParams>(config.GetSection(nameof(GtxMessagingParams))); services.AddHttpClientService<GtxMessagingParams>(config.GetSection(nameof(GtxMessagingParams)));
services.TryAddSingleton<ISmsSender, GTXSmsSender>(); services.TryAddSingleton<ISmsSender, GTXSmsSender>();
@@ -64,6 +57,12 @@ public static class DIExtensions
services.TryAddSingleton<IAuthenticator, Authenticator>(); services.TryAddSingleton<IAuthenticator, Authenticator>();
services.TryAddSingleton<QRCodeGenerator>(); services.TryAddSingleton<QRCodeGenerator>();
services.AddMediatR(cfg =>
{
cfg.RegisterServicesFromAssembly(Assembly.GetExecutingAssembly());
cfg.RegisterServicesFromAssembly(typeof(CreateEnvelopeReceiverCommandHandler).Assembly);
});
return services; return services;
} }
} }

View File

@@ -0,0 +1,18 @@
using AutoMapper;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Documents.Queries.Read;
/// <summary>
///
/// </summary>
public class ReadDocumentMappingProfile : Profile
{
/// <summary>
///
/// </summary>
public ReadDocumentMappingProfile()
{
CreateMap<EnvelopeDocument, ReadDocumentResponse>();
}
}

View File

@@ -0,0 +1,12 @@
using MediatR;
namespace EnvelopeGenerator.Application.Documents.Queries.Read;
/// <summary>
/// Represents a query to read a document based on its unique identifier or associated envelope identifier.
/// </summary>
/// <param name="Id">The unique identifier of the document. Optional.</param>
/// <param name="EnvelopeId">The identifier of the envelope associated with the document. Optional.</param>
public record ReadDocumentQuery(int? Id = null, int? EnvelopeId = null) : IRequest<ReadDocumentResponse?>
{
}

View File

@@ -0,0 +1,48 @@
using DigitalData.Core.Abstraction.Application.Repository;
using EnvelopeGenerator.Domain.Entities;
using MediatR;
namespace EnvelopeGenerator.Application.Documents.Queries.Read;
/// <summary>
/// Handles queries for reading <see cref="EnvelopeDocument"/> data based on either the document ID or the envelope ID.
/// </summary>
public class ReadDocumentQueryHandler : IRequestHandler<ReadDocumentQuery, ReadDocumentResponse?>
{
/// <summary>
/// Repository for accessing <see cref="EnvelopeDocument"/> entities.
/// </summary>
private readonly IRepository<EnvelopeDocument> _repo;
/// <summary>
/// Initializes a new instance of the <see cref="ReadDocumentQueryHandler"/> class.
/// </summary>
/// <param name="envelopeDocumentRepository">The repository used to access <see cref="EnvelopeDocument"/> entities.</param>
public ReadDocumentQueryHandler(IRepository<EnvelopeDocument> envelopeDocumentRepository)
{
_repo = envelopeDocumentRepository;
}
/// <summary>
/// Handles the <see cref="ReadDocumentQuery"/> and returns a <see cref="ReadDocumentResponse"/> based on the provided identifiers.
/// </summary>
/// <param name="query">The query containing the document ID or envelope ID to search for.</param>
/// <param name="cancellationToken">A token to monitor for cancellation requests.</param>
/// <returns>
/// A <see cref="ReadDocumentResponse"/> if a matching document is found; otherwise, <c>null</c>.
/// </returns>
/// <exception cref="InvalidOperationException">
/// Thrown when neither <see cref="ReadDocumentQuery.Id"/> nor <see cref="ReadDocumentQuery.EnvelopeId"/> is provided.
/// </exception>
[Obsolete("Use MediatR")]
public async Task<ReadDocumentResponse?> Handle(ReadDocumentQuery query, CancellationToken cancellationToken)
{
if (query.Id is not null)
return await _repo.ReadOrDefaultAsync<ReadDocumentResponse>(d => d.Id == query.Id);
else if (query.EnvelopeId is not null)
return await _repo.ReadOrDefaultAsync<ReadDocumentResponse>(d => d.EnvelopeId == query.EnvelopeId);
throw new InvalidOperationException(
$"Invalid {nameof(ReadDocumentQuery)}: either {nameof(query.Id)} or {nameof(query.EnvelopeId)} must be provided.");
}
}

View File

@@ -0,0 +1,12 @@
namespace EnvelopeGenerator.Application.Documents.Queries.Read;
/// <summary>
/// Represents the response for reading a document.
/// </summary>
public class ReadDocumentResponse : ReadDocumentResponseBase
{
/// <summary>
/// The binary data of the document, if available.
/// </summary>
public byte[]? ByteData { get; init; }
}

View File

@@ -0,0 +1,22 @@
namespace EnvelopeGenerator.Application.Documents.Queries.Read;
/// <summary>
/// Represents the response for reading a document.
/// </summary>
public class ReadDocumentResponseBase
{
/// <summary>
/// The unique identifier of the document.
/// </summary>
public int Guid { get; init; }
/// <summary>
/// The identifier of the associated envelope.
/// </summary>
public int EnvelopeId { get; init; }
/// <summary>
/// The date and time when the document was added.
/// </summary>
public DateTime AddedWhen { get; init; }
}

View File

@@ -0,0 +1,40 @@
using EnvelopeGenerator.Domain;
using MediatR;
namespace EnvelopeGenerator.Application.EmailTemplates.Commands.Reset;
/// <summary>
/// Ein Befehl zum Zurücksetzen einer E-Mail-Vorlage auf die Standardwerte.
/// Erbt von <see cref="EmailTemplateQuery"/> und ermöglicht die Angabe einer optionalen ID und eines Typs der E-Mail-Vorlage.<br/><br/>
/// Beispiele:<br/>
/// 0 - DocumentReceived: Benachrichtigung über den Empfang eines Dokuments.<br/>
/// 1 - DocumentSigned: Benachrichtigung über die Unterzeichnung eines Dokuments.<br/>
/// 2 - DocumentDeleted: Benachrichtigung über das Löschen eines Dokuments.<br/>
/// 3 - DocumentCompleted: Benachrichtigung über den Abschluss eines Dokuments.<br/>
/// 4 - DocumentAccessCodeReceived: Benachrichtigung über den Erhalt eines Zugangscodes.<br/>
/// 5 - DocumentShared: Benachrichtigung über das Teilen eines Dokuments.<br/>
/// 6 - TotpSecret: Benachrichtigung über ein TOTP-Geheimnis.<br/>
/// 7 - DocumentRejected_ADM (Für den Absender): Mail an den Absender, wenn das Dokument abgelehnt wird.<br/>
/// 8 - DocumentRejected_REC (Für den ablehnenden Empfänger): Mail an den ablehnenden Empfänger, wenn das Dokument abgelehnt wird.<br/>
/// 9 - DocumentRejected_REC_2 (Für sonstige Empfänger): Mail an andere Empfänger (Brief), wenn das Dokument abgelehnt wird.<br/>
/// </summary>
public record ResetEmailTemplateCommand : EmailTemplateQuery, IRequest
{
/// <summary>
///
/// </summary>
/// <param name="orginal"></param>
public ResetEmailTemplateCommand(EmailTemplateQuery? orginal = null) : base(orginal ?? new())
{
}
/// <summary>
///
/// </summary>
/// <param name="Id">Die optionale ID der E-Mail-Vorlage, die zurückgesetzt werden soll.</param>
/// <param name="Type">Der Typ der E-Mail-Vorlage, z. B. <see cref="Constants.EmailTemplateType"/> (optional).</param>
public ResetEmailTemplateCommand(int? Id = null, Constants.EmailTemplateType? Type = null) : base(Id, Type)
{
}
};

View File

@@ -0,0 +1,114 @@
using DigitalData.Core.Abstraction.Application.Repository;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
using MediatR;
namespace EnvelopeGenerator.Application.EmailTemplates.Commands.Reset;
/// <summary>
///
/// </summary>
public class ResetEmailTemplateCommandHandler : IRequestHandler<ResetEmailTemplateCommand>
{
private readonly IRepository<EmailTemplate> _repository;
/// <summary>
///
/// </summary>
/// <param name="repository"></param>
public ResetEmailTemplateCommandHandler(IRepository<EmailTemplate> repository)
{
_repository = repository;
}
/// <summary>
///
/// </summary>
/// <param name="request"></param>
/// <param name="cancel"></param>
/// <returns></returns>
[Obsolete("Use Read-method returning IReadQuery<TEntity> instead.")]
public async Task Handle(ResetEmailTemplateCommand request, CancellationToken cancel)
{
var temps = request.Id is not null
? await _repository.ReadAllAsync<EmailTemplateDto>(t => t.Id == request.Id, cancel)
: request.Type is not null
? await _repository.ReadAllAsync<EmailTemplateDto>(t => t.Name == request.Type.ToString(), cancel)
: await _repository.ReadAllAsync<EmailTemplateDto>(cancellation: cancel);
foreach (var temp in temps)
{
var def = Defaults.Where(t => t.Name == temp.Name).FirstOrDefault();
if(def is not null)
await _repository.UpdateAsync(def, t => t.Id == temp.Id, cancel);
}
}
/// <summary>
///
/// </summary>
public static readonly IEnumerable<EmailTemplateDto> Defaults = new List<EmailTemplateDto>()
{
new(){
Id = 1,
Name = "DocumentReceived",
Body = "Guten Tag [NAME_RECEIVER],<br />\r\n<br /><B><I>\r\n[NAME_SENDER]</I></B> hat Ihnen ein Dokument zum [SIGNATURE_TYPE] gesendet.<br />\r\n<br />\r\nÜber den folgenden Link können Sie das Dokument einsehen und elektronisch unterschreiben: <a href=\"[LINK_TO_DOCUMENT]\">[LINK_TO_DOCUMENT_TEXT]</a><br />\r\n<br />\r\n[MESSAGE]<br />\r\n<br />\r\nMit freundlichen Grüßen<br />\r\n<br />\r\n[NAME_PORTAL]",
Subject = "Dokument erhalten: '[DOCUMENT_TITLE]'"
},
new(){
Id = 2,
Name = "DocumentDeleted",
Body = "Guten Tag [NAME_RECEIVER],<br />\r\n<br /><B><I>\r\n[NAME_SENDER]</I></B> hat den Umschlag <B><I>'[DOCUMENT_TITLE]'</I></B> gelöscht/zurückgezogen.<br /><p>\rBegründung: <br /> <I>[REASON]</I> <p>\r\n<br />\r\nMit freundlichen Grüßen<br />\r\n<br />\r\n[NAME_PORTAL]",
Subject = "Umschlag zurückgezogen: '[DOCUMENT_TITLE]'"
},
new(){
Id = 3,
Name = "DocumentSigned",
Body = "Guten Tag [NAME_RECEIVER],<br />\r\n<br />\r\nhiermit bestätigen wir Ihnen die erfolgreiche Signatur für den Vorgang <B><I>'[DOCUMENT_TITLE]'</I></B>.<br />\r\nWenn alle Vertragspartner unterzeichnet haben, erhalten Sie ebenfalls per email ein unterschriebenes Exemplar mit dem Signierungszertifikat!\r\n<br />\r\nMit freundlichen Grüßen<br />\r\n<br />\r\n[NAME_PORTAL]",
Subject = "Dokument unterschrieben: '[DOCUMENT_TITLE]'"
},
new(){
Id = 4,
Name = "DocumentCompleted",
Body = "Guten Tag [NAME_RECEIVER],<br />\r\n<br />\r\nDer Signaturvorgang <B><I>'[DOCUMENT_TITLE]'</I></B> wurde erfolgreich abgeschlossen.<br />\r\n<br />\r\nSie erhalten das Dokument mit einem detaillierten Ergebnisbericht als Anhang zu dieser EmailAddress.<br />\r\n<br />\r\nMit freundlichen Grüßen<br />\r\n<br />\r\n[NAME_PORTAL]",
Subject = "Umschlag abgeschlossen: '[DOCUMENT_TITLE]'"
},
new(){
Id = 5,
Name = "DocumentAccessCodeReceived",
Body = "Guten Tag [NAME_RECEIVER],<br />\r\n<br /><B><I>\r\n[NAME_SENDER]</I></B> hat Ihnen ein Dokument zum [SIGNATURE_TYPE] gesendet. <br />\r\n<br />\r\nVerwenden Sie den folgenden Zugriffscode, um das Dokument einzusehen:<br />\r\n<br />\r\n[DOCUMENT_ACCESS_CODE]<br />\r\n<br />\r\nMit freundlichen Grüßen<br />\r\n<br />\r\n[NAME_PORTAL]",
Subject = "Zugriffscode für Dokument erhalten: '[DOCUMENT_TITLE]'"
},
new(){
Id = 6,
Name = "DocumentRejected_ADM",
Body = "Guten Tag [NAME_SENDER],<p><B><I>[NAME_RECEIVER]</I></B> hat den Umschlag <B><I>'[DOCUMENT_TITLE]'</I></B> mit folgendem Grund abgelehnt: <p>\r\n[REASON] \r\n<p>Der Umschlag wurde auf den Status Rejected gesetzt. <p> \r\nMit freundlichen Grüßen<br />\r\n<br />\r\n[NAME_PORTAL]",
Subject = "'[DOCUMENT_TITLE]' - Unterzeichnungsvorgang zurückgezogen"
},
new(){
Id = 9,
Name = "DocumentRejected_REC",
Body = "Guten Tag [NAME_RECEIVER],\r\n<p>Hiermit bestätigen wir Ihnen die Ablehnung des Unterzeichnungsvorganges <B><I>'[DOCUMENT_TITLE]'</I></B>!<p>Der Vertragsinhaber <B><I>[NAME_SENDER]</I></B> wurde über die Ablehnung informiert. <p> \r\nMit freundlichen Grüßen<br />\r\n<br />\r\n[NAME_PORTAL]",
Subject = "'[DOCUMENT_TITLE]' - Bestätigung Ablehnung"
},
new(){
Id = 10,
Name = "DocumentRejected_REC_2",
Body = "Guten Tag [NAME_RECEIVER],\r\n<p>Der Unterzeichnungsvorganges <B><I>'[DOCUMENT_TITLE]'</I></B> wurde durch einen anderen Vertragspartner abgelehnt! Ihre notwendige Unterzeichnung wurde verworfen.<p> Der Vertragsinhaber <B><I>[NAME_SENDER]</I></B> wird sich bei Bedarf mit Ihnen in Verbindung setzen. <p> \r\nMit freundlichen Grüßen<br />\r\n<br />\r\n[NAME_PORTAL]",
Subject = "'[DOCUMENT_TITLE]' - Unterzeichnungsvorgang abgelehnt."
},
new(){
Id = 11,
Name = "DocumentShared",
Body = "Guten Tag,<br /> <br /><B><I> [NAME_RECEIVER]</I></B> hat Ihnen ein Dokument zum Ansehen gesendet.<br /> <br /> Über den folgenden Link können Sie das Dokument einsehen: <a href=\"[LINK_TO_DOCUMENT]\">[LINK_TO_DOCUMENT_TEXT]</a><br /> <br /> <br /> Mit freundlichen Grüßen<br /> <br /> [NAME_PORTAL]",
Subject = "Dokument geteilt: '[DOCUMENT_TITLE]'"
},
new(){
Id = 12,
Name = "TotpSecret",
Body = "Guten Tag,<br /> <br />Sie können auf Ihren Zwei-Faktor-Authentifizierungscode zugreifen, indem Sie den unten stehenden QR-Code mit einer beliebigen Authentifizierungs-App auf Ihrem Telefon scannen (Google Authenticator, Microsoft Authenticator usw.). Dieser Code ist bis zum [TFA_EXPIRATION] gültig.<br /> <br /> <img src=\"data:image/png;base64,[TFA_QR_CODE]\" style=\"width: 13rem; height: 13rem;\"><br /> <br />\r\n<br /> Mit freundlichen Grüßen<br /> <br /> [NAME_PORTAL]",
Subject = "2-Faktor-Verifizierung QR-Code"
}
};
}

View File

@@ -0,0 +1,29 @@
using MediatR;
using System.Text.Json.Serialization;
namespace EnvelopeGenerator.Application.EmailTemplates.Commands.Update;
/// <summary>
/// Befehl zum Aktualisieren einer E-Mail-Vorlage.
/// </summary>
/// <param name="Body">
/// (Optional)Der neue Inhalt des E-Mail-Textkörpers. Wenn null, bleibt der vorhandene Inhalt unverändert.
/// </param>
/// <param name="Subject">
/// (Optional) Der neue Betreff der E-Mail. Wenn null, bleibt der vorhandene Betreff unverändert.
/// </param>
public record UpdateEmailTemplateCommand(string? Body = null, string? Subject = null) : IRequest
{
/// <param>
/// Die Abfrage, die die E-Mail-Vorlage darstellt, die aktualisiert werden soll.
/// </param>
[JsonIgnore]
public EmailTemplateQuery? EmailTemplateQuery { get; set; }
/// <summary>
///
/// </summary>
[JsonIgnore]
public DateTime ChangedWhen { get; init; } = DateTime.Now;
}

View File

@@ -0,0 +1,65 @@
using DigitalData.Core.Abstraction.Application.Repository;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Application.Exceptions;
using EnvelopeGenerator.Domain;
using EnvelopeGenerator.Domain.Entities;
using MediatR;
namespace EnvelopeGenerator.Application.EmailTemplates.Commands.Update;
/// <summary>
///
/// </summary>
public class UpdateEmailTemplateCommandHandler : IRequestHandler<UpdateEmailTemplateCommand>
{
private readonly IRepository<EmailTemplate> _repository;
/// <summary>
///
/// </summary>
/// <param name="repository"></param>
public UpdateEmailTemplateCommandHandler(IRepository<EmailTemplate> repository)
{
_repository = repository;
}
/// <summary>
///
/// </summary>
/// <param name="request"></param>
/// <param name="cancel"></param>
/// <returns></returns>
/// <exception cref="InvalidOperationException"></exception>
/// <exception cref="NotFoundException"></exception>
[Obsolete("Use Read-method returning IReadQuery<TEntity> instead.")]
public async Task Handle(UpdateEmailTemplateCommand request, CancellationToken cancel)
{
EmailTemplateDto? temp;
if (request.EmailTemplateQuery?.Id is int id)
{
temp = await _repository.ReadOrDefaultAsync<EmailTemplateDto>(t => t.Id == id, single: false, cancel);
}
else if (request!.EmailTemplateQuery!.Type is Constants.EmailTemplateType type)
{
temp = await _repository.ReadOrDefaultAsync<EmailTemplateDto>(t => t.Name == type.ToString(), single: false, cancel);
}
else
{
throw new InvalidOperationException("Both id and type is null. Id: " + request.EmailTemplateQuery.Id +". Type: " + request.EmailTemplateQuery.Type.ToString());
}
if (temp == null)
{
throw new NotFoundException();
}
if (request.Body is not null)
temp.Body = request.Body;
if (request.Subject is not null)
temp.Subject = request.Subject;
await _repository.UpdateAsync(temp, t => t.Id == temp.Id, cancel);
}
}

View File

@@ -0,0 +1,24 @@
using EnvelopeGenerator.Domain;
namespace EnvelopeGenerator.Application.EmailTemplates;
/// <summary>
/// Repräsentiert eine Abfrage für E-Mail-Vorlagen, die für Absender und Empfänger von Umschlägen verwendet werden.
/// Die Standardkultur ist "de-DE".
/// </summary>
/// <param name="Id">Die eindeutige Kennung der E-Mail-Vorlage (optional).</param>
/// <param name="Type">Der Typ der E-Mail-Vorlage, z. B. <see cref="Constants.EmailTemplateType"/> (optional). Beispiele:
/// 0 - DocumentReceived: Benachrichtigung über den Empfang eines Dokuments.
/// 1 - DocumentSigned: Benachrichtigung über die Unterzeichnung eines Dokuments.
/// 2 - DocumentDeleted: Benachrichtigung über das Löschen eines Dokuments.
/// 3 - DocumentCompleted: Benachrichtigung über den Abschluss eines Dokuments.
/// 4 - DocumentAccessCodeReceived: Benachrichtigung über den Erhalt eines Zugangscodes.
/// 5 - DocumentShared: Benachrichtigung über das Teilen eines Dokuments.
/// 6 - TotpSecret: Benachrichtigung über ein TOTP-Geheimnis.
/// 7 - DocumentRejected_ADM (Für den Absender): Mail an den Absender, wenn das Dokument abgelehnt wird.
/// 8 - DocumentRejected_REC (Für den ablehnenden Empfänger): Mail an den ablehnenden Empfänger, wenn das Dokument abgelehnt wird.
/// 9 - DocumentRejected_REC_2 (Für sonstige Empfänger): Mail an andere Empfänger (Brief), wenn das Dokument abgelehnt wird.
/// </param>
public record EmailTemplateQuery(int? Id = null, Constants.EmailTemplateType? Type = null)
{
}

View File

@@ -0,0 +1,23 @@
using AutoMapper;
using EnvelopeGenerator.Domain.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EnvelopeGenerator.Application.EmailTemplates.Queries.Read;
/// <summary>
///
/// </summary>
public class ReadEmailTemplateMappingProfile : Profile
{
/// <summary>
///
/// </summary>
public ReadEmailTemplateMappingProfile()
{
CreateMap<EmailTemplate, ReadEmailTemplateResponse>();
}
}

View File

@@ -0,0 +1,12 @@
using MediatR;
namespace EnvelopeGenerator.Application.EmailTemplates.Queries.Read;
/// <summary>
/// Stellt eine Abfrage dar, um eine E-Mail-Vorlage zu lesen.
/// Diese Klasse erbt von <see cref="EmailTemplateQuery"/>.
/// </summary>
public record ReadEmailTemplateQuery : EmailTemplateQuery, IRequest<ReadEmailTemplateResponse?>
{
}

View File

@@ -0,0 +1,52 @@
using AutoMapper;
using EnvelopeGenerator.Application.Contracts.Repositories;
using EnvelopeGenerator.Domain;
using MediatR;
namespace EnvelopeGenerator.Application.EmailTemplates.Queries.Read;
/// <summary>
///
/// </summary>
public class ReadEmailTemplateQueryHandler : IRequestHandler<ReadEmailTemplateQuery, ReadEmailTemplateResponse?>
{
private readonly IMapper _mapper;
[Obsolete("Use Read-method returning IReadQuery<TEntity> instead.")]
private readonly IEmailTemplateRepository _repository;
/// <summary>
/// Initialisiert eine neue Instanz der <see cref="EmailTemplateController"/>-Klasse.
/// </summary>
/// <param name="mapper">
/// <param name="repository">
/// Die AutoMapper-Instanz, die zum Zuordnen von Objekten verwendet wird.
/// </param>
[Obsolete("Use Read-method returning IReadQuery<TEntity> instead.")]
public ReadEmailTemplateQueryHandler(IMapper mapper, IEmailTemplateRepository repository)
{
_mapper = mapper;
_repository = repository;
}
/// <summary>
///
/// </summary>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
/// <exception cref="InvalidOperationException"></exception>
[Obsolete("Use IRepository")]
public async Task<ReadEmailTemplateResponse?> Handle(ReadEmailTemplateQuery request, CancellationToken cancellationToken)
{
var temp = request.Id is int id
? await _repository.ReadByIdAsync(id)
: request.Type is Constants.EmailTemplateType type
? await _repository.ReadByNameAsync(type)
: throw new InvalidOperationException("Either a valid integer ID or a valid EmailTemplateType must be provided in the request.");
var res = _mapper.Map<ReadEmailTemplateResponse>(temp);
return res;
}
}

View File

@@ -0,0 +1,37 @@
namespace EnvelopeGenerator.Application.EmailTemplates.Queries.Read;
/// <summary>
/// Stellt die Antwort für eine Abfrage von E-Mail-Vorlagen bereit.
/// </summary>
public class ReadEmailTemplateResponse
{
/// <summary>
/// Die eindeutige Kennung der E-Mail-Vorlage.
/// </summary>
public int Id { get; set; }
/// <summary>
/// Name des Typs
/// </summary>
public required string Name { get; set; }
/// <summary>
/// Das Datum und die Uhrzeit, wann die Vorlage hinzugefügt wurde.
/// </summary>
public DateTime AddedWhen { get; set; }
/// <summary>
/// Der Inhalt (Body) der E-Mail-Vorlage. Kann null sein.
/// </summary>
public string? Body { get; set; }
/// <summary>
/// Der Betreff der E-Mail-Vorlage. Kann null sein.
/// </summary>
public string? Subject { get; set; }
/// <summary>
/// Das Datum und die Uhrzeit, wann die Vorlage zuletzt geändert wurde. Kann null sein.
/// </summary>
public DateTime? ChangedWhen { get; set; }
}

View File

@@ -1,9 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net7.0</TargetFramework> <TargetFrameworks>net7.0;net8.0;net9.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
@@ -11,23 +13,23 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="AutoMapper" Version="13.0.1" /> <PackageReference Include="Dapper" Version="2.1.66" />
<PackageReference Include="DigitalData.Core.Abstractions" Version="2.2.1" /> <PackageReference Include="DigitalData.Core.Abstraction.Application" Version="1.0.0" />
<PackageReference Include="DigitalData.Core.Application" Version="2.0.0" /> <PackageReference Include="DigitalData.Core.Application" Version="3.3.4" />
<PackageReference Include="DigitalData.Core.Client" Version="2.0.3" /> <PackageReference Include="DigitalData.Core.Client" Version="2.1.0" />
<PackageReference Include="DigitalData.Core.DTO" Version="2.0.0" /> <PackageReference Include="DigitalData.EmailProfilerDispatcher" Version="3.1.1" />
<PackageReference Include="DigitalData.EmailProfilerDispatcher" Version="2.0.0" /> <PackageReference Include="MediatR" Version="12.5.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.18" /> <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.18" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.5" />
<PackageReference Include="Otp.NET" Version="1.4.0" /> <PackageReference Include="Otp.NET" Version="1.4.0" />
<PackageReference Include="QRCoder" Version="1.6.0" /> <PackageReference Include="QRCoder" Version="1.6.0" />
<PackageReference Include="QRCoder-ImageSharp" Version="0.10.0" /> <PackageReference Include="QRCoder-ImageSharp" Version="0.10.0" />
<PackageReference Include="UserManager.Application" Version="2.0.0" /> <PackageReference Include="UserManager" Version="1.1.1" />
<PackageReference Include="UserManager.Infrastructure" Version="2.0.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\EnvelopeGenerator.Domain\EnvelopeGenerator.Domain.csproj" />
<ProjectReference Include="..\EnvelopeGenerator.Extensions\EnvelopeGenerator.Extensions.csproj" /> <ProjectReference Include="..\EnvelopeGenerator.Extensions\EnvelopeGenerator.Extensions.csproj" />
<ProjectReference Include="..\EnvelopeGenerator.Infrastructure\EnvelopeGenerator.Infrastructure.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@@ -57,4 +59,28 @@
</EmbeddedResource> </EmbeddedResource>
</ItemGroup> </ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageReference Include="AutoMapper" Version="13.0.1" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.3" />
<PackageReference Include="CommandDotNet">
<Version>7.0.5</Version>
</PackageReference>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="AutoMapper" Version="14.0.0" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="6.0.2" />
<PackageReference Include="CommandDotNet">
<Version>8.1.1</Version>
</PackageReference>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
<PackageReference Include="AutoMapper" Version="14.0.0" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="6.0.2" />
<PackageReference Include="CommandDotNet">
<Version>8.1.1</Version>
</PackageReference>
</ItemGroup>
</Project> </Project>

View File

@@ -0,0 +1,21 @@
using EnvelopeGenerator.Application.Envelopes.Commands;
using MediatR;
using System.ComponentModel.DataAnnotations;
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Commands.Create;
/// <summary>
/// Befehl zur Erstellung eines Umschlags.
/// </summary>
/// <param name="Title">Der Titel des Umschlags. Dies ist ein Pflichtfeld.</param>
/// <param name="Message">Die Nachricht, die im Umschlag enthalten sein soll. Dies ist ein Pflichtfeld.</param>
/// <param name="Document">Das mit dem Umschlag verknüpfte Dokument. Dies ist ein Pflichtfeld.</param>
/// <param name="Receivers">Eine Sammlung von Empfängern, die den Umschlag erhalten. Dies ist ein Pflichtfeld.</param>
/// <param name="TFAEnabled">Gibt an, ob die Zwei-Faktor-Authentifizierung für den Umschlag aktiviert ist. Standardmäßig false.</param>
public record CreateEnvelopeReceiverCommand(
[Required] string Title,
[Required] string Message,
[Required] DocumentCreateCommand Document,
[Required] IEnumerable<ReceiverGetOrCreateCommand> Receivers,
bool TFAEnabled = false
) : CreateEnvelopeCommand(Title, Message, TFAEnabled), IRequest<CreateEnvelopeReceiverResponse>;

View File

@@ -0,0 +1,67 @@
using AutoMapper;
using EnvelopeGenerator.Application.Contracts.SQLExecutor;
using EnvelopeGenerator.Application.DTOs.Receiver;
using EnvelopeGenerator.Domain.Entities;
using MediatR;
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Commands.Create;
/// <summary>
/// Handles the creation of an envelope along with its associated document and recipients.
/// This command processes the envelope data, including title, message, document content,
/// recipient list, and optional two-factor authentication settings.
/// </summary>
public class CreateEnvelopeReceiverCommandHandler : IRequestHandler<CreateEnvelopeReceiverCommand, CreateEnvelopeReceiverResponse>
{
private readonly IMapper _mapper;
private readonly IEnvelopeExecutor _envelopeExecutor;
private readonly IEnvelopeReceiverExecutor _erExecutor;
/// <summary>
///
/// </summary>
/// <param name="mapper"></param>
/// <param name="envelopeExecutor"></param>
/// <param name="erExecutor"></param>
public CreateEnvelopeReceiverCommandHandler(IMapper mapper, IEnvelopeExecutor envelopeExecutor, IEnvelopeReceiverExecutor erExecutor)
{
_mapper = mapper;
_envelopeExecutor = envelopeExecutor;
_erExecutor = erExecutor;
}
/// <summary>
/// Handles the execution of the <see cref="CreateEnvelopeReceiverCommand"/>.
/// Responsible for validating input data, creating or retrieving recipients, associating signatures,
/// and storing the envelope and document details.
/// </summary>
/// <param name="request">The command containing all necessary information to create an envelope.</param>
/// <param name="cancel">Token to observe while waiting for the task to complete.</param>
/// <returns>A task representing the asynchronous operation.</returns>
public async Task<CreateEnvelopeReceiverResponse> Handle(CreateEnvelopeReceiverCommand request, CancellationToken cancel)
{
int userId = request.UserId ?? throw new InvalidOperationException("UserId cannot be null when creating an envelope.");
var envelope = await _envelopeExecutor.CreateEnvelopeAsync(userId, request.Title, request.Message, request.TFAEnabled, cancel);
List<EnvelopeReceiver> sentRecipients = new();
List<ReceiverGetOrCreateCommand> unsentRecipients = new();
foreach (var receiver in request.Receivers)
{
var envelopeReceiver = await _erExecutor.AddEnvelopeReceiverAsync(envelope.Uuid, receiver.EmailAddress, receiver.Salution, receiver.PhoneNumber, cancel);
if (envelopeReceiver is null)
unsentRecipients.Add(receiver);
else
sentRecipients.Add(envelopeReceiver);
}
var res = _mapper.Map<CreateEnvelopeReceiverResponse>(envelope);
res.UnsentReceivers = unsentRecipients;
res.SentReceiver = _mapper.Map<IEnumerable<ReceiverReadDto>>(sentRecipients);
return res;
}
}

View File

@@ -0,0 +1,48 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Commands.Create;
#region DTOs
/// <summary>
/// Signaturposition auf einem Dokument.
/// </summary>
/// <param name="X">X-Position</param>
/// <param name="Y">Y-Position</param>
/// <param name="Page">Seite, auf der sie sich befindet</param>
public record Signature([Required] double X, [Required] double Y, [Required] int Page);
/// <summary>
/// DTO für Empfänger, die erstellt oder abgerufen werden sollen.
/// Wenn nicht, wird sie erstellt und mit einer Signatur versehen.
/// </summary>
/// <param name="Signatures">Unterschriften auf Dokumenten.</param>
/// <param name="Salution">Der Name, mit dem der Empfänger angesprochen werden soll. Bei Null oder keinem Wert wird der zuletzt verwendete Name verwendet.</param>
/// <param name="PhoneNumber">Sollte mit Vorwahl geschrieben werden</param>
public record ReceiverGetOrCreateCommand([Required] IEnumerable<Signature> Signatures, string? Salution = null, string? PhoneNumber = null)
{
private string _emailAddress = string.Empty;
/// <summary>
/// E-Mail-Adresse des Empfängers.
/// </summary>
[Required]
public string EmailAddress { get => _emailAddress.ToLower(); init => _emailAddress = value.ToLower(); }
};
/// <summary>
/// DTO zum Erstellen eines Dokuments.
/// </summary>
public record DocumentCreateCommand()
{
/// <summary>
/// Die Dokumentdaten im Base64-String-Format. Wird verwendet, wenn das Dokument als Base64-codierter String bereitgestellt wird.
/// </summary>
[Required]
public required string DataAsBase64 { get; init; }
};
#endregion

Some files were not shown because too many files have changed in this diff Show More