Files
backend/app/Domain/Integration/MachineCommandResult.php
T
2026-06-28 12:29:53 +02:00

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);
}
}