<?php

declare(strict_types=1);

namespace PortalPeople\delivery\dto;

/**
 * Provider-neutral result returned after a consignment label is created.
 */
class ConsignmentResult
{
    public function __construct(
        public string $trackingInfo,
        public ?string $trackingNumbers = null,
        public ?string $filepath = null,
        public ?string $data = null
    ) {
    }

    /**
     * Preserve the existing event result shape used by carrier modules.
     *
     * @return array<string, string|null>
     */
    public function toArray(): array
    {
        return [
            'trackingInfo' => $this->trackingInfo,
            'trackingNumbers' => $this->trackingNumbers,
            'filepath' => $this->filepath,
            'data' => $this->data,
        ];
    }
}
