<?php

namespace App\Modules\Valuation;

class ConditionPriceTier
{
    public const TIER_CLEAN = 'clean_price';
    public const TIER_AVERAGE = 'average_price';
    public const TIER_BELOW = 'below_price';

    public static function fromCondition(?string $condition): ?string
    {
        if (empty($condition)) {
            return null;
        }

        return match (strtolower($condition)) {
            'excellent', 'good' => self::TIER_CLEAN,
            'average' => self::TIER_AVERAGE,
            'below_average', 'poor' => self::TIER_BELOW,
            default => null,
        };
    }
}
