Skip to content

Commit

Permalink
Change notification action to zaak create notification action
Browse files Browse the repository at this point in the history
  • Loading branch information
WilcoLouwerse committed Nov 27, 2023
1 parent 25545e3 commit 156e668
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
23 changes: 20 additions & 3 deletions Installation/Action/notifications.NotificationAction.action.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,29 @@
{
"title": "NotificationAction",
"$id": "https://commongateway.nl/action/notifications.NotificationAction.action.json",
"title": "ZaakCreatedAction",
"$id": "https://commongateway.nl/action/notifications.ZaakCreatedAction.action.json",
"$schema": "https://docs.commongateway.nl/schemas/Action.schema.json",
"version": "0.0.1",
"listens": ["notifications.notification.created"],
"conditions":
{
"==": [1, 1]
"and": [
{
"==": [
{
"var": "kanaal"
},
"zaken"
]
},
{
"==": [
{
"var": "actie"
},
"create"
]
}
]
},
"class": "CommonGateway\\CustomerNotificationsBundle\\ActionHandler\\NotificationsHandler",
"configuration": {
Expand Down
9 changes: 7 additions & 2 deletions src/Service/NotificationsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ public function __construct(


/**
* @todo
* Handles incoming notification api-call and is responsible for generating a response.
* Might also send an email and/or sms after, etc.
*
* @param array $data The data array
* @param array $configuration The configuration array
Expand All @@ -66,10 +67,14 @@ public function __construct(
*/
public function notificationsHandler(array $data, array $configuration): array
{
if ($data['method'] !== 'POST') {
return $data;
}

Check failure on line 73 in src/Service/NotificationsService.php

View workflow job for this annotation

GitHub Actions / build

Whitespace found at end of line
$this->data = $data;
$this->configuration = $configuration;

$this->logger->debug("NotificationsService -> notificationsHandler()");
$this->logger->debug("NotificationsBundler -> NotificationsService -> notificationsHandler()");

return ['response' => 'Hello. Your CustomerNotificationsBundle works'];

Expand Down

0 comments on commit 156e668

Please sign in to comment.