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

+26 -1
View File
@@ -1,16 +1,25 @@
<?php
declare(strict_types=1);
namespace App\BusProNet\Model;
use Symfony\Component\Serializer\Attribute\Groups;
/**
* Represents a CRM selection group with included services mapping.
*
* This class handles CRM selection group data including identification,
* labeling, and selections. It provides methods to filter mutable selections
* and determine visibility, along with a static mapping for included services.
*/
class CrmSelectionGroup
{
/**
* Maps BusPro IDs of CRM selection groups representing
* included services.
*
* @var array|string[]
* @var array<string, string>
*/
public static array $includedServicesMapping = [
7 => 'Skipass',
@@ -32,6 +41,14 @@ class CrmSelectionGroup
#[Groups(['api:single'])]
public ?array $selections = null;
/**
* Retrieves only the mutable selections from the group.
*
* Filters the selections array to return only items that are marked
* as mutable for user interface management.
*
* @return array<CrmSelection> The mutable selections array
*/
public function getMutableSelections(): array
{
return array_filter($this->selections, function (CrmSelection $selection) {
@@ -39,6 +56,14 @@ class CrmSelectionGroup
});
}
/**
* Determines if the selection group should be visible.
*
* A group is considered visible if it contains at least one
* mutable selection for user interaction.
*
* @return bool True if the group has mutable selections, false otherwise
*/
#[Groups(['api:single'])]
public function isVisible(): bool
{