initial commit
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user