<?php

namespace CouponsPlus\App\Handlers;

use CouponsPlus\App\Conditions\ConditionsRegistrator;
use CouponsPlus\Original\Events\Handler\EventHandler;
use CouponsPlus\App\Conditions\BuiltIn\Conditions\Date;
use CouponsPlus\App\Conditions\Stubs\Conditions\Holidays;
use CouponsPlus\App\Conditions\Stubs\Conditions\Location;
use CouponsPlus\App\Conditions\Stubs\Conditions\CartTotal;
use CouponsPlus\App\Conditions\BuiltIn\Conditions\Anything;
use CouponsPlus\App\Conditions\BuiltIn\Conditions\UserRole;
use CouponsPlus\App\Conditions\Stubs\Conditions\NewAccount;
use CouponsPlus\App\Conditions\Stubs\Conditions\TotalSpend;
use CouponsPlus\App\Conditions\Stubs\Conditions\NewCustomer;
use CouponsPlus\App\Conditions\Stubs\Conditions\CheckoutField;
use CouponsPlus\App\Conditions\BuiltIn\Conditions\CartSubtotal;
use CouponsPlus\App\Conditions\BuiltIn\Conditions\CustomerType;
use CouponsPlus\App\Conditions\BuiltIn\Conditions\URLParameter;
use CouponsPlus\App\Conditions\Stubs\Conditions\CustomUserMeta;
use CouponsPlus\App\Conditions\Stubs\Conditions\WeeklySchedule;
use CouponsPlus\App\Conditions\BuiltIn\Conditions\CouponsInCart;
use CouponsPlus\App\Conditions\BuiltIn\Conditions\PaymentMethod;
use CouponsPlus\App\Conditions\BuiltIn\Conditions\ShippingMethod;
use CouponsPlus\App\Conditions\Stubs\Conditions\CustomerPurchaseHistory;
use CouponsPlus\App\Conditions\Stubs\Conditions\AccountRegistrationDate;
use CouponsPlus\App\Conditions\BuiltIn\Conditions\CouponUsageNumberOfTimes;
use CouponsPlus\App\Conditions\BuiltIn\Conditions\CouponUsageNumberOfTimesPerUser;
use CouponsPlus\App\Conditions\BuiltIn\Conditions\UserID;

#[\AllowDynamicProperties]
Class BuiltInConditionsRegistrator extends EventHandler
{
    protected $numberOfArguments = 1;
    protected $priority = 10;

    public function execute(ConditionsRegistrator $conditionsRegistrator)
    {
        $conditionsRegistrator->register(Anything::class);
        $conditionsRegistrator->register(CartSubtotal::class);
        $conditionsRegistrator->register(CouponUsageNumberOfTimes::class);
        $conditionsRegistrator->register(CouponUsageNumberOfTimesPerUser::class);
        $conditionsRegistrator->register(CouponsInCart::class);
        $conditionsRegistrator->register(CustomerType::class);
        $conditionsRegistrator->register(Date::class);
        $conditionsRegistrator->register(PaymentMethod::class);
        //$conditionsRegistrator->register(ShippingTotal::class);
        $conditionsRegistrator->register(ShippingMethod::class);
        $conditionsRegistrator->register(URLParameter::class);
        $conditionsRegistrator->register(UserRole::class);
        $conditionsRegistrator->register(UserID::class);

        /**++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
         * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
         *
         *             -----------  NOT IMPLEMENTED -----------
         *
        +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++**
        *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
        $conditionsRegistrator->registerStub(NewAccount::class);
        $conditionsRegistrator->registerStub(NewCustomer::class);
        $conditionsRegistrator->registerStub(CartTotal::class);
        $conditionsRegistrator->registerStub(CheckoutField::class);
        $conditionsRegistrator->registerStub(CustomerPurchaseHistory::class);
        $conditionsRegistrator->registerStub(TotalSpend::class);
        $conditionsRegistrator->registerStub(CustomUserMeta::class);
        $conditionsRegistrator->registerStub(WeeklySchedule::class);
        $conditionsRegistrator->registerStub(Holidays::class);
        $conditionsRegistrator->registerStub(Location::class);
        $conditionsRegistrator->registerStub(AccountRegistrationDate::class);
    }
}
