Compare commits

...

558 Commits

Author SHA1 Message Date
fc23ba840e chore(Web): bump to 3.8.2 2025-11-20 16:47:45 +01:00
140d271b28 refactor(privacy-policy): remove 6. Hinweisgebersystem 2025-11-20 16:46:31 +01:00
a3b12a6957 bump to 3.8.1 2025-11-20 14:49:10 +01:00
16bdc7820d update privacy policy (English) 2025-11-20 14:14:25 +01:00
06e32b99ea update privacy policy (German) title and last updated date 2025-11-20 14:06:51 +01:00
c7c78f96a6 refactor(PDFBurner): fix merging errors 2025-11-20 12:34:30 +01:00
5c232e61f2 merge PDFBurner changes 2025-11-20 11:57:00 +01:00
24c9321c0f bump to 3.8.0 2025-11-20 10:34:19 +01:00
c75c2b1dd5 feat(envelope-api.js): append envKey query parameter to all outgoing requests
Added automatic injection of the envKey query parameter into all request URLs within sendRequest.
Updated URL handling to use the URL API, ensuring consistent parameter merging and preventing missing envKey issues.
2025-11-20 10:33:54 +01:00
8445757f34 feat: replace default cookie events with custom EnvelopeCookieManager and introduce custom auth cookie name (env_auth) 2025-11-20 10:32:32 +01:00
b088eb089f feat(EnvelopeCookieManager): add EnvelopeCookieManager to support envelope-specific cookie names
- Introduce EnvelopeCookieManager wrapper around ChunkingCookieManager to generate dynamic cookie names based on envelopeReceiverId or envKey. Ensures request/response cookies are scoped per envelope.
2025-11-20 10:30:49 +01:00
e66c46767e refactor: convert markdown parsing to IIFE and preserve indentation 2025-11-18 11:34:37 +01:00
bc732d311c feat: enable async marked parsing and improve markdown rendering
- Configure marked with async, breaks, and GFM options
- Update markdown processing to use textContent and async marked.parse
- Replace synchronous innerHTML parsing with awaited async parsing
2025-11-18 10:00:38 +01:00
c90d29d654 chore: remove IISProfileNetMulti 2025-11-17 16:20:27 +01:00
47a2e950ca chore: add IIS profile for .net 8 2025-11-17 16:19:51 +01:00
6ef989213e chore(Web): add multi-targeting for net7.0, net8.0, and net9.0 with framework-specific package references
Refactored the project file to support multiple target frameworks and added
conditional ItemGroups. Updated several package versions for net8.0 and net9.0
targets to ensure compatibility while keeping net7.0 dependencies unchanged.
2025-11-17 15:23:04 +01:00
2a27b6161b chore(Web): bump to 3.7.0 2025-11-17 12:50:49 +01:00
efdc372b04 feat(envelope): bypass access-code flow when UseAccessCode is disabled
- Add logic to skip access-code workflow if UseAccessCode is false
- Auto-authenticate receiver and show envelope immediately
- Preserve rejection and signed checks
- Keep existing behavior for access-code enabled envelopes
2025-11-17 12:49:15 +01:00
698b7ca1ac feat: render markdown content using marked library 2025-11-15 00:56:19 +01:00
bf6947a28c chore(Web): bump to 3.6.0 2025-11-14 23:05:47 +01:00
e2e31e2e69 feat(ShowEnvelope): render envelope message using Markdown parser 2025-11-14 23:02:37 +01:00
73f6221c3c chore(Web): add marked.js 2025-11-14 15:13:25 +01:00
10f730a833 chore(Web): bump to 3.5.1 2025-11-14 14:31:31 +01:00
cf5a301942 refactor(EnvelopeController): add cancellation token to LogInEnvelope POST action
- Updated `LogInEnvelope` method to accept `CancellationToken` for better async operation handling.
- No functional changes to other methods.
- Maintains backwards compatibility with obsolete MediatR services.
2025-11-14 14:29:25 +01:00
e364f1f592 fix: handle rejected documents correctly with info alert and auto-reload 2025-11-14 14:20:34 +01:00
8a488d4e71 fix: improve finish handler error handling for unavailable envelopes
- Update FINISH flow to handle status codes 409 and 423
- Reload page on 423 responses
- Show proper warning when envelope is no longer available (409)
2025-11-14 14:12:21 +01:00
f0be1a5b03 feat(annotation): update response status codes for signed/rejected checks 2025-11-14 14:08:10 +01:00
773721b634 fix(AnnotationController): enforce proper rejection and history checks in CreateOrUpdate
- Updated `AnyHistoryAsync` call to filter by `EnvelopeRejected` and `DocumentRejected` statuses, returning 403 instead of 200 when applicable.
- Ensures users cannot proceed if envelope was previously rejected.
- Minor cleanup in CreateOrUpdate logic to better handle authorization and signed checks.
2025-11-14 13:49:58 +01:00
99e3e4c24d refactor: update CountHistoryQueryExtensions to use IEnumerable<EnvelopeStatus> and improve status handling 2025-11-14 13:47:34 +01:00
b9c86ce3c6 refactor(CountHistoryQuery): replace single status filter with status range in CountHistoryQuery
- Updated AnyHistoryAsync extension to use EnvelopeStatusQuery instead of single EnvelopeStatus.
- Modified CountHistoryQuery to support multiple statuses (Min, Max, Include, Ignore).
- Preserved backward compatibility with obsolete single Status and EnvelopeId.
2025-11-14 13:39:39 +01:00
637b45efe0 feat(history-query): support multiple status filters in CountHistoryQueryHandler
- Added handling for `Statuses` property to filter by min, max, include, and ignore lists.
- Deprecated single `Status` handling is now wrapped with pragma warnings for backward compatibility.
- Ensures `AnyHistoryAsync` extension works correctly with enhanced query filtering.
2025-11-14 13:36:44 +01:00
28b8c311f9 refactor(CountHistoryQuery): simplify AnyHistoryAsync extension to use UUID and status
- Replace Action-based query configuration with direct parameters (uuid, status)
- Automatically constructs CountHistoryQuery from provided parameters
- Keeps existing EnvelopeId/UUID validation in handler
- Improves readability and usability of history count checks
2025-11-14 13:27:26 +01:00
00c7fe5316 feat(history): enhance ReadHistoryQuery to support Envelope object and UUID
- Replace nullable `OnlyLast` with non-nullable default `true`
- Support filtering by Envelope object (Id or Uuid) in addition to deprecated EnvelopeId
- Throw `BadRequestException` if no valid Envelope reference is provided
- Preserve status filtering and ordering for latest history entries
2025-11-14 13:24:02 +01:00
e5a061d5b5 feat(ReadHistoryQuery): enhance ReadHistoryQuery to support Envelope object and UUID
- Replace nullable `OnlyLast` with non-nullable default `true`
- Support filtering by Envelope object (Id or Uuid) in addition to deprecated EnvelopeId
- Throw `BadRequestException` if no valid Envelope reference is provided
- Preserve status filtering and ordering for latest history entries
2025-11-14 13:19:56 +01:00
629b02863b refactor(history): introduce extension method and remove AutoMapper dependency
- Added `CountHistoryQueryExtensions.AnyHistoryAsync` for cleaner query usage via `ISender`.
- Removed `IMapper` from `CountHistoryQueryHandler` as it was unused.
- Removed unnecessary `using` directives to simplify imports.
- Kept query handling logic intact.
2025-11-14 11:57:16 +01:00
3b24755c35 feat(CountHistoryQuery): add CountHistoryQuery to retrieve envelope history count
- Introduced `CountHistoryQuery` record for querying the count of history entries of an envelope.
- Implemented `CountHistoryQueryHandler` using repository pattern and AutoMapper.
- Supports optional filtering by `Status`.
- Throws `NotFoundException` if necessary (placeholder for future extension).
2025-11-14 11:49:51 +01:00
864e9e8164 refactor(HistoryQueryBase): created to handle basic history queries.
- imp to ReadHistoryQuery
2025-11-14 11:46:15 +01:00
7eff958d0a refactor(ReadHistoryQueryHandler): move to ReadHistoryQuery 2025-11-14 11:33:57 +01:00
c3deaae63b refactor(Service): add UserConfig 2025-10-30 14:39:15 +01:00
bb0197e6ba refactor: wrap repository access in a DI scope in PDFBurner
- Updated `BurnAnnotsToPDF` to create a scope using `Factory.Shared.ScopeFactory.CreateScope()`
  before accessing the `Signature` repository.
- Ensures proper disposal of services and improves dependency injection usage.
- No functional changes to PDF burning logic.
2025-10-29 17:40:42 +01:00
ec2935b524 refactor: update EnvelopeGenerator factory initialization with PostBuildBehavior 2025-10-29 17:14:49 +01:00
4fd7982cba refactor: update EnvelopeGenerator infrastructure service initialization
- Added `BehaveOnPostBuild(PostBuildBehavior.Ignore)` in the Factory initialization
- Adjusted formatting for better readability of `AddEnvelopeGeneratorInfrastructureServices` call
- No functional changes to job execution or PDF/email processing
2025-10-29 17:01:24 +01:00
ddcf5edc00 update DigitalData.Core.Abstractions 2025-10-29 16:54:12 +01:00
74d207caa3 refactor(EnvelopeGenerator.Service): update Microsoft.Extensions.Logging.Abstractions to 7.0.0 2025-10-29 16:29:07 +01:00
a367c12551 chore(Web): bump to 3.5 2025-10-28 16:57:20 +01:00
35a328f8dc feat(pdfburner): adjust background rendering in BurnElementAnnotsToPDF
- Added scaling factors (1.95 * 0.93, 2.52 * 0.67) to the background generation step
- Included TODO note to calculate length dynamically based on largest Y value
- Improved visual accuracy of PDF background rendering for element annotations
2025-10-28 16:56:00 +01:00
d259a15b4b refactor: add DigitalData.Core.Abstractions.Interfaces import and make Background method width/height configurable 2025-10-28 16:43:59 +01:00
23e0e5ddbe fix(pdfburner): correct annotation X-coordinate handling in BurnElementAnnotsToPDF
Adjusted logic in `BurnElementAnnotsToPDF` to properly use annotation X position
(`annot.X / inchFactor`) instead of offset-based calculation with `frameX` and
`frameXShift`. This ensures more accurate placement of form fields and images
when burning annotations into PDFs.
2025-10-28 16:40:06 +01:00
0bb85c28c1 fix: adjust annotation position calculation in PDFBurner
- Updated BurnElementAnnotsToPDF method to correctly align image annotations relative to the frame position.
- Introduced frame-based coordinate shifting (frameXShift and frameYShift) to handle signature positioning accurately.
- Replaced variable `x` with `frameX` for better clarity and consistency.
2025-10-28 16:27:55 +01:00
a11d9a0e0e refactor(PDFBurner): adjust annotation positioning and unit conversions in PDFBurner
- Renamed variable `magin` → `margin` for clarity
- Revised coordinate calculations for annotation positioning (`x`, `y`)
- Adjusted width and height units to use inches instead of fixed inchFactor multipliers
- Updated y-offset logic for form fields (`yOffsetsOfFF`) to improve layout alignment
- Simplified image annotation scaling (removed division by 100)
- Improved code readability and comment consistency
2025-10-28 15:27:52 +01:00
b9bb058137 fix(AnnotationCreateDto): rename WIDTH and HEIGHT properties to Width and Height in AnnotationCreateDto 2025-10-28 14:42:14 +01:00
0818d7d9eb feat(dto): add position and size properties to AnnotationCreateDto 2025-10-28 14:14:09 +01:00
9d200800c5 feat: add position and size properties to ElementAnnotation entity
- Added `X`, `Y`, `Width`, and `Height` properties with `float` database mapping.
- Retains existing fields and database annotations.
- Prepares the entity for spatial layout handling in documents.
2025-10-28 14:10:32 +01:00
6feb601670 fix(annotations): include bounding box coordinates in mapped signature and frame data
- Added extraction of `x`, `y`, `width`, and `height` from annotations and frames in `mapSignature`.
- Ensures positional data is correctly preserved when mapping signatures and frames from PSPDFKit annotations.
- No functional changes to annotation creation, deletion, or validation.
2025-10-28 13:58:03 +01:00
39c12ada45 refactor(annotations): include bounding box info in mapped signature fields
- Added `x`, `y`, `width`, and `height` properties to form field mapping in `mapSignature`.
- Preserves original form field values while enriching them with annotation coordinates.
- No functional changes to annotation creation, deletion, or validation.
2025-10-28 13:49:26 +01:00
985ad4dc29 fix(pdf-burner): correct image annotation type and scaling
- Fixed conditional check in BurnElementAnnotsToPDF to correctly handle AnnotationType.Image.
- Adjusted AddImageAnnotation method to scale width and height by dividing by 100.
- No functional changes to other PDF burning or annotation logic.
2025-10-28 13:00:43 +01:00
038ac2aed0 fix(annotations): correct signature frame mapping by filtering by pageIndex
- Updated `mapSignature` to filter signature annotations by `pageIndex` when finding nearest elements.
- Ensures correct association of frames and signature data for each page.
- Prevents errors caused by cross-page annotation references.
2025-10-28 12:59:49 +01:00
5e74de0ce7 refactor(pdf-burner): adjust annotation positioning logic in BurnElementAnnotsToPDF
- Introduced configurable inch factor, margins, width, and height for annotations
- Added dynamic Y-offsets for form fields based on annotation names
- Simplified AddFormFieldValue logic for direct coordinates
- Removed hardcoded offsets previously embedded in the method
2025-10-28 11:48:19 +01:00
0ce7ae9494 fix(pdfburner): correct page indexing for annotation rendering
- Removed unnecessary +1 offset in Manager.SelectPage calls for image and ink annotations
- Ensured correct page index is used when adding annotations and form field values
- Improved annotation rendering accuracy when burning to PDF
2025-10-28 10:48:15 +01:00
7041a4694a fix: ensure annotations are properly burned after background addition in PDFBurner 2025-10-28 10:43:19 +01:00
75e47d10e3 feat(pdfburner): add ink annotation support and refactor annotation handling
- Added new AddInkAnnotation(page As Integer, value As String) method to handle ink annotations from element data.
- Introduced new Ink model class for deserializing ink annotation data (lines and strokeColor).
- Updated BurnElementAnnotsToPDF to support Ink annotation type.
- Refactored annotation type handling for better extensibility.
- Improved annotation burning logic for mixed annotation types (form fields, images, inks).
2025-10-28 10:06:38 +01:00
7f9125b3aa refactor: add AddImageAnnotation-method 2025-10-28 09:43:43 +01:00
fee256a51a add y offset to AddFormFieldValue metot 2025-10-28 09:25:48 +01:00
8ad7c37261 refactor(PdfBurner): update BurnAnnotsToPDF to add form field 2025-10-28 09:09:53 +01:00
ef28bbaaf1 refactor(pdf-burner): replace annotation type constants with AnnotationType class
- Removed individual annotation type constants (ANNOTATION_TYPE_IMAGE, ANNOTATION_TYPE_INK, ANNOTATION_TYPE_WIDGET)
- Introduced new Friend Class `AnnotationType` to encapsulate annotation type string constants
- Updated all references to use `AnnotationType.Image`, `AnnotationType.Ink`, and `AnnotationType.Widget`
- Improved code organization by grouping related constants and removing redundant declarations
2025-10-24 13:50:24 +02:00
258de6244c refactor(pdf-burner): organize code with regions for better readability
- Grouped related methods and classes into logical #Region blocks:
  - "Burn PDF"
  - "Add Value"
  - "Helpers"
  - "Model"
- Improved code structure and readability without changing functionality.
- No logic or behavior modifications were made.
2025-10-24 12:30:16 +02:00
a845b85a5c refactor(PDFBurner): separate element annotation burning into dedicated method and simplify BurnAnnotsToPDF logic 2025-10-24 12:21:04 +02:00
02a7b706cf refactor(PDFBurner): extract instant JSON annotation burning logic into separate method
- Moved annotation burning logic from `BurnAnnotsToPDF` into new method `BurnInstantJSONAnnotsToPDF`
- Simplified `BurnAnnotsToPDF` to handle only background generation and call the new method
- Improved code readability and separation of concerns
2025-10-23 17:05:37 +02:00
7912469709 refactor(pdf): add output stream disposal management to Pdf class
- Added `disposeOutputStream` parameter to Pdf constructor
- Updated `FromMemory` to set output stream disposal based on null value
- Ensured proper cleanup of output stream in Dispose and DisposeAsync methods
- Improved resource management to prevent potential memory leaks
2025-10-23 14:34:57 +02:00
75d975223e feat(pdf): add optional output stream parameter to FromMemory overload
- Updated Pdf.FromMemory(MemoryStream) to accept an optional outputStream parameter
- Ensures flexibility when reusing existing MemoryStreams for output
- Added conditional nullability support for .NET builds
2025-10-23 14:30:30 +02:00
c456d67d03 feat(pdf): add option to preserve input stream on disposal
- Introduced `disposeInputStream` parameter in `Pdf<TInputStream, TOutputStream>` constructor.
- Updated `Dispose` and `DisposeAsync` to conditionally dispose the input stream based on this flag.
- Updated `Pdf.FromMemory(MemoryStream)` to not dispose the provided MemoryStream by default.
- Ensures better control over resource management when reusing input streams.
2025-10-23 13:51:40 +02:00
241e59fc7e feat(Pdf): add FromMemory method to be able to create via stream 2025-10-23 13:39:59 +02:00
f0d101bb23 refactor(pdf-burner): rename BurnInstantJSONAnnotationsToPDF to BurnAnnotsToPDF
- Updated method name to better reflect its functionality.
- No changes to logic or behavior; purely a rename for clarity.
2025-10-23 13:36:32 +02:00
8db5afae40 feat(PDFBurner): add background rendering using PdfEditor before burning annotations 2025-10-23 12:54:53 +02:00
b62cca5961 feat(pdf-burner): integrate repository to fetch envelope annotations
- Added repository access to retrieve signatures and their annotations for a given envelope.
- Updated `BurnInstantJSONAnnotationsToPDF` to accept `envelopeId` and load elements from the database.
- Updated imports to include `DigitalData.Core.Abstractions` and Entity Framework references.
2025-10-23 12:14:35 +02:00
0e7b120ded refactor(Entities.Annotation): rename it to ElementAnnotation to prevent name conflicts. 2025-10-23 10:51:19 +02:00
d8cbdb0c65 chore:
- upg Core.Abstraction.Application to 1.4.0
 - upg Core.Abstractions to 4.2.0
2025-10-23 10:37:15 +02:00
0107602a84 upg Abstraction.Application and Application projects 2025-10-22 18:34:40 +02:00
02ecd88758 feat(TestAnnotationController): include receiver signature in RemoveSignatureNotification
Updated TestAnnotationController.Delete to extract the receiver signature from the envelope key
and pass it along with the envelope UUID when publishing RemoveSignatureNotification.
Returns BadRequest if the signature is missing.
2025-10-22 14:29:38 +02:00
17c7e46388 fix(AnnotationController): use PublishSafely for docSignedNotification
Replaced `await _mediator.Publish(docSignedNotification, cancel)` with
`await _mediator.PublishSafely(docSignedNotification, cancel)` to ensure
safe publishing of notifications without unhandled exceptions.
2025-10-22 14:25:50 +02:00
f3af30c67d feat(DocSignedNotificationExtensions): add PublishSafely extension for DocSignedNotification
- Introduced PublishSafely method to safely publish DocSignedNotification events.
- Added fallback logic to publish RemoveSignatureNotification when publishing fails.
- Added missing using directive for RemoveSignatureNotification namespace.
2025-10-22 13:10:38 +02:00
90e10d3d04 refactor(RemoveSignatureNotification): update handlers to throw exception if there is no filter 2025-10-22 12:50:57 +02:00
af14ef7ce5 feat(RemoveSignatureNotification): add validation and filter logic to RemoveSignatureNotification
- Added `HasFilter` property to check if any filter parameters are provided.
- Implemented `ThrowIfHasNoFilter()` method to enforce at least one filter parameter.
- Improves robustness and validation of RemoveSignatureNotification.
2025-10-22 11:02:10 +02:00
1edcfed318 refactor(RemoveSignatureNotification): Alle Filter von Handlern an die Bedingung binden, dass sie nicht null sind. 2025-10-22 10:38:08 +02:00
2004c7ced2 feat(RemoveSignatureNotification): extend RemoveSignatureNotification with EnvelopeId and ReceiverId
Added optional parameters `EnvelopeId` and `ReceiverId` to RemoveSignatureNotification
to provide additional context when removing receiver signatures.
2025-10-21 16:43:01 +02:00
40135fb8a2 feat(RemoveHistoryHandler): add filtering by receiver signature in RemoveHistoryHandler
Added logic to filter history records by receiver signature when provided in
RemoveSignatureNotification. This ensures only relevant signed entries are deleted.
2025-10-21 15:51:55 +02:00
b57c0aa9c7 refactor(RemoveDocStatusHandler): update RemoveDocStatusHandler to support conditional receiver signature filtering
Updated the RemoveDocStatusHandler to refine document status deletion logic.
Now filters by EnvelopeUuid and optionally by ReceiverSignature when provided.
2025-10-21 15:41:09 +02:00
2c4c18935f feat(RemoveSignatureNotification): add ReceiverSignature to RemoveSignatureNotification
Added a new nullable ReceiverSignature property to the RemoveSignatureNotification record
to support handling receiver-specific signature removal events.
2025-10-21 15:25:04 +02:00
d8ed06fdb6 feat(RemoveAnnotationHandler): add RemoveAnnotationHandler to handle signature removal notifications
- Implements INotificationHandler<RemoveSignatureNotification>
- Deletes Annotation entities matching the Envelope UUID from the repository
- Uses IRepository<Annotation> for data access
2025-10-21 12:43:59 +02:00
09bf8db884 refactor(RemoveAnnotationHandler): rename as RemoveDocStatusHandler 2025-10-21 12:27:54 +02:00
911c812b19 refactor(Annotation): change Id column type from int to bigint in Annotation entity 2025-10-21 11:45:23 +02:00
8ae0f79365 refactor(AnnotationDto): split AnnotationDto into AnnotationCreateDto and AnnotationDto
- Introduced AnnotationCreateDto for creation-specific properties
- AnnotationDto now inherits from AnnotationCreateDto and includes Id, AddedWhen, ChangedWhen, and ChangedWho
- Added Type property to AnnotationCreateDto
 - remove CreateAnnotationCommand
2025-10-21 11:42:01 +02:00
0ca54fe1fe feat(DocSignedNotification): replace Annotations with PsPdfKitAnnotation in DocSignedNotification
- Introduced new record `PsPdfKitAnnotation` to encapsulate both Instant and Structured annotation data
- Updated `DocSignedNotification` to use `PsPdfKitAnnotation` instead of `ExpandoObject Annotations`
- Modified extension methods to accept and map `PsPdfKitAnnotation`
- Added reference to `EnvelopeGenerator.Application.Annotations.Commands` for `CreateAnnotationCommand`
2025-10-21 10:11:36 +02:00
a1d6b5347f refactor(annotation): simplify mapSignature function to return a flat array
Reworked mapSignature to return a single flattened array combining formFields,
frames, and signatures instead of a nested object. This simplifies downstream
processing and improves readability.
2025-10-21 09:48:06 +02:00
6cc631111c refactor(annotation): simplify field mapping and return structured objects
Refactored the mapSignature function to:
- Return cleaner structured objects for formFields, frames, and signatures
- Include `type` and `value` properties in returned objects
- Remove direct mutation of field and annotation objects
- Improve readability and maintainability of data mapping logic
2025-10-21 09:38:47 +02:00
9d6074874f fix(annotation): correctly assign elementId for signature annotations
Previously, signature annotations did not include elementId mapping logic, which caused issues when linking annotations to their corresponding elements. This update adds logic to extract elementId from the nearest signature annotation (similar to frame annotations) to ensure proper association.
2025-10-21 09:25:01 +02:00
26bdb0806d feat(MappingProfile): add AutoMapper profile for CreateAnnotationCommand to Annotation 2025-10-21 09:09:56 +02:00
7919f02ffd feat(annotation): enhance mapSignature to support drawn signatures
- Added support for mapping drawn (non-image) signatures by including `lines` and `strokeColor` data.
- Added error handling for incompatible or missing signature data structures.
- Ensures compatibility with third-party annotation libraries that return vector-based signatures.
2025-10-20 16:35:53 +02:00
04ae14c660 refactor(annotation): update mapSignature to handle frames and signatures separately
- Modified `mapSignature` to set `name` as 'frame' for FRAME annotations and 'signature' for signature annotations.
- Added processing for annotations with `isSignature` to include their `value` from attachments if present.
- Ensures consistent mapping of form fields, frames, and signatures.
2025-10-20 14:29:39 +02:00
cff79730b0 fix(annotations): correctly decode base64 for FRAME annotations
Updated `mapSignature` function to use `fixBase64` when assigning `value`
to FRAME annotations. This ensures any escaped Base64 strings in attachments
are properly converted to standard Base64 format.
2025-10-20 14:22:19 +02:00
188cb67306 feat(annotations): add fixBase64 and map FRAME annotations to nearest signature
- Added `fixBase64` utility to unescape Base64 strings.
- Updated `mapSignature` to link FRAME annotations to their nearest signature element and include `elementId`.
- Ensures proper mapping of annotation frames and consistent data structure for form fields.
2025-10-20 14:05:11 +02:00
abaa315b24 feat(utils): add findNearest function to calculate closest point 2025-10-20 13:40:38 +02:00
4f463c27e6 feat(annotation): extend mapSignature to include FRAME annotations
- Updated `mapSignature` function to also map image/frame annotations.
- For each annotation with `description === 'FRAME'`, add `name` and `value` based on corresponding attachment.
- Preserves existing mapping of form fields, filtering out labels.
- Ensures signature data and associated frames are returned in a structured object.
2025-10-20 11:28:05 +02:00
d6f17ec4e8 feat(annotations): add mapSignature function for mapping form field data
- Introduced new function `mapSignature(iJSON)` to process formFieldValues
- Filters out label fields and maps form field data to include elementId and simplified name
- Enhances annotation handling for signature mapping
2025-10-20 10:59:57 +02:00
e3e2831da1 feat(Annotation): add Type property to Annotation entity and update CHANGED_WHO column type
- Added new required `Type` field with nvarchar(50) to `Annotation` entity.
- Updated `CHANGED_WHO` column type from nchar(100) to nvarchar(50).
- Corresponding database migration required.
2025-10-20 10:37:29 +02:00
52306d481f refactor(app): simplify annotation creation and improve signature handling
- Updated `createImageAnnotation` to use pre-generated id instead of multiple parameters
- Replaced hardcoded annotation ID generation during signature creation
- Added `fixBase64` helper to handle escaped base64 strings
- Temporarily added logging in `handleFinish` for debugging exported InstantJSON
- Simplified `createImageAnnotation` signature and usage
- Improved readability and consistency in annotation ID generation logic
2025-10-17 13:46:07 +02:00
f046be240b refactor(annotations): replace global element index with element.id in generateId
- Removed global __elementIndex counter and updated generateId() to use element.id for unique annotation IDs.
- Updated createAnnotations() and createImageAnnotation() to pass element.id to generateId().
- Simplified ID generation logic for better consistency and traceability across annotations.
2025-10-17 09:33:58 +02:00
16e5d5c692 feat(AnnotationHandler): add handler for DocSignedNotification to create annotations
- Implemented AnnotationHandler to process DocSignedNotification events
- Sends CreateAnnotationCommand via MediatR with envelope, receiver, and annotations data
2025-10-16 14:28:25 +02:00
e64ad44b71 refactor(annotation): simplify PSPDFKitInstantJSON deserialization in CreateAnnotationCommand
Refactored CreateAnnotationCommand to remove the lazy initialization pattern
and replaced it with a direct property setter for PSPDFKitInstantJSON.
This simplifies JSON deserialization and removes unnecessary complexity
in managing the PSPDFKitInstant object.
2025-10-16 11:24:23 +02:00
e88bd55198 refactor(AnnotationHandler): rename as DocStatusHandler 2025-10-16 10:18:32 +02:00
4abed0e1bc fix(data): define navigation property for Envelope–Document relationship
Explicitly specify the navigation property `d.Envelope` in the relationship
between Envelope and Document to ensure proper entity mapping and navigation
in EF Core.
2025-10-15 18:23:43 +02:00
69821e64c6 refactor(Document): update Document entity structure and file properties
- Moved file-related properties (Filename, Filepath, FileNameOriginal) into dedicated region
- Added column mappings for file-related properties
- Changed Elements type to IEnumerable<Signature> for better abstraction
- Adjusted EnvelopeId default initialization for NETFRAMEWORK only
- Updated ByteData and nullable types for NET compatibility
- Removed obsolete default value and simplified property definitions
2025-10-14 10:53:19 +02:00
f13a2434f7 refactor(CreateAnnotationCommand): make JsonSerializerOptions static. 2025-10-14 09:34:59 +02:00
ecc7552951 refactor: move CreateAnnotationCommand extension to separate static class 2025-10-13 17:15:00 +02:00
d10f19d92a refactor(annotation): add lazy JSON deserialization for PSPDFKitInstantJSON
- Introduced Lazy<dynamic> field for deferred deserialization of PSPDFKitInstantJSON
- Added ExpandoObject property (PSPDFKitInstant) for dynamic access
- Updated handler to use ParsePSPDFKitInstant instead of ParsePSPDFKitInstantJSON
- Improved JsonSerializerOptions for case-insensitive property handling
2025-10-13 16:56:00 +02:00
5e53f2b691 refactor(CreateAnnotationCommand): update to return IEnumerable<Signature> as result 2025-10-13 15:51:53 +02:00
f56928f44f feat(CreateAnnotationCommand): implement CreateAnnotationCommand and handler logic
Added full implementation for CreateAnnotationCommand and its handler:
- Introduced `PSPDFKitInstantJSON` property to the command
- Injected repositories for `Signature` and `Annotation`
- Implemented query filtering for Envelope and Receiver
- Added annotation creation from parsed PSPDFKit JSON
- Created helper method `ParsePSPDFKitInstantJSON` for JSON parsing
2025-10-13 15:28:38 +02:00
faa37e0dcd add CreateAnnotationCommandHandler without implementation 2025-10-13 11:17:50 +02:00
e51470a449 create AnnotationDto 2025-10-13 11:16:37 +02:00
adce61fead feat: add CreateAnnotationCommand record for annotation creation 2025-10-13 10:59:58 +02:00
e052bf56f4 feat(EGDbContext): add annotations mapping and clean up constructor initialization
- Added model configuration for Signature → Annotation relationship
- Removed redundant DbSet initializations from EGDbContextBase constructor
- Updated Config DbSet type from Domain.Entities.Config to Config
- Simplified using directives and removed unnecessary configuration imports
- Maintained existing trigger registration and entity configurations
2025-10-13 10:02:26 +02:00
22a7619627 feat(Signature): add Annotations navigation property to Signature entity
- Added `IEnumerable<Annotation>? Annotations` to Signature class
- Added `using System.Collections.Generic;` for .NET Framework builds
2025-10-13 09:48:24 +02:00
281cf47834 refactor(Annotation): rename Guid as Id
- convert type to long
2025-10-13 09:43:08 +02:00
a258dcdad0 feat(Annotation): add Annotation entity for document receiver element annotations
- Added Annotation entity mapped to table TBSIG_DOCUMENT_RECEIVER_ELEMENT_ANNOTATION
- Included data annotations for key, required fields, and relationships
- Added conditional compilation for .NET and .NET Framework compatibility
2025-10-13 09:40:41 +02:00
79c26eb5b5 refactor(PDFBurner): replace fieldName with egName and simplify form field handling
- Removed formFieldIndex tracking and inline dictionary
- Introduced EGName class with centralized index mapping
- Updated AddFormFieldValue to resolve Y-offset using EGName.Index
- Replaced fieldName property with egName for annotations
- Changed helper methods from Function(Void) to Sub for clarity
2025-10-10 15:00:04 +02:00
1f745ae79c refactor(pdfburner): simplify form field handling and improve default field naming
- Replaced ImmutableDictionary-based FormFieldIndex with a simpler Dictionary
- Updated form field ordering to: NoName, signature, position, city, date
- Removed manual formFieldIndex counter, now using dictionary lookup by fieldName
- Introduced FieldNames class with NoName constant (guid-based) for unnamed fields
- Defaulted Annotation.fieldName to FieldNames.NoName instead of Nothing
2025-10-09 18:59:18 +02:00
ce7ca39c39 add isLabel property 2025-10-09 17:42:34 +02:00
7b6f916486 refactor(PDFBurner): rename Annotation.internalType to fieldName for clarity 2025-10-09 12:19:19 +02:00
57422a481c feat(PDFBurner): support unstructured annotations and simplify processing
- Added `UnstructuredAnnotations` property to handle annotations without structured IDs
- Changed default `hasStructuredID` to `False`, set to `True` only after successful parsing
- Updated `AddInstantJSONAnnotationToPDF` to process annotations directly instead of grouping by receiver
- Simplified logic for reversing annotations and applying seal positioning
2025-10-08 16:27:28 +02:00
e96523b786 update to use IRepository<T> 2025-10-08 13:36:09 +02:00
3b7d0e1321 refactor(RemoveSignatureNotification): create with handlers to remove signatures of a document 2025-10-08 12:41:14 +02:00
9adc1ea4e7 refactor(annotation): remove unnecessary loop 2025-10-08 10:26:25 +02:00
510f5e9ddd fix: update to set to hold the value of id in a varable to be able to use form fields 2025-10-08 00:47:17 +02:00
44b204ca68 add structred id to image annotations 2025-10-08 00:36:20 +02:00
b72ac68daf refactor(annotations.js): move generateId method to outsite of createAnnotations method 2025-10-08 00:29:37 +02:00
7d85d59ace add hasStructuredID property isntead of throwing exception and filter it 2025-10-08 00:19:28 +02:00
4fad41bd0b update to use # as seperator instead of _ 2025-10-07 22:19:01 +02:00
39936792aa update to use annotations-by-receiver for iteration 2025-10-07 22:16:52 +02:00
74f444a8d6 feat(PDFBurner): add AnnotationsByReceiver method to AnnotationData 2025-10-07 21:54:18 +02:00
b67f26cc21 refactor(PDFBurner): enhance annotation ID handling and validation
- Added parsing of annotation `id` into `envelopeId`, `receiverId`, `index`, and `internalType`.
- Added validation for `id` format, ensuring it has exactly 4 parts and numeric checks for relevant fields.
- Throws `BurnAnnotationException` if `id` is null, empty, or incorrectly formatted.
- Maintains existing functionality for adding image, ink, and widget annotations.
2025-10-07 21:31:38 +02:00
a29f918125 fix(DependencyInjection): update to scan the assembly of EnvelopeReceiver instead of Config 2025-10-07 18:09:14 +02:00
3f116ce11a refactor(annotation): generate deterministic annotation IDs based on envelopeId, receiverId, and element index 2025-10-07 09:41:02 +02:00
41738bb36c refactor(annotation): add envelope id and receiver id input parameters 2025-10-06 17:12:06 +02:00
320b2ecc77 refactor(AnnotationData): add SignatureAnnotations-getter method to split signatures 2025-10-06 17:08:44 +02:00
b02cc3d7a4 refactor(PDFBurner): convert to Sub 2025-10-06 14:39:55 +02:00
14f2d9b6af refactor(PDFBurner): remove sigAnnotType parameter from AddInstantJSONAnnotationToPDF method 2025-10-06 13:54:56 +02:00
df74267616 refactor(PDFBurner): Vereinfachung der PDFBurner-Annotationsmethoden und Verbesserung der Fehlerbehandlung
- Methoden für Annotationen (AddInstantJSONAnnotationToPDF, AddImageAnnotation, AddInkAnnotation, AddFormFieldValue) auf Rückgabe-Typ Void umgestellt.
- Interne Try/Catch-Blöcke und das Unterdrücken von Ausnahmen in Hilfsmethoden entfernt.
- Fehlerbehandlung in BurnInstantJSONAnnotationsToPDF zentralisiert, mit Try/Catch für das Hinzufügen von Annotationen.
- Exit Select-Anweisungen für bessere Lesbarkeit in Select Case-Blöcken hinzugefügt.
- Import von DevExpress.DataProcessing ergänzt.
2025-10-06 10:29:29 +02:00
42870b973d refactor(frmFinalizePDF): configure Factory.Shared 2025-10-01 16:52:05 +02:00
33041a8b96 update to add triggers as dictionary 2025-10-01 15:39:08 +02:00
79db05be26 update to use Factory.Shared 2025-10-01 15:18:58 +02:00
f24a218d12 refactor(FinalizeDocumentJob): add EnvelopeGeneratorInfrastructure-Services 2025-10-01 14:44:47 +02:00
44a9971cf8 refactor(DependencyInjection.Config): add AddSQLExecutor method 2025-10-01 14:08:41 +02:00
82d4b7ec6a feat(infrastructure): refactor DIExtensions for DbContext registration
* Removed `dbContextOptions` parameter from `AddEnvelopeGeneratorInfrastructureServices`
* Moved `AddDbContext` registration into `Config` class with overloads for both `Action<DbContextOptionsBuilder>` and `Action<IServiceProvider, DbContextOptionsBuilder>`
* Simplified service registration flow and improved extensibility
2025-10-01 13:25:52 +02:00
9472322c1d fix(dbcontext): add conditional nullable annotation for ILogger parameter on .NET builds 2025-10-01 13:04:44 +02:00
53a656f6ee move DbTriggerParams to Infrastructure layer.
- createConfig for flexable configuration
2025-10-01 12:59:55 +02:00
ca24afe3c6 refactor(dbcontext): add NET/NETFRAMEWORK conditional compilation
- Wrapped `using` directives with `#if NET` and `#elif NETFRAMEWORK`
- Applied conditional inheritance for `IUserManagerDbContext` and `IMailDbContext`
- Made `EmailOut` DbSet and triggers only available in `NET` builds
- Adjusted `_logger` nullability for NET vs NETFRAMEWORK targets
- Ensured `modelBuilder.ConfigureUserManager()` only runs in NET builds
2025-10-01 11:17:27 +02:00
9c867ac8aa refactor(DIExtensions): Hinzufügen einer bedingten NET/NETFRAMEWORK-Unterstützung in DIExtensions
- Umschlossene Repository- und Executor-Registrierungen mit `#if NET`, um die Kompatibilität zwischen .NET und .NET Framework sicherzustellen
- Hinzufügen des Abschnitts `#elif NETFRAMEWORK` für frameworkspezifische Importe
- Verschieben der SQLExecutor- und Dapper-Typzuordnung unter bedingte Kompilierung
- Anpassen der Methodensignaturen zur Unterstützung bedingter nullbarer Parameter
2025-10-01 10:51:50 +02:00
12063f36de refactor(Infrastructure): update Executor, Migrations and Repositories to be compiled only in .NET 2025-10-01 10:36:57 +02:00
167ea1444b update core packages 2025-10-01 10:00:11 +02:00
794029f0e5 chore(Infrastructure): update csproj to support NET 4.6.2 2025-10-01 09:57:47 +02:00
04b3d630fe update to ignore appsettings.migration.json 2025-09-29 16:45:55 +02:00
d39a3d283d bump to 3.4.1 2025-09-29 16:18:51 +02:00
7cae9a5291 feat(pdf): add overload for Page to apply design across all pages
- Introduced Page(Action<PdfPage>) method to apply design logic to every page in the document
- Simplified Background method by replacing per-page iteration with new Page overload
- Improved readability and maintainability by removing duplicate page loop logic
2025-09-29 15:43:55 +02:00
6f31d7b1d0 refactor(pdf): optimize background rendering with single concat per page
- Added `System.Linq` import to enable distinct and ordered page index selection
- Applied `ConcatMatrix` transformation once per page instead of per signature
- Improved performance and reduced redundant operations in `Background` method
2025-09-29 15:06:24 +02:00
06431028cb refactor(EnvelopeLocked): add if smsExpiration-statetment to timer script 2025-09-29 14:04:24 +02:00
eafcd79749 create appsettings.Logging 2025-09-29 10:58:34 +02:00
78473a45f1 move TFARegParams to appsettings.Security 2025-09-29 10:55:31 +02:00
5c10636e37 refactor(appsettings.GSM): create and move GtxMessagingParams 2025-09-29 10:50:42 +02:00
91c8043a23 refactor: move TFARegParams to appsettings.UI 2025-09-29 10:48:36 +02:00
5e77b300d6 fix: add PSPDFKitLicenseKey 2025-09-29 10:46:01 +02:00
ec30c86da1 move DisableMultiLanguage parameter to UI 2025-09-29 10:37:27 +02:00
341cb175a9 refactor(appsettings): add appsettings.Security 2025-09-29 10:34:52 +02:00
cccbb36f94 refactor(appsettings.UI): add appsettings for UI 2025-09-29 10:26:21 +02:00
c75877b19e add appsettings.Database 2025-09-29 10:08:57 +02:00
dde855a08f refactor(appsettings.Mail): create to hold mail and message configurations 2025-09-29 09:54:17 +02:00
247ab38536 refactor(appsettings.Annotation): create to handle Annotation para,eters 2025-09-29 09:39:47 +02:00
737df03f01 refactor(Program): update to scan all appsettings.*.json's 2025-09-29 09:26:23 +02:00
7e1ef838d7 chore(Web): bump to 3.4 2025-09-26 16:38:35 +02:00
16657f6a31 refactor(Pdf): Add Background-method to place a background behind the signatures. 2025-09-26 16:00:25 +02:00
bf0bd8e9e7 refactor(ISignature): create to handle common properties of a signature
- implement to entity and dto
2025-09-25 16:14:59 +02:00
94ce416aa1 refactor(Pdf); rename OutputStream as ExportStream
- rename ToBytes extension method as ExportAsBytes
2025-09-25 12:52:50 +02:00
7964cc44fb refactor(Extensions): add ToBytes shortcut method 2025-09-25 12:47:03 +02:00
b0b734ecfb refactor(Edit): rename as Pdf
- add Page and Design methods as shortcut methods
2025-09-25 11:06:03 +02:00
2d6347ffa6 refactor(Edit): Dokument-Methode zum Bearbeiten von PDF-Dokumenten hinzufügen 2025-09-25 10:19:11 +02:00
ac29fac88d add OutputStream getter 2025-09-24 17:49:15 +02:00
54c21556f6 refactor(Edit): add Finalizer region 2025-09-24 16:08:59 +02:00
ed4fd6ce96 feat(Edit): created to handle pdf edit operations fluently 2025-09-24 16:07:51 +02:00
0fa641c15d feat(Extensions): Add PDF editing extension methods using iText
- Introduced `Edit` extension methods for `Stream` and `byte[]` to allow
  in-place PDF modifications via a `PdfDocument` action.
- Supports both .NET and .NET Framework projects.
- Ensures proper disposal of streams and PdfDocument instances.
2025-09-24 14:12:35 +02:00
8709bd5c2e feat(PdfEditor): Erstellen ein PDF-Bearbeitungsprojekt, das sowohl .NET als auch das .NET Framework unterstützt. 2025-09-24 13:08:56 +02:00
7a6f2a3304 refactor(EnvelopeController): remove unnecessary document assigment 2025-09-24 10:07:51 +02:00
b5d744c1cd fix(annotation): invoke sigature background creation to fix z-index problem 2025-09-23 19:25:09 +02:00
a1f4898c35 refactor(annotation.js): split to regions 2025-09-23 18:08:08 +02:00
841cc4fd8d refactor(annotations.js): update createAnnotations to return signatures and remove instance input 2025-09-22 17:19:00 +02:00
e2df610544 refactor(EnvelopeController): update EnvelopeReceiverReadOnly to use without then-calback-method 2025-09-22 13:26:09 +02:00
95fd16fff0 Download the relevant Google font locally 2025-09-22 12:52:12 +02:00
4fcef41fc0 minimize return statement 2025-09-19 15:28:11 +02:00
9a2959b307 remvoe createElementFromHTML 2025-09-19 15:26:20 +02:00
d51c7ac5ae convert to function 2025-09-19 15:23:40 +02:00
925187e294 remove UI class to simplify 2025-09-19 15:22:48 +02:00
80c6b5bc64 update signatureCount to init in constructor 2025-09-19 15:18:50 +02:00
7d4106d0a5 refactor(app): simplify App initialization and rename PSPDFKit instance
- Initialize `currentDocument` and `currentReceiver` directly in constructor
- Replace `Instance` with `pdfKit` for clearer naming
- Remove redundant envelope/document loading in `init`
- Update all method references to use `this.pdfKit`
2025-09-19 15:16:59 +02:00
3b9b930b82 remove ActionType object 2025-09-19 15:07:24 +02:00
9ec6fcf272 update to use roload instead of rejection redirection 2025-09-19 15:03:23 +02:00
c38a50af34 make env.xsrfToken lazy loading
- remove env.envKey
2025-09-19 14:58:14 +02:00
877c88d52b refactor: replace repeated GET+JSON parsing with reusable getJson helper 2025-09-19 13:58:07 +02:00
9c730e8f42 refactor(api-service): rename as envelope-api 2025-09-19 13:53:12 +02:00
7a1c669fb0 move getAnnotationParams to api-service
- remove network.js
2025-09-19 13:50:19 +02:00
62411b4d2b move logout-method to api-service 2025-09-19 13:36:47 +02:00
f04fcde7b9 move setLanguage to api-service 2025-09-19 13:32:01 +02:00
2a352265a8 freeze env and url objects 2025-09-19 13:18:45 +02:00
ceff62cb64 refactor: unify and simplify request helper methods
This commit:
- Replaces `createRequest`, `createPost`, and `submitForm` with a single `sendRequest` helper.
- Adds `getRequest` and `postRequest` wrappers for clarity.
- Removes redundant content type constants and parameters.
- Updates envelope-related methods (`signEnvelope`, `rejectEnvelope`, `shareEnvelope`) to use the new request helpers.
- Simplifies `redirect` and `redirRejected` functions.
2025-09-19 13:16:48 +02:00
f1f4c6eaef create envelope region 2025-09-19 11:52:37 +02:00
f8297808ec create request helper methods region 2025-09-19 11:50:25 +02:00
0fc6fd650c refactor(postAnnotation): rename as signEnvelope 2025-09-19 11:49:14 +02:00
13af2ae3e1 refactor: move postAnnotations to ap-service 2025-09-19 11:47:49 +02:00
3914b827fb refactor(url): convert getter methods to variables 2025-09-19 11:44:23 +02:00
a5ab217ac6 refactor(env): remove lazy loading to simplfy 2025-09-19 11:42:37 +02:00
4075739522 Split the URL into two objects as URL and environment 2025-09-19 11:41:41 +02:00
8abf8260bf update to use lazy loading 2025-09-19 11:35:07 +02:00
451e7e7daa feat(lazy): created to handle lazy loading 2025-09-19 10:36:14 +02:00
6622442d95 convert to camel case 2025-09-19 10:20:23 +02:00
dcd5dc71de covnert Url to object 2025-09-19 10:07:38 +02:00
3fe09f8382 rename API as Url 2025-09-19 10:06:09 +02:00
bac9aebbc3 refactor(api): replace arrow functions with function declarations and simplify defaults
- Removed unused Content class
- Converted async arrow functions to standard function declarations
- Added default 'application/json' for createRequest and createPost
- Improved readability and consistency across API helpers
2025-09-19 09:59:57 +02:00
a8a73724e6 refactor(EnvelopeController): add logic to check the claims with role 2025-09-18 20:48:09 +02:00
8059e0aae4 remove old routes 2025-09-18 19:53:09 +02:00
4c5116695b remove envelope receiver id input 2025-09-18 19:51:43 +02:00
ffa31fbebc change LogInEnvelope route 2025-09-18 18:37:10 +02:00
e536e523b8 fix(EnvelopeController): rename CreateEnvelopeLockedView as EnvelopeLocked 2025-09-18 18:35:37 +02:00
1d64c19605 add cancelation token 2025-09-18 18:19:22 +02:00
29e6ba8733 Refactoring (EnvelopeController): Vereinheitlichung der Verarbeitung von gesperrten Ansichten
- Methode „CreateEnvelopeLockedView” hinzugefügt, um die Logik für die Anzeige gesperrter/umschlossener Ansichten zu zentralisieren
- Aktion „Main“ aktualisiert, um „CreateEnvelopeLockedView“ anstelle von Redirect zu verwenden
- Veraltete Methode „EnvelopeLocked“ entfernt
- TFA-bezogene Ansichten und Handler aktualisiert, um auf „CreateEnvelopeLockedView“ anstelle von „EnvelopeLocked“ zu verweisen
- Dokumentenlade- und Anmeldelogik in wiederverwendbare Methoden vereinfacht
2025-09-18 18:18:59 +02:00
2e6eeafd74 refactor(EnvelopeController): add read-only region 2025-09-18 17:22:40 +02:00
643501f484 refactor(EnvelopeController): simplify EnvelopeController actions and view handling
- Added overload of CreateShowEnvelopeView(EnvelopeReceiverDto) to remove redundant id parsing logic
- Refactored EnvelopeLocked action to receive EnvelopeReceiverDto directly instead of fetching inside
- Centralized ViewData assignments for cleaner envelope rendering
- Improved error logging to include envelope UUID and receiver signature where applicable
- Adjusted EnvelopeLocked GET to return explicit "EnvelopeLocked" view for unauthenticated users
2025-09-18 17:14:28 +02:00
0c900d219c refactor(EnvelopeController): add Send Access Code-region 2025-09-18 16:19:40 +02:00
8d8757810c refactor(EnvelopeController): move rejection and signing check to Main-endpoint 2025-09-18 16:15:33 +02:00
9dec681ce5 Home und View in Home und Envelope unterteilen 2025-09-18 14:01:21 +02:00
01ec2b3df2 refactor(HomeController): Als Home- und Envelope-Controller aufteilen 2025-09-18 13:16:33 +02:00
d64d46920a refactor(api-services): change wrong url route 2025-09-18 12:59:01 +02:00
6147a619a8 refactor(EnvelopeReceiverReadOnly): fix nullability problem 2025-09-18 12:33:00 +02:00
6327fef2e0 chore(Web): bump to 3.3.0 2025-09-17 17:48:58 +02:00
d0bfe795d7 refactor(HomeController): Ändern Sie den Routenparameter „EnvelopeReceiverReadOnly” von einem String-Schlüssel zu einer langen ID
- Aktualisieren Sie „MainAsync”, um mit einer geparsten schreibgeschützten ID anstelle eines String-Schlüssels zu „EnvelopeReceiverReadOnly” umzuleiten
- Ändern Sie die Aktionssignatur „EnvelopeReceiverReadOnly”, um „long readOnlyId” anstelle von „[FromRoute] string readOnlyKey” zu akzeptieren
- Inline-Schlüssel-Decodierungs-/Validierungslogik entfernt und Decodierung an `MainAsync` delegiert
- Protokollmeldungen angepasst, um `ReadOnly-Id` anstelle von `ReadOnly-key` widerzuspiegeln
2025-09-17 13:59:31 +02:00
10b1de4cf0 remove envelopeRejected-endpoint 2025-09-17 13:17:25 +02:00
cf3535b4de refactor(HomeController): remove envelopeSigned endpoint 2025-09-17 13:07:06 +02:00
56074c2b9f refactor(HomeController): add fromRoute attributes 2025-09-17 10:49:18 +02:00
c41c521fca rename postEnvelope as postAnnotation 2025-09-17 10:40:17 +02:00
7bc6cc92a0 remove setLangAsync-method 2025-09-17 10:37:43 +02:00
660a4c24df refactor(EnvelopeController): Umbenennen in AnnotationController 2025-09-17 10:35:11 +02:00
5d65f58a55 feat(EnvelopeController): sign out user after envelope actions
- Added `HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme)`
  to `CreateOrUpdate` and `Reject` endpoints in `EnvelopeController`
- Ensures user session is cleared after completing or rejecting envelope actions
- Updated using directives to include `Microsoft.AspNetCore.Authentication`
  and `Microsoft.AspNetCore.Authentication.Cookies`
2025-09-17 10:31:09 +02:00
6691471276 fix(pdfburner): correct y-position adjustment for signature seal annotations
Previously, image annotations for signature seals used a static yOffset
when combined with ink annotations, which caused positioning issues.
This change calculates the y-position of the signature annotation
relative to the next annotation and applies it only for the first seal.

- Added `yPosOfSigAnnot` calculation for precise vertical placement.
- Updated `AddInstantJSONAnnotationToPDF` to overwrite bbox.y for seals.
- Removed hardcoded ink offset logic.
2025-09-16 17:37:20 +02:00
b2bfc11713 change the y-offset of ANNOTATION_TYPE_IMAGE 2025-09-16 16:54:44 +02:00
5d758601b9 Merge branch 'master' of http://git.dd:3000/AppStd/EnvelopeGenerator 2025-09-16 11:28:32 +02:00
Developer01
210bb821da DocResult-Column was defined wrong. Correct: DOC_RESULT 2025-09-16 09:02:38 +02:00
Developer01
3ac61e75f5 ReceiverVM Vereinheitlichung 2025-09-16 08:05:50 +02:00
eb353ab772 chore(Web): bump to 3.2.3 2025-09-15 15:51:10 +02:00
991943d6bd refactor(SendMailHandler): remove TextToHtml 2025-09-15 14:23:48 +02:00
b5fec7bb46 refactor(DocSignedNotificationTests): add again EmailOut DbRepository using Fake.EGDbContext2Prod
- create base EGDbContextBase to be able to add custom DbContextOptions
2025-09-15 14:02:58 +02:00
9eaa777fb6 feat(Fake): enhance Fake host with production DbContext support
- Added `EGDbContext2Prod` class to allow connecting to production database in tests
 - Updated `CreateHost` to register `EGDbContext2Prod` with SQL Server connection string
 - Added `EnvelopeGenerator.Application.Common.Configurations` and logging support
 - Refactored service registration ordering for clarity
2025-09-15 13:18:30 +02:00
ccc4e948f3 feat(TestBase): seed real email templates in TestBase setup
- Added `RealEmailTemplates` property with predefined email templates.
- Populated the repository with these templates in the `Setup` method.
- Ensures tests have consistent, realistic email data available.
2025-09-15 12:44:36 +02:00
d5afb2201c refactor(DocSignedNotificationTests): DocSignedNotificationTests aktualisieren, um SendSignedMailHandler zu verwenden
- SendSignedMailHandler in Testdiensten registrieren
- Test1 umbenennen → SendSignedMailHandler_ShouldNotThrow
- Sicherstellen, dass die Handler-Ausführung keinen Fehler auslöst
2025-09-15 11:18:44 +02:00
7fbf0ebbfc refactor(TestBase): add ConfigureServices-callback method to be able to add custom services to testes 2025-09-15 11:00:00 +02:00
cb0c361cdb test: enhance DocSignedNotificationTests with AutoMapper and notification mapping 2025-09-15 10:48:25 +02:00
796c59cd38 chore: update Core.Abstraction.Application to 1.3.1
- update DigitalData.Core.Abstractions to 4.1.1
 - update DigitalData.Core.Infrastructure to 2.4.1
2025-09-15 10:38:01 +02:00
86780477fe refactor(Fake): update CreateReceiverCommand to be able to add email address 2025-09-12 14:19:57 +02:00
27a2d5ecc4 refactor(DIExtensions): update to scan EmailProfilerDispatcher 2025-09-12 13:50:48 +02:00
83460bd92b refactor(DIExtensions): update dependecy inejction to scan assemblies 2025-09-12 13:40:53 +02:00
b8bffdb4bc chore: update package versions and to solve vulnerabilities 2025-09-12 13:21:28 +02:00
df66060de3 bump to 3.2.2 2025-09-11 09:29:34 +02:00
4da7445271 remove removed reference 2025-09-11 09:25:22 +02:00
0a9e1dccb9 refactor(Interfaces): move Interfaces to Common 2025-09-10 16:42:52 +02:00
95b54fa1f1 feat(JsonExtensions): create to be able to make fluent Json serilization 2025-09-10 15:55:56 +02:00
e990a466aa refactor(AnnotationHandler): update to use System.Text.Json.JsonSerializer 2025-09-10 15:38:05 +02:00
4eb6d87770 add MsgBox 2025-09-10 15:02:19 +02:00
e2c3d4ad52 init DocSignedNotificationTest 2025-09-10 14:21:14 +02:00
a9dda12bf9 chore(Web): bump to 3.2.1 2025-09-10 14:08:27 +02:00
fd157c4443 refactor(ReadEnvelopeReceiverQuery): add receiver filter to signatures 2025-09-10 14:04:48 +02:00
f940caad1c chore(Web): bump to 3.2.0 2025-09-10 13:42:08 +02:00
6b89b9bbf2 refactor(ModifyDocStatusCommandBase): add EnvelopeId and ReceiverId properties 2025-09-09 23:15:19 +02:00
83ff3da795 fix(ReceiverAlreadySignedQuery) 2025-09-09 21:57:59 +02:00
5bb3341f43 refactor(JsonSerializerSettings): set Ignore ReferenceLoopHandling 2025-09-09 20:39:21 +02:00
7568274c77 refactor(ReceiverSecretDto): remove 2025-09-09 20:32:35 +02:00
c59b179a8f merge with EnvelopeReceiverBasicDto 2025-09-09 20:05:34 +02:00
248c5bce5a refactor(Common.Model): rename as Common.Query 2025-09-09 19:39:50 +02:00
c76a772768 fix references 2025-09-09 19:23:04 +02:00
3ba7bfd15a refactor(EnvelopeHistoryDto): rename HostoryDto 2025-09-09 19:01:20 +02:00
e8f2c868b1 refactor(EnvelopeHistory): rename as History 2025-09-09 18:58:58 +02:00
ae669d05e7 refactor(EnvelopeDocument): rename as Document 2025-09-09 18:56:55 +02:00
fbbc05814f refactor(DocumentReceiverElementDto): rename as SignatureDto 2025-09-09 18:56:18 +02:00
ec57906290 refactor(EnvelopeDocumentDto): rename as DocumentDto 2025-09-09 18:52:58 +02:00
fbfc20705d refactor(Extensions): move to common 2025-09-09 18:26:06 +02:00
895eb8977e refactor(Notifications): move to Common 2025-09-09 18:24:42 +02:00
428f45bff1 refactor(Model): move to Common 2025-09-09 18:22:31 +02:00
9339f24bf1 refacor(EnvelopeFlag): move to Common 2025-09-09 18:21:24 +02:00
390cbf9db5 refactor(Dto): move to common 2025-09-09 18:18:47 +02:00
570a192438 refactor(Configurations): move to common 2025-09-09 18:17:39 +02:00
c8a0264ed8 refactor(SQL): move to common 2025-09-09 18:17:00 +02:00
207bc8bcbd convert csrfToken to get method 2025-09-09 18:11:14 +02:00
1ac2a476d2 refactor(DocumentReceiverElementDto): remove Top and Left-properties 2025-09-09 16:55:34 +02:00
Developer 02
41f5d9f1e4 refactor: make CreateShowEnvelopeView and SignInEnvelopeAsync generic method 2025-09-09 14:08:20 +02:00
2ae6dda27e refactor(EnvelopeMailService): remove SendTFAQrCodeAsync method 2025-09-08 17:41:34 +02:00
e5a25c5893 refactor(EnvelopeReceiverDto): add option to make Receiver property generic 2025-09-08 17:32:00 +02:00
7d0648ede4 Um den Receiver in ReceiverSecretDto umwandeln zu können, fügen Sie ein Mapping-Profil hinzu. 2025-09-08 17:25:40 +02:00
bb6ca82289 feat(ReceiverSecretDto): ReceiverDto wurde so hinzugefügt, dass es vererbt wird.
- Die Eigenschaft TotpSecretkey wurde aus ReceiverDto entfernt.
 - Die Eigenschaft TotpSecretkey wurde zu ReceiverSecretDto hinzugefügt.
2025-09-08 17:23:20 +02:00
ed7068fe71 refactor(ReceiverReadDto): rename as ReceiverDto 2025-09-08 17:19:38 +02:00
876c5def56 fix(Extensions): update to add suffix 2025-09-08 16:53:44 +02:00
40697435ff fix(EnvelopeDto): convert type of Status-property to EnvelopeStatus 2025-09-08 16:20:16 +02:00
b43399ad01 fix(EGDbContext): add Envelope-property to Envelope-History relation definition on model builder 2025-09-08 16:16:22 +02:00
f41f26b810 refactor(DocumentReceiverElement): make AddedWhen nullable and add ChangedWho-property 2025-09-08 15:00:02 +02:00
442b7f7451 refactor(EGDbContext): split to regions 2025-09-08 13:03:12 +02:00
beada59593 refactor(HomeController): update EnvelopeLocked to use _mediator 2025-09-08 12:58:29 +02:00
b78aff102a remove then-calback method implementation on EnvelopeLocked-endpoint. 2025-09-08 11:55:08 +02:00
67f068ef38 refactor(Envelope): rename Receivers property as EnvelopeReceivers 2025-09-08 11:48:54 +02:00
122df4bd62 chore: remove DevExpress.Data.v21.2 and GdPicture.NET.14 2025-09-08 11:32:53 +02:00
741ebc8975 minify js 2025-09-05 15:01:29 +02:00
ada76d5030 refactor(HomeController): add SetLanguage and GetLanguages endpoints 2025-09-05 14:42:04 +02:00
845d06fc4c refactor(HomeController): add HttpGet-attribute to Error404 (fallback) endpoint 2025-09-05 14:32:22 +02:00
59105caffc fix(pdf-burner): Korrektur des Versatzes von Siegelbildern für Tintenunterschriften
- Hinzufügen des Parameters „yOffset“ zu „AddImageAnnotation“, um die Position der Siegel anzupassen.
- Aktualisierung von „AddInstantJSONAnnotationToPDF“, um den Versatz für das erste Unterschriftssiegel anzuwenden.
- Stellt sicher, dass Tintenunterschriftssiegel in PDF-Dateien korrekt dargestellt werden, ohne andere Anmerkungen zu beeinträchtigen.
2025-09-05 13:25:25 +02:00
fa8d2f5f62 feat(pdfburner): Berechnung für Anmerkungsindex innerhalb der Signaturgruppe hinzufügen 2025-09-05 11:26:09 +02:00
dbf42e13d9 feat(pdfburner): Berechnung des Signaturindexes bei der Anmerkungsverarbeitung hinzugefügt
- Variablen `annotCountPerSign`, `annotIndex` und `calcSignIndex` eingeführt
- Berechnung von `signIndex` während der Anmerkungsiteration hinzugefügt
- Bestehende Logik für Bild-, Tinten- und Widget-Anmerkungen beibehalten
2025-09-05 11:01:36 +02:00
e48a86e21c feat: add EnvelopeKeyRedirController to redirect /EnvelopeKey/{*path} to /Envelope/{*path} 2025-09-04 23:44:01 +02:00
1e6c9ed40e refactor(HomeController): ranme EnvelopeKey route as Envelope 2025-09-04 23:38:11 +02:00
1d605e9da3 fix(EnvelopeController): remove envelopeKey route parameter 2025-09-04 23:17:24 +02:00
77070a8cfc convert csrfToken constan variable 2025-09-04 23:07:32 +02:00
c479ea4179 remove README.md from static files 2025-09-04 19:10:31 +02:00
369d101d7b refactor(network): Netzwerkklasse entfernen und Methoden statisch machen.
- Unnötige Funktionen entfernen.
2025-09-04 19:09:21 +02:00
86eb687296 remove npm components of bootstrap-icons 2025-09-04 19:01:41 +02:00
aa8f46a303 remove old envelope srrvice dependencies 2025-09-04 18:56:02 +02:00
2c825d2fe3 update post Envelope to handle without object 2025-09-04 18:45:00 +02:00
1e1517f88a refactor(EnvelopeController): remove EnvelopeOldService 2025-09-04 18:01:01 +02:00
124523ad88 configure attributes 2025-09-04 17:46:16 +02:00
9c48b230b4 convert PlaceHolders-property to CreatePlaceHolders callback-method 2025-09-04 17:01:40 +02:00
95fe1aefcf merge placeholders dictionary 2025-09-04 16:45:56 +02:00
1b7a42fd7e remove cancelation token from ConfigEmailOut 2025-09-04 16:41:26 +02:00
73da768ed3 update ConfigEmailOut to add notifications 2025-09-04 09:28:13 +02:00
f20243d02c update to configure email out 2025-09-03 18:39:33 +02:00
c1c30caeec init EmailOut 2025-09-03 17:55:50 +02:00
5ccd1fee26 init SendMailHandler to read tempalte and replace placeholders 2025-09-03 17:46:24 +02:00
954d665ac3 remove unnecessary references 2025-09-03 16:58:07 +02:00
bb85437cc4 arrange folder structure of notification 2025-09-03 16:57:25 +02:00
763f022a5e add history handler 2025-09-03 16:42:32 +02:00
f87f8a1d17 refactor(DocSignedNotificationStatusHandler): rename as DocSignedNotificationAnnotationHandler 2025-09-03 16:31:14 +02:00
fb5d2110bd add DocSignedNotificationStatusHandler and implement the natification into EnveloepControler 2025-09-03 16:24:51 +02:00
aafed0f4f4 init DocSignedNotificationStatusHandler 2025-09-03 15:47:37 +02:00
a433654f86 refactor(DocSignedNotification): Aktualisierung, um von EnvelopeReceiverDto zu erben.
- Erweiterungsmethoden für die Zuordnung hinzufügen.
2025-09-03 15:38:41 +02:00
b599ada864 add DocSignedNotification 2025-09-03 15:17:03 +02:00
6b00ab6a45 refactor(SaveDocStatusCommand): update to return DocumentStatusDto. 2025-09-03 13:03:09 +02:00
6ab85f25eb refactor(SignDocBehavior): add to handle the events after document status updateted 2025-09-03 12:49:16 +02:00
fa46dd1fa8 feat(Format): create to centrilize the formats.
- Add json serializer settings for diagnostics and implement to DocumentController
2025-09-03 11:06:47 +02:00
e623680c3f refactor(DocumentController): migrate from legacy service to MediatR pattern
- Replace obsolete DocumentController implementation using EnvelopeOldService and direct dependencies
- Migrate to MediatR-based query handling via ReadEnvelopeReceiverAsync
- Remove obsolete constructors and actions marked for deprecation
- Add proper error handling with NotFoundException for missing envelope or document data
- Improve logging with structured JSON output for diagnostics
- Update base class from BaseController to ControllerBase and add ApiController attribute
- Rename action to GetDocument and apply explicit HttpGet routing
- Use IMediator for clean separation of concerns and alignment with CQRS pattern
2025-09-03 10:51:34 +02:00
f6e34c6d91 refactor(HistoryTests): Verbesserung von HistoryTests mit realistischen Daten und konsistenter Struktur
- Verwendung tatsächlicher Umschlag- und Empfängerdaten anstelle von magischen Zahlen
- Ersetzen von fest codierten EnvelopeId und UserReference durch dynamisch erstellte Entitäten
- Aktualisierung von ReadHistoryQuery zur Verwendung der Objektinitialisierungssyntax
- Fügen Sie CancellationToken zu Mediator.Send-Aufrufen hinzu, um Konsistenz zu gewährleisten
- Verwenden Sie EnvelopeHistoryDto explizit in der Assertion
- Verbessern Sie die Lesbarkeit und den Realismus des Tests, indem Sie vollständige Voraussetzungdaten einrichten
- Korrigieren Sie die Schreibweise im Kommentar: „EnvelopeReceiver” -> „envelope receiver”
2025-09-03 10:08:42 +02:00
fc443fb87f refactor(ReadHistoryQuery): Aktualisierung zur Verwendung von getter-initter. 2025-09-03 09:34:12 +02:00
1c9d0a6c47 refactor(MappingProfile): update to ignore Envelope, Sender and Receiver 2025-09-02 23:58:35 +02:00
23ec4fe322 remove re-read process 2025-09-02 23:14:16 +02:00
8ca0519dbc feat(history): CreateHistoryCommand wurde verbessert, um DTO zurückzugeben und den Empfänger zu validieren.
- Der Rückgabetyp des Handlers wurde von „long?“ zu „EnvelopeHistoryDto?“ geändert.
 - AutoMapper-Integration für die Zuordnung von EnvelopeHistory zu DTO hinzugefügt.
 - IRepository<EnvelopeReceiver> zur Validierung der Benutzerreferenz eingeführt.
 - Validierung implementiert, um sicherzustellen, dass genau ein Empfänger gefunden wird.
 - BadRequestException-Behandlung für fehlende oder mehrere Empfänger hinzugefügt.
2025-09-02 23:11:41 +02:00
c67bac3e16 test(history): Aktualisieren Sie HistoryTests, um die Erstellung von Umschlägen auf Repository-Basis zu verwenden. 2025-09-02 18:48:18 +02:00
6cdd1db7a9 feat(Fake): add extension method to Fake to create Envelope 2025-09-02 15:25:59 +02:00
a87a524271 feat(MappingProfile): UUID-Generierung beim Zuordnen von CreateEnvelopeCommand zu Envelope hinzufügen 2025-09-02 12:19:06 +02:00
ddb2439b29 add mapping profile to convert CreateEnvelopeCommand to Envelope 2025-09-01 17:30:38 +02:00
d48514bbad refactor(Extensions): update CreateEnvelopeCommand to make UseSQLExecutor false 2025-09-01 17:27:14 +02:00
00077a647a feat(envelopes): add support for SQLExecutor or repository when creating envelopes
- Refactored `CreateEnvelopeCommandHandler` to resolve dependencies via `IServiceProvider`
- Added `IRepository<Envelope>` to allow repository-based envelope creation
- Updated handler logic to choose between `IEnvelopeExecutor` and repository based on `UseSQLExecutor` flag
2025-09-01 17:23:40 +02:00
ee7eb08e75 refactor(CreateEnvelopeCommand): add UseSQLExecutor-property 2025-09-01 17:07:16 +02:00
6a34b65825 rename as ToEnvelopeKey 2025-09-01 15:43:13 +02:00
20d312a84e update to create key by EncodeEnvelopeReceiverId 2025-09-01 15:42:33 +02:00
87c5e7e4de feat(HistoryTests): add create receiver logic 2025-09-01 15:27:32 +02:00
bb93b980b4 refactor(HistoryTests): create and implement TestBase 2025-09-01 15:19:52 +02:00
950ae5a418 Update HistoryTests with new commands and setup changes
- Added new using directives for additional namespaces.
- Replaced `_host.AddSampleReceivers()` with `_host.AddSamples()` in the Setup method.
- Introduced `createEnvelopeCmd` in the test method to create an envelope before executing the history command.
2025-09-01 15:06:10 +02:00
582cc1eb13 Refactor CreateHistoryCommand and update tests
- Simplified `CreateHistoryCommand` method by removing generic type parameters.
- Updated `using` directives in `HistoryTests` to include necessary constants.
- Revised test method to utilize `Fake.Provider.CreateHistoryCommand` for improved maintainability.
2025-09-01 14:52:49 +02:00
9434f83b3e Refactor EnvelopeReceiver and History controllers
- Added using directive for EnvelopeGenerator.Domain.Constants.
- Updated ignore_statuses type in EnvelopeReceiverController.
- Improved resource management with using statements for SqlConnection and SqlCommand.
- Changed from Array.Empty<Signature>() to Enumerable.Empty<Signature>() for better performance.
- Simplified GetEnvelopeStatus method in HistoryController by using Status directly.
2025-09-01 14:21:53 +02:00
bbe93dad45 Refactor Receiver handling to use ReceiverVM
Updated ReceiverModel and EnvelopeEditorController to utilize ReceiverVM instead of Receiver in multiple function signatures. This change enhances the structure and flexibility of receiver data handling. Adjusted related methods in frmEnvelopeEditor to align with the new view model approach.
2025-09-01 13:53:09 +02:00
0a876fe486 Refactor EnvelopeEditorController for type consistency
- Updated constructor to cast receivers to EnvelopeReceiver.
- Changed ResendReceiverInvitation parameter from Receiver to ReceiverVM.
- Modified ValidateEnvelopeForSending to use EnvelopeReceiver and correct ID for validation.
2025-09-01 13:47:32 +02:00
a584a548d6 Refactor InsertReceiver method in EnvelopeEditorController
Removed conditional check for receiver ID in InsertReceiver.
The method now always attempts to insert the receiver,
simplifying the logic and ensuring consistent behavior.
2025-09-01 13:27:38 +02:00
3e3c9d4c54 Refactor Receiver to ReceiverVM in EnvelopeEditor and Main
Updated the `oReceiver` variable type from `Receiver` to `ReceiverVM` in the `frmEnvelopeEditor` and `frmMain` classes to align with a view model pattern. Modified the `Controller.DeleteReceiver` method to use `oReceiver.Receiver`, reflecting the new structure. Additionally, created `BindingList` of `ReceiverVM` to support a more MVVM architecture.
2025-09-01 13:00:03 +02:00
33fa4b76f5 Refactor receiver handling and update solution structure
- Updated `BaseController.vb` to use `Receiver.Id` for deletion.
- Changed `Receivers` property in `frmEnvelopeEditor.vb` to `BindingList(Of ReceiverVM)` and adjusted initialization and usage throughout the file.
- Modified `frmFieldEditor.vb` to use `List(Of ReceiverVM)` for receivers and updated related methods.
- Adjusted color assignment logic in `frmMain.vb` to utilize a new `Value` class.
- Added new project for `EnvelopeGenerator.Form` in the solution file.
- Introduced new enums `ContractType` and `PageOrientation` in their respective files.
2025-09-01 12:55:15 +02:00
7a84726a3b Refactor constant imports and enhance safety checks
Updated constant imports from static to regular usage across multiple controllers.
Improved null safety in `DebugEnvelopes.cshtml` by ensuring the `Receivers` property is not null before access.
Modified authorization attribute in `DocumentController.cs` to directly reference `Domain.Constants.ReceiverRole.FullyAuth`.
2025-09-01 11:31:39 +02:00
27d97ed12a Add constants import and refactor PDF burner params
- Added import for `EnvelopeGenerator.Domain.Constants` in
  `Scheduler_Envelopetask_API.vb` and `Scheduler_FinishEnvelope.vb`
  to access necessary constants.

- Updated the key for `_pdfBurnerParams` in
  `Scheduler_FinishEnvelope.vb` from
  `Domain.Constants.PDF_BURNER_PARAMS` to
  `Value.PDF_BURNER_PARAMS` for better organization.
2025-09-01 11:24:23 +02:00
f699e5a9aa Refactor constant references across multiple files
Updated import statements and changed references from
`Domain.Constants` to `Value` in `APIEnvelopeJob.vb`,
`FinalizeDocumentJob.vb`, `HistoryModel.vb`, `EmailService.vb`,
and job scheduling files. This standardizes constant access
and improves code maintainability and readability.
2025-09-01 11:20:57 +02:00
dc723d9f02 Refactor envelope status handling and imports
Updated `EnvelopeStatus` type in place of `EnvelopeStatusQuery` across multiple files, enhancing the domain model. Added `using` directives for `EnvelopeGenerator.Domain.Constants` in several files, improving clarity and maintainability. Modified import statements in Visual Basic files and repository classes to standardize imports. Overall, these changes aim to refine the structure and clarity of the codebase.
2025-09-01 11:17:27 +02:00
48ce0d5f32 Refactor EnvelopeStatus usage and streamline code
- Added `EnvelopeGenerator.Domain.Constants` in multiple files, replacing `Domain.Constants.EnvelopeStatus` with `EnvelopeStatus` for improved readability.
- Modified `CreateEnvelopeCommandHandler.cs` to directly use `request.UserId`, eliminating unnecessary local variable assignment.
- Identified potential duplication in query logic within `ReceiverAlreadySignedQuery.cs`.
- Updated `IEnvelopeService`, `EnvelopeReceiverService`, and `EnvelopeService` to ensure consistent usage of the simplified `EnvelopeStatus`.
- Overall, these changes enhance code maintainability and clarity.
2025-09-01 11:11:30 +02:00
ef7e694c9f refactor(Application.Envelopes.Queries.EnvelopeStatus): rename as EnvelopeStatusQuery 2025-09-01 11:06:41 +02:00
c5c040fb15 Refactor enum usage in codebase
Updated references from `Constants` to direct usage of `EnvelopeStatus` and `EmailTemplateType` enums. This change enhances code readability and reduces dependency on the `Constants` class.

Modified properties and parameters across command classes, DTOs, repositories, and services to use the enums directly. Updated `ModifyDocStatusCommandBase`, `EnvelopeHistoryDto`, and `ResetEmailTemplateCommand` for improved clarity.

Consistent updates across multiple files indicate a systematic refactoring aimed at streamlining the codebase and improving maintainability. Comments and documentation have also been revised to reflect these changes.
2025-09-01 11:04:40 +02:00
fc4187bb9e Refactor constants and update CreateHistoryCommand
Updated `CreateHistoryCommand.cs` to use the `EnvelopeStatus` enum directly from the `EnvelopeGenerator.Domain.Constants` namespace. Refactored `Constants.cs` to consolidate multiple enums related to statuses, types, and roles. Modified `Fake.cs` to align with the new enum structure and introduced `Value.cs` for better organization of constant string values. Overall, these changes enhance code clarity and maintainability.
2025-09-01 10:41:36 +02:00
ae4f5560fe Remove unused enums from Constants.cs
This commit removes the `ContractType` and `PageOrientation` enums from the `EnvelopeGenerator.Domain.Constants.cs` file. The `ContractType` enum included values for `Contract` and `ReadAndSign`, while the `PageOrientation` enum included values for `Portrait` and `Landscape`. The `ElementType` and `ColorType` enums remain unchanged.
2025-09-01 10:19:36 +02:00
09eb91b6be Add history command support and enum selection method
- Introduced new using directives for histories and models.
- Added `PickEnum<T>` method to randomly select enum values.
- Renamed region from `#region Envelope Command` to `#region Envelope`.
- Implemented `CreateHistoryCommand<TEnvelopeQuery, TReceiverQuery>` for creating history commands.
- Organized new method under a new region `#region History`.
2025-09-01 10:16:50 +02:00
838d7e3ab8 refactor(ReceiverGetOrCreateCommand): update to use getter inittier 2025-08-29 16:33:01 +02:00
542d80c439 fix(CreateEnvelopeReceiverCommandHandler): remove request.UserId null-check 2025-08-29 16:23:44 +02:00
145a2ebe8f feat(Extensions): add PDF generation support for EnvelopeGenerator tests
- Introduced QuestPDF dependency to generate PDF documents in tests.
- Added `CreatePdfAsBase64` extension method for generating random PDF content.
- Added `CreateDocumentCommand` and `CreateDocumentCommands` helpers for creating document test data.
- Refactored using statements and added `EnvelopeGenerator.Application.EnvelopeReceivers.Commands`.
- Maintains existing sample user and receiver setup for integration testing.
2025-08-29 16:11:14 +02:00
9cf776fa98 fix(CreateEnvelopeReceiverCommand): update to use getter-setter 2025-08-29 15:33:03 +02:00
68878c0fc8 feat(Fake): Erweiterung von Fake.Host um Repository-Zugriff und Unterstützung für Beispielbenutzer
- IRepository<TEntity>-Verknüpfung zum Auflösen von Repositorys hinzugefügt
 - AddSamples()-Hilfsprogramm zum gemeinsamen Initialisieren von Empfängern und Benutzern eingeführt
 - SampleReceivers mit Validierungsüberwachung verbessert
 - Beispiel für Benutzerinitialisierung über Repository mit AddSampleUser() hinzugefügt
 - using-Anweisungen aktualisiert, um DigitalData.Core.Abstraction.Application.Repository und DigitalData.UserManager.Domain.Entities einzubeziehen
2025-08-29 14:57:51 +02:00
d3e5d3d791 refactor(Extensions): add CreateUserCommand and CreateUserCommands 2025-08-29 14:37:24 +02:00
a7f6b94d20 create CreateUserCommand with handler and mapping profile 2025-08-29 14:31:36 +02:00
777f20eddb create faker-extension method for Envelope Commands 2025-08-29 14:00:00 +02:00
c14ffceee4 refactor(CreateEnvelopeCommand): update to generate with getter-setter 2025-08-29 13:41:10 +02:00
e9202ad23e refactor(Fake): Ersetzen der Roh-E-Mail-Generierung durch CreateReceiverCommand-Helfer
- Direkte Verwendung von `Internet.EMailList()` für Beispielempfänger entfernt.
- Erweiterungsmethoden `CreateReceiverCommand` und `CreateReceiverCommands` in `Faker` eingeführt.
- `AddSampleReceivers` aktualisiert, um `CreateReceiverCommands` für eine sauberere, konsistentere Testdatenerstellung zu verwenden.
2025-08-29 13:25:36 +02:00
954eff7101 refactor(tests): replace static sample emails with Bogus-generated random emails 2025-08-29 13:12:33 +02:00
ac501dffb1 fix(Mock): rename Fake 2025-08-29 12:53:03 +02:00
baf2207d03 refactor(Mock): Host-Klasse für csetup erstellen und MediatR integrieren
- Migration zu Microsoft.Extensions.Hosting.CreateDefaultBuilder
- Optionale Parameter und echte DB-Unterstützung in Tests entfernt
- InMemoryDatabase zum Testen hinzugefügt
- MediatR für die Befehlsverarbeitung integriert
- Beispielmethode zum Initialisieren von Empfängern im Test-Host hinzugefügt
2025-08-29 12:46:38 +02:00
6863ada4be feat(HistoryTests): add Receiver to provide random receiver 2025-08-29 11:11:15 +02:00
8a22075abe update to use deconstructed 2025-08-29 11:05:52 +02:00
bcb2e79fa1 feat: Duplikatsprüfung beim Erstellen eines Empfängers hinzufügen
- `CreateReceiverCommand` wurde aktualisiert, sodass nun `(Id, AlreadyExists)` anstelle von nur `Id` zurückgegeben wird.
- Der Handler wurde geändert, um zu überprüfen, ob bereits ein Empfänger mit derselben E-Mail-Adresse vorhanden ist.
- Es wird nur dann ein neuer Empfänger erstellt, wenn dieser noch nicht vorhanden ist.
- `Microsoft.EntityFrameworkCore` wurde für die Abfrageunterstützung hinzugefügt.
2025-08-29 10:58:27 +02:00
c8dae1d8ff test: extend HistoryTests by adding receiver initialization with CreateReceiverCommand 2025-08-29 10:45:00 +02:00
cc2db8716e refactor(CreateReceiverCommand): add handler 2025-08-29 10:25:33 +02:00
b939e19334 move mapping profile 2025-08-29 10:07:45 +02:00
16e769d916 rename UpdateReceiverCommand 2025-08-29 10:04:25 +02:00
befbacad7c move ReceiverUpdateDto 2025-08-29 10:04:04 +02:00
aa1e218b37 remove lazy loading of signature 2025-08-29 10:03:19 +02:00
ab9a6cd595 rename CreateReceiverCommand 2025-08-29 10:02:01 +02:00
8783cb9cd8 move ReceiverCreateDto to commands 2025-08-29 10:01:17 +02:00
e49be2b7c3 make set up Setup 2025-08-29 09:57:57 +02:00
14a565d202 refactor(HistoryTests): Vereinfachung von HistoryTests durch direkte Einbindung von IMediator
- Entfernen der benutzerdefinierten Hilfsmethode Send<T>
 - Einführung der Mediator-Eigenschaft, die aus dem DI-Container aufgelöst wird
 - Ersetzen aller Send(request)-Aufrufe durch Mediator.Send(request)
 - Reduzierung unnötiger Indirektionen, wodurch Tests übersichtlicher und leichter lesbar werden
2025-08-29 09:52:34 +02:00
dc42a76f31 Merge branch 'master' of http://git.dd:3000/AppStd/EnvelopeGenerator 2025-08-29 09:39:08 +02:00
Developer 02
dee58bec4b fix EnvelopeReceiverController 2025-08-28 20:12:16 +02:00
Developer 02
5bd045b998 init HistoryTests 2025-08-28 20:07:34 +02:00
Developer 02
fbbacb30bc remove wrong principal key 2025-08-28 18:47:41 +02:00
Developer 02
0b879b2f5b refactor(Extension): move to Application.Extensions and remove the project.
- update references
2025-08-28 18:46:55 +02:00
Developer 02
a343312f97 refactor(HistoryController): update to use CancellationToken 2025-08-28 18:36:11 +02:00
Developer 02
dad43de8b1 refactor(ReadHistoryQuery): update to not throw exception.
- update controller to throw NotFound if the list is empty
2025-08-28 18:30:27 +02:00
Developer 02
f7c988be9b refactor(ReadHistoryQuery): mvoe HisotryQuery to Queries directory and remove Read dir 2025-08-28 18:20:18 +02:00
Developer 02
e0af5b769d refactor(ReadHistoryQuery): update to use dto and remove response class 2025-08-28 18:15:47 +02:00
Developer 02
b8c348afb6 refactor(ReadHistoryQueryHandler): update to use IRepository<EnvelopeHistory> 2025-08-28 17:52:24 +02:00
79dc4ba599 refactor: remove HasPrincipalKey-statement 2025-08-28 11:05:40 +02:00
3616d43f2e fix(EGDbContext): remove principal key mapping on DocumentStatus.Receiver 2025-08-27 15:24:26 +02:00
d5443b223c fix(EGDbContext); remove Uuid from principal key 2025-08-27 15:12:09 +02:00
c456cb0301 refactor(CreateHistoryCommand); update to use EnvelopeReceiverQueryBase and related extension methods 2025-08-27 14:41:20 +02:00
1c0c23aca4 remove url encoder injection 2025-08-27 11:42:33 +02:00
05d7ac7864 refactor(ReadEnvelopeReceiverQueryHandler): update to use extension method and move to related query class 2025-08-27 11:39:03 +02:00
95e793b081 update read envelope, receiver and envelope-receiver queries to inhered from query-bases 2025-08-27 11:04:30 +02:00
dfa1667939 refactor(ReadDocumentQuery): update to add CancellationToken 2025-08-27 10:50:51 +02:00
Developer 02
8a4d3ff6f9 refactor(SaveDocStatusCommand): simplify repository filtering in SaveDocStatusCommandHandler
- Replaced explicit envelope and receiver expression filters with a single `.Where(request)` call.
- Removed redundant checks for null and empty values in handler.
- Updated using statements to include `EnvelopeGenerator.Application.Extensions`.
- Maintains the same functionality while reducing code complexity.
2025-08-26 22:34:54 +02:00
Developer 02
783d91a658 feat(QueryExtensions): add combined EnvelopeReceiver query support in QueryExtensions 2025-08-26 22:32:34 +02:00
Developer 02
ad032b2bdf fix(QueryExtensions): update to use base classes instead of interfaces 2025-08-26 22:23:26 +02:00
Developer 02
f2876d8995 move model intterfaces to interfaces dir 2025-08-26 22:09:45 +02:00
Developer 02
5468d7b2aa feat: add QueryExtensions for filtering by Envelope and Receiver
- Introduced extension methods on IQueryable<TEntity> to filter entities
  by Envelope (Id or Uuid) and Receiver (Id, EmailAddress, or Signature).
- Throws BadRequestException if no valid identifier is provided when notnull = true.
- Improves query handling consistency across application layer.
2025-08-26 22:05:33 +02:00
Developer 02
b005c194d3 create and implement IHasEnvelopeQuery and IHasReceiverQuery 2025-08-26 19:43:55 +02:00
Developer 02
dee6608390 add and implement IHasEnvelope and IHasReceiver 2025-08-26 19:20:44 +02:00
Developer 02
8b53eae6da init QueryExtensions 2025-08-26 18:51:57 +02:00
Developer 02
405b619bdc refactor(ReceiverAlreadySignedQuery): update to use common models 2025-08-26 17:29:07 +02:00
Developer 02
c5918b8e49 refactor(CreateHistoryCommand): update to use EnvelopeQuery- and ReceiverQueryBase 2025-08-26 17:16:30 +02:00
Developer 02
05cd8a05f4 refactor(MappingProfile): create to handle model mappings 2025-08-26 17:13:21 +02:00
Developer 02
2355a566e4 refactor(EnvelopeReceiverQueryBase): simplify EnvelopeReceiverQueryBase.Key handling
- Introduced private backing field `_key` for Key property
- Removed dynamic recomputation from Envelope and Receiver
- Ensured Key is only set once during initialization
- Improved null handling and exception safety
2025-08-26 16:49:22 +02:00
Developer 02
c887f857cd fix(EnvelopeReceiverQueryBase): make Envelope and Receiver properties not null and set default value 2025-08-26 16:39:12 +02:00
Developer 02
f114144d34 Fügen das Suffix „-base“ am Ende gängiger Modelle hinzu. 2025-08-26 16:36:52 +02:00
Developer 02
5c09601e3f refactor(ModifyDocStatusCommandBase): update to use EnvelopeReceiverQuery 2025-08-26 16:33:56 +02:00
Developer 02
18b05a3c63 refactor(ReceiverQuery): make properties virtual 2025-08-26 16:26:52 +02:00
Developer 02
ce35b0fea1 refactor(EnvelopeQuery): make properties virtual 2025-08-26 16:26:11 +02:00
Developer 02
7f18cd64c5 feat(EnvelopeReceiverQuery): create query with Key, Envelope and Receiver properties 2025-08-26 16:25:37 +02:00
Developer 02
0083c1b6c1 Create common Envelope and Receiver queries 2025-08-26 14:34:52 +02:00
59e73dbcf0 refactor(CreateHistoryCommand): add Envelope and Receiver queries 2025-08-26 10:36:46 +02:00
f34770931f feat(CreateHistoryCommand): add CreateHistoryCommandHandler with repository integration
- Extend CreateHistoryCommand to implement IRequest<long?>
- Introduce CreateHistoryCommandHandler to handle command via IRepository<EnvelopeHistory>
- Implement async creation and verification of EnvelopeHistory records
2025-08-25 17:33:49 +02:00
78100ef24f create CreateHistoryCommand 2025-08-25 17:22:26 +02:00
99083a68aa move mapping profile to pre dir 2025-08-25 16:50:42 +02:00
0939e57c56 refactor(EnvelopeController): migrate envelope update to MediatR with annotations
- Renamed `Update` action to `CreateOrUpdate`.
- Replaced manual signing logic with `_mediator.SignDocAsync`.
- Added `ExpandoObject` parameter to handle document annotations.
- Improved authorization checks and logging for missing claims.
- Kept legacy `Reject` endpoint intact with obsolete services.
2025-08-25 16:40:46 +02:00
00bdfeb9bb refactor(query): restructure ReceiverAlreadySignedQuery for clarity
- Replaced internal string properties with EnvelopeQuery and ReceiverQuery records
- Updated Key property to encode/decode using the new structured types
- Added overloaded IMediator extension methods IsSignedAsync for better usability
- Simplified ReceiverAlreadySignedQueryHandler to work with the new structure
2025-08-25 16:27:37 +02:00
cced0e5579 refator(SaveDocStatusCommandHandler): use SingleOrDefaultAsync instead of FirstOrDefaultAsync 2025-08-25 15:56:37 +02:00
82150290d2 refactor(Extensions): update SaveDocStatusAsync to use uuid and signature 2025-08-25 15:55:37 +02:00
fb7fd47a2a feat(SaveDocStatusCommand): add IMediator extension methods for saving and signing document status
- Introduced `SaveDocStatusAsync` extension method on IMediator to simplify saving document status
- Added `SignDocAsync` extension method as a shortcut for signing document status
- Refactored `SaveDocStatusCommand` usage to support new mediator extension
2025-08-25 15:43:54 +02:00
20b6b328f5 feat(EGDbContext): Eindeutige Indizes und Beziehungen für die Entitäten „Envelope“, „Receiver“ und „DocumentStatus“ hinzufügen
- Eindeutiger Index für „Envelope.Uuid“ hinzugefügt
- Eindeutige Indizes für „Receiver.Signature“ und „Receiver.EmailAddress“ hinzugefügt
- Beziehungen von „DocumentStatus“ zu „Envelope.Uuid“ und „Receiver“ (Signature und EmailAddress) konfiguriert
- Entitätsbeschränkungen für die Datenintegrität verbessert
2025-08-25 15:32:48 +02:00
fb07d9151f add mapping profiles 2025-08-25 15:20:29 +02:00
a3bc26bd08 feat(SaveDocStatusCommand): enhance SaveDocStatusCommandHandler with flexible envelope & receiver filters
- Added support for filtering by Envelope.Id or Envelope.Uuid
- Added support for filtering by Receiver.Id, Receiver.EmailAddress, or Receiver.Signature
- Throw BadRequestException when required identifiers are missing
- Updated repository queries to combine envelope and receiver filters
2025-08-25 15:02:57 +02:00
e1f793e571 refactor(TaskExtensions): TaskExtensions verallgemeinern, um benutzerdefinierte Ausnahmegeneratoren zu unterstützen
- Feste NotFoundException durch generischen Ausnahmegenerator in ThrowIfNull-Methoden ersetzt.
- Neue Exceptions-Hilfsklasse für die Erstellung gängiger Ausnahmen (NotFound, BadRequest, Forbidden) hinzugefügt.
- Funktionalität der Then-Erweiterungsmethode unverändert beibehalten.
2025-08-25 12:41:27 +02:00
86d8fcda07 chore: update to use DigitalData.Core.Exceptions instead of project exceptions classes 2025-08-25 11:48:29 +02:00
2f8401073f feat(SaveDocStatusCommand): Füge SaveDocStatusCommand und Handler hinzu, um den Dokumentstatus zu erstellen oder zu aktualisieren. 2025-08-25 11:41:08 +02:00
85a855fe64 refactor(ModifyDocStatusCommandBase): remove ChangedWhen-property 2025-08-25 11:18:48 +02:00
996b544633 feat(ModifyDocStatusCommandBase): create abstract class to handle common properties of commands 2025-08-25 11:16:57 +02:00
811656c4ca create UpdateDocStatusCommand 2025-08-25 10:36:35 +02:00
7e90d25f0b create CreateDocStatusCommand 2025-08-25 10:24:15 +02:00
20751aa708 update to remove loadEnvelope-metod 2025-08-23 01:15:51 +02:00
51b96e2a81 move extension extensions dir 2025-08-23 00:57:55 +02:00
7a011930df remvoe sanitzer from views and use extensions instead of keys 2025-08-23 00:54:27 +02:00
a080aaec95 refactor(ViewControllerBase): remvoe sanitzer 2025-08-23 00:17:59 +02:00
d390802305 refactor(HomeController): remove culture binding as viewdata; bind via string localizer 2025-08-23 00:14:43 +02:00
0b33ba0fd8 update to use ClaimsPrincipal instead of ControllerBase 2025-08-22 22:29:51 +02:00
6778d8e3e7 refactor add culture midleware 2025-08-22 22:26:23 +02:00
3394a580f4 refactor(DocumentController): remvoe Open endpoint and its client method 2025-08-22 21:54:25 +02:00
82a63b0dae remove envelopeOldService 2025-08-22 21:44:49 +02:00
e61d626bf3 implement receiver already signed method 2025-08-22 21:38:53 +02:00
bd7c1d4e36 feat(ReceiverAlreadySignedQuery): create with handler 2025-08-22 21:34:33 +02:00
30e2ac602d change LoadEnvelope method 2025-08-22 20:05:53 +02:00
1577440b77 refactor(EnvelopeStatus); arrange naming 2025-08-22 19:34:04 +02:00
68a6a23a20 refactor(TestEnvelopeReceiverController): remove observed inhearence and rename.
- Add related attributes
2025-08-22 19:29:16 +02:00
5e5458d87c fix conflicts after updates 2025-08-22 19:19:59 +02:00
eae83adee4 refactor(ReadEnvelopeReceiverQuery): update response to return list instate of sigel instance 2025-08-22 18:01:31 +02:00
a29785f7c7 feat(EnvelopeReceiverControler): add test endpoint for ReadEnvelopeReceiverQuery 2025-08-22 17:37:55 +02:00
cb641fd33a feat: add TaskExtensions with null and empty result checks
- Introduced ThrowIfNull<T>(Task<T?>) extension method to ensure awaited result is not null, throwing NotFoundException otherwise
- Added ThrowIfNull<T>(Task<IEnumerable<T>?>) extension method to validate collections, throwing NotFoundException if null or empty
- Supports optional custom exception messages for better error context
2025-08-22 16:33:30 +02:00
9434832261 refactor(Application.Contracts): rename Application.Interfaces 2025-08-22 15:42:38 +02:00
b7e19db0f1 update to use Constants.EnvelopeStatus instead of int 2025-08-22 15:26:37 +02:00
290e87048c add logic for status query 2025-08-22 15:24:34 +02:00
c0a5b57668 refactor(ReadEnvelopeQuery): move EnvelopeStatusQuery from ReadEnvelopeReceiverQuery 2025-08-22 14:54:36 +02:00
02ef05f054 feat(envelope-receivers): add query handler for reading envelope receiver with filtering
- Implemented ReadEnvelopeReceiverQueryHandler using MediatR
- Added filtering support for Envelope (Id, Status, Uuid) and Receiver (Id, EmailAddress, Signature)
- Included related navigation properties (Envelope, Documents, Elements, History, User, Receiver)
- Mapped result to EnvelopeReceiverDto using AutoMapper
2025-08-21 18:32:41 +02:00
72134c3d3b add IRepository<EnvelopeReceiver> to ReadEnvelopeReceiverQueryHandler 2025-08-21 17:42:02 +02:00
a4fffaa9b9 init the handler of ReadEnvelopeReceiverQuery 2025-08-21 17:37:37 +02:00
3a62f5317f feat(ReadEnvelopeReceiverQuery): add Key-property 2025-08-21 17:36:18 +02:00
59c93de8b7 feat(ReceiverQuery): merge ReadReceiverQuery 2025-08-21 17:14:45 +02:00
5122a2099d remove ReadReceiverQuery and Read-dir 2025-08-21 17:12:36 +02:00
95ec19d816 rempve Read dir 2025-08-21 17:09:24 +02:00
c7b3d97b2e refactor: remove CreateEnvelopeReceiverResponse 2025-08-21 17:07:22 +02:00
196941f73f remove EnvelopeQuery 2025-08-21 16:56:22 +02:00
415fe646b2 simplify ReadDocumentQuery 2025-08-21 16:52:04 +02:00
f42218802d Standardisierung der Struktur von Mapping-Profildateien 2025-08-21 16:43:50 +02:00
fcf00171de move CreateEnvelopeResponse to CreateEnvelopeCommand file 2025-08-21 16:39:16 +02:00
ca28c4cca4 refactor(CreateEnvelopeResponse): update to use getter-initters 2025-08-21 16:36:34 +02:00
a48e4988d6 Verschieben die Klassen von CreateEnvelopeReceiverDtos nach CreateEnvelopeReceiverCommand. 2025-08-21 16:26:23 +02:00
ec513716ff remove read dir and move files 2025-08-21 16:24:04 +02:00
f39b761412 remove create folder and move the files 2025-08-21 16:04:06 +02:00
70d122d2ff refactor(EnvelopeGenerator.Application.DTOs): Umbenennen in EnvelopeGenerator.Application.Dto 2025-08-21 15:55:15 +02:00
5bc5fcf764 refactor(EnvelopeOldService): remove LoadEnvelopes-method 2025-08-21 15:47:04 +02:00
8db62b41ba refactor(EnvelopeReceiver): remove companyName property 2025-08-21 14:54:48 +02:00
0f27600c5b feat(ReceiverVM): add From method to be able to generate from EnvelopeReceiver 2025-08-21 14:43:56 +02:00
9045655262 fix(Designer): Nicht verfügbare Datenquelle entfernen 2025-08-21 14:18:28 +02:00
5bcac264a7 refactor(CommonServices): updated to use ReveiverVM 2025-08-21 14:13:31 +02:00
c7bf800cd5 feat(ReceiverVM): Handles the combination of the envelope and receiver for common services and submodules as a view model. 2025-08-21 13:52:03 +02:00
5fb4d03ee7 refactor(Receiver): bring related props from EnvelopeReceiver 2025-08-21 13:36:48 +02:00
ac70aaa527 refactor(EnvelopeReceiver): remove not-mapped attribute 2025-08-21 12:44:01 +02:00
e877000b14 fix(Receiver): Entfernen Sie unnötige Eigenschaften und/oder verschieben Sie sie nach EnvelopeReceiver. 2025-08-21 11:54:47 +02:00
305422688e add todo 2025-08-21 11:23:17 +02:00
9c6135d208 refactor(ReadOnlyController): Globale try-catch-Anweisungen entfernen 2025-08-21 11:06:06 +02:00
903e4678ed refactor(Document-, EnvelopeController): Globale try-catch-Anweisungen entfernen 2025-08-21 11:03:41 +02:00
730a318b56 feat(ExceptionHandlingMiddleware): Hinzufügen, um Ausnahmen global zu behandeln 2025-08-21 10:57:34 +02:00
55c0f44954 Refactor(EnvelopeModel): Entfernen Sie den unnötigen try-catch-Block in der Methode GetByUuid des EnvelopeModel. 2025-08-21 10:52:46 +02:00
dbb745338c Entfernen unnötige try-catch-Anweisungen. 2025-08-21 10:47:16 +02:00
419f421d52 refactor(DocResult): remove framework condition_ 2025-08-20 17:43:30 +02:00
e64ac4b5e7 fix(Envelope): remove farmework condition of tfa enabled 2025-08-20 17:21:19 +02:00
d8200993af feat(appsettings.Dev): remove wrong cnn string 2025-08-20 15:04:48 +02:00
ee98142405 refactor(Envelope): EnvelopeType in Type umbenennen 2025-08-19 15:37:12 +02:00
c27337a6f5 refactor(Envelope): make EnvelopeType nullable for only .net 2025-08-19 15:36:28 +02:00
a09ea990ab Revert "refactor(Envelope): remove EnvelopeType-property"
This reverts commit f4c61e3bc7f99613106ff4c43b6ec86d34f96e1b.
2025-08-19 15:34:43 +02:00
05888bc57d revert(EnvelopeDocument): Add Filepath for .net framework
revert(EnvelopeHistory): Add AddedWhen, ActionDate and Comment for .net framework
2025-08-19 15:32:15 +02:00
39af0fe4fd feat(EnvelopeDocument): add System.Drawing-reference for .net-framework 2025-08-19 15:21:13 +02:00
f4c61e3bc7 refactor(Envelope): remove EnvelopeType-property 2025-08-19 15:20:00 +02:00
3f5a584399 refactor: Anpassung der Klassen-Definition für EnvelopeHistory zur Unterstützung von NET und NETFRAMEWORK 2025-08-19 15:11:42 +02:00
6aec854a64 refactor(EnvelopeHistory): Anpassung der Klassen-Definition für EnvelopeHistory zur Unterstützung von NET und NETFRAMEWORK 2025-08-19 15:06:00 +02:00
c360bde103 remove unnecessary references 2025-08-19 15:02:36 +02:00
82d4b0e740 refactor(EnvelopeDocument): Überarbeitung der Klasse EnvelopeDocument für .NET/Framework Kompatibilität
- Hinzugefügt: bedingte Namensraum-Deklaration für NET und NETFRAMEWORK
- Konstruktor eingeführt mit Initialisierung von Elements (nur .NET Framework)
- Entfernt: Property AddedWhen
- Verschoben: FileNameOriginal, IsTempFile, Filename, Filepath, Thumbnail, PageCount
  → nur verfügbar unter .NET Framework
- Entfernt Standardinitialisierung von Elements, stattdessen abhängig von Laufzeitumgebung
2025-08-19 15:02:05 +02:00
12519f06f7 refactor(EnvelopeCertificate): Entfernen Sie die Domäne, das Repository, die DTOs und den Dienst mit allen Schnittstellen. 2025-08-19 14:48:15 +02:00
a2471a0c35 refactor(EmailTemplate): adjust namespace declaration for EmailTemplate to support NET and NETFRAMEWORK 2025-08-19 14:35:35 +02:00
4251a24fe9 refactor(DocumentStatus): DocumentStatus-Klasse für plattformübergreifende Kompilierung angepasst
- Status-Default-Wert in Konstruktor verschoben, nur für NETFRAMEWORK gesetzt
- Klasse für NET/NETFRAMEWORK conditional compilation angepasst
- Unnötige Properties (StatusChangedWhen, AddedWhen, ChangedWhen, Navigation Properties) entfernt
- TODO-Kommentar für Status-Überprüfung erhalten
2025-08-19 14:31:11 +02:00
63a830c8e3 refactor(DocumentReceiverElement): Trenne .NET- und .NET Framework-spezifische Initialisierung in DocumentReceiverElement
- Verschiebe Standardwerte für Id, Required, ReadOnly und AnnotationIndex in den Konstruktor für .NET Framework
- Passe #if-Direktiven an, um Namensräume und NotMapped-Eigenschaften korrekt zu handhaben
- Entferne redundante Standardwert-Zuweisungen bei Property-Deklarationen
- Bereite Klasse für plattformübergreifende Nutzung vor
2025-08-19 14:26:14 +02:00
acee28ffce refactor: add conditional compilation for .NET and .NET Framework 2025-08-19 14:18:01 +02:00
50a541c5bf refactor: Plattform-spezifische Anpassungen an der Receiver-Klasse
- `NotMapped` Properties nur für NETFRAMEWORK verfügbar gemacht
- Klasse und Namespaces für NET- und NETFRAMEWORK-Bedingungen angepasst
- Redundant in NET definierten Code entfernt
2025-08-19 14:14:10 +02:00
d43877db62 refactor(Envelope): Standardwerte in der Envelope-Entity in den Konstruktor verschoben 2025-08-19 14:06:17 +02:00
242e66cd8d refactor(Receiver): make TfaRegDeadline nullable 2025-08-19 12:47:57 +02:00
e44fa0b7bd chore Upg UserManager 2025-08-19 12:13:30 +02:00
4201f7820a refactor(Envelope): Envelope-Entitätseigenschaften für NET/NETFRAMEWORK nullfähig und bedingt machen
- Mehrere DateTime- und int-Eigenschaften in nullfähige Typen geändert
- Bedingte Kompilierung für Message, Title, ContractTypeTranslated und StatusTranslated angewendet
- Einige Standardwerte entfernt, um die Kompatibilität mit verschiedenen Frameworks zu verbessern
- Flexibilität der Entitätszuordnung für Envelope verbessert
2025-08-19 11:12:41 +02:00
e095074c22 chore(Application): Aktualisierung zur Verwendung der bedingten Versionsverwaltung für Abhängigkeiten 2025-08-19 09:43:37 +02:00
412f19547f fix(Envelope): Entfernen das Attribut „NotMapped“. 2025-08-19 09:27:27 +02:00
b8c00884a9 Merge EnvelopeReceiver and EnvelopeReceiverBase 2025-08-13 16:35:51 +02:00
51d49d68ba fix(Envelope): Fügen Nicht-relationalen Eigenschaften NotMapped-Attribute hinzu. 2025-08-13 16:07:26 +02:00
4d5ee2b461 fix(MailParams): make Placeholders Dictionary 2025-08-13 13:03:56 +02:00
8a79ee4126 Stil: BaseController auf Datei-Namensraumformat umstellen 2025-08-12 11:24:38 +02:00
cde9896c01 Merge branch 'master' of http://git.dd:3000/AppStd/EnvelopeGenerator 2025-08-07 17:01:51 +02:00
c7d26a87b0 fix(EnvelopeMailService): Vermeiden Sie gemeinsam genutzte veränderbare Zustände in EnvelopeMailService-Platzhaltern
EnvelopeMailService wurde umgestaltet, um gemeinsam genutzte Veränderungen des _placeholders-Wörterbuchs zu vermeiden.
Die Konfigurationseigenschaft MailParams.Placeholders wurde von einem veränderbaren Dictionary<string, string>
zu einem ImmutableDictionary<string, string> geändert, und _placeholders wird nun bei der Dienstkonstruktion als neues Wörterbuch instanziiert.
2025-08-07 17:01:32 +02:00
17ceb1f72a Update EnvelopeGenerator.Web/wwwroot/README.md 2025-08-06 09:48:34 +02:00
b2c396c3b2 Add EnvelopeGenerator.Web/wwwroot/README.md 2025-08-06 09:45:11 +02:00
Developer01
286e17a900 layout specihern 2025-07-18 15:42:07 +02:00
Developer01
a21db6d6c5 Button AccessCode manuell versenden 2025-07-15 07:27:01 +02:00
Developer01
fe7030b9d7 Resend AccessCode Manually 2025-07-14 15:19:05 +02:00
Developer01
888c04b5c9 EnvelopeDomain Add Comment 2025-07-14 13:45:14 +02:00
de2cc62f95 Merge branch 'master' of http://git.dd:3000/AppStd/EnvelopeGenerator 2025-07-02 14:26:08 +02:00
0cfa732d87 Fix StatusTranslated property for correct enum translation
Updated the `StatusTranslated` property to cast the `Status` integer to the `Constants.EnvelopeStatus` enum before calling `ToString()`. This ensures accurate string representation based on the enum rather than the integer value.
2025-07-02 14:25:14 +02:00
Developer01
b14d9169f2 Fild editor msgbox 2025-07-02 13:18:01 +02:00
407 changed files with 14281 additions and 12826 deletions

View File

@ -1,4 +1,4 @@
namespace EnvelopeGenerator.Application.Configurations;
namespace EnvelopeGenerator.Application.Common.Configurations;
/// <summary>
///

View File

@ -1,4 +1,4 @@
namespace EnvelopeGenerator.Application.Configurations;
namespace EnvelopeGenerator.Application.Common.Configurations;
/// <summary>
///
@ -23,5 +23,5 @@ public class DispatcherParams
/// <summary>
/// Default value is string.Empty
/// </summary>
public string EmailAttmt1 { get; init; } = string.Empty;
public string? EmailAttmt1 { get; init; } = null;
}

View File

@ -1,5 +1,5 @@
using DigitalData.Core.Client.Interface;
namespace EnvelopeGenerator.Application.Configurations;
namespace EnvelopeGenerator.Application.Common.Configurations;
/// <summary>
/// https://www.gtx-messaging.com/en/api-docs/sms-rest-api/

View File

@ -1,4 +1,4 @@
namespace EnvelopeGenerator.Application.Configurations;
namespace EnvelopeGenerator.Application.Common.Configurations;
/// <summary>
///

View File

@ -1,7 +1,7 @@
using OtpNet;
using System.Globalization;
namespace EnvelopeGenerator.Application.Configurations;
namespace EnvelopeGenerator.Application.Common.Configurations;
/// <summary>
///

View File

@ -0,0 +1,73 @@
namespace EnvelopeGenerator.Application.Common.Dto;
/// <summary>
///
/// </summary>
public record AnnotationCreateDto
{
/// <summary>
///
/// </summary>
public int ElementId { get; init; }
/// <summary>
///
/// </summary>
public string Name { get; init; } = null!;
/// <summary>
///
/// </summary>
public string Value { get; init; } = null!;
/// <summary>
///
/// </summary>
public string Type { get; init; } = null!;
/// <summary>
///
/// </summary>
public double? X { get; init; }
/// <summary>
///
/// </summary>
public double? Y { get; init; }
/// <summary>
///
/// </summary>
public double? Width { get; init; }
/// <summary>
///
/// </summary>
public double? Height { get; init; }
}
/// <summary>
///
/// </summary>
public record AnnotationDto : AnnotationCreateDto
{
/// <summary>
///
/// </summary>
public long Id { get; init; }
/// <summary>
///
/// </summary>
public DateTime AddedWhen { get; init; }
/// <summary>
///
/// </summary>
public DateTime? ChangedWhen { get; init; }
/// <summary>
///
/// </summary>
public string? ChangedWho { get; init; }
}

View File

@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs;
namespace EnvelopeGenerator.Application.Common.Dto;
/// <summary>
/// Data Transfer Object representing configuration settings.

View File

@ -1,12 +1,12 @@
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs;
namespace EnvelopeGenerator.Application.Common.Dto;
/// <summary>
/// Data Transfer Object representing a document within an envelope, including optional binary data and form elements.
/// </summary>
[ApiExplorerSettings(IgnoreApi = true)]
public class EnvelopeDocumentDto
public class DocumentDto
{
/// <summary>
/// Gets or sets the unique identifier of the document.
@ -31,5 +31,5 @@ public class EnvelopeDocumentDto
/// <summary>
/// Gets or sets the collection of elements associated with the document for receiver interactions, if any.
/// </summary>
public IEnumerable<DocumentReceiverElementDto>? Elements { get; set; }
public IEnumerable<SignatureDto>? Elements { get; set; }
}

View File

@ -1,6 +1,7 @@
using Microsoft.AspNetCore.Mvc;
using EnvelopeGenerator.Domain.Constants;
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs;
namespace EnvelopeGenerator.Application.Common.Dto;
/// <summary>
/// Data Transfer Object representing the status of a document for a specific receiver.
@ -26,7 +27,7 @@ public class DocumentStatusDto
/// <summary>
/// Gets or sets the current status code.
/// </summary>
public int Status { get; set; }
public EnvelopeStatus Status { get; set; }
/// <summary>
/// Gets or sets the timestamp when the status was changed.

View File

@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs
namespace EnvelopeGenerator.Application.Common.Dto
{
/// <summary>
///

View File

@ -1,9 +1,10 @@
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
using DigitalData.UserManager.Application.DTOs.User;
using EnvelopeGenerator.Domain.Constants;
using EnvelopeGenerator.Domain.Entities;
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs;
namespace EnvelopeGenerator.Application.Common.Dto;
/// <summary>
///
@ -24,7 +25,7 @@ public record EnvelopeDto
/// <summary>
///
/// </summary>
public int Status { get; set; }
public required EnvelopeStatus Status { get; set; }
/// <summary>
/// Default value is string.Empty
@ -81,7 +82,7 @@ public record EnvelopeDto
/// <summary>
///
/// </summary>
public bool? UseAccessCode { get; set; }
public bool UseAccessCode { get; set; } = true;
/// <summary>
///
@ -116,5 +117,5 @@ public record EnvelopeDto
/// <summary>
///
/// </summary>
public IEnumerable<EnvelopeDocumentDto>? Documents { get; set; }
public IEnumerable<DocumentDto>? Documents { get; set; }
}

View File

@ -1,14 +1,25 @@
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
using EnvelopeGenerator.Application.Common.Dto.Receiver;
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
namespace EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver;
/// <summary>
///
/// </summary>
[ApiExplorerSettings(IgnoreApi = true)]
public record EnvelopeReceiverBasicDto
public record EnvelopeReceiverDto
{
/// <summary>
///
/// </summary>
public EnvelopeDto? Envelope { get; set; }
/// <summary>
///
/// </summary>
public ReceiverDto? Receiver { get; set; }
/// <summary>
///
/// </summary>

View File

@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
namespace EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver;
/// <summary>
///

View File

@ -2,7 +2,7 @@
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
namespace EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiverReadOnly;
/// <summary>
///

View File

@ -1,7 +1,8 @@
using EnvelopeGenerator.Application.DTOs.Receiver;
using EnvelopeGenerator.Application.Common.Dto;
using EnvelopeGenerator.Application.Common.Dto.Receiver;
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
namespace EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiverReadOnly;
/// <summary>
/// Represents a read-only Data Transfer Object (DTO) for an envelope receiver.
@ -59,5 +60,5 @@ public class EnvelopeReceiverReadOnlyDto
/// <summary>
/// Gets or inits the associated receiver details.
/// </summary>
public ReceiverReadDto? Receiver { get; set; }
public ReceiverDto? Receiver { get; set; }
}

View File

@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
namespace EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiverReadOnly;
/// <summary>
/// Data Transfer Object for updating a read-only envelope receiver.

View File

@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs;
namespace EnvelopeGenerator.Application.Common.Dto;
/// <summary>
/// Data Transfer Object representing a type of envelope with its configuration settings.

View File

@ -1,11 +1,9 @@
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
namespace EnvelopeGenerator.Application.Common.Dto.History;
/// <summary>
/// Data Transfer Object for creating a new envelope history record.
/// </summary>
public class EnvelopeHistoryCreateDto
public class HistoryCreateDto
{
/// <summary>
/// Gets or sets the identifier of the envelope.

View File

@ -1,13 +1,13 @@
using DigitalData.UserManager.Application.DTOs.User;
using EnvelopeGenerator.Application.DTOs.Receiver;
using static EnvelopeGenerator.Domain.Constants;
using EnvelopeGenerator.Application.Common.Dto.Receiver;
using EnvelopeGenerator.Domain.Constants;
namespace EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
namespace EnvelopeGenerator.Application.Common.Dto.History;
/// <summary>
/// Data Transfer Object representing the history of an envelope, including status, sender, receiver, and related metadata.
/// </summary>
public record EnvelopeHistoryDto
public record HistoryDto
{
/// <summary>
/// Unique identifier for the envelope history entry.
@ -25,9 +25,19 @@ public record EnvelopeHistoryDto
public required string UserReference { get; set; }
/// <summary>
/// Status code of the envelope at this history point.
/// Include code of the envelope at this history point.
/// </summary>
public int Status { get; set; }
public EnvelopeStatus Status { get; set; }
/// <summary>
/// Type of reference for this history entry.
/// </summary>
public ReferenceType ReferenceType => ((int)Status).ToString().FirstOrDefault() switch
{
'1' => ReferenceType.Sender,
'2' => ReferenceType.Receiver,
_ => ReferenceType.System,
};
/// <summary>
/// Human-readable name of the status.
@ -52,12 +62,7 @@ public record EnvelopeHistoryDto
/// <summary>
/// Information about the receiver associated with this history entry.
/// </summary>
public ReceiverReadDto? Receiver { get; set; }
/// <summary>
/// Type of reference for this history entry.
/// </summary>
public ReferenceType ReferenceType { get; set; }
public ReceiverDto? Receiver { get; set; }
/// <summary>
/// Optional comment related to this history entry.

View File

@ -1,13 +1,13 @@
using AutoMapper;
using EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
using EnvelopeGenerator.Application.DTOs.Messaging;
using EnvelopeGenerator.Application.DTOs.Receiver;
using EnvelopeGenerator.Application.Extensions;
using EnvelopeGenerator.Application.Common.Dto.History;
using EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver;
using EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiverReadOnly;
using EnvelopeGenerator.Application.Common.Dto.Messaging;
using EnvelopeGenerator.Application.Common.Dto.Receiver;
using EnvelopeGenerator.Application.Common.Extensions;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.DTOs;
namespace EnvelopeGenerator.Application.Common.Dto;
/// <summary>
/// Represents the AutoMapper profile configuration for mapping between
@ -23,40 +23,36 @@ public class MappingProfile : Profile
{
// Entity to DTO mappings
CreateMap<Config, ConfigDto>();
CreateMap<DocumentReceiverElement, DocumentReceiverElementDto>();
CreateMap<Signature, SignatureDto>();
CreateMap<DocumentStatus, DocumentStatusDto>();
CreateMap<EmailTemplate, EmailTemplateDto>();
CreateMap<Envelope, EnvelopeDto>();
CreateMap<EnvelopeCertificate, EnvelopeCertificateDto>();
CreateMap<EnvelopeDocument, EnvelopeDocumentDto>();
CreateMap<Domain.Entities.EnvelopeHistory, EnvelopeHistoryDto>();
CreateMap<Domain.Entities.EnvelopeHistory, EnvelopeHistoryCreateDto>();
CreateMap<Document, DocumentDto>();
CreateMap<Domain.Entities.History, HistoryDto>();
CreateMap<Domain.Entities.History, HistoryCreateDto>();
CreateMap<Domain.Entities.EnvelopeReceiver, EnvelopeReceiverDto>();
CreateMap<Domain.Entities.EnvelopeReceiver, EnvelopeReceiverSecretDto>();
CreateMap<EnvelopeType, EnvelopeTypeDto>();
CreateMap<Domain.Entities.Receiver, ReceiverReadDto>();
CreateMap<Domain.Entities.Receiver, ReceiverCreateDto>();
CreateMap<Domain.Entities.Receiver, ReceiverUpdateDto>();
CreateMap<Domain.Entities.Receiver, ReceiverDto>();
CreateMap<Domain.Entities.EnvelopeReceiverReadOnly, EnvelopeReceiverReadOnlyDto>();
CreateMap<ElementAnnotation, AnnotationDto>();
// DTO to Entity mappings
CreateMap<ConfigDto, Config>();
CreateMap<DocumentReceiverElementDto, DocumentReceiverElement>();
CreateMap<SignatureDto, Signature>();
CreateMap<DocumentStatusDto, DocumentStatus>();
CreateMap<EmailTemplateDto, EmailTemplate>();
CreateMap<EnvelopeDto, Envelope>();
CreateMap<EnvelopeCertificateDto, EnvelopeCertificate>();
CreateMap<EnvelopeDocumentDto, EnvelopeDocument>();
CreateMap<EnvelopeHistoryDto, Domain.Entities.EnvelopeHistory>();
CreateMap<EnvelopeHistoryCreateDto, Domain.Entities.EnvelopeHistory>();
CreateMap<DocumentDto, Document>();
CreateMap<HistoryDto, Domain.Entities.History>();
CreateMap<HistoryCreateDto, Domain.Entities.History>();
CreateMap<EnvelopeReceiverDto, Domain.Entities.EnvelopeReceiver>();
CreateMap<EnvelopeTypeDto, EnvelopeType>();
CreateMap<ReceiverReadDto, Domain.Entities.Receiver>().ForMember(rcv => rcv.EnvelopeReceivers, rcvReadDto => rcvReadDto.Ignore());
CreateMap<ReceiverCreateDto, Domain.Entities.Receiver>();
CreateMap<ReceiverUpdateDto, Domain.Entities.Receiver>();
CreateMap<EnvelopeReceiverBase, EnvelopeReceiverBasicDto>();
CreateMap<ReceiverDto, Domain.Entities.Receiver>().ForMember(rcv => rcv.EnvelopeReceivers, rcvReadDto => rcvReadDto.Ignore());
CreateMap<EnvelopeReceiverReadOnlyCreateDto, Domain.Entities.EnvelopeReceiverReadOnly>();
CreateMap<EnvelopeReceiverReadOnlyUpdateDto, Domain.Entities.EnvelopeReceiverReadOnly>();
CreateMap<AnnotationCreateDto, ElementAnnotation>()
.ForMember(dest => dest.AddedWhen, opt => opt.MapFrom(_ => DateTime.UtcNow));
// Messaging mappings
// for GTX messaging

View File

@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs.Messaging;
namespace EnvelopeGenerator.Application.Common.Dto.Messaging;
/// <summary>
///

View File

@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs.Messaging;
namespace EnvelopeGenerator.Application.Common.Dto.Messaging;
/// <summary>
///

View File

@ -1,14 +1,14 @@
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
using EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver;
using Microsoft.AspNetCore.Mvc;
using System.Text.Json.Serialization;
namespace EnvelopeGenerator.Application.DTOs.Receiver;
namespace EnvelopeGenerator.Application.Common.Dto.Receiver;
/// <summary>
///
/// </summary>
[ApiExplorerSettings(IgnoreApi = true)]
public class ReceiverReadDto
public class ReceiverDto
{
/// <summary>
///
@ -25,6 +25,12 @@ public class ReceiverReadDto
/// </summary>
public required string Signature { get; set; }
/// <summary>
///
/// </summary>
[JsonIgnore]
public string? TotpSecretkey { get; set; }
/// <summary>
///
/// </summary>
@ -34,18 +40,13 @@ public class ReceiverReadDto
///
/// </summary>
[JsonIgnore]
public IEnumerable<EnvelopeReceiverBasicDto>? EnvelopeReceivers { get; set; }
public IEnumerable<EnvelopeReceiverDto>? EnvelopeReceivers { get; set; }
/// <summary>
///
/// </summary>
public string? LastUsedName => EnvelopeReceivers?.LastOrDefault()?.Name;
/// <summary>
///
/// </summary>
public string? TotpSecretkey { get; set; } = null;
/// <summary>
///
/// </summary>

View File

@ -1,12 +1,13 @@
using Microsoft.AspNetCore.Mvc;
using EnvelopeGenerator.Domain.Interfaces;
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs;
namespace EnvelopeGenerator.Application.Common.Dto;
/// <summary>
/// Data Transfer Object representing a positioned element assigned to a document receiver.
/// </summary>
[ApiExplorerSettings(IgnoreApi = true)]
public class DocumentReceiverElementDto
public class SignatureDto : ISignature
{
/// <summary>
/// Gets or sets the unique identifier of the element.
@ -86,10 +87,10 @@ public class DocumentReceiverElementDto
/// <summary>
/// Gets or sets the top position of the element (in layout terms).
/// </summary>
public double Top { get; set; }
public double Top => Y;
/// <summary>
/// Gets or sets the left position of the element (in layout terms).
/// </summary>
public double Left { get; set; }
public double Left => X;
}

View File

@ -0,0 +1,27 @@
namespace EnvelopeGenerator.Application.Common;
/// <summary>
///
/// </summary>
public enum EnvelopeFlag
{
/// <summary>
///
/// </summary>
EnvelopeOrReceiverNonexists,
/// <summary>
///
/// </summary>
NonDecodableEnvelopeReceiverId,
/// <summary>
///
/// </summary>
WrongEnvelopeReceiverId,
/// <summary>
///
/// </summary>
AccessCodeNull
}

View File

@ -1,6 +1,6 @@
using Microsoft.Extensions.Caching.Distributed;
namespace EnvelopeGenerator.Application.Extensions;
namespace EnvelopeGenerator.Application.Common.Extensions;
/// <summary>
///

View File

@ -0,0 +1,182 @@
using EnvelopeGenerator.Domain.Constants;
using System.Text;
namespace EnvelopeGenerator.Application.Common.Extensions;
/// <summary>
///
/// </summary>
public static class DecodingExtensions
{
/// <summary>
/// Validates whether a given string is a correctly formatted Base-64 encoded string.
/// </summary>
/// <remarks>
/// This method checks the string for proper Base-64 formatting, which includes validating
/// the length of the string (must be divisible by 4). It also checks each character to ensure
/// it belongs to the Base-64 character set (A-Z, a-z, 0-9, '+', '/', and '=' for padding).
/// The method ensures that padding characters ('=') only appear at the end of the string and
/// are in a valid configuration (either one '=' at the end if the string's length % 4 is 3,
/// or two '==' if the length % 4 is 2).
/// </remarks>
/// <param name="input">The Base-64 encoded string to validate.</param>
/// <returns>
/// <c>true</c> if the string is a valid Base-64 encoded string; otherwise, <c>false</c>.
/// </returns>
/// <example>
/// <code>
/// string testString = "TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlzIHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2YgdGhlIG1pbmQsIHRoYXQgYnk=";
/// bool isValid = IsValidBase64String(testString);
/// Console.WriteLine(isValid); // Output: true
/// </code>
/// </example>
public static bool IsBase64String(this string input)
{
// Check if the string is null or empty
if (string.IsNullOrEmpty(input))
{
return false;
}
// Replace valid base-64 padding
input = input.Trim();
int mod4 = input.Length % 4;
if (mod4 > 0)
{
// Base-64 string lengths should be divisible by 4
return false;
}
// Check each character to ensure it is valid base-64
foreach (char c in input)
{
if (!char.IsLetterOrDigit(c) && c != '+' && c != '/' && c != '=')
{
// Invalid character detected
return false;
}
}
// Ensure no invalid padding scenarios exist
if (input.EndsWith("==") && input.Length % 4 == 0 ||
input.EndsWith("=") && input.Length % 4 == 3)
{
return true;
}
return input.IndexOf('=') == -1; // No padding allowed except at the end
}
/// <summary>
///
/// </summary>
/// <param name="encodedKey"></param>
/// <param name="decodedKeys"></param>
/// <returns></returns>
public static bool TryDecode(this string encodedKey, out string[] decodedKeys)
{
try
{
byte[] bytes = Convert.FromBase64String(encodedKey);
string decodedString = Encoding.UTF8.GetString(bytes);
decodedKeys = decodedString.Split(new string[] { "::" }, StringSplitOptions.None);
return true;
}
catch(ArgumentNullException) { }
catch (FormatException) { }
catch(ArgumentException) { }
decodedKeys = Array.Empty<string>();
return false;
}
/// <summary>
///
/// </summary>
/// <param name="decodedKeys"></param>
/// <returns></returns>
public static EncodeType GetEncodeType(this string[] decodedKeys) => decodedKeys.Length switch
{
2 => EncodeType.EnvelopeReceiver,
3 => long.TryParse(decodedKeys[1], out var _) ? EncodeType.EnvelopeReceiverReadOnly : EncodeType.Undefined,
_ => EncodeType.Undefined,
};
/// <summary>
///
/// </summary>
/// <param name="decodedKeys"></param>
/// <returns></returns>
/// <exception cref="InvalidOperationException"></exception>
public static (string? EnvelopeUuid, string? ReceiverSignature) ParseEnvelopeReceiverId(this string[] decodedKeys)
=> decodedKeys.GetEncodeType() == EncodeType.EnvelopeReceiver
? (EnvelopeUuid: decodedKeys[0], ReceiverSignature: decodedKeys[1])
: throw new InvalidOperationException("Attempted to convert a decoded other than type EnvelopeReceiver to EnvelopeReceiver.");
/// <summary>
///
/// </summary>
/// <param name="decodedKeys"></param>
/// <returns></returns>
/// <exception cref="InvalidOperationException"></exception>
public static long ParseReadOnlyId(this string[] decodedKeys)
=> decodedKeys.GetEncodeType() == EncodeType.EnvelopeReceiverReadOnly
? long.Parse(decodedKeys[1])
: throw new InvalidOperationException("Attempted to convert a decoded other than type EnvelopeReceiver to EnvelopeReceiver. ");
/// <summary>
/// Decodes the envelope receiver ID and extracts the envelope UUID and receiver signature.
/// </summary>
/// <param name="envelopeReceiverId">The base64 encoded string containing the envelope UUID and receiver signature.</param>
/// <returns>A tuple containing the envelope UUID and receiver signature.</returns>
public static (string? EnvelopeUuid, string? ReceiverSignature) DecodeEnvelopeReceiverId(this string envelopeReceiverId)
{
if (!envelopeReceiverId.IsBase64String())
{
return (null, null);
}
byte[] bytes = Convert.FromBase64String(envelopeReceiverId);
string decodedString = Encoding.UTF8.GetString(bytes);
string[] parts = decodedString.Split(new string[] { "::" }, StringSplitOptions.None);
if (parts.Length > 1)
return (EnvelopeUuid: parts[0], ReceiverSignature: parts[1]);
else
return (string.Empty, string.Empty);
}
/// <summary>
///
/// </summary>
/// <param name="envelopeReceiverReadOnlyId"></param>
/// <returns></returns>
public static long? DecodeEnvelopeReceiverReadOnlyId(this string envelopeReceiverReadOnlyId)
{
if (!envelopeReceiverReadOnlyId.IsBase64String())
{
return null;
}
byte[] bytes = Convert.FromBase64String(envelopeReceiverReadOnlyId);
string decodedString = Encoding.UTF8.GetString(bytes);
string[] parts = decodedString.Split(new string[] { "::" }, StringSplitOptions.None);
if (parts.Length > 2)
return long.TryParse(parts[1], out long readOnlyId) ? readOnlyId : null;
else
return null;
}
/// <summary>
/// Gets the envelope UUID from the decoded envelope receiver ID.
/// </summary>
/// <param name="envelopeReceiverId">The base64 encoded string to decode.</param>
/// <returns>The envelope UUID.</returns>
public static string? GetEnvelopeUuid(this string envelopeReceiverId) => envelopeReceiverId.DecodeEnvelopeReceiverId().EnvelopeUuid;
/// <summary>
/// Gets the receiver signature from the decoded envelope receiver ID.
/// </summary>
/// <param name="envelopeReceiverId">The base64 encoded string to decode.</param>
/// <returns>The receiver signature.</returns>
public static string? GetReceiverSignature(this string envelopeReceiverId) => envelopeReceiverId.DecodeEnvelopeReceiverId().ReceiverSignature;
}

View File

@ -0,0 +1,38 @@
using System.Text;
namespace EnvelopeGenerator.Application.Common.Extensions;
/// <summary>
/// Provides extension methods for decoding and extracting information from an envelope receiver ID.
/// </summary>
public static class EncodingExtensions
{
/// <summary>
///
/// </summary>
/// <param name="readOnlyId"></param>
/// <returns></returns>
public static string ToEnvelopeKey(this long readOnlyId)
{
//The random number is used as a salt to increase security but it is not saved in the database.
string combinedString = $"{Random.Shared.Next()}::{readOnlyId}::{Random.Shared.Next()}";
byte[] bytes = Encoding.UTF8.GetBytes(combinedString);
string base64String = Convert.ToBase64String(bytes);
return base64String;
}
/// <summary>
///
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public static string ToEnvelopeKey(this (string envelopeUuid, string receiverSignature) input)
{
string combinedString = $"{input.envelopeUuid}::{input.receiverSignature}";
byte[] bytes = Encoding.UTF8.GetBytes(combinedString);
string base64String = Convert.ToBase64String(bytes);
return base64String;
}
}

View File

@ -0,0 +1,18 @@
using System.Text.Json;
namespace EnvelopeGenerator.Application.Common.Extensions;
/// <summary>
///
/// </summary>
public static class JsonExtensions
{
/// <summary>
///
/// </summary>
/// <param name="obj"></param>
/// <param name="options"></param>
/// <returns></returns>
public static string ToJson(this object obj, JsonSerializerOptions? options = null)
=> JsonSerializer.Serialize(obj, options);
}

View File

@ -1,7 +1,7 @@
using Microsoft.Extensions.Logging;
using System.Text;
namespace EnvelopeGenerator.Extensions
namespace EnvelopeGenerator.Application.Common.Extensions
{
public static class LoggerExtensions
{

View File

@ -1,6 +1,6 @@
using EnvelopeGenerator.Application.DTOs.Messaging;
using EnvelopeGenerator.Application.Common.Dto.Messaging;
namespace EnvelopeGenerator.Application.Extensions;
namespace EnvelopeGenerator.Application.Common.Extensions;
/// <summary>
/// Provides extension methods for common mapping and conversion operations.

View File

@ -1,11 +1,24 @@
using Microsoft.Extensions.Caching.Memory;
using EnvelopeGenerator.Application.Common.Extensions;
using Microsoft.Extensions.Caching.Memory;
namespace EnvelopeGenerator.Extensions;
namespace EnvelopeGenerator.Application.Common.Extensions;
/// <summary>
///
/// </summary>
public static class MemoryCacheExtensions
{
private static readonly Guid BaseId = Guid.NewGuid();
/// <summary>
///
/// </summary>
/// <typeparam name="TEnum"></typeparam>
/// <param name="memoryCache"></param>
/// <param name="key"></param>
/// <param name="ignores"></param>
/// <returns></returns>
/// <exception cref="InvalidOperationException"></exception>
public static IDictionary<string, int> GetEnumAsDictionary<TEnum>(this IMemoryCache memoryCache, string key = "", params object[] ignores)
where TEnum : Enum
=> memoryCache.GetOrCreate(BaseId + typeof(TEnum).FullName + key, _ =>

View File

@ -0,0 +1,125 @@
using DigitalData.Core.Exceptions;
using EnvelopeGenerator.Application.Common.Extensions;
using EnvelopeGenerator.Application.Common.Query;
using EnvelopeGenerator.Domain.Entities;
using EnvelopeGenerator.Domain.Interfaces;
namespace EnvelopeGenerator.Application.Common.Extensions;
/// <summary>
///
/// </summary>
public static class QueryExtensions
{
/// <summary>
///
/// </summary>
/// <typeparam name="TEntity"></typeparam>
/// <param name="root"></param>
/// <param name="query"></param>
/// <param name="notnull"></param>
/// <returns></returns>
/// <exception cref="BadRequestException"></exception>
public static IQueryable<TEntity> Where<TEntity>(this IQueryable<TEntity> root, EnvelopeQueryBase query, bool notnull = true)
where TEntity : IHasEnvelope
{
if (query.Id is not null)
root = root.Where(e => e.Envelope!.Id == query.Id);
else if (query.Uuid is not null)
root = root.Where(e => e.Envelope!.Uuid == query.Uuid);
else if (notnull)
throw new BadRequestException(
"Either Envelope Id or Envelope Uuid must be provided in the query."
);
return root;
}
/// <summary>
///
/// </summary>
/// <param name="root"></param>
/// <param name="query"></param>
/// <param name="notnull"></param>
/// <returns></returns>
/// <exception cref="BadRequestException"></exception>
public static IQueryable<Envelope> Where(this IQueryable<Envelope> root, EnvelopeQueryBase query, bool notnull = true)
{
if (query.Id is not null)
root = root.Where(e => e.Id == query.Id);
else if (query.Uuid is not null)
root = root.Where(e => e.Uuid == query.Uuid);
else if (notnull)
throw new BadRequestException(
"Either Envelope Id or Envelope Uuid must be provided in the query."
);
return root;
}
/// <summary>
///
/// </summary>
/// <typeparam name="TEntity"></typeparam>
/// <param name="root"></param>
/// <param name="query"></param>
/// <param name="notnull"></param>
/// <returns></returns>
/// <exception cref="BadRequestException"></exception>
public static IQueryable<TEntity> Where<TEntity>(this IQueryable<TEntity> root, ReceiverQueryBase query, bool notnull = true)
where TEntity : IHasReceiver
{
if (query.Id is not null)
root = root.Where(e => e.Receiver!.Id == query.Id);
else if (query.EmailAddress is not null)
root = root.Where(e => e.Receiver!.EmailAddress == query.EmailAddress);
else if (query.Signature is not null)
root = root.Where(e => e.Receiver!.Signature == query.Signature);
else if (notnull)
throw new BadRequestException(
"Receiver must have at least one identifier (Id, EmailAddress, or Signature)."
);
return root;
}
/// <summary>
///
/// </summary>
/// <param name="root"></param>
/// <param name="query"></param>
/// <param name="notnull"></param>
/// <returns></returns>
/// <exception cref="BadRequestException"></exception>
public static IQueryable<Receiver> Where(this IQueryable<Receiver> root, ReceiverQueryBase query, bool notnull = true)
{
if (query.Id is not null)
root = root.Where(e => e.Id == query.Id);
else if (query.EmailAddress is not null)
root = root.Where(e => e.EmailAddress == query.EmailAddress);
else if (query.Signature is not null)
root = root.Where(e => e.Signature == query.Signature);
else if (notnull)
throw new BadRequestException(
"Receiver must have at least one identifier (Id, EmailAddress, or Signature)."
);
return root;
}
/// <summary>
///
/// </summary>
/// <typeparam name="TEntity"></typeparam>
/// <typeparam name="TEnvelopeQuery"></typeparam>
/// <typeparam name="TReceiverQuery"></typeparam>
/// <param name="root"></param>
/// <param name="query"></param>
/// <param name="notnull"></param>
/// <returns></returns>
public static IQueryable<TEntity> Where<TEntity, TEnvelopeQuery, TReceiverQuery>(this IQueryable<TEntity> root, EnvelopeReceiverQueryBase<TEnvelopeQuery, TReceiverQuery> query, bool notnull = true)
where TEntity : IHasEnvelope, IHasReceiver
where TEnvelopeQuery : EnvelopeQueryBase, new()
where TReceiverQuery : ReceiverQueryBase, new()
=> root.Where(query.Envelope, notnull).Where(query.Receiver, notnull);
}

View File

@ -0,0 +1,30 @@
using OtpNet;
namespace EnvelopeGenerator.Application.Common.Extensions;
/// <summary>
///
/// </summary>
public static class StringExtension
{
/// <summary>
///
/// </summary>
/// <param name="totp"></param>
/// <param name="secret"></param>
/// <returns></returns>
public static bool IsValidTotp(this string totp, string secret)
{
var secret_bytes = Base32Encoding.ToBytes(secret);
var secret_totp = new Totp(secret_bytes);
return secret_totp.VerifyTotp(totp, out _, VerificationWindow.RfcSpecifiedNetworkDelay);
}
/// <summary>
///
/// </summary>
/// <param name="seperator"></param>
/// <param name="values"></param>
/// <returns></returns>
public static string Join(this IEnumerable<string> values, string seperator) => string.Join(seperator, values);
}

View File

@ -0,0 +1,78 @@
using DigitalData.Core.Exceptions;
namespace EnvelopeGenerator.Application.Common.Extensions;
/// <summary>
/// Extension methods for tasks
/// </summary>
public static class TaskExtensions
{
/// <summary>
/// Awaits the specified task and ensures that the result is not <c>null</c>.
/// If the result is <c>null</c>, the exception created by factory-method is thrown.
/// </summary>
/// <typeparam name="T">The type of the result.</typeparam>
/// <typeparam name="TException">The type of the exception.</typeparam>
/// <param name="task">The task to await.</param>
/// <param name="factory">Exception provider</param>
/// <returns>The awaited result if not <c>null</c>.</returns>
/// <exception>Thrown if the result is <c>null</c>.</exception>
public static async Task<T> ThrowIfNull<T, TException>(this Task<T?> task, Func<TException> factory) where TException : Exception
{
var result = await task;
return result ?? throw factory();
}
/// <summary>
/// Awaits the specified task and ensures that the result is not <c>empty</c>.
/// If the result contains no elements, the exception created by factory-method is thrown.
/// </summary>
/// <typeparam name="T">The element type of the collection.</typeparam>
/// <typeparam name="TException">The type of the exception.</typeparam>
/// <param name="task">The task to await.</param>
/// <param name="factory">Exception provider</param>
/// <returns>The awaited collection if it is not <c>null</c> or empty.</returns>
/// <exception cref="NotFoundException">Thrown if the result is <c>null</c> or empty.</exception>
public static async Task<IEnumerable<T>> ThrowIfEmpty<T, TException>(this Task<IEnumerable<T>> task, Func<TException> factory) where TException : Exception
{
var result = await task;
return result?.Any() ?? false ? result : throw factory();
}
/// <summary>
///
/// </summary>
/// <typeparam name="T"></typeparam>
/// <typeparam name="I"></typeparam>
/// <param name="task"></param>
/// <param name="act"></param>
/// <returns></returns>
public static async Task<I> Then<T, I>(this Task<T> task, Func<T, I> act)
{
var res = await task;
return act(res);
}
}
/// <summary>
///
/// </summary>
public static class Exceptions
{
/// <summary>
///
/// </summary>
public static NotFoundException NotFound() => new();
/// <summary>
///
/// </summary>
/// <returns></returns>
public static BadRequestException BadRequest() => new();
/// <summary>
///
/// </summary>
/// <returns></returns>
public static ForbiddenException Forbidden() => new();
}

View File

@ -2,7 +2,7 @@
using Microsoft.Extensions.Localization;
using System.Text.Encodings.Web;
namespace EnvelopeGenerator.Extensions
namespace EnvelopeGenerator.Application.Common.Extensions
{
public static class XSSExtensions
{

View File

@ -1,7 +1,7 @@
using DigitalData.Core.Abstraction.Application.Repository;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Repositories;
namespace EnvelopeGenerator.Application.Common.Interfaces.Repositories;
/// <summary>
///

View File

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

View File

@ -1,7 +1,7 @@
using DigitalData.Core.Abstraction.Application.Repository;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Repositories;
namespace EnvelopeGenerator.Application.Common.Interfaces.Repositories;
/// <summary>
///

View File

@ -1,8 +1,8 @@
using DigitalData.Core.Abstraction.Application.Repository;
using EnvelopeGenerator.Domain.Constants;
using EnvelopeGenerator.Domain.Entities;
using static EnvelopeGenerator.Domain.Constants;
namespace EnvelopeGenerator.Application.Contracts.Repositories;
namespace EnvelopeGenerator.Application.Common.Interfaces.Repositories;
/// <summary>
///

View File

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

View File

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

View File

@ -1,7 +1,7 @@
using DigitalData.Core.Abstraction.Application.Repository;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Repositories;
namespace EnvelopeGenerator.Application.Common.Interfaces.Repositories;
/// <summary>
///

View File

@ -1,7 +1,9 @@
using DigitalData.Core.Abstraction.Application.Repository;
using EnvelopeGenerator.Application.Envelopes.Queries;
using EnvelopeGenerator.Domain.Constants;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Repositories;
namespace EnvelopeGenerator.Application.Common.Interfaces.Repositories;
/// <summary>
///
@ -83,7 +85,7 @@ public interface IEnvelopeReceiverRepository : ICRUDRepository<EnvelopeReceiver,
/// <param name="max_status"></param>
/// <param name="ignore_statuses"></param>
/// <returns></returns>
Task<IEnumerable<EnvelopeReceiver>> ReadByUsernameAsync(string username, int? min_status = null, int? max_status = null, params int[] ignore_statuses);
Task<IEnumerable<EnvelopeReceiver>> ReadByUsernameAsync(string username, EnvelopeStatus? min_status = null, EnvelopeStatus? max_status = null, params EnvelopeStatus[] ignore_statuses);
/// <summary>
///

View File

@ -1,7 +1,8 @@
using DigitalData.Core.Abstraction.Application.Repository;
using EnvelopeGenerator.Domain.Constants;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Repositories;
namespace EnvelopeGenerator.Application.Common.Interfaces.Repositories;
/// <summary>
///
@ -38,5 +39,5 @@ public interface IEnvelopeRepository : ICRUDRepository<Envelope, int>
/// <param name="max_status"></param>
/// <param name="ignore_statuses"></param>
/// <returns></returns>
Task<IEnumerable<Envelope>> ReadByUserAsync(int userId, int? min_status = null, int? max_status = null, params int[] ignore_statuses);
Task<IEnumerable<Envelope>> ReadByUserAsync(int userId, EnvelopeStatus? min_status = null, EnvelopeStatus? max_status = null, params EnvelopeStatus[] ignore_statuses);
}

View File

@ -1,7 +1,7 @@
using DigitalData.Core.Abstraction.Application.Repository;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Repositories;
namespace EnvelopeGenerator.Application.Common.Interfaces.Repositories;
/// <summary>
///

View File

@ -1,7 +1,7 @@
using DigitalData.Core.Abstraction.Application.Repository;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Repositories;
namespace EnvelopeGenerator.Application.Common.Interfaces.Repositories;
/// <summary>
///

View File

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

View File

@ -1,7 +1,7 @@
using Dapper;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.SQLExecutor;
namespace EnvelopeGenerator.Application.Common.Interfaces.SQLExecutor;
/// <summary>
///

View File

@ -1,6 +1,6 @@
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.SQLExecutor;
namespace EnvelopeGenerator.Application.Common.Interfaces.SQLExecutor;
/// <summary>
///

View File

@ -1,4 +1,4 @@
namespace EnvelopeGenerator.Application.Contracts.SQLExecutor;
namespace EnvelopeGenerator.Application.Common.Interfaces.SQLExecutor;
/// <summary>
/// Provides methods for executing common queries on a given entity type.

View File

@ -1,4 +1,4 @@
namespace EnvelopeGenerator.Application.Contracts.SQLExecutor;
namespace EnvelopeGenerator.Application.Common.Interfaces.SQLExecutor;
/// <summary>
/// Represents a raw SQL query contract.

View File

@ -1,4 +1,4 @@
namespace EnvelopeGenerator.Application.Contracts.SQLExecutor;
namespace EnvelopeGenerator.Application.Common.Interfaces.SQLExecutor;
/// <summary>
/// Defines methods for executing raw SQL queries or custom SQL query classes and returning query executors for further operations.

View File

@ -1,6 +1,6 @@
using Dapper;
namespace EnvelopeGenerator.Application.Contracts.SQLExecutor;
namespace EnvelopeGenerator.Application.Common.Interfaces.SQLExecutor;
/// <summary>
///

View File

@ -1,6 +1,6 @@
using OtpNet;
namespace EnvelopeGenerator.Application.Contracts.Services;
namespace EnvelopeGenerator.Application.Common.Interfaces.Services;
/// <summary>
///

View File

@ -1,9 +1,9 @@
using DigitalData.Core.Abstraction.Application;
using DigitalData.Core.Abstraction.Application.DTO;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Application.Common.Dto;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Services;
namespace EnvelopeGenerator.Application.Common.Interfaces.Services;
/// <summary>
///

View File

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

View File

@ -1,7 +1,7 @@
using DigitalData.Core.Abstraction.Application;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Application.Common.Dto;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Services;
namespace EnvelopeGenerator.Application.Common.Interfaces.Services;
/// <summary>
///

View File

@ -1,10 +1,10 @@
using DigitalData.Core.Abstraction.Application;
using DigitalData.Core.Abstraction.Application.DTO;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Application.Common.Dto;
using EnvelopeGenerator.Domain.Constants;
using EnvelopeGenerator.Domain.Entities;
using static EnvelopeGenerator.Domain.Constants;
namespace EnvelopeGenerator.Application.Contracts.Services;
namespace EnvelopeGenerator.Application.Common.Interfaces.Services;
/// <summary>
///

View File

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

View File

@ -1,17 +1,17 @@
using DigitalData.Core.Abstraction.Application;
using DigitalData.Core.Abstraction.Application.DTO;
using EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
using EnvelopeGenerator.Application.DTOs.Receiver;
using EnvelopeGenerator.Application.Common.Dto.History;
using EnvelopeGenerator.Application.Common.Dto.Receiver;
using EnvelopeGenerator.Domain.Constants;
using EnvelopeGenerator.Domain.Entities;
using static EnvelopeGenerator.Domain.Constants;
namespace EnvelopeGenerator.Application.Contracts.Services;
namespace EnvelopeGenerator.Application.Common.Interfaces.Services;
/// <summary>
///
/// </summary>
[Obsolete("Use MediatR")]
public interface IEnvelopeHistoryService : ICRUDService<EnvelopeHistoryCreateDto, EnvelopeHistoryDto, EnvelopeHistory, long>
public interface IEnvelopeHistoryService : ICRUDService<HistoryCreateDto, HistoryDto, History, long>
{
/// <summary>
///
@ -56,7 +56,7 @@ public interface IEnvelopeHistoryService : ICRUDService<EnvelopeHistoryCreateDto
/// <param name="withSender"></param>
/// <param name="withReceiver"></param>
/// <returns></returns>
Task<IEnumerable<EnvelopeHistoryDto>> ReadAsync(int? envelopeId = null, string? userReference = null, ReferenceType? referenceType = null, EnvelopeStatus? status = null, bool withSender = false, bool withReceiver = false);
Task<IEnumerable<HistoryDto>> ReadAsync(int? envelopeId = null, string? userReference = null, ReferenceType? referenceType = null, EnvelopeStatus? status = null, bool withSender = false, bool withReceiver = false);
/// <summary>
///
@ -64,14 +64,14 @@ public interface IEnvelopeHistoryService : ICRUDService<EnvelopeHistoryCreateDto
/// <param name="envelopeId"></param>
/// <param name="userReference"></param>
/// <returns></returns>
Task<IEnumerable<EnvelopeHistoryDto>> ReadRejectedAsync(int envelopeId, string? userReference = null);
Task<IEnumerable<HistoryDto>> ReadRejectedAsync(int envelopeId, string? userReference = null);
/// <summary>
///
/// </summary>
/// <param name="envelopeId"></param>
/// <returns></returns>
Task<IEnumerable<ReceiverReadDto>> ReadRejectingReceivers(int envelopeId);
Task<IEnumerable<ReceiverDto>> ReadRejectingReceivers(int envelopeId);
/// <summary>
///

View File

@ -1,10 +1,10 @@
using DigitalData.Core.Abstraction.Application.DTO;
using DigitalData.EmailProfilerDispatcher.Abstraction.Contracts;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
using EnvelopeGenerator.Domain;
using EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver;
using EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiverReadOnly;
using EnvelopeGenerator.Domain.Constants;
namespace EnvelopeGenerator.Application.Contracts.Services;
namespace EnvelopeGenerator.Application.Common.Interfaces.Services;
/// <summary>
///
@ -19,7 +19,7 @@ public interface IEnvelopeMailService : IEmailOutService
/// <param name="tempType"></param>
/// <param name="optionalPlaceholders"></param>
/// <returns></returns>
Task<DataResult<int>> SendAsync(EnvelopeReceiverDto envelopeReceiverDto, Constants.EmailTemplateType tempType, Dictionary<string, object>? optionalPlaceholders = null);
Task<DataResult<int>> SendAsync(EnvelopeReceiverDto envelopeReceiverDto, EmailTemplateType tempType, Dictionary<string, object>? optionalPlaceholders = null);
/// <summary>
///
@ -35,11 +35,4 @@ public interface IEnvelopeMailService : IEmailOutService
/// <param name="envelopeReceiverDto"></param>
/// <returns></returns>
Task<DataResult<int>> SendAccessCodeAsync(EnvelopeReceiverDto envelopeReceiverDto);
/// <summary>
///
/// </summary>
/// <param name="envelopeReceiverDto"></param>
/// <returns></returns>
Task<DataResult<int>> SendTFAQrCodeAsync(EnvelopeReceiverDto envelopeReceiverDto);
}

View File

@ -1,8 +1,8 @@
using DigitalData.Core.Abstraction.Application;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
using EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiverReadOnly;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Services;
namespace EnvelopeGenerator.Application.Common.Interfaces.Services;
/// <summary>
///

View File

@ -1,13 +1,16 @@
using CommandDotNet;
using DigitalData.Core.Abstraction.Application;
using DigitalData.Core.Abstraction.Application.DTO;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
using EnvelopeGenerator.Application.DTOs.Messaging;
using EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver;
using EnvelopeGenerator.Application.Common.Dto.Messaging;
using EnvelopeGenerator.Application.Envelopes;
using EnvelopeGenerator.Application.Receivers.Queries.Read;
using EnvelopeGenerator.Application.Envelopes.Queries;
using EnvelopeGenerator.Application.Receivers.Queries;
using EnvelopeGenerator.Domain;
using EnvelopeGenerator.Domain.Constants;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Services;
namespace EnvelopeGenerator.Application.Common.Interfaces.Services;
/// <summary>
///
@ -120,7 +123,7 @@ public interface IEnvelopeReceiverService : IBasicCRUDService<EnvelopeReceiverDt
/// <param name="receiverQuery"></param>
/// <param name="ignore_statuses"></param>
/// <returns></returns>
Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUsernameAsync(string username, int? min_status = null, int? max_status = null, EnvelopeQuery? envelopeQuery = null, ReadReceiverQuery? receiverQuery = null, params int[] ignore_statuses);
Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUsernameAsync(string username, EnvelopeStatus? min_status = null, EnvelopeStatus? max_status = null, ReadEnvelopeQuery? envelopeQuery = null, ReadReceiverQuery? receiverQuery = null, params EnvelopeStatus[] ignore_statuses);
/// <summary>
///

View File

@ -1,9 +1,10 @@
using DigitalData.Core.Abstraction.Application;
using DigitalData.Core.Abstraction.Application.DTO;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Application.Common.Dto;
using EnvelopeGenerator.Domain.Constants;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Services;
namespace EnvelopeGenerator.Application.Common.Interfaces.Services;
/// <summary>
///
@ -40,5 +41,5 @@ public interface IEnvelopeService : IBasicCRUDService<EnvelopeDto, Envelope, int
/// <param name="max_status"></param>
/// <param name="ignore_statuses"></param>
/// <returns></returns>
Task<DataResult<IEnumerable<EnvelopeDto>>> ReadByUserAsync(int userId, int? min_status = null, int? max_status = null, params int[] ignore_statuses);
Task<DataResult<IEnumerable<EnvelopeDto>>> ReadByUserAsync(int userId, EnvelopeStatus? min_status = null, EnvelopeStatus? max_status = null, params EnvelopeStatus[] ignore_statuses);
}

View File

@ -1,7 +1,7 @@
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
using EnvelopeGenerator.Application.DTOs.Messaging;
using EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver;
using EnvelopeGenerator.Application.Common.Dto.Messaging;
namespace EnvelopeGenerator.Application.Contracts.Services;
namespace EnvelopeGenerator.Application.Common.Interfaces.Services;
/// <summary>
///

View File

@ -1,8 +1,8 @@
using DigitalData.Core.Abstraction.Application;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Application.Common.Dto;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Services;
namespace EnvelopeGenerator.Application.Common.Interfaces.Services;
/// <summary>
///

View File

@ -1,15 +1,16 @@
using DigitalData.Core.Abstraction.Application;
using DigitalData.Core.Abstraction.Application.DTO;
using EnvelopeGenerator.Application.DTOs.Receiver;
using EnvelopeGenerator.Application.Common.Dto.Receiver;
using EnvelopeGenerator.Application.Receivers.Commands;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Services;
namespace EnvelopeGenerator.Application.Common.Interfaces.Services;
/// <summary>
///
/// </summary>
[Obsolete("Use MediatR")]
public interface IReceiverService : ICRUDService<ReceiverCreateDto, ReceiverReadDto, Receiver, int>
public interface IReceiverService : ICRUDService<CreateReceiverCommand, ReceiverDto, Receiver, int>
{
/// <summary>
///
@ -17,7 +18,7 @@ public interface IReceiverService : ICRUDService<ReceiverCreateDto, ReceiverRead
/// <param name="emailAddress"></param>
/// <param name="signature"></param>
/// <returns></returns>
Task<DataResult<ReceiverReadDto>> ReadByAsync(string? emailAddress = null, string? signature = null);
Task<DataResult<ReceiverDto>> ReadByAsync(string? emailAddress = null, string? signature = null);
/// <summary>
///

View File

@ -1,6 +1,6 @@
using EnvelopeGenerator.Application.DTOs.Messaging;
using EnvelopeGenerator.Application.Common.Dto.Messaging;
namespace EnvelopeGenerator.Application.Contracts.Services;
namespace EnvelopeGenerator.Application.Common.Interfaces.Services;
//TODO: move to DigitalData.Core
/// <summary>

View File

@ -0,0 +1,88 @@
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>
///
/// </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
{
/// <summary>
///
/// </summary>
public PsPdfKitAnnotation PsPdfKitAnnotation { get; init; } = null!;
/// <summary>
///
/// </summary>
public EmailTemplateType TemplateType => EmailTemplateType.DocumentSigned;
/// <summary>
///
/// </summary>
public string EmailAddress => 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

@ -0,0 +1,34 @@
using DigitalData.Core.Abstraction.Application.Repository;
using EnvelopeGenerator.Domain.Entities;
using MediatR;
namespace EnvelopeGenerator.Application.Common.Notifications.DocSigned.Handlers;
/// <summary>
///
/// </summary>
public class AnnotationHandler : INotificationHandler<DocSignedNotification>
{
/// <summary>
///
/// </summary>
private readonly IRepository<ElementAnnotation> _repo;
/// <summary>
///
/// </summary>
/// <param name="repository"></param>
public AnnotationHandler(IRepository<ElementAnnotation> repository)
{
_repo = repository;
}
/// <summary>
///
/// </summary>
/// <param name="notification"></param>
/// <param name="cancel"></param>
/// <returns></returns>
public Task Handle(DocSignedNotification notification, CancellationToken cancel)
=> _repo.CreateAsync(notification.PsPdfKitAnnotation.Structured, cancel);
}

View File

@ -0,0 +1,39 @@
using EnvelopeGenerator.Application.DocStatus.Commands;
using EnvelopeGenerator.Domain.Constants;
using MediatR;
using System.Text.Json;
namespace EnvelopeGenerator.Application.Common.Notifications.DocSigned.Handlers;
/// <summary>
///
/// </summary>
public class DocStatusHandler : INotificationHandler<DocSignedNotification>
{
private readonly ISender _sender;
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
public DocStatusHandler(ISender sender)
{
_sender = sender;
}
/// <summary>
///
/// </summary>
/// <param name="notification"></param>
/// <param name="cancel"></param>
/// <returns></returns>
public async Task Handle(DocSignedNotification notification, CancellationToken cancel)
{
await _sender.Send(new SaveDocStatusCommand()
{
Envelope = new() { Id = notification.EnvelopeId },
Receiver = new() { Id = notification.ReceiverId},
Value = JsonSerializer.Serialize(notification.PsPdfKitAnnotation.Instant, Format.Json.ForAnnotations)
}, cancel);
}
}

View File

@ -0,0 +1,42 @@
using EnvelopeGenerator.Application.Common.Extensions;
using EnvelopeGenerator.Application.Histories.Commands;
using EnvelopeGenerator.Domain.Constants;
using MediatR;
namespace EnvelopeGenerator.Application.Common.Notifications.DocSigned.Handlers;
/// <summary>
///
/// </summary>
public class HistoryHandler : INotificationHandler<DocSignedNotification>
{
private readonly ISender _sender;
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
public HistoryHandler(ISender sender)
{
_sender = sender;
}
/// <summary>
///
/// </summary>
/// <param name="notification"></param>
/// <param name="cancel"></param>
/// <returns></returns>
public async Task Handle(DocSignedNotification notification, CancellationToken cancel)
{
if (notification.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,
Status = EnvelopeStatus.DocumentSigned,
}, cancel);
}
}

View File

@ -0,0 +1,50 @@
using DigitalData.Core.Abstraction.Application.Repository;
using DigitalData.EmailProfilerDispatcher.Abstraction.Entities;
using EnvelopeGenerator.Application.Common.Configurations;
using EnvelopeGenerator.Domain.Entities;
using Microsoft.Extensions.Options;
namespace EnvelopeGenerator.Application.Common.Notifications.DocSigned.Handlers;
/// <summary>
///
/// </summary>
public class SendSignedMailHandler : SendMailHandler<DocSignedNotification>
{
/// <summary>
///
/// </summary>
/// <param name="tempRepo"></param>
/// <param name="emailOutRepo"></param>
/// <param name="mailParamsOptions"></param>
/// <param name="dispatcherParamsOptions"></param>
public SendSignedMailHandler(IRepository<EmailTemplate> tempRepo, IRepository<EmailOut> emailOutRepo, IOptions<MailParams> mailParamsOptions, IOptions<DispatcherParams> dispatcherParamsOptions) : base(tempRepo, emailOutRepo, mailParamsOptions, dispatcherParamsOptions)
{
}
/// <summary>
///
/// </summary>
/// <param name="notification"></param>
/// <param name="emailOut"></param>
protected override void ConfigureEmailOut(DocSignedNotification notification, EmailOut emailOut)
{
emailOut.ReferenceString = notification.EmailAddress;
emailOut.ReferenceId = notification.ReceiverId;
}
/// <summary>
/// </summary>
/// <param name="notification"></param>
/// <returns></returns>
protected override Dictionary<string, string> CreatePlaceHolders(DocSignedNotification notification)
{
var placeHolders = new Dictionary<string, string>()
{
{ "[NAME_RECEIVER]", notification.Name ?? string.Empty },
{ "[DOCUMENT_TITLE]", notification.Envelope?.Title ?? string.Empty },
};
return placeHolders;
}
}

View File

@ -0,0 +1,53 @@
using DigitalData.Core.Abstraction.Application.Repository;
using EnvelopeGenerator.Domain.Entities;
using MediatR;
namespace EnvelopeGenerator.Application.Common.Notifications.RemoveSignature.Handlers;
/// <summary>
///
/// </summary>
public class RemoveAnnotationHandler : INotificationHandler<RemoveSignatureNotification>
{
private readonly IRepository<ElementAnnotation> _repo;
/// <summary>
///
/// </summary>
/// <param name="repository"></param>
public RemoveAnnotationHandler(IRepository<ElementAnnotation> repository)
{
_repo = repository;
}
/// <summary>
///
/// </summary>
/// <param name="notification"></param>
/// <param name="cancel"></param>
/// <returns></returns>
public Task Handle(RemoveSignatureNotification notification, CancellationToken cancel)
{
notification.ThrowIfHasNoFilter();
return _repo.DeleteAsync(annots =>
{
// envelope ID filter
if (notification.EnvelopeId is int envelopeId)
annots = annots.Where(annot => annot.Element!.Document.EnvelopeId == envelopeId);
// envelope UUID filter
if (notification.EnvelopeUuid is string envelopeUuid)
annots = annots.Where(annot => annot.Element!.Document.Envelope!.Uuid == envelopeUuid);
// receiver ID
if (notification.ReceiverId is int receiverId)
annots = annots.Where(annot => annot.Element!.ReceiverId == receiverId);
// receiver signature
if (notification.ReceiverSignature is string receiverSignature)
annots = annots.Where(annot => annot.Element!.Receiver!.Signature == receiverSignature);
return annots;
}, cancel);
}
}

View File

@ -0,0 +1,53 @@
using AngleSharp.Html;
using DigitalData.Core.Abstraction.Application.Repository;
using MediatR;
namespace EnvelopeGenerator.Application.Common.Notifications.RemoveSignature.Handlers;
/// <summary>
///
/// </summary>
public class RemoveDocStatusHandler : INotificationHandler<RemoveSignatureNotification>
{
private readonly IRepository<Domain.Entities.DocumentStatus> _repo;
/// <summary>
///
/// </summary>
/// <param name="repository"></param>
public RemoveDocStatusHandler(IRepository<Domain.Entities.DocumentStatus> repository)
{
_repo = repository;
}
/// <summary>
///
/// </summary>
/// <param name="notification"></param>
/// <param name="cancel"></param>
/// <returns></returns>
public Task Handle(RemoveSignatureNotification notification, CancellationToken cancel)
{
notification.ThrowIfHasNoFilter();
return _repo.DeleteAsync(statuses =>
{
// envelope ID filter
if (notification.EnvelopeId is int envelopeId)
statuses = statuses.Where(status => status.EnvelopeId == envelopeId);
// envelope UUID filter
if (notification.EnvelopeUuid is string envelopeUuid)
statuses = statuses.Where(status => status.Envelope!.Uuid == envelopeUuid);
// receiver Id filter
if (notification.ReceiverId is int receiverId)
statuses = statuses.Where(status => status.ReceiverId == receiverId);
// receiver signature filter
if (notification.ReceiverSignature is string receiverSignature)
statuses = statuses.Where(status => status.Receiver!.Signature == receiverSignature);
return statuses;
}, cancel);
}
}

View File

@ -0,0 +1,56 @@
using DigitalData.Core.Abstraction.Application.Repository;
using EnvelopeGenerator.Application.Common.Extensions;
using EnvelopeGenerator.Domain.Constants;
using MediatR;
namespace EnvelopeGenerator.Application.Common.Notifications.RemoveSignature.Handlers;
/// <summary>
///
/// </summary>
public class RemoveHistoryHandler : INotificationHandler<RemoveSignatureNotification>
{
private readonly IRepository<Domain.Entities.History> _repo;
/// <summary>
///
/// </summary>
/// <param name="repository"></param>
public RemoveHistoryHandler(IRepository<Domain.Entities.History> repository)
{
_repo = repository;
}
/// <summary>
///
/// </summary>
/// <param name="notification"></param>
/// <param name="cancel"></param>
/// <returns></returns>
public Task Handle(RemoveSignatureNotification notification, CancellationToken cancel)
{
notification.ThrowIfHasNoFilter();
return _repo.DeleteAsync(hists =>
{
hists = hists.Where(hist => hist.Status == EnvelopeStatus.DocumentSigned);
// envelope ID filter
if (notification.EnvelopeId is int envelopeId)
hists = hists.Where(hist => hist.EnvelopeId == envelopeId);
// envelope UUID filter
if (notification.EnvelopeUuid is string envelopeUuid)
hists = hists.Where(hist => hist.Envelope!.Uuid == envelopeUuid);
// receiver ID filter
if (notification.ReceiverId is int receiverId)
hists = hists.Where(hist => hist.Receiver!.Id == receiverId);
// receiver signature filter
if (notification.ReceiverSignature is string receiverSignature)
hists = hists.Where(hist => hist.Receiver!.Signature == receiverSignature);
return hists;
}, cancel);
}
}

View File

@ -0,0 +1,37 @@
using MediatR;
namespace EnvelopeGenerator.Application.Common.Notifications.RemoveSignature;
/// <summary>
///
/// </summary>
/// <param name="EnvelopeId"></param>
/// <param name="ReceiverId"></param>
/// <param name="EnvelopeUuid"></param>
/// <param name="ReceiverSignature"></param>
public record RemoveSignatureNotification(
int? EnvelopeId = null,
int? ReceiverId = null,
string? EnvelopeUuid = null,
string? ReceiverSignature = null
) : INotification
{
/// <summary>
///
/// </summary>
public bool HasFilter =>
EnvelopeId is not null
|| ReceiverId is not null
|| EnvelopeUuid is not null
|| ReceiverSignature is not null;
/// <summary>
///
/// </summary>
/// <exception cref="InvalidOperationException"></exception>
public void ThrowIfHasNoFilter()
{
if (!HasFilter)
throw new InvalidOperationException("At least one filter parameter must be provided.");
}
}

View File

@ -0,0 +1,135 @@
using DigitalData.Core.Abstraction.Application.Repository;
using DigitalData.EmailProfilerDispatcher.Abstraction.Entities;
using EnvelopeGenerator.Application.Common.Configurations;
using EnvelopeGenerator.Application.Common.Extensions;
using EnvelopeGenerator.Domain.Constants;
using EnvelopeGenerator.Domain.Entities;
using MediatR;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Options;
using Newtonsoft.Json;
namespace EnvelopeGenerator.Application.Common.Notifications;
/// <summary>
///
/// </summary>
public interface ISendMailNotification : INotification
{
/// <summary>
///
/// </summary>
public EmailTemplateType TemplateType { get; }
/// <summary>
///
/// </summary>
public string EmailAddress { get; }
}
/// <summary>
///
/// </summary>
public abstract class SendMailHandler<TNotification> : INotificationHandler<TNotification>
where TNotification : ISendMailNotification
{
/// <summary>
///
/// </summary>
protected readonly IRepository<EmailTemplate> TempRepo;
/// <summary>
///
/// </summary>
protected readonly IRepository<EmailOut> EmailOutRepo;
/// <summary>
///
/// </summary>
protected abstract Dictionary<string, string> CreatePlaceHolders(TNotification notification);
/// <summary>
///{ "[MESSAGE]", notification.Message },<br/>
///{ "[DOCUMENT_ACCESS_CODE]", notification.ReceiverAccessCode },<br/>
///{ "[REASON]", pReason }<br/>
///{ "[NAME_SENDER]", notification.Envelope.User?.FullName},<br/>
///{ "[NAME_PORTAL]", DispatcherParams. },<br/>
///{ "[SIGNATURE_TYPE]", "signieren" },<br/>
///{ "[LINK_TO_DOCUMENT]", notification.SignatureLink },<br/>
///{ "[LINK_TO_DOCUMENT_TEXT]", $"{notification.SignatureLink.Truncate(40)}.." },
/// </summary>
protected readonly MailParams MailParams;
/// <summary>
///
/// </summary>
protected readonly DispatcherParams DispatcherParams;
/// <summary>
///
/// </summary>
/// <param name="notification"></param>
/// <param name="emailOut"></param>
protected abstract void ConfigureEmailOut(TNotification notification, EmailOut emailOut);
/// <summary>
///
/// </summary>
/// <param name="tempRepo"></param>
/// <param name="emailOutRepo"></param>
/// <param name="mailParamsOptions"></param>
/// <param name="dispatcherParamsOptions"></param>
protected SendMailHandler(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="notification"></param>
/// <param name="cancel"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
public virtual async Task Handle(TNotification notification, CancellationToken cancel)
{
var placeHolders = CreatePlaceHolders(notification);
var temp = await TempRepo
.Where(x => x.Name == notification.TemplateType.ToString())
.SingleOrDefaultAsync(cancel)
?? throw new InvalidOperationException($"Receiver information is missing in the notification." +
$"{typeof(TNotification)}:\n {notification.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 = notification.EmailAddress,
EmailBody = temp.Body,
EmailSubj = temp.Subject,
AddedWhen = DateTime.UtcNow,
AddedWho = DispatcherParams.AddedWho,
SendingProfile = DispatcherParams.SendingProfile,
ReminderTypeId = DispatcherParams.ReminderTypeId,
EmailAttmt1 = DispatcherParams.EmailAttmt1,
WfId = (int)EnvelopeStatus.MessageConfirmationSent,
};
ConfigureEmailOut(notification, emailOut);
await EmailOutRepo.CreateAsync(emailOut, cancel);
}
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,17 @@
namespace EnvelopeGenerator.Application.Common.Query;
/// <summary>
/// Repräsentiert eine Abfrage für Umschläge.
/// </summary>
public record EnvelopeQueryBase
{
/// <summary>
/// Die eindeutige Kennung des Umschlags.
/// </summary>
public virtual int? Id { get; set; }
/// <summary>
/// Die universell eindeutige Kennung des Umschlags.
/// </summary>
public virtual string? Uuid { get; set; }
}

View File

@ -0,0 +1,62 @@
using DigitalData.Core.Exceptions;
using EnvelopeGenerator.Application.Common.Extensions;
namespace EnvelopeGenerator.Application.Common.Query;
/// <summary>
///
/// </summary>
public record EnvelopeReceiverQueryBase : EnvelopeReceiverQueryBase<EnvelopeQueryBase, ReceiverQueryBase>;
/// <summary>
///
/// </summary>
/// <typeparam name="TEnvelopeQuery"></typeparam>
/// <typeparam name="TReceiverQuery"></typeparam>
public record EnvelopeReceiverQueryBase<TEnvelopeQuery, TReceiverQuery>
where TEnvelopeQuery : EnvelopeQueryBase, new()
where TReceiverQuery : ReceiverQueryBase, new()
{
private string? _key;
/// <summary>
///
/// </summary>
public virtual string? Key
{
get => _key;
set
{
if (value is null)
{
_key = null;
return;
}
(string? EnvelopeUuid, string? ReceiverSignature) = value.DecodeEnvelopeReceiverId();
if (string.IsNullOrEmpty(EnvelopeUuid) || string.IsNullOrEmpty(ReceiverSignature))
throw new BadRequestException("Der EnvelopeReceiverKey muss ein gültiger Base64-kodierter String sein, der die EnvelopeUuid und die ReceiverSignature enthält.");
Envelope = new TEnvelopeQuery()
{
Uuid = EnvelopeUuid
};
Receiver = new TReceiverQuery()
{
Signature = ReceiverSignature
};
_key = value;
}
}
/// <summary>
/// Repräsentiert eine Abfrage für Umschläge.
/// </summary>
public virtual TEnvelopeQuery Envelope { get; set; } = new();
/// <summary>
/// Stellt eine Abfrage dar, um die Details eines Empfängers zu lesen.
/// um spezifische Informationen über einen Empfänger abzurufen.
/// </summary>
public virtual TReceiverQuery Receiver { get; set; } = new();
}

View File

@ -0,0 +1,20 @@
using AutoMapper;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Common.Query;
/// <summary>
///
/// </summary>
public class MappingProfile : Profile
{
/// <summary>
///
/// </summary>
public MappingProfile()
{
CreateMap<EnvelopeQueryBase, Envelope>();
CreateMap<ReceiverQueryBase, Receiver>();
CreateMap<EnvelopeReceiverQueryBase, EnvelopeReceiver>();
}
}

View File

@ -0,0 +1,33 @@
namespace EnvelopeGenerator.Application.Common.Query;
/// <summary>
/// Stellt eine Abfrage dar, um die Details eines Empfängers zu lesen.
/// um spezifische Informationen über einen Empfänger abzurufen.
/// </summary>
public record ReceiverQueryBase
{
/// <summary>
/// ID des Empfängers
/// </summary>
public virtual int? Id { get; set; }
/// <summary>
/// E-Mail Adresse des Empfängers
/// </summary>
public virtual string? EmailAddress { get; set; }
/// <summary>
/// Eindeutige Signatur des Empfängers
/// </summary>
public virtual string? Signature { get; set; }
/// <summary>
/// Checks whether any of the specified query criteria have a value.
/// </summary>
/// <remarks>
/// This property returns <c>true</c> if at least one of the fields
/// <see cref="Id"/>, <see cref="EmailAddress"/>, or <see cref="Signature"/> is not null.
/// <para>Usage example: The query can be executed only if at least one criterion is specified.</para>
/// </remarks>
public bool HasAnyCriteria => Id is not null || EmailAddress is not null || Signature is not null;
}

View File

@ -1,14 +1,14 @@
using Dapper;
using EnvelopeGenerator.Application.Contracts.SQLExecutor;
using EnvelopeGenerator.Application.Exceptions;
using DigitalData.Core.Exceptions;
using EnvelopeGenerator.Domain.Entities;
using EnvelopeGenerator.Application.Common.Interfaces.SQLExecutor;
namespace EnvelopeGenerator.Application.SQL;
namespace EnvelopeGenerator.Application.Common.SQL;
/// <summary>
///
/// </summary>
public class DocumentCreateReadSQL : ISQL<EnvelopeDocument>
public class DocumentCreateReadSQL : ISQL<Document>
{
/// <summary>
/// Base64, OUT_UID

View File

@ -1,9 +1,9 @@
using Dapper;
using EnvelopeGenerator.Application.Contracts.SQLExecutor;
using EnvelopeGenerator.Application.Common.Interfaces.SQLExecutor;
using EnvelopeGenerator.Domain.Entities;
using System.Data;
namespace EnvelopeGenerator.Application.SQL;
namespace EnvelopeGenerator.Application.Common.SQL;
/// <summary>
///

View File

@ -1,8 +1,8 @@
using Dapper;
using EnvelopeGenerator.Application.Contracts.SQLExecutor;
using EnvelopeGenerator.Application.Common.Interfaces.SQLExecutor;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.SQL;
namespace EnvelopeGenerator.Application.Common.SQL;
/// <summary>
///

View File

@ -1,6 +1,6 @@
using System.Globalization;
namespace EnvelopeGenerator.Application.SQL;
namespace EnvelopeGenerator.Application.Common.SQL;
/// <summary>
/// Extension method for converting objects to SQL parameter strings.

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,13 +1,12 @@
using EnvelopeGenerator.Application.Configurations;
using DigitalData.Core.Client;
using EnvelopeGenerator.Application.Common.Configurations;
using EnvelopeGenerator.Application.Common.Interfaces.Services;
using EnvelopeGenerator.Application.Services;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using DigitalData.Core.Client;
using QRCoder;
using EnvelopeGenerator.Application.Contracts.Services;
using System.Reflection;
using EnvelopeGenerator.Application.EnvelopeReceivers.Commands.Create;
namespace EnvelopeGenerator.Application;
@ -33,7 +32,6 @@ public static class DependencyInjection
services.TryAddScoped<IDocumentStatusService, DocumentStatusService>();
services.TryAddScoped<IEmailTemplateService, EmailTemplateService>();
services.TryAddScoped<IEnvelopeService, EnvelopeService>();
services.TryAddScoped<IEnvelopeCertificateService, EnvelopeCertificateService>();
services.TryAddScoped<IEnvelopeDocumentService, EnvelopeDocumentService>();
services.TryAddScoped<IEnvelopeReceiverService, EnvelopeReceiverService>();
services.TryAddScoped<IEnvelopeTypeService, EnvelopeTypeService>();
@ -48,7 +46,6 @@ public static class DependencyInjection
services.Configure<MailParams>(config.GetSection(nameof(MailParams)));
services.Configure<AuthenticatorParams>(config.GetSection(nameof(AuthenticatorParams)));
services.Configure<TotpSmsParams>(config.GetSection(nameof(TotpSmsParams)));
services.Configure<DbTriggerParams>(config.GetSection(nameof(DbTriggerParams)));
services.AddHttpClientService<GtxMessagingParams>(config.GetSection(nameof(GtxMessagingParams)));
services.TryAddSingleton<ISmsSender, GTXSmsSender>();
@ -59,7 +56,6 @@ public static class DependencyInjection
services.AddMediatR(cfg =>
{
cfg.RegisterServicesFromAssembly(Assembly.GetExecutingAssembly());
cfg.RegisterServicesFromAssembly(typeof(CreateEnvelopeReceiverCommandHandler).Assembly);
});
return services;

View File

@ -0,0 +1,12 @@
namespace EnvelopeGenerator.Application.DocStatus.Commands;
/// <summary>
///
/// </summary>
public record CreateDocStatusCommand : ModifyDocStatusCommandBase
{
/// <summary>
/// Gets timestamp when this record was added. Returns the StatusChangedWhen value.
/// </summary>
public DateTime AddedWhen => StatusChangedWhen;
}

View File

@ -0,0 +1,54 @@
using EnvelopeGenerator.Application.Common.Query;
using EnvelopeGenerator.Domain.Constants;
namespace EnvelopeGenerator.Application.DocStatus.Commands;
/// <summary>
///
/// </summary>
public record ModifyDocStatusCommandBase : EnvelopeReceiverQueryBase
{
/// <summary>
///
/// </summary>
public int? EnvelopeId => Envelope.Id;
/// <summary>
///
/// </summary>
public int? ReceiverId => Receiver.Id;
/// <summary>
///
/// </summary>
public override ReceiverQueryBase Receiver { get => base.Receiver; set => base.Receiver = value; }
/// <summary>
/// Gets the current status code.
/// </summary>
public DocumentStatus Status => Value is null ? DocumentStatus.Created : DocumentStatus.Signed;
/// <summary>
/// Gets or sets the display value associated with the status.
/// </summary>
public string? Value { get; set; }
/// <summary>
/// Gets timestamp when this record was added.
/// </summary>
public DateTime StatusChangedWhen { get; } = DateTime.Now;
/// <summary>
/// Maps the current command to a new instance of the specified type.
/// </summary>
/// <typeparam name="TDest"></typeparam>
/// <returns></returns>
public TDest To<TDest>() where TDest : ModifyDocStatusCommandBase, new()
=> new()
{
Key = Key,
Envelope = Envelope,
Receiver = Receiver,
Value = Value
};
}

View File

@ -0,0 +1,77 @@
using DigitalData.Core.Abstraction.Application.Repository;
using EnvelopeGenerator.Domain.Entities;
using MediatR;
using Microsoft.EntityFrameworkCore;
using AutoMapper;
using EnvelopeGenerator.Application.Common.Dto;
using EnvelopeGenerator.Application.Common.Extensions;
namespace EnvelopeGenerator.Application.DocStatus.Commands;
/// <summary>
/// Represents a command to save the status of a document, either by creating a new status or updating an existing one based on the provided envelope and receiver identifiers.
/// It returns the identifier of the saved document status.
/// </summary>
public record SaveDocStatusCommand : ModifyDocStatusCommandBase, IRequest<DocumentStatusDto?>;
/// <summary>
///
/// </summary>
public class SaveDocStatusCommandHandler : IRequestHandler<SaveDocStatusCommand, DocumentStatusDto?>
{
private readonly IMapper _mapper;
private readonly IRepository<DocumentStatus> _repo;
private readonly IRepository<Envelope> _envRepo;
private readonly IRepository<Receiver> _rcvRepo;
/// <summary>
///
/// </summary>
/// <param name="mapper"></param>
/// <param name="repo"></param>
/// <param name="rcvRepo"></param>
/// <param name="envRepo"></param>
public SaveDocStatusCommandHandler(IMapper mapper, IRepository<DocumentStatus> repo, IRepository<Receiver> rcvRepo, IRepository<Envelope> envRepo)
{
_mapper = mapper;
_repo = repo;
_rcvRepo = rcvRepo;
_envRepo = envRepo;
}
/// <summary>
///
/// </summary>
/// <param name="request"></param>
/// <param name="cancel"></param>
/// <returns></returns>
public async Task<DocumentStatusDto?> Handle(SaveDocStatusCommand request, CancellationToken cancel)
{
// ceck if exists
bool isExists = await _repo.ReadOnly().Where(request).AnyAsync(cancel);
var env = await _envRepo.ReadOnly().Where(request.Envelope).FirstAsync(cancel);
var rcv = await _rcvRepo.ReadOnly().Where(request.Receiver).FirstAsync(cancel);
request.Envelope.Id = env.Id;
request.Receiver.Id = rcv.Id;
if (isExists)
{
var uReq = request.To<UpdateDocStatusCommand>();
await _repo.UpdateAsync(uReq, q => q.Where(request), cancel);
}
else
{
var cReq = request.To<CreateDocStatusCommand>();
await _repo.CreateAsync(cReq, cancel);
}
var docStatus = await _repo.ReadOnly().Where(request).SingleOrDefaultAsync(cancel);
return _mapper.Map<DocumentStatusDto>(docStatus);
}
}

View File

@ -0,0 +1,14 @@
using EnvelopeGenerator.Domain;
namespace EnvelopeGenerator.Application.DocStatus.Commands;
/// <summary>
///
/// </summary>
public record UpdateDocStatusCommand : ModifyDocStatusCommandBase
{
/// <summary>
/// Gets timestamp when this record was added. Returns the StatusChangedWhen value.
/// </summary>
public DateTime? ChangedWhen => StatusChangedWhen;
}

View File

@ -0,0 +1,25 @@
using AutoMapper;
using EnvelopeGenerator.Application.DocStatus.Commands;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.DocStatus;
/// <summary>
///
/// </summary>
public class MappingProfile : Profile
{
/// <summary>
///
/// </summary>
public MappingProfile()
{
CreateMap<CreateDocStatusCommand, DocumentStatus>()
.ForMember(dest => dest.Envelope, opt => opt.Ignore())
.ForMember(dest => dest.Receiver, opt => opt.Ignore());
CreateMap<UpdateDocStatusCommand, DocumentStatus>()
.ForMember(dest => dest.Envelope, opt => opt.Ignore())
.ForMember(dest => dest.Receiver, opt => opt.Ignore());
}
}

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