Automated PR provided by Codex via Gitea API. Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #482
36 lines
1023 B
PHP
36 lines
1023 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Services\TenantConfiguration;
|
|
|
|
use App\Support\TenantConfiguration\CaptureOutcome;
|
|
|
|
final readonly class CoverageSourceContractDecision
|
|
{
|
|
/**
|
|
* @param array<string, mixed> $contract
|
|
* @param array<string, mixed> $sourceMetadata
|
|
*/
|
|
public function __construct(
|
|
public string $canonicalType,
|
|
public CaptureOutcome $outcome,
|
|
public ?string $contractKey = null,
|
|
public ?string $sourceEndpoint = null,
|
|
public string $sourceVersion = 'v1.0',
|
|
public ?string $sourceSchemaHash = null,
|
|
public ?string $reasonCode = null,
|
|
public array $contract = [],
|
|
public array $sourceMetadata = [],
|
|
) {}
|
|
|
|
public function capturable(): bool
|
|
{
|
|
return $this->outcome === CaptureOutcome::Captured
|
|
&& is_string($this->contractKey)
|
|
&& $this->contractKey !== ''
|
|
&& is_string($this->sourceEndpoint)
|
|
&& $this->sourceEndpoint !== '';
|
|
}
|
|
}
|