Your IP : 216.73.217.79


Current Path : /var/www/v3.cesa.co.za/src/MemberBundle/Form/
Upload File :
Current File : /var/www/v3.cesa.co.za/src/MemberBundle/Form/TransformationReportingChoices.php

<?php

namespace App\MemberBundle\Form;

/**
 * Values recognised by MemberFirmManager::processStats() for turnover / ownership charts.
 */
final class TransformationReportingChoices
{
    /** @return array<string, string> label => stored value */
    public static function smmeCategories(): array
    {
        $codes = [
            'Not specified',
            'EME1', 'EME2',
            'QSE1', 'QSE2', 'QSE3', 'QSE4',
            'GEN1', 'GEN2', 'GEN3', 'GEN4', 'GEN5', 'GEN6', 'GEN7', 'GEN8',
        ];
        $out = [];
        foreach ($codes as $c) {
            $out[$c] = $c === 'Not specified' ? 'NotSpecified' : $c;
        }

        return $out;
    }

    /** @return array<string, string> */
    public static function blackOwnership(): array
    {
        return [
            'Less than 10%' => 'Less than 10%',
            'Equal to or greater than 10 and less than 25%' => 'Equal to or greater than 10 and less than 25%',
            'Equal to or greater than 25 and less than 51%' => 'Equal to or greater than 25 and less than 51%',
            'Equal to or greater than 51 and less than 100%' => 'Equal to or greater than 51 and less than 100%',
            '100% / fully black-owned' => '100%',
            'Black Owned' => 'Black Owned',
        ];
    }

    /** @return array<string, string> */
    public static function blackWomenOwnership(): array
    {
        return [
            'Less than 10%' => 'Less than 10%',
            'Less than 30%' => 'Less than 30%',
            'Equal to or greater than 10 and less than 30%' => 'Equal to or greater than 10 and less than 30%',
            'Equal to or greater than 30 and less than 51%' => 'Equal to or greater than 30 and less than 51%',
            'Equal to or greater than 51 and less than 100%' => 'Equal to or greater than 51 and less than 100%',
            '100%' => '100%',
            'Equal to 100' => 'Equal to 100',
        ];
    }

    /** @return array<string, int> */
    public static function bbbeeLevels(): array
    {
        $r = [];
        for ($i = 1; $i <= 8; ++$i) {
            $r['Level '.$i] = $i;
        }

        return $r;
    }

    /**
     * @param array<string, string|int> $choices label => stored value
     */
    public static function mergeStoredValue(array $choices, string $stored): array
    {
        if ($stored === '') {
            return $choices;
        }
        $vals = array_values($choices);
        if (in_array($stored, $vals, true)) {
            return $choices;
        }
        $choices[$stored.' (on file)'] = $stored;

        return $choices;
    }
}