34 lines
1.2 KiB
PHP
34 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace Modules\Core\Recovery\Events;
|
|
|
|
use Lunar\Models\Cart;
|
|
use Lunar\Models\Order;
|
|
|
|
/**
|
|
* A cart's checkout has gone stale (no activity for
|
|
* config('core.cart.abandoned_after')) with a draft Order already created
|
|
* (Order::isDraft() — placed_at IS NULL) but never placed. Strong
|
|
* purchase-intent signal — the shopper committed to checking out, something
|
|
* blocked completion. Distinct from CartAbandoned, which fires for a cart
|
|
* with no order at all (weak intent, usually unreachable). Checkout
|
|
* typically captures an email/address even for a guest, so this state is
|
|
* normally reachable regardless of login status.
|
|
*
|
|
* Lives under Recovery, not Checkout/Cart — abandonment detection/tracking
|
|
* is deliberately kept out of both modules entirely, including its event
|
|
* definitions. See docs/cart.md and docs/recovery-strategies.md.
|
|
*
|
|
* "Abandoned" is a derived state (stale updated_at, no placed_at), not
|
|
* something that transitions via a normal Eloquent write — detection is
|
|
* Recovery's own concern (not yet built; design notes in
|
|
* docs/recovery-strategies.md).
|
|
*/
|
|
class CheckoutAbandoned
|
|
{
|
|
public function __construct(
|
|
public readonly Cart $cart,
|
|
public readonly Order $order,
|
|
) {}
|
|
}
|