Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an endpoint to process notifications from xxllnc #75

Merged
merged 6 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions Installation/Schema/xxllnc-zaak-notification.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$id": "https://development.zaaksysteem.nl/schema/xxllnc.zaakNotification.schema.json",
WilcoLouwerse marked this conversation as resolved.
Show resolved Hide resolved
"$schema": "https://docs.commongateway.nl/schemas/Entity.schema.json",
"version": "0.0.1",
"title": "XxllncZaakNotification",
"type": "object",
"properties": {
"case_uuid": {
"description": "The uuid of the case in the Xxllnc registry",
"type": "string"
},
"event_name": {
"description": "The event type received",
"type": "string"
}
}
}
284 changes: 148 additions & 136 deletions Installation/installation.json
Original file line number Diff line number Diff line change
@@ -1,162 +1,174 @@
{
"installationService": "CommonGateway\\XxllncZGWBundle\\Service\\InstallationService",
"applications": [
{
"title": "Xxllnc Application",
"$id": "https://docs.commongateway.nl/application/default.application.json",
"$schema": "https://docs.commongateway.nl/schemas/Application.schema.json",
"version": "0.0.2",
"description": "The xxllnc application for extra configuration",
"domains": [
"localhost",
"api.xxllnc.commonground.nu"
],
"configuration": [
{
"https://vng.opencatalogi.nl/EntityEndpoint/ZaakType.endpoint.json": {
"in": {
"query": {
"mapping": "https://development.zaaksysteem.nl/mapping/xxllnc.XxllncZaaktypeQueryInMapping.mapping.json"
}
}
}
},
{
"https://vng.opencatalogi.nl/EntityEndpoint/Eigenschap.endpoint.json": {
"in": {
"query": {
"mapping": "https://development.zaaksysteem.nl/mapping/xxllnc.XxllncEigenschapQueryInMapping.mapping.json"
}
}
}
},
{
"https://vng.opencatalogi.nl/EntityEndpoint/InformatieObjectType.endpoint.json": {
"in": {
"query": {
"mapping": "https://development.zaaksysteem.nl/mapping/xxllnc.XxllncInformatieObjecttypeQueryInMapping.mapping.json"
}
}
}
},
{
"https://vng.opencatalogi.nl/EntityEndpoint/ResultaatType.endpoint.json": {
"in": {
"query": {
"mapping": "https://development.zaaksysteem.nl/mapping/xxllnc.XxllncResultaattypeQueryInMapping.mapping.json"
}
}
}
},
{
"https://vng.opencatalogi.nl/EntityEndpoint/BesluitType.endpoint.json": {
"in": {
"query": {
"mapping": "https://development.zaaksysteem.nl/mapping/xxllnc.XxllncBesluittypeQueryInMapping.mapping.json"
}
"installationService": "CommonGateway\\XxllncZGWBundle\\Service\\InstallationService",
"applications": [
{
"title": "Xxllnc Application",
"$id": "https://docs.commongateway.nl/application/default.application.json",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will work.
But keep in mind that if multiple bundles do this for the same default reference (and with different versions) they will collide.
Might be a better idea to create a new Application with a unique reference instead 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part of the file hasn't really changed except for some whitespacing

"$schema": "https://docs.commongateway.nl/schemas/Application.schema.json",
"version": "0.0.2",
"description": "The xxllnc application for extra configuration",
"domains": [
"localhost",
"api.xxllnc.commonground.nu"
],
"configuration": [
{
"https://vng.opencatalogi.nl/EntityEndpoint/ZaakType.endpoint.json": {
"in": {
"query": {
"mapping": "https://development.zaaksysteem.nl/mapping/xxllnc.XxllncZaaktypeQueryInMapping.mapping.json"
}
}
},
{
"https://vng.opencatalogi.nl/EntityEndpoint/RolType.endpoint.json": {
"in": {
"query": {
"mapping": "https://development.zaaksysteem.nl/mapping/xxllnc.XxllncRoltypeQueryInMapping.mapping.json"
}
}
},
{
"https://vng.opencatalogi.nl/EntityEndpoint/Eigenschap.endpoint.json": {
"in": {
"query": {
"mapping": "https://development.zaaksysteem.nl/mapping/xxllnc.XxllncEigenschapQueryInMapping.mapping.json"
}
}
},
{
"https://vng.opencatalogi.nl/EntityEndpoint/StatusType.endpoint.json": {
"in": {
"query": {
"mapping": "https://development.zaaksysteem.nl/mapping/xxllnc.XxllncStatustypeQueryInMapping.mapping.json"
}
}
},
{
"https://vng.opencatalogi.nl/EntityEndpoint/InformatieObjectType.endpoint.json": {
"in": {
"query": {
"mapping": "https://development.zaaksysteem.nl/mapping/xxllnc.XxllncInformatieObjecttypeQueryInMapping.mapping.json"
}
}
},
{
"https://vng.opencatalogi.nl/EntityEndpoint/ZaakTypeInformatieObjectType.endpoint.json": {
"in": {
"query": {
"mapping": "https://development.zaaksysteem.nl/mapping/xxllnc.XxllncZaakTypeInformatieObjectTypeQueryInMapping.mapping.json"
}
}
},
{
"https://vng.opencatalogi.nl/EntityEndpoint/ResultaatType.endpoint.json": {
"in": {
"query": {
"mapping": "https://development.zaaksysteem.nl/mapping/xxllnc.XxllncResultaattypeQueryInMapping.mapping.json"
}
}
},
{
"https://vng.opencatalogi.nl/EntityEndpoint/ZaakInformatieObject.endpoint.json": {
"out": {
"body": {
"mapping": "https://development.zaaksysteem.nl/mapping/xxllnc.XxllncZaakInformatieobjectBodyOutMapping.mapping.json"
}
},
"in": {
"query": {
"mapping": "https://development.zaaksysteem.nl/mapping/xxllnc.XxllncZaakInformatieObjectQueryInMapping.mapping.json"
}
}
},
{
"https://vng.opencatalogi.nl/EntityEndpoint/BesluitType.endpoint.json": {
"in": {
"query": {
"mapping": "https://development.zaaksysteem.nl/mapping/xxllnc.XxllncBesluittypeQueryInMapping.mapping.json"
}
}
}
]
}
],
"users": [
{
"$id": "https://development.zaaksysteem.nl/user/xxllnc.default.user.json",
"version": "0.0.1",
"description": "A default user with a SecurityGroup. It is not allowed to set a User password or change/create Admin Users this way.",
"email": "[email protected]",
"locale": "en",
"applications": [
"https://docs.commongateway.nl/application/default.application.json"
],
"securityGroups": [
"https://docs.commongateway.nl/securityGroup/xxllnc.user.securityGroup.json"
]
}
],
"cards": {
"sources": [
"https://development.zaaksysteem.nl/source/xxllnc.zaaksysteem.source.json"
]
},
"actions": {
"handlers": [
{
"reference": "https://development.zaaksysteem.nl/action/xxllnc.Zaak.action.json",
"actionHandler": "CommonGateway\\XxllncZGWBundle\\ActionHandler\\ZaakHandler",
"listens": ["xxllnc.cronjob.trigger", "xxllnc.case.received"],
"async": true
},
{
"reference": "https://development.zaaksysteem.nl/action/xxllnc.ZaakType.action.json",
"actionHandler": "CommonGateway\\XxllncZGWBundle\\ActionHandler\\ZaakTypeHandler",
"listens": ["xxllnc.cronjob.trigger"]
"https://vng.opencatalogi.nl/EntityEndpoint/RolType.endpoint.json": {
"in": {
"query": {
"mapping": "https://development.zaaksysteem.nl/mapping/xxllnc.XxllncRoltypeQueryInMapping.mapping.json"
}
}
}
},
{
"reference": "https://development.zaaksysteem.nl/action/xxllnc.ConnectBesluittypeToZaaktypeHandler.action.json",
"actionHandler": "CommonGateway\\XxllncZGWBundle\\ActionHandler\\ConnectBesluittypeToZaaktypeHandler",
"listens": ["xxllnc.cronjob.trigger"],
"priority": 1
"https://vng.opencatalogi.nl/EntityEndpoint/StatusType.endpoint.json": {
"in": {
"query": {
"mapping": "https://development.zaaksysteem.nl/mapping/xxllnc.XxllncStatustypeQueryInMapping.mapping.json"
}
}
}
},
{
"reference": "https://development.zaaksysteem.nl/action/xxllnc.ZGWZaakToXxllnc.action.json",
"actionHandler": "CommonGateway\\XxllncZGWBundle\\ActionHandler\\ZGWToXxllncHandler",
"listens": ["commongateway.object.create", "commongateway.object.update"],
"conditions": {
"==": [{"var": "entity"}, "https://vng.opencatalogi.nl/schemas/zrc.zaak.schema.json"]
"https://vng.opencatalogi.nl/EntityEndpoint/ZaakTypeInformatieObjectType.endpoint.json": {
"in": {
"query": {
"mapping": "https://development.zaaksysteem.nl/mapping/xxllnc.XxllncZaakTypeInformatieObjectTypeQueryInMapping.mapping.json"
}
}
}
},
{
"name": "BesluitToXxllncAction",
"reference": "https://development.zaaksysteem.nl/action/xxllnc.BesluitToXxllnc.action.json",
"actionHandler": "CommonGateway\\XxllncZGWBundle\\ActionHandler\\BesluitToXxllncHandler",
"listens": ["commongateway.object.create", "commongateway.object.update"],
"conditions": {
"==": [{"var": "entity"}, "https://vng.opencatalogi.nl/schemas/zrc.zaakBesluit.schema.json"]
"https://vng.opencatalogi.nl/EntityEndpoint/ZaakInformatieObject.endpoint.json": {
"out": {
"body": {
"mapping": "https://development.zaaksysteem.nl/mapping/xxllnc.XxllncZaakInformatieobjectBodyOutMapping.mapping.json"
}
},
"in": {
"query": {
"mapping": "https://development.zaaksysteem.nl/mapping/xxllnc.XxllncZaakInformatieObjectQueryInMapping.mapping.json"
}
}
}
}
]
}
],
"users": [
{
"$id": "https://development.zaaksysteem.nl/user/xxllnc.default.user.json",
"version": "0.0.1",
"description": "A default user with a SecurityGroup. It is not allowed to set a User password or change/create Admin Users this way.",
"email": "[email protected]",
"locale": "en",
"applications": [
"https://docs.commongateway.nl/application/default.application.json"
],
"securityGroups": [
"https://docs.commongateway.nl/securityGroup/xxllnc.user.securityGroup.json"
]
}
],
"cards": {
"sources": [
"https://development.zaaksysteem.nl/source/xxllnc.zaaksysteem.source.json"
]
},
"actions": {
"handlers": [
{
"reference": "https://development.zaaksysteem.nl/action/xxllnc.Zaak.action.json",
"actionHandler": "CommonGateway\\XxllncZGWBundle\\ActionHandler\\ZaakHandler",
"listens": ["xxllnc.cronjob.trigger", "xxllnc.case.received"],
"async": true
},
{
"reference": "https://development.zaaksysteem.nl/action/xxllnc.ZaakType.action.json",
"actionHandler": "CommonGateway\\XxllncZGWBundle\\ActionHandler\\ZaakTypeHandler",
"listens": ["xxllnc.cronjob.trigger"]
},
{
"reference": "https://development.zaaksysteem.nl/action/xxllnc.ConnectBesluittypeToZaaktypeHandler.action.json",
"actionHandler": "CommonGateway\\XxllncZGWBundle\\ActionHandler\\ConnectBesluittypeToZaaktypeHandler",
"listens": ["xxllnc.cronjob.trigger"],
"priority": 1
},
{
"reference": "https://development.zaaksysteem.nl/action/xxllnc.ZGWZaakToXxllnc.action.json",
"actionHandler": "CommonGateway\\XxllncZGWBundle\\ActionHandler\\ZGWToXxllncHandler",
"listens": ["commongateway.object.create", "commongateway.object.update"],
"conditions": {
"==": [{"var": "entity"}, "https://vng.opencatalogi.nl/schemas/zrc.zaak.schema.json"]
}
},
{
"name": "BesluitToXxllncAction",
"reference": "https://development.zaaksysteem.nl/action/xxllnc.BesluitToXxllnc.action.json",
"actionHandler": "CommonGateway\\XxllncZGWBundle\\ActionHandler\\BesluitToXxllncHandler",
"listens": ["commongateway.object.create", "commongateway.object.update"],
"conditions": {
"==": [{"var": "entity"}, "https://vng.opencatalogi.nl/schemas/zrc.zaakBesluit.schema.json"]
}
}
]
},
"endpoints": {
"schemas": [
{
"version": "0.0.1",
"name": "Xxllnc Notificaties endpoint",
"reference": "https://development.zaaksysteem.nl/schema/xxllnc.zaakNotification.schema.json",
"path": "xxllnc/notifications",
"methods": ["POST"],
"throws": ["xxllnc.case.received"]
}
]
}
}
5 changes: 5 additions & 0 deletions src/Service/ZaakService.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
*
* @return self
*
* @todo change to monolog

Check warning on line 133 in src/Service/ZaakService.php

View workflow job for this annotation

GitHub Actions / build

Comment refers to a TODO task
*/
public function setStyle(SymfonyStyle $style): self
{
Expand Down Expand Up @@ -158,7 +158,7 @@
// Find existing zaaktype
$zaakTypeSync = $this->synchronizationService->findSyncBySource($this->xxllncAPI, $zaakTypeSchema, $caseTypeId);
if ($zaakTypeSync && $zaakTypeSync->getObject()) {
isset($this->style) === true && $this->style->info("ZaakType found with id: {$zaakTypeSync->getObject()->getId()->toString()}.");

Check warning on line 161 in src/Service/ZaakService.php

View workflow job for this annotation

GitHub Actions / build

Line exceeds 125 characters; contains 141 characters
$this->logger->info("ZaakType found with id: {$zaakTypeSync->getObject()->getId()->toString()}.");

return $zaakTypeSync->getObject();
Expand Down Expand Up @@ -487,6 +487,11 @@
return $data;
}

if (isset($data['body']['case_uuid']) === true) {
$this->getZaak($configuration, $data['body']['case_uuid']);
return $data;
}

isset($this->style) === true && $this->zaakTypeService->setStyle($this->style);

// Fetch the xxllnc cases.
Expand Down
Loading