Compare commits

..

323 Commits

Author SHA1 Message Date
a3b33637fd Update authorization scheme for GetAsync method
Modified the `[Authorize]` attribute on the `GetAsync` method in the `EnvelopeController` class to specify `AuthenticationSchemes = AuthScheme.Sender`. This change enforces a more specific authentication requirement, allowing access only to users authenticated under the `Sender` scheme.
2026-06-11 23:04:53 +02:00
bc3134a033 Update Envelope to EnvelopeDto mapping configuration
The mapping for the `Envelope` entity to the `EnvelopeDto` was
modified to include a custom mapping for the `Receivers` property.
The `Receivers` property in `EnvelopeDto` is now populated by
mapping from the `EnvelopeReceivers` collection in the `Envelope`
entity, specifically selecting the `Receiver` property from each
`EnvelopeReceiver` object.
2026-06-11 23:04:43 +02:00
f106255c6b Add Receivers property to EnvelopeDto
Enhanced the EnvelopeDto class by introducing a new `Receivers` property of type `IEnumerable<ReceiverDto>?` to support including recipient information in the envelope DTO.

Added necessary `using` directives for `EnvelopeReceiver` and `Receiver` DTOs to ensure proper namespace references. Updated the class to accommodate this new functionality.
2026-06-11 23:04:31 +02:00
cb103dcb69 Restrict UserId visibility and update query includes
The `UserId` property in `ReadEnvelopeQuery` was changed from `public` to `internal` to improve encapsulation. A new `Authorize` method was added to set the `UserId` property using the `with` expression.

In `ReadEnvelopeQueryHandler`, the LINQ query was updated to replace the inclusion of `Documents` with `EnvelopeReceivers` and their associated `Receiver`, reflecting a shift in the data being eagerly loaded to support updated functionality.
2026-06-11 23:04:05 +02:00
8c1dd9c40d Make boolean properties nullable in Envelope class
Changed `SendReminderEmails`, `UseAccessCode`, and `TfaEnabled`
properties from non-nullable `bool` to nullable `bool?` to allow
representation of `null` values. Added conditional initialization
of `TfaEnabled` to `false` for `NETFRAMEWORK` target.
2026-06-11 23:03:35 +02:00
ee358ffaab Update project version to 1.4.2
Bump the project version from 1.4.1 to 1.4.2 in the `<Version>` tag for the NuGet package. Updated `<AssemblyVersion>` and `<FileVersion>` to `1.4.2.0` to maintain consistency with the new version. This reflects a minor version update for API compatibility and file versioning.
2026-06-11 17:14:20 +02:00
0780dbdd94 Enhance PDF viewer and add embed page with file upload
- Added CSS styles for `.pdf-viewer` and its child elements
  to ensure proper dimensions and layout for PDF display.
- Enhanced `EnvelopeReceiverPage_DxPdfViewer.razor` with
  conditional rendering for improved user feedback.
- Introduced `EnvelopeReceiverPage_embed.razor` with a new
  route `/envelope/Embed`, drag-and-drop file upload, and
  embedded PDF viewer using `<embed>`.
- Implemented default PDF loading from embedded resources
  and Base64 encoding for embedding.
- Refactored file upload handling with `OnFilesUploading`
  and centralized allowed file types logic.
- Improved user experience with success and informational
  messages for file upload and PDF viewing.
2026-06-11 17:13:17 +02:00
d722742fe8 Remove unused DevExpress Reporting CSS file
The `dx-blazor-reporting-components.bs5.css` file reference was removed from `EnvelopeReceiverPage_DxPdfViewer.razor`. This CSS file was likely used for styling DevExpress Blazor Reporting Viewer components, which are no longer needed or have been replaced.
2026-06-11 15:55:26 +02:00
8c42105f58 Add PDF viewer with drag-and-drop file upload support
Added a new Razor page `EnvelopeReceiverPage_DxPdfViewer.razor` with a route `/envelope/DxPdfViewer`. Integrated DevExpress components, including `DxPdfViewer` for displaying PDF documents and `DxFileInput` for drag-and-drop file uploads. Styled the drag-and-drop zone with custom CSS. Initialized the viewer with a default embedded PDF file and implemented logic to handle file uploads dynamically.
2026-06-11 15:33:22 +02:00
88b196ed6d Refactor report handling and improve async operations
Refactored the `Report` property to `_report` with nullable support
and updated `EnvelopeKey` to use `init` for immutability.
Made `CreateReport` asynchronous, returning `Task<XtraReport>`,
and removed redundant `BasePdfBytes` property. Simplified predefined
report fetching by removing `ReportStorage.TryGetReport`. Improved
error handling for missing or invalid `pdfBytes` in `CreateReport`.
Made minor formatting and structural improvements for clarity.
2026-06-11 14:11:56 +02:00
c99511de29 Add FORM_APPLICATION_CONTEXT.md for migration documentation
Added a new file, `FORM_APPLICATION_CONTEXT.md`, to the solution file `EnvelopeGenerator.sln`. This file provides detailed documentation of the legacy VB.NET Windows Forms application, including its architecture, workflows, and migration plan to the ReceiverUI + API architecture.

The documentation outlines the application's purpose, primary libraries, project structure, and key forms with their respective features and behaviors. It also describes data models, controllers, and their methods, along with technical details such as coordinate systems, status colors, and master-detail grid patterns.

Additionally, the file includes implementation notes for key features like drag-and-drop file uploads, auto-complete for receiver emails, and PDF merging. Workflow summaries and a data flow diagram are provided to clarify the application's processes. The document concludes with key takeaways to ensure consistency during the migration.
2026-06-11 13:52:55 +02:00
7d0c5a0ee5 Improve error handling and logging for envelope receiver
Added a null check in `EnvelopeReceiverPage.razor` to log a warning when `_envelopeReceiver` is null. Updated `ReportViewer.razor` to wrap `EnvelopeReceiverService.GetAsync` in a `try-catch` block, logging `HttpRequestException` errors and allowing the UI to handle null values gracefully.

Enhanced `EnvelopeReceiverService.GetAsync` to throw detailed `HttpRequestException` on API failures, including status code and reason phrase. Added `using System.Net;` to support HTTP-related classes. Updated method documentation to reflect the new behavior.

These changes improve error diagnostics, logging, and maintainability across the codebase.
2026-06-11 13:40:30 +02:00
7001d7351f Remove default "fake" fallback for EnvelopeKey usage
The default value "fake" for the `EnvelopeKey` parameter has been
removed when calling `AnnotationService.GetAnnotationsAsync` and
`EnvelopeReceiverService.GetAsync`. The code now directly uses
the `EnvelopeKey` variable, assuming it will always have a valid
value or that null/empty handling is managed elsewhere.
2026-06-11 13:37:55 +02:00
cf16312394 Refactor error handling in DocumentService and consumers
Refactored `DocumentService.GetDocumentAsync` to throw
`HttpRequestException` on failure instead of returning a tuple.
Updated all consumers to handle exceptions, improving error
handling consistency across the application.

Enhanced error messages for better user feedback and added
logging for improved traceability. Updated `EnvelopeReceiverPage`,
`EnvelopeReceiverPage_DxReportViewer`, and `ReportViewer` to
use the new exception-based API and handle errors gracefully.

This change simplifies the API, improves maintainability, and
makes the application more robust and user-friendly.
2026-06-11 13:33:15 +02:00
ecb7f45f14 Refactor report creation and property initialization
Replaced nullable fields with non-nullable properties for `Report`
and `BasePdfBytes` to improve initialization and encapsulation.
Updated `OnInitializedAsync` to use `BasePdfBytes` and added
error handling for missing PDF bytes.

Refactored report creation logic by removing `BuildFreshBaseReport`
and `CreateReportInstance`, consolidating functionality into a
new `CreateReport` method. Enhanced `CreateReport` to support
both predefined and dynamically generated reports, simplifying
the code structure and improving maintainability.
2026-06-11 13:12:40 +02:00
0ba5578d94 Update appsettings.json configuration options
Removed the `ForceToUseFakeDocument` property from the `Api` section, as it is no longer needed. Added a new property, `UsePredefinedReports`, to the `Api` section with a default value of `false` to enable or disable the use of predefined reports.
2026-06-11 13:11:51 +02:00
e093471a24 Refactor: Replace ForceToUseFakeDocument property
Replaced the `ForceToUseFakeDocument` property in `ApiOptions`
with `UsePredefinedReports` to improve clarity and better align
with business requirements. Updated all references in
`EnvelopeReceiverPage_DxReportViewer.razor` and
`ReportViewer.razor` to use the new property, ensuring
consistency and maintaining functionality.
2026-06-11 13:07:17 +02:00
b16ae70762 Remove signature-related functionality
This commit removes all features and UI elements related to signature handling in the `EnvelopeReceiverPage_DxReportViewer.razor` file.

Key changes include:
- Removed signature creation (drawing, typing, uploading) and associated UI components like the signature popup and action bar.
- Removed annotation handling logic, including toggling checkboxes and applying signatures to annotations.
- Removed PDF export functionality for signed documents.
- Deleted methods and properties related to signature handling, such as `AddSignature`, `OnInitializedAsync`, and `SignaturePopupVisible`.
- Removed `@inject` services and JavaScript interop calls related to signature handling.
- Simplified the `DxReportViewer` usage to only display the report without overlays or interactions.
- Removed envelope metadata display and logout functionality.

The page now focuses solely on displaying reports without any signature-related features.
2026-06-11 13:02:53 +02:00
c3e8f09291 Simplify EnvelopeReceiverPage logic and update settings
Removed redundant `EnvelopeKey` checks in `LogoutAsync` and
`OnInitializedAsync` methods, simplifying logout and initialization
logic. Updated navigation URL to `/envelope/login/`. Streamlined
document fetching logic by removing unnecessary conditions.

Added logging in `CreateReportInstance` to track report creation.
Enabled `ForceToUseFakeDocument` in `appsettings.json` to default
to using fake documents. These changes improve code clarity and
align behavior with updated requirements.
2026-06-11 12:51:04 +02:00
a9fb82bbea Refactor _dotNetRef type and remove unused redirection
Updated the `_dotNetRef` field to use a more specific type, `DotNetObjectReference<EnvelopeReceiverPage_DxReportViewer>`, for better alignment with the component. Removed obsolete redirection logic from `/receiver/{key}` to `/envelope/{key}` in `OnInitializedAsync`, as it is no longer needed or handled elsewhere. Retained envelope access validation logic.
2026-06-11 11:59:21 +02:00
895fd5c509 Add route for DxReportViewer in yarp.json
Introduce a new route configuration for `receiver-ui-envelope-dxreportviewer` in `yarp.json`.
The route matches requests to `/envelope/{EnvelopeKey}/DxReportViewer` for `GET` and `HEAD` methods.
It is part of the `receiver-ui` cluster, with an order of `90`, and includes a transformation to redirect the path to `/index.html`.
This change supports a new endpoint in the application.
2026-06-11 11:58:58 +02:00
3b4278d7e0 Add envelope viewer with signature functionality
Introduced a new Razor page `EnvelopeReceiverPage_DxReportViewer.razor` to manage and sign envelope-related documents. Integrated DevExpress Blazor components for PDF rendering and signature handling.

Key features:
- Added sections for envelope info, signature actions, and a PDF viewer.
- Enabled signature creation via drawing, text input, or image upload.
- Validated and applied signatures to annotated fields in the document.
- Integrated JavaScript interop for signature capture and rendering.
- Supported exporting signed PDFs and dynamic signature overlays.
- Ensured proper resource cleanup with `IDisposable` implementation.
2026-06-11 11:52:11 +02:00
6d1fb05e10 Update solution items in EnvelopeGenerator.sln
Replaced `COPILOT_CONTEXT_EN.md` with `COPILOT_CONTEXT.md`
in the `ProjectSection(SolutionItems)` of the solution file
`EnvelopeGenerator.sln` to reflect updated documentation.
2026-06-11 11:38:59 +02:00
26da78fa22 Refactor ReceiverUI: Rename files, update routes
Renamed Razor component files in ReceiverUI to follow a consistent "Page" naming convention. Updated routes to reference the renamed files. Introduced the root route (`/`) with `Index.razor` as the application entry point.

Updated documentation to reflect the file renames, route changes, and multi-envelope support. Clarified Redis/SQL caching details and deprecated the "Web" frontend in favor of `ReceiverUI`.

These changes improve maintainability, consistency, and developer experience.
2026-06-11 11:38:32 +02:00
9eee2b523d Refactor YARP routes and update configurations
Renamed the `receiver-ui-receiver` route to `receiver-ui-root` and updated its `Order` value from `100` to `300`. Changed the `Match` path for `receiver-ui-root` from `/receiver/{**catch-all}` to `/`. Removed the `receiver-ui-login` route entirely.

Added a `Transforms` section to the `receiver-ui-root` and `receiver-ui-sender` routes, setting the path to `/index.html`.
2026-06-11 11:38:19 +02:00
9dc2b9adef rename Pages\*.razor to Pages\*Page.razor to resolve conflicts 2026-06-11 11:07:32 +02:00
cc3c5ec9f0 Unify architecture with Blazor WASM and YARP proxy
Refactored the deployment architecture to include two distinct
presentation projects: `EnvelopeGenerator.API` (ASP.NET Core Web
API with YARP Reverse Proxy) and `EnvelopeGenerator.ReceiverUI`
(Blazor WebAssembly). The API now acts as the single entry point,
proxying requests to the ReceiverUI and external authentication
services.

Redefined the route structure for clarity, introducing sender
routes (`/sender/login`, `/sender`) and receiver routes
(`/envelope/login/{EnvelopeKey}`, `/envelope/{EnvelopeKey}`).
Added multi-envelope support with per-envelope cookies for
simultaneous authentication.

Renamed `EnvelopeViewer` to `EnvelopeReceiver` to reflect its
expanded functionality for viewing and signing envelopes.
Replaced iText7 and PSPDFKit with PDF.js 3.11.174 for document
viewing and signing, with configurable quality settings.

Updated `AuthService` and `SignatureCacheService` to support the
new route structure and multi-envelope authentication. Adjusted
sender login flow to redirect to `/sender` upon success.

Updated documentation to reflect the new architecture, route
structure, and file renames. Deprecated libraries and past
mistakes were documented to avoid repetition.
2026-06-11 11:02:01 +02:00
2766d963af Update login route and refactor _dotNetRef type
Updated the login route from `/login/{EnvelopeKey}` to
`/envelope/login/{EnvelopeKey}` across the application, including
navigation paths in `EnvelopeReceiver.razor` and the `@page` directive
in `LoginReceiver.razor`.

Refactored `_dotNetRef` in `EnvelopeReceiver.razor` to use
`DotNetObjectReference<enveloperece>?` instead of
`DotNetObjectReference<EnvelopeReceiver>?` to reflect a change in the
referenced type.
2026-06-11 10:59:50 +02:00
8fd9928524 Update routes and add EnvelopeSender component
Added a new `EnvelopeSender.razor` component with the route `/sender`.
Updated the route for `LoginSender.razor` from `/login` to `/sender/login`.
Modified navigation logic in `LoginSender.razor` to redirect to
`/sender` after a successful login instead of the root route.
2026-06-11 10:50:28 +02:00
fb3ee14f8f Initialize _pdfLoaded and update _dotNetRef type
The `_pdfLoaded` variable was initialized to `false` in the `EnvelopeReceiver.razor` file. Additionally, the type of `_dotNetRef` was changed from `DotNetObjectReference<EnvelopeViewer>?` to `DotNetObjectReference<EnvelopeReceiver>?` to reflect the correct object reference.
2026-06-11 10:49:31 +02:00
e3929a99e3 rename EnvelopeViewer to EnvelopeReceiver 2026-06-11 10:48:03 +02:00
b6d86aa3eb Refactor documentation for unified architecture
Updated documentation to reflect the transition to a unified Blazor WASM frontend for both Senders and Receivers. Removed references to PSPDFKit and legacy components, emphasizing the use of PDF.js and DevExpress.

Key changes include:
- Revised purpose and architecture sections.
- Updated solution structure to mark `EnvelopeGenerator.Web` as deprecated.
- Enhanced coordinate system explanation with conversion formulas.
- Documented new `EnvelopeViewer` features and signature workflows.
- Added details on signature caching and login flows for Senders and Receivers.
- Expanded "Mistakes History" to highlight lessons learned.
- Added quick reference for debugging and development consistency.

These changes improve clarity, maintainability, and alignment with the current system architecture.
2026-06-11 10:25:44 +02:00
4171a3138b Add LoginSender.razor for Sender user authentication
Implemented a new `LoginSender.razor` component to provide a login page for "Sender" users. The page includes:
- A responsive card layout with a header, input fields for "Username" and "Password," and a submit button with a loading spinner.
- Error handling for invalid credentials and server errors, with appropriate alerts.
- A password visibility toggle for better user experience.
- Integration with `AuthService` for authentication and `NavigationManager` for redirection.

Added Blazor code-behind logic to manage state, handle login submission, and trigger login on "Enter" key press. The page is styled with a custom theme and includes a footer for support information.
2026-06-11 10:09:59 +02:00
e98e18cfe0 Add sender login functionality to AuthService
Added a `SenderLoginResult` enum to represent outcomes of sender login attempts.
Implemented the `LoginSenderAsync` method in `AuthService` to authenticate sender users via the `/api/auth?cookie=true` endpoint.
The method handles HTTP response codes and returns appropriate `SenderLoginResult` values.
Included the `System.Net.Http.Json` namespace to support JSON-based HTTP requests.
2026-06-11 10:01:33 +02:00
14aff03de4 rename Login.razor as LoginReceiver.razor 2026-06-11 09:59:58 +02:00
d828a5bfe2 Refactor authentication schemes for sender and receiver
Updated `AuthScheme` to introduce a distinct `Sender` scheme
and renamed the `Receiver` scheme for clarity. Updated
`Program.cs` to use the new `Sender` scheme in JWT
authentication and explicitly associate authentication
schemes with `Sender` and `Receiver` policies. Removed the
deprecated `AuthPolicy.ReceiverTFA` policy. These changes
improve the separation and maintainability of authentication
and authorization logic.
2026-06-10 22:25:02 +02:00
a6e174e7c1 Refactor JWT auth scheme configuration
Replaced hardcoded per-envelope receiver JWT auth scheme string with a new `AuthScheme` static class containing a `Receiver` constant. Updated `Program.cs` to use `AuthScheme.Receiver` for authentication and policy configuration. Removed redundant comments and unused constants. Added necessary `using` directive for `AuthScheme`.
2026-06-10 17:14:46 +02:00
fc7aa83513 Refactor authorization policies in Program.cs
Reformatted the `AddAuthorizationBuilder()` method for improved readability and consistency. Updated `AuthPolicy.Receiver` to include an additional role, `"receiver"`, in the `RequireRole` method. No functional changes were made to other policies. These changes enhance code maintainability and introduce a minor adjustment to the `AuthPolicy.Receiver` policy.
2026-06-10 15:39:57 +02:00
90661cb856 Enhance SaveSignatureBehavior with validation and repo logic
Updated SaveSignatureBehavior.cs to improve functionality:
- Added new dependencies: AutoMapper, IRepository, and EF Core.
- Enhanced constructor to initialize new dependencies.
- Updated Handle method to validate signatures and handle errors.
- Introduced repository operations for querying and updating elements.
- Improved error handling with BadRequestException.
- Cleaned up redundant code and resolved namespace conflicts.
2026-06-10 15:18:53 +02:00
04e30b0d79 Add ReceiverAppType property and enum to SigningCommand
Added a new `ReceiverAppType` property to the `SigningCommand`
record, initialized to `ReceiverAppType.ReceiverUI`. Introduced
a `ReceiverAppType` enum with values `ReceiverUI` and `LegacyWeb`.
Updated `SignCommandHandler` to reflect these changes without
modifying its functionality.
2026-06-10 15:18:22 +02:00
d0a50f63db Improve validation and error handling in AnnotationBehavior
Updated `using` directives to include `DigitalData.Core.Exceptions` for enhanced exception handling. Updated the `[Obsolete]` attribute message to reflect PSPDFKit library deprecation. Renamed `cancellationToken` to `cancel` for consistency.

Added validation to ensure `PsPdfKitAnnotation` is only supported for the `LegacyWeb` receiver type. Introduced stricter checks for missing or invalid annotation data, throwing `BadRequestException` when necessary. Updated `await next` calls to use the renamed parameter.

These changes improve code clarity, enforce stricter validation, and enhance error handling.
2026-06-10 15:17:25 +02:00
9d20ba1987 Rename ElementId to Id in Signature record
The `ElementId` property in the `Signature` record was renamed to `Id`. This change simplifies the property name, making it more concise and aligning with standard naming conventions or domain terminology.
2026-06-10 12:38:38 +02:00
66f7b6f5e1 Enhance AutoMapper mappings and add base64 decoding
Updated `MappingProfile` to map `Signature.DataUrl` to
`DocReceiverElement.Ink` using the new `MapDataUrlToRequiredBytes`
extension method. Added `MapDataUrlToRequiredBytes` to handle
base64-encoded data URLs, converting them to byte arrays.

Introduced a `using System;` directive in `AutoMapperAuditingExtensions.cs`
to support `DateTime`. Retained `MapChangedWhen` functionality while
extending mapping capabilities for handling base64 data URLs.
2026-06-10 12:36:35 +02:00
a49dd0ff81 Replace SignatureDto with new Signature record
Replaced the `SignatureDto` record with a new `Signature` record to provide a more robust representation of signature data. Updated `MappingProfile` to map `Signature` to `DocReceiverElement` and removed the old `SignatureDto` mapping. Updated `SigningCommand` to use `IEnumerable<Signature>` instead of `IEnumerable<SignatureDto>`. Removed the old `MappingProfile` class and adjusted namespaces and `using` directives accordingly. These changes improve maintainability and streamline signature handling.
2026-06-10 11:38:02 +02:00
e420e8d47a Update routes to include '/example' prefix in .razor files
Updated the `@page` directives in `DocumentViewer.razor`,
`ReportDesigner.razor`, `ReportViewer.razor`, and `TestViewer.razor`
to prepend the `/example` prefix to their respective routes.

This change modifies the URL paths for accessing these components
to better organize or namespace the routes under the `/example`
prefix. No functional or structural changes were made to the
components themselves.
2026-06-10 11:24:37 +02:00
d7f86adffe Certainly! Please provide the list of code changes so I can help craft a concise and comprehensive commit message for you. 2026-06-10 11:24:12 +02:00
cfb5c15fda Add ReadDocReceiverElementQuery and handler
Introduced `ReadDocReceiverElementQuery` for retrieving document receiver elements and its corresponding handler. Added necessary `using` directives for dependencies like `AutoMapper`, `MediatR`, and `Microsoft.EntityFrameworkCore`.

The handler dynamically filters `DocReceiverElement` data based on optional query parameters (e.g., `Envelope.Id`, `Envelope.Uuid`, `Receiver.Id`, `Receiver.Signature`) using LINQ. Data is fetched asynchronously and mapped to DTOs using `AutoMapper`.
2026-06-10 10:31:56 +02:00
a0ed3e2fe4 Add SaveSignatureBehavior and resolve merge conflicts
Introduced the `SaveSignatureBehavior` class as a pipeline behavior for handling `SigningCommand` requests. Added necessary `using` directives to include required namespaces. Resolved merge conflicts in `using` directives between `net8.0` and `net9.0` project versions. Implemented the `Handle` method to delegate request processing.
2026-06-09 23:28:59 +02:00
f5505190e9 Add SignatureDto and mapping for signature handling
Added a new `SignatureDto` record to represent captured signatures with metadata, including properties like `ElementId`, `DataUrl`, `FullName`, `Position`, and `Place`. Updated `SigningCommand` to include a `Signatures` property for handling multiple signatures, deprecating `PsPdfKitAnnotation`.

Introduced a `MappingProfile` class to map `SignatureDto` to `DocReceiverElement` using AutoMapper. Added necessary `using` directives to support the new mapping configuration.
2026-06-09 23:20:53 +02:00
1bfdbac8ff rename Application.Signature directory as DocReceiverElements 2026-06-09 23:06:30 +02:00
4a29511491 Refactor: Replace Signatures with DocReceiverElements
Updated the codebase to replace the `Signature` record with the new `DocReceiverElementCreateDto` record for better alignment with the domain model.

- Updated `EnvelopeReceiverController` to use `DocReceiverElements` instead of `Signatures` when iterating over `Receivers`.
- Replaced the `Signature` record with `DocReceiverElementCreateDto` in `CreateEnvelopeReceiverCommand`.
- Updated `ReceiverGetOrCreateCommand` to use a `DocReceiverElements` property instead of `Signatures`.

These changes ensure consistency and reflect a shift in how document-related data is represented.
2026-06-09 23:03:18 +02:00
1089304bf1 Refactor: Rename SignatureDto to DocReceiverElementDto
Renamed `SignatureDto` to `DocReceiverElementDto` across the codebase to better reflect its purpose as a DTO for document receiver elements.

Updated all references, including:
- `SignatureController.cs`: Changed `doc.Elements` type to `IEnumerable<DocReceiverElementDto>`.
- `DocumentDto.cs`: Updated `Elements` property type.
- `MappingProfile.cs`: Adjusted mappings for the renamed DTO.
- `IDocumentReceiverElementService.cs` and `DocumentReceiverElementService.cs`: Updated interfaces and services to use the new DTO.
- `TestDocumentReceiverElementController.cs`: Updated generic type parameters.

These changes improve clarity, align naming with the domain model, and ensure consistency throughout the application.
2026-06-09 23:00:11 +02:00
9b606a0d3b rename Domain.Interfaces.ISignature as IDocReceiverElement 2026-06-09 22:56:55 +02:00
cb6dea319b rename Entities.Signature as DocReceiverElement 2026-06-09 22:52:41 +02:00
d59aa6157d Rename SignCommand to SigningCommand across codebase
Updated all references to `SignCommand` to use the new `SigningCommand` name for consistency and clarity. This includes changes to class definitions, method signatures, and pipeline behaviors in the following files:

- `DependencyInjection.cs`: Updated pipeline behaviors to use `SigningCommand`.
- `AnnotationBehavior.cs`: Updated class definition and methods to use `SigningCommand`. Marked `SignCommand` as `[Obsolete]`.
- `DocStatusBehavior.cs`, `EnvelopeReceiverResolutionBehavior.cs`, `HistoryBehavior.cs`, `SendSignedMailBehavior.cs`: Updated class definitions and methods to use `SigningCommand`.
- `SendSignedMailBehavior.cs`: Updated `CreatePlaceHolders` method to accept `SigningCommand`.
- `SigningCommand.cs`: Renamed `SignCommand` record to `SigningCommand` and updated internal methods and properties. Renamed `SignCommandHandler` to `SigningCommandHandler`.

Marked `SignCommand` as `[Obsolete]` where applicable to indicate deprecation. These changes improve code readability and align the command name with its purpose in the signing process.
2026-06-09 22:47:08 +02:00
1569647b60 Update pipeline behaviors for SignCommand in MediatR
Added EnvelopeReceiverResolutionBehavior as the first pipeline
behavior for SignCommand. Updated execution order of existing
behaviors: AnnotationBehavior (2nd), DocStatusBehavior (3rd),
and HistoryBehavior (4th). SendSignedMailBehavior remains last.
Updated comments to reflect the new execution order.
2026-06-09 22:43:37 +02:00
3bb2a013ab Add EnvelopeReceiverResolutionBehavior pipeline behavior
Introduced a new pipeline behavior class `EnvelopeReceiverResolutionBehavior` to resolve and validate the `EnvelopeReceiver` during the signing process.

- Added necessary `using` directives for dependencies such as `AutoMapper`, `MediatR`, and `IRepository`.
- Implemented the `Handle` method to query the database for `EnvelopeReceiver` if not provided in the `SignCommand` request.
- Throws a `NotFoundException` if the `EnvelopeReceiver` is not found.
- Maps the retrieved entity to a DTO and sets it in the request.
- Ensures the behavior executes before other signing process behaviors.
2026-06-09 22:43:19 +02:00
215b755f92 Refactor SignCommand and improve handler comments
Refactored the `SignCommand` class to inherit from `EnvelopeReceiverQueryBase` and introduced a private backing field `_envelopeReceiver` for better encapsulation. Added an internal method `SetEnvelopeReceiver` to manage the envelope receiver data. Updated the `EnvelopeReceiver` property to use the backing field and removed the `required` modifier for more controlled initialization.

Clarified comments in `SignCommandHandler` to emphasize that all processing is handled by pipeline behaviors, leaving the handler intentionally empty. Made minor adjustments to comments for improved clarity and consistency.
2026-06-09 22:42:50 +02:00
3a94733047 Refactor SignCommand and deprecate PsPdfKitAnnotation
Removed the `EmailAddress` property from the `SignCommand` class, which previously retrieved the receiver's email address and threw an exception if the receiver was null. This change eliminates reliance on `EnvelopeReceiver`.

Removed the `ToJson` extension method usage and the associated `using EnvelopeGenerator.Application.Common.Extensions;` directive, as well as the unused `using EnvelopeGenerator.Domain.Constants;` directive.

Marked the `PsPdfKitAnnotation` property as `[Obsolete]`, directing users to use `Signature.Commands.SignCommand` instead, signaling a transition to a newer implementation.
2026-06-09 19:11:55 +02:00
7793d3cbb9 Update EmailOut to use EnvelopeReceiver properties
Updated the `EmailAddress` and `ReferenceString` properties
of the `EmailOut` object in `SendSignedMailBehavior` to use
`request.EnvelopeReceiver.Receiver!.EmailAddress` instead of
`request.EmailAddress`. This ensures the values are derived
from the `EnvelopeReceiver.Receiver` object for improved
accuracy and consistency.
2026-06-09 19:11:44 +02:00
9174065365 Pass cancellationToken to next() in pipeline behaviors
Updated the `Handle` method in multiple classes implementing
`IPipelineBehavior<SignCommand, Unit>` to pass the `cancellationToken`
parameter to the `next()` method. This change ensures consistent
propagation of the `cancellationToken` through the pipeline, enabling
proper handling of cancellation requests during asynchronous operations.

Modified files:
- AnnotationBehavior.cs
- DocStatusBehavior.cs
- HistoryBehavior.cs
- SendSignedMailBehavior.cs
2026-06-09 19:07:38 +02:00
19824afc1c Mark PsPdfKitAnnotation as obsolete; remove TemplateType
The `PsPdfKitAnnotation` property in the `SignCommand` class has been marked as `[Obsolete]` with a deprecation message suggesting the use of `Signature.Commands.SignCommand` instead.

The `TemplateType` property, which returned the `EmailTemplateType.DocumentSigned` value, has been removed from the `SignCommand` class.
2026-06-09 19:07:26 +02:00
c7fe3f0b9c Mark PsPdfKitAnnotation as obsolete
Added an [Obsolete] attribute to the PsPdfKitAnnotation property
in the DocSignedNotification class, indicating that the PSPDFKit
library is deprecated.

Reorganized using directives in DocumentReceiverElementService.cs
to improve consistency and maintain code readability.
2026-06-09 19:04:55 +02:00
a98024063a Refactor namespaces for SignCommand and behaviors
Updated namespaces from `Signature` to `Signatures` for consistency and clarity across the application. Simplified pipeline behavior registrations in `DependencyInjection.cs` by using shorter references. Added `Microsoft.Extensions.Configuration` to `DependencyInjection.cs` to support configuration functionality. Ensured all references to `SignCommand` and related behaviors align with the new namespace structure.
2026-06-09 18:55:31 +02:00
e0cab3f965 Mark PSPDFKit-related code as obsolete
Added `[Obsolete]` attributes to classes, methods, and properties related to the deprecated PSPDFKit library and notifications.

- Marked `AnnotationHandler`, `DocStatusHandler`, `AnnotationBehavior`, and `DocStatusBehavior` as obsolete.
- Marked `Handle` methods in `DocStatusHandler` and `DocStatusBehavior` as obsolete.
- Marked `PsPdfKitAnnotation` property in `SignCommand` as obsolete.
- Marked `CreateOrUpdate` method in `AnnotationController` as obsolete.
- Added `Handle` methods in `DocStatusHandler` and `DocStatusBehavior` to send `CreateDocStatusCommand`.
- Updated `AnnotationController` dependencies to include `EnvelopeGenerator.Application.Common.Dto`.

These changes indicate a transition to `Signature.Commands.SignCommand` and deprecate PSPDFKit-related functionality.
2026-06-09 18:45:51 +02:00
e5347b063d Add pipeline behaviors for signing process
Introduced four new pipeline behaviors (`AnnotationBehavior`,
`DocStatusBehavior`, `HistoryBehavior`, and `SendSignedMailBehavior`)
to modularize the signing process. These behaviors handle annotation
persistence, document status creation, history recording, and signed
mail notifications, respectively.

- `AnnotationBehavior`: Saves annotations using `IRepository`.
- `DocStatusBehavior`: Creates document status via `ISender`.
- `HistoryBehavior`: Records signing history and validates receiver
  information.
- `SendSignedMailBehavior`: Sends signed mail notifications using
  email templates and dynamic placeholder replacement.

Added error handling for missing data in `HistoryBehavior` and
`SendSignedMailBehavior`. Updated the signing pipeline to execute
these behaviors sequentially, ensuring a structured and extensible
workflow.
2026-06-09 18:33:57 +02:00
ecd695ad37 Add MediatR pipeline behaviors for SignCommand
Introduced MediatR to the project by adding the `using MediatR;` directive in `DependencyInjection.cs`. Registered pipeline behaviors for the `Signature.Commands.SignCommand` to enforce a structured execution order:

1. AnnotationBehavior: Saves annotations.
2. DocStatusBehavior: Creates document status.
3. HistoryBehavior: Records history.
4. SendSignedMailBehavior: Sends notification email (executes last).

These changes improve the command handling pipeline by ensuring sequential and reliable execution of behaviors.
2026-06-09 18:33:27 +02:00
5a8809ffc1 Add new dependencies to DocSignedNotificationTests.cs
Added `using` directives for namespaces related to DTOs,
envelope receivers, and document signing notifications.
These changes enable the use of new functionality or
tests for document signing notifications.
2026-06-09 18:25:01 +02:00
b832637a6a Update AnnotationController with new dependencies
Added `using` directives for additional namespaces to support
application DTOs, extensions, services, notifications, and
envelope receiver queries. These changes introduce new
functionality and dependencies to the `AnnotationController`
class.
2026-06-09 18:23:08 +02:00
fceb266630 Deprecate DocSignedNotification and cleanup annotations
Marked `DocSignedNotification` as `[Obsolete]` with a note to use `Signature.Commands.SignCommand` instead. Removed the `PsPdfKitAnnotation` record and its associated `using` directives from `DocSignedNotification.cs`.

Added missing `using EnvelopeGenerator.Application.Common.Dto;` to `AnnotationHandler.cs` and `DocStatusHandler.cs` to ensure proper DTO support.
2026-06-09 18:22:43 +02:00
87bdef9d5e Add SignCommand and handler for document signing
Introduce `SignCommand` and `SignCommandHandler` in the `EnvelopeGenerator.Application.Signature.Commands` namespace.

- `SignCommand` is a CQRS command that encapsulates the envelope receiver's information (`EnvelopeReceiverDto`) and optional PSPDFKit annotation data.
- Added computed properties for email template type (`TemplateType`) and receiver's email address (`EmailAddress`), with validation for null receivers.
- `SignCommandHandler` implements the `IRequestHandler<SignCommand>` interface, with a placeholder `Handle` method delegating processing to pipeline behaviors.
- Added necessary `using` directives for MediatR, DTOs, extensions, and constants.
2026-06-09 18:12:12 +02:00
2fb32fb982 Add PsPdfKitAnnotation record with deprecation notice
Introduced a new `PsPdfKitAnnotation` record in the namespace
`EnvelopeGenerator.Application.Common.Dto` to represent PSPDFKit
annotation data. The record includes two parameters: `Instant`
of type `ExpandoObject` and `Structured` of type
`IEnumerable<AnnotationCreateDto>`.

Marked the record with the `[Obsolete]` attribute to indicate
that the PSPDFKit library is deprecated. Added a summary XML
comment to describe the purpose of the record. Also added a
`using` directive for `System.Dynamic` to support `ExpandoObject`.
2026-06-09 18:07:27 +02:00
63d050244c Rename method in SignatureController to Get
Renamed the method `GetAnnotsOfReceiver` to `Get` in the
`SignatureController` class. This change simplifies the method
name, making it more generic and potentially aligning with
naming conventions or broader use cases.
2026-06-09 17:05:43 +02:00
126a4acb12 Add new properties to SignatureDto for signature details
Added the `System.ComponentModel.DataAnnotations.Schema` namespace.
Introduced new properties to the `SignatureDto` class:
- `FullName` (string?) for the full name of the signature entity.
- `Position` (string?) for the position of the signature entity.
- `Place` (string?) for the place associated with the signature entity.
- `Ink` (byte[]?) for the ink data of the signature entity.
2026-06-09 17:05:23 +02:00
082cb322ef Refactor comments for clarity and consistency
Replaced non-English comments with English equivalents across
`EnvelopeViewer.razor` and `pdf-viewer.js` to improve code
readability and maintainability. Updated comments to clarify
the purpose of variables, methods, and DOM manipulation logic
without altering functionality. These changes ensure the
codebase is more accessible to a broader audience.
2026-06-09 17:05:01 +02:00
cd077aa1bd Refactor DocSignedNotification for better encapsulation
Refactored `DocSignedNotification` to remove inheritance from
`EnvelopeReceiverDto` and introduced a required `EnvelopeReceiver`
property. Updated all usages across the codebase to align with the
new structure, including controllers, handlers, and tests.

- Improved encapsulation and reduced coupling by making
  dependencies explicit.
- Updated `AnnotationController`, `DocStatusHandler`,
  `HistoryHandler`, and `SendSignedMailHandler` to use the
  `EnvelopeReceiver` property.
- Adjusted `DocSignedNotificationTests` to reflect the new
  instantiation pattern.
- Updated XML documentation and ensured consistent access to
  `EnvelopeReceiver` properties like `EnvelopeId`, `ReceiverId`,
  and `EmailAddress`.
2026-06-09 16:34:49 +02:00
49ac35153e Refactor AnnotationController and DocSignedNotification
Refactored `AnnotationController` to simplify `DocSignedNotification` creation and improve error handling. Replaced the `ToDocSignedNotification` extension method with direct instantiation of `DocSignedNotification`. Introduced a `try-catch` block to handle exceptions during notification publishing, ensuring a `RemoveSignatureNotification` is sent on failure.

Removed `ToDocSignedNotification` and `PublishSafely` extension methods, as their functionality was inlined into the controller. Updated tests to reflect these changes. Simplified the `DocSignedNotification` class by removing redundant methods.

Improved maintainability and clarity by reducing dependencies on extension methods and handling exceptions explicitly.
2026-06-09 15:39:41 +02:00
91a563d995 Refactor SQL cache configuration in Program.cs
Simplified the configuration of the distributed SQL Server cache by using the `Bind` method to map all properties from the `Cache:SqlServer` configuration section directly to the `options` object.

Added a fallback to ensure the `ConnectionString` is set to `connStr` if it is empty or whitespace.
2026-06-09 14:57:48 +02:00
308cdd03f2 Add SQL Server distributed cache configuration
Configured the application to use SQL Server as a distributed
cache provider. Added `AddDistributedSqlServerCache` to
`Program.cs` and set up the connection string, schema name,
and table name from the `Cache:SqlServer` configuration
section. This enables persistent and shared caching across
multiple application instances.
2026-06-09 13:52:30 +02:00
f35068e368 Add conditional SQL Server caching for .NET 8.0
Added a new package reference for `Microsoft.Extensions.Caching.SqlServer` version `8.0.11`, conditionally included for the `net8.0` target framework. This enables SQL Server-based caching functionality for applications targeting .NET 8.0.
2026-06-09 13:52:15 +02:00
e490805025 Add SQL Server cache configuration to appsettings.json
Added a "SqlServer" object under the "Cache" section in
`appsettings.json` with properties for "ConnectionString",
"SchemaName" (set to "dbo"), and "TableName" (set to "TBDD_CACHE").
No changes were made to the "SignatureCacheExpiration" property,
but it was re-added in the diff for context.
2026-06-09 13:52:03 +02:00
08550f87e6 Refactor ReceiverSignature to method in CacheController
Updated `ReceiverSignature` usage in `CacheController` to reflect its refactoring from a property to a method. This change was applied consistently across the `SaveSignature`, `GetSignature`, and `DeleteSignature` methods, ensuring the `cacheKey` variable now uses `User.ReceiverSignature()` instead of `User.ReceiverSignature`. This refactor likely accommodates additional logic in the `ReceiverSignature` method.
2026-06-09 13:32:38 +02:00
a22ec7a7d3 Enhance signature management functionality
Added a new button in `EnvelopeViewer.razor` for creating or modifying signatures, with dynamic styling and tooltips based on the signature state. Enhanced `OpenSignaturePopup` and `OnPopupShownAsync` methods to preload and display existing signatures in the popup and canvas.

Introduced new "success" button styles in `envelope-viewer.css` for better visual feedback. Added `loadExistingSignature` function in `receiver-signature.js` to render existing signatures on the canvas and updated the public API to expose this functionality.
2026-06-09 11:55:56 +02:00
f4681f85e7 Add signature caching and logging to EnvelopeViewer
Introduced `SignatureCacheService` and `ILogger<EnvelopeViewer>` to enable caching and logging functionality. Added logic to load cached signatures when available, bypassing the signature popup. Implemented asynchronous, fire-and-forget caching of captured signatures, with error handling to ignore cache failures. Updated signature handling to integrate with the caching mechanism, improving user experience and performance.
2026-06-09 11:14:49 +02:00
0ed4a44df0 Refactor services and add configuration options
Replaced scoped services from the `EnvelopeGenerator.ReceiverUI.Services` namespace with their counterparts without the namespace prefix. Added a new `SignatureCacheService` and updated `AppVersionService` to use the non-namespaced version.

Added `builder.RootComponents.Add<HeadOutlet>("head::after");` to register a root component. Introduced configuration binding for `ApiOptions` and `PdfViewerOptions`.

DevExpress components for reporting and PDF viewing remain unchanged, with additional configuration for `DevExpressBlazorReportingWebAssembly` included.
2026-06-09 11:11:16 +02:00
b8926f25c4 Update CacheController and SignatureCacheRequest
- Added `using EnvelopeGenerator.API.Extensions;` for utilities.
- Changed `SignatureCacheKeyPrefix` to a new prefix value.
- Added `[Authorize(Policy = AuthPolicy.Receiver)]` to methods.
- Used `[FromRoute]` for `envelopeKey` in route-bound methods.
- Updated cache key logic to use `User.ReceiverSignature`.
- Made `DataUrl`, `FullName`, and `Place` required in `SignatureCacheRequest`.
- Set default value (`null`) for `Position` in `SignatureCacheRequest`.
2026-06-09 10:59:13 +02:00
5b220932d3 Refactor claim handling and simplify controllers
Refactored multiple controllers (`AnnotationController`,
`DocumentController`, `ReadOnlyController`, and
`SignatureController`) to use updated claim extension methods
(`ReceiverSignature`, `EnvelopeUuid`, etc.), replacing older,
verbose methods for improved readability and consistency.

Removed the `EnvelopeClaimTypes` class and replaced claim type
constants with `EnvelopeClaimNames`. Simplified claim retrieval
logic in `ReceiverClaimExtensions` by consolidating methods and
removing redundant or unused functionality.

Eliminated the `SignInEnvelopeAsync` method, indicating a shift
away from manual claim management. Performed general cleanup,
including removing obsolete code and improving exception
messages for better debugging context.
2026-06-09 10:54:38 +02:00
50c02314ef Add SignatureCacheService for managing cached signatures
Introduced a new `SignatureCacheService` class to handle
cached signatures via API interactions. This includes methods
for saving, retrieving, and deleting signatures using `HttpClient`.

- Added dependency injection for `HttpClient` and `IOptions<ApiOptions>`.
- Implemented `SaveSignatureAsync`, `GetSignatureAsync`, and
  `DeleteSignatureAsync` methods with error handling.
- Utilized `Uri.EscapeDataString` for safe URL encoding.
- Added support for HTTP operations with `System.Net.Http.Json`.
2026-06-09 09:50:50 +02:00
223bb88f54 Add CacheController and caching support for signatures
Introduced a new `CacheController` to manage cached data for
receiver signatures using distributed caching. Added endpoints
to save, retrieve, and delete cached signatures.

Created a `SignatureCacheRequest` model for caching payloads
and a `CacheOptions` class to configure cache settings,
including optional expiration. Updated `Program.cs` to bind
`CacheOptions` to the `Cache` section in `appsettings.json`.

Added a new `Cache` section in `appsettings.json` with a
`SignatureCacheExpiration` property, defaulting to `null`
(no expiration).
2026-06-08 17:14:08 +02:00
38f4da00da Add new properties to Signature class for database mapping
Added four new properties (`FullName`, `Position`, `Place`, and
`Ink`) to the `Signature` class. Each property is annotated with
the `[Column]` attribute to map to corresponding database columns
(`FULL_NAME`, `POSITION`, `PLACE`, and `INK`). The properties
support nullable values based on the `nullable` directive,
ensuring compatibility with nullable reference types. These
changes enhance the `Signature` class by enabling additional
data storage and retrieval.
2026-06-08 17:13:22 +02:00
120485ee8d Refactor signature handling with SignatureCaptureDto
Introduced a new `SignatureCaptureDto` model to encapsulate
signature-related data and metadata, replacing the previous
`SignatureCapture` type in `EnvelopeViewer.razor`.

- Added `SignatureCaptureDto` in `SignatureCaptureDto.cs` with
  properties for signature image, signer name, position, and place.
- Updated `_capturedSignature` to use `SignatureCaptureDto` for
  consistency and maintainability.
- Refactored signature capture logic to initialize
  `SignatureCaptureDto` using object initializer syntax.
- Improved code clarity with detailed XML documentation for
  `SignatureCaptureDto`.

These changes enhance maintainability, readability, and ensure
a centralized model for signature-related data.
2026-06-08 15:49:52 +02:00
ee3a142af0 Refactor signature model; update EnvelopeViewer UI
Refactored `_capturedSignature` to `SignatureCaptureDto`, a
sealed record with required and optional properties for better
type safety and clarity. Updated components to use the new
model and demonstrated initialization with object initializers.

Enhanced `EnvelopeViewer` with modern UI features, including
HiDPI/Retina support, configurable zoom options, smooth zoom
transitions, and improved thumbnail sidebar functionality.

Updated `Applied Signature` HTML overlay to support dynamic
positioning for rendering signatures at specific coordinates.

Revised documentation in `COPILOT_CONTEXT_EN.md` to reflect
changes in the signature data structure and usage. Noted that
current implementation provides visual overlays only, with
future consideration for actual PDF stamping using PSPDFKit.
2026-06-08 15:47:54 +02:00
17e2de7f45 Update project version to 1.4.1
Updated the NuGet package version from 1.4.0 to 1.4.1 to reflect a minor update or patch release.
Aligned `<AssemblyVersion>` and `<FileVersion>` to 1.4.1.0 for consistency with the new version.
2026-06-08 13:19:34 +02:00
de60bd239d Add reset button to PDF toolbar for signature reset
Added a reset button to the PDF toolbar in `EnvelopeViewer.razor`
to allow users to reset all signatures and state. The button is
conditionally displayed when there are signed signatures
(`_signedSignatures > 0`).

Implemented the `RestartSigning` method to reload the page and
reset all signatures by navigating to the current URI with
`forceLoad: true`.

Introduced new styles in `envelope-viewer.css` for the reset
button, including hover effects, background gradients, border
colors, and transitions for a polished user experience.

Updated the reset button to include an SVG icon with hover
effects for better visual feedback and consistency with the
application's design.
2026-06-08 13:18:52 +02:00
52e5fce7fd Update project versions to 1.4.0 for new release
Updated version numbers in `EnvelopeGenerator.API.csproj`
from 1.3.1 to 1.4.0, including `<Version>`, `<FileVersion>`,
and `<AssemblyVersion>`.

Updated version numbers in `EnvelopeGenerator.ReceiverUI.csproj`
from 1.3.0 to 1.4.0, including `<Version>`, `<AssemblyVersion>`,
and `<FileVersion>`.

Adjusted copyright year in `EnvelopeGenerator.ReceiverUI.csproj`
from 2026 to 2025 to align with the release timeline.
2026-06-08 13:09:44 +02:00
e319d4e833 Use versioned URLs for static assets
Updated `EnvelopeViewer.razor` to use versioned URLs for CSS and JS files via the new `AppVersionService`, enabling cache busting.

Introduced `AppVersionService` to generate versioned URLs based on the application version retrieved from assembly metadata.

Registered `AppVersionService` as a singleton in `Program.cs` for dependency injection.
2026-06-08 12:12:57 +02:00
9aa01f8e9a Add new route and redirection for PDF.js viewer
Introduce a new route `/report-viewer/{EnvelopeKey}` alongside the existing `/receiver/{EnvelopeKey}`. Add redirection logic in `OnInitializedAsync` to navigate to `/envelope/{key}` for the new PDF.js viewer if `EnvelopeKey` is provided. Ensure this redirection takes precedence over the envelope access check.
2026-06-08 11:51:54 +02:00
9535c7dd6b Improve signature scaling and responsiveness in PDF viewer
Reduced delay in `OnZoomChanged` to improve responsiveness when rendering signature buttons. Added calls to `RenderSignatureButtonsAsync` in zoom-related methods to ensure signature overlays update dynamically.

Refactored `pdf-viewer.js` to introduce `appliedSignatureElements` for better management of applied signatures. Added `scaleAppliedSignature` and `updateAppliedSignaturePositions` methods to dynamically scale and position applied signatures based on zoom level and page.

Enhanced signature button rendering by scaling dimensions (width, height, font size, icon size) proportionally with zoom. Added attributes to store base values for applied signature containers to facilitate scaling.

Improved handling of applied signatures to ensure proper scaling, positioning, and visibility during zoom and page navigation. These changes enhance user experience and maintain consistency across zoom levels.
2026-06-08 11:39:17 +02:00
63b47ddbf2 Adjust layout sizing for better flexibility and spacing
Removed `max-width` constraints from `body.resizing` to allow more flexible layouts. Updated `width` properties in `body.resizing` and `.pdf-frame` to slightly increase their sizes, improving space utilization. These changes refine the design to better align with the intended user interface behavior.
2026-06-08 10:08:49 +02:00
f6c7918fc3 Remove itext dependency from project
The `<PackageReference Include="itext" Version="8.0.5" />` was removed from `EnvelopeGenerator.ReceiverUI.csproj`. This change indicates that the project no longer relies on the `itext` library, which is typically used for PDF generation and manipulation.
2026-06-08 09:53:09 +02:00
0aeeacc291 Update documentation and outline cross-page nav task
Updated `COPILOT_CONTEXT_TR.md` to provide detailed documentation for the `EnvelopeGenerator` project, including its purpose, structure, key components, and workflows. Added a comprehensive explanation of the `AnnotationDto` coordinate system and documented the resolution of a critical signature positioning bug.

Documented an open task in `OPEN_TASK.md` for implementing cross-page signature navigation in `EnvelopeViewer.razor`. Highlighted issues with the counter and navigation logic, provided a detailed specification for expected behavior, and proposed a step-by-step implementation strategy with JavaScript code snippets. Marked the task as "Failed" due to prior regressions, with instructions to revert and fix.
2026-06-08 09:39:32 +02:00
4fdbbc832f Refactor EnvelopeViewer layout and improve UI details
The `<div class="envelope-action-bar__inner">` layout was updated to use a column-based structure for better alignment and spacing. Title and sender details now include additional information such as the sender's full name, email, and the envelope's added date.

Badges for receiver name, signature count, access code, and 2FA were visually refined with smaller padding, font sizes, and resized SVG icons. A new section was added to display public and private messages with distinct styles and icons.

The logout button's placement was adjusted to fit the new layout. Minor spacing, padding, and alignment adjustments were made throughout the component for a cleaner and more consistent design.
2026-06-08 09:28:17 +02:00
dbe1ad3b53 Enhance EnvelopeViewer UI and integrate receiver data
Updated the `EnvelopeViewer` component to improve the user interface and functionality:
- Added `EnvelopeReceiverService` injection to fetch receiver data.
- Redesigned `envelope-action-bar` for better alignment and responsiveness.
- Displayed dynamic document title and compact badges for receiver info, sender name, signature count, and security features (e.g., access code, 2FA).
- Refactored logout button styling and `envelope-content` layout.
- Introduced `_envelopeReceiver` field and updated `SignatureService.GetAsync` to fetch receiver data.
- Added debugging logs for loaded signatures.
- Added fields for managing signature navigation state.
2026-06-08 08:48:59 +02:00
0b15496adb Update navigation path after successful login
Updated the navigation path in `Login.razor` to redirect to `/envelope/{EnvelopeKey}` instead of `/receiver/{EnvelopeKey}`. This change aligns with the updated routing structure and ensures proper redirection after a successful login.
2026-06-08 00:45:39 +02:00
6d9b4d98ae Add envelope access check and update thumbnail width
Updated `MaxThumbnailWidth` to 400 in `EnvelopeViewer.razor`.
Added an authentication check using `AuthService.CheckEnvelopeAccessAsync`
to ensure users have access to the envelope. Redirects unauthorized
users to a login page with the `EnvelopeKey` in the URL. The check
is performed before fetching the document via `DocumentService`.
2026-06-08 00:45:26 +02:00
334fc35b26 Remove OPEN_TASK.md from SolutionItems in src project
The `OPEN_TASK.md` file was removed from the `SolutionItems`
section of the `src` project in the `EnvelopeGenerator.sln`
solution file. This change ensures the file is no longer
tracked as part of the solution.
2026-06-08 00:38:08 +02:00
28b8bebe61 Add logout functionality to EnvelopeViewer
Added dependency injection for `AuthService` to enable authentication-related operations. Introduced a logout button in the UI, conditionally displayed when `EnvelopeKey` is valid, with a spinner and SVG icon for better UX.

Implemented the `LogoutAsync` method to handle the logout process, ensuring no concurrent logouts and redirecting the user to the login page. Added `_isLoggingOut` to manage logout state. Updated `OnInitializedAsync` for better error handling when `EnvelopeKey` is missing.
2026-06-08 00:37:30 +02:00
656fc97e74 Enhance signature navigation with current index display
Added functionality to display the current signature index in the
signature counter UI in `EnvelopeViewer.razor`, including a new
state variable `_currentSignatureIndex` to track the currently
viewed signature. Updated the logic to fetch and set this value
from the `SignatureNavState` object provided by the JavaScript
runtime.

Modified `pdf-viewer.js` to calculate the current signature index
based on the last viewed signature ID (`_lastViewedSignatureId`)
and return it as part of the `SignatureNavState`. This replaces
the previously hardcoded `signed` value.

These changes improve the user experience by providing a clear
indication of the currently viewed signature in the navigation UI.
2026-06-08 00:23:25 +02:00
6da68cdc86 Improve signature navigation logic and comments
Updated `getSignatureNavState`, `goToNextSignature`, and
`goToPreviousSignature` methods to enhance code readability
by improving comments and clarifying logic. Fixed a minor bug
in `goToPreviousSignature` where the wrong variable (`lastSig`)
was used for page navigation, replacing it with the correct
variable (`prevSignature`). Ensured `_lastViewedSignatureId`
is updated correctly in navigation methods. No significant
functional changes were introduced.
2026-06-08 00:13:26 +02:00
5bed9c932f Enable infinite signature navigation and improve button logic
Updated the `disabled` attribute logic in `EnvelopeViewer.razor`
to ensure navigation buttons are always active when signatures
exist. Modified `pdf-viewer.js` to enable infinite looping for
signature navigation, allowing users to cycle between the first
and last signatures seamlessly. Adjusted `canGoPrev` and
`canGoNext` properties to depend on the total number of
signatures, ensuring navigation is always enabled when
signatures are present.
2026-06-08 00:00:03 +02:00
7a7fc2f903 Improve signature navigation and toolbar functionality
Enhanced signature navigation logic to track the last viewed signature (`_lastViewedSignatureId`) and enable cross-page navigation. Updated next/previous navigation to handle both signed and unsigned signatures, with automatic page changes and scrolling to the relevant element.

Added a signature counter to the toolbar, displaying total, signed, and unsigned counts. Improved `renderSignatureButtons()` to filter out applied signatures and updated `clearSignatureButtons()` to manage visibility based on the current page.

Integrated Blazor callbacks (`OnPageChangedBySignatureNav()` and `OnSignatureNavChanged`) for UI updates. Fixed visibility issues where applied signatures appeared on incorrect pages.
2026-06-07 23:36:43 +02:00
2cea284a9d Improve signature navigation and rendering stability
Enhanced signature navigation and rendering logic in `pdf-viewer.js`:
- Added `_renderLock` to prevent concurrent page renders.
- Refactored `renderPage` and `queueRenderPage` for stability.
- Updated `goToNextSignature` to support cross-page navigation.
- Filtered out applied signatures during rendering and navigation.
- Improved handling of applied signatures visibility per page.

Updated `EnvelopeViewer.razor`:
- Added `OnPageChangedBySignatureNav` to handle page changes triggered by signature navigation.

Improved code readability, added comments, and removed outdated logic to ensure smooth transitions and better user experience.
2026-06-07 23:28:50 +02:00
c76ddb7123 Refactor getSignatureNavState for robustness
Updated `getSignatureNavState` to handle cases where the global signature list (`_allSignatures`) is unavailable or empty by introducing an early return with a default state.

Revised the logic to calculate `total`, `signed`, and `unsigned` using the global signature list, simplifying the `currentIndex` calculation to use the `signed` count. Updated `canGoPrev` and `canGoNext` to reflect the presence of signed or unsigned signatures.

Removed outdated logic relying on `signatureButtons` and added Turkish comments to clarify the new implementation.
2026-06-07 17:24:48 +02:00
80690d3d54 Update documentation and solution file for INCHES unit
Updated `COPILOT_CONTEXT_EN.md` to reflect the correct
coordinate system unit (INCHES) and added conversion
formulas for various systems. Corrected XML documentation
in `SignatureDto.cs`, `AnnotationDto.cs`, and
`AnnotationCreateDto.cs` to specify INCHES as the unit
and removed outdated references to DevExpress units.

Added `OPEN_TASK.md` to the solution file to track it
under `SolutionItems`. Removed incomplete task details
from `OPEN_TASK_SESSION_12.md`.

Provided additional context for future updates, including
database schema details and unit conversion references.
Documented completed changes for Session 12, such as
adding `SignatureService` to DI and fixing YARP routes.
2026-06-07 16:19:47 +02:00
465986b527 Fix cross-page signature navigation and counter logic
The commit implements cross-page navigation for signatures in the `EnvelopeViewer.razor` component. Users can now navigate between signatures across pages using "Next Signature" and "Previous Signature" buttons.

Key changes:
- Fixed `getSignatureNavState()` to correctly calculate total, signed, and unsigned signatures globally.
- Updated `goToNextSignature()` to navigate to the next unsigned signature, including automatic page changes and scrolling.
- Updated `goToPreviousSignature()` to navigate to the last signed signature, including automatic page changes and scrolling.
- Ensured navigation buttons are properly disabled when no further navigation is possible.

The toolbar design remains unchanged, as requested. These changes address issues caused by a previous implementation that broke the counter and navigation functionality.
2026-06-07 16:15:32 +02:00
09ff237ecc Add signature navigation to PDF viewer toolbar
This commit introduces a signature navigation feature in the PDF viewer:
- Removed zoom preset buttons to make space for the new toolbar.
- Added "Previous" and "Next" buttons for navigating signatures.
- Displayed a signature counter with signed/total signatures and a badge for unsigned signatures or completion status.
- Introduced state variables (`_totalSignatures`, `_signedSignatures`, `_unsignedSignatures`) to track signature progress.
- Implemented methods for navigating signatures (`GoToPreviousSignature`, `GoToNextSignature`, `UpdateSignatureCounterAsync`).
- Enhanced JavaScript with `getSignatureNavState`, `goToNextSignature`, and `goToPreviousSignature` for navigation logic.
- Updated CSS for the toolbar and signature navigation, including responsive adjustments and hover effects.
- Improved error handling during signature counter updates.
- Updated `RenderSignatureButtonsAsync` to refresh the signature counter after rendering.

These changes improve the user experience by enabling efficient navigation and tracking of signatures in the PDF viewer.
2026-06-07 14:55:41 +02:00
3f52858fe9 Add signature overlay workflow to PDF.js viewer
Implemented a complete client-side workflow for creating, applying, and displaying visual signature overlays on the PDF canvas.

- Added "Unterschreiben" buttons with modern styling (purple gradient, hover effects) to apply signatures.
- Introduced a signature creation popup (DxPopup) with Draw, Text, and Image tabs, including validation for required fields (Name, Place).
- Rendered German-style signature overlays with image, separator line, and text (Name, Position, Place, Date in dd.MM.yyyy format).
- Ensured automatic re-rendering of overlays on page load, zoom, and page changes.
- Added `escapeHtml()` for XSS protection of user-provided text.
- Styled popup, canvas, and buttons with a modern, clean design.
- Suggested future enhancements for server-side stamping or integration with commercial PDF libraries.
2026-06-07 14:08:38 +02:00
ce43ace3c2 Refactor signature handling and add PDF signature support
Refactored `OnSignatureButtonClick` in `EnvelopeViewer.razor`:
- Converted to async and added null-check for `_capturedSignature`.
- Integrated `pdfViewer.applySignature` to apply signatures to PDFs.

Added `applySignature` method to `pdf-viewer.js`:
- Handles rendering of signatures with image, metadata, and styling.
- Follows German standards for signature formatting.
- Includes error handling for missing elements.

Introduced `escapeHtml` helper in `pdf-viewer.js` to prevent XSS.
Updated `MaxThumbnailWidth` in `EnvelopeViewer.razor` to 400.
Enhanced logging for better debugging during signature application.
2026-06-07 13:47:34 +02:00
9523766678 Add signature creation popup with multiple input methods
Introduced a `DxPopup` for signature creation in `EnvelopeViewer.razor`, supporting three input methods: drawing, text, and image upload.

- Added `receiver-signature.js` for signature handling via JavaScript interop.
- Implemented tab-based UI for switching between signature methods.
- Added validation for required fields (e.g., full name, place).
- Enhanced text signature customization with font selection and dynamic rendering.
- Introduced state management for signature input and popup visibility.
- Added methods for initializing, clearing, and saving signatures.
- Styled the popup for a user-friendly experience and added error messages.
- Configured the popup to open automatically on page load or button click.

This feature improves the user experience by providing a flexible and intuitive way to create signatures.
2026-06-07 13:38:12 +02:00
382aafc186 Remove OPEN_TASK_SESSION_12.md from SolutionItems
The file `OPEN_TASK_SESSION_12.md` was removed from the
`SolutionItems` section of the `src` project in the
`EnvelopeGenerator.sln` solution file. This change ensures
that the file is no longer tracked as part of the solution.
2026-06-07 13:20:35 +02:00
45bb982414 Add client-side signature overlay system documentation
Documented the new client-side signature overlay system for
EnvelopeViewer, replacing iText7 due to GPL license issues.
Outlined the signature data structure in C# and JavaScript,
and described the workflow steps for creating, applying,
and displaying signatures as visual overlays.

Added a "Future Enhancement Required" section suggesting
commercial PDF libraries or server-side stamping for future
improvements.
2026-06-07 13:19:35 +02:00
3123102244 Update button label text for German localization
The text content of a `div` element in `pdf-viewer.js` was updated from "Sign" to "Unterschreiben" to support German localization. This change improves the user interface for German-speaking users by providing a translated label.
2026-06-07 12:55:32 +02:00
89fb6f1452 Add interactive signature buttons to PDF viewer
Implemented a new feature to render clickable "Sign" buttons on the PDF canvas at signature field positions fetched from the database.

- Updated `EnvelopeViewer.razor` to fetch signature data, convert coordinates from inches to points, and invoke JavaScript for rendering.
- Added `renderSignatureButtons` and `clearSignatureButtons` functions in `pdf-viewer.js` to dynamically create and position buttons based on page and zoom level.
- Modified HTML to include a new `#pdf-signature-layer` overlay for buttons.
- Styled buttons with a purple gradient, hover/active effects, and focus outlines for accessibility.
- Defined rendering triggers for initial load, page changes, and zoom changes.
- Documented coordinate conversion flow from inches to points to pixels for accurate positioning.
- Enhanced accessibility with `tabindex="0"`, focus outlines, and semantic `<button>` elements.
2026-06-07 12:55:21 +02:00
2f73e4f6da Add interactive signature buttons to PDF viewer
Introduced functionality to render interactive signature buttons on the PDF viewer. Added support for fetching and displaying signature data (`SignatureDto`) dynamically based on the current page.

- Added `@using` directives in `EnvelopeViewer.razor` for required namespaces.
- Introduced `_signatures` field to store signature data.
- Updated `OnInitializedAsync` to fetch and process signatures.
- Implemented `RenderSignatureButtonsAsync` to dynamically render buttons.
- Added `[JSInvokable]` method `OnSignatureButtonClick` for button events.
- Updated CSS to style `pdf-signature-layer` and `signature-button`.
- Enhanced `pdf-viewer.js` with methods to render and clear buttons.
- Ensured buttons respond to zoom and page navigation changes.
- Added error handling and logging for signature rendering.

These changes improve user interaction by enabling signing functionality directly on the PDF viewer.
2026-06-07 12:43:36 +02:00
b888c85937 Add SignatureDtoExtensions with Convert<T> method
Introduce a new static class `SignatureDtoExtensions` that adds
a `Convert<T>` extension method for collections of `SignatureDto`
objects. This method converts all `SignatureDto` instances in a
collection to a specified `UnitOfLength`, modifying them in place
and returning the same collection.

The method includes:
- A generic constraint to support any `IEnumerable<SignatureDto>`.
- Null checks to ensure the collection is not null.
- Comprehensive XML documentation with usage examples and notes.
2026-06-07 11:07:49 +02:00
db70bbcebf Add UnitOfLength enum and enhance SignatureDto immutability
Introduced the `UnitOfLength` enum to represent measurement units
(Inch and Point) for signature positioning, with detailed
documentation and conversion logic.

Updated `SignatureDto` to use `init` accessors for immutability,
added backing fields for `X` and `Y` with conversion support, and
introduced the `Factor` property to handle unit conversions.

Added a `Convert` method to enable switching between units of
length and improved extensibility for future `SenderAppType`
support. Enhanced code readability and maintainability with
detailed comments and remarks.
2026-06-07 10:17:42 +02:00
6d6e14fcb7 Add SenderAppType enum and integrate into SignatureDto
A new `SenderAppType` enum was introduced in the
`EnvelopeGenerator.ReceiverUI.Models.Constants` namespace, with
values `LegacyFormApp` and `ReceiverUIBlazorApp`.

The `SignatureDto` class was updated to include a new property of
type `SenderAppType`, enabling the specification of the sender
application type for a signature.

Additionally, a `using` directive for the
`EnvelopeGenerator.ReceiverUI.Models.Constants` namespace was added
to `SignatureDto.cs` to support the use of the new enum.
2026-06-06 21:23:43 +02:00
e6f12f0c68 Add SenderAppType property to SignatureDto
Updated the `using` directives in `SignatureDto.cs` to include the `EnvelopeGenerator.Domain.Constants` namespace and reordered the existing namespaces. Added a new `SenderAppType` property to the `SignatureDto` class, with a default value of `SenderAppType.LegacyFormApp`.
2026-06-06 21:23:06 +02:00
7e2631cb21 Add SenderAppType enum to represent sender application types
A new namespace `EnvelopeGenerator.Domain.Constants` was added,
containing the `SenderAppType` enumeration. This enum defines
two members: `LegacyFormApp` (0) and `ReceiverUIBlazorApp` (1).
The addition improves type safety and maintainability by
providing a structured way to differentiate between sender
application types.
2026-06-06 21:22:30 +02:00
34f145305c Standardize coordinate system to use INCHES
Updated the digital document signing system to use INCHES as the standard unit for annotations and signatures, aligning with GdPicture14's native format. Previously used DevExpress units (1/100 inch) and other formats have been replaced.

- Updated `AnnotationDto` to reflect the new coordinate system.
- Introduced `SignatureDto` for signature positions, deprecating `AnnotationDto`.
- Added conversion formulas for transforming coordinates between INCHES and other systems (DevExpress, PDF Points, PDF.js, etc.).
- Added a unit comparison table and A4 page dimensions in various units.
- Introduced a new read-only PDF.js viewer for envelopes (`/envelope/{EnvelopeKey}`).

These changes improve consistency, simplify conversions, and align with modern tools like PSPDFKit and iText7.
2026-06-06 21:21:12 +02:00
a3b104cd78 Add OPEN_TASK_SESSION_12.md to src project in solution
Added a new solution item `OPEN_TASK_SESSION_12.md` to the
`src` project section in the `EnvelopeGenerator.sln` file.
This was included under the `SolutionItems` subsection of
the `src` project.
2026-06-06 21:00:24 +02:00
53004504bd Update coordinate system documentation to INCHES
Updated documentation and code comments to reflect INCHES as the
coordinate unit instead of 1/100 inch. Replaced special characters
causing issues with proper symbols (e.g., `—`, `≈`, `→`).

- Updated VB.NET code snippet to clarify INCHES usage.
- Revised `COPILOT_CONTEXT_EN.md` with updated formulas, unit
  comparison tables, and database storage format details.
- Corrected XML documentation for `SignatureDto` and `AnnotationDto`
  in C# to reflect INCHES as the unit.
- Clarified database schema documentation for coordinate fields.
- Improved unit conversion quick reference with accurate formulas.
- Added A4 page dimensions reference in multiple units.
- Marked completed tasks in "Session 12 Changes Already Completed"
  with detailed descriptions.
2026-06-06 19:55:57 +02:00
cdc53c0bf7 Fix coordinate unit documentation to use INCHES
Updated documentation and code comments to reflect that the
coordinate system uses INCHES (not 1/100 inch or DX units).

- Updated `COPILOT_CONTEXT_EN.md`:
  - Clarified database stores coordinates in INCHES.
  - Added conversion formulas and unit comparison table.
  - Renamed section to `SignatureDto / AnnotationDto`.

- Updated XML documentation in C# files:
  - `SignatureDto.cs`: Added XML comments for INCHES-based coordinates.
  - `AnnotationDto.cs`: Corrected unit description and added conversions.
  - `AnnotationCreateDto.cs`: Fixed `X` and `Y` property comments.

- Verified VB.NET source (`frmFieldEditor.vb`) as the unit reference.
- Added quick reference for unit conversions across systems.
2026-06-06 19:53:11 +02:00
2f1777af4a Add routes for receiver-ui and register SignatureService
Expanded `yarp.json` with new routes for the `receiver-ui` cluster to handle paths for `appsettings.json`, `appsettings.Development.json`, styles, fonts, and images. These routes specify HTTP methods and execution order.

Registered `SignatureService` as a scoped dependency in `Program.cs` to support new functionality related to handling signatures.
2026-06-06 19:27:44 +02:00
dec2b81afe Refactor to use SignatureDto and SignatureService
Replaced AnnotationDto and AnnotationService with SignatureDto
and SignatureService for handling signature data. Marked
AnnotationDto and AnnotationService as obsolete.

Added the SignatureDto class to represent signature data and
introduced the SignatureService class to fetch signature data
from the API. Updated EnvelopeViewer.razor to use
SignatureService, replacing AnnotationService, and added a
debug log for retrieved signatures.

Performed general refactoring to align with the new signature
data model and functionality.
2026-06-06 19:14:42 +02:00
11a5012ab7 Refactor: Move GetAnnotsOfReceiver to SignatureController
The `GetAnnotsOfReceiver` method was removed from the `AnnotationController` class and moved to a newly introduced `SignatureController` class. The `SignatureController` is now a dedicated controller for handling signature-related endpoints, decorated with `[ApiController]` and `[Route("api/[controller]")]`.

The method's implementation remains largely unchanged, retaining its logic for retrieving and filtering signatures for a specific receiver. Dependency injection for `IMediator` was added to the `SignatureController` to handle the `ReadDocumentQuery`.

Additional `using` directives were added to `SignatureController.cs` to include necessary namespaces. A `TODO` comment remains in the method, indicating potential future updates.
2026-06-06 18:31:04 +02:00
b9efc75d4f Add nullable Annotations property to SignatureDto
A new property `Annotations` of type `IEnumerable<AnnotationDto>?`
was added to the `SignatureDto` class. This property includes a
getter and setter, allowing the class to manage a collection of
annotations. The property is nullable, enabling it to hold a
`null` value if no annotations are present.
2026-06-06 18:25:46 +02:00
8dc561cb8f Refactor query to include related document data
Refactored the `Handle` method in `ReadDocumentQueryHandler` to
eagerly load related data (`Elements` and `Annotations`) using
`Include` and `ThenInclude`. Introduced a reusable `docQuery`
variable to reduce code duplication and ensure consistency in
queries for both `query.Id` and `query.EnvelopeId`. No changes
were made to the mapping logic or exception handling.
2026-06-06 18:07:31 +02:00
76ce8a44b3 Add GetAnnotsOfReceiver method to AnnotationController
Introduced the `GetAnnotsOfReceiver` method in `AnnotationController` to handle HTTP GET requests for retrieving receiver-specific annotations. The method enforces authorization using the `Receiver` policy, fetches the document via a mediator query, and filters signatures based on the current receiver. Returns appropriate HTTP responses for empty documents or missing signatures.

Added new `using` directives for required dependencies and reorganized imports for better readability. Included a `TODO` comment for potential future updates.
2026-06-06 18:07:03 +02:00
e52972ee9b Add ReceiverId claim handling to ReceiverClaimExtensions
Updated ReceiverClaimExtensions to include a new array,
`ReceiverIdClaimTypes`, for receiver ID claim types. Added
`GetReceiverIdOfReceiver` method to retrieve and validate
receiver ID claims. Modified the exception message in
`GetEnvelopeIdOfReceiver` to use a string literal for
clarity.
2026-06-06 18:06:20 +02:00
17ee715b46 Expand and restructure ReverseProxy routes
Added new routes to the `ReverseProxy` configuration, including
`receiver-ui-login`, `receiver-ui-sender`, `receiver-ui-envelope`,
and others to handle specific paths, HTTP methods, and transformations.

Removed outdated routes such as `receiver-ui-static-assets` and
`receiver-ui-annotation-fake` to streamline the configuration.

Introduced transformations for response headers (e.g., `Cache-Control`)
and updated `auth-login` and `auth-envelope-receiver-login` routes
with new path patterns and query parameters.

Reorganized `receiver-ui` cluster routes to better handle static
assets (CSS, JS, Blazor framework, and content) and fake data.
2026-06-06 18:05:53 +02:00
6d8cecc20b Improve logging and text layer scaling
Removed unnecessary console output for non-critical features, including `console.log`, `console.warn`, and `console.error` statements in `setQualityOptions`, `renderTextLayer`, and `renderThumbnail` methods. This reduces noise in production logs.

Added a CSS variable `--scale-factor` to the text layer's `style` in `renderTextLayer` to ensure proper scaling and improve text rendering accuracy. These changes enhance code cleanliness and robustness.
2026-06-06 16:25:07 +02:00
d32050ce03 Add text layer support for PDF rendering and selection
Integrated PDF.js to enable text selection and copy-paste functionality in the PDF viewer. Updated `EnvelopeViewer.razor` to include the necessary scripts and styles, and modified the HTML structure to add a text layer container.

Enhanced `envelope-viewer.css` with styles for the text layer and optimized canvas rendering. Added a `renderTextLayer` method in `pdf-viewer.js` to extract and render text content from PDF pages. Updated the rendering process to overlay the text layer on the canvas.
2026-06-06 16:13:32 +02:00
fc267e1eb4 Improve PDF toolbar layout and rendering logic
Updated `envelope-viewer.css` to enhance the layout and responsiveness of the PDF toolbar:
- Adjusted padding, gap, width, and alignment for better usability.
- Improved zoom section and slider styles for flexibility and consistency.

Enhanced `pdf-viewer.js` to handle concurrent rendering tasks:
- Added checks to prevent overlapping render tasks on the same canvas.
- Implemented error handling for rendering operations to ensure stability.

These changes improve the user experience and robustness of the PDF viewer.
2026-06-06 14:56:45 +02:00
86b821739a Add "Session" column and new entries to Mistakes History
Enhanced the "Mistakes History" table in `COPILOT_CONTEXT_EN.md`:
- Added a "Session" column to track when mistakes occurred.
- Updated table with session numbers for existing mistakes.
- Added new entries documenting recurring issues like over-engineering, ignoring revert instructions, and user feedback.
- Highlighted the importance of configurability and simplicity in design.
- Documented specific mistakes related to DevExpress and PDF.js.

These changes improve traceability, accountability, and alignment with user preferences.
2026-06-06 13:47:13 +02:00
0f5acb7cf5 Update PdfViewer settings in appsettings.json
Removed the `_comment` field from the `PdfViewer` section, which described the PDF Viewer Quality Settings.
Increased `ZoomTransitionDuration` from 150 to 900 to adjust zoom transition behavior, potentially improving user experience.
2026-06-06 13:37:33 +02:00
c4ef195e20 Enhance EnvelopeViewer with configurable quality options
Updated EnvelopeViewer to support configurable quality settings via `PdfViewerOptions` and `appsettings.json`. Added HiDPI/Retina support, smooth zoom transitions, and unlimited zoom with configurable step percentages. Introduced a resizable thumbnail sidebar with localStorage persistence. Simplified initialization and cleanup processes, and documented new features and architecture. Improved user experience and performance compared to the legacy ReportViewer.
2026-06-06 13:08:54 +02:00
0faf1fba7e Make zoom step percentage configurable
Added a `ZoomStepPercentage` property to `PdfViewerOptions` to allow configurable zoom step increments (1-50, default 5%). Updated `EnvelopeViewer.razor` to use this property for the zoom slider step. Modified `pdf-viewer.js` to apply the zoom step percentage for mouse wheel zoom, `zoomIn`, and `zoomOut` methods.

Included `ZoomStepPercentage` in `appsettings.json` and `setQualityOptions` for dynamic updates. Reduced `ZoomTransitionDuration` in `appsettings.json` from 900ms to 150ms for faster zoom transitions. These changes ensure consistent and customizable zoom behavior across the application.
2026-06-06 12:36:00 +02:00
139b92ed8c Add configurable PDF viewer options and improve rendering
Introduced `PdfViewerOptions` class to centralize PDF viewer
settings such as scaling, HiDPI support, zoom transitions,
and rendering delays. Bound these options to `appsettings.json`
for dynamic configuration.

Injected `PdfViewerOptions` into `EnvelopeViewer.razor` and
updated `OnInitializedAsync` to pass settings to JavaScript.
Replaced hardcoded values in `pdf-viewer.js` with configurable
options, improving maintainability and flexibility.

Enhanced rendering logic to respect HiDPI settings, maximum
DPR, and smooth zoom transitions. Improved thumbnail rendering
with configurable delays to optimize performance.
2026-06-06 12:15:48 +02:00
ca3b74f939 Improve PDF rendering quality and user experience
Added `image-rendering` properties and opacity transitions to `.pdf-canvas` for smoother visual effects during rendering. Introduced a `.pdf-canvas.rendering` class to indicate rendering state.

Enhanced `renderPage` method to support HiDPI displays by scaling the viewport based on device pixel ratio (up to 2) and setting both internal resolution and CSS display size for better rendering quality. Enabled high-quality rendering with `imageSmoothingEnabled` and `imageSmoothingQuality`.

Updated scroll container reference to `.pdf-canvas-wrapper` for proper alignment. Added logic to manage the `rendering` class during and after rendering, including error handling to ensure UI consistency. These changes improve both functionality and aesthetics of the PDF viewer.
2026-06-06 11:16:05 +02:00
a6014ae88c Improve PDF rendering quality and HiDPI support
Enhanced thumbnail rendering in `envelope-viewer.css` by adding `image-rendering` properties for better visual quality.

Updated `pdf-viewer.js` to support high-quality rendering with HiDPI support:
- Replaced fixed scale with dynamic scaling using `devicePixelRatio` (capped at 2x) and a base scale of 0.75.
- Adjusted canvas resolution to match scaled viewport dimensions.
- Removed inline canvas styles to delegate display size to CSS.
- Retained high-quality rendering settings for the canvas context.

These changes improve visual fidelity while maintaining performance.
2026-06-06 10:44:58 +02:00
4b5cdbfccd Improve PDF rendering quality and sharpness
Increased the scale for rendering PDF pages from 0.2 to 0.5 in the
`getViewport` method to enhance resolution and sharpness. Although
CSS scales the canvas down, the higher scale ensures better visual
quality.

Enabled high-quality rendering for the canvas context by setting
`ctx.imageSmoothingEnabled` to `true` and `ctx.imageSmoothingQuality`
to `'high'`, resulting in smoother and sharper PDF content rendering.
2026-06-06 01:17:54 +02:00
64068c9c29 Improve PDF thumbnail scaling and centering
Updated the `.pdf-thumbnail__canvas` CSS class to replace
`max-width`, `max-height`, and `display: block` with `width`,
`height`, `object-fit: contain`, and `object-position: center`.
These changes ensure the canvas fully occupies its container,
scales proportionally without cropping, and centers the content
for better visual consistency and usability.
2026-06-06 01:16:14 +02:00
b913d5a88a Make ToggleThumbnails method asynchronous
Refactor the `ToggleThumbnails` method to be asynchronous (`async Task`) to support asynchronous operations. Add logic to re-render thumbnails when toggled on, including forcing a UI update, waiting for DOM rendering, and invoking `RenderThumbnailsAsync`. These changes improve the user experience by ensuring thumbnails are properly updated when displayed.
2026-06-06 00:56:30 +02:00
51ea93200e Add thumbnail sidebar and resizable splitter to viewer
Enhanced EnvelopeViewer with a thumbnail sidebar for page previews and a resizable splitter (150px-400px range) for improved navigation. Updated layout to use a flexbox design for side-by-side thumbnails and PDF canvas.

Externalized CSS for maintainability and added responsive behavior for mobile devices. Improved Blazor lifecycle handling with `firstRender` checks and sequential thumbnail rendering. Addressed known issues like vertical alignment and infinite render loops.

Introduced localStorage persistence for user preferences and enhanced zoom/navigation interactivity with global mouse events.
2026-06-06 00:46:10 +02:00
9fa8ef29d8 Add resizable thumbnail sidebar to EnvelopeViewer
Introduced a resizable splitter for the PDF thumbnail sidebar, allowing users to dynamically adjust its width. Added `_thumbnailWidth` property with min/max constraints and implemented mouse event handlers (`OnSplitterMouseDown`, `OnSplitterMouseMove`, `OnSplitterMouseUp`) to manage resizing.

Integrated JavaScript interop to attach/detach resize event listeners and save user preferences to `localStorage`. Updated `pdf-viewer.js` to handle resizing state and cleanup. Styled the splitter in `envelope-viewer.css` with hover/active states and ensured smooth interaction.

Persisted thumbnail width across sessions and added error handling for `localStorage`. Enhanced user experience with intuitive resizing and improved UI flexibility.
2026-06-06 00:38:27 +02:00
fb02a1a359 Simplify PDF thumbnail sidebar UI
Removed the header section of the PDF thumbnail sidebar, including the title and close button, to streamline the UI. Updated Razor logic to control sidebar visibility directly, eliminating the need for `.pdf-thumbnails--visible`. Deleted associated CSS styles for the removed elements. Retained scrolling and padding styles for the thumbnail content.
2026-06-06 00:28:46 +02:00
bd6ff4e67e Refactor PDF viewer layout and improve responsiveness
Refactor the PDF thumbnail sidebar to use Razor logic for dynamic visibility control, removing reliance on CSS-based toggling. Updated the `pdf-thumbnails` layout to use `relative` positioning and improved its integration with the viewer structure. Introduced a new `pdf-canvas-wrapper` for better styling, scrolling, and alignment of the main PDF canvas.

Enhanced responsiveness by adjusting `pdf-thumbnails`, `pdf-thumbnails__content`, and `pdf-toolbar` styles for smaller screens. Deprecated the `pdf-thumbnails--visible` class and removed redundant CSS properties to simplify the codebase. Updated the `pdf-frame` layout to use a column-based flexbox for better alignment.

These changes improve maintainability, responsiveness, and the overall user experience of the `EnvelopeViewer` component.
2026-06-06 00:16:02 +02:00
c6d5656fce EnvelopeViewer updates and known issue documentation
Updated EnvelopeViewer with layout fixes, unlimited zoom, and thumbnail navigation. Added global mouse wheel zoom (`Ctrl+Wheel`) and retry logic for thumbnail rendering. Refactored layout for responsiveness and documented a critical issue causing a blank screen and infinite render loop. Proposed next steps for resolution and provided a temporary workaround using the legacy ReportViewer.
2026-06-06 00:03:01 +02:00
0282c8e5d3 Improve thumbnail rendering reliability and error handling
Added delays in `EnvelopeViewer.razor` to ensure the DOM is ready and to render thumbnails sequentially, preventing browser overload and keeping the UI responsive. Enhanced error handling in `RenderThumbnailsAsync` with detailed debug logs.

In `pdf-viewer.js`, introduced a retry mechanism to wait for canvas elements to appear in the DOM and added detailed error logging for missing canvases or PDF document issues. Replaced generic comments with specific error messages to improve debugging.

These changes enhance the robustness, reliability, and user experience of the PDF viewer.
2026-06-05 23:05:21 +02:00
6024f5c040 Add PDF thumbnail sidebar to EnvelopeViewer
Introduced a PDF thumbnail sidebar in `EnvelopeViewer.razor` to enhance navigation between pages. Added a toggle button to show/hide the sidebar and implemented dynamic thumbnail rendering for all pages.

Updated `envelope-viewer.css` with styles for the sidebar, including hover/active states, transitions, and mobile responsiveness.

Enhanced `pdf-viewer.js` with a `renderThumbnail` method to render page previews on canvas elements. Added error handling for non-critical thumbnail rendering issues.

Improved user experience by providing an intuitive way to preview and navigate PDF pages.
2026-06-05 21:16:15 +02:00
d9ab6b3eff Clean up debugging code and refine error handling
Removed unnecessary `console.log` statements from `pdf-viewer.js`
and `receiver-signature.js` to reduce console output in production.
Simplified error handling in `pdf-viewer.js` for better clarity,
including consolidating error logging and removing redundant
handling for `RenderingCancelledException`.

Deleted the `debugDumpViewerDom` function and its public API
reference from `receiver-signature.js` as part of a cleanup
effort to eliminate unused debugging utilities. Streamlined
code related to event listener management in `pdf-viewer.js`
while retaining core functionality.
2026-06-05 13:49:39 +02:00
c26ad9e1c2 Improve zoom control granularity and behavior
Updated the zoom slider in `EnvelopeViewer.razor` to allow finer adjustments by changing the step size from 25 to 1. Modified `pdf-viewer.js` to enable smoother zooming with 1% increments for `zoomIn` and `zoomOut` methods. Capped zoom levels between 0.5 and 3.0. Enhanced mouse wheel zoom behavior to adjust zoom in 1% steps and notify the .NET side of changes via `OnZoomChanged`. Ensured pages are re-rendered after each zoom adjustment.
2026-06-05 13:39:20 +02:00
76945c9051 Redesign PDF toolbar with enhanced functionality
The PDF toolbar in `EnvelopeViewer.razor` has been redesigned to improve usability and functionality. Key changes include:

- Added buttons for page navigation, zooming, and preset zoom levels.
- Introduced a zoom slider and page input field for direct control.
- Added "Fit to Width" and "Set Zoom to 100%" features.
- Updated `ZoomIn` and `ZoomOut` methods with boundary checks.
- Added new methods: `SetZoom`, `OnZoomSliderChanged`, `OnPageInputChanged`, and `FitToWidth`.

Styling updates in `envelope-viewer.css` include a modernized toolbar design with rounded corners, shadows, and responsive layouts for smaller screens.

`pdf-viewer.js` was updated with `setScale` and `fitToWidth` methods to support the new functionality. These changes enhance the interactivity, flexibility, and user experience of the PDF viewer.
2026-06-05 13:31:36 +02:00
34b620e749 Preserve scroll position during PDF page rendering
Added functionality to maintain the scroll position and viewport
center of the `.pdf-frame` container during PDF page rendering.
This ensures the user's view remains centered on the same content
after re-rendering, even if the canvas dimensions change.

Implemented logic to store the scroll position and viewport center
before rendering and restore them afterward using scaling factors
calculated from the canvas's old and new dimensions.
2026-06-05 12:55:23 +02:00
f7aaeccf58 Add EnvelopeViewer for read-only PDF viewing with PDF.js
Introduced a new EnvelopeViewer component (`EnvelopeViewer.razor`)
to replace the legacy ReportViewer for non-signing workflows.
The new viewer is based on PDF.js and provides a modern,
lightweight, and responsive user experience.

Added `pdf-viewer.js` to handle PDF rendering, zoom, pagination,
and mouse wheel control, integrated with Blazor via JSInterop.
Externalized styles to `envelope-viewer.css` with a modern
glassmorphism design.

Enhanced user experience with unlimited zoom, global mouse
wheel zoom (`Ctrl+Wheel`), and responsive design. Fixed issues
like scroll behavior and canvas size restrictions.

Updated `COPILOT_CONTEXT_EN.md` to document the new
EnvelopeViewer, its architecture, and its advantages over the
legacy ReportViewer. Added external dependencies for PDF.js
via CDN and updated project history to reflect these changes.
2026-06-05 12:52:23 +02:00
41f3df4c71 Enable Blazor-JS communication for PDF viewer zoom
Added `DotNetObjectReference` in `EnvelopeViewer.razor` to enable Blazor-JS communication. Updated `OnAfterRenderAsync` to pass the reference to `pdfViewer.initialize`. Introduced `[JSInvokable]` method `OnZoomChanged` to handle zoom updates from JavaScript.

Enhanced `DisposeAsync` to clean up resources, including disposing of the `.NET reference` and invoking a JavaScript `dispose` method.

In `pdf-viewer.js`, modified `initialize` to accept a `.NET reference` and added `attachWheelEvent` to handle zooming via mouse wheel with `Ctrl`/`Meta` key. Updated `dispose` to clean up event listeners and reset the `.NET reference`. Added `getScale` to retrieve the current zoom scale.

Improved resource cleanup and event handling to prevent memory leaks and ensure stability.
2026-06-05 12:36:59 +02:00
3539907054 Improve PDF viewer layout and styling
Updated `.pdf-viewer-container` to vertically center content by changing `align-items` to `center`. Adjusted `.pdf-frame` dimensions to use dynamic height and width, added a maximum width, and centered text alignment. Introduced rounded corners to the gradient bar with a `border-radius`. Changed `.pdf-canvas` to `inline-block` display with `vertical-align: top`. Further refined `.pdf-frame` layout with slightly different height and width calculations.
2026-06-05 11:47:05 +02:00
f1ebd47c77 Refactor EnvelopeViewer styles and add PDF support
Moved inline styles from `EnvelopeViewer.razor` to a new external
CSS file `envelope-viewer.css` for better maintainability and
separation of concerns. Added external JavaScript dependencies
(`pdf.js` and `pdf-viewer.js`) to enable PDF rendering.

Fixed encoding issues in error messages and improved the layout
structure with responsive design rules. Enhanced readability and
usability by organizing styles and ensuring proper localization
support.
2026-06-05 11:18:23 +02:00
6b051155c4 Refactor EnvelopeViewer: Remove PDF viewer init logic
Simplified the component by removing unnecessary debug output
and redundant comments. Removed the `OnAfterRenderAsync`
method, which previously handled PDF viewer initialization
and related JavaScript calls. This suggests the initialization
logic has been moved elsewhere or is no longer required in
this component.
2026-06-05 11:04:30 +02:00
e3bc439444 Add task management for PDF rendering operations
Introduced `currentRenderTask` to track and manage rendering tasks, ensuring only one task is active at a time. Added logic to cancel ongoing tasks before starting new ones, preventing conflicts and redundant rendering.

Enhanced error handling to gracefully manage `RenderingCancelledException` and allow rendering of pending pages. Improved logging for better debugging and insights into the rendering process. Ensured clean state management by resetting `currentRenderTask` after task completion or cancellation.
2026-06-05 10:40:09 +02:00
f4b78bce36 Add EnvelopeViewer for PDF rendering with pdf.js
Introduced a new Blazor component `EnvelopeViewer.razor` to display PDF documents with a user-friendly interface. The component supports dynamic routing via `/envelope/{EnvelopeKey}` and integrates the `pdf.js` library for efficient PDF rendering in the browser.

Key features include:
- Zoom and navigation controls (Next/Previous page, Zoom In/Out).
- Loading spinner, error handling, and fallback UI for robustness.
- Responsive design with modern styling using CSS.
- JavaScript interop via `pdf-viewer.js` for managing PDF rendering, scaling, and navigation.

Added lifecycle methods (`OnInitializedAsync`, `OnAfterRenderAsync`) for dynamic loading and rendering. Ensured asynchronous operations for smooth user interactions. Included a `DisposeAsync` method for cleanup.
2026-06-05 10:32:54 +02:00
d16a5020cb Update ForceToUseFakeDocument to false in appsettings.json
The `ForceToUseFakeDocument` property in the `Api` section of
`appsettings.json` was changed from `true` to `false`. This
modification alters the application's behavior to no longer
force the use of fake documents, potentially enabling the use
of real documents or other configurations as defined by the
application logic.
2026-06-05 10:26:50 +02:00
634043ebd9 Reformat Transforms in yarp.json for readability
Reformatted the `Transforms` sections in `yarp.json` to use
multi-line JSON objects instead of single-line objects.
This change improves the readability and maintainability
of the configuration file without altering its functionality.
2026-06-05 10:26:29 +02:00
1bf1c37296 Update receiver-ui-envelope route and add transforms
The `Path` matching rule for the `receiver-ui-envelope` route was updated to use `/envelope/{EnvelopeKey}` instead of the wildcard `/envelope/{**catch-all}` for more specific routing.

Additionally, a `Transforms` section was added to the route, which includes a transformation to set the path to `/index.html`.
2026-06-03 10:32:03 +02:00
ea6f3e61be Add GetDocumentOfReceiver method to DocumentController
The `GetDocumentOfReceiver` method was introduced to handle
retrieving a document for a specified envelope key. It is
secured with the `[Authorize(Policy = AuthPolicy.Receiver)]`
attribute and responds to HTTP GET requests with a route
parameter `envelopeKey`.

The previous logic for extracting and validating the
`envelopeId` from user claims was removed. This was replaced
with a call to `User.GetEnvelopeIdOfReceiver()` for improved
clarity and maintainability.

The method uses the `mediator` to send a `ReadDocumentQuery`
and returns a `NotFound` response if the document's `ByteData`
is empty.
2026-06-03 10:31:29 +02:00
0c446bba56 Enhance claim handling in ReceiverClaimExtensions
Refactor `ReceiverClaimExtensions` to support multiple claim
type variations by introducing arrays for envelope ID, UUID,
and receiver signature claim types. Updated the
`GetRequiredClaimOfReceiver` method to handle multiple claim
types and provide detailed error messages when claims are
missing. Refactored methods to use the new claim type arrays
for improved flexibility and robustness.
2026-06-03 10:31:14 +02:00
e74c777687 Add COPILOT_CONTEXT_EN.md to SolutionItems section
A new `SolutionItems` section was added to the `EnvelopeGenerator.sln` solution file. This section includes the `COPILOT_CONTEXT_EN.md` file, which is likely intended for documentation or context purposes. The section is marked as `preProject`, ensuring it is processed before other project sections.
2026-06-01 16:16:03 +02:00
d678111f25 Update y-coordinates for annotations in annotations.json
Adjusted the y-coordinate values for annotations with id 1, 2,
and 3 in annotations.json to reposition them on their respective
pages:
- Changed y for id 1 from 980.0 to 380.0.
- Changed y for id 2 from 980.0 to 680.0.
2026-06-01 16:15:53 +02:00
469e335fc3 Set background color and adjust label positioning
Added a `BackColor` property to both `signature` and
`signatureLabel` objects to improve visual consistency.
Adjusted the `BoundsF` property of `signatureLabel` to
slightly move the label upward for better alignment.
2026-06-01 16:15:30 +02:00
8d9dbbea19 Update receiver-ui cluster address in yarp.json
Replaced the `primary` destination address in the `receiver-ui`
cluster from `http://172.24.12.39:1234` to `https://localhost:52936`.
This change likely supports local development or testing by
switching to `localhost` with HTTPS and a different port.
2026-06-01 16:04:05 +02:00
d1088798e5 Add iText library for PDF processing functionality
The `itext` library (version 8.0.5) was added as a package reference to the `EnvelopeGenerator.ReceiverUI.csproj` file. This update introduces support for PDF generation or manipulation, potentially enabling new features or enhancing existing functionality related to PDF handling.
2026-06-01 15:37:15 +02:00
b4353cd9ff Move signature annotations to DetailBand
Updated `AddSignatureAtAnnotation` to use `DetailBand` instead of `BottomMarginBand` for managing signature annotations. Adjusted logic to ensure signatures are placed in the detail section and only displayed on the specified page using the `BeforePrint` event. Reformatted constants for readability and updated `RemoveExistingSignatureById` to operate on `DetailBand`. Removed reliance on bottom margin height for positioning and introduced `annotation?.Y` for vertical placement.
2026-06-01 15:37:03 +02:00
0ea7386cb6 Update project version to 1.3.0
Updated `<Version>` to 1.3.0 to reflect the new application version.
Aligned `<AssemblyVersion>` and `<FileVersion>` to 1.3.0.0
for API compatibility and Windows file version consistency.
2026-06-01 11:32:39 +02:00
161ec6491d Add dynamic typing animation to homepage description
Introduced a dynamic typing effect for the homepage description using the `Typed` library. Replaced hardcoded description text in `Index.razor` with a dynamically rendered `<span>` element. Added a constant for the description text and implemented `OnAfterRenderAsync` to invoke the typing animation on first render.

Included the `typed.umd.js` library in `index.html` and updated `receiver-signature.js` with a `startTyped` function to support typing animations. Registered `startTyped` in the public API for external use.

Enhanced the user experience with dynamic content rendering and improved maintainability by centralizing the description text. Also added a new theme file for improved styling.
2026-06-01 11:32:27 +02:00
6d254281f8 Update ReverseProxy config and adjust destination address
Added a new `ReverseProxy` section in `appsettings.Development.json` to define the `receiver-ui` cluster with a destination pointing to `https://localhost:52936`. Reformatted the `Logging` configuration without changing its values.

Updated the `yarp.json` file to modify the `receiver-ui` cluster's destination address from `https://localhost:52936` to `http://172.24.12.39:1234` to reflect the new backend service location.
2026-06-01 10:43:04 +02:00
5dc32a02a9 Update version to 1.3.1 and simplify YARP proxy logic
Updated the project version in `EnvelopeGenerator.API.csproj`
from `1.3.0` to `1.3.1`, including `<Version>`, `<FileVersion>`,
and `<AssemblyVersion>` properties, indicating a minor update.

Simplified the YARP proxy mapping in `Program.cs` by replacing
the conditional `app.MapWhen` logic with a direct call to
`app.MapReverseProxy()`, allowing all requests to be forwarded
through the reverse proxy without path filtering.
2026-06-01 10:39:44 +02:00
ba468c3f99 Update privacy policy styles and fix stylesheet path
Added new CSS rules in `privacy-policy.css` to improve the styling of the body, header, headings, sections, lists, and links. Minified these styles into `privacy-policy.min.css` for better performance. Updated the stylesheet path in `privacy-policy.de-DE.html` to ensure the correct relative path is used.
2026-06-01 10:39:04 +02:00
bca0b09cf4 Add IIS publish profile for .NET 8.0 deployment
A new publish profile `IISProfileNet8.pubxml` was added to configure deployment settings for a .NET project targeting the `net8.0` framework. Key settings include:

- `WebPublishMethod` set to `Package` for deployment packaging.
- `LastUsedBuildConfiguration` set to `Release`.
- `DesktopBuildPackageLocation` specifies the output path with a version placeholder.
- `PackageAsSingleFile` set to `true` for single-file packaging.
- `DeployIisAppPath` set to `EnvelopeGenerator` for IIS deployment.
- `TargetFramework` specified as `net8.0`.

This profile streamlines the deployment process and ensures compatibility with .NET 8.0.
2026-06-01 10:02:29 +02:00
a6ddc72df3 Update project version to 1.3.0
Updated `Version`, `FileVersion`, and `AssemblyVersion` in the `EnvelopeGenerator.API.csproj` file from `1.2.3` to `1.3.0`, indicating a minor version update with backward-compatible improvements or new features.
2026-06-01 05:00:35 +02:00
759a4e6b75 Update version to 1.2.0 with assembly and file updates
The `<Version>` element was updated from `1.0.1` to `1.2.0`, marking a new release with potential new features or improvements.
The `<AssemblyVersion>` was updated from `1.0.1.0` to `1.2.0.0`, indicating changes that may affect API compatibility.
The `<FileVersion>` was updated from `1.0.1.0` to `1.2.0.0`, reflecting the new build or release version.
2026-06-01 05:00:05 +02:00
cc68f76180 Simplify layout and remove unused styles
Removed styles for `.sidebar` and `.top-row` elements, including their background, layout, and responsive behavior, as they are no longer used. Simplified `main` and `article` elements by standardizing `margin` and `padding` to `0`.

Removed media query styles for `.top-row` and `.sidebar` to streamline responsive design. Updated global styles in `app.css` to ensure consistent spacing and alignment for `html`, `body`, `main`, and `.page`.

Focused on creating a cleaner, more minimal design by removing redundant styles and ensuring uniformity across the layout.
2026-06-01 04:59:46 +02:00
6a03308dc1 Update UI and improve routing and parameter handling
Updated the content in `Index.razor` to describe the digital signature portal's features and removed redundant UI elements, including a document signing button and a feature badge.

Modified `ReportViewer.razor` to remove the `/receiver` route, leaving only `/receiver/{EnvelopeKey}`. Updated the `EnvelopeKey` parameter to be non-nullable with a default value, improving type safety and preventing null reference issues.
2026-06-01 04:44:46 +02:00
4c33b1020a Redesign home page layout and improve user experience
Replaced the old card-based layout in `Index.razor` with a modern, visually appealing home page design. Added a hero header, content section, and call-to-action button for signing documents. Introduced new SVG icons and text elements to enhance the UI.

Removed the `OnAfterRenderAsync` method and automatic redirection logic to simplify user navigation. Added a new stylesheet link for the DevExpress Blazor theme.

Updated `app.css` to support the new design:
- Changed `article` overflow to `overflow-y: auto`.
- Added new classes for layout, buttons, and feature badges.
- Styled the home page with a gradient background, rounded corners, and hover effects.

These changes improve usability, responsiveness, and visual consistency.
2026-06-01 04:39:50 +02:00
5237c91100 Add footer and privacy policy files to ReceiverUI
Introduced a new footer in `MainLayout.razor` with copyright
information, a link to "Digital Data GmbH," and a privacy
policy link. Added two new privacy policy files
(`privacy-policy.en-US.html` and `privacy-policy.fr-FR.html`)
to the project and configured them to always copy to the
output directory.

Updated `app.css` to adjust layout heights to accommodate
the footer. Added new styles for the footer, including a
gradient background, responsive design, and hover effects
for links.
2026-06-01 04:31:12 +02:00
a6f699687c Add privacy policy documents in three locales
Added privacy policy documents in German (de-DE), English (en-US), and French (fr-FR). Each document is structured as an HTML file with sections covering general information, data processing responsibilities, data collection, use of cookies, and rights of affected persons.

Included metadata (title, charset, viewport) and linked a consistent stylesheet (`css/privacy-policy.min.css`). Provided contact details for the manufacturer (Digital Data GmbH) and Data Protection Officer in all locales.

Referenced locale-specific legal frameworks (e.g., GDPR, DSGVO, RGPD) and outlined session cookie usage. Documents are dated November 18, 2025, ensuring clarity and compliance with data protection regulations.
2026-06-01 04:28:09 +02:00
9cb29a0f1c Improve UI, fix signature placement, add documentation
Enhanced `ReportViewer.razor` with new UI elements, including a detailed `receiver-info-header` and `receiver-action-bar` for better signature workflows. Refactored signature logic to ensure accurate placement using `report.AfterPrint` and `PrintingSystem.Pages`. Removed legacy methods and iText7-based workflows.

Added Turkish documentation (`COPILOT_CONTEXT_TR.md`) detailing project structure, workflows, and pending tasks. Updated `MainLayout.razor` to simplify layout. Improved styling in `app.css` for better visual hierarchy and readability.

Documented pending tasks such as adding signature backgrounds, improving checkbox styles, and automating signature workflows.
2026-06-01 04:12:52 +02:00
26e6aea6f7 Add EnvelopeReceiverService to DI container
A new service, `EnvelopeGenerator.ReceiverUI.Services.EnvelopeReceiverService`, was registered in the dependency injection container using `AddScoped`. This ensures the service is available for injection with a scoped lifetime, creating a new instance per HTTP request or scope.
2026-06-01 03:56:23 +02:00
122942a5ff Add EnvelopeReceiverDto and related service class
Introduced `EnvelopeReceiverDto` and its nested models (`EnvelopeClientDto`, `EnvelopeSenderDto`, `DocumentClientDto`, `SignatureClientDto`, `ReceiverClientDto`) to represent client-side data for envelope receivers and their associated entities.

Added `EnvelopeReceiverService` to fetch `EnvelopeReceiverDto` from the API using `HttpClient`. Implemented error handling and JSON deserialization with `JsonSerializerDefaults.Web`. Updated necessary `using` directives.
2026-06-01 03:56:02 +02:00
360a762fb9 Refactor return value in EnvelopeReceiverController
Modified the method to return a single item or null by using
`SingleOrDefault()` on the result of `await _mediator.Send(...)`.
This ensures the response is no longer a collection but a single
object, improving clarity and aligning with expected behavior.
2026-06-01 03:53:01 +02:00
683f1eaf13 Improve signature workflow in ReportViewer.razor
Enhance the user interface and functionality for applying signatures:
- Add detailed display of signature fields and their pages.
- Introduce a progress bar to show marking progress visually.
- Display success message when all fields are marked.
- Automatically submit signatures when all fields are marked.
- Provide guidance for creating a signature if none exists.
- Disable "Export Signed PDF" button until signature is applied.
- Refactor code to simplify logic and remove redundancy.

These changes improve usability and provide clearer feedback to users.
2026-06-01 03:25:35 +02:00
d657f3825c Set initial zoom level for DxReportViewer to 130%
Added a `Zoom` property with a value of `1.3` to the `DxReportViewer` component in `ReportViewer.razor`. This change adjusts the default display scale to improve readability and enhance the user experience.
2026-06-01 03:21:04 +02:00
638c6f3291 Refactor signature popup handling in ReportViewer
Simplified the `OpenSignaturePopupAsync` method by converting it to a synchronous `void` method and removing unnecessary asynchronous calls. Introduced a new `OnPopupShownAsync` method to handle popup initialization logic.

Updated the `<Popup>` component to include the `Shown="OnPopupShownAsync"` attribute and re-added the `CloseOnOutsideClick="false"` attribute. Improved the logic for opening the signature popup by setting the active tab and resetting validation messages inline.

Enhanced the `OnAfterRenderAsync` lifecycle method to include additional checks for `Report`, annotations, and signature state before triggering JavaScript runtime calls. These changes improve the popup's behavior and overall state management.
2026-06-01 02:56:51 +02:00
1bdceb8b42 Update popup behavior and footer button logic
Modified `<DxPopup>` properties to prevent closing via Escape,
outside clicks, or the close button. Updated the "Schliessen"
button to always be enabled, regardless of `_capturedSignature`
state.
2026-06-01 02:51:23 +02:00
164dfacab3 Improve signature UI and refactor ReportViewer.razor
Updated the signature button text and SVG icon for clarity.
Enhanced the `DxPopup` component with better interaction
properties (`CloseOnEscape` and `CloseOnOutsideClick`).
Disabled the "Close" button in the popup when no signature
is captured.

Reformatted and restructured constants and fields in the
`@code` block for readability. Reintroduced previously
removed fields, constants, and methods to ensure
functionality. Added a conditional block in `LogoutAsync`
to open the signature popup when the user has access.

Performed general cleanup and code reorganization to
improve maintainability.
2026-06-01 02:42:32 +02:00
d8781a4b41 Refactor .annot-sig-cb-wrapper styles for modern UI
Updated `.annot-sig-cb-wrapper` and related classes to improve
appearance, interactivity, and hover effects. Key changes include:
- Increased `border-radius` and adjusted `font-size`, `font-weight`,
  and `padding` for a cleaner look.
- Replaced solid background and borders with gradient backgrounds
  and updated `box-shadow` for modern styling.
- Added `cursor` property and refined `transition` effects for
  smoother interactions.
- Updated hover and checked states with dynamic `filter` and
  enhanced `box-shadow`.
- Hid `.annot-sig-cb` checkbox and improved `.annot-sig-cb__label`
  readability with `letter-spacing`.
2026-06-01 02:06:28 +02:00
ee442d35b5 Simplify signature formatting and adjust layout
Simplified the `signatureInformation` string formatting by removing the `"Empfaengerunterschrift\n"` prefix and starting directly with `signerFullName`. Adjusted `infoHeight` from `65F` to `48.75F` to refine layout spacing.

Added a `BackColor` property to both `XRPictureBox` and `XRLabel` for consistent background styling (`Color.FromArgb(219, 219, 219)`). Updated `XRLabel` properties: adjusted `BoundsF` to offset `labelY` by `-5` for better vertical alignment and changed `TextAlignment` from `TopLeft` to `TopCenter`.

Made minor formatting adjustments to improve the visual consistency of signature and label elements.
2026-06-01 01:49:45 +02:00
c9264dc8de Add comprehensive documentation for EnvelopeGenerator
Enhanced documentation for the EnvelopeGenerator system:
- Added purpose section describing its functionality as a digital document signing system.
- Documented solution structure, listing projects, frameworks, and purposes.
- Highlighted key files in `ReceiverUI` and `API` with their roles.
- Explained `AnnotationDto` coordinate system and unit conversions.
- Detailed the signing flow in `ReceiverUI`, including page load, signature popup, and export steps.
- Documented JavaScript checkbox overlay logic for annotations.
- Provided a breakdown of `StampSignaturesOnPdf` using iText7.
- Described `BuildFreshBaseReport` behavior in real and dev modes.
- Listed NuGet packages with versions and purposes.
- Added "Mistakes History" to prevent repeated errors.
- Clarified why DevExpress X.509 signing article does not apply.
- Summarized development sessions in a change log.
2026-06-01 00:34:09 +02:00
6672b902b0 Make AnnotationDto properties non-nullable
Changed the `Page` property from `int?` to `int` to ensure it always has a value. Similarly, changed the `X` and `Y` properties from `double?` to `double` to enforce non-nullable values for horizontal and vertical positions.
2026-05-31 22:26:20 +02:00
614a275740 Enhance signature handling and annotation features
- Added dependency injection for `AnnotationService`, `DocumentService`, and `AuthService` in `ReportViewer.razor`.
- Improved signature button logic with dynamic appearance and feedback.
- Introduced annotation checkbox overlays for marking signature fields.
- Refactored signature saving and application logic into `SaveSignatureAsync` and `SubmitSignaturesAsync`.
- Added `BuildFreshBaseReport` and `AddAnnotationPlaceholders` for dynamic report creation.
- Implemented annotation-specific signature placement with `AddSignatureAtAnnotation`.
- Enhanced state management for annotations and signature overlays.
- Updated `app.css` with styles for annotation checkboxes.
- Added cache-control headers and versioned JavaScript in `index.html`.
- Improved `receiver-signature.js` with annotation checkbox management, optimized signature pad logic, and debugging utilities.
- Performed general code cleanup and optimization for maintainability.
2026-05-31 16:38:41 +02:00
a668dfa3eb Refactor envelope ID retrieval and error handling
Replaced hardcoded `envelopeId` with dynamic retrieval from
user claims. Reintroduced and updated error handling logic
to validate the `envelopeId` and log detailed errors when
parsing fails. Improved robustness by returning a 500 error
for invalid or missing envelope claims.
2026-05-31 16:15:00 +02:00
21c6b65318 Add no-cache headers to receiver-ui responses
Introduce a `Transforms` section in `yarp.json` for the `receiver-ui` route to enforce a no-cache policy. This includes setting the following response headers for all responses:
- `Cache-Control`: `no-cache, no-store, must-revalidate`
- `Pragma`: `no-cache`
- `Expires`: `0`

These changes ensure that client-side caching is disabled for the `receiver-ui` route.
2026-05-31 13:51:40 +02:00
759b60889e Add AnnotationDto and AnnotationService for API integration
Added `AnnotationDto` to represent signature annotation positions,
including properties for ID, page, and coordinates, with detailed
documentation on coordinate systems. Implemented `AnnotationService`
to fetch annotation data from an API endpoint, using `HttpClient`
and supporting cancellation tokens. Registered `AnnotationService`
in the DI container to enable its use across the application.
Provided development setup details for working with fake data
via YARP-proxied routes.
2026-05-31 11:19:03 +02:00
5964ebc088 Add receiver-ui-annotation-fake route to yarp.json
Added a new route configuration `receiver-ui-annotation-fake` to the `yarp.json` file. This route is associated with the `receiver-ui` cluster, has an `Order` value of `10`, and matches requests to `/api/Annotation/{envelopeKey}` with `GET` and `HEAD` methods. A path transformation rewrites the route to `/fake-data/annotations.json`.
2026-05-31 11:11:58 +02:00
dcb3e5d45d Mark Type obsolete; add X and Y properties
The `Type` property in `AnnotationCreateDto` was marked as obsolete with the note: "Not required for DevExpress."

Added `X` and `Y` properties to represent the horizontal and vertical positions of the signature field on the page. Both properties use DevExpress units (hundredths of an inch) with the origin at the top-left corner of the page.

Detailed documentation was added for `X` and `Y`, including differences in coordinate systems and unit conversions between DevExpress, PSPDFKit, and GDPicture.
2026-05-31 11:11:47 +02:00
fb9bc95e5f Add annotations for pages 1-3 in annotations.json
Added three new annotation objects to `annotations.json`.
Each annotation includes an `id`, `page`, `x`, and `y` property.
The annotations are for pages 1, 2, and 3, all with the same
coordinates (390.0, 980.0).
2026-05-31 11:11:30 +02:00
d97268c18c Refactor AnnotationCreateDto and update appsettings.json
Refactored the `AnnotationCreateDto` class:
- Changed `ElementId` from `int` to `long` and made it mutable.
- Marked `Name`, `Value`, and `Type` as `[Obsolete]` with defaults.
- Added `[Obsolete]` attributes to `Width` and `Height`.
- Introduced a new `Page` property to replace `SignatureDto`.

Updated `appsettings.json`:
- Set `Api.BaseUrl` to an empty string.
2026-05-31 11:10:31 +02:00
d9d731ab59 Add logout functionality for envelope sessions
Introduced a "Logout" button in `ReportViewer.razor` that is displayed when an `EnvelopeKey` is present. The button includes a spinner to indicate progress during the logout process.

Added the `LogoutAsync` method in `ReportViewer.razor` to handle the logout operation, preventing multiple attempts and navigating the user to the login page upon success.

Implemented `LogoutEnvelopeReceiverAsync` in `AuthService` to send a POST request to remove the per-envelope receiver cookie. This ensures proper backend handling of the logout process.

Improved user experience by providing a responsive and clear logout mechanism for envelope-based sessions.
2026-05-31 10:29:46 +02:00
1c7ca765cb Add login route and enhance login page functionality
Added a new `/login/{**catch-all}` route in `yarp.json` for the `receiver-ui` cluster. Updated `Login.razor` with a modernized UI, including a gradient header, improved error handling, and a toggle for password visibility. Integrated `AuthService` for API-based login validation.

Refactored `Login.razor` logic to handle login outcomes (`Success`, `InvalidCode`, `NotFound`, `Error`) using the new `EnvelopeLoginResult` enum. Added `LoginEnvelopeReceiverAsync` method in `AuthService` to handle login requests via `POST /api/Auth/envelope-receiver/{key}`. Improved code maintainability and user experience.
2026-05-31 09:23:07 +02:00
de8d363c27 Add authentication for secure document access
Introduced a new login page (`Login.razor`) to handle user authentication via access codes. Implemented `AuthService` to validate access codes through an API. Updated `ReportViewer.razor` to check user access and redirect unauthorized users to the login page. Modified `Program.cs` to register `AuthService` for dependency injection. Enhanced document fetching in `ReportViewer.razor` to ensure secure access control.
2026-05-31 09:01:02 +02:00
390f2d2cae Replace DxPdfViewer with DxReportViewer for PDF handling
Replaced `DxPdfViewer` with `DxReportViewer` to unify handling of
both PDF and report rendering. Removed conditional logic for
`PdfBytes` and directly initialized `XtraReport` with PDF content
using `XRPdfContent`. Simplified `OnInitializedAsync` to fetch
PDF content, create a report, and store it in `ReportStorage`.
Removed unused fields (`PdfViewerUrl`, `PdfBytes`, and
`SignedPdfBytes`) and redundant code related to PDF handling.
2026-05-31 08:14:07 +02:00
697f85f805 Refactor signature handling and PDF export logic
Refactored the signature handling process by introducing a new
`Report` instance creation step in the `SignatureApplied` block
to streamline signed report generation. Added a validation check
in `ExportSignedPdfAsync` to ensure the `Report` object is not
null before proceeding with export. Removed redundant code for
manual signed report creation and simplified the export logic
by directly invoking `reportViewer!.ExportToAsync`. Incremented
`ViewerKey` to refresh the report viewer after signing.
2026-05-31 08:01:10 +02:00
d97172b9cf Add condition to bypass document fetching logic
Updated the `OnInitializedAsync` method in `ReportViewer.razor`
to include a check for `AppOptions.Value.ForceToUseFakeDocument`.
This ensures that the application can bypass fetching the
actual document when the configuration option is enabled.
2026-05-31 07:46:51 +02:00
72cbccab8c Add ForceToUseFakeDocument option for document loading
Introduced a new `ForceToUseFakeDocument` property in `ApiOptions` to control whether the application uses a fake document for testing or bypasses certain conditions for document loading. Updated `ReportViewer.razor` to respect this configuration, including changes to conditional rendering logic and dependency injection for `IOptions<ApiOptions>`.

Removed test code that forced `EnvelopeKey` to `null` during initialization. Updated `appsettings.json` to include the new `ForceToUseFakeDocument` property with a default value of `true`. Added necessary `using` directives and dependencies for the updated functionality.
2026-05-31 07:30:23 +02:00
b708343db0 Merge branch 'master' of http://git.dd:3000/AppStd/EnvelopeGenerator 2026-05-31 05:52:44 +02:00
b416823f38 configure for test case 2026-05-31 05:52:42 +02:00
5bdc552492 Add DocumentService for fetching PDF documents
Introduced a new `DocumentService` class to handle fetching
PDF document bytes from an API endpoint. The service uses
`HttpClient` for HTTP communication and `IOptions<ApiOptions>`
for accessing API configuration. Added the `GetDocumentAsync`
method to perform the HTTP GET request, handle responses, and
return the document bytes along with the HTTP status code.
Included necessary `using` directives and encapsulated the
service in the `EnvelopeGenerator.ReceiverUI.Services` namespace.
2026-05-30 17:03:25 +02:00
cdf34a262b Add ApiOptions and configure API settings
Added a new `ApiOptions` class to encapsulate API configuration,
including the `BaseUrl` property and `SectionName` constant.
Registered `ApiOptions` in the dependency injection container
in `Program.cs` and bound it to the "Api" section in the
configuration file. Updated `appsettings.json` to include the
"Api" section with a `BaseUrl` value of "https://localhost:8088".
2026-05-30 17:02:57 +02:00
4c84b28034 Add DevExpress reporting and PDF viewer services
Integrated DevExpress WebAssembly Blazor Report Viewer and PDF Viewer to enable report and PDF rendering in the application.

Registered `EnvelopeGenerator.ReceiverUI.Services.DocumentService` for document handling. Configured `DevExpress Blazor Reporting WebAssembly` in development mode.

Added a custom implementation of `IDataSourceWizardJsonConnectionStorage` to manage JSON data connections in the data source wizard.
2026-05-30 16:51:42 +02:00
b70f902190 Update DevExpress packages and add PdfViewer support
Upgraded DevExpress package references in `EnvelopeGenerator.ReceiverUI.csproj` from version 25.2.3 to 25.2.7, including:
- `DevExpress.Drawing.Skia`
- `DevExpress.Blazor.Reporting.JSBasedControls`
- `DevExpress.Blazor.Reporting.Viewer`

Added a new package reference for `DevExpress.Blazor.PdfViewer` (version 25.2.7) to enable PDF viewing functionality.

Updated `_Imports.razor` to include `@using DevExpress.Blazor.PdfViewer` for PdfViewer component support.
2026-05-30 16:51:11 +02:00
094c87eb88 Refactor CreateEnvelopeCommand and remove ConstantsTests
Refactored the `CreateEnvelopeCommand` method in `Fake.cs` to delegate user authentication logic to the `WithAuth` method. Added a new `CreateEnvelopeCommands` method to generate multiple commands for a set of user IDs.

Removed `ConstantsTests.cs`, which contained tests for the `Normalize` method of the `EnvelopeSigningType` enumeration, as the method or its tests are no longer relevant.
2026-05-30 16:50:21 +02:00
9b2539e378 Refactor CreateEnvelopeCommand authorization method
Replaced the `Authorize` method with a new `WithAuth` method
in the `CreateEnvelopeCommand` class. The new method sets
the `UserId` property and returns the current instance,
enabling method chaining and improving usability.
2026-05-30 16:47:51 +02:00
0b73a90b15 Downgrade to net8.0 and update dependencies
The `<TargetFrameworks>` property in `EnvelopeGenerator.API.csproj` was downgraded from `net9.0` to `net8.0`. Conditional package references were added for `Microsoft.AspNetCore.OpenApi` and `Microsoft.EntityFrameworkCore.SqlServer` to support both `net8.0` and `net9.0`.

Added `itext` and `itext.bouncy-castle-adapter` (version 8.0.5) as new dependencies. Updated the project to include a reference to `EnvelopeGenerator.PdfEditor.csproj`. Removed unconditional `Microsoft.AspNetCore.OpenApi` reference and replaced it with conditional references based on the target framework.
2026-05-30 16:47:32 +02:00
76cfe4dc46 Add conditional MapOpenApi for .NET 9.0 or newer
Introduced a preprocessor directive `#if NET9_0_OR_GREATER` to conditionally include the `app.MapOpenApi();` method call. This ensures that the `MapOpenApi` functionality is only executed when the application targets .NET 9.0 or later, maintaining compatibility with earlier .NET versions.
2026-05-30 16:46:27 +02:00
c1a10cc0fa Add OpenAPI service for .NET 9.0 or newer
Introduced a conditional compilation directive (`#if NET9_0_OR_GREATER`) to register the `AddOpenApi` service only when the application is targeting .NET 9.0 or later. This ensures compatibility and avoids unnecessary service registration for earlier .NET versions.
2026-05-30 16:45:48 +02:00
b6b5ca52f2 Update yarp.json with granular routing rules
Renamed the route "receiver-ui" to "receiver-ui-receiver" and added new routes for more specific path handling:
- "receiver-ui-receiver" for `/receiver/{**catch-all}`.
- "receiver-ui-sender" for `/sender/{**catch-all}`.
- "receiver-ui-envelope" for `/envelope/{**catch-all}`.
- "receiver-ui-static-assets" for `{**catch-all}` as a fallback.

These changes improve routing granularity for the "receiver-ui" cluster.
2026-05-30 16:45:17 +02:00
5279731281 Refactor: Replace Authorize with WithAuth in CreateAsync
Updated the `CreateAsync` method in `EnvelopeController` to use
`WithAuth` instead of `Authorize` for handling authorization
within the `CreateEnvelopeCommand`. This change reflects a
refactor or update in the command's API to improve clarity or
functionality.
2026-05-30 16:42:59 +02:00
27ed3689f2 Adjust YARP proxy to exclude specific API paths
Updated the middleware pipeline in `Program.cs` to use `app.MapWhen()` for conditional routing. The reverse proxy now excludes requests to `/swagger`, `/scalar`, and `/openapi` paths, ensuring these endpoints are handled separately. This change replaces the direct `app.MapReverseProxy()` call with a more selective approach, improving request handling for specific API paths.
2026-05-29 18:44:10 +02:00
d4f23e0e82 Merge branch 'master' of http://git.dd:3000/AppStd/EnvelopeGenerator 2026-05-29 14:27:05 +02:00
618f899440 Add receiver-ui route and cluster to YARP configuration
Added a new `receiver-ui` route under the `ReverseProxy:Routes`
section in `yarp.json` to match all paths for `GET` and `HEAD`
methods. The route is associated with the `receiver-ui` cluster
and has an `Order` value of 100.

Configured a new `receiver-ui` cluster under the
`ReverseProxy:Clusters` section with a single destination
pointing to `https://localhost:52936`. This enables reverse
proxying for the `receiver-ui` service.
2026-05-29 14:26:53 +02:00
2eb258d236 Merge branch 'master' of http://git.dd:3000/AppStd/EnvelopeGenerator 2026-05-29 14:09:37 +02:00
28df3f4ec1 Refactor document handling and improve file response
Refactored the handling of `senderDoc.ByteData` by replacing
the ternary operator with an explicit `if` statement for better
readability. Added a `Content-Disposition` header to ensure
the file is displayed inline with a proper filename. Updated
the MIME type of the file response from `application/octet-stream`
to `application/pdf` to reflect the expected content type.
2026-05-29 14:09:31 +02:00
3e37dc1eff Merge branch 'master' of http://git.dd:3000/AppStd/EnvelopeGenerator 2026-05-29 14:07:19 +02:00
5fd8637913 Add DependencyInjection and ReceiverUI projects
Added the `EnvelopeGenerator.DependencyInjection` project to the solution, including its build configurations for Debug and Release modes.

Also added build configurations for the existing `EnvelopeGenerator.ReceiverUI` project.

Both projects were associated with the parent project in the NestedProjects section.
2026-05-29 14:07:14 +02:00
31db160fba Add signature panel and layout updates for ReportViewer
Enhanced `ReportViewer.razor` with a new layout structure:
- Added `receiver-page-layout` with `receiver-signature-panel` and `receiver-viewer-wrapper` for better organization.
- Introduced a button to export signed PDFs, conditionally enabled based on `SignatureApplied`.
- Added a `DxPopup` for capturing signatures with a "Close" button.

Updated `MainLayout.razor` to remove unnecessary padding from `<article>`.

Refined `app.css`:
- Defined styles for `receiver-page-layout`, `receiver-signature-panel`, and `receiver-viewer-wrapper` to improve layout flexibility.
- Adjusted `article` to use flexbox and ensure hidden overflow.
2026-05-29 14:06:59 +02:00
b6e63841cd Disable automatic database migrations in appsettings.json
The `UseDbMigration` setting in the `appsettings.json` file was updated from `true` to `false`. This change disables automatic application of database migrations, potentially requiring manual intervention or an alternative approach for managing schema updates.
2026-05-29 13:47:11 +02:00
f051896296 Add API endpoint to retrieve envelope receiver by key
Added a new `GetEnvelopeReceiverOfReceiver` method in the
`EnvelopeReceiverController` to retrieve an envelope receiver
based on the provided `envelopeKey`. The method is secured
with the `Receiver` authorization policy and uses the
`_mediator.Send` method to process a `ReadEnvelopeReceiverQuery`.

Included the `Microsoft.Extensions.Options` namespace to
support potential configuration needs. Added XML documentation
placeholders for the new method.
2026-05-29 13:46:06 +02:00
92b93e862e Add GetDocumentOfReceiver endpoint and logging support
Updated DocumentController to include a new GetDocumentOfReceiver
endpoint for retrieving envelope documents. Added authorization
based on the Receiver policy and implemented error handling for
invalid or missing EnvelopeId claims. Integrated ILogger to log
errors and provide detailed diagnostics. Included necessary
namespace imports to support the new functionality.
2026-05-29 13:37:51 +02:00
8876f5c286 Add token validation for envelope key in request path
Enhanced token validation logic by introducing an `OnTokenValidated` event handler. This ensures the `envelopeKey` in the request path matches the token's subject (`sub` claim). Added `return Task.CompletedTask;` to complete asynchronous operations. These changes improve security by preventing mismatches or unauthorized access.
2026-05-29 13:10:42 +02:00
e93c7e8bc1 Add envelope-receiver login endpoint support
Added `AddEnvelopeReceiverLoginOperation` to `AuthProxyDocumentFilter` to define a new Swagger operation for the `/api/Auth/envelope-receiver/{key}` endpoint. Introduced the `EnvelopeReceiverLogin` record for the request body. Updated `yarp.json` to configure routing for the new endpoint, ensuring the `cookie` query parameter is always set to `true`. Modified `Apply` to include the new operation in Swagger documentation.
2026-05-29 12:44:51 +02:00
16493b4594 Add endpoints for envelope receiver logout functionality
Added two new endpoints to `AuthController`: `LogoutEnvelopeReceiver` for removing a specific per-envelope receiver cookie and `LogoutAllEnvelopeReceivers` for clearing all such cookies. Updated `DigitalData.Auth.Claims` package to version 1.0.3. Introduced new `using` directives to support the added functionality. Included XML documentation for the new endpoints to improve code clarity.
2026-05-29 12:44:26 +02:00
938504b2d1 Add per-envelope JWT authentication and validation
Introduced a new `EnvelopeReceiverJwt` authentication scheme to support per-envelope JWT validation using cookies specific to envelope keys. Added the `CheckEnvelopeReceiver` endpoint in `AuthController.cs` to validate these tokens, protected by the `AuthPolicy.Receiver` policy.

Configured the `EnvelopeReceiverJwt` scheme to dynamically resolve issuer signing keys and validate tokens. Enhanced `JwtBearerEvents.OnMessageReceived` to extract envelope keys from the request path and retrieve tokens from corresponding cookies.

Updated the `AuthPolicy.Receiver` policy to use the `EnvelopeReceiverJwt` scheme, ensuring isolated authentication for per-envelope scenarios. Added XML documentation for the `CheckEnvelopeReceiver` method.
2026-05-29 11:47:12 +02:00
3eb718f6ac Add CheckReceiver endpoint to AuthController
Introduce a new `CheckReceiver` action method in `AuthController`.
This method is protected by the `Receiver` authorization policy
and handles GET requests to the `check-receiver/{envelopeKey}` route.
It accepts an `envelopeKey` parameter from the route and currently
returns an HTTP 200 OK response.
2026-05-29 10:23:34 +02:00
99781aeb8a Enhance authentication and database configuration
- Added `using DigitalData.Auth.Claims` to support claims handling.
- Improved EF Core DbContext comment for better clarity.
- Added logic to dynamically select connection strings based on
  `MIGRATION_TEST_MODE` or `UseDbMigration` configuration.
- Updated `AuthPolicy.Receiver` to include the `"receiver"` role.
2026-05-29 10:02:25 +02:00
ffcd41f4dc Add DigitalData.Auth.Claims package dependency
Added a reference to the `DigitalData.Auth.Claims` package (version 1.0.1) in the `EnvelopeGenerator.API.csproj` file. This introduces functionality related to handling authentication claims in the project.
2026-05-29 10:02:11 +02:00
a7ed9be1de Update version and improve build process for packaging
Updated project version to 1.2.0.3 in `EnvelopeGenerator.DependencyInjection.csproj`.
Replaced line endings in `_DepDlls` for consistency. Added a new
`RebuildDependenciesBeforePack` target to ensure all dependencies
are rebuilt for `net7.0`, `net8.0`, and `net9.0` before packaging.
Improved formatting in `BundleReferencedDlls` for better readability.
2026-05-29 08:45:56 +02:00
32fbf782fa Update project version to 1.2.0
Bump the project version from 1.1.1 to 1.2.0 in the `EnvelopeGenerator.DependencyInjection.csproj` file. Updated the `<Version>`, `<AssemblyVersion>`, and `<FileVersion>` properties to reflect the new version.
2026-05-28 23:47:02 +02:00
bfae72529c Add query for sensitive envelope receiver data
Introduced `ReadEnvelopeReceiverSecretQuery` to fetch sensitive
fields (e.g., access code, phone number) for envelope receivers.
Added extension methods for dispatching the query via `IMediator`
and implemented `ReadEnvelopeReceiverSecretQueryHandler` to
process the query using repositories and AutoMapper.

Updated `EnvelopeController` with a new HTTP GET endpoint
`EnvelopeReceiverWithSecretByMediatr` to expose the query
functionality. This endpoint returns sensitive data as
`EnvelopeReceiverSecretDto` or a 404 response if no match is found.

These changes improve modularity, testability, and separation of
concerns by leveraging MediatR and CQRS patterns.
2026-05-28 23:46:31 +02:00
33c52bcef8 Add signature panel and layout updates for ReportViewer
Enhanced `ReportViewer.razor` with a new layout structure:
- Added `receiver-page-layout` with `receiver-signature-panel` and `receiver-viewer-wrapper` for better organization.
- Introduced a button to export signed PDFs, conditionally enabled based on `SignatureApplied`.
- Added a `DxPopup` for capturing signatures with a "Close" button.

Updated `MainLayout.razor` to remove unnecessary padding from `<article>`.

Refined `app.css`:
- Defined styles for `receiver-page-layout`, `receiver-signature-panel`, and `receiver-viewer-wrapper` to improve layout flexibility.
- Adjusted `article` to use flexbox and ensure hidden overflow.
2026-05-28 23:37:20 +02:00
40c5e1d044 Update navigation and remove sidebar in MainLayout
Updated the `OnAfterRenderAsync` method in `Index.razor` to navigate to `/receiver` instead of `/reportviewer`. Removed the sidebar containing the `<NavMenu />` component in `MainLayout.razor` and adjusted the `<main>` tag to directly contain the content.
2026-05-28 23:36:22 +02:00
67e6f288eb Bump version to 1.1.1
Updated project version from 1.1.0 to 1.1.1 in `EnvelopeGenerator.DependencyInjection.csproj`. This includes changes to `<Version>`, `<AssemblyVersion>`, and `<FileVersion>` properties. The update reflects minor improvements or bug fixes while maintaining backward compatibility.
2026-05-28 22:52:40 +02:00
823bafeeb9 Refactor project dependencies and add TFM-specific packages
Restructured `EnvelopeGenerator.DependencyInjection.csproj` to:
- Add multiple `PackageReference` entries for application services, ORM/Database, security/identity, utilities, and DI abstractions.
- Introduce conditional `ItemGroup` sections for `net7.0`, `net8.0`, and `net9.0` with framework-specific package versions.
- Move `UserManager` package reference to align with the updated dependency structure.
- Update comments for clarity, including replacing a Turkish comment with an English one.
- Add a comment explaining the rationale for centralizing `PackageReference` declarations to ensure correct `.nuspec` generation and simplify consumption.
2026-05-28 22:50:45 +02:00
750b9f1b57 Bump project version to 1.1.0
Updated the project version from 1.0.1 to 1.1.0 in the `EnvelopeGenerator.DependencyInjection.csproj` file. This includes changes to the `<Version>`, `<AssemblyVersion>`, and `<FileVersion>` properties, reflecting the addition of new features or improvements.
2026-05-28 21:57:19 +02:00
0a4daccc0f Refactor service registration for modularity
Introduced `EnvelopeGeneratorOptions` and `SqlCacheOptions` to enable fine-grained control over optional service registrations in `AddEnvelopeGenerator`. Updated `AddEnvelopeGenerator` to conditionally register services like `HttpContextAccessor`, `DistributedSqlServerCache`, `Dispatcher`, `MemoryCache`, and `UserManager` based on these options.

Updated `DependencyInjection.csproj` to include necessary framework references and package dependencies. Simplified `Program.cs` by consolidating service registrations into `AddEnvelopeGenerator`, reducing boilerplate and improving maintainability.

Improved extensibility by centralizing service registration logic, allowing consuming projects to customize configurations without modifying the core library. Updated documentation and removed unused directives.
2026-05-28 21:57:03 +02:00
bc4905d2f4 Refactor DI setup and simplify service registration
Centralized dependency injection setup by adding a reference to
`EnvelopeGenerator.DependencyInjection` in the project file and
replacing multiple `using` directives with a single one.

Replaced obsolete `AddEnvelopeGeneratorInfrastructureServices`
and `AddEnvelopeGeneratorServices` methods with the new
`AddEnvelopeGenerator` method, consolidating service and
infrastructure setup.

Encapsulated `EGDbContext` configuration within
`AddEnvelopeGenerator` and removed obsolete `#pragma` directives.

Simplified mail service registration by replacing manual
`IEnvelopeMailService` setup with `AddEnvelopeMailService`.

These changes improve maintainability, reduce redundancy, and
modernize the codebase.
2026-05-28 20:23:14 +02:00
533d646211 Update routes and navigation links for sender/receiver UI
Updated the `@page` directives in `ReportDesigner.razor` and
`ReportViewer.razor` to change routes from `/reportdesigner`
to `/sender` and `/reportviewer` to `/receiver`, respectively.

Modified `NavMenu.razor` to update navigation links to reflect
the new routes. Updated the displayed text for the links to
"Empfänger-UI" (Receiver UI) and "Umschlag-UI" (Envelope UI).
2026-05-28 20:17:42 +02:00
7c737ee6ad Update project versioning and dependency handling
Updated project version to 1.0.1, including `<Version>`, `<AssemblyVersion>`, and `<FileVersion>`. Added `<PrivateAssets>all</PrivateAssets>` to `<ProjectReference>` elements to prevent exposing referenced projects' assets. Introduced `IncludeDependencyDlls` and `BundleReferencedDlls` targets to include and bundle dependent project DLLs for multiple target frameworks (`net7.0`, `net8.0`, `net9.0`). Removed redundant `<ProjectReference>` entries and improved packaging to ensure proper handling of dependencies.
2026-05-28 20:13:51 +02:00
7aa08cf8e9 Enable Wasm native build and refactor signature layout
Updated EnvelopeGenerator.ReceiverUI.csproj to enable native WebAssembly builds and load all globalization data for improved localization support.

Refactored ReportViewer.razor to enhance layout calculations for the signature section:
- Introduced constants for better readability and maintainability.
- Dynamically adjusted band height and padding to fit content without overlap.
- Updated control positioning and sizing using calculated values.
- Changed font style of the signature label to regular and reordered control additions for clarity.
2026-05-28 19:43:03 +02:00
4144d2abde Disable native Wasm build in ReceiverUI project
The `<WasmBuildNative>` property in the `EnvelopeGenerator.ReceiverUI.csproj` file was changed from `true` to `false`. This disables the native WebAssembly (Wasm) build, potentially simplifying the build process, reducing build time, or addressing compatibility issues.
2026-05-28 19:42:47 +02:00
2a8fed166b Adjust signature layout and bottom margin height
Increased the `bottomMargin` height from 140F to 175F to provide additional space. Updated the `signatureInformation` format to simplify text structure, remove redundant labels, and use a short date format.

Modified the `XRLabel` to enable multiline text, adjusted its height to 70F, and changed text alignment to `TopLeft`. Updated the `XRPictureBox` position by shifting its Y-coordinate to 80F for better alignment with the new layout.
2026-05-28 17:08:18 +02:00
60f01565da Add user input fields and enhance signature details
Added input fields for "Full Name," "Position," and "Place" in `ReportViewer.razor` to collect additional user details. Introduced validation for required fields ("Full Name" and "Place") in `ApplySignatureAsync`. Updated `CreateSignedReportInstance` and `AddSignature` to include these details in the signature label, which now dynamically displays full name, position (if provided), place, and date. Adjusted layout and bounds for proper alignment and spacing in the report.
2026-05-28 16:57:27 +02:00
8a796a2eec Support multi-targeting and add NuGet metadata
Updated `EnvelopeGenerator.DependencyInjection.csproj` to support multiple target frameworks (`net7.0`, `net8.0`, `net9.0`) for broader compatibility. Added NuGet package metadata to enable publishing, including details like `PackageId`, `Authors`, and `RepositoryUrl`.

Upgraded `Microsoft.Extensions.Configuration.Abstractions` and `Microsoft.Extensions.DependencyInjection.Abstractions` to version `9.0.6`. Added a project reference to `EnvelopeGenerator.Domain`.

Modified `EnvelopeGenerator.sln` to adjust the build configuration for the project with GUID `{90FE0312-8C38-4347-9EA2-0A719E255D5C}`, setting `Debug` to use the `Release` configuration.
2026-05-28 16:54:59 +02:00
83957d28e9 Add DependencyInjection class for service registration in EnvelopeGenerator 2026-05-28 16:27:30 +02:00
fe3f1347d5 Add EnvelopeGenerator.DependencyInjection project and update solution file 2026-05-28 16:27:21 +02:00
0a22e4e5cc Enhance signature popup with multiple input modes
Refactored `@using` directives in `ReportViewer.razor` to use specific aliases for improved readability. Updated the signature popup to support three input modes: "Draw", "Text", and "Image", with a tabbed interface for switching between modes. Added font selection for typed signatures and improved state management for signature modes.

Refactored JavaScript interop methods to handle initialization, clearing, and data retrieval for each signature mode. Enhanced `receiver-signature.js` to support typed and image-based signatures, including rendering text-based signatures and handling image uploads with scaling and centering.

Improved maintainability by modularizing code and extracting reusable functions. Enhanced user experience with dynamic UI updates and better handling of signature state changes.
2026-05-28 14:39:38 +02:00
1e35e0447f Merge branch 'master' of http://git.dd:3000/AppStd/EnvelopeGenerator 2026-05-28 14:15:19 +02:00
0ca487d5bd Enhance globalization and error handling support
Added support for culture-specific globalization in the Blazor WebAssembly project by disabling invariant globalization and enabling the loading of all globalization data.

Improved error handling in `ReportViewer.razor` by wrapping the `ExportToAsync` method in a `try-catch` block to handle export failures gracefully. Updated user-facing messages to provide clearer feedback in case of errors.
2026-05-28 13:57:42 +02:00
7828ed237d Refactor utility functions for clarity and consistency
Updated `findNearest` for improved readability by renaming
parameters, introducing a helper function for distance
calculation, and using `Infinity` for clarity. Refactored
`getCurrentCulture` to use modern `typeof` syntax. Updated
`B64ToBuff` and `getLocaleDateString` for consistency with
naming conventions and concise syntax. Re-added
`detailedCurrentDate` to ensure consistency.
2026-05-27 16:16:50 +02:00
b3eafcbd0b Enable nullable types and add NuGet package metadata
Added `<Nullable>enable</Nullable>` to improve code safety.
Included metadata properties for NuGet packaging, such as
`<PackageId>`, `<Authors>`, `<Company>`, `<Product>`, and
more, to support package creation and distribution. Updated
the `<Description>` to detail the project's purpose and
technologies. Specified versioning details to ensure proper
version control and compatibility.
2026-05-27 15:16:52 +02:00
affdc44f91 Refactor startup and add report storage services
- Added `EnvelopeGen` as a trusted class for deserialization.
- Registered `InMemoryReportStorageWebExtension` as a singleton.
- Registered `ReportStorageWebExtension` as a singleton using a factory.
- Added `IReportProviderAsync` as a scoped service with `CustomReportProvider`.
- Registered `InMemoryReportStorageWebExtension` globally.
- Refactored app startup to load fonts asynchronously before running:
  - Introduced `FontLoader.LoadFonts` to load "opensans.ttf".
  - Replaced `await builder.Build().RunAsync()` with a `host` variable.
2026-05-27 15:07:27 +02:00
8adc8683b8 Add publish profile and update project for deployment
Added a new `<ItemGroup>` in `EnvelopeGenerator.ReceiverUI.csproj` to include the `Properties\PublishProfiles\` folder, enabling publishing configurations. Introduced `IISProfile.pubxml` to define publishing settings, including the use of the `Package` method, `Release` build configuration, single-file packaging, and IIS deployment path configuration.
2026-05-26 11:43:25 +02:00
4d91b0a4fb Refactor Index.razor layout and add redirection logic
Simplified the `@page` directive by removing redundant entries.
Replaced the introductory section with a centered card layout
featuring a document icon, heading, description, and a
`DxLoadingPanel` with a spinner for redirection feedback.

Removed the "Helpful Resources" section with external links.
Added a new `@code` block to handle redirection logic using
`OnAfterRenderAsync`, which redirects to `/reportviewer` after
a 1200ms delay.
2026-05-26 10:44:56 +02:00
e62cdc9d9d Update NavMenu links and add commented-out navigation
- Added a commented-out block for "Home" and "Document Viewer (JS-Based)" navigation links.
- Updated the "reportviewer" link text to "Empfänger-UI."
- Updated the "reportdesigner" link text to "Umschlag-UI."
2026-05-26 10:27:37 +02:00
12a0974efe Refactor signature input into popup modal
The signature input process has been refactored to use a `<DxPopup>` modal for better user experience. The `<canvas>` element for capturing the signature has been moved into the popup, which is dynamically displayed when the user interacts with the "Unterschrift hinzufügen" or "Unterschrift erneuern" button.

Dynamic messages now provide clearer feedback based on whether a signature has been applied. Signature-related actions (renew, apply, close) have been consolidated into the popup's footer, decluttering the main interface.

New properties (`SignaturePopupVisible`, `PopupValidationMessage`) and methods (`OpenSignaturePopupAsync`, `RenewSignatureAsync`, `CloseSignaturePopup`) have been added to manage the popup and its behavior. The `ApplySignatureAsync` method has been updated to handle popup-specific validation and close the popup after applying the signature.

The `OnAfterRenderAsync` method has been removed, and signature pad initialization has been moved to `OpenSignaturePopupAsync`. The `ApplySignatureToReport` method has been removed, with its functionality integrated into `ApplySignatureAsync`.

Minor layout adjustments and validation logic improvements have been made. The "Export Signed PDF" button is now disabled unless a signature has been applied.
2026-05-26 09:55:40 +02:00
367850fee5 Refactor ReportViewer for reusability and dynamic updates
Refactored `ReportViewer.razor` to improve maintainability and
ensure dynamic updates to the `DxReportViewer` component.

- Added `@key` attribute bound to `ViewerKey` to trigger re-renders.
- Introduced `CreateReportInstance` and `CreateSignedReportInstance`
  helper methods to encapsulate report creation logic.
- Updated `OnInitializedAsync`, `ClearSignatureAsync`, and
  `ApplySignatureAsync` to use the new helper methods.
- Incremented `ViewerKey` in relevant methods to ensure proper
  re-rendering of the `DxReportViewer` component.
- Replaced `ApplySignatureToReport` with `CreateSignedReportInstance`.

These changes improve code modularity, readability, and ensure
the UI reflects the latest state of the report.
2026-05-26 02:39:25 +02:00
09cc639466 Add signature input and PDF export functionality
Introduced a signature input feature in `ReportViewer.razor` to allow users to draw a signature on a canvas and embed it into reports before exporting as a signed PDF.

- Added a canvas (`receiver-signature-pad`) and buttons for clearing, applying, and exporting signatures.
- Injected `IJSRuntime` for JavaScript interop and added methods for signature handling (`ClearSignatureAsync`, `ApplySignatureAsync`, `ExportSignedPdfAsync`).
- Embedded the signature as an image and label in the report's bottom margin.
- Added `receiver-signature.js` to manage the signature pad, including drawing, clearing, and exporting the signature as a Base64 image.
- Updated `index.html` to include the new JavaScript file.
- Displayed validation messages for missing or invalid signatures.
2026-05-26 01:02:07 +02:00
c3730d109b Add in-memory report storage and async report handling
Introduced `InMemoryReportStorageWebExtension` to manage
reports in memory, enabling dynamic report storage and
retrieval. Updated `ReportViewer.razor` to conditionally
render the `DxReportViewer` component and initialize
reports asynchronously.

Configured dependency injection in `Program.cs` to register
`InMemoryReportStorageWebExtension` as a singleton and
integrated it with `CustomReportProvider`. Registered
`EnvelopeGenerator.ReceiverUI.PredefinedReports.Report` as
a trusted class for deserialization.

Enhanced `CustomReportProvider` to fetch reports from
memory or generate them dynamically using `ReportsFactory`.
Added necessary `using` directives and ensured proper
report lifecycle management.
2026-05-25 14:04:25 +02:00
f510cfb5ad INIT 2026-05-22 10:50:25 +02:00
OlgunR
45377ea61c Merge branch 'master' of https://vcs.digitaldata.works/AppStd/EnvelopeGenerator 2026-03-13 10:44:39 +01:00
OlgunR
b5748550d1 Fix typo in document confirmation message
Corrected "red" to "read" in the DocumentSuccessfullyConfirmed resource string to ensure proper messaging.
2026-03-13 10:44:00 +01:00
64c018b92e Add DbSets for ElementAnnotation and DocumentStatus
Added DocumentReceiverElementAnnotations (ElementAnnotation) and DocumentStatus DbSet properties to EGDbContextBase to support database operations for these entities.
2026-03-12 16:11:50 +01:00
176672d7eb Add interface import and update email sending condition
Added import for EnvelopeGenerator.Domain.Interfaces. Updated logic to send final emails to receivers only if the envelope requires "Read and Sign," adding an extra check to the email dispatch condition.
2026-03-11 17:45:27 +01:00
05d54e87c3 Bump version to 3.12.3 in project file
Updated EnvelopeGenerator.Web.csproj to increment <Version>, <AssemblyVersion>, and <FileVersion> from 3.12.2 to 3.12.3, preparing for a new release. No other changes included.
2026-03-11 14:19:15 +01:00
06c2a07fbc Replace DateTime.UtcNow with DateTime.Now for timestamps
Switched all audit and creation timestamps from UTC to local time
by replacing DateTime.UtcNow with DateTime.Now across the codebase.
This affects audit fields, object creation, and default values for
date/time properties.
2026-03-11 14:11:23 +01:00
7cb1546934 Add Reject endpoint to AnnotationController
Introduced a new Reject endpoint for users with the ReceiverFull role to reject annotations, with optional reason support. Marked the endpoint as obsolete for future exception handling updates. Also standardized the Unauthorized response to remove the custom error message.
2026-03-11 12:09:23 +01:00
60db762bcc Bump project version to 3.12.2
Updated EnvelopeGenerator.Web.csproj to increment <Version>, <AssemblyVersion>, and <FileVersion> from 3.12.1 to 3.12.2, reflecting the new release. No other changes were made.
2026-03-11 12:08:48 +01:00
5e840db04c Refactor envelope rejection logic in EnvelopeController
Clarified and streamlined the handling of rejected envelopes:
- Moved retrieval of rejecting receivers for clarity.
- Signed out users when any rejecting receivers are present.
- Improved determination of "external" users.
- Updated condition for showing the EnvelopeRejected view.
- Temporarily hardcoded ViewBag.IsExt with a TODO for future fix.
- Removed redundant code for better maintainability.
2026-03-11 12:05:20 +01:00
e724a74f9c Bump version to 3.12.1 in project file
Updated <Version>, <AssemblyVersion>, and <FileVersion> in EnvelopeGenerator.Web.csproj from 3.12.0 to 3.12.1 to reflect a new patch release. No other changes were made.
2026-03-11 11:19:17 +01:00
48b7afcdc1 Restrict rejection check to ReadAndSign envelopes
Previously, rejection logic was applied to all envelopes. Now, the check for rejected receivers and the "EnvelopeRejected" view are only executed if the envelope is of the "ReadAndSign" type, preventing unnecessary rejection handling for other envelope types.
2026-03-11 11:16:08 +01:00
717da90c01 Add .NET 7.0 support and update project dependencies
Added net7.0 to TargetFrameworks in EnvelopeGenerator.Web.csproj and introduced a conditional ItemGroup with required package references for .NET 7.0 compatibility. Also removed clipboard2.svg from the list of included static files.
2026-03-11 11:07:33 +01:00
8054bb377d Refine rejection check for read-and-sign envelopes
Only return 423 Locked if envelope is read-and-sign and has a rejection history. Also add missing using for Domain.Interfaces in AnnotationController.
2026-03-11 09:43:35 +01:00
200258ff73 Update EnvelopeDto.ReadOnly to use IsReadAndConfirm()
Refactored the ReadOnly property in EnvelopeDto to use the IsReadAndConfirm() extension method instead of directly checking EnvelopeTypeId. Marked the property as [Obsolete] and advised using EnvelopeExtensions.IsReadAndConfirm.
2026-03-11 09:43:22 +01:00
fa73d939b5 Only check rejection for read-and-sign envelopes
Previously, rejection checks were performed for all envelopes. Now, the code checks for rejecting receivers only if the envelope is of the "read-and-sign" type, avoiding unnecessary queries and logic for other envelope types.
2026-03-11 09:29:24 +01:00
ca9e25abcb Add IsReadAndSign extension method to IEnvelope
Introduced the IsReadAndSign method to IEnvelope extensions, which returns true when EnvelopeTypeId is not 2. This allows clear differentiation between "Read and Sign" and "Read and Confirm" envelope types.
2026-03-11 09:28:40 +01:00
82831991b0 Merge branch 'master' of http://git.dd:3000/AppStd/EnvelopeGenerator 2026-03-10 13:21:13 +01:00
OlgunR
260e8d53ba Update 'SignatureConfirmed' localization strings
Changed 'SignatureConfirmed' value in English to "Finalization confirmed" and in German to "Abschluss bestätigt". Updated designer file comments to match new wording.
2026-03-10 12:45:56 +01:00
OlgunR
0fd174ee0c Update resource strings and comments for read confirmation in Domain.Resources.Model
Switched Model.Designer.cs comments from German to English and added new resource string properties for read confirmation workflows. Updated Model.resx and Model.en.resx with new and corrected entries, improved translation consistency, and clarified documentation.
2026-03-10 11:55:57 +01:00
OlgunR
ab4cd7c254 Update resources for confirmation workflows & English comments in CommonService.Strings.Model
Replaced German comments/descriptions with English for clarity and internationalization. Added new resource strings for confirmation/read confirmation statuses (e.g., CompletelyConfirmed, Confirmation, DocumentConfirmed, etc.) to support both signing and read confirmation workflows. Corrected and standardized several existing resource values for consistency across languages.
2026-03-10 10:54:52 +01:00
1f5468b1ac Refactor PDF canvas transform to use Save/Restore state
Move Y-axis flip transform inside signature drawing block and
wrap with SaveState/RestoreState to prevent side effects on
other drawing operations and pages. Removes redundant
page-level transformation for better encapsulation.
2026-03-10 04:07:37 +01:00
b20aafe7a5 Fix PDF/A conversion status check in PDFMerger
Previously, the code checked the status of the original document
after converting the merged PDF to PDF/A, which could miss
conversion errors. Now, it correctly checks the status of the
merged PDF to ensure the conversion succeeded.
2026-03-10 04:07:28 +01:00
466d0a3a7a Refactor envelope and annotation data retrieval logic
Add private helper functions ReadEnvelope and LoadAnnotationDataForEnvelope to centralize retrieval of envelope byte data and annotation JSON from the database. Update PDF annotation burning logic to use these helpers, improving code reuse and testability.
2026-03-10 04:07:14 +01:00
7281cb47c3 Remove duplicate ProjectReference in BBTests.vbproj
Eliminated a redundant ProjectReference to EnvelopeGenerator.CommonServices.vbproj from the EnvelopeGenerator.BBTests.vbproj file, ensuring only a single reference remains. This helps prevent potential build issues and maintains project file clarity.
2026-03-10 03:25:38 +01:00
eb5db3d6be Remove StatusChangedWhen from DocumentStatus entity
The StatusChangedWhen property, previously required and mapped
to the "STATUS_CHANGED_WHEN" column, has been removed from
the DocumentStatus entity in the EnvelopeGenerator.Domain.Entities
namespace. This change simplifies the entity and its mapping.
2026-03-10 02:44:12 +01:00
8a534b84d0 Update NuGet packages and binding redirects to latest versions
Updated NuGet package references and assembly binding redirects in App.config, EnvelopeGenerator.Service.vbproj, and packages.config to newer versions compatible with .NET 4.8/4.6.2/4.6.3. No application logic changes; these updates ensure dependency consistency and improved framework compatibility.
2026-03-10 02:17:17 +01:00
c523153654 Add "Full Finalize Test" button for PDF finalization debug
Added a new "Full Finalize Test" button to frmFinalizePDF, along with its event handler. The handler loads annotation data, document bytes, and related entities, logs detailed information about the envelope and signatures, and tests the PDF annotation burning process. The result is saved to the desktop and opened automatically. Also added necessary repository/entity imports for EF Core access. This feature aids in debugging and verifying the full PDF finalization workflow.
2026-03-10 02:16:58 +01:00
82c85643c8 Add EF Core, SqlClient, and Microsoft.Extensions packages
Updated .vbproj and packages.config to include references and NuGet packages for Microsoft.Data.SqlClient, Entity Framework Core, AutoMapper, and various Microsoft.Extensions libraries (configuration, logging, caching, options). Added import and error checks for SqlClient SNI targets. No source code changes; all updates are related to project and package management.
2026-03-10 01:45:46 +01:00
69892d566c Add System.ComponentModel.Annotations reference to project
Added a reference to System.ComponentModel.Annotations v4.2.1.0 in EnvelopeGenerator.Service.vbproj, specifying the HintPath to the appropriate DLL in the packages directory. This enables use of additional data annotation attributes in the project.
2026-03-10 01:23:26 +01:00
2f41348c59 Add System.ComponentModel.Annotations NuGet package
Added System.ComponentModel.Annotations v4.7.0 to support data validation and metadata attributes in .NET Framework 4.8 projects.
2026-03-10 01:23:06 +01:00
0d56ac7448 Downgrade several NuGet package dependencies
Reverted multiple packages in packages.config to earlier versions, including EntityFramework, System.Text.Json, System.Buffers, and others. These downgrades address compatibility issues and ensure alignment with other project dependencies.
2026-03-10 00:02:32 +01:00
18a563ecd1 Improve annotation handling and date retrieval robustness
Refactored annotation processing in PDFBurner.vb to handle null elements and annotations safely, preventing possible errors and improving code clarity. Updated GetSignedDate in ReceiverModel.vb to ensure consistent DateTime return values, handle DBNull and type conversions, and improve error handling.
2026-03-10 00:02:22 +01:00
73df248d15 Update System.Text.Json to 8.0.6 and enhance ClickOnce config
- Upgraded System.Text.Json NuGet package and binding redirects to 8.0.6.
- Updated project references to use System.Text.Json 8.0.0.6.
- Enhanced ClickOnce publishing settings: set PublishUrl, enabled autorun, completed wizard, and added manifest signing with a temporary key.
- Minor formatting and property order adjustments in the project file.
2026-03-09 22:50:55 +01:00
7c7674c822 Show "Confirmed by" or "Signed by" label conditionally
The signature label now displays "Confirmed by" if READ_AND_CONFIRM is true, otherwise "Signed by". This uses the appropriate localized string when available, defaulting to "Signed by" if not. Previously, only "Signed by" was shown.
2026-03-06 12:55:30 +01:00
65f606f573 Update finalize dialog text based on READ_AND_CONFIRM flag
The confirmation dialog when finalizing a document now displays
context-appropriate text depending on the READ_AND_CONFIRM flag.
If true, it shows localized.confirmAgree; otherwise, it shows
localized.sigAgree, improving clarity for different workflows.
2026-03-06 12:55:19 +01:00
218 changed files with 25840 additions and 2136 deletions

424
COPILOT_CONTEXT.md Normal file
View File

@@ -0,0 +1,424 @@
# EnvelopeGenerator — AI Context Reference
## Purpose
Digital document signing system with **unified Blazor WASM frontend** for both Senders and Receivers. Senders create envelopes and place signature fields. Receivers view PDFs, sign documents, export stamped PDFs.
**Primary Libraries:** DevExpress + PDF.js (PSPDFKit removed)
---
## Deployment Architecture
**Two Presentation Projects (Both Required):**
1. **EnvelopeGenerator.API** (ASP.NET Core Web API)
- Runs independently (development & production)
- **YARP Reverse Proxy** configured via `yarp.json`
- Proxies requests to:
- `EnvelopeGenerator.ReceiverUI` (Blazor WASM)
- External Auth.API service
- Serves as single entry point for all requests
2. **EnvelopeGenerator.ReceiverUI** (Blazor WebAssembly)
- Runs on separate host/port
- Accessed **only through API proxy** (not directly)
- Serves static files (HTML, JS, CSS, WASM)
**Request Flow:**
```
Client ? API:8088 (YARP Proxy) ? ReceiverUI:52936 (Blazor WASM)
? Auth.API:9090 (External Auth Service)
```
**Configuration:** `EnvelopeGenerator.API/yarp.json`
---
## ReceiverUI Route Structure
### Root Route
| Route | File | Purpose |
|---|---|---|
| `/` | `Index.razor` | Application entry point (landing page). |
### Sender Routes
| Route | File | Purpose |
|---|---|---|
| `/sender/login` | `LoginSenderPage.razor` | Username/password authentication |
| `/sender` | `EnvelopeSenderPage.razor` | Sender dashboard (envelope list) |
### Receiver Routes
| Route | File | Purpose |
|---|---|---|
| `/envelope/login/{EnvelopeKey}` | `LoginReceiverPage.razor` | Access code authentication for specific envelope |
| `/envelope/{EnvelopeKey}` | `EnvelopeReceiverPage.razor` | View & sign envelope (PDF.js viewer) |
**Multi-Envelope Support:** Receivers can login to multiple envelopes simultaneously (per-envelope cookie authentication).
---
## Architecture Evolution
### Old Architecture (Deprecated)
- **Sender UI:** `EnvelopeGenerator.Web` (Razor Pages + PSPDFKit)
- **Receiver UI:** `EnvelopeGenerator.ReceiverUI` (Blazor WASM + PDF.js)
- **Backend:** `EnvelopeGenerator.API`
### Current Architecture
- **Unified Frontend:** `EnvelopeGenerator.ReceiverUI` (Blazor WASM) — **Both Senders & Receivers**
- **Backend:** `EnvelopeGenerator.API`**Both Senders & Receivers**
- **Libraries:** DevExpress + PDF.js
- **PSPDFKit:** **REMOVED**
---
## Solution Structure
| Project | Target | Purpose |
|---|---|---|
| `EnvelopeGenerator.API` | net8.0 | ASP.NET Core Web API. Backend for **both Senders & Receivers**. Auth, PDF serving, signature endpoints. |
| `EnvelopeGenerator.ReceiverUI` | net8.0 WASM | **Unified Blazor WebAssembly Frontend**. UI for **both Senders & Receivers**. YARP proxy to API. |
| `EnvelopeGenerator.Web` | net7/8/9 | **DEPRECATED.** Legacy Razor Pages (Sender UI). No longer used. |
| `EnvelopeGenerator.Application` | multi | MediatR CQRS handlers. Business logic. |
| `EnvelopeGenerator.Domain` | multi | Domain models, constants, interfaces. |
| `EnvelopeGenerator.Infrastructure` | multi | EF Core repos, DB context. |
| `EnvelopeGenerator.PdfEditor` | multi | iText7 utilities (NOT used in ReceiverUI). |
| `EnvelopeGenerator.DependencyInjection` | multi | DI registration helpers. |
| **VB.NET projects** (Service/Form/BBTests) | net462 | **Legacy. Do NOT touch.** |
---
## Key Files & Routes
| File | Route/Purpose |
|---|---|
| `ReceiverUI/Pages/Index.razor` | `/` — Application entry point (landing page). |
| `ReceiverUI/Pages/EnvelopeSenderPage.razor` | `/sender` — Sender dashboard (envelope list). |
| `ReceiverUI/Pages/EnvelopeReceiverPage.razor` | `/envelope/{key}` — Receiver PDF viewer & signing. |
| `ReceiverUI/Pages/LoginSenderPage.razor` | `/sender/login` — Sender username/password auth. |
| `ReceiverUI/Pages/LoginReceiverPage.razor` | `/envelope/login/{EnvelopeKey}` — Receiver access code auth. |
| `ReceiverUI/wwwroot/js/pdf-viewer.js` | PDF.js wrapper (zoom, pagination, thumbnails). |
| `ReceiverUI/wwwroot/js/receiver-signature.js` | Signature pad (draw/type/image). |
| `ReceiverUI/wwwroot/css/envelope-viewer.css` | EnvelopeViewer styles. |
| `ReceiverUI/Services/AuthService.cs` | Receiver + Sender authentication. |
| `ReceiverUI/Services/SignatureCacheService.cs` | Signature caching (Redis/SQL). |
| `API/Controllers/CacheController.cs` | Signature cache endpoints. |
---
## Coordinate System — CRITICAL
**Database Format:** INCHES (GdPicture14 native)
**Origin:** Top-left corner
**Axes:** X right, Y down
### Conversion Formulas
| From INCHES to | Formula | Example |
|---|---|---|
| **DevExpress DX** | `x_DX = x_inches * 100` | 1.5" ? 150 DX |
| **PDF Points** | `x_pt = x_inches * 72` | 1.5" ? 108 pt |
| **PDF.js Pixels** | Normalize ? scale | `(x_inches / pageWidth) * canvasWidth * scale` |
**A4 Dimensions:**
- Width: 8.27" = 595pt = 827 DX
- Height: 11.69" = 842pt = 1169 DX
### Unit Systems
| System | Unit | Origin | Y-Axis |
|---|---|---|---|
| **Database (GdPicture14)** | Inches | Top-left | Down |
| PDF.js | Pixels | Top-left | Down |
| iText7 PDF | Points (1/72") | **Bottom-left** | **Up** (flip required) |
| ~~PSPDFKit~~ | ~~Points~~ | ~~Top-left~~ | **REMOVED** |
---
## EnvelopeReceiver — PDF.js Viewer & Signing
**Route:** `/envelope/{EnvelopeKey}`
**Tech:** PDF.js 3.11.174 + Blazor WASM + configurable quality
**File:** `ReceiverUI/Pages/EnvelopeReceiverPage.razor`
### Key Features
1. HiDPI/Retina support (4x quality)
2. Configurable quality (`appsettings.json`)
3. Unlimited zoom (50%-300%)
4. Ctrl+Wheel global zoom
5. Resizable thumbnail sidebar (150-400px, localStorage)
6. Responsive (desktop/mobile)
### Configuration
**File:** `ReceiverUI/wwwroot/appsettings.json`
```json
{
"PdfViewer": {
"ThumbnailBaseScale": 0.75,
"ThumbnailEnableHiDPI": true,
"MainCanvasEnableHiDPI": true,
"ZoomStepPercentage": 5
}
}
```
### JavaScript API
**File:** `ReceiverUI/wwwroot/js/pdf-viewer.js`
```javascript
window.pdfViewer = {
initialize(canvasId, pdfDataUrl, dotNetRef),
renderPage(num),
renderSignatureButtons(signatures, pageNum, dotNetRef),
applySignature(signatureId, dataUrl, fullName, position, place),
zoomIn(), zoomOut(), dispose()
}
```
---
## Signature Workflow — EnvelopeReceiver
**IMPORTANT:** iText7 NOT used (GPL license issue). Client-side overlay system only.
### Workflow Steps
1. **Page Load:**
- Check `SignatureCacheService` for cached signature
- If cached ? skip popup, load signature
- If not ? show automatic popup (mandatory)
2. **Signature Popup (DxPopup):**
- **Cannot close** (no X, no ESC, no outside-click)
- **3 Tabs:** Draw (canvas) / Text (font select) / Image (upload)
- **Required:** Full name, Place
- **Optional:** Position
- **Save ?** Store in `_capturedSignature`, cache via API
3. **Signature Buttons:**
- Render purple "Unterschreiben" buttons at signature field positions
- Coordinates: INCHES ? POINTS ? Pixels (scaled)
- File: `pdf-viewer.js` ? `renderSignatureButtons()`
4. **Apply Signature (Click "Unterschreiben"):**
- JS: Remove button, create HTML overlay
- Format: Image + separator + text (Name, Position, Place, Date)
- **NOT stamped on PDF bytes** (visual overlay only)
5. **Re-rendering:**
- Zoom/Page change ? recalculate button positions
- Session state: `_capturedSignature` (lost on refresh)
### Data Model
**File:** `ReceiverUI/Models/SignatureCaptureDto.cs`
```csharp
public sealed record SignatureCaptureDto {
public required string DataUrl { get; init; } // base64 PNG
public required string FullName { get; init; }
public string Position { get; init; } = ""; // Optional
public required string Place { get; init; }
}
```
---
## Signature Caching
**Purpose:** Persist signature across page refreshes (distributed cache: Redis/SQL)
### API Endpoints
**Controller:** `API/Controllers/CacheController.cs`
- `POST /api/Cache/SignatureCapture/{envelopeKey}` — Save
- `GET /api/Cache/SignatureCapture/{envelopeKey}` — Load
- `DELETE /api/Cache/SignatureCapture/{envelopeKey}` — Delete
**Cache Key Format:**
```
signature:91751687-8ae6-4777-bf5f-b8846085e62e:{envelopeKey}
```
**Configuration:** `appsettings.json`
```json
{
"Cache": {
"SignatureCacheExpiration": null // or "02:00:00" for 2h
}
}
```
### Service
**File:** `ReceiverUI/Services/SignatureCacheService.cs`
```csharp
public class SignatureCacheService {
Task SaveSignatureAsync(string envelopeKey, SignatureCaptureDto signature);
Task<SignatureCaptureDto?> GetSignatureAsync(string envelopeKey);
Task DeleteSignatureAsync(string envelopeKey);
}
```
**Error Handling:** Fire-and-forget saves, graceful degradation on load failure.
---
## Sender Login
**Route:** `/sender/login`
**File:** `ReceiverUI/Pages/LoginSenderPage.razor`
**Tech:** Bootstrap 5 + DevExpress Blazing Berry theme
### AuthService Extension
**File:** `ReceiverUI/Services/AuthService.cs`
```csharp
public enum SenderLoginResult { Success, InvalidCredentials, Error }
public async Task<SenderLoginResult> LoginSenderAsync(string username, string password) {
var response = await http.PostAsJsonAsync(
$"{_api.BaseUrl}/api/auth?cookie=true",
new { username, password });
return response.StatusCode switch {
HttpStatusCode.OK => SenderLoginResult.Success,
HttpStatusCode.Unauthorized => SenderLoginResult.InvalidCredentials,
_ => SenderLoginResult.Error
};
}
```
### API Integration
**Endpoint:** `POST /api/auth?cookie=true`
**Request:**
```json
{ "username": "TekH", "password": "***" }
```
**Response:**
- `200 OK` ? Cookie set, redirect to `/sender`
- `401 Unauthorized` ? Show error: "Ungültige Anmeldedaten"
- Other ? Show error: "Serverfehler"
**Cookie:** HTTP-only, Secure (HTTPS), SameSite=Strict
### UI Flow
1. User enters username + password
2. Click "Anmelden" or press Enter
3. Call `AuthService.LoginSenderAsync()`
4. Success ? `Navigation.NavigateTo("/sender", forceLoad: true)`
5. Error ? Display alert
---
## Receiver Login
**Route:** `/envelope/login/{EnvelopeKey}`
**File:** `ReceiverUI/Pages/LoginReceiverPage.razor`
**Multi-Envelope Support:** Cookies are stored per-envelope (e.g., `AuthTokenSignFLOWReceiver.{envelopeKey}`), allowing simultaneous authentication for multiple envelopes in the same browser session.
### AuthService Method
```csharp
public enum EnvelopeLoginResult { Success, InvalidCode, NotFound, Error }
public async Task<EnvelopeLoginResult> LoginEnvelopeReceiverAsync(string key, string accessCode) {
var form = new MultipartFormDataContent();
form.Add(new StringContent(accessCode), "AccessCode");
var response = await http.PostAsync(
$"{_api.BaseUrl}/api/Auth/envelope-receiver/{Uri.EscapeDataString(key)}", form);
return response.StatusCode switch {
HttpStatusCode.OK => EnvelopeLoginResult.Success,
HttpStatusCode.Unauthorized => EnvelopeLoginResult.InvalidCode,
HttpStatusCode.NotFound => EnvelopeLoginResult.NotFound,
_ => EnvelopeLoginResult.Error
};
}
```
**Success:** Redirect to `/envelope/{key}`
---
## NuGet Packages (ReceiverUI)
| Package | Version | Purpose |
|---|---|---|
| `DevExpress.Blazor.*` | 25.2.3 | UI components (grids, popups, etc.) |
| `SkiaSharp.*` | 3.119.1 | WASM rendering |
| ~~`itext`~~ | ~~8.0.5~~ | **NOT USED** (GPL license) |
**External CDN:**
- PDF.js 3.11.174: `https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.11.174/pdf.min.js`
---
## Mistakes History — Do NOT Repeat
| Mistake | Why Wrong |
|---|---|
| Using iText7 in EnvelopeReceiver | GPL license issue. Use overlay system instead. |
| Using PSPDFKit | Removed from architecture. Use PDF.js + DevExpress. |
| Hardcoded quality values in PDF.js | Use `appsettings.json` for configurability. |
| Complex toolbar layouts | User wants simplicity. Keep horizontal layout. |
| Over-designed UI (gradients/badges) | User prefers simple text labels. |
| Ignoring "revert" instructions | Revert HTML structure, not just CSS. |
| `BottomMarginBand` for signatures | Repeats on every page. Use DetailBand. |
| `imageY = (page-1) * 1169 + ann.Y` | Inflates DetailBand. Calculate per-page. |
---
## Development Notes
### Deprecated Projects
**DO NOT USE:**
- `EnvelopeGenerator.Web` (Razor Pages) — Replaced by unified ReceiverUI
- PSPDFKit — Removed, use PDF.js + DevExpress instead
### Legacy Projects (VB.NET)
**DO NOT TOUCH:** `EnvelopeGenerator.Service`, `EnvelopeGenerator.Form`, `EnvelopeGenerator.BBTests`
### Signature Coordinate Evidence
**File:** `EnvelopeGenerator.Form/frmFieldEditor.vb` (VB.NET)
```vb
Private Const SIGNATURE_WIDTH As Single = 1.77 ' inches
Private Const SIGNATURE_HEIGHT As Single = 1.96 ' inches
Sub LoadAnnotation(pElement As Signature, ...)
oAnnotation.Left = CSng(pElement.X) ' Direct INCHES assignment
oAnnotation.Top = CSng(pElement.Y)
End Sub
```
Proves database uses INCHES natively.
---
## Quick Reference
### When working with coordinates:
1. **Database ? UI:** INCHES × 72 = PDF Points
2. **UI ? Display:** Points × scale = Pixels
3. **iText7 stamping:** Flip Y-axis (top-down ? bottom-up)
### When adding features:
1. Check `Mistakes History` first
2. Prefer simplicity over complexity
3. Use `appsettings.json` for configuration
4. Keep consistent with existing design (Bootstrap 5 + Blazing Berry)
5. **Unified frontend:** ReceiverUI serves both Senders and Receivers
### When debugging:
1. **Coordinates:** Always check unit system (inches/points/pixels)
2. **Authentication:** Check cookie name/domain/SameSite
3. **Cache:** Check Redis/SQL connection + key format
4. **Frontend confusion:** Only use ReceiverUI (Web is deprecated)
---
**Last Updated:** Session 19 (Razor file naming convention + Index route proxy)

View File

@@ -0,0 +1,17 @@
namespace EnvelopeGenerator.API;
/// <summary>
///
/// </summary>
public static class AuthScheme
{
/// <summary>
/// Scheme name used for per-envelope receiver JWT authentication.
/// </summary>
public const string Receiver = "EnvelopeGenerator.API.ReceiverJWT";
/// <summary>
/// Scheme name used for per-envelope sender JWT authentication.
/// </summary>
public const string Sender = "EnvelopeGenerator.API.SenderJWT";
}

View File

@@ -1,12 +1,14 @@
using DigitalData.Core.Abstraction.Application.DTO;
using DigitalData.Core.Exceptions;
using EnvelopeGenerator.API.Extensions;
using EnvelopeGenerator.Application.Common.Dto;
using EnvelopeGenerator.Application.Common.Extensions;
using EnvelopeGenerator.Application.Common.Interfaces.Services;
using EnvelopeGenerator.Application.Common.Notifications.DocSigned;
using EnvelopeGenerator.Application.Common.Notifications.RemoveSignature;
using EnvelopeGenerator.Application.EnvelopeReceivers.Queries;
using EnvelopeGenerator.Application.Histories.Queries;
using EnvelopeGenerator.Domain.Constants;
using EnvelopeGenerator.API.Extensions;
using MediatR;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.Cookies;
@@ -59,8 +61,8 @@ public class AnnotationController : ControllerBase
[Obsolete("PSPDF Kit will no longer be used.")]
public async Task<IActionResult> CreateOrUpdate([FromBody] PsPdfKitAnnotation? psPdfKitAnnotation = null, CancellationToken cancel = default)
{
var signature = User.GetReceiverSignatureOfReceiver();
var uuid = User.GetEnvelopeUuidOfReceiver();
var signature = User.ReceiverSignature();
var uuid = User.EnvelopeUuid();
var envelopeReceiver = await _mediator.ReadEnvelopeReceiverAsync(uuid, signature, cancel).ThrowIfNull(Exceptions.NotFound);
@@ -72,12 +74,24 @@ public class AnnotationController : ControllerBase
else if (await _mediator.AnyHistoryAsync(uuid, new[] { EnvelopeStatus.EnvelopeRejected, EnvelopeStatus.DocumentRejected }, cancel))
return Problem(statusCode: StatusCodes.Status423Locked);
var docSignedNotification = await _mediator
.ReadEnvelopeReceiverAsync(uuid, signature, cancel)
.ToDocSignedNotification(psPdfKitAnnotation)
?? throw new NotFoundException("Envelope receiver is not found.");
var envelopeReceiverDto = await _mediator.ReadEnvelopeReceiverAsync(uuid, signature, cancel);
var docSignedNotification = envelopeReceiverDto is not null
? new DocSignedNotification { EnvelopeReceiver = envelopeReceiverDto, PsPdfKitAnnotation = psPdfKitAnnotation }
: throw new NotFoundException("Envelope receiver is not found.");
await _mediator.PublishSafely(docSignedNotification, cancel);
try
{
await _mediator.Publish(docSignedNotification, cancel);
}
catch (Exception)
{
await _mediator.Publish(new RemoveSignatureNotification()
{
EnvelopeId = docSignedNotification.EnvelopeReceiver.EnvelopeId,
ReceiverId = docSignedNotification.EnvelopeReceiver.ReceiverId
}, cancel);
throw;
}
await HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
return Ok();
@@ -92,9 +106,9 @@ public class AnnotationController : ControllerBase
[Obsolete("Use MediatR")]
public async Task<IActionResult> Reject([FromBody] string? reason = null)
{
var signature = User.GetReceiverSignatureOfReceiver();
var uuid = User.GetEnvelopeUuidOfReceiver();
var mail = User.GetReceiverMailOfReceiver();
var signature = User.ReceiverSignature();
var uuid = User.EnvelopeUuid();
var mail = User.ReceiverMail();
var envRcvRes = await _envelopeReceiverService.ReadByUuidSignatureAsync(uuid: uuid, signature: signature);

View File

@@ -1,3 +1,4 @@
using DigitalData.Auth.Claims;
using EnvelopeGenerator.API.Controllers.Interfaces;
using EnvelopeGenerator.API.Models;
using EnvelopeGenerator.Domain.Constants;
@@ -73,4 +74,44 @@ public partial class AuthController(IOptions<AuthTokenKeys> authTokenKeyOptions,
=> role is not null && !User.IsInRole(role)
? Unauthorized()
: Ok();
/// <summary>
/// Checks whether the caller holds a valid per-envelope receiver token for the given envelope key.
/// The request must carry a cookie named <c>AuthTokenSignFLOWReceiver.{envelopeKey}</c>.
/// </summary>
/// <param name="envelopeKey">The unique envelope key extracted from the route.</param>
/// <response code="200">Valid per-envelope token found.</response>
/// <response code="401">Token is missing, expired or invalid.</response>
[ProducesResponseType(typeof(void), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(void), StatusCodes.Status401Unauthorized)]
[Authorize(Policy = AuthPolicy.Receiver)]
[HttpGet("check/envelope/{envelopeKey}")]
public IActionResult CheckEnvelopeReceiver([FromRoute] string envelopeKey) => Ok();
/// <summary>
/// Removes the per-envelope receiver cookie for the given envelope key.
/// </summary>
/// <param name="envelopeKey">The unique envelope key whose cookie should be deleted.</param>
/// <response code="200">Cookie successfully deleted.</response>
[ProducesResponseType(typeof(void), StatusCodes.Status200OK)]
[HttpPost("logout/envelope/{envelopeKey}")]
public IActionResult LogoutEnvelopeReceiver([FromRoute] string envelopeKey)
{
var cookieName = CookieNames.GetEnvelopeReceiverCookieName(authTokenKeys.Cookie, envelopeKey);
Response.Cookies.Delete(cookieName);
return Ok();
}
/// <summary>
/// Removes all per-envelope receiver cookies from the current request.
/// </summary>
/// <response code="200">All envelope receiver cookies successfully deleted.</response>
[ProducesResponseType(typeof(void), StatusCodes.Status200OK)]
[HttpPost("logout/envelope")]
public IActionResult LogoutAllEnvelopeReceivers()
{
foreach (var cookieName in Request.Cookies.Keys.Where(k => CookieNames.IsEnvelopeReceiverCookie(k, authTokenKeys.Cookie)))
Response.Cookies.Delete(cookieName);
return Ok();
}
}

View File

@@ -0,0 +1,84 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Caching.Distributed;
using Microsoft.Extensions.Options;
using System.Text.Json;
using EnvelopeGenerator.API.Options;
using EnvelopeGenerator.Domain.Constants;
using EnvelopeGenerator.API.Extensions;
namespace EnvelopeGenerator.API.Controllers;
/// <summary>
/// Manages cached data for receivers using distributed cache.
/// </summary>
[ApiController]
[Route("api/[controller]")]
[Authorize(Policy = AuthPolicy.Receiver)]
public class CacheController(
IDistributedCache cache,
IOptions<CacheOptions> cacheOptions) : ControllerBase
{
private const string SignatureCacheKeyPrefix = "envelope-generator.receiver-ui.signature:";
/// <summary>
/// Stores a receiver's signature in cache for the specified envelope.
/// </summary>
[Authorize(Policy = AuthPolicy.Receiver)]
[HttpPost("SignatureCapture/{envelopeKey}")]
public async Task<IActionResult> SaveSignature(
[FromRoute] string envelopeKey,
[FromBody] SignatureCacheRequest request,
CancellationToken cancel)
{
var cacheKey = $"{SignatureCacheKeyPrefix}{User.ReceiverSignature()}";
var json = JsonSerializer.Serialize(request);
var options = cacheOptions.Value.SignatureCacheExpiration.HasValue
? new DistributedCacheEntryOptions { AbsoluteExpirationRelativeToNow = cacheOptions.Value.SignatureCacheExpiration.Value }
: null;
await cache.SetStringAsync(cacheKey, json, options ?? new DistributedCacheEntryOptions(), cancel);
return Ok();
}
/// <summary>
/// Retrieves a cached signature for the specified envelope.
/// </summary>
[Authorize(Policy = AuthPolicy.Receiver)]
[HttpGet("SignatureCapture/{envelopeKey}")]
public async Task<IActionResult> GetSignature([FromRoute] string envelopeKey, CancellationToken cancel)
{
var cacheKey = $"{SignatureCacheKeyPrefix}{User.ReceiverSignature()}";
var json = await cache.GetStringAsync(cacheKey, cancel);
if (json is null)
return NotFound();
var signature = JsonSerializer.Deserialize<SignatureCacheRequest>(json);
return Ok(signature);
}
/// <summary>
/// Deletes a cached signature for the specified envelope.
/// </summary>
[Authorize(Policy = AuthPolicy.Receiver)]
[HttpDelete("SignatureCapture/{envelopeKey}")]
public async Task<IActionResult> DeleteSignature([FromRoute] string envelopeKey, CancellationToken cancel)
{
var cacheKey = $"{SignatureCacheKeyPrefix}{User.ReceiverSignature()}";
await cache.RemoveAsync(cacheKey, cancel);
return Ok();
}
}
/// <summary>
/// Request model for caching signature data.
/// </summary>
public sealed record SignatureCacheRequest(
string DataUrl,
string FullName,
string Place,
string? Position = null);

View File

@@ -1,3 +1,4 @@
using DigitalData.Auth.Claims;
using EnvelopeGenerator.API.Controllers.Interfaces;
using EnvelopeGenerator.API.Extensions;
using EnvelopeGenerator.Application.Documents.Queries;
@@ -14,10 +15,9 @@ namespace EnvelopeGenerator.API.Controllers;
/// <remarks>
/// Initializes a new instance of the <see cref="DocumentController"/> class.
/// </remarks>
[Authorize]
[ApiController]
[Route("api/[controller]")]
public class DocumentController(IMediator mediator, IAuthorizationService authService) : ControllerBase, IAuthController
public class DocumentController(IMediator mediator, IAuthorizationService authService, ILogger<DocumentController> logger) : ControllerBase, IAuthController
{
/// <summary>
///
@@ -51,7 +51,7 @@ public class DocumentController(IMediator mediator, IAuthorizationService authSe
if (query is not null)
return BadRequest("Query parameters are not allowed for receiver role.");
var envelopeId = User.GetEnvelopeIdOfReceiver();
var envelopeId = User.EnvelopeId();
var receiverDoc = await mediator.Send(new ReadDocumentQuery { EnvelopeId = envelopeId }, cancel);
return receiverDoc.ByteData is byte[] receiverDocByte
? File(receiverDocByte, "application/octet-stream")
@@ -60,4 +60,25 @@ public class DocumentController(IMediator mediator, IAuthorizationService authSe
return Unauthorized();
}
/// <summary>
/// Gets the document for the specified envelope key.
/// </summary>
/// <param name="envelopeKey"></param>
/// <param name="cancel"></param>
/// <returns></returns>
[Authorize(Policy = AuthPolicy.Receiver)]
[HttpGet("{envelopeKey}")]
public async Task<IActionResult> GetDocumentOfReceiver(string envelopeKey, CancellationToken cancel)
{
int envelopeId = User.EnvelopeId();
var senderDoc = await mediator.Send(new ReadDocumentQuery() { EnvelopeId = envelopeId }, cancel);
if (senderDoc.ByteData is not byte[] senderDocByte)
return NotFound("Document is empty.");
Response.Headers.ContentDisposition = $"inline; filename=\"{envelopeKey}.pdf\"";
return File(senderDocByte, "application/pdf");
}
}

View File

@@ -51,7 +51,7 @@ public class EnvelopeController : ControllerBase
/// <response code="401">Der Benutzer ist nicht authentifiziert.</response>
/// <response code="403">Der Benutzer hat keine Berechtigung, auf die Ressource zuzugreifen.</response>
/// <response code="500">Ein unerwarteter Fehler ist aufgetreten.</response>
[Authorize]
[Authorize(AuthenticationSchemes = AuthScheme.Sender)]
[HttpGet]
public async Task<IActionResult> GetAsync([FromQuery] ReadEnvelopeQuery envelope)
{
@@ -98,7 +98,7 @@ public class EnvelopeController : ControllerBase
[HttpPost]
public async Task<IActionResult> CreateAsync([FromBody] CreateEnvelopeCommand command)
{
var res = await _mediator.Send(command.Authorize(User.GetId()));
var res = await _mediator.Send(command.WithAuth(User.GetId()));
if (res is null)
{

View File

@@ -14,6 +14,7 @@ using EnvelopeGenerator.Application.Common.SQL;
using EnvelopeGenerator.Application.Common.Dto.Receiver;
using EnvelopeGenerator.Application.Common.Interfaces.SQLExecutor;
using EnvelopeGenerator.API.Extensions;
using EnvelopeGenerator.Domain.Constants;
namespace EnvelopeGenerator.API.Controllers;
@@ -73,6 +74,24 @@ public class EnvelopeReceiverController : ControllerBase
return Ok(result);
}
/// <summary>
///
/// </summary>
/// <param name="envelopeKey"></param>
/// <param name="cancel"></param>
/// <returns></returns>
[Authorize(Policy = AuthPolicy.Receiver)]
[HttpGet("{envelopeKey}")]
public async Task<IActionResult> GetEnvelopeReceiverOfReceiver([FromRoute] string envelopeKey, CancellationToken cancel)
{
var er = await _mediator.Send(new ReadEnvelopeReceiverQuery()
{
Key = envelopeKey
}, cancel);
return Ok(er.SingleOrDefault());
}
/// <summary>
/// Ruft den Namen des zuletzt verwendeten Empfängers basierend auf der angegebenen E-Mail-Adresse ab.
/// </summary>
@@ -181,7 +200,7 @@ public class EnvelopeReceiverController : ControllerBase
SELECT @OUT_SUCCESS as [@OUT_SUCCESS];";
foreach (var rcv in res.SentReceiver)
foreach (var sign in request.Receivers.Where(r => r.EmailAddress == rcv.EmailAddress).FirstOrDefault()?.Signatures ?? Enumerable.Empty<Application.EnvelopeReceivers.Commands.Signature>())
foreach (var sign in request.Receivers.Where(r => r.EmailAddress == rcv.EmailAddress).FirstOrDefault()?.DocReceiverElements ?? Enumerable.Empty<Application.EnvelopeReceivers.Commands.DocReceiverElementCreateDto>())
{
using SqlConnection conn = new(_cnnStr);
conn.Open();

View File

@@ -41,14 +41,14 @@ public class ReadOnlyController : ControllerBase
[Obsolete("Use MediatR")]
public async Task<IActionResult> CreateAsync([FromBody] EnvelopeReceiverReadOnlyCreateDto createDto)
{
var authReceiverMail = User.GetReceiverMailOfReceiver();
var authReceiverMail = User.ReceiverMail();
if (authReceiverMail is null)
{
_logger.LogError("EmailAddress claim is not found in envelope-receiver-read-only creation process. Create DTO is:\n {dto}", JsonConvert.SerializeObject(createDto));
return Unauthorized();
}
var envelopeId = User.GetEnvelopeIdOfReceiver();
var envelopeId = User.EnvelopeId();
createDto.AddedWho = authReceiverMail;
createDto.EnvelopeId = envelopeId;

View File

@@ -0,0 +1,57 @@
using EnvelopeGenerator.API.Extensions;
using EnvelopeGenerator.Application.Common.Dto;
using EnvelopeGenerator.Application.Common.Extensions;
using EnvelopeGenerator.Application.Documents.Queries;
using EnvelopeGenerator.Domain.Constants;
using MediatR;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.API.Controllers;
/// <summary>
///
/// </summary>
[Authorize(Policy = AuthPolicy.Receiver)]
[ApiController]
[Route("api/[controller]")]
public class SignatureController : ControllerBase
{
private readonly IMediator _mediator;
/// <summary>
/// Initializes a new instance of <see cref="SignatureController"/>.
/// </summary>
public SignatureController(IMediator mediator)
{
_mediator = mediator;
}
//TODO: update to use signature query
/// <summary>
///
/// </summary>
/// <param name="envelopeKey"></param>
/// <param name="cancel"></param>
/// <returns></returns>
[Authorize(Policy = AuthPolicy.Receiver)]
[HttpGet("{envelopeKey}")]
public async Task<IActionResult> Get(string envelopeKey, CancellationToken cancel)
{
int envelopeId = User.EnvelopeId();
int receiverId = User.ReceiverId();
var doc = await _mediator.Send(new ReadDocumentQuery() { EnvelopeId = envelopeId }, cancel);
if (doc.Elements is not IEnumerable<DocReceiverElementDto> docSignatures)
return NotFound("Document is empty.");
var rcvSignatures = docSignatures.Where(s => s.ReceiverId == receiverId).ToList();
if (rcvSignatures is null)
return NotFound("No signatures found for the current receiver.");
else
return Ok(rcvSignatures);
}
}

View File

@@ -16,6 +16,12 @@ public sealed class AuthProxyDocumentFilter : IDocumentFilter
/// <param name="swaggerDoc"></param>
/// <param name="context"></param>
public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context)
{
AddLoginOperation(swaggerDoc, context);
AddEnvelopeReceiverLoginOperation(swaggerDoc, context);
}
private static void AddLoginOperation(OpenApiDocument swaggerDoc, DocumentFilterContext context)
{
const string path = "/api/auth";
@@ -67,4 +73,51 @@ public sealed class AuthProxyDocumentFilter : IDocumentFilter
}
};
}
private static void AddEnvelopeReceiverLoginOperation(OpenApiDocument swaggerDoc, DocumentFilterContext context)
{
const string path = "/api/Auth/envelope-receiver/{key}";
var bodySchema = context.SchemaGenerator.GenerateSchema(typeof(EnvelopeReceiverLogin), context.SchemaRepository);
var operation = new OpenApiOperation
{
Summary = "Envelope receiver login (auth-hub proxy)",
Description = "Proxies the envelope receiver login to the auth service. " +
"The `cookie` query parameter is always forwarded as `true` so the auth service sets the per-envelope cookie automatically.",
Tags = [new() { Name = "Auth" }],
Parameters =
{
new OpenApiParameter
{
Name = "key",
In = ParameterLocation.Path,
Required = true,
Schema = new OpenApiSchema { Type = "string" },
Description = "The unique envelope receiver key."
}
},
RequestBody = new OpenApiRequestBody
{
Required = false,
Content =
{
["multipart/form-data"] = new OpenApiMediaType { Schema = bodySchema }
}
},
Responses =
{
["200"] = new OpenApiResponse { Description = "OK per-envelope cookie set by auth service." },
["401"] = new OpenApiResponse { Description = "Unauthorized invalid or missing access code." }
}
};
swaggerDoc.Paths[path] = new OpenApiPathItem
{
Operations =
{
[OperationType.Post] = operation
}
};
}
}

View File

@@ -1,17 +0,0 @@
namespace EnvelopeGenerator.API;
/// <summary>
/// Provides custom claim types for envelope-related information.
/// </summary>
public static class EnvelopeClaimTypes
{
/// <summary>
/// Claim type for the title of an envelope.
/// </summary>
public static readonly string Title = $"Envelope{nameof(Title)}";
/// <summary>
/// Claim type for the ID of an envelope.
/// </summary>
public static readonly string Id = $"Envelope{nameof(Id)}";
}

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFrameworks>net9.0</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
@@ -10,9 +10,9 @@
<Authors>Digital Data GmbH</Authors>
<Company>Digital Data GmbH</Company>
<Product>EnvelopeGenerator.GeneratorAPI</Product>
<Version>1.2.3</Version>
<FileVersion>1.2.3</FileVersion>
<AssemblyVersion>1.2.3</AssemblyVersion>
<Version>1.4.0</Version>
<FileVersion>1.4.0</FileVersion>
<AssemblyVersion>1.4.0</AssemblyVersion>
<PackageOutputPath>Copyright © 2025 Digital Data GmbH. All rights reserved.</PackageOutputPath>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
</PropertyGroup>
@@ -30,11 +30,17 @@
<ItemGroup>
<PackageReference Include="AspNetCore.Scalar" Version="1.1.8" />
<PackageReference Include="DigitalData.Auth.Claims" Version="1.0.3" />
<PackageReference Include="DigitalData.Auth.Client" Version="1.3.7" />
<PackageReference Include="DigitalData.Core.API" Version="2.2.1" />
<PackageReference Include="HtmlSanitizer" Version="9.0.892" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.6" />
<PackageReference Include="Microsoft.Extensions.Caching.SqlServer" Version="8.0.11" Condition="'$(TargetFramework)' == 'net8.0'" />
<PackageReference Include="itext" Version="8.0.5" />
<PackageReference Include="itext.bouncy-castle-adapter" Version="8.0.5" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.4" Condition="'$(TargetFramework)' == 'net9.0'" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.11" Condition="'$(TargetFramework)' == 'net8.0'" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.6" Condition="'$(TargetFramework)' == 'net9.0'" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.17" Condition="'$(TargetFramework)' == 'net8.0'" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.82.1" />
<PackageReference Include="NLog" Version="5.2.5" />
<PackageReference Include="NLog.Web.AspNetCore" Version="5.3.0" />
@@ -71,6 +77,7 @@
<ProjectReference Include="..\EnvelopeGenerator.Application\EnvelopeGenerator.Application.csproj" />
<ProjectReference Include="..\EnvelopeGenerator.Domain\EnvelopeGenerator.Domain.csproj" />
<ProjectReference Include="..\EnvelopeGenerator.Infrastructure\EnvelopeGenerator.Infrastructure.csproj" />
<ProjectReference Include="..\EnvelopeGenerator.PdfEditor\EnvelopeGenerator.PdfEditor.csproj" />
</ItemGroup>
</Project>

View File

@@ -1,8 +1,6 @@
using System.Linq;
using DigitalData.Auth.Claims;
using Microsoft.IdentityModel.JsonWebTokens;
using System.Security.Claims;
using EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.Cookies;
namespace EnvelopeGenerator.API.Extensions;
@@ -11,7 +9,14 @@ namespace EnvelopeGenerator.API.Extensions;
/// </summary>
public static class ReceiverClaimExtensions
{
private static string GetRequiredClaimOfReceiver(this ClaimsPrincipal user, string claimType)
/// <summary>
///
/// </summary>
/// <param name="user"></param>
/// <param name="claimType"></param>
/// <returns></returns>
/// <exception cref="InvalidOperationException"></exception>
private static string GetRequiredClaimValue(this ClaimsPrincipal user, string claimType)
{
var value = user.FindFirstValue(claimType);
if (value is not null)
@@ -27,75 +32,65 @@ public static class ReceiverClaimExtensions
throw new InvalidOperationException(message);
}
private static string GetRequiredClaimValue(this ClaimsPrincipal user, params string[] claimTypes)
{
foreach (var claimType in claimTypes.Where(t => !string.IsNullOrWhiteSpace(t)).Distinct())
{
var value = user.FindFirstValue(claimType);
if (!string.IsNullOrWhiteSpace(value))
return value;
}
var identity = user.Identity;
var principalName = identity?.Name ?? "(anonymous)";
var authType = identity?.AuthenticationType ?? "(none)";
var availableClaims = string.Join(", ", user.Claims.Select(c => $"{c.Type}={c.Value}"));
var message = $"Required claim(s) '{string.Join("', '", claimTypes)}' are missing for user '{principalName}' (auth: {authType}). Available claims: [{availableClaims}].";
throw new InvalidOperationException(message);
}
/// <summary>
/// Gets the authenticated envelope UUID from the claims.
/// </summary>
public static string GetEnvelopeUuidOfReceiver(this ClaimsPrincipal user) => user.GetRequiredClaimOfReceiver(ClaimTypes.NameIdentifier);
public static string EnvelopeUuid(this ClaimsPrincipal user)
=> user.GetRequiredClaimValue(EnvelopeClaimNames.EnvelopeUuid);
/// <summary>
/// Gets the authenticated receiver signature from the claims.
/// </summary>
public static string GetReceiverSignatureOfReceiver(this ClaimsPrincipal user) => user.GetRequiredClaimOfReceiver(ClaimTypes.Hash);
/// <summary>
/// Gets the authenticated receiver display name from the claims.
/// </summary>
public static string GetReceiverNameOfReceiver(this ClaimsPrincipal user) => user.GetRequiredClaimOfReceiver(ClaimTypes.Name);
public static string ReceiverSignature(this ClaimsPrincipal user)
=> user.GetRequiredClaimValue(EnvelopeClaimNames.ReceiverSignature);
/// <summary>
/// Gets the authenticated receiver email address from the claims.
/// </summary>
public static string GetReceiverMailOfReceiver(this ClaimsPrincipal user) => user.GetRequiredClaimOfReceiver(ClaimTypes.Email);
/// <summary>
/// Gets the authenticated envelope title from the claims.
/// </summary>
public static string GetEnvelopeTitleOfReceiver(this ClaimsPrincipal user) => user.GetRequiredClaimOfReceiver(EnvelopeClaimTypes.Title);
public static string ReceiverMail(this ClaimsPrincipal user)
=> user.GetRequiredClaimValue(JwtRegisteredClaimNames.Email);
/// <summary>
/// Gets the authenticated envelope identifier from the claims.
/// </summary>
public static int GetEnvelopeIdOfReceiver(this ClaimsPrincipal user)
public static int EnvelopeId(this ClaimsPrincipal user)
{
var envIdStr = user.GetRequiredClaimOfReceiver(EnvelopeClaimTypes.Id);
if (!int.TryParse(envIdStr, out var envId))
{
throw new InvalidOperationException($"Claim '{EnvelopeClaimTypes.Id}' is not a valid integer.");
}
var envIdStr = user.GetRequiredClaimValue(EnvelopeClaimNames.EnvelopeId);
if (int.TryParse(envIdStr, out var envId))
return envId;
else
throw new InvalidOperationException($"Claim '{EnvelopeClaimNames.EnvelopeId}' is not a valid integer.");
}
/// <summary>
/// Signs in an envelope receiver using cookie authentication and attaches envelope claims.
/// Gets the authenticated receiver identifier from the claims.
/// </summary>
/// <param name="context">The current HTTP context.</param>
/// <param name="envelopeReceiver">Envelope receiver DTO to extract claims from.</param>
/// <param name="receiverRole">Role to attach to the authentication ticket.</param>
public static async Task SignInEnvelopeAsync(this HttpContext context, EnvelopeReceiverDto envelopeReceiver, string receiverRole)
/// <param name="user"></param>
/// <returns></returns>
/// <exception cref="InvalidOperationException"></exception>
public static int ReceiverId(this ClaimsPrincipal user)
{
var claims = new List<Claim>
{
new(ClaimTypes.NameIdentifier, envelopeReceiver.Envelope!.Uuid),
new(ClaimTypes.Hash, envelopeReceiver.Receiver!.Signature),
new(ClaimTypes.Name, envelopeReceiver.Name ?? string.Empty),
new(ClaimTypes.Email, envelopeReceiver.Receiver.EmailAddress),
new(EnvelopeClaimTypes.Title, envelopeReceiver.Envelope.Title),
new(EnvelopeClaimTypes.Id, envelopeReceiver.Envelope.Id.ToString()),
new(ClaimTypes.Role, receiverRole)
};
var claimsIdentity = new ClaimsIdentity(claims, CookieAuthenticationDefaults.AuthenticationScheme);
var authProperties = new AuthenticationProperties
{
AllowRefresh = false,
IsPersistent = false
};
await context.SignInAsync(
CookieAuthenticationDefaults.AuthenticationScheme,
new ClaimsPrincipal(claimsIdentity),
authProperties);
var rcvIdStr = user.GetRequiredClaimValue(EnvelopeClaimNames.ReceiverId);
if (int.TryParse(rcvIdStr, out var rcvId))
return rcvId;
else
throw new InvalidOperationException($"Claim '{EnvelopeClaimNames.ReceiverId}' is not a valid integer.");
}
}

View File

@@ -0,0 +1,7 @@
namespace EnvelopeGenerator.API.Models;
/// <summary>
/// Request body for the envelope-receiver login endpoint.
/// </summary>
/// <param name="AccessCode">The access code sent to the receiver.</param>
public record EnvelopeReceiverLogin(string? AccessCode = null);

View File

@@ -0,0 +1,18 @@
namespace EnvelopeGenerator.API.Options;
/// <summary>
/// Configuration options for distributed caching.
/// </summary>
public sealed class CacheOptions
{
/// <summary>
/// Configuration section name in appsettings.json.
/// </summary>
public const string SectionName = "Cache";
/// <summary>
/// Signature cache expiration time.
/// If null, signatures will not expire automatically.
/// </summary>
public TimeSpan? SignatureCacheExpiration { get; set; }
}

View File

@@ -17,8 +17,11 @@ using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.IdentityModel.Tokens;
using DigitalData.Core.Abstractions.Security.Extensions;
using EnvelopeGenerator.API.Middleware;
using EnvelopeGenerator.API.Options;
using NLog.Web;
using NLog;
using DigitalData.Auth.Claims;
using EnvelopeGenerator.API;
var logger = LogManager.Setup().LoadConfigurationFromAppSettings().GetCurrentClassLogger();
logger.Info("Logging initialized!");
@@ -110,9 +113,11 @@ try
options.DocumentFilter<EnvelopeGenerator.API.Documentation.AuthProxyDocumentFilter>();
});
#if NET9_0_OR_GREATER
builder.Services.AddOpenApi();
#endif
//AddEF Core dbcontext
//Add EF Core dbcontext
var useDbMigration = Environment.GetEnvironmentVariable("MIGRATION_TEST_MODE") == true.ToString() || config.GetValue<bool>("UseDbMigration");
var cnnStrName = useDbMigration ? "DbMigrationTest" : "Default";
var connStr = config.GetConnectionString(cnnStrName)
@@ -131,7 +136,7 @@ try
options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
})
.AddJwtBearer(opt =>
.AddJwtBearer(AuthScheme.Sender, opt =>
{
opt.TokenValidationParameters = new TokenValidationParameters
{
@@ -163,6 +168,61 @@ try
return Task.CompletedTask;
}
};
})
// Per-envelope receiver scheme: reads the JWT from the cookie named
// AuthTokenSignFLOWReceiver.{envelope_key} where envelope_key is the
// last path segment of the request URL.
// This enables simultaneous authentication for multiple envelopes
// within the same browser session.
.AddJwtBearer(AuthScheme.Receiver, opt =>
{
opt.TokenValidationParameters = new TokenValidationParameters
{
ValidateIssuerSigningKey = true,
IssuerSigningKeyResolver = (token, securityToken, identifier, parameters) =>
{
var clientParams = deferredProvider.GetOptions<ClientParams>();
var publicKey = clientParams!.PublicKeys.Get(authTokenKeys.Issuer, authTokenKeys.Audience);
return [publicKey.SecurityKey];
},
ValidateIssuer = true,
ValidIssuer = authTokenKeys.Issuer,
ValidateAudience = true,
ValidAudience = authTokenKeys.Audience,
};
opt.Events = new JwtBearerEvents
{
OnMessageReceived = context =>
{
var paths = context.Request.Path.Value?.Split('/', StringSplitOptions.RemoveEmptyEntries);
// Derive the envelope key from the last route segment: /{envelope_key}
var envelopeKey = paths?.LastOrDefault();
if (envelopeKey is not null)
{
var cookieName = CookieNames.GetEnvelopeReceiverCookieName(authTokenKeys.Cookie, envelopeKey);
if (context.Request.Cookies.TryGetValue(cookieName, out var cookieToken) && cookieToken is not null)
context.Token = cookieToken;
}
return Task.CompletedTask;
},
OnTokenValidated = context =>
{
var paths = context.Request.Path.Value?.Split('/', StringSplitOptions.RemoveEmptyEntries);
var envelopeKey = paths?.LastOrDefault();
var sub = context.Principal?.FindFirst(System.Security.Claims.ClaimTypes.NameIdentifier)?.Value
?? context.Principal?.FindFirst("sub")?.Value;
if (envelopeKey is null || sub != envelopeKey)
context.Fail("Envelope key in the path does not match the token subject.");
return Task.CompletedTask;
}
};
});
// Authentication
@@ -178,14 +238,16 @@ try
});
builder.Services.AddAuthorizationBuilder()
.AddPolicy(AuthPolicy.SenderOrReceiver, policy =>
policy.RequireRole(Role.Sender, Role.Receiver.Full))
.AddPolicy(AuthPolicy.Sender, policy =>
policy.RequireRole(Role.Sender))
.AddPolicy(AuthPolicy.Receiver, policy =>
policy.RequireRole(Role.Receiver.Full))
.AddPolicy(AuthPolicy.ReceiverTFA, policy =>
policy.RequireRole(Role.Receiver.TFA));
.AddPolicy(AuthPolicy.SenderOrReceiver, policy => policy.RequireRole(Role.Sender, Role.Receiver.Full))
.AddPolicy(AuthPolicy.Sender, policy => policy
.RequireRole(Role.Sender)
.AddAuthenticationSchemes(AuthScheme.Sender))
.AddPolicy(AuthPolicy.Receiver, policy => policy
.AddAuthenticationSchemes(AuthScheme.Receiver)
.RequireAuthenticatedUser()
.RequireRole(Role.Receiver.Full, "receiver"))
.AddPolicy(AuthPolicy.ReceiverTFA, policy => policy.RequireRole(Role.Receiver.TFA));
// User manager
#pragma warning disable CS0618 // Type or member is obsolete
@@ -199,6 +261,20 @@ try
// Localizer
builder.Services.AddCookieBasedLocalizer();
// Cache options
builder.Services.Configure<CacheOptions>(config.GetSection(CacheOptions.SectionName));
// Distributed Cache - SQL Server
builder.Services.AddDistributedSqlServerCache(options =>
{
config.GetSection("Cache:SqlServer").Bind(options);
if (string.IsNullOrWhiteSpace(options.ConnectionString))
{
options.ConnectionString = connStr;
}
});
// Envelope generator serives
#pragma warning disable CS0618 // Type or member is obsolete
builder.Services
@@ -224,7 +300,9 @@ try
app.UseMiddleware<ExceptionHandlingMiddleware>();
#if NET9_0_OR_GREATER
app.MapOpenApi();
#endif
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment() || (app.IsDevOrDiP() && config.GetValue<bool>("UseSwagger")))
@@ -258,9 +336,11 @@ try
app.UseAuthentication();
app.UseAuthorization();
app.MapReverseProxy();
app.MapControllers();
// Catch-all YARP proxy — only forward requests that are not swagger/scalar/openapi paths.
app.MapReverseProxy();
app.Run();
}
catch (Exception ex)

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<WebPublishMethod>Package</WebPublishMethod>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
<ExcludeApp_Data>false</ExcludeApp_Data>
<ProjectGuid>5e0e17c0-ff5a-4246-bf87-1add85376a27</ProjectGuid>
<DesktopBuildPackageLocation>M:\App&amp;Service\0 DD - Smart UP\signFLOW\API\net8\$(Version)\EnvelopeGenerator.API.zip</DesktopBuildPackageLocation>
<PackageAsSingleFile>true</PackageAsSingleFile>
<DeployIisAppPath>EnvelopeGenerator</DeployIisAppPath>
<_TargetId>IISWebDeployPackage</_TargetId>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
</Project>

View File

@@ -1,10 +1,21 @@
{
"Logging": {
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
},
"ReverseProxy": {
"Clusters": {
"receiver-ui": {
"Destinations": {
"primary": {
"Address": "https://localhost:52936"
}
}
}
}
},
"AuthClientParams": {
"Url": "http://172.24.12.39:9090/auth-hub",
"PublicKeys": [

View File

@@ -1,6 +1,6 @@
{
"UseSwagger": true,
"UseDbMigration": true,
"UseDbMigration": false,
"DiPMode": true,
"Logging": {
"LogLevel": {
@@ -174,6 +174,14 @@
"Receiver": [],
"EmailTemplate": [ "TBSIG_EMAIL_TEMPLATE_AFT_UPD" ]
},
"Cache": {
"SignatureCacheExpiration": null,
"SqlServer": {
"ConnectionString": null,
"SchemaName": "dbo",
"TableName": "TBDD_CACHE"
}
},
"MainPageTitle": null,
"AnnotationParams": {
"Background": {

View File

@@ -1,6 +1,144 @@
{
"ReverseProxy": {
"ReverseProxy": {
"Routes": {
"receiver-ui-root": {
"ClusterId": "receiver-ui",
"Order": 300,
"Match": {
"Path": "/",
"Methods": [ "GET", "HEAD" ]
},
"Transforms": [
{ "PathSet": "/index.html" }
]
},
"receiver-ui-sender": {
"ClusterId": "receiver-ui",
"Order": 100,
"Match": {
"Path": "/sender/{**catch-all}",
"Methods": [ "GET", "HEAD" ]
},
"Transforms": [
{ "PathSet": "/index.html" }
]
},
"receiver-ui-envelope": {
"ClusterId": "receiver-ui",
"Order": 100,
"Match": {
"Path": "/envelope/{EnvelopeKey}",
"Methods": [ "GET", "HEAD" ]
},
"Transforms": [
{ "PathSet": "/index.html" }
]
},
"receiver-ui-envelope-dxreportviewer": {
"ClusterId": "receiver-ui",
"Order": 90,
"Match": {
"Path": "/envelope/{EnvelopeKey}/DxReportViewer",
"Methods": [ "GET", "HEAD" ]
},
"Transforms": [
{ "PathSet": "/index.html" }
]
},
"receiver-ui-blazor-framework": {
"ClusterId": "receiver-ui",
"Order": 50,
"Match": {
"Path": "/_framework/{**catch-all}",
"Methods": [ "GET", "HEAD" ]
}
},
"receiver-ui-blazor-content": {
"ClusterId": "receiver-ui",
"Order": 50,
"Match": {
"Path": "/_content/{**catch-all}",
"Methods": [ "GET", "HEAD" ]
}
},
"receiver-ui-static-css": {
"ClusterId": "receiver-ui",
"Order": 200,
"Match": {
"Path": "/css/{**catch-all}",
"Methods": [ "GET", "HEAD" ]
},
"Transforms": [
{
"ResponseHeader": "Cache-Control",
"Set": "no-cache, no-store, must-revalidate",
"When": "Always"
}
]
},
"receiver-ui-static-js": {
"ClusterId": "receiver-ui",
"Order": 200,
"Match": {
"Path": "/js/{**catch-all}",
"Methods": [ "GET", "HEAD" ]
},
"Transforms": [
{
"ResponseHeader": "Cache-Control",
"Set": "no-cache, no-store, must-revalidate",
"When": "Always"
}
]
},
"receiver-ui-fake-data": {
"ClusterId": "receiver-ui",
"Order": 200,
"Match": {
"Path": "/fake-data/{**catch-all}",
"Methods": [ "GET", "HEAD" ]
}
},
"receiver-ui-appsettings": {
"ClusterId": "receiver-ui",
"Order": 50,
"Match": {
"Path": "/appsettings.json",
"Methods": [ "GET", "HEAD" ]
}
},
"receiver-ui-appsettings-dev": {
"ClusterId": "receiver-ui",
"Order": 50,
"Match": {
"Path": "/appsettings.Development.json",
"Methods": [ "GET", "HEAD" ]
}
},
"receiver-ui-styles": {
"ClusterId": "receiver-ui",
"Order": 50,
"Match": {
"Path": "/EnvelopeGenerator.ReceiverUI.styles.css",
"Methods": [ "GET", "HEAD" ]
}
},
"receiver-ui-fonts": {
"ClusterId": "receiver-ui",
"Order": 200,
"Match": {
"Path": "/fonts/{**catch-all}",
"Methods": [ "GET", "HEAD" ]
}
},
"receiver-ui-images": {
"ClusterId": "receiver-ui",
"Order": 200,
"Match": {
"Path": "/images/{**catch-all}",
"Methods": [ "GET", "HEAD" ]
}
},
"auth-login": {
"ClusterId": "auth-hub",
"Match": {
@@ -10,9 +148,30 @@
"Transforms": [
{ "PathSet": "/api/auth/sign-flow" }
]
},
"auth-envelope-receiver-login": {
"ClusterId": "auth-hub",
"Match": {
"Path": "/api/Auth/envelope-receiver/{key}",
"Methods": [ "POST" ]
},
"Transforms": [
{ "PathPattern": "/api/auth/envelope-receiver/{key}" },
{
"QueryValueParameter": "cookie",
"Set": "true"
}
]
}
},
"Clusters": {
"receiver-ui": {
"Destinations": {
"primary": {
"Address": "https://localhost:52936"
}
}
},
"auth-hub": {
"Destinations": {
"primary": {
@@ -23,3 +182,4 @@
}
}
}

View File

@@ -8,42 +8,77 @@ public record AnnotationCreateDto
/// <summary>
///
/// </summary>
public int ElementId { get; init; }
public long Id { get; set; }
/// <summary>
///
/// </summary>
public string Name { get; init; } = null!;
[Obsolete("Not required for DevExpress")]
public int ElementId { get; init; } = -1;
/// <summary>
///
/// </summary>
public string Value { get; init; } = null!;
[Obsolete("Not required for DevExpress")]
public string Name { get; init; } = string.Empty;
/// <summary>
///
/// </summary>
public string Type { get; init; } = null!;
[Obsolete("Not required for DevExpress")]
public string Value { get; init; } = string.Empty;
/// <summary>
///
/// </summary>
[Obsolete("Not required for DevExpress")]
public string Type { get; init; } = string.Empty;
/// <summary>
/// Horizontal position of the signature field on the page.
/// <br/><br/>
/// <b>Unit:</b> INCHES (GdPicture14 native), origin at the <b>top-left</b> corner of the page, X increases to the right.
/// <br/>
/// <b>Conversion to DevExpress:</b> Multiply by 100 (DX uses 1/100 inch).
/// Convert: <c>xDX = xInches * 100.0</c>
/// <br/>
/// <b>Conversion to PDF Points:</b> Multiply by 72 (PSPDFKit, iText7 use 1/72 inch).
/// Convert: <c>xPt = xInches * 72.0</c>
/// </summary>
public double? X { get; init; }
/// <summary>
///
/// Vertical position of the signature field on the page.
/// <br/><br/>
/// <b>Unit:</b> INCHES (GdPicture14 native), origin at the <b>top-left</b> corner of the page, Y increases downward.
/// <br/>
/// <b>Conversion to DevExpress:</b> Multiply by 100 (DX uses 1/100 inch).
/// Convert: <c>yDX = yInches * 100.0</c>
/// <br/>
/// <b>Conversion to PDF Points (top-left origin):</b> Multiply by 72.
/// Convert: <c>yPt = yInches * 72.0</c>
/// <br/>
/// <b>Conversion to PDF Points (bottom-left origin - iText7):</b> Y-flip required.
/// Convert: <c>yPt = (pageHeightInches - yInches - elemHeightInches) * 72.0</c>
/// </summary>
public double? Y { get; init; }
/// <summary>
///
/// </summary>
[Obsolete("Not required for DevExpress")]
public double? Width { get; init; }
/// <summary>
///
/// </summary>
[Obsolete("Not required for DevExpress")]
public double? Height { get; init; }
/// <summary>
/// Added to eliminate the need for SignatureDto in DevExpress
/// </summary>
public int? Page { get; init; }
}
/// <summary>

View File

@@ -1,5 +1,7 @@
using EnvelopeGenerator.Domain.Interfaces;
using EnvelopeGenerator.Domain.Constants;
using EnvelopeGenerator.Domain.Interfaces;
using Microsoft.AspNetCore.Mvc;
using System.ComponentModel.DataAnnotations.Schema;
namespace EnvelopeGenerator.Application.Common.Dto;
@@ -7,7 +9,7 @@ namespace EnvelopeGenerator.Application.Common.Dto;
/// Data Transfer Object representing a positioned element assigned to a document receiver.
/// </summary>
[ApiExplorerSettings(IgnoreApi = true)]
public class SignatureDto : ISignature
public class DocReceiverElementDto : IDocReceiverElement
{
/// <summary>
/// Gets or sets the unique identifier of the element.
@@ -93,4 +95,34 @@ public class SignatureDto : ISignature
/// Gets or sets the left position of the element (in layout terms).
/// </summary>
public double Left => X;
/// <summary>
///
/// </summary>
public IEnumerable<AnnotationDto>? Annotations { get; set; }
/// <summary>
///
/// </summary>
public SenderAppType SenderAppType { get; set; } = SenderAppType.LegacyFormApp;
/// <summary>
///
/// </summary>
public string? FullName { get; set; }
/// <summary>
///
/// </summary>
public string? Position { get; set; }
/// <summary>
///
/// </summary>
public string? Place { get; set; }
/// <summary>
///
/// </summary>
public byte[]? Ink { get; set; }
}

View File

@@ -31,5 +31,5 @@ public class DocumentDto
/// <summary>
/// Gets or sets the collection of elements associated with the document for receiver interactions, if any.
/// </summary>
public IEnumerable<SignatureDto>? Elements { get; set; }
public IEnumerable<DocReceiverElementDto>? Elements { get; set; }
}

View File

@@ -1,9 +1,12 @@
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
using DigitalData.UserManager.Application.DTOs.User;
using EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver;
using EnvelopeGenerator.Application.Common.Dto.Receiver;
using EnvelopeGenerator.Domain.Constants;
using EnvelopeGenerator.Domain.Entities;
using EnvelopeGenerator.Domain.Interfaces;
using Microsoft.AspNetCore.Mvc;
using System.Text.Json.Serialization;
namespace EnvelopeGenerator.Application.Common.Dto;
@@ -75,10 +78,12 @@ public record EnvelopeDto : IEnvelope
/// </summary>
public int? EnvelopeTypeId { get; set; }
// TODO: use ReadAndConfirm property name
/// <summary>
///
/// </summary>
public bool ReadOnly => EnvelopeTypeId == 2;
[Obsolete("Use EnvelopeExtensions.IsReadAndConfirm extension metot instead.")]
public bool ReadOnly => this.IsReadAndConfirm();
/// <summary>
///
@@ -124,4 +129,9 @@ public record EnvelopeDto : IEnvelope
///
/// </summary>
public IEnumerable<DocumentDto>? Documents { get; set; }
/// <summary>
///
/// </summary>
public IEnumerable<ReceiverDto>? Receivers { get; set; }
}

View File

@@ -23,10 +23,10 @@ public class MappingProfile : Profile
{
// Entity to DTO mappings
CreateMap<Config, ConfigDto>();
CreateMap<Signature, SignatureDto>();
CreateMap<DocReceiverElement, DocReceiverElementDto>();
CreateMap<DocumentStatus, DocumentStatusDto>();
CreateMap<EmailTemplate, EmailTemplateDto>();
CreateMap<Envelope, EnvelopeDto>();
CreateMap<Envelope, EnvelopeDto>().ForMember(dest => dest.Receivers, opt => opt.MapFrom(src => src.EnvelopeReceivers.Select(er => er.Receiver)));
CreateMap<Document, DocumentDto>();
CreateMap<Domain.Entities.History, HistoryDto>().ForMember(dest => dest.ActionDate, opt => opt.MapFrom(src => src.ChangedWhen));
CreateMap<Domain.Entities.History, HistoryCreateDto>().ForMember(dest => dest.ActionDate, opt => opt.MapFrom(src => src.ChangedWhen));
@@ -39,7 +39,10 @@ public class MappingProfile : Profile
// DTO to Entity mappings
CreateMap<ConfigDto, Config>();
CreateMap<SignatureDto, Signature>();
CreateMap<DocReceiverElementDto, DocReceiverElement>();
CreateMap<Signature, DocReceiverElement>()
.ForMember(dest => dest.Ink, opt => opt.MapFrom(src => src.DataUrl.MapDataUrlToRequiredBytes()))
.MapChangedWhen();
CreateMap<DocumentStatusDto, DocumentStatus>();
CreateMap<EmailTemplateDto, EmailTemplate>();
CreateMap<EnvelopeDto, Envelope>();

View File

@@ -0,0 +1,11 @@
using System.Dynamic;
namespace EnvelopeGenerator.Application.Common.Dto;
/// <summary>
/// Represents PSPDFKit annotation data.
/// </summary>
/// <param name="Instant">Instant annotation data.</param>
/// <param name="Structured">Structured annotation data.</param>
[Obsolete("The PSPDFKit library is deprecated.")]
public record PsPdfKitAnnotation(ExpandoObject Instant, IEnumerable<AnnotationCreateDto> Structured);

View File

@@ -0,0 +1,65 @@
namespace EnvelopeGenerator.Application.Common.Dto;
/// <summary>
/// Represents a captured signature with metadata created by the receiver in the signature popup.
/// This model holds the signature image (as base64 data URL) along with signer information
/// used for rendering applied signatures on the PDF canvas.
/// </summary>
/// <remarks>
/// <b>Used in:</b> EnvelopeViewer.razor signature popup workflow
/// <br/>
/// <b>Creation:</b> User draws/types/uploads signature and fills required fields
/// </remarks>
public sealed record Signature
{
/// <summary>
/// TBDD_DOCUMENT_RECEIVER_ELEMENT.ID - identifies the specific signature field on the PDF page.
/// </summary>
public required int Id { get; init; }
/// <summary>
/// Base64-encoded data URL of the signature image.
/// <br/>
/// <b>Format:</b> <c>data:image/png;base64,iVBORw0KG...</c>
/// <br/>
/// <b>Source:</b> Canvas.toDataURL() from signature pad (draw/text/image tabs)
/// <br/>
/// <b>Usage:</b> Set as <c>img.src</c> in applied signature overlay
/// </summary>
public required string DataUrl { get; init; }
/// <summary>
/// Full name of the signer (first and last name).
/// <br/>
/// <b>Required:</b> Yes (validated in popup)
/// <br/>
/// <b>Example:</b> "Max Mustermann"
/// </summary>
public required string FullName { get; init; }
private readonly string? _position = null;
/// <summary>
/// Job title or position of the signer.
/// <br/>
/// <b>Required:</b> No (optional field)
/// <br/>
/// <b>Example:</b> "Geschäftsführer" or empty string
/// </summary>
public string? Position
{
get => _position;
init => _position = string.IsNullOrWhiteSpace(value) ? value : null;
}
/// <summary>
/// Location/place where the signature was created.
/// <br/>
/// <b>Required:</b> Yes (validated in popup)
/// <br/>
/// <b>Display:</b> Shown with current date in German format (dd.MM.yyyy)
/// <br/>
/// <b>Example:</b> "Berlin" ? rendered as "Berlin, 26.01.2025"
/// </summary>
public required string Place { get; init; }
}

View File

@@ -1,5 +1,6 @@
using AutoMapper;
using EnvelopeGenerator.Domain.Interfaces.Auditing;
using System;
namespace EnvelopeGenerator.Application.Common.Extensions;
@@ -13,12 +14,29 @@ public static class AutoMapperAuditingExtensions
/// </summary>
public static IMappingExpression<TSource, TDestination> MapAddedWhen<TSource, TDestination>(this IMappingExpression<TSource, TDestination> expression)
where TDestination : IHasAddedWhen
=> expression.ForMember(dest => dest.AddedWhen, opt => opt.MapFrom(_ => DateTime.UtcNow));
=> expression.ForMember(dest => dest.AddedWhen, opt => opt.MapFrom(_ => DateTime.Now));
/// <summary>
/// Maps <see cref="IHasChangedWhen.ChangedWhen"/> to the current UTC time.
/// </summary>
public static IMappingExpression<TSource, TDestination> MapChangedWhen<TSource, TDestination>(this IMappingExpression<TSource, TDestination> expression)
where TDestination : IHasChangedWhen
=> expression.ForMember(dest => dest.ChangedWhen, opt => opt.MapFrom(_ => DateTime.UtcNow));
=> expression.ForMember(dest => dest.ChangedWhen, opt => opt.MapFrom(_ => DateTime.Now));
/// <summary>
/// Converts a base64 data URL string to a byte array.
/// Handles data URLs in the format: "data:image/png;base64,iVBORw0KG..."
/// </summary>
/// <param name="dataUrl">The base64 data URL string from Canvas.toDataURL()</param>
/// <returns>The decoded byte array, or null if the input is null or empty</returns>
public static byte[]? MapDataUrlToRequiredBytes(this string dataUrl)
{
// Remove data URL prefix (e.g., "data:image/png;base64,")
var base64Index = dataUrl.IndexOf(',', StringComparison.Ordinal);
if (base64Index == -1)
throw new ArgumentException("Invalid data URL format. Unable to extract base64 data.", nameof(dataUrl));
var base64Data = dataUrl[(base64Index + 1)..];
return Convert.FromBase64String(base64Data);
}
}

View File

@@ -6,6 +6,6 @@ namespace EnvelopeGenerator.Application.Common.Interfaces.Repositories;
///
/// </summary>
[Obsolete("Use IRepository")]
public interface IDocumentReceiverElementRepository : ICRUDRepository<Signature, int>
public interface IDocumentReceiverElementRepository : ICRUDRepository<DocReceiverElement, int>
{
}

View File

@@ -8,6 +8,6 @@ namespace EnvelopeGenerator.Application.Common.Interfaces.Services;
///
/// </summary>
[Obsolete("Use MediatR")]
public interface IDocumentReceiverElementService : IBasicCRUDService<SignatureDto, Signature, int>
public interface IDocumentReceiverElementService : IBasicCRUDService<DocReceiverElementDto, DocReceiverElement, int>
{
}

View File

@@ -1,88 +1,37 @@
using EnvelopeGenerator.Application.Common.Dto;
using EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver;
using EnvelopeGenerator.Application.Common.Extensions;
using EnvelopeGenerator.Application.Common.Notifications.RemoveSignature;
using EnvelopeGenerator.Domain.Constants;
using MediatR;
using System.Dynamic;
namespace EnvelopeGenerator.Application.Common.Notifications.DocSigned;
/// <summary>
///
/// Notification raised when a document is signed by a receiver.
/// </summary>
/// <param name="Instant"></param>
/// <param name="Structured"></param>
public record PsPdfKitAnnotation(ExpandoObject Instant, IEnumerable<AnnotationCreateDto> Structured);
/// <summary>
///
/// </summary>
/// <param name="Original"></param>
public record DocSignedNotification(EnvelopeReceiverDto Original) : EnvelopeReceiverDto(Original), INotification, ISendMailNotification
[Obsolete("This notification is deprecated. Use Signature.Commands.SignCommand instead.")]
public record DocSignedNotification : INotification, ISendMailNotification
{
/// <summary>
///
/// The envelope receiver information.
/// </summary>
public required EnvelopeReceiverDto EnvelopeReceiver { get; init; }
/// <summary>
/// The PSPDFKit annotation data.
/// </summary>
[Obsolete("The PSPDFKit library is deprecated.")]
public PsPdfKitAnnotation? PsPdfKitAnnotation { get; init; }
/// <summary>
///
/// Gets the email template type.
/// </summary>
public EmailTemplateType TemplateType => EmailTemplateType.DocumentSigned;
/// <summary>
///
/// Gets the email address of the receiver.
/// </summary>
public string EmailAddress => Receiver?.EmailAddress
public string EmailAddress => EnvelopeReceiver.Receiver?.EmailAddress
?? throw new InvalidOperationException($"Receiver is null." +
$"DocSignedNotification:\n{this.ToJson(Format.Json.ForDiagnostics)}");
}
/// <summary>
///
/// </summary>
public static class DocSignedNotificationExtensions
{
/// <summary>
/// Converts an <see cref="EnvelopeReceiverDto"/> to a <see cref="DocSignedNotification"/>.
/// </summary>
/// <param name="dto">The DTO to convert.</param>
/// <param name="psPdfKitAnnotation"></param>
/// <returns>A new <see cref="DocSignedNotification"/> instance.</returns>
public static DocSignedNotification ToDocSignedNotification(this EnvelopeReceiverDto dto, PsPdfKitAnnotation psPdfKitAnnotation)
=> new(dto) { PsPdfKitAnnotation = psPdfKitAnnotation };
/// <summary>
///
/// </summary>
/// <param name="dtoTask"></param>
/// <param name="psPdfKitAnnotation"></param>
/// <returns></returns>
public static async Task<DocSignedNotification?> ToDocSignedNotification(this Task<EnvelopeReceiverDto?> dtoTask, PsPdfKitAnnotation? psPdfKitAnnotation)
=> await dtoTask is EnvelopeReceiverDto dto ? new(dto) { PsPdfKitAnnotation = psPdfKitAnnotation } : null;
/// <summary>
///
/// </summary>
/// <param name="publisher"></param>
/// <param name="notification"></param>
/// <param name="cancel"></param>
/// <returns></returns>
public static async Task PublishSafely(this IPublisher publisher, DocSignedNotification notification, CancellationToken cancel = default)
{
try
{
await publisher.Publish(notification, cancel);
}
catch (Exception)
{
await publisher.Publish(new RemoveSignatureNotification()
{
EnvelopeId = notification.EnvelopeId,
ReceiverId = notification.ReceiverId
}, cancel);
throw;
}
}
}

View File

@@ -1,5 +1,6 @@
using DigitalData.Core.Abstraction.Application.Repository;
using EnvelopeGenerator.Domain.Entities;
using EnvelopeGenerator.Application.Common.Dto;
using MediatR;
namespace EnvelopeGenerator.Application.Common.Notifications.DocSigned.Handlers;
@@ -7,6 +8,7 @@ namespace EnvelopeGenerator.Application.Common.Notifications.DocSigned.Handlers;
/// <summary>
///
/// </summary>
[Obsolete("The PSPDFKit library is deprecated.")]
public class AnnotationHandler : INotificationHandler<DocSignedNotification>
{
/// <summary>

View File

@@ -1,4 +1,5 @@
using EnvelopeGenerator.Application.DocStatus.Commands;
using EnvelopeGenerator.Application.Common.Dto;
using EnvelopeGenerator.Domain.Constants;
using MediatR;
using System.Text.Json;
@@ -8,6 +9,7 @@ namespace EnvelopeGenerator.Application.Common.Notifications.DocSigned.Handlers;
/// <summary>
///
/// </summary>
[Obsolete("This notification is deprecated. Use Signature.Commands.SignCommand instead.")]
public class DocStatusHandler : INotificationHandler<DocSignedNotification>
{
private const string BlankAnnotationJson = "{}";
@@ -29,10 +31,11 @@ public class DocStatusHandler : INotificationHandler<DocSignedNotification>
/// <param name="notification"></param>
/// <param name="cancel"></param>
/// <returns></returns>
[Obsolete("This notification is deprecated. Use Signature.Commands.SignCommand instead.")]
public Task Handle(DocSignedNotification notification, CancellationToken cancel) => _sender.Send(new CreateDocStatusCommand()
{
EnvelopeId = notification.EnvelopeId,
ReceiverId = notification.ReceiverId,
EnvelopeId = notification.EnvelopeReceiver.EnvelopeId,
ReceiverId = notification.EnvelopeReceiver.ReceiverId,
Value = notification.PsPdfKitAnnotation is PsPdfKitAnnotation annot
? JsonSerializer.Serialize(annot.Instant, Format.Json.ForAnnotations)
: BlankAnnotationJson

View File

@@ -29,13 +29,13 @@ public class HistoryHandler : INotificationHandler<DocSignedNotification>
/// <returns></returns>
public async Task Handle(DocSignedNotification notification, CancellationToken cancel)
{
if (notification.Receiver is null)
if (notification.EnvelopeReceiver.Receiver is null)
throw new InvalidOperationException($"Receiver information is missing in the notification. DocSignedNotification:\n {notification.ToJson(Format.Json.ForDiagnostics)}");
await _sender.Send(new CreateHistoryCommand()
{
EnvelopeId = notification.EnvelopeId,
UserReference = notification.Receiver.EmailAddress,
EnvelopeId = notification.EnvelopeReceiver.EnvelopeId,
UserReference = notification.EnvelopeReceiver.Receiver.EmailAddress,
Status = EnvelopeStatus.DocumentSigned,
}, cancel);
}

View File

@@ -31,7 +31,7 @@ public class SendSignedMailHandler : SendMailHandler<DocSignedNotification>
protected override void ConfigureEmailOut(DocSignedNotification notification, EmailOut emailOut)
{
emailOut.ReferenceString = notification.EmailAddress;
emailOut.ReferenceId = notification.ReceiverId;
emailOut.ReferenceId = notification.EnvelopeReceiver.ReceiverId;
}
/// <summary>
@@ -42,11 +42,11 @@ public class SendSignedMailHandler : SendMailHandler<DocSignedNotification>
{
var placeHolders = new Dictionary<string, string>()
{
{ "[NAME_RECEIVER]", notification.Name ?? string.Empty },
{ "[DOCUMENT_TITLE]", notification.Envelope?.Title ?? string.Empty },
{ "[NAME_RECEIVER]", notification.EnvelopeReceiver.Name ?? string.Empty },
{ "[DOCUMENT_TITLE]", notification.EnvelopeReceiver.Envelope?.Title ?? string.Empty },
};
if (notification.Envelope.IsReadAndConfirm())
if (notification.EnvelopeReceiver.Envelope.IsReadAndConfirm())
{
placeHolders["[SIGNATURE_TYPE]"] = "Lesen und bestätigen";
placeHolders["[DOCUMENT_PROCESS]"] = string.Empty;

View File

@@ -113,7 +113,7 @@ public abstract class SendMailHandler<TNotification> : INotificationHandler<TNot
EmailAddress = notification.EmailAddress,
EmailBody = temp.Body,
EmailSubj = temp.Subject,
AddedWhen = DateTime.UtcNow,
AddedWhen = DateTime.Now,
AddedWho = DispatcherParams.AddedWho,
SendingProfile = DispatcherParams.SendingProfile,
ReminderTypeId = DispatcherParams.ReminderTypeId,

View File

@@ -7,6 +7,9 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using QRCoder;
using System.Reflection;
using MediatR;
using EnvelopeGenerator.Application.DocReceiverElements.Commands;
using EnvelopeGenerator.Application.DocReceiverElements.Behaviors;
namespace EnvelopeGenerator.Application;
@@ -56,6 +59,22 @@ public static class DependencyInjection
services.AddMediatR(cfg =>
{
cfg.RegisterServicesFromAssembly(Assembly.GetExecutingAssembly());
// Register SignCommand pipeline behaviors in execution order
// 0. EnvelopeReceiverResolutionBehavior - Resolves EnvelopeReceiver from query parameters (executes FIRST)
cfg.AddBehavior<IPipelineBehavior<SigningCommand, Unit>, EnvelopeReceiverResolutionBehavior>();
// 1. AnnotationBehavior - Saves annotations (executes second)
cfg.AddBehavior<IPipelineBehavior<SigningCommand, Unit>, AnnotationBehavior>();
// 2. DocStatusBehavior - Creates document status (executes third)
cfg.AddBehavior<IPipelineBehavior<SigningCommand, Unit>, DocStatusBehavior>();
// 3. HistoryBehavior - Records history (executes fourth)
cfg.AddBehavior<IPipelineBehavior<SigningCommand, Unit>, HistoryBehavior>();
// 4. SendSignedMailBehavior - Sends notification email (executes LAST, only if all previous succeed)
cfg.AddBehavior<IPipelineBehavior<SigningCommand, Unit>, SendSignedMailBehavior>();
});
return services;

View File

@@ -0,0 +1,50 @@
using DigitalData.Core.Abstraction.Application.Repository;
using DigitalData.Core.Exceptions;
using EnvelopeGenerator.Application.Common.Dto;
using EnvelopeGenerator.Application.DocReceiverElements.Commands;
using EnvelopeGenerator.Domain.Entities;
using MediatR;
namespace EnvelopeGenerator.Application.DocReceiverElements.Behaviors;
/// <summary>
/// Pipeline behavior that saves annotations.
/// Executes first in the signing process.
/// </summary>
[Obsolete("The PSPDFKit library is deprecated.")]
public class AnnotationBehavior : IPipelineBehavior<SigningCommand, Unit>
{
private readonly IRepository<ElementAnnotation> _repo;
/// <summary>
/// Initializes a new instance of the <see cref="AnnotationBehavior"/> class.
/// </summary>
/// <param name="repository"></param>
public AnnotationBehavior(IRepository<ElementAnnotation> repository)
{
_repo = repository;
}
/// <summary>
///
/// </summary>
/// <param name="request"></param>
/// <param name="next"></param>
/// <param name="cancel"></param>
/// <returns></returns>
public async Task<Unit> Handle(SigningCommand request, RequestHandlerDelegate<Unit> next, CancellationToken cancel)
{
if(request.ReceiverAppType != ReceiverAppType.LegacyWeb)
if(request.PsPdfKitAnnotation is null)
return await next(cancel);
else
throw new BadRequestException("PsPdfKit Annotation are only supported for the legacy web receiver type.");
if (request.PsPdfKitAnnotation is PsPdfKitAnnotation annot)
await _repo.CreateAsync(annot.Structured, cancel);
else
throw new BadRequestException("Annotation data is missing or invalid.");
return await next(cancel);
}
}

View File

@@ -0,0 +1,50 @@
using EnvelopeGenerator.Application.Common.Dto;
using EnvelopeGenerator.Application.DocStatus.Commands;
using EnvelopeGenerator.Application.DocReceiverElements.Commands;
using EnvelopeGenerator.Domain.Constants;
using MediatR;
using System.Text.Json;
namespace EnvelopeGenerator.Application.DocReceiverElements.Behaviors;
/// <summary>
/// Pipeline behavior that creates document status.
/// Executes second in the signing process.
/// </summary>
public class DocStatusBehavior : IPipelineBehavior<SigningCommand, Unit>
{
private const string BlankAnnotationJson = "{}";
private readonly ISender _sender;
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
public DocStatusBehavior(ISender sender)
{
_sender = sender;
}
/// <summary>
///
/// </summary>
/// <param name="request"></param>
/// <param name="next"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
[Obsolete("This notification is deprecated. Use Signature.Commands.SignCommand instead.")]
public async Task<Unit> Handle(SigningCommand request, RequestHandlerDelegate<Unit> next, CancellationToken cancellationToken)
{
await _sender.Send(new CreateDocStatusCommand()
{
EnvelopeId = request.EnvelopeReceiver.EnvelopeId,
ReceiverId = request.EnvelopeReceiver.ReceiverId,
Value = request.PsPdfKitAnnotation is PsPdfKitAnnotation annot
? JsonSerializer.Serialize(annot.Instant, Format.Json.ForAnnotations)
: BlankAnnotationJson
}, cancellationToken);
return await next(cancellationToken);
}
}

View File

@@ -0,0 +1,54 @@
using AutoMapper;
using DigitalData.Core.Abstraction.Application.Repository;
using DigitalData.Core.Exceptions;
using EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver;
using EnvelopeGenerator.Application.Common.Extensions;
using EnvelopeGenerator.Application.DocReceiverElements.Commands;
using EnvelopeGenerator.Domain.Entities;
using MediatR;
using Microsoft.EntityFrameworkCore;
namespace EnvelopeGenerator.Application.DocReceiverElements.Behaviors;
/// <summary>
/// Pipeline behavior that resolves and validates EnvelopeReceiver.
/// Executes FIRST in the signing process - before all other behaviors.
/// If EnvelopeReceiver is not provided, it queries the database using EnvelopeReceiverQueryBase parameters.
/// </summary>
public class EnvelopeReceiverResolutionBehavior : IPipelineBehavior<SigningCommand, Unit>
{
private readonly IRepository<EnvelopeReceiver> _erRepo;
private readonly IMapper _mapper;
/// <summary>
///
/// </summary>
/// <param name="erRepo"></param>
/// <param name="mapper"></param>
public EnvelopeReceiverResolutionBehavior(IRepository<EnvelopeReceiver> erRepo, IMapper mapper)
{
_erRepo = erRepo;
_mapper = mapper;
}
/// <summary>
///
/// </summary>
/// <param name="request"></param>
/// <param name="next"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public async Task<Unit> Handle(SigningCommand request, RequestHandlerDelegate<Unit> next, CancellationToken cancellationToken)
{
// If EnvelopeReceiver is not provided, query it from database
if (request.EnvelopeReceiver is null)
{
var er = await _erRepo.Query.Where(request, notnull: true).SingleOrDefaultAsync(cancellationToken)
?? throw new NotFoundException("EnvelopeReceiver not found");
request.SetEnvelopeReceiver(_mapper.Map<EnvelopeReceiverDto>(er));
}
return await next(cancellationToken);
}
}

View File

@@ -0,0 +1,47 @@
using EnvelopeGenerator.Application.Common.Extensions;
using EnvelopeGenerator.Application.Histories.Commands;
using EnvelopeGenerator.Application.DocReceiverElements.Commands;
using EnvelopeGenerator.Domain.Constants;
using MediatR;
namespace EnvelopeGenerator.Application.DocReceiverElements.Behaviors;
/// <summary>
/// Pipeline behavior that records history.
/// Executes third in the signing process.
/// </summary>
public class HistoryBehavior : IPipelineBehavior<SigningCommand, Unit>
{
private readonly ISender _sender;
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
public HistoryBehavior(ISender sender)
{
_sender = sender;
}
/// <summary>
///
/// </summary>
/// <param name="request"></param>
/// <param name="next"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public async Task<Unit> Handle(SigningCommand request, RequestHandlerDelegate<Unit> next, CancellationToken cancellationToken)
{
if (request.EnvelopeReceiver.Receiver is null)
throw new InvalidOperationException($"Receiver information is missing in the notification. SignCommand:\n {request.ToJson(Format.Json.ForDiagnostics)}");
await _sender.Send(new CreateHistoryCommand()
{
EnvelopeId = request.EnvelopeReceiver.EnvelopeId,
UserReference = request.EnvelopeReceiver.Receiver.EmailAddress,
Status = EnvelopeStatus.DocumentSigned,
}, cancellationToken);
return await next(cancellationToken);
}
}

View File

@@ -0,0 +1,70 @@
using AutoMapper;
using DigitalData.Core.Abstraction.Application.Repository;
using DigitalData.Core.Exceptions;
using EnvelopeGenerator.Application.Common.Dto;
using EnvelopeGenerator.Application.DocReceiverElements.Commands;
using EnvelopeGenerator.Domain.Entities;
using MediatR;
using Microsoft.EntityFrameworkCore;
namespace EnvelopeGenerator.Application.DocReceiverElements.Behaviors;
/// <summary>
/// Pipeline behavior that creates document status.
/// Executes second in the signing process.
/// </summary>
public class SaveSignatureBehavior : IPipelineBehavior<SigningCommand, Unit>
{
private readonly ISender _sender;
private readonly IRepository<DocReceiverElement> _elementRepo;
private readonly IMapper _mapper;
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="elementRepo"></param>
/// <param name="mapper"></param>
public SaveSignatureBehavior(ISender sender, IRepository<DocReceiverElement> elementRepo, IMapper mapper)
{
_sender = sender;
_elementRepo = elementRepo;
_elementRepo = elementRepo;
_mapper = mapper;
}
/// <summary>
///
/// </summary>
/// <param name="request"></param>
/// <param name="next"></param>
/// <param name="cancel"></param>
/// <returns></returns>
public async Task<Unit> Handle(SigningCommand request, RequestHandlerDelegate<Unit> next, CancellationToken cancel)
{
if (request.ReceiverAppType == ReceiverAppType.LegacyWeb)
return await next(cancel);
else if(request.Signatures is not IEnumerable<Signature> signatures)
throw new BadRequestException($"Signatures are required for saving signature behavior.");
var elements = await _elementRepo
.Where(e => e.Document.EnvelopeId == request.Envelope.Id)
.Where(e => e.ReceiverId == request.Receiver.Id)
.ToListAsync(cancel);
foreach (var element in elements)
{
var signatures = request.Signatures.Where(s => s.Id == element.Id).ToList();
if(signatures.Count == 0)
throw new BadRequestException("No signature found for element with id {element.Id}.");
else if(signatures.Count > 1)
throw new BadRequestException("Multiple signatures found for element with id {element.Id}.");
await _elementRepo.UpdateAsync(signatures.First(), e => e.Id == element.Id, cancel);
}
return await next(cancel);
}
}

View File

@@ -0,0 +1,122 @@
using DigitalData.Core.Abstraction.Application.Repository;
using DigitalData.EmailProfilerDispatcher.Abstraction.Entities;
using EnvelopeGenerator.Application.Common.Configurations;
using EnvelopeGenerator.Application.Common.Extensions;
using EnvelopeGenerator.Application.DocReceiverElements.Commands;
using EnvelopeGenerator.Domain.Constants;
using EnvelopeGenerator.Domain.Entities;
using EnvelopeGenerator.Domain.Interfaces;
using MediatR;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Options;
using Newtonsoft.Json;
namespace EnvelopeGenerator.Application.DocReceiverElements.Behaviors;
/// <summary>
/// Pipeline behavior that sends signed mail notification.
/// Executes LAST in the signing process - only if all previous behaviors succeed.
/// </summary>
public class SendSignedMailBehavior : IPipelineBehavior<SigningCommand, Unit>
{
private readonly IRepository<EmailTemplate> _tempRepo;
private readonly IRepository<EmailOut> _emailOutRepo;
private readonly MailParams _mailParams;
private readonly DispatcherParams _dispatcherParams;
/// <summary>
///
/// </summary>
/// <param name="tempRepo"></param>
/// <param name="emailOutRepo"></param>
/// <param name="mailParamsOptions"></param>
/// <param name="dispatcherParamsOptions"></param>
public SendSignedMailBehavior(
IRepository<EmailTemplate> tempRepo,
IRepository<EmailOut> emailOutRepo,
IOptions<MailParams> mailParamsOptions,
IOptions<DispatcherParams> dispatcherParamsOptions)
{
_tempRepo = tempRepo;
_emailOutRepo = emailOutRepo;
_mailParams = mailParamsOptions.Value;
_dispatcherParams = dispatcherParamsOptions.Value;
}
/// <summary>
///
/// </summary>
/// <param name="request"></param>
/// <param name="next"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public async Task<Unit> Handle(SigningCommand request, RequestHandlerDelegate<Unit> next, CancellationToken cancellationToken)
{
var placeHolders = CreatePlaceHolders(request);
var temp = await _tempRepo
.Where(x => x.Name == EmailTemplateType.DocumentSigned.ToString())
.SingleOrDefaultAsync(cancellationToken)
?? throw new InvalidOperationException($"Email template not found. SignCommand:\n {request.ToJson(Format.Json.ForDiagnostics)}");
temp.Subject = ReplacePlaceHolders(temp.Subject, placeHolders, _mailParams.Placeholders);
temp.Body = ReplacePlaceHolders(temp.Body, placeHolders, _mailParams.Placeholders);
var emailOut = new EmailOut
{
EmailAddress = request.EnvelopeReceiver.Receiver!.EmailAddress,
EmailBody = temp.Body,
EmailSubj = temp.Subject,
AddedWhen = DateTime.Now,
AddedWho = _dispatcherParams.AddedWho,
SendingProfile = _dispatcherParams.SendingProfile,
ReminderTypeId = _dispatcherParams.ReminderTypeId,
EmailAttmt1 = _dispatcherParams.EmailAttmt1,
WfId = (int)EnvelopeStatus.MessageConfirmationSent,
ReferenceString = request.EnvelopeReceiver.Receiver!.EmailAddress,
ReferenceId = request.EnvelopeReceiver.ReceiverId
};
await _emailOutRepo.CreateAsync(emailOut, cancellationToken);
return await next(cancellationToken);
}
private Dictionary<string, string> CreatePlaceHolders(SigningCommand request)
{
var placeHolders = new Dictionary<string, string>()
{
{ "[NAME_RECEIVER]", request.EnvelopeReceiver.Name ?? string.Empty },
{ "[DOCUMENT_TITLE]", request.EnvelopeReceiver.Envelope?.Title ?? string.Empty },
};
if (request.EnvelopeReceiver.Envelope.IsReadAndConfirm())
{
placeHolders["[SIGNATURE_TYPE]"] = "Lesen und bestätigen";
placeHolders["[DOCUMENT_PROCESS]"] = string.Empty;
placeHolders["[FINAL_STATUS]"] = "Lesebestätigung";
placeHolders["[FINAL_ACTION]"] = "Empfänger bestätigt";
placeHolders["[REJECTED_BY_OTHERS]"] = "anderen Empfänger abgelehnt!";
placeHolders["[RECEIVER_ACTION]"] = "bestätigt";
}
else
{
placeHolders["[SIGNATURE_TYPE]"] = "Signieren";
placeHolders["[DOCUMENT_PROCESS]"] = " und elektronisch unterschreiben";
placeHolders["[FINAL_STATUS]"] = "Signatur";
placeHolders["[FINAL_ACTION]"] = "Vertragspartner unterzeichnet";
placeHolders["[REJECTED_BY_OTHERS]"] = "anderen Vertragspartner abgelehnt! Ihre notwendige Unterzeichnung wurde verworfen.";
placeHolders["[RECEIVER_ACTION]"] = "unterschrieben";
}
return placeHolders;
}
private static string ReplacePlaceHolders(string text, params Dictionary<string, string>[] placeHoldersList)
{
foreach (var placeHolders in placeHoldersList)
foreach (var ph in placeHolders)
text = text.Replace(ph.Key, ph.Value);
return text;
}
}

View File

@@ -0,0 +1,78 @@
using MediatR;
using EnvelopeGenerator.Application.Common.Dto;
using EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver;
using EnvelopeGenerator.Application.Common.Query;
namespace EnvelopeGenerator.Application.DocReceiverElements.Commands;
/// <summary>
/// Command to sign a document by a receiver.
/// </summary>
public record SigningCommand : EnvelopeReceiverQueryBase, IRequest
{
private EnvelopeReceiverDto? _envelopeReceiver;
internal void SetEnvelopeReceiver(EnvelopeReceiverDto envelopeReceiver)
{
_envelopeReceiver = envelopeReceiver;
}
/// <summary>
/// The envelope receiver information.
/// </summary>
public EnvelopeReceiverDto EnvelopeReceiver
{
get => _envelopeReceiver!;
init => _envelopeReceiver = value;
}
/// <summary>
/// The PSPDFKit annotation data.
/// </summary>
[Obsolete("This notification is deprecated. Use Signature.Commands.SignCommand instead.")]
public PsPdfKitAnnotation? PsPdfKitAnnotation { get; init; }
/// <summary>
///
/// </summary>
public IEnumerable<Signature>? Signatures { get; init; }
/// <summary>
///
/// </summary>
public ReceiverAppType ReceiverAppType { get; init; } = ReceiverAppType.ReceiverUI;
}
/// <summary>
/// Handles the sign command. All work is done by pipeline behaviors.
/// This handler is intentionally empty - behaviors handle all the processing.
/// </summary>
public class SignCommandHandler : IRequestHandler<SigningCommand>
{
/// <summary>
/// Executes the signing command. Pipeline behaviors handle all processing.
/// </summary>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public Task Handle(SigningCommand request, CancellationToken cancellationToken = default)
{
return Task.CompletedTask;
}
}
/// <summary>
///
/// </summary>
public enum ReceiverAppType
{
/// <summary>
///
/// </summary>
ReceiverUI = 0,
/// <summary>
///
/// </summary>
LegacyWeb = 1,
}

View File

@@ -0,0 +1,66 @@
using AutoMapper;
using EnvelopeGenerator.Application.Common.Dto;
using EnvelopeGenerator.Application.Common.Query;
using EnvelopeGenerator.Domain.Entities;
using MediatR;
using EnvelopeGenerator.Application.Common.Extensions;
using DigitalData.Core.Abstraction.Application.Repository;
using Microsoft.EntityFrameworkCore;
namespace EnvelopeGenerator.Application.DocReceiverElements.Queries;
/// <summary>
///
/// </summary>
public record ReadDocReceiverElementQuery : EnvelopeReceiverQueryBase, IRequest<IEnumerable<DocReceiverElementDto>>
{
}
/// <summary>
///
/// </summary>
public class ReadDocReceiverElementQueryHandler : IRequestHandler<ReadDocReceiverElementQuery, IEnumerable<DocReceiverElementDto>>
{
private readonly IRepository<DocReceiverElement> _repository;
private readonly IMapper _mapper;
/// <summary>
///
/// </summary>
/// <param name="repository"></param>
/// <param name="mapper"></param>
public ReadDocReceiverElementQueryHandler(IRepository<DocReceiverElement> repository, IMapper mapper)
{
_repository = repository;
_mapper = mapper;
}
/// <summary>
///
/// </summary>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
public async Task<IEnumerable<DocReceiverElementDto>> Handle(ReadDocReceiverElementQuery request, CancellationToken cancellationToken)
{
var q = _repository.Query;
if(request.Envelope.Id is int envelopeId)
q = q.Where(e => e.Document.EnvelopeId == envelopeId);
if (request.Envelope.Uuid is string envelopeUuid)
q = q.Where(e => e.Document.Envelope.Uuid == envelopeUuid);
if (request.Receiver.Id is int receiverId)
q = q.Where(e => e.ReceiverId == receiverId);
if (request.Receiver.Signature is string signature)
q = q.Where(e => e.Receiver.Signature == signature);
var elements = await q.ToListAsync(cancellationToken);
return _mapper.Map<IEnumerable<DocReceiverElementDto>>(elements);
}
}

View File

@@ -27,7 +27,7 @@ public class MappingProfile : Profile
CreateMap<UpdateDocStatusCommand, DocumentStatus>()
.ForMember(dest => dest.Envelope, opt => opt.Ignore())
.ForMember(dest => dest.Receiver, opt => opt.Ignore())
.ForMember(dest => dest.StatusChangedWhen, opt => opt.MapFrom(src => DateTime.UtcNow))
.ForMember(dest => dest.StatusChangedWhen, opt => opt.MapFrom(src => DateTime.Now))
.MapChangedWhen();
}
}

View File

@@ -53,14 +53,17 @@ public class ReadDocumentQueryHandler : IRequestHandler<ReadDocumentQuery, Docum
/// </exception>
public async Task<DocumentDto> Handle(ReadDocumentQuery query, CancellationToken cancel)
{
var docQuery = _repo.Query.Include(doc => doc.Elements).ThenInclude(e => e.Annotations);
if (query.Id is not null)
{
var doc = await _repo.Query.Where(d => d.Id == query.Id).FirstOrDefaultAsync(cancel);
var doc = await docQuery.Where(d => d.Id == query.Id).FirstOrDefaultAsync(cancel);
return _mapper.Map<DocumentDto>(doc);
}
else if (query.EnvelopeId is not null)
{
var doc = await _repo.Query.Where(d => d.EnvelopeId == query.EnvelopeId).FirstOrDefaultAsync(cancel);
var doc = await docQuery.Where(d => d.EnvelopeId == query.EnvelopeId).FirstOrDefaultAsync(cancel);
return _mapper.Map<DocumentDto>(doc);
}

View File

@@ -29,7 +29,7 @@ public record CreateEnvelopeReceiverCommand : CreateEnvelopeCommand, IRequest<Cr
/// <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);
public record DocReceiverElementCreateDto([Required] double X, [Required] double Y, [Required] int Page);
/// <summary>
/// DTO für Empfänger, die erstellt oder abgerufen werden sollen.
@@ -41,7 +41,7 @@ public class ReceiverGetOrCreateCommand
/// Unterschriften auf Dokumenten.
/// </summary>
[Required]
public List<Signature> Signatures { get; init; } = new();
public List<DocReceiverElementCreateDto> DocReceiverElements { get; init; } = new();
/// <summary>
/// Der Name, mit dem der Empfänger angesprochen werden soll.

View File

@@ -0,0 +1,127 @@
using AutoMapper;
using DigitalData.Core.Abstraction.Application.Repository;
using EnvelopeGenerator.Application.Envelopes.Queries;
using EnvelopeGenerator.Application.Receivers.Queries;
using MediatR;
using EnvelopeGenerator.Domain.Entities;
using Microsoft.EntityFrameworkCore;
using EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver;
using EnvelopeGenerator.Application.Common.Query;
using EnvelopeGenerator.Application.Common.Extensions;
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Queries;
/// <summary>
/// Represents a query for reading an envelope receiver including sensitive fields
/// (access code, phone number) that are excluded from the standard <see cref="ReadEnvelopeReceiverQuery"/>.
/// </summary>
/// <remarks>
/// Returns a single <see cref="EnvelopeReceiverSecretDto"/> matched by UUID and receiver signature.
/// Equivalent to the legacy <c>ReadWithSecretByUuidSignatureAsync</c> service method.
/// </remarks>
public record ReadEnvelopeReceiverSecretQuery
: EnvelopeReceiverQueryBase<ReadEnvelopeQuery, ReadReceiverQuery>,
IRequest<EnvelopeReceiverSecretDto?>;
/// <summary>
/// Extension methods for dispatching <see cref="ReadEnvelopeReceiverSecretQuery"/> via <see cref="IMediator"/>.
/// </summary>
public static class ReadEnvelopeReceiverSecretQueryExtensions
{
/// <summary>
/// Sends a <see cref="ReadEnvelopeReceiverSecretQuery"/> using the composite key (uuid::signature).
/// </summary>
/// <param name="mediator">The mediator instance.</param>
/// <param name="key">Composite key in the format <c>uuid::signature</c>.</param>
/// <param name="cancel">Cancellation token.</param>
/// <returns>The matching <see cref="EnvelopeReceiverSecretDto"/>, or <c>null</c> if not found.</returns>
public static Task<EnvelopeReceiverSecretDto?> ReadEnvelopeReceiverSecretAsync(
this IMediator mediator,
string key,
CancellationToken cancel = default)
=> mediator.Send(new ReadEnvelopeReceiverSecretQuery { Key = key }, cancel);
/// <summary>
/// Sends a <see cref="ReadEnvelopeReceiverSecretQuery"/> using UUID and receiver signature.
/// </summary>
/// <param name="mediator">The mediator instance.</param>
/// <param name="uuid">Envelope UUID.</param>
/// <param name="signature">Receiver signature.</param>
/// <param name="cancel">Cancellation token.</param>
/// <returns>The matching <see cref="EnvelopeReceiverSecretDto"/>, or <c>null</c> if not found.</returns>
public static Task<EnvelopeReceiverSecretDto?> ReadEnvelopeReceiverSecretAsync(
this IMediator mediator,
string uuid,
string signature,
CancellationToken cancel = default)
{
var q = new ReadEnvelopeReceiverSecretQuery();
q.Envelope.Uuid = uuid;
q.Receiver.Signature = signature;
return mediator.Send(q, cancel);
}
/// <summary>
/// Handles <see cref="ReadEnvelopeReceiverSecretQuery"/> and returns a
/// <see cref="EnvelopeReceiverSecretDto"/> containing sensitive fields.
/// </summary>
public class ReadEnvelopeReceiverSecretQueryHandler
: IRequestHandler<ReadEnvelopeReceiverSecretQuery, EnvelopeReceiverSecretDto?>
{
private readonly IRepository<EnvelopeReceiver> _repo;
private readonly IRepository<Receiver> _rcvRepo;
private readonly IMapper _mapper;
/// <summary>
/// Initializes a new instance of <see cref="ReadEnvelopeReceiverSecretQueryHandler"/>.
/// </summary>
/// <param name="envelopeReceiver">Repository for <see cref="EnvelopeReceiver"/>.</param>
/// <param name="rcvRepo">Repository for <see cref="Receiver"/>.</param>
/// <param name="mapper">AutoMapper instance.</param>
public ReadEnvelopeReceiverSecretQueryHandler(
IRepository<EnvelopeReceiver> envelopeReceiver,
IRepository<Receiver> rcvRepo,
IMapper mapper)
{
_repo = envelopeReceiver;
_rcvRepo = rcvRepo;
_mapper = mapper;
}
/// <summary>
/// Handles the query and returns the matching <see cref="EnvelopeReceiverSecretDto"/>.
/// </summary>
/// <param name="request">The query containing filter criteria.</param>
/// <param name="cancel">Cancellation token.</param>
/// <returns>
/// The matched <see cref="EnvelopeReceiverSecretDto"/>, or <c>null</c> if no record is found.
/// </returns>
public async Task<EnvelopeReceiverSecretDto?> Handle(
ReadEnvelopeReceiverSecretQuery request,
CancellationToken cancel)
{
var q = _repo.Query.Where(request, notnull: false);
var envRcvs = await q
.Include(er => er.Envelope).ThenInclude(e => e!.Documents!).ThenInclude(d => d.Elements)
.Include(er => er.Envelope).ThenInclude(e => e!.Histories)
.Include(er => er.Envelope).ThenInclude(e => e!.User)
.Include(er => er.Receiver)
.ToListAsync(cancel);
if (request.Receiver.HasAnyCriteria && envRcvs.Count != 0)
{
var receiver = await _rcvRepo.Query.Where(request.Receiver).FirstAsync(cancel);
foreach (var item in envRcvs)
item.Envelope?.Documents?.FirstOrDefault()?.Elements?.RemoveAll(s => s.ReceiverId != receiver.Id);
}
var envRcv = envRcvs.FirstOrDefault();
if (envRcv is null)
return null;
return _mapper.Map<EnvelopeReceiverSecretDto>(envRcv);
}
}
}

View File

@@ -40,10 +40,10 @@ public record CreateEnvelopeCommand : IRequest<EnvelopeDto?>
/// </summary>
/// <param name="userId"></param>
/// <returns></returns>
public bool Authorize(int userId)
public CreateEnvelopeCommand WithAuth(int userId)
{
UserId = userId;
return true;
return this;
}
/// <summary>

View File

@@ -22,7 +22,7 @@ public record ReadEnvelopeQuery : EnvelopeQueryBase, IRequest<IEnumerable<Envelo
/// <summary>
/// Optionaler Benutzerfilter; wenn gesetzt, werden nur Umschläge des Benutzers geladen.
/// </summary>
public int? UserId { get; init; }
internal int? UserId { get; init; }
/// <summary>
/// Setzt den Benutzerkontext für die Abfrage.
@@ -133,7 +133,7 @@ public class ReadEnvelopeQueryHandler : IRequestHandler<ReadEnvelopeQuery, IEnum
}
var envelopes = await query
.Include(e => e.Documents)
.Include(e => e.EnvelopeReceivers).ThenInclude(er => er.Receiver)
.ToListAsync(cancel);
return _mapper.Map<IEnumerable<EnvelopeDto>>(envelopes);

View File

@@ -34,7 +34,7 @@ public record CreateHistoryCommand : EnvelopeReceiverQueryBase, IRequest<History
/// <summary>
///
/// </summary>
public DateTime AddedWhen { get; } = DateTime.UtcNow;
public DateTime AddedWhen { get; } = DateTime.Now;
/// <summary>
///

View File

@@ -448,7 +448,7 @@
<value>Document has been reset.</value>
</data>
<data name="DocumentSuccessfullyConfirmed" xml:space="preserve">
<value>Document successfully red and confirmed!</value>
<value>Document successfully read and confirmed!</value>
</data>
<data name="DocumentConfirmedConfirmationMessage" xml:space="preserve">
<value>You have read and confirmed the document. You will receive a written confirmation afterwards.</value>

View File

@@ -1,9 +1,9 @@
using AutoMapper;
using DigitalData.Core.Application;
using EnvelopeGenerator.Domain.Entities;
using EnvelopeGenerator.Application.Common.Dto;
using EnvelopeGenerator.Application.Common.Interfaces.Repositories;
using EnvelopeGenerator.Application.Common.Interfaces.Services;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Services;
@@ -11,7 +11,7 @@ namespace EnvelopeGenerator.Application.Services;
///
/// </summary>
[Obsolete("Use MediatR")]
public class DocumentReceiverElementService : BasicCRUDService<IDocumentReceiverElementRepository, SignatureDto, Signature, int>, IDocumentReceiverElementService
public class DocumentReceiverElementService : BasicCRUDService<IDocumentReceiverElementRepository, DocReceiverElementDto, DocReceiverElement, int>, IDocumentReceiverElementService
{
/// <summary>
///

View File

@@ -487,10 +487,6 @@
<Project>{6EA0C51F-C2B1-4462-8198-3DE0B32B74F8}</Project>
<Name>EnvelopeGenerator.CommonServices</Name>
</ProjectReference>
<ProjectReference Include="..\EnvelopeGenerator.CommonServices\EnvelopeGenerator.CommonServices.vbproj">
<Project>{6ea0c51f-c2b1-4462-8198-3de0b32b74f8}</Project>
<Name>EnvelopeGenerator.CommonServices</Name>
</ProjectReference>
<ProjectReference Include="..\EnvelopeGenerator.Domain\EnvelopeGenerator.Domain.csproj">
<Project>{4f32a98d-e6f0-4a09-bd97-1cf26107e837}</Project>
<Name>EnvelopeGenerator.Domain</Name>

View File

@@ -27,6 +27,7 @@ Partial Class frmFinalizePDF
Me.Label2 = New System.Windows.Forms.Label()
Me.Button1 = New System.Windows.Forms.Button()
Me.Button2 = New System.Windows.Forms.Button()
Me.Button3 = New System.Windows.Forms.Button()
Me.txtResult = New System.Windows.Forms.TextBox()
Me.txtEnvelope = New System.Windows.Forms.TextBox()
Me.SuspendLayout()
@@ -75,6 +76,15 @@ Partial Class frmFinalizePDF
Me.Button2.Text = "Merge Json"
Me.Button2.UseVisualStyleBackColor = True
'
'Button3
'
Me.Button3.Location = New System.Drawing.Point(15, 160)
Me.Button3.Name = "Button3"
Me.Button3.Size = New System.Drawing.Size(166, 23)
Me.Button3.TabIndex = 5
Me.Button3.Text = "Full Finalize Test"
Me.Button3.UseVisualStyleBackColor = True
'
'txtResult
'
Me.txtResult.Location = New System.Drawing.Point(333, 12)
@@ -97,6 +107,7 @@ Partial Class frmFinalizePDF
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(800, 450)
Me.Controls.Add(Me.txtResult)
Me.Controls.Add(Me.Button3)
Me.Controls.Add(Me.Button2)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.Label2)
@@ -116,5 +127,6 @@ Partial Class frmFinalizePDF
Friend WithEvents Label2 As Label
Friend WithEvents Button1 As Button
Friend WithEvents Button2 As Button
Friend WithEvents Button3 As Button
Friend WithEvents txtResult As TextBox
End Class

View File

@@ -8,6 +8,8 @@ Imports Newtonsoft.Json.Linq
Imports EnvelopeGenerator.Infrastructure
Imports Microsoft.EntityFrameworkCore
Imports DigitalData.Core.Abstractions
Imports DigitalData.Core.Abstraction.Application.Repository
Imports EnvelopeGenerator.Domain.Entities
Public Class frmFinalizePDF
Private Const CONNECTIONSTRING = "Server=sDD-VMP04-SQL17\DD_DEVELOP01;Database=DD_ECM;User Id=sa;Password=+bk8oAbbQP1AzoHtvZUbd+Mbok2f8Fl4miEx1qssJ5yEaEWoQJ9prg4L14fURpPnqi1WMNs9fE4=;" + "Encrypt=True;TrustServerCertificate=True;"
@@ -124,4 +126,86 @@ Public Class frmFinalizePDF
txtResult.Text = oJObject1.ToString()
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Try
Dim envelopeId As Integer = CInt(txtEnvelope.Text)
Dim log As New System.Text.StringBuilder()
' 1. Load annotation JSON data (same as Service)
Dim oTable = LoadAnnotationDataForEnvelope()
Dim oJsonList = oTable.Rows.
Cast(Of DataRow).
Select(Function(r As DataRow) r.Item("VALUE").ToString()).
ToList()
log.AppendLine($"Annotation JSON count: {oJsonList.Count}")
' 2. Load document bytes (same as Service)
Dim oBuffer As Byte() = ReadEnvelope(envelopeId)
log.AppendLine($"Document bytes: {oBuffer.Length}")
' 3. Check what BurnAnnotsToPDF will do internally
Using scope = Factory.Shared.ScopeFactory.CreateScope()
Dim envRepo = scope.ServiceProvider.Repository(Of Envelope)()
Dim envelope = envRepo.Where(Function(env) env.Id = envelopeId).FirstOrDefault()
If envelope Is Nothing Then
log.AppendLine("ERROR: Envelope not found in EF Core!")
txtResult.Text = log.ToString()
Return
End If
log.AppendLine($"Envelope found: Id={envelope.Id}, EnvelopeTypeId={envelope.EnvelopeTypeId}")
log.AppendLine($"ReadOnly (IsReadAndConfirm): {envelope.ReadOnly}")
If envelope.ReadOnly Then
log.AppendLine(">>> EARLY RETURN: ReadOnly=True, original PDF returned without burning")
txtResult.Text = log.ToString()
Return
End If
Dim sigRepo = scope.ServiceProvider.Repository(Of DocReceiverElement)()
Dim elements = sigRepo _
.Where(Function(sig) sig.Document.EnvelopeId = envelopeId) _
.Include(Function(sig) sig.Annotations) _
.ToList()
log.AppendLine($"Elements (Signature) count: {elements.Count}")
If elements.Any() Then
log.AppendLine(">>> PATH: BurnElementAnnotsToPDF (new element-based path)")
For Each elem In elements
Dim annotCount = If(elem.Annotations IsNot Nothing, elem.Annotations.Count(), 0)
log.AppendLine($" Element Id={elem.Id}, Page={elem.Page}, X={elem.X}, Y={elem.Y}, W={elem.Width}, H={elem.Height}, Annotations={annotCount}")
If elem.Annotations IsNot Nothing Then
For Each annot In elem.Annotations
log.AppendLine($" Annot: Name={annot.Name}, Type={annot.Type}, X={annot.X}, Y={annot.Y}, W={annot.Width}, H={annot.Height}")
Next
End If
Next
Else
log.AppendLine(">>> PATH: BurnInstantJSONAnnotsToPDF (old JSON-based path)")
End If
End Using
' 4. Actually call BurnAnnotsToPDF (same as Service)
log.AppendLine("")
log.AppendLine("Calling BurnAnnotsToPDF...")
Dim oNewBuffer = PDFBurner.BurnAnnotsToPDF(oBuffer, oJsonList, envelopeId)
log.AppendLine($"Result bytes: {oNewBuffer.Length}")
log.AppendLine($"Same as input: {oBuffer.Length = oNewBuffer.Length AndAlso oBuffer.SequenceEqual(oNewBuffer)}")
' 5. Write output
Dim desktopPath As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
Dim oNewPath = Path.Combine(desktopPath, $"E{txtEnvelope.Text}_FullTest.burned.pdf")
File.WriteAllBytes(oNewPath, oNewBuffer)
log.AppendLine($"Output: {oNewPath}")
txtResult.Text = log.ToString()
Process.Start(oNewPath)
Catch ex As Exception
txtResult.Text = $"ERROR: {ex.Message}{vbCrLf}{vbCrLf}{ex.ToString()}"
End Try
End Sub
End Class

View File

@@ -15,13 +15,13 @@
<package id="DigitalData.Modules.Messaging" version="1.9.8" targetFramework="net462" />
<package id="DocumentFormat.OpenXml" version="3.2.0" targetFramework="net462" />
<package id="DocumentFormat.OpenXml.Framework" version="3.2.0" targetFramework="net462" />
<package id="EntityFramework" version="6.5.1" targetFramework="net462" />
<package id="EntityFramework" version="6.4.4" targetFramework="net462" />
<package id="EntityFramework.Firebird" version="6.4.0" targetFramework="net462" />
<package id="FirebirdSql.Data.FirebirdClient" version="7.5.0" targetFramework="net462" />
<package id="GdPicture" version="14.3.3" targetFramework="net462" />
<package id="GdPicture.runtimes.windows" version="14.3.3" targetFramework="net462" />
<package id="Microsoft.AspNet.WebApi.Client" version="6.0.0" targetFramework="net462" />
<package id="Microsoft.Bcl.AsyncInterfaces" version="9.0.0" targetFramework="net462" />
<package id="Microsoft.Bcl.AsyncInterfaces" version="8.0.0" targetFramework="net462" />
<package id="Microsoft.Bcl.Cryptography" version="9.0.0" targetFramework="net462" />
<package id="Microsoft.Bcl.HashCode" version="1.1.1" targetFramework="net462" />
<package id="Microsoft.CSharp" version="4.7.0" targetFramework="net462" />
@@ -62,10 +62,10 @@
<package id="protobuf-net.Core" version="3.2.46" targetFramework="net462" />
<package id="RtfPipe" version="2.0.7677.4303" targetFramework="net462" />
<package id="S22.Imap" version="3.6.0.0" targetFramework="net462" />
<package id="System.Buffers" version="4.6.1" targetFramework="net462" />
<package id="System.Buffers" version="4.6.0" targetFramework="net462" />
<package id="System.ClientModel" version="1.8.0" targetFramework="net462" />
<package id="System.CodeDom" version="9.0.0" targetFramework="net462" />
<package id="System.Collections.Immutable" version="9.0.0" targetFramework="net462" />
<package id="System.CodeDom" version="8.0.0" targetFramework="net462" />
<package id="System.Collections.Immutable" version="8.0.0" targetFramework="net462" />
<package id="System.ComponentModel.Annotations" version="4.7.0" targetFramework="net462" />
<package id="System.Data.Common" version="4.3.0" targetFramework="net462" />
<package id="System.Data.Odbc" version="6.0.1" targetFramework="net462" />
@@ -74,23 +74,23 @@
<package id="System.Formats.Asn1" version="10.0.3" targetFramework="net462" />
<package id="System.IdentityModel.Tokens.Jwt" version="7.7.1" targetFramework="net462" />
<package id="System.IO.FileSystem.AccessControl" version="5.0.0" targetFramework="net462" />
<package id="System.IO.Packaging" version="9.0.0" targetFramework="net462" />
<package id="System.IO.Packaging" version="8.0.1" targetFramework="net462" />
<package id="System.IO.Pipelines" version="9.0.0" targetFramework="net462" />
<package id="System.Management" version="9.0.0" targetFramework="net462" />
<package id="System.Memory" version="4.6.3" targetFramework="net462" />
<package id="System.Management" version="8.0.0" targetFramework="net462" />
<package id="System.Memory" version="4.6.0" targetFramework="net462" />
<package id="System.Memory.Data" version="8.0.1" targetFramework="net462" />
<package id="System.Numerics.Vectors" version="4.6.1" targetFramework="net462" />
<package id="System.Runtime.CompilerServices.Unsafe" version="6.1.2" targetFramework="net462" />
<package id="System.Numerics.Vectors" version="4.6.0" targetFramework="net462" />
<package id="System.Runtime.CompilerServices.Unsafe" version="6.1.0" targetFramework="net462" />
<package id="System.Security.AccessControl" version="6.0.1" targetFramework="net462" />
<package id="System.Security.Cryptography.Algorithms" version="4.3.1" targetFramework="net462" />
<package id="System.Security.Cryptography.Cng" version="5.0.0" targetFramework="net462" />
<package id="System.Security.Cryptography.Pkcs" version="9.0.0" targetFramework="net462" />
<package id="System.Security.Cryptography.Pkcs" version="8.0.1" targetFramework="net462" />
<package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net462" />
<package id="System.Security.Cryptography.ProtectedData" version="4.5.0" targetFramework="net462" />
<package id="System.Security.Principal.Windows" version="5.0.0" targetFramework="net462" />
<package id="System.Text.Encodings.Web" version="9.0.0" targetFramework="net462" />
<package id="System.Text.Json" version="9.0.0" targetFramework="net462" />
<package id="System.Text.Encodings.Web" version="8.0.0" targetFramework="net462" />
<package id="System.Text.Json" version="8.0.6" targetFramework="net462" />
<package id="System.Text.RegularExpressions" version="4.3.1" targetFramework="net462" />
<package id="System.Threading.Tasks.Extensions" version="4.6.0" targetFramework="net462" />
<package id="System.ValueTuple" version="4.6.1" targetFramework="net462" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net462" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net462" />
</packages>

View File

@@ -15,6 +15,7 @@ Imports DigitalData.Core.Abstraction.Application
Imports EnvelopeGenerator.Infrastructure
Imports Microsoft.EntityFrameworkCore
Imports DigitalData.Core.Abstractions
Imports EnvelopeGenerator.Domain.Interfaces
Namespace Jobs
Public Class FinalizeDocumentJob
@@ -230,6 +231,29 @@ Namespace Jobs
Return Task.FromResult(True)
End Function
#Region "From BBTests"
Private Function ReadEnvelope(pEnvID As Integer) As Byte()
Dim strSql As String = "Select [BYTE_DATA] from [TBSIG_ENVELOPE_DOCUMENT] WHERE ENVELOPE_ID = " & pEnvID
Dim obyteDB = Database.GetScalarValue(strSql)
If Not IsDBNull(obyteDB) Then
Dim fileData As Byte() = DirectCast(Database.GetScalarValue(strSql), Byte())
If fileData IsNot Nothing Then
Return fileData
End If
End If
Throw New InvalidOperationException($"Byte data is null. Envelope ID: {pEnvID}")
End Function
Private Function LoadAnnotationDataForEnvelope(pEnvID As Integer) As DataTable
Dim oSql = $"SELECT VALUE FROM [TBSIG_DOCUMENT_STATUS] WHERE ENVELOPE_ID = {pEnvID}"
Return Database.GetDatatable(oSql)
End Function
#End Region
Private Sub Update_File_DB(pFilePath As String, pEnvelopeID As Long)
Dim SqlCom As SqlCommand
Dim imageData As Byte()
@@ -327,7 +351,7 @@ Namespace Jobs
Logger.Warn($"No SendFinalEmailToCreator - oMailToCreator [{oMailToCreator}] <> [{FinalEmailType.No}] ")
End If
If oMailToReceivers <> FinalEmailType.No Then
If oMailToReceivers <> FinalEmailType.No And pEnvelope.IsReadAndSign() Then
Logger.Debug("Sending emails to receivers..")
SendFinalEmailToReceivers(pEnvelope) ', pAttachment
Else
@@ -418,7 +442,18 @@ Namespace Jobs
End Try
End If
Return PDFBurner.BurnAnnotsToPDF(oInputDocumentBuffer, oAnnotations, pEnvelopeData.EnvelopeId)
#Region "From BBTests"
Dim oTable = LoadAnnotationDataForEnvelope(pEnvelopeId)
Dim oJsonList = oTable.Rows.
Cast(Of DataRow).
Select(Function(r As DataRow) r.Item("VALUE").ToString()).
ToList()
Dim oBuffer As Byte() = ReadEnvelope(pEnvelopeId)
#End Region
Return PDFBurner.BurnAnnotsToPDF(oBuffer, oJsonList, pEnvelopeId)
End Function
Private Function GetEnvelopeData(pEnvelopeId As Integer) As EnvelopeData

View File

@@ -46,7 +46,7 @@ Namespace Jobs.FinalizeDocument
Return pSourceBuffer
End If
Dim sigRepo = scope.ServiceProvider.Repository(Of Signature)()
Dim sigRepo = scope.ServiceProvider.Repository(Of DocReceiverElement)()
Dim elements = sigRepo _
.Where(Function(sig) sig.Document.EnvelopeId = envelopeId) _
.Include(Function(sig) sig.Annotations) _
@@ -58,7 +58,7 @@ Namespace Jobs.FinalizeDocument
End Using
End Function
Public Function BurnElementAnnotsToPDF(pSourceBuffer As Byte(), elements As List(Of Signature)) As Byte()
Public Function BurnElementAnnotsToPDF(pSourceBuffer As Byte(), elements As List(Of DocReceiverElement)) As Byte()
' Add background
Using doc As Pdf(Of MemoryStream, MemoryStream) = Pdf.FromMemory(pSourceBuffer)
'TODO: take the length from the largest y
@@ -85,16 +85,37 @@ Namespace Jobs.FinalizeDocument
'Add annotations
For Each element In elements
If element Is Nothing Then
Continue For
End If
Dim elementAnnotations = If(element.Annotations, Enumerable.Empty(Of ElementAnnotation)())
If Not elementAnnotations.Any() Then
Continue For
End If
Dim frameX = (element.Left - 0.7 - margin)
Dim frame = element.Annotations.FirstOrDefault(Function(a) a.Name = "frame")
Dim frame = elementAnnotations.FirstOrDefault(Function(a) a.Name = "frame")
Dim frameY = element.Top - 0.5 - margin
Dim frameYShift = frame.Y - frameY * inchFactor
Dim frameXShift = frame.X - frameX * inchFactor
Dim frameYShift As Double = 0
Dim frameXShift As Double = 0
If frame IsNot Nothing Then
frameYShift = frame.Y - frameY * inchFactor
frameXShift = frame.X - frameX * inchFactor
End If
For Each annot In elementAnnotations
If annot Is Nothing Then
Continue For
End If
Dim yOffsetofFF As Double = 0
If Not String.IsNullOrEmpty(annot.Name) Then
yOffsetsOfFF.TryGetValue(annot.Name, yOffsetofFF)
End If
For Each annot In element.Annotations
Dim yOffsetofFF As Double = If(yOffsetsOfFF.TryGetValue(annot.Name, yOffsetofFF), yOffsetofFF, 0)
Dim y = frameY + yOffsetofFF
If annot.Type = AnnotationType.FormField Then

View File

@@ -56,7 +56,7 @@ Public Class PDFMerger
' Convert to PDF/A
oMergedPDF.ConvertToPDFA(oFinalStream, PDFAConformanceLevel, ALLOW_VECTORIZATION, ALLOW_RASTERIZATION)
oStatus = oDocumentPDF.GetStat()
oStatus = oMergedPDF.GetStat()
If oStatus <> GdPictureStatus.OK Then
Throw New MergeDocumentException($"Document could not be converted to PDF/A: {oStatus}")
End If

View File

@@ -10,8 +10,8 @@ Public Class ElementModel
MyBase.New(pState)
End Sub
Private Function ToElement(pRow As DataRow) As Signature
Return New Signature() With {
Private Function ToElement(pRow As DataRow) As DocReceiverElement
Return New DocReceiverElement() With {
.Id = pRow.ItemEx("GUID", 0),
.DocumentId = pRow.ItemEx("DOCUMENT_ID", 0),
.ReceiverId = pRow.ItemEx("RECEIVER_ID", 0),
@@ -24,7 +24,7 @@ Public Class ElementModel
}
End Function
Private Function ToElements(pTable As DataTable) As List(Of Signature)
Private Function ToElements(pTable As DataTable) As List(Of DocReceiverElement)
Return pTable?.Rows.Cast(Of DataRow).
Select(AddressOf ToElement).
ToList()
@@ -80,7 +80,7 @@ Public Class ElementModel
End Try
End Function
Public Function List(pDocumentId As Integer) As List(Of Signature)
Public Function List(pDocumentId As Integer) As List(Of DocReceiverElement)
Try
Dim oSql = $"SELECT * FROM [dbo].[TBSIG_DOCUMENT_RECEIVER_ELEMENT] WHERE DOCUMENT_ID = {pDocumentId} ORDER BY PAGE ASC"
Dim oTable = Database.GetDatatable(oSql)
@@ -93,7 +93,7 @@ Public Class ElementModel
End Try
End Function
Public Function List(pDocumentId As Integer, pReceiverId As Integer) As List(Of Signature)
Public Function List(pDocumentId As Integer, pReceiverId As Integer) As List(Of DocReceiverElement)
Try
Dim oReceiverConstraint = ""
If pReceiverId > 0 Then
@@ -111,7 +111,7 @@ Public Class ElementModel
End Try
End Function
Public Function Insert(pElement As Signature) As Boolean
Public Function Insert(pElement As DocReceiverElement) As Boolean
Try
Dim oSql = "INSERT INTO [dbo].[TBSIG_DOCUMENT_RECEIVER_ELEMENT]
([DOCUMENT_ID]
@@ -161,7 +161,7 @@ Public Class ElementModel
End Try
End Function
Public Function Update(pElement As Signature) As Boolean
Public Function Update(pElement As DocReceiverElement) As Boolean
Try
Dim oSql = "UPDATE [dbo].[TBSIG_DOCUMENT_RECEIVER_ELEMENT]
SET [POSITION_X] = @POSITION_X
@@ -185,7 +185,7 @@ Public Class ElementModel
End Try
End Function
Private Function GetElementId(pElement As Signature) As Integer
Private Function GetElementId(pElement As DocReceiverElement) As Integer
Try
Return Database.GetScalarValue($"SELECT MAX(GUID) FROM TBSIG_DOCUMENT_RECEIVER_ELEMENT
WHERE DOCUMENT_ID = {pElement.DocumentId} AND RECEIVER_ID = {pElement.ReceiverId}")
@@ -196,7 +196,7 @@ Public Class ElementModel
End Try
End Function
Public Function DeleteElement(pElement As Signature) As Boolean
Public Function DeleteElement(pElement As DocReceiverElement) As Boolean
Try
Dim oSql = $"DELETE FROM TBSIG_DOCUMENT_RECEIVER_ELEMENT WHERE GUID = {pElement.Id}"
Return Database.ExecuteNonQuery(oSql)

View File

@@ -270,12 +270,26 @@ Public Class ReceiverModel
Private Function GetSignedDate(pEmailAddress As String, pEnvelopeId As Integer) As Date
Try
Dim oStatusInt As Integer = EnvelopeStatus.DocumentSigned
Return Database.GetScalarValue($"SELECT ACTION_DATE FROM [DD_ECM].[dbo].[TBSIG_ENVELOPE_HISTORY] WHERE ENVELOPE_ID = {pEnvelopeId}
Dim value = Database.GetScalarValue($"SELECT ACTION_DATE FROM [DD_ECM].[dbo].[TBSIG_ENVELOPE_HISTORY] WHERE ENVELOPE_ID = {pEnvelopeId}
And USER_REFERENCE = '{pEmailAddress}' AND [STATUS] = {oStatusInt}")
If value Is Nothing OrElse value Is DBNull.Value Then
Return DateTime.MinValue
End If
If TypeOf value Is DateTime Then
Return DirectCast(value, DateTime)
End If
Dim parsedDate As DateTime
If DateTime.TryParse(value.ToString(), parsedDate) Then
Return parsedDate
End If
Return DateTime.MinValue
Catch ex As Exception
Logger.Error(ex)
Return Nothing
Return DateTime.MinValue
End Try
End Function

View File

@@ -1,10 +1,10 @@
'------------------------------------------------------------------------------
' <auto-generated>
' Dieser Code wurde von einem Tool generiert.
' Laufzeitversion:4.0.30319.42000
' This code was generated by a tool.
' Runtime Version:4.0.30319.42000
'
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
' der Code erneut generiert wird.
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------
@@ -15,12 +15,12 @@ Imports System
Namespace My.Resources
'Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
'-Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
'Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
'mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
'This class was auto-generated by the StronglyTypedResourceBuilder
'class via a tool like ResGen or Visual Studio.
'To add or remove a member, edit your .ResX file then rerun ResGen
'with the /str option, or rebuild your VS project.
'''<summary>
''' Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
''' A strongly-typed resource class, for looking up localized strings, etc.
'''</summary>
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0"), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
@@ -37,7 +37,7 @@ Namespace My.Resources
End Sub
'''<summary>
''' Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
''' Returns the cached ResourceManager instance used by this class.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Public Shared ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
@@ -51,8 +51,8 @@ Namespace My.Resources
End Property
'''<summary>
''' Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
''' Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
''' Overrides the current thread's CurrentUICulture property for all
''' resource lookups using this strongly typed resource class.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Public Shared Property Culture() As Global.System.Globalization.CultureInfo
@@ -65,7 +65,7 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Zugriffscode korrekt eingegeben ähnelt.
''' Looks up a localized string similar to Zugriffscode korrekt eingegeben.
'''</summary>
Public Shared ReadOnly Property AccessCodeCorrect() As String
Get
@@ -74,7 +74,7 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Zugriffscode falsch eingegeben ähnelt.
''' Looks up a localized string similar to Zugriffscode falsch eingegeben.
'''</summary>
Public Shared ReadOnly Property AccessCodeIncorrect() As String
Get
@@ -83,7 +83,7 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Zugriffscode angefordert ähnelt.
''' Looks up a localized string similar to Zugriffscode angefordert.
'''</summary>
Public Shared ReadOnly Property AccessCodeRequested() As String
Get
@@ -92,7 +92,7 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Fortgeschrittene Elektronische Signatur ähnelt.
''' Looks up a localized string similar to Fortgeschrittene Elektronische Signatur.
'''</summary>
Public Shared ReadOnly Property AdvancedElectronicSignature() As String
Get
@@ -101,7 +101,7 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Abgeschlossen ähnelt.
''' Looks up a localized string similar to Abgeschlossen.
'''</summary>
Public Shared ReadOnly Property Completed() As String
Get
@@ -110,7 +110,16 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Vollständig Signiert ähnelt.
''' Looks up a localized string similar to Vollständig bestätigt.
'''</summary>
Public Shared ReadOnly Property CompletelyConfirmed() As String
Get
Return ResourceManager.GetString("CompletelyConfirmed", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Vollständig signiert.
'''</summary>
Public Shared ReadOnly Property CompletelySigned() As String
Get
@@ -119,7 +128,25 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Vertrag ähnelt.
''' Looks up a localized string similar to Lesebestätigung.
'''</summary>
Public Shared ReadOnly Property Confirmation() As String
Get
Return ResourceManager.GetString("Confirmation", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Gelesen und Bestätigt.
'''</summary>
Public Shared ReadOnly Property Confirmed() As String
Get
Return ResourceManager.GetString("Confirmed", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Vertrag.
'''</summary>
Public Shared ReadOnly Property Contract() As String
Get
@@ -128,7 +155,7 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Erstellt ähnelt.
''' Looks up a localized string similar to Erstellt.
'''</summary>
Public Shared ReadOnly Property Created() As String
Get
@@ -137,7 +164,16 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Dokument Rotation geändert ähnelt.
''' Looks up a localized string similar to Dokument gelesen und bestätigt.
'''</summary>
Public Shared ReadOnly Property DocumentConfirmed() As String
Get
Return ResourceManager.GetString("DocumentConfirmed", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Dokument Rotation geändert.
'''</summary>
Public Shared ReadOnly Property DocumentMod_Rotation() As String
Get
@@ -146,7 +182,7 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Dokument geöffnet ähnelt.
''' Looks up a localized string similar to Dokument geöffnet.
'''</summary>
Public Shared ReadOnly Property DocumentOpened() As String
Get
@@ -155,7 +191,7 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Unterzeichnung abgelehnt ähnelt.
''' Looks up a localized string similar to Unterzeichnung abgelehnt.
'''</summary>
Public Shared ReadOnly Property DocumentRejected() As String
Get
@@ -164,7 +200,16 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Dokument unterzeichnet ähnelt.
''' Looks up a localized string similar to Lesebestätigung abgelehnt.
'''</summary>
Public Shared ReadOnly Property DocumentRejectedRaC() As String
Get
Return ResourceManager.GetString("DocumentRejectedRaC", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Dokument unterzeichnet.
'''</summary>
Public Shared ReadOnly Property DocumentSigned() As String
Get
@@ -173,7 +218,7 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Entwurf ähnelt.
''' Looks up a localized string similar to Entwurf.
'''</summary>
Public Shared ReadOnly Property Draft() As String
Get
@@ -182,7 +227,7 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Archiviert ähnelt.
''' Looks up a localized string similar to Archiviert.
'''</summary>
Public Shared ReadOnly Property EnvelopeArchived() As String
Get
@@ -191,7 +236,16 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Vollständig signiert ähnelt.
''' Looks up a localized string similar to Vollständig bestätigt.
'''</summary>
Public Shared ReadOnly Property EnvelopeCompletelyConfirmed() As String
Get
Return ResourceManager.GetString("EnvelopeCompletelyConfirmed", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Vollständig signiert.
'''</summary>
Public Shared ReadOnly Property EnvelopeCompletelySigned() As String
Get
@@ -200,7 +254,7 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Umschlag Erstellt ähnelt.
''' Looks up a localized string similar to Umschlag Erstellt.
'''</summary>
Public Shared ReadOnly Property EnvelopeCreated() As String
Get
@@ -209,7 +263,7 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Umschlag Gelöscht ähnelt.
''' Looks up a localized string similar to Umschlag Gelöscht.
'''</summary>
Public Shared ReadOnly Property EnvelopeDeleted() As String
Get
@@ -218,7 +272,16 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Teil-Signiert ähnelt.
''' Looks up a localized string similar to Teil-Bestätigt.
'''</summary>
Public Shared ReadOnly Property EnvelopePartlyConfirmed() As String
Get
Return ResourceManager.GetString("EnvelopePartlyConfirmed", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Teil-Signiert.
'''</summary>
Public Shared ReadOnly Property EnvelopePartlySigned() As String
Get
@@ -227,7 +290,7 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Umschlag in Queue ähnelt.
''' Looks up a localized string similar to Umschlag in Queue.
'''</summary>
Public Shared ReadOnly Property EnvelopeQueued() As String
Get
@@ -236,7 +299,7 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Umschlag abgelehnt ähnelt.
''' Looks up a localized string similar to Umschlag abgelehnt.
'''</summary>
Public Shared ReadOnly Property EnvelopeRejected() As String
Get
@@ -245,7 +308,7 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Signierungszertifikat erstellt ähnelt.
''' Looks up a localized string similar to Signierungszertifikat erstellt.
'''</summary>
Public Shared ReadOnly Property EnvelopeReportCreated() As String
Get
@@ -254,7 +317,16 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Gespeichert ähnelt.
''' Looks up a localized string similar to Lesebestätigungszertifikat erstellt.
'''</summary>
Public Shared ReadOnly Property EnvelopeReportCreatedRaC() As String
Get
Return ResourceManager.GetString("EnvelopeReportCreatedRaC", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Gespeichert.
'''</summary>
Public Shared ReadOnly Property EnvelopeSaved() As String
Get
@@ -263,7 +335,7 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Gesendet ähnelt.
''' Looks up a localized string similar to Gesendet.
'''</summary>
Public Shared ReadOnly Property EnvelopeSent() As String
Get
@@ -272,7 +344,7 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Umschlag zurückgezogen ähnelt.
''' Looks up a localized string similar to Umschlag zurückgezogen.
'''</summary>
Public Shared ReadOnly Property EnvelopeWithdrawn() As String
Get
@@ -281,7 +353,7 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Zugriffscode versendet ähnelt.
''' Looks up a localized string similar to Zugriffscode versendet.
'''</summary>
Public Shared ReadOnly Property MessageAccessCodeSent() As String
Get
@@ -290,7 +362,7 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Abschlussemail versendet ähnelt.
''' Looks up a localized string similar to Abschlussemail versendet.
'''</summary>
Public Shared ReadOnly Property MessageCompletionSent() As String
Get
@@ -299,7 +371,7 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Signaturbestätigung versendet ähnelt.
''' Looks up a localized string similar to Signaturbestätigung versendet.
'''</summary>
Public Shared ReadOnly Property MessageConfirmationSent() As String
Get
@@ -308,7 +380,16 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Löschinformation versendet ähnelt.
''' Looks up a localized string similar to Lesebestätigung versendet.
'''</summary>
Public Shared ReadOnly Property MessageConfirmationSentRaC() As String
Get
Return ResourceManager.GetString("MessageConfirmationSentRaC", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Löschinformation versendet.
'''</summary>
Public Shared ReadOnly Property MessageDeletionSent() As String
Get
@@ -317,7 +398,7 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Dokumentenlink versendet ähnelt.
''' Looks up a localized string similar to Dokumentenlink versendet.
'''</summary>
Public Shared ReadOnly Property MessageInvitationSent() As String
Get
@@ -326,7 +407,7 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Nein ähnelt.
''' Looks up a localized string similar to Nein.
'''</summary>
Public Shared ReadOnly Property No() As String
Get
@@ -335,7 +416,16 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Teil-Signiert ähnelt.
''' Looks up a localized string similar to Teil-Bestätigt.
'''</summary>
Public Shared ReadOnly Property PartlyConfirmed() As String
Get
Return ResourceManager.GetString("PartlyConfirmed", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Teil-Signiert.
'''</summary>
Public Shared ReadOnly Property PartlySigned() As String
Get
@@ -344,7 +434,7 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Qualifizierte Signatur ähnelt.
''' Looks up a localized string similar to Qualifizierte Signatur.
'''</summary>
Public Shared ReadOnly Property QualifiedSignature() As String
Get
@@ -353,7 +443,7 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Arbeitsanweisung ähnelt.
''' Looks up a localized string similar to Lesebestätigung.
'''</summary>
Public Shared ReadOnly Property ReadAndSign() As String
Get
@@ -362,7 +452,7 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Wollen Sie die 2-Faktor Definition für diesen Empfänger zurücksetzen. Der Empfänger muss sich dann neu identifizieren! ähnelt.
''' Looks up a localized string similar to Wollen Sie die 2-Faktor Definition für diesen Empfänger zurücksetzen. Der Empfänger muss sich dann neu identifizieren!.
'''</summary>
Public Shared ReadOnly Property ResetTOTPUser() As String
Get
@@ -371,7 +461,7 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Gespeichert ähnelt.
''' Looks up a localized string similar to Gespeichert.
'''</summary>
Public Shared ReadOnly Property Saved() As String
Get
@@ -380,7 +470,7 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Gesendet ähnelt.
''' Looks up a localized string similar to Gesendet.
'''</summary>
Public Shared ReadOnly Property Sent() As String
Get
@@ -389,7 +479,7 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Signatur ähnelt.
''' Looks up a localized string similar to Signatur.
'''</summary>
Public Shared ReadOnly Property Signature() As String
Get
@@ -398,7 +488,7 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Signatur bestätigt ähnelt.
''' Looks up a localized string similar to Abschluss bestätigt.
'''</summary>
Public Shared ReadOnly Property SignatureConfirmed() As String
Get
@@ -407,7 +497,7 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Signiert ähnelt.
''' Looks up a localized string similar to Signiert.
'''</summary>
Public Shared ReadOnly Property Signed() As String
Get
@@ -416,7 +506,7 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Erfolgreich! Dialog wird geschlossen. ähnelt.
''' Looks up a localized string similar to Erfolgreich! Dialog wird geschlossen..
'''</summary>
Public Shared ReadOnly Property Success_FormClose() As String
Get
@@ -425,7 +515,7 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Unsigniert ähnelt.
''' Looks up a localized string similar to Unsigniert.
'''</summary>
Public Shared ReadOnly Property Unsigned() As String
Get
@@ -434,7 +524,7 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Ja ähnelt.
''' Looks up a localized string similar to Ja.
'''</summary>
Public Shared ReadOnly Property Yes() As String
Get
@@ -443,7 +533,7 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Ja, mit Anhang ähnelt.
''' Looks up a localized string similar to Ja, mit Anhang.
'''</summary>
Public Shared ReadOnly Property YesWithAttachment() As String
Get

View File

@@ -132,12 +132,27 @@
<data name="Completed" xml:space="preserve">
<value>Completed</value>
</data>
<data name="CompletelyConfirmed" xml:space="preserve">
<value>Completely confirmed</value>
</data>
<data name="CompletelySigned" xml:space="preserve">
<value>Completely signed</value>
</data>
<data name="Confirmation" xml:space="preserve">
<value>Read Confirmation</value>
</data>
<data name="Confirmed" xml:space="preserve">
<value>Read and signed</value>
</data>
<data name="Contract" xml:space="preserve">
<value>Contract</value>
</data>
<data name="Created" xml:space="preserve">
<value>Created</value>
</data>
<data name="DocumentConfirmed" xml:space="preserve">
<value>Document read and confirmed</value>
</data>
<data name="DocumentMod_Rotation" xml:space="preserve">
<value>Document rotation adapted</value>
</data>
@@ -147,6 +162,9 @@
<data name="DocumentRejected" xml:space="preserve">
<value>Signing rejected</value>
</data>
<data name="DocumentRejectedRaC" xml:space="preserve">
<value>Read confirmation rejected</value>
</data>
<data name="DocumentSigned" xml:space="preserve">
<value>Document signed</value>
</data>
@@ -156,6 +174,9 @@
<data name="EnvelopeArchived" xml:space="preserve">
<value>Archived</value>
</data>
<data name="EnvelopeCompletelyConfirmed" xml:space="preserve">
<value>Completely confirmed</value>
</data>
<data name="EnvelopeCompletelySigned" xml:space="preserve">
<value>Completely signed</value>
</data>
@@ -165,8 +186,11 @@
<data name="EnvelopeDeleted" xml:space="preserve">
<value>Envelope Deleted</value>
</data>
<data name="EnvelopePartlyConfirmed" xml:space="preserve">
<value>Partially confirmed</value>
</data>
<data name="EnvelopePartlySigned" xml:space="preserve">
<value>Partly signed</value>
<value>Partially signed</value>
</data>
<data name="EnvelopeQueued" xml:space="preserve">
<value>Envelope Queued</value>
@@ -177,6 +201,9 @@
<data name="EnvelopeReportCreated" xml:space="preserve">
<value>Signature certificate created</value>
</data>
<data name="EnvelopeReportCreatedRaC" xml:space="preserve">
<value>Read Confirmation Certificate Created</value>
</data>
<data name="EnvelopeSaved" xml:space="preserve">
<value>Saved</value>
</data>
@@ -195,6 +222,9 @@
<data name="MessageConfirmationSent" xml:space="preserve">
<value>Confirmation Sent</value>
</data>
<data name="MessageConfirmationSentRaC" xml:space="preserve">
<value>Read Confirmation Sent</value>
</data>
<data name="MessageDeletionSent" xml:space="preserve">
<value>Deletion Notice Sent</value>
</data>
@@ -204,6 +234,12 @@
<data name="No" xml:space="preserve">
<value>No</value>
</data>
<data name="PartlyConfirmed" xml:space="preserve">
<value>Partially confirmed</value>
</data>
<data name="PartlySigned" xml:space="preserve">
<value>Partially signed</value>
</data>
<data name="QualifiedSignature" xml:space="preserve">
<value>Qualified Signature</value>
</data>
@@ -223,7 +259,7 @@
<value>Signature</value>
</data>
<data name="SignatureConfirmed" xml:space="preserve">
<value>Signature confirmed</value>
<value>Finalization confirmed</value>
</data>
<data name="Signed" xml:space="preserve">
<value>Signed</value>

View File

@@ -132,8 +132,17 @@
<data name="Completed" xml:space="preserve">
<value>Abgeschlossen</value>
</data>
<data name="CompletelyConfirmed" xml:space="preserve">
<value>Vollständig bestätigt</value>
</data>
<data name="CompletelySigned" xml:space="preserve">
<value>Vollständig Signiert</value>
<value>Vollständig signiert</value>
</data>
<data name="Confirmation" xml:space="preserve">
<value>Lesebestätigung</value>
</data>
<data name="Confirmed" xml:space="preserve">
<value>Gelesen und Bestätigt</value>
</data>
<data name="Contract" xml:space="preserve">
<value>Vertrag</value>
@@ -141,6 +150,9 @@
<data name="Created" xml:space="preserve">
<value>Erstellt</value>
</data>
<data name="DocumentConfirmed" xml:space="preserve">
<value>Dokument gelesen und bestätigt</value>
</data>
<data name="DocumentMod_Rotation" xml:space="preserve">
<value>Dokument Rotation geändert</value>
</data>
@@ -150,6 +162,9 @@
<data name="DocumentRejected" xml:space="preserve">
<value>Unterzeichnung abgelehnt</value>
</data>
<data name="DocumentRejectedRaC" xml:space="preserve">
<value>Lesebestätigung abgelehnt</value>
</data>
<data name="DocumentSigned" xml:space="preserve">
<value>Dokument unterzeichnet</value>
</data>
@@ -159,6 +174,9 @@
<data name="EnvelopeArchived" xml:space="preserve">
<value>Archiviert</value>
</data>
<data name="EnvelopeCompletelyConfirmed" xml:space="preserve">
<value>Vollständig bestätigt</value>
</data>
<data name="EnvelopeCompletelySigned" xml:space="preserve">
<value>Vollständig signiert</value>
</data>
@@ -168,6 +186,9 @@
<data name="EnvelopeDeleted" xml:space="preserve">
<value>Umschlag Gelöscht</value>
</data>
<data name="EnvelopePartlyConfirmed" xml:space="preserve">
<value>Teil-Bestätigt</value>
</data>
<data name="EnvelopePartlySigned" xml:space="preserve">
<value>Teil-Signiert</value>
</data>
@@ -180,6 +201,9 @@
<data name="EnvelopeReportCreated" xml:space="preserve">
<value>Signierungszertifikat erstellt</value>
</data>
<data name="EnvelopeReportCreatedRaC" xml:space="preserve">
<value>Lesebestätigungszertifikat erstellt</value>
</data>
<data name="EnvelopeSaved" xml:space="preserve">
<value>Gespeichert</value>
</data>
@@ -198,6 +222,9 @@
<data name="MessageConfirmationSent" xml:space="preserve">
<value>Signaturbestätigung versendet</value>
</data>
<data name="MessageConfirmationSentRaC" xml:space="preserve">
<value>Lesebestätigung versendet</value>
</data>
<data name="MessageDeletionSent" xml:space="preserve">
<value>Löschinformation versendet</value>
</data>
@@ -207,6 +234,9 @@
<data name="No" xml:space="preserve">
<value>Nein</value>
</data>
<data name="PartlyConfirmed" xml:space="preserve">
<value>Teil-Bestätigt</value>
</data>
<data name="PartlySigned" xml:space="preserve">
<value>Teil-Signiert</value>
</data>
@@ -214,7 +244,7 @@
<value>Qualifizierte Signatur</value>
</data>
<data name="ReadAndSign" xml:space="preserve">
<value>Arbeitsanweisung</value>
<value>Lesebestätigung</value>
</data>
<data name="ResetTOTPUser" xml:space="preserve">
<value>Wollen Sie die 2-Faktor Definition für diesen Empfänger zurücksetzen. Der Empfänger muss sich dann neu identifizieren!</value>
@@ -229,7 +259,7 @@
<value>Signatur</value>
</data>
<data name="SignatureConfirmed" xml:space="preserve">
<value>Signatur bestätigt</value>
<value>Abschluss bestätigt</value>
</data>
<data name="Signed" xml:space="preserve">
<value>Signiert</value>

View File

@@ -0,0 +1,145 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using EnvelopeGenerator.Application;
using EnvelopeGenerator.Application.Common.Interfaces.Services;
using EnvelopeGenerator.Application.Services;
using EnvelopeGenerator.Infrastructure;
using DigitalData.EmailProfilerDispatcher;
using DigitalData.UserManager.DependencyInjection;
namespace EnvelopeGenerator.DependencyInjection;
/// <summary>
/// Controls which optional services are registered by <see cref="DependencyInjection.AddEnvelopeGenerator"/>.
/// All flags default to <c>true</c>. Set a flag to <c>false</c> if the consuming project
/// already registers that service itself or simply does not need it.
/// </summary>
public sealed class EnvelopeGeneratorOptions
{
/// <summary>Calls <c>AddHttpContextAccessor()</c>. Default: <c>true</c>.</summary>
public bool AddHttpContextAccessor { get; set; } = true;
/// <summary>
/// Calls <c>AddDistributedSqlServerCache()</c> with the supplied <see cref="SqlCacheOptions"/>.
/// Requires <see cref="SqlCacheOptions"/> to be configured. Default: <c>true</c>.
/// </summary>
public bool AddDistributedSqlServerCache { get; set; } = true;
/// <summary>
/// Options for the distributed SQL Server cache.
/// Required when <see cref="AddDistributedSqlServerCache"/> is <c>true</c>.
/// </summary>
public SqlCacheOptions? SqlCacheOptions { get; set; }
/// <summary>Calls <c>AddDispatcher&lt;TDbContext&gt;()</c>. Default: <c>true</c>.</summary>
public bool AddDispatcher { get; set; } = true;
/// <summary>Calls <c>AddMemoryCache()</c>. Default: <c>true</c>.</summary>
public bool AddMemoryCache { get; set; } = true;
/// <summary>Calls <c>AddUserManager&lt;TDbContext&gt;()</c>. Default: <c>true</c>.</summary>
public bool AddUserManager { get; set; } = true;
}
/// <summary>Options for <c>AddDistributedSqlServerCache</c>.</summary>
public sealed class SqlCacheOptions
{
/// <summary>SQL Server connection string.</summary>
public string ConnectionString { get; set; } = string.Empty;
/// <summary>Schema name. Default: <c>dbo</c>.</summary>
public string SchemaName { get; set; } = "dbo";
/// <summary>Table name. Default: <c>TBDD_CACHE</c>.</summary>
public string TableName { get; set; } = "TBDD_CACHE";
}
/// <summary>
/// Extension methods for registering EnvelopeGenerator services into an <see cref="IServiceCollection"/>.
/// Use <see cref="AddEnvelopeGenerator{TDbContext}"/> as the single entry-point for projects that need both the
/// application layer (MediatR, AutoMapper, CRUD services, configuration sections) and the infrastructure
/// layer (repositories, DbContext, SQL executors).
/// For projects that do not need a database (e.g. lightweight API gateways or unit-test hosts), use
/// <see cref="AddEnvelopeGeneratorCore"/> to register only the application layer.
/// </summary>
public static class DependencyInjection
{
/// <summary>
/// Registers the full EnvelopeGenerator stack using <see cref="EGDbContext"/> as the DbContext type.
/// </summary>
public static IServiceCollection AddEnvelopeGenerator(
this IServiceCollection services,
IConfiguration configuration,
Action<EnvelopeGenerator.Infrastructure.DependencyInjection.Config>? infrastructureOptions = null,
Action<EnvelopeGeneratorOptions>? options = null)
{
var opt = new EnvelopeGeneratorOptions();
options?.Invoke(opt);
#pragma warning disable CS0618
// Application layer: CRUD services, MediatR, AutoMapper, configuration sections.
services.AddEnvelopeGeneratorServices(configuration);
// Infrastructure layer: repositories, DbContext, Dapper type maps, SQL executors.
services.AddEnvelopeGeneratorInfrastructureServices(cfg =>
{
infrastructureOptions?.Invoke(cfg);
});
#pragma warning restore CS0618
if (opt.AddHttpContextAccessor)
services.AddHttpContextAccessor();
if (opt.AddDistributedSqlServerCache && opt.SqlCacheOptions is { } cacheOpts)
services.AddDistributedSqlServerCache(o =>
{
o.ConnectionString = cacheOpts.ConnectionString;
o.SchemaName = cacheOpts.SchemaName;
o.TableName = cacheOpts.TableName;
});
if (opt.AddDispatcher)
services.AddDispatcher<EGDbContext>();
if (opt.AddMemoryCache)
services.AddMemoryCache();
#pragma warning disable CS0618
if (opt.AddUserManager)
services.AddUserManager<EGDbContext>();
#pragma warning restore CS0618
return services;
}
/// <summary>
/// Registers only the <em>application</em> layer services (MediatR handlers, AutoMapper profiles,
/// CRUD services, configuration sections) without any infrastructure / database dependencies.
/// </summary>
/// <param name="services">Service collection to register services into.</param>
/// <param name="configuration">Application configuration used to bind application-level option sections.</param>
/// <returns>The updated <see cref="IServiceCollection"/>.</returns>
#pragma warning disable CS0618
public static IServiceCollection AddEnvelopeGeneratorCore(
this IServiceCollection services,
IConfiguration configuration)
{
services.AddEnvelopeGeneratorServices(configuration);
return services;
}
#pragma warning restore CS0618
/// <summary>
/// Registers <see cref="EnvelopeMailService"/> as the <see cref="IEnvelopeMailService"/> scoped
/// implementation.
/// </summary>
/// <param name="services">Service collection to register services into.</param>
/// <returns>The updated <see cref="IServiceCollection"/>.</returns>
#pragma warning disable CS0618
public static IServiceCollection AddEnvelopeMailService(this IServiceCollection services)
{
services.AddScoped<IEnvelopeMailService, EnvelopeMailService>();
return services;
}
#pragma warning restore CS0618
}

View File

@@ -0,0 +1,176 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net7.0;net8.0;net9.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<!-- NuGet package metadata -->
<PackageId>EnvelopeGenerator</PackageId>
<Authors>Digital Data GmbH</Authors>
<Company>Digital Data GmbH</Company>
<Product>EnvelopeGenerator</Product>
<Description>
Envelope Generator ist eine Bibliothek zur Verwaltung und Verarbeitung digitaler Umschläge (Envelopes).
Dieses Paket enthält die Dependency-Injection-Erweiterungsmethoden und bündelt die Application-
sowie Infrastructure-Schicht in einer einzigen NuGet-Referenz.
</Description>
<Copyright>Copyright 2024 Digital Data GmbH</Copyright>
<RepositoryUrl>http://git.dd:3000/AppStd/EnvelopeGenerator.git</RepositoryUrl>
<PackageTags>digital data envelope generator di dependency injection</PackageTags>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<Version>1.2.0.3</Version>
<AssemblyVersion>1.2.0.3</AssemblyVersion>
<FileVersion>1.2.0.3</FileVersion>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
</PropertyGroup>
<!-- ASP.NET Core shared framework (AddHttpContextAccessor, AddMemoryCache, etc.) -->
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
<!--
All dependencies are declared here.
Because Application and Infrastructure DLLs are bundled via PrivateAssets=all,
their PackageReferences have been moved to this project so that the correct
dependencies are written to the nuspec and a consuming project works with
a single package install.
-->
<ItemGroup>
<!-- DigitalData BaGet packages -->
<PackageReference Include="DigitalData.Core.Abstraction.Application" Version="1.6.0" />
<PackageReference Include="DigitalData.Core.Application" Version="3.4.0" />
<PackageReference Include="DigitalData.Core.Client" Version="2.1.0" />
<PackageReference Include="DigitalData.Core.Exceptions" Version="1.1.0" />
<PackageReference Include="DigitalData.Core.Infrastructure" Version="2.6.1" />
<PackageReference Include="DigitalData.EmailProfilerDispatcher" Version="3.1.1" />
<PackageReference Include="UserManager" Version="1.1.3" />
<!-- ORM / Database -->
<PackageReference Include="Dapper" Version="2.1.66" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.2" />
<!-- Application services -->
<PackageReference Include="MediatR" Version="12.5.0" />
<PackageReference Include="QRCoder" Version="1.6.0" />
<PackageReference Include="QRCoder-ImageSharp" Version="0.10.0" />
<PackageReference Include="QuestPDF" Version="2025.7.1" />
<PackageReference Include="Otp.NET" Version="1.4.0" />
<!-- Security / Identity -->
<PackageReference Include="Microsoft.Identity.Client" Version="4.82.1" />
<!-- Utilities -->
<PackageReference Include="HtmlSanitizer" Version="9.0.892" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.12" />
<PackageReference Include="System.Formats.Asn1" Version="10.0.3" />
<PackageReference Include="System.Security.AccessControl" Version="6.0.1" />
<!-- DI abstractions -->
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="9.0.6" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.6" />
</ItemGroup>
<!-- TFM-specific packages -->
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageReference Include="AutoMapper" Version="13.0.1" />
<PackageReference Include="CommandDotNet" Version="7.0.5" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.20" />
<PackageReference Include="Microsoft.Extensions.Caching.SqlServer" Version="7.0.20" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.20" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="7.0.20" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.20" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="AutoMapper" Version="14.0.0" />
<PackageReference Include="CommandDotNet" Version="8.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.17" />
<PackageReference Include="Microsoft.Extensions.Caching.SqlServer" Version="8.0.17" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.17" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.17" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.17" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
<PackageReference Include="AutoMapper" Version="14.0.0" />
<PackageReference Include="CommandDotNet" Version="8.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.6" />
<PackageReference Include="Microsoft.Extensions.Caching.SqlServer" Version="9.0.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.6" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\EnvelopeGenerator.Application\EnvelopeGenerator.Application.csproj">
<PrivateAssets>all</PrivateAssets>
</ProjectReference>
<ProjectReference Include="..\EnvelopeGenerator.Domain\EnvelopeGenerator.Domain.csproj">
<PrivateAssets>all</PrivateAssets>
</ProjectReference>
<ProjectReference Include="..\EnvelopeGenerator.Infrastructure\EnvelopeGenerator.Infrastructure.csproj">
<PrivateAssets>all</PrivateAssets>
</ProjectReference>
</ItemGroup>
<!-- Bundle dependency DLLs into the package lib folder -->
<Target Name="IncludeDependencyDlls" BeforeTargets="_GetPackageFiles">
<ItemGroup>
<_DepDlls Include="&#xD;&#xA; ..\EnvelopeGenerator.Application\bin\$(Configuration)\%(ProjectReference.TargetFramework)\EnvelopeGenerator.Application.dll;&#xD;&#xA; ..\EnvelopeGenerator.Domain\bin\$(Configuration)\%(ProjectReference.TargetFramework)\EnvelopeGenerator.Domain.dll;&#xD;&#xA; ..\EnvelopeGenerator.Infrastructure\bin\$(Configuration)\%(ProjectReference.TargetFramework)\EnvelopeGenerator.Infrastructure.dll" />
</ItemGroup>
</Target>
<!--
Rebuild all dependency projects for every TFM before packing so that
the DLLs bundled into the package are always up-to-date.
Run with: dotnet pack -c Release
-->
<Target Name="RebuildDependenciesBeforePack" BeforeTargets="GenerateNuspec">
<MSBuild Projects="..\EnvelopeGenerator.Application\EnvelopeGenerator.Application.csproj"
Targets="Build"
Properties="Configuration=$(Configuration);TargetFramework=net7.0" />
<MSBuild Projects="..\EnvelopeGenerator.Application\EnvelopeGenerator.Application.csproj"
Targets="Build"
Properties="Configuration=$(Configuration);TargetFramework=net8.0" />
<MSBuild Projects="..\EnvelopeGenerator.Application\EnvelopeGenerator.Application.csproj"
Targets="Build"
Properties="Configuration=$(Configuration);TargetFramework=net9.0" />
<MSBuild Projects="..\EnvelopeGenerator.Domain\EnvelopeGenerator.Domain.csproj"
Targets="Build"
Properties="Configuration=$(Configuration);TargetFramework=net7.0" />
<MSBuild Projects="..\EnvelopeGenerator.Domain\EnvelopeGenerator.Domain.csproj"
Targets="Build"
Properties="Configuration=$(Configuration);TargetFramework=net8.0" />
<MSBuild Projects="..\EnvelopeGenerator.Domain\EnvelopeGenerator.Domain.csproj"
Targets="Build"
Properties="Configuration=$(Configuration);TargetFramework=net9.0" />
<MSBuild Projects="..\EnvelopeGenerator.Infrastructure\EnvelopeGenerator.Infrastructure.csproj"
Targets="Build"
Properties="Configuration=$(Configuration);TargetFramework=net7.0" />
<MSBuild Projects="..\EnvelopeGenerator.Infrastructure\EnvelopeGenerator.Infrastructure.csproj"
Targets="Build"
Properties="Configuration=$(Configuration);TargetFramework=net8.0" />
<MSBuild Projects="..\EnvelopeGenerator.Infrastructure\EnvelopeGenerator.Infrastructure.csproj"
Targets="Build"
Properties="Configuration=$(Configuration);TargetFramework=net9.0" />
</Target>
<Target Name="BundleReferencedDlls" AfterTargets="Build">
<ItemGroup>
<BuildOutputInPackage Include="..\EnvelopeGenerator.Application\bin\$(Configuration)\net7.0\EnvelopeGenerator.Application.dll" TargetFramework="net7.0" />
<BuildOutputInPackage Include="..\EnvelopeGenerator.Application\bin\$(Configuration)\net8.0\EnvelopeGenerator.Application.dll" TargetFramework="net8.0" />
<BuildOutputInPackage Include="..\EnvelopeGenerator.Application\bin\$(Configuration)\net9.0\EnvelopeGenerator.Application.dll" TargetFramework="net9.0" />
<BuildOutputInPackage Include="..\EnvelopeGenerator.Domain\bin\$(Configuration)\net7.0\EnvelopeGenerator.Domain.dll" TargetFramework="net7.0" />
<BuildOutputInPackage Include="..\EnvelopeGenerator.Domain\bin\$(Configuration)\net8.0\EnvelopeGenerator.Domain.dll" TargetFramework="net8.0" />
<BuildOutputInPackage Include="..\EnvelopeGenerator.Domain\bin\$(Configuration)\net9.0\EnvelopeGenerator.Domain.dll" TargetFramework="net9.0" />
<BuildOutputInPackage Include="..\EnvelopeGenerator.Infrastructure\bin\$(Configuration)\net7.0\EnvelopeGenerator.Infrastructure.dll" TargetFramework="net7.0" />
<BuildOutputInPackage Include="..\EnvelopeGenerator.Infrastructure\bin\$(Configuration)\net8.0\EnvelopeGenerator.Infrastructure.dll" TargetFramework="net8.0" />
<BuildOutputInPackage Include="..\EnvelopeGenerator.Infrastructure\bin\$(Configuration)\net9.0\EnvelopeGenerator.Infrastructure.dll" TargetFramework="net9.0" />
</ItemGroup>
</Target>
</Project>

View File

@@ -0,0 +1,8 @@
namespace EnvelopeGenerator.Domain.Constants
{
public enum SenderAppType
{
LegacyFormApp = 0,
ReceiverUIBlazorApp = 1
}
}

View File

@@ -4,9 +4,6 @@ using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using EnvelopeGenerator.Domain.Interfaces.Auditing;
#if NET
using System.Text.Json.Serialization;
#endif
#if NETFRAMEWORK
using System.Collections.Generic;
#endif
@@ -14,9 +11,9 @@ using System.Collections.Generic;
namespace EnvelopeGenerator.Domain.Entities
{
[Table("TBSIG_DOCUMENT_RECEIVER_ELEMENT", Schema = "dbo")]
public class Signature : ISignature, IHasReceiver, IHasAddedWhen, IUpdateAuditable
public class DocReceiverElement : IDocReceiverElement, IHasReceiver, IHasAddedWhen, IUpdateAuditable
{
public Signature()
public DocReceiverElement()
{
// TODO: * Check the Form App and remove the default value
#if NETFRAMEWORK
@@ -112,25 +109,50 @@ namespace EnvelopeGenerator.Domain.Entities
#if nullable
?
#endif
Receiver { get; set; }
Receiver
{ get; set; }
public virtual IEnumerable<ElementAnnotation>
#if nullable
?
#endif
Annotations { get; set; }
Annotations
{ get; set; }
#if NET
[JsonIgnore]
#endif
#if NETFRAMEWORK
[NotMapped]
public double Top => Math.Round(Y, 5);
#if NET
[JsonIgnore]
#endif
[NotMapped]
public double Left => Math.Round(X, 5);
#endif
[Column("FULL_NAME", TypeName = "nvarchar(100)")]
public string
#if nullable
?
# endif
FullName { get; set; }
[Column("POSITION", TypeName = "nvarchar(100)")]
public string
#if nullable
?
#endif
Position { get; set; }
[Column("PLACE", TypeName = "nvarchar(100)")]
public string
#if nullable
?
#endif
Place { get; set; }
[Column("INK", TypeName = "varbinary(MAX)")]
public byte[]
#if nullable
?
#endif
Ink { get; set; }
}
}

View File

@@ -18,7 +18,7 @@ namespace EnvelopeGenerator.Domain.Entities
public Document()
{
#if NETFRAMEWORK
Elements = Enumerable.Empty<Signature>().ToList();
Elements = Enumerable.Empty<DocReceiverElement>().ToList();
#endif
}
@@ -60,7 +60,7 @@ namespace EnvelopeGenerator.Domain.Entities
FileNameOriginal { get; set; }
#endregion
public virtual List<Signature>
public virtual List<DocReceiverElement>
#if nullable
?
#endif

View File

@@ -35,7 +35,6 @@ namespace EnvelopeGenerator.Domain.Entities
[Column("STATUS")]
public Constants.DocumentStatus Status { get; set; }
[Required]
[Column("STATUS_CHANGED_WHEN", TypeName = "datetime")]
public DateTime? StatusChangedWhen { get; set; }

View File

@@ -76,7 +76,7 @@ namespace EnvelopeGenerator.Domain.Entities
ChangedWho { get; set; }
[ForeignKey("ElementId")]
public virtual Signature
public virtual DocReceiverElement
#if nullable
?
#endif

View File

@@ -94,7 +94,7 @@ namespace EnvelopeGenerator.Domain.Entities
public string Language { get; set; }
[Column("SEND_REMINDER_EMAILS")]
public bool SendReminderEmails { get; set; }
public bool? SendReminderEmails { get; set; }
[Column("FIRST_REMINDER_DAYS")]
public int? FirstReminderDays { get; set; }
@@ -114,7 +114,7 @@ namespace EnvelopeGenerator.Domain.Entities
public int? CertificationType { get; set; }
[Column("USE_ACCESS_CODE")]
public bool UseAccessCode { get; set; }
public bool? UseAccessCode { get; set; }
[Column("FINAL_EMAIL_TO_CREATOR")]
public int? FinalEmailToCreator { get; set; }
@@ -132,7 +132,7 @@ namespace EnvelopeGenerator.Domain.Entities
public User User { get; set; }
[Column("TFA_ENABLED")]
public bool TfaEnabled { get; set; }
public bool? TfaEnabled { get; set; }
#if NETFRAMEWORK
= false;
#endif

View File

@@ -1,6 +1,6 @@
namespace EnvelopeGenerator.Domain.Interfaces
{
public interface ISignature
public interface IDocReceiverElement
{
int Page { get; set; }

View File

@@ -11,5 +11,10 @@
{
return envelope.EnvelopeTypeId == 2;
}
public static bool IsReadAndSign(this IEnvelope envelope)
{
return envelope.EnvelopeTypeId != 2;
}
}
}

View File

@@ -1,10 +1,10 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Dieser Code wurde von einem Tool generiert.
// Laufzeitversion:4.0.30319.42000
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
// der Code erneut generiert wird.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
@@ -13,12 +13,12 @@ namespace My.Resources {
/// <summary>
/// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
// -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
// Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
// mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
@@ -33,7 +33,7 @@ namespace My.Resources {
}
/// <summary>
/// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
public static global::System.Resources.ResourceManager ResourceManager {
@@ -47,8 +47,8 @@ namespace My.Resources {
}
/// <summary>
/// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
/// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
public static global::System.Globalization.CultureInfo Culture {
@@ -61,7 +61,7 @@ namespace My.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Zugriffscode korrekt eingegeben ähnelt.
/// Looks up a localized string similar to Zugriffscode korrekt eingegeben.
/// </summary>
public static string AccessCodeCorrect {
get {
@@ -70,7 +70,7 @@ namespace My.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Zugriffscode falsch eingegeben ähnelt.
/// Looks up a localized string similar to Zugriffscode falsch eingegeben.
/// </summary>
public static string AccessCodeIncorrect {
get {
@@ -79,7 +79,7 @@ namespace My.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Zugriffscode angefordert ähnelt.
/// Looks up a localized string similar to Zugriffscode angefordert.
/// </summary>
public static string AccessCodeRequested {
get {
@@ -88,7 +88,7 @@ namespace My.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Fortgeschrittene Elektronische Signatur ähnelt.
/// Looks up a localized string similar to Fortgeschrittene Elektronische Signatur.
/// </summary>
public static string AdvancedElectronicSignature {
get {
@@ -97,7 +97,7 @@ namespace My.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Abgeschlossen ähnelt.
/// Looks up a localized string similar to Abgeschlossen.
/// </summary>
public static string Completed {
get {
@@ -106,7 +106,16 @@ namespace My.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Vollständig Signiert ähnelt.
/// Looks up a localized string similar to Vollständig bestätigt.
/// </summary>
public static string CompletelyConfirmed {
get {
return ResourceManager.GetString("CompletelyConfirmed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Vollständig signiert.
/// </summary>
public static string CompletelySigned {
get {
@@ -115,7 +124,25 @@ namespace My.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Vertrag ähnelt.
/// Looks up a localized string similar to Lesebestätigung.
/// </summary>
public static string Confirmation {
get {
return ResourceManager.GetString("Confirmation", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Gelesen und bestätigt.
/// </summary>
public static string Confirmed {
get {
return ResourceManager.GetString("Confirmed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Vertrag.
/// </summary>
public static string Contract {
get {
@@ -124,7 +151,7 @@ namespace My.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Erstellt ähnelt.
/// Looks up a localized string similar to Erstellt.
/// </summary>
public static string Created {
get {
@@ -133,7 +160,16 @@ namespace My.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Dokument Rotation geändert ähnelt.
/// Looks up a localized string similar to Dokument gelesen und bestätigt.
/// </summary>
public static string DocumentConfirmed {
get {
return ResourceManager.GetString("DocumentConfirmed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Dokument Rotation geändert.
/// </summary>
public static string DocumentMod_Rotation {
get {
@@ -142,7 +178,7 @@ namespace My.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Dokument geöffnet ähnelt.
/// Looks up a localized string similar to Dokument geöffnet.
/// </summary>
public static string DocumentOpened {
get {
@@ -151,7 +187,7 @@ namespace My.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Unterzeichnung abgelehnt ähnelt.
/// Looks up a localized string similar to Unterzeichnung abgelehnt.
/// </summary>
public static string DocumentRejected {
get {
@@ -160,7 +196,16 @@ namespace My.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Dokument unterzeichnet ähnelt.
/// Looks up a localized string similar to Lesebestätigung abgelehnt.
/// </summary>
public static string DocumentRejectedRaC {
get {
return ResourceManager.GetString("DocumentRejectedRaC", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Dokument unterzeichnet.
/// </summary>
public static string DocumentSigned {
get {
@@ -169,7 +214,7 @@ namespace My.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Entwurf ähnelt.
/// Looks up a localized string similar to Entwurf.
/// </summary>
public static string Draft {
get {
@@ -178,7 +223,7 @@ namespace My.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Archiviert ähnelt.
/// Looks up a localized string similar to Archiviert.
/// </summary>
public static string EnvelopeArchived {
get {
@@ -187,7 +232,16 @@ namespace My.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Vollständig signiert ähnelt.
/// Looks up a localized string similar to Vollständig gelesen und bestätigt.
/// </summary>
public static string EnvelopeCompletelyConfirmed {
get {
return ResourceManager.GetString("EnvelopeCompletelyConfirmed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Vollständig signiert.
/// </summary>
public static string EnvelopeCompletelySigned {
get {
@@ -196,7 +250,7 @@ namespace My.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Umschlag Erstellt ähnelt.
/// Looks up a localized string similar to Umschlag Erstellt.
/// </summary>
public static string EnvelopeCreated {
get {
@@ -205,7 +259,7 @@ namespace My.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Umschlag Gelöscht ähnelt.
/// Looks up a localized string similar to Umschlag Gelöscht.
/// </summary>
public static string EnvelopeDeleted {
get {
@@ -214,7 +268,16 @@ namespace My.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Teil-Signiert ähnelt.
/// Looks up a localized string similar to Teil-Bestätigt.
/// </summary>
public static string EnvelopePartlyConfirmed {
get {
return ResourceManager.GetString("EnvelopePartlyConfirmed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Teil-Signiert.
/// </summary>
public static string EnvelopePartlySigned {
get {
@@ -223,7 +286,7 @@ namespace My.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Umschlag in Queue ähnelt.
/// Looks up a localized string similar to Umschlag in Queue.
/// </summary>
public static string EnvelopeQueued {
get {
@@ -232,7 +295,7 @@ namespace My.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Umschlag abgelehnt ähnelt.
/// Looks up a localized string similar to Umschlag abgelehnt.
/// </summary>
public static string EnvelopeRejected {
get {
@@ -241,7 +304,7 @@ namespace My.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Signierungszertifikat erstellt ähnelt.
/// Looks up a localized string similar to Signierungszertifikat erstellt.
/// </summary>
public static string EnvelopeReportCreated {
get {
@@ -250,7 +313,16 @@ namespace My.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Gespeichert ähnelt.
/// Looks up a localized string similar to Lesebestätigungszertifikat erstellt.
/// </summary>
public static string EnvelopeReportCreatedRaC {
get {
return ResourceManager.GetString("EnvelopeReportCreatedRaC", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Gespeichert.
/// </summary>
public static string EnvelopeSaved {
get {
@@ -259,7 +331,7 @@ namespace My.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Gesendet ähnelt.
/// Looks up a localized string similar to Gesendet.
/// </summary>
public static string EnvelopeSent {
get {
@@ -268,7 +340,7 @@ namespace My.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Umschlag zurückgezogen ähnelt.
/// Looks up a localized string similar to Umschlag zurückgezogen.
/// </summary>
public static string EnvelopeWithdrawn {
get {
@@ -277,7 +349,7 @@ namespace My.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Zugriffscode versendet ähnelt.
/// Looks up a localized string similar to Zugriffscode versendet.
/// </summary>
public static string MessageAccessCodeSent {
get {
@@ -286,7 +358,7 @@ namespace My.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Abschlussemail versendet ähnelt.
/// Looks up a localized string similar to Abschlussemail versendet.
/// </summary>
public static string MessageCompletionSent {
get {
@@ -295,7 +367,7 @@ namespace My.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Signaturbestätigung versendet ähnelt.
/// Looks up a localized string similar to Abschlussbestätigung versendet.
/// </summary>
public static string MessageConfirmationSent {
get {
@@ -304,7 +376,7 @@ namespace My.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Löschinformation versendet ähnelt.
/// Looks up a localized string similar to Löschinformation versendet.
/// </summary>
public static string MessageDeletionSent {
get {
@@ -313,7 +385,7 @@ namespace My.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Dokumentenlink versendet ähnelt.
/// Looks up a localized string similar to Dokumentenlink versendet.
/// </summary>
public static string MessageInvitationSent {
get {
@@ -322,7 +394,7 @@ namespace My.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Nein ähnelt.
/// Looks up a localized string similar to Nein.
/// </summary>
public static string No {
get {
@@ -331,7 +403,16 @@ namespace My.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Teil-Signiert ähnelt.
/// Looks up a localized string similar to Teil-Bestätigt.
/// </summary>
public static string PartlyConfirmed {
get {
return ResourceManager.GetString("PartlyConfirmed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Teil-Signiert.
/// </summary>
public static string PartlySigned {
get {
@@ -340,7 +421,7 @@ namespace My.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Qualifizierte Signatur ähnelt.
/// Looks up a localized string similar to Qualifizierte Signatur.
/// </summary>
public static string QualifiedSignature {
get {
@@ -349,7 +430,7 @@ namespace My.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Arbeitsanweisung ähnelt.
/// Looks up a localized string similar to Lesebestätigung.
/// </summary>
public static string ReadAndSign {
get {
@@ -358,7 +439,7 @@ namespace My.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Wollen Sie die 2-Faktor Definition für diesen Empfänger zurücksetzen. Der Empfänger muss sich dann neu identifizieren! ähnelt.
/// Looks up a localized string similar to Wollen Sie die 2-Faktor Definition für diesen Empfänger zurücksetzen. Der Empfänger muss sich dann neu identifizieren!.
/// </summary>
public static string ResetTOTPUser {
get {
@@ -367,7 +448,7 @@ namespace My.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Gespeichert ähnelt.
/// Looks up a localized string similar to Gespeichert.
/// </summary>
public static string Saved {
get {
@@ -376,7 +457,7 @@ namespace My.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Gesendet ähnelt.
/// Looks up a localized string similar to Gesendet.
/// </summary>
public static string Sent {
get {
@@ -385,7 +466,7 @@ namespace My.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Signatur ähnelt.
/// Looks up a localized string similar to Signatur.
/// </summary>
public static string Signature {
get {
@@ -394,7 +475,7 @@ namespace My.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Signatur bestätigt ähnelt.
/// Looks up a localized string similar to Abschluss bestätigt.
/// </summary>
public static string SignatureConfirmed {
get {
@@ -403,7 +484,7 @@ namespace My.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Signiert ähnelt.
/// Looks up a localized string similar to Signiert.
/// </summary>
public static string Signed {
get {
@@ -412,7 +493,7 @@ namespace My.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Erfolgreich! Dialog wird geschlossen. ähnelt.
/// Looks up a localized string similar to Erfolgreich! Dialog wird geschlossen..
/// </summary>
public static string Success_FormClose {
get {
@@ -421,7 +502,16 @@ namespace My.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Unsigniert ähnelt.
/// Looks up a localized string similar to Unbestätigt.
/// </summary>
public static string Unconfirmed {
get {
return ResourceManager.GetString("Unconfirmed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Unsigniert.
/// </summary>
public static string Unsigned {
get {
@@ -430,7 +520,7 @@ namespace My.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Ja ähnelt.
/// Looks up a localized string similar to Ja.
/// </summary>
public static string Yes {
get {
@@ -439,7 +529,7 @@ namespace My.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Ja, mit Anhang ähnelt.
/// Looks up a localized string similar to Ja, mit Anhang.
/// </summary>
public static string YesWithAttachment {
get {

View File

@@ -132,15 +132,27 @@
<data name="Completed" xml:space="preserve">
<value>Completed</value>
</data>
<data name="CompletelyConfirmed" xml:space="preserve">
<value>Completely confirmed</value>
</data>
<data name="CompletelySigned" xml:space="preserve">
<value>Completely signed</value>
</data>
<data name="Confirmation" xml:space="preserve">
<value>Read Confirmation</value>
</data>
<data name="Confirmed" xml:space="preserve">
<value>Read and signed</value>
</data>
<data name="Contract" xml:space="preserve">
<value>Contract</value>
</data>
<data name="Created" xml:space="preserve">
<value>Created</value>
</data>
<data name="DocumentConfirmed" xml:space="preserve">
<value>Document read and signed</value>
</data>
<data name="DocumentMod_Rotation" xml:space="preserve">
<value>Document rotation adapted</value>
</data>
@@ -150,6 +162,9 @@
<data name="DocumentRejected" xml:space="preserve">
<value>Signing rejected</value>
</data>
<data name="DocumentRejectedRaC" xml:space="preserve">
<value>Read confirmation rejected</value>
</data>
<data name="DocumentSigned" xml:space="preserve">
<value>Document signed</value>
</data>
@@ -159,6 +174,9 @@
<data name="EnvelopeArchived" xml:space="preserve">
<value>Archived</value>
</data>
<data name="EnvelopeCompletelyConfirmed" xml:space="preserve">
<value>Completely confirmed</value>
</data>
<data name="EnvelopeCompletelySigned" xml:space="preserve">
<value>Completely signed</value>
</data>
@@ -168,8 +186,11 @@
<data name="EnvelopeDeleted" xml:space="preserve">
<value>Envelope Deleted</value>
</data>
<data name="EnvelopePartlyConfirmed" xml:space="preserve">
<value>Partially confirmed</value>
</data>
<data name="EnvelopePartlySigned" xml:space="preserve">
<value>Partly signed</value>
<value>Partially signed</value>
</data>
<data name="EnvelopeQueued" xml:space="preserve">
<value>Envelope Queued</value>
@@ -180,6 +201,9 @@
<data name="EnvelopeReportCreated" xml:space="preserve">
<value>Signature certificate created</value>
</data>
<data name="EnvelopeReportCreatedRaC" xml:space="preserve">
<value>Read confirmartion certificate created</value>
</data>
<data name="EnvelopeSaved" xml:space="preserve">
<value>Saved</value>
</data>
@@ -196,7 +220,7 @@
<value>Final email sent</value>
</data>
<data name="MessageConfirmationSent" xml:space="preserve">
<value>Confirmation Sent</value>
<value>Finalization Confirmation Sent</value>
</data>
<data name="MessageDeletionSent" xml:space="preserve">
<value>Deletion Notice Sent</value>
@@ -207,6 +231,12 @@
<data name="No" xml:space="preserve">
<value>No</value>
</data>
<data name="PartlyConfirmed" xml:space="preserve">
<value>Partially confirmed</value>
</data>
<data name="PartlySigned" xml:space="preserve">
<value>Partially signed</value>
</data>
<data name="QualifiedSignature" xml:space="preserve">
<value>Qualified Signature</value>
</data>
@@ -226,7 +256,7 @@
<value>Signature</value>
</data>
<data name="SignatureConfirmed" xml:space="preserve">
<value>Signature confirmed</value>
<value>Finalization confirmed</value>
</data>
<data name="Signed" xml:space="preserve">
<value>Signed</value>
@@ -234,6 +264,9 @@
<data name="Success_FormClose" xml:space="preserve">
<value>Successful! Dialog is closed.successful! Dialog is closed.</value>
</data>
<data name="Unconfirmed" xml:space="preserve">
<value>Unconfirmed</value>
</data>
<data name="Unsigned" xml:space="preserve">
<value>Unsigned</value>
</data>

View File

@@ -132,8 +132,17 @@
<data name="Completed" xml:space="preserve">
<value>Abgeschlossen</value>
</data>
<data name="CompletelyConfirmed" xml:space="preserve">
<value>Vollständig bestätigt</value>
</data>
<data name="CompletelySigned" xml:space="preserve">
<value>Vollständig Signiert</value>
<value>Vollständig signiert</value>
</data>
<data name="Confirmation" xml:space="preserve">
<value>Lesebestätigung</value>
</data>
<data name="Confirmed" xml:space="preserve">
<value>Gelesen und bestätigt</value>
</data>
<data name="Contract" xml:space="preserve">
<value>Vertrag</value>
@@ -141,6 +150,9 @@
<data name="Created" xml:space="preserve">
<value>Erstellt</value>
</data>
<data name="DocumentConfirmed" xml:space="preserve">
<value>Dokument gelesen und bestätigt</value>
</data>
<data name="DocumentMod_Rotation" xml:space="preserve">
<value>Dokument Rotation geändert</value>
</data>
@@ -150,6 +162,9 @@
<data name="DocumentRejected" xml:space="preserve">
<value>Unterzeichnung abgelehnt</value>
</data>
<data name="DocumentRejectedRaC" xml:space="preserve">
<value>Lesebestätigung abgelehnt</value>
</data>
<data name="DocumentSigned" xml:space="preserve">
<value>Dokument unterzeichnet</value>
</data>
@@ -159,6 +174,9 @@
<data name="EnvelopeArchived" xml:space="preserve">
<value>Archiviert</value>
</data>
<data name="EnvelopeCompletelyConfirmed" xml:space="preserve">
<value>Vollständig gelesen und bestätigt</value>
</data>
<data name="EnvelopeCompletelySigned" xml:space="preserve">
<value>Vollständig signiert</value>
</data>
@@ -168,6 +186,9 @@
<data name="EnvelopeDeleted" xml:space="preserve">
<value>Umschlag Gelöscht</value>
</data>
<data name="EnvelopePartlyConfirmed" xml:space="preserve">
<value>Teil-Bestätigt</value>
</data>
<data name="EnvelopePartlySigned" xml:space="preserve">
<value>Teil-Signiert</value>
</data>
@@ -180,6 +201,9 @@
<data name="EnvelopeReportCreated" xml:space="preserve">
<value>Signierungszertifikat erstellt</value>
</data>
<data name="EnvelopeReportCreatedRaC" xml:space="preserve">
<value>Lesebestätigungszertifikat erstellt</value>
</data>
<data name="EnvelopeSaved" xml:space="preserve">
<value>Gespeichert</value>
</data>
@@ -196,7 +220,7 @@
<value>Abschlussemail versendet</value>
</data>
<data name="MessageConfirmationSent" xml:space="preserve">
<value>Signaturbestätigung versendet</value>
<value>Abschlussbestätigung versendet</value>
</data>
<data name="MessageDeletionSent" xml:space="preserve">
<value>Löschinformation versendet</value>
@@ -207,6 +231,9 @@
<data name="No" xml:space="preserve">
<value>Nein</value>
</data>
<data name="PartlyConfirmed" xml:space="preserve">
<value>Teil-Bestätigt</value>
</data>
<data name="PartlySigned" xml:space="preserve">
<value>Teil-Signiert</value>
</data>
@@ -214,7 +241,7 @@
<value>Qualifizierte Signatur</value>
</data>
<data name="ReadAndSign" xml:space="preserve">
<value>Arbeitsanweisung</value>
<value>Lesebestätigung</value>
</data>
<data name="ResetTOTPUser" xml:space="preserve">
<value>Wollen Sie die 2-Faktor Definition für diesen Empfänger zurücksetzen. Der Empfänger muss sich dann neu identifizieren!</value>
@@ -229,7 +256,7 @@
<value>Signatur</value>
</data>
<data name="SignatureConfirmed" xml:space="preserve">
<value>Signatur bestätigt</value>
<value>Abschluss bestätigt</value>
</data>
<data name="Signed" xml:space="preserve">
<value>Signiert</value>
@@ -237,6 +264,9 @@
<data name="Success_FormClose" xml:space="preserve">
<value>Erfolgreich! Dialog wird geschlossen.</value>
</data>
<data name="Unconfirmed" xml:space="preserve">
<value>Unbestätigt</value>
</data>
<data name="Unsigned" xml:space="preserve">
<value>Unsigniert</value>
</data>

View File

@@ -8,7 +8,7 @@ Public Class FieldEditorController
Inherits BaseController
Private ReadOnly Document As Document
Public Property Elements As New List(Of Signature)
Public Property Elements As New List(Of DocReceiverElement)
Public Class ElementInfo
Public ReceiverId As Integer
@@ -36,7 +36,7 @@ Public Class FieldEditorController
}
End Function
Private Function GetElementByPosition(pAnnotation As AnnotationStickyNote, pPage As Integer, pReceiverId As Integer) As Signature
Private Function GetElementByPosition(pAnnotation As AnnotationStickyNote, pPage As Integer, pReceiverId As Integer) As DocReceiverElement
Dim oElement = Elements.
Where(Function(e)
Return e.Left = CSng(Math.Round(pAnnotation.Left, 5)) And
@@ -47,12 +47,12 @@ Public Class FieldEditorController
Return oElement
End Function
Private Function GetElementByGuid(pGuid As Integer) As Signature
Private Function GetElementByGuid(pGuid As Integer) As DocReceiverElement
Dim oElement = Elements.Where(Function(e) pGuid = e.Id).SingleOrDefault()
Return oElement
End Function
Public Function GetElement(pAnnotation As AnnotationStickyNote) As Signature
Public Function GetElement(pAnnotation As AnnotationStickyNote) As DocReceiverElement
Dim oInfo = GetElementInfo(pAnnotation.Tag)
If oInfo.Guid = -1 Then
@@ -85,7 +85,7 @@ Public Class FieldEditorController
Else
Dim oInfo = GetElementInfo(pAnnotation.Tag)
Elements.Add(New Signature() With {
Elements.Add(New DocReceiverElement() With {
.ElementType = Constants.ElementType.Signature,
.Height = oAnnotationHeight,
.Width = oAnnotationWidth,
@@ -98,7 +98,7 @@ Public Class FieldEditorController
End If
End Sub
Public Function ClearElements(pPage As Integer, pReceiverId As Integer) As IEnumerable(Of Signature)
Public Function ClearElements(pPage As Integer, pReceiverId As Integer) As IEnumerable(Of DocReceiverElement)
Return Elements.
Where(Function(e) e.Page <> pPage And e.ReceiverId <> pReceiverId).
ToList()
@@ -120,7 +120,7 @@ Public Class FieldEditorController
All(Function(pResult) pResult = True)
End Function
Public Function SaveElement(pElement As Signature) As Boolean
Public Function SaveElement(pElement As DocReceiverElement) As Boolean
Try
If pElement.Id > 0 Then
Return ElementModel.Update(pElement)
@@ -134,11 +134,11 @@ Public Class FieldEditorController
End Try
End Function
Public Function DeleteElement(pElement As Signature) As Boolean
Public Function DeleteElement(pElement As DocReceiverElement) As Boolean
Try
' Element aus Datenbank löschen
If ElementModel.DeleteElement(pElement) Then
Dim oElement = New List(Of Signature)() From {pElement}
Dim oElement = New List(Of DocReceiverElement)() From {pElement}
Elements = Elements.Except(oElement).ToList()
Return True
Else

View File

@@ -280,7 +280,7 @@ Partial Public Class frmFieldEditor
End If
End Sub
Private Sub LoadAnnotation(pElement As Signature, pReceiverId As Integer)
Private Sub LoadAnnotation(pElement As DocReceiverElement, pReceiverId As Integer)
Dim oAnnotation As AnnotationStickyNote = Manager.AddStickyNoteAnnot(0, 0, 0, 0, "SIGNATUR")
Dim oPage = pElement.Page
Dim oReceiver = Receivers.Where(Function(r) r.Id = pReceiverId).Single()

View File

@@ -74,14 +74,14 @@ namespace EnvelopeGenerator.Infrastructure
services.AddSQLExecutor<Envelope>();
services.AddSQLExecutor<Receiver>();
services.AddSQLExecutor<Document>();
services.AddSQLExecutor<Signature>();
services.AddSQLExecutor<DocReceiverElement>();
services.AddSQLExecutor<DocumentStatus>();
SetDapperTypeMap<Envelope>();
SetDapperTypeMap<User>();
SetDapperTypeMap<Receiver>();
SetDapperTypeMap<Document>();
SetDapperTypeMap<Signature>();
SetDapperTypeMap<DocReceiverElement>();
SetDapperTypeMap<DocumentStatus>();
services.AddScoped<IEnvelopeExecutor, EnvelopeExecutor>();

View File

@@ -45,7 +45,9 @@ public abstract class EGDbContextBase : DbContext
public DbSet<Envelope> Envelopes { get; set; }
public DbSet<Signature> DocumentReceiverElements { get; set; }
public DbSet<DocReceiverElement> DocumentReceiverElements { get; set; }
public DbSet<ElementAnnotation> DocumentReceiverElementAnnotations { get; set; }
public DbSet<DocumentStatus> DocumentStatus { get; set; }
@@ -152,7 +154,7 @@ public abstract class EGDbContextBase : DbContext
#endregion EnvelopeDocument
#region DocumentReceiverElement
modelBuilder.Entity<Signature>()
modelBuilder.Entity<DocReceiverElement>()
.HasOne(dre => dre.Document)
.WithMany(ed => ed.Elements)
.HasForeignKey(dre => dre.DocumentId);
@@ -194,7 +196,7 @@ public abstract class EGDbContextBase : DbContext
#endregion DocumentStatus
#region Annotation
modelBuilder.Entity<Signature>()
modelBuilder.Entity<DocReceiverElement>()
.HasMany(signature => signature.Annotations)
.WithOne(annot => annot.Element)
.HasForeignKey(annot => annot.ElementId);
@@ -215,7 +217,7 @@ public abstract class EGDbContextBase : DbContext
// TODO: call add trigger methods with attributes and reflection
AddTrigger<Config>();
AddTrigger<Signature>();
AddTrigger<DocReceiverElement>();
AddTrigger<DocumentStatus>();
AddTrigger<EmailTemplate>();
AddTrigger<Envelope>();

View File

@@ -6,7 +6,7 @@ using EnvelopeGenerator.Application.Common.Interfaces.Repositories;
namespace EnvelopeGenerator.Infrastructure.Repositories;
[Obsolete("Use IRepository")]
public class DocumentReceiverElementRepository : CRUDRepository<Signature, int, EGDbContext>, IDocumentReceiverElementRepository
public class DocumentReceiverElementRepository : CRUDRepository<DocReceiverElement, int, EGDbContext>, IDocumentReceiverElementRepository
{
public DocumentReceiverElementRepository(EGDbContext dbContext) : base(dbContext, dbContext.DocumentReceiverElements)
{

View File

@@ -103,19 +103,15 @@ namespace EnvelopeGenerator.PdfEditor
#endregion
public Pdf<TInputStream, TOutputStream> Background<TSignature>(IEnumerable<TSignature> signatures, double widthPx = 1.9500000000000002, double heightPx = 2.52)
where TSignature : ISignature
where TSignature : IDocReceiverElement
{
// once per page
Page(page =>
{
var canvas = new PdfCanvas(page);
canvas.ConcatMatrix(1, 0, 0, -1, 0, page.GetPageSize().GetHeight());
});
foreach (var signature in signatures)
Page(signature.Page, page =>
{
var canvas = new PdfCanvas(page);
canvas.SaveState();
canvas.ConcatMatrix(1, 0, 0, -1, 0, page.GetPageSize().GetHeight());
double inchFactor = 72;
double magin = .2;
double x = (signature.X - .7 - magin) * inchFactor;
@@ -134,6 +130,8 @@ namespace EnvelopeGenerator.PdfEditor
canvas.SetFillColor(new DeviceRgb(204, 202, 198))
.Rectangle(x, y + height - bottomLineLength, width, bottomLineLength)
.Fill();
canvas.RestoreState();
});
return this;

View File

@@ -0,0 +1,10 @@
<Router AppAssembly="@typeof(Program).Assembly">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
</Found>
<NotFound>
<LayoutView Layout="@typeof(MainLayout)">
<p>Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>

View File

@@ -0,0 +1,44 @@
namespace EnvelopeGenerator.ReceiverUI.Data {
public class Adjustment
{
public static Adjustment CreateBalanceForward(DateTime dt, int random)
{
var rnd = new DeterministicRandom(random);
Adjustment res = new Adjustment();
res.currentDateTime = dt;
res.currentDescription = "Balance Forward";
res.currentAmount = rnd.Random(10, 300) * 10;
return res;
}
public static Adjustment CreatePayment(DateTime dt, int random)
{
var rnd = new DeterministicRandom(random);
Adjustment res = new Adjustment();
res.currentDateTime = dt;
res.currentDescription = "Payment";
res.currentAmount = -rnd.Random(1, 40) * 10;
return res;
}
public static Adjustment CreateCharge(DateTime dt, int random)
{
var rnd = new DeterministicRandom(random);
Adjustment res = new Adjustment();
res.currentDateTime = dt;
res.currentDescription = rnd.GetRandomItem(bills);
res.currentAmount = rnd.Random(10, 50) * 10;
return res;
}
DateTime currentDateTime;
string currentDescription = "";
double currentAmount = 0;
static readonly string[] bills = new string[] { "Bill - Insurance", "Bill - Electricity", "Bill - Rent", "Bill - Phone", "Bill - Office Supplies" };
public DateTime Date { get { return currentDateTime; } }
public string Description { get { return currentDescription; } }
public double Amount { get { return currentAmount; } }
public Adjustment()
{
}
}
}

View File

@@ -0,0 +1,64 @@
using DevExpress.DataAccess.Sql;
using DevExpress.DataAccess.Sql.DataApi;
namespace EnvelopeGenerator.ReceiverUI.Data {
public class Customer {
static List<Customer> currentCustomers = new List<Customer>();
public static List<Customer> Customers { get { return currentCustomers; } }
static Customer() {
try {
SqlDataSource ds = new SqlDataSource("NWindConnectionString");
SelectQuery query = SelectQueryFluentBuilder
.AddTable("Customers")
.SelectAllColumns()
.Build("Customers");
ds.Queries.Add(query);
ds.RebuildResultSchema();
ds.Fill();
ITable src = ds.Result["Customers"];
foreach(var row in src) {
currentCustomers.Add(new Customer() {
CustomerID = row.GetValue<string>("CustomerID"),
Address = row.GetValue<string>("Address"),
CompanyName = row.GetValue<string>("CompanyName"),
ContactName = row.GetValue<string>("ContactName"),
ContactTitle = row.GetValue<string>("ContactTitle"),
Country = row.GetValue<string>("Country"),
City = row.GetValue<string>("City"),
Fax = row.GetValue<string>("Fax"),
Phone = row.GetValue<string>("Phone"),
PostalCode = row.GetValue<string>("PostalCode"),
Region = row.GetValue<string>("Region")
});
}
} catch {
currentCustomers.Add(new Customer() {
Address = "Obere Str. 57",
City = "Berlin",
CompanyName = "Alfreds Futterkiste",
ContactName = "Maria Anders",
ContactTitle = "Sales Representative",
Country = "Germany",
CustomerID = "ALFKI",
Fax = "030-0076545",
Phone = "030-0074321",
PostalCode = "12209"
});
}
}
public string CustomerID { get; set; }
public string CompanyName { get; set; }
public string ContactName { get; set; }
public string ContactTitle { get; set; }
public string Address { get; set; }
public string City { get; set; }
public string PostalCode { get; set; }
public string Region { get; set; }
public string Country { get; set; }
public string Phone { get; set; }
public string Fax { get; set; }
}
}

View File

@@ -0,0 +1,71 @@
namespace EnvelopeGenerator.ReceiverUI.Data {
public class DataItem {
static readonly string[] accountType = new string[] { "Energy", "Manufacturing", "Estate", "Food", "Services" };
public string CustomerID { get; set; }
public string CompanyName { get; set; }
public string ContactName { get; set; }
public string ContactTitle { get; set; }
public string Address { get; set; }
public string City { get; set; }
public string PostalCode { get; set; }
public string Region { get; set; }
public string Country { get; set; }
public string Phone { get; set; }
public string Fax { get; set; }
public string Email { get; set; }
public string Invoice { get; set; }
public string CustomerAccount { get; set; }
public string CustomerIdentifiers { get; set; }
public DateTime BillingDate { get; set; }
public DateTime BillingPeriodStart { get; set; }
public DateTime BillingPeriodEnd { get; set; }
public string Terms { get; set; }
public string TermsID { get; set; }
public Adjustment[] Adjustments { get; set; }
public DataItem(int i) {
var rnd = new DeterministicRandom(i);
Customer c = rnd.GetRandomItem(Customer.Customers);
CustomerID = c.CustomerID;
CompanyName = c.CompanyName;
ContactName = c.ContactName;
ContactTitle = c.ContactTitle;
Address = c.Address;
City = c.City;
PostalCode = c.PostalCode;
Region = c.Region;
Country = c.Country;
Phone = c.Phone;
Fax = c.Fax;
Email = ContactName.Split(' ')[0].Replace(' ', '.').ToLower() + "@" + CompanyName.Split(' ')[0].ToLower() + ".com";
Invoice = string.Format("{0}{1}-{2}", rnd.RandomChar, rnd.Random(100, 1000), rnd.Random(100, 1000));
CustomerAccount = rnd.GetRandomItem(accountType);
CustomerIdentifiers = string.Format("{0}-{1}", rnd.Random(1000, 10000), rnd.Random(10, 100));
BillingPeriodStart = rnd.RandomTime();
BillingPeriodEnd = rnd.RandomTime(BillingPeriodStart, 7 * 24, 30 * 24);
BillingDate = rnd.RandomTime(BillingPeriodEnd, 7 * 24, 30 * 24);
Term currentTerm = rnd.GetRandomItem(Term.Terms);
Terms = currentTerm.Name;
int adjustmentsCount = rnd.Random(6) + 4;
Adjustments = new Adjustment[adjustmentsCount];
int h = (int)((BillingPeriodEnd - BillingPeriodStart).TotalHours / adjustmentsCount);
Adjustments[0] = Adjustment.CreateBalanceForward(rnd.RandomTime(BillingPeriodStart, 0, h), rnd.Random(10000));
int[] items = rnd.RandomList(adjustmentsCount - 1, 2);
for(int j = 1; j < Adjustments.Length; j++) {
DateTime nextDate = rnd.RandomTime(BillingPeriodStart.AddHours(h * j), 0, h);
switch(items[j - 1]) {
case 0:
Adjustments[j] = Adjustment.CreateCharge(nextDate, rnd.Random(10000));
break;
case 1:
Adjustments[j] = Adjustment.CreatePayment(nextDate, rnd.Random(10000));
break;
}
}
}
}
}

View File

@@ -0,0 +1,70 @@
using System.Collections;
namespace EnvelopeGenerator.ReceiverUI.Data {
public class DataItemList : IList<DataItem>, IList {
readonly int rowCount;
public DataItem this[int index] { get { return new DataItem(index); } set { } }
public int Count { get { return rowCount; } }
public bool IsReadOnly { get { return false; } }
public bool IsFixedSize { get { return false; } }
public object SyncRoot { get { return true; } }
public bool IsSynchronized { get { return true; } }
object IList.this[int index] { get { return new DataItem(index); } set { } }
public DataItemList(int rowCount) {
this.rowCount = rowCount;
}
public IEnumerator<DataItem> GetEnumerator() {
throw new NotImplementedException();
}
public int Add(object value) {
throw new NotImplementedException();
}
public bool Contains(object value) {
throw new NotImplementedException();
}
public void Clear() {
throw new NotImplementedException();
}
public int IndexOf(object value) {
throw new NotImplementedException();
}
public void Insert(int index, object value) {
throw new NotImplementedException();
}
public void Remove(object value) {
throw new NotImplementedException();
}
public void RemoveAt(int index) {
throw new NotImplementedException();
}
public void CopyTo(Array array, int index) {
throw new NotImplementedException();
}
IEnumerator IEnumerable.GetEnumerator() {
throw new NotImplementedException();
}
public int IndexOf(DataItem item) {
throw new NotImplementedException();
}
public void Insert(int index, DataItem item) {
throw new NotImplementedException();
}
public void Add(DataItem item) {
throw new NotImplementedException();
}
public bool Contains(DataItem item) {
throw new NotImplementedException();
}
public void CopyTo(DataItem[] array, int arrayIndex) {
throw new NotImplementedException();
}
public bool Remove(DataItem item) {
throw new NotImplementedException();
}
void ICollection<DataItem>.CopyTo(DataItem[] array, int arrayIndex) {
CopyTo(array, arrayIndex);
}
}
}

View File

@@ -0,0 +1,60 @@
namespace EnvelopeGenerator.ReceiverUI.Data {
class DeterministicRandom {
const int randomCount = 10000;
static readonly int[] deterministicRandomNumbers;
static readonly DateTime time;
int rnd;
int Next {
get {
rnd = deterministicRandomNumbers[rnd % randomCount];
return rnd;
}
}
public char RandomChar {
get {
return (char)((int)'A' + Random(0, 26));
}
}
public int[] RandomList(int count, int to) {
int[] res = new int[count];
for(int i = 0; i < Math.Min(count, to); i++)
res[i] = i;
for(int i = to; i < count; i++)
res[i] = Random(to);
for(int i = 0; i < count; i++) {
int ind = Random(count);
int temp = res[ind];
res[ind] = res[i];
res[i] = temp;
}
return res;
}
public int Random(int to) {
return Random(0, to);
}
public int Random(int from, int to) {
return Next % Math.Max(1, to - from) + from;
}
public T GetRandomItem<T>(IList<T> list) {
return list[Next % list.Count];
}
public DateTime RandomTime() {
return RandomTime(time, 0, 30 * 24);
}
public DateTime RandomTime(DateTime from, int fromHours, int toHours) {
return from.AddHours(Next % (toHours - fromHours) + fromHours);
}
static DeterministicRandom() {
time = DateTime.Now.AddDays(-62);
Random currentRandom = new Random(randomCount);
deterministicRandomNumbers = new int[randomCount];
for(int i = 0; i < randomCount; i++)
deterministicRandomNumbers[i] = currentRandom.Next(randomCount);
}
public DeterministicRandom(int i) {
this.rnd = i + (i >> 10) + (i >> 20);
}
}
}

View File

@@ -0,0 +1,15 @@
namespace EnvelopeGenerator.ReceiverUI.Data {
public struct Term {
public static readonly Term[] Terms = new Term[] {
new Term("Payment seven days after invoice date" ),
new Term("Payment ten days after invoice date" ),
new Term("End of month" ),
new Term("21st of the month following invoice date" ),
};
readonly string currentName;
public string Name { get { return currentName; } }
public Term(string currentName) {
this.currentName = currentName;
}
}
}

View File

@@ -0,0 +1,51 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<WasmBuildNative>true</WasmBuildNative>
<InvariantGlobalization>false</InvariantGlobalization>
<BlazorWebAssemblyLoadAllGlobalizationData>true</BlazorWebAssemblyLoadAllGlobalizationData>
<Nullable>enable</Nullable>
<PackageId>EnvelopeGenerator.ReceiverUI</PackageId>
<Authors>Digital Data GmbH</Authors>
<Company>Digital Data GmbH</Company>
<Product>EnvelopeGenerator.ReceiverUI</Product>
<PackageIcon>Assets\icon.ico</PackageIcon>
<PackageTags>digital data envelope generator web</PackageTags>
<Description>EnvelopeGenerator.ReceiverUI is a Blazor WebAssembly application developed to manage signing processes. It uses Entity Framework Core (EF Core) for database operations. The user interface for signing processes is developed with Razor View Engine (.cshtml files) and JavaScript under wwwroot, integrated with PSPDFKit. This integration allows users to view and sign documents seamlessly.</Description>
<Version>1.4.2</Version>
<!-- NuGet package version -->
<AssemblyVersion>1.4.2.0</AssemblyVersion>
<!-- Assembly version for API compatibility -->
<FileVersion>1.4.2.0</FileVersion>
<!-- Windows file version -->
<Copyright>Copyright © 2026 Digital Data GmbH. All rights reserved.</Copyright>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DevExpress.Blazor.PdfViewer" Version="25.2.3" />
<PackageReference Include="DevExpress.Blazor.Reporting.JSBasedControls" Version="25.2.3" />
<PackageReference Include="DevExpress.Blazor.Reporting.Viewer" Version="25.2.3" />
<PackageReference Include="DevExpress.Drawing.Skia" Version="25.2.3" />
<PackageReference Include="HarfBuzzSharp.NativeAssets.WebAssembly" Version="8.3.1.2" />
<PackageReference Include="SkiaSharp.NativeAssets.WebAssembly" Version="3.119.1" />
<PackageReference Include="SkiaSharp.Views.Blazor" Version="3.119.1" />
<NativeFileReference Include="$(HarfBuzzSharpStaticLibraryPath)\2.0.23\*.a" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.11" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.11" PrivateAssets="all" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\PublishProfiles\" />
</ItemGroup>
<ItemGroup>
<Content Update="wwwroot\docs\privacy-policy.en-US.html">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\docs\privacy-policy.fr-FR.html">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,32 @@
namespace EnvelopeGenerator.ReceiverUI.Models;
/// <summary>
/// Represents a pre-assigned signature annotation position on a specific page.
/// <br/><br/>
/// <b>Coordinate unit (X, Y):</b> Inches (GdPicture14 native unit),
/// origin at the <b>top-left</b> corner of the page, both axes increase downward/rightward.
/// <br/><br/>
/// <b>Conversion to DevExpress:</b> Multiply by 100 (DX uses 1/100 inch).
/// Convert: <c>xDX = xInches * 100.0</c>
/// <br/>
/// <b>Conversion to PDF Points:</b> Multiply by 72 (1 inch = 72 points).
/// Convert: <c>xPt = xInches * 72.0</c>
/// <br/>
/// <b>Y-axis for PDF (bottom-left origin):</b> Flip required for iText7.
/// Convert: <c>yPt = (pageHeightInches - yInches - elemHeightInches) * 72.0</c>
/// </summary>
[Obsolete("Use SignatureDto with SignatureService.")]
public record AnnotationDto
{
/// <summary>Unique identifier of the annotation.</summary>
public long Id { get; init; }
/// <summary>1-based page number within the document.</summary>
public int Page { get; init; }
/// <summary>Horizontal position in INCHES from the left edge of the page.</summary>
public double X { get; init; }
/// <summary>Vertical position in INCHES from the top edge of the page.</summary>
public double Y { get; init; }
}

View File

@@ -0,0 +1,8 @@
namespace EnvelopeGenerator.ReceiverUI.Models.Constants
{
public enum SenderAppType
{
LegacyFormApp = 0,
ReceiverUIBlazorApp = 1
}
}

View File

@@ -0,0 +1,65 @@
namespace EnvelopeGenerator.ReceiverUI.Models.Constants;
/// <summary>
/// Represents the unit of measurement for coordinate values in signature positioning.
/// Used for converting coordinates between different systems (GdPicture14, PDF.js, iText7).
/// </summary>
public enum UnitOfLength
{
/// <summary>
/// Inch unit (1 inch = 25.4 mm).
/// This is the native unit used by GdPicture14 (EnvelopeGenerator.Form - Legacy VB.NET app).
/// Database stores all coordinates (X, Y, Width, Height) in INCHES.
/// </summary>
/// <remarks>
/// <b>Source:</b> GdPicture14.Annotations.AnnotationStickyNote uses INCHES natively.
/// <br/>
/// <b>Evidence:</b> VB.NET code directly assigns database values to annotation properties without conversion:
/// <code>
/// oAnnotation.Left = CSng(pElement.X) ' Direct assignment → INCHES
/// oAnnotation.Top = CSng(pElement.Y)
/// </code>
/// <b>Standard Page Dimensions:</b>
/// <list type="bullet">
/// <item>A4: 8.27" × 11.69" (210mm × 297mm)</item>
/// <item>Letter: 8.5" × 11"</item>
/// </list>
/// </remarks>
Inch = 0,
/// <summary>
/// PDF Point unit (1 point = 1/72 inch).
/// This is the standard unit used by PDF specification and PDF.js viewer.
/// </summary>
/// <remarks>
/// <b>Definition:</b> According to PDF specification and Microsoft documentation:
/// <br/>
/// <i>"PDF pages are sized in point units. 1 pt == 1/72 inch"</i>
/// <br/><br/>
/// <b>Conversion Formula:</b>
/// <code>
/// points = inches * 72.0
/// inches = points / 72.0
/// </code>
/// <b>Important:</b> Point ≠ Pixel!
/// <list type="bullet">
/// <item><b>Point (pt):</b> Device-independent unit (always 1/72 inch)</item>
/// <item><b>Pixel (px):</b> Device-dependent unit (varies with screen DPI)</item>
/// <item>At 72 DPI: 1 point = 1 pixel (coincidence)</item>
/// <item>At 96 DPI: 1 point ≈ 1.33 pixels</item>
/// <item>At 300 DPI: 1 point ≈ 4.17 pixels</item>
/// </list>
/// <b>Standard Page Dimensions (in points):</b>
/// <list type="bullet">
/// <item>A4: 595 × 842 points (8.27" × 11.69" × 72)</item>
/// <item>Letter: 612 × 792 points (8.5" × 11" × 72)</item>
/// </list>
/// <b>Usage in EnvelopeGenerator:</b>
/// <list type="bullet">
/// <item>PDF.js viewer expects coordinates in points</item>
/// <item>iText7 library uses points for PDF manipulation</item>
/// <item>PSPDFKit (Web) uses points for annotation placement</item>
/// </list>
/// </remarks>
Point
}

View File

@@ -0,0 +1,106 @@
namespace EnvelopeGenerator.ReceiverUI.Models;
/// <summary>
/// Client-side model for the envelope receiver returned by
/// <c>GET api/EnvelopeReceiver/{envelopeKey}</c>.
/// </summary>
public record EnvelopeReceiverDto
{
public int EnvelopeId { get; init; }
public int ReceiverId { get; init; }
public int Sequence { get; init; }
public string? Name { get; init; }
public string? JobTitle { get; init; }
public string? CompanyName { get; init; }
public string? PrivateMessage { get; init; }
public DateTime AddedWhen { get; init; }
public DateTime? ChangedWhen { get; init; }
public bool HasPhoneNumber { get; init; }
public EnvelopeClientDto? Envelope { get; init; }
public ReceiverClientDto? Receiver { get; init; }
}
/// <summary>
/// Client-side model for the envelope data embedded in <see cref="EnvelopeReceiverDto"/>.
/// </summary>
public record EnvelopeClientDto
{
public int Id { get; init; }
public int UserId { get; init; }
public int Status { get; init; }
public string StatusName { get; init; } = string.Empty;
public string Uuid { get; init; } = string.Empty;
public string Title { get; init; } = string.Empty;
public string Message { get; init; } = string.Empty;
public DateTime AddedWhen { get; init; }
public DateTime? ChangedWhen { get; init; }
public string Language { get; init; } = "de-DE";
public int? EnvelopeTypeId { get; init; }
public string? EnvelopeTypeTitle { get; init; }
public int? ContractType { get; init; }
public int? CertificationType { get; init; }
public bool UseAccessCode { get; init; }
public bool TFAEnabled { get; init; }
public IEnumerable<DocumentClientDto>? Documents { get; init; }
public EnvelopeSenderDto? User { get; init; }
}
/// <summary>
/// Sender (user) information embedded in <see cref="EnvelopeClientDto"/>.
/// </summary>
public record EnvelopeSenderDto
{
public int Id { get; init; }
public string? Username { get; init; }
public string? FullName { get; init; }
public string? Email { get; init; }
}
/// <summary>
/// Client-side model for a document embedded in <see cref="EnvelopeClientDto"/>.
/// </summary>
public record DocumentClientDto
{
public int Id { get; init; }
public int EnvelopeId { get; init; }
public DateTime AddedWhen { get; init; }
public IEnumerable<SignatureClientDto>? Elements { get; init; }
}
/// <summary>
/// Client-side model for a signature/annotation element embedded in <see cref="DocumentClientDto"/>.
/// </summary>
public record SignatureClientDto
{
public int Id { get; init; }
public int DocumentId { get; init; }
public int ReceiverId { get; init; }
public int ElementType { get; init; }
public double X { get; init; }
public double Y { get; init; }
public double Width { get; init; }
public double Height { get; init; }
public int Page { get; init; }
public bool Required { get; init; }
public string? Tooltip { get; init; }
public bool ReadOnly { get; init; }
public int AnnotationIndex { get; init; }
public DateTime AddedWhen { get; init; }
public DateTime? ChangedWhen { get; init; }
}
/// <summary>
/// Client-side model for the receiver data embedded in <see cref="EnvelopeReceiverDto"/>.
/// </summary>
public record ReceiverClientDto
{
public int Id { get; init; }
public string? EmailAddress { get; init; }
public string? Signature { get; init; }
public DateTime AddedWhen { get; init; }
public DateTime? TfaRegDeadline { get; init; }
}

View File

@@ -0,0 +1,62 @@
namespace EnvelopeGenerator.ReceiverUI.Models;
/// <summary>
/// Represents a captured signature with metadata created by the receiver in the signature popup.
/// This model holds the signature image (as base64 data URL) along with signer information
/// used for rendering applied signatures on the PDF canvas.
/// </summary>
/// <remarks>
/// <b>Used in:</b> EnvelopeViewer.razor signature popup workflow
/// <br/>
/// <b>Creation:</b> User draws/types/uploads signature and fills required fields
/// <br/>
/// <b>Storage:</b> Session-only (Blazor component state, lost on page refresh)
/// <br/>
/// <b>Rendering:</b> Applied signatures display: Image + Separator + Name/Position/Place/Date
/// </remarks>
public sealed record SignatureCaptureDto
{
/// <summary>
/// Base64-encoded data URL of the signature image.
/// <br/>
/// <b>Format:</b> <c>data:image/png;base64,iVBORw0KG...</c>
/// <br/>
/// <b>Source:</b> Canvas.toDataURL() from signature pad (draw/text/image tabs)
/// <br/>
/// <b>Usage:</b> Set as <c>img.src</c> in applied signature overlay
/// </summary>
public required string DataUrl { get; init; }
/// <summary>
/// Full name of the signer (first and last name).
/// <br/>
/// <b>Required:</b> Yes (validated in popup)
/// <br/>
/// <b>Display:</b> Bold text in applied signature block
/// <br/>
/// <b>Example:</b> "Max Mustermann"
/// </summary>
public required string FullName { get; init; }
/// <summary>
/// Job title or position of the signer.
/// <br/>
/// <b>Required:</b> No (optional field)
/// <br/>
/// <b>Display:</b> Normal weight text between name and place/date
/// <br/>
/// <b>Example:</b> "Geschäftsführer" or empty string
/// </summary>
public string Position { get; init; } = string.Empty;
/// <summary>
/// Location/place where the signature was created.
/// <br/>
/// <b>Required:</b> Yes (validated in popup)
/// <br/>
/// <b>Display:</b> Shown with current date in German format (dd.MM.yyyy)
/// <br/>
/// <b>Example:</b> "Berlin" ? rendered as "Berlin, 26.01.2025"
/// </summary>
public required string Place { get; init; }
}

View File

@@ -0,0 +1,101 @@
using EnvelopeGenerator.ReceiverUI.Models.Constants;
namespace EnvelopeGenerator.ReceiverUI.Models;
/// <summary>
/// Represents a signature position on a PDF page.
/// Coordinates stored in INCHES (GdPicture14 native unit).
/// Origin: Top-left corner, X increases right, Y increases down.
/// </summary>
public class SignatureDto
{
/// <summary>Unique identifier.</summary>
public int Id { get; init; }
private double _x;
private double _y;
/// <summary>Horizontal position in INCHES from left edge.</summary>
public double X
{
get => _x * Factor;
init => _x = value;
}
/// <summary>Vertical position in INCHES from top edge.</summary>
public double Y
{
get => _y * Factor;
init => _y = value;
}
/// <summary>1-based page number.</summary>
public int Page { get; init; }
/// <summary>Sender application type that created this signature.</summary>
public SenderAppType SenderAppType { get; init; }
private UnitOfLength _unitOfLength;
public SignatureDto Convert(UnitOfLength unitOfLength)
{
_unitOfLength = unitOfLength;
return this;
}
public double Factor
{
get
{
if (SenderAppType != SenderAppType.LegacyFormApp)
{
throw new NotImplementedException(
$"SenderAppType '{SenderAppType}' is not yet implemented. " +
$"Currently, only '{nameof(SenderAppType.LegacyFormApp)}' is supported. " +
$"Future implementations will handle '{nameof(SenderAppType.ReceiverUIBlazorApp)}' and other types.");
}
// LegacyFormApp uses GdPicture14 with INCHES
return _unitOfLength switch
{
UnitOfLength.Inch => 1.0, // No conversion needed: INCHES → INCHES
UnitOfLength.Point => 72.0, // INCHES → PDF Points: 1 inch = 72 points (PDF standard, NOT pixels!)
_ => throw new InvalidOperationException(
$"Unknown UnitOfLength: {_unitOfLength}. Expected '{nameof(UnitOfLength.Inch)}' or '{nameof(UnitOfLength.Point)}'.")
};
}
}
}
public static class SignatureDtoExtensions
{
/// <summary>
/// Converts all signatures in the collection to the specified unit of length.
/// </summary>
/// <typeparam name="T">Type of the collection (IEnumerable, List, etc.)</typeparam>
/// <param name="signatures">Collection of SignatureDto objects to convert.</param>
/// <param name="unitOfLength">Target unit of measurement (Inch or Point).</param>
/// <returns>The same collection with all signatures converted to the specified unit.</returns>
/// <exception cref="ArgumentNullException">Thrown when signatures collection is null.</exception>
/// <remarks>
/// <b>Usage:</b>
/// <code>
/// var signatures = await SignatureService.GetAsync(envelopeKey);
/// var convertedSignatures = signatures.ConvertAll(UnitOfLength.Point);
/// </code>
/// <b>Note:</b> This method modifies each SignatureDto object in place and returns the same collection.
/// </remarks>
public static T Convert<T>(this T signatures, UnitOfLength unitOfLength)
where T : IEnumerable<SignatureDto>
{
if (signatures == null)
throw new ArgumentNullException(nameof(signatures));
foreach (var signature in signatures)
{
signature.Convert(unitOfLength);
}
return signatures;
}
}

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