<?php

declare(strict_types=1);

namespace KupShop\GraphQLBundle\ApiShared\Types\Order;

use TheCodingMachine\GraphQLite\Annotations\Field;
use TheCodingMachine\GraphQLite\Annotations\Type;

/**
 * Stav objednávky.
 *
 * @Type()
 */
class OrderStatus
{
    private int $statusId;

    public function __construct(int $statusId)
    {
        $this->statusId = $statusId;
    }

    /**
     * ID.
     *
     * @Field()
     */
    public function getId(): int
    {
        return $this->statusId;
    }

    /**
     * Název.
     *
     * @Field()
     */
    public function getName(): string
    {
        return getOrderStatus($this->statusId)['name'] ?? '';
    }
}
