<?php

declare(strict_types=1);

namespace KupShop\GraphQLBundle\ApiShared\Types\Order;

use KupShop\OrderingBundle\Util\Order\OrderInfo;
use TheCodingMachine\GraphQLite\Annotations\Field;
use TheCodingMachine\GraphQLite\Annotations\Type;

#[Type]
class OrderSource
{
    public function __construct(private string $source)
    {
    }

    #[Field(description: 'Zdroj objednávky.')]
    public function getSource(): string
    {
        return $this->source;
    }

    #[Field(description: 'Název zdroje objednávky.')]
    public function getName(): string
    {
        return OrderInfo::getOrderSources()[$this->source];
    }
}
