-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SDK-2438 added advanced ca and added related tests
- Loading branch information
1 parent
14003c5
commit 5c8627c
Showing
15 changed files
with
687 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
src/DocScan/Request/Check/Advanced/SandboxExactMatchingStrategy.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,27 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Yoti\Sandbox\DocScan\Request\Check\Advanced; | ||
|
||
use Yoti\Sandbox\DocScan\Request\Check\Contracts\Advanced\SandboxCaMatchingStrategy; | ||
use Yoti\Sandbox\DocScan\SandboxConstants; | ||
|
||
class SandboxExactMatchingStrategy extends SandboxCaMatchingStrategy | ||
{ | ||
/** | ||
* @return bool | ||
*/ | ||
public function isExactMatch(): bool | ||
{ | ||
return true; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getType(): string | ||
{ | ||
return SandboxConstants::EXACT; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/DocScan/Request/Check/Advanced/SandboxExactMatchingStrategyBuilder.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,18 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Yoti\Sandbox\DocScan\Request\Check\Advanced; | ||
|
||
use Yoti\DocScan\Session\Create\Check\Advanced\RequestedExactMatchingStrategy; | ||
|
||
class SandboxExactMatchingStrategyBuilder | ||
{ | ||
/** | ||
* @return RequestedExactMatchingStrategy | ||
*/ | ||
public function build(): RequestedExactMatchingStrategy | ||
{ | ||
return new RequestedExactMatchingStrategy(); | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
src/DocScan/Request/Check/Advanced/SandboxSearchProfileSources.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,52 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Yoti\Sandbox\DocScan\Request\Check\Advanced; | ||
|
||
use stdClass; | ||
use Yoti\Sandbox\DocScan\Request\Check\Contracts\Advanced\SandboxCaSources; | ||
use Yoti\Sandbox\DocScan\SandboxConstants; | ||
|
||
class SandboxSearchProfileSources extends SandboxCaSources | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
private $searchProfile; | ||
|
||
/** | ||
* @param string $searchProfile | ||
*/ | ||
public function __construct(string $searchProfile) | ||
{ | ||
$this->searchProfile = $searchProfile; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getSearchProfile(): string | ||
{ | ||
return $this->searchProfile; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getType(): string | ||
{ | ||
return SandboxConstants::PROFILE; | ||
} | ||
|
||
/** | ||
* @return stdClass | ||
*/ | ||
public function jsonSerialize(): stdClass | ||
{ | ||
$json = parent::jsonSerialize(); | ||
$json->search_profile = $this->getSearchProfile(); | ||
|
||
return $json; | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
src/DocScan/Request/Check/Advanced/SandboxSearchProfileSourcesBuilder.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,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Yoti\Sandbox\DocScan\Request\Check\Advanced; | ||
|
||
class SandboxSearchProfileSourcesBuilder | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
private $searchProfile; | ||
|
||
/** | ||
* @param string $searchProfile | ||
* @return $this | ||
*/ | ||
public function withSearchProfile(string $searchProfile): SandboxSearchProfileSourcesBuilder | ||
{ | ||
$this->searchProfile = $searchProfile; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return SandboxSearchProfileSources | ||
*/ | ||
public function build(): SandboxSearchProfileSources | ||
{ | ||
return new SandboxSearchProfileSources($this->searchProfile); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/DocScan/Request/Check/Contracts/Advanced/SandboxCaMatchingStrategy.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,31 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Yoti\Sandbox\DocScan\Request\Check\Contracts\Advanced; | ||
|
||
use stdClass; | ||
use Yoti\Util\Json; | ||
|
||
abstract class SandboxCaMatchingStrategy implements \JsonSerializable | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
public $type; | ||
|
||
/** | ||
* @return string | ||
*/ | ||
abstract public function getType(): string; | ||
|
||
/** | ||
* @return stdClass | ||
*/ | ||
public function jsonSerialize(): stdClass | ||
{ | ||
return (object)Json::withoutNullValues([ | ||
'type' => $this->getType(), | ||
]); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/DocScan/Request/Check/Contracts/Advanced/SandboxCaSources.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,31 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Yoti\Sandbox\DocScan\Request\Check\Contracts\Advanced; | ||
|
||
use stdClass; | ||
use Yoti\Util\Json; | ||
|
||
abstract class SandboxCaSources implements \JsonSerializable | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
public $type; | ||
|
||
/** | ||
* @return string | ||
*/ | ||
abstract public function getType(): string; | ||
|
||
/** | ||
* @return stdClass | ||
*/ | ||
public function jsonSerialize(): stdClass | ||
{ | ||
return (object)Json::withoutNullValues([ | ||
'type' => $this->getType(), | ||
]); | ||
} | ||
} |
102 changes: 102 additions & 0 deletions
102
src/DocScan/Request/Check/Contracts/SandboxWatchlistAdvancedCaConfig.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,102 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Yoti\Sandbox\DocScan\Request\Check\Contracts; | ||
|
||
use stdClass; | ||
use Yoti\Sandbox\DocScan\Request\Check\Contracts\Advanced\SandboxCaMatchingStrategy; | ||
use Yoti\Sandbox\DocScan\Request\Check\Contracts\Advanced\SandboxCaSources; | ||
use Yoti\Sandbox\DocScan\Request\Check\SandboxCheckConfigInterface; | ||
|
||
abstract class SandboxWatchlistAdvancedCaConfig implements SandboxCheckConfigInterface | ||
{ | ||
/** | ||
* @var bool | ||
*/ | ||
private $removeDeceased; | ||
|
||
/** | ||
* @var bool | ||
*/ | ||
private $shareUrl; | ||
|
||
/** | ||
* @var SandboxCaSources | ||
*/ | ||
private $sources; | ||
|
||
/** | ||
* @var SandboxCaMatchingStrategy | ||
*/ | ||
private $matchingStrategy; | ||
|
||
/** | ||
* @return string | ||
*/ | ||
abstract public function getType(): string; | ||
|
||
/** | ||
* @param bool $removeDeceased | ||
* @param bool $shareUrl | ||
* @param SandboxCaSources $sources | ||
* @param SandboxCaMatchingStrategy $matchingStrategy | ||
*/ | ||
public function __construct( | ||
bool $removeDeceased, | ||
bool $shareUrl, | ||
SandboxCaSources $sources, | ||
SandboxCaMatchingStrategy $matchingStrategy | ||
) { | ||
$this->removeDeceased = $removeDeceased; | ||
$this->shareUrl = $shareUrl; | ||
$this->sources = $sources; | ||
$this->matchingStrategy = $matchingStrategy; | ||
} | ||
|
||
/** | ||
* @return bool | ||
*/ | ||
public function getRemoveDeceased(): bool | ||
{ | ||
return $this->removeDeceased; | ||
} | ||
|
||
/** | ||
* @return bool | ||
*/ | ||
public function getShareUrl(): bool | ||
{ | ||
return $this->shareUrl; | ||
} | ||
|
||
/** | ||
* @return SandboxCaSources | ||
*/ | ||
public function getSources(): SandboxCaSources | ||
{ | ||
return $this->sources; | ||
} | ||
|
||
/** | ||
* @return SandboxCaMatchingStrategy | ||
*/ | ||
public function getMatchingStrategy(): SandboxCaMatchingStrategy | ||
{ | ||
return $this->matchingStrategy; | ||
} | ||
|
||
/** | ||
* @return stdClass | ||
*/ | ||
public function jsonSerialize(): stdClass | ||
{ | ||
return (object)[ | ||
'remove_deceased' => $this->getRemoveDeceased(), | ||
'share_url' => $this->getShareUrl(), | ||
'sources' => $this->getSources(), | ||
'matching_strategy' => $this->getMatchingStrategy(), | ||
'type' => $this->getType(), | ||
]; | ||
} | ||
} |
81 changes: 81 additions & 0 deletions
81
src/DocScan/Request/Check/Contracts/SandboxWatchlistAdvancedCaConfigBuilder.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,81 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Yoti\Sandbox\DocScan\Request\Check\Contracts; | ||
|
||
use Yoti\Sandbox\DocScan\Request\Check\Contracts\Advanced\SandboxCaMatchingStrategy; | ||
use Yoti\Sandbox\DocScan\Request\Check\Contracts\Advanced\SandboxCaSources; | ||
|
||
abstract class SandboxWatchlistAdvancedCaConfigBuilder | ||
{ | ||
/** | ||
* @var bool | ||
*/ | ||
protected $removeDeceased; | ||
|
||
/** | ||
* @var bool | ||
*/ | ||
protected $shareUrl; | ||
|
||
/** | ||
* @var SandboxCaSources | ||
*/ | ||
protected $sources; | ||
|
||
/** | ||
* @var SandboxCaMatchingStrategy | ||
*/ | ||
protected $matchingStrategy; | ||
|
||
/** | ||
* @return mixed | ||
*/ | ||
abstract public function build(); | ||
|
||
/** | ||
* @param bool $removeDeceased | ||
* @return $this | ||
*/ | ||
public function withRemoveDeceased(bool $removeDeceased): SandboxWatchlistAdvancedCaConfigBuilder | ||
{ | ||
$this->removeDeceased = $removeDeceased; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @param bool $shareUrl | ||
* @return $this | ||
*/ | ||
public function withShareUrl(bool $shareUrl): SandboxWatchlistAdvancedCaConfigBuilder | ||
{ | ||
$this->shareUrl = $shareUrl; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @param SandboxCaSources $sources | ||
* @return $this | ||
*/ | ||
public function withSources(SandboxCaSources $sources): SandboxWatchlistAdvancedCaConfigBuilder | ||
{ | ||
$this->sources = $sources; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @param SandboxCaMatchingStrategy $matchingStrategy | ||
* @return $this | ||
*/ | ||
public function withMatchingStrategy( | ||
SandboxCaMatchingStrategy $matchingStrategy | ||
): SandboxWatchlistAdvancedCaConfigBuilder { | ||
$this->matchingStrategy = $matchingStrategy; | ||
|
||
return $this; | ||
} | ||
} |
Oops, something went wrong.