diff --git a/lib/seatsio/domain.rb b/lib/seatsio/domain.rb index 9afc505..8fed854 100644 --- a/lib/seatsio/domain.rb +++ b/lib/seatsio/domain.rb @@ -162,7 +162,7 @@ class Event :table_booking_config, :for_sale_config, :created_on, :updated_on, :channels, :is_top_level_season, :is_partial_season, :is_event_in_season, :top_level_season_key, - :object_categories, :categories, :is_in_the_past + :object_categories, :categories, :is_in_the_past, :partial_season_keys_for_event def initialize(data) @id = data['id'] @@ -185,6 +185,7 @@ def initialize(data) @object_categories = data['objectCategories'] @categories = Category.create_list(data['categories']) if data['categories'] @is_in_the_past = data['isInThePast'] + @partial_season_keys_for_event = data['partialSeasonKeysForEvent'] end def is_season diff --git a/test/events/retrieve_event_test.rb b/test/events/retrieve_event_test.rb index d1570a6..76f0618 100644 --- a/test/events/retrieve_event_test.rb +++ b/test/events/retrieve_event_test.rb @@ -17,6 +17,7 @@ def test_retrieve_event assert_nil(retrieved_event.updated_on) # TODO: assert_that(retrieved_event.created_on).is_between_now_minus_and_plus_minutes(datetime.utcnow(), 1) assert_equal(TEST_CHART_CATEGORIES, retrieved_event.categories) + assert_nil(retrieved_event.partial_season_keys_for_event) end def test_retrieve_season @@ -35,5 +36,6 @@ def test_retrieve_season assert_nil(season.for_sale_config) assert_nil(season.updated_on) assert_equal(TEST_CHART_CATEGORIES, season.categories) + assert_nil(season.partial_season_keys_for_event) end end diff --git a/test/seasons/add_events_to_partial_season_test.rb b/test/seasons/add_events_to_partial_season_test.rb index ac3616a..5a094de 100644 --- a/test/seasons/add_events_to_partial_season_test.rb +++ b/test/seasons/add_events_to_partial_season_test.rb @@ -14,5 +14,6 @@ def test_add_events_to_partial_season event_keys: %w[event1 event2] assert_equal(%w[event1 event2], updated_season.events.map { |e| e.key }) + assert_equal([updated_season.key], updated_season.events[0].partial_season_keys_for_event) end end diff --git a/test/seasons/create_partial_season_test.rb b/test/seasons/create_partial_season_test.rb index 9d5e049..ed29bf9 100644 --- a/test/seasons/create_partial_season_test.rb +++ b/test/seasons/create_partial_season_test.rb @@ -22,5 +22,6 @@ def test_event_keys_is_optional partial_season = @seatsio.seasons.create_partial_season top_level_season_key: season.key, event_keys: ['event1', 'event2'] assert_equal(%w[event1 event2], partial_season.events.map { |e| e.key }) + assert_equal([partial_season.key], partial_season.events[0].partial_season_keys_for_event) end end