15 Commits

Author SHA1 Message Date
318599334e
Fix phpstan issues 2023-02-28 21:43:28 +01:00
a16244a3f5 Feature: [docgen] generate documents in an async queue
The documents are now generated in a queue, using symfony messenger. This queue should be configured:

```yaml
# app/config/messenger.yaml
framework:
    messenger:
        # reset services after consuming messages
        # reset_on_message: true

        failure_transport: failed

        transports:
            # https://symfony.com/doc/current/messenger.html#transport-configuration
            async: '%env(MESSENGER_TRANSPORT_DSN)%'
            priority:
                dsn: '%env(MESSENGER_TRANSPORT_DSN)%'
            failed: 'doctrine://default?queue_name=failed'

        routing:
            # ... other messages
            'Chill\DocGeneratorBundle\Service\Messenger\RequestGenerationMessage': priority
```

`StoredObject`s now have additionnal properties:

* status (pending, failure, ready (by default) ), which explain if the document is generated;
* a generationTrialCounter, which is incremented on each generation trial, which prevent each generation more than 5 times;

The generator computation is moved from the `DocGenTemplateController` to a `Generator` (implementing `GeneratorInterface`. 

There are new methods to `Context` which allow to normalize/denormalize context data to/from a messenger's `Message`.
2023-02-28 15:25:47 +00:00
9676975cd8
Revert "Feature: [docgen][stored object] handler for request generator and required fixes"
This reverts commit 91d21ba939e39af504888be3cced98d0b95a92bb.
2023-02-16 14:08:11 +01:00
91d21ba939
Feature: [docgen][stored object] handler for request generator and required fixes 2023-02-14 23:26:00 +01:00
31f048b8e8 Feature: [person][docgen] Add a title to document in person docgen
context
2022-10-19 14:12:47 +02:00
a8a206557b Fixed: add scope to generated document ref #11 2022-10-10 14:25:07 +02:00
7df203633d add scope to docs if required 2022-10-10 14:25:07 +02:00
49731777b4 fix cs: declare type and license header mismatch 2022-10-06 20:51:44 +02:00
63137c67f4 fix cs 2022-10-05 16:55:13 +02:00
9680f7c01e remove deprecated notation for getting entity 2022-05-27 16:34:30 +02:00
84f9fdba28 add budget to docgen 2022-03-24 18:22:49 +01:00
nobohan
4406016f82 code fix for PersonContext 2022-03-03 10:17:16 +01:00
nobohan
88e9a96e0e Person document generation: clean build Admin form + add household and relations groups 2022-03-01 15:51:34 +01:00
nobohan
7aefa5014c Add docgen:read group on Person + 2 fields in PersonContext admin form 2022-03-01 15:17:17 +01:00
nobohan
d163783ed3 Person Document: add a PersonContext class 2022-03-01 15:17:17 +01:00