<?php

namespace App\Data\Pagarme\Order\Parts\Request;

use App\Data\Pagarme\PagarmeData;

final readonly class PixAdditionalInformationData extends PagarmeData
{
    public function __construct(
        public string $name,
        public string $value,
    ) {
        self::requireFilled($this->name, 'additional_information.name');
        self::requireFilled($this->value, 'additional_information.value');
    }

    public function toArray(): array
    {
        return $this->filterFilledRecursive([
            'name'  => $this->name,
            'value' => $this->value,
        ]);
    }
}
