@tillhub/schemas 6.390.0 → 6.392.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/CHANGELOG.md +23 -0
- package/lib/v1/table_layout/available_tables.js +6 -6
- package/lib/v1/table_layout/base.js +11 -39
- package/lib/v1/table_layout/combination_schema.js +32 -0
- package/lib/v1/table_layout/create.js +9 -3
- package/lib/v1/table_layout/index.js +1 -0
- package/lib/v1/table_layout/layout_schema.js +124 -0
- package/lib/v1/table_layout/read.js +60 -10
- package/package.json +3 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
# [6.392.0](https://github.com/tillhub/schemas/compare/v6.391.0...v6.392.0) (2025-06-19)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **UNTIL-14137:** fixing linting ([73e4c7b](https://github.com/tillhub/schemas/commit/73e4c7b))
|
|
7
|
+
* **UNTIL-14137:** upgrading circleci pipeline to work with service account ([1ab0798](https://github.com/tillhub/schemas/commit/1ab0798))
|
|
8
|
+
|
|
9
|
+
# [6.391.0](https://github.com/tillhub/schemas/compare/v6.390.1...v6.391.0) (2025-06-18)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
* **table-reservation:** enhance the schema ([5b67e2b](https://github.com/tillhub/schemas/commit/5b67e2b))
|
|
15
|
+
* **table-reservation:** enhance the schema ([#1073](https://github.com/tillhub/schemas/issues/1073)) ([cf22b9a](https://github.com/tillhub/schemas/commit/cf22b9a))
|
|
16
|
+
|
|
17
|
+
## [6.390.1](https://github.com/tillhub/schemas/compare/v6.390.0...v6.390.1) (2025-06-18)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* **UNTIL-14219:** allow table count prop for table layout v1 ([#1071](https://github.com/tillhub/schemas/issues/1071)) ([460ea09](https://github.com/tillhub/schemas/commit/460ea09))
|
|
23
|
+
|
|
1
24
|
# [6.390.0](https://github.com/tillhub/schemas/compare/v6.389.0...v6.390.0) (2025-06-05)
|
|
2
25
|
|
|
3
26
|
|
|
@@ -3,11 +3,11 @@ module.exports = {
|
|
|
3
3
|
type: 'string',
|
|
4
4
|
format: 'uuid'
|
|
5
5
|
},
|
|
6
|
-
|
|
6
|
+
layoutId: {
|
|
7
7
|
type: 'string',
|
|
8
8
|
format: 'uuid'
|
|
9
9
|
},
|
|
10
|
-
|
|
10
|
+
sortOrder: {
|
|
11
11
|
type: 'number'
|
|
12
12
|
},
|
|
13
13
|
name: {
|
|
@@ -20,16 +20,16 @@ module.exports = {
|
|
|
20
20
|
format: 'uuid'
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
|
-
|
|
23
|
+
minPartySize: {
|
|
24
24
|
type: 'number'
|
|
25
25
|
},
|
|
26
|
-
|
|
26
|
+
maxPartySize: {
|
|
27
27
|
type: 'number'
|
|
28
28
|
},
|
|
29
|
-
|
|
29
|
+
isCombination: {
|
|
30
30
|
type: 'boolean'
|
|
31
31
|
},
|
|
32
|
-
|
|
32
|
+
isBookableExternally: {
|
|
33
33
|
type: 'boolean'
|
|
34
34
|
},
|
|
35
35
|
type: {
|
|
@@ -1,56 +1,28 @@
|
|
|
1
|
+
const combinationSchema = require('./combination_schema')
|
|
2
|
+
const layoutSchema = require('./layout_schema')
|
|
1
3
|
module.exports = {
|
|
2
4
|
id: {
|
|
3
5
|
type: 'string',
|
|
4
6
|
format: 'uuid'
|
|
5
7
|
},
|
|
6
8
|
name: {
|
|
7
|
-
type: 'string'
|
|
8
|
-
minLength: 1
|
|
9
|
+
type: 'string'
|
|
9
10
|
},
|
|
10
11
|
location: {
|
|
11
12
|
type: 'string',
|
|
12
13
|
format: 'uuid'
|
|
13
14
|
},
|
|
15
|
+
gridColumnCount: {
|
|
16
|
+
type: 'number',
|
|
17
|
+
default: 5
|
|
18
|
+
},
|
|
14
19
|
active: {
|
|
15
20
|
type: 'boolean',
|
|
16
|
-
default:
|
|
17
|
-
},
|
|
18
|
-
layout: {
|
|
19
|
-
type: 'object',
|
|
20
|
-
additionalProperties: true,
|
|
21
|
-
default: {}
|
|
21
|
+
default: false
|
|
22
22
|
},
|
|
23
|
+
layout: layoutSchema,
|
|
23
24
|
combinations: {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
minItems: 0,
|
|
27
|
-
items: {
|
|
28
|
-
type: 'object',
|
|
29
|
-
properties: {
|
|
30
|
-
id: {
|
|
31
|
-
type: 'string',
|
|
32
|
-
format: 'uuid'
|
|
33
|
-
},
|
|
34
|
-
min_party_size: {
|
|
35
|
-
type: 'number',
|
|
36
|
-
minimum: 0
|
|
37
|
-
},
|
|
38
|
-
max_party_size: {
|
|
39
|
-
type: 'number',
|
|
40
|
-
minimum: 0
|
|
41
|
-
},
|
|
42
|
-
is_bookable_externally: {
|
|
43
|
-
type: 'boolean'
|
|
44
|
-
},
|
|
45
|
-
tables: {
|
|
46
|
-
type: 'array',
|
|
47
|
-
items: {
|
|
48
|
-
type: 'string',
|
|
49
|
-
format: 'uuid'
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
required: ['id', 'min_party_size', 'max_party_size', 'is_bookable_externally', 'tables']
|
|
54
|
-
}
|
|
25
|
+
...combinationSchema,
|
|
26
|
+
default: []
|
|
55
27
|
}
|
|
56
28
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
type: 'array',
|
|
3
|
+
additionalProperties: false,
|
|
4
|
+
minItems: 0,
|
|
5
|
+
items: {
|
|
6
|
+
additionalProperties: false,
|
|
7
|
+
type: 'object',
|
|
8
|
+
properties: {
|
|
9
|
+
id: {
|
|
10
|
+
type: 'string',
|
|
11
|
+
format: 'uuid'
|
|
12
|
+
},
|
|
13
|
+
minPartySize: {
|
|
14
|
+
type: 'number'
|
|
15
|
+
},
|
|
16
|
+
maxPartySize: {
|
|
17
|
+
type: 'number'
|
|
18
|
+
},
|
|
19
|
+
isBookableExternally: {
|
|
20
|
+
type: 'boolean'
|
|
21
|
+
},
|
|
22
|
+
tables: {
|
|
23
|
+
type: 'array',
|
|
24
|
+
items: {
|
|
25
|
+
type: 'string',
|
|
26
|
+
format: 'uuid'
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
// TODO: add these line to the schema: required: ['id', 'minPartySize', 'maxPartySize', 'isBookableExternally', 'tables']
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -2,8 +2,14 @@ const base = require('./base')
|
|
|
2
2
|
module.exports.request = {
|
|
3
3
|
$id: 'https://schemas.tillhub.com/v1/table_layout.create.request.schema.json',
|
|
4
4
|
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
5
|
-
additionalProperties: false
|
|
6
|
-
required: ['name', 'location', 'active'],
|
|
7
|
-
properties:
|
|
5
|
+
additionalProperties: true, // @TODO: change this to false
|
|
6
|
+
required: ['name', 'location', 'active', 'layout'],
|
|
7
|
+
properties: {
|
|
8
|
+
...base,
|
|
9
|
+
tables_count: { // @TODO: remove this field
|
|
10
|
+
type: 'number',
|
|
11
|
+
default: 0
|
|
12
|
+
}
|
|
13
|
+
},
|
|
8
14
|
type: 'object'
|
|
9
15
|
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
type: 'object',
|
|
3
|
+
default: {},
|
|
4
|
+
properties: {
|
|
5
|
+
scene: {
|
|
6
|
+
type: 'object',
|
|
7
|
+
properties: {
|
|
8
|
+
color: {
|
|
9
|
+
oneOf: [
|
|
10
|
+
{
|
|
11
|
+
type: 'string',
|
|
12
|
+
pattern: '^#[0-9A-Fa-f]{6}$' // hex color code
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
type: 'string',
|
|
16
|
+
maxLength: 0
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
width: {
|
|
21
|
+
type: 'number'
|
|
22
|
+
},
|
|
23
|
+
height: {
|
|
24
|
+
type: 'number'
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
additionalProperties: false
|
|
28
|
+
},
|
|
29
|
+
entities: {
|
|
30
|
+
type: 'array',
|
|
31
|
+
items: {
|
|
32
|
+
type: 'object',
|
|
33
|
+
properties: {
|
|
34
|
+
id: {
|
|
35
|
+
type: 'string',
|
|
36
|
+
format: 'uuid'
|
|
37
|
+
},
|
|
38
|
+
sortOrder: {
|
|
39
|
+
type: 'number'
|
|
40
|
+
},
|
|
41
|
+
type: {
|
|
42
|
+
type: 'string'
|
|
43
|
+
},
|
|
44
|
+
kind: {
|
|
45
|
+
type: 'string'
|
|
46
|
+
},
|
|
47
|
+
text: {
|
|
48
|
+
type: 'string'
|
|
49
|
+
},
|
|
50
|
+
fontSize: {
|
|
51
|
+
type: 'number'
|
|
52
|
+
},
|
|
53
|
+
image: {
|
|
54
|
+
type: 'object',
|
|
55
|
+
properties: {
|
|
56
|
+
type: {
|
|
57
|
+
type: 'string'
|
|
58
|
+
},
|
|
59
|
+
value: {
|
|
60
|
+
type: 'string'
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
width: {
|
|
65
|
+
type: 'number'
|
|
66
|
+
},
|
|
67
|
+
height: {
|
|
68
|
+
type: 'number'
|
|
69
|
+
},
|
|
70
|
+
x: {
|
|
71
|
+
type: 'number'
|
|
72
|
+
},
|
|
73
|
+
y: {
|
|
74
|
+
type: 'number'
|
|
75
|
+
},
|
|
76
|
+
rotation: {
|
|
77
|
+
type: 'number'
|
|
78
|
+
},
|
|
79
|
+
name: {
|
|
80
|
+
type: 'string'
|
|
81
|
+
},
|
|
82
|
+
color: {
|
|
83
|
+
oneOf: [
|
|
84
|
+
{
|
|
85
|
+
type: 'string',
|
|
86
|
+
pattern: '^#[0-9A-Fa-f]{6}$' // hex color code
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
type: 'string',
|
|
90
|
+
maxLength: 0
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
},
|
|
94
|
+
minPartySize: {
|
|
95
|
+
type: 'number'
|
|
96
|
+
},
|
|
97
|
+
maxPartySize: {
|
|
98
|
+
type: 'number'
|
|
99
|
+
},
|
|
100
|
+
isBookableExternally: {
|
|
101
|
+
type: 'boolean'
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
additionalProperties: false
|
|
105
|
+
},
|
|
106
|
+
required: ['id', 'type', 'x', 'y', 'width', 'height']
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
additionalProperties: false
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** @TODO: add these line to the schema :
|
|
113
|
+
* required: ['id', 'type', 'x', 'y', 'width', 'height'],
|
|
114
|
+
if: {
|
|
115
|
+
properties: {
|
|
116
|
+
type: {
|
|
117
|
+
enum: ['table', 'stool']
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
then: {
|
|
122
|
+
required: ['sortOrder', 'name', 'minPartySize', 'maxPartySize', 'isBookableExternally', 'x', 'y']
|
|
123
|
+
}
|
|
124
|
+
*/
|
|
@@ -1,7 +1,27 @@
|
|
|
1
|
-
const base = require('./base')
|
|
2
1
|
const baseObject = require('../../common/base')
|
|
3
2
|
const commonResponse = require('../../common/response')
|
|
4
3
|
const commonQuery = require('../../common/query')
|
|
4
|
+
const combinationSchema = require('./combination_schema')
|
|
5
|
+
const layoutSchema = require('./layout_schema')
|
|
6
|
+
const availableTables = require('./available_tables')
|
|
7
|
+
|
|
8
|
+
const sharedSchema = {
|
|
9
|
+
name: {
|
|
10
|
+
type: 'string',
|
|
11
|
+
minLength: 1
|
|
12
|
+
},
|
|
13
|
+
location: {
|
|
14
|
+
type: 'string',
|
|
15
|
+
format: 'uuid'
|
|
16
|
+
},
|
|
17
|
+
gridColumnCount: {
|
|
18
|
+
type: 'number'
|
|
19
|
+
},
|
|
20
|
+
active: {
|
|
21
|
+
type: 'boolean',
|
|
22
|
+
default: false
|
|
23
|
+
}
|
|
24
|
+
}
|
|
5
25
|
|
|
6
26
|
module.exports.all = {
|
|
7
27
|
query: {
|
|
@@ -23,6 +43,24 @@ module.exports.all = {
|
|
|
23
43
|
format: 'uuid'
|
|
24
44
|
}
|
|
25
45
|
},
|
|
46
|
+
include_layout: {
|
|
47
|
+
description: 'The option to include or omit the layout field from the response',
|
|
48
|
+
example: 'true',
|
|
49
|
+
type: 'string',
|
|
50
|
+
enum: ['true', 'false']
|
|
51
|
+
},
|
|
52
|
+
start: {
|
|
53
|
+
description: 'The start date and time of the period to query',
|
|
54
|
+
example: '2025-01-01T00:00:00Z',
|
|
55
|
+
type: 'string',
|
|
56
|
+
format: 'date-time'
|
|
57
|
+
},
|
|
58
|
+
active: {
|
|
59
|
+
description: 'The active status of the layout',
|
|
60
|
+
example: 'true',
|
|
61
|
+
type: 'string',
|
|
62
|
+
enum: ['true', 'false']
|
|
63
|
+
},
|
|
26
64
|
page: {
|
|
27
65
|
description: 'The page number (for paginated output)',
|
|
28
66
|
example: 3,
|
|
@@ -39,12 +77,6 @@ module.exports.all = {
|
|
|
39
77
|
description: 'Cursor field and direction for sorting query by',
|
|
40
78
|
example: '+name',
|
|
41
79
|
type: 'string'
|
|
42
|
-
},
|
|
43
|
-
include_layout: {
|
|
44
|
-
description: 'The option to include or omit the layout field from the response',
|
|
45
|
-
example: 'true',
|
|
46
|
-
type: 'string',
|
|
47
|
-
enum: ['true', 'false']
|
|
48
80
|
}
|
|
49
81
|
}
|
|
50
82
|
})
|
|
@@ -59,7 +91,21 @@ module.exports.all = {
|
|
|
59
91
|
additionalProperties: false,
|
|
60
92
|
properties: {
|
|
61
93
|
...baseObject(),
|
|
62
|
-
...
|
|
94
|
+
...sharedSchema,
|
|
95
|
+
...{
|
|
96
|
+
tablesCount: {
|
|
97
|
+
type: 'number'
|
|
98
|
+
},
|
|
99
|
+
combinationsCount: {
|
|
100
|
+
type: 'number'
|
|
101
|
+
},
|
|
102
|
+
bookableTablesCount: {
|
|
103
|
+
type: 'number'
|
|
104
|
+
},
|
|
105
|
+
bookableCombinationsCount: {
|
|
106
|
+
type: 'number'
|
|
107
|
+
}
|
|
108
|
+
}
|
|
63
109
|
}
|
|
64
110
|
}
|
|
65
111
|
})
|
|
@@ -77,7 +123,11 @@ module.exports.one = {
|
|
|
77
123
|
additionalProperties: false,
|
|
78
124
|
properties: {
|
|
79
125
|
...baseObject(),
|
|
80
|
-
...
|
|
126
|
+
...sharedSchema,
|
|
127
|
+
...{
|
|
128
|
+
combinations: combinationSchema,
|
|
129
|
+
layout: layoutSchema
|
|
130
|
+
}
|
|
81
131
|
}
|
|
82
132
|
}
|
|
83
133
|
})
|
|
@@ -95,7 +145,7 @@ module.exports.available_tables = {
|
|
|
95
145
|
additionalProperties: false,
|
|
96
146
|
properties: {
|
|
97
147
|
...baseObject(),
|
|
98
|
-
...
|
|
148
|
+
...availableTables
|
|
99
149
|
}
|
|
100
150
|
}
|
|
101
151
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tillhub/schemas",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.392.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "All Tillhub API OpenAPI 3 compatible JSON Schemas.",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -72,12 +72,11 @@
|
|
|
72
72
|
"eslint-plugin-promise": "^4.0.1",
|
|
73
73
|
"eslint-plugin-react": "^7.12.4",
|
|
74
74
|
"eslint-plugin-standard": "^4.0.0",
|
|
75
|
-
"firebase-tools": "^
|
|
75
|
+
"firebase-tools": "^11.30.0",
|
|
76
76
|
"gh-pages": "^1.2.0",
|
|
77
77
|
"glob": "^7.1.2",
|
|
78
78
|
"jsdoc": "^3.6.5",
|
|
79
79
|
"jsdoc-to-markdown": "^4.0.1",
|
|
80
|
-
"node": "^10.22.0",
|
|
81
80
|
"nodemon": "^1.18.3",
|
|
82
81
|
"nyc": "^12.0.2",
|
|
83
82
|
"proxyquire": "^2.1.0",
|
|
@@ -152,7 +151,7 @@
|
|
|
152
151
|
"publish": [
|
|
153
152
|
{
|
|
154
153
|
"path": "@semantic-release/exec",
|
|
155
|
-
"cmd": "npm run deploy:static
|
|
154
|
+
"cmd": "npm run deploy:static"
|
|
156
155
|
},
|
|
157
156
|
"@semantic-release/npm",
|
|
158
157
|
"@semantic-release/github"
|