<?php

namespace App\Services;

use App\CarType;
use App\Configuration;
use App\Traits\ServiceAppAop;
use Illuminate\Support\Facades\Cache;


class ConfigurationService
{
    use ServiceAppAop;
    protected $modelClass=Configuration::class;
    private $procurement_configuration_cache_key='procurement_configuration_cache_key_';
    public function getEnquiryTime()
    {
        return Cache::remember($this->procurement_configuration_cache_key.'enquiry_time',null,function (){
            return Configuration::query()->where('name','enquiry_time')->value('value');
        });
    }

    public function getReceiveTime()
    {
        return Cache::remember($this->procurement_configuration_cache_key.'receive_time',null,function (){
            return Configuration::query()->where('name','receive_time')->value('value');
        });
    }
    public function getPriceCoefficient()
    {
        return Cache::remember($this->procurement_configuration_cache_key.'price_coefficient',null,function (){
            return Configuration::query()->where('name','price_coefficient')->value('value');
        });
    }


}
