-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from spryker-middleware/dev
Release 1.0.0
- Loading branch information
Showing
32 changed files
with
1,585 additions
and
1 deletion.
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,18 @@ | ||
build: | ||
dependencies: | ||
before: | ||
- composer config repositories.spryker composer https://code.spryker.com/repo/private | ||
environment: | ||
php: | ||
version: 7.1 | ||
|
||
checks: | ||
php: | ||
code_rating: true | ||
|
||
filter: | ||
excluded_paths: | ||
- config/* | ||
- tests/* | ||
- src/Generated/* | ||
- src/Pyz/* |
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,24 @@ | ||
language: php | ||
|
||
php: | ||
- 7.1 | ||
|
||
cache: | ||
directories: | ||
- vendor | ||
- $HOME/.composer/cache | ||
|
||
env: | ||
global: | ||
- APPLICATION_ENV=development | ||
- APPLICATION_STORE=DE | ||
|
||
install: | ||
- composer install --no-interaction --prefer-dist | ||
|
||
script: | ||
- vendor/bin/phpcs src --standard=vendor/spryker/code-sniffer/Spryker/ruleset.xml | ||
- vendor/bin/phpmd src text vendor/spryker/architecture-sniffer/src/ruleset.xml --minimumpriority=2 | ||
|
||
notifications: | ||
email: false |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
namespace: SprykerMiddleware | ||
actor: Tester | ||
|
||
include: | ||
- tests/SprykerMiddlewareTest/Zed/Report | ||
|
||
paths: | ||
tests: tests | ||
log: tests/_output | ||
data: tests/_data | ||
support: tests/_support | ||
envs: tests/_envs | ||
settings: | ||
bootstrap: _bootstrap.php | ||
suite_class: \PHPUnit_Framework_TestSuite | ||
colors: true | ||
memory_limit: 1024M | ||
log: true | ||
coverage: | ||
enabled: true | ||
whitelist: { include: ['src/*'] } |
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
40 changes: 40 additions & 0 deletions
40
src/SprykerMiddleware/Shared/Process/Transfer/process.transfer.xml
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,40 @@ | ||
<?xml version="1.0"?> | ||
<transfers xmlns="spryker:transfer-01" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="spryker:transfer-01 http://static.spryker.com/transfer-01.xsd"> | ||
|
||
<transfer name="ProcessResult"> | ||
<property name="processName" type="string"/> | ||
<property name="startTime" type="int"/> | ||
<property name="endTime" type="int"/> | ||
<property name="itemCount" type="int"/> | ||
<property name="processedItemCount" type="int"/> | ||
<property name="failedItemCount" type="int"/> | ||
<property name="skippedItemCount" type="int"/> | ||
<property name="stageResults" type="StageResults[]" singular="stageResult"/> | ||
<property name="processConfiguration" type="ProcessConfiguration"/> | ||
</transfer> | ||
|
||
<transfer name="StageResults"> | ||
<property name="stageName" type="string"/> | ||
<property name="inputItemCount" type="string"/> | ||
<property name="outputItemCount" type="string"/> | ||
<property name="totalExecutionTime" type="int"/> | ||
</transfer> | ||
|
||
<transfer name="ProcessConfiguration"> | ||
<property name="iteratorPluginName" type="string"/> | ||
<property name="inputStreamPlugin" type="StreamConfiguration"/> | ||
<property name="outputStreamPlugin" type="StreamConfiguration"/> | ||
<property name="loggerPluginName" type="string"/> | ||
<property name="stagePluginNames" type="string[]" singular="stagePluginName"/> | ||
<property name="preProcessHookPluginNames" type="string[]" singular="preProcessHookPluginName"/> | ||
<property name="postProcessHookPluginNames" type="string[]" singular="postProcessHookPluginName"/> | ||
</transfer> | ||
|
||
<transfer name="StreamConfiguration"> | ||
<property name="StreamPluginName" type="string"/> | ||
<property name="path" type="string"/> | ||
</transfer> | ||
|
||
</transfers> |
77 changes: 77 additions & 0 deletions
77
src/SprykerMiddleware/Zed/Report/Business/Model/ProcessResult.php
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,77 @@ | ||
<?php | ||
|
||
namespace SprykerMiddleware\Zed\Report\Business\Model; | ||
|
||
use Generated\Shared\Transfer\ProcessResultTransfer; | ||
use Generated\Shared\Transfer\SpyProcessEntityTransfer; | ||
use SprykerMiddleware\Zed\Report\Persistence\ReportEntityManagerInterface; | ||
use SprykerMiddleware\Zed\Report\Persistence\ReportRepositoryInterface; | ||
|
||
class ProcessResult implements ProcessResultInterface | ||
{ | ||
/** | ||
* @var \SprykerMiddleware\Zed\Report\Persistence\ReportRepositoryInterface | ||
*/ | ||
protected $reportRepository; | ||
|
||
/** | ||
* @var \SprykerMiddleware\Zed\Report\Persistence\ReportEntityManagerInterface | ||
*/ | ||
protected $reportEntityManager; | ||
|
||
/** | ||
* @param \SprykerMiddleware\Zed\Report\Persistence\ReportRepositoryInterface $reportRepository | ||
* @param \SprykerMiddleware\Zed\Report\Persistence\ReportEntityManagerInterface $reportEntityManager | ||
*/ | ||
public function __construct( | ||
ReportRepositoryInterface $reportRepository, | ||
ReportEntityManagerInterface $reportEntityManager | ||
) { | ||
$this->reportRepository = $reportRepository; | ||
$this->reportEntityManager = $reportEntityManager; | ||
} | ||
|
||
/** | ||
* @param \Generated\Shared\Transfer\ProcessResultTransfer $processResultTransfer | ||
* | ||
* @return \Generated\Shared\Transfer\ProcessResultTransfer | ||
*/ | ||
public function saveProcessResult(ProcessResultTransfer $processResultTransfer): ProcessResultTransfer | ||
{ | ||
$spyProcessEntityTransfer = new SpyProcessEntityTransfer(); | ||
$spyProcessEntityTransfer->setProcessName($processResultTransfer->getProcessName()); | ||
$spyProcessEntityTransfer = $this->reportEntityManager->saveProcess($spyProcessEntityTransfer); | ||
|
||
return $this->reportEntityManager->saveProcessResult($processResultTransfer, $spyProcessEntityTransfer); | ||
} | ||
|
||
/** | ||
* @param int $idResult | ||
* | ||
* @return \Generated\Shared\Transfer\ProcessResultTransfer | ||
*/ | ||
public function findProcessResultByResultId(int $idResult): ProcessResultTransfer | ||
{ | ||
return $this->reportRepository->findProcessResultByResultId($idResult); | ||
} | ||
|
||
/** | ||
* @param int $idResult | ||
* | ||
* @return \Generated\Shared\Transfer\SpyProcessEntityTransfer | ||
*/ | ||
public function findProcessByIdResult(int $idResult): SpyProcessEntityTransfer | ||
{ | ||
return $this->reportRepository->findProcessByIdResult($idResult); | ||
} | ||
|
||
/** | ||
* @param int $idProcess | ||
* | ||
* @return \Generated\Shared\Transfer\SpyProcessEntityTransfer | ||
*/ | ||
public function findProcessByProcessId(int $idProcess): SpyProcessEntityTransfer | ||
{ | ||
return $this->reportRepository->findProcessByProcessId($idProcess); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
src/SprykerMiddleware/Zed/Report/Business/Model/ProcessResultInterface.php
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,37 @@ | ||
<?php | ||
|
||
namespace SprykerMiddleware\Zed\Report\Business\Model; | ||
|
||
use Generated\Shared\Transfer\ProcessResultTransfer; | ||
use Generated\Shared\Transfer\SpyProcessEntityTransfer; | ||
|
||
interface ProcessResultInterface | ||
{ | ||
/** | ||
* @param \Generated\Shared\Transfer\ProcessResultTransfer $processResultTransfer | ||
* | ||
* @return \Generated\Shared\Transfer\ProcessResultTransfer | ||
*/ | ||
public function saveProcessResult(ProcessResultTransfer $processResultTransfer): ProcessResultTransfer; | ||
|
||
/** | ||
* @param int $idResult | ||
* | ||
* @return \Generated\Shared\Transfer\ProcessResultTransfer | ||
*/ | ||
public function findProcessResultByResultId(int $idResult): ProcessResultTransfer; | ||
|
||
/** | ||
* @param int $idResult | ||
* | ||
* @return \Generated\Shared\Transfer\SpyProcessEntityTransfer | ||
*/ | ||
public function findProcessByIdResult(int $idResult): SpyProcessEntityTransfer; | ||
|
||
/** | ||
* @param int $idProcess | ||
* | ||
* @return \Generated\Shared\Transfer\SpyProcessEntityTransfer | ||
*/ | ||
public function findProcessByProcessId(int $idProcess): SpyProcessEntityTransfer; | ||
} |
25 changes: 25 additions & 0 deletions
25
src/SprykerMiddleware/Zed/Report/Business/ReportBusinessFactory.php
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,25 @@ | ||
<?php | ||
|
||
namespace SprykerMiddleware\Zed\Report\Business; | ||
|
||
use Spryker\Zed\Kernel\Business\AbstractBusinessFactory; | ||
use SprykerMiddleware\Zed\Report\Business\Model\ProcessResult; | ||
use SprykerMiddleware\Zed\Report\Business\Model\ProcessResultInterface; | ||
|
||
/** | ||
* @method \SprykerMiddleware\Zed\Report\Persistence\ReportRepositoryInterface getRepository() | ||
* @method \SprykerMiddleware\Zed\Report\Persistence\ReportEntityManagerInterface getEntityManager() | ||
*/ | ||
class ReportBusinessFactory extends AbstractBusinessFactory | ||
{ | ||
/** | ||
* @return \SprykerMiddleware\Zed\Report\Business\Model\ProcessResultInterface | ||
*/ | ||
public function createProcessResult(): ProcessResultInterface | ||
{ | ||
return new ProcessResult( | ||
$this->getRepository(), | ||
$this->getEntityManager() | ||
); | ||
} | ||
} |
61 changes: 61 additions & 0 deletions
61
src/SprykerMiddleware/Zed/Report/Business/ReportFacade.php
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,61 @@ | ||
<?php | ||
|
||
namespace SprykerMiddleware\Zed\Report\Business; | ||
|
||
use Generated\Shared\Transfer\ProcessResultTransfer; | ||
use Generated\Shared\Transfer\SpyProcessEntityTransfer; | ||
use Spryker\Zed\Kernel\Business\AbstractFacade; | ||
|
||
/** | ||
* @method \SprykerMiddleware\Zed\Report\Business\ReportBusinessFactory getFactory() | ||
*/ | ||
class ReportFacade extends AbstractFacade implements ReportFacadeInterface | ||
{ | ||
/** | ||
* @param \Generated\Shared\Transfer\ProcessResultTransfer $processResultTransfer | ||
* | ||
* @return \Generated\Shared\Transfer\ProcessResultTransfer | ||
*/ | ||
public function saveProcessResult(ProcessResultTransfer $processResultTransfer): ProcessResultTransfer | ||
{ | ||
return $this->getFactory() | ||
->createProcessResult() | ||
->saveProcessResult($processResultTransfer); | ||
} | ||
|
||
/** | ||
* @param int $idResult | ||
* | ||
* @return \Generated\Shared\Transfer\ProcessResultTransfer | ||
*/ | ||
public function findProcessResultByResultId(int $idResult): ProcessResultTransfer | ||
{ | ||
return $this->getFactory() | ||
->createProcessResult() | ||
->findProcessResultByResultId($idResult); | ||
} | ||
|
||
/** | ||
* @param int $idResult | ||
* | ||
* @return \Generated\Shared\Transfer\SpyProcessEntityTransfer | ||
*/ | ||
public function findProcessByIdResult(int $idResult): SpyProcessEntityTransfer | ||
{ | ||
return $this->getFactory() | ||
->createProcessResult() | ||
->findProcessByIdResult($idResult); | ||
} | ||
|
||
/** | ||
* @param int $idProcess | ||
* | ||
* @return \Generated\Shared\Transfer\SpyProcessEntityTransfer | ||
*/ | ||
public function findProcessByProcessId(int $idProcess): SpyProcessEntityTransfer | ||
{ | ||
return $this->getFactory() | ||
->createProcessResult() | ||
->findProcessByProcessId($idProcess); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
src/SprykerMiddleware/Zed/Report/Business/ReportFacadeInterface.php
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,37 @@ | ||
<?php | ||
|
||
namespace SprykerMiddleware\Zed\Report\Business; | ||
|
||
use Generated\Shared\Transfer\ProcessResultTransfer; | ||
use Generated\Shared\Transfer\SpyProcessEntityTransfer; | ||
|
||
interface ReportFacadeInterface | ||
{ | ||
/** | ||
* @param \Generated\Shared\Transfer\ProcessResultTransfer $processResultTransfer | ||
* | ||
* @return \Generated\Shared\Transfer\ProcessResultTransfer | ||
*/ | ||
public function saveProcessResult(ProcessResultTransfer $processResultTransfer): ProcessResultTransfer; | ||
|
||
/** | ||
* @param int $idResult | ||
* | ||
* @return \Generated\Shared\Transfer\ProcessResultTransfer | ||
*/ | ||
public function findProcessResultByResultId(int $idResult): ProcessResultTransfer; | ||
|
||
/** | ||
* @param int $idResult | ||
* | ||
* @return \Generated\Shared\Transfer\SpyProcessEntityTransfer | ||
*/ | ||
public function findProcessByIdResult(int $idResult): SpyProcessEntityTransfer; | ||
|
||
/** | ||
* @param int $idProcess | ||
* | ||
* @return \Generated\Shared\Transfer\SpyProcessEntityTransfer | ||
*/ | ||
public function findProcessByProcessId(int $idProcess): SpyProcessEntityTransfer; | ||
} |
Oops, something went wrong.