<?php

namespace App\Modules\Valuation\Config;

use App\Facades\Settings;

class EVAConfig extends \Mtc\VehicleValuation\Config\EVAConfig
{
    #[\Override]
    public function enabled(): bool
    {
        return Settings::get('valuation-eva-enabled') ?? false;
    }

    #[\Override]
    public function isLiveEnvironment(): bool
    {
        return Settings::get('valuation-eva-use-live') ?? false;
    }

    #[\Override]
    public function questionSetId(): ?int
    {
        return Settings::get('valuation-eva-question-set-id');
    }

    #[\Override]
    public function categoryCode(): ?string
    {
        return Settings::get('valuation-eva-question-category-code');
    }

    #[\Override]
    public function conditionValue(): ?string
    {
        return Settings::get('valuation-eva-question-overall-condition');
    }

    #[\Override]
    public function lcvUsageValue(): ?string
    {
        return Settings::get('valuation-eva-question-lcv-usage');
    }

    #[\Override]
    protected function getAuthValue(): string
    {
        return base64_encode(
            Settings::get('valuation-eva-client-id') . ':' . Settings::get('valuation-eva-client-secret')
        );
    }
}
