<?php

declare(strict_types=1);

namespace KupShop\GraphQLBundle\ApiAdmin\Types\Changes\Product;

use KupShop\GraphQLBundle\ApiAdmin\Types\Changes\ChangeInterface;
use KupShop\GraphQLBundle\ApiAdmin\Types\Changes\ChangeMetadata;
use TheCodingMachine\GraphQLite\Annotations\Field;
use TheCodingMachine\GraphQLite\Annotations\Type;

#[Type]
class ProductChange implements ChangeInterface
{
    public function __construct(
        public ChangeMetadata $metadata,
        #[Field(description: 'ID produktu.')]
        public int $productId,
        /** @var string[] $changedFields */
        #[Field(description: 'Seznam polí produktu, která byla v rámci této změny upravena.')]
        public array $changedFields = [],
    ) {
    }

    public function getMetadata(): ChangeMetadata
    {
        return $this->metadata;
    }
}
