2026-07-19 00:50:15 +03:00
|
|
|
<?php
|
|
|
|
|
|
2026-09-03 15:58:51 +03:00
|
|
|
namespace Modules\Core\Shipping\DTOs;
|
2026-07-19 00:50:15 +03:00
|
|
|
|
|
|
|
|
use Illuminate\Support\Collection;
|
|
|
|
|
|
|
|
|
|
class ManifestResult
|
|
|
|
|
{
|
|
|
|
|
private function __construct(
|
|
|
|
|
public readonly bool $success,
|
|
|
|
|
public readonly ?string $reference,
|
|
|
|
|
public readonly Collection $includedShipments,
|
|
|
|
|
public readonly Collection $blockedShipments,
|
|
|
|
|
public readonly ?string $reason,
|
|
|
|
|
) {}
|
|
|
|
|
|
|
|
|
|
public static function success(string $reference, Collection $includedShipments): self
|
|
|
|
|
{
|
|
|
|
|
return new self(true, $reference, $includedShipments, collect(), null);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static function blocked(Collection $blockedShipments, string $reason): self
|
|
|
|
|
{
|
|
|
|
|
return new self(false, null, collect(), $blockedShipments, $reason);
|
|
|
|
|
}
|
|
|
|
|
}
|