<?php

declare(strict_types=1);

namespace External\PompoBundle\Overrides\GraphQL\Types\User;

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

/**
 * @Type()
 */
class PompoUserCard
{
    private array $card;

    public function __construct(array $card)
    {
        $this->card = $card;
    }

    /**
     * Kód karty.
     *
     * @Field()
     */
    public function getCode(): string
    {
        return $this->card['code'];
    }

    /**
     * Vrací, zda je karta aktivní.
     *
     * @Field()
     */
    public function getActive(): bool
    {
        return $this->card['active'] == 1;
    }
}
