<?php

declare(strict_types=1);

namespace KupShop\GraphQLBundle\ApiShared\Types\Product;

use KupShop\KupShopBundle\Config;
use TheCodingMachine\GraphQLite\Annotations\Field;
use TheCodingMachine\GraphQLite\Annotations\Type;

#[Type]
class DeliveryTime
{
    public function __construct(
        public int $id,
    ) {
    }

    #[Field(description: 'ID.')]
    public function getId(): int
    {
        return $this->id;
    }

    #[Field(description: 'Název.')]
    public function getName(): string
    {
        $cfg = Config::get();

        return $cfg['Products']['DeliveryTime'][$this->id] ?? '';
    }
}
