diff --git a/src/Events/Events.php b/src/Events/Events.php index ce091ca..68b2511 100644 --- a/src/Events/Events.php +++ b/src/Events/Events.php @@ -280,6 +280,20 @@ public function markEverythingAsForSale(string $eventKey): void $this->client->post(UriTemplate::expand('/events/{key}/actions/mark-everything-as-for-sale', array("key" => $eventKey))); } + public function overrideSeasonStatus(string $eventKey, array $objects) + { + $request = new stdClass(); + $request->objects = $objects; + $this->client->post(UriTemplate::expand('/events/{key}/actions/override-season-status', array("key" => $eventKey)), ['json' => $request]); + } + + public function useSeasonStatus(string $eventKey, array $objects) + { + $request = new stdClass(); + $request->objects = $objects; + $this->client->post(UriTemplate::expand('/events/{key}/actions/use-season-status', array("key" => $eventKey)), ['json' => $request]); + } + public function updateExtraData(string $eventKey, string $object, array $extraData): void { $request = new stdClass(); @@ -543,5 +557,4 @@ private static function normalizeObjects($objectOrObjects): array } return self::normalizeObjects([$objectOrObjects]); } - } diff --git a/tests/Events/OverrideSeasonObjectStatusTest.php b/tests/Events/OverrideSeasonObjectStatusTest.php new file mode 100644 index 0000000..c82566f --- /dev/null +++ b/tests/Events/OverrideSeasonObjectStatusTest.php @@ -0,0 +1,26 @@ +createTestChart(); + $season = $this->seatsioClient->seasons->create($chartKey, (new SeasonCreationParams())->setEventKeys(["anEvent"])); + $this->seatsioClient->events->book($season->key, ["A-1", "A-2"]); + + $this->seatsioClient->events->overrideSeasonStatus("anEvent", ["A-1", "A-2"]); + + self::assertEquals(EventObjectInfo::$FREE, $this->seatsioClient->events->retrieveObjectInfo("anEvent", "A-1")->status); + self::assertEquals(EventObjectInfo::$FREE, $this->seatsioClient->events->retrieveObjectInfo("anEvent", "A-2")->status); + } +} diff --git a/tests/Events/UseSeasonObjectStatusTest.php b/tests/Events/UseSeasonObjectStatusTest.php new file mode 100644 index 0000000..3876809 --- /dev/null +++ b/tests/Events/UseSeasonObjectStatusTest.php @@ -0,0 +1,27 @@ +createTestChart(); + $season = $this->seatsioClient->seasons->create($chartKey, (new SeasonCreationParams())->setEventKeys(["anEvent"])); + $this->seatsioClient->events->book($season->key, ["A-1", "A-2"]); + $this->seatsioClient->events->overrideSeasonStatus("anEvent", ["A-1", "A-2"]); + + $this->seatsioClient->events->useSeasonStatus("anEvent", ["A-1", "A-2"]); + + self::assertEquals(EventObjectInfo::$BOOKED, $this->seatsioClient->events->retrieveObjectInfo("anEvent", "A-1")->status); + self::assertEquals(EventObjectInfo::$BOOKED, $this->seatsioClient->events->retrieveObjectInfo("anEvent", "A-2")->status); + } +}