<?php

namespace KupShop\ReturnsBundle\Page;

use KupShop\ContentBundle\Entity\Placeholder;

class OwnReturnDeliveryPage extends AbstractReturnDeliveryPage
{
    protected static $name = 'Vratka - doprava: vlastní';
    protected static $type = 'RETURN_DELIVERY_OWN';
    protected $returnDeliveryClass = 'OwnReturnDelivery';

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

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

        return array_merge([
            new Placeholder('PACKAGE_LABEL', 'ID zásilky', fn () => $returnDeliveryLabel['package_label'] ?? '-'),
            new Placeholder('AUTH_KOD_ODVOZU', 'Kód odvozu', fn () => $this->getCustomData()['auth_code'] ?? ''),
        ], parent::getPlaceholders());
    }
}
