<?php
/**
 * Turns rule constants into something a customer can act on.
 *
 * @package SkyServers\Retragere
 */

declare(strict_types=1);

namespace SkyServers\Retragere\Wc;

use SkyServers\Retragere\Core\EligibilityRules;

/**
 * Core speaks in constants because it knows nothing about language. The
 * translation lives here, next to the screens that show it.
 */
final class LineReasons
{
    public static function label(string $reason): string
    {
        switch ($reason) {
            case EligibilityRules::REASON_DIGITAL:
                return __('digital product, exempt from the right of withdrawal', 'skyservers-retragere-contract');
            case EligibilityRules::REASON_ALREADY_REQUESTED:
                return __('already included in a withdrawal request', 'skyservers-retragere-contract');
            case EligibilityRules::REASON_NON_RETURNABLE:
                return __('product exempt from the right of withdrawal', 'skyservers-retragere-contract');
            default:
                return __('unavailable for selection', 'skyservers-retragere-contract');
        }
    }
}
