25 lines
528 B
PHP
25 lines
528 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Validator\Constraints;
|
|
|
|
use Symfony\Component\Validator\Constraint;
|
|
|
|
/**
|
|
* Validates purchase voucher codes via BPN API.
|
|
*
|
|
* Checks that the voucher exists and has remaining balance.
|
|
* Applied at ParticipantEditDto level to access booking context.
|
|
*/
|
|
#[\Attribute]
|
|
class PurchaseVoucher extends Constraint
|
|
{
|
|
public string $message = 'Gutschein ungültig: {{ error }}';
|
|
|
|
public function getTargets(): array|string
|
|
{
|
|
return static::CLASS_CONSTRAINT;
|
|
}
|
|
}
|