diff --git a/SeatsioDotNet.Test/Events/ChangeObjectStatusForMultipleEventsTest.cs b/SeatsioDotNet.Test/Events/ChangeObjectStatusForMultipleEventsTest.cs index e36180b..de9ee67 100644 --- a/SeatsioDotNet.Test/Events/ChangeObjectStatusForMultipleEventsTest.cs +++ b/SeatsioDotNet.Test/Events/ChangeObjectStatusForMultipleEventsTest.cs @@ -36,6 +36,21 @@ public async Task Book() Assert.Equal(EventObjectInfo.Booked, (await Client.Events.RetrieveObjectInfoAsync(event2.Key, "A-1")).Status); Assert.Equal(EventObjectInfo.Booked, (await Client.Events.RetrieveObjectInfoAsync(event2.Key, "A-2")).Status); } + + [Fact] + public async Task PutUpForResale() + { + var chartKey = CreateTestChart(); + var event1 = await Client.Events.CreateAsync(chartKey); + var event2 = await Client.Events.CreateAsync(chartKey); + + await Client.Events.PutUpForResaleAsync(new[] {event1.Key, event2.Key}, new[] {"A-1", "A-2"}); + + Assert.Equal(EventObjectInfo.Resale, (await Client.Events.RetrieveObjectInfoAsync(event1.Key, "A-1")).Status); + Assert.Equal(EventObjectInfo.Resale, (await Client.Events.RetrieveObjectInfoAsync(event1.Key, "A-2")).Status); + Assert.Equal(EventObjectInfo.Resale, (await Client.Events.RetrieveObjectInfoAsync(event2.Key, "A-1")).Status); + Assert.Equal(EventObjectInfo.Resale, (await Client.Events.RetrieveObjectInfoAsync(event2.Key, "A-2")).Status); + } [Fact] public async Task Hold() diff --git a/SeatsioDotNet.Test/Events/PutObjectsUpForResaleTest.cs b/SeatsioDotNet.Test/Events/PutObjectsUpForResaleTest.cs new file mode 100644 index 0000000..4ff80df --- /dev/null +++ b/SeatsioDotNet.Test/Events/PutObjectsUpForResaleTest.cs @@ -0,0 +1,26 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using FluentAssertions; +using SeatsioDotNet.EventReports; +using SeatsioDotNet.Events; +using SeatsioDotNet.HoldTokens; +using Xunit; + +namespace SeatsioDotNet.Test.Events; + +public class PutObjectsUpForResale : SeatsioClientTest +{ + [Fact] + public async Task Test() + { + var chartKey = CreateTestChart(); + var evnt = await Client.Events.CreateAsync(chartKey); + + var result = await Client.Events.PutUpForResaleAsync(evnt.Key, new[] {"A-1", "A-2"}); + + Assert.Equal(EventObjectInfo.Resale, (await Client.Events.RetrieveObjectInfoAsync(evnt.Key, "A-1")).Status); + Assert.Equal(EventObjectInfo.Resale, (await Client.Events.RetrieveObjectInfoAsync(evnt.Key, "A-2")).Status); + Assert.Equal(EventObjectInfo.Free, (await Client.Events.RetrieveObjectInfoAsync(evnt.Key, "A-3")).Status); + CustomAssert.ContainsOnly(new[] {"A-1", "A-2"}, result.Objects.Keys); + } +} \ No newline at end of file diff --git a/SeatsioDotNet/Events/EventObjectInfo.cs b/SeatsioDotNet/Events/EventObjectInfo.cs index b1869d2..0043ca7 100644 --- a/SeatsioDotNet/Events/EventObjectInfo.cs +++ b/SeatsioDotNet/Events/EventObjectInfo.cs @@ -15,6 +15,7 @@ public class EventObjectInfo public const string Free = "free"; public const string Booked = "booked"; public const string Held = "reservedByToken"; + public const string Resale = "resale"; public string Label { get; set; } public Labels Labels { get; set; } diff --git a/SeatsioDotNet/Events/Events.cs b/SeatsioDotNet/Events/Events.cs index 1d089b4..e378af7 100644 --- a/SeatsioDotNet/Events/Events.cs +++ b/SeatsioDotNet/Events/Events.cs @@ -251,6 +251,16 @@ public async Task BookAsync(string eventKey, BestAvailable keepExtraData, ignoreChannels, channelKeys, cancellationToken); } + public async Task PutUpForResaleAsync(string eventKey, IEnumerable objects) + { + return await ChangeObjectStatusAsync(eventKey, objects, EventObjectInfo.Resale, null); + } + + public async Task PutUpForResaleAsync(string[] eventKeys, IEnumerable objects) + { + return await ChangeObjectStatusAsync(eventKeys, objects, EventObjectInfo.Resale, null); + } + public async Task ReleaseAsync(string eventKey, IEnumerable objects, string holdToken = null, string orderId = null, bool? keepExtraData = null, bool? ignoreChannels = null, string[] channelKeys = null, CancellationToken cancellationToken = default) {