Skip to content

Commit

Permalink
Exposed season status overridden quantity (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
mroloux authored Apr 24, 2024
1 parent 5c992b5 commit a3d2d85
Show file tree
Hide file tree
Showing 2 changed files with 15 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 @@ -391,7 +391,7 @@ 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
:variable_occupancy, :min_occupancy, :max_occupancy, :season_status_overridden_quantity

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

Expand Down
13 changes: 13 additions & 0 deletions test/reports/events/event_reports_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def test_report_item_properties
assert_false(report_item.is_available)
assert_equal('channelKey1', report_item.channel)
assert_not_nil(report_item.distance_to_focal_point)
assert_equal(0, report_item.season_status_overridden_quantity)

ga_item = report.items['GA1'][0]
assert_true(ga_item.variable_occupancy)
Expand All @@ -75,6 +76,18 @@ def test_hold_token
assert_equal(hold_token.hold_token, report_item.hold_token)
end

def test_season_status_overridden_quantity
chart_key = create_test_chart
season = @seatsio.seasons.create chart_key: chart_key, number_of_events: 1
event = season.events[0]
@seatsio.events.override_season_object_status(key: event.key, objects: %w(A-1))

report = @seatsio.event_reports.by_label(event.key)

report_item = report.items['A-1'][0]
assert_equal(1, report_item.season_status_overridden_quantity)
end

def test_report_item_properties_for_GA
chart_key = create_test_chart
event = @seatsio.events.create chart_key: chart_key
Expand Down

0 comments on commit a3d2d85

Please sign in to comment.