Skip to content

Commit

Permalink
Exposed partialSeasonKeysForEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
mroloux committed Nov 9, 2023
1 parent 7d2ca73 commit f0507ee
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/seatsio/domain.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions test/events/retrieve_event_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
1 change: 1 addition & 0 deletions test/seasons/add_events_to_partial_season_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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(%w[updated_season.key], updated_season.events[0].partial_season_keys_for_event)
end
end
1 change: 1 addition & 0 deletions test/seasons/create_partial_season_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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(%w[partial_season.key], partial_season.events[0].partial_season_keys_for_event)
end
end

0 comments on commit f0507ee

Please sign in to comment.