54 Commits

Author SHA1 Message Date
8aec69f0f9
Merge remote-tracking branch 'origin/signature-app-master' into 286-storedobject-voter 2024-07-16 13:34:36 +02:00
9e92ede16f
Handle cases when there are multiple EntityWorkflows associated with one entity 2024-07-15 21:22:30 +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
c1cf27c42d
Refactor workflow handlers and update comments
Changes include class refactoring for Workflow handlers, using `readonly` and better indentation in constructors for better readability. In addition, outdated comments are removed. Also, entity workflow handlers now implement the EntityWorkflowHandlerInterface type for better type safety.
2024-07-10 10:40:18 +02:00
fe6b4848e6
Implement workflow handlers for stored objects
Added new interface, EntityWorkflowWithStoredObjectHandlerInterface, which provides methods to handle workflows associated with stored objects. Two classes, AccompanyingPeriodWorkEvaluationDocumentWorkflowHandler and AccompanyingCourseDocumentWorkflowHandler, have been updated to implement this new interface. The EntityWorkflowManager class has also been updated to handle workflows associated with stored objects.
2024-07-10 10:40:18 +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
790576863f Merge signature-app-master into branch 2024-07-04 15:53:01 +02:00
21b79c1981 Php cs fixes 2024-07-04 11:39:02 +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
c9d2e37cee Implement logic to check if editing of document is blocked by workflow
Using the workflow handlers we return the workflow that is attached to an object
so that within the workflowDocumentService we can then check whether this workflow blocks
the edition of a document.
2024-07-01 12:14:03 +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
f889d67e94
fixes after merge of master into upgrade-sf4 2024-02-12 22:31:16 +01:00
036fe8d6f8
upgrade php-cs 3.49 2024-02-07 10:43:53 +01:00
3c8e59e088 php cs fixes after updating php cs fixer 2024-01-10 10:31:25 +01:00
bc2041cbdd
apply more cs rules for php-cs 2023-10-17 13:27:03 +02:00
d2323e91ca
new cs rule: single_line_empty_body
Rule is added to the last version of php-cs-fixer
2023-09-12 15:58:59 +02:00
efaa01f4f6
DX: rector apply rules 'symfony up to 4.4 2023-05-05 18:21:33 +02:00
6d63177ff4
apply rules rector up to php82 2023-05-01 21:39:45 +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
1cd153fb78
DX: fix CS 2023-04-13 09:58:22 +02:00
0335986326
Merge remote-tracking branch 'origin/master' into issue706_cc_in_workflow-2 2023-04-13 09:53:23 +02:00
nobohan
a8c2750ac8 Feature: add cc users in workflow: move isNotificationCc to WorkflowNotificationHandler 2023-03-29 11:19:52 +02:00
nobohan
1789a75216 Feature: send notification on ccuser for workflows 2023-03-29 11:19:51 +02:00
48772efd54
DX: fix phpstan issues 2023-03-28 22:32:08 +02:00
4c7a16587b [workflow][method] add method to get involved/suggested users 2023-03-15 09:37:56 +01:00
055acbf43c DX: more code style fixes 2022-11-07 11:30:51 +01:00
9699e2304a fix cs: declare type and license header mismatch 2022-10-06 22:25:43 +02:00
67c3f3a840 fix cs with licencse header 2022-10-05 17:08:14 +02:00
a967e1ed17 fix cs 2022-10-05 15:23:28 +02:00
6bd0bcff6e Fix: Workflow: the notification is send when the user is added on first
step.

See https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/813
2022-09-19 21:27:07 +02:00
f917be0958 type hinting param for psalm 2022-04-30 02:12:29 +02:00
b2a61071bf create voter which blocks deletion if a workflow exists 2022-03-07 00:30:53 +01:00
432cce280b simplify showing title of workflow, and add handler for evaluationDocument 2022-02-25 14:02:36 +01:00
18836f312a fix cs 2022-02-25 12:11:05 +01:00
2b257cc402 improve title rendering on workflows 2022-02-25 12:09:53 +01:00
b7d6d69101 list workflow on index pages 2022-02-25 11:51:28 +01:00
1479e2ae9a entity workflow: handle sending an access key by email 2022-02-24 21:53:05 +01:00
ff1ff8f5bb workflow: allow a user to get access to validation step by an access key 2022-02-24 12:17:13 +01:00
1fda56b5f7 Merge remote-tracking branch 'origin/master' into workflow/fix-sending-notifications 2022-02-17 23:34:20 +01:00
45beb27f83 fix sending notifications 2022-02-16 21:54:37 +01:00
b6c118a0c8 add informations to workflow normalization 2022-02-14 20:02:24 +01:00
e3c5f6f95f fix phpcs, psalm and phpstan 2022-02-11 13:07:38 +01:00
1e81256404 fix cs 2022-02-08 19:37:59 +01:00
211ecf1c3e add cache to workflow counter 2022-02-02 23:19:59 +01:00
76932e6e8c bugfix in notificationhandler. Not sure about the fix in the template 2022-02-01 17:23:12 +01:00
97d2e3d5b5 counter created for workflows for which user is a destuser and that are not finalized 2022-02-01 17:22:45 +01:00
de1dddbb85 validation: no more workflow without dest 2022-02-01 12:19:51 +01:00