[stable32] feat: file level signature flow#6171
Merged
vitormattos merged 18 commits intostable32from Dec 13, 2025
Merged
Conversation
Add toNumeric() and fromNumeric() methods to enable conversion between SignatureFlow enum values and their integer database representations. - PARALLEL = 1 - ORDERED_NUMERIC = 2 This allows storing signature flow as integers in the database while maintaining type-safe enum usage in the code. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Add signature_flow column to store signature flow mode at file level. - Column type: SMALLINT NOT NULL DEFAULT 1 - 1 = parallel (default) - 2 = ordered_numeric This enables per-file configuration of signature flow, overriding the global application setting when specified. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Add signatureFlow property and enum conversion helper methods to File entity. - New protected property: signatureFlow (SMALLINT, default 1) - getSignatureFlowEnum(): Returns SignatureFlow enum from integer - setSignatureFlowEnum(): Sets integer from SignatureFlow enum These methods provide type-safe access to signature flow configuration stored in the database. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Replace global config dependency with file-level signature flow. - Add setFile() method to inject File entity - Replace getSignatureFlow() to read from file instead of IAppConfig - Remove IAppConfig dependency (no longer needed) - Add validation: throws LogicException if getSignatureFlow() called without file This enables per-file signature flow configuration while maintaining backward compatibility through database default values. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Add optional signatureFlow parameter to POST /request-signature API. - Accepts 'parallel' or 'ordered_numeric' values - Falls back to global configuration if not provided - Documented in PHPDoc and OpenAPI annotations This enables clients to specify signature flow mode per document when creating signature requests. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Add signature flow parameter processing and file configuration logic. - Parse signatureFlow from request data and convert to enum - Fall back to global config if parameter invalid or missing - Set file entity signature flow via setSignatureFlowEnum() - Initialize SequentialSigningService with file entity context - Add IAppConfig dependency for global fallback This completes the backend logic for per-file signature flow configuration with graceful fallback to system defaults. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…vice Update releaseNextOrder call to provide file entity context. - Call setFile() before releaseNextOrder() - Enables SequentialSigningService to read file-level signature flow This ensures signature flow logic uses the correct per-file configuration during document signing workflow. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Expose signature flow configuration in file list and detail endpoints. FileService changes: - Add signatureFlow to fileData object in formatFile() SignRequestMapper changes: - Include f.signature_flow in SELECT query - Convert numeric value to enum string in formatListRow() - Remove signature_flow from response (cleanup after conversion) This enables frontend to display and use per-file signature flow configuration. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Update API documentation for request-signature endpoint. - Add signatureFlow parameter to request body schema - Type: string, nullable - Description documents accepted values and fallback behavior This ensures API consumers have accurate documentation for the signature flow parameter. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Move database value constants from File entity to SignatureFlow enum where they belong as the single source of truth. - Add SignatureFlow::NUMERIC_PARALLEL and NUMERIC_ORDERED_NUMERIC - Remove circular dependency between File and SignatureFlow - Update all references to use enum constants - Use descriptive names instead of abbreviations This follows single responsibility principle: the enum owns its database representation. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Update generated TypeScript types to include signatureFlow parameter. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Add signatureFlow field to ValidateFile schema in OpenAPI specs and ResponseDefinitions. - Update openapi.json and openapi-full.json schemas - Add signatureFlow to LibresignValidateFile psalm type - Mark as required field with integer type This fixes OpenAPI validation errors in API tests. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Replace global config usage with file-level signature flow from store. - RequestSignatureTab.vue: Compute signatureFlow from file data - Signer.vue: Read signatureFlow from file instead of loadState - Signers.vue: Check file.signatureFlow for ordered flow mode - files.js: Use file.signatureFlow for signer order management This enables per-file signature flow configuration in the UI. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Add comprehensive unit tests for the signature flow implementation. - SequentialSigningServiceTest: Test flow detection and order assignment - FileTest: Test enum conversion methods in File entity - RequestSignatureServiceTest: Fix constructor to include IAppConfig mock Tests validate the core logic without focusing on coverage metrics. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Complete the OpenAPI schema update by adding signatureFlow field to the ValidateFile schema definition. This was manually corrected after the initial automated update. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
When user provides a specific signing order, the next auto-assigned order should be the provided value + 1. Changed condition from > to >= and set currentOrder to userProvidedOrder + 1 instead of just userProvidedOrder. This ensures proper order sequencing when mixing user-provided and auto-assigned orders. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of PR #6169