From 1fe8c11aa94be93e6f3e49fb6189d5bd7d50de8d Mon Sep 17 00:00:00 2001 From: mroloux Date: Mon, 10 Jul 2023 12:42:28 +0200 Subject: [PATCH] Removed social distancing (#88) --- src/Charts/Chart.php | 5 - src/Charts/Charts.php | 7 - src/Charts/SocialDistancingRuleset.php | 283 ------------------ src/Events/Event.php | 5 - src/Events/EventObjectInfo.php | 4 - src/Events/EventParams.php | 11 - src/Events/Events.php | 24 +- src/Seasons/SeasonCreationParams.php | 12 - src/Seasons/Seasons.php | 4 - .../SaveSocialDistancingRulesetsTest.php | 39 --- tests/Events/BookObjectsTest.php | 15 - tests/Events/ChangeObjectStatusTest.php | 20 +- tests/Events/CreateEventTest.php | 11 - tests/Events/CreateEventsTest.php | 17 -- tests/Events/HoldObjectsTest.php | 15 - tests/Events/UpdateEventTest.php | 30 -- tests/Reports/EventReportsTest.php | 1 - tests/Seasons/CreateSeasonTest.php | 12 - 18 files changed, 7 insertions(+), 508 deletions(-) delete mode 100644 src/Charts/SocialDistancingRuleset.php delete mode 100644 tests/Charts/SaveSocialDistancingRulesetsTest.php diff --git a/src/Charts/Chart.php b/src/Charts/Chart.php index 6a07ca5..25c85de 100644 --- a/src/Charts/Chart.php +++ b/src/Charts/Chart.php @@ -45,9 +45,4 @@ class Chart * @var array */ public $validation; - - /** - * @var SocialDistancingRuleset[] - */ - public $socialDistancingRulesets; } diff --git a/src/Charts/Charts.php b/src/Charts/Charts.php index 9deba4a..84fa247 100644 --- a/src/Charts/Charts.php +++ b/src/Charts/Charts.php @@ -212,13 +212,6 @@ public function removeTag(string $key, string $tag): void $this->client->delete(UriTemplate::expand('/charts/{key}/tags/{tag}', array("key" => $key, "tag" => $tag))); } - public function saveSocialDistancingRulesets(string $key, array $rulesets) - { - $request = new stdClass(); - $request->socialDistancingRulesets = $rulesets; - $this->client->post(UriTemplate::expand('/charts/{key}/social-distancing-rulesets', array("key" => $key)), ['json' => $request]); - } - public function listAll(ChartListParams $chartListParams = null): ChartPagedIterator { return $this->iterator()->all($this->listParamsToArray($chartListParams)); diff --git a/src/Charts/SocialDistancingRuleset.php b/src/Charts/SocialDistancingRuleset.php deleted file mode 100644 index 141f453..0000000 --- a/src/Charts/SocialDistancingRuleset.php +++ /dev/null @@ -1,283 +0,0 @@ -name = $name; - } - - public function build(): SocialDistancingRuleset - { - $ruleset = new SocialDistancingRuleset(); - $ruleset->index = $this->index; - $ruleset->name = $this->name; - $ruleset->fixedGroupLayout = true; - $ruleset->disabledSeats = $this->disabledSeats; - return $ruleset; - } - - public function setIndex($index): self - { - $this->index = $index; - return $this; - } - - public function setDisabledSeats($disabledSeats): self - { - $this->disabledSeats = $disabledSeats; - return $this; - } - -} - - -class RuleBasedSocialDistancingRulesetBuilder -{ - - /** - * @var int - */ - public $index = 0; - - /** - * @var string - */ - public $name; - - /** - * @var int - */ - public $numberOfDisabledSeatsToTheSides = 0; - - /** - * @var boolean - */ - public $disableSeatsInFrontAndBehind = false; - - /** - * @var boolean - */ - public $disableDiagonalSeatsInFrontAndBehind = false; - - /** - * @var int - */ - public $numberOfDisabledAisleSeats = 0; - - /** - * @var int - */ - public $maxGroupSize = 0; - - /** - * @var int - */ - public $maxOccupancyAbsolute = 0; - - /** - * @var int - */ - public $maxOccupancyPercentage = 0; - - /** - * @var boolean - */ - public $oneGroupPerTable = false; - - /** - * @var string[] - */ - public $disabledSeats = []; - - /** - * @var string[] - */ - public $enabledSeats = []; - - public function __construct($name) - { - $this->name = $name; - } - - public function build(): SocialDistancingRuleset - { - $ruleset = new SocialDistancingRuleset(); - $ruleset->index = $this->index; - $ruleset->name = $this->name; - $ruleset->numberOfDisabledSeatsToTheSides = $this->numberOfDisabledSeatsToTheSides; - $ruleset->disableSeatsInFrontAndBehind = $this->disableSeatsInFrontAndBehind; - $ruleset->disableDiagonalSeatsInFrontAndBehind = $this->disableDiagonalSeatsInFrontAndBehind; - $ruleset->numberOfDisabledAisleSeats = $this->numberOfDisabledAisleSeats; - $ruleset->maxGroupSize = $this->maxGroupSize; - $ruleset->maxOccupancyAbsolute = $this->maxOccupancyAbsolute; - $ruleset->maxOccupancyPercentage = $this->maxOccupancyPercentage; - $ruleset->oneGroupPerTable = $this->oneGroupPerTable; - $ruleset->fixedGroupLayout = false; - $ruleset->disabledSeats = $this->disabledSeats; - $ruleset->enabledSeats = $this->enabledSeats; - return $ruleset; - } - - public function setIndex(int $index): self - { - $this->index = $index; - return $this; - } - - public function setNumberOfDisabledSeatsToTheSides(int $numberOfDisabledSeatsToTheSides): self - { - $this->numberOfDisabledSeatsToTheSides = $numberOfDisabledSeatsToTheSides; - return $this; - } - - public function setDisableSeatsInFrontAndBehind(bool $disableSeatsInFrontAndBehind): self - { - $this->disableSeatsInFrontAndBehind = $disableSeatsInFrontAndBehind; - return $this; - } - - public function setDisableDiagonalSeatsInFrontAndBehind(bool $disableDiagonalSeatsInFrontAndBehind): self - { - $this->disableDiagonalSeatsInFrontAndBehind = $disableDiagonalSeatsInFrontAndBehind; - return $this; - } - - public function setNumberOfDisabledAisleSeats(int $numberOfDisabledAisleSeats): self - { - $this->numberOfDisabledAisleSeats = $numberOfDisabledAisleSeats; - return $this; - } - - public function setMaxGroupSize(int $maxGroupSize): self - { - $this->maxGroupSize = $maxGroupSize; - return $this; - } - - public function setMaxOccupancyAbsolute(int $maxOccupancyAbsolute): self - { - $this->maxOccupancyAbsolute = $maxOccupancyAbsolute; - return $this; - } - - public function setMaxOccupancyPercentage(int $maxOccupancyPercentage): self - { - $this->maxOccupancyPercentage = $maxOccupancyPercentage; - return $this; - } - - public function setOneGroupPerTable(bool $oneGroupPerTable): self - { - $this->oneGroupPerTable = $oneGroupPerTable; - return $this; - } - - public function setDisabledSeats(array $disabledSeats): self - { - $this->disabledSeats = $disabledSeats; - return $this; - } - - public function setEnabledSeats(array $enabledSeats): self - { - $this->enabledSeats = $enabledSeats; - return $this; - } -} diff --git a/src/Events/Event.php b/src/Events/Event.php index af634e7..9c35eb5 100644 --- a/src/Events/Event.php +++ b/src/Events/Event.php @@ -61,11 +61,6 @@ class Event */ public $channels; - /** - * @var string - */ - public $socialDistancingRulesetKey; - /** * @var string */ diff --git a/src/Events/EventObjectInfo.php b/src/Events/EventObjectInfo.php index 40682aa..5f6d8b6 100644 --- a/src/Events/EventObjectInfo.php +++ b/src/Events/EventObjectInfo.php @@ -115,10 +115,6 @@ class EventObjectInfo * @var string */ public $availabilityReason; - /** - * @var boolean - */ - public $isDisabledBySocialDistancing; /** * @var string */ diff --git a/src/Events/EventParams.php b/src/Events/EventParams.php index c9bc5ba..b09d1f8 100644 --- a/src/Events/EventParams.php +++ b/src/Events/EventParams.php @@ -26,11 +26,6 @@ abstract class EventParams */ public $tableBookingConfig; - /** - * @var string - */ - public $socialDistancingRulesetKey; - /** * @var array */ @@ -76,10 +71,4 @@ public function setCategories($categories): self $this->categories = $categories; return $this; } - - public function setSocialDistancingRulesetKey(string $socialDistancingRulesetKey): self - { - $this->socialDistancingRulesetKey = $socialDistancingRulesetKey; - return $this; - } } diff --git a/src/Events/Events.php b/src/Events/Events.php index 1ad7b89..4c8f9cb 100644 --- a/src/Events/Events.php +++ b/src/Events/Events.php @@ -54,10 +54,6 @@ public function create(string $chartKey, CreateEventParams $params = null): Even $request->tableBookingConfig = $this->serializeTableBookingConfig($params->tableBookingConfig); } - if ($params->socialDistancingRulesetKey !== null) { - $request->socialDistancingRulesetKey = $params->socialDistancingRulesetKey; - } - if ($params->objectCategories !== null) { $request->objectCategories = $params->objectCategories; } @@ -100,9 +96,6 @@ public function createMultiple(string $chartKey, array $createEventParams): arra $eventToCreate->tableBookingConfig = $param->tableBookingConfig; } - if ($param->socialDistancingRulesetKey !== null) { - $eventToCreate->socialDistancingRulesetKey = $param->socialDistancingRulesetKey; - } if ($param->objectCategories !== null) { $eventToCreate->objectCategories = $param->objectCategories; } @@ -148,10 +141,6 @@ public function update(string $eventKey, UpdateEventParams $params): void $request->tableBookingConfig = $this->serializeTableBookingConfig($params->tableBookingConfig); } - if ($params->socialDistancingRulesetKey !== null) { - $request->socialDistancingRulesetKey = $params->socialDistancingRulesetKey; - } - if ($params->objectCategories !== null) { $request->objectCategories = $params->objectCategories; } @@ -322,7 +311,7 @@ public function retrieveObjectInfos(string $eventKey, array $objectLabels): arra * @return ChangeObjectStatusResult */ public function changeObjectStatus($eventKeyOrKeys, $objectOrObjects, string $status, string $holdToken = null, string $orderId = null, - bool $keepExtraData = null, bool $ignoreChannels = null, array $channelKeys = null, bool $ignoreSocialDistancing = null, + bool $keepExtraData = null, bool $ignoreChannels = null, array $channelKeys = null, array $allowedPreviousStatuses = null, array $rejectedPreviousStatuses = null): ChangeObjectStatusResult { $request = new stdClass(); @@ -343,9 +332,6 @@ public function changeObjectStatus($eventKeyOrKeys, $objectOrObjects, string $st if ($channelKeys !== null) { $request->channelKeys = $channelKeys; } - if ($ignoreSocialDistancing !== null) { - $request->ignoreSocialDistancing = $ignoreSocialDistancing; - } if ($allowedPreviousStatuses !== null) { $request->allowedPreviousStatuses = $allowedPreviousStatuses; } @@ -426,9 +412,9 @@ private function serializeTableBookingConfig($tableBookingConfig) * @param $objectOrObjects mixed * @param $channelKeys string[]|null */ - public function book($eventKeyOrKeys, $objectOrObjects, string $holdToken = null, string $orderId = null, bool $keepExtraData = null, bool $ignoreChannels = null, array $channelKeys = null, bool $ignoreSocialDistancing = null): ChangeObjectStatusResult + public function book($eventKeyOrKeys, $objectOrObjects, string $holdToken = null, string $orderId = null, bool $keepExtraData = null, bool $ignoreChannels = null, array $channelKeys = null): ChangeObjectStatusResult { - return $this::changeObjectStatus($eventKeyOrKeys, $objectOrObjects, EventObjectInfo::$BOOKED, $holdToken, $orderId, $keepExtraData, $ignoreChannels, $channelKeys, $ignoreSocialDistancing); + return $this::changeObjectStatus($eventKeyOrKeys, $objectOrObjects, EventObjectInfo::$BOOKED, $holdToken, $orderId, $keepExtraData, $ignoreChannels, $channelKeys); } /** @@ -456,9 +442,9 @@ public function release($eventKeyOrKeys, $objectOrObjects, string $holdToken = n * @param $objectOrObjects mixed * @param $channelKeys string[]|null */ - public function hold($eventKeyOrKeys, $objectOrObjects, string $holdToken, string $orderId = null, bool $keepExtraData = null, bool $ignoreChannels = null, array $channelKeys = null, bool $ignoreSocialDistancing = null): ChangeObjectStatusResult + public function hold($eventKeyOrKeys, $objectOrObjects, string $holdToken, string $orderId = null, bool $keepExtraData = null, bool $ignoreChannels = null, array $channelKeys = null): ChangeObjectStatusResult { - return $this::changeObjectStatus($eventKeyOrKeys, $objectOrObjects, EventObjectInfo::$HELD, $holdToken, $orderId, $keepExtraData, $ignoreChannels, $channelKeys, $ignoreSocialDistancing); + return $this::changeObjectStatus($eventKeyOrKeys, $objectOrObjects, EventObjectInfo::$HELD, $holdToken, $orderId, $keepExtraData, $ignoreChannels, $channelKeys); } /** diff --git a/src/Seasons/SeasonCreationParams.php b/src/Seasons/SeasonCreationParams.php index 283a680..d5ced45 100644 --- a/src/Seasons/SeasonCreationParams.php +++ b/src/Seasons/SeasonCreationParams.php @@ -27,11 +27,6 @@ class SeasonCreationParams */ public $tableBookingConfig; - /** - * @var string - */ - public $socialDistancingRulesetKey; - public function __construct(string $key = null) { $this->key = $key; @@ -59,11 +54,4 @@ public function setTableBookingConfig(TableBookingConfig $tableBookingConfig): s $this->tableBookingConfig = $tableBookingConfig; return $this; } - - public function setSocialDistancingRulesetKey(string $socialDistancingRulesetKey): self - { - $this->socialDistancingRulesetKey = $socialDistancingRulesetKey; - return $this; - } - } diff --git a/src/Seasons/Seasons.php b/src/Seasons/Seasons.php index 5f15e17..af72b59 100644 --- a/src/Seasons/Seasons.php +++ b/src/Seasons/Seasons.php @@ -46,10 +46,6 @@ public function create(string $chartKey, SeasonCreationParams $seasonCreationPar if ($seasonCreationParams->tableBookingConfig !== null) { $request->tableBookingConfig = $this->serializeTableBookingConfig($seasonCreationParams->tableBookingConfig); } - - if ($seasonCreationParams->socialDistancingRulesetKey !== null) { - $request->socialDistancingRulesetKey = $seasonCreationParams->socialDistancingRulesetKey; - } } $res = $this->client->post('/seasons', ['json' => $request]); diff --git a/tests/Charts/SaveSocialDistancingRulesetsTest.php b/tests/Charts/SaveSocialDistancingRulesetsTest.php deleted file mode 100644 index c3521a9..0000000 --- a/tests/Charts/SaveSocialDistancingRulesetsTest.php +++ /dev/null @@ -1,39 +0,0 @@ -seatsioClient->charts->create(); - - $ruleset1 = SocialDistancingRuleset::ruleBased("My first ruleset") - ->setIndex(0) - ->setNumberOfDisabledSeatsToTheSides(1) - ->setDisableSeatsInFrontAndBehind(true) - ->setDisableDiagonalSeatsInFrontAndBehind(true) - ->setNumberOfDisabledAisleSeats(2) - ->setMaxGroupSize(1) - ->setMaxOccupancyAbsolute(10) - ->setOneGroupPerTable(true) - ->setDisabledSeats(["A-1"]) - ->setEnabledSeats(["A-2"]) - ->build(); - - $ruleset2 = SocialDistancingRuleset::fixed("My second ruleset") - ->setIndex(1) - ->setDisabledSeats(["A-1"]) - ->build(); - - $rulesets = ["ruleset1" => $ruleset1, "ruleset2" => $ruleset2]; - $this->seatsioClient->charts->saveSocialDistancingRulesets($chart->key, $rulesets); - - $retrievedChart = $this->seatsioClient->charts->retrieve($chart->key); - self::assertEquals($rulesets, $retrievedChart->socialDistancingRulesets); - } - -} diff --git a/tests/Events/BookObjectsTest.php b/tests/Events/BookObjectsTest.php index d2ef921..c14d34b 100644 --- a/tests/Events/BookObjectsTest.php +++ b/tests/Events/BookObjectsTest.php @@ -2,7 +2,6 @@ namespace Seatsio\Events; -use Seatsio\Charts\SocialDistancingRuleset; use Seatsio\Common\IDs; use Seatsio\SeatsioClientTest; @@ -104,18 +103,4 @@ public function testIgnoreChannels() $objectInfo = $this->seatsioClient->events->retrieveObjectInfo($event->key, "A-1"); self::assertEquals(EventObjectInfo::$BOOKED, $objectInfo->status); } - - public function testIgnoreSocialDistancing() - { - $chartKey = $this->createTestChart(); - $ruleset = SocialDistancingRuleset::fixed("ruleset")->setDisabledSeats(["A-1"])->build(); - $this->seatsioClient->charts->saveSocialDistancingRulesets($chartKey, ["ruleset" => $ruleset]); - $event = $this->seatsioClient->events->create($chartKey, CreateEventParams::create()->setSocialDistancingRulesetKey("ruleset")); - - $this->seatsioClient->events->book($event->key, "A-1", null, null, null, null, null, true); - - $objectInfo = $this->seatsioClient->events->retrieveObjectInfo($event->key, "A-1"); - self::assertEquals(EventObjectInfo::$BOOKED, $objectInfo->status); - } - } diff --git a/tests/Events/ChangeObjectStatusTest.php b/tests/Events/ChangeObjectStatusTest.php index 89cc813..4dd18a3 100644 --- a/tests/Events/ChangeObjectStatusTest.php +++ b/tests/Events/ChangeObjectStatusTest.php @@ -2,7 +2,6 @@ namespace Seatsio\Events; -use Seatsio\Charts\SocialDistancingRuleset; use Seatsio\Common\IDs; use Seatsio\SeatsioClientTest; use Seatsio\SeatsioException; @@ -151,19 +150,6 @@ public function testIgnoreChannels() self::assertEquals("someStatus", $objectInfo->status); } - public function testIgnoreSocialDistancing() - { - $chartKey = $this->createTestChart(); - $ruleset = SocialDistancingRuleset::fixed("ruleset")->setDisabledSeats(["A-1"])->build(); - $this->seatsioClient->charts->saveSocialDistancingRulesets($chartKey, ["ruleset" => $ruleset]); - $event = $this->seatsioClient->events->create($chartKey, CreateEventParams::create()->setSocialDistancingRulesetKey("ruleset")); - - $this->seatsioClient->events->changeObjectStatus($event->key, "A-1", "someStatus", null, null, null, null, null, true); - - $objectInfo = $this->seatsioClient->events->retrieveObjectInfo($event->key, "A-1"); - self::assertEquals("someStatus", $objectInfo->status); - } - public function testAllowedPreviousStatuses() { $chartKey = $this->createTestChart(); @@ -177,9 +163,8 @@ public function testAllowedPreviousStatuses() null, null, null, - true, null, - true, + null, ['someOtherStatus'] ); throw new \Exception("Should have failed"); @@ -202,9 +187,8 @@ public function testRejectedPreviousStatuses() null, null, null, - true, null, - true, + null, null, ['free'] ); diff --git a/tests/Events/CreateEventTest.php b/tests/Events/CreateEventTest.php index 24abacc..3d812ad 100644 --- a/tests/Events/CreateEventTest.php +++ b/tests/Events/CreateEventTest.php @@ -3,7 +3,6 @@ namespace Seatsio\Events; use Seatsio\Charts\Category; -use Seatsio\Charts\SocialDistancingRuleset; use Seatsio\LocalDate; use Seatsio\SeatsioClientTest; @@ -57,16 +56,6 @@ public function testTableBookingConfigInheritCanBePassedIn() self::assertEquals(TableBookingConfig::inherit(), $event->tableBookingConfig); } - public function testSocialDistancingRulesetKeyCanBePassedIn() - { - $chartKey = $this->createTestChartWithTables(); - $this->seatsioClient->charts->saveSocialDistancingRulesets($chartKey, ["ruleset1" => SocialDistancingRuleset::ruleBased("My ruleset")->build()]); - - $event = $this->seatsioClient->events->create($chartKey, CreateEventParams::create()->setSocialDistancingRulesetKey("ruleset1")); - - self::assertEquals("ruleset1", $event->socialDistancingRulesetKey); - } - public function testObjectCategoriesCanBePassedIn() { $chartKey = $this->createTestChart(); diff --git a/tests/Events/CreateEventsTest.php b/tests/Events/CreateEventsTest.php index 90ec515..eac0882 100644 --- a/tests/Events/CreateEventsTest.php +++ b/tests/Events/CreateEventsTest.php @@ -4,7 +4,6 @@ use Composer\DependencyResolver\LocalRepoTransaction; use Seatsio\Charts\Category; -use Seatsio\Charts\SocialDistancingRuleset; use Seatsio\LocalDate; use Seatsio\SeatsioClientTest; @@ -72,22 +71,6 @@ public function test_tableBookingConfigCanBePassedIn() self::assertEquals(TableBookingConfig::custom(["T1" => "BY_SEAT", "T2" => "BY_TABLE"]), $events[1]->tableBookingConfig); } - public function test_socialDistancingRulesetKeyCanBePassedIn() - { - $chartKey = $this->createTestChartWithTables(); - $this->seatsioClient->charts->saveSocialDistancingRulesets($chartKey, ["ruleset1" => SocialDistancingRuleset::ruleBased("My ruleset")->build()]); - $params = [ - CreateEventParams::create()->setSocialDistancingRulesetKey("ruleset1"), - CreateEventParams::create()->setSocialDistancingRulesetKey("ruleset1") - ]; - - $events = $this->seatsioClient->events->createMultiple($chartKey, $params); - - self::assertEquals(2, sizeof($events)); - self::assertEquals("ruleset1", $events[0]->socialDistancingRulesetKey); - self::assertEquals("ruleset1", $events[1]->socialDistancingRulesetKey); - } - public function test_objectCategoriesCanBePassedIn() { $chartKey = $this->createTestChart(); diff --git a/tests/Events/HoldObjectsTest.php b/tests/Events/HoldObjectsTest.php index ad8bc47..609d774 100644 --- a/tests/Events/HoldObjectsTest.php +++ b/tests/Events/HoldObjectsTest.php @@ -2,7 +2,6 @@ namespace Seatsio\Events; -use Seatsio\Charts\SocialDistancingRuleset; use Seatsio\SeatsioClientTest; class HoldObjectsTest extends SeatsioClientTest @@ -82,18 +81,4 @@ public function testIgnoreChannels() $objectInfo = $this->seatsioClient->events->retrieveObjectInfo($event->key, "A-1"); self::assertEquals(EventObjectInfo::$HELD, $objectInfo->status); } - - public function testIgnoreSocialDistancing() - { - $chartKey = $this->createTestChart(); - $holdToken = $this->seatsioClient->holdTokens->create(); - $ruleset = SocialDistancingRuleset::fixed("ruleset")->setDisabledSeats(["A-1"])->build(); - $this->seatsioClient->charts->saveSocialDistancingRulesets($chartKey, ["ruleset" => $ruleset]); - $event = $this->seatsioClient->events->create($chartKey, CreateEventParams::create()->setSocialDistancingRulesetKey("ruleset")); - - $this->seatsioClient->events->hold($event->key, "A-1", $holdToken->holdToken, null, null, null, null, true); - - $objectInfo = $this->seatsioClient->events->retrieveObjectInfo($event->key, "A-1"); - self::assertEquals(EventObjectInfo::$HELD, $objectInfo->status); - } } diff --git a/tests/Events/UpdateEventTest.php b/tests/Events/UpdateEventTest.php index d6db076..5f9b028 100644 --- a/tests/Events/UpdateEventTest.php +++ b/tests/Events/UpdateEventTest.php @@ -3,7 +3,6 @@ namespace Seatsio\Events; use Seatsio\Charts\Category; -use Seatsio\Charts\SocialDistancingRuleset; use Seatsio\LocalDate; use Seatsio\SeatsioClientTest; use stdClass; @@ -71,35 +70,6 @@ public function testUpdateTableBookingConfig() self::assertEquals(TableBookingConfig::custom(["T1" => "BY_TABLE", "T2" => "BY_SEAT"]), $retrievedEvent->tableBookingConfig); } - public function testUpdateSocialDistancingRulesetKey() - { - $chartKey = $this->createTestChartWithTables(); - $this->seatsioClient->charts->saveSocialDistancingRulesets($chartKey, [ - "ruleset1" => SocialDistancingRuleset::ruleBased("My first ruleset")->setIndex(0)->build(), - "ruleset2" => SocialDistancingRuleset::ruleBased("My second ruleset")->setIndex(1)->build() - ]); - $event = $this->seatsioClient->events->create($chartKey, CreateEventParams::create()->setSocialDistancingRulesetKey("ruleset1")); - - $this->seatsioClient->events->update($event->key, UpdateEventParams::create()->setSocialDistancingRulesetKey("ruleset2")); - - $retrievedEvent = $this->seatsioClient->events->retrieve($event->key); - self::assertEquals("ruleset2", $retrievedEvent->socialDistancingRulesetKey); - } - - public function testRemoveSocialDistancingRulesetKey() - { - $chartKey = $this->createTestChartWithTables(); - $this->seatsioClient->charts->saveSocialDistancingRulesets($chartKey, [ - "ruleset1" => SocialDistancingRuleset::ruleBased("My first ruleset")->build() - ]); - $event = $this->seatsioClient->events->create($chartKey, CreateEventParams::create()->setSocialDistancingRulesetKey("ruleset1")); - - $this->seatsioClient->events->update($event->key, UpdateEventParams::create()->setSocialDistancingRulesetKey("")); - - $retrievedEvent = $this->seatsioClient->events->retrieve($event->key); - self::assertNull($retrievedEvent->socialDistancingRulesetKey); - } - public function testUpdateObjectCategories() { $chartKey = $this->createTestChart(); diff --git a/tests/Reports/EventReportsTest.php b/tests/Reports/EventReportsTest.php index c12c2de..90bcb8b 100644 --- a/tests/Reports/EventReportsTest.php +++ b/tests/Reports/EventReportsTest.php @@ -44,7 +44,6 @@ public function testReportItemProperties() self::assertFalse($reportItem->isCompanionSeat); self::assertFalse($reportItem->isAvailable); self::assertEquals(EventObjectInfo::$BOOKED, $reportItem->availabilityReason); - self::assertFalse($reportItem->isDisabledBySocialDistancing); self::assertNull($reportItem->displayedObjectType); self::assertNull($reportItem->leftNeighbour); self::assertEquals("A-2", $reportItem->rightNeighbour); diff --git a/tests/Seasons/CreateSeasonTest.php b/tests/Seasons/CreateSeasonTest.php index 13e7465..c580e14 100644 --- a/tests/Seasons/CreateSeasonTest.php +++ b/tests/Seasons/CreateSeasonTest.php @@ -2,7 +2,6 @@ namespace Seatsio\Seasons; -use Seatsio\Charts\SocialDistancingRuleset; use Seatsio\Events\TableBookingConfig; use Seatsio\SeatsioClientTest; use function Functional\map; @@ -76,15 +75,4 @@ public function testTableBookingConfigInheritCanBePassedIn() self::assertNotNull($season->key); self::assertEquals(TableBookingConfig::inherit(), $season->tableBookingConfig); } - - public function testSocialDistancingRulesetKeyCanBePassedIn() - { - $chartKey = $this->createTestChartWithTables(); - $this->seatsioClient->charts->saveSocialDistancingRulesets($chartKey, ["ruleset1" => SocialDistancingRuleset::ruleBased("My ruleset")->build()]); - - $season = $this->seatsioClient->seasons->create($chartKey, (new SeasonCreationParams())->setSocialDistancingRulesetKey("ruleset1")); - - self::assertEquals("ruleset1", $season->socialDistancingRulesetKey); - } - }