@tillhub/schemas 6.350.0 → 6.352.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 +14 -0
- package/lib/v0/gastro_orders/index.js +6 -0
- package/lib/v0/gastro_orders/locks/base.js +33 -0
- package/lib/v0/gastro_orders/locks/upsert.js +20 -0
- package/lib/v0/index.js +1 -0
- package/lib/v1/products/bulk_create_v2.js +5 -2
- package/lib/v1/products/common/price_condition.js +51 -0
- package/lib/v1/products/index.js +5 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [6.352.0](https://github.com/tillhub/schemas/compare/v6.351.0...v6.352.0) (2025-01-20)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **gastro:** crreated schema for gastro order locks ([#1022](https://github.com/tillhub/schemas/issues/1022)) ([aa2267f](https://github.com/tillhub/schemas/commit/aa2267f))
|
|
7
|
+
|
|
8
|
+
# [6.351.0](https://github.com/tillhub/schemas/compare/v6.350.0...v6.351.0) (2025-01-16)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **products:** gross price checking ([#1021](https://github.com/tillhub/schemas/issues/1021)) ([9b462d7](https://github.com/tillhub/schemas/commit/9b462d7))
|
|
14
|
+
|
|
1
15
|
# [6.350.0](https://github.com/tillhub/schemas/compare/v6.349.1...v6.350.0) (2025-01-14)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
order_id: {
|
|
3
|
+
type: 'string',
|
|
4
|
+
format: 'uuid'
|
|
5
|
+
},
|
|
6
|
+
register_id: {
|
|
7
|
+
type: 'string',
|
|
8
|
+
format: 'uuid'
|
|
9
|
+
},
|
|
10
|
+
branch_id: {
|
|
11
|
+
type: 'string',
|
|
12
|
+
format: 'uuid'
|
|
13
|
+
},
|
|
14
|
+
cashier_id: {
|
|
15
|
+
type: 'string',
|
|
16
|
+
format: 'uuid'
|
|
17
|
+
},
|
|
18
|
+
order_date: {
|
|
19
|
+
type: 'string',
|
|
20
|
+
format: 'date-time'
|
|
21
|
+
},
|
|
22
|
+
expires_at: {
|
|
23
|
+
type: 'string',
|
|
24
|
+
format: 'date-time'
|
|
25
|
+
},
|
|
26
|
+
status: {
|
|
27
|
+
type: 'string',
|
|
28
|
+
enum: ['locked', 'unlocked']
|
|
29
|
+
},
|
|
30
|
+
revision: {
|
|
31
|
+
type: 'integer'
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const base = require('./base')
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
request: {
|
|
5
|
+
$id: 'https://schemas.tillhub.com/v1/gastro_orders.locks.upsert.request.schema.json',
|
|
6
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
7
|
+
type: 'object',
|
|
8
|
+
additionalProperties: false,
|
|
9
|
+
required: ['register_id', 'branch_id', 'cashier_id', 'order_date', 'expires_at', 'status', 'revision'],
|
|
10
|
+
properties: base
|
|
11
|
+
},
|
|
12
|
+
response: {
|
|
13
|
+
$id: 'https://schemas.tillhub.com/v1/gastro_orders.locks.upsert.response.schema.json',
|
|
14
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
15
|
+
type: 'object',
|
|
16
|
+
additionalProperties: false,
|
|
17
|
+
required: ['register_id', 'branch_id', 'cashier_id', 'order_date', 'expires_at', 'status', 'revision'],
|
|
18
|
+
properties: base
|
|
19
|
+
}
|
|
20
|
+
}
|
package/lib/v0/index.js
CHANGED
|
@@ -78,5 +78,6 @@ module.exports.configurations = require('./configurations')
|
|
|
78
78
|
module.exports.service_categories = require('./service_categories')
|
|
79
79
|
module.exports.services = require('./services')
|
|
80
80
|
module.exports.shift_plan = require('./shift_plan')
|
|
81
|
+
module.exports.gastro_orders = require('./gastro_orders')
|
|
81
82
|
|
|
82
83
|
// hygen:injection - Please, don't delete this line: when running the cli for schema resources the new routes will be automatically added here.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const base = require('./base').request
|
|
2
2
|
const { oneOf } = require('../../helpers/payload-or-null')
|
|
3
|
+
const { grossPriceCondition } = require('./common/price_condition')
|
|
3
4
|
|
|
4
5
|
const productProperties = {
|
|
5
6
|
...base,
|
|
@@ -54,10 +55,12 @@ module.exports = {
|
|
|
54
55
|
'tax',
|
|
55
56
|
'type'
|
|
56
57
|
],
|
|
57
|
-
properties: productProperties
|
|
58
|
+
properties: productProperties,
|
|
59
|
+
allOf: [grossPriceCondition]
|
|
58
60
|
}
|
|
59
61
|
})
|
|
60
|
-
}
|
|
62
|
+
},
|
|
63
|
+
allOf: [grossPriceCondition]
|
|
61
64
|
}
|
|
62
65
|
}
|
|
63
66
|
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
const grossPriceCondition = {
|
|
2
|
+
if: {
|
|
3
|
+
properties: {
|
|
4
|
+
configuration: {
|
|
5
|
+
type: 'object',
|
|
6
|
+
properties: {
|
|
7
|
+
pricing: {
|
|
8
|
+
type: 'object',
|
|
9
|
+
properties: {
|
|
10
|
+
request_input: {
|
|
11
|
+
not: {
|
|
12
|
+
const: true
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
then: {
|
|
22
|
+
properties: {
|
|
23
|
+
prices: {
|
|
24
|
+
type: 'object',
|
|
25
|
+
properties: {
|
|
26
|
+
default_prices: {
|
|
27
|
+
type: 'array',
|
|
28
|
+
contains: {
|
|
29
|
+
type: 'object',
|
|
30
|
+
properties: {
|
|
31
|
+
amount: {
|
|
32
|
+
type: 'object',
|
|
33
|
+
properties: {
|
|
34
|
+
gross: {
|
|
35
|
+
type: 'number',
|
|
36
|
+
minimum: 0,
|
|
37
|
+
multipleOf: 0.01
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
required: ['gross']
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
module.exports = { grossPriceCondition }
|
package/lib/v1/products/index.js
CHANGED
|
@@ -4,6 +4,7 @@ const customizationsBase = require('./customizations').base
|
|
|
4
4
|
const priceBookBase = require('./prices/book').base
|
|
5
5
|
const priceBookEntryBase = require('./prices/book/entry').base
|
|
6
6
|
const commonResponse = require('../../common/response')
|
|
7
|
+
const { grossPriceCondition } = require('./common/price_condition')
|
|
7
8
|
|
|
8
9
|
module.exports.search = {
|
|
9
10
|
request: require('./search')
|
|
@@ -50,7 +51,8 @@ module.exports.ext = {
|
|
|
50
51
|
properties: {
|
|
51
52
|
...base.request,
|
|
52
53
|
...ext
|
|
53
|
-
}
|
|
54
|
+
},
|
|
55
|
+
allOf: [grossPriceCondition]
|
|
54
56
|
},
|
|
55
57
|
response: {
|
|
56
58
|
$id: 'https://schemas.tillhub.com/v1/products.ext.create.response.schema.json',
|
|
@@ -74,7 +76,8 @@ module.exports.ext = {
|
|
|
74
76
|
properties: {
|
|
75
77
|
...base.request,
|
|
76
78
|
...ext
|
|
77
|
-
}
|
|
79
|
+
},
|
|
80
|
+
allOf: [grossPriceCondition]
|
|
78
81
|
},
|
|
79
82
|
response: {
|
|
80
83
|
$id: 'https://schemas.tillhub.com/v1/products.ext.update.response.schema.json',
|