Skip to content

Commit

Permalink
Merge pull request #75 from CommonGateway/feature/PC173-5/sync-zaak-o…
Browse files Browse the repository at this point in the history
…p-trigger

Add an endpoint to process notifications from xxllnc
  • Loading branch information
rjzondervan authored Feb 22, 2024
2 parents 9e58ecd + 49a5723 commit a50f067
Show file tree
Hide file tree
Showing 3 changed files with 170 additions and 136 deletions.
17 changes: 17 additions & 0 deletions Installation/Schema/xxllnc-zaak-notification.schema.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",
"$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",
"$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 @@ -487,6 +487,11 @@ public function zaakHandler(?array $data = [], ?array $configuration = [])
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

0 comments on commit a50f067

Please sign in to comment.