Weak hands cannot be planted, meager skills have no foundation. Shallow wisdom is futile, how can one hope for a good name?扰扰从役倦，屑屑身事微。少壮轻年月，迟暮惜光辉。
<html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><?php

namespace Hostinger\Reach\Jobs;

use Hostinger\Reach\Api\Handlers\ReachApiHandler;
use Hostinger\Reach\Api\Webhooks\Handlers\CartAbandoned;
use Hostinger\Reach\Models\Cart;
use Hostinger\Reach\Repositories\CartRepository;

class AbandonedCartsJob extends AbstractBatchedJob implements RecurringJobInterface {

    public const JOB_NAME             = 'abandoned_carts';
    public const JOB_INTERVAL_SECONDS = MINUTE_IN_SECONDS * 15;

    protected CartAbandoned $cart_abandoned_webhook;
    protected CartRepository $cart_repository;

    public function __construct( ActionScheduler $action_scheduler, ReachApiHandler $reach_api_handler, CartRepository $cart_repository, CartAbandoned $cart_abandoned_webhook ) {
        parent::__construct( $action_scheduler, $reach_api_handler );
        $this->cart_repository        = $cart_repository;
        $this->cart_abandoned_webhook = $cart_abandoned_webhook;
    }

    public function handle_create_batch_action( int $batch_number, array $args ): void {
        if ( ! $this->cart_abandoned_webhook->is_enabled() ) {
            $this->handle_complete( $batch_number, $args );

            return;
        }

        parent::handle_create_batch_action( $batch_number, $args );
    }

    public function can_schedule_recurrent(): bool {
        return $this->cart_abandoned_webhook->is_enabled() && count( $this->cart_repository->active_abandoned_carts( 1 ) ) && parent::can_schedule_recurrent();
    }

    protected function get_batch( int $batch_number, array $args ): array {
        $limit = $this->get_batch_size();

        return $this->cart_repository->active_abandoned_carts( $limit, array( 'hash' ) );
    }

    public function get_name(): string {
        return self::JOB_NAME;
    }

    protected function process_items( array $args = array() ): void {
        $items = $args['items'] ?? array();

        if ( empty( $items ) ) {
            return;
        }

        foreach ( $items as $item ) {
            $this->cart_abandoned_webhook->send( $item['hash'] );
        }
    }

    prote