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,12 +1,12 @@
|
|
|
1
1
|
const ChartObjectInfo = require('../Charts/ChartObjectInfo.js')
|
|
2
|
-
const
|
|
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
|
|
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
|
|
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()
|