wip: booking process

This commit is contained in:
Björn Fromme committed 2025-07-14 17:15:15 +02:00
1 parent a55e30e12d
commit bef18971c3
45 files changed
+688 -270

No files matched your search

+20 -3
View File
@@ -1,22 +1,39 @@
<?php
declare(strict_types=1);
namespace App\BusProNet\Model;
use Symfony\Component\Validator\Constraints as Assert;
/**
* Represents communication information including email, phone, and newsletter preferences.
*
* This class handles contact information for users and participants in the booking system.
* It provides validation constraints for required fields and methods to convert
* communication data to API payload format.
*/
class Communication
{
public ?string $phone = '';
public string $phone = '';
#[Assert\NotBlank(message: 'Bitte angeben', groups: ['personal_data'])]
public ?string $mobile = '';
public string $mobile = '';
#[Assert\NotBlank(message: 'Bitte angeben', groups: ['personal_data'])]
#[Assert\Email(message: 'Bitte eine gültige Adresse angeben', mode: 'strict', groups: ['personal_data'])]
public ?string $email = '';
public string $email = '';
public bool $newsletter = false;
/**
* Converts the communication data to API payload format.
*
* Transforms the communication object into an array structure suitable
* for API communication with the BusProNet system.
*
* @return array<string, string> The payload array for API transmission
*/
public function toPayload(): array
{
return [