Skip to content

Commit

Permalink
Merge pull request #7 from CommonGateway/feature/XW-41/noordwijk-config
Browse files Browse the repository at this point in the history
Noordwijk specific sync config added
  • Loading branch information
bbrands02 authored Aug 25, 2023
2 parents 70625cc + 0b7bfbb commit ca71b87
Show file tree
Hide file tree
Showing 12 changed files with 279 additions and 59 deletions.
4 changes: 3 additions & 1 deletion .phpdoc-md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ return (object)[
'format' => 'github',
'classes' => [
'\CommonGateway\PDDBundle\Service\InstallationService',
'\CommonGateway\PDDBundle\Service\PDDService'
'\CommonGateway\PDDBundle\Service\PDDService',
'\CommonGateway\PDDBundle\Service\SyncXxllncCasesService',
'\CommonGateway\PDDBundle\Command\SyncXxllncCasesCommand'
],
];
12 changes: 0 additions & 12 deletions Installation/Action/pdd.SyncCasesAction.action.json

This file was deleted.

16 changes: 16 additions & 0 deletions Installation/Action/pdd.SyncNoordwijkCasesAction.action.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"title": "SyncNoordwijkCasesAction",
"$id": "https://commongateway.nl/pdd.SyncNoordwijkAction.action.json",
"$schema": "https://docs.commongateway.nl/schemas/Action.schema.json",
"version": "0.0.1",
"listens": ["pdd.default.listens","pdd.noordwijk.listens"],
"configuration": {
"oidn": "unknown",
"source": "https://commongateway.woo.nl/source/noordwijk.zaaksysteem.source.json"
},
"conditions":
{
"==": [1, 1]
},
"class": "CommonGateway\\PDDBundle\\ActionHandler\\SyncXxllncCasesHandler"
}
4 changes: 2 additions & 2 deletions Installation/Cronjob/pdd.default.cronjob.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"title": "PDD cronjob",
"title": "PDD default cronjob",
"$id": "https://commongateway.nl/pdd.default.cronjob.json",
"$schema": "https://docs.commongateway.nl/schemas/Cronjob.schema.json",
"version": "0.0.1",
"version": "0.0.2",
"description": "This cronjob fires all the pdd actions every 5 minutes",
"crontab": "*/5 * * * *",
"throws": [
Expand Down
12 changes: 12 additions & 0 deletions Installation/Cronjob/pdd.noordwijk.cronjob.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"title": "PDD noordwijk cronjob",
"$id": "https://commongateway.nl/pdd.noordwijk.cronjob.json",
"$schema": "https://docs.commongateway.nl/schemas/Cronjob.schema.json",
"version": "0.0.1",
"description": "This cronjob fires the Noordwijk actions every 5 minutes",
"crontab": "*/5 * * * *",
"throws": [
"pdd.noordwijk.listens"
],
"isEnabled": false
}
5 changes: 3 additions & 2 deletions Installation/Mapping/pdd.xxllncCaseToWoo.mapping.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"passTrough": false,
"mapping": {
"_sourceId": "id",
"oidn": "{% if oidn|default %}{{ oidn }}{% else %}unknown{% endif %}",
"UUID": "case.class_uuid",
"ID": "id",
"Object_ID": "object_id",
Expand All @@ -17,8 +18,8 @@
"Beschrijving": "values.case.subject",
"Samenvatting": "values.case.subject",
"Verzoeker": "values.case.requestor.name",
"Ontvangstdatum": "values.date_created",
"Besluitdatum": "",
"Ontvangstdatum": "{{ 'now'|date('Y-m-dTH:i:s') }}",
"Besluitdatum": "values.case.date_target",
"Behandelstatus": "values.case.status",
"Besluit": "",
"Termijnoverschrijding": "",
Expand Down
57 changes: 57 additions & 0 deletions docs/classes/Command/SyncXxllncCasesCommand.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# CommonGateway\PDDBundle\Command\SyncXxllncCasesCommand

This class handles the command for the synchronization of a xxllnc case to a woo object.

This Command executes the syncXxllncCasesService->syncXxllncCasesHandler.



## Extend:

Symfony\Component\Console\Command\Command

## Methods

| Name | Description |
|------|-------------|

## Inherited methods

| Name | Description |
|------|-------------|
| [__construct](https://secure.php.net/manual/en/symfony\component\console\command\command.__construct.php) | - |
|addArgument|Adds an argument.|
|addOption|Adds an option.|
|addUsage|Add a command usage example, it'll be prefixed with the command name.|
|getAliases|Returns the aliases for the command.|
|getApplication|Gets the application instance for this command.|
| [getDefaultDescription](https://secure.php.net/manual/en/symfony\component\console\command\command.getdefaultdescription.php) | - |
| [getDefaultName](https://secure.php.net/manual/en/symfony\component\console\command\command.getdefaultname.php) | - |
|getDefinition|Gets the InputDefinition attached to this Command.|
|getDescription|Returns the description for the command.|
|getHelp|Returns the help for the command.|
|getHelper|Gets a helper instance by name.|
|getHelperSet|Gets the helper set.|
|getName|Returns the command name.|
|getNativeDefinition|Gets the InputDefinition to be used to create representations of this Command.|
|getProcessedHelp|Returns the processed help for the command replacing the %command.name% and
%command.full_name% patterns with the real values dynamically.|
|getSynopsis|Returns the synopsis for the command.|
|getUsages|Returns alternative usages of the command.|
|ignoreValidationErrors|Ignores validation errors.|
|isEnabled|Checks whether the command is enabled or not in the current environment.|
| [isHidden](https://secure.php.net/manual/en/symfony\component\console\command\command.ishidden.php) | - |
|mergeApplicationDefinition|Merges the application definition with the command definition.|
|run|Runs the command.|
|setAliases|Sets the aliases for the command.|
| [setApplication](https://secure.php.net/manual/en/symfony\component\console\command\command.setapplication.php) | - |
|setCode|Sets the code to execute when running this command.|
|setDefinition|Sets an array of argument and option instances.|
|setDescription|Sets the description for the command.|
|setHelp|Sets the help for the command.|
| [setHelperSet](https://secure.php.net/manual/en/symfony\component\console\command\command.sethelperset.php) | - |
| [setHidden](https://secure.php.net/manual/en/symfony\component\console\command\command.sethidden.php) | - |
|setName|Sets the name of the command.|
|setProcessTitle|Sets the process title of the command.|


2 changes: 2 additions & 0 deletions docs/classes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@

* [Service\InstallationService](Service/InstallationService.md)
* [Service\PDDService](Service/PDDService.md)
* [Service\SyncXxllncCasesService](Service/SyncXxllncCasesService.md)
* [Command\SyncXxllncCasesCommand](Command/SyncXxllncCasesCommand.md)
106 changes: 106 additions & 0 deletions docs/classes/Service/SyncXxllncCasesService.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# CommonGateway\PDDBundle\Service\SyncXxllncCasesService

Service responsible for synchronizing xxllnc cases to woo objects.





## Methods

| Name | Description |
|------|-------------|
|[__construct](#syncxxllnccasesservice__construct)|SyncXxllncCasesService constructor.|
|[setStyle](#syncxxllnccasesservicesetstyle)|Set symfony style in order to output to the console.|
|[syncXxllncCasesHandler](#syncxxllnccasesservicesyncxxllnccaseshandler)|Handles the synchronization of xxllnc cases.|




### SyncXxllncCasesService::__construct

**Description**

```php
public __construct (\GatewayResourceService $resourceService, \CallService $callService, \SynchronizationService $syncService, \EntityManagerInterface $entityManager, \MappingService $mappingService, \LoggerInterface $pluginLogger)
```

SyncXxllncCasesService constructor.



**Parameters**

* `(\GatewayResourceService) $resourceService`
* `(\CallService) $callService`
* `(\SynchronizationService) $syncService`
* `(\EntityManagerInterface) $entityManager`
* `(\MappingService) $mappingService`
* `(\LoggerInterface) $pluginLogger`

**Return Values**

`void`


<hr />


### SyncXxllncCasesService::setStyle

**Description**

```php
public setStyle (\SymfonyStyle $style)
```

Set symfony style in order to output to the console.



**Parameters**

* `(\SymfonyStyle) $style`

**Return Values**

`self`




<hr />


### SyncXxllncCasesService::syncXxllncCasesHandler

**Description**

```php
public syncXxllncCasesHandler (array $data, array $configuration)
```

Handles the synchronization of xxllnc cases.



**Parameters**

* `(array) $data`
* `(array) $configuration`

**Return Values**

`array`




**Throws Exceptions**


`\CacheException|\InvalidArgumentException`


<hr />

Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,37 @@

Check failure on line 2 in src/ActionHandler/SyncXxllncCasesHandler.php

View workflow job for this annotation

GitHub Actions / build

Missing file doc comment
namespace CommonGateway\PDDBundle\ActionHandler;

use CommonGateway\PDDBundle\Service\SyncCasesService;
use CommonGateway\PDDBundle\Service\SyncXxllncCasesService;
use Symfony\Component\Mailer\Exception\TransportExceptionInterface;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Error\SyntaxError;
use CommonGateway\CoreBundle\ActionHandler\ActionHandlerInterface;

/**
* ActionHandler executing SyncCasesService->syncCasesHandler.
* ActionHandler executing SyncXxllncCasesService->syncXxllncCasesHandler.
*
* @author Conduction BV ([email protected]), Barry Brands ([email protected])
* @license EUPL <https://github.com/ConductionNL/contactcatalogus/blob/master/LICENSE.md>
*
* @package CommonGateway\PDDBundle
* @category ActionHandler
*/
class SyncCasesHandler implements ActionHandlerInterface
class SyncXxllncCasesHandler implements ActionHandlerInterface
{

/**

Check failure on line 24 in src/ActionHandler/SyncXxllncCasesHandler.php

View workflow job for this annotation

GitHub Actions / build

Missing short description in doc comment
* @var SyncCasesService
* @var SyncXxllncCasesService
*/
private SyncCasesService $service;
private SyncXxllncCasesService $service;


/**
* SyncPubHandler constructor.
* SyncXxllncCasesHandler constructor.
*
* @param SyncCasesService $service
* @param SyncXxllncCasesService $service

Check failure on line 33 in src/ActionHandler/SyncXxllncCasesHandler.php

View workflow job for this annotation

GitHub Actions / build

Missing parameter comment
*/
public function __construct(SyncCasesService $service)
public function __construct(SyncXxllncCasesService $service)
{
$this->service = $service;

Expand All @@ -49,7 +49,7 @@ public function getConfiguration(): array
return [
'$id' => 'https://commongateway.nl/pdd.SyncCasesAction.action.json',
'$schema' => 'https://docs.commongateway.nl/schemas/ActionHandler.schema.json',
'title' => 'SyncCasesHandler',
'title' => 'SyncXxllncCasesHandler',
'description' => 'Handles the sync for xxllnc cases.',
'required' => [],
'properties' => [],
Expand All @@ -59,7 +59,7 @@ public function getConfiguration(): array


/**
* This function runs the SyncCases service plugin.
* This function runs the SyncXxllncCases service plugin.
*
* @param array $data The data from the call
* @param array $configuration The configuration of the action
Expand All @@ -70,7 +70,7 @@ public function getConfiguration(): array
*/
public function run(array $data, array $configuration): array
{
return $this->service->syncCasesHandler($data, $configuration);
return $this->service->syncXxllncCasesHandler($data, $configuration);

}//end run()

Expand Down
Loading

0 comments on commit ca71b87

Please sign in to comment.