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.
add action, make some variables more generic
- Loading branch information
1 parent
76788b9
commit f0157ca
Showing
4 changed files
with
96 additions
and
6 deletions.
There are no files selected for viewing
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,34 @@ | ||
{ | ||
"title": "ZgwToVrijbrpBirthAction", | ||
"$id": "https://vrijbrp.nl/action/vrijbrp.synczaken.action.json", | ||
"$schema": "https://json-schema.org/draft/2020-12/action", | ||
"version": "0.0.2", | ||
"listens": [ | ||
"vrijbrp.zaken.sync" | ||
], | ||
"throws": [], | ||
"conditions": { | ||
"==": [ | ||
1, | ||
1 | ||
] | ||
}, | ||
"class": "CommonGateway\\VrijBRPToZGWBundle\\ActionHandler\\SynchronizeCollectionHandler", | ||
"configuration": { | ||
"source": "https://vrijbrp.nl/source/vrijbrp.dossiers.source.json", | ||
"schema": "https://vng.opencatalogi.nl/schemas/zrc.zaak.schema.json", | ||
"mapping": "https://commongateway.nl/mapping/vrijbrp.dossierToZaak.mapping.json", | ||
"endpoint": "/api/v1/dossiers/search", | ||
"idField": "dossierId", | ||
"resultsPath": "result.content", | ||
"method": "POST", | ||
"body": { | ||
"types": [ | ||
"intra_mun_relocation", | ||
"inter_mun_relocation" | ||
] | ||
} | ||
}, | ||
"isLockable": false, | ||
"isEnabled": true | ||
} |
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,54 @@ | ||
<?php | ||
|
||
namespace CommonGateway\VrijBRPToZGWBundle\ActionHandler; | ||
|
||
use App\ActionHandler\ActionHandlerInterface; | ||
use CommonGateway\VrijBRPToZGWBundle\Service\NewSynchronizationService; | ||
use CommonGateway\VrijBRPToZGWBundle\Service\VrijBrpService; | ||
|
||
class SynchronizeCollectionHandler implements ActionHandlerInterface | ||
{ | ||
|
||
/** | ||
Check failure on line 12 in src/ActionHandler/SynchronizeCollectionHandler.php GitHub Actions / build
|
||
* @param NewSynchronizationService $synchronizationService | ||
*/ | ||
public function __construct( | ||
private readonly NewSynchronizationService $synchronizationService, | ||
private readonly VrijBrpService $vrijBrpService, | ||
) | ||
{ | ||
} | ||
|
||
/** | ||
* 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 | ||
*/ | ||
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' => [ | ||
], | ||
]; | ||
} | ||
|
||
/** | ||
* 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 | ||
{ | ||
$configuration = $this->vrijBrpService->setVrijBRPDefaults($configuration); | ||
|
||
return $this->synchronizationService->synchronizeCollectionHandler($data, $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
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