26 lines
798 B
PHP
26 lines
798 B
PHP
<?php
|
|||
|
|
|
||
|
|
namespace Modules\Core\Order\Events;
|
||
|
|
|
||
|
|
use Illuminate\Foundation\Events\Dispatchable;
|
||
|
|
use Lunar\Models\Order;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Dispatched by Modules\Core\Order\Services\OrderStatusWriter::markPaid()
|
||
|
|
* whenever Order::paid flips to true — entirely independent of the
|
||
|
|
* `status` column (see OrderStatusFlow's own docblock for why payment
|
||
|
|
* timing, especially for cash-on-delivery, cannot be modeled as a step in
|
||
|
|
* that sequence). Order::status changes are instead picked up generically
|
||
|
|
* by Modules\Core\Order\Events\OrderStatusUpdated (dispatched by
|
||
|
|
* OrderObserver whenever `status` changes, regardless of writer).
|
||
|
|
*/
|
||
|
|
class OrderPaidChanged
|
||
|
|
{
|
||
|
|
use Dispatchable;
|
||
|
|
|
||
|
|
public function __construct(
|
||
|
|
public readonly Order $order,
|
||
|
|
public readonly string $causeClass,
|
||
|
|
) {}
|
||
|
|
}
|