Skip to content

Commit

Permalink
Exposed zone on event and chart object info
Browse files Browse the repository at this point in the history
  • Loading branch information
mroloux committed Jul 12, 2024
1 parent 9c79592 commit 1324edf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/seatsio/domain.rb
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ class ChartObjectInfo

attr_reader :label, :labels, :ids, :category_key, :category_label, :section, :entrance, :capacity, :object_type,
:left_neighbour, :right_neighbour, :book_as_a_whole, :distance_to_focal_point, :num_seats, :is_accessible,
:is_companion_seat, :has_restricted_view
:is_companion_seat, :has_restricted_view, :zone

def initialize(data)
@label = data['label']
Expand All @@ -336,6 +336,7 @@ def initialize(data)
@is_accessible = data['isAccessible']
@is_companion_seat = data['isCompanionSeat']
@has_restricted_view = data['hasRestrictedView']
@zone = data['zone']
end
end

Expand Down Expand Up @@ -392,7 +393,8 @@ class EventObjectInfo
: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, :num_not_for_sale
:min_occupancy, :max_occupancy, :season_status_overridden_quantity, :num_not_for_sale,
:zone

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

Expand Down
1 change: 1 addition & 0 deletions test/reports/charts/chart_reports_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ def test_by_zone
report = get_report.(chart_key)
assert_equal(3, report.items.length)
assert_equal(6032, report.items['midtrack'].length)
assert_equal('midtrack', report.items['midtrack'][0].zone)
assert_equal(2865, report.items['finishline'].length)
assert_equal(0, report.items['NO_ZONE'].length)
end
Expand Down
1 change: 1 addition & 0 deletions test/reports/events/event_reports_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ def test_by_zone
report = @seatsio.event_reports.by_zone(event.key)

assert_equal(6032, report.items['midtrack'].length)
assert_equal('midtrack', report.items['midtrack'][0].zone)
end

def test_by_specific_zone
Expand Down

0 comments on commit 1324edf

Please sign in to comment.