wip: booking process
This commit is contained in:
@@ -1,25 +1,42 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\BusProNet\Model;
|
||||
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
/**
|
||||
* Represents a physical address with street, postal code, city, and country information.
|
||||
*
|
||||
* This class handles address data for users and participants in the booking system.
|
||||
* It provides validation constraints for required fields and methods to convert
|
||||
* address data to API payload format.
|
||||
*/
|
||||
class Address
|
||||
{
|
||||
#[Assert\NotBlank(message: 'Bitte angeben', groups: ['personal_data'])]
|
||||
public ?string $street = '';
|
||||
public string $street = '';
|
||||
|
||||
#[Assert\NotBlank(message: 'Bitte angeben', groups: ['personal_data'])]
|
||||
public ?string $postCode = '';
|
||||
public string $postCode = '';
|
||||
|
||||
#[Assert\NotBlank(message: 'Bitte angeben', groups: ['personal_data'])]
|
||||
public ?string $city = '';
|
||||
public string $city = '';
|
||||
|
||||
public ?string $district = '';
|
||||
public string $district = '';
|
||||
|
||||
#[Assert\NotBlank(message: 'Bitte angeben', groups: ['personal_data'])]
|
||||
public ?string $country = '';
|
||||
public string $country = '';
|
||||
|
||||
/**
|
||||
* Converts the address to API payload format.
|
||||
*
|
||||
* Transforms the address 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 [
|
||||
|
||||
Reference in New Issue
Block a user