diff --git a/SeatsioDotNet.Test/Events/ChangeObjectStatusTest.cs b/SeatsioDotNet.Test/Events/ChangeObjectStatusTest.cs index aa2b5c1..de71e9d 100644 --- a/SeatsioDotNet.Test/Events/ChangeObjectStatusTest.cs +++ b/SeatsioDotNet.Test/Events/ChangeObjectStatusTest.cs @@ -82,15 +82,11 @@ public void Quantity() var chartKey = CreateTestChart(); var evnt = Client.Events.Create(chartKey); ObjectProperties object1 = new ObjectProperties("GA1", 5); - ObjectProperties object2 = new ObjectProperties("GA2", 10); - Client.Events.ChangeObjectStatus(evnt.Key, new[] {object1, object2}, "foo"); + Client.Events.ChangeObjectStatus(evnt.Key, new[] {object1}, "foo"); var status1 = Client.Events.RetrieveObjectStatus(evnt.Key, "GA1"); Assert.Equal(5, status1.Quantity); - - var status2 = Client.Events.RetrieveObjectStatus(evnt.Key, "GA2"); - Assert.Equal(10, status2.Quantity); } [Fact] diff --git a/SeatsioDotNet.Test/Events/CreateEventTest.cs b/SeatsioDotNet.Test/Events/CreateEventTest.cs index bdbf8bc..991d037 100644 --- a/SeatsioDotNet.Test/Events/CreateEventTest.cs +++ b/SeatsioDotNet.Test/Events/CreateEventTest.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using Xunit; namespace SeatsioDotNet.Test.Events @@ -27,7 +28,7 @@ public void EventKeyIsOptional() { var chartKey = CreateTestChart(); - var evnt = Client.Events.Create(chartKey, "eventje", null); + var evnt = Client.Events.Create(chartKey, "eventje"); Assert.Equal("eventje", evnt.Key); Assert.False(evnt.BookWholeTables); @@ -42,6 +43,19 @@ public void BookWholeTablesIsOptional() Assert.NotNull(evnt.Key); Assert.True(evnt.BookWholeTables); + } + + [Fact] + public void TableBookingModesAreOptional() + { + var chartKey = CreateTestChartWithTables(); + var tableBookingModes = new Dictionary {{"T1", "BY_TABLE"}, {"T2", "BY_SEAT"}}; + + var evnt = Client.Events.Create(chartKey, null, tableBookingModes); + + Assert.NotNull(evnt.Key); + Assert.False(evnt.BookWholeTables); + Assert.Equal(evnt.TableBookingModes, tableBookingModes); } } } \ No newline at end of file diff --git a/SeatsioDotNet.Test/Events/UpdateEventTest.cs b/SeatsioDotNet.Test/Events/UpdateEventTest.cs index e72ffcf..ba110a7 100644 --- a/SeatsioDotNet.Test/Events/UpdateEventTest.cs +++ b/SeatsioDotNet.Test/Events/UpdateEventTest.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using Xunit; namespace SeatsioDotNet.Test.Events @@ -12,7 +13,7 @@ public void UpdateChartKey() var chartKey2 = CreateTestChart(); var evnt = Client.Events.Create(chartKey1); - Client.Events.Update(evnt.Key, chartKey2, null, null); + Client.Events.Update(evnt.Key, chartKey2, null); var retrievedEvent = Client.Events.Retrieve(evnt.Key); Assert.Equal(evnt.Key, retrievedEvent.Key); @@ -27,7 +28,7 @@ public void UpdateEventKey() var chartKey = CreateTestChart(); var evnt = Client.Events.Create(chartKey); - Client.Events.Update(evnt.Key, null, "newKey", null); + Client.Events.Update(evnt.Key, null, "newKey"); var retrievedEvent = Client.Events.Retrieve("newKey"); Assert.Equal("newKey", retrievedEvent.Key); @@ -47,6 +48,21 @@ public void UpdateBookWholeTables() Assert.Equal(evnt.Key, retrievedEvent.Key); Assert.Equal(chartKey, retrievedEvent.ChartKey); Assert.True(retrievedEvent.BookWholeTables); + } + + [Fact] + public void UpdateTableBookingModes() + { + var chartKey = CreateTestChartWithTables(); + var evnt = Client.Events.Create(chartKey, null, new Dictionary {{"T1", "BY_TABLE"}}); + + Client.Events.Update(evnt.Key, null, null, new Dictionary {{"T1", "BY_SEAT"}}); + + var retrievedEvent = Client.Events.Retrieve(evnt.Key); + Assert.Equal(evnt.Key, retrievedEvent.Key); + Assert.Equal(chartKey, retrievedEvent.ChartKey); + Assert.False(retrievedEvent.BookWholeTables); + Assert.Equal(retrievedEvent.TableBookingModes, new Dictionary {{"T1", "BY_SEAT"}}); } } } \ No newline at end of file diff --git a/SeatsioDotNet.Test/SeatsioClientTest.cs b/SeatsioDotNet.Test/SeatsioClientTest.cs index d57f698..2f94f02 100644 --- a/SeatsioDotNet.Test/SeatsioClientTest.cs +++ b/SeatsioDotNet.Test/SeatsioClientTest.cs @@ -1,4 +1,5 @@ using System; +using System.IO; using RestSharp; using SeatsioDotNet.Util; @@ -31,12 +32,17 @@ protected static string RandomEmail() protected string CreateTestChart() { - return CreateTestChartFromJson(TestChartJson()); + return CreateTestChartFromJson(File.ReadAllText("./resources/sampleChart.json")); } protected string CreateTestChartWithSections() { - return CreateTestChartFromJson(TestChartWithSectionsJson()); + return CreateTestChartFromJson(File.ReadAllText("./resources/sampleChartWithSections.json")); + } + + protected string CreateTestChartWithTables() + { + return CreateTestChartFromJson(File.ReadAllText("./resources/sampleChartWithTables.json")); } protected string CreateTestChartFromJson(String json) @@ -55,15 +61,5 @@ protected SeatsioClient CreateSeatsioClient(string secretKey) { return new SeatsioClient(secretKey, BaseUrl); } - - private string TestChartJson() - { - return "{\"name\":\"Sample chart\",\"tablesLabelCounter\":3,\"uuidCounter\":369,\"categories\":{\"list\":[{\"label\":\"Cat1\",\"color\":\"#87A9CD\",\"accessible\":false,\"key\":9},{\"label\":\"Cat2\",\"color\":\"#5E42ED\",\"accessible\":false,\"key\":10}],\"maxCategoryKey\":10},\"version\":17,\"venueType\":\"ROWS_WITHOUT_SECTIONS\",\"showAllButtons\":false,\"sectionScaleFactor\":100,\"subChart\":{\"height\":95,\"width\":442,\"tables\":[],\"texts\":[],\"rows\":[{\"label\":\"A\",\"seatLabeling\":{\"algoName\":\"SimpleNumbers\",\"startAtIndex\":0,\"isInverted\":false},\"objectLabeling\":{\"algoName\":\"SimpleLettersUppercase\",\"prefix\":\"\",\"startAtIndex\":0},\"seats\":[{\"x\":151.94,\"y\":9,\"label\":\"1\",\"categoryLabel\":\"Cat1\",\"categoryAccessible\":false,\"categoryKey\":9,\"uuid\":\"uuid288\"},{\"x\":171.94,\"y\":9,\"label\":\"2\",\"categoryLabel\":\"Cat1\",\"categoryAccessible\":false,\"categoryKey\":9,\"uuid\":\"uuid289\"},{\"x\":191.94,\"y\":9,\"label\":\"3\",\"categoryLabel\":\"Cat1\",\"categoryAccessible\":false,\"categoryKey\":9,\"uuid\":\"uuid290\"},{\"x\":211.94,\"y\":9,\"label\":\"4\",\"categoryLabel\":\"Cat1\",\"categoryAccessible\":false,\"categoryKey\":9,\"uuid\":\"uuid291\"},{\"x\":231.94,\"y\":9,\"label\":\"5\",\"categoryLabel\":\"Cat1\",\"categoryAccessible\":false,\"categoryKey\":9,\"uuid\":\"uuid292\"},{\"x\":251.94,\"y\":9,\"label\":\"6\",\"categoryLabel\":\"Cat1\",\"categoryAccessible\":false,\"categoryKey\":9,\"uuid\":\"uuid293\"},{\"x\":271.94,\"y\":9,\"label\":\"7\",\"categoryLabel\":\"Cat1\",\"categoryAccessible\":false,\"categoryKey\":9,\"uuid\":\"uuid294\"},{\"x\":291.94,\"y\":9,\"label\":\"8\",\"categoryLabel\":\"Cat1\",\"categoryAccessible\":false,\"categoryKey\":9,\"uuid\":\"uuid295\"}],\"curve\":0,\"chairSpacing\":4,\"objectType\":\"row\",\"uuid\":\"uuid297\"},{\"label\":\"B\",\"seatLabeling\":{\"algoName\":\"SimpleNumbers\",\"startAtIndex\":0,\"isInverted\":false},\"objectLabeling\":{\"algoName\":\"SimpleLettersUppercase\",\"prefix\":\"\",\"startAtIndex\":0},\"seats\":[{\"x\":151.94,\"y\":33,\"label\":\"1\",\"categoryLabel\":\"Cat1\",\"categoryAccessible\":false,\"categoryKey\":9,\"uuid\":\"uuid298\"},{\"x\":171.94,\"y\":33,\"label\":\"2\",\"categoryLabel\":\"Cat1\",\"categoryAccessible\":false,\"categoryKey\":9,\"uuid\":\"uuid299\"},{\"x\":191.94,\"y\":33,\"label\":\"3\",\"categoryLabel\":\"Cat1\",\"categoryAccessible\":false,\"categoryKey\":9,\"uuid\":\"uuid300\"},{\"x\":211.94,\"y\":33,\"label\":\"4\",\"categoryLabel\":\"Cat1\",\"categoryAccessible\":false,\"categoryKey\":9,\"uuid\":\"uuid301\"},{\"x\":231.94,\"y\":33,\"label\":\"5\",\"categoryLabel\":\"Cat1\",\"categoryAccessible\":false,\"categoryKey\":9,\"uuid\":\"uuid302\"},{\"x\":251.94,\"y\":33,\"label\":\"6\",\"categoryLabel\":\"Cat1\",\"categoryAccessible\":false,\"categoryKey\":9,\"uuid\":\"uuid303\"},{\"x\":271.94,\"y\":33,\"label\":\"7\",\"categoryLabel\":\"Cat1\",\"categoryAccessible\":false,\"categoryKey\":9,\"uuid\":\"uuid304\"},{\"x\":291.94,\"y\":33,\"label\":\"8\",\"categoryLabel\":\"Cat1\",\"categoryAccessible\":false,\"categoryKey\":9,\"uuid\":\"uuid305\"}],\"curve\":0,\"chairSpacing\":4,\"objectType\":\"row\",\"uuid\":\"uuid307\"},{\"label\":\"C\",\"seatLabeling\":{\"algoName\":\"SimpleNumbers\",\"startAtIndex\":0,\"isInverted\":false},\"objectLabeling\":{\"algoName\":\"SimpleLettersUppercase\",\"prefix\":\"\",\"startAtIndex\":0},\"seats\":[{\"x\":151.94,\"y\":57,\"label\":\"1\",\"categoryLabel\":\"Cat2\",\"categoryAccessible\":false,\"categoryKey\":10,\"uuid\":\"uuid308\"},{\"x\":171.94,\"y\":57,\"label\":\"2\",\"categoryLabel\":\"Cat2\",\"categoryAccessible\":false,\"categoryKey\":10,\"uuid\":\"uuid309\"},{\"x\":191.94,\"y\":57,\"label\":\"3\",\"categoryLabel\":\"Cat2\",\"categoryAccessible\":false,\"categoryKey\":10,\"uuid\":\"uuid310\"},{\"x\":211.94,\"y\":57,\"label\":\"4\",\"categoryLabel\":\"Cat2\",\"categoryAccessible\":false,\"categoryKey\":10,\"uuid\":\"uuid311\"},{\"x\":231.94,\"y\":57,\"label\":\"5\",\"categoryLabel\":\"Cat2\",\"categoryAccessible\":false,\"categoryKey\":10,\"uuid\":\"uuid312\"},{\"x\":251.94,\"y\":57,\"label\":\"6\",\"categoryLabel\":\"Cat2\",\"categoryAccessible\":false,\"categoryKey\":10,\"uuid\":\"uuid313\"},{\"x\":271.94,\"y\":57,\"label\":\"7\",\"categoryLabel\":\"Cat2\",\"categoryAccessible\":false,\"categoryKey\":10,\"uuid\":\"uuid314\"},{\"x\":291.94,\"y\":57,\"label\":\"8\",\"categoryLabel\":\"Cat2\",\"categoryAccessible\":false,\"categoryKey\":10,\"uuid\":\"uuid315\"}],\"curve\":0,\"chairSpacing\":4,\"objectType\":\"row\",\"uuid\":\"uuid317\"},{\"label\":\"D\",\"seatLabeling\":{\"algoName\":\"SimpleNumbers\",\"startAtIndex\":0,\"isInverted\":false},\"objectLabeling\":{\"algoName\":\"SimpleLettersUppercase\",\"prefix\":\"\",\"startAtIndex\":0},\"seats\":[{\"x\":151.94,\"y\":81,\"label\":\"1\",\"categoryLabel\":\"Cat2\",\"categoryAccessible\":false,\"categoryKey\":10,\"uuid\":\"uuid318\"},{\"x\":171.94,\"y\":81,\"label\":\"2\",\"categoryLabel\":\"Cat2\",\"categoryAccessible\":false,\"categoryKey\":10,\"uuid\":\"uuid319\"},{\"x\":191.94,\"y\":81,\"label\":\"3\",\"categoryLabel\":\"Cat2\",\"categoryAccessible\":false,\"categoryKey\":10,\"uuid\":\"uuid320\"},{\"x\":211.94,\"y\":81,\"label\":\"4\",\"categoryLabel\":\"Cat2\",\"categoryAccessible\":false,\"categoryKey\":10,\"uuid\":\"uuid321\"},{\"x\":231.94,\"y\":81,\"label\":\"5\",\"categoryLabel\":\"Cat2\",\"categoryAccessible\":false,\"categoryKey\":10,\"uuid\":\"uuid322\"},{\"x\":251.94,\"y\":81,\"label\":\"6\",\"categoryLabel\":\"Cat2\",\"categoryAccessible\":false,\"categoryKey\":10,\"uuid\":\"uuid323\"},{\"x\":271.94,\"y\":81,\"label\":\"7\",\"categoryLabel\":\"Cat2\",\"categoryAccessible\":false,\"categoryKey\":10,\"uuid\":\"uuid324\"},{\"x\":291.94,\"y\":81,\"label\":\"8\",\"categoryLabel\":\"Cat2\",\"categoryAccessible\":false,\"categoryKey\":10,\"uuid\":\"uuid325\"}],\"curve\":0,\"chairSpacing\":4,\"objectType\":\"row\",\"uuid\":\"uuid327\"}],\"shapes\":[],\"booths\":[],\"generalAdmissionAreas\":[{\"categoryLabel\":\"Cat1\",\"categoryKey\":9,\"capacity\":100,\"label\":\"GA1\",\"labelSize\":24,\"labelShown\":true,\"labelHorizontalOffset\":0,\"labelVerticalOffset\":0,\"objectType\":\"generalAdmission\",\"uuid\":\"uuid368\",\"type\":\"circle\",\"center\":{\"x\":53.22,\"y\":48.89},\"rotationAngle\":0,\"radius1\":52.222222222222626,\"radius2\":45.55555555555566},{\"categoryLabel\":\"Cat2\",\"categoryKey\":10,\"capacity\":100,\"label\":\"GA2\",\"labelSize\":24,\"labelShown\":true,\"labelHorizontalOffset\":0,\"labelVerticalOffset\":0,\"objectType\":\"generalAdmission\",\"uuid\":\"uuid369\",\"type\":\"circle\",\"center\":{\"x\":389.22,\"y\":48.89},\"rotationAngle\":0,\"radius1\":52.222222222222626,\"radius2\":45.55555555555566}],\"sections\":[],\"focalPoint\":{\"x\":223.89,\"y\":42.67},\"snapOffset\":{\"x\":0.06,\"y\":3}}}"; - } - - private string TestChartWithSectionsJson() - { - return "{\"name\": \"Sample chart with sections\",\"tablesLabelCounter\": 1,\"uuidCounter\": 101,\"categories\": {\"list\": [{\"label\": \"cat1\",\"color\": \"#AEDB54\",\"accessible\": false,\"key\": 1},{\"label\": \"cat2\",\"color\": \"#AFCA54\",\"accessible\": false,\"key\": 4}],\"maxCategoryKey\": 11},\"rowSpacing\": 8,\"version\": 17,\"venueType\": \"ROWS_WITH_SECTIONS\",\"sectionScaleFactor\": 100,\"subChart\": {\"height\": 276,\"width\": 303,\"tables\": [],\"texts\": [],\"rows\": [],\"shapes\": [],\"booths\": [],\"generalAdmissionAreas\": [],\"sections\": [{\"points\": [{\"x\": 0.75,\"y\": 0.75},{\"x\": 0.75,\"y\": 240.75},{\"x\": 132.75,\"y\": 240.75},{\"x\": 132.75,\"y\": 0.75}],\"label\": \"Section A\",\"labelSize\": 12,\"labelHorizontalOffset\": 0,\"labelVerticalOffset\": 0,\"labelRotationAngle\": 0,\"uuid\": \"uuid2\",\"categoryLabel\": \"cat1\",\"categoryKey\": 1,\"topLeft\": {\"x\": 0,\"y\": 0},\"entrance\": \"Entrance 1\",\"viewFromYourSeatImage\": null,\"subChart\": {\"height\": 242,\"width\": 134,\"tables\": [],\"texts\": [],\"rows\": [{\"label\": \"A\",\"seatLabeling\": {\"algoName\": \"SimpleNumbers\",\"startAtIndex\": null,\"isInverted\": null},\"objectLabeling\": {\"algoName\": \"SimpleLettersUppercase\",\"prefix\": null,\"startAtIndex\": null},\"seats\": [{\"x\": 18.25,\"y\": 41.25,\"label\": \"1\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid5\"},{\"x\": 38.25,\"y\": 41.25,\"label\": \"2\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid6\"},{\"x\": 58.25,\"y\": 41.25,\"label\": \"3\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid7\"},{\"x\": 78.25,\"y\": 41.25,\"label\": \"4\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid8\"},{\"x\": 98.25,\"y\": 41.25,\"label\": \"5\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid9\"},{\"x\": 118.25,\"y\": 41.25,\"label\": \"6\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid10\"}],\"curve\": 0,\"chairSpacing\": 4,\"objectType\": \"row\",\"uuid\": \"uuid12\"},{\"label\": \"B\",\"seatLabeling\": {\"algoName\": \"SimpleNumbers\",\"startAtIndex\": null,\"isInverted\": null},\"objectLabeling\": {\"algoName\": \"SimpleLettersUppercase\",\"prefix\": null,\"startAtIndex\": null},\"seats\": [{\"x\": 18.25,\"y\": 65.25,\"label\": \"1\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid13\"},{\"x\": 38.25,\"y\": 65.25,\"label\": \"2\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid14\"},{\"x\": 58.25,\"y\": 65.25,\"label\": \"3\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid15\"},{\"x\": 78.25,\"y\": 65.25,\"label\": \"4\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid16\"},{\"x\": 98.25,\"y\": 65.25,\"label\": \"5\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid17\"},{\"x\": 118.25,\"y\": 65.25,\"label\": \"6\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid18\"}],\"curve\": 0,\"chairSpacing\": 4,\"objectType\": \"row\",\"uuid\": \"uuid20\"},{\"label\": \"C\",\"seatLabeling\": {\"algoName\": \"SimpleNumbers\",\"startAtIndex\": null,\"isInverted\": null},\"objectLabeling\": {\"algoName\": \"SimpleLettersUppercase\",\"prefix\": null,\"startAtIndex\": null},\"seats\": [{\"x\": 18.25,\"y\": 89.25,\"label\": \"1\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid21\"},{\"x\": 38.25,\"y\": 89.25,\"label\": \"2\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid22\"},{\"x\": 58.25,\"y\": 89.25,\"label\": \"3\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid23\"},{\"x\": 78.25,\"y\": 89.25,\"label\": \"4\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid24\"},{\"x\": 98.25,\"y\": 89.25,\"label\": \"5\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid25\"},{\"x\": 118.25,\"y\": 89.25,\"label\": \"6\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid26\"}],\"curve\": 0,\"chairSpacing\": 4,\"objectType\": \"row\",\"uuid\": \"uuid28\"},{\"label\": \"D\",\"seatLabeling\": {\"algoName\": \"SimpleNumbers\",\"startAtIndex\": null,\"isInverted\": null},\"objectLabeling\": {\"algoName\": \"SimpleLettersUppercase\",\"prefix\": null,\"startAtIndex\": null},\"seats\": [{\"x\": 18.25,\"y\": 113.25,\"label\": \"1\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid29\"},{\"x\": 38.25,\"y\": 113.25,\"label\": \"2\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid30\"},{\"x\": 58.25,\"y\": 113.25,\"label\": \"3\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid31\"},{\"x\": 78.25,\"y\": 113.25,\"label\": \"4\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid32\"},{\"x\": 98.25,\"y\": 113.25,\"label\": \"5\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid33\"},{\"x\": 118.25,\"y\": 113.25,\"label\": \"6\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid34\"}],\"curve\": 0,\"chairSpacing\": 4,\"objectType\": \"row\",\"uuid\": \"uuid36\"},{\"label\": \"E\",\"seatLabeling\": {\"algoName\": \"SimpleNumbers\",\"startAtIndex\": null,\"isInverted\": null},\"objectLabeling\": {\"algoName\": \"SimpleLettersUppercase\",\"prefix\": null,\"startAtIndex\": null},\"seats\": [{\"x\": 18.25,\"y\": 137.25,\"label\": \"1\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid37\"},{\"x\": 38.25,\"y\": 137.25,\"label\": \"2\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid38\"},{\"x\": 58.25,\"y\": 137.25,\"label\": \"3\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid39\"},{\"x\": 78.25,\"y\": 137.25,\"label\": \"4\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid40\"},{\"x\": 98.25,\"y\": 137.25,\"label\": \"5\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid41\"},{\"x\": 118.25,\"y\": 137.25,\"label\": \"6\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid42\"}],\"curve\": 0,\"chairSpacing\": 4,\"objectType\": \"row\",\"uuid\": \"uuid44\"},{\"label\": \"F\",\"seatLabeling\": {\"algoName\": \"SimpleNumbers\",\"startAtIndex\": null,\"isInverted\": null},\"objectLabeling\": {\"algoName\": \"SimpleLettersUppercase\",\"prefix\": null,\"startAtIndex\": null},\"seats\": [{\"x\": 18.25,\"y\": 161.25,\"label\": \"1\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid45\"},{\"x\": 38.25,\"y\": 161.25,\"label\": \"2\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid46\"},{\"x\": 58.25,\"y\": 161.25,\"label\": \"3\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid47\"},{\"x\": 78.25,\"y\": 161.25,\"label\": \"4\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid48\"},{\"x\": 98.25,\"y\": 161.25,\"label\": \"5\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid49\"},{\"x\": 118.25,\"y\": 161.25,\"label\": \"6\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid50\"}],\"curve\": 0,\"chairSpacing\": 4,\"objectType\": \"row\",\"uuid\": \"uuid52\"}],\"shapes\": [],\"booths\": [],\"generalAdmissionAreas\": []}},{\"points\": [{\"x\": 190.69,\"y\": 0.75},{\"x\": 190.69,\"y\": 240.75},{\"x\": 302.69,\"y\": 240.75},{\"x\": 302.69,\"y\": 0.75}],\"label\": \"Section B\",\"labelSize\": 12,\"labelHorizontalOffset\": 0,\"labelVerticalOffset\": 0,\"labelRotationAngle\": 0,\"uuid\": \"uuid4\",\"categoryLabel\": \"cat2\",\"categoryKey\": 4,\"topLeft\": {\"x\": 189.94,\"y\": 0},\"entrance\": \"Entrance 2\",\"viewFromYourSeatImage\": null,\"subChart\": {\"height\": 242,\"width\": 114,\"tables\": [],\"texts\": [],\"rows\": [{\"label\": \"A\",\"seatLabeling\": {\"algoName\": \"SimpleNumbers\",\"startAtIndex\": null,\"isInverted\": null},\"objectLabeling\": {\"algoName\": \"SimpleLettersUppercase\",\"prefix\": null,\"startAtIndex\": null},\"seats\": [{\"x\": 16.25,\"y\": 45.25,\"label\": \"1\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid53\"},{\"x\": 36.25,\"y\": 45.25,\"label\": \"2\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid54\"},{\"x\": 56.25,\"y\": 45.25,\"label\": \"3\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid55\"},{\"x\": 76.25,\"y\": 45.25,\"label\": \"4\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid56\"},{\"x\": 96.25,\"y\": 45.25,\"label\": \"5\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid57\"}],\"curve\": 0,\"chairSpacing\": 4,\"objectType\": \"row\",\"uuid\": \"uuid59\"},{\"label\": \"B\",\"seatLabeling\": {\"algoName\": \"SimpleNumbers\",\"startAtIndex\": null,\"isInverted\": null},\"objectLabeling\": {\"algoName\": \"SimpleLettersUppercase\",\"prefix\": null,\"startAtIndex\": null},\"seats\": [{\"x\": 16.25,\"y\": 69.25,\"label\": \"1\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid60\"},{\"x\": 36.25,\"y\": 69.25,\"label\": \"2\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid61\"},{\"x\": 56.25,\"y\": 69.25,\"label\": \"3\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid62\"},{\"x\": 76.25,\"y\": 69.25,\"label\": \"4\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid63\"},{\"x\": 96.25,\"y\": 69.25,\"label\": \"5\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid64\"}],\"curve\": 0,\"chairSpacing\": 4,\"objectType\": \"row\",\"uuid\": \"uuid66\"},{\"label\": \"C\",\"seatLabeling\": {\"algoName\": \"SimpleNumbers\",\"startAtIndex\": null,\"isInverted\": null},\"objectLabeling\": {\"algoName\": \"SimpleLettersUppercase\",\"prefix\": null,\"startAtIndex\": null},\"seats\": [{\"x\": 16.25,\"y\": 93.25,\"label\": \"1\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid67\"},{\"x\": 36.25,\"y\": 93.25,\"label\": \"2\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid68\"},{\"x\": 56.25,\"y\": 93.25,\"label\": \"3\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid69\"},{\"x\": 76.25,\"y\": 93.25,\"label\": \"4\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid70\"},{\"x\": 96.25,\"y\": 93.25,\"label\": \"5\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid71\"}],\"curve\": 0,\"chairSpacing\": 4,\"objectType\": \"row\",\"uuid\": \"uuid73\"},{\"label\": \"D\",\"seatLabeling\": {\"algoName\": \"SimpleNumbers\",\"startAtIndex\": null,\"isInverted\": null},\"objectLabeling\": {\"algoName\": \"SimpleLettersUppercase\",\"prefix\": null,\"startAtIndex\": null},\"seats\": [{\"x\": 16.25,\"y\": 117.25,\"label\": \"1\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid74\"},{\"x\": 36.25,\"y\": 117.25,\"label\": \"2\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid75\"},{\"x\": 56.25,\"y\": 117.25,\"label\": \"3\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid76\"},{\"x\": 76.25,\"y\": 117.25,\"label\": \"4\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid77\"},{\"x\": 96.25,\"y\": 117.25,\"label\": \"5\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid78\"}],\"curve\": 0,\"chairSpacing\": 4,\"objectType\": \"row\",\"uuid\": \"uuid80\"},{\"label\": \"E\",\"seatLabeling\": {\"algoName\": \"SimpleNumbers\",\"startAtIndex\": null,\"isInverted\": null},\"objectLabeling\": {\"algoName\": \"SimpleLettersUppercase\",\"prefix\": null,\"startAtIndex\": null},\"seats\": [{\"x\": 16.25,\"y\": 141.25,\"label\": \"1\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid81\"},{\"x\": 36.25,\"y\": 141.25,\"label\": \"2\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid82\"},{\"x\": 56.25,\"y\": 141.25,\"label\": \"3\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid83\"},{\"x\": 76.25,\"y\": 141.25,\"label\": \"4\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid84\"},{\"x\": 96.25,\"y\": 141.25,\"label\": \"5\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid85\"}],\"curve\": 0,\"chairSpacing\": 4,\"objectType\": \"row\",\"uuid\": \"uuid87\"},{\"label\": \"F\",\"seatLabeling\": {\"algoName\": \"SimpleNumbers\",\"startAtIndex\": null,\"isInverted\": null},\"objectLabeling\": {\"algoName\": \"SimpleLettersUppercase\",\"prefix\": null,\"startAtIndex\": null},\"seats\": [{\"x\": 16.25,\"y\": 165.25,\"label\": \"1\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid88\"},{\"x\": 36.25,\"y\": 165.25,\"label\": \"2\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid89\"},{\"x\": 56.25,\"y\": 165.25,\"label\": \"3\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid90\"},{\"x\": 76.25,\"y\": 165.25,\"label\": \"4\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid91\"},{\"x\": 96.25,\"y\": 165.25,\"label\": \"5\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid92\"}],\"curve\": 0,\"chairSpacing\": 4,\"objectType\": \"row\",\"uuid\": \"uuid94\"},{\"label\": \"G\",\"seatLabeling\": {\"algoName\": \"SimpleNumbers\",\"startAtIndex\": null,\"isInverted\": null},\"objectLabeling\": {\"algoName\": \"SimpleLettersUppercase\",\"prefix\": null,\"startAtIndex\": null},\"seats\": [{\"x\": 16.25,\"y\": 189.25,\"label\": \"1\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid95\"},{\"x\": 36.25,\"y\": 189.25,\"label\": \"2\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid96\"},{\"x\": 56.25,\"y\": 189.25,\"label\": \"3\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid97\"},{\"x\": 76.25,\"y\": 189.25,\"label\": \"4\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid98\"},{\"x\": 96.25,\"y\": 189.25,\"label\": \"5\",\"categoryLabel\": null,\"categoryAccessible\": null,\"categoryKey\": null,\"uuid\": \"uuid99\"}],\"curve\": 0,\"chairSpacing\": 4,\"objectType\": \"row\",\"uuid\": \"uuid101\"}],\"shapes\": [],\"booths\": [],\"generalAdmissionAreas\": []}}],\"focalPoint\": null,\"backgroundImage\": null,\"referenceChart\": null,\"snapOffset\": {\"x\": 3.25,\"y\": 3.25}}}"; - } } } \ No newline at end of file diff --git a/SeatsioDotNet.Test/SeatsioDotNet.Test.csproj b/SeatsioDotNet.Test/SeatsioDotNet.Test.csproj index 6a43319..eb32189 100644 --- a/SeatsioDotNet.Test/SeatsioDotNet.Test.csproj +++ b/SeatsioDotNet.Test/SeatsioDotNet.Test.csproj @@ -11,4 +11,9 @@ + + + Always + + \ No newline at end of file diff --git a/SeatsioDotNet.Test/resources/sampleChart.json b/SeatsioDotNet.Test/resources/sampleChart.json new file mode 100644 index 0000000..2e01add --- /dev/null +++ b/SeatsioDotNet.Test/resources/sampleChart.json @@ -0,0 +1,451 @@ +{ + "name": "Sample chart", + "tablesLabelCounter": 3, + "uuidCounter": 369, + "categories": { + "list": [ + { + "label": "Cat1", + "color": "#87A9CD", + "accessible": false, + "key": 9 + }, + { + "label": "Cat2", + "color": "#5E42ED", + "accessible": false, + "key": 10 + } + ], + "maxCategoryKey": 10 + }, + "version": 17, + "venueType": "ROWS_WITHOUT_SECTIONS", + "showAllButtons": false, + "sectionScaleFactor": 100, + "subChart": { + "height": 95, + "width": 442, + "tables": [], + "texts": [], + "rows": [ + { + "label": "A", + "seatLabeling": { + "algoName": "SimpleNumbers", + "startAtIndex": 0, + "isInverted": false + }, + "objectLabeling": { + "algoName": "SimpleLettersUppercase", + "prefix": "", + "startAtIndex": 0 + }, + "seats": [ + { + "x": 151.94, + "y": 9, + "label": "1", + "categoryLabel": "Cat1", + "categoryAccessible": false, + "categoryKey": 9, + "uuid": "uuid288" + }, + { + "x": 171.94, + "y": 9, + "label": "2", + "categoryLabel": "Cat1", + "categoryAccessible": false, + "categoryKey": 9, + "uuid": "uuid289" + }, + { + "x": 191.94, + "y": 9, + "label": "3", + "categoryLabel": "Cat1", + "categoryAccessible": false, + "categoryKey": 9, + "uuid": "uuid290" + }, + { + "x": 211.94, + "y": 9, + "label": "4", + "categoryLabel": "Cat1", + "categoryAccessible": false, + "categoryKey": 9, + "uuid": "uuid291" + }, + { + "x": 231.94, + "y": 9, + "label": "5", + "categoryLabel": "Cat1", + "categoryAccessible": false, + "categoryKey": 9, + "uuid": "uuid292" + }, + { + "x": 251.94, + "y": 9, + "label": "6", + "categoryLabel": "Cat1", + "categoryAccessible": false, + "categoryKey": 9, + "uuid": "uuid293" + }, + { + "x": 271.94, + "y": 9, + "label": "7", + "categoryLabel": "Cat1", + "categoryAccessible": false, + "categoryKey": 9, + "uuid": "uuid294" + }, + { + "x": 291.94, + "y": 9, + "label": "8", + "categoryLabel": "Cat1", + "categoryAccessible": false, + "categoryKey": 9, + "uuid": "uuid295" + } + ], + "curve": 0, + "chairSpacing": 4, + "objectType": "row", + "uuid": "uuid297" + }, + { + "label": "B", + "seatLabeling": { + "algoName": "SimpleNumbers", + "startAtIndex": 0, + "isInverted": false + }, + "objectLabeling": { + "algoName": "SimpleLettersUppercase", + "prefix": "", + "startAtIndex": 0 + }, + "seats": [ + { + "x": 151.94, + "y": 33, + "label": "1", + "categoryLabel": "Cat1", + "categoryAccessible": false, + "categoryKey": 9, + "uuid": "uuid298" + }, + { + "x": 171.94, + "y": 33, + "label": "2", + "categoryLabel": "Cat1", + "categoryAccessible": false, + "categoryKey": 9, + "uuid": "uuid299" + }, + { + "x": 191.94, + "y": 33, + "label": "3", + "categoryLabel": "Cat1", + "categoryAccessible": false, + "categoryKey": 9, + "uuid": "uuid300" + }, + { + "x": 211.94, + "y": 33, + "label": "4", + "categoryLabel": "Cat1", + "categoryAccessible": false, + "categoryKey": 9, + "uuid": "uuid301" + }, + { + "x": 231.94, + "y": 33, + "label": "5", + "categoryLabel": "Cat1", + "categoryAccessible": false, + "categoryKey": 9, + "uuid": "uuid302" + }, + { + "x": 251.94, + "y": 33, + "label": "6", + "categoryLabel": "Cat1", + "categoryAccessible": false, + "categoryKey": 9, + "uuid": "uuid303" + }, + { + "x": 271.94, + "y": 33, + "label": "7", + "categoryLabel": "Cat1", + "categoryAccessible": false, + "categoryKey": 9, + "uuid": "uuid304" + }, + { + "x": 291.94, + "y": 33, + "label": "8", + "categoryLabel": "Cat1", + "categoryAccessible": false, + "categoryKey": 9, + "uuid": "uuid305" + } + ], + "curve": 0, + "chairSpacing": 4, + "objectType": "row", + "uuid": "uuid307" + }, + { + "label": "C", + "seatLabeling": { + "algoName": "SimpleNumbers", + "startAtIndex": 0, + "isInverted": false + }, + "objectLabeling": { + "algoName": "SimpleLettersUppercase", + "prefix": "", + "startAtIndex": 0 + }, + "seats": [ + { + "x": 151.94, + "y": 57, + "label": "1", + "categoryLabel": "Cat2", + "categoryAccessible": false, + "categoryKey": 10, + "uuid": "uuid308" + }, + { + "x": 171.94, + "y": 57, + "label": "2", + "categoryLabel": "Cat2", + "categoryAccessible": false, + "categoryKey": 10, + "uuid": "uuid309" + }, + { + "x": 191.94, + "y": 57, + "label": "3", + "categoryLabel": "Cat2", + "categoryAccessible": false, + "categoryKey": 10, + "uuid": "uuid310" + }, + { + "x": 211.94, + "y": 57, + "label": "4", + "categoryLabel": "Cat2", + "categoryAccessible": false, + "categoryKey": 10, + "uuid": "uuid311" + }, + { + "x": 231.94, + "y": 57, + "label": "5", + "categoryLabel": "Cat2", + "categoryAccessible": false, + "categoryKey": 10, + "uuid": "uuid312" + }, + { + "x": 251.94, + "y": 57, + "label": "6", + "categoryLabel": "Cat2", + "categoryAccessible": false, + "categoryKey": 10, + "uuid": "uuid313" + }, + { + "x": 271.94, + "y": 57, + "label": "7", + "categoryLabel": "Cat2", + "categoryAccessible": false, + "categoryKey": 10, + "uuid": "uuid314" + }, + { + "x": 291.94, + "y": 57, + "label": "8", + "categoryLabel": "Cat2", + "categoryAccessible": false, + "categoryKey": 10, + "uuid": "uuid315" + } + ], + "curve": 0, + "chairSpacing": 4, + "objectType": "row", + "uuid": "uuid317" + }, + { + "label": "D", + "seatLabeling": { + "algoName": "SimpleNumbers", + "startAtIndex": 0, + "isInverted": false + }, + "objectLabeling": { + "algoName": "SimpleLettersUppercase", + "prefix": "", + "startAtIndex": 0 + }, + "seats": [ + { + "x": 151.94, + "y": 81, + "label": "1", + "categoryLabel": "Cat2", + "categoryAccessible": false, + "categoryKey": 10, + "uuid": "uuid318" + }, + { + "x": 171.94, + "y": 81, + "label": "2", + "categoryLabel": "Cat2", + "categoryAccessible": false, + "categoryKey": 10, + "uuid": "uuid319" + }, + { + "x": 191.94, + "y": 81, + "label": "3", + "categoryLabel": "Cat2", + "categoryAccessible": false, + "categoryKey": 10, + "uuid": "uuid320" + }, + { + "x": 211.94, + "y": 81, + "label": "4", + "categoryLabel": "Cat2", + "categoryAccessible": false, + "categoryKey": 10, + "uuid": "uuid321" + }, + { + "x": 231.94, + "y": 81, + "label": "5", + "categoryLabel": "Cat2", + "categoryAccessible": false, + "categoryKey": 10, + "uuid": "uuid322" + }, + { + "x": 251.94, + "y": 81, + "label": "6", + "categoryLabel": "Cat2", + "categoryAccessible": false, + "categoryKey": 10, + "uuid": "uuid323" + }, + { + "x": 271.94, + "y": 81, + "label": "7", + "categoryLabel": "Cat2", + "categoryAccessible": false, + "categoryKey": 10, + "uuid": "uuid324" + }, + { + "x": 291.94, + "y": 81, + "label": "8", + "categoryLabel": "Cat2", + "categoryAccessible": false, + "categoryKey": 10, + "uuid": "uuid325" + } + ], + "curve": 0, + "chairSpacing": 4, + "objectType": "row", + "uuid": "uuid327" + } + ], + "shapes": [], + "booths": [], + "generalAdmissionAreas": [ + { + "categoryLabel": "Cat1", + "categoryKey": 9, + "capacity": 100, + "label": "GA1", + "labelSize": 24, + "labelShown": true, + "labelHorizontalOffset": 0, + "labelVerticalOffset": 0, + "objectType": "generalAdmission", + "uuid": "uuid368", + "type": "circle", + "center": { + "x": 53.22, + "y": 48.89 + }, + "rotationAngle": 0, + "radius1": 52.222222222222626, + "radius2": 45.55555555555566 + }, + { + "categoryLabel": "Cat2", + "categoryKey": 10, + "capacity": 100, + "label": "34", + "labelSize": 24, + "labelShown": true, + "labelHorizontalOffset": 0, + "labelVerticalOffset": 0, + "objectType": "generalAdmission", + "uuid": "uuid369", + "type": "circle", + "center": { + "x": 389.22, + "y": 48.89 + }, + "rotationAngle": 0, + "radius1": 52.222222222222626, + "radius2": 45.55555555555566 + } + ], + "sections": [], + "focalPoint": { + "x": 223.89, + "y": 42.67 + }, + "snapOffset": { + "x": 0.06, + "y": 3 + } + } +} \ No newline at end of file diff --git a/SeatsioDotNet.Test/resources/sampleChartWithSections.json b/SeatsioDotNet.Test/resources/sampleChartWithSections.json new file mode 100644 index 0000000..e24a85a --- /dev/null +++ b/SeatsioDotNet.Test/resources/sampleChartWithSections.json @@ -0,0 +1,1021 @@ +{ + "name": "Sample chart with sections", + "tablesLabelCounter": 1, + "uuidCounter": 101, + "categories": { + "list": [ + { + "label": "cat1", + "color": "#AEDB54", + "accessible": false, + "key": 1 + }, + { + "label": "cat2", + "color": "#AFCA54", + "accessible": false, + "key": 4 + } + ], + "maxCategoryKey": 11 + }, + "rowSpacing": 8, + "version": 17, + "venueType": "ROWS_WITH_SECTIONS", + "sectionScaleFactor": 100, + "subChart": { + "height": 276, + "width": 303, + "tables": [], + "texts": [], + "rows": [], + "shapes": [], + "booths": [], + "generalAdmissionAreas": [], + "sections": [ + { + "points": [ + { + "x": 0.75, + "y": 0.75 + }, + { + "x": 0.75, + "y": 240.75 + }, + { + "x": 132.75, + "y": 240.75 + }, + { + "x": 132.75, + "y": 0.75 + } + ], + "label": "Section A", + "labelSize": 12, + "labelHorizontalOffset": 0, + "labelVerticalOffset": 0, + "labelRotationAngle": 0, + "uuid": "uuid2", + "categoryLabel": "cat1", + "categoryKey": 1, + "topLeft": { + "x": 0, + "y": 0 + }, + "entrance": "Entrance 1", + "viewFromYourSeatImage": null, + "subChart": { + "height": 242, + "width": 134, + "tables": [], + "texts": [], + "rows": [ + { + "label": "A", + "seatLabeling": { + "algoName": "SimpleNumbers", + "startAtIndex": null, + "isInverted": null + }, + "objectLabeling": { + "algoName": "SimpleLettersUppercase", + "prefix": null, + "startAtIndex": null + }, + "seats": [ + { + "x": 18.25, + "y": 41.25, + "label": "1", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid5" + }, + { + "x": 38.25, + "y": 41.25, + "label": "2", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid6" + }, + { + "x": 58.25, + "y": 41.25, + "label": "3", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid7" + }, + { + "x": 78.25, + "y": 41.25, + "label": "4", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid8" + }, + { + "x": 98.25, + "y": 41.25, + "label": "5", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid9" + }, + { + "x": 118.25, + "y": 41.25, + "label": "6", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid10" + } + ], + "curve": 0, + "chairSpacing": 4, + "objectType": "row", + "uuid": "uuid12" + }, + { + "label": "B", + "seatLabeling": { + "algoName": "SimpleNumbers", + "startAtIndex": null, + "isInverted": null + }, + "objectLabeling": { + "algoName": "SimpleLettersUppercase", + "prefix": null, + "startAtIndex": null + }, + "seats": [ + { + "x": 18.25, + "y": 65.25, + "label": "1", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid13" + }, + { + "x": 38.25, + "y": 65.25, + "label": "2", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid14" + }, + { + "x": 58.25, + "y": 65.25, + "label": "3", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid15" + }, + { + "x": 78.25, + "y": 65.25, + "label": "4", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid16" + }, + { + "x": 98.25, + "y": 65.25, + "label": "5", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid17" + }, + { + "x": 118.25, + "y": 65.25, + "label": "6", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid18" + } + ], + "curve": 0, + "chairSpacing": 4, + "objectType": "row", + "uuid": "uuid20" + }, + { + "label": "C", + "seatLabeling": { + "algoName": "SimpleNumbers", + "startAtIndex": null, + "isInverted": null + }, + "objectLabeling": { + "algoName": "SimpleLettersUppercase", + "prefix": null, + "startAtIndex": null + }, + "seats": [ + { + "x": 18.25, + "y": 89.25, + "label": "1", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid21" + }, + { + "x": 38.25, + "y": 89.25, + "label": "2", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid22" + }, + { + "x": 58.25, + "y": 89.25, + "label": "3", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid23" + }, + { + "x": 78.25, + "y": 89.25, + "label": "4", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid24" + }, + { + "x": 98.25, + "y": 89.25, + "label": "5", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid25" + }, + { + "x": 118.25, + "y": 89.25, + "label": "6", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid26" + } + ], + "curve": 0, + "chairSpacing": 4, + "objectType": "row", + "uuid": "uuid28" + }, + { + "label": "D", + "seatLabeling": { + "algoName": "SimpleNumbers", + "startAtIndex": null, + "isInverted": null + }, + "objectLabeling": { + "algoName": "SimpleLettersUppercase", + "prefix": null, + "startAtIndex": null + }, + "seats": [ + { + "x": 18.25, + "y": 113.25, + "label": "1", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid29" + }, + { + "x": 38.25, + "y": 113.25, + "label": "2", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid30" + }, + { + "x": 58.25, + "y": 113.25, + "label": "3", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid31" + }, + { + "x": 78.25, + "y": 113.25, + "label": "4", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid32" + }, + { + "x": 98.25, + "y": 113.25, + "label": "5", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid33" + }, + { + "x": 118.25, + "y": 113.25, + "label": "6", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid34" + } + ], + "curve": 0, + "chairSpacing": 4, + "objectType": "row", + "uuid": "uuid36" + }, + { + "label": "E", + "seatLabeling": { + "algoName": "SimpleNumbers", + "startAtIndex": null, + "isInverted": null + }, + "objectLabeling": { + "algoName": "SimpleLettersUppercase", + "prefix": null, + "startAtIndex": null + }, + "seats": [ + { + "x": 18.25, + "y": 137.25, + "label": "1", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid37" + }, + { + "x": 38.25, + "y": 137.25, + "label": "2", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid38" + }, + { + "x": 58.25, + "y": 137.25, + "label": "3", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid39" + }, + { + "x": 78.25, + "y": 137.25, + "label": "4", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid40" + }, + { + "x": 98.25, + "y": 137.25, + "label": "5", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid41" + }, + { + "x": 118.25, + "y": 137.25, + "label": "6", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid42" + } + ], + "curve": 0, + "chairSpacing": 4, + "objectType": "row", + "uuid": "uuid44" + }, + { + "label": "F", + "seatLabeling": { + "algoName": "SimpleNumbers", + "startAtIndex": null, + "isInverted": null + }, + "objectLabeling": { + "algoName": "SimpleLettersUppercase", + "prefix": null, + "startAtIndex": null + }, + "seats": [ + { + "x": 18.25, + "y": 161.25, + "label": "1", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid45" + }, + { + "x": 38.25, + "y": 161.25, + "label": "2", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid46" + }, + { + "x": 58.25, + "y": 161.25, + "label": "3", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid47" + }, + { + "x": 78.25, + "y": 161.25, + "label": "4", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid48" + }, + { + "x": 98.25, + "y": 161.25, + "label": "5", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid49" + }, + { + "x": 118.25, + "y": 161.25, + "label": "6", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid50" + } + ], + "curve": 0, + "chairSpacing": 4, + "objectType": "row", + "uuid": "uuid52" + } + ], + "shapes": [], + "booths": [], + "generalAdmissionAreas": [] + } + }, + { + "points": [ + { + "x": 190.69, + "y": 0.75 + }, + { + "x": 190.69, + "y": 240.75 + }, + { + "x": 302.69, + "y": 240.75 + }, + { + "x": 302.69, + "y": 0.75 + } + ], + "label": "Section B", + "labelSize": 12, + "labelHorizontalOffset": 0, + "labelVerticalOffset": 0, + "labelRotationAngle": 0, + "uuid": "uuid4", + "categoryLabel": "cat2", + "categoryKey": 4, + "topLeft": { + "x": 189.94, + "y": 0 + }, + "entrance": "Entrance 2", + "viewFromYourSeatImage": null, + "subChart": { + "height": 242, + "width": 114, + "tables": [], + "texts": [], + "rows": [ + { + "label": "A", + "seatLabeling": { + "algoName": "SimpleNumbers", + "startAtIndex": null, + "isInverted": null + }, + "objectLabeling": { + "algoName": "SimpleLettersUppercase", + "prefix": null, + "startAtIndex": null + }, + "seats": [ + { + "x": 16.25, + "y": 45.25, + "label": "1", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid53" + }, + { + "x": 36.25, + "y": 45.25, + "label": "2", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid54" + }, + { + "x": 56.25, + "y": 45.25, + "label": "3", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid55" + }, + { + "x": 76.25, + "y": 45.25, + "label": "4", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid56" + }, + { + "x": 96.25, + "y": 45.25, + "label": "5", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid57" + } + ], + "curve": 0, + "chairSpacing": 4, + "objectType": "row", + "uuid": "uuid59" + }, + { + "label": "B", + "seatLabeling": { + "algoName": "SimpleNumbers", + "startAtIndex": null, + "isInverted": null + }, + "objectLabeling": { + "algoName": "SimpleLettersUppercase", + "prefix": null, + "startAtIndex": null + }, + "seats": [ + { + "x": 16.25, + "y": 69.25, + "label": "1", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid60" + }, + { + "x": 36.25, + "y": 69.25, + "label": "2", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid61" + }, + { + "x": 56.25, + "y": 69.25, + "label": "3", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid62" + }, + { + "x": 76.25, + "y": 69.25, + "label": "4", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid63" + }, + { + "x": 96.25, + "y": 69.25, + "label": "5", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid64" + } + ], + "curve": 0, + "chairSpacing": 4, + "objectType": "row", + "uuid": "uuid66" + }, + { + "label": "C", + "seatLabeling": { + "algoName": "SimpleNumbers", + "startAtIndex": null, + "isInverted": null + }, + "objectLabeling": { + "algoName": "SimpleLettersUppercase", + "prefix": null, + "startAtIndex": null + }, + "seats": [ + { + "x": 16.25, + "y": 93.25, + "label": "1", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid67" + }, + { + "x": 36.25, + "y": 93.25, + "label": "2", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid68" + }, + { + "x": 56.25, + "y": 93.25, + "label": "3", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid69" + }, + { + "x": 76.25, + "y": 93.25, + "label": "4", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid70" + }, + { + "x": 96.25, + "y": 93.25, + "label": "5", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid71" + } + ], + "curve": 0, + "chairSpacing": 4, + "objectType": "row", + "uuid": "uuid73" + }, + { + "label": "D", + "seatLabeling": { + "algoName": "SimpleNumbers", + "startAtIndex": null, + "isInverted": null + }, + "objectLabeling": { + "algoName": "SimpleLettersUppercase", + "prefix": null, + "startAtIndex": null + }, + "seats": [ + { + "x": 16.25, + "y": 117.25, + "label": "1", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid74" + }, + { + "x": 36.25, + "y": 117.25, + "label": "2", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid75" + }, + { + "x": 56.25, + "y": 117.25, + "label": "3", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid76" + }, + { + "x": 76.25, + "y": 117.25, + "label": "4", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid77" + }, + { + "x": 96.25, + "y": 117.25, + "label": "5", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid78" + } + ], + "curve": 0, + "chairSpacing": 4, + "objectType": "row", + "uuid": "uuid80" + }, + { + "label": "E", + "seatLabeling": { + "algoName": "SimpleNumbers", + "startAtIndex": null, + "isInverted": null + }, + "objectLabeling": { + "algoName": "SimpleLettersUppercase", + "prefix": null, + "startAtIndex": null + }, + "seats": [ + { + "x": 16.25, + "y": 141.25, + "label": "1", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid81" + }, + { + "x": 36.25, + "y": 141.25, + "label": "2", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid82" + }, + { + "x": 56.25, + "y": 141.25, + "label": "3", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid83" + }, + { + "x": 76.25, + "y": 141.25, + "label": "4", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid84" + }, + { + "x": 96.25, + "y": 141.25, + "label": "5", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid85" + } + ], + "curve": 0, + "chairSpacing": 4, + "objectType": "row", + "uuid": "uuid87" + }, + { + "label": "F", + "seatLabeling": { + "algoName": "SimpleNumbers", + "startAtIndex": null, + "isInverted": null + }, + "objectLabeling": { + "algoName": "SimpleLettersUppercase", + "prefix": null, + "startAtIndex": null + }, + "seats": [ + { + "x": 16.25, + "y": 165.25, + "label": "1", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid88" + }, + { + "x": 36.25, + "y": 165.25, + "label": "2", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid89" + }, + { + "x": 56.25, + "y": 165.25, + "label": "3", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid90" + }, + { + "x": 76.25, + "y": 165.25, + "label": "4", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid91" + }, + { + "x": 96.25, + "y": 165.25, + "label": "5", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid92" + } + ], + "curve": 0, + "chairSpacing": 4, + "objectType": "row", + "uuid": "uuid94" + }, + { + "label": "G", + "seatLabeling": { + "algoName": "SimpleNumbers", + "startAtIndex": null, + "isInverted": null + }, + "objectLabeling": { + "algoName": "SimpleLettersUppercase", + "prefix": null, + "startAtIndex": null + }, + "seats": [ + { + "x": 16.25, + "y": 189.25, + "label": "1", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid95" + }, + { + "x": 36.25, + "y": 189.25, + "label": "2", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid96" + }, + { + "x": 56.25, + "y": 189.25, + "label": "3", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid97" + }, + { + "x": 76.25, + "y": 189.25, + "label": "4", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid98" + }, + { + "x": 96.25, + "y": 189.25, + "label": "5", + "categoryLabel": null, + "categoryAccessible": null, + "categoryKey": null, + "uuid": "uuid99" + } + ], + "curve": 0, + "chairSpacing": 4, + "objectType": "row", + "uuid": "uuid101" + } + ], + "shapes": [], + "booths": [], + "generalAdmissionAreas": [] + } + } + ], + "focalPoint": null, + "backgroundImage": null, + "referenceChart": null, + "snapOffset": { + "x": 3.25, + "y": 3.25 + } + } +} \ No newline at end of file diff --git a/SeatsioDotNet.Test/resources/sampleChartWithTables.json b/SeatsioDotNet.Test/resources/sampleChartWithTables.json new file mode 100644 index 0000000..d72b1eb --- /dev/null +++ b/SeatsioDotNet.Test/resources/sampleChartWithTables.json @@ -0,0 +1,206 @@ +{ + "name": "Sample chart", + "tablesLabelCounter": 3, + "uuidCounter": 369, + "categories": { + "list": [ + { + "label": "Cat1", + "color": "#87A9CD", + "accessible": false, + "key": 9 + }, + { + "label": "Cat2", + "color": "#5E42ED", + "accessible": false, + "key": 10 + } + ], + "maxCategoryKey": 10 + }, + "version": 17, + "venueType": "ROWS_WITHOUT_SECTIONS", + "showAllButtons": false, + "sectionScaleFactor": 100, + "subChart": { + "height": 95, + "width": 442, + "tables": [ + { + "center": { + "x": 35.74, + "y": 39.87 + }, + "radius": 23.8732414637843, + "autoRadius": true, + "seats": [ + { + "x": 35.74, + "y": 70.75, + "label": "1", + "categoryLabel": "Cat1", + "categoryAccessible": null, + "categoryKey": 9, + "uuid": "uuid9" + }, + { + "x": 9, + "y": 55.31, + "label": "2", + "categoryLabel": "Cat1", + "categoryAccessible": null, + "categoryKey": 9, + "uuid": "uuid10" + }, + { + "x": 9, + "y": 24.44, + "label": "3", + "categoryLabel": "Cat1", + "categoryAccessible": null, + "categoryKey": 9, + "uuid": "uuid11" + }, + { + "x": 35.74, + "y": 9, + "label": "4", + "categoryLabel": "Cat1", + "categoryAccessible": null, + "categoryKey": 9, + "uuid": "uuid12" + }, + { + "x": 62.47, + "y": 24.44, + "label": "5", + "categoryLabel": "Cat1", + "categoryAccessible": null, + "categoryKey": 9, + "uuid": "uuid13" + }, + { + "x": 62.47, + "y": 55.31, + "label": "6", + "categoryLabel": "Cat1", + "categoryAccessible": null, + "categoryKey": 9, + "uuid": "uuid14" + } + ], + "rotationAngle": 0, + "openSpaces": 0, + "label": "T1", + "seatLabeling": { + "algoName": "SimpleNumbers", + "startAtIndex": 0, + "isInverted": false + }, + "objectLabeling": { + "algoName": "SimpleNumbers", + "prefix": "T", + "startAtIndex": 0 + }, + "type": "round", + "objectType": "table", + "uuid": "uuid8" + }, + { + "center": { + "x": 35.74, + "y": 39.87 + }, + "radius": 23.8732414637843, + "autoRadius": true, + "seats": [ + { + "x": 35.74, + "y": 70.75, + "label": "1", + "categoryLabel": "Cat1", + "categoryAccessible": null, + "categoryKey": 9, + "uuid": "uuid934" + }, + { + "x": 9, + "y": 55.31, + "label": "2", + "categoryLabel": "Cat1", + "categoryAccessible": null, + "categoryKey": 9, + "uuid": "uuid1043" + }, + { + "x": 9, + "y": 24.44, + "label": "3", + "categoryLabel": "Cat1", + "categoryAccessible": null, + "categoryKey": 9, + "uuid": "uuid11342" + }, + { + "x": 35.74, + "y": 9, + "label": "4", + "categoryLabel": "Cat1", + "categoryAccessible": null, + "categoryKey": 9, + "uuid": "uuid12432" + }, + { + "x": 62.47, + "y": 24.44, + "label": "5", + "categoryLabel": "Cat1", + "categoryAccessible": null, + "categoryKey": 9, + "uuid": "uuid1334" + }, + { + "x": 62.47, + "y": 55.31, + "label": "6", + "categoryLabel": "Cat1", + "categoryAccessible": null, + "categoryKey": 9, + "uuid": "uuid1432" + } + ], + "rotationAngle": 0, + "openSpaces": 0, + "label": "T2", + "seatLabeling": { + "algoName": "SimpleNumbers", + "startAtIndex": 0, + "isInverted": false + }, + "objectLabeling": { + "algoName": "SimpleNumbers", + "prefix": "T", + "startAtIndex": 0 + }, + "type": "round", + "objectType": "table", + "uuid": "uuid88989" + } + ], + "texts": [], + "rows": [], + "shapes": [], + "booths": [], + "generalAdmissionAreas": [], + "sections": [], + "focalPoint": { + "x": 223.89, + "y": 42.67 + }, + "snapOffset": { + "x": 0.06, + "y": 3 + } + } +} \ No newline at end of file diff --git a/SeatsioDotNet/Events/Event.cs b/SeatsioDotNet/Events/Event.cs index ede0147..df2ace2 100644 --- a/SeatsioDotNet/Events/Event.cs +++ b/SeatsioDotNet/Events/Event.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; namespace SeatsioDotNet.Events { @@ -8,10 +9,10 @@ public class Event public string Key { get; set; } public string ChartKey { get; set; } public bool BookWholeTables { get; set; } + public Dictionary TableBookingModes { get; set; } public bool SupportsBestAvailable { get; set; } public ForSaleConfig ForSaleConfig { get; set; } public DateTime? CreatedOn { get; set; } public DateTime? UpdatedOn { get; set; } } - } \ No newline at end of file diff --git a/SeatsioDotNet/Events/Events.cs b/SeatsioDotNet/Events/Events.cs index c436957..287ef55 100644 --- a/SeatsioDotNet/Events/Events.cs +++ b/SeatsioDotNet/Events/Events.cs @@ -18,10 +18,25 @@ public Events(RestClient restClient) public Event Create(string chartKey) { - return Create(chartKey, null, null); + return Create(chartKey, null, null, null); + } + + public Event Create(string chartKey, string eventKey) + { + return Create(chartKey, eventKey, null, null); } public Event Create(string chartKey, string eventKey, bool? bookWholeTables) + { + return Create(chartKey, eventKey, bookWholeTables, null); + } + + public Event Create(string chartKey, string eventKey, Dictionary tableBookingModes) + { + return Create(chartKey, eventKey, null, tableBookingModes); + } + + private Event Create(string chartKey, string eventKey, bool? bookWholeTables, Dictionary tableBookingModes) { Dictionary requestBody = new Dictionary(); requestBody.Add("chartKey", chartKey); @@ -36,12 +51,32 @@ public Event Create(string chartKey, string eventKey, bool? bookWholeTables) requestBody.Add("bookWholeTables", bookWholeTables); } + if (tableBookingModes != null) + { + requestBody.Add("tableBookingModes", tableBookingModes); + } + var restRequest = new RestRequest("/events", Method.POST) .AddJsonBody(requestBody); return AssertOk(_restClient.Execute(restRequest)); } + public void Update(string eventKey, string chartKey, string newEventKey) + { + Update(eventKey, chartKey, newEventKey, null, null); + } + public void Update(string eventKey, string chartKey, string newEventKey, bool? bookWholeTables) + { + Update(eventKey, chartKey, newEventKey, bookWholeTables, null); + } + + public void Update(string eventKey, string chartKey, string newEventKey, Dictionary tableBookingModes) + { + Update(eventKey, chartKey, newEventKey, null, tableBookingModes); + } + + private void Update(string eventKey, string chartKey, string newEventKey, bool? bookWholeTables, Dictionary tableBookingModes) { Dictionary requestBody = new Dictionary(); @@ -60,6 +95,11 @@ public void Update(string eventKey, string chartKey, string newEventKey, bool? b requestBody.Add("bookWholeTables", bookWholeTables); } + if (tableBookingModes != null) + { + requestBody.Add("tableBookingModes", tableBookingModes); + } + var restRequest = new RestRequest("/events/{key}", Method.POST) .AddUrlSegment("key", eventKey) .AddJsonBody(requestBody); diff --git a/SeatsioDotNet/SeatsioDotNet.csproj b/SeatsioDotNet/SeatsioDotNet.csproj index d3ebdc2..ccbe1c1 100644 --- a/SeatsioDotNet/SeatsioDotNet.csproj +++ b/SeatsioDotNet/SeatsioDotNet.csproj @@ -2,7 +2,7 @@ Library true - 45 + 46 mroloux;bverbeken Official Seats.io .NET API client Official Seats.io .NET API client