30 lines
788 B
PHP
30 lines
788 B
PHP
<?php
|
|
|
|
namespace App\Domain\Integration;
|
|
|
|
readonly class MachineCommandResult
|
|
{
|
|
public function __construct(
|
|
public bool $success,
|
|
public string $status,
|
|
public ?string $externalReference = null,
|
|
public ?string $correlationId = null,
|
|
) {}
|
|
|
|
public static function success(
|
|
string $status = 'acknowledged',
|
|
?string $externalReference = null,
|
|
?string $correlationId = null,
|
|
): self {
|
|
return new self(true, $status, $externalReference, $correlationId);
|
|
}
|
|
|
|
public static function failure(
|
|
string $status = 'failed',
|
|
?string $externalReference = null,
|
|
?string $correlationId = null,
|
|
): self {
|
|
return new self(false, $status, $externalReference, $correlationId);
|
|
}
|
|
}
|