diff --git a/seatsio/domain.py b/seatsio/domain.py index 5b85653..4560188 100644 --- a/seatsio/domain.py +++ b/seatsio/domain.py @@ -281,6 +281,7 @@ class EventObjectInfo: FREE = "free" BOOKED = "booked" HELD = "reservedByToken" + RESALE = "resale" def __init__(self, item_data): self.status = item_data.get("status") diff --git a/seatsio/events/eventsClient.py b/seatsio/events/eventsClient.py index d90ad2f..e04d475 100644 --- a/seatsio/events/eventsClient.py +++ b/seatsio/events/eventsClient.py @@ -81,6 +81,9 @@ def book(self, event_key_or_keys, object_or_objects, hold_token=None, order_id=N return self.change_object_status(event_key_or_keys, object_or_objects, EventObjectInfo.BOOKED, hold_token, order_id, keep_extra_data, ignore_channels, channel_keys) + def put_up_for_resale(self, event_key_or_keys, object_or_objects): + return self.change_object_status(event_key_or_keys, object_or_objects, EventObjectInfo.RESALE) + def book_best_available(self, event_key, number, categories=None, hold_token=None, extra_data=None, ticket_types=None, order_id=None, keep_extra_data=None, ignore_channels=None, channel_keys=None, try_to_prevent_orphan_seats=None, zone=None): diff --git a/tests/events/testChangeObjectStatusForMultipleEvents.py b/tests/events/testChangeObjectStatusForMultipleEvents.py index f7d3586..8c5e8a6 100644 --- a/tests/events/testChangeObjectStatusForMultipleEvents.py +++ b/tests/events/testChangeObjectStatusForMultipleEvents.py @@ -36,6 +36,22 @@ def test_book(self): assert_that(self.fetch_status(event1.key, "A-2")).is_equal_to(EventObjectInfo.BOOKED) assert_that(self.fetch_status(event2.key, "A-2")).is_equal_to(EventObjectInfo.BOOKED) + def test_put_up_for_resale(self): + chart_key = self.create_test_chart() + event1 = self.client.events.create(chart_key) + event2 = self.client.events.create(chart_key) + + self.client.events.put_up_for_resale( + event_key_or_keys=[event1.key, event2.key], + object_or_objects=["A-1", "A-2"], + ) + + assert_that(self.fetch_status(event1.key, "A-1")).is_equal_to(EventObjectInfo.RESALE) + assert_that(self.fetch_status(event2.key, "A-1")).is_equal_to(EventObjectInfo.RESALE) + assert_that(self.fetch_status(event1.key, "A-2")).is_equal_to(EventObjectInfo.RESALE) + assert_that(self.fetch_status(event2.key, "A-2")).is_equal_to(EventObjectInfo.RESALE) + + def test_hold(self): chart_key = self.create_test_chart() event1 = self.client.events.create(chart_key) diff --git a/tests/events/testPutObjectsUpForResale.py b/tests/events/testPutObjectsUpForResale.py new file mode 100644 index 0000000..c347ff8 --- /dev/null +++ b/tests/events/testPutObjectsUpForResale.py @@ -0,0 +1,22 @@ +from seatsio.domain import EventObjectInfo, Channel +from tests.seatsioClientTest import SeatsioClientTest +from tests.util.asserts import assert_that + + +class PutObjectsUpForResaleTest(SeatsioClientTest): + + def test(self): + chart_key = self.create_test_chart() + event = self.client.events.create(chart_key) + + res = self.client.events.put_up_for_resale(event.key, ["A-1", "A-2"]) + + a1_status = self.client.events.retrieve_object_info(event.key, "A-1").status + a2_status = self.client.events.retrieve_object_info(event.key, "A-2").status + a3_status = self.client.events.retrieve_object_info(event.key, "A-3").status + + assert_that(a1_status).is_equal_to(EventObjectInfo.RESALE) + assert_that(a2_status).is_equal_to(EventObjectInfo.RESALE) + assert_that(a3_status).is_equal_to(EventObjectInfo.FREE) + + assert_that(list(res.objects)).contains_exactly_in_any_order("A-1", "A-2")