<?php

declare(strict_types=1);

namespace Gls\GlsPoland\Form\Type;

use Gls\GlsPoland\Carrier\ParcelShopType;
use Gls\GlsPoland\Translation\TranslatorAwareTrait;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\OptionsResolver\OptionsResolver;

final class ParcelShopTypeChoiceType extends AbstractType
{
    use TranslatorAwareTrait;

    public function getParent(): string
    {
        return ChoiceType::class;
    }

    public function configureOptions(OptionsResolver $resolver): void
    {
        $resolver
            ->setDefaults([
                'choices' => [
                    $this->getTranslator()->trans('All GLS locations', [], 'Modules.Glspoland.Carrier') => '',
                    $this->getTranslator()->trans('Parcel lockers', [], 'Modules.Glspoland.Carrier') => ParcelShopType::APM,
                    $this->getTranslator()->trans('Pickup and drop-off points', [], 'Modules.Glspoland.Carrier') => ParcelShopType::PUDO,
                ],
            ]);
    }
}
