Feature: Add ManifestResult DTO for carrier manifest batching
Completes the carrier-agnostic shipping abstraction (CarrierFulfillmentInterface, SupportsManifestBatching, Shipment model) with the result type SupportsManifestBatching::issueManifest() returns. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Core\Shipping\DataTransferObjects;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user