@tillhub/schemas 6.133.0 → 6.134.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.134.0](https://github.com/tillhub/schemas/compare/v6.133.0...v6.134.0) (2022-04-05)
2
+
3
+
4
+ ### Features
5
+
6
+ * **products:** configuration ([3050bd5](https://github.com/tillhub/schemas/commit/3050bd5))
7
+
1
8
  # [6.133.0](https://github.com/tillhub/schemas/compare/v6.132.0...v6.133.0) (2022-04-01)
2
9
 
3
10
 
@@ -188,7 +188,14 @@ module.exports = {
188
188
  ]
189
189
  },
190
190
  allow_zero_prices: {
191
- description: 'If true, a product can be added to the cart with 0.0 as price or its price can be changed to 0.0.',
191
+ deprecated: true,
192
+ description: stripIndents`
193
+ If true, a product can be added to the cart with 0.0 as price or its price can be changed to 0.0.
194
+
195
+ NOTE: Hard validation will be removed entirely!
196
+ Behavior will be driven by 'v1/products.configuration.pricing.request_input'
197
+ and 'v1/products.configuration.pricing.zero_input_allowed'.
198
+ `,
192
199
  oneOf: [
193
200
  {
194
201
  type: 'null'
@@ -1,3 +1,4 @@
1
+ const { stripIndents } = require('common-tags')
1
2
  module.exports = {
2
3
  description: 'Defines various product behaviours.',
3
4
  default: {
@@ -12,6 +13,7 @@ module.exports = {
12
13
  additionalProperties: true,
13
14
  properties: {
14
15
  allow_zero_prices: {
16
+ deprecated: true,
15
17
  description: 'Allow adding this product to a cart if it has no price.',
16
18
  type: 'boolean'
17
19
  },
@@ -19,8 +21,27 @@ module.exports = {
19
21
  type: 'object',
20
22
  properties: {
21
23
  allow_is_free: {
24
+ deprecated: true,
22
25
  description: 'If an eligible price is 0 define whether the user is prompted to enter a price or whether the price can stay 0, to essentially be a freebie.',
23
26
  type: 'boolean'
27
+ },
28
+ request_input: {
29
+ type: 'boolean',
30
+ default: false,
31
+ description: stripIndents`
32
+ If true, request cashier input - regardless of the current price value, but pre-filled with it.
33
+
34
+ NOTE: If false and price is 0 - adds item with 0 price automatically.
35
+ `
36
+ },
37
+ zero_input_allowed: {
38
+ type: 'boolean',
39
+ default: false,
40
+ description: stripIndents`
41
+ Defines whether a requested price input can be confirmed with a zero value or not.
42
+
43
+ NOTE: Does not affect any zero price behavior directly, just the input validation when 'request_input'=true.
44
+ `
24
45
  }
25
46
  }
26
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tillhub/schemas",
3
- "version": "6.133.0",
3
+ "version": "6.134.0",
4
4
  "private": false,
5
5
  "description": "All Tillhub API OpenAPI 3 compatible JSON Schemas.",
6
6
  "main": "./lib/index.js",