feat: financial data check for teamers, improved enforced checks logic
addresses #869at5rtp
This commit is contained in:
1 parent
fd5d478a5c
commit
388ecf9603
22 files changed
+1196
-195
No files matched your search
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Model\FinancialDataDto;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class FinancialDataType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('taxId', TextType::class, [
|
||||
'label' => 'Steuer-ID',
|
||||
])
|
||||
->add('iban', TextType::class, [
|
||||
'label' => 'IBAN',
|
||||
])
|
||||
->add('bic', TextType::class, [
|
||||
'label' => 'BIC',
|
||||
])
|
||||
->add('bank', TextType::class, [
|
||||
'label' => 'Name der Bank',
|
||||
])
|
||||
->add('holder', TextType::class, [
|
||||
'label' => 'Kontoinhaber',
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => FinancialDataDto::class,
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Model\PersonalDataConfirmationDto;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class PersonalDataConfirmationType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder->add('confirmed', CheckboxType::class, [
|
||||
'label' => 'Ich bestätige, dass meine Daten korrekt und aktuell sind',
|
||||
]);
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => PersonalDataConfirmationDto::class,
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,6 @@ use App\Model\UploadSessionDto;
|
||||
use App\Service\Upload\UploadHandler;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\BirthdayType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\CollectionType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
@@ -15,7 +14,6 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
use Symfony\Component\Form\FormView;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Validator\Constraints\IsTrue;
|
||||
|
||||
class TeamerProfileType extends AbstractType
|
||||
{
|
||||
@@ -96,19 +94,6 @@ class TeamerProfileType extends AbstractType
|
||||
],
|
||||
])
|
||||
;
|
||||
|
||||
if (true === $options['verification_mode']) {
|
||||
$builder->add('confirmDataVerification', CheckboxType::class, [
|
||||
'label' => 'Ich bestätige, dass meine Daten korrekt und aktuell sind',
|
||||
'mapped' => false,
|
||||
'constraints' => [
|
||||
new IsTrue([
|
||||
'message' => 'Deine Bestätigung ist erforderlich',
|
||||
'groups' => ['profile'],
|
||||
]),
|
||||
],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function buildView(FormView $view, FormInterface $form, array $options): void
|
||||
@@ -128,11 +113,9 @@ class TeamerProfileType extends AbstractType
|
||||
'validation_groups' => [
|
||||
'profile',
|
||||
],
|
||||
'verification_mode' => false,
|
||||
])
|
||||
->setRequired(['upload_session'])
|
||||
->setAllowedTypes('upload_session', UploadSessionDto::class)
|
||||
->setAllowedTypes('verification_mode', 'bool')
|
||||
;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user