-
Notifications
You must be signed in to change notification settings - Fork 0
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 synchronizationService #2
Changes from all commits
4baf8ab
9e37d5b
76788b9
f0157ca
2bb1cc3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 0.0.2 for a new action? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
"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 | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?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 13 in src/ActionHandler/SynchronizeCollectionHandler.php GitHub Actions / build
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing short description in doc comment There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in PR #4 |
||
* @param NewSynchronizationService $synchronizationService | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doc comment for parameter "$vrijBrpService" missing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in PR #4 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing parameter comment There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in PR #4 |
||
*/ | ||
public function __construct( | ||
private readonly NewSynchronizationService $synchronizationService, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid excessively long variable names like $synchronizationService. Keep variable name length under 20. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in PR #4 |
||
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 28 in src/ActionHandler/SynchronizeCollectionHandler.php GitHub Actions / build
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing @return tag in function comment There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added in PR #4 |
||
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' => [], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing properties in Handler here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will fix this in PR 4 |
||
]; | ||
|
||
}//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 | ||
{ | ||
$configuration = $this->vrijBrpService->setVrijBRPDefaults($configuration); | ||
|
||
return $this->synchronizationService->synchronizeCollectionHandler($data, $configuration); | ||
|
||
}//end run() | ||
|
||
|
||
}//end class |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
different domain than mappings from https://github.com/CommonGateway/VrijBRPToZGWBundle/pull/1/files
might be better to be consistent with these references