Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feature/GW-1736/test-with-mappin…
Browse files Browse the repository at this point in the history
…g' into feature/GW-1736/test-with-mapping
  • Loading branch information
rjzondervan committed Oct 4, 2024
2 parents 868ed7e + 138d1a7 commit fd91f99
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 44 deletions.
60 changes: 33 additions & 27 deletions src/ActionHandler/SynchronizeCollectionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,12 @@ class SynchronizeCollectionHandler implements ActionHandlerInterface

/**

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

View workflow job for this annotation

GitHub Actions / build

Missing short description in doc comment

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

View workflow job for this annotation

GitHub Actions / build

Missing short description in doc comment
* @param NewSynchronizationService $syncService

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

View workflow job for this annotation

GitHub Actions / build

Missing parameter comment

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

View workflow job for this annotation

GitHub Actions / build

Missing parameter comment
* @param VrijBrpService $vrijBrpService
* @param VrijBrpService $vrijBrpService

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

View workflow job for this annotation

GitHub Actions / build

Missing parameter comment

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

View workflow job for this annotation

GitHub Actions / build

Missing parameter comment
*/
public function __construct(
private readonly NewSynchronizationService $syncService,
private readonly VrijBrpService $vrijBrpService,
)
{
private readonly VrijBrpService $vrijBrpService,
) {

}//end __construct()

Expand All @@ -41,38 +40,45 @@ public function __construct(
public function getConfiguration(): array
{
return [
'$id' => 'https://commongateway.nl/ActionHandler/SynchronizationCollectionHandler.ActionHandler.json',
'$schema' => 'https://docs.commongateway.nl/schemas/ActionHandler.schema.json',
'title' => 'SynchronizationCollectionHandler',
'$id' => 'https://commongateway.nl/ActionHandler/SynchronizationCollectionHandler.ActionHandler.json',
'$schema' => 'https://docs.commongateway.nl/schemas/ActionHandler.schema.json',
'title' => 'SynchronizationCollectionHandler',
'description' => '',
'required' => ['source', 'schema', 'endpoint', 'idField', 'resultsPath'],
'properties' => [
'source' => [
'type' => 'string',
'required' => [
'source',
'schema',
'endpoint',
'idField',
'resultsPath',
],
'properties' => [
'source' => [
'type' => 'string',
'description' => 'The source where the publication belongs to.',
'example' => 'https://commongateway.woo.nl/source/buren.openwoo.source.json',
'required' => true,
'example' => 'https://commongateway.woo.nl/source/buren.openwoo.source.json',
'required' => true,
],
'schema' => [
'type' => 'string',
'schema' => [
'type' => 'string',
'description' => 'The publication schema.',
'example' => 'https://commongateway.nl/woo.publicatie.schema.json',
'reference' => 'https://commongateway.nl/woo.publicatie.schema.json',
'required' => true,
], 'mapping' => [
'type' => 'string',
'example' => 'https://commongateway.nl/woo.publicatie.schema.json',
'reference' => 'https://commongateway.nl/woo.publicatie.schema.json',
'required' => true,
],
'mapping' => [
'type' => 'string',
'description' => 'The mapping for open woo to publication.',
'example' => 'https://commongateway.nl/mapping/woo.openWooToWoo.mapping.json',
'reference' => 'https://commongateway.nl/mapping/woo.openWooToWoo.mapping.json',
'required' => false,
'example' => 'https://commongateway.nl/mapping/woo.openWooToWoo.mapping.json',
'reference' => 'https://commongateway.nl/mapping/woo.openWooToWoo.mapping.json',
'required' => false,
],
'endpoint' => [
'endpoint' => [
'type' => 'string',
'description' => 'The endpoint of the source.',
'example' => '/wp-json/owc/openwoo/v1/items',
'required' => true,
],
'idField' => [
'idField' => [
'type' => 'string',
'description' => 'Dot-array location of the field that contains the id',
'example' => 'dossierId',
Expand All @@ -84,7 +90,7 @@ public function getConfiguration(): array
'example' => 'dossierId',
'required' => true,
],
'body' => [
'body' => [
'type' => 'array',
'description' => 'Body that will be sent to the source if necessary.',
'example' => 'dossierId',
Expand All @@ -100,7 +106,7 @@ public function getConfiguration(): array
/**
* Run the actual business logic in the appropriate server.
*
* @param array $data The data from the call
* @param array $data The data from the call
* @param array $configuration The configuration of the action
*
* @return array
Expand Down
8 changes: 4 additions & 4 deletions src/Service/NewSynchronizationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ class NewSynchronizationService

public function __construct(
private readonly GatewayResourceService $resourceService,
private readonly CallService $callService,
private readonly CallService $callService,
private readonly SynchronizationService $syncService,
private readonly LoggerInterface $synchronizationLogger,
private readonly LoggerInterface $synchronizationLogger,

Check warning on line 42 in src/Service/NewSynchronizationService.php

View workflow job for this annotation

GitHub Actions / build

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

Check warning on line 42 in src/Service/NewSynchronizationService.php

View workflow job for this annotation

GitHub Actions / build

Avoid excessively long variable names like $synchronizationLogger. Keep variable name length under 20.
private readonly EntityManagerInterface $entityManager,
private readonly MappingService $mappingService,
private readonly HydrationService $hydrationService,
private readonly MappingService $mappingService,
private readonly HydrationService $hydrationService,
) {

}//end __construct()
Expand Down
27 changes: 14 additions & 13 deletions src/Service/VrijBrpService.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ class VrijBrpService


/**
* @param CacheService $cacheService
* @param GatewayResourceService $resourceService
* @param EntityManagerInterface $entityManager
* @param CacheService $cacheService
* @param GatewayResourceService $resourceService
* @param EntityManagerInterface $entityManager
* @param NewSynchronizationService $syncService
*/
public function __construct(
private readonly CacheService $cacheService,
private readonly GatewayResourceService $resourceService,
private readonly EntityManagerInterface $entityManager,
private readonly CacheService $cacheService,
private readonly GatewayResourceService $resourceService,
private readonly EntityManagerInterface $entityManager,
private readonly NewSynchronizationService $syncService,
) {

Expand All @@ -41,7 +41,7 @@ public function __construct(
/**
* Set defaults for configuration of synchronize action.
*
* @param array $configuration Incoming configuration.
* @param array $configuration Incoming configuration.
* @return array
*/
public function setVrijBRPDefaults(array $configuration): array
Expand All @@ -67,11 +67,12 @@ public function setVrijBRPDefaults(array $configuration): array

}//end setVrijBRPDefaults()


/**
* Creates a status notification.
*
* @param array $data incoming data.
* @param array $config incoming configuration.
* @param array $data incoming data.
* @param array $config incoming configuration.
* @return array
*/
public function createStatusNotification(array $data, array $config): array
Expand Down Expand Up @@ -107,8 +108,8 @@ public function createStatusNotification(array $data, array $config): array
/**
* Specific extension: fetch second source and run mapping.
*
* @param ObjectEntity $object Incoming object
* @param array $array Serialised incoming object
* @param ObjectEntity $object Incoming object
* @param array $array Serialised incoming object
* @return ObjectEntity
*/
public function extendSync(ObjectEntity $object, array $array): ObjectEntity
Expand Down Expand Up @@ -138,8 +139,8 @@ public function extendSync(ObjectEntity $object, array $array): ObjectEntity
/**
* Fire notification for case creation. Also extend case with data from detail endpoint.
*
* @param array $data Incoming data
* @param array $config Incoming configuration
* @param array $data Incoming data
* @param array $config Incoming configuration
* @return array
*/
public function createCaseNotification(array $data, array $config): array
Expand Down

0 comments on commit fd91f99

Please sign in to comment.