seatsio 69.0.0 → 69.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "seatsio",
3
- "version": "69.0.0",
3
+ "version": "69.1.0",
4
4
  "main": "index.js",
5
5
  "description": "Official JavaScript and Node.JS client library for the Seats.io REST API",
6
6
  "license": "MIT",
@@ -19,6 +19,7 @@ class ChartObjectInfo {
19
19
  this.leftNeighbour = chartReport.leftNeighbour
20
20
  this.rightNeighbour = chartReport.rightNeighbour
21
21
  this.distanceToFocalPoint = chartReport.distanceToFocalPoint
22
+ this.numSeats = chartReport.numSeats
22
23
  }
23
24
  }
24
25
 
@@ -37,6 +37,7 @@ class EventObjectInfo {
37
37
  this.channel = report.channel
38
38
  this.distanceToFocalPoint = report.distanceToFocalPoint
39
39
  this.holds = report.holds
40
+ this.numSeats = report.numSeats
40
41
  }
41
42
  }
42
43
 
@@ -1,12 +1,12 @@
1
1
  const ChartObjectInfo = require('../Charts/ChartObjectInfo.js')
2
- const ObjectInfo = require('../Events/EventObjectInfo.js')
2
+ const EventObjectInfo = require('../Events/EventObjectInfo.js')
3
3
 
4
4
  module.exports = {
5
5
 
6
6
  createChangeObjectStatusDetails (data) {
7
7
  const objectDetails = {}
8
8
  for (const key in data) {
9
- objectDetails[key] = new ObjectInfo(data[key])
9
+ objectDetails[key] = new EventObjectInfo(data[key])
10
10
  }
11
11
  return objectDetails
12
12
  },
@@ -18,7 +18,7 @@ module.exports = {
18
18
  createEventReport (reportsData) {
19
19
  const reportObjects = {}
20
20
  for (const key of Object.keys(reportsData)) {
21
- reportObjects[key] = reportsData[key].map(data => new ObjectInfo(data))
21
+ reportObjects[key] = reportsData[key].map(data => new EventObjectInfo(data))
22
22
  }
23
23
  return reportObjects
24
24
  },
@@ -36,6 +36,18 @@ test('chart report properties for GA', async () => {
36
36
  expect(reportItem.bookAsAWhole).toBe(false)
37
37
  })
38
38
 
39
+ test('chart report properties for table', async () => {
40
+ const { client, user } = await testUtils.createTestUserAndClient()
41
+ const chartKey = testUtils.getChartKey()
42
+ await testUtils.createTestChartWithTables(chartKey, user.secretKey)
43
+
44
+ const report = await client.chartReports.byLabel(chartKey, 'true')
45
+
46
+ const reportItem = report.T1[0]
47
+ expect(reportItem.numSeats).toBe(6)
48
+ expect(reportItem.bookAsAWhole).toBe(false)
49
+ })
50
+
39
51
  test('get report byLabel', async () => {
40
52
  const { client, user } = await testUtils.createTestUserAndClient()
41
53
  const chartKey = testUtils.getChartKey()
@@ -2,6 +2,7 @@ const testUtils = require('../testUtils.js')
2
2
  const EventObjectInfo = require('../../src/Events/EventObjectInfo.js')
3
3
  const ObjectProperties = require('../../src/Events/ObjectProperties.js')
4
4
  const { IDs } = require('../../src/Common/IDs')
5
+ const { TableBookingconfig } = require('../../index')
5
6
 
6
7
  test('report properties', async () => {
7
8
  const { client, user } = await testUtils.createTestUserAndClient()
@@ -82,6 +83,19 @@ test('report properties for GA', async () => {
82
83
  expect(reportItem.bookAsAWhole).toBe(false)
83
84
  })
84
85
 
86
+ test('report properties for table', async () => {
87
+ const { client, user } = await testUtils.createTestUserAndClient()
88
+ const chartKey = testUtils.getChartKey()
89
+ await testUtils.createTestChartWithTables(chartKey, user.secretKey)
90
+ const event = await client.events.create(chartKey, null, TableBookingconfig.allByTable())
91
+
92
+ const report = await client.eventReports.byLabel(event.key)
93
+
94
+ const reportItem = report.T1[0]
95
+ expect(reportItem.numSeats).toBe(6)
96
+ expect(reportItem.bookAsAWhole).toBe(false)
97
+ })
98
+
85
99
  test('report with object status', async () => {
86
100
  const { client, user } = await testUtils.createTestUserAndClient()
87
101
  const chartKey = testUtils.getChartKey()