use Shopware\Core\Framework\Log\Package;
use Shopware\Core\Framework\Rule\Container\DaysSinceRule;
use Shopware\Core\Framework\Rule\RuleScope;
#[Package('business-ops')]
class DaysSinceLastLoginRule extends DaysSinceRule
{ final public const RULE_NAME = 'customerDaysSinceLastLogin';
protected function getDate(RuleScope
$scope): ?\DateTimeInterface
{ if (!
$customer =
$scope->
getSalesChannelContext()->
getCustomer()) { return null;
} return $customer->
getLastLogin();
} protected function supportsScope(RuleScope
$scope): bool
{ return $scope instanceof CheckoutRuleScope;
}}