@tillhub/schemas 6.387.0 → 6.391.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 CHANGED
@@ -1,3 +1,39 @@
1
+ # [6.391.0](https://github.com/tillhub/schemas/compare/v6.390.1...v6.391.0) (2025-06-18)
2
+
3
+
4
+ ### Features
5
+
6
+ * **table-reservation:** enhance the schema ([5b67e2b](https://github.com/tillhub/schemas/commit/5b67e2b))
7
+ * **table-reservation:** enhance the schema ([#1073](https://github.com/tillhub/schemas/issues/1073)) ([cf22b9a](https://github.com/tillhub/schemas/commit/cf22b9a))
8
+
9
+ ## [6.390.1](https://github.com/tillhub/schemas/compare/v6.390.0...v6.390.1) (2025-06-18)
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * **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))
15
+
16
+ # [6.390.0](https://github.com/tillhub/schemas/compare/v6.389.0...v6.390.0) (2025-06-05)
17
+
18
+
19
+ ### Features
20
+
21
+ * **table_layout:** triggering build ([#1069](https://github.com/tillhub/schemas/issues/1069)) ([7741187](https://github.com/tillhub/schemas/commit/7741187))
22
+
23
+ # [6.389.0](https://github.com/tillhub/schemas/compare/v6.388.0...v6.389.0) (2025-06-05)
24
+
25
+
26
+ ### Features
27
+
28
+ * **table_layout:** fix eslint ([#1068](https://github.com/tillhub/schemas/issues/1068)) ([3f71149](https://github.com/tillhub/schemas/commit/3f71149))
29
+
30
+ # [6.388.0](https://github.com/tillhub/schemas/compare/v6.387.0...v6.388.0) (2025-06-02)
31
+
32
+
33
+ ### Features
34
+
35
+ * **table_layout:** enhance schema with new table management fields ([#1066](https://github.com/tillhub/schemas/issues/1066)) ([732015c](https://github.com/tillhub/schemas/commit/732015c))
36
+
1
37
  # [6.387.0](https://github.com/tillhub/schemas/compare/v6.386.0...v6.387.0) (2025-05-09)
2
38
 
3
39
 
@@ -0,0 +1,38 @@
1
+ module.exports = {
2
+ id: {
3
+ type: 'string',
4
+ format: 'uuid'
5
+ },
6
+ layoutId: {
7
+ type: 'string',
8
+ format: 'uuid'
9
+ },
10
+ sortOrder: {
11
+ type: 'number'
12
+ },
13
+ name: {
14
+ type: 'string'
15
+ },
16
+ parents: {
17
+ type: 'array',
18
+ items: {
19
+ type: 'string',
20
+ format: 'uuid'
21
+ }
22
+ },
23
+ minPartySize: {
24
+ type: 'number'
25
+ },
26
+ maxPartySize: {
27
+ type: 'number'
28
+ },
29
+ isCombination: {
30
+ type: 'boolean'
31
+ },
32
+ isBookableExternally: {
33
+ type: 'boolean'
34
+ },
35
+ type: {
36
+ type: 'string'
37
+ }
38
+ }
@@ -1,27 +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
  },
14
- tables_count: {
15
- type: 'integer',
16
- minimum: 0
15
+ gridColumnCount: {
16
+ type: 'number',
17
+ default: 5
17
18
  },
18
19
  active: {
19
20
  type: 'boolean',
20
- default: true
21
+ default: false
21
22
  },
22
- layout: {
23
- type: 'object',
24
- additionalProperties: true,
25
- default: {}
23
+ layout: layoutSchema,
24
+ combinations: {
25
+ ...combinationSchema,
26
+ default: []
26
27
  }
27
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
+ }
@@ -1,15 +1,15 @@
1
1
  const base = require('./base')
2
-
3
2
  module.exports.request = {
4
3
  $id: 'https://schemas.tillhub.com/v1/table_layout.create.request.schema.json',
5
4
  $schema: 'http://json-schema.org/draft-07/schema#',
6
- additionalProperties: false,
7
- required: [
8
- 'name',
9
- 'location',
10
- 'tables_count',
11
- 'active'
12
- ],
13
- properties: base,
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
+ },
14
14
  type: 'object'
15
15
  }
@@ -2,3 +2,4 @@ module.exports.create = require('./create')
2
2
  module.exports.read = require('./read')
3
3
  module.exports.update = require('./update')
4
4
  module.exports.duplicate = require('./duplicate')
5
+ module.exports.availableTables = require('./available_tables')
@@ -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
- ...base
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,29 @@ module.exports.one = {
77
123
  additionalProperties: false,
78
124
  properties: {
79
125
  ...baseObject(),
80
- ...base
126
+ ...sharedSchema,
127
+ ...{
128
+ combinations: combinationSchema,
129
+ layout: layoutSchema
130
+ }
131
+ }
132
+ }
133
+ })
134
+ }
135
+ }
136
+
137
+ module.exports.available_tables = {
138
+ response: {
139
+ $id: 'https://schemas.tillhub.com/v1/table_layout.read.available_tables.response.schema.json',
140
+ $schema: 'http://json-schema.org/draft-07/schema#',
141
+ additionalProperties: false,
142
+ ...commonResponse({
143
+ resultItems: {
144
+ type: 'object',
145
+ additionalProperties: false,
146
+ properties: {
147
+ ...baseObject(),
148
+ ...availableTables
81
149
  }
82
150
  }
83
151
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tillhub/schemas",
3
- "version": "6.387.0",
3
+ "version": "6.391.0",
4
4
  "private": false,
5
5
  "description": "All Tillhub API OpenAPI 3 compatible JSON Schemas.",
6
6
  "main": "./lib/index.js",