<?php

namespace App\Form;

use App\Entity\Ticket;
use App\Enum\FoodData;
use App\Enum\TicketData;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class TicketType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        $builder
            ->add('type', ChoiceType::class, [
                'label' => 'Ticket Type',
                'choices' => TicketData::TYPES,
                'row_attr' => [
                    'style' => 'flex: 1;',
                ],
            ])
            ->add('foodType', ChoiceType::class, [
                'label' => 'Ernährung',
                'choices' => FoodData::TYPES,
                'row_attr' => [
                    'style' => 'flex: 1;',
                ],
            ])
            ->add('note', TextType::class, [
                'label' => 'Notiz',
                'required' => false,
                'row_attr' => [
                    'style' => 'flex: 2;',
                ],
            ]);
    }

    public function configureOptions(OptionsResolver $resolver): void
    {
        $resolver->setDefaults([
            'data_class' => Ticket::class,
        ]);
    }
} 