<?php

namespace CouponsPlus\App\Handlers;

use CouponsPlus\App\Offers\DiscountState;
use CouponsPlus\Original\Events\Handler\EventHandler;

Class DiscountStateRegistrationHandler extends EventHandler
{
    protected $numberOfArguments = 1;
    protected $priority = 10;

    public function execute()
    {
        add_action('woocommerce_before_calculate_totals', [DiscountState::getInstance(), 'reset']);
        add_action('woocommerce_after_calculate_totals', [DiscountState::getInstance(), 'saveCartData'], 100);
    }
}