71 Commits

Author SHA1 Message Date
86ec6f82da
Do not block transition in EntityWorkflow when the user is member of a dest user group
- refactor EntityWorkflowGuardTransition + tests
- allow to find easily user within userGroup by adding a dedicated method to UserGroup::contains
2024-09-26 16:04:53 +02:00
17f4c85fa5
Add user group support in entity workflow steps
Enhanced the WorkflowTransitionContextDTO to include user groups alongside individual users for future steps. Updated the relevant entity and form classes to accommodate this change and included the necessary database migration script.
2024-09-26 15:39:13 +02:00
83121c2a83
Implement signature cancellation feature
Added functionality to cancel signatures in workflow, including controller, view, and tests. Updated translations and adjusted templates to support and display cancellation actions.
2024-09-25 10:58:53 +02:00
9f1afb8423
Add access controls and permissions for signature steps
Implemented a Voter to enforce permissions on signature steps, ensuring only authorized users can sign steps. Updated relevant controllers and templates to reflect these permissions, and added corresponding tests to validate the changes.
2024-09-13 17:04:57 +02:00
70671dadac
Refactor workflow guard logic and add internal methods
Removed guard logic from EntityWorkflowTransitionEventSubscriber and created a new EntityWorkflowGuardTransition class for separation of concerns. Marked several setter methods in EntityWorkflowStepSignature as internal to guide proper usage. Added comprehensive tests to ensure the new guard logic functions correctly.
2024-09-11 21:13:58 +02:00
nobohan
1197a46f5f
Refactor PDF signature handling and add signature state changer
Simplified PdfSignedMessageHandler by delegating signature state changes to a new SignatureStepStateChanger class. Added utility method to EntityWorkflowStepSignature for checking pending signatures and created new test cases for the SignatureStepStateChanger.
2024-09-10 21:27:55 +02:00
1ddd283f26
Add signer type differentiation for workflows
Added a method to determine if the signer is a 'person' or 'user'. Updated the signature template to handle both types accordingly, ensuring the correct entity type is displayed in workflow signatures.
2024-09-10 17:48:32 +02:00
f4356ac249
Add test for detecting stale workflows and enhance handler
Added a new test to check if workflows are stale in EntityWorkflowTest. Enhanced CancelStaleWorkflowHandler to handle stale workflows more accurately, including checking if workflows have transitioned recently. Updated EntityWorkflow entity to cascade remove workflow steps.

Refactor tests for handler, to avoid using $kernel during tests
2024-09-09 15:08:39 +02:00
2e69d2df90
Adjust test to work with actual workflow + minor fix of handler logic 2024-09-09 10:46:33 +02:00
49ad25b4c8
Refactor WorkflowOnHoldController and improve tests
Refactored WorkflowOnHoldController to remove dependencies and improve redirect handling. Updated test cases to use PHPUnit instead of KernelTestCase and mock proper dependencies. Added relationship handling in EntityWorkflowStep to manage EntityWorkflowStepHold instances accurately.
2024-09-06 14:02:11 +02:00
ad94310981
Refactor workflow hold functionality to avoid relying on database to perform some checks on "user holds entityworkflow"
Simplify the logic in handling workflow on hold status by moving related checks and operations to `EntityWorkflowStep` and `EntityWorkflow` entities. This includes implementing new methods to check if a step or workflow is held by a specific user and refactoring the controller actions to use these methods.
2024-09-05 20:46:29 +02:00
e8f09b507f
Fix cs after php-cs-fixer upgrade, fix phpstan and rector errors 2024-09-05 18:00:37 +02:00
deb4bda16e
Add unique constraint as attribute on EntityWorkflowStepHold class 2024-09-05 17:19:23 +02:00
18abc84e68
Rector fixes 2024-09-05 17:18:43 +02:00
e85c31826f
php cs fixes 2024-09-05 17:18:42 +02:00
15eaf648df
Add label to workflow listing and history to indicate whether it's on hold 2024-09-05 17:18:42 +02:00
9475a708c3
Add EntityWorkflowStepHold entity to allow workflow to be put on hold by user
Entity created, migration, and repository.
2024-09-05 17:13:20 +02:00
ee6edba206
Create isSigned method in EntityWorkflowStepSignature.php
Refactorization and ease of use in template and workflow controller
2024-09-04 17:08:35 +02:00
313fb9ffdf
PHP CS Fixer updated (3.63.1 -> v3.64.0) 2024-09-04 14:38:56 +02:00
e17203ca3a
Add PDF signature zone availability checks
Introduce `PDFSignatureZoneAvailable` service to check available PDF signature zones. Updated `WorkflowAddSignatureController` to use the new service. Added unit tests to verify the correctness of the functionality.
2024-09-04 13:55:08 +02:00
8a374864fa
update code style after upgrade rector and phpstan 2024-08-28 14:03:26 +02:00
bb848746d5
Merge branch 'upgrade-sf5' into signature-app-master 2024-08-28 13:23:12 +02:00
b0485dbcc8
Replace ArrayCollection with Collection&Selectable on some entity typing (fix previous commit)
Updated entity properties to use Collection&Selectable for better type safety and interoperability. This change affects User, Household, Calendar, Person, AccompanyingPeriod, and EntityWorkflow classes.
2024-08-28 12:04:43 +02:00
c16219dc6d
Force typing for ArrayIterator in EntityWorkflow 2024-08-28 11:48:24 +02:00
ad47804c91 Apply rector changes to Collection typing 2024-08-27 16:23:08 +02:00
85e2466611 Cherry-pick phpstan fixes after rector changes 2024-08-27 16:09:12 +02:00
db94af0958
Add support for user signatures in workflow transitions
This update introduces the ability to specify user signatures in workflow transitions. It allows a nullable user to be declared that may be requested to apply a signature. The code now handles the use-case of signing a transition by a user in addition to previous functionality of having it signed by a "Person" entity. Corresponding tests are also updated to validate this new feature.
2024-07-10 12:47:02 +02:00
b5af9f7b63
Add futurePersonSignatures property to WorkflowTransitionContextDTO
A new property named futurePersonSignatures has been added to the WorkflowTransitionContextDTO class. This will hold a list of Person objects expected to sign the next step, improving the scope of information available within the workflow context.
2024-07-10 10:40:18 +02:00
7f3de62b2c
Move the metadata on each workflow transition from the event subscriber to the entity EntityWorkflow::setStep method
The main update is in the setStep method of EntityWorkflow, where parameters are added to capture the transition details. These include the exact transition, the user who made the transition and the time of transition.

The WorkflowController extracts this information and put it into the transition's context. The MarkingStore transfer it to the EntityWorkflow::setStep method, and all metadata are recorded within the entities themselve.
2024-07-10 10:40:17 +02:00
a309cc0774
Refactor workflow classes and forms
- the workflow controller add a context to each transition;
- the state of the entity workflow is applyied using a dedicated marking store
- the method EntityWorkflow::step use the context to associate the new step with the future destination user, cc users and email. This makes the step consistent at every step.
- this allow to remove some logic which was processed in eventSubscribers,
- as counterpart, each workflow must specify a dedicated marking_store:

```yaml
framework:
    workflows:
        vendee_internal:
            # ...
            marking_store:
                service: Chill\MainBundle\Workflow\EntityWorkflowMarkingStore
```
2024-07-02 08:30:28 +02:00
3db4fff80d
Add signature functionality to workflow entities
Created new files to add signature functionality to the workflow entities, including signature state enums and signature metadata. Added these changes to the migration script as well. Updated EntityWorkflowStep to include a collection for signatures.
2024-07-01 14:50:03 +02:00
06dd7dd4f5
apply rector rules 2024-05-28 14:58:09 +02:00
73d6578a3a
Fix workflow configuration 2024-04-29 15:28:24 +02:00
5be85a4fc6
Refactored code to use PHP8 attributes instead of annotations
In this change, Doctrine and validation annotations have been replaced with PHP8 Attributes. The Rector tool has been configured with a list of annotations to convert to attributes. As a consequence, the PHPStan's rules have been updated to reflect these changes. The PHP8's nullable operator (?) has been added where required, and comments in field declaration have been replaced with #[Attribute] syntax.
2024-04-08 12:11:29 +02:00
0ff4593863
Apply rector rules: add annotation for doctrine mapping 2024-04-05 13:11:42 +02:00
72016e1a21
Apply rector rules: add annotation for doctrine mapping 2024-04-05 00:01:30 +02:00
579bd829f8
Apply rector rules: symfony up to 54 2024-04-04 23:30:25 +02:00
bc2041cbdd
apply more cs rules for php-cs 2023-10-17 13:27:03 +02:00
075aca493b
DX: type-hing oneToMany and ManyToMany properties as collection 2023-07-19 16:21:17 +02:00
dde3002100
DX: apply rector rules up to php8.0 2023-04-28 22:30:33 +02:00
746ed4f5e5
DX: fix cs 2023-04-15 00:43:55 +02:00
858ade467c
DX: rector rules upt to PHP 74 2023-04-15 00:20:19 +02:00
a21637331f
Fixed: [workflow] validation of users in cc and dest
The validation is processed at the form step, so before the transition is processed
2023-04-13 12:24:44 +02:00
nobohan
8c37afa3a9 Feature: add cc users in workflow: add constraint validation on EntityWorkflowStep 2023-03-29 12:09:12 +02:00
nobohan
a3db67fd1e Add users in cc in workflow: fix code style 2023-03-29 11:19:52 +02:00
nobohan
2b3d7f34fc Feature: Add new field ccuser in workflow step form 2023-03-29 11:19:51 +02:00
nobohan
cbc3ee68b5 Feature: Add new field ccuser in workflow step entity 2023-03-29 11:19:51 +02:00
eaea702454 FIX add initial user as suggestion and fix error when there are no suggestions 2023-03-15 10:14:25 +01:00
67e68ac149 FIX [review] processing review, but stuck at transformation of json string to array 2023-03-15 09:37:56 +01:00
4c7a16587b [workflow][method] add method to get involved/suggested users 2023-03-15 09:37:56 +01:00