@tillhub/schemas 6.350.0 → 6.351.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,10 @@
|
|
|
1
|
+
# [6.351.0](https://github.com/tillhub/schemas/compare/v6.350.0...v6.351.0) (2025-01-16)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **products:** gross price checking ([#1021](https://github.com/tillhub/schemas/issues/1021)) ([9b462d7](https://github.com/tillhub/schemas/commit/9b462d7))
|
|
7
|
+
|
|
1
8
|
# [6.350.0](https://github.com/tillhub/schemas/compare/v6.349.1...v6.350.0) (2025-01-14)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -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',
|