Feat: Shipping functionalities redesign, elta courier integration, commenting out acs since no integration can happen, flow updates

This commit is contained in:
2026-09-30 17:28:47 +03:00
parent f411dec1da
commit 49ec4333af
63 changed files with 3143 additions and 347 deletions
+19 -1
View File
@@ -29,6 +29,18 @@ use Modules\Core\Order\Events\OrderStatusChanged;
*/
class OrderStatusWriter
{
/**
* The cause of the write in progress, so OrderObserver can put it on
* the generic OrderStatusUpdated event (null for writes that don't go
* through here, e.g. tinker).
*/
private static ?string $currentCause = null;
public static function currentCause(): ?string
{
return self::$currentCause;
}
public function write(Order $order, string $to, string $causeClass): void
{
$from = $order->status;
@@ -37,7 +49,13 @@ class OrderStatusWriter
return;
}
$order->update(['status' => $to]);
self::$currentCause = $causeClass;
try {
$order->update(['status' => $to]);
} finally {
self::$currentCause = null;
}
OrderStatusChanged::dispatch($order, $from, $to, $causeClass);
}