From a508c7861e53de23a10f1898f5912e84bf37d72d Mon Sep 17 00:00:00 2001 From: mroloux Date: Wed, 24 Apr 2024 13:22:39 +0200 Subject: [PATCH] Exposed season status overridden quantity (#111) --- src/Events/EventObjectInfo.php | 4 ++++ tests/Reports/Events/EventReportsTest.php | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/Events/EventObjectInfo.php b/src/Events/EventObjectInfo.php index 8a51133..c610084 100644 --- a/src/Events/EventObjectInfo.php +++ b/src/Events/EventObjectInfo.php @@ -143,4 +143,8 @@ class EventObjectInfo * @var int */ public $maxOccupancy; + /** + * @var int + */ + public $seasonStatusOverriddenQuantity; } diff --git a/tests/Reports/Events/EventReportsTest.php b/tests/Reports/Events/EventReportsTest.php index d2f255b..cfbb563 100644 --- a/tests/Reports/Events/EventReportsTest.php +++ b/tests/Reports/Events/EventReportsTest.php @@ -8,6 +8,7 @@ use Seatsio\Events\EventObjectInfo; use Seatsio\Events\ObjectProperties; use Seatsio\Events\TableBookingConfig; +use Seatsio\Seasons\SeasonCreationParams; use Seatsio\SeatsioClientTest; class EventReportsTest extends SeatsioClientTest @@ -48,6 +49,7 @@ public function testReportItemProperties() self::assertEquals("A-2", $reportItem->rightNeighbour); self::assertEquals("channel1", $reportItem->channel); self::assertNotNull($reportItem->distanceToFocalPoint); + self::assertEquals(0, $reportItem->seasonStatusOverriddenQuantity); $gaItem = $report["GA1"][0]; self::assertFalse($gaItem->variableOccupancy); @@ -68,6 +70,19 @@ public function testHoldToken() self::assertEquals("$holdToken->holdToken", $reportItem->holdToken); } + public function testSeasonStatusOverriddenQuantity() + { + $chartKey = $this->createTestChart(); + $season = $this->seatsioClient->seasons->create($chartKey, (new SeasonCreationParams())->setNumberOfEvents(1)); + $event = $season->events[0]; + $this->seatsioClient->events->overrideSeasonStatus($event->key, ["A-1"]); + + $report = $this->seatsioClient->eventReports->byLabel($event->key); + + $reportItem = $report["A-1"][0]; + self::assertEquals(1, $reportItem->seasonStatusOverriddenQuantity); + } + public function testReportItemPropertiesForGA() { $chartKey = $this->createTestChart();