From f2f81bdaed0351e92f1da5cac2994e8021014808 Mon Sep 17 00:00:00 2001 From: mroloux Date: Mon, 8 May 2023 13:13:06 +0200 Subject: [PATCH] Added tryToPreventOrphanSeats flag when selecting best available objects (#81) * Added tryToPreventOrphanSeats flag when selecting best available objects * Fixed tests --- .../ChangeBestAvailableObjectStatusTest.cs | 58 ++- SeatsioDotNet.Test/Events/HoldObjectsTest.cs | 4 +- SeatsioDotNet.Test/resources/sampleChart.json | 443 ++++++++++++++---- SeatsioDotNet/Events/BestAvailable.cs | 11 +- 4 files changed, 398 insertions(+), 118 deletions(-) diff --git a/SeatsioDotNet.Test/Events/ChangeBestAvailableObjectStatusTest.cs b/SeatsioDotNet.Test/Events/ChangeBestAvailableObjectStatusTest.cs index 462ddbd..443e99d 100644 --- a/SeatsioDotNet.Test/Events/ChangeBestAvailableObjectStatusTest.cs +++ b/SeatsioDotNet.Test/Events/ChangeBestAvailableObjectStatusTest.cs @@ -16,7 +16,7 @@ public void Number() var bestAvailableResult = Client.Events.ChangeObjectStatus(evnt.Key, new BestAvailable(3), "foo"); Assert.True(bestAvailableResult.NextToEachOther); - Assert.Equal(new[] {"B-4", "B-5", "B-6"}, bestAvailableResult.Objects); + Assert.Equal(new[] {"A-4", "A-5", "A-6"}, bestAvailableResult.Objects); } [Fact] @@ -27,10 +27,10 @@ public void ObjectDetails() var bestAvailableResult = Client.Events.ChangeObjectStatus(evnt.Key, new BestAvailable(2), "foo"); - var reportItem = bestAvailableResult.ObjectDetails["B-4"]; - Assert.Equal("B-4", reportItem.Label); - reportItem.Labels.Should().BeEquivalentTo(new Labels("4", "seat", "B", "row")); - reportItem.IDs.Should().BeEquivalentTo(new IDs("4", "B", null)); + var reportItem = bestAvailableResult.ObjectDetails["A-4"]; + Assert.Equal("A-4", reportItem.Label); + reportItem.Labels.Should().BeEquivalentTo(new Labels("4", "seat", "A", "row")); + reportItem.IDs.Should().BeEquivalentTo(new IDs("4", "A", null)); Assert.Equal("foo", reportItem.Status); Assert.Equal("Cat1", reportItem.CategoryLabel); Assert.Equal("9", reportItem.CategoryKey); @@ -42,8 +42,8 @@ public void ObjectDetails() Assert.Null(reportItem.Entrance); Assert.Null(reportItem.NumBooked); Assert.Null(reportItem.Capacity); - Assert.Equal("B-3", reportItem.LeftNeighbour); - Assert.Equal("B-5", reportItem.RightNeighbour); + Assert.Equal("A-3", reportItem.LeftNeighbour); + Assert.Equal("A-5", reportItem.RightNeighbour); } [Fact] @@ -71,9 +71,21 @@ public void ExtraData() var bestAvailableResult = Client.Events.ChangeObjectStatus(evnt.Key, new BestAvailable(2, extraData: extraData), "foo"); - Assert.Equal(new[] {"B-4", "B-5"}, bestAvailableResult.Objects); - Assert.Equal(new Dictionary {{"foo", "bar"}}, Client.Events.RetrieveObjectInfo(evnt.Key, "B-4").ExtraData); - Assert.Equal(new Dictionary {{"foo", "baz"}}, Client.Events.RetrieveObjectInfo(evnt.Key, "B-5").ExtraData); + Assert.Equal(new[] {"A-4", "A-5"}, bestAvailableResult.Objects); + Assert.Equal(new Dictionary {{"foo", "bar"}}, Client.Events.RetrieveObjectInfo(evnt.Key, "A-4").ExtraData); + Assert.Equal(new Dictionary {{"foo", "baz"}}, Client.Events.RetrieveObjectInfo(evnt.Key, "A-5").ExtraData); + } + + [Fact] + public void DoNotTryToPreventOrphanSeats() + { + var chartKey = CreateTestChart(); + var evnt = Client.Events.Create(chartKey); + Client.Events.Book(evnt.Key, new[] {"A-4", "A-5"}); + + var bestAvailableResult = Client.Events.ChangeObjectStatus(evnt.Key, new BestAvailable(2, tryToPreventOrphanSeats: false), "foo"); + + Assert.Equal(new[] {"A-2", "A-3"}, bestAvailableResult.Objects); } [Fact] @@ -89,9 +101,9 @@ public void TicketTypes() var bestAvailableResult = Client.Events.ChangeObjectStatus(evnt.Key, new BestAvailable(2, ticketTypes: new[]{"adult", "child"}), "foo"); - Assert.Equal(new[] {"B-4", "B-5"}, bestAvailableResult.Objects); - Assert.Equal("adult", Client.Events.RetrieveObjectInfo(evnt.Key, "B-4").TicketType); - Assert.Equal("child", Client.Events.RetrieveObjectInfo(evnt.Key, "B-5").TicketType); + Assert.Equal(new[] {"A-4", "A-5"}, bestAvailableResult.Objects); + Assert.Equal("adult", Client.Events.RetrieveObjectInfo(evnt.Key, "A-4").TicketType); + Assert.Equal("child", Client.Events.RetrieveObjectInfo(evnt.Key, "A-5").TicketType); } [Fact] @@ -100,11 +112,11 @@ public void KeepExtraDataTrue() var chartKey = CreateTestChart(); var evnt = Client.Events.Create(chartKey); var extraData = new Dictionary {{"foo1", "bar1"}}; - Client.Events.UpdateExtraData(evnt.Key, "B-5", extraData); + Client.Events.UpdateExtraData(evnt.Key, "A-5", extraData); Client.Events.ChangeObjectStatus(evnt.Key, new BestAvailable(1), "someStatus", null, null, true); - Assert.Equal(extraData, Client.Events.RetrieveObjectInfo(evnt.Key, "B-5").ExtraData); + Assert.Equal(extraData, Client.Events.RetrieveObjectInfo(evnt.Key, "A-5").ExtraData); } [Fact] @@ -113,11 +125,11 @@ public void KeepExtraDataFalse() var chartKey = CreateTestChart(); var evnt = Client.Events.Create(chartKey); var extraData = new Dictionary {{"foo1", "bar1"}}; - Client.Events.UpdateExtraData(evnt.Key, "B-5", extraData); + Client.Events.UpdateExtraData(evnt.Key, "A-5", extraData); Client.Events.ChangeObjectStatus(evnt.Key, new BestAvailable(1), "someStatus", null, null, false); - Assert.Null(Client.Events.RetrieveObjectInfo(evnt.Key, "B-5").ExtraData); + Assert.Null(Client.Events.RetrieveObjectInfo(evnt.Key, "A-5").ExtraData); } [Fact] @@ -126,11 +138,11 @@ public void NoKeepExtraData() var chartKey = CreateTestChart(); var evnt = Client.Events.Create(chartKey); var extraData = new Dictionary {{"foo1", "bar1"}}; - Client.Events.UpdateExtraData(evnt.Key, "B-5", extraData); + Client.Events.UpdateExtraData(evnt.Key, "A-5", extraData); Client.Events.ChangeObjectStatus(evnt.Key, new BestAvailable(1), "someStatus"); - Assert.Null(Client.Events.RetrieveObjectInfo(evnt.Key, "B-5").ExtraData); + Assert.Null(Client.Events.RetrieveObjectInfo(evnt.Key, "A-5").ExtraData); } [Fact] @@ -145,12 +157,12 @@ public void ChannelKeys() Client.Events.Channels.Replace(evnt.Key, channels); Client.Events.Channels.SetObjects(evnt.Key, new { - channelKey1 = new[] {"B-6"} + channelKey1 = new[] {"A-6"} }); var bestAvailableResult = Client.Events.ChangeObjectStatus(evnt.Key, new BestAvailable(1), "someStatus", channelKeys: new[] {"channelKey1"}); - Assert.Equal(new[] {"B-6"}, bestAvailableResult.Objects); + Assert.Equal(new[] {"A-6"}, bestAvailableResult.Objects); } [Fact] @@ -165,12 +177,12 @@ public void IgnoreChannels() Client.Events.Channels.Replace(evnt.Key, channels); Client.Events.Channels.SetObjects(evnt.Key, new { - channelKey1 = new[] {"B-5"} + channelKey1 = new[] {"A-5"} }); var bestAvailableResult = Client.Events.ChangeObjectStatus(evnt.Key, new BestAvailable(1), "someStatus", ignoreChannels: true); - Assert.Equal(new[] {"B-5"}, bestAvailableResult.Objects); + Assert.Equal(new[] {"A-5"}, bestAvailableResult.Objects); } } } diff --git a/SeatsioDotNet.Test/Events/HoldObjectsTest.cs b/SeatsioDotNet.Test/Events/HoldObjectsTest.cs index 457bce6..814e758 100644 --- a/SeatsioDotNet.Test/Events/HoldObjectsTest.cs +++ b/SeatsioDotNet.Test/Events/HoldObjectsTest.cs @@ -52,8 +52,8 @@ public void BestAvailable() var bestAvailableResult = Client.Events.Hold(evnt.Key, new BestAvailable(3), holdToken.Token, "order1"); Assert.True(bestAvailableResult.NextToEachOther); - Assert.Equal(new[] {"B-4", "B-5", "B-6"}, bestAvailableResult.Objects); - Assert.Equal("order1", Client.Events.RetrieveObjectInfo(evnt.Key, "B-4").OrderId); + Assert.Equal(new[] {"A-4", "A-5", "A-6"}, bestAvailableResult.Objects); + Assert.Equal("order1", Client.Events.RetrieveObjectInfo(evnt.Key, "A-4").OrderId); } [Fact] diff --git a/SeatsioDotNet.Test/resources/sampleChart.json b/SeatsioDotNet.Test/resources/sampleChart.json index ac230c5..6812923 100644 --- a/SeatsioDotNet.Test/resources/sampleChart.json +++ b/SeatsioDotNet.Test/resources/sampleChart.json @@ -1,7 +1,7 @@ { "name": "Sample chart", "tablesLabelCounter": 3, - "uuidCounter": 369, + "uuidCounter": 371, "categories": { "list": [ { @@ -25,433 +25,694 @@ ], "maxCategoryKey": 10 }, - "version": 17, + "rowSpacing": 14, + "rowChairSpacing": 5, + "colorScheme": "light", + "version": 19, "venueType": "ROWS_WITHOUT_SECTIONS", - "showAllButtons": false, "sectionScaleFactor": 100, + "referenceChartVisible": true, "subChart": { - "height": 95, - "width": 442, + "height": 186, + "width": 442.44, "tables": [], "texts": [], + "imageObjects": [], "rows": [ { "label": "A", + "displayLabel": null, + "sectionLabel": null, + "sectionDisplayedLabel": null, + "rowLabelPosition": "label-position-invisible", "seatLabeling": { "algoName": "SimpleNumbers", "startAtIndex": 0, - "isInverted": false + "isInverted": false, + "useEndAt": false }, "objectLabeling": { "algoName": "SimpleLettersUppercase", "prefix": "", - "startAtIndex": 0 + "startAtIndex": 0, + "skippedCharacters": [] }, "seats": [ { "x": 151.94, - "y": 9, + "y": 99.56, "label": "1", "categoryLabel": "Cat1", "categoryAccessible": false, "categoryKey": 9, - "uuid": "uuid288" + "restrictedView": false, + "accessible": false, + "companionSeat": false, + "disabledBySocialDistancingRules": false, + "uuid": "uuid288", + "published": true }, { "x": 171.94, - "y": 9, + "y": 99.56, "label": "2", "categoryLabel": "Cat1", "categoryAccessible": false, "categoryKey": 9, - "uuid": "uuid289" + "restrictedView": false, + "accessible": false, + "companionSeat": false, + "disabledBySocialDistancingRules": false, + "uuid": "uuid289", + "published": true }, { "x": 191.94, - "y": 9, + "y": 99.56, "label": "3", "categoryLabel": "Cat1", "categoryAccessible": false, "categoryKey": 9, - "uuid": "uuid290" + "restrictedView": false, + "accessible": false, + "companionSeat": false, + "disabledBySocialDistancingRules": false, + "uuid": "uuid290", + "published": true }, { "x": 211.94, - "y": 9, + "y": 99.56, "label": "4", "categoryLabel": "Cat1", "categoryAccessible": false, "categoryKey": 9, - "uuid": "uuid291" + "restrictedView": false, + "accessible": false, + "companionSeat": false, + "disabledBySocialDistancingRules": false, + "uuid": "uuid291", + "published": true }, { "x": 231.94, - "y": 9, + "y": 99.56, "label": "5", "categoryLabel": "Cat1", "categoryAccessible": false, "categoryKey": 9, - "uuid": "uuid292" + "restrictedView": false, + "accessible": false, + "companionSeat": false, + "disabledBySocialDistancingRules": false, + "uuid": "uuid292", + "published": true }, { "x": 251.94, - "y": 9, + "y": 99.56, "label": "6", "categoryLabel": "Cat1", "categoryAccessible": false, "categoryKey": 9, - "uuid": "uuid293" + "restrictedView": false, + "accessible": false, + "companionSeat": false, + "disabledBySocialDistancingRules": false, + "uuid": "uuid293", + "published": true }, { "x": 271.94, - "y": 9, + "y": 99.56, "label": "7", "categoryLabel": "Cat1", "categoryAccessible": false, "categoryKey": 9, - "uuid": "uuid294" + "restrictedView": false, + "accessible": false, + "companionSeat": false, + "disabledBySocialDistancingRules": false, + "uuid": "uuid294", + "published": true }, { "x": 291.94, - "y": 9, + "y": 99.56, "label": "8", "categoryLabel": "Cat1", "categoryAccessible": false, "categoryKey": 9, - "uuid": "uuid295" + "restrictedView": false, + "accessible": false, + "companionSeat": false, + "disabledBySocialDistancingRules": false, + "uuid": "uuid295", + "published": true } ], "curve": 0, "chairSpacing": 4, + "verticalRowLabelDirection": "BASELINE_LEFT", + "displayObjectType": "row", "objectType": "row", - "uuid": "uuid297" + "uuid": "uuid297", + "points": null, + "rowLabelDisabled": false, + "published": true }, { "label": "B", + "displayLabel": null, + "sectionLabel": null, + "sectionDisplayedLabel": null, + "rowLabelPosition": "label-position-invisible", "seatLabeling": { "algoName": "SimpleNumbers", "startAtIndex": 0, - "isInverted": false + "isInverted": false, + "useEndAt": false }, "objectLabeling": { "algoName": "SimpleLettersUppercase", "prefix": "", - "startAtIndex": 0 + "startAtIndex": 0, + "skippedCharacters": [] }, "seats": [ { "x": 151.94, - "y": 33, + "y": 123.56, "label": "1", "categoryLabel": "Cat1", "categoryAccessible": false, "categoryKey": 9, - "uuid": "uuid298" + "restrictedView": false, + "accessible": false, + "companionSeat": false, + "disabledBySocialDistancingRules": false, + "uuid": "uuid298", + "published": true }, { "x": 171.94, - "y": 33, + "y": 123.56, "label": "2", "categoryLabel": "Cat1", "categoryAccessible": false, "categoryKey": 9, - "uuid": "uuid299" + "restrictedView": false, + "accessible": false, + "companionSeat": false, + "disabledBySocialDistancingRules": false, + "uuid": "uuid299", + "published": true }, { "x": 191.94, - "y": 33, + "y": 123.56, "label": "3", "categoryLabel": "Cat1", "categoryAccessible": false, "categoryKey": 9, - "uuid": "uuid300" + "restrictedView": false, + "accessible": false, + "companionSeat": false, + "disabledBySocialDistancingRules": false, + "uuid": "uuid300", + "published": true }, { "x": 211.94, - "y": 33, + "y": 123.56, "label": "4", "categoryLabel": "Cat1", "categoryAccessible": false, "categoryKey": 9, - "uuid": "uuid301" + "restrictedView": false, + "accessible": false, + "companionSeat": false, + "disabledBySocialDistancingRules": false, + "uuid": "uuid301", + "published": true }, { "x": 231.94, - "y": 33, + "y": 123.56, "label": "5", "categoryLabel": "Cat1", "categoryAccessible": false, "categoryKey": 9, - "uuid": "uuid302" + "restrictedView": false, + "accessible": false, + "companionSeat": false, + "disabledBySocialDistancingRules": false, + "uuid": "uuid302", + "published": true }, { "x": 251.94, - "y": 33, + "y": 123.56, "label": "6", "categoryLabel": "Cat1", "categoryAccessible": false, "categoryKey": 9, - "uuid": "uuid303" + "restrictedView": false, + "accessible": false, + "companionSeat": false, + "disabledBySocialDistancingRules": false, + "uuid": "uuid303", + "published": true }, { "x": 271.94, - "y": 33, + "y": 123.56, "label": "7", "categoryLabel": "Cat1", "categoryAccessible": false, "categoryKey": 9, - "uuid": "uuid304" + "restrictedView": false, + "accessible": false, + "companionSeat": false, + "disabledBySocialDistancingRules": false, + "uuid": "uuid304", + "published": true }, { "x": 291.94, - "y": 33, + "y": 123.56, "label": "8", "categoryLabel": "Cat1", "categoryAccessible": false, "categoryKey": 9, - "uuid": "uuid305" + "restrictedView": false, + "accessible": false, + "companionSeat": false, + "disabledBySocialDistancingRules": false, + "uuid": "uuid305", + "published": true } ], "curve": 0, "chairSpacing": 4, + "verticalRowLabelDirection": "BASELINE_LEFT", + "displayObjectType": "row", "objectType": "row", - "uuid": "uuid307" + "uuid": "uuid307", + "points": null, + "rowLabelDisabled": false, + "published": true }, { "label": "C", + "displayLabel": null, + "sectionLabel": null, + "sectionDisplayedLabel": null, + "rowLabelPosition": "label-position-invisible", "seatLabeling": { "algoName": "SimpleNumbers", "startAtIndex": 0, - "isInverted": false + "isInverted": false, + "useEndAt": false }, "objectLabeling": { "algoName": "SimpleLettersUppercase", "prefix": "", - "startAtIndex": 0 + "startAtIndex": 0, + "skippedCharacters": [] }, "seats": [ { "x": 151.94, - "y": 57, + "y": 147.56, "label": "1", "categoryLabel": "Cat2", "categoryAccessible": false, "categoryKey": 10, - "uuid": "uuid308" + "restrictedView": false, + "accessible": false, + "companionSeat": false, + "disabledBySocialDistancingRules": false, + "uuid": "uuid308", + "published": true }, { "x": 171.94, - "y": 57, + "y": 147.56, "label": "2", "categoryLabel": "Cat2", "categoryAccessible": false, "categoryKey": 10, - "uuid": "uuid309" + "restrictedView": false, + "accessible": false, + "companionSeat": false, + "disabledBySocialDistancingRules": false, + "uuid": "uuid309", + "published": true }, { "x": 191.94, - "y": 57, + "y": 147.56, "label": "3", "categoryLabel": "Cat2", "categoryAccessible": false, "categoryKey": 10, - "uuid": "uuid310" + "restrictedView": false, + "accessible": false, + "companionSeat": false, + "disabledBySocialDistancingRules": false, + "uuid": "uuid310", + "published": true }, { "x": 211.94, - "y": 57, + "y": 147.56, "label": "4", "categoryLabel": "Cat2", "categoryAccessible": false, "categoryKey": 10, - "uuid": "uuid311" + "restrictedView": false, + "accessible": false, + "companionSeat": false, + "disabledBySocialDistancingRules": false, + "uuid": "uuid311", + "published": true }, { "x": 231.94, - "y": 57, + "y": 147.56, "label": "5", "categoryLabel": "Cat2", "categoryAccessible": false, "categoryKey": 10, - "uuid": "uuid312" + "restrictedView": false, + "accessible": false, + "companionSeat": false, + "disabledBySocialDistancingRules": false, + "uuid": "uuid312", + "published": true }, { "x": 251.94, - "y": 57, + "y": 147.56, "label": "6", "categoryLabel": "Cat2", "categoryAccessible": false, "categoryKey": 10, - "uuid": "uuid313" + "restrictedView": false, + "accessible": false, + "companionSeat": false, + "disabledBySocialDistancingRules": false, + "uuid": "uuid313", + "published": true }, { "x": 271.94, - "y": 57, + "y": 147.56, "label": "7", "categoryLabel": "Cat2", "categoryAccessible": false, "categoryKey": 10, - "uuid": "uuid314" + "restrictedView": false, + "accessible": false, + "companionSeat": false, + "disabledBySocialDistancingRules": false, + "uuid": "uuid314", + "published": true }, { "x": 291.94, - "y": 57, + "y": 147.56, "label": "8", "categoryLabel": "Cat2", "categoryAccessible": false, "categoryKey": 10, - "uuid": "uuid315" + "restrictedView": false, + "accessible": false, + "companionSeat": false, + "disabledBySocialDistancingRules": false, + "uuid": "uuid315", + "published": true } ], "curve": 0, "chairSpacing": 4, + "verticalRowLabelDirection": "BASELINE_LEFT", + "displayObjectType": "row", "objectType": "row", - "uuid": "uuid317" + "uuid": "uuid317", + "points": null, + "rowLabelDisabled": false, + "published": true }, { "label": "D", + "displayLabel": null, + "sectionLabel": null, + "sectionDisplayedLabel": null, + "rowLabelPosition": "label-position-invisible", "seatLabeling": { "algoName": "SimpleNumbers", "startAtIndex": 0, - "isInverted": false + "isInverted": false, + "useEndAt": false }, "objectLabeling": { "algoName": "SimpleLettersUppercase", "prefix": "", - "startAtIndex": 0 + "startAtIndex": 0, + "skippedCharacters": [] }, "seats": [ { "x": 151.94, - "y": 81, + "y": 171.56, "label": "1", "categoryLabel": "Cat2", "categoryAccessible": false, "categoryKey": 10, - "uuid": "uuid318" + "restrictedView": false, + "accessible": false, + "companionSeat": false, + "disabledBySocialDistancingRules": false, + "uuid": "uuid318", + "published": true }, { "x": 171.94, - "y": 81, + "y": 171.56, "label": "2", "categoryLabel": "Cat2", "categoryAccessible": false, "categoryKey": 10, - "uuid": "uuid319" + "restrictedView": false, + "accessible": false, + "companionSeat": false, + "disabledBySocialDistancingRules": false, + "uuid": "uuid319", + "published": true }, { "x": 191.94, - "y": 81, + "y": 171.56, "label": "3", "categoryLabel": "Cat2", "categoryAccessible": false, "categoryKey": 10, - "uuid": "uuid320" + "restrictedView": false, + "accessible": false, + "companionSeat": false, + "disabledBySocialDistancingRules": false, + "uuid": "uuid320", + "published": true }, { "x": 211.94, - "y": 81, + "y": 171.56, "label": "4", "categoryLabel": "Cat2", "categoryAccessible": false, "categoryKey": 10, - "uuid": "uuid321" + "restrictedView": false, + "accessible": false, + "companionSeat": false, + "disabledBySocialDistancingRules": false, + "uuid": "uuid321", + "published": true }, { "x": 231.94, - "y": 81, + "y": 171.56, "label": "5", "categoryLabel": "Cat2", "categoryAccessible": false, "categoryKey": 10, - "uuid": "uuid322" + "restrictedView": false, + "accessible": false, + "companionSeat": false, + "disabledBySocialDistancingRules": false, + "uuid": "uuid322", + "published": true }, { "x": 251.94, - "y": 81, + "y": 171.56, "label": "6", "categoryLabel": "Cat2", "categoryAccessible": false, "categoryKey": 10, - "uuid": "uuid323" + "restrictedView": false, + "accessible": false, + "companionSeat": false, + "disabledBySocialDistancingRules": false, + "uuid": "uuid323", + "published": true }, { "x": 271.94, - "y": 81, + "y": 171.56, "label": "7", "categoryLabel": "Cat2", "categoryAccessible": false, "categoryKey": 10, - "uuid": "uuid324" + "restrictedView": false, + "accessible": false, + "companionSeat": false, + "disabledBySocialDistancingRules": false, + "uuid": "uuid324", + "published": true }, { "x": 291.94, - "y": 81, + "y": 171.56, "label": "8", "categoryLabel": "Cat2", "categoryAccessible": false, "categoryKey": 10, - "uuid": "uuid325" + "restrictedView": false, + "accessible": false, + "companionSeat": false, + "disabledBySocialDistancingRules": false, + "uuid": "uuid325", + "published": true } ], "curve": 0, "chairSpacing": 4, + "verticalRowLabelDirection": "BASELINE_LEFT", + "displayObjectType": "row", "objectType": "row", - "uuid": "uuid327" + "uuid": "uuid327", + "points": null, + "rowLabelDisabled": false, + "published": true + } + ], + "shapes": [ + { + "uuid": "uuid371", + "objectType": "shape", + "label": "Stage", + "smartType": "stage", + "smartTypeVariation": null, + "fillColor": "#D0D1D2", + "strokeColor": "#E8E8E9", + "strokeWidth": 0, + "autoStroke": false, + "labelSize": 16, + "icon": "stage", + "labelHorizontalOffset": 0, + "labelVerticalOffset": 0, + "type": "rectangle", + "center": { + "x": 218.94, + "y": 30.56 + }, + "rotationAngle": 0, + "width": 245.55555555555475, + "height": 61.11111111111131, + "cornerRadius": 8, + "foreground": false } ], - "shapes": [], "booths": [], + "icons": [], "generalAdmissionAreas": [ { "categoryLabel": "Cat1", "categoryKey": 9, "capacity": 100, "label": "GA1", + "objectLabeling": { + "algoName": null, + "prefix": null, + "startAtIndex": null, + "skippedCharacters": [] + }, "labelSize": 24, "labelShown": true, "labelHorizontalOffset": 0, "labelVerticalOffset": 0, "objectType": "generalAdmission", "uuid": "uuid368", + "translucent": false, + "bookAsAWhole": false, + "variableOccupancy": false, + "minOccupancy": 1, + "published": true, "type": "circle", "center": { "x": 53.22, - "y": 48.89 + "y": 139.45 }, "rotationAngle": 0, "radius1": 52.222222222222626, - "radius2": 45.55555555555566 + "radius2": 45.55555555555566, + "foreground": false }, { "categoryLabel": "Cat2", "categoryKey": 10, "capacity": 100, - "label": "34", + "label": "GA2", + "objectLabeling": { + "algoName": null, + "prefix": null, + "startAtIndex": null, + "skippedCharacters": [] + }, "labelSize": 24, "labelShown": true, "labelHorizontalOffset": 0, "labelVerticalOffset": 0, "objectType": "generalAdmission", "uuid": "uuid369", + "translucent": false, + "bookAsAWhole": false, + "variableOccupancy": false, + "minOccupancy": 1, + "published": true, "type": "circle", "center": { "x": 389.22, - "y": 48.89 + "y": 139.45 }, "rotationAngle": 0, "radius1": 52.222222222222626, - "radius2": 45.55555555555566 + "radius2": 45.55555555555566, + "foreground": false } ], "sections": [], "focalPoint": { - "x": 223.89, - "y": 42.67 + "x": 225, + "y": 33.23 }, + "backgroundImage": null, + "referenceChart": null, "snapOffset": { "x": 0.06, - "y": 3 + "y": 0.44 } } -} \ No newline at end of file +} diff --git a/SeatsioDotNet/Events/BestAvailable.cs b/SeatsioDotNet/Events/BestAvailable.cs index cbd8710..322ba16 100644 --- a/SeatsioDotNet/Events/BestAvailable.cs +++ b/SeatsioDotNet/Events/BestAvailable.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; namespace SeatsioDotNet.Events { @@ -8,13 +9,15 @@ public class BestAvailable public IEnumerable Categories { get; } public IEnumerable> ExtraData { get; } public string[] TicketTypes { get; } + public bool? TryToPreventOrphanSeats; - public BestAvailable(int number, IEnumerable categories = null, IEnumerable> extraData = null, string[] ticketTypes = null) + public BestAvailable(int number, IEnumerable categories = null, IEnumerable> extraData = null, string[] ticketTypes = null, bool? tryToPreventOrphanSeats = null) { Categories = categories; Number = number; ExtraData = extraData; TicketTypes = ticketTypes; + TryToPreventOrphanSeats = tryToPreventOrphanSeats; } public Dictionary AsDictionary() @@ -35,6 +38,10 @@ public Dictionary AsDictionary() { dictionary.Add("ticketTypes", TicketTypes); } + if (TryToPreventOrphanSeats != null) + { + dictionary.Add("tryToPreventOrphanSeats", TryToPreventOrphanSeats); + } return dictionary; }