docs: add inline documentation where missing
This commit is contained in:
@@ -1,9 +1,17 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Validator\Constraints;
|
||||
|
||||
use Symfony\Component\Validator\Constraint;
|
||||
|
||||
/**
|
||||
* Validates participant data for cross-field consistency.
|
||||
*
|
||||
* Applied as a class-level constraint on ParticipantDto to enforce business rules
|
||||
* that depend on multiple fields (e.g., requiring pickup when bus transport is selected).
|
||||
*/
|
||||
#[\Attribute]
|
||||
class Participant extends Constraint
|
||||
{
|
||||
|
||||
@@ -1,11 +1,19 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Validator\Constraints;
|
||||
|
||||
use App\Form\Model\ParticipantDto;
|
||||
use Symfony\Component\Validator\Constraint;
|
||||
use Symfony\Component\Validator\ConstraintValidator;
|
||||
|
||||
/**
|
||||
* Validates cross-field constraints on participant data.
|
||||
*
|
||||
* Enforces business rules that require examining multiple fields together,
|
||||
* such as requiring a pickup location when bus transportation is selected.
|
||||
*/
|
||||
class ParticipantValidator extends ConstraintValidator
|
||||
{
|
||||
public function validate(mixed $value, Constraint $constraint): void
|
||||
|
||||
@@ -11,6 +11,13 @@ use Symfony\Component\Validator\Constraint;
|
||||
use Symfony\Component\Validator\ConstraintValidator;
|
||||
use Symfony\Component\Validator\Exception\UnexpectedTypeException;
|
||||
|
||||
/**
|
||||
* Validates promotional voucher codes against the BPN API.
|
||||
*
|
||||
* Verifies that promo codes are valid for the current travel, checks minimum price
|
||||
* thresholds, and validates code availability. Uses the participant's calculated
|
||||
* total price (including room and all selected services) for threshold comparison.
|
||||
*/
|
||||
class PromoVoucherValidator extends ConstraintValidator
|
||||
{
|
||||
public function __construct(
|
||||
|
||||
@@ -10,6 +10,12 @@ use Symfony\Component\Validator\Constraint;
|
||||
use Symfony\Component\Validator\ConstraintValidator;
|
||||
use Symfony\Component\Validator\Exception\UnexpectedTypeException;
|
||||
|
||||
/**
|
||||
* Validates purchase voucher codes against the BPN API.
|
||||
*
|
||||
* Verifies that voucher codes exist and have remaining balance. Unlike promo
|
||||
* vouchers, purchase vouchers do not require travel or price context validation.
|
||||
*/
|
||||
class PurchaseVoucherValidator extends ConstraintValidator
|
||||
{
|
||||
public function __construct(
|
||||
|
||||
@@ -6,6 +6,13 @@ namespace App\Validator\Constraints;
|
||||
|
||||
use Symfony\Component\Validator\Constraint;
|
||||
|
||||
/**
|
||||
* Validates room selection requirements for bookings.
|
||||
*
|
||||
* Applied as a class-level constraint on BookingDto to ensure valid room
|
||||
* configurations: at least one room must be selected, and baby rooms
|
||||
* cannot be booked without accompanying regular rooms.
|
||||
*/
|
||||
#[\Attribute]
|
||||
class RoomSelection extends Constraint
|
||||
{
|
||||
|
||||
@@ -10,6 +10,12 @@ use Symfony\Component\Validator\Constraint;
|
||||
use Symfony\Component\Validator\ConstraintValidator;
|
||||
use Symfony\Component\Validator\Exception\UnexpectedTypeException;
|
||||
|
||||
/**
|
||||
* Validates room selection business rules for bookings.
|
||||
*
|
||||
* Enforces that at least one room is selected and that baby rooms (BABY code)
|
||||
* are only booked in combination with regular rooms, not standalone.
|
||||
*/
|
||||
class RoomSelectionValidator extends ConstraintValidator
|
||||
{
|
||||
public function validate(mixed $value, Constraint $constraint): void
|
||||
|
||||
Reference in New Issue
Block a user