wip: booking process
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
namespace App\Form\Model;
|
||||
|
||||
use App\BusProNet\Model\PersonalData;
|
||||
use App\BusProNet\Model\Pickup;
|
||||
use App\BusProNet\Model\Service;
|
||||
use App\Validator\Constraints as AppAssert;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
#[AppAssert\Participant]
|
||||
class ParticipantDto
|
||||
{
|
||||
public ?int $index = null;
|
||||
public ?int $addressId = null;
|
||||
public ?int $personId = null;
|
||||
public ?string $status = null;
|
||||
public bool $mutable = false;
|
||||
|
||||
#[Assert\NotBlank(message: 'Bitte angeben')]
|
||||
public ?string $firstName = null;
|
||||
|
||||
#[Assert\NotBlank(message: 'Bitte angeben')]
|
||||
public ?string $lastName = null;
|
||||
public ?string $title = null;
|
||||
public ?string $gender = null;
|
||||
public ?string $nationality = null;
|
||||
public ?string $height = null;
|
||||
public ?string $shoeSize = null;
|
||||
public ?string $weight = null;
|
||||
|
||||
#[Assert\NotNull(message: 'Bitte angeben')]
|
||||
public ?\DateTimeImmutable $dateOfBirth = null;
|
||||
|
||||
#[Assert\NotBlank(message: 'Bitte angeben')]
|
||||
#[Assert\Email(message: 'Bitte eine gültige E-Mail Adresse angeben', mode: 'strict')]
|
||||
public ?string $email = null;
|
||||
|
||||
public ?string $mobile = null;
|
||||
public array $courses = [];
|
||||
public array $additionalServices = [];
|
||||
public array $skiPass = [];
|
||||
public array $board = [];
|
||||
public array $rentals = [];
|
||||
public ?Service $transportationServiceTo = null;
|
||||
public ?Service $transportationServiceFro = null;
|
||||
public ?Pickup $pickup = null;
|
||||
|
||||
public static function fromPersonalData(PersonalData $personalData): static
|
||||
{
|
||||
$instance = new static();
|
||||
|
||||
$instance->status = $personalData->status;
|
||||
$instance->addressId = $personalData->addressId;
|
||||
$instance->personId = $personalData->personId;
|
||||
$instance->mutable = $personalData->mutable;
|
||||
$instance->firstName = $personalData->firstName;
|
||||
$instance->lastName = $personalData->name;
|
||||
$instance->gender = $personalData->gender;
|
||||
$instance->nationality = $personalData->nationality;
|
||||
$instance->email = $personalData->communication?->email;
|
||||
$instance->mobile = $personalData->communication?->mobile;
|
||||
$instance->dateOfBirth = $personalData->dateOfBirth;
|
||||
$instance->height = $personalData->height;
|
||||
$instance->weight = $personalData->weight;
|
||||
$instance->shoeSize = $personalData->shoeSize;
|
||||
|
||||
return $instance;
|
||||
}
|
||||
|
||||
public function isCanceled(): bool
|
||||
{
|
||||
return 'S' === $this->status;
|
||||
}
|
||||
|
||||
public function isOption(): bool
|
||||
{
|
||||
return 'O' === $this->status;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user