generated from CommonGateway/PetStoreBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
warning: this will cause infinite loops. Working on that
- Loading branch information
1 parent
6cb974a
commit e347b94
Showing
3 changed files
with
145 additions
and
0 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
Installation/Action/vrijbrp.createStatusNotification.action.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"title": "CreateStatusNotification", | ||
"$id": "https://example.com/action/vrijbrp.createStatusNotification.action.json", | ||
"$schema": "https://docs.commongateway.nl/schemas/Action.schema.json", | ||
"version": "0.0.1", | ||
"description": "This is an example Action. This action is triggered when commongateway.object.create event is thrown and the data (object) of the event has entity = https://example.com/schema/example.schema.json. In order for this condition to work the ref https://example.com/schema/example.schema.json has to be translated to an id, see installation.json['actions']['fixConfigRef'] for how to do this.", | ||
"listens": [ | ||
"commongateway.object.pre.update" | ||
], | ||
"conditions": | ||
{ | ||
"==": [ | ||
{ | ||
"var": "entity.reference" | ||
}, "https://vng.opencatalogi.nl/schemas/zrc.zaak.schema.json" | ||
] | ||
}, | ||
"class": "CommonGateway\\VrijBRPToZGWBundle\\ActionHandler\\NotificationUpdateHandler", | ||
"configuration": { | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
|
||
namespace CommonGateway\VrijBRPToZGWBundle\ActionHandler; | ||
|
||
use CommonGateway\VrijBRPToZGWBundle\Service\NewSynchronizationService; | ||
use CommonGateway\VrijBRPToZGWBundle\Service\VrijBrpService; | ||
use CommonGateway\CoreBundle\ActionHandler\ActionHandlerInterface; | ||
|
||
class NotificationUpdateHandler implements ActionHandlerInterface | ||
{ | ||
|
||
public function __construct( | ||
Check failure on line 12 in src/ActionHandler/NotificationUpdateHandler.php GitHub Actions / build
|
||
private readonly VrijBrpService $vrijBrpService, | ||
) { | ||
|
||
}//end __construct() | ||
|
||
|
||
/** | ||
* This function returns the requered configuration as a [json-schema](https://json-schema.org/) array. | ||
* | ||
* @throws array a [json-schema](https://json-schema.org/) that this action should comply to | ||
*/ | ||
Check failure on line 23 in src/ActionHandler/NotificationUpdateHandler.php GitHub Actions / build
|
||
public function getConfiguration(): array | ||
{ | ||
return [ | ||
'$id' => 'https://commongateway.nl/ActionHandler/SynchronizationCollectionHandler.ActionHandler.json', | ||
'$schema' => 'https://docs.commongateway.nl/schemas/ActionHandler.schema.json', | ||
'title' => 'SynchronizationCollectionHandler', | ||
'description' => '', | ||
'required' => [], | ||
'properties' => [], | ||
]; | ||
|
||
}//end getConfiguration() | ||
|
||
|
||
/** | ||
* Run the actual business logic in the appropriate server. | ||
* | ||
* @param array $data The data from the call | ||
* @param array $configuration The configuration of the action | ||
* | ||
* @return array | ||
*/ | ||
public function run(array $data, array $configuration): array | ||
{ | ||
return $this->vrijBrpService->createNotification($data, $configuration); | ||
|
||
}//end run() | ||
|
||
|
||
}//end class |
This file contains 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