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 synchronizationService #2

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
34 changes: 34 additions & 0 deletions Installation/Action/synczaken.action.json
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",

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

"$schema": "https://json-schema.org/draft/2020-12/action",
"version": "0.0.2",

Choose a reason for hiding this comment

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

0.0.2 for a new action?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will be fixed in PR #3 or #4

"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
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"license": "EUPL-1.2",
"minimum-stability": "dev",
"require": {
"php": ">=7.4",
"php": ">=8.2",
"commongateway/corebundle": "^1.2.68 | <2.0"
},
"require-dev": {
Expand Down
60 changes: 60 additions & 0 deletions src/ActionHandler/SynchronizeCollectionHandler.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?php

Check failure on line 2 in src/ActionHandler/SynchronizeCollectionHandler.php

View workflow job for this annotation

GitHub Actions / build

Missing file doc comment
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

View workflow job for this annotation

GitHub Actions / build

Missing short description in doc comment

Check failure on line 13 in src/ActionHandler/SynchronizeCollectionHandler.php

View workflow job for this annotation

GitHub Actions / build

Doc comment for parameter "$vrijBrpService" missing

Choose a reason for hiding this comment

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

Missing short description in doc comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in PR #4

* @param NewSynchronizationService $synchronizationService

Check failure on line 14 in src/ActionHandler/SynchronizeCollectionHandler.php

View workflow job for this annotation

GitHub Actions / build

Missing parameter comment

Choose a reason for hiding this comment

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

Doc comment for parameter "$vrijBrpService" missing

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in PR #4

Choose a reason for hiding this comment

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

Missing parameter comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in PR #4

*/
public function __construct(
private readonly NewSynchronizationService $synchronizationService,

Check warning on line 17 in src/ActionHandler/SynchronizeCollectionHandler.php

View workflow job for this annotation

GitHub Actions / build

Avoid excessively long variable names like $synchronizationService. Keep variable name length under 20.

Choose a reason for hiding this comment

The 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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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

View workflow job for this annotation

GitHub Actions / build

Missing @return tag in function comment

Choose a reason for hiding this comment

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

Missing @return tag in function comment

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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' => [],

Choose a reason for hiding this comment

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

Missing properties in Handler here

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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
109 changes: 0 additions & 109 deletions src/Service/InstallationService.php

This file was deleted.

Loading
Loading