Feature: Order Updates, Events, Order Flows, Shipment And COD support
This commit is contained in:
@@ -3,24 +3,26 @@
|
||||
namespace Modules\Core\Shipping\DTOs;
|
||||
|
||||
use Illuminate\Support\Collection;
|
||||
use Modules\Core\Shipping\Models\Manifest;
|
||||
|
||||
class ManifestResult
|
||||
{
|
||||
private function __construct(
|
||||
public readonly bool $success,
|
||||
public readonly ?string $reference,
|
||||
public readonly ?Manifest $manifest,
|
||||
public readonly Collection $includedShipments,
|
||||
public readonly Collection $blockedShipments,
|
||||
public readonly ?string $reason,
|
||||
) {}
|
||||
|
||||
public static function success(string $reference, Collection $includedShipments): self
|
||||
public static function success(Manifest $manifest, Collection $includedShipments): self
|
||||
{
|
||||
return new self(true, $reference, $includedShipments, collect(), null);
|
||||
return new self(true, $manifest->reference, $manifest, $includedShipments, collect(), null);
|
||||
}
|
||||
|
||||
public static function blocked(Collection $blockedShipments, string $reason): self
|
||||
{
|
||||
return new self(false, null, collect(), $blockedShipments, $reason);
|
||||
return new self(false, null, null, collect(), $blockedShipments, $reason);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user