635 Commits

Author SHA1 Message Date
6195d99fab refactor: remove usePdfBurner parameter from AddEnvelopeGeneratorServices 2025-11-12 16:55:06 +01:00
35dd2e8e07 refactor(email): replace Task.WhenAll with foreach in SendEmailBehavior
Changed the SendFinalEmailToReceiversAsync method to use a sequential `foreach` loop
instead of `Task.WhenAll` for sending history commands. Added a null check for
receiver emails to prevent potential exceptions.
2025-11-12 16:14:32 +01:00
fac5419589 refactor: simplify email sending logic and remove debug checks
- Removed unused `EnvelopeGenerator.Domain.Entities` import.
- Changed `SendFinalEmailWithAttachment` calls to explicitly cast envelope email type to `int`.
- Removed `Debug` conditional checks around history creation; history commands are now always sent.
- Made `SendFinalEmailWithAttachment` a static method for clarity.
2025-11-12 15:44:37 +01:00
d442ad0ce0 refactor(SendEmailBehavior): update to add history recors when request is not debug 2025-11-12 15:35:23 +01:00
cbe2acc37d feat(SendEmailBehavior): make SendEmailBehavior fully async and record history
- Added ISender dependency to send history commands
- Refactored SendFinalEmailToCreator and SendFinalEmailToReceivers to async
- Log attachment inclusion for emails
- Use Task.WhenAll for sending to multiple receivers
2025-11-12 15:32:06 +01:00
40cc467b47 feat(SendEmailBehavior): add SendEmailBehavior for sending final emails after PDF burn
- Implements IPipelineBehavior<BurnPdfCommand, byte[]> to send emails to creator and receivers.
- Logs debug information when sending emails and warnings if email sending is skipped.
- Uses Envelope's FinalEmailType to determine whether to send emails.
2025-11-12 15:12:04 +01:00
d1513dab5e feat(WritePdfBehavior): add WritePdfBehavior to handle PDF writing pipeline
- Implements WritePdfBehavior as an IPipelineBehavior for BurnPdfCommand
- Writes generated PDF to configured export path
- Automatically creates export directory if missing
- Adds logging for export path and file operations
2025-11-12 14:55:35 +01:00
dee424e7db feat(DefaultReadConfigQuery): add DefaultReadConfigQuery with caching and AutoMapper support
- Implemented DefaultReadConfigQuery and its handler for reading default configuration.
- Added memory caching using IMemoryCache to improve performance.
- Integrated AutoMapper to map Config entities to ConfigDto.
- Included extension method for easier MediatR query invocation.
- Added error handling for missing configuration records.
2025-11-12 14:34:30 +01:00
e57e9e1834 fix(PdfMergeBehavior): improve error diagnostics and exception messages in PdfMergeBehavior
- Added detailed request context to all MergeDocumentException messages
- Clarified conversion error message from "converted to PDF/A" to "converted to byte"
- Removed unused base64 conversion and redundant variable assignment
- Improved code readability and string concatenation formatting
2025-11-12 14:02:40 +01:00
5b30465126 refactor(pdf): simplify and inline PDF merge logic in PdfMergeBehavior
- Removed MergeDocuments static method; integrated merge process directly in Handle()
- Added null check for request.Report before merging
- Cleaned up redundant return and improved flow for memory stream handling
- Added DevExpress.XtraReports using directive
- Clarified comment and exception messages for PDF loading and merging
2025-11-12 13:59:35 +01:00
2dfa1de7e1 refactor(PdfMergeBehavior): update to use SaveToStream instead of ConvertToPDFA 2025-11-12 13:51:49 +01:00
e68965543e refactor(BurnPdfCommand): add Report property to forward report.
- Reverse the order in which behaviors are added.
2025-11-12 12:47:19 +01:00
958bcdfc42 chore: wrap AddReportBehavior with #if WINDOWS directive 2025-11-12 11:08:09 +01:00
d88ed324be refactor(Pdf\Behaviors): Handle the history recording process in another behavior named CreateHistoryBehavior 2025-11-12 11:00:24 +01:00
380b141738 refactor(project): add net8.0-windows target and unify net8.0 package references
- Updated <TargetFrameworks> to include net8.0-windows
- Consolidated package references for net8.0 and net8.0-windows into a single ItemGroup
2025-11-12 10:51:04 +01:00
4ed118ed2b update to add as closed behavior 2025-11-11 23:24:51 +01:00
Developer 02
350aa259c8 chore(Application): add DevExpress.Reporting.Core 2025-11-11 23:16:36 +01:00
Developer 02
737de2202e remove unnecessary projects 2025-11-11 23:08:50 +01:00
Developer 02
ff60cd7ef8 refactor: simplify AddReportBehavior by making DoCreateReport static and reordering base64 conversion 2025-11-11 22:57:50 +01:00
Developer 02
e1aa7fe650 chore(Application): add CommonServices reference 2025-11-11 22:51:14 +01:00
Developer 02
9c0b1e3fa8 chore(App.VB): fix reference 2025-11-11 22:33:46 +01:00
Developer 02
9c4766518e feat(AddReportBehavior): add PDF report generation logic with logging
- Introduced `ILogger<AddReportBehavior>` for logging support.
- Added `DoCreateReport` method to generate PDF from `EnvelopeReport` items.
- Added `ReportSource` class to structure report data.
- Retained existing history creation and MediatR pipeline behavior.
2025-11-11 21:40:20 +01:00
Developer 02
292b6b2ccf feat(AddReportBehavior): add report creation logic to AddReportBehavior
- Added CreateReport method to generate PDF report from envelope data
- Integrated call to CreateReport within pipeline after history creation
- Introduced error handling via CreateReportException for missing report data
- Added necessary using directives for EnvelopeReports, Exceptions, and Entities
2025-11-11 21:19:21 +01:00
Developer 02
6f9b5d4b13 feat(envelope-reports): add extension method for reading envelope reports via ISender 2025-11-11 19:21:22 +01:00
Developer 02
8459706c45 feat: implement ReadEnvelopeReportQuery with handler and repository integration
- Add ReadEnvelopeReportQuery record that returns IEnumerable<EnvelopeReport>
- Implement ReadEnvelopeReportQueryHandler with repository and AutoMapper integration
- Add ThrowIfNotFound property with JsonIgnore and NotMapped attributes
- Integrate IRepository<EnvelopeReport> for data access
- Add NotFoundException when no reports found and ThrowIfNotFound is true
- Configure Entity Framework Core using Microsoft.EntityFrameworkCore
- Add JSON serialization configuration with System.Text.Json
- Update using statements with necessary abstractions and exceptions
2025-11-11 18:22:23 +01:00
Developer 02
972c63388e add EnvelopeReport to EnvelopeReportDto mapping 2025-11-11 17:34:42 +01:00
Developer 02
cde9ed06a1 create EnvelopeReportDto 2025-11-11 17:32:52 +01:00
Developer 02
d94f885e92 init a query to read envelope report by envelope id via mediator 2025-11-11 17:27:46 +01:00
Developer 02
e6285f13f7 feat(AddReportBehavior): add conditional history creation based on Debug flag in AddReportBehavior 2025-11-11 13:08:34 +01:00
35b7b1a080 refactor(AddReportBehavior): update to add history record. 2025-11-10 17:05:35 +01:00
67d0980c63 move the behaviours about pdf to pdf dir 2025-11-10 16:46:10 +01:00
c6a99b56a2 add GdPicture packages via nuget 2025-11-10 16:18:42 +01:00
31f5d1f340 add SaveBurnedPdfBehavior to services 2025-11-10 15:29:16 +01:00
a2df5d7691 create SaveBurnedPdfBehavior 2025-11-10 15:13:57 +01:00
f8c586dd31 feat(FinishEnvelopeJob): add PDF burning with concurrency control
- Introduced PDFBurnerParams configuration for concurrency limit.
- Added SemaphoreSlim to handle concurrent PDF burning for envelopes.
- Updated job to call _mediator.BurnPdf for each envelope with error handling.
- Preserved logging of job execution and envelope UUIDs.
2025-11-10 15:01:07 +01:00
8aea3c8301 refactor(BurnPdfCommand): add extension methods for ISender
- Introduce BurnPdfCommandExtensions to simplify sending BurnPdfCommand via ISender
- Enables calling `sender.BurnPdf(envelopeId, cancel)` or `sender.BurnPdf(envelopeUuid, cancel)`
- No changes to the underlying PDF burning logic in BurnPdfCommandHandler
2025-11-10 14:00:21 +01:00
86c0a65540 refactor: add conditional PDFBurner and GdPicture service registration 2025-11-10 13:43:44 +01:00
d2e8f1fc5e refactor: simplify GdPicture license resolution in dependency injection 2025-11-10 13:29:02 +01:00
f8369e350f refactor(BurnPdfCommand): replace manual JSON serialization with ToJson extension
- Replaced `System.Text.Json.JsonSerializer.Serialize(request, Format.Json.ForDiagnostics)`
  with `request.ToJson(Format.Json.ForDiagnostics)` for better readability and consistency.
- No functional changes, purely a code style and maintainability improvement.
2025-11-10 13:01:33 +01:00
b8a2ad97ef refactor(BurnPdfCommand): simplify BurnPdfCommand and improve envelope/document handling
- Updated `BurnPdfCommand` to accept `EnvelopeId` or `EnvelopeUuid` instead of full `EnvelopeQueryBase` and document data.
- Reworked `BurnPdfCommandHandler` to fetch envelope and document from repositories, including proper validations and exceptions.
- Removed direct dependency on `Signature` repository; annotations now retrieved via document elements.
- Added detailed exception handling for missing envelope, document, or byte data.
- Minor namespace and using cleanup.
2025-11-10 12:58:04 +01:00
ffffc2d470 refactor(BurnPdfCommand): update BurnPdfCommand to use EnvelopeQueryBase and enhance request structure
- Replaced record-based BurnPdfCommand with class-based implementation
- Added Envelope property of type EnvelopeQueryBase
- Changed parameters to nullable (Document, InstantJSONList)
- Added ByCronService flag for cron-based PDF burning control
- Updated query logic to use request.Envelope.Id instead of EnvelopeId
- Improved code structure for flexibility and service integration
2025-11-10 09:30:04 +01:00
36b03da084 fix(DependencyInjection): change AnnotationManager registration from Scoped to Transient 2025-11-07 15:21:36 +01:00
defa53fa26 refactor(BurnPdfCommand): rename SourceBuffer to Document in BurnPdfCommand and handler
- Renamed parameter `SourceBuffer` to `Document` in BurnPdfCommand record
- Updated all usages of `request.SourceBuffer` to `request.Document`
- Reorganized method order for better readability (Handle moved up)
- No functional or behavioral changes introduced
2025-11-07 14:56:34 +01:00
6134b58a4c refactor(BurnPdfCommand): extract GdPicture and math helpers into extension classes and simplify BurnPdfCommandHandler
- Refactored BurnPdfCommandHandler to use new extension methods for cleaner annotation handling.
- Introduced ITextStyle interface to generalize font styling for text annotations.
- Updated PDFBurnerParams to implement ITextStyle for consistent font settings reuse.
- Added MathematExtensions for coordinate and unit conversion (ToInches, ToPointF).
- Added GdPictureExtensions to encapsulate annotation-related logic (form fields, images, ink).
- Improved readability and maintainability by removing redundant helper methods.
2025-11-07 14:46:55 +01:00
5299016b43 move PSDPFKitModels namespace to Dto and rename as PSPDFKitInstant 2025-11-07 13:51:53 +01:00
55c20e83d8 refactor: convert BurnPdfCommand to record and update handler to return byte[]
- Changed `BurnPdfCommand` from empty class to a `record` with properties: `SourceBuffer`, `InstantJSONList`, `EnvelopeId`.
- Updated `BurnPdfCommandHandler` to implement `IRequestHandler<BurnPdfCommand, byte[]>`.
- Modified `Handle` method to be async and use the `request` data to return PDF bytes.
- Removed obsolete `BurnPdfCommand` class and updated related logic accordingly.
2025-11-07 13:44:53 +01:00
f1a140faa7 feat(BurnPdfCommandHandler): implement AddInkAnnotation for Annotation parameter
- Added implementation for AddInkAnnotation(Annotation) to handle ink annotations from Annotation objects.
- Retained existing AddInkAnnotation(int, string) method for backward compatibility.
- Refactored PDF burning logic to support both Annotation-based and JSON-based annotations.
2025-11-07 13:24:26 +01:00
b20d25e5b9 feat(BurnPdfCommandHandler): implement AddInkAnnotation for freehand annotations
- Added implementation for AddInkAnnotation(int page, string value) to render ink annotations from JSON.
- Deserialize ink lines and stroke color, convert points to PDF coordinates, and add as freehand annotations.
- Retained placeholder for AddInkAnnotation(Annotation pAnnotation) for future use.
2025-11-07 13:21:33 +01:00
e21eb2c0d6 refactor(BurnPdfCommandHandler): rename AddInstantJSONAnnotationToPdf to AddInstantJsonAnnotationToPdf for consistent casing 2025-11-07 13:16:14 +01:00
d237b4ab95 feat(BurnPdfCommand): implement AddImageAnnotation with attachment handling
- Added logic to AddImageAnnotation to handle image attachments from a dictionary.
- Removed NotImplementedException placeholder for AddImageAnnotation with attachments.
- Refactored code to convert annotation bounds from pixels to inches before adding images.
2025-11-07 13:14:02 +01:00