<?php

declare(strict_types=1);

namespace KupShop\ReturnsBundle\Page;

use KupShop\ContentBundle\Entity\Placeholder;

class PPLReturnDeliveryPage extends AbstractReturnDeliveryPage
{
    protected static $name = 'Vratka - doprava: PPL';
    protected static $type = 'RETURN_DELIVERY_PPL';

    protected $returnDeliveryClass = 'PPLReturnDelivery';

    public function getUrl(): string
    {
        return path('kupshop_returns_returndeliverypage_returndeliveryinfo', ['returnDeliveryCode' => 'ppl']);
    }

    public function getPlaceholders(): array
    {
        $returnDeliveryLabel = $this->getReturnDeliveryLabel();

        return array_merge([
            new Placeholder('PACKAGE_LABEL', 'ID zásilky', fn () => $returnDeliveryLabel['carrier_id'] ?? '-'),
            new Placeholder('LABEL_URL', 'URL se štítkem', fn () => $returnDeliveryLabel['label_url'] ?? '-'),
        ], parent::getPlaceholders());
    }
}
