Skip to content

Commit

Permalink
Expose num_not_for_sale in EventObjectInfo (#110)
Browse files Browse the repository at this point in the history
Co-authored-by: Steve Chaloner <[email protected]>
  • Loading branch information
schaloner and Steve Chaloner authored Jun 7, 2024
1 parent 16162a5 commit 382c71e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/seatsio/domain.rb
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,8 @@ class EventObjectInfo
:ticket_type, :num_booked, :num_free, :num_held, :for_sale, :section,
:is_accessible, :is_companion_seat, :has_restricted_view, :displayed_object_type,
:left_neighbour, :right_neighbour, :is_available, :channel,
:book_as_a_whole, :distance_to_focal_point, :holds, :num_seats,
:variable_occupancy, :min_occupancy, :max_occupancy, :season_status_overridden_quantity
:book_as_a_whole, :distance_to_focal_point, :holds, :num_seats, :variable_occupancy,
:min_occupancy, :max_occupancy, :season_status_overridden_quantity, :num_not_for_sale

def initialize(data)
@status = data['status']
Expand Down Expand Up @@ -429,6 +429,7 @@ def initialize(data)
@min_occupancy = data['minOccupancy']
@max_occupancy = data['maxOccupancy']
@season_status_overridden_quantity = data['seasonStatusOverriddenQuantity']
@num_not_for_sale = data['numNotForSale']
end
end

Expand Down
10 changes: 10 additions & 0 deletions test/events/mark_objects_as_not_for_sale_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,14 @@ def test_categories
assert_equal([], retrieved_event.for_sale_config.objects)
assert_equal(["cat1", "cat2"], retrieved_event.for_sale_config.categories)
end

def test_num_not_for_sale_is_correctly_exposed
chart_key = create_test_chart
event = @seatsio.events.create chart_key: chart_key

@seatsio.events.mark_as_not_for_sale key: event.key, area_places: { 'GA1' => 3 }

ga1_info = @seatsio.events.retrieve_object_info(key: event.key, label: 'GA1')
assert_equal(3, ga1_info.num_not_for_sale)
end
end

0 comments on commit 382c71e

Please sign in to comment.