<?php

/**
 * Copyright 2024-2025 Simply.IN Sp. z o.o.
 *
 * NOTICE OF LICENSE
 *
 * Licensed under the EUPL-1.2 or later.
 * You may not use this work except in compliance with the Licence.
 *
 * Copy of the Licence is available at:
 * https://joinup.ec.europa.eu/software/page/eupl
 * It is bundled with this package in the file LICENSE.txt
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the Licence is distributed on an as is basis,
 * without warranties or conditions of any kind, either express or implied.
 * Check the Licence for the specific language governing permissions
 * and limitations under the License.
 *
 * @author   Simply.IN Sp. z o.o.
 * @copyright 2024-2025 Simply.IN Sp. z o.o.
 * @license   https://joinup.ec.europa.eu/software/page/eupl
 */

declare(strict_types=1);

namespace SimplyIn\Install;

if (!defined('_PS_VERSION_')) {
    exit;
}

final class HookRegistry
{
    /**
     * @return list<string>
     */
    public static function hooks(): array
    {
        return [
            'actionAdminOrdersTrackingNumberUpdate',
            'actionObjectOrderCarrierUpdateAfter',
            'actionCustomerLogoutBefore',
            'actionOrderStatusPostUpdate',
            'actionCustomerAccountUpdate',
            'displayHeader',
            'actionFrontControllerSetMedia',
            'displayPaymentTop',
            'displayExpressCheckout',
            'displayBackOfficeHeader',
            'displayAdminOrderMain',
            'actionCarrierUpdate',
            'actionValidateOrder',
            'actionModuleRegisterCronJobs',
            'paymentOptions',
            'displayOrderConfirmation',
            'displayOrderDetail',
            'displayAddressSelectorBottom',
            'actionOrderGridDefinitionModifier',
            'actionOrderGridQueryBuilderModifier',
        ];
    }

    /**
     * Hooks a shop may still be registered on from an earlier module version, no longer in
     * {@see hooks()} and so never registered on a fresh install, but still needing cleanup on
     * uninstall so it doesn't leave a stale hook-module row behind.
     *
     * `displayShoppingCartFooter`: superseded by `displayExpressCheckout` for the cart badge (see
     * {@see \Simplyin::hookDisplayExpressCheckout()}, still served in the meantime by the
     * backward-compat shim {@see \Simplyin::hookDisplayShoppingCartFooter()}); every shop installed
     * before that change is still registered on it until its own upgrade migration runs.
     *
     * @return list<string>
     */
    public static function legacyHooksToUnregister(): array
    {
        return [
            'displayShoppingCartFooter',
        ];
    }
}
