<?php

declare(strict_types=1);

namespace CpCreation\VitiCore\Bridge\Symfony\Bundle\Form\Admin\Payment;

use Symfony\Component\Form\Extension\Core\Type\NumberType;
use Symfony\Component\Form\FormBuilderInterface;

final class EstimatedTransactionFeeFields
{
    public static function add(FormBuilderInterface $builder): void
    {
        $builder
            ->add('estimatedTransactionFeePercent', NumberType::class, [
                'label' => 'Taux estime des frais de transaction (%)',
                'required' => false,
                'scale' => 4,
                'html5' => true,
                'attr' => [
                    'step' => '0.0001',
                    'min' => '0',
                ],
                'help' => 'Exemple : 1.4 pour 1,4 % du montant TTC.',
            ])
            ->add('estimatedTransactionFeeFixed', NumberType::class, [
                'label' => 'Frais fixes estimes (EUR)',
                'required' => false,
                'scale' => 2,
                'html5' => true,
                'attr' => [
                    'step' => '0.01',
                    'min' => '0',
                ],
                'help' => 'Exemple : 0.25 pour 0,25 EUR par transaction.',
            ]);
    }

    private function __construct()
    {
    }
}
