<?php

declare(strict_types=1);

namespace KupShop\GraphQLBundle\ApiAdmin\Types\Order;

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

#[Type]
class OrderBalikobotData
{
    public function __construct(private readonly array $balikobotData)
    {
    }

    #[Field(description: 'Pozice štítku.')]
    public function getTicketPosition(): ?int
    {
        return isset($this->balikobotData['position']) ? (int) $this->balikobotData['position'] : null;
    }

    #[Field(description: 'Počet balíků')]
    public function getPackagesCount(): ?int
    {
        return (int) $this->balikobotData['packages'];
    }

    #[Field(description: 'Poznámka')]
    public function getNote(): string
    {
        return $this->balikobotData['note'] ?? '';
    }

    #[Field(description: 'Velikost balíku')]
    public function getPackageSize(): string
    {
        return $this->balikobotData['size'] ?? '';
    }
}
