Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exposed partialSeasonKeysForEvent #94

Merged
merged 2 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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([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([partial_season.key], partial_season.events[0].partial_season_keys_for_event)
end
end
Loading