Delete PDFs from root fixtures directory.
Files now organized in tests/php/fixtures/pdfs/ with catalog.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Create catalog system for managing real-world signed PDFs:
- PdfFixtureCatalog class with YAML-based metadata
- Filter by DocMDP level, TSA, signature tool, count
- Provides expected validation results for tests
- Includes PdfFixture wrapper for easy access
- Store real PDFs in tests/php/fixtures/pdfs/ directory
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Delete trait after migrating all methods to PdfGenerator.
The trait pattern was unnecessary for stateless utility methods.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Consolidate PDF fixture generation into a single static class:
- Migrate all methods from PdfFixtureTrait to PdfGenerator
- Convert trait methods to public static methods
- Maintain all existing functionality
- Includes 20+ methods for ISO 32000-1 edge case testing
This improves code organization and eliminates trait usage.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Add isDocMdpNoChangesAllowed() method to files store
- Update canAddSigner() to check DocMDP level 1 with existing signers
- Only blocks after first signer is added (not before)
- Encapsulates logic in reusable method
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Add docmdp_level to SELECT and GROUP BY in SignRequestMapper
- Format docmdpLevel as integer in API response
- Add docmdpLevel to FileService::loadLibreSignData()
- Ensures frontend receives per-file DocMDP configuration
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Update validateDocMdpAllowsSignatures() to check file's docmdpLevel first
- Falls back to PDF extraction for legacy files (level 0)
- Throws consistent error message for DocMDP level 1
- Prevents adding signatures to certified documents with no changes allowed
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Add DocMdpConfigService dependency to RequestSignatureService
- Create setDocMdpLevelFromGlobalConfig() method
- Save admin DocMDP configuration to file entity on creation
- Allows per-file DocMDP configuration instead of only global
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Removed IAppConfig mock from test setup to match updated
service constructor signature.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
IAppConfig was injected but never used in any method.
Removed dependency to clean up constructor.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Updated tests to inject FileStatusService and SignRequestStatusService
mocks. Added specific tests validating parallel and ordered flow
behavior with correct parameter ordering for determineInitialStatus.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Created test suite with 53 tests validating business rules for sign
request status determination. Covers notification scenarios, status
updates, and initial status calculation based on file status, signer
status, signing order, and flow type. Uses PHP 8 DataProvider
attributes for parameterized testing.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Created test suite with 23 tests covering all file status upgrade
scenarios and notification validation. Uses PHP 8 DataProvider
attributes for parameterized testing.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Injected FileStatusService and SignRequestStatusService to delegate
all status-related operations. Removed status determination methods
and notification validation logic, delegating to specialized services.
Updated method calls to use appropriate service methods.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Created dedicated service to manage sign request status determination
and validation. Implements shouldNotifySignRequest, canNotifySignRequest,
updateStatusIfAllowed, determineInitialStatus, and private helper methods
for status calculation based on file status, signer status, signing order,
and flow type (parallel/sequential).
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Created dedicated service to handle file status management.
Includes updateFileStatusIfUpgrade to upgrade file status and
canNotifySigners to validate if file status allows notifications.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
The RequestSignatureService constructor was updated to require 18 parameters
including IEventDispatcher, but the test was only passing 17 parameters.
This commit adds the missing mock dependency to fix all failing tests.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Extracts the SignRequestCanceledEvent dispatching logic from
unassociateToUser into a dedicated dispatchCancellationEventIfNeeded
method for better code organization and single responsibility.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Changes default values for email and push notifications to false
in LibresignActivitySettings, ensuring all LibreSign activity types
follow the same pattern and respect user opt-in preference.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Adds the SignRequestCanceled setting and provider to the
activity section of info.xml, making it available in the
Nextcloud activity system.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Registers all three listeners (Notification, Mail, and Activity)
for the SignRequestCanceledEvent in the application bootstrap.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Registers the cancellation event in the activity stream,
allowing users to see signature request cancellations
in their activity history.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Implements email notification for canceled signature requests.
Sends email to users informing them that their signature
request has been canceled.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Implements the notification message formatting in Notifier
to display cancellation notifications with proper subject
and message text.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Implements the notification handler for canceled signature requests.
Sends in-app notifications to users when their signature request
is canceled, respecting user activity settings preferences.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>