Skip to content

Commit

Permalink
Best available call supports accessible seats (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
mroloux authored Sep 4, 2024
1 parent 4877763 commit 0c22490
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
11 changes: 11 additions & 0 deletions src/Events/BestAvailableParams.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ class BestAvailableParams
*/
public $tryToPreventOrphanSeats;

/**
* @var int
*/
public $accessibleSeats;

public function setNumber(int $number): self
{
$this->number = $number;
Expand Down Expand Up @@ -69,4 +74,10 @@ public function setTryToPreventOrphanSeats(bool $tryToPreventOrphanSeats): self
$this->tryToPreventOrphanSeats = $tryToPreventOrphanSeats;
return $this;
}

public function setAccessibleSeats(int $accessibleSeats): self
{
$this->accessibleSeats = $accessibleSeats;
return $this;
}
}
11 changes: 11 additions & 0 deletions tests/Events/ChangeBestAvailableObjectStatusTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,4 +192,15 @@ public function testIgnoreChannels()

self::assertEquals(["A-5"], $bestAvailableObjects->objects);
}

public function accessibleSeats()
{
$chartKey = $this->createTestChart();
$event = $this->seatsioClient->events->create($chartKey);

$bestAvailableObjects = $this->seatsioClient->events->changeBestAvailableObjectStatus($event->key, (new BestAvailableParams())->setNumber(3)->setAccessibleSeats(1), "lolzor");

self::assertTrue($bestAvailableObjects->nextToEachOther);
self::assertEquals(["A-6", "A-7", "A-8"], $bestAvailableObjects->objects);
}
}
2 changes: 1 addition & 1 deletion tests/sampleChart.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
"categoryAccessible": false,
"categoryKey": 9,
"restrictedView": false,
"accessible": false,
"accessible": true,
"companionSeat": false,
"disabledBySocialDistancingRules": false,
"uuid": "uuid294",
Expand Down

0 comments on commit 0c22490

Please sign in to comment.