<?php

declare(strict_types=1);

namespace KupShop\OrderingBundle\Feed\Wrapper;

use KupShop\FeedsBundle\Wrapper\BaseWrapper;

class OrderDeliveryTypeWrapper extends BaseWrapper
{
    /** @var \Delivery */
    protected $object;

    protected static $objectType = \Delivery::class;

    /** Název dopravy */
    public function field_name(): string
    {
        return $this->object->name ?? '';
    }

    /** Dopravce */
    public function field_method(): string
    {
        return $this->object->class ?? '';
    }

    /** Heureka ID */
    public function field_heureka_id(): string
    {
        return $this->object->getHeurekaDeliveryID() ?? '';
    }

    /** Typ dopravy.
     *
     * Možné hodnoty: <code>ADDRESS</code>, <code>IN_PERSON</code>, <code>POINT</code>, <code>VIRTUAL</code>, <code>UNKNOWN</code>
     */
    public function field_type(): string
    {
        $types = [
            1 => 'ADDRESS',
            2 => 'IN_PERSON',
            3 => 'POINT',
            4 => 'VIRTUAL',
        ];

        return $types[$this->object->getType()] ?? 'UNKNOWN';
    }
}
