Skip to content

Commit

Permalink
Expose numNotForSale in EventObjectInfo (#184)
Browse files Browse the repository at this point in the history
Co-authored-by: Steve Chaloner <[email protected]>
  • Loading branch information
schaloner and Steve Chaloner authored Jun 7, 2024
1 parent da1d592 commit 00f4414
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/seatsio/events/EventObjectInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public class EventObjectInfo extends ValueObject {
public Integer numFree;
public Integer numHeld;
public Integer numSeats;
public Integer numNotForSale;
public Map<?, ?> extraData;
public Boolean isAccessible;
public Boolean isCompanionSeat;
Expand Down
13 changes: 13 additions & 0 deletions src/test/java/seatsio/events/MarkObjectsAsNotForSaleTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import org.junit.jupiter.api.Test;
import seatsio.SeatsioClientTest;

import java.util.Map;

import static com.google.common.collect.Lists.newArrayList;
import static org.assertj.core.api.Assertions.assertThat;

Expand Down Expand Up @@ -64,4 +66,15 @@ public void categories() {
assertThat(retrievedEvent.forSaleConfig.areaPlaces).isEmpty();
assertThat(retrievedEvent.forSaleConfig.categories).containsExactly("cat1", "cat2");
}

@Test
public void numNotForSale() {
String chartKey = createTestChart();
Event event = client.events.create(chartKey);

client.events.markAsNotForSale(event.key, null, Map.of("GA1", 5), null);

EventObjectInfo status = client.events.retrieveObjectInfo(event.key, "GA1");
assertThat(status.numNotForSale).isEqualTo(5);
}
}
1 change: 1 addition & 0 deletions src/test/java/seatsio/reports/events/EventReportsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ public void reportItemPropertiesForGA() {
assertThat(reportItem.numBooked).isEqualTo(5);
assertThat(reportItem.numFree).isEqualTo(92);
assertThat(reportItem.numHeld).isEqualTo(3);
assertThat(reportItem.numNotForSale).isEqualTo(0);
assertThat(reportItem.capacity).isEqualTo(100);
assertThat(reportItem.objectType).isEqualTo("generalAdmission");
assertThat(reportItem.bookAsAWhole).isEqualTo(false);
Expand Down

0 comments on commit 00f4414

Please sign in to comment.